|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectij.gui.Roi
ij.gui.TextRoi
public class TextRoi
This class is a rectangular ROI containing text.
Field Summary | |
---|---|
static int |
CENTER
|
static int |
LEFT
|
static int |
RIGHT
|
Fields inherited from class ij.gui.Roi |
---|
ANGLE, asp_bk, aspect, cachedMask, center, clipboard, clipHeight, clipWidth, clipX, clipY, COMPOSITE, constrain, CONSTRUCTING, fillColor, 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, previousRoi, RECTANGLE, RESIZING, ROIColor, stroke, strokeColor, TRACED_ROI, type, updateFullWindow, wideLine, xMax, yMax |
Constructor Summary | |
---|---|
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,
ImagePlus imp)
|
|
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. |
|
TextRoi(int x,
int y,
String text,
Font font,
Color color)
Deprecated. |
|
TextRoi(String text,
double x,
double y,
Font font)
Use this constructor as a drop-in replacement for ImageProcessor.drawString(). |
Method Summary | |
---|---|
void |
addChar(char c)
This method is used by the text tool to add typed characters to displayed text selections. |
void |
clear(ImageProcessor ip)
|
Object |
clone()
Returns a copy of this TextRoi. |
void |
draw(Graphics g)
Draws the text on the screen, clipped to the ROI. |
void |
drawOverlay(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 '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). |
String |
getMacroCode(String cmd,
ImagePlus imp)
Used by the Recorder for recording the text tool. |
static int |
getSize()
Returns the global (default) font size. |
static int |
getStyle()
Returns the global (default) font style. |
String |
getText()
|
protected void |
handleMouseUp(int screenX,
int screenY)
|
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) |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int LEFT
public static final int CENTER
public static final int RIGHT
Constructor Detail |
---|
public TextRoi(int x, int y, String text)
public TextRoi(String text, double x, double y, Font font)
public TextRoi(double x, double y, String text)
public TextRoi(int x, int y, String text, Font font)
Roi.setStrokeColor(java.awt.Color)
,
Roi.setNonScalable(boolean)
,
ImagePlus.setOverlay(ij.gui.Overlay)
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 TextRoi(int x, int y, String text, Font font, Color color)
public TextRoi(int x, int y, ImagePlus imp)
Method Detail |
---|
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(Graphics g)
draw
in class Roi
public void drawOverlay(Graphics g)
drawOverlay
in class Roi
public 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)
protected void handleMouseUp(int screenX, int screenY)
handleMouseUp
in class Roi
public String getMacroCode(String cmd, ImagePlus imp)
public String getText()
public boolean isDrawingTool()
Roi
isDrawingTool
in class Roi
public void clear(ImageProcessor ip)
public Object clone()
clone
in class Roi
public double getAngle()
Roi
getAngle
in class Roi
public void setAngle(double angle)
public boolean getDrawStringMode()
public void setDrawStringMode(boolean drawStringMode)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |