|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.common.notify.impl.AdapterImpl
org.jupe.editors.classdiagram.model.ModelElement
org.jupe.editors.classdiagram.model.nodes.NodeModelElement
public abstract class NodeModelElement
NodeModelElement is an abstract class for all possible nodes in the model: package, classes etc.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter |
---|
org.eclipse.emf.common.notify.Adapter.Internal |
Field Summary | |
---|---|
static java.lang.String |
CHILD_ADDED_PROP
PropertyId used to fire an event when a child is added to this diagram. |
static java.lang.String |
CHILD_REMOVED_PROP
PropertyId used to fire an event when a child is removed from this diagram. |
static java.lang.String |
CONNECTIONS_PROP
Property ID used to fire an event when either an outgoing or incoming connection is modified. |
static java.lang.String |
LOCATION_PROP
PropertyId used to fire an event when the location of this node is modified. |
static java.lang.String |
SIZE_PROP
PropertyId used to fire an event when the size of this node is modified. |
static java.lang.String |
SOURCE_CONNECTIONS_PROP
Property ID used to fire an event when the list of outgoing connections is modified. |
static java.lang.String |
TARGET_CONNECTIONS_PROP
Property ID used to fire an event when the list of incoming connections is modified. |
Fields inherited from class org.jupe.editors.classdiagram.model.ModelElement |
---|
GENERAL_CHANGE_PROP |
Constructor Summary | |
---|---|
NodeModelElement()
Default constructor. |
Method Summary | |
---|---|
boolean |
addChild(NodeModelElement child)
Adds a child to the NodeModelElement. |
void |
addConnection(ConnectionElement conn)
Add an incoming or outgoing connection to this shape. |
void |
addToHash(org.eclipse.uml2.uml.Element uml2Element,
NodeModelElement modelElement)
Add a new element and its corresponding uml2 element to the hash. |
java.util.Set<NodeModelElement> |
getAllChildren()
Returns a list with all children including recursively the children of the children etc. |
java.util.List<NodeModelElement> |
getChildren()
|
ClassDiagram |
getClassDiagram()
Get the class diagram that contains this element. |
org.eclipse.draw2d.geometry.Point |
getLocation()
This method should be used to get the location of a NodeModelElement. |
NodeModelElement |
getParent()
|
java.lang.Object |
getPropertyValue(java.lang.Object propertyId)
Children should override this. |
org.eclipse.draw2d.geometry.Dimension |
getSize()
|
java.util.List<ConnectionElement> |
getSourceConnections()
|
java.util.List<ConnectionElement> |
getTargetConnections()
|
boolean |
isPropertySet(java.lang.Object propertyId)
Children should override this. |
void |
notifyChanged(org.eclipse.emf.common.notify.Notification notification)
The ModelElement does not handle all types of notifications only ADD and REMOVE. |
boolean |
removeChild(NodeModelElement child)
Remove a given child from the NodeModelElement. |
void |
removeConnection(ConnectionElement connection)
Remove an incoming or outgoing connection from this shape. |
void |
removeFromHash(org.eclipse.uml2.uml.Element uml2Element)
Remove an element from the hash table, that contains all elements and their corresponding uml2 elements. |
boolean |
removeFromModel()
Removes this element and all its children from the model. |
void |
resetPropertyValue(java.lang.Object propertyId)
Children should override this. |
void |
setLocation(org.eclipse.draw2d.geometry.Point newLocation)
Set the location for a NodeModelElement. |
void |
setPropertyValue(java.lang.Object propertyId,
java.lang.Object value)
Children should override this. |
void |
setSize(org.eclipse.draw2d.geometry.Dimension newSize)
Set the size of a NodeModelElement. |
void |
setSourceConnections(java.util.List<ConnectionElement> newSourceConnections)
Sets the list of all ConnectionElement which have this NodeModelElements as source. |
void |
setTargetConnections(java.util.List<ConnectionElement> newTargetConnections)
Sets the list of all ConnectionElement which have this NodeModelElements as targets. |
Methods inherited from class org.jupe.editors.classdiagram.model.ModelElement |
---|
addPropertyChangeListener, getEditableValue, getPropertyDescriptors, getUML2Element, removePropertyChangeListener, setUML2Element |
Methods inherited from class org.eclipse.emf.common.notify.impl.AdapterImpl |
---|
getTarget, isAdapterForType, setTarget, unsetTarget |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CHILD_ADDED_PROP
public static final java.lang.String CHILD_REMOVED_PROP
public static final java.lang.String LOCATION_PROP
public static final java.lang.String SIZE_PROP
public static final java.lang.String CONNECTIONS_PROP
public static final java.lang.String SOURCE_CONNECTIONS_PROP
public static final java.lang.String TARGET_CONNECTIONS_PROP
Constructor Detail |
---|
public NodeModelElement()
Method Detail |
---|
public org.eclipse.draw2d.geometry.Point getLocation()
public void setLocation(org.eclipse.draw2d.geometry.Point newLocation)
newLocation
- of the NodeModelElementpublic org.eclipse.draw2d.geometry.Dimension getSize()
public void setSize(org.eclipse.draw2d.geometry.Dimension newSize)
newSize
- of the NodeModelElementpublic void addConnection(ConnectionElement conn)
conn
- a non-null connection instance
java.lang.IllegalArgumentException
- if the connection is null or has not distinct endpointspublic void removeConnection(ConnectionElement connection)
connection
- a non-null connection instancepublic void setSourceConnections(java.util.List<ConnectionElement> newSourceConnections)
newSourceConnections
- a list of new source connectionspublic void setTargetConnections(java.util.List<ConnectionElement> newTargetConnections)
newTargetConnections
- a list of new target connectionspublic java.util.List<ConnectionElement> getSourceConnections()
public java.util.List<ConnectionElement> getTargetConnections()
public void setPropertyValue(java.lang.Object propertyId, java.lang.Object value)
ModelElement
setPropertyValue
in interface org.eclipse.ui.views.properties.IPropertySource
setPropertyValue
in class ModelElement
eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object,
java.lang.Object)
public void resetPropertyValue(java.lang.Object propertyId)
ModelElement
resetPropertyValue
in interface org.eclipse.ui.views.properties.IPropertySource
resetPropertyValue
in class ModelElement
IPropertySource.resetPropertyValue(java.lang.Object)
public java.lang.Object getPropertyValue(java.lang.Object propertyId)
ModelElement
getPropertyValue
in interface org.eclipse.ui.views.properties.IPropertySource
getPropertyValue
in class ModelElement
eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)
public boolean isPropertySet(java.lang.Object propertyId)
ModelElement
isPropertySet
in interface org.eclipse.ui.views.properties.IPropertySource
isPropertySet
in class ModelElement
eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
public boolean addChild(NodeModelElement child)
child
- to add
public java.util.List<NodeModelElement> getChildren()
public NodeModelElement getParent()
public ClassDiagram getClassDiagram()
getClassDiagram
in class ModelElement
public boolean removeChild(NodeModelElement child)
child
- to remove
public boolean removeFromModel()
public java.util.Set<NodeModelElement> getAllChildren()
public void notifyChanged(org.eclipse.emf.common.notify.Notification notification)
AddAdapter
for details. All
implementations in the subclasses should call this super method to handle
ADD and REMOVE. It is also necessary to verify that the
handleNotifications variable is set to true to avoid notifications for
each call of setPropertyValue().
notifyChanged
in interface org.eclipse.emf.common.notify.Adapter
notifyChanged
in class ModelElement
Adapter.notifyChanged(org.eclipse.emf.common.notify.Notification)
public void addToHash(org.eclipse.uml2.uml.Element uml2Element, NodeModelElement modelElement)
uml2Element
- modelElement
- public void removeFromHash(org.eclipse.uml2.uml.Element uml2Element)
uml2Element
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |