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.
-
actAsEnabled
- Flag to see if the ImageButton is enabled.
-
downGrayImage
- The image to display when the ImageButton is disabled and pressed (sticky).
-
grayImage
- The image to display when the ImageButton is disabled.
-
image
- The image to display.
-
mouseDown
- True if the mouse is down.
-
pressed
- True if the button is pressed.
-
pressedImage
- The image to display when the ImageButton is pressed.
-
sticky
- True if the button should act as a sticky button that toggles between up
and down states.
-
tip
- The tool tip to show for the button when it is contained in a ToolTipFrame
or ToolTipPanel.
-
ImageButton()
-
-
ImageButton(Image)
- Constructs a new ImageButton.
-
ImageButton(Image, boolean)
- Constructs a new ImageButton.
-
ImageButton(Image, Image)
- Constructs a new ImageButton.
-
ImageButton(Image, Image, boolean)
- Constructs a new ImageButton.
-
ImageButton(Image, Image, String)
- Constructs a new ImageButton.
-
ImageButton(Image, Image, String, boolean)
- Constructs a new ImageButton.
-
ImageButton(Image, String)
- Constructs a new ImageButton.
-
ImageButton(Image, String, boolean)
- Constructs a new ImageButton.
-
actAsEnabled()
- Returns true if the ImageButton should act enabled.
-
disable()
- Disables the ImageButton.
-
enable()
- Enables the ImageButton.
-
enable(boolean)
- Enables or disables the ImageButton.
-
getImage()
- Returns the ImageButton's image.
-
getPressedImage()
- Returns the image the ImageButton displays when it is down.
-
getTip()
- Returns the tool tip to show for the button when it is contained in a ToolTipFrame
or ToolTipPanel.
-
hideTip()
- Tell the ImageButton's parent ToolTipFrame or ToolTipPanel to hide the
ImageButton's tool tip.
-
insideComponent(int, int)
- Returns true if the local x and y coordinates are within the ImageButton.
-
isPressed()
- Returns true if the ImageButton is in a down state.
-
isSticky()
- Returns true if the ImageButton is a sticky button.
-
minimumSize()
- Returns the minimum size of the ImageButton.
-
mouseDown(Event, int, int)
- Press in the ImageButton when the mouse is clicked and hide its tool tip if the tool tip is
showing.
-
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.
-
mouseEnter(Event, int, int)
- Show the ImageButton's tool tip when the mouse enters the ImageButton.
-
mouseExit(Event, int, int)
- Hide the ImageButton's tool tip when the mouse leaves the ImageButton.
-
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.
-
mouseUp(Event, int, int)
- Display the ImageButton in its standard state when the mouse is released and
post an action event.
-
paint(Graphics)
- Paints the ImageButton.
-
preferredSize()
- Returns the preferred size of the ImageButton.
-
setActAsEnabled(boolean)
- Sets the ImageButton to act as enabled.
-
setImage(Image)
- Sets the ImageButton's image.
-
setPressed(boolean)
- Sets the ImageButton to an up or down state.
-
setPressedImage(Image)
- Sets the image the ImageButton displays when it is down.
-
setSticky(boolean)
- Sets the ImageButton to a sticky or normal state.
-
setTip(String)
- Sets the tool tip to show for the button when it is contained in a ToolTipFrame
or ToolTipPanel.
-
showTip(int, int)
- Tell the ImageButton's parent ToolTipFrame or ToolTipPanel to show the
ImageButton's tool tip.
-
updateTip(int, int)
- Tell the ImageButton's parent ToolTipFrame or ToolTipPanel to update the
ImageButton's tool tip.
image
protected Image image
- The image to display.
pressedImage
protected Image pressedImage
- The image to display when the ImageButton is pressed.
grayImage
protected Image grayImage
- The image to display when the ImageButton is disabled.
downGrayImage
protected Image downGrayImage
- The image to display when the ImageButton is disabled and pressed (sticky).
pressed
protected boolean pressed
- True if the button is pressed.
sticky
protected boolean sticky
- True if the button should act as a sticky button that toggles between up
and down states.
tip
protected String tip
- The tool tip to show for the button when it is contained in a ToolTipFrame
or ToolTipPanel.
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.
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.
ImageButton
public ImageButton()
ImageButton
public ImageButton(Image image)
- Constructs a new ImageButton.
- Parameters:
- image - the image to display
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
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
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
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
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
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
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
getImage
public Image getImage()
- Returns the ImageButton's image.
setImage
public void setImage(Image image)
- Sets the ImageButton's image.
getPressedImage
public Image getPressedImage()
- Returns the image the ImageButton displays when it is down.
setPressedImage
public void setPressedImage(Image pressedImage)
- Sets the image the ImageButton displays when it is down.
isPressed
public boolean isPressed()
- Returns true if the ImageButton is in a down state.
setPressed
public void setPressed(boolean pressed)
- Sets the ImageButton to an up or down state.
isSticky
public boolean isSticky()
- Returns true if the ImageButton is a sticky button.
setSticky
public void setSticky(boolean sticky)
- Sets the ImageButton to a sticky or normal state.
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.
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.
getTip
public String getTip()
- Returns the tool tip to show for the button when it is contained in a ToolTipFrame
or ToolTipPanel.
setTip
public void setTip(String tip)
- Sets the tool tip to show for the button when it is contained in a ToolTipFrame
or ToolTipPanel.
minimumSize
public Dimension minimumSize()
- Returns the minimum size of the ImageButton.
- Overrides:
- minimumSize in class Component
preferredSize
public Dimension preferredSize()
- Returns the preferred size of the ImageButton.
- Overrides:
- preferredSize in class Component
showTip
protected void showTip(int x,
int y)
- Tell the ImageButton's parent ToolTipFrame or ToolTipPanel to show the
ImageButton's tool tip.
updateTip
protected void updateTip(int x,
int y)
- Tell the ImageButton's parent ToolTipFrame or ToolTipPanel to update the
ImageButton's tool tip.
hideTip
protected void hideTip()
- Tell the ImageButton's parent ToolTipFrame or ToolTipPanel to hide the
ImageButton's tool tip.
paint
public void paint(Graphics g)
- Paints the ImageButton.
- Overrides:
- paint in class Canvas
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
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
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
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
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
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
insideComponent
protected boolean insideComponent(int x,
int y)
- Returns true if the local x and y coordinates are within the ImageButton.
enable
public void enable()
- Enables the ImageButton.
- Overrides:
- enable in class Component
disable
public void disable()
- Disables the ImageButton.
- Overrides:
- disable in class Component
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