org.argouml.ui
Class DetailsPane

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byorg.argouml.ui.DetailsPane
All Implemented Interfaces:
Accessible, ChangeListener, EventListener, ImageObserver, MenuContainer, MouseListener, org.tigris.swidgets.Orientable, QuadrantPanel, Serializable, TargetListener

public class DetailsPane
extends JPanel
implements ChangeListener, MouseListener, QuadrantPanel, org.tigris.swidgets.Orientable, TargetListener

The lower-right pane of the main ArgoUML window, which shows the details of a selected model element.

This panel has several tabs that show details of the selected ToDoItem, or the selected model element in the Explorer (NavigatorPane), or the MultiEditorPane.

There are requests to have the cursor automatically be set to the primary field.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  Object currentTarget
          The current target.
private  int lastNonNullTab
          index of the selected tab in the JTabbedPane.
private  Icon leftArrowIcon
          Graphic that goes on the tab label.
private  EventListenerList listenerList
          The list with targetlisteners, this are the property panels managed by TabProps It should only contain one listener at a time.
private static Logger LOG
          Logger.
private  Object selectedTodoItem
          The currently selected todo item.
private  Vector tabPanelList
          a list of all the tabs, which are JPanels, in the JTabbedPane tabs.
private  JTabbedPane topLevelTabbedPane
          The top level pane, which is a tabbed pane.
private  Icon upArrowIcon
          Graphic that goes on the tab label.
 
Fields inherited from class javax.swing.JPanel
 
Fields inherited from class javax.swing.JComponent
accessibleContext, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface org.argouml.application.api.QuadrantPanel
Q_BOTTOM, Q_BOTTOM_LEFT, Q_BOTTOM_RIGHT, Q_LEFT, Q_RIGHT, Q_TOP, Q_TOP_LEFT, Q_TOP_RIGHT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DetailsPane(String pane, org.tigris.swidgets.Orientation orientation)
          Gets all of the tabPanels from the ConfigLoader, then adds them to the JTabbedPane.
 
Method Summary
private  void addTargetListener(TargetListener listener)
          Adds a listener.
 void addToPropTab(Class c, PropPanel p)
          Helper method to add a Property panel for a given class.
private  void enableTabs(Object target)
          Enables/disables the tabs on the tabbed card.
private  void fireTargetAdded(TargetEvent targetEvent)
           
private  void fireTargetRemoved(TargetEvent targetEvent)
           
private  void fireTargetSet(TargetEvent targetEvent)
           
 int getIndexOfNamedTab(String tabName)
          Get the index of the tab with the given name.
 Dimension getMinimumSize()
           
 JPanel getNamedTab(String tabName)
          Get the JPanel of the tab with the given name.
 int getQuadrant()
          This shall return a corner indentification.
 TabSpawnable getTab(Class tabClass)
          Returns the tab instance of the specified class.
 int getTabCount()
          Get the number of tabs.
 TabProps getTabProps()
          returns the Property panel in the Details Pane.
 JTabbedPane getTabs()
          Returns the JTabbedPane that contains all details panels.
 Object getTarget()
          Returns the current model target.
 void mouseClicked(MouseEvent me)
          if(the mouse click is not in the bounds of the tabbed panel) then call mySingleClick() or myDoubleClick()
 void mouseEntered(MouseEvent me)
          empty, no action taken.
 void mouseExited(MouseEvent me)
          empty, no action taken.
 void mousePressed(MouseEvent me)
          empty, no action taken.
 void mouseReleased(MouseEvent me)
          empty, no action taken.
 void myDoubleClick(int tab)
          Spawns a new tab.
 void mySingleClick(int tab)
          no action currently executed here.
private  void removeTargetListener(TargetListener listener)
          Removes a target listener.
 boolean selectTabNamed(String tabName)
          Selects a tab by given name.
 void setOrientation(org.tigris.swidgets.Orientation orientation)
          Set the orientation of this details pane.
private  void setTarget(Object target)
          Sets the target of the Details pane to either be a selected model element or the owner(model element) of a selected fig.
 boolean setToDoItem(Object item)
          Selects the to do tab, and sets the target of that tab.
 void stateChanged(ChangeEvent e)
          Reacts to a change in the selected tab by calling refresh() for TabToDoTarget's & setTarget on a TabModelTarget or TabFigTarget instance old notes: called when the user selects a new tab, by clicking or otherwise.
 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 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, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

private static final Logger LOG
Logger.


selectedTodoItem

private Object selectedTodoItem
The currently selected todo item.


topLevelTabbedPane

private JTabbedPane topLevelTabbedPane
The top level pane, which is a tabbed pane.


currentTarget

private Object currentTarget
The current target.


tabPanelList

private Vector tabPanelList
a list of all the tabs, which are JPanels, in the JTabbedPane tabs.


lastNonNullTab

private int lastNonNullTab
index of the selected tab in the JTabbedPane.


listenerList

private EventListenerList listenerList
The list with targetlisteners, this are the property panels managed by TabProps It should only contain one listener at a time.


upArrowIcon

private Icon upArrowIcon
Graphic that goes on the tab label.


leftArrowIcon

private Icon leftArrowIcon
Graphic that goes on the tab label.

Constructor Detail

DetailsPane

public DetailsPane(String pane,
                   org.tigris.swidgets.Orientation orientation)
Gets all of the tabPanels from the ConfigLoader, then adds them to the JTabbedPane.

Sets the target to null.

Registers listeners.

Parameters:
pane - is probably the name of the pane TODO: verify this!
orientation - is the orientation.
Method Detail

addTargetListener

private void addTargetListener(TargetListener listener)
Adds a listener.

Parameters:
listener - the listener to add

removeTargetListener

private void removeTargetListener(TargetListener listener)
Removes a target listener.

Parameters:
listener - the listener to remove

getTabs

public JTabbedPane getTabs()
Returns the JTabbedPane that contains all details panels.

Returns:
the JTabbedPane.

setToDoItem

public boolean setToDoItem(Object item)
Selects the to do tab, and sets the target of that tab.

Parameters:
item - the selected todo item
Returns:
true if ? Yes when? TODO: Explain.

setTarget

private void setTarget(Object target)
Sets the target of the Details pane to either be a selected model element or the owner(model element) of a selected fig.

Decides which panels to enable.


getTarget

public Object getTarget()
Returns the current model target.

Returns:
the current model target

getMinimumSize

public Dimension getMinimumSize()
See Also:
Component.getMinimumSize()

getIndexOfNamedTab

public int getIndexOfNamedTab(String tabName)
Get the index of the tab with the given name.

Parameters:
tabName - the name of the required tab
Returns:
index of the tab of the given name

getNamedTab

public JPanel getNamedTab(String tabName)
Get the JPanel of the tab with the given name.

Parameters:
tabName - the name of the required tab
Returns:
the tab of the given name

getTabCount

public int getTabCount()
Get the number of tabs.

Returns:
the number of tab pages

selectTabNamed

public boolean selectTabNamed(String tabName)
Selects a tab by given name.

Parameters:
tabName - the given name
Returns:
true if the named tab has been found

addToPropTab

public void addToPropTab(Class c,
                         PropPanel p)
Helper method to add a Property panel for a given class.

Parameters:
c - the given class
p - the given property panel

getTabProps

public TabProps getTabProps()
returns the Property panel in the Details Pane.

Returns:
the property panel

getTab

public TabSpawnable getTab(Class tabClass)
Returns the tab instance of the specified class.

Parameters:
tabClass - the given class
Returns:
the tab instance for the given class

stateChanged

public void stateChanged(ChangeEvent e)
Reacts to a change in the selected tab by calling refresh() for TabToDoTarget's & setTarget on a TabModelTarget or TabFigTarget instance old notes: called when the user selects a new tab, by clicking or otherwise.

Specified by:
stateChanged in interface ChangeListener
See Also:
ChangeListener.stateChanged(javax.swing.event.ChangeEvent)

mySingleClick

public void mySingleClick(int tab)
no action currently executed here. called when the user clicks once on a tab.

Parameters:
tab - the index of the clicked tab

myDoubleClick

public void myDoubleClick(int tab)
Spawns a new tab. called when the user clicks twice on a tab.

Parameters:
tab - the index of the clicked tab

mousePressed

public void mousePressed(MouseEvent me)
empty, no action taken.

Specified by:
mousePressed in interface MouseListener
See Also:
MouseListener.mousePressed(java.awt.event.MouseEvent)

mouseReleased

public void mouseReleased(MouseEvent me)
empty, no action taken.

Specified by:
mouseReleased in interface MouseListener
See Also:
MouseListener.mouseReleased(java.awt.event.MouseEvent)

mouseEntered

public void mouseEntered(MouseEvent me)
empty, no action taken.

Specified by:
mouseEntered in interface MouseListener
See Also:
MouseListener.mouseEntered(java.awt.event.MouseEvent)

mouseExited

public void mouseExited(MouseEvent me)
empty, no action taken.

Specified by:
mouseExited in interface MouseListener
See Also:
MouseListener.mouseExited(java.awt.event.MouseEvent)

mouseClicked

public void mouseClicked(MouseEvent me)
if(the mouse click is not in the bounds of the tabbed panel) then call mySingleClick() or myDoubleClick()

Specified by:
mouseClicked in interface MouseListener
See Also:
MouseListener.mouseClicked(java.awt.event.MouseEvent)

getQuadrant

public int getQuadrant()
Description copied from interface: QuadrantPanel
This shall return a corner indentification.

Specified by:
getQuadrant in interface QuadrantPanel
Returns:
one of Q_TOP_LEFT, Q_TOP_RIGHT, Q_BOTTOM_LEFT, Q_BOTTOM_RIGHT
See Also:
QuadrantPanel.getQuadrant()

setOrientation

public void setOrientation(org.tigris.swidgets.Orientation orientation)
Set the orientation of this details pane.

Specified by:
setOrientation in interface org.tigris.swidgets.Orientable
Parameters:
orientation - the required orientation

targetAdded

public void targetAdded(TargetEvent e)
Description copied from interface: TargetListener
Fired when a target is added to the list of targets.

Specified by:
targetAdded in interface TargetListener
Parameters:
e - The targetevent, name will be TARGET_ADDED
See Also:
TargetListener.targetAdded(TargetEvent)

targetRemoved

public void targetRemoved(TargetEvent e)
Description copied from interface: TargetListener
Fired when a target is removed from the list of targets

Specified by:
targetRemoved in interface TargetListener
Parameters:
e - The targetevent, name will be TARGET_REMOVED
See Also:
TargetListener.targetRemoved(TargetEvent)

targetSet

public void targetSet(TargetEvent e)
Description copied from interface: TargetListener
Fired when a total new set of targets is set

Specified by:
targetSet in interface TargetListener
Parameters:
e - The targetevent, name will be TARGET_SET
See Also:
TargetListener.targetSet(TargetEvent)

enableTabs

private void enableTabs(Object target)
Enables/disables the tabs on the tabbed card. Also selects the tab to show.


fireTargetSet

private void fireTargetSet(TargetEvent targetEvent)

fireTargetAdded

private void fireTargetAdded(TargetEvent targetEvent)

fireTargetRemoved

private void fireTargetRemoved(TargetEvent targetEvent)


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook