org.argouml.ui
Class MultiEditorPane

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byorg.argouml.ui.MultiEditorPane
All Implemented Interfaces:
javax.accessibility.Accessible, javax.swing.event.ChangeListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, QuadrantPanel, java.io.Serializable, TargetListener

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

The upper right pane in the Argo/UML user interface. It has several tabs with different kinds of "major" editors that allow the user to edit whatever is selected in the NavigatorPane.

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  org.tigris.gef.base.Editor _ed
           
protected  java.awt.Component _lastTab
           
protected  java.util.Vector _tabPanels
           
protected  javax.swing.JTabbedPane _tabs
           
protected  java.lang.Object _target
           
private static org.apache.log4j.Logger cat
          logger
 
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, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
MultiEditorPane()
          Constructs the MultiEditorPane.
 
Method Summary
private  void enableTabs(java.lang.Object target)
          Enables the tabs on the MultiEditorPane depending on the result of its shouldBeEnabled method.
 java.util.List findPresentationsFor(java.lang.Object o, java.util.Vector diagrams)
          Returns a list with all figs for some object o on the given diagrams.
 int getIndexOfNamedTab(java.lang.String tabName)
          Returns the index of a tab with a certain name in the JTabbedPane which is the component shown by the multieditorpane.
 java.awt.Dimension getMinimumSize()
           
 java.awt.Dimension getPreferredSize()
           
 int getQuadrant()
           
 java.lang.Object getTarget()
          Deprecated. As of ArgoUml version 0.13.5, use TargetManager.getTarget() instead
 void mouseClicked(java.awt.event.MouseEvent me)
          Catches a mouseevent and calls mySingleClick and myDoubleClick if a tab is clicked which is selected.
 void mouseEntered(java.awt.event.MouseEvent me)
           
 void mouseExited(java.awt.event.MouseEvent me)
           
 void mousePressed(java.awt.event.MouseEvent me)
           
 void mouseReleased(java.awt.event.MouseEvent me)
           
 void myDoubleClick(int tab)
          When the user double clicks on a tab, this tab is spawned by this method if it is selected.
 void mySingleClick(int tab)
          called when the user clicks once on a tab.
 void removePresentationFor(java.lang.Object obj, java.util.Vector diagrams)
          Removes all figs from all diagrams for some object obj.
 void select(java.lang.Object o)
          Deprecated. As of ArgoUml version 0.13.5, The tabdiagram arranges for it's own selection now via it's TargetListener.
 void selectNextTab()
          Selects the next tab in the JTabbedPane.
 void selectTabNamed(java.lang.String tabName)
          Selects a certain tab and shows it.
 void setTarget(java.lang.Object target)
          Deprecated. As of ArgoUml version 0.13.5, this method will change visibility in the near future
 void stateChanged(javax.swing.event.ChangeEvent e)
          called when the user selects a 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, 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


_target

protected java.lang.Object _target

_tabs

protected javax.swing.JTabbedPane _tabs

_ed

protected org.tigris.gef.base.Editor _ed

_tabPanels

protected java.util.Vector _tabPanels

_lastTab

protected java.awt.Component _lastTab
Constructor Detail

MultiEditorPane

public MultiEditorPane()
Constructs the MultiEditorPane. This is the pane in which the tabs with the diagrams are drawn in ArgoUML. The MultiEditorPane is a JTabbedPane that holds 0-* JPanels that can show several editors but only show one editor at the moment (argouml version 0.13.3). With this editor diagrams can be edited.

Method Detail

getPreferredSize

public java.awt.Dimension getPreferredSize()

getMinimumSize

public java.awt.Dimension getMinimumSize()

setTarget

public void setTarget(java.lang.Object target)
Deprecated. As of ArgoUml version 0.13.5, this method will change visibility in the near future

Sets the target of the multieditorpane. The multieditorpane can have several tabs. If a tab is an instance of tabmodeltarget (that is a tab that displays model elements) that tab should display the target if the target is an ArgoDiagram.

Parameters:
target -

enableTabs

private void enableTabs(java.lang.Object target)
Enables the tabs on the MultiEditorPane depending on the result of its shouldBeEnabled method.

Parameters:
target - The target for which the shouldBeEnabled test should hold true.

getTarget

public java.lang.Object getTarget()
Deprecated. As of ArgoUml version 0.13.5, use TargetManager.getTarget() instead

Returns the current target of the multieditorpane. TODO: check if the target is needed for the multieditorpane as an instance variable.

Returns:
Object

getIndexOfNamedTab

public int getIndexOfNamedTab(java.lang.String tabName)
Returns the index of a tab with a certain name in the JTabbedPane which is the component shown by the multieditorpane. At the moment (version 0.13.3 of ArgoUML) there is only 1 tab, the Diagram tab.


selectTabNamed

public void selectTabNamed(java.lang.String tabName)
Selects a certain tab and shows it. At the moment (version 0.13.3 of ArgoUML) there is only 1 tab, the Diagram tab.

Parameters:
tabName -

selectNextTab

public void selectNextTab()
Selects the next tab in the JTabbedPane. At the moment (version 0.13.3 of ArgoUML) there is only 1 tab, the Diagram tab.


select

public void select(java.lang.Object o)
Deprecated. As of ArgoUml version 0.13.5, The tabdiagram arranges for it's own selection now via it's TargetListener.

Selects a Fig on a TabDiagram if the TabDiagram is currently shown.

Parameters:
o - The Fig or the owner of the Fig to select.

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
called when the user selects a tab, by clicking or otherwise.

Specified by:
stateChanged in interface javax.swing.event.ChangeListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent me)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent me)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent me)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent me)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent me)
Catches a mouseevent and calls mySingleClick and myDoubleClick if a tab is clicked which is selected.

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

mySingleClick

public void mySingleClick(int tab)
called when the user clicks once on a tab.


myDoubleClick

public void myDoubleClick(int tab)
When the user double clicks on a tab, this tab is spawned by this method if it is selected.

Parameters:
tab -

getQuadrant

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

removePresentationFor

public void removePresentationFor(java.lang.Object obj,
                                  java.util.Vector diagrams)
Removes all figs from all diagrams for some object obj. Does not remove the owner of the objects (does not do a call to dispose). TODO move this to ProjectManager for example, in any case: out of the GUI

Parameters:
obj -

findPresentationsFor

public java.util.List findPresentationsFor(java.lang.Object o,
                                           java.util.Vector diagrams)
Returns a list with all figs for some object o on the given diagrams. TODO move this to ProjectManager for example, in any case: out of the GUI

Parameters:
o -
diagrams -
Returns:
List

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(org.argouml.ui.targetmanager.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(org.argouml.ui.targetmanager.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(org.argouml.ui.targetmanager.TargetEvent)


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