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:
javax.accessibility.Accessible, javax.swing.event.ChangeListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, Orientable, QuadrantPanel, java.io.Serializable, TargetListener

public class DetailsPane
extends javax.swing.JPanel
implements javax.swing.event.ChangeListener, java.awt.event.MouseListener, QuadrantPanel, Orientable, TargetListener

The lower-right pane of the main Argo/UML 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 NavigationPane, or the MultiEditorPane. There are requests to have the cursor automatically be set to the primary field. $Id: DetailsPane.java,v 1.37 2004/02/29 12:35:41 linus Exp $

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  java.lang.Object _item
          The currently selected todo item.
protected  int _lastNonNullTab
          index of the selected tab in the JTabbedPane.
protected  javax.swing.Icon _leftArrowIcon
          graphic that goes on the tab label
private  javax.swing.event.EventListenerList _listenerList
          The list with targetlisteners, this are the property panels managed by TabProps It should only contain one listener at a time.
protected  java.util.Vector _tabPanels
          a list of all the tabs, which are JPanels, in the JTabbedPane _tabs.
protected  javax.swing.JTabbedPane _tabs
          The top level pane, which is a tabbed pane.
private  java.lang.Object _target
          The current target
protected  javax.swing.Icon _upArrowIcon
          graphic that goes on the tab label
private static org.apache.log4j.Logger cat
          logger
static int HEIGHT
           
static int INITIAL_HEIGHT
           
static int INITIAL_WIDTH
           
private  Orientation orientation
           
static int WIDTH
           
 
Fields inherited from class javax.swing.JPanel
 
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.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, PROPERTIES, SOMEBITS
 
Constructor Summary
DetailsPane(java.lang.String pane, 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(java.lang.Class c, PropPanel p)
          Heper method to add a Property panel for a given class.
private  void enableTabs(java.lang.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(java.lang.String tabName)
          Get the index of the tab with the given name
 java.awt.Dimension getMinimumSize()
           
 javax.swing.JPanel getNamedTab(java.lang.String tabName)
          Get the JPanel of the tab with the given name
 int getQuadrant()
           
 TabSpawnable getTab(java.lang.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.
 javax.swing.JTabbedPane getTabs()
          Returns the JTabbedPane that contains all details panels.
 java.lang.Object getTarget()
          Returns the current model target.
 void mouseClicked(java.awt.event.MouseEvent me)
          if(the mouse click is not in the bounds of the tabbed panel) then call mySingleClick() or myDoubleClick()
 void mouseEntered(java.awt.event.MouseEvent me)
          empty, no action taken.
 void mouseExited(java.awt.event.MouseEvent me)
          empty, no action taken.
 void mousePressed(java.awt.event.MouseEvent me)
          empty, no action taken.
 void mouseReleased(java.awt.event.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(java.lang.String tabName)
           
 void setOrientation(Orientation orientation)
          Set the orientation of this details pane.
 void setTarget(java.lang.Object target)
          Deprecated. As of ArgoUml version 0.13.5, replaced by TargetListener, will become non-public in the future
 boolean setToDoItem(java.lang.Object item)
          Selects the to do tab, and sets the target of that tab.
 void stateChanged(javax.swing.event.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

cat

private static org.apache.log4j.Logger cat
logger


WIDTH

public static int WIDTH

HEIGHT

public static int HEIGHT

INITIAL_WIDTH

public static int INITIAL_WIDTH

INITIAL_HEIGHT

public static int INITIAL_HEIGHT

_item

protected java.lang.Object _item
The currently selected todo item.


_tabs

protected javax.swing.JTabbedPane _tabs
The top level pane, which is a tabbed pane.


_target

private java.lang.Object _target
The current target


_tabPanels

protected java.util.Vector _tabPanels
a list of all the tabs, which are JPanels, in the JTabbedPane _tabs.


_lastNonNullTab

protected int _lastNonNullTab
index of the selected tab in the JTabbedPane.


orientation

private Orientation orientation

_listenerList

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


_upArrowIcon

protected javax.swing.Icon _upArrowIcon
graphic that goes on the tab label


_leftArrowIcon

protected javax.swing.Icon _leftArrowIcon
graphic that goes on the tab label

Constructor Detail

DetailsPane

public DetailsPane(java.lang.String pane,
                   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 javax.swing.JTabbedPane getTabs()
Returns the JTabbedPane that contains all details panels.

Returns:
the JTabbedPane.

setToDoItem

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

Returns:
true if ? Yes when? TODO: Explain.

setTarget

public void setTarget(java.lang.Object target)
Deprecated. As of ArgoUml version 0.13.5, replaced by TargetListener, will become non-public in the future

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 java.lang.Object getTarget()
Returns the current model target.


getMinimumSize

public java.awt.Dimension getMinimumSize()

getIndexOfNamedTab

public int getIndexOfNamedTab(java.lang.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 javax.swing.JPanel getNamedTab(java.lang.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(java.lang.String tabName)

addToPropTab

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


getTabProps

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


getTab

public TabSpawnable getTab(java.lang.Class tabClass)
returns the tab instance of the specified class


stateChanged

public void stateChanged(javax.swing.event.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 javax.swing.event.ChangeListener

mySingleClick

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


myDoubleClick

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


mousePressed

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

Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

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

Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

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

Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

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

Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseClicked

public void mouseClicked(java.awt.event.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 java.awt.event.MouseListener

getQuadrant

public int getQuadrant()
Specified by:
getQuadrant in interface QuadrantPanel

setOrientation

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

Specified by:
setOrientation in interface 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(java.lang.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 (20040316)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook