java.lang.Object
ij.gui.Roi
ij.gui.TextRoi
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<Point>
This class is a rectangular ROI containing text.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intFields inherited from class ij.gui.Roi
ANGLE, asp_bk, aspect, cachedMask, center, clipboard, clipHeight, clipWidth, clipX, clipY, COMPOSITE, constrain, CONSTRUCTING, defaultColor, 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 Summary
ConstructorsConstructorDescriptionCreates a TextRoi using the specified sub-pixel location, size and Font.Creates a TextRoi using sub-pixel coordinates.Creates a TextRoi using the specified sub-pixel location and Font.Creates a TextRoi using the defaultFont.Creates a TextRoi using the specified location and Font.Deprecated.Use this constructor as a drop-in replacement for ImageProcessor.drawString(). -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChar(char c) This method is used by the text tool to add typed characters to displayed text selections.voidclear(ImageProcessor ip) clone()Returns a copy of this TextRoi.static TextRoiObsolete.static TextRoiCreates a TextRoi using the specified text and location.voidDraws the text on the screen, clipped to the ROI.voidvoidRenders the text on the image.doublegetAngle()Overridden by PolygonRoi (angle between first two points), TextRoi (text angle) and Line (line angle).booleanReturns the state of the 'antiAlias' instance variable.Returns the current font.static StringReturns the name of the default font.static intReturns the default font size.static intReturns the default font style.booleanstatic StringgetFont()Deprecated.Replaced by getDefaultFontNamestatic intReturns the default text tool justification (LEFT, CENTER or RIGHT).intReturns the value of the 'justification' instance variable (LEFT, CENTER or RIGHT).getMacroCode(String cmd, ImagePlus imp) Used by the Recorder for recording the text tool.static intgetSize()Deprecated.Replaced by getDefaultFontSizestatic intgetStyle()Deprecated.Replaced by getDefaultFontStylegetText()protected voidhandleMouseUp(int screenX, int screenY) static booleanReturns the state of the global 'antialiasedText' variable, which is used by the "Fonts" widget.booleanReturns 'true' if this is an ROI primarily used from drawing (e.g., TextRoi or Arrow).voidsetAngle(double angle) voidsetAntialiased(boolean antiAlias) Sets the 'antiAlias' instance variable.static voidsetAntialiasedText(boolean antialiased) Sets the state of the global 'antialiasedText' variable.voidsetCurrentFont(Font font) Deprecated.Replaced by setFont(font)static voidsetDefaultAngle(double angle) Sets the default angle.static voidsetDefaultFillColor(Color fillColor) Sets the default fill (background) color.static voidsetDefaultFont(Font font) Sets the default font.static voidsetDefaultFontSize(int size) Sets the default font size.voidsetDrawStringMode(boolean drawStringMode) voidSets the current font.static voidSets the global font face, size and style that will be used by TextROIs interactively created using the text tool.static voidSets the font face, size, style and antialiasing mode that will be used by TextROIs interactively created using the text tool.voidsetFontSize(int size) Sets the size of the current font.static voidsetGlobalJustification(int justification) Sets the default text tool justification (LEFT, CENTER or RIGHT).voidsetJustification(int justification) Sets the 'justification' instance variable (LEFT, CENTER or RIGHT)voidsetLocation(int x, int y) Set the location of the ROI in image coordinates.voidsetPreviousTextRoi(Roi previousRoi) voidMethods inherited from class ij.gui.Roi
abortModification, abortPaste, addRoiListener, clipRectMargin, contains, containsPoint, convertLineToArea, convertToPolygon, copyAttributes, create, create, 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, getGroupName, getGroupNames, getHandleSize, getHashCode, getImage, getImageID, getInterpolatedPolygon, getInterpolatedPolygon, getInterpolatedPolygon, getInverse, getLength, getListeners, getMagnification, getMask, getName, getPasteMode, getPolygon, getPosition, getPreviousRoi, 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, isLineOrPoint, isVisible, iterator, lineCircleIntersection, magnificationForSubPixel, magnificationForSubPixel, mouseDownInHandle, mouseDragged, mouseMoved, mouseReleased, moveHandle, notifyListeners, nudge, nudgeCorner, offScreenX, offScreenXD, offScreenY, offScreenYD, removeRoiListener, resetDefaultHandleSize, saveGroupNames, screenX, screenXD, screenY, screenYD, setAntiAlias, setBounds, setColor, setCornerDiameter, setDefaultColor, setDefaultGroup, setDefaultStrokeWidth, setDrawOffset, setFillColor, setFlattenScale, setGroup, setGroupName, setGroupNames, setHandleSize, setIgnoreClipRect, setImage, setInstanceColor, setIsCursor, setLineWidth, setLocation, setName, setNonScalable, setPasteMode, setPosition, setPosition, setPosition, setPreviousRoi, setProperties, setProperty, setPrototypeOverlay, setRenderingHint, setRotationCenter, setRoundRectArcSize, setStroke, setStrokeColor, setStrokeWidth, setStrokeWidth, setUnscalableStrokeWidth, showStatus, size, startPaste, subPixelResolution, temporarilyHide, toFloat, toInt, toInt, toIntR, toString, translate, update, updateClipRect, updateWideLine, useLineSubpixelConvention, xorMethods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
LEFT
public static final int LEFT- See Also:
-
CENTER
public static final int CENTER- See Also:
-
RIGHT
public static final int RIGHT- See Also:
-
-
Constructor Details
-
TextRoi
Creates a TextRoi using the defaultFont. -
TextRoi
Use this constructor as a drop-in replacement for ImageProcessor.drawString(). -
TextRoi
Creates a TextRoi using sub-pixel coordinates. -
TextRoi
Creates a TextRoi using the specified location and Font.- See Also:
-
TextRoi
Creates a TextRoi using the specified sub-pixel location and Font. -
TextRoi
Creates a TextRoi using the specified sub-pixel location, size and Font. -
TextRoi
Deprecated. -
TextRoi
-
-
Method Details
-
create
Creates a TextRoi using the specified text and location. -
create
Obsolete. -
addChar
public void addChar(char c) This method is used by the text tool to add typed characters to displayed text selections. -
drawPixels
Renders the text on the image. Draws the text in the foreground color if ip.setColor(Color) has not been called.- Overrides:
drawPixelsin classRoi- See Also:
-
draw
Draws the text on the screen, clipped to the ROI. -
drawOverlay
- Overrides:
drawOverlayin classRoi
-
getDefaultFontName
Returns the name of the default font. Use getCurrentFont().getName() to get the name of the font that this TextRoi is using. -
getDefaultFontSize
public static int getDefaultFontSize()Returns the default font size. Use getCurrentFont().getSize() to get the size of the font that this TextRoi is using. -
getDefaultFontStyle
public static int getDefaultFontStyle()Returns the default font style. Use getCurrentFont().getStyle() to get the style of the font that this TextRoi is using. -
setFont
Sets the current font. -
setFontSize
public void setFontSize(int size) Sets the size of the current font. -
getCurrentFont
Returns the current font. -
isAntialiased
public static boolean isAntialiased()Returns the state of the global 'antialiasedText' variable, which is used by the "Fonts" widget. -
setAntialiasedText
public static void setAntialiasedText(boolean antialiased) Sets the state of the global 'antialiasedText' variable. -
setAntialiased
public void setAntialiased(boolean antiAlias) Sets the 'antiAlias' instance variable. -
getAntialiased
public boolean getAntialiased()Returns the state of the 'antiAlias' instance variable. -
setGlobalJustification
public static void setGlobalJustification(int justification) Sets the default text tool justification (LEFT, CENTER or RIGHT). -
getGlobalJustification
public static int getGlobalJustification()Returns the default text tool justification (LEFT, CENTER or RIGHT). -
setJustification
public void setJustification(int justification) Sets the 'justification' instance variable (LEFT, CENTER or RIGHT) -
getJustification
public int getJustification()Returns the value of the 'justification' instance variable (LEFT, CENTER or RIGHT). -
setFont
Sets the global font face, size and style that will be used by TextROIs interactively created using the text tool. -
setFont
Sets the font face, size, style and antialiasing mode that will be used by TextROIs interactively created using the text tool. -
setDefaultFont
Sets the default font. -
setDefaultFontSize
public static void setDefaultFontSize(int size) Sets the default font size. -
setDefaultFillColor
Sets the default fill (background) color. -
setDefaultAngle
public static void setDefaultAngle(double angle) Sets the default angle. -
handleMouseUp
protected void handleMouseUp(int screenX, int screenY) - Overrides:
handleMouseUpin classRoi
-
getMacroCode
Used by the Recorder for recording the text tool. -
getText
-
setText
-
isDrawingTool
public boolean isDrawingTool()Description copied from class:RoiReturns 'true' if this is an ROI primarily used from drawing (e.g., TextRoi or Arrow).- Overrides:
isDrawingToolin classRoi
-
clear
-
setLocation
public void setLocation(int x, int y) Description copied from class:RoiSet the location of the ROI in image coordinates.- Overrides:
setLocationin classRoi
-
clone
Returns a copy of this TextRoi. -
getAngle
public double getAngle()Description copied from class:RoiOverridden by PolygonRoi (angle between first two points), TextRoi (text angle) and Line (line angle). -
setAngle
public void setAngle(double angle) -
getDrawStringMode
public boolean getDrawStringMode() -
setDrawStringMode
public void setDrawStringMode(boolean drawStringMode) -
setPreviousTextRoi
-
getFont
Deprecated.Replaced by getDefaultFontName -
getSize
public static int getSize()Deprecated.Replaced by getDefaultFontSize -
getStyle
public static int getStyle()Deprecated.Replaced by getDefaultFontStyle -
setCurrentFont
Deprecated.Replaced by setFont(font)
-