All Packages Class Hierarchy This Package Previous Next Index
Class symantec.itools.awt.ButtonBase
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----symantec.itools.awt.ButtonBase
- public class ButtonBase
- extends Canvas
ButtonBase abstract class used to implement special Symantec buttons.
It supports InfoTips, 3-D beveled borders, and the posting of continuous
notification events while the button is pressed.
An InfoTip is very small window that pops up to display a helpful
message regarding the component the mouse is over. It appears if
the mouse is held over the component for a short while.
-
bevel
- The "height" (cross-section) of a beveled edge, in pixels.
-
doInfoTip
- If true draw InfoTip during paint().
-
inButton
- True if the mouse is over this button.
-
infoTipDelay
- The delay in milliseconds till InfoTips first appear.
-
infoTipLayoutManager
- The layout manager for InfoTips.
-
infoTipText
- The text to display in the InfoTip.
-
infoTipTextColor
- The color of the text in the InfoTip.
-
infoTipTimer
- The timer used to time delay before InfoTips appear.
-
infoTipX
- The horizontal location to display the InfoTip.
-
infoTipY
- The vertical location to display the InfoTip.
-
notified
- True if a notification has been posted in response to a mouse down.
-
notifyDelay
- The delay in milliseconds between notifications while the button is pressed.
-
notifyTimer
- Timer used to time notification events while button pressed.
-
notifyWhilePressed
- If true the button will continuously post events while pressed.
-
pressed
- True if the button is currently pressed.
-
pressedAdjustment
- A drawing location adjustment for the 3-D bevel while button is pressed.
-
released
- True if the button has been released.
-
running
- True if the notify timer is running.
-
showFocus
- If true show the focus when the mouse enters the button.
-
showInfoTip
- If true an InfoTip will appear after mouse has been over the button a few moments.
-
ButtonBase()
- Constructs a default ButtonBase.
-
action(Event, Object)
- Handles internal actions for this component.
-
disable()
- Disables this component so that it doesn't respond to user input.
-
drawInfoTip()
- Determines where to draw this button's InfoTip then draws it.
-
enable()
- Enables this component so that it will respond to user input.
-
getBevelHeight()
- Returns the current "height" (cross-section) of a beveled edge, in pixels.
-
getInfoTipDelay()
- Returns the delay in milliseconds from the time the mouse enters the
button till the InfoTip is displayed
-
getInfoTipText()
- Returns the text displayed in this button's InfoTip.
-
getInfoTipTextColor()
- Returns the color of text displayed in this button's InfoTip.
-
getNotifyDelay()
- Returns the current delay in milliseconds between notification events.
-
getNotifyWhilePressed()
- Gets whether the button will continuously post events while pressed.
-
getShowFocus()
- Returns whether this button will be shown as having the focus when the mouse enters.
-
getShowInfoTip()
- Returns whether an InfoTip will appear after mouse has been over
the button a few moments.
-
mouseDown(Event, int, int)
- Processes MOUSE_DOWN events.
-
mouseEnter(Event, int, int)
- Processes MOUSE_ENTER events.
-
mouseExit(Event, int, int)
- Processes MOUSE_EXIT events.
-
mouseUp(Event, int, int)
- Processes MOUSE_UP events.
-
paint(Graphics)
- Paints this component using the given graphics context.
-
setBevelHeight(int)
- Sets the "height" (cross-section) of a beveled edge, in pixels.
-
setInfoTipDelay(int)
- Sets the delay till an InfoTip is displayed for this button.
-
setInfoTipText(String)
- Sets the text displayed in this button's InfoTip.
-
setInfoTipTextColor(Color)
- Sets the color of text displayed in this button's InfoTip.
-
setNotifyDelay(int)
- Sets the notification event delay in milliseconds.
-
setNotifyWhilePressed(boolean)
- Sets whether the button will continually post notify events while pressed.
-
setShowFocus(boolean)
- Sets whether this button will be shown as having the focus when the mouse enters.
-
setShowInfoTip(boolean)
- Sets whether an InfoTip is displayed for this button.
-
update(Graphics)
- Handles redrawing of this component on the screen.
pressed
protected boolean pressed
- True if the button is currently pressed.
released
protected boolean released
- True if the button has been released.
inButton
protected boolean inButton
- True if the mouse is over this button.
notifyWhilePressed
protected boolean notifyWhilePressed
- If true the button will continuously post events while pressed.
showInfoTip
protected boolean showInfoTip
- If true an InfoTip will appear after mouse has been over the button a few moments.
running
protected boolean running
- True if the notify timer is running.
notified
protected boolean notified
- True if a notification has been posted in response to a mouse down.
showFocus
protected boolean showFocus
- If true show the focus when the mouse enters the button.
doInfoTip
protected boolean doInfoTip
- If true draw InfoTip during paint().
bevel
protected int bevel
- The "height" (cross-section) of a beveled edge, in pixels.
notifyDelay
protected int notifyDelay
- The delay in milliseconds between notifications while the button is pressed.
infoTipDelay
protected int infoTipDelay
- The delay in milliseconds till InfoTips first appear.
pressedAdjustment
protected int pressedAdjustment
- A drawing location adjustment for the 3-D bevel while button is pressed.
infoTipText
protected String infoTipText
- The text to display in the InfoTip.
infoTipTextColor
protected Color infoTipTextColor
- The color of the text in the InfoTip.
notifyTimer
protected Timer notifyTimer
- Timer used to time notification events while button pressed.
infoTipTimer
protected Timer infoTipTimer
- The timer used to time delay before InfoTips appear.
infoTipX
protected int infoTipX
- The horizontal location to display the InfoTip.
This is measured in pixels and is relative to the position of this button.
infoTipY
protected int infoTipY
- The vertical location to display the InfoTip.
This is measured in pixels and is relative to the position of this button.
infoTipLayoutManager
protected LayoutManager infoTipLayoutManager
- The layout manager for InfoTips.
ButtonBase
protected ButtonBase()
- Constructs a default ButtonBase. The defaults are: no notifyWhilePressed,
no InfoTips, and a bevel height of 1.
setBevelHeight
public void setBevelHeight(int size)
- Sets the "height" (cross-section) of a beveled edge, in pixels.
- Parameters:
- size - the size of the bevel, in pixels
- See Also:
- getBevelHeight
getBevelHeight
public int getBevelHeight()
- Returns the current "height" (cross-section) of a beveled edge, in pixels.
- See Also:
- setBevelHeight
setNotifyWhilePressed
public void setNotifyWhilePressed(boolean f)
- Sets whether the button will continually post notify events while pressed.
- Parameters:
- f - true to post notify events; false to not post events
- See Also:
- getNotifyWhilePressed, setNotifyDelay, getNotifyDelay
getNotifyWhilePressed
public boolean getNotifyWhilePressed()
- Gets whether the button will continuously post events while pressed.
- Returns:
- true if it will continuously post events while pressed, false
otherwise
- See Also:
- setNotifyWhilePressed, setNotifyDelay, getNotifyDelay
setNotifyDelay
public void setNotifyDelay(int d)
- Sets the notification event delay in milliseconds.
- Parameters:
- d - the delay between notification events in milliseconds
- See Also:
- setNotifyWhilePressed, getNotifyDelay
getNotifyDelay
public int getNotifyDelay()
- Returns the current delay in milliseconds between notification events.
- See Also:
- setNotifyWhilePressed, setNotifyDelay
setShowInfoTip
public void setShowInfoTip(boolean f)
- Sets whether an InfoTip is displayed for this button.
- Parameters:
- f - If true an InfoTip will be displayed for this button
- See Also:
- getShowInfoTip, setInfoTipDelay, getInfoTipDelay, setInfoTipText, getInfoTipText, getInfoTipTextColor, setInfoTipTextColor
getShowInfoTip
public boolean getShowInfoTip()
- Returns whether an InfoTip will appear after mouse has been over
the button a few moments.
- See Also:
- setShowInfoTip, setInfoTipDelay, getInfoTipDelay, setInfoTipText, getInfoTipText, getInfoTipTextColor, setInfoTipTextColor
setInfoTipDelay
public void setInfoTipDelay(int d)
- Sets the delay till an InfoTip is displayed for this button.
- Parameters:
- d - the delay in milliseconds from the time the mouse enters the
button till the InfoTip is displayed
- See Also:
- setShowInfoTip, getShowInfoTip, getInfoTipDelay, setInfoTipText, getInfoTipText, getInfoTipTextColor, setInfoTipTextColor
getInfoTipDelay
public int getInfoTipDelay()
- Returns the delay in milliseconds from the time the mouse enters the
button till the InfoTip is displayed
- See Also:
- setShowInfoTip, getShowInfoTip, setInfoTipDelay, setInfoTipText, getInfoTipText, getInfoTipTextColor, setInfoTipTextColor
setShowFocus
public void setShowFocus(boolean f)
- Sets whether this button will be shown as having the focus when the mouse enters.
- Parameters:
- f - true to show focus at mouse enter; false to not show at mouse enter
- See Also:
- getShowFocus
getShowFocus
public boolean getShowFocus()
- Returns whether this button will be shown as having the focus when the mouse enters.
- See Also:
- setShowFocus
setInfoTipText
public void setInfoTipText(String t)
- Sets the text displayed in this button's InfoTip.
- Parameters:
- t - the text to display in the InfoTip
- See Also:
- setShowInfoTip, getShowInfoTip, setInfoTipDelay, getInfoTipDelay, getInfoTipText, getInfoTipTextColor, setInfoTipTextColor
getInfoTipText
public String getInfoTipText()
- Returns the text displayed in this button's InfoTip.
- See Also:
- setShowInfoTip, getShowInfoTip, setInfoTipDelay, getInfoTipDelay, setInfoTipText, getInfoTipTextColor, setInfoTipTextColor
setInfoTipTextColor
public void setInfoTipTextColor(Color c)
- Sets the color of text displayed in this button's InfoTip.
- Parameters:
- c - the color of the text displayed in the InfoTip
- See Also:
- setShowInfoTip, getShowInfoTip, setInfoTipDelay, getInfoTipDelay, setInfoTipText, getInfoTipText, getInfoTipTextColor
getInfoTipTextColor
public Color getInfoTipTextColor()
- Returns the color of text displayed in this button's InfoTip.
- See Also:
- setShowInfoTip, getShowInfoTip, setInfoTipDelay, getInfoTipDelay, setInfoTipText, getInfoTipText, setInfoTipTextColor
mouseUp
public boolean mouseUp(Event e,
int x,
int y)
- Processes MOUSE_UP events.
This is a standard Java AWT method which gets called by the AWT
method handleEvent() in response to receiving a MOUSE_UP
event. These events occur when the mouse button is released while
inside this component.
If the notification timer is running it is stopped.
If the mouse was pressed inside the button then an event is posted.
- Parameters:
- e - the event
- x - the component-relative horizontal coordinate of the mouse
- y - the component-relative vertical coordinate of the mouse
- Returns:
- always true since the event was handled
- Overrides:
- mouseUp in class Component
- See Also:
- mouseDown, handleEvent
mouseDown
public boolean mouseDown(Event e,
int x,
int y)
- Processes MOUSE_DOWN events.
This is a standard Java AWT method which gets called by the AWT
method handleEvent() in response to receiving a MOUSE_DOWN
event. These events occur when the mouse button is pressed while
inside this component.
If the notifyWhilePressed flag is true the notification Timer is started
- Parameters:
- e - the event
- x - the component-relative horizontal coordinate of the mouse
- y - the component-relative vertical coordinate of the mouse
- Returns:
- always true since the event was handled
- Overrides:
- mouseDown in class Component
- See Also:
- mouseUp, handleEvent, setNotifyWhilePressed, setNotifyDelay
mouseEnter
public boolean mouseEnter(Event e,
int x,
int y)
- Processes MOUSE_ENTER events.
This is a standard Java AWT method which gets called by the AWT
method handleEvent() in response to receiving a MOUSE_ENTER
event. These events occur when the mouse first moves over this
component.
- Parameters:
- e - the event
- x - the component-relative horizontal coordinate of the mouse
- y - the component-relative vertical coordinate of the mouse
- Returns:
- always true since the event was handled
- Overrides:
- mouseEnter in class Component
- See Also:
- mouseExit, handleEvent
mouseExit
public boolean mouseExit(Event e,
int x,
int y)
- Processes MOUSE_EXIT events.
This is a standard Java AWT method which gets called by the AWT
method handleEvent() in response to receiving a MOUSE_EXIT
event. These events occur when the mouse first leaves this
component.
- Parameters:
- e - the event
- x - the component-relative horizontal coordinate of the mouse
- y - the component-relative vertical coordinate of the mouse
- Returns:
- always true since the event was handled
- Overrides:
- mouseExit in class Component
- See Also:
- mouseEnter, handleEvent
action
public boolean action(Event e,
Object o)
- Handles internal actions for this component.
This is a standard Java AWT method which usually gets called by the AWT
method handleEvent() in response to receiving an ACTION_EVENT event. In those
cases the o parameter contains the value in the event's arg field.
- Parameters:
- e - the event that caused this action
- o - the action
- Returns:
- true if the action was handled
- Overrides:
- action in class Component
- See Also:
- handleEvent
enable
public void enable()
- Enables this component so that it will respond to user input.
This is a standard Java AWT method which gets called to enable
this component. Once enabled this component will respond to user input.
- Overrides:
- enable in class Component
- See Also:
- disable
disable
public void disable()
- Disables this component so that it doesn't respond to user input.
This is a standard Java AWT method which gets called to disable
this component. Once disabled this component will not respond to user
input.
- Overrides:
- disable in class Component
- See Also:
- enable
update
public void update(Graphics g)
- Handles redrawing of this component on the screen.
This is a standard Java AWT method which gets called by the Java
AWT (repaint()) to handle repainting this component on the screen.
The graphics context clipping region is set to the bounding rectangle
of this component and its <0,0> coordinate is this component's
top-left corner.
Typically this method paints the background color to clear the
component's drawing space, sets graphics context to be the foreground
color, and then calls paint() to draw the component.
It is overridden here to prevent the flicker associated with the standard
update() method's repainting of the background before painting the component
itself.
- Parameters:
- g - the graphics context
- Overrides:
- update in class Component
- See Also:
- repaint, paint
paint
public void paint(Graphics g)
- Paints this component using the given graphics context.
This is a standard Java AWT method which typically gets called
by the AWT to handle painting this component. It paints this component
using the given graphics context. The graphics context clipping region
is set to the bounding rectangle of this component and its <0,0>
coordinate is this component's top-left corner.
- Parameters:
- g - the graphics context used for painting
- Overrides:
- paint in class Canvas
- See Also:
- repaint, update
drawInfoTip
protected void drawInfoTip()
- Determines where to draw this button's InfoTip then draws it.
All Packages Class Hierarchy This Package Previous Next Index