Package | com.yworks.yfiles.layout.labeling |
Class | public class AbstractLabelingAlgorithm |
Inheritance | AbstractLabelingAlgorithm AbstractLayoutStage YObject Object |
Subclasses | MISLabelingAlgorithm |
Property | Defined By | ||
---|---|---|---|
applyPostprocessing : Boolean
Getter:
Returns true if the postprocessing step is applied. | AbstractLabelingAlgorithm | ||
autoFlippingEnabled : Boolean
Determines whether or not edge labels associated with a "free" label model (see for example y.view.SmartEdgeLabelModel) should be automatically flipped if they would be upside-down. | AbstractLabelingAlgorithm | ||
coreLayouter : Layouter
Specifies the core layouter. | AbstractLayoutStage | ||
edgeGroupOverlapAllowed : Boolean
Getter:
Returns whether edge labels may overlap with edges belonging to the same edge group. | AbstractLabelingAlgorithm | ||
moveInternalNodeLabels : Boolean
Specifies true if the labeling algorithm is allowed to move internal node labels. | AbstractLabelingAlgorithm | ||
placeEdgeLabels : Boolean
Specifies whether labels assigned to edges in a graph should be placed or ignored. | AbstractLabelingAlgorithm | ||
placeNodeLabels : Boolean
Specifies whether labels assigned to nodes in a graph should be placed or ignored. | AbstractLabelingAlgorithm | ||
profitModel : ProfitModel
Sets the profit model that is used to rank the available positions for each label. | AbstractLabelingAlgorithm | ||
rects : YList [read-only]
Returns the set of all generated candidate rectangles. | AbstractLabelingAlgorithm | ||
removeEdgeOverlaps : Boolean
Specifies how label candidates which overlap with edges are handled. | AbstractLabelingAlgorithm | ||
removeNodeOverlaps : Boolean
Specifies how label candidates which overlap with nodes are handled. | AbstractLabelingAlgorithm | ||
selectedLabelsDpKey : Object
Getter:
Returns the labeling selection DataProvider key. | AbstractLabelingAlgorithm | ||
storeRects : Boolean
Specifies whether the candidate rectangles should be stored to be retrieved. | AbstractLabelingAlgorithm | ||
useAlternativeSideHandling : Boolean
Getter:
Returns true if the preference on which side of an edge a corresponding label should be placed is interpreted by human perception instead of always following the edge from source to target. | AbstractLabelingAlgorithm |
Method | Defined By | ||
---|---|---|---|
AbstractLabelingAlgorithm(init:Boolean = true)
Creates a new instance of this class. | AbstractLabelingAlgorithm | ||
canLayout(graph:LayoutGraph):Boolean [override]
Returns true. | AbstractLabelingAlgorithm | ||
doLayout(graph:LayoutGraph):void [override]
Place the labels in the graph. | AbstractLabelingAlgorithm | ||
equals(o:Object):Boolean | YObject | ||
getClass():Class [override] | AbstractLabelingAlgorithm | ||
getProfit(l:LabelCandidate):Number
Returns the profit model that is used to rank the available positions for each label. | AbstractLabelingAlgorithm | ||
hashCode():int | YObject | ||
label(gl:LayoutGraph):void
Place the labels in the graph. | AbstractLabelingAlgorithm | ||
labelSome(gl:LayoutGraph, key:Object):void
Place a subset of the labels. | AbstractLabelingAlgorithm | ||
Place some labels in the graph. | AbstractLabelingAlgorithm |
Method | Defined By | ||
---|---|---|---|
canLayoutCore(graph:LayoutGraph):Boolean
Queries the core layouter whether or not the given graph can be laid out. | AbstractLayoutStage | ||
checkGroupNodeSize(layout:GraphLayout, node:Object):void
This method throws an com.yworks.bridge.util.IllegalArgumentException if the width/height of the given group node object is zero. | AbstractLabelingAlgorithm | ||
checkNodeSize(layout:GraphLayout, node:Object):void
This method throws an com.yworks.bridge.util.IllegalArgumentException if the width/height of the given node object is zero. | AbstractLabelingAlgorithm | ||
doLayoutCore(graph:LayoutGraph):void
Invokes the layout routine of the core layouter. | AbstractLayoutStage | ||
AbstractLabelingAlgorithm | |||
initAbstractLayoutStage1():void | AbstractLayoutStage | ||
initAbstractLayoutStage2(core:Layouter):void | AbstractLayoutStage |
Constant | Defined By | ||
---|---|---|---|
LABEL_MODEL_DPKEY : Object = y.layout.labeling.AbstractLabelingAlgorithm.LABEL_MODEL_DPKEY [static]
com.yworks.yfiles.base.DataProvider key to specify for each com.yworks.yfiles.layout.EdgeLabelLayout s and each com.yworks.yfiles.layout.NodeLabelLayout a replacement com.yworks.yfiles.layout.EdgeLabelModel or com.yworks.yfiles.layout.NodeLabelModel, respectively, that is used by the labeling algorithm instead of the original label model. | AbstractLabelingAlgorithm |
applyPostprocessing | property |
applyPostprocessing:Boolean
Getter: Returns true if the postprocessing step is applied. The postprocessing step tries to further reduce the number of overlaps.
Setter: Sets if the postprocessing step should be applied. The postprocessing step tries to further reduce the number of overlaps. Note: the postprocessing step is only applied to edge labels whose edge label model isFreeEdgeLabelModel
and node labels whose node label model is FreeNodeLabelModel
.
public function get applyPostprocessing():Boolean
public function set applyPostprocessing(value:Boolean):void
autoFlippingEnabled | property |
autoFlippingEnabled:Boolean
Determines whether or not edge labels associated with a "free" label model (see for example y.view.SmartEdgeLabelModel
) should be automatically flipped if they would be upside-down.
By default, this property is set to false
.
public function get autoFlippingEnabled():Boolean
public function set autoFlippingEnabled(value:Boolean):void
edgeGroupOverlapAllowed | property |
edgeGroupOverlapAllowed:Boolean
Getter: Returns whether edge labels may overlap with edges belonging to the same edge group.
Setter: Sets the policy for edge groups. If edge labels overlap with other edges of the same group, this flag decides whether these positions are allowed. public function get edgeGroupOverlapAllowed():Boolean
public function set edgeGroupOverlapAllowed(value:Boolean):void
moveInternalNodeLabels | property |
moveInternalNodeLabels:Boolean
Specifies true if the labeling algorithm is allowed to move internal node labels. A node label is deemed internal if the label's bounds are completely within the node bounds.
public function get moveInternalNodeLabels():Boolean
public function set moveInternalNodeLabels(value:Boolean):void
placeEdgeLabels | property |
placeEdgeLabels:Boolean
Specifies whether labels assigned to edges in a graph should be placed or ignored.
This method has higher priority than a specified selection, that means that all selected edge labels are ignored by this algorithm if this property is set to false
.
public function get placeEdgeLabels():Boolean
public function set placeEdgeLabels(value:Boolean):void
See also
placeNodeLabels | property |
placeNodeLabels:Boolean
Specifies whether labels assigned to nodes in a graph should be placed or ignored.
This method has higher priority than a specified selection, that means that all selected node labels are ignored by this algorithm if this property is set to false
.
public function get placeNodeLabels():Boolean
public function set placeNodeLabels(value:Boolean):void
See also
profitModel | property |
profitModel:ProfitModel
Sets the profit model that is used to rank the available positions for each label. The higher the rank of a position, the more likely it will be chosen by the algorithm. By default an instance of type com.yworks.yfiles.layout.LabelRanking is set.
public function get profitModel():ProfitModel
public function set profitModel(value:ProfitModel):void
See also
rects | property |
rects:YList
[read-only] Returns the set of all generated candidate rectangles.
Debug only.
public function get rects():YList
removeEdgeOverlaps | property |
removeEdgeOverlaps:Boolean
Specifies how label candidates which overlap with edges are handled.
If true
these candidates are not considered, if false
these candidates are considered, but a penalty is assigned to them.
public function get removeEdgeOverlaps():Boolean
public function set removeEdgeOverlaps(value:Boolean):void
removeNodeOverlaps | property |
removeNodeOverlaps:Boolean
Specifies how label candidates which overlap with nodes are handled.
If true
these candidates are not considered, if false
these candidates are considered, but a penalty is assigned to them.
public function get removeNodeOverlaps():Boolean
public function set removeNodeOverlaps(value:Boolean):void
selectedLabelsDpKey | property |
selectedLabelsDpKey:Object
Getter:
Returns the labeling selection DataProvider
key.
DataProvider
key, under which the labeling selection can be retrieved.
The data provider registered with this key has to return true
for labels that should be placed and false
for all other labels.
public function get selectedLabelsDpKey():Object
public function set selectedLabelsDpKey(value:Object):void
storeRects | property |
storeRects:Boolean
Specifies whether the candidate rectangles should be stored to be retrieved.
Debug only.
public function get storeRects():Boolean
public function set storeRects(value:Boolean):void
useAlternativeSideHandling | property |
useAlternativeSideHandling:Boolean
Getter:
Returns true
if the preference on which side of an edge a corresponding label should be placed is interpreted by human perception instead of always following the edge from source to target.
Note: the alternative side handling is only applied to edge labels whose edge label model is FreeEdgeLabelModel
.
public function get useAlternativeSideHandling():Boolean
public function set useAlternativeSideHandling(value:Boolean):void
AbstractLabelingAlgorithm | () | Constructor |
public function AbstractLabelingAlgorithm(init:Boolean = true)
Creates a new instance of this class.
Parametersinit:Boolean (default = true ) — An internally used switch to help handle proper instance initialization in inheritance chains where classes can have multiple constructor-like factory methods.
This parameter can safely be ignored/omitted when calling the constructor.
|
canLayout | () | method |
override public function canLayout(graph:LayoutGraph):Boolean
Returns true
.
Parameters
graph:LayoutGraph |
Boolean |
checkGroupNodeSize | () | method |
protected function checkGroupNodeSize(layout:GraphLayout, node:Object):void
This method throws an com.yworks.bridge.util.IllegalArgumentException if the width/height of the given group node object is zero. It is called by the label-methods for each group node object in the input graph.
Parameters
layout:GraphLayout — a graph layout object.
| |
node:Object — the group node object to test.
|
IllegalArgumentException — thrown if the width/height of the group node object is zero.
|
See also
checkNodeSize | () | method |
protected function checkNodeSize(layout:GraphLayout, node:Object):void
This method throws an com.yworks.bridge.util.IllegalArgumentException if the width/height of the given node object is zero. It is called by the label-methods for each node object in the input graph.
Parameters
layout:GraphLayout — a graph layout object.
| |
node:Object — the node object to test.
|
IllegalArgumentException — thrown if the width/height of the node object is zero.
|
See also
doLayout | () | method |
override public function doLayout(graph:LayoutGraph):void
Place the labels in the graph.
This method is equivalent to the label()
method.
Parameters
graph:LayoutGraph — The graph to label.
|
getClass | () | method |
override public function getClass():Class
ReturnsClass |
getProfit | () | method |
public function getProfit(l:LabelCandidate):Number
Returns the profit model that is used to rank the available positions for each label. The higher the rank of a position, the more likely it will be chosen by the algorithm. By default an instance of type com.yworks.yfiles.layout.LabelRanking is set.
Parameters
l:LabelCandidate |
Number |
See also
initAbstractLabelingAlgorithm | () | method |
protected final function initAbstractLabelingAlgorithm():void
label | () | method |
public function label(gl:LayoutGraph):void
Place the labels in the graph.
Parameters
gl:LayoutGraph — The graph to label.
|
labelSome | () | method |
public function labelSome(gl:LayoutGraph, key:Object):void
Place a subset of the labels.
Parameters
gl:LayoutGraph | |
key:Object — The key for a DataProvider in gl . Labels which should be placed return true .
|
labelSome2 | () | method |
public function labelSome2(gl:LayoutGraph, nodeLabels:YList, edgeLabels:YList):void
Place some labels in the graph. The selection is ignored, if set.
Parameters
gl:LayoutGraph | |
nodeLabels:YList | |
edgeLabels:YList |
LABEL_MODEL_DPKEY | Constant |
public static const LABEL_MODEL_DPKEY:Object = y.layout.labeling.AbstractLabelingAlgorithm.LABEL_MODEL_DPKEY
com.yworks.yfiles.base.DataProvider key to specify for each com.yworks.yfiles.layout.EdgeLabelLayout s and each com.yworks.yfiles.layout.NodeLabelLayout a replacement com.yworks.yfiles.layout.EdgeLabelModel or com.yworks.yfiles.layout.NodeLabelModel, respectively, that is used by the labeling algorithm instead of the original label model. If this key is not defined or if a label has no mapping, the original model is used as normal. Otherwise, a model parameter that fits the calculated position of the replacement model best is set for the original model.
This feature is especially useful to restrict a free model. For example, to place a label upon its associated edge, a centered com.yworks.yfiles.layout.RotatedSliderEdgeLabelLayoutModel can be used a replacement model.See also