Package | com.yworks.yfiles.layout |
Interface | public interface LabelLayoutFactory |
ClassCastException
s. An instance of the factory can be obtained with method com.yworks.yfiles.layout.LayoutTool.getLabelFactory(). This method uses the added protected com.yworks.yfiles.layout.LayoutGraph.createLabelFactory() method to create the factory.
Note that each factory instance is bound to a specific graph instance, i.e., you can only create, add and remove labels for the graph specified in method getLabelFactory (com.yworks.yfiles.layout.LayoutTool.getLabelFactory()).
See also
Property | Defined By | ||
---|---|---|---|
graph : LayoutGraph [read-only]
Returns the graph associated with this label factory instance. | LabelLayoutFactory |
Method | Defined By | ||
---|---|---|---|
Adds the given edge label layout to the given edge. | LabelLayoutFactory | ||
Adds the given node label layout to the given node. | LabelLayoutFactory | ||
Creates a new label layout for the given edge. | LabelLayoutFactory | ||
createEdgeLabelLayoutWithModel(edge:Edge, orientedBox:YOrientedRectangle, model:EdgeLabelModel, descriptor:PreferredPlacementDescriptor):EdgeLabelLayout
Creates a new label layout for the given edge. | LabelLayoutFactory | ||
Creates a new label layout for the given node. | LabelLayoutFactory | ||
createNodeLabelLayoutWithModel(node:Node, orientedBox:YOrientedRectangle, model:NodeLabelModel):NodeLabelLayout
Creates a new label layout for the given node. | LabelLayoutFactory | ||
Removes the given edge label layout from the given edge. | LabelLayoutFactory | ||
Removes the given node label layout from the given node. | LabelLayoutFactory |
graph | property |
graph:LayoutGraph
[read-only] Returns the graph associated with this label factory instance.
public function get graph():LayoutGraph
addEdgeLabelLayout | () | method |
public function addEdgeLabelLayout(edge:Edge, labelLayout:EdgeLabelLayout):void
Adds the given edge label layout to the given edge. The given label layout has to be created with method createEdgeLabelLayout() or createEdgeLabelLayoutWithModel().
Note, implementations of this method must ensure that re-adding temporarily removed original labels during buffered layout calculations (com.yworks.yfiles.layout.BufferedLayouter) automatically restores the original order of labels at the given edge. Otherwise the layout calculation will most likely produce incorrect results or break down with ClassCastException
s.
Parameters
edge:Edge — the given edge.
| |
labelLayout:EdgeLabelLayout — the edge label layout that should be added to the given edge.
|
IllegalArgumentException — if the given label layout has already been added to the graph.
|
See also
addNodeLabelLayout | () | method |
public function addNodeLabelLayout(node:Node, labelLayout:NodeLabelLayout):void
Adds the given node label layout to the given node. The given label layout has to be created with method createNodeLabelLayout() or createNodeLabelLayoutWithModel().
Note, implementations of this method must ensure that re-adding temporarily removed original labels during buffered layout calculations (com.yworks.yfiles.layout.BufferedLayouter) automatically restores the original order of labels at the given node. Otherwise the layout calculation will most likely produce incorrect results or break down with ClassCastException
s.
Parameters
node:Node — the given node.
| |
labelLayout:NodeLabelLayout — the node label layout that should be added to the given node.
|
IllegalArgumentException — if the given label layout has already been added to the graph.
|
See also
createEdgeLabelLayout | () | method |
public function createEdgeLabelLayout(edge:Edge, orientedBox:YOrientedRectangle):EdgeLabelLayout
Creates a new label layout for the given edge. Note that calling this method has no effect on the edge's labels. The returned label layout has to be added to the edge using method addEdgeLabelLayout().
This method should create a label layout with a com.yworks.yfiles.layout.EdgeLabelModel that supports the desired oriented label box exactly as given.
Parameters
edge:Edge — the given edge.
| |
orientedBox:YOrientedRectangle — the box specifying the size and location of the label.
|
EdgeLabelLayout — a new edge label layout.
|
See also
createEdgeLabelLayoutWithModel | () | method |
public function createEdgeLabelLayoutWithModel(edge:Edge, orientedBox:YOrientedRectangle, model:EdgeLabelModel, descriptor:PreferredPlacementDescriptor):EdgeLabelLayout
Creates a new label layout for the given edge. Note that calling this method has no effect on the edge's labels. The returned label layout has to be added to the edge using method addEdgeLabelLayout().
Note that the oriented box associated with the created edge label layout (see method com.yworks.yfiles.layout.EdgeLabelLayout.orientedBox) may differ from the given oriented box, i.e., the box associated with the label layout corresponds to the closest box (with respect to the given box) that is valid in the specified edge label model.
Parameters
edge:Edge — the given edge.
| |
orientedBox:YOrientedRectangle — the box specifying the size and location of the label.
| |
model:EdgeLabelModel — specifies the model of the created edge label.
| |
descriptor:PreferredPlacementDescriptor — specifies the preferred placement descriptor of the created label. If this value is null , the default descriptor is used.
|
EdgeLabelLayout — a new edge label layout.
|
See also
createNodeLabelLayout | () | method |
public function createNodeLabelLayout(node:Node, orientedBox:YOrientedRectangle):NodeLabelLayout
Creates a new label layout for the given node. Note that calling this method has no effect on the node's labels. The returned label layout has to be added to the node using method addNodeLabelLayout().
This method should create a label layout with a com.yworks.yfiles.layout.NodeLabelModel that supports the desired oriented label box exactly as given.
Parameters
node:Node — the given node.
| |
orientedBox:YOrientedRectangle — the box specifying the size and location of the label.
|
NodeLabelLayout — a new node label layout.
|
See also
createNodeLabelLayoutWithModel | () | method |
public function createNodeLabelLayoutWithModel(node:Node, orientedBox:YOrientedRectangle, model:NodeLabelModel):NodeLabelLayout
Creates a new label layout for the given node. Note that calling this method has no effect on the node's labels. The returned label layout has to be added to the node using method addNodeLabelLayout().
Note that the oriented box associated with the created node label layout (see method com.yworks.yfiles.layout.NodeLabelLayout.orientedBox) may differ from the given oriented box, i.e., the box associated with the label layout corresponds to the closest box (with respect to the given box) that is valid in the specified node label model.
Parameters
node:Node — the given node.
| |
orientedBox:YOrientedRectangle — the box specifying the size and location of the label.
| |
model:NodeLabelModel — specifies the model of the created node label.
|
NodeLabelLayout — a new node label layout.
|
See also
removeEdgeLabelLayout | () | method |
public function removeEdgeLabelLayout(edge:Edge, labelLayout:EdgeLabelLayout):void
Removes the given edge label layout from the given edge.
Note that original labels which are removed during a layout calculation have to be re-added when the layout calculation is done. Otherwise buffered layout calculations (com.yworks.yfiles.layout.BufferedLayouter) and delayed layout results (com.yworks.yfiles.layout.LayoutTool.applyGraphLayout()) will most likely produce incorrect results or break down with ClassCastException
s.
Parameters
edge:Edge — the given edge.
| |
labelLayout:EdgeLabelLayout — the label layout that should be removed from the given edge.
|
See also
removeNodeLabelLayout | () | method |
public function removeNodeLabelLayout(node:Node, labelLayout:NodeLabelLayout):void
Removes the given node label layout from the given node.
Note that original labels which are removed during a layout calculation have to be re-added when the layout calculation is done. Otherwise buffered layout calculations (com.yworks.yfiles.layout.BufferedLayouter) and delayed layout results (com.yworks.yfiles.layout.LayoutTool.applyGraphLayout()) will most likely produce incorrect results or break down with ClassCastException
s.
Parameters
node:Node — the given node.
| |
labelLayout:NodeLabelLayout — the label layout that should be removed from the given node.
|
See also