org.jpop.gui
Class PoplogProcessConsole

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byorg.jpop.gui.ProcessConsole
                      extended byorg.jpop.gui.PoplogProcessConsole
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class PoplogProcessConsole
extends ProcessConsole

A console that displays IO for a poplog process. This only extends ProcessConsole to add some tools and commandlines specific to poplog along with the appropriate commands needed to run any of the poplog interfaces (pop11, clisp, ML, etc). This is the JEdit-independent class. The JEdit-specific version includes a whole heap of stuff needed to make this into a JEdit plugin proper.

Version:
1.0
Author:
dsm
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.lang.String DEFAULT_PREFIX
          Strings for the properties file
protected static java.lang.String[] DEFINED_PROPERTIES
          An array with all properties defined by the object, using the following prefix keys: [S]=String (Default), [I]=Integer [B]=Bool, [C]=Color, [Z]=Size, [F]=File, [D]=Directory [P]=Point, [K]=Icon, [L]=long (multiline) String, [A]=Array/List
static java.lang.String IMG_CLASSPATH
          The directory where the images are
 
Fields inherited from class org.jpop.gui.ProcessConsole
STDERR, STDOUT
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
  PoplogProcessConsole(java.awt.Component parent)
          Constructor for PoplogProcessConsole
protected PoplogProcessConsole(java.lang.String propertiesFilePath)
          Constructor for PoplogProcessConsole
protected PoplogProcessConsole(java.lang.String propertiesFilePath, java.awt.Component parent)
          Constructor for PoplogProcessConsole
 
Method Summary
protected  void addListeners()
          Adds the listeners to the PoplogProcessConsole object
 void applyProperties()
          Checks the properties to see if anything needs changing from defaults.
 void buttonMouseEntered(javax.swing.JButton jb)
          Called when a button has the mouse over it
 void buttonMouseExited(javax.swing.JButton jb)
          Called when a button has the mouse taken away from over it
 void clearStderrButtonActionPerformed()
          When the clear stderr button is clicked
 void clearStdinButtonActionPerformed()
          When the clear stdin button is clicked
 void clearStdoutButtonActionPerformed()
          When the clear stdout button is clicked
 void close()
          Closes the object
 void compileFileButtonActionPerformed()
          When the compile button is clicked this happens
 void debug(java.lang.String s)
          Debug messaged get printed to stdout
 void editPropertiesButtonActionPerformed()
          When the Edit Properties Button is clicked
 void executeStdinButtonActionPerformed()
          when the execute stdin button is pressed
 PoplogDocBrowser getDocBrowser()
          Gets the doc browser value of the PoplogProcessConsole object
 java.util.Properties getProperties()
          Gets the properties attribute of the PoplogProcessConsole object
 PropertiesEditor getPropertiesEditor()
          Gets the properties editor value of the PoplogProcessConsole object
 java.lang.String getPropertiesFileName()
          Gets the properties file name attribute of the PoplogProcessConsole object
 java.lang.String getPropertiesFilePath()
          Gets the properties file path attribute of the PoplogProcessConsole object
 java.lang.String getProperty(java.lang.String key)
          Gets the property attribute of the PoplogProcessConsole object
 void helpButtonActionPerformed()
          What happens when the help button is clicked
 void initButtonForToolbar(javax.swing.JButton jb)
          Initializes the button to the look and feel of the other buttons in the toolbar
 boolean isFirstRun()
          Gets the first run attribute of the PoplogProcessConsole object
 void killButtonActionPerformed()
          When the kill button is pressed
protected  void loadDefaultProperties()
          Creates the default properties of the object ad adds them to the main properties.
 void loadProperties()
          Loads the properties of the object
static void main(java.lang.String[] args)
          The main program for the PoplogProcessConsole class
 void poplogDocsButtonActionPerformed()
          What happens when the poplog docs button is clicked
 void processChooserActionPerformed()
          When a selection is made int the process chooser
 void processKilled()
          When a process gets killed
 void processStarted()
          Happens every time the process starts
protected  void removeEditPropertiesButton()
          Removes the Edit Properties button from the gui
 void respawnActionPerformed()
          When the respawn button is pressed
 void saveProperties()
          Saves the properties of the object
 void setFirstRun(boolean firstRun)
          Sets the first run attribute of the PoplogProcessConsole object
 void setInputPanePreferredSize(java.awt.Dimension d)
          Sets the input pane preferred size attribute of the PoplogProcessConsole object
 void setOutputTabsPreferredSize(java.awt.Dimension d)
          Sets the output tabs preferred size attribute of the PoplogProcessConsole object
 void setProcessChoices(java.lang.Object[] oa)
          Sets the coices of the combo box to s
 void setProcessName(java.lang.String processName)
          Sets the process name attribute of the PoplogProcessConsole object
 void setProperties(java.util.Properties properties)
          Sets the properties attribute of the PoplogProcessConsole object
protected  void setPropertiesFilePath(java.lang.String propertiesFilePath)
          Sets the properties file path attribute of the PoplogProcessConsole object
 void setProperty(java.lang.String key, java.lang.String value)
          Sets the property attribute of the PoplogProcessConsole object
 void setRespawnable(boolean respawnable)
          Sets the respawnable attribute of the PoplogProcessConsole object
 void setShowButtonsText(boolean showButtonText)
          Sets the show button text attribute of the PoplogProcessConsole object
 void setStderrColor(java.awt.Color stderrColor)
          Sets the stderr color attribute of the PoplogProcessConsole object
 void setStderrText(java.lang.String s, boolean addToInit)
          Sets the stderr text attribute of the PoplogProcessConsole object
 void setStdinColor(java.awt.Color stdinColor)
          Sets the stdin color attribute of the PoplogProcessConsole object
 void setStdinText(java.lang.String s, boolean addToInit)
          Sets the stdin text attribute of the PoplogProcessConsole object
 void setStdoutColor(java.awt.Color stdoutColor)
          Sets the stdout color attribute of the PoplogProcessConsole object
 void setStdoutText(java.lang.String s, boolean addToInit)
          Sets the stdout text attribute of the PoplogProcessConsole object
 void setVerticalSplit(boolean verticalSplit)
          Sets the vertical split attribute of the PoplogProcessConsole object
 void spawnButtonActionPerformed()
          When the spawn button is pressed
 void stderrTextChanged()
          this method is called when the text in stderr is changed by a method, like appendToStderr() or setStderrText().
 void stdinTextChanged()
          this method is called when the text in stdin is changed by a method, like appendToStdin() or setStdinText().
 void stdoutTextChanged()
          this method is called when the text in stdout is changed by a method, like appendToStdout() or setStdoutText().
 void updateGuiProperties()
          this loads the GUI properties to the propertoies object
 
Methods inherited from class org.jpop.gui.ProcessConsole
addTool, appendToStderr, appendToStdin, appendToStdout, execBufferedReader, execFile, getInputPanelSize, getInputPanePreferredSize, getIOControl, getOutputTabsPreferredSize, getOutputTabsSize, getPrinter, getProcessName, getStderrColor, getStderrText, getStdinColor, getStdinText, getStdoutColor, getStdoutText, isRespawnable, isRunning, isVerticalSplit, kill, makeOutputPanes, removeTool, respawn, setSelectedTab, setStderrReader, setStderrText, setStdinText, setStdoutReader, setStdoutText, spawn, stderrPaneRequestFocus, stdinPaneRequestFocus, stdoutPaneRequestFocus
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

IMG_CLASSPATH

public static final java.lang.String IMG_CLASSPATH
The directory where the images are

See Also:
Constant Field Values

DEFAULT_PREFIX

public static final java.lang.String DEFAULT_PREFIX
Strings for the properties file

See Also:
Constant Field Values

DEFINED_PROPERTIES

protected static final java.lang.String[] DEFINED_PROPERTIES
An array with all properties defined by the object, using the following prefix keys: [S]=String (Default), [I]=Integer [B]=Bool, [C]=Color, [Z]=Size, [F]=File, [D]=Directory [P]=Point, [K]=Icon, [L]=long (multiline) String, [A]=Array/List

Constructor Detail

PoplogProcessConsole

public PoplogProcessConsole(java.awt.Component parent)
Constructor for PoplogProcessConsole

Parameters:
parent - The parent of this object

PoplogProcessConsole

protected PoplogProcessConsole(java.lang.String propertiesFilePath)
Constructor for PoplogProcessConsole

Parameters:
propertiesFilePath -

PoplogProcessConsole

protected PoplogProcessConsole(java.lang.String propertiesFilePath,
                               java.awt.Component parent)
Constructor for PoplogProcessConsole

Parameters:
propertiesFilePath -
parent -
Method Detail

main

public static void main(java.lang.String[] args)
The main program for the PoplogProcessConsole class

Parameters:
args - The command line arguments

setFirstRun

public void setFirstRun(boolean firstRun)
Sets the first run attribute of the PoplogProcessConsole object

Parameters:
firstRun - The new firstRun value

setInputPanePreferredSize

public void setInputPanePreferredSize(java.awt.Dimension d)
Sets the input pane preferred size attribute of the PoplogProcessConsole object

Overrides:
setInputPanePreferredSize in class ProcessConsole
Parameters:
d - The new inputPanePreferredSize value

setOutputTabsPreferredSize

public void setOutputTabsPreferredSize(java.awt.Dimension d)
Sets the output tabs preferred size attribute of the PoplogProcessConsole object

Overrides:
setOutputTabsPreferredSize in class ProcessConsole
Parameters:
d - The new outputTabsPreferredSize value

setProcessChoices

public void setProcessChoices(java.lang.Object[] oa)
Sets the coices of the combo box to s

Parameters:
oa - The new processChoices value

setProcessName

public void setProcessName(java.lang.String processName)
Sets the process name attribute of the PoplogProcessConsole object

Overrides:
setProcessName in class ProcessConsole
Parameters:
processName - The new processName value

setProperties

public void setProperties(java.util.Properties properties)
Sets the properties attribute of the PoplogProcessConsole object

Parameters:
properties - The new properties value

setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)
Sets the property attribute of the PoplogProcessConsole object

Parameters:
key - The new property value
value - The new property value

setRespawnable

public void setRespawnable(boolean respawnable)
Sets the respawnable attribute of the PoplogProcessConsole object

Overrides:
setRespawnable in class ProcessConsole
Parameters:
respawnable - The new respawnable value

setShowButtonsText

public void setShowButtonsText(boolean showButtonText)
Sets the show button text attribute of the PoplogProcessConsole object

Parameters:
showButtonText - The new showButtonText value

setStderrColor

public void setStderrColor(java.awt.Color stderrColor)
Sets the stderr color attribute of the PoplogProcessConsole object

Overrides:
setStderrColor in class ProcessConsole
Parameters:
stderrColor - The new stderrColor value

setStderrText

public void setStderrText(java.lang.String s,
                          boolean addToInit)
Sets the stderr text attribute of the PoplogProcessConsole object

Parameters:
s - The new stderrText value
addToInit - whether the text should be added to the properties (default false)

setStdinColor

public void setStdinColor(java.awt.Color stdinColor)
Sets the stdin color attribute of the PoplogProcessConsole object

Overrides:
setStdinColor in class ProcessConsole
Parameters:
stdinColor - The new stdinColor value

setStdinText

public void setStdinText(java.lang.String s,
                         boolean addToInit)
Sets the stdin text attribute of the PoplogProcessConsole object

Parameters:
s - The new stdinText value
addToInit - whether the text should be added to the properties (default false)

setStdoutColor

public void setStdoutColor(java.awt.Color stdoutColor)
Sets the stdout color attribute of the PoplogProcessConsole object

Overrides:
setStdoutColor in class ProcessConsole
Parameters:
stdoutColor - The new stdoutColor value

setStdoutText

public void setStdoutText(java.lang.String s,
                          boolean addToInit)
Sets the stdout text attribute of the PoplogProcessConsole object

Parameters:
s - The new stdoutText value
addToInit - whether the text should be added to the properties (default false)

setVerticalSplit

public void setVerticalSplit(boolean verticalSplit)
Sets the vertical split attribute of the PoplogProcessConsole object

Overrides:
setVerticalSplit in class ProcessConsole
Parameters:
verticalSplit - The new verticalSplit value

getDocBrowser

public PoplogDocBrowser getDocBrowser()
Gets the doc browser value of the PoplogProcessConsole object

Returns:
The docBrowser value

getProperties

public java.util.Properties getProperties()
Gets the properties attribute of the PoplogProcessConsole object

Returns:
The properties value

getPropertiesEditor

public PropertiesEditor getPropertiesEditor()
Gets the properties editor value of the PoplogProcessConsole object

Returns:
The propertiesEditor value

getPropertiesFileName

public java.lang.String getPropertiesFileName()
Gets the properties file name attribute of the PoplogProcessConsole object

Returns:
The propertiesFileName value

getPropertiesFilePath

public java.lang.String getPropertiesFilePath()
Gets the properties file path attribute of the PoplogProcessConsole object

Returns:
The propertiesFilePath value

getProperty

public java.lang.String getProperty(java.lang.String key)
Gets the property attribute of the PoplogProcessConsole object

Parameters:
key -
Returns:
The property value

isFirstRun

public boolean isFirstRun()
Gets the first run attribute of the PoplogProcessConsole object

Returns:
The firstRun value

debug

public void debug(java.lang.String s)
Debug messaged get printed to stdout

Specified by:
debug in class ProcessConsole
Parameters:
s -

processKilled

public void processKilled()
When a process gets killed

Specified by:
processKilled in class ProcessConsole

applyProperties

public void applyProperties()
Checks the properties to see if anything needs changing from defaults. On subclasses the implementation should look:
. protected void applyProperties(){
.     super.applyProperties();
.     String s;
.
.     if((s = getProperty("prop-name")) != null) {
.         // cast or convert and apply s
.     }
.     ...
. }


buttonMouseEntered

public void buttonMouseEntered(javax.swing.JButton jb)
Called when a button has the mouse over it

Parameters:
jb - The button in question

buttonMouseExited

public void buttonMouseExited(javax.swing.JButton jb)
Called when a button has the mouse taken away from over it

Parameters:
jb - The button in question

clearStderrButtonActionPerformed

public void clearStderrButtonActionPerformed()
When the clear stderr button is clicked


clearStdinButtonActionPerformed

public void clearStdinButtonActionPerformed()
When the clear stdin button is clicked


clearStdoutButtonActionPerformed

public void clearStdoutButtonActionPerformed()
When the clear stdout button is clicked


close

public void close()
           throws java.io.IOException
Description copied from class: ProcessConsole
Closes the object

Overrides:
close in class ProcessConsole
Throws:
java.io.IOException

compileFileButtonActionPerformed

public void compileFileButtonActionPerformed()
When the compile button is clicked this happens


editPropertiesButtonActionPerformed

public void editPropertiesButtonActionPerformed()
When the Edit Properties Button is clicked


executeStdinButtonActionPerformed

public void executeStdinButtonActionPerformed()
when the execute stdin button is pressed


helpButtonActionPerformed

public void helpButtonActionPerformed()
What happens when the help button is clicked


initButtonForToolbar

public void initButtonForToolbar(javax.swing.JButton jb)
Initializes the button to the look and feel of the other buttons in the toolbar

Parameters:
jb -

killButtonActionPerformed

public void killButtonActionPerformed()
When the kill button is pressed


loadProperties

public void loadProperties()
Loads the properties of the object


poplogDocsButtonActionPerformed

public void poplogDocsButtonActionPerformed()
What happens when the poplog docs button is clicked


processChooserActionPerformed

public void processChooserActionPerformed()
When a selection is made int the process chooser


processStarted

public void processStarted()
Happens every time the process starts

Specified by:
processStarted in class ProcessConsole

respawnActionPerformed

public void respawnActionPerformed()
When the respawn button is pressed


saveProperties

public void saveProperties()
Saves the properties of the object


spawnButtonActionPerformed

public void spawnButtonActionPerformed()
When the spawn button is pressed


stderrTextChanged

public void stderrTextChanged()
this method is called when the text in stderr is changed by a method, like appendToStderr() or setStderrText().

Specified by:
stderrTextChanged in class ProcessConsole

stdinTextChanged

public void stdinTextChanged()
this method is called when the text in stdin is changed by a method, like appendToStdin() or setStdinText().

Specified by:
stdinTextChanged in class ProcessConsole

stdoutTextChanged

public void stdoutTextChanged()
this method is called when the text in stdout is changed by a method, like appendToStdout() or setStdoutText().

Specified by:
stdoutTextChanged in class ProcessConsole

updateGuiProperties

public void updateGuiProperties()
this loads the GUI properties to the propertoies object


setPropertiesFilePath

protected void setPropertiesFilePath(java.lang.String propertiesFilePath)
Sets the properties file path attribute of the PoplogProcessConsole object

Parameters:
propertiesFilePath - The new propertiesFilePath value

addListeners

protected void addListeners()
Adds the listeners to the PoplogProcessConsole object


loadDefaultProperties

protected void loadDefaultProperties()
Creates the default properties of the object ad adds them to the main properties.


removeEditPropertiesButton

protected void removeEditPropertiesButton()
Removes the Edit Properties button from the gui