|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkaapo.Observable
kaapo.project.ProjectComponent
kaapo.project.Diagram
public abstract class Diagram
Diagram is a collection of related elements and connections. This class maintains a list of diagram component wrappers. Diagram is an abstract base class that concrete diagram types (such as UMLClassDiagram) must extend.
Diagram components (instances of Element and Connection) are not added to a diagram as themselves. Rathes, they are wrapped into diagram component wrappers and the wrappers are added to the diagram. This way, a element or connection can belong to several diagrams or even belong to the same diagram several times.
DiagramComponentWrapper
,
Serialized FormNested Class Summary | |
---|---|
static class |
Diagram.ObservableMessage
|
Field Summary | |
---|---|
protected Vector<DiagramComponentWrapper> |
dcwList
|
protected String |
name
|
protected DiagramPanel |
panel
|
protected ProjectManager |
pm
|
Fields inherited from class kaapo.project.ProjectComponent |
---|
attributeMap, attributePanel |
Constructor Summary | |
---|---|
Diagram()
Constructs a diagram with null name. |
|
Diagram(String name)
Constructs a diagram with given name. |
Method Summary | |
---|---|
void |
addComponent(DiagramComponentWrapper dcw)
Adds a diagram component wrapper to the diagram. |
boolean |
containsDiagramComponent(DiagramComponent diagramComponent)
Tells whether given diagram component is present in the diagram. |
Vector<DiagramComponentWrapper> |
getDiagramComponentWrappers()
Returns the list of DiagramComponentWrappers. |
DiagramPanel |
getDiagramPanel(ProjectManager pm)
Gets the diagram panel for this diagram. |
abstract List<Class> |
getLegalDiagramConnections()
Returns the list of connection classes that may legally be added to this diagram type. |
abstract List<Class> |
getLegalDiagramElements()
Returns the list of element classes that may legally be added to this diagram type. |
String |
getName()
Gets the diagram name. |
boolean |
removeComponent(DiagramComponentWrapper dcw)
Removes the diagram component wrapper from the diagram. |
void |
replaceDiagramComponentWrappers(Vector<DiagramComponentWrapper> newList)
Replaces the current list of DiagramComponentWrappers with another one. |
void |
setName(String name)
Sets the diagram name. |
Methods inherited from class kaapo.project.ProjectComponent |
---|
addAttribute, addAttribute, buildAttributePanel, getAttribute, getAttributeMap, getAttributePanel, getSmallIcon, getTypeName, hasAttribute, removeAttribute, setAttribute |
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, toString, wait, wait, wait |
Field Detail |
---|
protected Vector<DiagramComponentWrapper> dcwList
protected String name
protected transient DiagramPanel panel
protected transient ProjectManager pm
Constructor Detail |
---|
public Diagram()
public Diagram(String name)
name
- Diagram nameMethod Detail |
---|
public abstract List<Class> getLegalDiagramElements()
public abstract List<Class> getLegalDiagramConnections()
public String getName()
public void setName(String name)
name
- The new name.public Vector<DiagramComponentWrapper> getDiagramComponentWrappers()
public void replaceDiagramComponentWrappers(Vector<DiagramComponentWrapper> newList)
newList
- new list of Wrappers.public void addComponent(DiagramComponentWrapper dcw) throws IllegalArgumentException
dcw
- The wrapper to be added
IllegalArgumentException
- If the wrapper already
belongs to the diagram. If you want to add several "instances"
of the component, create several wrappers and add them
separately.public boolean removeComponent(DiagramComponentWrapper dcw)
dcw
- The wrapper to be removed.
public boolean containsDiagramComponent(DiagramComponent diagramComponent)
diagramComponent
- The diagram component to be tested
public DiagramPanel getDiagramPanel(ProjectManager pm)
pm
- The project manager that manages this project.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |