All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----jcsp.awt.ActiveCanvas
|
+----demo.jcsp.ActiveImageAnimator
_______________________
configure | | event
------>----| ActiveImageAnimator |-->----
|_______________________|
_______________________________________
| ___________ ___________________ |
configure | | | | | | event
------>------| Configure | | MouseEventHandler |---->----
| |___________| |___________________| |
| |
| ActiveImageAnimator |
|_______________________________________|
The process has two CSProcess executing in Parallel, the first is the Configure process that will change the current frame depending on the Object sent down the configure Channel, the second is a MouseEventHandler that will send MouseEvents down the event Channel when the mouse is clicked etc on the component.
| Input Channels | ||
|---|---|---|
| configure | java.lang.Boolean | If the booleanValue() of the Object is true the animation will be advanced to the next frame otherwise it will be moved back to the previous frame. If wrap was true when the index hits 0 or images.length-1 the frame index will be adjusted to wrap the animation, otherwise nothing will happen. |
| java.lang.Integer | Sets the index of the current frame to the value of the Integer. The index will be adjusted so it is within 0..images.length-1. If wrap was false the index will be set to 0 if it was less than 0 or images.length-1 if it was greater than images.length-1 otherwise modulo arithmatic will be used to ensure it is in the right range. | |
| Output Channels | ||
| event | jcsp.awt.event.MouseEvent | The MouseEvent that was generated. |
public ActiveImageAnimator(ChannelInput configure,
ChannelOutput event,
Image images[],
int width,
int height)
public ActiveImageAnimator(ChannelInput configure,
ChannelOutput event,
Image images[],
int width,
int height,
boolean wrap)
public void paint(Graphics g)
public Dimension getMinimumSize()
public Dimension getPreferredSize()
public static Image[] loadImages(URL base,
String path,
String fileName,
String fileExtension,
int numFrames)
public static Image[] loadImages(URL base,
String path,
String fileName,
String fileExtension,
int numFrames,
int numPadding)
All Packages Class Hierarchy This Package Previous Next Index