public class GraphMLGroupNode extends AbstractGraphMLNode implements ShapeType, NodeParent
diagram
id
DIAMOND, ELLIPSE, FATARROW, FATARROW2, HEXAGON, OCTAGON, PARALLELOGRAM, PARALLELOGRAM2, RECTANGLE, RECTANGLE3D, ROUNDRECTANGLE, TRIANGLE, TRIANGLE2
Constructor and Description |
---|
GraphMLGroupNode(AbstractGraphMLDiagram diagram,
java.lang.String id)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addChild(IGraphMLNode node)
Adds a child node to the group.
|
GraphMLGroupNode |
addGroupNode()
Adds a child group node to the parent.
|
GraphMLGroupNode |
addGroupNode(java.lang.String id)
Add a group node with a specified id.
|
GraphMLGroupNode |
addGroupNodeFromTemplate(java.lang.String id)
Adds a child group node to the parent.
|
GraphMLGroupNode |
addGroupNodeFromTemplateWithLabel(java.lang.String id,
java.lang.String text)
Adds a child node to the parent, using a template, and with a specified label.
|
GraphMLGroupNode |
addGroupNodeWithLabel(java.lang.String text)
Adds a group node to the parent, and with a specified label.
|
GraphMLNode |
addNode()
Add a node with an id specified automatically.
|
GraphMLNode |
addNode(java.lang.String id)
Add a node with a specified id.
|
GraphMLNode |
addNodeFromTemplate(java.lang.String id)
Add a node with an id specified automatically.
|
GraphMLNode |
addNodeFromTemplateWithLabel(java.lang.String id,
java.lang.String text)
Adds a child node to the parent, using a template, and with a specified label.
|
GraphMLNode |
addNodeWithLabel(java.lang.String text)
Add a node with an id specified automatically, and with a specified label.
|
GraphMLGroupNode |
clone()
Clone the node.
|
void |
computeSize(float groupNodePadding,
boolean recurse)
Compute the size of the group node.
|
void |
computeSize(float groupNodePadding,
boolean realizedState,
boolean recurse)
Compute the size of the node.
|
int |
countGroupNodes()
Return the number of group nodes.
|
int |
countNodes()
Return the number of children nodes.
|
java.util.SortedMap<java.lang.String,IGraphMLNode> |
getChildren()
Return the children nodes.
|
int |
getClosedHeight()
Return the closed height.
|
GroupStateNode |
getClosedStateNode()
Return the closed state node.
|
int |
getClosedWidth()
Return the closed width.
|
GraphMLGroupDiagram |
getGroupDiagram()
Return the sub-diagram of the group.
|
java.util.SortedMap<java.lang.String,GraphMLGroupNode> |
getGroupNodes()
Return the group nodes.
|
short |
getGroupOpenedNodeSizeType()
Return the type which sets how the size of the node will be computed.
|
ShapeNode |
getOpenedShapeNode()
Return the opened shape node.
|
GroupStateNode |
getOpenedStateNode()
Return the opened state node.
|
ShapeNode |
getRealizedShapeNode()
Return the current realized shape node.
|
GroupStateNode |
getRealizedStateNode()
Return the current realized state node.
|
boolean |
getRealizedStateValue() |
GroupStateNode |
getStateNode(boolean stateValue)
Return a state node.
|
java.util.Map<java.lang.Boolean,GroupStateNode> |
getStateNodes()
Return the state nodes.
|
boolean |
hasBorderColor()
Return true if the node has a border color.
|
boolean |
hasFillColor()
Return true if the node has a fill color.
|
boolean |
hasGroupNodes()
Return true if there are group nodes.
|
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 |
setBorderInsets(java.awt.Insets insets)
Set the Insets.
|
void |
setBorderInsets(int value)
Set the border Insets.
|
void |
setBorderStyle(LineStyle borderStyle)
Set the border style.
|
void |
setClosedHeight(int closedHeight)
Set the closed height.
|
void |
setClosedWidth(int closedWidth)
Set the closed width.
|
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 fill color.
|
void |
setGeometry(Geometry geometry)
Set the shape geometry.
|
void |
setGroupOpenedNodeSizeType(short nodeSizeType)
Set the type which sets how the size of the node will be computed.
|
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 |
setHeightPadding(int padding)
Set the height padding for the default autosized property.
|
void |
setInsets(java.awt.Insets insets)
Set the Insets.
|
void |
setInsets(int value)
Set the Insets.
|
void |
setLabel(NodeLabel nodeLabel)
Set the label.
|
NodeLabel |
setLabel(java.lang.String text)
Set the node group label text for both the states.
|
NodeLabel |
setLabel(java.lang.String text,
boolean stateValue)
Set the node group label text for one state.
|
void |
setRealizedStateValue(boolean stateValue) |
void |
setType(short type)
Set the shape type.
|
void |
setWidthPadding(int padding)
Set the width padding for the default autosized property.
|
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
getDiagram
getDescription, getID, getURL, getURLAsString, hasDescription, hasURL, isTemplate, setDescription, setURL, setURL
public GraphMLGroupNode(AbstractGraphMLDiagram diagram, java.lang.String id)
diagram
- the diagramid
- the node idpublic GraphMLGroupDiagram getGroupDiagram()
public void setClosedWidth(int closedWidth)
closedWidth
- the closed widthpublic int getClosedWidth()
public void setClosedHeight(int closedHeight)
closedHeight
- the closed heightpublic int getClosedHeight()
public void setDefaultGeometry()
setDefaultGeometry
in interface IGraphMLNode
public void setGroupOpenedNodeSizeType(short nodeSizeType)
nodeSizeType
- the type which sets how the size of the node will be computedGroupNodeSizeType
public short getGroupOpenedNodeSizeType()
GroupNodeSizeType
public 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 NodeLabel setLabel(java.lang.String text)
public NodeLabel setLabel(java.lang.String text, boolean stateValue)
text
- the label textstateValue
- the state valuepublic java.util.Map<java.lang.Boolean,GroupStateNode> getStateNodes()
public GroupStateNode getClosedStateNode()
public GroupStateNode getOpenedStateNode()
public GroupStateNode getStateNode(boolean stateValue)
stateValue
- the state valuepublic void setRealizedStateValue(boolean stateValue)
public boolean getRealizedStateValue()
public ShapeNode getRealizedShapeNode()
getRealizedShapeNode
in interface IGraphMLNode
public ShapeNode getOpenedShapeNode()
getOpenedShapeNode
in interface IGraphMLNode
public GroupStateNode getRealizedStateNode()
public GraphMLGroupNode clone()
IGraphMLNode
clone
in interface IGraphMLNode
clone
in class AbstractGraphMLNode
protected void setDefaults()
public boolean addChild(IGraphMLNode node)
addChild
in interface NodeParent
node
- the node to addtrue
if the add is successful, and false
otherwisepublic GraphMLNode addNode()
addNode
in interface NodeParent
public GraphMLNode addNodeWithLabel(java.lang.String text)
addNodeWithLabel
in interface NodeParent
text
- the node labelpublic GraphMLNode addNodeFromTemplate(java.lang.String id)
addNodeFromTemplate
in interface NodeParent
id
- tehe template idpublic GraphMLNode addNodeFromTemplateWithLabel(java.lang.String id, java.lang.String text)
addNodeFromTemplateWithLabel
in interface NodeParent
id
- the template idtext
- the node labelpublic GraphMLNode addNode(java.lang.String id)
addNode
in interface NodeParent
id
- the node idpublic GraphMLGroupNode addGroupNode()
addGroupNode
in interface NodeParent
public GraphMLGroupNode addGroupNodeWithLabel(java.lang.String text)
addGroupNodeWithLabel
in interface NodeParent
text
- the group node labelpublic GraphMLGroupNode addGroupNodeFromTemplate(java.lang.String id)
addGroupNodeFromTemplate
in interface NodeParent
id
- the template idpublic GraphMLGroupNode addGroupNodeFromTemplateWithLabel(java.lang.String id, java.lang.String text)
addGroupNodeFromTemplateWithLabel
in interface NodeParent
id
- the template idtext
- the node labelpublic GraphMLGroupNode addGroupNode(java.lang.String id)
addGroupNode
in interface NodeParent
id
- the group node idpublic java.util.SortedMap<java.lang.String,IGraphMLNode> getChildren()
getChildren
in interface NodeParent
public java.util.SortedMap<java.lang.String,GraphMLGroupNode> getGroupNodes()
getGroupNodes
in interface NodeParent
public int countNodes()
countNodes
in interface NodeParent
public int countGroupNodes()
countGroupNodes
in interface NodeParent
public boolean hasGroupNodes()
hasGroupNodes
in interface NodeParent
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 void setBorderStyle(LineStyle borderStyle)
setBorderStyle
in interface ShapeType
borderStyle
- the 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 void setInsets(java.awt.Insets insets)
insets
- the Insetspublic void setInsets(int value)
value
- the value, identical for each insets value (top, bottm, right, left).public void setBorderInsets(java.awt.Insets insets)
insets
- the Insetspublic void setBorderInsets(int value)
value
- the value, identical for each border insets value (top, bottom, right, left).public 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 setAutosized(boolean autosized)
setAutosized
in interface ShapeType
autosized
- true if the node is autosizedpublic void setWidthPadding(int padding)
setWidthPadding
in interface ShapeType
padding
- the paddingpublic void setHeightPadding(int padding)
setHeightPadding
in interface ShapeType
padding
- the paddingpublic void setLabel(NodeLabel nodeLabel)
public void updateLabel()
updateLabel
in interface IGraphMLNode
Copyright © 2021, 2022 Herve Girod. All Rights Reserved. Documentation and source under the BSD 3-Clause licence