gate.gui
Class SerialControllerEditor

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bygate.creole.AbstractVisualResource
                      extended bygate.gui.SerialControllerEditor
All Implemented Interfaces:
Accessible, ActionsPublisher, CreoleListener, EventListener, FeatureBearer, ImageObserver, MenuContainer, NameBearer, Resource, Serializable, VisualResource

public class SerialControllerEditor
extends AbstractVisualResource
implements CreoleListener, ActionsPublisher

See Also:
Serialized Form

Nested Class Summary
(package private)  class SerialControllerEditor.AddPRAction
          Adds a PR to the controller
protected  class SerialControllerEditor.CorporaComboModel
          A model for a combobox containing the loaded corpora in the system
protected  class SerialControllerEditor.InternalProgressListener
          A simple progress listener used to forward the events upstream.
protected  class SerialControllerEditor.InternalStatusListener
          A simple status listener used to forward the events upstream.
(package private)  class SerialControllerEditor.LabelRenderer
          Renders JLabel by simply displaying them
(package private)  class SerialControllerEditor.LoadedPRsTableModel
          Table model for all the loaded processing resources that are not part of the controller.
(package private)  class SerialControllerEditor.MemberPRsTableModel
          Table model for all the processing resources in the controller.
(package private)  class SerialControllerEditor.RemovePRAction
          Removes a PR from the controller
(package private)  class SerialControllerEditor.RunAction
          Runs the Application
 
Nested classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
(package private)  List actionList
          The list of actions provided by this editor
(package private)  JButton addButon
          Adds one or more PR(s) to the controller
(package private)  JMenu addMenu
          The "Add PR" menu; part of the popup menu
(package private)  boolean analyserMode
          Is the controller displayed an analyser controller?
(package private)  JRadioButton conditional_RunRBtn
          Button for conditional run.
(package private)  boolean conditionalMode
          Is the controller displayed conditional?
(package private)  SerialController controller
          The controller this editor edits
(package private)  JComboBox corpusCombo
          A combobox that allows selection of a corpus from the list of loaded corpora.
(package private)  SerialControllerEditor.CorporaComboModel corpusComboModel
           
(package private)  JTextField featureNameTextField
          Text field for the feature name for conditional run.
(package private)  JTextField featureValueTextField
          Text field for the feature value for conditional run.
(package private)  Handle handle
          The Handle that created this view
(package private)  XJTable loadedPRsTable
          Contains all the PRs loaded in the sytem that are not already part of the serial controller
(package private)  SerialControllerEditor.LoadedPRsTableModel loadedPRsTableModel
          model for the loadedPRsTable JTable.
(package private)  XJTable memberPRsTable
          Displays the PRs in the controller
(package private)  SerialControllerEditor.MemberPRsTableModel memberPRsTableModel
          model for memberPRsTable
(package private)  JButton moveDownButton
          Moves the module down in the controller list
(package private)  JButton moveUpButton
          Moves the module up in the controller list
(package private)  JRadioButton no_RunRBtn
          Button for never run.
(package private)  TitledBorder parametersBorder
          A border for the parametersPanel
(package private)  ResourceParametersEditor parametersEditor
          A component for editing the parameters of the currently selected PR
(package private)  JPanel parametersPanel
          A JPanel containing the parametersEditor
private  Vector progressListeners
           
(package private)  JButton removeButton
          Removes one or more PR(s) from the controller
(package private)  JMenu removeMenu
          The "Remove PR" menu; part of the popup menu
(package private)  SerialControllerEditor.RunAction runAction
          Action that runs the application
(package private)  ButtonGroup runBtnGrp
          The group for run strategy buttons;
(package private)  ProcessingResource selectedPR
          The PR currently selected (having its parameters set)
(package private)  RunningStrategy selectedPRRunStrategy
          The running strategy for the selected PR.
private  Vector statusListeners
           
(package private)  TitledBorder strategyBorder
          A border for the running strategy options box
(package private)  JPanel strategyPanel
          A JPanel containing the running strategy options
(package private)  JRadioButton yes_RunRBtn
          Button for run always.
 
Fields inherited from class gate.creole.AbstractVisualResource
features
 
Fields inherited from class javax.swing.JPanel
 
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.Container
 
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
SerialControllerEditor()
           
 
Method Summary
 void addProgressListener(ProgressListener l)
           
 void addStatusListener(StatusListener l)
           
protected  void buildInternalMenus()
           
 void cleanup()
          Cleans the internal data and prepares this object to be collected
 void datastoreClosed(CreoleEvent e)
          Called when a DataStore has been closed
 void datastoreCreated(CreoleEvent e)
          Called when a DataStore has been created
 void datastoreOpened(CreoleEvent e)
          Called when a DataStore has been opened
protected  void fireProcessFinished()
           
protected  void fireProgressChanged(int e)
           
protected  void fireStatusChanged(String e)
           
 List getActions()
          Returns a list of Action objects.
 Resource init()
          Initialise this resource, and return it.
protected  void initGuiComponents()
           
protected  void initListeners()
           
protected  void initLocalData()
           
 void removeProgressListener(ProgressListener l)
           
 void removeStatusListener(StatusListener l)
           
 void resourceLoaded(CreoleEvent e)
          Called when a new Resource has been loaded into the system
 void resourceRenamed(Resource resource, String oldName, String newName)
          Called when the creole register has renamed a resource.1
 void resourceUnloaded(CreoleEvent e)
          Called when a Resource has been removed from the system
protected  void selectPR(int index)
          Called when a PR has been selected in the memeber PRs table;
 void setHandle(Handle handle)
          Used by the main GUI to tell this VR what handle created it.
 void setTarget(Object target)
          Called by the GUI when this viewer/editor has to initialise itself for a specific object.
protected  void showParamsEditor(ProcessingResource pr)
          Stops the current edits for parameters; sets the paarmeters for the resource currently being edited and diplays the editor for the new resource
 
Methods inherited from class gate.creole.AbstractVisualResource
getFeatures, getParameterValue, setFeatures, setParameterValue, setParameterValues
 
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
 
Methods inherited from interface gate.util.NameBearer
getName, setName
 

Field Detail

controller

SerialController controller
The controller this editor edits


handle

Handle handle
The Handle that created this view


actionList

List actionList
The list of actions provided by this editor


loadedPRsTable

XJTable loadedPRsTable
Contains all the PRs loaded in the sytem that are not already part of the serial controller


loadedPRsTableModel

SerialControllerEditor.LoadedPRsTableModel loadedPRsTableModel
model for the loadedPRsTable JTable.


memberPRsTable

XJTable memberPRsTable
Displays the PRs in the controller


memberPRsTableModel

SerialControllerEditor.MemberPRsTableModel memberPRsTableModel
model for memberPRsTable


addButon

JButton addButon
Adds one or more PR(s) to the controller


removeButton

JButton removeButton
Removes one or more PR(s) from the controller


moveUpButton

JButton moveUpButton
Moves the module up in the controller list


moveDownButton

JButton moveDownButton
Moves the module down in the controller list


parametersEditor

ResourceParametersEditor parametersEditor
A component for editing the parameters of the currently selected PR


parametersPanel

JPanel parametersPanel
A JPanel containing the parametersEditor


parametersBorder

TitledBorder parametersBorder
A border for the parametersPanel


strategyPanel

JPanel strategyPanel
A JPanel containing the running strategy options


strategyBorder

TitledBorder strategyBorder
A border for the running strategy options box


yes_RunRBtn

JRadioButton yes_RunRBtn
Button for run always.


no_RunRBtn

JRadioButton no_RunRBtn
Button for never run.


conditional_RunRBtn

JRadioButton conditional_RunRBtn
Button for conditional run.


runBtnGrp

ButtonGroup runBtnGrp
The group for run strategy buttons;


featureNameTextField

JTextField featureNameTextField
Text field for the feature name for conditional run.


featureValueTextField

JTextField featureValueTextField
Text field for the feature value for conditional run.


corpusCombo

JComboBox corpusCombo
A combobox that allows selection of a corpus from the list of loaded corpora.


corpusComboModel

SerialControllerEditor.CorporaComboModel corpusComboModel

addMenu

JMenu addMenu
The "Add PR" menu; part of the popup menu


removeMenu

JMenu removeMenu
The "Remove PR" menu; part of the popup menu


runAction

SerialControllerEditor.RunAction runAction
Action that runs the application


analyserMode

boolean analyserMode
Is the controller displayed an analyser controller?


conditionalMode

boolean conditionalMode
Is the controller displayed conditional?


selectedPR

ProcessingResource selectedPR
The PR currently selected (having its parameters set)


selectedPRRunStrategy

RunningStrategy selectedPRRunStrategy
The running strategy for the selected PR.


statusListeners

private transient Vector statusListeners

progressListeners

private transient Vector progressListeners
Constructor Detail

SerialControllerEditor

public SerialControllerEditor()
Method Detail

setTarget

public void setTarget(Object target)
Description copied from class: AbstractVisualResource
Called by the GUI when this viewer/editor has to initialise itself for a specific object.

Specified by:
setTarget in interface VisualResource
Overrides:
setTarget in class AbstractVisualResource
Parameters:
target - the object (be it a Resource, DataStore or whatever) this viewer has to display

setHandle

public void setHandle(Handle handle)
Description copied from class: AbstractVisualResource
Used by the main GUI to tell this VR what handle created it. The VRs can use this information e.g. to add items to the popup for the resource.

Specified by:
setHandle in interface VisualResource
Overrides:
setHandle in class AbstractVisualResource

init

public Resource init()
              throws ResourceInstantiationException
Description copied from class: AbstractVisualResource
Initialise this resource, and return it.

Specified by:
init in interface Resource
Overrides:
init in class AbstractVisualResource
Throws:
ResourceInstantiationException

initLocalData

protected void initLocalData()

initGuiComponents

protected void initGuiComponents()

initListeners

protected void initListeners()

getActions

public List getActions()
Description copied from interface: ActionsPublisher
Returns a list of Action objects. This method will be called everytime a menu for this resource needs to be built, thus allowing for dynamic updates to the list of actions. A null value in this list will cause a separator to be created.

Specified by:
getActions in interface ActionsPublisher
Returns:

cleanup

public void cleanup()
Cleans the internal data and prepares this object to be collected

Specified by:
cleanup in interface Resource
Overrides:
cleanup in class AbstractVisualResource

buildInternalMenus

protected void buildInternalMenus()

selectPR

protected void selectPR(int index)
Called when a PR has been selected in the memeber PRs table;


showParamsEditor

protected void showParamsEditor(ProcessingResource pr)
Stops the current edits for parameters; sets the paarmeters for the resource currently being edited and diplays the editor for the new resource

Parameters:
pr - the new resource

resourceLoaded

public void resourceLoaded(CreoleEvent e)
Description copied from interface: CreoleListener
Called when a new Resource has been loaded into the system

Specified by:
resourceLoaded in interface CreoleListener

resourceUnloaded

public void resourceUnloaded(CreoleEvent e)
Description copied from interface: CreoleListener
Called when a Resource has been removed from the system

Specified by:
resourceUnloaded in interface CreoleListener

resourceRenamed

public void resourceRenamed(Resource resource,
                            String oldName,
                            String newName)
Description copied from interface: CreoleListener
Called when the creole register has renamed a resource.1

Specified by:
resourceRenamed in interface CreoleListener

datastoreOpened

public void datastoreOpened(CreoleEvent e)
Description copied from interface: CreoleListener
Called when a DataStore has been opened

Specified by:
datastoreOpened in interface CreoleListener

datastoreCreated

public void datastoreCreated(CreoleEvent e)
Description copied from interface: CreoleListener
Called when a DataStore has been created

Specified by:
datastoreCreated in interface CreoleListener

datastoreClosed

public void datastoreClosed(CreoleEvent e)
Description copied from interface: CreoleListener
Called when a DataStore has been closed

Specified by:
datastoreClosed in interface CreoleListener

removeStatusListener

public void removeStatusListener(StatusListener l)

addStatusListener

public void addStatusListener(StatusListener l)

fireStatusChanged

protected void fireStatusChanged(String e)

removeProgressListener

public void removeProgressListener(ProgressListener l)

addProgressListener

public void addProgressListener(ProgressListener l)

fireProgressChanged

protected void fireProgressChanged(int e)

fireProcessFinished

protected void fireProcessFinished()