Class ncsa.horizon.awt.GuiedRoi
All Packages Class Hierarchy This Package Previous Next Index
Class ncsa.horizon.awt.GuiedRoi
java.lang.Object
|
+----java.awt.Rectangle
|
+----ncsa.horizon.awt.ROI
|
+----ncsa.horizon.awt.GuiedRoi
- public class GuiedRoi
- extends ROI
- implements Guiedable
This class is a subclass of ncsa.horizon.awt.ROI.
It adds the functionality to have a setting panel.
Client can use setting panel to set the attribute
of the ROI.
It implements ncsa.horizon.awt.Guiedable interface.
Client of this class can call getGui to get a reference
to the setting panel.
-
GuiedRoi()
-
-
GuiedRoi(Component)
-
-
GuiedRoi(int, int, Component)
- Create a ROI beginning at the specified point.
-
GuiedRoi(int, int, int, int, Component)
- Create a ROI beginning with the specified vertex and dimensions.
-
GuiedRoi(Point, Component)
- Create a ROI beginning at the specified point.
-
add(int, int)
- Adds a point to a the roi.
-
add(Point)
- Adds a point to a roi.
-
add(Rectangle)
- Adds a rectangle to a roi.
-
directionString(int)
- Translate a direction integer to a String representation.
-
drag(int, int)
- Drag this ROI to a given location.
-
draw(Graphics)
- Draw the ROI at its current location.
-
drop(int, int)
- Drop this Region Of Interest.
-
equals(Object)
- Checks whether two rois are equal.
-
getColor()
- Get the color of this ROI.
-
getGui()
- Return one element component array.
-
getRect()
- return a Rectangle to represent the Roi's
location and dimension.
-
getStyle()
- Get the style of this ROI.
-
getThickness()
- Get the current ROI line thickness.
-
grab(int, int)
- Grab this ROI in preparation for dragging or resizing.
-
grow(int, int)
- Adjust the width and height in the current direction.
-
hide()
- Hide the ROI from view.
-
inside(int, int)
- Checks if the specified point lies inside a the roi.
-
intersection(Rectangle)
- Computes the intersection of this roi and rectangle r.
-
intersects(Rectangle)
- Checks if this roi intersect with rectangle r.
-
isActive()
- Indicate whether the ROI has been completed.
-
isGrabbed()
- Indicate whether the ROI has been grabbed.
-
isInitialized()
- Indicate whether the ROI has been initialized but not completed.
-
isResizable()
- Indicates whether this ROI is resizable.
-
isVisible()
- Indicate whether the ROI is visible.
-
move(int, int)
- Move this ROI to the coordinate (x,y) in the parent's coordinate
space.
-
on(int, int, int)
- Determines if the specified (x,y) location is on or inside this
component.
-
reshape(int, int, int, int)
- Reshapes the roi.
-
resize(Dimension)
- Resize the ROI to the width and height specified by the dimension
argument.
-
resize(int, int)
- Resize the ROI to the width and height specified.
-
setColor(Color)
- Set the color for this ROI.
-
setComponent(Component)
- Set the component to attach this ROI to.
-
setResizable(boolean)
- Determines whether this ROI should be resizable.
-
setStyle(int)
- Set the style for this ROI.
-
setThickness(int)
- Set the line thickness to use.
-
show()
- Show the ROI.
-
show(boolean)
- If the boolean argument is true, makes the ROI visible.
-
size()
- return size of the ROI
-
toString()
- Returns the String representation of this Rectangle's values.
GuiedRoi
public GuiedRoi()
GuiedRoi
public GuiedRoi(Component component)
GuiedRoi
public GuiedRoi(Point p,
Component component)
- Create a ROI beginning at the specified point.
- Parameters:
- p - The point defining a vertex of the region.
- _component - The component to attach the ROI to.
GuiedRoi
public GuiedRoi(int x,
int y,
Component component)
- Create a ROI beginning at the specified point.
- Parameters:
- 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 ROI to.
GuiedRoi
public GuiedRoi(int x,
int y,
int width,
int height,
Component component)
- Create a ROI beginning with the specified vertex and dimensions.
- Parameters:
- 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 ROI to.
add
public void add(int newx,
int newy)
- Adds a point to a the roi. This results in the smallest
roi that contains both the rectangle and the point.
- Overrides:
- add in class Rectangle
add
public void add(Point pt)
- Adds a point to a roi. This results in the smallest
roi that contains both the roi and the point.
- Overrides:
- add in class Rectangle
add
public void add(Rectangle r)
- Adds a rectangle to a roi. This results in the union roi
of the roi and the rectangle.
- Overrides:
- add in class Rectangle
directionString
public String directionString(int direction)
- Translate a direction integer to a String representation.
- Parameters:
- _direction - An integer representation of a direction.
- Returns:
- A String describing the direction; "NONE" if out of bounds.
- Overrides:
- directionString in class ROI
drag
public void drag(int x,
int y)
- Drag this ROI to a given location.
- Parameters:
- _x - the x coordinate.
- _y - the y coordinate.
- Overrides:
- drag in class ROI
draw
public void draw(Graphics g)
- Draw the ROI at its current location. It is the responsibility of
the applet/application to draw the ROI at the appropriate times, e.g.,
inside the component's update() and/or paint() method. This gives
maximum flexibility for double buffering, etc.
- Parameters:
- g - The Graphics context to use for drawing.
- Overrides:
- draw in class ROI
drop
public void drop(int x,
int y)
- Drop this Region Of Interest. Depending on region state, this can
mean either finish creating a new region, ending a region move, or
ending a resize operation.
- Parameters:
- _x - The x coordinate.
- _y - The y coordinate.
- Overrides:
- drop in class ROI
getColor
public Color getColor()
- Get the color of this ROI.
- Returns:
- The Color used to draw the ROI.
- Overrides:
- getColor in class ROI
getGui
public Component[] getGui()
- Return one element component array. The only element is
the reference of the ROISettingPanel
getRect
public Rectangle getRect()
- return a Rectangle to represent the Roi's
location and dimension.
- Overrides:
- getRect in class ROI
getStyle
public int getStyle()
- Get the style of this ROI.
- Returns:
- The style of the ROI.
- Overrides:
- getStyle in class ROI
getThickness
public int getThickness()
- Get the current ROI line thickness.
- Returns:
- The thicknes of the ROI elements.
- Overrides:
- getThickness in class ROI
equals
public boolean equals(Object obj)
- Checks whether two rois are equal.
- Overrides:
- equals in class Rectangle
grab
public void grab(int x,
int y)
- Grab this ROI in preparation for dragging or resizing.
- Overrides:
- grab in class ROI
grow
public void grow(int _x,
int _y)
- Adjust the width and height in the current direction. Overrides
the superclass method to handle single-direction growth and
negative width/height.
- Parameters:
- x - The x value of the new location.
- y - The y value of the new location.
- Overrides:
- grow in class ROI
hide
public void hide()
- Hide the ROI from view.
- Overrides:
- hide in class ROI
inside
public boolean inside(int x,
int y)
- Checks if the specified point lies inside a the roi.
- Parameters:
- x - the x coordinate
- y - the y coordinate
- Overrides:
- inside in class Rectangle
intersects
public boolean intersects(Rectangle r)
- Checks if this roi intersect with rectangle r.
- Overrides:
- intersects in class Rectangle
intersection
public Rectangle intersection(Rectangle r)
- Computes the intersection of this roi and rectangle r.
- Overrides:
- intersection in class Rectangle
isActive
public boolean isActive()
- Indicate whether the ROI has been completed.
- Returns:
- boolean true if this ROI has been completed.
- Overrides:
- isActive in class ROI
isGrabbed
public boolean isGrabbed()
- Indicate whether the ROI has been grabbed.
- Returns:
- boolean true if this ROI has been grabbed; otherwise false
- Overrides:
- isGrabbed in class ROI
- See Also:
- grab, drop
isInitialized
public boolean isInitialized()
- Indicate whether the ROI has been initialized but not completed.
- Returns:
- boolean true if this ROI has been initialized but not completed.
- Overrides:
- isInitialized in class ROI
isResizable
public boolean isResizable()
- Indicates whether this ROI is resizable. By default, an ROI is resizable.
- Returns:
- true if this ROI can be resized; false otherwise
- Overrides:
- isResizable in class ROI
isVisible
public boolean isVisible()
- Indicate whether the ROI is visible.
- Returns:
- boolean true if this ROI is showing; false if it is hidden.
- Overrides:
- isVisible in class ROI
- See Also:
- show
move
public void move(int x,
int y)
- Move this ROI to the coordinate (x,y) in the parent's coordinate
space. This calls the repaint() method of the ROI's component,
which is ultimately responsible for calling the ROI's draw() method.
- Parameters:
- _x - the x coordinate
- _y - the y coordinate
- Overrides:
- move in class ROI
on
public int on(int x,
int y,
int pad)
- Determines if the specified (x,y) location is on or inside this
component. This method is used for resize or move operations on
the region.
- Parameters:
- _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 ROI for determining on-ness insideness.
- Returns:
- A direction constant indicating the postion of the (x,y)
location of the region box; otherwise 0.
- Overrides:
- on in class ROI
reshape
public void reshape(int x,
int y,
int width,
int height)
- Reshapes the roi.
- Overrides:
- reshape in class Rectangle
resize
public void resize(Dimension _dim)
- Resize the ROI to the width and height specified by the dimension
argument.
- Parameters:
- _dim - The new dimension of this ROI.
- Overrides:
- resize in class ROI
resize
public void resize(int width,
int height)
- Resize the ROI to the width and height specified.
- Parameters:
- _width - The new width of this ROI.
- _height - The new height of this ROI.
- Overrides:
- resize in class ROI
setColor
public void setColor(Color color)
- Set the color for this ROI.
- Parameters:
- _color - The Color to use to draw the ROI.
- Overrides:
- setColor in class ROI
setComponent
public void setComponent(Component component)
- Set the component to attach this ROI to.
- Parameters:
- _component - The component to attach the ROI to.
- Overrides:
- setComponent in class ROI
setResizable
public void setResizable(boolean resizable)
- Determines whether this ROI should be resizable. By default, an ROI
is resizable.
- Parameters:
- resizable - true if this ROI should be resizable; false otherwise
- Overrides:
- setResizable in class ROI
setStyle
public void setStyle(int style)
- Set the style for this ROI.
- Parameters:
- _style - The style to use for the ROI.
- Overrides:
- setStyle in class ROI
setThickness
public void setThickness(int thickness)
- Set the line thickness to use. This controls the width of the lines
that make up box- and cross-style ROIs, and the size of the center
portion of open- and bullseye-style ROIs.
- Parameters:
- _thickness - The thickness of the ROI elements.
- Overrides:
- setThickness in class ROI
show
public void show()
- Show the ROI.
- Overrides:
- show in class ROI
show
public void show(boolean cond)
- If the boolean argument is true, makes the ROI visible. If false,
makes the ROI invisible.
- Parameters:
- cond - if true, show the ROI; if false, hide the ROI.
- Overrides:
- show in class ROI
size
public Dimension size()
- return size of the ROI
- Returns:
- The current size of this ROI.
- Overrides:
- size in class ROI
toString
public String toString()
- Returns the String representation of this Rectangle's values.
- Overrides:
- toString in class Rectangle
All Packages Class Hierarchy This Package Previous Next Index