|
||||||||||
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 javax.swing.JComponent javax.swing.JPanel ix.iview.AConstructFramePanel
public abstract class AConstructFramePanel
An abstract editor/viewer panel for domain constructs. This kind of panel is intended to sit within a frame (domain editor); it will usually contain one or more ConstuctEditing panels. E.g. the ActionEditorPanel has alternative ConstructEditing panels for simple/comprehensive/graphical views.
This abstract class manages the generic window building (scoll, connection to frame, etc) and undo/redo, options for modified objects, notification of ConstructListeners, open/close/switching behaviour, and variable declarations Abstract methods to define are:
protected JPanel setupMainPanel() to set up the main editing panel. This is called during creation/initialisation. Often, this is a simple wrapper panel that contains a ConstructEditing panel and not much else.
public void refresh() to refresh the panel, making sure updates are shown etc.
public void newConstruct() to clear the panel and set up a new construct of the kind to be edited in this panel
public UIObject makeNewConstruct() to create a construct of the kind to be edited in this panel. Returns the new construct. Note that this method should not change the panel display.
public boolean frameActionPerformed(ActionEvent event) for handling user requests that are generated in the frame (e.g. in the menu) rather than in the panel
public void actionPerformed(ActionEvent ae) Wakes up the ActionListener with a user action. This is called when a KeyStroke or other panel event (e.g. button click) happens in which the ActionListener registered its interest.
protected UIObject noteConstruct() transfer information from the panel into the object that is being edited.
Optional methods to overwrite are: public void viewChanges() to show the user changes between the edited object and the version in the draft domain
public void viewChangesFromOriginal() to show the user changes between the edited object and the version in the published domain
public Set search(String pattern) to search the domain constructs
To add a new ConstructFramePanel to an editor frame, subclass this panel, implement the abstract methods, put a ConstructEditing panel inside (use setupMainPanel to do this), and implement its methods. Tie the methods to the commands using frameActionPerformed and set up your own commands using buttons etc. and the actionPerformed method.
Nested Class Summary | |
---|---|
protected class |
AConstructFramePanel.FieldValue
|
protected class |
AConstructFramePanel.JModifyDialog
|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
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 | |
---|---|
(package private) java.util.HashSet |
currentConstructListeners
|
static boolean |
DEFAULT_SORT
|
protected IFormPanel |
formPanel
seems like this should not be here! |
protected boolean |
hasOverview
|
protected javax.swing.JPanel |
mainPanel
The panel's main panel in which editing occurs |
DomainEditorFrame |
parent
The panels parent - a DomainEditor |
protected javax.swing.JScrollPane |
scrollPane
The scrollPane in which all the panel's contents are placed |
protected boolean |
switching
|
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 | |
---|---|
AConstructFramePanel()
Creates an editor panel. |
|
AConstructFramePanel(DomainEditorFrame theParent)
Creates an editor panel with the given parent. |
Method Summary | |
---|---|
abstract void |
actionPerformed(java.awt.event.ActionEvent ae)
Wakes up the ActionListener with a user action. |
void |
addCurrentConstructListener(CurrentConstructListener ccl)
|
void |
addUndoListener(UndoChangeListener listener)
|
java.lang.String |
addVariableDeclaration(java.lang.String name)
Add the given variable name as a declaration, return the name or "". |
void |
afterSwitching()
Ensures that displays are updated for new view/construct. |
protected void |
askModifyDialog(UIObject uio)
|
protected void |
askModifyOptions(UIObject uio)
|
boolean |
beforeClosing()
|
boolean |
beforeOpening()
|
boolean |
beforeSwitching()
Notes the current panel's contents in the current construct before switching. |
boolean |
canRedo()
|
boolean |
canUndo()
|
void |
clear()
|
protected abstract UIObject |
cloneConstruct(UIObject original)
|
void |
copyConstruct()
User request to copy the current action. |
void |
dataChanged(EditableObject o,
java.lang.String field,
java.lang.Object oVal,
java.lang.Object nVal)
|
void |
deleteConstruct()
User request to delete the current action. |
void |
editConstruct(java.lang.Object construct)
|
void |
fireConstructChanged(UIObject oldUIO,
UIObject newUIO,
java.awt.Component source)
|
abstract boolean |
frameActionPerformed(java.awt.event.ActionEvent event)
Tries to process an action generated in the panel's frame. |
Domain |
getDomain()
Gets the current Domain. |
ConstructEditing |
getEditingPanel()
|
ConstructEditing |
getMainPanel()
|
boolean |
getSort()
|
UIObject |
getUIConstruct()
Looks up the current construct in the main panel. |
UIDomain |
getUIDomain()
Gets the current UIDomain. |
java.util.List |
getVarsToOffer()
Offers the declared variables (if any) for completion, splices in selection (if any) |
boolean |
hasOverview()
|
abstract UIObject |
makeNewConstruct()
Makes a new construct of the panel's type. |
void |
newConstruct()
Makes a new construct of the panel's type and get ready to edit it by seting it in the panel. |
protected abstract UIObject |
noteConstruct()
Note the contents of the panel into the current object. |
protected void |
noteDraftConstruct(UIObject uio)
Note the UIObject in the (right) draft domain |
void |
OLDsetUIConstruct(UIObject object)
Sets the given UI construct to be viewed/edited. |
void |
populatePopup(JObjectPopup popup,
java.lang.Object construct)
|
boolean |
redo()
|
abstract void |
refresh()
|
void |
registerListKeys(javax.swing.JComponent comp,
java.lang.String commandEnd)
|
void |
removeCurrentConstructListener(CurrentConstructListener ccl)
|
void |
revertConstruct()
User request to revert an action to when it was last saved in the draft domain. |
void |
revertOConstruct()
User request to revert an action to when it was last saved in the draft domain. |
void |
saveConstruct()
User request to save a construct into the draft domain. |
java.util.Set |
search(java.lang.String pattern)
|
void |
setConstruct(IXObject object)
Sets the given construct to be viewed/edited. |
void |
setSort(boolean sortIt)
|
void |
setUIConstruct(UIObject object)
Sets the given UI construct to be viewed/edited. |
void |
setUIConstructPanel(UIObject construct)
overwrite this to not call before/after switching |
void |
setUIDomain(UIDomain uid)
Sets the current UIDomain. |
protected void |
setupEditor()
Sets the panel's layout and dimensions and the main panel's layout. |
protected abstract javax.swing.JPanel |
setupMainPanel()
Sets up the main panel in which construct editing will happen. |
protected void |
setupOuterPanel()
|
boolean |
undo()
|
java.lang.Object |
undoGetValue(java.lang.String field)
Gets the given field to the given value in the editor. |
void |
undoSetValue(java.lang.String field,
java.lang.Object value)
Sets the given field to the given value in the editor. |
void |
updateOverview()
|
void |
viewChanges()
into abstract User request to view the changes from the draft version of the object. |
void |
viewChangesFromOriginal()
User request to view the changes from the original object. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, 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, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, 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 ix.iview.ConstructFraming |
---|
checkConstruct, getAllConstructs, getNamedConstruct |
Field Detail |
---|
public DomainEditorFrame parent
protected javax.swing.JScrollPane scrollPane
protected javax.swing.JPanel mainPanel
protected IFormPanel formPanel
protected boolean switching
protected boolean hasOverview
public static boolean DEFAULT_SORT
java.util.HashSet currentConstructListeners
Constructor Detail |
---|
public AConstructFramePanel()
public AConstructFramePanel(DomainEditorFrame theParent)
parent
- the DomainEditorFrame that the panel belons to. Used
mainly to keep toggle buttons and menus in synchMethod Detail |
---|
public void undoSetValue(java.lang.String field, java.lang.Object value)
undoSetValue
in interface UndoEditing
public java.lang.Object undoGetValue(java.lang.String field)
undoGetValue
in interface UndoEditing
protected void setupEditor()
protected void setupOuterPanel()
protected abstract javax.swing.JPanel setupMainPanel()
public ConstructEditing getEditingPanel()
public void registerListKeys(javax.swing.JComponent comp, java.lang.String commandEnd)
public ConstructEditing getMainPanel()
public void editConstruct(java.lang.Object construct)
public void deleteConstruct()
public void copyConstruct()
public void setUIConstructPanel(UIObject construct)
public java.util.Set search(java.lang.String pattern)
public void viewChangesFromOriginal()
viewChangesFromOriginal
in interface ConstructFraming
public void viewChanges()
viewChanges
in interface ConstructFraming
public void saveConstruct()
saveConstruct
in interface ConstructFraming
public void revertConstruct()
public void revertOConstruct()
public void setConstruct(IXObject object)
setConstruct
in interface ConstructFraming
object
- the object to be viewed/editedpublic void setUIConstruct(UIObject object)
setUIConstruct
in interface ConstructFraming
object
- the UIObject to be viewed/editedpublic void OLDsetUIConstruct(UIObject object)
object
- the UIObject to be viewed/editedpublic UIObject getUIConstruct()
public Domain getDomain()
ConstructFraming
getDomain
in interface ConstructFraming
public UIDomain getUIDomain()
ConstructFraming
getUIDomain
in interface ConstructFraming
public void setUIDomain(UIDomain uid)
ConstructFraming
setUIDomain
in interface ConstructFraming
public void clear()
public boolean hasOverview()
public void updateOverview()
public void setSort(boolean sortIt)
public boolean getSort()
public boolean canUndo()
public boolean canRedo()
public boolean undo()
public boolean redo()
public void populatePopup(JObjectPopup popup, java.lang.Object construct)
public void addUndoListener(UndoChangeListener listener)
public void addCurrentConstructListener(CurrentConstructListener ccl)
public void removeCurrentConstructListener(CurrentConstructListener ccl)
public void fireConstructChanged(UIObject oldUIO, UIObject newUIO, java.awt.Component source)
public boolean beforeClosing()
public boolean beforeOpening()
public void afterSwitching()
public boolean beforeSwitching()
protected void askModifyOptions(UIObject uio)
protected void askModifyDialog(UIObject uio)
protected void noteDraftConstruct(UIObject uio)
public void dataChanged(EditableObject o, java.lang.String field, java.lang.Object oVal, java.lang.Object nVal)
dataChanged
in interface DataChangeListener
public java.util.List getVarsToOffer()
getVarsToOffer
in interface VarSpecifier
public java.lang.String addVariableDeclaration(java.lang.String name)
VarSpecifier
addVariableDeclaration
in interface VarSpecifier
public void newConstruct()
newConstruct
in interface ConstructFraming
public abstract void refresh()
public abstract UIObject makeNewConstruct()
ConstructFraming
makeNewConstruct
in interface ConstructFraming
protected abstract UIObject cloneConstruct(UIObject original)
public abstract boolean frameActionPerformed(java.awt.event.ActionEvent event)
ConstructFraming
frameActionPerformed
in interface FramePanel
frameActionPerformed
in interface ConstructFraming
event
- the event to be processed.
public abstract void actionPerformed(java.awt.event.ActionEvent ae)
actionPerformed
in interface java.awt.event.ActionListener
protected abstract UIObject noteConstruct()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |