Class BSTTreeJPanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--DrawingJPanel
                                |
                                +--TreeJPanel
                                      |
                                      +--BSTTreeJPanel
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.awt.event.ComponentListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, OptionListener, java.io.Serializable, TreeMessageListener
Direct Known Subclasses:
BalancedBSTTreeJPanel, RedBlackTreeJPanel, RootInsertionBSTTreeJPanel, SplayTreeJPanel

public class BSTTreeJPanel
extends TreeJPanel

This class provides the panel for a BSTTree. It keeps the graphics for drawing the tree and the image for redrawing. It also keeps a timer for the animation and all changes to the tree proceed through the panel.

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  NodeAndLinkAnimatingJPanel animatingPanel
          The animatingPanel for this JPanel.
protected  java.lang.String backgroundColor
          The String for the currently selected backgroundColor.
static java.lang.String CHRISTMAS
          Christmas color scheme.
protected  ColorOptionsJPanel colorOptionsPanel
          The colorOptionsPanel held currently within this panel.
protected  javax.swing.JComboBox colorPresetOptionsJComboBox
          JComboBox that holds all of the schemes available for this current settings.
protected  javax.swing.JComboBox colorSchemesJComboBox
          JComboBox that holds all of the schemes available for this current settings.
protected  java.lang.String colorSettings
          The variable holding the colorSettings.
protected  javax.swing.JComboBox colorSettingsJComboBox
          JComboBox that holds all of the settings available for this current function.
static java.lang.String DEFAULT
          Default color scheme.
protected  java.lang.String deleteLeftLinePaintSettings
          The protected String for the currently selected left line paint.
protected  java.lang.String deleteRightLinePaintSettings
          The protected String for the currently selected right line paint.
protected  java.lang.String drawingKeySettings
          The protected String for the currently selected drawing Key Settings.
protected  java.lang.String drawingNodeSettings
          The protected String for the currently selected drawing Node Settings.
protected  NodeAndLinkDrawingJPanel drawingPanel
          The drawingPanel for this JPanel.
protected  javax.swing.JComboBox functionJComboBox
          JComboBox that holds all of the functions available for this panel.
static java.lang.String HALLOWEEN
          Halloween color scheme.
protected  java.lang.String insertAnimatorKeySettings
          The protected String for the currently selected insertion Animator Key Settings.
protected  java.lang.String insertAnimatorNodeSettings
          The protected String for the currently selected insertion Animator Node Settings.
protected  java.lang.String insertNodeLeftSettings
          The protected String for the currently selected insertion Left Node Settings.
protected  java.lang.String insertNodeRightSettings
          The protected String for the currently selected insertion Right Node Settings.
static java.lang.String PRIMARY
          Default color scheme.
static java.lang.String PRINCETON
          Princeton color scheme.
protected  java.lang.String rotateAnimatorKeySettings
          The protected String for the currently selected rotated Animator Key Settings.
protected  java.lang.String rotateChildNodeSettings
          The protected String for the currently selected rotated Child Node Settings.
protected  java.lang.String rotateDescendantNodeSettings
          The protected String for the currently selected rotated Descendant Node Settings.
protected  java.lang.String rotateOriginalKeySettings
          The protected String for the currently selected rotated Original Key Settings.
protected  java.lang.String rotateOriginalNodeSettings
          The protected String for the currently selected rotated Original Node Settings.
protected  java.lang.String rotateRootNodeSettings
          The protected String for the currently selected rotated Root Node Settings.
protected  java.lang.String searchAnimatorKeySettings
          The protected String for the currently selected searching Animator Key Settings.
protected  java.lang.String searchAnimatorNodeSettings
          The protected String for the currently selected searching Animator Node Settings.
protected  java.lang.String searchNodeLeftSettings
          The protected String for the currently selected searching Left Node Settings.
protected  java.lang.String searchNodeRightSettings
          The protected String for the currently selected searching Right Node Settings.
protected  java.lang.String selectAnimatorKeySettings
          The protected String for the currently selected select Animator Key Settings.
protected  java.lang.String selectAnimatorNodeSettings
          The protected String for the currently selected select Animator Node Settings.
protected  java.lang.String selectNodeLeftSettings
          The protected String for the currently selected select Left Node Settings.
protected  java.lang.String selectNodeRightSettings
          The protected String for the currently selected select Right Node Settings.
protected  java.lang.String traverseAnimatorKeySettings
          The protected String for the currently selected traversal animator Key Settings.
protected  java.lang.String traverseAnimatorNodeSettings
          The protected String for the currently selected traversal animator Node Settings.
 
Fields inherited from class TreeJPanel
BACKGROUND, CHARACTER, DEFAULT_DELAY, DELETE, DOUBLE, DRAWING, INSERT, INTEGER, KEY, KEY_ANIMATOR_SETTINGS, KEY_ORIGINAL_SETTINGS, LEFT_PAINT, NODE, NODE_ANIMATOR_SETTINGS, NODE_CHILD_SETTINGS, NODE_DESCENDANT_SETTINGS, NODE_LEFT_SETTINGS, NODE_ORIGINAL_SETTINGS, NODE_RIGHT_SETTINGS, NODE_ROOT_SETTINGS, NOKEY, PAINT, RIGHT_PAINT, ROTATE, SEARCH, SELECT, TRAVERSE, TYPEERR
 
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.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
BSTTreeJPanel()
          Sole Constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Listens to action events.
 void balanceCommand(Tree node)
          Balance command.
protected  void balanceNode(BSTTree node)
          Balances the given node.
protected  void balanceTree()
          Balances the entire tree.
protected  void changeDisplay()
          Changes the display.
 void constructColorOptions(ColorOptionsJPanel colorOptionsPanel)
          Constructs the color options combo box and sets the box for the given colorOptionsPanel.
 void constructPresetColorOptions(ColorOptionsJPanel colorOptionsPanel)
          Constructs the color settings combo box and sets the box for the given colorOptionsPanel.
 void displayChangeCommand()
          Change Display Command.
 void drawAnimatingNode()
          Draws the animating node using the currently selected animating settings.
 void drawDrawingNode()
          Draws the drawing node using the currently selected drawing settings.
 java.lang.String[] getColorSchemeOptions()
          Gets the color scheme aniamtion options for the current tree.
 java.lang.String getColorSchemeSetting(java.lang.String function, java.lang.String setting)
          Gets the Color Scheme setting for the given function and setting.
 java.lang.String[] getColorSchemesList(java.lang.String settings)
          Gets the color scheme settings for each type of settings.
 java.lang.String[] getColorSettings()
          Gets the color settings options for the current tree.
 java.lang.String getColorSettingsString()
          Gets the color settings string of the current panel to the colorSettings param.
 java.lang.String[] getOptionColorSchemeOptions(java.lang.String option)
          Gets the color scheme options for each type of animation.
 java.lang.String getTitle()
          Gets the title for the tree.
 javax.swing.JPopupMenu makeJPopupMenu(java.awt.event.ActionListener actionlistener)
          Constructs a popupmenu, using the actionlistener passed.
 void optionEventPerformed(OptionEvent e)
          Recieved an event from an OptionJPanel with one of the given commands.
 void resetSettingStrings()
          Resets the string settings currently selected.
 void rotateToTopCommand(Tree node)
          RotateToTop command.
protected  void rotateToTopNode(BSTTree node)
          Rotates up the given node to the top.
 void rotateUpCommand(Tree node)
          RotateUp command.
 void rotateUpDoubleCommand(Tree node)
          RotateUpDouble command.
protected  void rotateUpDoubleNode(BSTTree node)
          Doubly Rotates up the given node.
protected  void rotateUpNode(BSTTree node)
          Rotates up the given node.
 void setAnimating(boolean animating)
          Sets whether the tree is animating or not.
 void setColorSchemeSetting(java.lang.String presetScheme)
          Sets the color scheme using the given preset scheme string.
 void setColorSchemeSetting(java.lang.String function, java.lang.String setting, java.lang.String scheme)
          Sets the color scheme using the given function and setting.
 void setColorSettingsString(java.lang.String colorSettings)
          Sets the color settings string of the current panel to the colorSettings param.
 void setComponentShown(boolean componentShown)
          Sets whether the tree is shown or not.
 void setSettings()
          Sets the settings for the panel using the currently selected String options.
 void setSettings(TreeJPanel panel)
          Sets the settings for the panel using the currently selected String options.
 void splayCommand(Tree node)
          Splay command.
protected  void splayNode(BSTTree node)
          Splays up the given node.
 void traverseCommand(int traverseType)
          Traverse command.
 
Methods inherited from class TreeJPanel
addTreeMessageListener, animatingCommand, animationQualityCommand, animationSpeedCommand, clear, clearAllCommand, clearCommand, clearTree, deleteCommand, deleteCommand, deleteKeys, deleteNode, draw, getAnimationTimer, getInputOptions, getKeyType, getObjectList, getStringList, getTree, getTreeStatusMessage, inputChange, inputChangeCommand, insertCommand, insertKeys, isAnimating, isStep, makeColorSchemeOptions, makeColorSettings, makeMissingErrorMessage, makeTypeErrorMessage, makeTypeIntegerErrorMessage, messageAction, paintComponent, partitionCommand, partitionNode, pauseCommand, playCommand, playFastCommand, playStepCommand, removeTreeMessageListener, rewindCommand, rewindFastCommand, rewindStepCommand, saveTreeCommand, searchCommand, searchKeys, selectCommand, selectCommand, selectKeys, selectNode, setAnimationTimer, setDelayRate, setKeyType, setStep, setTree, stopCommand, stringToType, treeMessageEventPerformed
 
Methods inherited from class DrawingJPanel
componentHidden, componentMoved, componentResized, componentShown, drawTree, getDrawingArea, getDrawTreeGraphics, getDrawTreeImage, isComponentShown, isDrawTree, makeDrawTreeGraphics, makeDrawTreeImage, setDrawingArea, setDrawTree, setDrawTreeGraphics, setDrawTreeImage
 
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, getMinimumSize, 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, 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

DEFAULT

public static final java.lang.String DEFAULT
Default color scheme.

See Also:
Constant Field Values

PRIMARY

public static final java.lang.String PRIMARY
Default color scheme.

See Also:
Constant Field Values

PRINCETON

public static final java.lang.String PRINCETON
Princeton color scheme.

See Also:
Constant Field Values

CHRISTMAS

public static final java.lang.String CHRISTMAS
Christmas color scheme.

See Also:
Constant Field Values

HALLOWEEN

public static final java.lang.String HALLOWEEN
Halloween color scheme.

See Also:
Constant Field Values

backgroundColor

protected java.lang.String backgroundColor
The String for the currently selected backgroundColor.


drawingNodeSettings

protected java.lang.String drawingNodeSettings
The protected String for the currently selected drawing Node Settings.


drawingKeySettings

protected java.lang.String drawingKeySettings
The protected String for the currently selected drawing Key Settings.


insertNodeLeftSettings

protected java.lang.String insertNodeLeftSettings
The protected String for the currently selected insertion Left Node Settings.


insertNodeRightSettings

protected java.lang.String insertNodeRightSettings
The protected String for the currently selected insertion Right Node Settings.


insertAnimatorNodeSettings

protected java.lang.String insertAnimatorNodeSettings
The protected String for the currently selected insertion Animator Node Settings.


insertAnimatorKeySettings

protected java.lang.String insertAnimatorKeySettings
The protected String for the currently selected insertion Animator Key Settings.


searchNodeLeftSettings

protected java.lang.String searchNodeLeftSettings
The protected String for the currently selected searching Left Node Settings.


searchNodeRightSettings

protected java.lang.String searchNodeRightSettings
The protected String for the currently selected searching Right Node Settings.


searchAnimatorNodeSettings

protected java.lang.String searchAnimatorNodeSettings
The protected String for the currently selected searching Animator Node Settings.


searchAnimatorKeySettings

protected java.lang.String searchAnimatorKeySettings
The protected String for the currently selected searching Animator Key Settings.


selectNodeLeftSettings

protected java.lang.String selectNodeLeftSettings
The protected String for the currently selected select Left Node Settings.


selectNodeRightSettings

protected java.lang.String selectNodeRightSettings
The protected String for the currently selected select Right Node Settings.


selectAnimatorNodeSettings

protected java.lang.String selectAnimatorNodeSettings
The protected String for the currently selected select Animator Node Settings.


selectAnimatorKeySettings

protected java.lang.String selectAnimatorKeySettings
The protected String for the currently selected select Animator Key Settings.


rotateChildNodeSettings

protected java.lang.String rotateChildNodeSettings
The protected String for the currently selected rotated Child Node Settings.


rotateRootNodeSettings

protected java.lang.String rotateRootNodeSettings
The protected String for the currently selected rotated Root Node Settings.


rotateDescendantNodeSettings

protected java.lang.String rotateDescendantNodeSettings
The protected String for the currently selected rotated Descendant Node Settings.


rotateOriginalNodeSettings

protected java.lang.String rotateOriginalNodeSettings
The protected String for the currently selected rotated Original Node Settings.


rotateAnimatorKeySettings

protected java.lang.String rotateAnimatorKeySettings
The protected String for the currently selected rotated Animator Key Settings.


rotateOriginalKeySettings

protected java.lang.String rotateOriginalKeySettings
The protected String for the currently selected rotated Original Key Settings.


deleteLeftLinePaintSettings

protected java.lang.String deleteLeftLinePaintSettings
The protected String for the currently selected left line paint.


deleteRightLinePaintSettings

protected java.lang.String deleteRightLinePaintSettings
The protected String for the currently selected right line paint.


traverseAnimatorNodeSettings

protected java.lang.String traverseAnimatorNodeSettings
The protected String for the currently selected traversal animator Node Settings.


traverseAnimatorKeySettings

protected java.lang.String traverseAnimatorKeySettings
The protected String for the currently selected traversal animator Key Settings.


animatingPanel

protected NodeAndLinkAnimatingJPanel animatingPanel
The animatingPanel for this JPanel.


drawingPanel

protected NodeAndLinkDrawingJPanel drawingPanel
The drawingPanel for this JPanel.


colorSettings

protected java.lang.String colorSettings
The variable holding the colorSettings. Set initially to DEFAULT.


functionJComboBox

protected javax.swing.JComboBox functionJComboBox
JComboBox that holds all of the functions available for this panel.


colorSettingsJComboBox

protected javax.swing.JComboBox colorSettingsJComboBox
JComboBox that holds all of the settings available for this current function.


colorSchemesJComboBox

protected javax.swing.JComboBox colorSchemesJComboBox
JComboBox that holds all of the schemes available for this current settings.


colorPresetOptionsJComboBox

protected javax.swing.JComboBox colorPresetOptionsJComboBox
JComboBox that holds all of the schemes available for this current settings.


colorOptionsPanel

protected ColorOptionsJPanel colorOptionsPanel
The colorOptionsPanel held currently within this panel.

Constructor Detail

BSTTreeJPanel

public BSTTreeJPanel()
Sole Constructor. Simply sets the correct type of tree and sets it to animating.

Method Detail

getTitle

public java.lang.String getTitle()
Gets the title for the tree.

Overrides:
getTitle in class TreeJPanel
Returns:
String defining the title of the tree.

resetSettingStrings

public void resetSettingStrings()
Resets the string settings currently selected. This bascially calls the tree and gets the settings of the tree and sets all currently selected strings to the settings of the tree.


setSettings

public void setSettings()
Sets the settings for the panel using the currently selected String options.

The Panel used is the current panel.


setSettings

public void setSettings(TreeJPanel panel)
Sets the settings for the panel using the currently selected String options.

The Panel used is the passed panel.

Overrides:
setSettings in class TreeJPanel
Parameters:
panel - panel to which the settings are changed according to the currently selected settings.

setColorSettingsString

public void setColorSettingsString(java.lang.String colorSettings)
Sets the color settings string of the current panel to the colorSettings param.

Parameters:
colorSettings - the String defining the colorSettings for the current panel.

getColorSettingsString

public java.lang.String getColorSettingsString()
Gets the color settings string of the current panel to the colorSettings param.

Returns:
String colorSettings String defining the colorSettings for the current panel.

drawDrawingNode

public void drawDrawingNode()
Draws the drawing node using the currently selected drawing settings.


drawAnimatingNode

public void drawAnimatingNode()
Draws the animating node using the currently selected animating settings.


getColorSchemeSetting

public java.lang.String getColorSchemeSetting(java.lang.String function,
                                              java.lang.String setting)
Gets the Color Scheme setting for the given function and setting.

Parameters:
function - String function like DRAWING or BACKGROUND.
setting - String setting choice for which the color setting is requested like NODE.
Returns:
String defining the color scheme setting.

setColorSchemeSetting

public void setColorSchemeSetting(java.lang.String function,
                                  java.lang.String setting,
                                  java.lang.String scheme)
Sets the color scheme using the given function and setting.

Parameters:
function - for which the setting is given.
setting - the setting for which the scheme is set.
scheme - the color setting used for the given function and setting.

setColorSchemeSetting

public void setColorSchemeSetting(java.lang.String presetScheme)
Sets the color scheme using the given preset scheme string.

Parameters:
presetScheme - the preset sceme defined.

getColorSchemeOptions

public java.lang.String[] getColorSchemeOptions()
Gets the color scheme aniamtion options for the current tree.

Returns:
String array of the options for the current tree.

getColorSettings

public java.lang.String[] getColorSettings()
Gets the color settings options for the current tree.

Returns:
String array of the color settings.

getOptionColorSchemeOptions

public java.lang.String[] getOptionColorSchemeOptions(java.lang.String option)
Gets the color scheme options for each type of animation.

Returns:
String array of the options for the current tree.

getColorSchemesList

public java.lang.String[] getColorSchemesList(java.lang.String settings)
Gets the color scheme settings for each type of settings.

Returns:
String array of the options for the current type of settings.

constructColorOptions

public void constructColorOptions(ColorOptionsJPanel colorOptionsPanel)
Constructs the color options combo box and sets the box for the given colorOptionsPanel.

Overrides:
constructColorOptions in class TreeJPanel
Parameters:
colorOptionsPanel - the colorToolsJPanel for which the JComboBox is set.

constructPresetColorOptions

public void constructPresetColorOptions(ColorOptionsJPanel colorOptionsPanel)
Constructs the color settings combo box and sets the box for the given colorOptionsPanel.

Overrides:
constructPresetColorOptions in class TreeJPanel
Parameters:
colorOptionsPanel - the colorOptionsPanel for which the JComboBox is set.

makeJPopupMenu

public javax.swing.JPopupMenu makeJPopupMenu(java.awt.event.ActionListener actionlistener)
Constructs a popupmenu, using the actionlistener passed. The popupMenu contains all of the options available through the current tree. For this class, no items are added, making it necessary to overide the method.

Overrides:
makeJPopupMenu in class TreeJPanel
Parameters:
actionlistener - the listener add to the actions of all the items made in the menu.
Returns:
JPopupMenu which is the menu constructed within the panel.

setAnimating

public void setAnimating(boolean animating)
Sets whether the tree is animating or not.

Overrides:
setAnimating in class TreeJPanel
Parameters:
animating - boolean flag as to whether the tree is animating.

setComponentShown

public void setComponentShown(boolean componentShown)
Sets whether the tree is shown or not.

Overrides:
setComponentShown in class DrawingJPanel
Parameters:
componentShown - boolean flag as to whether the tree is shown.

rotateUpNode

protected void rotateUpNode(BSTTree node)
Rotates up the given node.

Parameters:
node - the node to rotate up.

rotateToTopNode

protected void rotateToTopNode(BSTTree node)
Rotates up the given node to the top.

Parameters:
node - the node to rotate up.

rotateUpDoubleNode

protected void rotateUpDoubleNode(BSTTree node)
Doubly Rotates up the given node.

Parameters:
node - the node to rotate up.

splayNode

protected void splayNode(BSTTree node)
Splays up the given node.

Parameters:
node - the node to rotate up.

balanceTree

protected void balanceTree()
Balances the entire tree.


balanceNode

protected void balanceNode(BSTTree node)
Balances the given node.

Parameters:
node - the node to balance.

changeDisplay

protected void changeDisplay()
Changes the display.


rotateUpCommand

public void rotateUpCommand(Tree node)
RotateUp command.

Overrides:
rotateUpCommand in class TreeJPanel
Parameters:
node - Tree to rotateUp.

rotateToTopCommand

public void rotateToTopCommand(Tree node)
RotateToTop command.

Overrides:
rotateToTopCommand in class TreeJPanel
Parameters:
node - Tree to rotateToTop.

rotateUpDoubleCommand

public void rotateUpDoubleCommand(Tree node)
RotateUpDouble command.

Overrides:
rotateUpDoubleCommand in class TreeJPanel
Parameters:
node - Tree to rotateUpDouble.

splayCommand

public void splayCommand(Tree node)
Splay command.

Overrides:
splayCommand in class TreeJPanel
Parameters:
node - Tree to splay.

traverseCommand

public void traverseCommand(int traverseType)
Traverse command.

Overrides:
traverseCommand in class TreeJPanel
Parameters:
traverseType - int that defines the traverseType.

balanceCommand

public void balanceCommand(Tree node)
Balance command.

Overrides:
balanceCommand in class TreeJPanel
Parameters:
node - Tree to balance.

displayChangeCommand

public void displayChangeCommand()
Change Display Command.


optionEventPerformed

public void optionEventPerformed(OptionEvent e)
Recieved an event from an OptionJPanel with one of the given commands. The Panel responds accordingly. The Methods it calls (for example: insertCommand, rotateCommand...) should be overiden in extending classes to functionable.

Specified by:
optionEventPerformed in interface OptionListener
Overrides:
optionEventPerformed in class TreeJPanel
Parameters:
e - OptionEvent recieved from the event performed.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Listens to action events.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Overrides:
actionPerformed in class TreeJPanel
Parameters:
e - ActionEvent that contains information about the tree.