net.sf.taverna.zaria
Class ZPane

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by net.sf.taverna.zaria.ZPane
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, ZTreeNode
Direct Known Subclasses:
ZBasePane, ZBlankComponent, ZRavenComponent, ZSplitPane, ZTabbedPane

public abstract class ZPane
extends javax.swing.JComponent
implements ZTreeNode

Abstract superclass of all Zaria node components, extends JComponent and adds basic tree traversal functionality.

Author:
Tom Oinn
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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
 
Method Summary
 javax.swing.JFrame getFrame()
          Traverse up to the JFrame this component is contained within, used for showing dialogues and locking the frame using the glass pane.
 ZBasePane getRoot()
          Traverse up the component heirarchy until we find an instance of ZBasePane
 java.util.List<java.awt.Component> getToolbarComponents()
          Return a list of JComponent items that should be added on the left hand side of the toolbar when in edit mode
 int getZChildCount()
          Get number of immediate children
 ZTreeNode getZParent()
          Traverse up the swing container heirarchy looking for the first parent implementing ZTreeNode, or null if we fall off the top of the container heirarchy.
 boolean isEditable()
           
 boolean isZLeaf()
          Is this a leaf node?
 boolean isZRoot()
          Is this a root node?
 void setEditable(boolean b)
          If setting editable from false to true generates the toolbar from the getActions method of the subclass and displays it otherwise hides the toolbar.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, 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, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.taverna.zaria.ZTreeNode
configure, discard, getActions, getElement, getZChildren, swap
 

Method Detail

getFrame

public javax.swing.JFrame getFrame()
Traverse up to the JFrame this component is contained within, used for showing dialogues and locking the frame using the glass pane.


getRoot

public ZBasePane getRoot()
Traverse up the component heirarchy until we find an instance of ZBasePane

Specified by:
getRoot in interface ZTreeNode

getToolbarComponents

public java.util.List<java.awt.Component> getToolbarComponents()
Description copied from interface: ZTreeNode
Return a list of JComponent items that should be added on the left hand side of the toolbar when in edit mode

Specified by:
getToolbarComponents in interface ZTreeNode

getZChildCount

public int getZChildCount()
Description copied from interface: ZTreeNode
Get number of immediate children

Specified by:
getZChildCount in interface ZTreeNode
Returns:
int count of immediate ZTreeNode children

getZParent

public ZTreeNode getZParent()
Traverse up the swing container heirarchy looking for the first parent implementing ZTreeNode, or null if we fall off the top of the container heirarchy.

Specified by:
getZParent in interface ZTreeNode
Returns:
parent node or null if this is a root

isEditable

public boolean isEditable()
Returns:
boolean to indicate whether the pane is in edit mode

isZLeaf

public boolean isZLeaf()
Description copied from interface: ZTreeNode
Is this a leaf node?

Specified by:
isZLeaf in interface ZTreeNode
Returns:
whether the node is a leaf

isZRoot

public boolean isZRoot()
Description copied from interface: ZTreeNode
Is this a root node?

Specified by:
isZRoot in interface ZTreeNode
Returns:
whether the node is a root

setEditable

public void setEditable(boolean b)
If setting editable from false to true generates the toolbar from the getActions method of the subclass and displays it otherwise hides the toolbar. The toolbar is only shown if there are actions present, I'm not sure this is actually a sensible behaviour.

Specified by:
setEditable in interface ZTreeNode