org.gicentre.utils.multisketch
Class SlideShow

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by org.gicentre.utils.multisketch.SlideShow
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class SlideShow
extends java.awt.Panel

Class for showing a sequence of Processing sketches. Can be used to construct 'powerpoint' type presentations that contain an arbitrary set of sketches. See also the Slide class for showing simple text screens as part of a slide show. Progress through the slide show is controlled with the PageUp ad PageDown keys.

Version:
3.3, 6th April, 2013.
Author:
Jo Wood, giCentre, City University London.
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SlideShow(processing.core.PApplet parent)
          Initialises the slideshow.
 
Method Summary
 void addCountdownTimer(int startTime, processing.core.PFont timerFont)
          Adds a countdown timer displayed using the given font and default size and colour to the slide show.
 void addCountdownTimer(int startTime, processing.core.PFont timerFont, int timerFontSize, int timerFontColour)
          Adds a countdown timer displayed using the given font characteristics to the slide show.
 void addSketch(EmbeddedSketch sketch)
          Adds the given sketch to the slide show.
 void addSketch(EmbeddedSketch sketch, int offset)
          Adds the given sketch to the slide show with the given offset from the top of the slide.
 void addSlide(Slide slide)
          Adds the given slide to the slide show.
 void addTimer(processing.core.PFont timerFont)
          Adds a timer to the slide show displayed with the given font but default colour and size.
 void addTimer(processing.core.PFont timerFont, int timerFontSize, int timerFontColour)
          Adds a timer to the slide show displayed using the given font characteristics.
 void displayTime(EmbeddedSketch sketch, processing.core.PFont timerFont)
          Displays the time since addTimer() was last called in the top-right corner of the given sketch.
 void keyEvent(java.awt.event.KeyEvent e)
          Deprecated. This version is for Processing 1.x only as it relies on the AWT event handling model.
 void keyEvent(processing.event.KeyEvent e)
          Controls sequence though slide show with the keys that have been allocated for advancing and retreating through slides.
 void setAdvanceKey(int advanceKey)
          Sets the key that advances the slideshow by one slide.
 void setCurrentSlide(int slideNumber)
          Sets the currently displayed slide to the given one.
 void setRetreatKey(int retreatKey)
          Sets the key that sends the slideshow back by one slide.
 void startShow()
          Starts the slide show from the first slide.
 void startShow(int slideNum)
          Starts the slide show from the given slide.
 
Methods inherited from class java.awt.Panel
addNotify, getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SlideShow

public SlideShow(processing.core.PApplet parent)
Initialises the slideshow.

Parameters:
parent - Parent sketch containing the slideshow.
Method Detail

addSketch

public void addSketch(EmbeddedSketch sketch)
Adds the given sketch to the slide show.

Parameters:
sketch - Sketch to add to the slide show.

addSketch

public void addSketch(EmbeddedSketch sketch,
                      int offset)
Adds the given sketch to the slide show with the given offset from the top of the slide.

Parameters:
sketch - Sketch to add to the slide show.
offset - Offset from top of slide in pixels.

addSlide

public void addSlide(Slide slide)
Adds the given slide to the slide show.

Parameters:
slide - Slide to add to the slide show.

addTimer

public void addTimer(processing.core.PFont timerFont)
Adds a timer to the slide show displayed with the given font but default colour and size. This results in the time since this method was last called being displayed in the top right corner of any slides in the slide show. Will not display the timer in any embedded sketches. To display the time in a sketch, call displayTime() from the draw() method of the embedded sketch.

Parameters:
timerFont - Font used to display timer.

addTimer

public void addTimer(processing.core.PFont timerFont,
                     int timerFontSize,
                     int timerFontColour)
Adds a timer to the slide show displayed using the given font characteristics. This results in the time since this method was last called being displayed in the top right corner of any slides in the slide show. Will not display the timer in any embedded sketches. To display the time in a sketch, call displayTime() from the draw() method of the embedded sketch.

Parameters:
timerFont - Font used to display timer.
timerFontSize - Size of font in pixels used to display timer.
timerFontColour - Colour of font used to display timer.

addCountdownTimer

public void addCountdownTimer(int startTime,
                              processing.core.PFont timerFont)
Adds a countdown timer displayed using the given font and default size and colour to the slide show. This results in a timer that counts down from the given start time being displayed in the top right corner of any slides in the slide show. When the timer reaches zero, the time will remain displayed as 0:00. Will not display the timer in any embedded sketches. To display the time in a sketch, call displayTime() from the draw() method of the embedded sketch.

Parameters:
startTime - Start time in seconds (e.g. to add a 2 minute countdown, this should be 120).
timerFont - Font used to display timer.

addCountdownTimer

public void addCountdownTimer(int startTime,
                              processing.core.PFont timerFont,
                              int timerFontSize,
                              int timerFontColour)
Adds a countdown timer displayed using the given font characteristics to the slide show. This results in a timer that counts down from the given start time being displayed in the top right corner of any slides in the slide show. When the timer reaches zero, the time will remain displayed as 0:00. Will not display the timer in any embedded sketches. To display the time in a sketch, call displayTime() from the draw() method of the embedded sketch.

Parameters:
startTime - Start time in seconds (e.g. to add a 2 minute countdown, this should be 120).
timerFont - Font used to display timer.
timerFontSize - Size of font in pixels used to display timer.
timerFontColour - Colour of font used to display timer.

displayTime

public void displayTime(EmbeddedSketch sketch,
                        processing.core.PFont timerFont)
Displays the time since addTimer() was last called in the top-right corner of the given sketch. Nothing will be displayed if addTimer() has not been called.

Parameters:
sketch - Sketch in which to display the time.
timerFont - Font in which to display time.

setCurrentSlide

public void setCurrentSlide(int slideNumber)
Sets the currently displayed slide to the given one.

Parameters:
slideNumber - Number of slide to display.

startShow

public void startShow()
Starts the slide show from the first slide.


startShow

public void startShow(int slideNum)
Starts the slide show from the given slide. If this is greater than the number of slides currently stored, the slide show will start from the last slide in the collection.

Parameters:
slideNum - The number of the slide from which to start.

setAdvanceKey

public void setAdvanceKey(int advanceKey)
Sets the key that advances the slideshow by one slide. The values should be one of the KeyEvent codes. The default value is KeyEvent.VK_PAGE_DOWN.

Parameters:
advanceKey - Key code corresponding to the key that will advance each slide.

setRetreatKey

public void setRetreatKey(int retreatKey)
Sets the key that sends the slideshow back by one slide. The values should be one of the KeyEvent codes. The default value is KeyEvent.VK_PAGE_UP.

Parameters:
retreatKey - Key code corresponding to the key that will move back to the previous slide.

keyEvent

public void keyEvent(java.awt.event.KeyEvent e)
Deprecated. This version is for Processing 1.x only as it relies on the AWT event handling model.

Controls sequence though slide show with the pageUp and pageDown keys.

Parameters:
e - Key press event.

keyEvent

public void keyEvent(processing.event.KeyEvent e)
Controls sequence though slide show with the keys that have been allocated for advancing and retreating through slides.

Parameters:
e - Key press event.


giCentre Utilities V.3.3, API documentation generated 6th April, 2013