Module ij
Package ij.text

Class TextWindow

All Implemented Interfaces:
ActionListener, FocusListener, ItemListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class TextWindow extends Frame implements ActionListener, FocusListener, ItemListener
Uses a TextPanel to displays text in a window.
See Also:
  • Field Details

  • Constructor Details

    • TextWindow

      public TextWindow(String title, String text, int width, int height)
      Opens a new single-column text window.
      Parameters:
      title - the title of the window
      text - the text initially displayed in the window
      width - the width of the window in pixels
      height - the height of the window in pixels
    • TextWindow

      public TextWindow(String title, String headings, String text, int width, int height)
      Opens a new multi-column text window.
      Parameters:
      title - title of the window
      headings - the tab-delimited column headings
      text - text initially displayed in the window
      width - width of the window in pixels
      height - height of the window in pixels
    • TextWindow

      public TextWindow(String title, String headings, ArrayList text, int width, int height)
      Opens a new multi-column text window.
      Parameters:
      title - title of the window
      headings - tab-delimited column headings
      text - ArrayList containing the text to be displayed in the window
      width - width of the window in pixels
      height - height of the window in pixels
    • TextWindow

      public TextWindow(String path, int width, int height)
      Opens a new text window containing the contents of a text file.
      Parameters:
      path - the path to the text file
      width - the width of the window in pixels
      height - the height of the window in pixels
  • Method Details

    • append

      public void append(String text)
      Adds one or more lines of text to the window.
      Parameters:
      text - The text to be appended. Multiple lines should be separated by \n.
    • getTextPanel

      public TextPanel getTextPanel()
      Returns a reference to this TextWindow's TextPanel.
    • getResultsTable

      public ResultsTable getResultsTable()
      Returns the ResultsTable associated with this TextWindow, or null.
    • load

      public void load(BufferedReader in) throws IOException
      Appends the text in the specified file to the end of this TextWindow.
      Throws:
      IOException
    • actionPerformed

      public void actionPerformed(ActionEvent evt)
      Specified by:
      actionPerformed in interface ActionListener
    • processWindowEvent

      public void processWindowEvent(WindowEvent e)
      Overrides:
      processWindowEvent in class Window
    • itemStateChanged

      public void itemStateChanged(ItemEvent e)
      Specified by:
      itemStateChanged in interface ItemListener
    • close

      public void close()
    • close

      public void close(boolean showDialog)
      Closes this TextWindow. Display a "save changes" dialog if this is the "Results" window and 'showDialog' is true.
    • rename

      public void rename(String title)
    • setFont

      public static void setFont(String name, int style, int size)
    • setMonospaced

      public static void setMonospaced(boolean b)
    • setAntialiased

      public static void setAntialiased(boolean b)
    • focusGained

      public void focusGained(FocusEvent e)
      Specified by:
      focusGained in interface FocusListener
    • focusLost

      public void focusLost(FocusEvent e)
      Specified by:
      focusLost in interface FocusListener