ix.iview
Class ObjectConstraintEditor

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Dialog
                  extended by javax.swing.JDialog
                      extended by ix.iface.ui.JConstraintEditor
                          extended by ix.iview.ConstraintEditor
                              extended by ix.iview.ObjectConstraintEditor
All Implemented Interfaces:
PropertyConstraintsListener, VarSpecifier, java.awt.event.MouseListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ListSelectionListener, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class ObjectConstraintEditor
extends ConstraintEditor
implements javax.swing.event.ListSelectionListener, java.awt.event.MouseListener, PropertyConstraintsListener

An editor for specifying (world-state) constraints on objects in refinements. The editor is implemented as a frame using a JTextField, a JCheckBox, and a JTable.

The editor can be created with no arguments or with a given refinement which will be set as the current refinement whose object constraints are to be specified. Subsequently, the refinement in the editor can be set using the setRefinement method.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
 
Nested classes/interfaces inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  ListEditorPanel classEd
           
(package private)  boolean isAdjusting
           
protected  UIObjectClass objectClass
           
protected  ListEditorPanel propConstraintEd
           
protected  java.util.HashMap propertyConstraints
           
protected  ToggleEditorPanel propModePan
           
protected  Constraint typeConstraint
           
protected  UIDomain uiDomain
           
protected  java.util.HashMap varConstraints
           
protected  ItemVar variable
           
protected  ListEditorPanel varNameEd
           
 
Fields inherited from class ix.iview.ConstraintEditor
varDecs
 
Fields inherited from class ix.iface.ui.JConstraintEditor
bitsBox, butBox, cancelBut, constraintListeners, currentObject, focusComponent, label, mainPanel, moreBut, okBut, original
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPE
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ObjectConstraintEditor(java.awt.Frame owner, UIDomain domain)
          Creates an editor for specifying object constraints.
ObjectConstraintEditor(java.awt.Frame owner, UIRefinement refinement)
          Creates an editor for specifying object constraints within the given refinement.
 
Method Summary
 void clear()
           
protected  java.lang.Object collectConstraint()
          Normally reads the constraint and updates the current object.
 void dataChanged(EditableObject eo, java.lang.String field, java.lang.Object vNew, java.lang.Object vOld)
           
protected  void deleteConstraint(ObjectProperty prop, Constraint c)
           
protected  void finishEdits()
           
protected  javax.swing.JComponent getFocusComponent()
          By default, there is no focus component
protected  java.util.List getObjectProperties()
           
protected static java.util.List getObjectProperties(int mode, UIObjectClass oClass)
           
protected  void initFromObject()
          Sets the refinement whose objects are to be constrained.
protected  Constraint makeConstraint(ItemVar var, UIObjectClass oClass, java.lang.String typeProperty)
          Make a type constraint for the variable
protected  java.awt.Component makeRels()
          Makes all items on the relations panel.
 void moreInitFromObject()
          Set up the editor to specify more of the same (add more button) This is disabled for the editor - all constraints are done here anyway
 void mouseClicked(java.awt.event.MouseEvent e)
           
protected  void noteType()
           
protected  void setFromObject(java.lang.Object original)
          Set the editor for editing a constraint (not putting in a new one)
 void setObject(java.lang.Object o)
          Set the object (UIRefinement) whose objects are to be constrained
protected  void updateVariable()
           
 void valueChanged(javax.swing.event.ListSelectionEvent e)
           
 void variableConstraintsChanged(ItemVar variable, java.util.HashMap propConsts)
           
 void variableNameChanged(ItemVar oldVar, ItemVar newVar)
           
 void variableTypeChanged(ItemVar var, UIObjectClass oldType, UIObjectClass newType)
           
 
Methods inherited from class ix.iview.ConstraintEditor
addVariableDeclaration, getField, getPreviousList, getVarsToOffer, handleVariables, makeBits, processConstraint, start
 
Methods inherited from class ix.iface.ui.JConstraintEditor
addConstraintListener, closeEditor, focus, getObject, isEditing, mouseEntered, mouseExited, mousePressed, mouseReleased, noteNewValue, removeConstraintListener, setMessage, setOriginal, start, start, start, start, start
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setModalityType, setResizable, setTitle, setUndecorated, setVisible, show, toBack
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, 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 java.awt.event.MouseListener
mouseEntered, mouseExited, mousePressed, mouseReleased
 

Field Detail

varNameEd

protected ListEditorPanel varNameEd

classEd

protected ListEditorPanel classEd

propConstraintEd

protected ListEditorPanel propConstraintEd

propModePan

protected ToggleEditorPanel propModePan

uiDomain

protected UIDomain uiDomain

objectClass

protected UIObjectClass objectClass

typeConstraint

protected Constraint typeConstraint

variable

protected ItemVar variable

propertyConstraints

protected java.util.HashMap propertyConstraints

varConstraints

protected java.util.HashMap varConstraints

isAdjusting

boolean isAdjusting
Constructor Detail

ObjectConstraintEditor

public ObjectConstraintEditor(java.awt.Frame owner,
                              UIDomain domain)
Creates an editor for specifying object constraints. The editor has components for specifying a variable, its type, and a set of constraints on the variable. The editor will always be brought up within the context of a refinement; This method is preparation only. To work with the editor: "- select or enter variable name (starting with ?)" "- select or enter object class of the variable,", "- select or enter property to be constrained," "- enter constraint details (value, cond/eff, begin/end," "- select anoter property or finish with the variable" "- select anoter variable or finish with the editor"


ObjectConstraintEditor

public ObjectConstraintEditor(java.awt.Frame owner,
                              UIRefinement refinement)
Creates an editor for specifying object constraints within the given refinement. The editor will come up with the current variables and constraints in place. Otherwise as above.

Parameters:
refinement - the refinement whose objects are to be consrained.
Method Detail

makeRels

protected java.awt.Component makeRels()
Makes all items on the relations panel. Items are: - Prompt (label) - Variable name (text field) - Type (combo box) - property constraints (table): - property, syntax, own-flag, value, nodeEnd, cond/effect - property diplay mode (own vs ancestors)

Specified by:
makeRels in class ConstraintEditor

getFocusComponent

protected javax.swing.JComponent getFocusComponent()
Description copied from class: JConstraintEditor
By default, there is no focus component

Overrides:
getFocusComponent in class JConstraintEditor

moreInitFromObject

public void moreInitFromObject()
                        throws java.lang.NullPointerException
Set up the editor to specify more of the same (add more button) This is disabled for the editor - all constraints are done here anyway

Overrides:
moreInitFromObject in class JConstraintEditor
Throws:
java.lang.NullPointerException

initFromObject

protected void initFromObject()
                       throws java.lang.NullPointerException
Sets the refinement whose objects are to be constrained. ********revise this

Specified by:
initFromObject in class ConstraintEditor
Throws:
java.lang.NullPointerException - if *******

setFromObject

protected void setFromObject(java.lang.Object original)
Set the editor for editing a constraint (not putting in a new one)

Specified by:
setFromObject in class ConstraintEditor

setObject

public void setObject(java.lang.Object o)
Set the object (UIRefinement) whose objects are to be constrained

Overrides:
setObject in class JConstraintEditor
Parameters:
o - the object whose children are to be related

clear

public void clear()

updateVariable

protected void updateVariable()

variableConstraintsChanged

public void variableConstraintsChanged(ItemVar variable,
                                       java.util.HashMap propConsts)
Specified by:
variableConstraintsChanged in interface PropertyConstraintsListener

variableNameChanged

public void variableNameChanged(ItemVar oldVar,
                                ItemVar newVar)
Specified by:
variableNameChanged in interface PropertyConstraintsListener

variableTypeChanged

public void variableTypeChanged(ItemVar var,
                                UIObjectClass oldType,
                                UIObjectClass newType)
Specified by:
variableTypeChanged in interface PropertyConstraintsListener

noteType

protected void noteType()

collectConstraint

protected java.lang.Object collectConstraint()
Normally reads the constraint and updates the current object. Here this is done at the time when changes are made. NOTE***: perhaps here we can do a consistency check?

Specified by:
collectConstraint in class ConstraintEditor

makeConstraint

protected Constraint makeConstraint(ItemVar var,
                                    UIObjectClass oClass,
                                    java.lang.String typeProperty)
Make a type constraint for the variable


deleteConstraint

protected void deleteConstraint(ObjectProperty prop,
                                Constraint c)

getObjectProperties

protected java.util.List getObjectProperties()

getObjectProperties

protected static java.util.List getObjectProperties(int mode,
                                                    UIObjectClass oClass)

finishEdits

protected void finishEdits()

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener
Overrides:
mouseClicked in class JConstraintEditor

dataChanged

public void dataChanged(EditableObject eo,
                        java.lang.String field,
                        java.lang.Object vNew,
                        java.lang.Object vOld)

valueChanged

public void valueChanged(javax.swing.event.ListSelectionEvent e)
Specified by:
valueChanged in interface javax.swing.event.ListSelectionListener