uk.ac.ic.doc.y2002.tool.editor
Class PropertiesFrame

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JInternalFrame
                          |
                          +--uk.ac.ic.doc.y2002.tool.editor.PropertiesFrame
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants
Direct Known Subclasses:
DisplayPropertiesBox, PNPropertiesBox

public class PropertiesFrame
extends javax.swing.JInternalFrame

The base class for the Properties Window. The default implementation extracts all elements and attributes below the element being examined. The one extra feature is that it makes "id" fields un-editable.

See Also:
Serialized Form

Inner Class Summary
 class PropertiesFrame.AttribUpdater
          Listener class which is attached to an input text field and updates the JDOM Element with any changes.
 class PropertiesFrame.ValueUpdater
          Listener class which is attached to an input text field and updates the JDOM Element with any changes.
 
Inner classes inherited from class javax.swing.JInternalFrame
javax.swing.JInternalFrame.AccessibleJInternalFrame, javax.swing.JInternalFrame.JDesktopIcon
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Fields inherited from class javax.swing.JInternalFrame
closable, CONTENT_PANE_PROPERTY, desktopIcon, FRAME_ICON_PROPERTY, frameIcon, GLASS_PANE_PROPERTY, iconable, IS_CLOSED_PROPERTY, IS_ICON_PROPERTY, IS_MAXIMUM_PROPERTY, IS_SELECTED_PROPERTY, isClosed, isIcon, isMaximum, isSelected, LAYERED_PANE_PROPERTY, maximizable, MENU_BAR_PROPERTY, resizable, ROOT_PANE_PROPERTY, rootPane, rootPaneCheckingEnabled, title, TITLE_PROPERTY
 
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 javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
PropertiesFrame(org.jdom.Element e)
           
 
Method Summary
protected  javax.swing.JTextField doAttribute(java.lang.String label, javax.swing.JPanel panel, org.jdom.Element e, org.jdom.Attribute a)
          A variant on (and helper for) doAttributes(JPanel,Element,String) for when you want to specify the text used to label the input field.
protected  javax.swing.JComboBox doAttribute(java.lang.String label, javax.swing.JPanel panel, org.jdom.Element e, org.jdom.Attribute a, java.util.Vector values)
          A variant on (and helper for) doAttributes(JPanel,Element,String) for when you want to specify the text used to label the input field, and you have a fixed set of allowed values for this attribute.
protected  void doAttributes(javax.swing.JPanel panel, org.jdom.Element e, java.lang.String ancestry)
          Deals with attributes of the current element, eg - creates a label and a field, with attached Listener of class AttribUpdater.
protected  void doElement(javax.swing.JPanel panel, org.jdom.Element e, java.lang.String ancestry)
          Function which recursively works through the Element and its children, producing labels and input fields.
protected  void doHidden(javax.swing.JPanel panel, org.jdom.Element e)
          Override in subclasses to find those elements which should not be shown in the properties box.
protected  boolean done(java.lang.Object o)
           
protected  void doSpecial(javax.swing.JPanel panel, org.jdom.Element e)
          Override in subclasses to find and add to the panel elements that require special treatment, and those that should always be available for a particular type of petri net object.
protected  void doTextContent(javax.swing.JPanel panel, org.jdom.Element e, java.lang.String ancestry)
          Deals with text content within an element, eg 34 - creates a label and a field, with attached Listener of class ValueUpdater.
protected  javax.swing.JTextField doTextContent(java.lang.String label, javax.swing.JPanel panel, org.jdom.Element e)
          A variant on doTextContent(JPanel,Element,String) for when you want to specify the text used to label the input field.
protected  java.lang.String format(java.lang.String text)
           
protected  javax.swing.JPanel makePanel()
          Makes the panel which contains the input fields.
 
Methods inherited from class javax.swing.JInternalFrame
addImpl, addInternalFrameListener, createRootPane, dispose, doDefaultCloseAction, fireInternalFrameEvent, getAccessibleContext, getContentPane, getDefaultCloseOperation, getDesktopIcon, getDesktopPane, getFocusOwner, getFrameIcon, getGlassPane, getJMenuBar, getLayer, getLayeredPane, getMenuBar, getNormalBounds, getRootPane, getTitle, getUI, getUIClassID, getWarningString, isClosable, isClosed, isIcon, isIconifiable, isMaximizable, isMaximum, isResizable, isRootPaneCheckingEnabled, isSelected, moveToBack, moveToFront, pack, paintComponent, paramString, remove, removeInternalFrameListener, reshape, restoreSubcomponentFocus, setClosable, setClosed, setContentPane, setDefaultCloseOperation, setDesktopIcon, setFrameIcon, setGlassPane, setIcon, setIconifiable, setJMenuBar, setLayer, setLayer, setLayeredPane, setLayout, setMaximizable, setMaximum, setMenuBar, setNormalBounds, setResizable, setRootPane, setRootPaneCheckingEnabled, setSelected, setTitle, setUI, show, toBack, toFront, 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, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, 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, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertiesFrame

public PropertiesFrame(org.jdom.Element e)
Method Detail

makePanel

protected javax.swing.JPanel makePanel()
Makes the panel which contains the input fields. doElement() creates the input fields by examining the Element.
See Also:
doElement(JPanel panel, Element e, String ancestry)

doElement

protected void doElement(javax.swing.JPanel panel,
                         org.jdom.Element e,
                         java.lang.String ancestry)
Function which recursively works through the Element and its children, producing labels and input fields.
See Also:
doTextContent(JPanel panel, Element e, String ancestry), doAttributes(JPanel panel, Element e, String ancestry)

doTextContent

protected void doTextContent(javax.swing.JPanel panel,
                             org.jdom.Element e,
                             java.lang.String ancestry)
Deals with text content within an element, eg 34 - creates a label and a field, with attached Listener of class ValueUpdater.
See Also:
PropertiesFrame.ValueUpdater

doTextContent

protected javax.swing.JTextField doTextContent(java.lang.String label,
                                               javax.swing.JPanel panel,
                                               org.jdom.Element e)
A variant on doTextContent(JPanel,Element,String) for when you want to specify the text used to label the input field.
See Also:
doTextContent(JPanel panel, Element e, String ancestry)

doAttributes

protected void doAttributes(javax.swing.JPanel panel,
                            org.jdom.Element e,
                            java.lang.String ancestry)
Deals with attributes of the current element, eg - creates a label and a field, with attached Listener of class AttribUpdater. If the attribute is "id", sets the field to be non-editable.
See Also:
PropertiesFrame.AttribUpdater

doAttribute

protected javax.swing.JTextField doAttribute(java.lang.String label,
                                             javax.swing.JPanel panel,
                                             org.jdom.Element e,
                                             org.jdom.Attribute a)
A variant on (and helper for) doAttributes(JPanel,Element,String) for when you want to specify the text used to label the input field.
See Also:
doAttributes(JPanel panel, Element e, String ancestry)

doAttribute

protected javax.swing.JComboBox doAttribute(java.lang.String label,
                                            javax.swing.JPanel panel,
                                            org.jdom.Element e,
                                            org.jdom.Attribute a,
                                            java.util.Vector values)
A variant on (and helper for) doAttributes(JPanel,Element,String) for when you want to specify the text used to label the input field, and you have a fixed set of allowed values for this attribute.
See Also:
doAttributes(JPanel panel, Element e, String ancestry)

done

protected boolean done(java.lang.Object o)

doSpecial

protected void doSpecial(javax.swing.JPanel panel,
                         org.jdom.Element e)
Override in subclasses to find and add to the panel elements that require special treatment, and those that should always be available for a particular type of petri net object.

doHidden

protected void doHidden(javax.swing.JPanel panel,
                        org.jdom.Element e)
Override in subclasses to find those elements which should not be shown in the properties box.

format

protected java.lang.String format(java.lang.String text)