public class LayoutContext extends Object implements IElementInfoManager
It provides several methods to access data as well as adding and removing elements.
Modifier and Type | Method and Description |
---|---|
void |
addEdgeLabel(IEdgeLabelLayout label,
Edge labeledElement)
Adds a label to a given edge.
|
void |
addNodeLabel(INodeLabelLayout label,
Node labeledElement)
Adds a label to a given node.
|
Edge |
createEdge(Node source,
Node target,
Object sameDataElementId)
All methods of the
IElementFactory have to use this method to create an
edge. |
Node |
createNode(Object sameDataElementId)
All methods of the
IElementFactory have to use this method to create a node. |
IEdgeInfo |
getEdgeInfo(Edge edge)
Returns the edge information object of the given edge.
|
IEdgeLabelInfo |
getEdgeLabelInfo(IEdgeLabelLayout edgeLabelLayout)
Returns the edge label information object of the given edge label layout.
|
LayoutGraph |
getGraph()
Gets the relevant graph.
|
MultiPageLayout |
getLayout()
Gets the layouter object that belongs to this layout context.
|
INodeInfo |
getNodeInfo(Node node)
Returns the node information object of the given node.
|
INodeLabelInfo |
getNodeLabelInfo(INodeLabelLayout nodeLabelLayout)
Returns the node label layout information object of the given node label layout.
|
Edge |
getOriginalEdge(Object id)
Returns the edge of the input graph with the given ID or
null if there is no such edge. |
Node |
getOriginalNode(Object id)
Returns the node of the input graph with the given ID or
null if there is no such node. |
Edge |
getPageEdge(Object id)
Returns the edge of a page graph (a graph that represents the result of the multi-page layout) with the given ID or
null
if there is no such edge. |
Node |
getPageNode(Object id)
Returns the node of a page graph (a graph that represents the result of the multi-page layout) with the given ID or
null
if there is no such node. |
boolean |
removeEdgeLabel(IEdgeLabelLayout label,
Edge labeledElement)
Removes a label from a given edge.
|
boolean |
removeNodeLabel(INodeLabelLayout label,
Node labeledElement)
Removes a label from a given node.
|
public void addEdgeLabel(IEdgeLabelLayout label, Edge labeledElement)
label
- the label that should be added to the given edgelabeledElement
- the edge to which the label should be addedpublic void addNodeLabel(INodeLabelLayout label, Node labeledElement)
label
- the label that should be added to the given nodelabeledElement
- the node to which the label should be addedpublic Edge createEdge(Node source, Node target, Object sameDataElementId)
IElementFactory
have to use this method to create an
edge.source
- the source of the edgetarget
- the target of the edgesameDataElementId
- the ID of the edge whose data should be copied to the created edge (or null
if no data should be copied)IElementFactory
public Node createNode(Object sameDataElementId)
IElementFactory
have to use this method to create a node.sameDataElementId
- the ID of the node whose data should be copied to the created node (or null
if no data should be copied)IElementFactory
public IEdgeInfo getEdgeInfo(Edge edge)
IElementInfoManager
getEdgeInfo
in interface IElementInfoManager
edge
- the edge for which the information object should be returnedpublic IEdgeLabelInfo getEdgeLabelInfo(IEdgeLabelLayout edgeLabelLayout)
IElementInfoManager
getEdgeLabelInfo
in interface IElementInfoManager
edgeLabelLayout
- the edge label layout for which the information object should be returnedpublic LayoutGraph getGraph()
public MultiPageLayout getLayout()
public INodeInfo getNodeInfo(Node node)
IElementInfoManager
getNodeInfo
in interface IElementInfoManager
node
- the node for which the information object should be returnedpublic INodeLabelInfo getNodeLabelInfo(INodeLabelLayout nodeLabelLayout)
IElementInfoManager
getNodeLabelInfo
in interface IElementInfoManager
nodeLabelLayout
- the node label layout for which the information object should be returnedpublic Edge getOriginalEdge(Object id)
null
if there is no such edge.id
- the ID of the edge that should be returnednull
if there is no such edgepublic Node getOriginalNode(Object id)
null
if there is no such node.id
- the ID of the node that should be returnednull
if there is no such nodepublic Edge getPageEdge(Object id)
null
if there is no such edge.id
- the ID of the edge that should be returnednull
if there is no such edgepublic Node getPageNode(Object id)
null
if there is no such node.id
- the ID of the node that should be returnednull
if there is no such nodepublic boolean removeEdgeLabel(IEdgeLabelLayout label, Edge labeledElement)
label
- the label that should be removedlabeledElement
- the edge owning the labelpublic boolean removeNodeLabel(INodeLabelLayout label, Node labeledElement)
label
- the label that should be removedlabeledElement
- the node owning the label