visual.dynamic.sampled
Class Screen

java.lang.Object
  extended by visual.Visualization
      extended by visual.dynamic.sampled.Screen
All Implemented Interfaces:
MetronomeListener
Direct Known Subclasses:
SpecialEffectsScreen

public class Screen
extends Visualization
implements MetronomeListener

A component that renders a sequence of Content objects (i.e., static visual content)

See Also:
"The Design and Implementation of Multimedia Software © 2011"

Field Summary
protected  SimpleContent currentFrame
           
protected  NullIterator<SimpleContent> currentFrameIterator
           
static int DEFAULT_FRAME_DELAY
           
protected  Metronome metronome
           
 
Constructor Summary
Screen()
          Default Constructor
Screen(int frameRate)
          Explicit Value Constructor
Screen(Metronome metronome)
          Explicit Value Constructor
 
Method Summary
 void addSuperimposition(Superimposition si)
          Add a Superimposition Note: This method does not ensure that the order is correct
 void addTransition(Transition t)
          Add a Transition Note: This method does not ensure that the order is correct
protected  VisualizationView createDefaultView()
          Create the default view associated with this Visualization Note: This method should only be called by constructors.
 int getFrameNumber()
          Get the number of the current frame
 Metronome getMetronome()
          Get the Metronome being used by this Screen
 java.util.Iterator<Superimposition> getSuperimpositions()
          Get the current superimpositions (if any)
 java.util.Iterator<Transition> getTransitions()
          Get the current transitions (if any)
 void handleTick(int time)
          Handle tick events (required by MetronomeListener) Specifically, make the current frame the "current" Content and call repaint() to start the rendering process.
 java.util.Iterator<SimpleContent> iterator()
          Get an Iterator that contains the current SimpleContent object
 java.util.Iterator<SimpleContent> iterator(boolean all)
          Get an Iterator that contains either all of the SimpleContent objects or the current SimpleContent Object
 void setRepeating(boolean repeating)
          Set whether this presentation should repeat/loop
 void start()
          Start the presentation
 void stop()
          Stop the presentation
 
Methods inherited from class visual.Visualization
add, addKeyListener, addMouseListener, addMouseMotionListener, addView, clear, getView, getViews, remove, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeView, repaint, setBackground, setView, toBack, toFront
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

metronome

protected Metronome metronome

currentFrame

protected SimpleContent currentFrame

DEFAULT_FRAME_DELAY

public static final int DEFAULT_FRAME_DELAY
See Also:
Constant Field Values

currentFrameIterator

protected NullIterator<SimpleContent> currentFrameIterator
Constructor Detail

Screen

public Screen()
Default Constructor


Screen

public Screen(int frameRate)
Explicit Value Constructor

Parameters:
frameRate - The frame rate to use

Screen

public Screen(Metronome metronome)
Explicit Value Constructor

Parameters:
metronome - The Metronome to use
Method Detail

addSuperimposition

public void addSuperimposition(Superimposition si)
Add a Superimposition Note: This method does not ensure that the order is correct

Parameters:
si - The Superimposition to add

addTransition

public void addTransition(Transition t)
Add a Transition Note: This method does not ensure that the order is correct

Parameters:
t - The Transition to add

createDefaultView

protected VisualizationView createDefaultView()
Create the default view associated with this Visualization Note: This method should only be called by constructors. It should be overridden by derived classes that need to use a specialized view

Overrides:
createDefaultView in class Visualization

getFrameNumber

public int getFrameNumber()
Get the number of the current frame

Returns:
The number of the current frame

getSuperimpositions

public java.util.Iterator<Superimposition> getSuperimpositions()
Get the current superimpositions (if any)

Returns:
The current superimpositions

getTransitions

public java.util.Iterator<Transition> getTransitions()
Get the current transitions (if any)

Returns:
The current transitions

getMetronome

public Metronome getMetronome()
Get the Metronome being used by this Screen

Returns:
The Metronome

handleTick

public void handleTick(int time)
Handle tick events (required by MetronomeListener) Specifically, make the current frame the "current" Content and call repaint() to start the rendering process.

Specified by:
handleTick in interface MetronomeListener
Parameters:
time - The current time (in millis)

iterator

public java.util.Iterator<SimpleContent> iterator()
Get an Iterator that contains the current SimpleContent object

Overrides:
iterator in class Visualization
Returns:
The Iterator (containing 0 or 1 elements)

iterator

public java.util.Iterator<SimpleContent> iterator(boolean all)
Get an Iterator that contains either all of the SimpleContent objects or the current SimpleContent Object

Parameters:
all - true to get all frames; false to get the current frame
Returns:
The SimpleContent objects

setRepeating

public void setRepeating(boolean repeating)
Set whether this presentation should repeat/loop

Parameters:
repeating - true to repeat/loop; false otherwise

start

public void start()
Start the presentation


stop

public void stop()
Stop the presentation



Design and Implementation of Multimedia Software, Jones and Bartlett Publishers