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.


Variable Index

 o bevel
The "height" (cross-section) of a beveled edge, in pixels.
 o doInfoTip
If true draw InfoTip during paint().
 o inButton
True if the mouse is over this button.
 o infoTipDelay
The delay in milliseconds till InfoTips first appear.
 o infoTipLayoutManager
The layout manager for InfoTips.
 o infoTipText
The text to display in the InfoTip.
 o infoTipTextColor
The color of the text in the InfoTip.
 o infoTipTimer
The timer used to time delay before InfoTips appear.
 o infoTipX
The horizontal location to display the InfoTip.
 o infoTipY
The vertical location to display the InfoTip.
 o notified
True if a notification has been posted in response to a mouse down.
 o notifyDelay
The delay in milliseconds between notifications while the button is pressed.
 o notifyTimer
Timer used to time notification events while button pressed.
 o notifyWhilePressed
If true the button will continuously post events while pressed.
 o pressed
True if the button is currently pressed.
 o pressedAdjustment
A drawing location adjustment for the 3-D bevel while button is pressed.
 o released
True if the button has been released.
 o running
True if the notify timer is running.
 o showFocus
If true show the focus when the mouse enters the button.
 o showInfoTip
If true an InfoTip will appear after mouse has been over the button a few moments.

Constructor Index

 o ButtonBase()
Constructs a default ButtonBase.

Method Index

 o action(Event, Object)
Handles internal actions for this component.
 o disable()
Disables this component so that it doesn't respond to user input.
 o drawInfoTip()
Determines where to draw this button's InfoTip then draws it.
 o enable()
Enables this component so that it will respond to user input.
 o getBevelHeight()
Returns the current "height" (cross-section) of a beveled edge, in pixels.
 o getInfoTipDelay()
Returns the delay in milliseconds from the time the mouse enters the button till the InfoTip is displayed
 o getInfoTipText()
Returns the text displayed in this button's InfoTip.
 o getInfoTipTextColor()
Returns the color of text displayed in this button's InfoTip.
 o getNotifyDelay()
Returns the current delay in milliseconds between notification events.
 o getNotifyWhilePressed()
Gets whether the button will continuously post events while pressed.
 o getShowFocus()
Returns whether this button will be shown as having the focus when the mouse enters.
 o getShowInfoTip()
Returns whether an InfoTip will appear after mouse has been over the button a few moments.
 o mouseDown(Event, int, int)
Processes MOUSE_DOWN events.
 o mouseEnter(Event, int, int)
Processes MOUSE_ENTER events.
 o mouseExit(Event, int, int)
Processes MOUSE_EXIT events.
 o mouseUp(Event, int, int)
Processes MOUSE_UP events.
 o paint(Graphics)
Paints this component using the given graphics context.
 o setBevelHeight(int)
Sets the "height" (cross-section) of a beveled edge, in pixels.
 o setInfoTipDelay(int)
Sets the delay till an InfoTip is displayed for this button.
 o setInfoTipText(String)
Sets the text displayed in this button's InfoTip.
 o setInfoTipTextColor(Color)
Sets the color of text displayed in this button's InfoTip.
 o setNotifyDelay(int)
Sets the notification event delay in milliseconds.
 o setNotifyWhilePressed(boolean)
Sets whether the button will continually post notify events while pressed.
 o setShowFocus(boolean)
Sets whether this button will be shown as having the focus when the mouse enters.
 o setShowInfoTip(boolean)
Sets whether an InfoTip is displayed for this button.
 o update(Graphics)
Handles redrawing of this component on the screen.

Variables

 o pressed
  protected boolean pressed
True if the button is currently pressed.

 o released
  protected boolean released
True if the button has been released.

 o inButton
  protected boolean inButton
True if the mouse is over this button.

 o notifyWhilePressed
  protected boolean notifyWhilePressed
If true the button will continuously post events while pressed.

 o showInfoTip
  protected boolean showInfoTip
If true an InfoTip will appear after mouse has been over the button a few moments.

 o running
  protected boolean running
True if the notify timer is running.

 o notified
  protected boolean notified
True if a notification has been posted in response to a mouse down.

 o showFocus
  protected boolean showFocus
If true show the focus when the mouse enters the button.

 o doInfoTip
  protected boolean doInfoTip
If true draw InfoTip during paint().

 o bevel
  protected int bevel
The "height" (cross-section) of a beveled edge, in pixels.

 o notifyDelay
  protected int notifyDelay
The delay in milliseconds between notifications while the button is pressed.

 o infoTipDelay
  protected int infoTipDelay
The delay in milliseconds till InfoTips first appear.

 o pressedAdjustment
  protected int pressedAdjustment
A drawing location adjustment for the 3-D bevel while button is pressed.

 o infoTipText
  protected String infoTipText
The text to display in the InfoTip.

 o infoTipTextColor
  protected Color infoTipTextColor
The color of the text in the InfoTip.

 o notifyTimer
  protected Timer notifyTimer
Timer used to time notification events while button pressed.

 o infoTipTimer
  protected Timer infoTipTimer
The timer used to time delay before InfoTips appear.

 o 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.

 o 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.

 o infoTipLayoutManager
  protected LayoutManager infoTipLayoutManager
The layout manager for InfoTips.

Constructors

 o ButtonBase
  protected ButtonBase()
Constructs a default ButtonBase. The defaults are: no notifyWhilePressed, no InfoTips, and a bevel height of 1.

Methods

 o 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
 o getBevelHeight
  public int getBevelHeight()
Returns the current "height" (cross-section) of a beveled edge, in pixels.

See Also:
setBevelHeight
 o 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
 o 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
 o 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
 o getNotifyDelay
  public int getNotifyDelay()
Returns the current delay in milliseconds between notification events.

See Also:
setNotifyWhilePressed, setNotifyDelay
 o 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
 o 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
 o 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
 o 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
 o 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
 o getShowFocus
  public boolean getShowFocus()
Returns whether this button will be shown as having the focus when the mouse enters.

See Also:
setShowFocus
 o 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
 o getInfoTipText
  public String getInfoTipText()
Returns the text displayed in this button's InfoTip.

See Also:
setShowInfoTip, getShowInfoTip, setInfoTipDelay, getInfoTipDelay, setInfoTipText, getInfoTipTextColor, setInfoTipTextColor
 o 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
 o getInfoTipTextColor
  public Color getInfoTipTextColor()
Returns the color of text displayed in this button's InfoTip.

See Also:
setShowInfoTip, getShowInfoTip, setInfoTipDelay, getInfoTipDelay, setInfoTipText, getInfoTipText, setInfoTipTextColor
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o drawInfoTip
  protected void drawInfoTip()
Determines where to draw this button's InfoTip then draws it.


All Packages  Class Hierarchy  This Package  Previous  Next  Index