|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--org.argouml.ui.TabSpawnable | +--org.argouml.uml.ui.PropPanel
This abstract class provides the basic layout and event dispatching support for all Property Panels. The property panel is layed out as a number (specified in the constructor) of equally sized panels that split the available space. Each panel has a column of "captions" and matching column of "fields" which are laid out indepently from the other panels.
Inner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
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 |
Field Summary | |
protected static javax.swing.ImageIcon |
_deleteIcon
|
protected static javax.swing.ImageIcon |
_navBackIcon
|
protected static javax.swing.ImageIcon |
_navForwardIcon
|
protected static javax.swing.ImageIcon |
_navUpIcon
|
protected javax.swing.JPanel |
buttonPanel
|
protected java.awt.Font |
smallFont
|
Fields inherited from class org.argouml.ui.TabSpawnable |
cat, orientation, OVERLAPP |
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 | |
PropPanel(java.lang.String title,
javax.swing.ImageIcon icon,
int panelCount)
Constructs the PropPanel - DO NOT USE. |
|
PropPanel(java.lang.String title,
javax.swing.ImageIcon icon,
Orientation orientation)
Construct new PropPanel using LabelledLayout |
|
PropPanel(java.lang.String title,
int panelCount)
Deprecated. 7-Dec-2002 by Bob Tarling. Use the constructor specifying orientation instead. |
|
PropPanel(java.lang.String title,
Orientation orientation)
Constructs a new Proppanel without an icon. |
Method Summary | |
void |
addCaption(java.awt.Component component,
int row,
int panel,
double weighty)
Adds a component to the captions of the specified panel. |
void |
addCaption(java.lang.String label,
int row,
int panel,
double weighty)
|
void |
addField(java.awt.Component component,
int row,
int panel,
double weighty)
Adds a component to the fields of the specified panel. |
javax.swing.JLabel |
addField(java.lang.String label,
java.awt.Component component)
Add a component with the specified label |
javax.swing.JLabel |
addFieldAfter(java.lang.String label,
java.awt.Component component,
java.awt.Component afterComponent)
Add a component with the specified label positioned after another component |
javax.swing.JLabel |
addFieldBefore(java.lang.String label,
java.awt.Component component,
java.awt.Component beforeComponent)
Add a component with the specified label positioned before another component |
void |
addLinkField(java.awt.Component component,
int row,
int panel,
double weighty)
Adds a component to the fields of the specified panel and sets the background and color to indicate the field is a link. |
void |
addLinkField(java.lang.String label,
javax.swing.JComponent component)
Adds a component to the fields of the specified panel and sets the background and color to indicate the field is a link. |
void |
addMElementListener(ru.novosoft.uml.MBase target)
This method (and removeMElementListener) can be overriden if the prop panel wants to monitor additional objects. |
void |
addNavigationListener(NavigationListener navListener)
Registers a listener for navigation events. |
java.lang.String |
formatCollection(java.util.Iterator iter)
Formats a collection of model elements. |
java.lang.String |
formatElement(ru.novosoft.uml.foundation.core.MModelElement element)
Formats the specified model element. |
java.lang.String |
formatNamespace(ru.novosoft.uml.foundation.core.MNamespace ns)
Formats the model element as a namespace. |
protected ru.novosoft.uml.foundation.core.MNamespace |
getDisplayNamespace()
This method can be overriden in derived Panels where the appropriate namespace for display may not be the same as the namespace of the target |
ru.novosoft.uml.foundation.core.MModelElement |
getModelElement()
Returns the current target for the container if the target is a MModelElement, otherwise null. |
Profile |
getProfile()
Returns the current profile, may not be null. |
java.util.ResourceBundle |
getResourceBundle()
|
java.lang.Object |
getTarget()
Returns the current target for the container, may be null. |
boolean |
isNavigateBackEnabled()
Returns true if this listener has a target for a back navigation. |
boolean |
isNavigateForwardEnabled()
Returns true if this listener has a target for a back navigation. |
boolean |
isRemovableElement()
check whether this element can be deleted. |
void |
listRoleItemSet(ru.novosoft.uml.MElementEvent mee)
|
java.lang.String |
localize(java.lang.String key)
Returns a localized string corresponding to the key |
boolean |
navigateBack(boolean attempt)
Called to navigate to previous selection returns true if navigation performed |
void |
navigateBackAction()
|
boolean |
navigateForward(boolean attempt)
Called to navigate to next selection returns true if navigation performed |
void |
navigateForwardAction()
|
void |
navigateTo(java.lang.Object element)
Called by a user interface element when a request to navigate to a model element has been received. |
void |
open(java.lang.Object element)
Called by a user interface element when a request to open a model element in a new window has been recieved. |
void |
propertySet(ru.novosoft.uml.MElementEvent mee)
|
void |
recovered(ru.novosoft.uml.MElementEvent mee)
|
void |
refresh()
|
void |
removed(ru.novosoft.uml.MElementEvent mee)
|
void |
removeElement()
|
protected void |
removeMElementListener(ru.novosoft.uml.MBase target)
This method (and addMElementListener) can be overriden if the prop panel wants to monitor additional objects. |
void |
removeNavigationListener(NavigationListener navListener)
Removes a listener for navigation events. |
void |
roleAdded(ru.novosoft.uml.MElementEvent mee)
|
void |
roleRemoved(ru.novosoft.uml.MElementEvent mee)
|
void |
setNameEventListening(java.lang.Class[] metaclasses)
Deprecated. since components should register themselves. |
void |
setOrientation(Orientation orientation)
|
void |
setTarget(java.lang.Object t)
Set the target to be associated with a particular property panel. This involves resetting the third party listeners. |
boolean |
shouldBeEnabled()
|
Methods inherited from class org.argouml.ui.TabSpawnable |
clone, getTitle, setTitle, spawn |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUIClassID, paramString, 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, 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, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, 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, addImpl, 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, remove, removeAll, removeContainerListener, setLayout, 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, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected javax.swing.JPanel buttonPanel
protected static javax.swing.ImageIcon _navBackIcon
protected static javax.swing.ImageIcon _navForwardIcon
protected static javax.swing.ImageIcon _deleteIcon
protected static javax.swing.ImageIcon _navUpIcon
protected java.awt.Font smallFont
Constructor Detail |
public PropPanel(java.lang.String title, int panelCount)
title
- Title of panelpanelCount
- number of horizontal panelspublic PropPanel(java.lang.String title, javax.swing.ImageIcon icon, int panelCount)
title
- Title of panelpanelCount
- number of horizontal panelspublic PropPanel(java.lang.String title, javax.swing.ImageIcon icon, Orientation orientation)
icon
- The icon to display for the paneltitle
- The title of the panelsectionCount
- the number of sections in the proppanelpublic PropPanel(java.lang.String title, Orientation orientation)
title
- orientation
- Method Detail |
public void setOrientation(Orientation orientation)
setOrientation
in class TabSpawnable
public void addCaption(java.awt.Component component, int row, int panel, double weighty)
component
- Component to be added (typically a JLabel)row
- row index, zero-based.panel
- panel index, zero-based.weighty
- specifies how to distribute extra vertical space,
see GridBagConstraint for details on usage.public void addCaption(java.lang.String label, int row, int panel, double weighty)
public javax.swing.JLabel addField(java.lang.String label, java.awt.Component component)
label
- the label for the componentcomponent
- the componentpublic javax.swing.JLabel addFieldAfter(java.lang.String label, java.awt.Component component, java.awt.Component afterComponent)
label
- the label for the componentcomponent
- the componentpublic javax.swing.JLabel addFieldBefore(java.lang.String label, java.awt.Component component, java.awt.Component beforeComponent)
label
- the label for the componentcomponent
- the componentbeforeComponent
- the componentpublic final void addLinkField(java.lang.String label, javax.swing.JComponent component)
label
- the required string labelcomponent
- Component to be addedpublic final java.lang.String localize(java.lang.String key)
UMLUserInterfaceContainer
localize
in interface UMLUserInterfaceContainer
org.argouml.uml.ui.UMLUserInterfaceContainer
key
- key for resource bundle, typically english literalpublic java.util.ResourceBundle getResourceBundle()
public void addField(java.awt.Component component, int row, int panel, double weighty)
component
- Component to be addedrow
- row index, zero-based.panel
- panel index, zero-based.weighty
- specifies how to distribute extra vertical space,
see GridBagConstraint for details on usage.public final void addLinkField(java.awt.Component component, int row, int panel, double weighty)
component
- Component to be addedrow
- row index, zero-based.panel
- panel index, zero-based.weighty
- specifies how to distribute extra vertical space,
see GridBagConstraint for details on usage.public Profile getProfile()
UMLUserInterfaceContainer
getProfile
in interface UMLUserInterfaceContainer
protected void removeMElementListener(ru.novosoft.uml.MBase target)
target
- target of prop panelpublic void addMElementListener(ru.novosoft.uml.MBase target)
target
- target of prop panelpublic void setTarget(java.lang.Object t)
Set the target to be associated with a particular property panel.
This involves resetting the third party listeners.
setTarget
in interface TabModelTarget
t
- The object to be set as a target.public final java.lang.Object getTarget()
UMLUserInterfaceContainer
getTarget
in interface TabModelTarget
public final ru.novosoft.uml.foundation.core.MModelElement getModelElement()
UMLUserInterfaceContainer
getModelElement
in interface UMLUserInterfaceContainer
public void refresh()
refresh
in interface TabModelTarget
public boolean shouldBeEnabled()
shouldBeEnabled
in interface TabModelTarget
public void propertySet(ru.novosoft.uml.MElementEvent mee)
propertySet
in interface ru.novosoft.uml.MElementListener
public void listRoleItemSet(ru.novosoft.uml.MElementEvent mee)
listRoleItemSet
in interface ru.novosoft.uml.MElementListener
public void recovered(ru.novosoft.uml.MElementEvent mee)
recovered
in interface ru.novosoft.uml.MElementListener
public void removed(ru.novosoft.uml.MElementEvent mee)
removed
in interface ru.novosoft.uml.MElementListener
public void roleAdded(ru.novosoft.uml.MElementEvent mee)
roleAdded
in interface ru.novosoft.uml.MElementListener
public void roleRemoved(ru.novosoft.uml.MElementEvent mee)
roleRemoved
in interface ru.novosoft.uml.MElementListener
protected ru.novosoft.uml.foundation.core.MNamespace getDisplayNamespace()
public java.lang.String formatElement(ru.novosoft.uml.foundation.core.MModelElement element)
UMLUserInterfaceContainer
formatElement
in interface UMLUserInterfaceContainer
public java.lang.String formatNamespace(ru.novosoft.uml.foundation.core.MNamespace ns)
UMLUserInterfaceContainer
formatNamespace
in interface UMLUserInterfaceContainer
public java.lang.String formatCollection(java.util.Iterator iter)
UMLUserInterfaceContainer
formatCollection
in interface UMLUserInterfaceContainer
public void navigateTo(java.lang.Object element)
NavigationListener
navigateTo
in interface NavigationListener
public void open(java.lang.Object element)
NavigationListener
open
in interface NavigationListener
public boolean navigateBack(boolean attempt)
NavigationListener
navigateBack
in interface NavigationListener
org.argouml.ui.NavigationListener
attempt
- false if navigation accomplished by earlier listenerpublic void navigateBackAction()
public boolean navigateForward(boolean attempt)
NavigationListener
navigateForward
in interface NavigationListener
org.argouml.ui.NavigationListener
attempt
- false if navigation accomplished by earlier listenerpublic void navigateForwardAction()
public boolean isNavigateForwardEnabled()
NavigationListener
isNavigateForwardEnabled
in interface NavigationListener
public boolean isNavigateBackEnabled()
NavigationListener
isNavigateBackEnabled
in interface NavigationListener
public void addNavigationListener(NavigationListener navListener)
addNavigationListener
in interface UMLUserInterfaceContainer
public void removeNavigationListener(NavigationListener navListener)
UMLUserInterfaceContainer
removeNavigationListener
in interface UMLUserInterfaceContainer
public void setNameEventListening(java.lang.Class[] metaclasses)
Calling this method with an array of metaclasses (for example, MClassifier.class) will result in the prop panel propagating any name changes or removals on any object that on the same event queue as the target that is assignable to one of the metaclasses.
Reworked to use #addThirdPartyEventListening(Object[])
, so
removing the need for NSUML promiscuous listeners.
Note. Despite the name, the old implementation tried to listen for ownedElement and baseClass events as well as name events. We incorporate all these.
Note Reworked the implementation to use the new UmlModelEventPump mechanism. In the future proppanels should register directly with UmlModelEventPump IF they are really interested in the events themselves. If components on the proppanels are interested, these components should register themselves.
metaclasses
- The metaclass array we wish to listen to.public void removeElement()
public boolean isRemovableElement()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML (c) 1996-2002 |