All Packages Class Hierarchy This Package Previous Next Index
Class dtai.gwt.ButtonGadget
java.lang.Object
|
+----dtai.gwt.Gadget
|
+----dtai.gwt.ContainerGadget
|
+----dtai.gwt.PanelGadget
|
+----dtai.gwt.BorderGadget
|
+----dtai.gwt.ClickableGadget
|
+----dtai.gwt.ButtonGadget
- public class ButtonGadget
- extends ClickableGadget
A class that produces a labeled button component.
-
image
-
-
label
-
-
ButtonGadget()
- Constructs a Button with no label.
-
ButtonGadget(Image)
- Constructs a Button with an unarmedImage.
-
ButtonGadget(Image, Image, Image, Image)
- Constructs a Button with an unarmedImage, an armedImage,
an overImage, and a disabledImage.
-
ButtonGadget(String)
- Constructs a Button with a label.
-
ButtonGadget(String, Image)
- Constructs a Button with a label and an image.
-
ButtonGadget(String, Image, Image, Image, Image)
- Constructs a Button with a label, an unarmedImage, an armedImage,
an overImage, and a disabledImage.
-
addActionListener(ActionListener)
- Adds the specified listener to be notified when component
events occur on this component.
-
click(AWTEvent)
- Processes events on this button
-
doDefaultAction(AWTEvent)
- Calls click.
-
getArmedImage()
- Gets the armedImage variable.
-
getBlackToForeground()
- Gets the blacktoForeground value.
-
getDisabledImage()
- Gets the disabledImage variable.
-
getLabel()
- Gets the label of the Button.
-
getOverImage()
- Gets the overImage variable.
-
getUnarmedImage()
- Gets the UnarmedImage variable.
-
processActionEvent(ActionEvent)
-
-
processEvent(AWTEvent)
- processEvent
-
processFocusEvent(FocusEvent)
- The shell's NormalDefaultGadget repaints (if there is one)
and the parent's handleFocusGained method is called.
-
removeActionListener(ActionListener)
- Removes the specified listener so it no longer receives
action events on this action.
-
setArmedImage(Image)
- Sets the armedImage variable.
-
setBlackToForeground(boolean)
- Set this to true if you want the black pixels to be converted to the
current foreground color.
-
setDisabledImage(Image)
- Sets the disabledImage variable.
-
setFocusAllowed(boolean)
- Sets the value of the parent's FocusAllowed variable to
the supplied value.
-
setImage(Image)
- Sets image to the supplied value.
-
setLabel(String)
- Sets the button with the specified label.
-
setMouseState(int)
- Parent's mouse state is set with the given value,
and if the parameter is ARMED or OVER the appropriate
Image is set, and for any other non-null state, the
unarmedImage is set.
-
setOverImage(Image)
- Sets the overImage variable.
-
setUnarmedImage(Image)
- Sets the unarmedImage variable.
-
toString()
- Returns the name of this Button, if it has one, else "Unmamed Button."
label
protected LabelGadget label
image
protected ImageGadget image
ButtonGadget
public ButtonGadget()
- Constructs a Button with no label.
ButtonGadget
public ButtonGadget(String label)
- Constructs a Button with a label.
- Parameters:
- label - label must be a String
ButtonGadget
public ButtonGadget(Image unarmedImage)
- Constructs a Button with an unarmedImage.
- Parameters:
- unarmedImage - the unarmedImage for the Button
ButtonGadget
public ButtonGadget(Image unarmedImage,
Image armedImage,
Image overImage,
Image disabledImage)
- Constructs a Button with an unarmedImage, an armedImage,
an overImage, and a disabledImage.
- Parameters:
- unarmedImage - the unarmedImage for the Button, null if not set
- armedImage - the armedImage for the Button, null if not set
- overImage - the overImage for the Button, null if not set
- disabledImage - the disabledImage for the Button, null if not set
ButtonGadget
public ButtonGadget(String label,
Image image)
- Constructs a Button with a label and an image.
- Parameters:
- label - the String label for the Button
- image - the image for the Button
ButtonGadget
public ButtonGadget(String label,
Image unarmedImage,
Image armedImage,
Image overImage,
Image disabledImage)
- Constructs a Button with a label, an unarmedImage, an armedImage,
an overImage, and a disabledImage.
- Parameters:
- label - the String label for the Button
- unarmedImage - the unarmedImage for the Button, null if not set
- armedImage - the armedImage for the Button, null if not set
- overImage - the overImage for the Button, null if not set
- disabledImage - the disabledImage for the Button, null if not set
toString
public String toString()
- Returns the name of this Button, if it has one, else "Unmamed Button."
- Returns:
- the name of this Button
- Overrides:
- toString in class Object
setFocusAllowed
public void setFocusAllowed(boolean focusAllowed)
- Sets the value of the parent's FocusAllowed variable to
the supplied value. If the given parameter is false,
default values are set for FocusThickness(0), DefaultThickness(0),
margins(1) and the margins of the ArmedBorder(2,2,0,0).
- Parameters:
- focusAllowed - new value for parent's focusAllowed.
- Overrides:
- setFocusAllowed in class ClickableGadget
doDefaultAction
public void doDefaultAction(AWTEvent e)
- Calls click.
- Parameters:
- e - an AWTEvent fed to method click
- Overrides:
- doDefaultAction in class Gadget
- See Also:
- click
getLabel
public String getLabel()
- Gets the label of the Button.
- Returns:
- String
- See Also:
- setLabel
setLabel
public void setLabel(String label)
- Sets the button with the specified label.
- Parameters:
- label - the label to set the button with
- See Also:
- getLabel
getUnarmedImage
public Image getUnarmedImage()
- Gets the UnarmedImage variable.
- Returns:
- Image - the UnarmedImage variable
getArmedImage
public Image getArmedImage()
- Gets the armedImage variable.
- Returns:
- Image - the armedImage variable
getOverImage
public Image getOverImage()
- Gets the overImage variable.
- Returns:
- Image - the overImage variable
getDisabledImage
public Image getDisabledImage()
- Gets the disabledImage variable.
- Returns:
- Image - the disabledImage variable
setImage
public void setImage(Image image)
- Sets image to the supplied value.
If the given Image parameter is null, this
image is set to null, and this label is removed.
- Parameters:
- image - - new value for image
setBlackToForeground
public void setBlackToForeground(boolean blackToForeground)
- Set this to true if you want the black pixels to be converted to the
current foreground color.
- Parameters:
- blackToForeground - convert/not convert
getBlackToForeground
public boolean getBlackToForeground()
- Gets the blacktoForeground value.
- Returns:
- boolean - the blacktoForeground value
setUnarmedImage
public void setUnarmedImage(Image unarmedImage)
- Sets the unarmedImage variable.
- Parameters:
- unarmedImage - - new Image for unarmedImage
setArmedImage
public void setArmedImage(Image armedImage)
- Sets the armedImage variable.
- Parameters:
- armedImage - - new Image for armedImage
setOverImage
public void setOverImage(Image overImage)
- Sets the overImage variable.
- Parameters:
- overImage - - new Image for overImage
setDisabledImage
public void setDisabledImage(Image disabledImage)
- Sets the disabledImage variable.
- Parameters:
- disabledImage - new Image for disabledImage
setMouseState
public void setMouseState(int state)
- Parent's mouse state is set with the given value,
and if the parameter is ARMED or OVER the appropriate
Image is set, and for any other non-null state, the
unarmedImage is set.
- Parameters:
- state - new mouse state
- Overrides:
- setMouseState in class ClickableGadget
addActionListener
public synchronized void addActionListener(ActionListener l)
- Adds the specified listener to be notified when component
events occur on this component.
- Parameters:
- l - the listener to receive the events
removeActionListener
public synchronized void removeActionListener(ActionListener l)
- Removes the specified listener so it no longer receives
action events on this action.
- Parameters:
- l - the listener to remove
processEvent
protected void processEvent(AWTEvent e)
- processEvent
- Parameters:
- e - a ActionEvent
- Returns:
- boolean result
- Overrides:
- processEvent in class ContainerGadget
processActionEvent
protected void processActionEvent(ActionEvent e)
click
public void click(AWTEvent mouse)
- Processes events on this button
- Parameters:
- mouse - the firing AWTEvent
- Overrides:
- click in class ClickableGadget
processFocusEvent
protected void processFocusEvent(FocusEvent e)
- The shell's NormalDefaultGadget repaints (if there is one)
and the parent's handleFocusGained method is called.
- Parameters:
- e - the firing FocusEvent
- Returns:
- boolean
- Overrides:
- processFocusEvent in class ClickableGadget
All Packages Class Hierarchy This Package Previous Next Index