org.argouml.uml.diagram.ui
Class UMLDiagram
java.lang.Object
|
+--org.tigris.gef.base.Diagram
|
+--org.argouml.ui.ArgoDiagram
|
+--org.argouml.uml.diagram.ui.UMLDiagram
- All Implemented Interfaces:
- java.util.EventListener, org.tigris.gef.graph.GraphListener, ru.novosoft.uml.MElementListener, java.io.Serializable
- Direct Known Subclasses:
- UMLActivityDiagram, UMLClassDiagram, UMLCollaborationDiagram, UMLDeploymentDiagram, UMLSequenceDiagram, UMLStateDiagram, UMLUseCaseDiagram
- public abstract class UMLDiagram
- extends ArgoDiagram
- implements ru.novosoft.uml.MElementListener
This class provides support for writing a UML diagram for argo using
the GEF framework.
It adds common buttons, a namespace, capability
to delete itself when its namespace is deleted, some help
with creating a valid diagram name.
- See Also:
- Serialized Form
Fields inherited from class org.tigris.gef.base.Diagram |
_comments, _lay, _name, _toolBar, vetoListeners |
Constructor Summary |
UMLDiagram()
|
UMLDiagram(ru.novosoft.uml.foundation.core.MNamespace ns)
|
UMLDiagram(java.lang.String diagramName,
ru.novosoft.uml.foundation.core.MNamespace ns)
|
Method Summary |
java.lang.String |
getClassAndModelID()
|
ru.novosoft.uml.foundation.core.MNamespace |
getNamespace()
|
ru.novosoft.uml.foundation.core.MModelElement |
getOwner()
|
org.tigris.gef.ui.ToolBar |
getToolBar()
Get the toolbar for the diagram |
void |
initialize(java.lang.Object owner)
|
void |
initToolBar()
This is a template method. |
protected abstract void |
initToolBar(javax.swing.JToolBar toolbar)
Implement on the ancestor to populate the toolbar with diagram specific buttons. |
void |
listRoleItemSet(ru.novosoft.uml.MElementEvent e)
not used the UMLDiagram is only interested in the removed() event. |
void |
propertySet(ru.novosoft.uml.MElementEvent e)
not used the UMLDiagram is only interested in the removed() event. |
void |
recovered(ru.novosoft.uml.MElementEvent e)
not used the UMLDiagram is only interested in the removed() event. |
void |
removed(ru.novosoft.uml.MElementEvent e)
This diagram listens to events from is namespace ModelElement;
When the modelelement is removed, we also want to delete this diagram too.
|
void |
roleAdded(ru.novosoft.uml.MElementEvent e)
not used the UMLDiagram is only interested in the removed() event. |
void |
roleRemoved(ru.novosoft.uml.MElementEvent e)
not used the UMLDiagram is only interested in the removed() event. |
void |
setName(java.lang.String n)
|
void |
setNamespace(ru.novosoft.uml.foundation.core.MNamespace m)
sets the namespace of the Diagram, and
adds the diagram as a listener of its namspace in the UML model.
(so that it can delete itself when the model element is deleted). |
Methods inherited from class org.tigris.gef.base.Diagram |
add, addVetoableChangeListener, bringForward, bringToFront, countContained, edgeAdded, edgeRemoved, elements, elementsIn, fireVetoableChange, fireVetoableChange, fireVetoableChange, getComments, getGraphController, getGraphModel, getLayer, getName, graphChanged, hit, nodeAdded, nodeRemoved, postLoad, postSave, preSave, presentationFor, remove, removeAll, removeVetoableChangeListener, reorder, sendBackward, sendToBack, setComments, setGraphModel, setLayer, setToolBar |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cat
protected static org.apache.log4j.Category cat
_actionSelect
protected static javax.swing.Action _actionSelect
_actionBroom
protected static javax.swing.Action _actionBroom
_actionRectangle
protected static javax.swing.Action _actionRectangle
_actionRRectangle
protected static javax.swing.Action _actionRRectangle
_actionCircle
protected static javax.swing.Action _actionCircle
_actionLine
protected static javax.swing.Action _actionLine
_actionText
protected static javax.swing.Action _actionText
_actionPoly
protected static javax.swing.Action _actionPoly
_actionSpline
protected static javax.swing.Action _actionSpline
_actionInk
protected static javax.swing.Action _actionInk
_namespace
protected ru.novosoft.uml.foundation.core.MNamespace _namespace
_diagramName
protected DiagramInfo _diagramName
UMLDiagram
public UMLDiagram()
UMLDiagram
public UMLDiagram(ru.novosoft.uml.foundation.core.MNamespace ns)
UMLDiagram
public UMLDiagram(java.lang.String diagramName,
ru.novosoft.uml.foundation.core.MNamespace ns)
initialize
public void initialize(java.lang.Object owner)
- Overrides:
initialize
in class ArgoDiagram
- Following copied from class:
org.argouml.ui.ArgoDiagram
- See Also:
Diagram.initialize(Object)
getNamespace
public ru.novosoft.uml.foundation.core.MNamespace getNamespace()
setNamespace
public void setNamespace(ru.novosoft.uml.foundation.core.MNamespace m)
- sets the namespace of the Diagram, and
adds the diagram as a listener of its namspace in the UML model.
(so that it can delete itself when the model element is deleted).
getClassAndModelID
public java.lang.String getClassAndModelID()
- Overrides:
getClassAndModelID
in class org.tigris.gef.base.Diagram
getOwner
public ru.novosoft.uml.foundation.core.MModelElement getOwner()
setName
public void setName(java.lang.String n)
throws java.beans.PropertyVetoException
- Overrides:
setName
in class ArgoDiagram
getToolBar
public org.tigris.gef.ui.ToolBar getToolBar()
- Get the toolbar for the diagram
- Overrides:
getToolBar
in class org.tigris.gef.base.Diagram
- Returns:
- the diagram toolbar
initToolBar
public void initToolBar()
- This is a template method. It sets up the standard toolbar buttons
required for all diagram toolbars calling the abstract method
initToolBar(JToolBar) which should be implemented on the ancestor
to populate the toolbar with diagram specific buttons.
- Overrides:
initToolBar
in class org.tigris.gef.base.Diagram
- See Also:
Diagram.initToolBar()
initToolBar
protected abstract void initToolBar(javax.swing.JToolBar toolbar)
- Implement on the ancestor to populate the toolbar with diagram specific buttons.
- Parameters:
toolbar
- The toolbar to populate with buttons
removed
public void removed(ru.novosoft.uml.MElementEvent e)
- This diagram listens to events from is namespace ModelElement;
When the modelelement is removed, we also want to delete this diagram too.
There is also a risk that if this diagram was the one shown in the
diagram panel, then it will remain after it has been deleted. so
we need to deselect this diagram.
- Specified by:
removed
in interface ru.novosoft.uml.MElementListener
propertySet
public void propertySet(ru.novosoft.uml.MElementEvent e)
- not used the UMLDiagram is only interested in the removed() event.
- Specified by:
propertySet
in interface ru.novosoft.uml.MElementListener
roleAdded
public void roleAdded(ru.novosoft.uml.MElementEvent e)
- not used the UMLDiagram is only interested in the removed() event.
- Specified by:
roleAdded
in interface ru.novosoft.uml.MElementListener
roleRemoved
public void roleRemoved(ru.novosoft.uml.MElementEvent e)
- not used the UMLDiagram is only interested in the removed() event.
- Specified by:
roleRemoved
in interface ru.novosoft.uml.MElementListener
listRoleItemSet
public void listRoleItemSet(ru.novosoft.uml.MElementEvent e)
- not used the UMLDiagram is only interested in the removed() event.
- Specified by:
listRoleItemSet
in interface ru.novosoft.uml.MElementListener
recovered
public void recovered(ru.novosoft.uml.MElementEvent e)
- not used the UMLDiagram is only interested in the removed() event.
- Specified by:
recovered
in interface ru.novosoft.uml.MElementListener