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:
Accessible, ChangeListener, EventListener, ImageObserver, MenuContainer, MouseListener, QuadrantPanel, Serializable, TargetListener

public class MultiEditorPane
extends JPanel
implements ChangeListener, MouseListener, QuadrantPanel, TargetListener

The upper right pane in the ArgoUML user interface. It may have several tabs with different kinds of "major" editors that allow the user to edit whatever is selected in the NavigatorPane. Currently, there is only the diagram tab.

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  org.tigris.gef.base.Editor ed
           
private  Component lastTab
           
private static Logger LOG
          logger
private  Vector tabPanels
           
private  JTabbedPane tabs
           
private  Object target
           
 
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(Object t)
          Enables the tabs on the MultiEditorPane depending on the result of its shouldBeEnabled method.
 int getIndexOfNamedTab(String tabName)
          Returns the index of a tab with a certain name in the JTabbedPane which is the component shown by the multieditorpane.
 Dimension getMinimumSize()
           
 Dimension getPreferredSize()
           
 int getQuadrant()
          This shall return a corner indentification.
protected  JTabbedPane getTabs()
           
 void mouseClicked(MouseEvent me)
          Catches a mouseevent and calls mySingleClick and myDoubleClick if a tab is clicked which is selected.
 void mouseEntered(MouseEvent me)
           
 void mouseExited(MouseEvent me)
           
 void mousePressed(MouseEvent me)
           
 void mouseReleased(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 selectNextTab()
          Selects the next tab in the JTabbedPane.
 void selectTabNamed(String tabName)
          Selects a certain tab and shows it.
private  void setTarget(Object t)
          Sets the target of the multieditorpane.
 void stateChanged(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

LOG

private static final Logger LOG
logger


target

private Object target

tabs

private JTabbedPane tabs

ed

private org.tigris.gef.base.Editor ed

tabPanels

private Vector tabPanels

lastTab

private 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 Dimension getPreferredSize()
See Also:
Component.getPreferredSize()

getMinimumSize

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

setTarget

private void setTarget(Object t)
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:
t - the target

enableTabs

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

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

getIndexOfNamedTab

public int getIndexOfNamedTab(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.

Parameters:
tabName - the given tab name
Returns:
The index.

selectTabNamed

public void selectTabNamed(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 - the name of the tab

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.


stateChanged

public void stateChanged(ChangeEvent e)
Called when the user selects a tab, by clicking or otherwise.

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

mousePressed

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

mouseReleased

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

mouseEntered

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

mouseExited

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

mouseClicked

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

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

mySingleClick

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

Parameters:
tab - the tab that was clicked on

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 - The index of the tab.

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()

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)

getTabs

protected JTabbedPane getTabs()
Returns:
returns the upper right panel tabs (the diagram tabs)


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