org.argouml.ui.targetmanager
Class TargetManager.HistoryManager

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

private class TargetManager.HistoryManager
extends java.lang.Object
implements TargetListener

The manager of the history of targets. Everytimes 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  java.util.List _history
          The history with targets
private  boolean _navigateBackward
          Flag to indicate if the current settarget was instantiated by a navigateBack action.
private static int MAX_SIZE
           
 
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(java.lang.Object target)
          Puts some target into the history (if needed).
private  void removeHistoryTarget(java.lang.Object o)
           
private  void resize()
          Resizes the history if it's grown too big.
 void targetAdded(TargetEvent e)
          Fired when a target is added to the list of targets.
 void targetRemoved(TargetEvent e)
          Fired when a target is removed from the list of targets
 void targetSet(TargetEvent e)
          Fired when a total new set of targets is set
 
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 java.util.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(java.lang.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)
Description copied from interface: TargetListener
Fired when a target is added to the list of targets.

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)
Description copied from interface: TargetListener
Fired when a target is removed from the list 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)
Description copied from interface: TargetListener
Fired when a total new set of targets is set

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(java.lang.Object o)


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