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 Details

  • Constructor Details

    • TextRoi

      public TextRoi​(int x, int y, String text)
      Creates a TextRoi.
    • TextRoi

      public TextRoi​(double x, double y, String text)
      Creates a TextRoi using sub-pixel coordinates.
    • TextRoi

      public TextRoi​(int x, int y, String text, Font font)
      Creates a TextRoi using the specified location and Font.
      See Also:
      Roi.setStrokeColor(java.awt.Color), Roi.setNonScalable(boolean)
    • TextRoi

      public TextRoi​(double x, double y, String text, Font font)
      Creates a TextRoi using the specified sub-pixel location and Font.
    • TextRoi

      public TextRoi​(double x, double y, double width, double height, String text, Font font)
      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

      public static String[] split​(String str, String delim)
      Splits a string into substring using the characters contained in the second argument as the delimiter set.
    • draw

      public void draw​(Graphics g)
      Draws the text on the screen, clipped to the ROI.
      Overrides:
      draw in class Roi
    • drawOverlay

      public void drawOverlay​(Graphics g)
      Overrides:
      drawOverlay in class Roi
    • getFont

      public static String 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

      public void setCurrentFont​(Font font)
      Set the current (instance) font.
    • getCurrentFont

      public 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

      public 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.
    • setFont

      public 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.
    • setDefaultFillColor

      public static void setDefaultFillColor​(Color fillColor)
      Sets the default fill (background) color.
    • setDefaultAngle

      public static void setDefaultAngle​(double angle)
      Sets the default angle.
    • getText

      public String getText()
    • isDrawingTool

      public boolean isDrawingTool()
      Description copied from class: Roi
      Returns 'true' if this is an ROI primarily used from drawing (e.g., TextRoi or Arrow).
      Overrides:
      isDrawingTool in class Roi
    • getAngle

      public double getAngle()
      Description copied from class: Roi
      Overridden by PolygonRoi (angle between first two points), TextRoi (text angle) and Line (line angle).
      Overrides:
      getAngle in class Roi
    • setAngle

      public void setAngle​(double angle)
    • getDrawStringMode

      public boolean getDrawStringMode()
    • setDrawStringMode

      public void setDrawStringMode​(boolean drawStringMode)