org.argouml.ui.explorer
Class PerspectiveManager

java.lang.Object
  extended byorg.argouml.ui.explorer.PerspectiveManager

public class PerspectiveManager
extends Object

Provides a model and event management for perspectives(views) of the Explorer.

This class defines the complete list of perspective rules, and knows the default perspectives and their contents.

Since:
0.15.2

Field Summary
private static PerspectiveManager instance
           
private static Logger LOG
           
private  List perspectiveListeners
           
private  List perspectives
           
private  List rules
           
 
Constructor Summary
private PerspectiveManager()
          Creates a new instance of PerspectiveManager
 
Method Summary
 void addAllPerspectives(Collection newPerspectives)
           
 void addListener(PerspectiveManagerListener listener)
           
 void addPerspective(Object perspective)
           
 void addRule(PerspectiveRule rule)
          Add a rule to the list of rules.
 Collection getDefaultPerspectives()
           
static PerspectiveManager getInstance()
           
 List getPerspectives()
           
 Collection getRules()
           
 void loadDefaultPerspectives()
          Loads a pre-defined default set of perspectives.
 void loadRules()
          Get the predefined rules.
 void loadUserPerspectives()
          Tries to load user defined perspectives, if it can't it loads the (predefined) default perspectives.
 void removeAllPerspectives()
          Remove all perspectives.
 void removeListener(PerspectiveManagerListener listener)
           
 void removePerspective(Object perspective)
           
 void removeRule(PerspectiveRule rule)
          Remove a rule from the list.
 void saveUserPerspectives()
          save the user perspectives in the ArgoUML configuration
 String toString()
          string representation of the perspectives in the same format as saved in the user properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

private static final Logger LOG

instance

private static PerspectiveManager instance

perspectiveListeners

private List perspectiveListeners

perspectives

private List perspectives

rules

private List rules
Constructor Detail

PerspectiveManager

private PerspectiveManager()
Creates a new instance of PerspectiveManager

Method Detail

getInstance

public static PerspectiveManager getInstance()
Returns:
the instance (singleton)

addListener

public void addListener(PerspectiveManagerListener listener)
Parameters:
listener - the listener to be added

removeListener

public void removeListener(PerspectiveManagerListener listener)
Parameters:
listener - the listener to be removed

addPerspective

public void addPerspective(Object perspective)
Parameters:
perspective - the perspective to be added

addAllPerspectives

public void addAllPerspectives(Collection newPerspectives)
Parameters:
newPerspectives - the collection of perspectives to be added

removePerspective

public void removePerspective(Object perspective)
Parameters:
perspective - the perspective to be removed

removeAllPerspectives

public void removeAllPerspectives()
Remove all perspectives.


getPerspectives

public List getPerspectives()
Returns:
the list of all persppectives

loadUserPerspectives

public void loadUserPerspectives()
Tries to load user defined perspectives, if it can't it loads the (predefined) default perspectives.


loadDefaultPerspectives

public void loadDefaultPerspectives()
Loads a pre-defined default set of perspectives.


getDefaultPerspectives

public Collection getDefaultPerspectives()
Returns:
a collection of default perspectives (i.e. the predefined ones)

loadRules

public void loadRules()
Get the predefined rules.

This is a hard coded rules library for now, since it is quite a lot of work to get all possible rule names in "org.argouml.ui.explorer.rules" from the classpath (which would also not allow adding rules from other locations).


addRule

public void addRule(PerspectiveRule rule)
Add a rule to the list of rules.

Parameters:
rule - the PerspectiveRule to be added

removeRule

public void removeRule(PerspectiveRule rule)
Remove a rule from the list.

Parameters:
rule - the PerspectiveRule to be removed

getRules

public Collection getRules()
Returns:
the collection of rules

saveUserPerspectives

public void saveUserPerspectives()
save the user perspectives in the ArgoUML configuration


toString

public String toString()
string representation of the perspectives in the same format as saved in the user properties.

See Also:
Object.toString()


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