|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--quicktime.app.anim.TwoDSprite | +--quicktime.app.ui.UIElement | +--quicktime.app.ui.QTButton
This abstarct class provides the basic functionality for a QTButton which takes care of the event handling of the button. It also updates the button images and sets the current image of the button as the mouse enters and leaves the button. Other classes can extend this class to provide their own button behaviour. The QTButton will fire action events as defined by these subclasses. The label of the TwoDSprite will be passed on to the action listeners.
Field Summary | |
protected QTActionListener |
actionListener
The QTActionListeners that will be fired when the QTButton is activated. |
protected ImageSpec |
pressedImage
The image presented by the QTButton when it is in a pressed state. |
protected ImageSpec |
releasedImage
The image presented by the QTButton when it is in a released state. |
protected ImageSpec |
rolloverImage
If specified then the image presented by the QTButton when it is in a released state and the mouse is over the button. |
Fields inherited from class quicktime.app.ui.UIElement |
currentImage, deactiveImage |
Fields inherited from class quicktime.app.anim.TwoDSprite |
label |
Fields inherited from interface quicktime.app.display.Layerable |
kBackMostLayer |
Constructor Summary | |
protected |
QTButton(ImageSpec releasedImage,
ImageSpec pressedImage,
ImageSpec deactiveImage,
ImageSpec rolloverImage)
Sets the images of the UIElement as specified. |
protected |
QTButton(ImageSpec releasedImage,
ImageSpec pressedImage,
ImageSpec deactiveImage,
ImageSpec rolloverImage,
Matrix matrix,
int layer,
GraphicsMode mode)
Sets the images and display characteristics of the UIElement as specified. |
Method Summary | |
void |
addActionListener(QTActionListener l)
Add an QTActionListeners to this button. |
void |
addMouseTargetListener(MouseTargetListener l)
Add a MouseTargetListener for this QTButton. |
protected void |
entered(QTMouseEvent e)
This method is called by the ButtonActivator when the mouse enters the button |
protected void |
exited(QTMouseEvent e)
This method is called by the ButtonActivator when the mouse exits the button |
protected void |
fireAction()
This method is invoked by the event handling code so that any QTActionListeners actionPerformed methods are invoked. |
ImageSpec |
getDeactiveImage()
|
ImageSpec |
getPressedImage()
|
ImageSpec |
getReleasedImage()
|
ImageSpec |
getRolloverImage()
|
boolean |
isMouseInButton()
|
boolean |
isPressed()
|
void |
pressed()
Subclass provides the implementation for this method, though the subclass should ensure that super.pressed() is called. |
void |
released()
Subclass provides the implementation for this method, though the subclass should ensure that super.released() is called. |
void |
removeActionListener(QTActionListener l)
Remove an ActionListener from this button. |
void |
removeMouseTargetListener(MouseTargetListener l)
Remove a MouseTargetListener for this QTButton. |
void |
setDeactiveImage(ImageSpec image)
Sets a new image for the deactive state of the button. |
void |
setPressedImage(ImageSpec image)
Sets a new image for the pressed state of the button. |
void |
setReleasedImage(ImageSpec image)
Sets a new image for the released state of the button. |
void |
setRolloverImage(ImageSpec image)
Sets a new image for the rollover state of the button. |
Methods inherited from class quicktime.app.ui.UIElement |
addedToCompositor, getBounds, isActive, removedFromCompositor, setActive, setCurrentImage, setLocation, setSize |
Methods inherited from class quicktime.app.anim.TwoDSprite |
createSprite, equals, getDescription, getGraphicsMode, getImage, getInitialSize, getLabel, getLayer, getMatrix, getOriginalSize, getParent, getSpriteInfo, getVisible, hitTest, invalidate, isValid, notifyComplete, remove, removeNotify, setDescription, setGraphicsMode, setImage, setImageData, setLabel, setLayer, setMatrix, setNotifier, setVisible, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface quicktime.app.image.Compositable |
getGraphicsMode, setGraphicsMode |
Methods inherited from interface quicktime.app.image.ImageSpec |
getDescription, getImage |
Field Detail |
protected ImageSpec releasedImage
protected ImageSpec rolloverImage
protected ImageSpec pressedImage
protected QTActionListener actionListener
Constructor Detail |
protected QTButton(ImageSpec releasedImage, ImageSpec pressedImage, ImageSpec deactiveImage, ImageSpec rolloverImage) throws QTException
releasedImage
- will be the currentImage of the UIElementpressedImage
- will be the image shown when the QTButton is presseddeactiveImage
- will be the deactiveImage of the UIElementrolloverImage
- will be the releasedImage of the UIElement when the mouse is over the buttonprotected QTButton(ImageSpec releasedImage, ImageSpec pressedImage, ImageSpec deactiveImage, ImageSpec rolloverImage, Matrix matrix, int layer, GraphicsMode mode) throws QTException
releasedImage
- will be the currentImage of the UIElementpressedImage
- will be the image shown when the QTButton is presseddeactiveImage
- will be the deactiveImage of the UIElementrolloverImage
- will be the releasedImage of the UIElement when the mouse is over the buttonmatrix
- the display matrix properties of the UIElementlayer
- the layer in which the UIElement will be presentedmode
- the GraphicsMode of the UIElement.Method Detail |
public void released() throws QTException
public void setReleasedImage(ImageSpec image) throws QTException
image
- the new released imagepublic ImageSpec getReleasedImage()
public void setRolloverImage(ImageSpec image) throws QTException
image
- the new rollover imagepublic ImageSpec getRolloverImage()
public void setPressedImage(ImageSpec image) throws QTException
image
- the new pressed imagepublic ImageSpec getPressedImage()
public void setDeactiveImage(ImageSpec image) throws QTException
image
- the new deactive imagepublic ImageSpec getDeactiveImage()
public void pressed() throws QTException
public boolean isPressed()
public boolean isMouseInButton()
public void addActionListener(QTActionListener l)
l
- a new ActionListenerpublic void removeActionListener(QTActionListener l)
l
- a new QTActionListenerspublic void addMouseTargetListener(MouseTargetListener l)
l
- a new MouseTargetListenerpublic void removeMouseTargetListener(MouseTargetListener l)
l
- a MouseTargetListener to removeprotected void entered(QTMouseEvent e) throws QTException
protected void exited(QTMouseEvent e) throws QTException
protected void fireAction()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |