ix.iview
Class ActionEditorPanel
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.JPanel
|
+--ix.iview.AConstructFramePanel
|
+--ix.iview.ActionEditorPanel
- All Implemented Interfaces:
- javax.accessibility.Accessible, java.awt.event.ActionListener, ConstraintListener, ConstructFraming, CurrentActionListener, java.util.EventListener, FramePanel, IDESymbols, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, UIDomainListener
- public class ActionEditorPanel
- extends AConstructFramePanel
- implements ConstructFraming, ConstraintListener, java.awt.event.ActionListener, UIDomainListener, CurrentActionListener, IDESymbols
An editor/viewer panel for refinement structures.
The editor has a flag that specifies whether it is in minimal view (true)
or in comprehensive view (false).
The editor is created with a minimal flag.
Subsequently, the refinement can be set using the setRefinement method.
The editor will not let you update a current refinement yet, because we have
not yet worked out how to manage the impact this would have on other
modules that use the domain.
The editor will let you add new refinements (if you have changed an old one,
change the name to save it).
The refinement name, pattern, and comments are currently simply strings. They
can all be edited by typing into their fields. The pattern should not stay
as a string - it should change into something a bit more constrained.
This will be changed when the refinement models have been sorted out.
Sub-activities and constraints can be added, deleted, and cleared, either
using the buttons or using keys (enter or insert for add, delete for
delete).
Sub-activities are simple LLists for the moment. Adding a sub-activity
expects the user to type in a pattern (currently just a string) and it will
generate a number for the activity. Deleting sub-activities will also
delete any constraints in which the deleted activity participates.
The only constraints currently known are ordering constraints. Adding
constraints will bring up an editor that lets the user select activities
and time-points. For the moment, these "proper" constraints are translated
into simple versions because other modules cannot handle anything more
complex. A simple constraint "( )" stands for
"( End Before Begin ). The constraint editor and the
DomainEditor are ready to provide and manage "proper" constraints, but we
will not provide them until other modules can deal with them.
Example code for using the ActionEditorPanel:
...
editorPanel = new ActionEditorPanel(this,isMinimal);
mainJPanel.add(editorPanel);
...
- See Also:
- Serialized Form
| Inner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
| Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent, javax.swing.JComponent.ActionStandin, javax.swing.JComponent.IntVector, javax.swing.JComponent.KeyboardState |
| Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock |
| Fields inherited from class javax.swing.JComponent |
_bounds, accessibleContext, listenerList, paintingChild, 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 |
component, containerListener, layoutMgr, listeningBoundsChildren, listeningChildren, ncomponents |
| Fields inherited from class java.awt.Component |
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, componentListener, componentListenerK, componentOrientation, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, newEventsOnly, ownedWindowK, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y |
| Fields inherited from interface ix.iview.IDESymbols |
C_ALL, C_CONDITIONS_ONLY, C_CONDITIONS_OTHER, C_NONE, C_ORDER_CONDITIONS, C_ORDER_ONLY, C_ORDER_OTHER, C_OTHER_ONLY, MODE_ADVANCED, MODE_SIMPLE, VIEW_COMPREHENSIVE, VIEW_GRAPHICAL, VIEW_MINIMAL, VIEWS |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Methods inherited from class ix.iview.AConstructFramePanel |
askModifyDialog, askModifyOptions, askModifyOptionsOld, beforeOpening, beforeSwitching, clear, getDomain, getUIDomain, noteDraftConstruct, registerListKeys, setConstruct, setUIDomain, setupEditor, setupOuterPanel |
| Methods inherited from class javax.swing.JPanel |
, getAccessibleContext, getUIClassID, paramString, updateUI |
| Methods inherited from class javax.swing.JComponent |
_paintImmediately, addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, alwaysOnTop, checkIfChildObscuredBySibling, componentInputMapChanged, computeVisibleRect, computeVisibleRect, compWriteObjectNotify, contains, createToolTip, disable, enable, enableSerialization, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getCreatedDoubleBuffer, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyBindings, processKeyBindingsForAllComponents, processKeyEvent, processMouseMotionEvent, putClientProperty, rectangleIsObscured, rectangleIsObscuredBySibling, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setCreatedDoubleBuffer, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPaintingChild, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, shouldDebugGraphics, superProcessMouseMotionEvent, unregisterKeyboardAction, update |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, adjustListeningChildren, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getLayout, getMouseEventTarget, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, nextFocus, numListening, paintComponents, paintHeavyweightComponents, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, printComponents, printHeavyweightComponents, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, setFocusOwner, setLayout, transferFocus, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, constructComponentName, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getToolkit, getToolkitImpl, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isEnabledImpl, isLightweight, isRecursivelyVisible, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resetGC, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
orderingEditor
public OrderingEditor orderingEditor
- An editor for temporal relations
conditionEditor
public ConditionEffectEditor conditionEditor
constraintEditor
public DefaultConstraintEditor constraintEditor
specEditor
public SpecEditor specEditor
formModel
IFormModel formModel
currentPanel
ConstructEditing currentPanel
graphPanel
GExpansionEditor graphPanel
comprehensiveConstrIndex
int comprehensiveConstrIndex
comprehensiveFields
java.util.List comprehensiveFields
minimalFields
java.util.List minimalFields
lineSeparator
java.lang.String lineSeparator
actionListeners
java.util.HashSet actionListeners
- Listeners interested in the current action
ActionEditorPanel
public ActionEditorPanel(DomainEditor theParent,
Symbol view,
Symbol constr)
- Creates the editor panel with the given parent with the given view and
the indicated set of constraints shown.
Creates all panel components, the mouse listener, and the relation editor.
- Parameters:
parent - the DomainEditor frame that the panel belons to. Used
mainly to keep toggle buttons and menus in synchview - a symbol specifying whether the editor is to display
its minimal, comprehensive, or graphical view.constr - a symbol indicating how constraints are shown (orderings,
conditions, others)
setupMainPanel
protected javax.swing.JPanel setupMainPanel()
- Overrides:
setupMainPanel in class AConstructFramePanel
setupActionTree
protected void setupActionTree()
setPanel
protected void setPanel(ConstructEditing panel)
updateToolbar
public void updateToolbar(boolean show)
isComprehensive
public boolean isComprehensive()
- Returns:
- true if the view is comprehensive, false for minimal and graphical
getActivityView
public Symbol getActivityView()
- Returns:
- the current view (minimal/comprehensive/graphical)
setCurrentView
public void setCurrentView(Symbol view)
- Returns:
- the current view (minimal/comprehensive/graphical)
setConstraintsView
public void setConstraintsView(Symbol constrView)
- Changes the fields that are displayed in the form view. Currently only
changes comprehensive form, but would work for minimal too.
Does not check whether the view is different from the previous one.
isSequenceSet
public boolean isSequenceSet()
- Returns:
- the current setting of the sequence flag
setDefaultSequence
public void setDefaultSequence(boolean newSequence)
- Sets the flag to put nodes in sequence (true) or in parallel (false)
If the state of the checkbox does not correspond to the new setting,
it is changed.
If the editor is already in the given mode, nothing is done.
Currently, nothing else changes in the panel
orderingsAreSequential
public static boolean orderingsAreSequential(LList nodes,
LList orderings)
- Checks whether the orderings are a sequence of the nodes.
- Parameters:
nodes - the nodes that can be part of the ordering.orderings - the orderings to be tested.
setOrdering
public void setOrdering(boolean isSequence)
makeSequence
public void makeSequence()
- Puts the nodes of the current refinement into sequence.
makeSequence
public static java.util.List makeSequence(java.util.List nodes)
- Puts the given nodes into sequence.
makeParallel
public void makeParallel()
- Puts the nodes of the current refinement in parallel.
ensureRelationEditor
public void ensureRelationEditor()
ensureConditionEditor
public void ensureConditionEditor()
ensureConstraintEditor
public void ensureConstraintEditor()
ensureSpecEditor
public void ensureSpecEditor(java.lang.String type)
ensureSpecEditor
public void ensureSpecEditor(java.lang.String type,
java.lang.String init)
beforeClosing
public boolean beforeClosing()
- Overrides:
beforeClosing in class AConstructFramePanel
setUIConstruct
public void setUIConstruct(UIObject object)
- Sets the given UI construct to be viewed/edited.
Also sets the uiConstruct in the current editorPanel
- Specified by:
setUIConstruct in interface ConstructFraming- Overrides:
setUIConstruct in class AConstructFramePanel
- Parameters:
object - the UI object to be viewed/edited
setUIConstructPanel
public void setUIConstructPanel(UIObject object)
- Sets the given UI construct in this editor and in the current panel
Does not call beforeSwitching.
- Parameters:
object - the UI object to be viewed/edited
setUIConstructOnly
public void setUIConstructOnly(UIObject object)
- Sets the given UI construct to be viewed/edited without noting the
previous construct.
Also sets the uiConstruct in the current editorPanel
- Parameters:
object - the UI object to be viewed/edited
clearUIConstruct
public void clearUIConstruct()
- Clears the current construct and the panel.
Also sets the uiConstruct in the current editorPanel
makeNewRefinement
public UIRefinement makeNewRefinement(java.lang.String name,
LList pattern)
getAllExpansions
public java.util.ArrayList getAllExpansions(NodeSpec node)
noteConstruct
protected UIObject noteConstruct()
- Note the settings in the editor in a UIObject. Do not save into doamin.
- Overrides:
noteConstruct in class AConstructFramePanel
resetUIConstruct
protected void resetUIConstruct(UIObject object)
- Same as setUIConstruct, but remembers the setting of the miniConstraints
checkConstruct
public boolean checkConstruct()
- User request to check the refinement - not implemented.
- Specified by:
checkConstruct in interface ConstructFraming
newConstruct
public void newConstruct()
- User request to make a new action.
- Specified by:
newConstruct in interface ConstructFraming- Overrides:
newConstruct in class AConstructFramePanel
deleteConstruct
public void deleteConstruct()
- User request to delete the current action.
copyConstruct
public void copyConstruct()
- User request to copy the current action.
makeNewConstruct
public UIObject makeNewConstruct()
- User request to make a new action.
- Specified by:
makeNewConstruct in interface ConstructFraming- Overrides:
makeNewConstruct in class AConstructFramePanel
saveConstruct
public void saveConstruct()
- User request to save an action into the draft domain.
- Specified by:
saveConstruct in interface ConstructFraming
revertConstruct
public void revertConstruct()
- User request to revert an action to when it was last saved in
the draft domain.
revertOConstruct
public void revertOConstruct()
- User request to revert an action to when it was last saved in
the draft domain.
getAllConstructs
public java.util.List getAllConstructs()
- Description copied from interface:
ConstructFraming
- Gets a full list of the constructs of the panel's type in the domain.
- Specified by:
getAllConstructs in interface ConstructFraming
getNamedConstruct
public Named getNamedConstruct(java.lang.String name)
- Description copied from interface:
ConstructFraming
- Gets a named construct of the panel's type from the domain
- Specified by:
getNamedConstruct in interface ConstructFraming
userMakeSequence
public void userMakeSequence()
- User request to put the nodes of the current action into sequence.
userMakeParallel
public void userMakeParallel()
- User request to put the nodes of the current action in parallel.
noteTextNodes
public void noteTextNodes()
- Parse the nodes from the text area and store them in the current
refinement.
clearOrderings
protected boolean clearOrderings()
constructAdded
public void constructAdded(UIDomainEvent event)
- Called when a UI construct is added.
Use getSource() to get at the domain (UI/IX) in which the event occurred.
Use getObject() to get at the object (UI/IX) that has been added.
- Specified by:
constructAdded in interface UIDomainListener
constructAdded
public void constructAdded(RefinementEvent event)
- Specified by:
constructAdded in interface UIDomainListener
constructEdited
public void constructEdited(UIDomainEvent event)
- Called when a UI construct is edited.
Use getSource() to get at the UIDomain in which the event occurred.
Use getObject() to get at the UIObject that has been edited.
- Specified by:
constructEdited in interface UIDomainListener
constructRemoved
public void constructRemoved(UIDomainEvent event)
- Called when a UI construct is removed.
Use getSource() to get at the UIDomain in which the event occurred.
Use getObject() to get at the UIObject that has been removed.
- Specified by:
constructRemoved in interface UIDomainListener
domainCleared
public void domainCleared(UIDomainEvent event)
- Description copied from interface:
UIDomainListener
- Called when the domain is cleared.
- Specified by:
domainCleared in interface UIDomainListener
domainEdited
public void domainEdited(UIDomainEvent se)
- Description copied from interface:
UIDomainListener
- Called when the domain's own fields changed (currently only name).
- Specified by:
domainEdited in interface UIDomainListener
domainSet
public void domainSet(UIDomainEvent event)
- Description copied from interface:
UIDomainListener
- Called when the domain is added.
- Specified by:
domainSet in interface UIDomainListener
updateTree
public void updateTree()
updateTreeSelection
public void updateTreeSelection()
addCurrentActionListener
public void addCurrentActionListener(CurrentActionListener cal)
actionChanged
public void actionChanged(java.awt.Component source,
UIRefinement newAction)
- Description copied from interface:
CurrentActionListener
- Implement this method to take note of action selections
- Specified by:
actionChanged in interface CurrentActionListener
- Following copied from interface:
ix.iview.event.CurrentActionListener
- Parameters:
source - the component that changed the actionnewAction - the new action
gotConstraint
public void gotConstraint(java.lang.Object o,
java.lang.Object constraint)
- Wakes up the ConstraintListener with a newly defined ordering.
This is called when a new ordering has been defined by the component
with which the ConstraintListener registered its interest.
- Specified by:
gotConstraint in interface ConstraintListener
- Parameters:
o - the object to which the constraint appliesconstraint - the new constraint
frameActionPerformed
public boolean frameActionPerformed(java.awt.event.ActionEvent event)
- Recognises panel specific events and processes them.
This is a separate method because it must let other event handlers know
whether it recognised the event.
- Specified by:
frameActionPerformed in interface ConstructFraming- Overrides:
frameActionPerformed in class AConstructFramePanel
- Parameters:
event - the event to be processed.- Returns:
- true if the event was recognised, false if not.
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent ae)
- Wakes up the ActionListener with a user action.
This is called when a KeyStroke or other panel event happens in which
the ActionListener registered its interest.
- Specified by:
actionPerformed in interface java.awt.event.ActionListener- Overrides:
actionPerformed in class AConstructFramePanel
notImp
protected static void notImp(java.lang.String message)