All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ca.bc.europa.awt.AniCheckbox

java.lang.Object
   |
   +----java.awt.Component
           |
           +----ca.bc.europa.awt.AniCheckbox

public class AniCheckbox
extends Component
implements Runnable

The AniCheckbox class has the same functionality as the java.awt.Checkbox class.

It creates a series of images from a "film strip" image, where the frames are laid out from left to right. The images are animated to reflect the "true" state and the first image is displayed, statically, to represent the "false" state.

It provides its own mouse listener to control the state change and can be used in a group configuration using the AniCheckboxGroup.

Example Film Strip:

See Also:
Component, Runnable, AniCheckboxGroup

Constructor Index

 o AniCheckbox()
Create an AniCheckbox.
 o AniCheckbox(Image, int, int, int, AniCheckboxGroup, boolean)
Create an AniCheckbox from an Image and belongs to an AniCheckboxGroup.
 o AniCheckbox(Image, int, int, int, boolean)
Create an AniCheckbox from an Image.
 o AniCheckbox(URL, int, int, int, AniCheckboxGroup, boolean)
Create an AniCheckbox from a URL, that belongs to an AniCheckBoxGroup.
 o AniCheckbox(URL, int, int, int, boolean)
Create an AniCheckbox from a URL.

Method Index

 o getPreferredSize()
Get the componenets preferred size.
 o getState()
Get the current state of the checkbox.
 o goWithLeadin()
Start the leadin animation.
 o paint(Graphics)
Draw the component.
 o run()
Setup the animation frames and play the clip.
 o setImage(Image, int, int, int)
Change the animation "film strip" image.
 o setState(boolean)
Set the state of the checkbox.
 o setStateInternal(boolean)
Set the state of the checkbox without informing the checkbox group.
 o update(Graphics)
Update the component.

Constructors

 o AniCheckbox
 public AniCheckbox(URL theURL,
                    int w,
                    int h,
                    int count,
                    boolean initState)
Create an AniCheckbox from a URL.

Parameters:
theURL - A URL to the "film strip" image. An image with animation frames laid out from left to right.
w - The component width.
h - The component height.
count - The number of frames in the "film strip" image.
initState - The initial state of the checkbox, checked = true.
 o AniCheckbox
 public AniCheckbox(URL theURL,
                    int w,
                    int h,
                    int count,
                    AniCheckboxGroup g,
                    boolean initState)
Create an AniCheckbox from a URL, that belongs to an AniCheckBoxGroup.

Parameters:
theURL - A URL to the "film strip" image. An image with animation frames laid out from left to right.
w - The component width.
h - The component height.
count - The number of frames in the "film strip" image.
g - An AniCheckBoxGroup that this checkbox belongs to.
initState - The initial state of the checkbox, checked = true.
 o AniCheckbox
 public AniCheckbox(Image image,
                    int w,
                    int h,
                    int count,
                    boolean initState)
Create an AniCheckbox from an Image.

Parameters:
image - A "film strip" image. An image with animation frames laid out from left to right.
w - The component width.
h - The component height.
count - The number of frames in the "film strip" image.
initState - The initial state of the checkbox, checked = true.
 o AniCheckbox
 public AniCheckbox(Image image,
                    int w,
                    int h,
                    int count,
                    AniCheckboxGroup g,
                    boolean initState)
Create an AniCheckbox from an Image and belongs to an AniCheckboxGroup.

Parameters:
image - A "film strip" image. An image with animation frames laid out from left to right.
w - The component width.
h - The component height.
count - The number of frames in the "film strip" image.
g - An AniCheckBoxGroup that this checkbox belongs to.
initState - The initial state of the checkbox, checked = true.
 o AniCheckbox
 public AniCheckbox()
Create an AniCheckbox.

Methods

 o setImage
 public void setImage(Image image,
                      int w,
                      int h,
                      int count)
Change the animation "film strip" image.

Parameters:
image - The new film strip.
w - The frame width.
h - The frame height.
count - The number of frames.
 o paint
 public void paint(Graphics g)
Draw the component.

Parameters:
g - The graphics context.
Overrides:
paint in class Component
See Also:
Component
 o update
 public void update(Graphics g)
Update the component.

Parameters:
g - The graphics context.
Overrides:
update in class Component
See Also:
component
 o getPreferredSize
 public Dimension getPreferredSize()
Get the componenets preferred size. Required for exact layout size.

Overrides:
getPreferredSize in class Component
See Also:
Component
 o getState
 public boolean getState()
Get the current state of the checkbox.

 o setStateInternal
 public void setStateInternal(boolean s)
Set the state of the checkbox without informing the checkbox group.

Parameters:
s - The new checkbox state.
 o setState
 public void setState(boolean state)
Set the state of the checkbox.

Parameters:
state - The new checkbox state.
 o goWithLeadin
 public void goWithLeadin()
Start the leadin animation. This can be used to delay display of the checkbox until an appropriate time. This allows the caller to entertain the user during creation of the interface.

 o run
 public synchronized void run()
Setup the animation frames and play the clip.

See Also:
Runnable

All Packages  Class Hierarchy  This Package  Previous  Next  Index