|
|||||||||||
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 selected element in the model. 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.
Via an event mechanism this manager makes sure that all objects interested in knowing wether the event 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 boolean |
_inTransaction
Flag to indicate that there is a setTarget method running |
private javax.swing.event.EventListenerList |
_listenerList
The list with targetlisteners |
private org.apache.log4j.Logger |
_log
The log4j logger to log messages to |
private java.lang.Object |
_modelTarget
Cache for the modeltarget. |
private java.util.List |
_targets
The targets |
private static TargetManager |
instance
The singleton instance |
Constructor Summary | |
TargetManager()
|
Method Summary | |
void |
addTarget(java.lang.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(java.lang.Object target)
Calculates the most probable 'fig-form' of some target. |
private java.lang.Object |
determineModelTarget(java.lang.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 |
java.lang.Object |
getModelTarget()
Returns the target in it's 'modelform'. |
java.util.Collection |
getModelTargets()
|
java.lang.Object |
getTarget()
Returns the current primary target, the first selected object. |
java.util.Collection |
getTargets()
Returns a collection with all targets. |
private void |
internalOnSetTarget(java.lang.String eventName,
java.lang.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(java.lang.Object o)
|
void |
removeTarget(java.lang.Object target)
Removes the target from the targets list. |
void |
removeTargetListener(TargetListener listener)
Removes a listener. |
void |
setTarget(java.lang.Object o)
Sets the targets to the single given object. |
void |
setTargets(java.util.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 org.apache.log4j.Logger _log
private static TargetManager instance
private java.util.List _targets
private java.lang.Object _modelTarget
private org.tigris.gef.presentation.Fig _figTarget
private javax.swing.event.EventListenerList _listenerList
private TargetManager.HistoryManager _historyManager
private boolean _inTransaction
Constructor Detail |
public TargetManager()
Method Detail |
public static TargetManager getInstance()
public void setTarget(java.lang.Object o)
o
- The new target, null clears all targets.private void internalOnSetTarget(java.lang.String eventName, java.lang.Object[] oldTargets)
public java.lang.Object getTarget()
public void setTargets(java.util.Collection targetsList)
targetsList
- The new targets list.public void addTarget(java.lang.Object target)
target
- the target to be added.public void removeTarget(java.lang.Object target)
target
- The target to remove.public java.util.Collection getTargets()
public java.util.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(java.lang.Object target)
target
- the target to calculate the 'fig-form' for.
public java.lang.Object getModelTarget()
private java.lang.Object determineModelTarget(java.lang.Object target)
target
- The target to calculate the modeltarget for
public void navigateForward() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- If the target pointer is at the end of the
history.public void navigateBackward() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- If the target pointer is at the
beginning of the history.public boolean navigateForwardPossible()
public boolean navigateBackPossible()
public void cleanHistory()
public void removeHistoryElement(java.lang.Object o)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2004 (20040316) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |