info.aduna.clustermap.panel.request
Class History

java.lang.Object
  extended by info.aduna.clustermap.panel.request.History

public class History
extends Object

History keeps track of a history of Graphs normally shown in a ClusterMap and allows to retrieve previous graphs.


Constructor Summary
History()
           
 
Method Summary
 void addItem(Collection<Classification> classifications, Graph graph)
          Add an item to the history, right after the current item.
 void addListener(HistoryListener listener)
          Registers a new HistoryListener at this History.
 void clear()
          This brings the History back into its original state, i.e.
 Collection<Classification> getCurrentClassifications()
          Returns the set of Classifications represented by the current history item.
 ClusterModel getCurrentClusterModel()
          Returns the ClusterModel represented by the current history item.
 Graph getCurrentGraph()
          Returns the Graph represented by the current history item.
 List getItems()
           
 void goToNext()
          Lets the current item be the next item in the history.
 void goToPrevious()
          Lets the current item be the previous item in the history.
 boolean hasNext()
          Returns whether the current item has a next item in the history.
 boolean hasPrevious()
          Returns whether the current item has a previous item in the history.
 boolean isEmpty()
           
 void removeListener(HistoryListener listener)
          Removes a HistoryListener from this History.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

History

public History()
Method Detail

addItem

public void addItem(Collection<Classification> classifications,
                    Graph graph)
Add an item to the history, right after the current item. All current subsequent items of the current item are removed. The new item will become the current item.


hasPrevious

public boolean hasPrevious()
Returns whether the current item has a previous item in the history.


hasNext

public boolean hasNext()
Returns whether the current item has a next item in the history.


goToPrevious

public void goToPrevious()
                  throws IllegalStateException
Lets the current item be the previous item in the history.

Throws:
IllegalStateException - when there is no previous item.

goToNext

public void goToNext()
              throws IllegalStateException
Lets the current item be the next item in the history.

Throws:
IllegalStateException - when there is no next item.

getCurrentClassifications

public Collection<Classification> getCurrentClassifications()
                                                     throws IllegalStateException
Returns the set of Classifications represented by the current history item.

Throws:
IllegalStateException - when there is no current item.

getCurrentClusterModel

public ClusterModel getCurrentClusterModel()
                                    throws IllegalStateException
Returns the ClusterModel represented by the current history item.

Throws:
IllegalStateException - when there is no current item.

getCurrentGraph

public Graph getCurrentGraph()
                      throws IllegalStateException
Returns the Graph represented by the current history item.

Throws:
IllegalStateException - when there is no current item.

clear

public void clear()
This brings the History back into its original state, i.e. no items in the history.


getItems

public List getItems()

isEmpty

public boolean isEmpty()

addListener

public void addListener(HistoryListener listener)
Registers a new HistoryListener at this History. This method is not thread-safe.


removeListener

public void removeListener(HistoryListener listener)
Removes a HistoryListener from this History. Nothing happens when the specified HistoryListener was not present. This method is not thread-safe.



Copyright © 1997-2008 Aduna. All Rights Reserved.