|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container java.awt.Window java.awt.Dialog javax.swing.JDialog ix.iface.ui.JConstraintEditor ix.iview.ConstraintEditor ix.iview.DeclarationEditor
public class DeclarationEditor
An editor for specifying variable declarations Declarations are attached to self (the refinement).
The editor is implemented as a frame using a JTextArea and JRadioButtons.
The editor can be created with no arguments or with a given refinement which will be set as the current refinement whose variable declarations are to be specified. Subsequently, the refinement in the editor can be set using the setRefinement method.
Nested Class Summary | |
---|---|
class |
DeclarationEditor.VarListEditor
A list editor panel that will find type constraints for the data variables. |
class |
DeclarationEditor.VarTypeTableModel
A table model for ItemVar-Type pairs |
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 javax.swing.JRadioButton |
any
|
ConditionEffectEditor |
conditionEditor
|
protected javax.swing.JRadioButton |
given
|
protected javax.swing.JRadioButton |
none
|
protected javax.swing.JButton |
otherEdBut
|
protected DeclarationEditor.VarListEditor |
varEd
|
protected DeclarationEditor.VarTypeTableModel |
varTableMod
|
(package private) ObjectView.ValueParser |
vp
|
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 | |
---|---|
DeclarationEditor(java.awt.Frame owner)
Creates an editor for specifying variable declarations. |
|
DeclarationEditor(java.awt.Frame owner,
UIRefinement refinement)
Creates an editor for specifying variable declarations within the given refinement. |
Method Summary | |
---|---|
void |
closeEditor()
|
protected java.lang.Object |
collectConstraint()
Reads the given declarations and type and property constraints and updates the current refinement. |
void |
constructAdded(DomainEvent se)
|
void |
constructAdded(UIDomainEvent se)
Called when a UI construct is added. |
void |
constructEdited(UIDomainEvent se)
Called when a UI construct is edited. |
void |
constructRemoved(UIDomainEvent se)
Called when a UI construct is removed. |
void |
dataChanged(EditableObject object,
java.lang.String field,
java.lang.Object oldValue,
java.lang.Object newValue)
|
void |
domainCleared(UIDomainEvent se)
Called when the domain is cleared. |
void |
domainEdited(UIDomainEvent se)
Called when the domain's own fields changed (currently only name). |
void |
domainSet(UIDomainEvent se)
Called when the domain is added. |
void |
ensureConditionEditor()
|
protected void |
finishEdits()
|
protected java.util.Set |
getNoObjectConstraints(ItemVar var)
|
protected java.util.HashMap |
getVarConstraints(ItemVar var)
Looks up the constraints for the given variable in the varConstMap |
protected UIObjectClass |
getVarType(ItemVar var)
Looks up the var type for the given variable in the varTypeMap |
protected Constraint |
getVarTypeConstraint(ItemVar var)
Looks up the var type for the given variable in the varTypeMap and makes a constraint that sets it. |
protected void |
handleVariables()
This is not necessary - declarations are handled explicitly on exit Note any variable declarations set in this editor. |
protected void |
initFromObject()
Sets the refinement whose variables are to be edited Fills the current declarations (if any) into the list and selects the appropriate radio button. |
protected void |
loadObjectConstraints(UIRefinement refinement)
Gets variable type and property constraints from the given refinement, loads them into the editor and keeps a copy in case of cancel. |
protected void |
loadVarConstraints(UIRefinement uir,
ItemVar var)
Loads the constraints of the refinement into the varConstMap |
protected void |
loadVarType(UIRefinement uir,
ItemVar var)
Looks up the type constraint of the given var in the given refinement. |
protected java.awt.Component |
makeRels()
Makes all items on the relations panel. |
protected Constraint |
makeTypeConstraint(ItemVar var)
Makes a type constraint for the given variable from the current settings. |
void |
mouseClicked(java.awt.event.MouseEvent e)
mouse clicked - radio button "none": warn about clearing declarations - button "Ok": finish editing, collect constraint, and exit - button "Other Editor": use simple cond/eff editor - button "Note Edits": put constraints into refinement |
void |
mousePressed(java.awt.event.MouseEvent me)
|
protected java.lang.Object |
noteNewValue(java.lang.Object constraint)
make UIO update properly so that the event is noted elsewhere (panels..) |
protected void |
noteVarConstraints(ItemVar var,
java.util.HashMap propConsts)
Notes the given constraints for the given variable in the varConstMap. |
protected void |
noteVarType(ItemVar var,
UIObjectClass type)
Notes the given type for the given variable in the varTypeMap. |
protected void |
noteVarTypeConstraint(ItemVar var,
Constraint c)
Notes the var type for the given variable in the varTypeConstraints map |
protected void |
noteVarTypeConstraint(ItemVar var,
UIObjectClass oClass)
Notes the var type for the given variable in the varTypeConstraints map |
protected void |
reloadAllVarConstraints()
Checks applicability of editor constraints and noObCons for all vars. |
protected void |
reloadVarConstraints(ItemVar var)
Checks applicability of editor constraints and noObCons |
protected boolean |
removeConstraint(Constraint c)
Remove the constraint; |
protected boolean |
removeConstraint(ItemVar var,
Constraint c)
Remove the constraint; |
protected boolean |
removeConstraint(ItemVar var,
UIObjectClass type,
Constraint c)
Remove the constraint; |
protected boolean |
removeConstraint(ItemVar var,
UIObjectClass type,
ObjectProperty prop,
Constraint c)
Remove the constraint; |
protected void |
removeVarConstraints(ItemVar var)
|
protected void |
removeVarType(ItemVar var)
|
protected void |
removeVarTypeConstraint(ItemVar var)
|
protected void |
replaceNotes(ItemVar oldVar,
ItemVar newVar)
If variable name has changed, replace note of type and constraints and note that the change was made (to clean up uir on exit) |
protected void |
saveVarConstraints(UIRefinement uir,
ItemVar var)
Saves the constraints in the varConstMap into the refinement |
protected void |
saveVarType(UIRefinement uir,
ItemVar var)
Saves the var type (class) in the varTypeMap into the refinement. |
protected java.util.Set |
setAllConstraints(UIRefinement refinement)
Goes through the variable type constraints in the var-type table and sets them all in the refinement. |
protected void |
setFromObject(java.lang.Object original)
We do editing of all variable declarations from initFromObject so this is obsolete. |
void |
setListData(UIRefinement refinement,
java.util.Collection data)
Sets the data in the variable-type table Handles lists or sets of ItemVar |
void |
start()
|
void |
start(java.lang.String title,
java.lang.Object uir,
java.awt.Point location)
|
void |
userShowNoDecs(ItemVar var)
|
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, makeBits, processConstraint |
Methods inherited from class ix.iface.ui.JConstraintEditor |
---|
addConstraintListener, focus, getFocusComponent, getObject, isEditing, moreInitFromObject, mouseEntered, mouseExited, mouseReleased, removeConstraintListener, setMessage, setObject, 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 |
Field Detail |
---|
protected DeclarationEditor.VarTypeTableModel varTableMod
protected DeclarationEditor.VarListEditor varEd
protected javax.swing.JRadioButton any
protected javax.swing.JRadioButton given
protected javax.swing.JRadioButton none
protected javax.swing.JButton otherEdBut
ObjectView.ValueParser vp
public ConditionEffectEditor conditionEditor
Constructor Detail |
---|
public DeclarationEditor(java.awt.Frame owner)
public DeclarationEditor(java.awt.Frame owner, UIRefinement refinement)
refinement
- the refinement whose variable declarations are to be
specifiedMethod Detail |
---|
protected java.awt.Component makeRels()
makeRels
in class ConstraintEditor
protected void initFromObject() throws java.lang.NullPointerException
initFromObject
in class ConstraintEditor
java.lang.NullPointerException
public void setListData(UIRefinement refinement, java.util.Collection data)
protected void setFromObject(java.lang.Object original)
setFromObject
in class ConstraintEditor
protected void loadVarType(UIRefinement uir, ItemVar var)
protected void saveVarType(UIRefinement uir, ItemVar var)
protected void noteVarType(ItemVar var, UIObjectClass type)
protected UIObjectClass getVarType(ItemVar var)
protected void removeVarType(ItemVar var)
protected Constraint getVarTypeConstraint(ItemVar var)
protected void noteVarTypeConstraint(ItemVar var, Constraint c)
protected void noteVarTypeConstraint(ItemVar var, UIObjectClass oClass)
protected Constraint makeTypeConstraint(ItemVar var)
protected void loadVarConstraints(UIRefinement uir, ItemVar var)
protected void reloadAllVarConstraints()
protected void reloadVarConstraints(ItemVar var)
protected void saveVarConstraints(UIRefinement uir, ItemVar var)
protected void noteVarConstraints(ItemVar var, java.util.HashMap propConsts)
protected java.util.HashMap getVarConstraints(ItemVar var)
protected void removeVarConstraints(ItemVar var)
protected void removeVarTypeConstraint(ItemVar var)
protected boolean removeConstraint(Constraint c)
protected boolean removeConstraint(ItemVar var, Constraint c)
protected boolean removeConstraint(ItemVar var, UIObjectClass type, Constraint c)
protected boolean removeConstraint(ItemVar var, UIObjectClass type, ObjectProperty prop, Constraint c)
protected void replaceNotes(ItemVar oldVar, ItemVar newVar)
protected java.util.Set getNoObjectConstraints(ItemVar var)
protected java.lang.Object collectConstraint()
collectConstraint
in class ConstraintEditor
protected void loadObjectConstraints(UIRefinement refinement)
protected java.util.Set setAllConstraints(UIRefinement refinement)
protected void handleVariables()
handleVariables
in class ConstraintEditor
protected java.lang.Object noteNewValue(java.lang.Object constraint)
JConstraintEditor
noteNewValue
in class JConstraintEditor
public void userShowNoDecs(ItemVar var)
protected void finishEdits()
public void start(java.lang.String title, java.lang.Object uir, java.awt.Point location)
public void start()
start
in class ConstraintEditor
public void closeEditor()
closeEditor
in class JConstraintEditor
public void ensureConditionEditor()
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
mouseClicked
in class JConstraintEditor
public void mousePressed(java.awt.event.MouseEvent me)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class JConstraintEditor
public void valueChanged(javax.swing.event.ListSelectionEvent e)
valueChanged
in interface javax.swing.event.ListSelectionListener
public void dataChanged(EditableObject object, java.lang.String field, java.lang.Object oldValue, java.lang.Object newValue)
dataChanged
in interface DataChangeListener
public void constructAdded(UIDomainEvent se)
UIDomainListener
constructAdded
in interface UIDomainListener
public void constructAdded(DomainEvent se)
constructAdded
in interface UIDomainListener
public void constructEdited(UIDomainEvent se)
UIDomainListener
constructEdited
in interface UIDomainListener
public void constructRemoved(UIDomainEvent se)
UIDomainListener
constructRemoved
in interface UIDomainListener
public void domainCleared(UIDomainEvent se)
UIDomainListener
domainCleared
in interface UIDomainListener
public void domainEdited(UIDomainEvent se)
UIDomainListener
domainEdited
in interface UIDomainListener
public void domainSet(UIDomainEvent se)
UIDomainListener
domainSet
in interface UIDomainListener
public void variableConstraintsChanged(ItemVar variable, java.util.HashMap propConsts)
variableConstraintsChanged
in interface PropertyConstraintsListener
public void variableNameChanged(ItemVar oldVar, ItemVar newVar)
variableNameChanged
in interface PropertyConstraintsListener
public void variableTypeChanged(ItemVar var, UIObjectClass oldType, UIObjectClass newType)
variableTypeChanged
in interface PropertyConstraintsListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |