Class TextRoi
java.lang.Object
org.micromanager.ndviewer.overlay.Roi
org.micromanager.ndviewer.overlay.TextRoi
- All Implemented Interfaces:
Serializable,Cloneable
public class TextRoi extends Roi
This class is a rectangular ROI containing text.
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class org.micromanager.ndviewer.overlay.Roi
ANGLE, asp_bk, aspect, center, clipHeight, clipWidth, clipX, clipY, COMPOSITE, constrain, CONSTRUCTING, fillColor, FREELINE, FREEROI, HANDLE_SIZE, handleColor, ignoreClipRect, instanceColor, LINE, lineWidth, mag, MOVING, MOVING_HANDLE, nonScalable, NORMAL, NOT_PASTING, oldHeight, oldWidth, oldX, oldY, onePixelWide, OVAL, overlay, POINT, POLYGON, POLYLINE, previousRoi, RECTANGLE, RESIZING, ROIColor, stroke, strokeColor, TRACED_ROI, type, updateFullWindow, wideLine, xMax, yMax -
Constructor Summary
Constructors Constructor Description TextRoi(double x, double y, double width, double height, String text, Font font)Creates a TextRoi using the specified location, size and Font.TextRoi(double x, double y, String text)Creates a TextRoi using sub-pixel coordinates.TextRoi(double x, double y, String text, Font font)Creates a TextRoi using the specified sub-pixel location and Font.TextRoi(int x, int y, String text)Creates a TextRoi.TextRoi(int x, int y, String text, Font font)Creates a TextRoi using the specified location and Font. -
Method Summary
Modifier and Type Method Description voiddraw(Graphics g)Draws the text on the screen, clipped to the ROI.voiddrawOverlay(Graphics g)doublegetAngle()Overridden by PolygonRoi (angle between first two points), TextRoi (text angle) and Line (line angle).booleangetAntialiased()Returns the state of the 'antialiased' instance variable.FontgetCurrentFont()Returns the current (instance) font.booleangetDrawStringMode()static StringgetFont()Returns the name of the global (default) font.static intgetGlobalJustification()Returns the global (default) justification (LEFT, CENTER or RIGHT).intgetJustification()Returns the value of the 'justification' instance variable (LEFT, CENTER or RIGHT).static intgetSize()Returns the global (default) font size.static intgetStyle()Returns the global (default) font style.StringgetText()static booleanisAntialiased()Returns the state of global 'antialiasedText' variable, which is used by the "Fonts" widget.booleanisDrawingTool()Returns 'true' if this is an ROI primarily used from drawing (e.g., TextRoi or Arrow).voidsetAngle(double angle)voidsetAntialiased(boolean antialiased)Sets the 'antialiased' instance variable.voidsetCurrentFont(Font font)Set the current (instance) font.static voidsetDefaultAngle(double angle)Sets the default angle.static voidsetDefaultFillColor(Color fillColor)Sets the default fill (background) color.voidsetDrawStringMode(boolean drawStringMode)static voidsetFont(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 voidsetFont(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 voidsetGlobalJustification(int justification)Sets the 'justification' instance variable (must be LEFT, CENTER or RIGHT)voidsetJustification(int justification)Sets the 'justification' instance variable (must be LEFT, CENTER or RIGHT)static String[]split(String str, String delim)Splits a string into substring using the characters contained in the second argument as the delimiter set.Methods inherited from class org.micromanager.ndviewer.overlay.Roi
clipRectMargin, contains, copyAttributes, enableSubPixelResolution, getBoundingRect, getBounds, getColor, getConvexHull, getCornerDiameter, getCPosition, getDebugInfo, getDefaultFillColor, getDrawOffset, getFillColor, getFloatBounds, getFloatHeight, getFloatWidth, getHashCode, getName, getPolygon, getPosition, getProperties, getProperty, getPropertyCount, getPrototypeOverlay, getRoundRectArcSize, getState, getStroke, getStrokeColor, getStrokeWidth, getTPosition, getType, getTypeAsString, getXBase, getYBase, getZPosition, isArea, isCursor, isLine, setColor, setCornerDiameter, setDrawOffset, setFillColor, setIgnoreClipRect, setIsCursor, setLocation, setLocation, setName, setNonScalable, setPosition, setPosition, setProperty, setPrototypeOverlay, setRotationCenter, setRoundRectArcSize, setStroke, setStrokeColor, setStrokeWidth, setStrokeWidth, subPixelResolution, temporarilyHide, toFloat, toInt, toInt, toIntR, toString
-
Field Details
-
LEFT
public static final int LEFT- See Also:
- Constant Field Values
-
CENTER
public static final int CENTER- See Also:
- Constant Field Values
-
RIGHT
public static final int RIGHT- See Also:
- Constant Field Values
-
-
Constructor Details
-
TextRoi
Creates a TextRoi. -
TextRoi
Creates a TextRoi using sub-pixel coordinates. -
TextRoi
Creates a TextRoi using the specified location and Font. -
TextRoi
Creates a TextRoi using the specified sub-pixel location and Font. -
TextRoi
Creates a TextRoi using the specified location, size and Font. public TextRoi(int x, int y, int width, int height, String text, Font font) { super(x, y, width, height); init(text, font); } /** Creates a TextRoi using the specified sub-pixel location, size and Font.
-
-
Method Details
-
split
Splits a string into substring using the characters contained in the second argument as the delimiter set. -
draw
Draws the text on the screen, clipped to the ROI. -
drawOverlay
- Overrides:
drawOverlayin classRoi
-
getFont
Returns the name of the global (default) font. -
getSize
public static int getSize()Returns the global (default) font size. -
getStyle
public static int getStyle()Returns the global (default) font style. -
setCurrentFont
Set the current (instance) font. -
getCurrentFont
Returns the current (instance) font. -
isAntialiased
public static boolean isAntialiased()Returns the state of global 'antialiasedText' variable, which is used by the "Fonts" widget. -
setAntialiased
public void setAntialiased(boolean antialiased)Sets the 'antialiased' instance variable. -
getAntialiased
public boolean getAntialiased()Returns the state of the 'antialiased' instance variable. -
setGlobalJustification
public static void setGlobalJustification(int justification)Sets the 'justification' instance variable (must be LEFT, CENTER or RIGHT) -
getGlobalJustification
public static int getGlobalJustification()Returns the global (default) justification (LEFT, CENTER or RIGHT). -
setJustification
public void setJustification(int justification)Sets the 'justification' instance variable (must be 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. -
setDefaultFillColor
Sets the default fill (background) color. -
setDefaultAngle
public static void setDefaultAngle(double angle)Sets the default angle. -
getText
-
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
-
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)
-