public class BusNodePlacer extends AbstractRotatableNodePlacer
BusNodePlacer
creates a bus to which all child nodes and the local root node are connected.
The root node is marked
AbstractRotatableNodePlacer.Matrix, AbstractRotatableNodePlacer.RootAlignment
createdChildren, graph, nodeShapeProvider, subtreeShapeProvider
Constructor and Description |
---|
BusNodePlacer()
Creates a new instance of
BusNodePlacer with default settings. |
BusNodePlacer(AbstractRotatableNodePlacer.Matrix modificationMatrix)
Creates a new
BusNodePlacer instance that uses the transformation defined by the given matrix. |
Modifier and Type | Method and Description |
---|---|
Comparator<Object> |
createComparator()
Creates a
Comparator for outgoing edges that takes the rotation into account. |
protected ParentConnectorDirection |
determineChildConnector(Node child)
Determines a connector direction for the given child node.
|
void |
determineChildConnectors(Node localRoot,
IDataMap connectorMap)
Determines connector directions depending on whether or not the child nodes are placed above or below the bus.
|
protected RotatedSubtreeShape |
placeSubtree(Node localRoot,
ParentConnectorDirection parentConnectorDirection)
Places all children of the local root below and above a bus segment that is shared by the edges.
|
createFromSketchComparator, createProcessor, getModificationMatrix, getNodeShape, getPortConstraint, getSourcePointAbs, getSpacing, getSubtreeShape, placeSubtree, setSpacing, translateDirectionToModel, translateDirectionToReal, translatePoint
public BusNodePlacer()
BusNodePlacer
with default settings.public BusNodePlacer(AbstractRotatableNodePlacer.Matrix modificationMatrix)
BusNodePlacer
instance that uses the transformation defined by the given matrix.modificationMatrix
- the transformation matrixpublic Comparator<Object> createComparator()
Comparator
for outgoing edges that takes the rotation into account.
This implementation keeps the current order of edges.
createComparator
in class AbstractRotatableNodePlacer
null
protected ParentConnectorDirection determineChildConnector(Node child)
determineChildConnector
in class AbstractRotatableNodePlacer
IllegalStateException
- if this method is calleddetermineChildConnectors(Node, IDataMap)
.child
- the child nodeINodePlacer
interfacepublic void determineChildConnectors(Node localRoot, IDataMap connectorMap)
When a child node is placed above the bus, the edge should connect north
,
otherwise it should connect south
.
determineChildConnectors
in interface INodePlacer
determineChildConnectors
in class AbstractRotatableNodePlacer
localRoot
- the local rootconnectorMap
- the map that must be used for storing the direction specifiers of the child nodesAbstractRotatableNodePlacer.determineChildConnector(Node)
protected RotatedSubtreeShape placeSubtree(Node localRoot, ParentConnectorDirection parentConnectorDirection)
The bus is located below the local root and the children are placed below this bus or next to the local root.
placeSubtree
in class AbstractRotatableNodePlacer
localRoot
- the local root nodeparentConnectorDirection
- the direction specifier for the connector of the local root node to its parent node