visual.dynamic.sampled
Class AbstractSuperimposition

java.lang.Object
  extended by visual.dynamic.sampled.AbstractFrameOp
      extended by visual.dynamic.sampled.AbstractSuperimposition
All Implemented Interfaces:
FrameOp, Superimposition
Direct Known Subclasses:
TransformableContentSuperimposition

public abstract class AbstractSuperimposition
extends AbstractFrameOp
implements Superimposition

An abstract implementation of the Superimposition interface.

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

Field Summary
 
Fields inherited from class visual.dynamic.sampled.AbstractFrameOp
duration, first
 
Constructor Summary
AbstractSuperimposition(int first, int duration, int position)
          Explicit Value Constructor
 
Method Summary
protected  java.awt.geom.Point2D calculateRegistrationPoint(double frameWidth, double frameHeight, double siWidth, double siHeight)
          Calculate the registration point for the superimposition based on its size, the frame size, and the desired position
 int getPosition()
          Get the position Possible values: javax.SwingConstants.NORTH, NORTH_EAST, EAST, SOUTH_EAST, SOUTH, SOUTH_WEST, WEST, NORTH_WEST, or CENTER)
abstract  void postRendering(java.awt.Graphics g, int frame)
          Apply the post-rendering portion of this Superimposition
abstract  void preRendering(java.awt.Graphics g, int frame)
          Apply the pre-rendering portion of this Superimposition
 
Methods inherited from class visual.dynamic.sampled.AbstractFrameOp
getFirstFrame, getLastFrame, hasFinishedAt, shouldApplyAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface visual.dynamic.sampled.FrameOp
getFirstFrame, getLastFrame
 

Constructor Detail

AbstractSuperimposition

public AbstractSuperimposition(int first,
                               int duration,
                               int position)
Explicit Value Constructor

Parameters:
first - The first frame
duration - The duration (in frames)
position - The position
Method Detail

calculateRegistrationPoint

protected java.awt.geom.Point2D calculateRegistrationPoint(double frameWidth,
                                                           double frameHeight,
                                                           double siWidth,
                                                           double siHeight)
Calculate the registration point for the superimposition based on its size, the frame size, and the desired position

Parameters:
frameWidth - The width of the frame
frameHeight - The height of the frame
siWidth - The width of the superimposition
siHeight - The height of the superimposition

getPosition

public int getPosition()
Get the position Possible values: javax.SwingConstants.NORTH, NORTH_EAST, EAST, SOUTH_EAST, SOUTH, SOUTH_WEST, WEST, NORTH_WEST, or CENTER)

Specified by:
getPosition in interface Superimposition
Returns:
The position

postRendering

public abstract void postRendering(java.awt.Graphics g,
                                   int frame)
Apply the post-rendering portion of this Superimposition

Specified by:
postRendering in interface FrameOp
Specified by:
postRendering in class AbstractFrameOp
Parameters:
g - The rendering engine
frame - The current frame number

preRendering

public abstract void preRendering(java.awt.Graphics g,
                                  int frame)
Apply the pre-rendering portion of this Superimposition

Specified by:
preRendering in interface FrameOp
Specified by:
preRendering in class AbstractFrameOp
Parameters:
g - The rendering engine
frame - The current frame number


Design and Implementation of Multimedia Software, Jones and Bartlett Publishers