| Overview | Package | Class | Tree | Deprecated | Index | Help | |||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||
java.lang.Object | +--ncsa.horizon.awt.Marker
This allows a distinction to be made between the cursor attached to a component and the cursor used by the windowing system. The cursor can be moved and placed by pressing the mouse button while the window system cursor is "inside" the component cursor, dragging it to a new location, and releasing the mouse button.
The Marker neither generates nor receives events. It can be thought of as a simple decorational widget than knows its location and state, can draw itself given a graphics context, and can be manipulated and queried through method calls. It is the responsibility of the parent component to ask the Marker to draw/redraw itself.
| Field Summary | |
| java.awt.Color | color
|
| java.awt.Component | component
|
| java.awt.Point | grabLoc
|
| int | heightDec
|
| int | heightInc
|
| int | height
|
| static int | STATE_VISIBLE
|
| int | state
|
| static int | STYLE_BOX
A box marker. |
| static int | STYLE_BULLSEYE
A box marker with central dot. |
| static int | STYLE_CROSS
A cross (plus-sign) marker. |
| static int | STYLE_DOT
A solid block marker. |
| static int | STYLE_OPENCROSS
A cross marker with open hotspot. |
| static int | STYLE_SPANNINGCROSS
An cross marker that spans the display. |
| static int | STYLE_TERMINUS
|
| static int | STYLE_USER_ICON
A monochrome user-supplied marker. |
| static int | STYLE_USER_PIXMAP
A fixed-color user-supplied marker. |
| static int | STYLE_X
An X-shaped marker. |
| int | style
|
| int | thickness
|
| int | widthDec
|
| int | widthInc
|
| int | width
|
| int | x
The x location of the marker. |
| int | y
The y location of the marker. |
| Constructor Summary | |
| Marker()
Create a Marker in the default style and size. |
|
| Marker(int _size,
int _style)
Create a Marker with a given size and style. |
|
| Marker(java.awt.Component _component)
Create a Marker for a given component. |
|
| Method Summary | |
| void | calcDimensions()
calculate convenience values for use by other methods. |
| java.lang.Object | clone()
|
| void | drag(int x,
int y)
Drag this marker to a given location. |
| void | draw(java.awt.Graphics g)
Draw the marker at its current location. |
| void | draw(java.awt.Graphics g,
int x,
int y)
Draw the marker at a given location. |
| void | drop(int _x,
int _y)
Drop this marker. |
| java.awt.Color | getColor()
Get the color of this Marker. |
| java.awt.Point | getOrigin()
get the location of the Marker. |
| java.awt.Dimension | getSize()
get the size of the Marker |
| int | getStyle()
Get the style of this Marker. |
| int | getThickness()
Get the current marker line thickness. |
| void | grab()
Grab this marker in preparation for dragging or placing. |
| void | hide()
Deprecated. Hide the marker from view. |
| boolean | inside(int _x,
int _y)
Determines if the specified (x,y) location is inside this component. |
| boolean | inside(int _x,
int _y,
int _pad)
Determines if the specified (x,y) location is inside or close to this component. |
| boolean | isGrabbed()
Indicate whether the marker has been grabbed. |
| boolean | isVisible()
Indicate whether the marker is visible. |
| java.awt.Point | location()
The location of this Marker in its parent's coordinate space. |
| void | move(int _x,
int _y)
Move this Marker to the coordinate (x,y) in the parent's coordinate space. |
| void | redraw()
Cause a redisplay of the marker (by calling the component's repaint() method). |
| void | resize(java.awt.Dimension _dim)
Deprecated. Resize the Marker to the width and height specified by the dimension argument. |
| void | resize(int _width,
int _height)
Deprecated. Resize the Marker to the width and height specified. |
| void | setColor(java.awt.Color _color)
Set the color for this Marker. |
| void | setComponent(java.awt.Component _component)
Set the component to attach this Marker to. |
| void | setOrigin(java.awt.Point p)
set the location of the Marker. |
| void | setSize(java.awt.Dimension d)
set the size of the Marker |
| void | setSize(int width,
int height)
set the size of the Marker |
| void | setStyle(int _style)
Set the style for this Marker. |
| void | setThickness(int _thickness)
Set the line thickness to use. |
| void | setVisible(boolean b)
set whether the marker is visible |
| void | show()
Deprecated. Show the marker. |
| void | show(boolean cond)
Deprecated. If the boolean argument is true, makes the Marker visible. |
| java.awt.Dimension | size()
Deprecated. Resize the Marker to the width and height specified by the dimension |
| Methods inherited from class java.lang.Object | |
| clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait | |
| Field Detail |
public int x
public int y
protected int height
protected int width
protected int heightInc
protected int widthInc
protected int heightDec
protected int widthDec
protected int thickness
protected int style
protected java.awt.Color color
protected int state
protected java.awt.Component component
protected java.awt.Point grabLoc
public static final int STYLE_CROSS
public static final int STYLE_DOT
public static final int STYLE_BOX
public static final int STYLE_BULLSEYE
public static final int STYLE_OPENCROSS
public static final int STYLE_SPANNINGCROSS
public static final int STYLE_X
public static final int STYLE_USER_ICON
public static final int STYLE_USER_PIXMAP
protected static final int STYLE_TERMINUS
protected static final int STATE_VISIBLE
| Constructor Detail |
public Marker()
public Marker(int _size,
int _style)
_size
- The size of the marker (height and width are equal)
_style
- The style of the markerpublic Marker(java.awt.Component _component)
_component
- The component to attach the Marker to.| Method Detail |
protected void calcDimensions()
public void draw(java.awt.Graphics g)
g
- The Graphics context on which to draw the Marker.
public void draw(java.awt.Graphics g,
int x,
int y)
g
- The Graphics context on which to draw the Marker.
x
- the x location at which to draw the marker
y
- the y location at which to draw the markerpublic void grab()
public void drag(int x,
int y)
_x
- the x coordinate.
_y
- the y coordinate.
public void drop(int _x,
int _y)
_x
- The x coordinate.
_y
- The y coordinate.
public void move(int _x,
int _y)
_x
- the x coordinate
_y
- the y coordinateprotected void redraw()
public java.awt.Point getOrigin()
public void setOrigin(java.awt.Point p)
public java.awt.Point location()
public void setVisible(boolean b)
public void hide()
public void show()
public void show(boolean cond)
cond
- if true, show the Marker; if false, hide the Marker.public java.awt.Dimension getSize()
public void setSize(java.awt.Dimension d)
public void setSize(int width,
int height)
public java.awt.Dimension size()
public void resize(java.awt.Dimension _dim)
_dim
- The new dimension of this Marker.
public void resize(int _width,
int _height)
_width
- The new width of this Marker.
_height
- The new height of this Marker.
public boolean inside(int _x,
int _y)
_x
- The x coordinate
_y
- The y coordinate
public boolean inside(int _x,
int _y,
int _pad)
_x
- The x coordinate
_y
- The y coordinate
_pad
- The pad value. This amount is added to each side of
the bounding box of the marker for determining insideness.public boolean isVisible()
public boolean isGrabbed()
public void setComponent(java.awt.Component _component)
_component
- The component to attach the Marker to.public void setStyle(int _style)
_style
- The style to use for the marker.public int getStyle()
public void setColor(java.awt.Color _color)
_color
- The Color to use to draw the marker.public java.awt.Color getColor()
public void setThickness(int _thickness)
int
- The thickness of the marker elements.public int getThickness()
public java.lang.Object clone()
| Overview | Package | Class | Tree | Deprecated | Index | Help | |||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||