|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Polygon | +--did.gui.DIDBaseRoi
File: DIDBaseROI.java Version: 1.1 Description: Abstract class from which all specialized ROI classes are derived. This class implements the DIDRoiIFC interface and inherits from the Java Polygon class. Any class derived from this one will thus inherit this implementation allowing universal access to all common methods and attributes of the ROI architecture. This class also contains a reference to a DIDNode. This DIDNode points to a specific portion of the TreeModel which serves as a starting point from which to set and get all persitable data. Modification Log: Date Name Comment xx-xx-xxxx XXX xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
DIDPolyRoi
,
DIDRectRoi
, Serialized FormField Summary | |
protected java.awt.geom.AffineTransform |
at
Attribute that holds the current transform for this ROI. |
protected static int |
CORNER_HEIGHT
Integer used to dermine the size and location of the rectangle which marks a vertex. |
protected static int |
CORNER_WIDTH
Integer used to dermine the size and location of the rectangle which marks a vertex. |
protected boolean |
focus
Attribute used to determine if the ROI has focus and therefore should be rendered distinctly. |
protected int |
myActiveVertex
Attribute that points to the active vertex. |
protected java.awt.Color |
myActiveVertexColor
Attribute used to determine the color of the active vertex. |
DIDNode |
myAnchorNode
Attribute that references |
protected java.awt.Color |
myArrowColor
Attribute used to determine the color of the arrow showing the logical relationship. |
protected boolean |
myDrawArrow
if true, draw an arrow to the logically next ROI |
protected java.awt.Color |
myFillColor
Attribute used to determine the color of the ROI's inside. |
protected java.awt.Color |
myFocusColor
Attribute used to determine the color of the entire ROI when it does have focus. |
protected static java.awt.Font |
myFont
Attribute used to determine the type of font used to display coordinate information. |
protected static java.awt.Color |
myFontColor
Attribute used to determine the color used to display coordinate information. |
protected static int |
myFontSize
Attribute used to determine the size of the text used to display coordinate information. |
protected DIDBaseRoi |
myNextRoi
the next logical node |
protected java.awt.Color |
myNoFocusColor
Attribute used to determine the color of the entire ROI when it does not have focus. |
protected DIDBaseRoi |
myPrevRoi
the previous logical node |
protected java.awt.Color |
mySelectedColor
Attribute used to determine the color of the ROI when it is selected by search function. |
protected int |
myStatus
Attribute used to determine the |
protected double |
myTheta
Attribute that holds the current rotation factor. |
protected java.awt.Color |
myVertexColor
Attribute used to determine the color of each rectangle that marks a vertex. |
protected java.awt.geom.PathIterator |
pi
Attribure that hold the current iterator implementation for this ROI. |
protected boolean |
selected
Attribute used to determine if the ROI has been searched and therefore should be rendered distinctly. |
protected boolean |
showCoordinates
Attribute used to determine if coordinate information should be rendered next to each vertex. |
protected static int |
X_OFFSET
Integer used to dermine the size and location of the rectangle which marks a vertex. |
protected static int |
Y_OFFSET
Integer used to dermine the size and location of the rectangle which marks a vertex. |
Fields inherited from class java.awt.Polygon |
bounds,
npoints,
xpoints,
ypoints |
Fields inherited from interface did.gui.DIDRoiIFC |
BASE,
CHARACTER,
CONSTRUCTING,
LINE,
MOVING,
NORMAL,
PAGE,
POLYGON,
RECTANGLE,
RESIZING,
ROTATING,
UNDETERMINED,
UNSPECIFIED,
WAITING,
WORD,
ZONE |
Constructor Summary | |
DIDBaseRoi()
Method used to instatiate the class. |
|
DIDBaseRoi(int x)
Method used to instantitiate this class. |
|
DIDBaseRoi(int[] tmpX,
int[] tmpY,
int tmpN)
Constructor used to initalize the object. |
Method Summary | |
abstract void |
draw(java.awt.Graphics2D g2d)
This method renders the object onto whatever graphics object is passed to it as a parameter. |
abstract void |
draw(java.awt.Graphics2D g2d,
float scale)
|
void |
drawArrow(java.awt.Graphics2D g2d,
float scale)
|
void |
drawTriangle(java.awt.Graphics2D g2d,
java.awt.Point p1,
java.awt.Point p2,
int len)
|
void |
finalizeROI()
Method used to finalize and ROI. |
DIDNode |
getAnchorNode()
Method used to return a reference to the corresponding DIDNode. |
java.awt.Rectangle |
getBounds()
|
java.awt.Point |
getCenterPoint(float scale)
|
boolean |
getDrawArrow()
Method used to return a value of myDrawArrow. |
java.awt.Color |
getFillColor()
Method used to get the color of the ROI's inside. |
java.awt.Color |
getFocusColor()
Method used to get the color of the ROI when it has the focus. |
DIDBaseRoi |
getNextRoi()
Method used to return a reference to the next ROI. |
int |
getNodeType()
Method used to return the type of data this ROI is reprsenting (Zone, Line, Character). |
java.awt.Color |
getNoFocusColor()
Method used to get the color of the ROI when it doesn't have the focus. |
java.awt.geom.PathIterator |
getPathIterator()
Method used to return the current PathIterator implementation for this class. |
DIDBaseRoi |
getPrevRoi()
/*********************************************************************** Method used to return a reference to the previous ROI. |
int |
getStatus()
Method used to get the Status of the ROI. |
int |
getType()
Method used to get the type (Rectangle, Polygon) of a particular implementation of this class. |
int |
getVertexCount()
Method used determine the number of verticies this ROI contains. |
boolean |
hasFocus()
Method used to determine if an ROI has the focus. |
void |
init()
Method used to initialize the ROI. |
boolean |
isOriginVertex(int x,
int y)
Method used to dertermine if a set of coordinates is within the bounds of the first vertex of the ROI. |
protected void |
modifyPoint(int n,
int x,
int y)
Method used to safely modify an element in the base polygons coordinate arrays( xpoints, ypoints). |
void |
rotate(double myAmount)
Method used to rotate the ROI. |
boolean |
setActiveVertex(int x,
int y)
Method used to set the active vertex. |
void |
setActiveVertexCoord(int x,
int y)
Method used to move the active vertex to the specified coordinate. |
void |
setAnchorNode(DIDNode newAnchorNode)
Method used to set a reference to the corresponding DIDNode which the ROI is representing. |
void |
setAnchorNode(DIDNode newAnchorNode,
java.lang.String color)
Method used to set a reference to the corresponding DIDNode which the ROI is representing. |
void |
setCoordDisp(boolean myValue)
Method used to determine whether coordinate information is to be displayed next to each vertex in the ROI. |
void |
setDrawArrow(boolean da)
Method used to set a value of myDrawArrow. |
void |
setFillColor(java.awt.Color c)
Method used to set the color of the ROI's inside. |
void |
setFocus(boolean state)
Method used to set the focus of a single instance of a ROI. |
void |
setFocusColor(java.awt.Color c)
Method used to set the color of the ROI when it has the focus. |
void |
setNextRoi(DIDBaseRoi nextRoi)
Method used to set a value of the next ROI. |
void |
setNoFocusColor(java.awt.Color c)
Method used to set the color of the ROI when it doesn't have the focus. |
void |
setPrevRoi(DIDBaseRoi prevRoi)
Method used to set a value of the previous ROI. |
void |
setSelected(boolean state)
Method used to indicate a ROI is selected by search function. |
void |
setStatus(int s)
Method used to set the status of the ROI. |
void |
setTranslation(int x,
int y)
Convenience method used move the entire ROI to a new location. |
void |
syncData()
Method used to synchronize coordinate data between the ROI class and the TreeModel (XML). |
java.lang.String |
toString()
Method used to convert ROI statistics into a string that can be returned when the ROI is dumbed to an output stream. |
Methods inherited from class java.awt.Polygon |
addPoint,
contains,
contains,
contains,
contains,
contains,
contains,
getBoundingBox,
getBounds2D,
getPathIterator,
getPathIterator,
inside,
intersects,
intersects,
translate |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected static int myFontSize
protected static java.awt.Font myFont
protected static java.awt.Color myFontColor
protected java.awt.Color myVertexColor
protected java.awt.Color myActiveVertexColor
protected java.awt.Color myFocusColor
protected java.awt.Color myNoFocusColor
protected java.awt.Color myFillColor
protected java.awt.Color mySelectedColor
protected java.awt.Color myArrowColor
protected static int CORNER_WIDTH
protected static int CORNER_HEIGHT
protected static int X_OFFSET
protected static int Y_OFFSET
protected double myTheta
protected int myActiveVertex
protected int myStatus
protected java.awt.geom.AffineTransform at
protected java.awt.geom.PathIterator pi
protected boolean showCoordinates
protected boolean focus
protected boolean selected
protected boolean myDrawArrow
protected DIDBaseRoi myNextRoi
protected DIDBaseRoi myPrevRoi
public DIDNode myAnchorNode
Constructor Detail |
public DIDBaseRoi(int[] tmpX, int[] tmpY, int tmpN)
tmpX
- An array of integers corresponding to all the x corrdinates for this ROI.tmpY
- An array of integers corresponding to all the y corrdinates for this ROI.tmpN
- The number of verticies this ROI should contain.public DIDBaseRoi(int x)
x
- The number of verticies this instance of this class should contain.public DIDBaseRoi()
Method Detail |
public void init()
public java.awt.geom.PathIterator getPathIterator()
public abstract void draw(java.awt.Graphics2D g2d)
g2d
- A reference to a specific Graphics2D object onto which this ROI should render
itself.public abstract void draw(java.awt.Graphics2D g2d, float scale)
public java.awt.Rectangle getBounds()
public java.awt.Point getCenterPoint(float scale)
public void drawTriangle(java.awt.Graphics2D g2d, java.awt.Point p1, java.awt.Point p2, int len)
public void drawArrow(java.awt.Graphics2D g2d, float scale)
public void rotate(double myAmount)
myAmount
- The amount by which the ROI should rotated. Negative values rotate to
the left and positive to the right.public boolean isOriginVertex(int x, int y)
x
- X coordinate to be tested.y
- Y coordinate to be tested.DIDCreationHandler.mouseClicked(java.awt.event.MouseEvent)
public void setActiveVertexCoord(int x, int y)
x
- New x position for the active vertex.y
- New y position for the active vertex.public boolean setActiveVertex(int x, int y)
x
- X coordinate to be iterrigated to see if it lies within the active vertex bounds.y
- Y coordinate to be iterrigated to see if it lies within the active vertex bounds.public void setTranslation(int x, int y)
x
- Integer representing the x coordinate to which the ROI should be moved.y
- Integer representing the y coordinate to which the ROI should be moved.public void finalizeROI()
at
,
pi
public java.lang.String toString()
public int getType()
public void setCoordDisp(boolean myValue)
myValue
- True if coordinate info is to be displayed next to each vertex, false
if no information is to be displayed.public void setFocus(boolean state)
state
- A boolean primitive used to determine if the current instance of the ROI
should get the focus.public void setSelected(boolean state)
state
- A boolean primitive used to determine if the current
instance of the ROI is selected.public boolean hasFocus()
public void setStatus(int s)
s
- An integer that specifies the state of the ROI. WAITING=-1,CONSTRUCTING=0,
MOVING=1,RESIZING=2,ROTATING=3,NORMAL=4;DIDCreationHandler
public int getStatus()
DIDRoiIFC.WAITING
public void setFocusColor(java.awt.Color c)
c
- A color object to which the ROI who has the focus should be set.public java.awt.Color getFocusColor()
public void setNoFocusColor(java.awt.Color c)
c
- A color object to which the ROI who doesn't have the focus should be set.public java.awt.Color getNoFocusColor()
public void setFillColor(java.awt.Color c)
A
- color object to which the color of the ROI's inside should be set.public java.awt.Color getFillColor()
public void setAnchorNode(DIDNode newAnchorNode)
newAnchorNode
- A reference to the corresponding DIDNode.#stringToColor
public void setAnchorNode(DIDNode newAnchorNode, java.lang.String color)
newAnchorNode
- A reference to the corresponding DIDNode.#stringToColor
public DIDNode getAnchorNode()
public void setDrawArrow(boolean da)
myValue
- True if an arrow is to be displayed.
if false, no information is to be displayed.public boolean getDrawArrow()
public void setNextRoi(DIDBaseRoi nextRoi)
public DIDBaseRoi getNextRoi()
public void setPrevRoi(DIDBaseRoi prevRoi)
public DIDBaseRoi getPrevRoi()
public void syncData()
public int getNodeType()
protected void modifyPoint(int n, int x, int y)
n
- References the element in the x & y coordinate arrays which are to be modified.x
- New x coordinate.y
- New y coordinate.public int getVertexCount()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |