jmathlib.ui.swing
Class HistoryModel

java.lang.Object
  extended by jmathlib.ui.swing.HistoryModel
All Implemented Interfaces:
javax.swing.tree.TreeModel

public class HistoryModel
extends java.lang.Object
implements javax.swing.tree.TreeModel


Nested Class Summary
static class HistoryModel.RootNode
           
 
Field Summary
private  CommandHistoryManager commandHistory
           
private  CommandHistoryManager.SessionCommandListener listener
           
private  java.util.ArrayList<javax.swing.event.TreeModelListener> listeners
           
private  HistoryModel.RootNode root
           
 
Constructor Summary
HistoryModel(CommandHistoryManager commandHistory)
           
 
Method Summary
 void addTreeModelListener(javax.swing.event.TreeModelListener l)
           
 java.lang.Object getChild(java.lang.Object parent, int index)
           
 int getChildCount(java.lang.Object parent)
           
 int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
           
 java.lang.Object getRoot()
           
 int indexReverser(int size, int currentIndex)
           
 boolean isLeaf(java.lang.Object node)
           
 void removeTreeModelListener(javax.swing.event.TreeModelListener l)
           
 void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

root

private HistoryModel.RootNode root

commandHistory

private CommandHistoryManager commandHistory

listeners

private java.util.ArrayList<javax.swing.event.TreeModelListener> listeners

listener

private CommandHistoryManager.SessionCommandListener listener
Constructor Detail

HistoryModel

public HistoryModel(CommandHistoryManager commandHistory)
Method Detail

addTreeModelListener

public void addTreeModelListener(javax.swing.event.TreeModelListener l)
Specified by:
addTreeModelListener in interface javax.swing.tree.TreeModel

getChild

public java.lang.Object getChild(java.lang.Object parent,
                                 int index)
Specified by:
getChild in interface javax.swing.tree.TreeModel

indexReverser

public int indexReverser(int size,
                         int currentIndex)

getChildCount

public int getChildCount(java.lang.Object parent)
Specified by:
getChildCount in interface javax.swing.tree.TreeModel

getIndexOfChild

public int getIndexOfChild(java.lang.Object parent,
                           java.lang.Object child)
Specified by:
getIndexOfChild in interface javax.swing.tree.TreeModel

getRoot

public java.lang.Object getRoot()
Specified by:
getRoot in interface javax.swing.tree.TreeModel

isLeaf

public boolean isLeaf(java.lang.Object node)
Specified by:
isLeaf in interface javax.swing.tree.TreeModel

removeTreeModelListener

public void removeTreeModelListener(javax.swing.event.TreeModelListener l)
Specified by:
removeTreeModelListener in interface javax.swing.tree.TreeModel

valueForPathChanged

public void valueForPathChanged(javax.swing.tree.TreePath path,
                                java.lang.Object newValue)
Specified by:
valueForPathChanged in interface javax.swing.tree.TreeModel

FOOTER

BOTTOM