[
Previous section |
Next section |
This Package |
Package List |
Table of Contents
]
Class HotSpot
public class extend.awt.HotSpot extends java.lang.Object {
public HotSpot(Rectangle, Object, int)
public void add(HotSpot)
public void chop()
public HotSpot hit(int, int)
public int getType()
public Object getReference();
}
The HotSpot class provides for a self linking list of hot spots for
detecting mouse click areas. The ability to associate a type identifier
and reference object aid in determining how to respond to a mouse event.
HotSpot
public HotSpot (Rectangle r, Object o, int i)
- This is the only constructor for the HotSpot class.
- Parameters:
r -
The rectangle which represents the window area for
this hot spot.
o -
A reference object to associate with the hot spot.
i -
An integer which can hold any value. It is usually
used to indicate a type of action. (The DataContainer uses this to, in
the Tree view, distinguish between a click on a plus/minus button vs. a
click on the item itself.
add
public void add (HotSpot h)
- This method sets the given HotSpot to the end of the list this
HotSpot is in.
- Parameters:
h -
The hot spot to add to the list.
chop
public void chop ()
- This method forces this HotSpot to be the last in its list.
hit
public HotSpot hit (int x, int y)
- This method returns the HotSpot under the given x and y
coordinates. The list of HotSpots starts with the current one. If no
hot spot was under the point, null is returned.
- Parameters:
x -
The x coordinate to search for.
y -
The y coordinate to search for.
- Returns:
- This method returns HotSpot.
getType
public int getType ()
- This method returns the type identifier provided to the
constructor.
- Returns:
- This method returns int.
getReference
public Object getReference ()
- This method returns the reference object provided to the
constructor.
- Returns:
- This method returns Object.
[
Previous section |
Next section |
This Package |
Package List |
Table of Contents
]