|
|||||||||||
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 | +--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.
The Properties panels for UML Model Elements are structured in an inheritance hierarchy that matches the UML 1.3 metamodel.
Field Summary | |
protected static javax.swing.ImageIcon |
_deleteIcon
|
protected static javax.swing.ImageIcon |
_navUpIcon
|
protected Toolbar |
buttonPanel
|
protected java.awt.Font |
smallFont
|
Fields inherited from class org.argouml.ui.TabSpawnable |
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)
Deprecated. As of ArgoUml version 0.13.2 (7-Dec-2002), replaced by . Use of GridBagLayout is being dropped in favour of LabelledLayout
I propose to remove this by version 0.15 (Bob Tarling) |
|
PropPanel(java.lang.String title,
javax.swing.ImageIcon icon,
Orientation orientation)
Construct new PropPanel using LabelledLayout |
|
PropPanel(java.lang.String title,
int panelCount)
Deprecated. As of ArgoUml version 0.13.2 (7-Dec-2002), replaced by PropPanel(String, ImageIcon, Orientation)
I propose to remove this by version 0.15 (Bob Tarling) |
|
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)
Deprecated. as of ArgoUml 0.13.5 (10-may-2003), GridBagConstraints is no longer used as a prop panel layout, replaced by addField(label, component) - Labelled layout method. I propose to remove this by version 0.15 (Bob Tarling) |
void |
addCaption(java.lang.String label,
int row,
int panel,
double weighty)
Deprecated. as of ArgoUml 0.13.5 (10-may-2003), GridBagConstraints is no longer used as a prop panel layout, replaced by addField(label, component) - Labelled layout method I propose to remove this by version 0.15 (Bob Tarling) |
void |
addField(java.awt.Component component,
int row,
int panel,
double weighty)
Deprecated. as of ArgoUml 0.13.5 (10-may-2003), GridBagConstraints is no longer used as a prop panel layout, replaced by addField(label, component) - Labelled layout method. I propose to remove this by version 0.15 (Bob Tarling) |
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)
Deprecated. as of ArgoUml 0.13.5 (10-may-2003), GridBagConstraints is no longer used as a prop panel layout, replaced by addLinkField(label, component) - Labelled layout method. |
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(MBase target)
This method (and removeMElementListener) can be overriden if the prop panel wants to monitor additional objects. |
protected void |
addSeperator()
|
java.lang.String |
formatCollection(java.util.Iterator iter)
Formats a collection of model elements. |
java.lang.String |
formatElement(MModelElement element)
Formats the specified model element. |
java.lang.String |
formatNamespace(MNamespace ns)
Formats the model element as a namespace. |
protected 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 |
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(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()
Deprecated. As of ArgoUml version 0.13.5,replaced by {@link org.argouml.ui.targetmanager.TargetManager.getInstance().navigateBack(); |
boolean |
navigateForward(boolean attempt)
Called to navigate to next selection returns true if navigation performed |
void |
navigateForwardAction()
Deprecated. As of ArgoUml version 0.13.5,replaced by TargetManager.getInstance().navigateForward() |
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 |
propertySet(MElementEvent mee)
|
void |
recovered(MElementEvent mee)
|
void |
refresh()
Refreshes the tab IN TOTAL |
void |
removed(MElementEvent mee)
|
void |
removeElement()
|
protected void |
removeMElementListener(MBase target)
This method (and addMElementListener) can be overriden if the prop panel wants to monitor additional objects. |
void |
roleAdded(MElementEvent mee)
|
void |
roleRemoved(MElementEvent mee)
|
void |
setNameEventListening(java.lang.Class[] metaclasses)
Deprecated. As of ArgoUml version unknown(earlier than 0.13.5), replaced by UmlModelEventPump.addModelEventListener(Object , Object) .
since components should register themselves. |
void |
setOrientation(Orientation orientation)
Set the orientation of the panel |
void |
setTarget(java.lang.Object t)
Deprecated. As Of Argouml version 0.13.5, This will change visibility from release 0.16 |
boolean |
shouldBeEnabled(java.lang.Object target)
Returns true if the tab should be enabled with the given target |
void |
targetAdded(TargetEvent e)
Fired when a target is added to the list of targets. |
void |
targetRemoved(TargetEvent e)
Fired when a target is removed from the list of targets |
void |
targetSet(TargetEvent e)
Fired when a total new set of targets is set |
Methods inherited from class org.argouml.ui.TabSpawnable |
clone, getTitle, setTitle, spawn |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, 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, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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 |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Toolbar buttonPanel
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, javax.swing.ImageIcon icon, Orientation orientation)
icon
- The icon to display for the paneltitle
- The title of the panelpublic PropPanel(java.lang.String title, Orientation orientation)
title
- orientation
- public PropPanel(java.lang.String title, int panelCount)
PropPanel(String, ImageIcon, Orientation)
I propose to remove this by version 0.15 (Bob Tarling)
title
- Title of panelpanelCount
- number of horizontal panelspublic PropPanel(java.lang.String title, javax.swing.ImageIcon icon, int panelCount)
LabelledLayout
I propose to remove this by version 0.15 (Bob Tarling)
title
- Title of panelpanelCount
- number of horizontal panelsMethod Detail |
public void setOrientation(Orientation orientation)
setOrientation
in interface Orientable
setOrientation
in class TabSpawnable
orientation
- 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
key
- key for resource bundle, typically english literal
protected final void addSeperator()
public java.util.ResourceBundle getResourceBundle()
public Profile getProfile()
UMLUserInterfaceContainer
getProfile
in interface UMLUserInterfaceContainer
protected void removeMElementListener(MBase target)
target
- target of prop panelpublic void addMElementListener(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 TabTarget
t
- The object to be set as a target.public final java.lang.Object getTarget()
UMLUserInterfaceContainer
getTarget
in interface TabTarget
public final MModelElement getModelElement()
UMLUserInterfaceContainer
getModelElement
in interface UMLUserInterfaceContainer
public void refresh()
TabTarget
refresh
in interface TabTarget
public boolean shouldBeEnabled(java.lang.Object target)
TabTarget
shouldBeEnabled
in interface TabTarget
public void propertySet(MElementEvent mee)
public void listRoleItemSet(MElementEvent mee)
public void recovered(MElementEvent mee)
public void removed(MElementEvent mee)
public void roleAdded(MElementEvent mee)
public void roleRemoved(MElementEvent mee)
protected MNamespace getDisplayNamespace()
public java.lang.String formatElement(MModelElement element)
UMLUserInterfaceContainer
formatElement
in interface UMLUserInterfaceContainer
public java.lang.String formatNamespace(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)
TargetManager.getInstance().setTarget(Object target)
NavigationListener
navigateTo
in interface NavigationListener
public boolean navigateBack(boolean attempt)
TargetManager.getInstance().navigateBackward()
NavigationListener
navigateBack
in interface NavigationListener
attempt
- false if navigation accomplished by earlier listener
public void navigateBackAction()
public boolean navigateForward(boolean attempt)
TargetManager.getInstance().navigateForward()
NavigationListener
navigateForward
in interface NavigationListener
attempt
- false if navigation accomplished by earlier listener
public void navigateForwardAction()
TargetManager.getInstance().navigateForward()
public boolean isNavigateForwardEnabled()
TargetManager.getInstance().navigateForwardPossible()
NavigationListener
isNavigateForwardEnabled
in interface NavigationListener
public boolean isNavigateBackEnabled()
TargetManager.getInstance().navigateBackPossible()
NavigationListener
isNavigateBackEnabled
in interface NavigationListener
public void setNameEventListening(java.lang.Class[] metaclasses)
UmlModelEventPump.addModelEventListener(Object , Object)
.
since components should register themselves.
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()
public void targetAdded(TargetEvent e)
TargetListener
targetAdded
in interface TargetListener
e
- The targetevent, name will be TARGET_ADDEDTargetListener.targetAdded(org.argouml.ui.targetmanager.TargetEvent)
public void targetRemoved(TargetEvent e)
TargetListener
targetRemoved
in interface TargetListener
e
- The targetevent, name will be TARGET_REMOVEDTargetListener.targetRemoved(org.argouml.ui.targetmanager.TargetEvent)
public void targetSet(TargetEvent e)
TargetListener
targetSet
in interface TargetListener
e
- The targetevent, name will be TARGET_SETTargetListener.targetSet(org.argouml.ui.targetmanager.TargetEvent)
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 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.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2003 (20030919) | ArgoUML Project Home | ArgoUML Cookbook |