|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkaapo.Observable
kaapo.project.Project
public class Project
Composite class that contains all diagrams, elements and connections of a project. This class is the starting point for working with the project.
Project maintains the following data structures:
Nested Class Summary | |
---|---|
static class |
Project.ObservableMessage
|
Constructor Summary | |
---|---|
Project()
Constructs the project with null name. |
|
Project(String name)
Constructs the project with given name. |
Method Summary | |
---|---|
DiagramWrapper |
addDiagram(Diagram diagram,
DiagramWrapper parent,
DiagramWrapper prevSibling)
Adds the diagram to the project and the project tree and creates a new DiagramWrapper
for it. |
boolean |
addDiagram(DiagramWrapper dw,
DiagramWrapper parent,
DiagramWrapper prevSibling)
Adds the DiagramWrapper to the project
and the project tree. |
void |
addDiagramComponent(DiagramComponent diagramComponent)
Adds the diagram component (element or connection) to the project. |
boolean |
containsProjectComponent(ProjectComponent projectComponent)
Tells whether given diagram, element or connection is part of the project. |
List<Diagram> |
getDiagrams()
Gets list of all Diagram instances in the project. |
List<DiagramWrapper> |
getDiagramWrappers()
Gets the list of top-level diagram wrappers in the diagram tree. |
String |
getName()
Gets the name of the project. |
boolean |
removeDiagram(Diagram diagram)
Removes the diagram completely from the project, including all diagram wrappers associated to it. |
boolean |
removeDiagramComponent(DiagramComponent diagramComponent)
Removes the diagram component from the project. |
boolean |
removeDiagramWrapper(DiagramWrapper diagramWrapper)
Removes diagram wrapper from the tree; also removes the diagram itself if it is no longer in any diagram wrapper. |
void |
setName(String name)
Sets the name of the project. |
String |
toString()
|
Methods inherited from class kaapo.Observable |
---|
addObserver, notifyObservers, notifyObservers, removeAllObservers, removeObserver, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Project()
public Project(String name)
name
- Project nameMethod Detail |
---|
public String getName()
public void setName(String name)
name
- The new namepublic DiagramWrapper addDiagram(Diagram diagram, DiagramWrapper parent, DiagramWrapper prevSibling)
DiagramWrapper
for it.
diagram
- The diagram to be added.parent
- Parent of the new diagram in the tree. If
the new diagram gets added to the first level of the
tree, parent must be null.prevSibling
- In the diagram tree, the diagram
wrapper that will precede the new diagram. The new
diagram will be added after the prevSibling. If the
diagram will be the first child of its parent,
prevSibling must be null.
public boolean addDiagram(DiagramWrapper dw, DiagramWrapper parent, DiagramWrapper prevSibling)
DiagramWrapper
to the project
and the project tree.
dw
- The DiagramWrapper
to be added.parent
- Parent of the new diagram in the tree. If
the new diagram gets added to the first level of the
tree, parent must be null.prevSibling
- In the diagram tree, the diagram
wrapper that will precede the new diagram. The new
diagram will be added after the prevSibling. If the
diagram will be the first child of its parent,
prevSibling must be null.
IllegalArgumentException
- If prevSibling
is not found in the treepublic boolean removeDiagram(Diagram diagram)
diagram
-
public boolean removeDiagramWrapper(DiagramWrapper diagramWrapper)
diagramWrapper
- The diagram wrapper to be removed
public List<Diagram> getDiagrams()
public List<DiagramWrapper> getDiagramWrappers()
public void addDiagramComponent(DiagramComponent diagramComponent)
diagramComponent
- The component to be added.public boolean removeDiagramComponent(DiagramComponent diagramComponent)
diagramComponent
-
public boolean containsProjectComponent(ProjectComponent projectComponent)
projectComponent
- Project component to be tested
for membership.
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |