com.yobotics.simulationconstructionset.gui
Class VarPanelsHolder

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.yobotics.simulationconstructionset.gui.VarPanelsHolder
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.lang.Comparable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ChangeListener

public class VarPanelsHolder
extends javax.swing.JPanel
implements java.lang.Comparable, javax.swing.event.ChangeListener

Title: SimulationConstructionSet

Description: This class provides a framework for displaying varlists using their namespace based names. These panels form a tree structure based on name allowing easy viewing of numerous lists

Copyright: Copyright (c) 2000

Company: Yobotics, Inc.

Version:
1.0
Author:
not attributable
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
 
Constructor Summary
VarPanelsHolder(java.lang.String stubName)
          Creates a new VarPanelsHolder with no internal variables and the given name.
VarPanelsHolder(VarPanelHolder panelHolder)
          Create a new VarPanelsHolder based on the specified panelHolder
 
Method Summary
 boolean addChild(VarPanelsHolder child)
          Adds the specified child to this.
 int compareTo(java.lang.Object o)
          Compare this to the specified object and return an integer value indicating { @code > = < } as 1 0 and -1 respectively.
 int getChildCount()
           
 java.lang.String getFullName()
          Retrieve the full name of this far panel.
 VarList getList()
           
 java.lang.String getName()
          Retrieves the short name of this panel.
 java.lang.String getParentName()
          Retrieve the name of the immediate parent.
 VarPanelsHolder getParentVarPanelsHolder()
          Retrieves the parent of this.
 java.lang.String getRootParentName()
          Retrieve the name of the top level parent for this.
 java.lang.String getStatisticsText()
           
 int getTotalChildCount()
           
 int getTotalVariableCount()
           
 int getVariableCount()
           
 boolean hasChild(java.lang.String childName)
          Indicates whether or not this or any of its children have the specified Child.
 boolean isTopLevel()
          Indicate whether or not this is a root namespace meaning it has no parent.
 void setParentTabbedPane(javax.swing.JTabbedPane pane)
           
 void stateChanged(javax.swing.event.ChangeEvent event)
           
 java.lang.String toString()
          The string form of this object.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, 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, 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
 
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, 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, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VarPanelsHolder

public VarPanelsHolder(VarPanelHolder panelHolder)
Create a new VarPanelsHolder based on the specified panelHolder

Parameters:
panelHolder - holder containing this panel's variables

VarPanelsHolder

public VarPanelsHolder(java.lang.String stubName)
Creates a new VarPanelsHolder with no internal variables and the given name. This allows the creation a stub to which children can be added. There may be namespace levels containing no variables which necessitate this structure.

Parameters:
stubName - to use with this holder.
Method Detail

hasChild

public boolean hasChild(java.lang.String childName)
Indicates whether or not this or any of its children have the specified Child.

Parameters:
childName - name of the desired child, this should not include parents
Returns:
Does it have the specified child?

getName

public java.lang.String getName()
Retrieves the short name of this panel. For example a VarPanelsHolder named parent.child.grandchild would return grandchild.

Overrides:
getName in class java.awt.Component
Returns:
short name of this

getFullName

public java.lang.String getFullName()
Retrieve the full name of this far panel. This includes all parent namespaces

Returns:
full name of this

getParentName

public java.lang.String getParentName()
Retrieve the name of the immediate parent. A panel named parent.child.grandchild.greatgrandchild would return grandchild.

Returns:
name the parent of this

getRootParentName

public java.lang.String getRootParentName()
Retrieve the name of the top level parent for this. A panel named parent.child.grandchild.greatgrandchild would return parent.

Returns:
name of top level parent

addChild

public boolean addChild(VarPanelsHolder child)
Adds the specified child to this. Null children are not allowed. If the child's root parent is not this it will not be added. If the child is equal to this it will be used to populate the VarPanelHolder.

Parameters:
child - to be added
Returns:
Was it added?

compareTo

public int compareTo(java.lang.Object o)
              throws java.lang.ClassCastException

Compare this to the specified object and return an integer value indicating { @code > = < } as 1 0 and -1 respectively. Cannot be compared to object not of its type, will throw a runtime exception if this occurs.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - reference to be compared to
Returns:
integer indicating comparison
Throws:
java.lang.ClassCastException

toString

public java.lang.String toString()
The string form of this object. Returns the short name.

Overrides:
toString in class java.awt.Component
Returns:
String the short name

isTopLevel

public boolean isTopLevel()
Indicate whether or not this is a root namespace meaning it has no parent.

Returns:
is it top level?

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent event)
Specified by:
stateChanged in interface javax.swing.event.ChangeListener

getParentVarPanelsHolder

public VarPanelsHolder getParentVarPanelsHolder()
Retrieves the parent of this. If this is top level this will return null.

Returns:
the parent VarPanelsHolder of this

getChildCount

public int getChildCount()

getTotalChildCount

public int getTotalChildCount()

getVariableCount

public int getVariableCount()

getTotalVariableCount

public int getTotalVariableCount()

getStatisticsText

public java.lang.String getStatisticsText()

setParentTabbedPane

public void setParentTabbedPane(javax.swing.JTabbedPane pane)

getList

public VarList getList()