public interface IDiagramGraphic
Base interface of all graphical elements.
A IDiagramGraphic may be a node (IDiagramNode
) or a link (IDiagramLink
).
A graphic element may be related to an MObject
model.
The element might not exist any longer (IDiagramGraphic#getElement returns null
), meaning the graphical element is a "ghost".
Therefore, the only information still available are the Name of the ghost element, and its MRef.
Modifier and Type | Method and Description |
---|---|
MObject |
getElement()
Get the element this
IDiagramGraphic is related to. |
java.util.List<IDiagramLink> |
getFromLinks()
Return the links that are starting (ie outgoing links) from this node.
|
MObject |
getHyperLink()
For graphics that may have an hyper link to a model object, get the linked object.
|
IDiagramLayer |
getLayer()
Get the layer this graphic belongs to.
|
java.util.List<java.lang.String> |
getLocalPropertyNames()
Get the list of all properties which values have been changed from their default "style" value.
|
java.lang.String |
getName()
Return the name of this graphic.
|
java.lang.String |
getProperty(java.lang.String property)
Get a style property.
The resolution of the property values follows this algorithm: return the local redefinition of the property if it exists. otherwise, go to the graphical owner and return its local redefinition of the property if it exists. when no local redefinition is found, the default value comes from the style of the element. when no style value is found, the extended style are checked. lastly, if no style defines a value, Modelio gives a default "factory value". Might return null if the corresponding style key isn't defined. |
IStyleHandle |
getStyle()
Get the graphical element style.
|
java.util.List<IDiagramLink> |
getToLinks()
Return the links that are ending (ie incoming links) at this node.
|
boolean |
isPrimarySelected()
Returns the selected state of this graphical element.
|
boolean |
isSelected()
Returns the selected state of this graphical element.
|
void |
mask()
Mask the current representation.
|
void |
moveToLayer(IDiagramLayer newLayer)
Move the graphic to another layer.
|
void |
normalizeLocalProperties()
Normalizing an element's style consists in removing from its local definitions the values that are currently the same as the value in cascaded style.
|
void |
resetLocalProperties()
Removes all local property redefinitions.
|
void |
setHyperLink(MObject obj)
For graphics that may have an hyper link to a model object, set the linked object.
|
void |
setProperty(java.lang.String property,
java.lang.String value)
Sets the local property value of this graphic element for 'property'.
|
void |
setStyle(IStyleHandle style)
Set the style used to get a property value when it is not defined locally.
|
MObject getElement()
IDiagramGraphic
is related to.
Note: May return null if the element is not resolved. or the graphic does not represent a model element, such as diagram drawings..
java.util.List<IDiagramLink> getFromLinks()
MObject getHyperLink()
Returns null for graphics that cannot have hyper-link to a model object.
IDiagramLayer getLayer()
java.util.List<java.lang.String> getLocalPropertyNames()
null
.java.lang.String getName()
java.lang.String getProperty(java.lang.String property)
null
if the corresponding style key isn't defined.property
- The property nameIStyleHandle getStyle()
The style contains many properties such has the foreground and background color, the font and some display options. These properties are displayed and editable in the symbol view.
null
if the graphical element has no proper style but references the owner diagram's style.java.util.List<IDiagramLink> getToLinks()
boolean isPrimarySelected()
true
if the graphical element is the primary selection of the diagram.boolean isSelected()
true
if the graphical element is selected in the diagram.void mask()
void moveToLayer(IDiagramLayer newLayer) throws java.lang.IllegalArgumentException
The new layer must be compatible with the old one.
newLayer
- the new layerjava.lang.IllegalArgumentException
- if the new layer is not compatible with the graphic.void normalizeLocalProperties()
void resetLocalProperties()
void setHyperLink(MObject obj)
Has no effect on a graphic that cannot have hyper-link to a model object.
obj
- the linked model object or null.void setProperty(java.lang.String property, java.lang.String value)
property
- The property namevalue
- The property valuevoid setStyle(IStyleHandle style)
style
- The new style. Use null
to reference the owner diagram's style.