ij.gui
Class TextRoi

java.lang.Object
  extended by ij.gui.Roi
      extended by ij.gui.TextRoi
All Implemented Interfaces:
java.lang.Cloneable

public class TextRoi
extends Roi

This class is a rectangular ROI containing text.


Field Summary
 
Fields inherited from class ij.gui.Roi
clipboard, clipHeight, clipWidth, clipX, clipY, constrain, CONSTRUCTING, FREELINE, FREEROI, HANDLE_SIZE, ic, imp, LINE, MOVING, NORMAL, oldHeight, oldWidth, oldX, oldY, OVAL, pasteMode, POLYGON, POLYLINE, previousRoi, RECTANGLE, RESIZING, ROIColor, TRACED_ROI, type, updateFullWindow, xMax, yMax
 
Constructor Summary
TextRoi(int x, int y, ImagePlus imp)
           
 
Method Summary
 void addChar(char c)
          Adds the specified character to the end of the text string.
 void draw(java.awt.Graphics g)
          Draws the text on the screen, clipped to the ROI.
static java.lang.String getFont()
          Returns the current font.
 int[] getMask()
          Returns a mask that can be used to draw the text on an image.
static int getSize()
          Returns the current font size.
static int getStyle()
          Returns the current font style.
static void setFont(java.lang.String fontName, int fontSize, int fontStyle)
          Sets the font face, size and style.
 
Methods inherited from class ij.gui.Roi
abortPaste, clone, contains, drawPixels, endPaste, getAngle, getBoundingRect, getColor, getLength, getState, getType, grow, handleMouseDown, handleMouseDrag, handleMouseUp, nudge, nudgeCorner, setColor, setImage, setLocation, setPasteMode, showStatus, toString, updateClipRect
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextRoi

public TextRoi(int x,
               int y,
               ImagePlus imp)
Method Detail

addChar

public void addChar(char c)
Adds the specified character to the end of the text string.


getMask

public int[] getMask()
Returns a mask that can be used to draw the text on an image.

Overrides:
getMask in class Roi

draw

public void draw(java.awt.Graphics g)
Draws the text on the screen, clipped to the ROI.

Overrides:
draw in class Roi

getFont

public static java.lang.String getFont()
Returns the current font.


getSize

public static int getSize()
Returns the current font size.


getStyle

public static int getStyle()
Returns the current font style.


setFont

public static void setFont(java.lang.String fontName,
                           int fontSize,
                           int fontStyle)
Sets the font face, size and style.