public class GraphMLNode extends AbstractGraphMLNode implements LabeledElement, java.lang.Cloneable
diagram
id
DIAMOND, ELLIPSE, FATARROW, FATARROW2, HEXAGON, OCTAGON, PARALLELOGRAM, PARALLELOGRAM2, RECTANGLE, RECTANGLE3D, ROUNDRECTANGLE, TRIANGLE, TRIANGLE2
Constructor and Description |
---|
GraphMLNode(AbstractGraphMLDiagram diagram,
java.lang.String id)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
GraphMLNode |
clone()
Clone the node.
|
void |
computeSize(float groupNodePadding,
boolean recurse)
Do nothing.
|
void |
computeSize(float groupNodePadding,
boolean realizedState,
boolean recurse)
Compute the size of the node.
|
NodeLabel |
createLabel(boolean createIfExist)
Create the node associated label.
|
float |
getHeight()
Return the height.
|
NodeLabel |
getLabel()
Return the node associated label.
|
java.lang.String |
getLabelText()
Return the element label text.
|
ShapeNode |
getOpenedShapeNode()
Return the shape node.
|
ShapeNode |
getRealizedShapeNode()
Return the shape node.
|
ShapeNode |
getShapeNode()
Return the shape node.
|
float |
getWidth()
Return the width.
|
float |
getX()
Return the x position.
|
float |
getY()
Return the y position.
|
boolean |
hasBorderColor()
Return true if the node has a border color.
|
boolean |
hasFillColor()
Return true if the node has a fill color.
|
boolean |
isAutosized()
Return true if the node is automatically sized depending on the node label.
|
void |
setAutosized(boolean autosized)
Set if the node is automatically sized depending on the node label.
|
boolean |
setBorderColor(java.lang.String borderColor)
Set the border color.
|
void |
setBorderStyle(LineStyle borderStyle)
Set the node border style.
|
void |
setDefaultGeometry()
Set the default geometry.
|
protected void |
setDefaults()
Set the defaults.
|
void |
setDropShadow(DropShadow dropShadow)
Set the node drop shadow.
|
boolean |
setFillColor(java.awt.Color fillColor)
Set the text color.
|
boolean |
setFillColor(java.lang.String fillColor)
Set the node fill color.
|
void |
setGeometry(Geometry geometry)
Set the shape geometry.
|
void |
setHasBorderColor(boolean hasBorderColor)
Set if the node has a border color.
|
void |
setHasFillColor(boolean hasFillColor)
Set if the node has a fill color.
|
void |
setHeight(float height)
A shortcut to set the height.
|
void |
setHeightPadding(int padding)
Set the height padding for the default autosized property.
|
void |
setLabel(NodeLabel nodeLabel)
Set the label.
|
NodeLabel |
setLabel(java.lang.String text)
Set the element label text.
|
void |
setShapeNode(ShapeNode shape)
Set the shape node.
|
void |
setType(short type)
Set the shape type.
|
void |
setWidth(float width)
A shortcut to set the width.
|
void |
setWidthPadding(int padding)
Set the width padding for the default autosized property.
|
void |
setX(float x)
A shortcut to set the x position.
|
void |
setY(float y)
A shortcut to set the y position.
|
void |
updateLabel()
Called when the label is updated.
|
addEdgeFrom, addEdgeTo, addFromEdge, addToEdge, computeSize, getDiagram, getFromEdges, getParent, getToEdges, repatriate, repatriate, setFromPortConstraint, setFromPortConstraint, setId, setParent, setToPortConstraint, setToPortConstraint
getDescription, getID, getURL, getURLAsString, hasURL, setDescription, setURL, setURL
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createLabelPlacement, getLabelPlacement
getDescription, getID, getURL, getURLAsString, hasDescription, hasURL, isTemplate, setDescription, setURL, setURL
public GraphMLNode(AbstractGraphMLDiagram diagram, java.lang.String id)
diagram
- the diagramid
- the node idpublic void setAutosized(boolean autosized)
setAutosized
in interface ShapeType
autosized
- true if the node is autosizedpublic boolean isAutosized()
public GraphMLNode clone()
IGraphMLNode
clone
in interface IGraphMLNode
clone
in class AbstractGraphMLNode
protected void setDefaults()
public void setDefaultGeometry()
setDefaultGeometry
in interface IGraphMLNode
public void setType(short type)
public void setShapeNode(ShapeNode shape)
shape
- the shape nodepublic void computeSize(float groupNodePadding, boolean realizedState, boolean recurse)
computeSize
in interface IGraphMLNode
groupNodePadding
- the padding between nodes used for computing group node sizesrealizedState
- true for the state for which to compute the sizerecurse
- recurse on children nodespublic void computeSize(float groupNodePadding, boolean recurse)
computeSize
in interface IGraphMLNode
groupNodePadding
- the padding between nodes used for computing group node sizesrecurse
- recurse on children nodespublic ShapeNode getOpenedShapeNode()
getOpenedShapeNode
in interface IGraphMLNode
public ShapeNode getRealizedShapeNode()
getRealizedShapeNode
in interface IGraphMLNode
public ShapeNode getShapeNode()
public void setX(float x)
x
- the x positionpublic float getX()
public void setY(float y)
y
- the y positionpublic float getY()
public void setWidth(float width)
width
- the widthpublic float getWidth()
public void setHeight(float height)
height
- the heightpublic float getHeight()
public void setWidthPadding(int padding)
setWidthPadding
in interface ShapeType
padding
- the paddingpublic void setHeightPadding(int padding)
setHeightPadding
in interface ShapeType
padding
- the paddingpublic void setGeometry(Geometry geometry)
setGeometry
in interface ShapeType
geometry
- the geometrypublic void setDropShadow(DropShadow dropShadow)
setDropShadow
in interface ShapeType
dropShadow
- the node drop shadowpublic void setBorderStyle(LineStyle borderStyle)
setBorderStyle
in interface ShapeType
borderStyle
- the node border stylepublic boolean setBorderColor(java.lang.String borderColor)
setBorderColor
in interface ShapeType
borderColor
- the colorpublic void setHasBorderColor(boolean hasBorderColor)
setHasBorderColor
in interface ShapeType
hasBorderColor
- true if the node has a border colorpublic boolean hasBorderColor()
hasBorderColor
in interface ShapeType
public boolean setFillColor(java.awt.Color fillColor)
setFillColor
in interface ShapeType
fillColor
- the colorpublic boolean setFillColor(java.lang.String fillColor)
setFillColor
in interface ShapeType
fillColor
- the colorpublic void setHasFillColor(boolean hasFillColor)
setHasFillColor
in interface ShapeType
hasFillColor
- true if the node has a fill colorpublic boolean hasFillColor()
hasFillColor
in interface ShapeType
public NodeLabel getLabel()
getLabel
in interface LabeledElement
public NodeLabel createLabel(boolean createIfExist)
createLabel
in interface LabeledElement
createIfExist
- true if a new label will be created even if it already existspublic NodeLabel setLabel(java.lang.String text)
public void setLabel(NodeLabel nodeLabel)
public void updateLabel()
updateLabel
in interface IGraphMLNode
updateLabel
in interface LabeledElement
public java.lang.String getLabelText()
getLabelText
in interface LabeledElement
Copyright © 2021, 2022 Herve Girod. All Rights Reserved. Documentation and source under the BSD 3-Clause licence