| 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.RegionOfInterest
The RegionOfInterest can be created, moved, resized, etc. by calling the appropriate methods. It is up to the calling application to implement the user action interface to the routines. E.g., create the RegionOfInterest on mouse button down, extend the size on mouse drag, and return a completed RegionOfInterest on mouse up.
The RegionOfInterest 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.
| Field Summary | |
| static int | CENTER
The inside area of the bounding rectangle. |
| static int | EAST
The right edge of the bounding rectangle. |
| int | height
|
| static int | NORTHEAST
The top right vertex of the bounding rectangle. |
| static int | NORTH
The top edge of the bounding rectangle. |
| static int | NORTHWEST
The top left vertex of the bounding rectangle. |
| static int | SOUTHEAST
The bottom right vertex of the bounding rectangle. |
| static int | SOUTH
The bottom edge of the bounding rectangle. |
| static int | SOUTHWEST
The bottom left vertex of the bounding rectangle. |
| static int | WEST
The left edge of the bounding rectangle. |
| int | width
|
| int | x
|
| int | y
|
| Constructor Summary | |
| RegionOfInterest()
Create a RegionOfInterest in the default style and size. |
|
| RegionOfInterest(java.awt.Point p,
java.awt.Component _component)
Create a RegionOfInterest beginning at the specified point. |
|
| RegionOfInterest(int _x,
int _y,
java.awt.Component _component)
Create a RegionOfInterest beginning at the specified point. |
|
| RegionOfInterest(int _x,
int _y,
int _width,
int _height,
java.awt.Component _component)
Create a RegionOfInterest beginning with the specified vertex and dimensions. |
|
| RegionOfInterest(java.awt.Component _component)
Create a RegionOfInterest for a given component. |
|
| Method Summary | |
| java.lang.String | directionString(int _direction)
Translate a direction integer to a String representation. |
| void | drag(int _x,
int _y)
Drag this RegionOfInterest to a given location. |
| void | draw(java.awt.Graphics g)
Draw the RegionOfInterest at its current location. |
| void | drop(int _x,
int _y)
Drop this Region Of Interest. |
| java.awt.Color | getColor()
Get the color of this RegionOfInterest. |
| java.awt.Point | getOrigin()
get the location of the Marker. |
| java.awt.Rectangle | getRect()
return the Rectangle described by this region. |
| java.awt.Dimension | getSize()
get the size of the Marker |
| int | getStyle()
Get the style of this RegionOfInterest. |
| int | getThickness()
Get the current RegionOfInterest line thickness. |
| java.awt.Rectangle | getTrueRectangle()
return the current region as a rectable with positive length sides |
| static java.awt.Rectangle | getTrueRectangle(java.awt.Rectangle rec)
|
| void | grab(int _x,
int _y)
Grab this RegionOfInterest in preparation for dragging or resizing. |
| void | grow(int _x,
int _y)
Adjust the width and height in the current direction. |
| void | hide()
Deprecated. Hide the RegionOfInterest from view. |
| boolean | isActive()
Indicate whether the RegionOfInterest has been completed. |
| boolean | isGrabbed()
Indicate whether the RegionOfInterest has been grabbed. |
| boolean | isInitialized()
Indicate whether the RegionOfInterest has been initialized but not completed. |
| boolean | isResizable()
Indicates whether this RegionOfInterest is resizable. |
| boolean | isVisible()
Indicate whether the RegionOfInterest is visible. |
| void | move(int _x,
int _y)
Move this RegionOfInterest to the coordinate (x,y) in the parent's coordinate space. |
| int | on(int _x,
int _y,
int _pad)
Determines if the specified (x,y) location is on or inside this component. |
| void | resize(java.awt.Dimension _dim)
Deprecated. Resize the RegionOfInterest to the width and height specified by the dimension argument. |
| void | resize(int _width,
int _height)
Deprecated. Resize the RegionOfInterest to the width and height specified. |
| void | setColor(java.awt.Color _color)
Set the color for this RegionOfInterest. |
| void | setComponent(java.awt.Component _component)
Set the component to attach this RegionOfInterest to. |
| void | setOrigin(java.awt.Point p)
set the location of the Marker. |
| void | setResizable(boolean resizable)
Determines whether this RegionOfInterest should be resizable. |
| 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 RegionOfInterest. |
| void | setThickness(int _thickness)
Set the line thickness to use. |
| void | setVisible(boolean b)
set whether the region is visible |
| void | show()
Deprecated. Show the RegionOfInterest. |
| void | show(boolean cond)
Deprecated. If the boolean argument is true, makes the RegionOfInterest visible. |
| java.awt.Dimension | size()
Deprecated. Resize the RegionOfInterest 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 |
protected int x
protected int y
protected int width
protected int height
public static final int CENTER
public static final int NORTH
public static final int NORTHEAST
public static final int EAST
public static final int SOUTHEAST
public static final int SOUTH
public static final int SOUTHWEST
public static final int WEST
public static final int NORTHWEST
| Constructor Detail |
public RegionOfInterest()
public RegionOfInterest(java.awt.Point p,
java.awt.Component _component)
p
- The point defining a vertex of the region.
_component
- The component to attach the RegionOfInterest to.
public RegionOfInterest(int _x,
int _y,
java.awt.Component _component)
x
- The x value of the location of one vertex of the region.
y
- The y value of the location of one vertex of the region.
_component
- The component to attach the RegionOfInterest to.
public RegionOfInterest(int _x,
int _y,
int _width,
int _height,
java.awt.Component _component)
x
- The x value of the location of one vertex of the region.
y
- The y value of the location of one vertex of the region.
width
- The width of the region.
height
- The height of the region.
_component
- The component to attach the RegionOfInterest to.public RegionOfInterest(java.awt.Component _component)
_component
- The component to attach the RegionOfInterest to.| Method Detail |
public void draw(java.awt.Graphics g)
g
- The Graphics context to use for drawing.
public void grab(int _x,
int _y)
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 coordinatepublic void setVisible(boolean b)
public void hide()
public void show()
public void show(boolean cond)
cond
- if true, show the RegionOfInterest; if false, hide
the RegionOfInterest.
public void grow(int _x,
int _y)
x
- The x value of the new location.
y
- The y value of the new location.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 RegionOfInterest.
public void resize(int _width,
int _height)
_width
- The new width of this RegionOfInterest.
_height
- The new height of this RegionOfInterest.
public int on(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 RegionOfInterest for
determining on-ness insideness.public java.awt.Point getOrigin()
public void setOrigin(java.awt.Point p)
public java.awt.Rectangle getRect()
public boolean isInitialized()
public boolean isActive()
public boolean isVisible()
public boolean isGrabbed()
public void setComponent(java.awt.Component _component)
_component
- The component to attach the RegionOfInterest to.public void setStyle(int _style)
_style
- The style to use for the RegionOfInterest.public int getStyle()
public void setColor(java.awt.Color _color)
_color
- The Color to use to draw the RegionOfInterest.public java.awt.Color getColor()
public void setThickness(int _thickness)
_thickness
- The thickness of the RegionOfInterest elements.public int getThickness()
public boolean isResizable()
public void setResizable(boolean resizable)
resizable
- true if this RegionOfInterest should be resizable;
false otherwisepublic java.lang.String directionString(int _direction)
_direction
- An integer representation of a direction.public java.awt.Rectangle getTrueRectangle()
public static java.awt.Rectangle getTrueRectangle(java.awt.Rectangle rec)
| Overview | Package | Class | Tree | Deprecated | Index | Help | |||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||