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
-
AniCheckbox()
- Create an AniCheckbox.
-
AniCheckbox(Image, int, int, int, AniCheckboxGroup, boolean)
- Create an AniCheckbox from an Image and belongs to an AniCheckboxGroup.
-
AniCheckbox(Image, int, int, int, boolean)
- Create an AniCheckbox from an Image.
-
AniCheckbox(URL, int, int, int, AniCheckboxGroup, boolean)
- Create an AniCheckbox from a URL, that belongs to an AniCheckBoxGroup.
-
AniCheckbox(URL, int, int, int, boolean)
- Create an AniCheckbox from a URL.
-
getPreferredSize()
- Get the componenets preferred size.
-
getState()
- Get the current state of the checkbox.
-
goWithLeadin()
- Start the leadin animation.
-
paint(Graphics)
- Draw the component.
-
run()
- Setup the animation frames and play the clip.
-
setImage(Image, int, int, int)
- Change the animation "film strip" image.
-
setState(boolean)
- Set the state of the checkbox.
-
setStateInternal(boolean)
- Set the state of the checkbox without informing the checkbox group.
-
update(Graphics)
- Update the component.
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.
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.
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.
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.
AniCheckbox
public AniCheckbox()
- Create an AniCheckbox.
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.
paint
public void paint(Graphics g)
- Draw the component.
- Parameters:
- g - The graphics context.
- Overrides:
- paint in class Component
- See Also:
- Component
update
public void update(Graphics g)
- Update the component.
- Parameters:
- g - The graphics context.
- Overrides:
- update in class Component
- See Also:
- component
getPreferredSize
public Dimension getPreferredSize()
- Get the componenets preferred size.
Required for exact layout size.
- Overrides:
- getPreferredSize in class Component
- See Also:
- Component
getState
public boolean getState()
- Get the current state of the checkbox.
setStateInternal
public void setStateInternal(boolean s)
- Set the state of the checkbox without informing the checkbox group.
- Parameters:
- s - The new checkbox state.
setState
public void setState(boolean state)
- Set the state of the checkbox.
- Parameters:
- state - The new checkbox state.
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.
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