|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.argouml.kernel.Project
The Project is a datastructure that represents the designer's current project. It manages the list of diagrams and UML models.
Nested Class Summary | |
private class |
Project.Vcl
Listener to events from the Diagram class. |
Field Summary | |
private ArgoDiagram |
activeDiagram
The active diagram, pointer to a diagram in the list with diagrams. |
private String |
authorname
|
private GenerationPreferences |
cgPrefs
|
private Object |
currentNamespace
|
private Object |
defaultModel
|
private HashMap |
defaultModelCache
Cache for the default model. |
private String |
description
|
private Vector |
diagrams
Instances of the uml diagrams. |
private String |
historyFile
|
private static Logger |
LOG
Logger. |
private MemberList |
members
|
private Vector |
models
Instances of the uml model. |
private int |
persistenceVersion
The version number of the persistence format that last saved this project. |
private Vector |
searchpath
|
(package private) static long |
serialVersionUID
|
private Collection |
trashcan
|
private Object |
treeRoot
The root of the modeltree the user is working on. |
private static String |
UNTITLED_FILE
Default name for a project. |
private URL |
url
TODO: should just be the directory to write. |
private HashMap |
uuidRefs
|
private String |
version
|
private VetoableChangeSupport |
vetoSupport
|
Constructor Summary | |
Project()
Constructor. |
|
Project(URL theProjectUrl)
Constructor. |
Method Summary | |
void |
addDiagram(ArgoDiagram d)
|
private void |
addDiagramMember(ArgoDiagram d)
|
void |
addMember(Object m)
|
void |
addModel(Object m)
|
private void |
addModelMember(Object m)
|
void |
addSearchPath(String searchPathElement)
|
private void |
addTodoMember(ProjectMemberTodoList pm)
|
private Collection |
collectAllEnclosedFigsRecursively(org.tigris.gef.presentation.Fig f)
|
Collection |
findAllPresentationsFor(Object obj)
Returns a list with all figs for some UML object on all diagrams. |
private Collection |
findAllPresentationsFor(Object obj,
boolean includeEnclosedOnes)
Get all figs from all diagrams (+ enclosed ones recursively) for some object obj. |
Collection |
findFigsForMember(Object member)
Finds all figs on the diagrams for some project member, including the figs containing the member (so for some operation, the containing figclass is returned). |
Object |
findType(String s)
Searches for a type/classifier with name s. |
Object |
findType(String s,
boolean defineNew)
Searches for a type/classifier with name s. |
Object |
findTypeInDefaultModel(String name)
Find a type by name in the default model. |
Object |
findTypeInModel(String s,
Object ns)
Finds a classifier with a certain name. |
ArgoDiagram |
getActiveDiagram()
Get the current viewed diagram. |
String |
getAuthorname()
Get the author name. |
String |
getBaseName()
Find the base name of this project. |
GenerationPreferences |
getCgPrefs()
Returns the cgPrefs. |
Object |
getCurrentNamespace()
|
Object |
getDefaultModel()
Get the default model. |
String |
getDescription()
Get the description. |
ArgoDiagram |
getDiagram(String name)
Finds a diagram with a specific name or UID. |
int |
getDiagramCount()
Get the number of diagrams in this project. |
Vector |
getDiagrams()
|
GenerationPreferences |
getGenerationPrefs()
|
String |
getHistoryFile()
Get the history file. |
Object |
getInitialTarget()
|
MemberList |
getMembers()
Get all members of the project. |
Object |
getModel()
Return the model. |
Collection |
getModels()
Returns all models, including the default model (default.xmi). |
String |
getName()
|
int |
getPersistenceVersion()
|
int |
getPresentationCountFor(Object me)
|
Object |
getRoot()
Returns the root. |
Vector |
getSearchpath()
Returns the searchpath. |
Vector |
getSearchPath()
|
URL |
getUrl()
Returns the url. |
URL |
getURL()
Get the URL for this project. |
Vector |
getUserDefinedModels()
Returns all models defined by the user. |
HashMap |
getUUIDRefs()
Returns the uUIDRefs. |
String |
getVersion()
Get the version. |
VetoableChangeSupport |
getVetoSupport()
|
boolean |
isInTrash(Object obj)
|
boolean |
isValidDiagramName(String name)
Returns true if the given name is a valid name for a diagram. |
protected void |
makeUntitledProject()
Makes a just created project to an untitled project with a class diagram and a usecase diagram and an untitled model. |
void |
moveToTrash(Object obj)
Moves some object to trash, i.e. |
void |
postLoad()
This is executed after a load. |
void |
postSave()
This is execcuted after a save. |
void |
preSave()
This is executed before a save. |
void |
remove()
Remove the project. |
private void |
removeAllFigs(Collection c)
|
protected void |
removeDiagram(ArgoDiagram d)
Removes a diagram from the list with diagrams. |
protected void |
removeProjectMemberDiagram(ArgoDiagram d)
Removes a project member diagram completely from the project. |
void |
setActiveDiagram(ArgoDiagram theDiagram)
|
void |
setAuthorname(String s)
Set the author name. |
void |
setCgPrefs(GenerationPreferences theCgPrefs)
Sets the cgPrefs. |
void |
setCurrentNamespace(Object m)
|
void |
setDefaultModel(Object theDefaultModel)
|
void |
setDescription(String s)
Set a new description. |
void |
setFile(File file)
Set the project file. |
void |
setGenerationPrefs(GenerationPreferences cgp)
|
void |
setHistoryFile(String s)
Set the history file. |
void |
setName(String n)
Set the project URL. |
void |
setPersistenceVersion(int pv)
|
void |
setRoot(Object root)
Sets the root. |
void |
setSearchpath(Vector theSearchpath)
Sets the searchpath. |
private void |
setTarget(Object target)
Called to update the current namespace and active diagram after the target has changed. |
void |
setUrl(URL theUrl)
Sets the url. |
void |
setURL(URL theUrl)
Set the URL for this project. |
void |
setUUIDRefs(HashMap uUIDRefs)
Sets the uUIDRefs. |
void |
setVersion(String s)
Set the new version. |
void |
setVetoSupport(VetoableChangeSupport theVetoSupport)
Sets the vetoSupport. |
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 |
protected void |
trashInternal(Object obj)
Removes some object from the project. |
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 final String UNTITLED_FILE
static final long serialVersionUID
private URL url
private String authorname
private String description
private String version
private Vector searchpath
private MemberList members
private String historyFile
private int persistenceVersion
private Vector models
private Vector diagrams
private Object defaultModel
private Object currentNamespace
private HashMap uuidRefs
private GenerationPreferences cgPrefs
private transient VetoableChangeSupport vetoSupport
private Object treeRoot
private ArgoDiagram activeDiagram
private HashMap defaultModelCache
private Collection trashcan
Constructor Detail |
public Project(URL theProjectUrl)
theProjectUrl
- Url to read the project from.public Project()
Method Detail |
protected void makeUntitledProject()
public String getBaseName()
This is the name minus any valid file extension.
public String getName()
public void setName(String n) throws MalformedURLException
n
- The new URL (as a String).
MalformedURLException
- if the argument cannot be converted to
an URL.public URL getURL()
public void setURL(URL theUrl)
theUrl
- The URL to set.public void setFile(File file)
file
- File to set the project to.public Vector getSearchPath()
public void addSearchPath(String searchPathElement)
searchPathElement
- the element to be added to the searchpathpublic MemberList getMembers()
private void addDiagramMember(ArgoDiagram d)
d
- the diagramprivate void addTodoMember(ProjectMemberTodoList pm)
pm
- the member to be addedpublic void addMember(Object m)
m
- the member to be addedprivate void addModelMember(Object m)
m
- the modelpublic void addModel(Object m)
m
- a namespaceprotected void removeProjectMemberDiagram(ArgoDiagram d)
d
- the ArgoDiagrampublic String getAuthorname()
public void setAuthorname(String s)
s
- The new author name.public String getVersion()
public void setVersion(String s)
s
- The new version.public String getDescription()
public void setDescription(String s)
s
- The new description.public String getHistoryFile()
public void setHistoryFile(String s)
s
- The new history file.public Vector getUserDefinedModels()
public Collection getModels()
public Object getModel()
If there isn't exactly one model, null
is returned.
public Object findType(String s)
s
- the name of the type/classifier to be found
public Object findType(String s, boolean defineNew)
s
- the name of the type/classifier to be founddefineNew
- if true, define a new one
public Collection findFigsForMember(Object member)
member
- The member we are looking for.
This can be a NSUML object but also another object.
public Collection findAllPresentationsFor(Object obj)
obj
- the given UML object
private Collection findAllPresentationsFor(Object obj, boolean includeEnclosedOnes)
See issue 3042 for an explanation of the 2nd parameter.
obj
- the given objectincludeEnclosedOnes
- true to return also enclosed figs
public Object findTypeInModel(String s, Object ns)
Will only return first classifier with the matching name.
s
- is short name.ns
- Namespace where we do the search.
null
if not found).public void setCurrentNamespace(Object m)
m
- the namespacepublic Object getCurrentNamespace()
public Vector getDiagrams()
public int getDiagramCount()
public ArgoDiagram getDiagram(String name)
name
- is the name to search for.
public void addDiagram(ArgoDiagram d)
d
- the diagram to be addedprotected void removeDiagram(ArgoDiagram d)
d
- the ArgoDiagrampublic int getPresentationCountFor(Object me)
me
- the given modelelement
public Object getInitialTarget()
public void setGenerationPrefs(GenerationPreferences cgp)
cgp
- the generation preferencespublic GenerationPreferences getGenerationPrefs()
public VetoableChangeSupport getVetoSupport()
public void preSave()
public void postSave()
public void postLoad()
public void moveToTrash(Object obj)
Deleting an object involves:
- Removing Target history - Deleting all Fig representations for the object - Deleting the UML element - Deleting all dependent UML modelelements - Deleting CommentEdges (which are not UML elements) - Move to trash for enclosed objects, i.e. graphically drawn on top of - Move to trash subdiagrams for the object - Saveguard that there is always at least 1 diagram left - Trigger the explorer when a diagram is deleted - Set the needsSave (dirty) flag of the projectmanager
obj
- The object to be deletedtrashInternal(Object)
protected void trashInternal(Object obj)
obj
- the object to be thrown awayprivate Collection collectAllEnclosedFigsRecursively(org.tigris.gef.presentation.Fig f)
private void removeAllFigs(Collection c)
c
- a collection of figspublic boolean isInTrash(Object obj)
obj
- the object
public void setDefaultModel(Object theDefaultModel)
theDefaultModel
- a uml modelpublic Object getDefaultModel()
public Object findTypeInDefaultModel(String name)
name
- the name.
public Object getRoot()
public void setRoot(Object root)
root
- The root to set, a uml modelpublic boolean isValidDiagramName(String name)
name
- The name to test
public GenerationPreferences getCgPrefs()
public Vector getSearchpath()
public URL getUrl()
public HashMap getUUIDRefs()
public void setCgPrefs(GenerationPreferences theCgPrefs)
theCgPrefs
- The cgPrefs to setpublic void setSearchpath(Vector theSearchpath)
theSearchpath
- The searchpath to setpublic void setUrl(URL theUrl)
theUrl
- The url to setpublic void setUUIDRefs(HashMap uUIDRefs)
uUIDRefs
- The uUIDRefs to setpublic void setVetoSupport(VetoableChangeSupport theVetoSupport)
theVetoSupport
- The vetoSupport to setpublic ArgoDiagram getActiveDiagram()
public void setActiveDiagram(ArgoDiagram theDiagram)
theDiagram
- the ArgoDiagrampublic void targetAdded(TargetEvent e)
TargetListener
targetAdded
in interface TargetListener
e
- The targetevent, name will be TARGET_ADDEDTargetListener.targetAdded(TargetEvent)
public void targetRemoved(TargetEvent e)
TargetListener
targetRemoved
in interface TargetListener
e
- The targetevent, name will be TARGET_REMOVEDTargetListener.targetRemoved(TargetEvent)
public void targetSet(TargetEvent e)
TargetListener
targetSet
in interface TargetListener
e
- The targetevent, name will be TARGET_SETTargetListener.targetSet(TargetEvent)
private void setTarget(Object target)
target
- public void remove()
public int getPersistenceVersion()
public void setPersistenceVersion(int pv)
pv
- The persistenceVersion to set.
|
|||||||||||
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 |