public interface IDiagramNode extends IDiagramGraphic
Modifier and Type | Interface and Description |
---|---|
static class |
IDiagramNode.Role
Role of a node within its
parent node . |
Modifier and Type | Method and Description |
---|---|
void |
fitToContent()
Resize this diagram node to fit its content.
|
Rectangle |
getBounds()
Return the node location and size as a Rectangle.
|
MObject |
getElement()
Get the element this
IDiagramGraphic is related to. |
java.lang.String |
getFillColor()
Get the current fill color.
|
int |
getFillMode()
Get the current fill mode.
|
IDiagramNode |
getFirstNode(IDiagramNode.Role role)
Get the first child node with the given role.
|
java.lang.String |
getFont()
Get the current font, represented by font data.
|
java.lang.String |
getLineColor()
Get the current line color.
|
int |
getLineWidth()
Get the current line width.
|
java.util.List<IDiagramNode> |
getNodes()
Return the list of children nodes of this node.
|
java.util.Collection<IDiagramNode> |
getNodes(IDiagramNode.Role role)
Get the child nodes with the given role.
|
Rectangle |
getOverallBounds()
Return the location and size as a Rectangle for the node, including its satellites.
|
IDiagramGraphic |
getParent() |
int |
getRepresentationMode()
Get the current representation mode.
|
java.lang.String |
getTextColor()
Get the current text color.
|
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 |
setBounds(Rectangle newBounds)
This method changes both the location and the size of a node by changing its current bounds.
|
void |
setFillColor(java.lang.String value)
Modify the current fill color.
|
void |
setFillMode(int value)
Modify the current fill mode
|
void |
setFont(java.lang.String value)
Modify the current font.
|
void |
setLineColor(java.lang.String value)
Modify the current line color.
|
void |
setLineWidth(int value)
Modify the current line width.
|
boolean |
setLocation(int x,
int y)
Change the location of the node, setting its new position to (x,y).
|
void |
setRepresentationMode(int value)
Modify the current representation mode.
|
boolean |
setSize(int width,
int height)
Change the size of the node to (width,height).
|
void |
setTextColor(java.lang.String value)
Modify the current text color.
|
getFromLinks, getHyperLink, getLayer, getLocalPropertyNames, getName, getProperty, getStyle, getToLinks, moveToLayer, normalizeLocalProperties, resetLocalProperties, setHyperLink, setProperty, setStyle
void fitToContent()
Rectangle getBounds()
MObject getElement()
IDiagramGraphic
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..
getElement
in interface IDiagramGraphic
java.lang.String getFillColor()
null
if the corresponding style key isn't defined.int getFillMode()
IDiagramNode getFirstNode(IDiagramNode.Role role)
To be used when you know at most one element matches the role.
role
- the asked rolejava.lang.String getFont()
A valid font data representation is a string of the form
where
is the name of a font,
is a font style (one of
"regular"
, "bold"
,
"italic"
, or "bold italic"
)
and
is an integer representing the
font height. Example: Times New Roman-bold-36
.
null
if the corresponding style key isn't defined.java.lang.String getLineColor()
null
if the corresponding style key isn't defined.int getLineWidth()
java.util.List<IDiagramNode> getNodes()
java.util.Collection<IDiagramNode> getNodes(IDiagramNode.Role role)
role
- the asked roleRectangle getOverallBounds()
When no satellites are displayed, returns the same value as getBounds().
IDiagramGraphic getParent()
int getRepresentationMode()
java.lang.String getTextColor()
null
if the corresponding style key isn't defined.boolean isPrimarySelected()
IDiagramGraphic
isPrimarySelected
in interface IDiagramGraphic
true
if the graphical element is the primary selection of the diagram.boolean isSelected()
IDiagramGraphic
isSelected
in interface IDiagramGraphic
true
if the graphical element is selected in the diagram.void mask()
IDiagramGraphic
mask
in interface IDiagramGraphic
void setBounds(Rectangle newBounds)
newBounds
- the new node boundsvoid setFillColor(java.lang.String value)
value
- The new fill color.void setFillMode(int value)
value
- The new fill mode.void setFont(java.lang.String value) throws DataFormatException
This method fails if the value does not represent font data.
A valid font data representation is a string of the form
where
is the name of a font,
is a font style (one of
"regular"
, "bold"
,
"italic"
, or "bold italic"
)
and
is an integer representing the
font height. Example: Times New Roman-bold-36
.
value
- The new font.DataFormatException
- if the given value does not represent font datavoid setLineColor(java.lang.String value)
value
- The new line color.void setLineWidth(int value)
value
- The new line width.boolean setLocation(int x, int y)
x
- the new X positiony
- the new Y positionvoid setRepresentationMode(int value)
value
- The new representation mode.boolean setSize(int width, int height)
width
- the new widthheight
- the new heightvoid setTextColor(java.lang.String value)
value
- The new text color.