All Packages Class Hierarchy This Package Previous Next Index
Class symantec.itools.awt.InvisibleButton
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----symantec.itools.awt.InvisibleButton
- public class InvisibleButton
- extends Canvas
- implements TransparencyTrick
Use this component to create an invisible area, usually within an image,
that initiates an action when clicked. Specifically, use InvisibleButton to
- ╖ Create a "hot spot" on an image or on a component.
- ╖ Accept or yield focus.
- ╖ Respond to a user event.
- ╖ Send an action event to another component.
Button tips:
- ╖ Buttons accept and yield focus automatically by default.
- ╖ Buttons accept clicked events automatically by default.
- ╖ To send an action event to another component, use the Interaction
Wizard. Optionally, you can override the InvisibleButtonÆs click event in
project source code.
- ╖ Overlapping components - browsers handle components layered on each
other differently. Some browsers display/layer the InvisibleButtons on top
of a particular component, while others display them underneath. Therefore,
it often requires two sets of InvisibleButtons to ensure that one is "on top";
one on top of the particular component and the other underneath.
-
pressed
- True if the button is currently pressed.
-
InvisibleButton()
- Constructs an InvisibleButton.
-
mouseDown(Event, int, int)
- Processes MOUSE_DOWN events.
-
mouseUp(Event, int, int)
- Processes MOUSE_UP events.
-
paint(Graphics)
- Paints this component using the given graphics context.
-
update(Graphics)
- Handles redrawing of this component on the screen.
pressed
protected boolean pressed
- True if the button is currently pressed.
InvisibleButton
public InvisibleButton()
- Constructs an InvisibleButton.
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.
It paints what is under the button, so as to appear invisible.
- Parameters:
- g - the graphics context used for painting
- Overrides:
- paint in class Canvas
- See Also:
- repaint, update
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.
- 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
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 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
All Packages Class Hierarchy This Package Previous Next Index