Class jrad.util.ImageButton
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jrad.util.ImageButton

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----jrad.util.ImageButton

public class ImageButton
extends Canvas
A class that displays a Windows 95-style image button.

Variable Index

 o actAsEnabled
Flag to see if the ImageButton is enabled.
 o downGrayImage
The image to display when the ImageButton is disabled and pressed (sticky).
 o grayImage
The image to display when the ImageButton is disabled.
 o image
The image to display.
 o mouseDown
True if the mouse is down.
 o pressed
True if the button is pressed.
 o pressedImage
The image to display when the ImageButton is pressed.
 o sticky
True if the button should act as a sticky button that toggles between up and down states.
 o tip
The tool tip to show for the button when it is contained in a ToolTipFrame or ToolTipPanel.

Constructor Index

 o ImageButton()
 o ImageButton(Image)
Constructs a new ImageButton.
 o ImageButton(Image, boolean)
Constructs a new ImageButton.
 o ImageButton(Image, Image)
Constructs a new ImageButton.
 o ImageButton(Image, Image, boolean)
Constructs a new ImageButton.
 o ImageButton(Image, Image, String)
Constructs a new ImageButton.
 o ImageButton(Image, Image, String, boolean)
Constructs a new ImageButton.
 o ImageButton(Image, String)
Constructs a new ImageButton.
 o ImageButton(Image, String, boolean)
Constructs a new ImageButton.

Method Index

 o actAsEnabled()
Returns true if the ImageButton should act enabled.
 o disable()
Disables the ImageButton.
 o enable()
Enables the ImageButton.
 o enable(boolean)
Enables or disables the ImageButton.
 o getImage()
Returns the ImageButton's image.
 o getPressedImage()
Returns the image the ImageButton displays when it is down.
 o getTip()
Returns the tool tip to show for the button when it is contained in a ToolTipFrame or ToolTipPanel.
 o hideTip()
Tell the ImageButton's parent ToolTipFrame or ToolTipPanel to hide the ImageButton's tool tip.
 o insideComponent(int, int)
Returns true if the local x and y coordinates are within the ImageButton.
 o isPressed()
Returns true if the ImageButton is in a down state.
 o isSticky()
Returns true if the ImageButton is a sticky button.
 o minimumSize()
Returns the minimum size of the ImageButton.
 o mouseDown(Event, int, int)
Press in the ImageButton when the mouse is clicked and hide its tool tip if the tool tip is showing.
 o mouseDrag(Event, int, int)
Toggle the up and down state of the ImageButton when the mouse is dragged in and out while the mouse button is pressed.
 o mouseEnter(Event, int, int)
Show the ImageButton's tool tip when the mouse enters the ImageButton.
 o mouseExit(Event, int, int)
Hide the ImageButton's tool tip when the mouse leaves the ImageButton.
 o mouseMove(Event, int, int)
Update the ImageButton's tooltip location if the mouse is moved in order to position the tool tip below the mouse when it appears.
 o mouseUp(Event, int, int)
Display the ImageButton in its standard state when the mouse is released and post an action event.
 o paint(Graphics)
Paints the ImageButton.
 o preferredSize()
Returns the preferred size of the ImageButton.
 o setActAsEnabled(boolean)
Sets the ImageButton to act as enabled.
 o setImage(Image)
Sets the ImageButton's image.
 o setPressed(boolean)
Sets the ImageButton to an up or down state.
 o setPressedImage(Image)
Sets the image the ImageButton displays when it is down.
 o setSticky(boolean)
Sets the ImageButton to a sticky or normal state.
 o setTip(String)
Sets the tool tip to show for the button when it is contained in a ToolTipFrame or ToolTipPanel.
 o showTip(int, int)
Tell the ImageButton's parent ToolTipFrame or ToolTipPanel to show the ImageButton's tool tip.
 o updateTip(int, int)
Tell the ImageButton's parent ToolTipFrame or ToolTipPanel to update the ImageButton's tool tip.

Variables

 o image
  protected Image image
The image to display.
 o pressedImage
  protected Image pressedImage
The image to display when the ImageButton is pressed.
 o grayImage
  protected Image grayImage
The image to display when the ImageButton is disabled.
 o downGrayImage
  protected Image downGrayImage
The image to display when the ImageButton is disabled and pressed (sticky).
 o pressed
  protected boolean pressed
True if the button is pressed.
 o sticky
  protected boolean sticky
True if the button should act as a sticky button that toggles between up and down states.
 o tip
  protected String tip
The tool tip to show for the button when it is contained in a ToolTipFrame or ToolTipPanel.
 o mouseDown
  protected boolean mouseDown
True if the mouse is down. Necessary since the ImageButton needs to know if the mouse is down outside of the MouseDown method.
 o actAsEnabled
  protected boolean actAsEnabled
Flag to see if the ImageButton is enabled. Necessary since the Windows 95 AWT 1.0.2 does not post a MOUSE_ENTER event when a component is disabled and the ImageButton must trap that event to display the tool tip even when it is disabled.

Constructors

 o ImageButton
  public ImageButton()
 o ImageButton
  public ImageButton(Image image)
Constructs a new ImageButton.
Parameters:
image - the image to display
 o ImageButton
  public ImageButton(Image image,
                     boolean sticky)
Constructs a new ImageButton.
Parameters:
image - the image to display
sticky - whether to act as a sticky button
 o ImageButton
  public ImageButton(Image image,
                     Image pressedImage)
Constructs a new ImageButton.
Parameters:
image - the image to display
sticky - whether to act as a sticky button
 o ImageButton
  public ImageButton(Image image,
                     Image pressedImage,
                     boolean sticky)
Constructs a new ImageButton.
Parameters:
image - the image to display
pressedImage - the image to display when the button is down
sticky - whether to act as a sticky button
 o ImageButton
  public ImageButton(Image image,
                     String tip)
Constructs a new ImageButton.
Parameters:
image - the image to display
tip - the string to display in the button's tool tip
 o ImageButton
  public ImageButton(Image image,
                     String tip,
                     boolean sticky)
Constructs a new ImageButton.
Parameters:
image - the image to display
tip - the string to display in the button's tool tip
sticky - whether to act as a sticky button
 o ImageButton
  public ImageButton(Image image,
                     Image pressedImage,
                     String tip)
Constructs a new ImageButton.
Parameters:
image - the image to display
pressedImage - the image to display when the button is down
tip - the string to display in the button's tool tip
 o ImageButton
  public ImageButton(Image image,
                     Image pressedImage,
                     String tip,
                     boolean sticky)
Constructs a new ImageButton.
Parameters:
image - the image to display
pressedImage - the image to display when the button is down
tip - the string to display in the button's tool tip
sticky - whether to act as a sticky button

Methods

 o getImage
  public Image getImage()
Returns the ImageButton's image.
 o setImage
  public void setImage(Image image)
Sets the ImageButton's image.
 o getPressedImage
  public Image getPressedImage()
Returns the image the ImageButton displays when it is down.
 o setPressedImage
  public void setPressedImage(Image pressedImage)
Sets the image the ImageButton displays when it is down.
 o isPressed
  public boolean isPressed()
Returns true if the ImageButton is in a down state.
 o setPressed
  public void setPressed(boolean pressed)
Sets the ImageButton to an up or down state.
 o isSticky
  public boolean isSticky()
Returns true if the ImageButton is a sticky button.
 o setSticky
  public void setSticky(boolean sticky)
Sets the ImageButton to a sticky or normal state.
 o actAsEnabled
  protected boolean actAsEnabled()
Returns true if the ImageButton should act enabled. Necessary since the Windows 95 AWT 1.0.2 does not post a MOUSE_ENTER event when a component is disabled and the ImageButton must trap that event to display the tool tip even when it is disabled.
 o setActAsEnabled
  protected void setActAsEnabled(boolean actAsEnabled)
Sets the ImageButton to act as enabled. Necessary since the Windows 95 AWT 1.0.2 does not post a MOUSE_ENTER event when a component is disabled and the ImageButton must trap that event to display the tool tip even when it is disabled.
 o getTip
  public String getTip()
Returns the tool tip to show for the button when it is contained in a ToolTipFrame or ToolTipPanel.
 o setTip
  public void setTip(String tip)
Sets the tool tip to show for the button when it is contained in a ToolTipFrame or ToolTipPanel.
 o minimumSize
  public Dimension minimumSize()
Returns the minimum size of the ImageButton.
Overrides:
minimumSize in class Component
 o preferredSize
  public Dimension preferredSize()
Returns the preferred size of the ImageButton.
Overrides:
preferredSize in class Component
 o showTip
  protected void showTip(int x,
                         int y)
Tell the ImageButton's parent ToolTipFrame or ToolTipPanel to show the ImageButton's tool tip.
 o updateTip
  protected void updateTip(int x,
                           int y)
Tell the ImageButton's parent ToolTipFrame or ToolTipPanel to update the ImageButton's tool tip.
 o hideTip
  protected void hideTip()
Tell the ImageButton's parent ToolTipFrame or ToolTipPanel to hide the ImageButton's tool tip.
 o paint
  public void paint(Graphics g)
Paints the ImageButton.
Overrides:
paint in class Canvas
 o mouseDown
  public boolean mouseDown(Event event,
                           int x,
                           int y)
Press in the ImageButton when the mouse is clicked and hide its tool tip if the tool tip is showing.
Overrides:
mouseDown in class Component
 o mouseUp
  public boolean mouseUp(Event event,
                         int x,
                         int y)
Display the ImageButton in its standard state when the mouse is released and post an action event.
Overrides:
mouseUp in class Component
 o mouseDrag
  public boolean mouseDrag(Event event,
                           int x,
                           int y)
Toggle the up and down state of the ImageButton when the mouse is dragged in and out while the mouse button is pressed.
Overrides:
mouseDrag in class Component
 o mouseMove
  public boolean mouseMove(Event event,
                           int x,
                           int y)
Update the ImageButton's tooltip location if the mouse is moved in order to position the tool tip below the mouse when it appears.
Overrides:
mouseMove in class Component
 o mouseEnter
  public boolean mouseEnter(Event event,
                            int x,
                            int y)
Show the ImageButton's tool tip when the mouse enters the ImageButton.
Overrides:
mouseEnter in class Component
 o mouseExit
  public boolean mouseExit(Event event,
                           int x,
                           int y)
Hide the ImageButton's tool tip when the mouse leaves the ImageButton.
Overrides:
mouseExit in class Component
 o insideComponent
  protected boolean insideComponent(int x,
                                    int y)
Returns true if the local x and y coordinates are within the ImageButton.
 o enable
  public void enable()
Enables the ImageButton.
Overrides:
enable in class Component
 o disable
  public void disable()
Disables the ImageButton.
Overrides:
disable in class Component
 o enable
  public void enable(boolean enable)
Enables or disables the ImageButton.
Overrides:
enable in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index