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.

Constructor Index

 o GuiedRoi()
 o GuiedRoi(Component)
 o GuiedRoi(int, int, Component)
Create a ROI beginning at the specified point.
 o GuiedRoi(int, int, int, int, Component)
Create a ROI beginning with the specified vertex and dimensions.
 o GuiedRoi(Point, Component)
Create a ROI beginning at the specified point.

Method Index

 o add(int, int)
Adds a point to a the roi.
 o add(Point)
Adds a point to a roi.
 o add(Rectangle)
Adds a rectangle to a roi.
 o directionString(int)
Translate a direction integer to a String representation.
 o drag(int, int)
Drag this ROI to a given location.
 o draw(Graphics)
Draw the ROI at its current location.
 o drop(int, int)
Drop this Region Of Interest.
 o equals(Object)
Checks whether two rois are equal.
 o getColor()
Get the color of this ROI.
 o getGui()
Return one element component array.
 o getRect()
return a Rectangle to represent the Roi's location and dimension.
 o getStyle()
Get the style of this ROI.
 o getThickness()
Get the current ROI line thickness.
 o grab(int, int)
Grab this ROI in preparation for dragging or resizing.
 o grow(int, int)
Adjust the width and height in the current direction.
 o hide()
Hide the ROI from view.
 o inside(int, int)
Checks if the specified point lies inside a the roi.
 o intersection(Rectangle)
Computes the intersection of this roi and rectangle r.
 o intersects(Rectangle)
Checks if this roi intersect with rectangle r.
 o isActive()
Indicate whether the ROI has been completed.
 o isGrabbed()
Indicate whether the ROI has been grabbed.
 o isInitialized()
Indicate whether the ROI has been initialized but not completed.
 o isResizable()
Indicates whether this ROI is resizable.
 o isVisible()
Indicate whether the ROI is visible.
 o move(int, int)
Move this ROI to the coordinate (x,y) in the parent's coordinate space.
 o on(int, int, int)
Determines if the specified (x,y) location is on or inside this component.
 o reshape(int, int, int, int)
Reshapes the roi.
 o resize(Dimension)
Resize the ROI to the width and height specified by the dimension argument.
 o resize(int, int)
Resize the ROI to the width and height specified.
 o setColor(Color)
Set the color for this ROI.
 o setComponent(Component)
Set the component to attach this ROI to.
 o setResizable(boolean)
Determines whether this ROI should be resizable.
 o setStyle(int)
Set the style for this ROI.
 o setThickness(int)
Set the line thickness to use.
 o show()
Show the ROI.
 o show(boolean)
If the boolean argument is true, makes the ROI visible.
 o size()
return size of the ROI
 o toString()
Returns the String representation of this Rectangle's values.

Constructors

 o GuiedRoi
  public GuiedRoi()
 o GuiedRoi
  public GuiedRoi(Component component)
 o 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.
 o 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.
 o 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.

Methods

 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o getColor
  public Color getColor()
Get the color of this ROI.
Returns:
The Color used to draw the ROI.
Overrides:
getColor in class ROI
 o getGui
  public Component[] getGui()
Return one element component array. The only element is the reference of the ROISettingPanel
 o getRect
  public Rectangle getRect()
return a Rectangle to represent the Roi's location and dimension.
Overrides:
getRect in class ROI
 o getStyle
  public int getStyle()
Get the style of this ROI.
Returns:
The style of the ROI.
Overrides:
getStyle in class ROI
 o getThickness
  public int getThickness()
Get the current ROI line thickness.
Returns:
The thicknes of the ROI elements.
Overrides:
getThickness in class ROI
 o equals
  public boolean equals(Object obj)
Checks whether two rois are equal.
Overrides:
equals in class Rectangle
 o grab
  public void grab(int x,
                   int y)
Grab this ROI in preparation for dragging or resizing.
Overrides:
grab in class ROI
 o 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
 o hide
  public void hide()
Hide the ROI from view.
Overrides:
hide in class ROI
 o 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
 o intersects
  public boolean intersects(Rectangle r)
Checks if this roi intersect with rectangle r.
Overrides:
intersects in class Rectangle
 o intersection
  public Rectangle intersection(Rectangle r)
Computes the intersection of this roi and rectangle r.
Overrides:
intersection in class Rectangle
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o reshape
  public void reshape(int x,
                      int y,
                      int width,
                      int height)
Reshapes the roi.
Overrides:
reshape in class Rectangle
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o show
  public void show()
Show the ROI.
Overrides:
show in class ROI
 o 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
 o size
  public Dimension size()
return size of the ROI
Returns:
The current size of this ROI.
Overrides:
size in class ROI
 o 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