Class ScriptingPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, TitleUpdatedListener
Direct Known Subclasses:
FileScriptingPanel, SimpleCLIPanel

public abstract class ScriptingPanel extends JPanel implements TitleUpdatedListener
Abstract ancestor for scripting panels.
Version:
$Revision: 15290 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
  • Constructor Details

    • ScriptingPanel

      public ScriptingPanel()
      Default constructor.
  • Method Details

    • terminate

      public void terminate()
      Terminates this panel, i.e., terminates the output threads it started. Removes the output and error streams from the corresponding tees as well so that garbage collection succeeds.
    • getIcon

      public abstract ImageIcon getIcon()
      Returns an icon to be used in a frame.
      Returns:
      the icon
    • getTitle

      public abstract String getTitle()
      Returns the current title for the frame/dialog.
      Returns:
      the title
    • getOutput

      public abstract JTextPane getOutput()
      Returns the text area that is used for displaying output on stdout and stderr.
      Returns:
      the JTextArea
    • getMenuBar

      public abstract JMenuBar getMenuBar()
      Returns the menu bar to to be displayed in the frame.
      Returns:
      the menu bar, null if not applicable
    • setDebug

      public void setDebug(boolean value)
      Turns on/off debugging mode.
      Parameters:
      value - if true, debug mode is turned on
    • getDebug

      public boolean getDebug()
      Returns whether debugging mode is on.
      Returns:
      true if debug mode is turned on
    • addTitleUpdatedListener

      public void addTitleUpdatedListener(TitleUpdatedListener l)
      Adds the listener to the internal list.
      Parameters:
      l - the listener to add
    • removeTitleUpdatedListener

      public void removeTitleUpdatedListener(TitleUpdatedListener l)
      Removes the listener from the internal list.
      Parameters:
      l - the listener to remove
    • titleUpdated

      public void titleUpdated(TitleUpdatedEvent event)
      Gets called when the title of the frame/dialog needs updating.
      Specified by:
      titleUpdated in interface TitleUpdatedListener
      Parameters:
      event - the event that got sent
    • showPanel

      public static void showPanel(ScriptingPanel panel, String[] args)
      Displays the panel in a frame.
      Parameters:
      panel - the panel to display
      args - currently ignored commandline parameters
    • showPanel

      public static void showPanel(ScriptingPanel panel, String[] args, int width, int height)
      Displays the panel in a frame.
      Parameters:
      panel - the panel to display
      args - currently ignored commandline parameters
      width - the width of the frame
      height - the height of the frame