|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.argouml.ui.targetmanager.TargetManager
The manager of the target of ArgoUML. The target of ArgoUML is the element currently selected by the user. This can either be an instance of a meta-class (an Interface or a Class for example) but it can also be a diagram or a figure on a diagram.
There can be multiple targets in case someone selected multiple modelelements or figs in the explorer or on the diagram .
The purpose of the targetmanager is to have a central spot where we manage the list of current targets.
Via an event mechanism this manager makes sure that all objects interested in knowing wether the selection changed are acknowledged.
Note in particular that null is an invalid target.
Nested Class Summary | |
private class |
TargetManager.HistoryManager
The manager of the history of targets. |
Field Summary | |
private org.tigris.gef.presentation.Fig |
figTarget
Cache for the figTarget. |
private TargetManager.HistoryManager |
historyManager
The history manager of argouml. |
private static TargetManager |
instance
The singleton instance. |
private boolean |
inTransaction
Flag to indicate that there is a setTarget method running. |
private EventListenerList |
listenerList
The list with targetlisteners. |
private static Logger |
LOG
The log4j logger to log messages to. |
private Object |
modelTarget
Cache for the modeltarget. |
private List |
targets
The targets. |
Constructor Summary | |
TargetManager()
|
Method Summary | |
void |
addTarget(Object target)
Adds a target to the targets list. |
void |
addTargetListener(TargetListener listener)
Adds a listener. |
void |
cleanHistory()
Cleans the history. |
private org.tigris.gef.presentation.Fig |
determineFigTarget(Object target)
Calculates the most probable 'fig-form' of some target. |
private Object |
determineModelTarget(Object target)
Calculates the modeltarget. |
private void |
endTargetTransaction()
|
private void |
fireTargetAdded(TargetEvent targetEvent)
|
private void |
fireTargetRemoved(TargetEvent targetEvent)
|
private void |
fireTargetSet(TargetEvent targetEvent)
|
org.tigris.gef.presentation.Fig |
getFigTarget()
Convenience method to return the target as fig. |
static TargetManager |
getInstance()
Singleton retrieval method. |
Object |
getModelTarget()
Returns the target in it's 'modelform'. |
Collection |
getModelTargets()
|
Object |
getTarget()
Returns the current primary target, the first selected object. |
Collection |
getTargets()
Returns a collection with all targets. |
private void |
internalOnSetTarget(String eventName,
Object[] oldTargets)
|
private boolean |
isInTargetTransaction()
|
boolean |
navigateBackPossible()
Checks if it's possible to navigate backward |
void |
navigateBackward()
Navigates the target pointer one target backward. |
void |
navigateForward()
Navigates the target pointer one target forward. |
boolean |
navigateForwardPossible()
Checks if it's possible to navigate forward. |
void |
removeHistoryElement(Object o)
|
void |
removeTarget(Object target)
Removes the target from the targets list. |
void |
removeTargetListener(TargetListener listener)
Removes a listener. |
void |
setTarget(Object o)
Sets the targets to the single given object. |
void |
setTargets(Collection targetsList)
Sets the given collection to the current targets. |
private void |
startTargetTransaction()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final Logger LOG
private static TargetManager instance
private List targets
private Object modelTarget
private org.tigris.gef.presentation.Fig figTarget
private EventListenerList listenerList
private TargetManager.HistoryManager historyManager
private boolean inTransaction
Constructor Detail |
public TargetManager()
Method Detail |
public static TargetManager getInstance()
public void setTarget(Object o)
o
- The new target, null clears all targets.private void internalOnSetTarget(String eventName, Object[] oldTargets)
public Object getTarget()
public void setTargets(Collection targetsList)
targetsList
- The new targets list.public void addTarget(Object target)
target
- the target to be added.public void removeTarget(Object target)
target
- The target to remove.public Collection getTargets()
public Collection getModelTargets()
public void addTargetListener(TargetListener listener)
listener
- the listener to addpublic void removeTargetListener(TargetListener listener)
listener
- the listener to removeprivate void fireTargetSet(TargetEvent targetEvent)
private void fireTargetAdded(TargetEvent targetEvent)
private void fireTargetRemoved(TargetEvent targetEvent)
private void startTargetTransaction()
private boolean isInTargetTransaction()
private void endTargetTransaction()
public org.tigris.gef.presentation.Fig getFigTarget()
private org.tigris.gef.presentation.Fig determineFigTarget(Object target)
target
- the target to calculate the 'fig-form' for.
public Object getModelTarget()
private Object determineModelTarget(Object target)
target
- The target to calculate the modeltarget for
public void navigateForward() throws IllegalStateException
IllegalStateException
- If the target pointer is at the end of the
history.public void navigateBackward() throws IllegalStateException
IllegalStateException
- If the target pointer is at the
beginning of the history.public boolean navigateForwardPossible()
public boolean navigateBackPossible()
public void cleanHistory()
public void removeHistoryElement(Object o)
o
- the object to be removed
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2004 (20050222) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |