public class TextRoi extends Roi
Modifier and Type | Field and Description |
---|---|
static int |
CENTER |
static int |
LEFT |
static int |
RIGHT |
ANGLE, asp_bk, aspect, cachedMask, center, clipboard, clipHeight, clipWidth, clipX, clipY, COMPOSITE, constrain, CONSTRUCTING, FERET_ARRAY_POINTOFFSET, FERET_ARRAYSIZE, fillColor, flattenScale, FREELINE, FREEROI, HANDLE_SIZE, handleColor, ic, ignoreClipRect, imp, instanceColor, LINE, lineWidth, mag, MOVING, MOVING_HANDLE, nonScalable, NORMAL, NOT_PASTING, oldHeight, oldWidth, oldX, oldY, onePixelWide, OVAL, overlay, pasteMode, POINT, POLYGON, POLYLINE, RECTANGLE, RESIZING, ROIColor, stroke, strokeColor, TRACED_ROI, type, updateFullWindow, wideLine, xMax, yMax
Constructor and Description |
---|
TextRoi(double x,
double y,
double width,
double height,
java.lang.String text,
java.awt.Font font)
Creates a TextRoi using the specified sub-pixel location, size and Font.
|
TextRoi(double x,
double y,
java.lang.String text)
Creates a TextRoi using sub-pixel coordinates.
|
TextRoi(double x,
double y,
java.lang.String text,
java.awt.Font font)
Creates a TextRoi using the specified sub-pixel location and Font.
|
TextRoi(int x,
int y,
ImagePlus imp) |
TextRoi(int x,
int y,
java.lang.String text)
Creates a TextRoi.
|
TextRoi(int x,
int y,
java.lang.String text,
java.awt.Font font)
Creates a TextRoi using the specified location and Font.
|
TextRoi(int x,
int y,
java.lang.String text,
java.awt.Font font,
java.awt.Color color)
Deprecated.
|
TextRoi(java.lang.String text,
double x,
double y,
java.awt.Font font)
Use this constructor as a drop-in replacement for ImageProcessor.drawString().
|
Modifier and Type | Method and Description |
---|---|
void |
addChar(char c)
This method is used by the text tool to add typed
characters to displayed text selections.
|
void |
clear(ImageProcessor ip) |
java.lang.Object |
clone()
Returns a copy of this TextRoi.
|
void |
draw(java.awt.Graphics g)
Draws the text on the screen, clipped to the ROI.
|
void |
drawOverlay(java.awt.Graphics g) |
void |
drawPixels(ImageProcessor ip)
Renders the text on the image.
|
double |
getAngle()
Overridden by PolygonRoi (angle between first two points), TextRoi (text angle) and Line (line angle).
|
boolean |
getAntialiased()
Returns the state of the 'antiAlias' instance variable.
|
java.awt.Font |
getCurrentFont()
Returns the current (instance) font.
|
static java.lang.String |
getDefaultFontName()
Returns the name of the default font.
|
static int |
getDefaultFontSize()
Returns the default font size.
|
static int |
getDefaultFontStyle()
Returns the default font style.
|
boolean |
getDrawStringMode() |
static java.lang.String |
getFont()
Deprecated.
Replaced by getDefaultFontName
|
static int |
getGlobalJustification()
Returns the global (default) justification (LEFT, CENTER or RIGHT).
|
int |
getJustification()
Returns the value of the 'justification' instance variable (LEFT, CENTER or RIGHT).
|
java.lang.String |
getMacroCode(java.lang.String cmd,
ImagePlus imp)
Used by the Recorder for recording the text tool.
|
static int |
getSize()
Deprecated.
Replaced by getDefaultFontSize
|
static int |
getStyle()
Deprecated.
Replaced by getDefaultFontStyle
|
java.lang.String |
getText() |
protected void |
handleMouseUp(int screenX,
int screenY) |
static boolean |
isAntialiased()
Returns the state of the global 'antialiasedText' variable, which is used by the "Fonts" widget.
|
boolean |
isDrawingTool()
Returns 'true' if this is an ROI primarily used from drawing
(e.g., TextRoi or Arrow).
|
void |
setAngle(double angle) |
void |
setAntialiased(boolean antiAlias)
Sets the 'antiAlias' instance variable.
|
static void |
setAntialiasedText(boolean antialiased)
Sets the state of the global 'antialiasedText' variable.
|
void |
setCurrentFont(java.awt.Font font)
Set the current (instance) font.
|
static void |
setDefaultAngle(double angle)
Sets the default angle.
|
static void |
setDefaultFillColor(java.awt.Color fillColor)
Sets the default fill (background) color.
|
void |
setDrawStringMode(boolean drawStringMode) |
static void |
setFont(java.lang.String fontName,
int fontSize,
int fontStyle)
Sets the global font face, size and style that will be used by
TextROIs interactively created using the text tool.
|
static void |
setFont(java.lang.String fontName,
int fontSize,
int fontStyle,
boolean antialiased)
Sets the font face, size, style and antialiasing mode that will
be used by TextROIs interactively created using the text tool.
|
static void |
setGlobalJustification(int justification)
Sets the 'justification' instance variable (must be LEFT, CENTER or RIGHT)
|
void |
setJustification(int justification)
Sets the 'justification' instance variable (must be LEFT, CENTER or RIGHT)
|
void |
setLocation(int x,
int y)
Set the location of the ROI in image coordinates.
|
void |
setPreviousRoi(Roi previousRoi) |
abortModification, abortPaste, addRoiListener, clipRectMargin, contains, containsPoint, convertLineToArea, convertToPolygon, copyAttributes, drawPixels, enableSubPixelResolution, endPaste, equals, getAngle, getAntiAlias, getBoundingRect, getBounds, getColor, getContainedFloatPoints, getContainedPoints, getContourCentroid, getConvexHull, getCornerDiameter, getCPosition, getCurrentPasteMode, getDebugInfo, getDefaultFillColor, getDefaultGroup, getDefaultHandleSize, getDefaultStrokeWidth, getDrawOffset, getFeretsDiameter, getFeretValues, getFillColor, getFloatAngle, getFloatBounds, getFloatConvexHull, getFloatHeight, getFloatPolygon, getFloatPolygon, getFloatWidth, getGroup, getHandleSize, getHashCode, getImage, getImageID, getInterpolatedPolygon, getInterpolatedPolygon, getInterpolatedPolygon, getInverse, getLength, getMagnification, getMask, getName, getPasteMode, getPolygon, getPosition, getProperties, getProperty, getPropertyCount, getPrototypeOverlay, getRotationCenter, getRoundRectArcSize, getScaledStroke, getScaleStrokeWidth, getState, getStatistics, getStroke, getStrokeColor, getStrokeWidth, getTPosition, getType, getTypeAsString, getXBase, getYBase, getZPosition, grow, handleMouseDown, handleMouseDrag, hasHyperStackPosition, isActiveOverlayRoi, isArea, isCursor, isHandle, isInteger, isLine, isVisible, iterator, lineCircleIntersection, mouseDownInHandle, mouseDragged, mouseMoved, mouseReleased, moveHandle, notifyListeners, nudge, nudgeCorner, removeRoiListener, resetDefaultHandleSize, screenX, screenXD, screenY, screenYD, setAntiAlias, setColor, setCornerDiameter, setDefaultGroup, setDefaultStrokeWidth, setDrawOffset, setFillColor, setFlattenScale, setGroup, setHandleSize, setIgnoreClipRect, setImage, setInstanceColor, setIsCursor, setLineWidth, setLocation, setName, setNonScalable, setPasteMode, setPosition, setPosition, setPosition, setProperties, setProperty, setPrototypeOverlay, setRenderingHint, setRotationCenter, setRoundRectArcSize, setStroke, setStrokeColor, setStrokeWidth, setStrokeWidth, setUnscalableStrokeWidth, showStatus, size, startPaste, subPixelResolution, temporarilyHide, toFloat, toInt, toInt, toIntR, toString, update, updateClipRect, updateWideLine
public static final int LEFT
public static final int CENTER
public static final int RIGHT
public TextRoi(int x, int y, java.lang.String text)
public TextRoi(java.lang.String text, double x, double y, java.awt.Font font)
public TextRoi(double x, double y, java.lang.String text)
public TextRoi(int x, int y, java.lang.String text, java.awt.Font font)
public TextRoi(double x, double y, java.lang.String text, java.awt.Font font)
public TextRoi(double x, double y, double width, double height, java.lang.String text, java.awt.Font font)
public TextRoi(int x, int y, java.lang.String text, java.awt.Font font, java.awt.Color color)
public TextRoi(int x, int y, ImagePlus imp)
public void addChar(char c)
public void drawPixels(ImageProcessor ip)
drawPixels
in class Roi
ImageProcessor.setColor(java.awt.Color)
,
ImageProcessor.setLineWidth(int)
public void draw(java.awt.Graphics g)
public void drawOverlay(java.awt.Graphics g)
drawOverlay
in class Roi
public static java.lang.String getDefaultFontName()
public static int getDefaultFontSize()
public static int getDefaultFontStyle()
public void setCurrentFont(java.awt.Font font)
public java.awt.Font getCurrentFont()
public static boolean isAntialiased()
public static void setAntialiasedText(boolean antialiased)
public void setAntialiased(boolean antiAlias)
public boolean getAntialiased()
public static void setGlobalJustification(int justification)
public static int getGlobalJustification()
public void setJustification(int justification)
public int getJustification()
public static void setFont(java.lang.String fontName, int fontSize, int fontStyle)
public static void setFont(java.lang.String fontName, int fontSize, int fontStyle, boolean antialiased)
public static void setDefaultFillColor(java.awt.Color fillColor)
public static void setDefaultAngle(double angle)
protected void handleMouseUp(int screenX, int screenY)
handleMouseUp
in class Roi
public java.lang.String getMacroCode(java.lang.String cmd, ImagePlus imp)
public java.lang.String getText()
public boolean isDrawingTool()
Roi
isDrawingTool
in class Roi
public void clear(ImageProcessor ip)
public void setLocation(int x, int y)
Roi
setLocation
in class Roi
public double getAngle()
Roi
public void setAngle(double angle)
public boolean getDrawStringMode()
public void setDrawStringMode(boolean drawStringMode)
public void setPreviousRoi(Roi previousRoi)
public static java.lang.String getFont()
public static int getSize()
public static int getStyle()