org.argouml.ui.targetmanager
Class TargetManager.HistoryManager

java.lang.Object
  extended byorg.argouml.ui.targetmanager.TargetManager.HistoryManager
All Implemented Interfaces:
EventListener, TargetListener
Enclosing class:
TargetManager

private class TargetManager.HistoryManager
extends Object
implements TargetListener

The manager of the history of targets. Every time the user (or the program) selects a new target, this is recorded in the history. Via navigateBack and navigateForward, the user can browse through the history just like in an ordinary internet browser.


Field Summary
private  int currentTarget
          The pointer to the current target in the history
private  List history
          The history with targets
private static int MAX_SIZE
           
private  boolean navigateBackward
          Flag to indicate if the current settarget was instantiated by a navigateBack action.
 
Constructor Summary
private TargetManager.HistoryManager()
          Default constructor that registrates the history manager as target listener with the target manager.
 
Method Summary
private  void clean()
          Cleans the history in total.
private  boolean navigateBackPossible()
          Checks if it's possible to navigate back.
private  void navigateBackward()
          Navigate one step back in history.
private  void navigateForward()
          Navigate one target forward in history.
private  boolean navigateForwardPossible()
          Checks if it's possible to navigate forward
private  void putInHistory(Object target)
          Puts some target into the history (if needed).
private  void removeHistoryTarget(Object o)
           
private  void resize()
          Resizes the history if it's grown too big.
 void targetAdded(TargetEvent e)
          Listener for additions of targets to the selected targets.
 void targetRemoved(TargetEvent e)
          Listener for the removal of targets from the selection.
 void targetSet(TargetEvent e)
          Listener for the selection of a whole bunch of targets in one go (or just one).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_SIZE

private static final int MAX_SIZE
See Also:
Constant Field Values

history

private List history
The history with targets


navigateBackward

private boolean navigateBackward
Flag to indicate if the current settarget was instantiated by a navigateBack action.


currentTarget

private int currentTarget
The pointer to the current target in the history

Constructor Detail

TargetManager.HistoryManager

private TargetManager.HistoryManager()
Default constructor that registrates the history manager as target listener with the target manager.

Method Detail

putInHistory

private void putInHistory(Object target)
Puts some target into the history (if needed). Updates both the history as the pointer to indicate the target.

Parameters:
target - The target to put into the history

resize

private void resize()
Resizes the history if it's grown too big.


navigateForward

private void navigateForward()
Navigate one target forward in history. Throws an illegalstateException if not possible.


navigateBackward

private void navigateBackward()
Navigate one step back in history. Throws an illegalstateexception if not possible.


navigateBackPossible

private boolean navigateBackPossible()
Checks if it's possible to navigate back.

Returns:
true if it's possible to navigate back.

navigateForwardPossible

private boolean navigateForwardPossible()
Checks if it's possible to navigate forward

Returns:
true if it's possible to navigate forward

targetAdded

public void targetAdded(TargetEvent e)
Listener for additions of targets to the selected targets. On addition of targets we put them in the history.

Specified by:
targetAdded in interface TargetListener
Parameters:
e - The targetevent, name will be TARGET_ADDED
See Also:
TargetListener.targetAdded( org.argouml.ui.targetmanager.TargetEvent)

targetRemoved

public void targetRemoved(TargetEvent e)
Listener for the removal of targets from the selection. On removal of a target from the selection we do nothing with respect to the history of targets.

Specified by:
targetRemoved in interface TargetListener
Parameters:
e - The targetevent, name will be TARGET_REMOVED
See Also:
TargetListener.targetRemoved(org.argouml.ui.targetmanager.TargetEvent)

targetSet

public void targetSet(TargetEvent e)
Listener for the selection of a whole bunch of targets in one go (or just one). Puts all the new targets in the history starting with the 'newest' target.

Specified by:
targetSet in interface TargetListener
Parameters:
e - The targetevent, name will be TARGET_SET
See Also:
TargetListener.targetSet(org.argouml.ui.targetmanager.TargetEvent)

clean

private void clean()
Cleans the history in total.


removeHistoryTarget

private void removeHistoryTarget(Object o)


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook