|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.stanford.hci.dtools.statechart.model.ModelElement edu.stanford.hci.dtools.statechart.model.ShapeModel
public abstract class ShapeModel
Abstract prototype of a shape. Has a size (width and height), a location (x and y position) and a list of incoming and outgoing connections. Use subclasses to instantiate a specific shape.
This software is distributed under the BSD License.
This code is partially based on code that is copyright (c) 2004 Elias Volanakis. See License.txt
,
Serialized FormField Summary | |
---|---|
static java.lang.String |
DIAGRAM_PROP
Property ID to use when a Diagram Model is attached to this shape |
static java.lang.String |
LOCATION_PROP
Property ID to use when the location of this shape is modified. |
static java.lang.String |
SIZE_PROP
Property ID to use then the size of this shape is modified. |
static java.lang.String |
SOURCE_CONNECTIONS_PROP
Property ID to use when the list of outgoing connections is modified. |
static java.lang.String |
TARGET_CONNECTIONS_PROP
Property ID to use when the list of incoming connections is modified. |
Constructor Summary | |
---|---|
ShapeModel()
|
Method Summary | |
---|---|
static org.eclipse.swt.graphics.Image |
createImage(java.lang.String name)
How to get an image out of a local project directory |
DiagramModel |
getDiagramModel()
Retrieve the DiagramModel that this shape is a child of. |
abstract org.eclipse.swt.graphics.Image |
getIcon()
Return a pictogram (small icon) describing this model element. |
org.eclipse.draw2d.geometry.Point |
getLocation()
Return the Location of this shape. |
org.eclipse.ui.views.properties.IPropertyDescriptor[] |
getPropertyDescriptors()
Returns an array of IPropertyDescriptors for this shape. |
java.lang.Object |
getPropertyValue(java.lang.Object propertyId)
Return the property value for the given propertyId, or null. |
org.eclipse.draw2d.geometry.Dimension |
getSize()
Return the Size of this shape. |
java.util.List<ConnectionModel> |
getSourceConnections()
Return a List of outgoing Connections. |
java.util.List<ConnectionModel> |
getTargetConnections()
Return a List of incoming Connections. |
void |
setDiagramModel(DiagramModel newDiagram)
Sets the diagram associated with this shape. |
void |
setLocation(org.eclipse.draw2d.geometry.Point newLocation)
Set the Location of this shape. |
void |
setPropertyValue(java.lang.Object propertyId,
java.lang.Object value)
Set the property value for the given property id. |
void |
setSize(org.eclipse.draw2d.geometry.Dimension newSize)
Set the Size of this shape. |
Methods inherited from class edu.stanford.hci.dtools.statechart.model.ModelElement |
---|
addPropertyChangeListener, getEditableValue, isPropertySet, removePropertyChangeListener, resetPropertyValue |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String LOCATION_PROP
public static final java.lang.String SIZE_PROP
public static final java.lang.String DIAGRAM_PROP
public static final java.lang.String SOURCE_CONNECTIONS_PROP
public static final java.lang.String TARGET_CONNECTIONS_PROP
Constructor Detail |
---|
public ShapeModel()
Method Detail |
---|
public static org.eclipse.swt.graphics.Image createImage(java.lang.String name)
public abstract org.eclipse.swt.graphics.Image getIcon()
public org.eclipse.draw2d.geometry.Point getLocation()
public org.eclipse.ui.views.properties.IPropertyDescriptor[] getPropertyDescriptors()
The returned array is used to fill the property view, when the edit-part corresponding to this model element is selected.
getPropertyDescriptors
in interface org.eclipse.ui.views.properties.IPropertySource
getPropertyDescriptors
in class ModelElement
descriptors
,
getPropertyValue(Object)
,
setPropertyValue(Object, Object)
public java.lang.Object getPropertyValue(java.lang.Object propertyId)
The property view uses the IDs from the IPropertyDescriptors array to obtain the value of the corresponding properties.
getPropertyValue
in interface org.eclipse.ui.views.properties.IPropertySource
getPropertyValue
in class ModelElement
descriptors
,
getPropertyDescriptors()
public org.eclipse.draw2d.geometry.Dimension getSize()
public java.util.List<ConnectionModel> getSourceConnections()
public java.util.List<ConnectionModel> getTargetConnections()
public void setLocation(org.eclipse.draw2d.geometry.Point newLocation)
newLocation
- a non-null Point instance
java.lang.IllegalArgumentException
- if the parameter is nullpublic void setPropertyValue(java.lang.Object propertyId, java.lang.Object value)
The property view uses the IDs from the IPropertyDescriptors array to set the values of the corresponding properties.
setPropertyValue
in interface org.eclipse.ui.views.properties.IPropertySource
setPropertyValue
in class ModelElement
descriptors
,
getPropertyDescriptors()
public void setSize(org.eclipse.draw2d.geometry.Dimension newSize)
newSize
- a non-null Dimension instance or nullpublic DiagramModel getDiagramModel()
public void setDiagramModel(DiagramModel newDiagram)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |