|
|||||||||||
| 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 anything that is shown on a diagram.
There can be multiple targets in case someone selected multiple items in the explorer or on the diagram. This can be done by shift-clicking or Ctrl-clicking items, or by drawing a box on the diagram around the items to select.
In case multiple targets are selected, the target manager will add each target to the beginning of the list of targets. This way, the first item of the list is the last selected item. Most functions in ArgoUML work on all selected items. However, a few (intentionally) only work on one target, such as the properties panels. These functions have 2 ways of retrieving the target they should work on:
Remark: There is currently no function getFigs(), returning a list of selected figs. But you can obtain such a list from GEF.
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.
Thanks to the architecture of ArgoUML of Modelelements and Figs, one rule has been decided upon (by mvw@tigris.org):
| 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. |
Action |
getAddAttributeAction()
Get the Action for creating and adding a new attribute to the single selected target (or its owner). |
Action |
getAddEnumerationLiteralAction()
Get the Action class for creating and adding a new EnumerationLiteral for the single selected target (or its owner). |
Action |
getAddOperationAction()
Get the Action for creating and adding a new operation to the single selected target (or its owner). |
Action |
getDeleteAction()
Get the Action for deleting the target list. |
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 |
getOwner(Object o)
|
Object |
getSingleModelTarget()
If there is only one model target, then it is returned. |
Object |
getSingleTarget()
If there is only one target, then it is returned. |
Object |
getTarget()
Returns the current primary target, the first selected object. |
Collection |
getTargets()
Returns a collection with all targets. |
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 targetsCollection)
Sets the given collection to the current targets. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static TargetManager getInstance()
public void setTarget(Object o)
o - The new target, null clears all targets.public Object getTarget()
public void setTargets(Collection targetsCollection)
targetsCollection - 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 Object getOwner(Object o)
o - the object
public Collection getTargets()
public Object getSingleTarget()
public Collection getModelTargets()
public Object getSingleModelTarget()
public void addTargetListener(TargetListener listener)
listener - the listener to addpublic void removeTargetListener(TargetListener listener)
listener - the listener to removepublic Action getAddAttributeAction()
public Action getAddOperationAction()
public Action getDeleteAction()
public Action getAddEnumerationLiteralAction()
public Fig getFigTarget()
public Object getModelTarget()
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-2006 | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |