ij.gui
Class TextRoi

java.lang.Object
  extended byij.gui.Roi
      extended byij.gui.TextRoi
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class TextRoi
extends Roi

This class is a rectangular ROI containing text.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class ij.gui.Roi
ANGLE, cachedMask, center, clipboard, clipHeight, clipWidth, clipX, clipY, COMPOSITE, constrain, CONSTRUCTING, FREELINE, FREEROI, HANDLE_SIZE, handleColor, ic, imp, instanceColor, LINE, mag, MOVING, MOVING_HANDLE, NORMAL, NOT_PASTING, oldHeight, oldWidth, oldX, oldY, OVAL, pasteMode, POINT, 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.
 void drawPixels(ImageProcessor ip)
          Renders the text on the image.
static java.lang.String getFont()
          Returns the name of the current font.
static int getSize()
          Returns the current font size.
static int getStyle()
          Returns the current font style.
protected  void handleMouseUp(int screenX, int screenY)
           
static boolean isAntialiased()
           
static void setFont(java.lang.String fontName, int fontSize, int fontStyle)
          Sets the font face, size and style.
static void setFont(java.lang.String fontName, int fontSize, int fontStyle, boolean antialiased)
          Sets the font face, size, style and antialiasing mode.
 
Methods inherited from class ij.gui.Roi
abortPaste, clone, contains, drawPixels, endPaste, equals, getAngle, getBoundingRect, getBounds, getColor, getCurrentPasteMode, getFeretsDiameter, getLength, getMask, getName, getPasteMode, getPolygon, getState, getType, getTypeAsString, grow, handleMouseDown, handleMouseDrag, isArea, isHandle, isLine, isVisible, mouseDownInHandle, moveHandle, nudge, nudgeCorner, setColor, setImage, setInstanceColor, setLocation, setName, setPasteMode, showStatus, startPaste, toString, update, updateClipRect
 
Methods inherited from class java.lang.Object
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.


drawPixels

public void drawPixels(ImageProcessor ip)
Renders the text on the image.

Overrides:
drawPixels in class Roi
See Also:
ImageProcessor.setColor(java.awt.Color), ImageProcessor.setLineWidth(int)

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 name of the current font.


getSize

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


getStyle

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


isAntialiased

public static boolean isAntialiased()

setFont

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


setFont

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


handleMouseUp

protected void handleMouseUp(int screenX,
                             int screenY)
Overrides:
handleMouseUp in class Roi