public class TextRoi extends Roi
| Modifier and Type | Field and Description |
|---|---|
static int |
CENTER |
static int |
LEFT |
static int |
RIGHT |
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 and 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.
|
| Modifier and Type | Method and Description |
|---|---|
void |
draw(Graphics g)
Draws the text on the screen, clipped to the ROI.
|
void |
drawOverlay(Graphics g) |
double |
getAngle()
Overridden by PolygonRoi (angle between first two points), TextRoi (text
angle) and Line (line angle).
|
boolean |
getAntialiased()
Returns the state of the 'antialiased' instance variable.
|
Font |
getCurrentFont()
Returns the current (instance) font.
|
boolean |
getDrawStringMode() |
static String |
getFont()
Returns the name of the global (default) font.
|
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).
|
static int |
getSize()
Returns the global (default) font size.
|
static int |
getStyle()
Returns the global (default) font style.
|
String |
getText() |
static boolean |
isAntialiased()
Returns the state of 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 antialiased)
Sets the 'antialiased' instance variable.
|
void |
setCurrentFont(Font font)
Set the current (instance) font.
|
static void |
setDefaultAngle(double angle)
Sets the default angle.
|
static void |
setDefaultFillColor(Color fillColor)
Sets the default fill (background) color.
|
void |
setDrawStringMode(boolean drawStringMode) |
static void |
setFont(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(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)
|
static String[] |
split(String str,
String delim)
Splits a string into substring using the characters contained in the
second argument as the delimiter set.
|
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, toStringpublic static final int LEFT
public static final int CENTER
public static final int RIGHT
public TextRoi(int x,
int y,
String text)
public TextRoi(double x,
double y,
String text)
public TextRoi(int x,
int y,
String text,
Font font)
public TextRoi(double x,
double y,
String text,
Font font)
public TextRoi(double x,
double y,
double width,
double height,
String text,
Font font)
public static String[] split(String str, String delim)
public void draw(Graphics g)
public void drawOverlay(Graphics g)
drawOverlay in class Roipublic static String getFont()
public static int getSize()
public static int getStyle()
public void setCurrentFont(Font font)
public Font getCurrentFont()
public static boolean isAntialiased()
public void setAntialiased(boolean antialiased)
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(String fontName, int fontSize, int fontStyle)
public static void setFont(String fontName, int fontSize, int fontStyle, boolean antialiased)
public static void setDefaultFillColor(Color fillColor)
public static void setDefaultAngle(double angle)
public String getText()
public boolean isDrawingTool()
RoiisDrawingTool in class Roipublic double getAngle()
Roipublic void setAngle(double angle)
public boolean getDrawStringMode()
public void setDrawStringMode(boolean drawStringMode)
Copyright © 2023. All rights reserved.