com.xinapse.multisliceimage.roi
Class Text

java.lang.Object
  extended by com.xinapse.multisliceimage.roi.ROI
      extended by com.xinapse.multisliceimage.roi.Marker
          extended by com.xinapse.multisliceimage.roi.Text
All Implemented Interfaces:
RegularROI, java.lang.Cloneable

public class Text
extends Marker

A Class for putting text on an image.


Field Summary
 
Fields inherited from class com.xinapse.multisliceimage.roi.Marker
DEFAULT_SIZE
 
Fields inherited from class com.xinapse.multisliceimage.roi.ROI
handles, PREFERENCES_NODE_NAME, XTOKEN, YTOKEN
 
Constructor Summary
Text(double x, double y)
          Creates a new Text roi at the given (x, y) coordinate.
Text(double x, double y, ROIState state)
          Creates a new Text ROI at the given (x, y) coordinate, and sets the state of the ROI.
Text(java.awt.geom.Point2D.Double pt)
          Creates a new Text ROI at the given point.
 
Method Summary
 Text clone()
          Returns a clone of this ROI.
 boolean draw(java.awt.Graphics g, java.awt.Rectangle visibleRectangle, int imageDrawCols, int imageDrawRows, int xOffset, int yOffset, int nCols, int nRows, float pixelXSize, float pixelYSize, boolean drawAnnotation)
          Draws this ROI if it needs to be be drawn on screen.
 void drawInOrthoView(java.awt.Image orthoView, javax.vecmath.Point3f orthoViewPosition, javax.media.j3d.Transform3D imageToViewTx, int nCols, int nRows, int nSlices, float pixelXSize, float pixelYSize, boolean filled)
          Draws this ROI on top of an orthogonal view of an image.
static javax.swing.Icon getButtonIcon()
          Returns an Icon that can be used for a button to create this type of ROI.
 java.awt.Color getColor()
          Returns the java.awt.Color in which this Text ROI should be drawn.
 ROI getCopy()
          Returns a copy of this ROI.
static ROICreateDialog getCreateDialog(CanAddROIToFrame listener)
          Returns a JDialog that can be used to create Text ROIs.
static InteractionType getCreateInteractionType()
          Returns the type of interaction needed to create a Text ROI.
 java.lang.String getDescription()
          Return a description of this type of ROI.
static ROI getInstance(java.awt.geom.Point2D point, boolean pixelSnap, int nCols, int nRows, float pixelXSize, float pixelYSize, byte userColour, ROIState state)
          Create a Text ROI at a point on an image.
static java.lang.String getName()
          Returns a descriptive name for this type of ROI.
 int hashCode()
          Returns a hash code value for this Marker ROI.
 boolean selectDeselect(java.awt.Point point, boolean editMode, boolean showDeleted, int nAlreadySelected)
          Selects or deselects an ROI after a user click at the point.
 
Methods inherited from class com.xinapse.multisliceimage.roi.Marker
add, contains, dilate, equals, exclusiveOr, flipHorizontal, flipVertical, getBoundingRectangle, getFeret, getPerimeter, getSquareArea, getStats, getX, getY, intersect, intersects, move, set, set, subtract, toString
 
Methods inherited from class com.xinapse.multisliceimage.roi.ROI
add, addMorphological, clearDeletionHistory, clearStats, dilate, getAnnotation, getBoundingRectangle, getCachedStatistics, getClasses, getDisplayedBounds2D, getDisplayedBounds2D, getDisplayedRoiArea, getFeret, getHandles, getHandleUnderPoint, getImageSource, getPixelValue, getROIs, getROIs, getROIs, getSlice, getState, getStats, getStats, getTextColor, getTextFontSize, getUserColour, isDeleted, isEditable, isReloaded, isSelected, join, main, markDeleted, mmPosToPix, moveROIs, pixPosToMm, printStats, setAnnotation, setCreationHistory, setSlice, setState, setTextColor, setTextSize, setUserColour, subtract, write, write
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Text

public Text(java.awt.geom.Point2D.Double pt)
Creates a new Text ROI at the given point.

Parameters:
pt - the location of the Text ROI.

Text

public Text(double x,
            double y)
Creates a new Text roi at the given (x, y) coordinate.

Parameters:
x - the x location of the text.
y - the y location of the text.

Text

public Text(double x,
            double y,
            ROIState state)
Creates a new Text ROI at the given (x, y) coordinate, and sets the state of the ROI.

Parameters:
x - the x location of the text.
y - the y location of the text.
state - the ROIState of the text.
Method Detail

getCreateInteractionType

public static InteractionType getCreateInteractionType()
Returns the type of interaction needed to create a Text ROI.

Returns:
type of interaction needed to create a Text ROI - InteractionType.CLICK_TYPE.

getInstance

public static ROI getInstance(java.awt.geom.Point2D point,
                              boolean pixelSnap,
                              int nCols,
                              int nRows,
                              float pixelXSize,
                              float pixelYSize,
                              byte userColour,
                              ROIState state)
                       throws ROIException
Create a Text ROI at a point on an image.

Parameters:
point - the point on the image in pixel coordinates.
pixelSnap - true if pixel snap is turned on.
nCols - the number of columns in the image.
nRows - the number of rows in the image.
pixelXSize - the width of an image pixel in mm.
pixelYSize - the height of an image pixel in mm.
state - the ROIState of this ROI on creation.
Throws:
ROIException

draw

public boolean draw(java.awt.Graphics g,
                    java.awt.Rectangle visibleRectangle,
                    int imageDrawCols,
                    int imageDrawRows,
                    int xOffset,
                    int yOffset,
                    int nCols,
                    int nRows,
                    float pixelXSize,
                    float pixelYSize,
                    boolean drawAnnotation)
Description copied from class: Marker
Draws this ROI if it needs to be be drawn on screen. Marker ROIs are a special case, since we can't use the Bounding Rectangle to decide whether a Marker is on screen, since the zero-area bounding rectangle never intersects anything.

Overrides:
draw in class Marker
Parameters:
g - the graphics context for the drawing operation.
visibleRectangle - the part of the image that can be seen on-screen.
imageDrawCols - width of the area in which this portion of the image is to be drawn.
imageDrawRows - height of the area in which this portion of the image is to be drawn.
xOffset - a horizontal offset for drawing operations.
yOffset - a vertical offset for drawing operations.
nCols - the number of columns in the image on which this ROI is defined.
nRows - the number of rows in the image on which this ROI is defined.
pixelXSize - pixel width for the image on which this ROI is defined.
pixelYSize - pixel height for the image on which this ROI is defined.
drawAnnotation - a flag to indicate whether annotation should be drawn.
Returns:
true if the ROI is visible and been drawn on screen; false otherwise.

drawInOrthoView

public void drawInOrthoView(java.awt.Image orthoView,
                            javax.vecmath.Point3f orthoViewPosition,
                            javax.media.j3d.Transform3D imageToViewTx,
                            int nCols,
                            int nRows,
                            int nSlices,
                            float pixelXSize,
                            float pixelYSize,
                            boolean filled)
Description copied from class: ROI
Draws this ROI on top of an orthogonal view of an image.

Overrides:
drawInOrthoView in class Marker
Parameters:
orthoView - the java.awt.Image into which the ROI is to be drawn.
orthoViewPosition - the coordinates (col, row, slice position) of the orthogonal view in the original image.
imageToViewTx - the Transform3D that maps original image pixel coordinates to pixel coordinates in the orthogonal view.
nCols - the number of columns in the original image.
nRows - the number of rows in the original image.
nSlices - the number of slices in the original image.
pixelXSize - the pixel width in the original image.
pixelYSize - the pixel height in the original image.
filled - whether the ROI should be drawn filled (effective only for ROIs that enclose an area).

selectDeselect

public boolean selectDeselect(java.awt.Point point,
                              boolean editMode,
                              boolean showDeleted,
                              int nAlreadySelected)
Description copied from class: ROI
Selects or deselects an ROI after a user click at the point.

Overrides:
selectDeselect in class Marker
Parameters:
point - the Point at which the user has clicked.
editMode - true if the tool working with ROIs is in edit mode; false if it is in view mode.
showDeleted - true if the tool working with ROIs is set to show deleted ROIs; false if it is not.
nAlreadySelected - the number of ROIs already selected. This determines the exact selection/deselection behaviour.
Returns:
true if the selection was changed.

getColor

public java.awt.Color getColor()
Returns the java.awt.Color in which this Text ROI should be drawn.

Overrides:
getColor in class ROI
Returns:
the java.awt.Color with which this Text ROI should be drawn.

getCreateDialog

public static ROICreateDialog getCreateDialog(CanAddROIToFrame listener)
Returns a JDialog that can be used to create Text ROIs.

Parameters:
listener - the CanAddROIToFrame to which the ROI will be added when the Add button of the Dialog is clicked.

hashCode

public int hashCode()
Returns a hash code value for this Marker ROI.

Overrides:
hashCode in class Marker
Returns:
a hash code value for this Marker ROI.

getCopy

public ROI getCopy()
Description copied from class: ROI
Returns a copy of this ROI. The copy will be identical in shape and annotation as the original ROI, but with a history of that of a newly-created ROI.

Overrides:
getCopy in class Marker
Returns:
a copy of this ROI, cast to an Object.

getDescription

public java.lang.String getDescription()
Description copied from class: ROI
Return a description of this type of ROI.

Overrides:
getDescription in class Marker
Returns:
a String describing the type of this ROI.

getName

public static java.lang.String getName()
Returns a descriptive name for this type of ROI.

Returns:
a String describing this type of ROI.

getButtonIcon

public static javax.swing.Icon getButtonIcon()
Returns an Icon that can be used for a button to create this type of ROI.

Returns:
an Icon that can be used to represent this type of ROI.

clone

public Text clone()
Description copied from class: ROI
Returns a clone of this ROI. The copy will be identical in shape and annotation as the original ROI, and with a history identical to the cloned ROI.

Overrides:
clone in class Marker
Returns:
a clone of this ROI, cast to an Object.


Copyright 2006-2011 Xinapse Systems Limited. All Rights Reserved.