edu.princeton.cs.algs4.growingtree.framework
Class TreeJPanel<P extends NodeProperties>

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 edu.princeton.cs.algs4.growingtree.framework.DrawingJPanel
                      extended by edu.princeton.cs.algs4.growingtree.framework.TreeJPanel<P>
All Implemented Interfaces:
OptionListener, TreeMessageListener, java.awt.event.ActionListener, java.awt.event.ComponentListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible
Direct Known Subclasses:
BSTTreeJPanel

public class TreeJPanel<P extends NodeProperties>
extends DrawingJPanel
implements OptionListener, java.awt.event.ActionListener, TreeMessageListener

This class provides the panel for a Tree. 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. This is a class that is extended for each specific tree.

Version:
3.5 9/15/01
Author:
Corey Sanders
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
 
Field Summary
static java.lang.String BACKGROUND
          String representing DRAWING color scheme.
static java.lang.String CHARACTER
          String representing character types.
static int DEFAULT_DELAY
          The default delay for animation (90).
static java.lang.String DELETE
          String representing DELETE color scheme.
static java.lang.String DOUBLE
          String representing double types.
static java.lang.String DRAWING
          String representing DRAWING color scheme.
static java.lang.String INSERT
          String representing INSERT color scheme.
static java.lang.String INTEGER
          String representing integer types.
static java.lang.String KEY
          String representing Key color scheme.
static java.lang.String KEY_ANIMATOR_SETTINGS
          String representing key animator color scheme.
static java.lang.String KEY_ORIGINAL_SETTINGS
          String representing key original color scheme.
static java.lang.String LEFT_PAINT
          String representing the left paint.
static java.lang.String NODE
          String representing Node color scheme.
static java.lang.String NODE_ANIMATOR_SETTINGS
          String representing node animator color scheme.
static java.lang.String NODE_CHILD_SETTINGS
          String representing node child color scheme.
static java.lang.String NODE_DESCENDANT_SETTINGS
          String representing node descendant color scheme.
static java.lang.String NODE_LEFT_SETTINGS
          String representing node left color scheme.
static java.lang.String NODE_ORIGINAL_SETTINGS
          String representing node original color scheme.
static java.lang.String NODE_RIGHT_SETTINGS
          String representing node right color scheme.
static java.lang.String NODE_ROOT_SETTINGS
          String representing node root color scheme.
static java.lang.String NOKEY
          command passed for no key errors.
static java.lang.String PAINT
          String representing Paint color scheme.
static java.lang.String RIGHT_PAINT
          String representing the right paint.
static java.lang.String ROTATE
          String representing ROTATE color scheme.
static java.lang.String SEARCH
          String representing SEARCH color scheme.
static java.lang.String SELECT
          String representing SELECT color scheme.
static java.lang.String TRAVERSE
          String representing TRAVERSE color scheme.
static java.lang.String TYPEERR
          command passed for type errors.
 
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
TreeJPanel()
          Sole constructor which sets all of the default values for the Panel.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Listens to action events.
 void addTreeMessageListener(TreeMessageListener l)
          Adds an TreeMessageListener from the TREE, according to the TreeMessageListener interface and the TreeMessageEvent.
 void animatingCommand(boolean animatingCommand)
          Animation command.
 void animationQualityCommand(int quality)
          Animation quality command.
 void animationSpeedCommand(int speed)
          Animation speed command.
 void balanceCommand(Tree<P> node)
          Balance command.
 void clearAllCommand()
          Clear all command.
 void clearCommand()
          Clear command.
 void constructColorOptions(ColorOptionsJPanel allTreeToolsPanel)
          Constructs the color settings for this tree, using the given parameter.
 void constructPresetColorOptions(ColorOptionsJPanel colorOptionsPanel)
          Constructs the color settings combo box and sets the box for the given colorOptionsPanel.
 void deleteCommand(java.lang.String text)
          Delete command.
 void deleteCommand(Tree<P> node)
          Insert command.
 void getInputOptions()
          Gets the input options for the current tree.
 java.lang.String getKeyType()
          Gets the key type for the tree.
 java.lang.String getTitle()
          Gets the title for the tree.
 AnimatingTreeHead<P> getTree()
          Gets the head of the tree currently drawn in the Panel.
 java.lang.String getTreeStatusMessage()
          Get the tree message.
 void inputChangeCommand(java.lang.String input)
          Input Change Command.
 void insertCommand(java.lang.String text)
          Insert command.
 boolean isAnimating()
          Gets whether the tree is animating or not.
 boolean isStep()
          Gets whether the tree is stepping or not.
 void makeColorSchemeOptions()
          Passes a message to make the color scheme options for the current Panel.
 void makeColorSettings()
          Passes a message to make the color settings options for the current Panel.
 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 paintComponent(java.awt.Graphics g)
          Overides paintComponenet and is called whenever the Panel needs to be painted.
 void partitionCommand(Tree<P> node)
          Partition command.
 void pauseCommand()
          Pause command.
 void playCommand()
          Play command.
 void playFastCommand()
          Play command.
 void playStepCommand()
          Play command.
 void removeTreeMessageListener(TreeMessageListener l)
          Removes an TreeMessageListener from the TREE, according to the TreeMessageListener interface and the TreeMessageEvent.
 void repaintAttempt()
           
 void rewindCommand()
          Play command.
 void rewindFastCommand()
          Play command.
 void rewindStepCommand()
          Play command.
 void rotateToTopCommand(Tree<P> node)
          RotateToTop command.
 void rotateUpCommand(Tree<P> node)
          RotateUp command.
 void rotateUpDoubleCommand(Tree<P> node)
          RotateUpDouble command.
 void saveTreeCommand(TreeJPanel<P> panel)
           
 void searchCommand(java.lang.String text)
          Search command.
 void selectCommand(java.lang.String text)
          Select command.
 void selectCommand(Tree<P> node)
          Select command.
 void setAnimating(boolean animating)
          Sets whether the tree is animating or not.
 void setDelayRate(int t)
          Sets the delay rate for the timer for the animation.
 void setSettings(TreeJPanel<P> panel)
          Sets the settings for the panel param.
 void setStep(boolean step)
          Sets whether the tree is stepping or not.
 void setSubtreeCountsCommand(boolean visible)
           
 void setTree(AnimatingTreeHead<P> tree)
          Sets the head of the tree currently drawn in the Panel.
 void splayCommand(Tree<P> node)
          Splay command.
 void stopCommand()
          Stop command.
 void traverseCommand(int traverseType)
          Traverse command.
 void treeMessageEventPerformed(TreeMessageEvent e)
          Listens to tree message events.
 
Methods inherited from class edu.princeton.cs.algs4.growingtree.framework.DrawingJPanel
componentHidden, componentMoved, componentResized, componentShown, getDrawingArea, getDrawTreeGraphics, getDrawTreeImage, isComponentShown, isDrawTree, setComponentShown, setDrawTree
 
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, getBaseline, getBaselineResizeBehavior, 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, isPaintingForPrint, 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, 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
 

Field Detail

TYPEERR

public static final java.lang.String TYPEERR
command passed for type errors.

See Also:
Constant Field Values

NOKEY

public static final java.lang.String NOKEY
command passed for no key errors.

See Also:
Constant Field Values

INTEGER

public static final java.lang.String INTEGER
String representing integer types.

See Also:
Constant Field Values

CHARACTER

public static final java.lang.String CHARACTER
String representing character types.

See Also:
Constant Field Values

DOUBLE

public static final java.lang.String DOUBLE
String representing double types.

See Also:
Constant Field Values

DRAWING

public static final java.lang.String DRAWING
String representing DRAWING color scheme.

See Also:
Constant Field Values

BACKGROUND

public static final java.lang.String BACKGROUND
String representing DRAWING color scheme.

See Also:
Constant Field Values

INSERT

public static final java.lang.String INSERT
String representing INSERT color scheme.

See Also:
Constant Field Values

SEARCH

public static final java.lang.String SEARCH
String representing SEARCH color scheme.

See Also:
Constant Field Values

SELECT

public static final java.lang.String SELECT
String representing SELECT color scheme.

See Also:
Constant Field Values

ROTATE

public static final java.lang.String ROTATE
String representing ROTATE color scheme.

See Also:
Constant Field Values

DELETE

public static final java.lang.String DELETE
String representing DELETE color scheme.

See Also:
Constant Field Values

TRAVERSE

public static final java.lang.String TRAVERSE
String representing TRAVERSE color scheme.

See Also:
Constant Field Values

NODE

public static final java.lang.String NODE
String representing Node color scheme.

See Also:
Constant Field Values

KEY

public static final java.lang.String KEY
String representing Key color scheme.

See Also:
Constant Field Values

PAINT

public static final java.lang.String PAINT
String representing Paint color scheme.

See Also:
Constant Field Values

NODE_LEFT_SETTINGS

public static final java.lang.String NODE_LEFT_SETTINGS
String representing node left color scheme.

See Also:
Constant Field Values

NODE_RIGHT_SETTINGS

public static final java.lang.String NODE_RIGHT_SETTINGS
String representing node right color scheme.

See Also:
Constant Field Values

NODE_ANIMATOR_SETTINGS

public static final java.lang.String NODE_ANIMATOR_SETTINGS
String representing node animator color scheme.

See Also:
Constant Field Values

KEY_ANIMATOR_SETTINGS

public static final java.lang.String KEY_ANIMATOR_SETTINGS
String representing key animator color scheme.

See Also:
Constant Field Values

KEY_ORIGINAL_SETTINGS

public static final java.lang.String KEY_ORIGINAL_SETTINGS
String representing key original color scheme.

See Also:
Constant Field Values

NODE_ROOT_SETTINGS

public static final java.lang.String NODE_ROOT_SETTINGS
String representing node root color scheme.

See Also:
Constant Field Values

NODE_CHILD_SETTINGS

public static final java.lang.String NODE_CHILD_SETTINGS
String representing node child color scheme.

See Also:
Constant Field Values

NODE_DESCENDANT_SETTINGS

public static final java.lang.String NODE_DESCENDANT_SETTINGS
String representing node descendant color scheme.

See Also:
Constant Field Values

NODE_ORIGINAL_SETTINGS

public static final java.lang.String NODE_ORIGINAL_SETTINGS
String representing node original color scheme.

See Also:
Constant Field Values

LEFT_PAINT

public static final java.lang.String LEFT_PAINT
String representing the left paint.

See Also:
Constant Field Values

RIGHT_PAINT

public static final java.lang.String RIGHT_PAINT
String representing the right paint.

See Also:
Constant Field Values

DEFAULT_DELAY

public static final int DEFAULT_DELAY
The default delay for animation (90).

See Also:
Constant Field Values
Constructor Detail

TreeJPanel

public TreeJPanel()
Sole constructor which sets all of the default values for the Panel. Calls the super constructor of JPanel. Also, it adds itself to listen to component events.

Method Detail

setTree

public void setTree(AnimatingTreeHead<P> tree)
Sets the head of the tree currently drawn in the Panel.

Parameters:
tree - AnimatingTreeHead head.

setDelayRate

public void setDelayRate(int t)
Sets the delay rate for the timer for the animation. param t int delay rate.


setAnimating

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

Parameters:
animating - boolean flag as to whether the tree is animating.

setStep

public void setStep(boolean step)
Sets whether the tree is stepping or not.

Parameters:
step - boolean flag as to whether the tree is stepping.

getTitle

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

Returns:
String defining the title of the tree.

getTreeStatusMessage

public java.lang.String getTreeStatusMessage()
Get the tree message. The method calls TreeStatusMessage of the tree within the panel.


getTree

public AnimatingTreeHead<P> getTree()
Gets the head of the tree currently drawn in the Panel.

Returns:
TreeHead the tree head.

isAnimating

public boolean isAnimating()
Gets whether the tree is animating or not.

Parameters:
true - if the tree is animating.

isStep

public boolean isStep()
Gets whether the tree is stepping or not.

Parameters:
true - if the tree is stepping.

getKeyType

public java.lang.String getKeyType()
Gets the key type for the tree.

Returns:
String defining the type of key in the tree.

getInputOptions

public void getInputOptions()
Gets the input options for the current tree.


paintComponent

public void paintComponent(java.awt.Graphics g)
Overides paintComponenet and is called whenever the Panel needs to be painted. The painting includes painting the image and then painting the animation (if any).

Overrides:
paintComponent in class DrawingJPanel
Parameters:
g - Graphics to which the component is drawn.

repaintAttempt

public void repaintAttempt()

setSubtreeCountsCommand

public void setSubtreeCountsCommand(boolean visible)

insertCommand

public void insertCommand(java.lang.String text)
Insert command. Simply calls insertKeys with the text. Overide if necessary.

Parameters:
text - String to insert.

searchCommand

public void searchCommand(java.lang.String text)
Search command. Simply calls searchKeys with the text. Overide if necessary.

Parameters:
text - String to search.

deleteCommand

public void deleteCommand(java.lang.String text)
Delete command. Simply calls deleteKeys with the text. Overide if necessary.

Parameters:
text - String to delete.

deleteCommand

public void deleteCommand(Tree<P> node)
Insert command. Simply calls insertKeys with the text. Overide if necessary.

Parameters:
node - Tree to delete.

selectCommand

public void selectCommand(java.lang.String text)
Select command. Simply calls selectKeys with the text. Overide if necessary.

Parameters:
text - String to select.

selectCommand

public void selectCommand(Tree<P> node)
Select command. Simply calls selectKeys with the text. Overide if necessary.

Parameters:
text - String to select.

clearCommand

public void clearCommand()
Clear command. Simply calls clearTree. Overide if necessary.


clearAllCommand

public void clearAllCommand()
Clear all command. Simply calls clear. Overide if necessary.


partitionCommand

public void partitionCommand(Tree<P> node)
Partition command. Simply calls partitionNode. Overide if necessary.

Parameters:
node - Tree to partition.

rotateUpCommand

public void rotateUpCommand(Tree<P> node)
RotateUp command. Does Nothing (not all trees have rotations). Overide if necessary.

Parameters:
node - Tree to rotateUp.

rotateToTopCommand

public void rotateToTopCommand(Tree<P> node)
RotateToTop command. Does Nothing (not all trees have rotations). Overide if necessary.

Parameters:
node - Tree to rotateToTop.

rotateUpDoubleCommand

public void rotateUpDoubleCommand(Tree<P> node)
RotateUpDouble command. Does Nothing (not all trees have rotations). Overide if necessary.

Parameters:
node - Tree to rotateUpDouble.

splayCommand

public void splayCommand(Tree<P> node)
Splay command. Does Nothing (not all trees have rotations). Overide if necessary.

Parameters:
node - Tree to splay.

balanceCommand

public void balanceCommand(Tree<P> node)
Balance command. Does Nothing. Overide if necessary.

Parameters:
node - Tree to balance.

traverseCommand

public void traverseCommand(int traverseType)
Traverse command. Does Nothing. Overide if necessary.

Parameters:
traverseType - int that defines the traverseType.

playCommand

public void playCommand()
Play command.


playStepCommand

public void playStepCommand()
Play command.


playFastCommand

public void playFastCommand()
Play command.


rewindCommand

public void rewindCommand()
Play command.


rewindStepCommand

public void rewindStepCommand()
Play command.


rewindFastCommand

public void rewindFastCommand()
Play command.


pauseCommand

public void pauseCommand()
Pause command.


stopCommand

public void stopCommand()
Stop command.


animatingCommand

public void animatingCommand(boolean animatingCommand)
Animation command.

Parameters:
step - boolean turning animation on or off.

animationQualityCommand

public void animationQualityCommand(int quality)
Animation quality command.

Parameters:
quality - int setting the quality of the animation.

animationSpeedCommand

public void animationSpeedCommand(int speed)
Animation speed command.

Parameters:
speed - int setting the speed of the animation.

inputChangeCommand

public void inputChangeCommand(java.lang.String input)
Input Change Command.

Parameters:
input - string setting the new input type.

saveTreeCommand

public void saveTreeCommand(TreeJPanel<P> panel)

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.

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.

makeColorSchemeOptions

public void makeColorSchemeOptions()
Passes a message to make the color scheme options for the current Panel. Generally called if this panel becomes selected. A tree message is sent with TreeMessageEvent.COLOR_PANEL with this as the object.


makeColorSettings

public void makeColorSettings()
Passes a message to make the color settings options for the current Panel. Generally called if this panel becomes selected. A tree message is sent with TreeMessageEvent.SET_PRESET_COLOR_OPTIONS with this as the object.


constructColorOptions

public void constructColorOptions(ColorOptionsJPanel allTreeToolsPanel)
Constructs the color settings for this tree, using the given parameter.

Parameters:
allTreeToolsPanel - Panel to construct the color settings.

constructPresetColorOptions

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

Parameters:
colorOptionsPanel - the colorOptionsPanel for which the JComboBox is set.

addTreeMessageListener

public void addTreeMessageListener(TreeMessageListener l)
Adds an TreeMessageListener from the TREE, according to the TreeMessageListener interface and the TreeMessageEvent.

Parameters:
l - the listener added recieves the TreeMessageEvents occuring.

removeTreeMessageListener

public void removeTreeMessageListener(TreeMessageListener l)
Removes an TreeMessageListener from the TREE, according to the TreeMessageListener interface and the TreeMessageEvent.

Parameters:
l - the listener removed from recieving the TreeMessageEvents occuring.

setSettings

public void setSettings(TreeJPanel<P> panel)
Sets the settings for the panel param.

Parameters:
panel - the panel for the settings to be set.

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
Parameters:
e - OptionEvent recieved from the event performed.

treeMessageEventPerformed

public void treeMessageEventPerformed(TreeMessageEvent e)
Listens to tree message events.

Specified by:
treeMessageEventPerformed in interface TreeMessageListener
Parameters:
e - TreeMessageEvent that contains information about the tree.

actionPerformed

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

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