com.pentec.gui.aoi
Interface AOI

All Superinterfaces:
java.awt.Shape
All Known Implementing Classes:
AoiAdapter, EllipticalAOI, RectangularAOI

public interface AOI
extends java.awt.Shape

An AOI describes the shape of an area of interest and provides other basic services needed to manage such an area. An AOI is defined as the integer bounds of an area from 1 to N. Due to a number of operations performed on AOIs, the bounds should never exceed 1 or N. Doing so may raise a bounds exception.

Author:
Pender Technology

Field Summary
static java.awt.Color DEFAULT_COLOR
          Default color used to draw an AOI
 
Method Summary
 void addChangeListener(AoiChangeListener changeListener)
          Add a listener to the AOI
 AOI duplicate()
          Create a new identical AOI (just like clone but returns an AOI instead of an Object for convenience)
 java.awt.Point getCenter()
          Get the center of the AOI.
 AoiChangeListener[] getChangeListeners()
          Get the current listeners to the AOI
 java.awt.Color getColor()
          Get the color used to draw the AOI
 AoiEditor getEditor(DataFrame owner)
          Return an appropriate new editor for the AOI given the DataFrame the AOI is in
 java.awt.Rectangle getEnclosure()
          Get a Rectangle enclosing the AOI
 java.lang.String getName()
          Get the name of the AOI
 boolean isFillEnabled()
          Return if the AOI should be drawn filled or not
 void removeChangeListener(AoiChangeListener changeListener)
          Remove a listener from the AOI
 AOI scale(APanel owner)
          Returns a new AOI with coordinates scaled to fit the APanel's current display size
 AOI scale(double dx, double dy)
          Returns a new scaled AOI
 void setCenter(java.awt.Point center)
          Set the AOI's position by recentering it
 void setColor(java.awt.Color color)
          Set the color used to draw the AOI
 void setFillEnabled(boolean isFilled)
          Set if the AOI should be drawn filled or not
 void setName(java.lang.String $Name)
          Set the name of the AOI
 void translate(double dx, double dy)
          Translate the AOI
 
Methods inherited from interface java.awt.Shape
contains, contains, contains, contains, getBounds, getBounds2D, getPathIterator, getPathIterator, intersects, intersects
 

Field Detail

DEFAULT_COLOR

static final java.awt.Color DEFAULT_COLOR
Default color used to draw an AOI

Method Detail

addChangeListener

void addChangeListener(AoiChangeListener changeListener)
Add a listener to the AOI

Parameters:
changeListener - listener to add

duplicate

AOI duplicate()
Create a new identical AOI (just like clone but returns an AOI instead of an Object for convenience)

Returns:
new duplicate AOI

getCenter

java.awt.Point getCenter()
Get the center of the AOI. If the AOI does not have a well defined center due to its irregular shape, a consistently chosen central point may be returned instead.

Returns:
center point of the AOI

getChangeListeners

AoiChangeListener[] getChangeListeners()
Get the current listeners to the AOI

Returns:
array of listeners

getColor

java.awt.Color getColor()
Get the color used to draw the AOI

Returns:
color of the AOI

getEditor

AoiEditor getEditor(DataFrame owner)
Return an appropriate new editor for the AOI given the DataFrame the AOI is in

Parameters:
owner - DataFrame owning the AOI
Returns:
AoiEditor capable of handling the AOI properly

getEnclosure

java.awt.Rectangle getEnclosure()
Get a Rectangle enclosing the AOI

Returns:
enclosinig Rectangle

getName

java.lang.String getName()
Get the name of the AOI

Returns:
name of the AOI

isFillEnabled

boolean isFillEnabled()
Return if the AOI should be drawn filled or not

Returns:
fill value

removeChangeListener

void removeChangeListener(AoiChangeListener changeListener)
Remove a listener from the AOI

Parameters:
changeListener - listener to remove

scale

AOI scale(APanel owner)
Returns a new AOI with coordinates scaled to fit the APanel's current display size

Parameters:
owner - APanel to which to scale
Returns:
new scaled AOI

scale

AOI scale(double dx,
          double dy)
Returns a new scaled AOI

Parameters:
dx - X scale factor
dy - Y scale factor
Returns:
new scaled AOI

setCenter

void setCenter(java.awt.Point center)
Set the AOI's position by recentering it

Parameters:
center - new center point

setColor

void setColor(java.awt.Color color)
Set the color used to draw the AOI

Parameters:
color - color of the AOI

setFillEnabled

void setFillEnabled(boolean isFilled)
Set if the AOI should be drawn filled or not

Parameters:
isFilled - fill value

setName

void setName(java.lang.String $Name)
Set the name of the AOI

Parameters:
$Name - name of the AOI

translate

void translate(double dx,
               double dy)
Translate the AOI

Parameters:
dx - X translation amount
dy - Y translation amount