Package | com.yworks.yfiles.layout.transformer |
Class | public class GraphTransformer |
Inheritance | GraphTransformer CanonicMultiStageLayouter YObject Object |
Implements | LayoutStage |
Here is an sample output of the layouter that rotated the inner nine nodes of the grid by 45 degrees.
Property | Defined By | ||
---|---|---|---|
bestFitRotationEnabled : Boolean
Getter:
Returns whether or not the best fit rotation angle will be applied. | GraphTransformer | ||
componentLayouter : LayoutStage
Specifies the LayoutStage responsible for laying out the connected components of the graph. | CanonicMultiStageLayouter | ||
componentLayouterEnabled : Boolean [override]
Getter:
Returns whether or not ComponentLayouter is enabled. | GraphTransformer | ||
coreLayouter : Layouter | GraphTransformer | ||
groupNodeHider : LayoutStage
Specifies the LayoutStage that is responsible for hiding away grouping information for the layout algorithm. | CanonicMultiStageLayouter | ||
hideGroupNodes : Boolean
Specifies whether or not to hide away group nodes before the layout begins. | CanonicMultiStageLayouter | ||
labelLayouter : LayoutStage
Getter:
Returns the algorithm used for placing labels. | CanonicMultiStageLayouter | ||
labelLayouterEnabled : Boolean
Getter:
Returns whether or not LabelLayouter is enabled. | CanonicMultiStageLayouter | ||
layoutOrientation : int
Specifies the main layout orientation. | CanonicMultiStageLayouter | ||
operation : int
Specifies the transformation operation this layouter performs. | GraphTransformer | ||
orientationLayouter : LayoutStage
Specifies the LayoutStage that is responsible for changing the orientation of the computed layout. | CanonicMultiStageLayouter | ||
orientationLayouterEnabled : Boolean
Getter:
Returns whether or not the OrientationLayouter is enabled. | CanonicMultiStageLayouter | ||
parallelEdgeLayouter : LayoutStage
Getter:
Returns the LayoutStage responsible for routing parallel edges. | CanonicMultiStageLayouter | ||
parallelEdgeLayouterEnabled : Boolean
Getter:
Returns whether or not the ParallelEdgeLayouter is enabled. | CanonicMultiStageLayouter | ||
rotationAngle : Number
Specifies the angle of rotation. | GraphTransformer | ||
scaleFactor : Number [write-only]
Sets the uniform scaling factor used for the SCALE operation. | GraphTransformer | ||
scaleFactorX : Number [read-only]
Returns the scaling factor used for the x-coordinate. | GraphTransformer | ||
scaleFactorY : Number [read-only]
Returns the scaling factor used for the y-coordinate. | GraphTransformer | ||
scaleNodeSize : Boolean
Getter:
Returns whether or not to scale node sizes. | GraphTransformer | ||
selfLoopLayouter : LayoutStage
Getter:
Returns the LayoutStage used for routing Self-loops. | CanonicMultiStageLayouter | ||
selfLoopLayouterEnabled : Boolean
Getter:
Returns whether or not the SelfLoopLayouter is enabled. | CanonicMultiStageLayouter | ||
subgraphLayouter : LayoutStage
Specifies the LayoutStage that is responsible for constraining the layout process to a subgraph of the target graph. | CanonicMultiStageLayouter | ||
subgraphLayouterEnabled : Boolean
Getter:
Returns whether or not the SubgraphLayouter is enabled. | CanonicMultiStageLayouter | ||
translateX : Number
Specifies the horizontal translation distance. | GraphTransformer | ||
translateY : Number
Specifies the vertical translation distance. | GraphTransformer |
Method | Defined By | ||
---|---|---|---|
GraphTransformer(init:Boolean = true)
Creates a new instance of graph transformer. | GraphTransformer | ||
appendStage(stage:LayoutStage):void
Appends a stage to the layout pipeline. | CanonicMultiStageLayouter | ||
applyBestFitRotationAngle(graph:LayoutGraph, width:Number, height:Number):Number [static]
Performs a rotation of the given graph such that its resulting bounding box (approximately) fits best to the given area bounds. | GraphTransformer | ||
Returns a layout for the given layout graph. | CanonicMultiStageLayouter | ||
Returns a layout for the given graph interface and layout. | CanonicMultiStageLayouter | ||
canLayout(graph:LayoutGraph):Boolean
Tests whether or not the given graph can be laid out by this layouter. | CanonicMultiStageLayouter | ||
canLayoutCore(graph:LayoutGraph):Boolean [override]
Returns always true. | GraphTransformer | ||
doLayout(layoutGraph:LayoutGraph):void
Calculates a layout for the given graph. | CanonicMultiStageLayouter | ||
Calculates a layout for the given graph interface and layout. | CanonicMultiStageLayouter | ||
doLayoutCore(graph:LayoutGraph):void [override]
Performs the selected transformation. | GraphTransformer | ||
enableOnlyCore():void
Disables all layout stages and performs only the core layouter. | CanonicMultiStageLayouter | ||
equals(o:Object):Boolean | YObject | ||
findBestFitRotationAngle(graph:LayoutGraph, width:Number, height:Number):Number [static]
Returns a rotation angle that, if applied to the given graph, would minimize the zoom-level needed to display the graph in an area of the given dimension. | GraphTransformer | ||
getClass():Class [override] | GraphTransformer | ||
hashCode():int | YObject | ||
[static]
Creates a new instance of graph transformer. | GraphTransformer | ||
prependStage(stage:LayoutStage):void
Prepends a stage to the layout pipeline. | CanonicMultiStageLayouter | ||
removeStage(stage:LayoutStage):void
Removes a LayoutStage that has been previously added by the methods appendStage() or prependStage(). | CanonicMultiStageLayouter | ||
[static]
Scales the coordinates of the given graph in such a way that the resulting bounding box of the graph approximately equals the bounds of the given rectangle. | GraphTransformer | ||
setMaximalBounds(graph:LayoutGraph, x:Number, y:Number, w:Number, h:Number):void [static]
Assures that the given graph fits into the given rectangular bounds. | GraphTransformer | ||
setPreferedLayoutSize(width:Number, height:Number):void
Sets the preferred layout size for this layouter. | GraphTransformer | ||
setScaleFactors(xFactor:Number, yFactor:Number):void
Sets the scaling factors for the x-coordinates and y-coordinates used for the SCALE operation. | GraphTransformer | ||
translate(g:LayoutGraph, dx:Number, dy:Number):void [static]
Translates the layout coordinates by the vector (dx,dy). | GraphTransformer |
Method | Defined By | ||
---|---|---|---|
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. | CanonicMultiStageLayouter | ||
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. | CanonicMultiStageLayouter | ||
CanonicMultiStageLayouter | |||
initGraphTransformer():void
Initializes this object. | GraphTransformer |
Constant | Defined By | ||
---|---|---|---|
MIRROR_XAXIS : int = 0 [static]
Operation type constant. | GraphTransformer | ||
MIRROR_YAXIS : int = 1 [static]
Operation type constant. | GraphTransformer | ||
ROTATE : int = 2 [static]
Operation type constant. | GraphTransformer | ||
SCALE : int = 3 [static]
Operation type constant. | GraphTransformer | ||
TRANSLATE : int = 4 [static]
Operation type constant. | GraphTransformer |
bestFitRotationEnabled | property |
bestFitRotationEnabled:Boolean
Getter: Returns whether or not the best fit rotation angle will be applied.
Setter: Set whether or not to choose a best fit rotation angle instead of the one set by rotationAngle. Also, to apply the best fit rotation angle, the operation type of this layouter must be set to ROTATE.Use setPreferedLayoutSize() to specify the preferred aspect ratio of the resulting layout.
public function get bestFitRotationEnabled():Boolean
public function set bestFitRotationEnabled(value:Boolean):void
See also
componentLayouterEnabled | property |
componentLayouterEnabled:Boolean
[override] Getter: Returns whether or not ComponentLayouter is enabled. By default it is disabled.
Setter: Specifies whether or not to enable the ComponentLayouter. By default it is disabled. public function get componentLayouterEnabled():Boolean
public function set componentLayouterEnabled(value:Boolean):void
coreLayouter | property |
coreLayouter:Layouter
public function get coreLayouter():Layouter
public function set coreLayouter(value:Layouter):void
operation | property |
operation:int
Specifies the transformation operation this layouter performs.
By default the SCALE
operation is set.
public function get operation():int
public function set operation(value:int):void
See also
rotationAngle | property |
rotationAngle:Number
Specifies the angle of rotation.
The angle must be given in degrees. This feature is only meaningful for the ROTATE
operation.
By default the rotation angle is 0.0
.
public function get rotationAngle():Number
public function set rotationAngle(value:Number):void
scaleFactor | property |
scaleFactor:Number
[write-only]
Sets the uniform scaling factor used for the SCALE
operation.
By default the scaling factor is set to 1.0
public function set scaleFactor(value:Number):void
scaleFactorX | property |
scaleFactorX:Number
[read-only] Returns the scaling factor used for the x-coordinate.
public function get scaleFactorX():Number
scaleFactorY | property |
scaleFactorY:Number
[read-only] Returns the scaling factor used for the y-coordinate.
public function get scaleFactorY():Number
scaleNodeSize | property |
scaleNodeSize:Boolean
Getter: Returns whether or not to scale node sizes.
Setter: Specifies whether or not to scale node sizes when performing theSCALE
operation.
By default this feature is disabled.
public function get scaleNodeSize():Boolean
public function set scaleNodeSize(value:Boolean):void
translateX | property |
translateX:Number
Specifies the horizontal translation distance.
A positive value means the graph is moved to the right; a negative value means the graph is moved to the left. Defaults to 0
.
public function get translateX():Number
public function set translateX(value:Number):void
See also
translateY | property |
translateY:Number
Specifies the vertical translation distance.
A positive value means the graph is moved downwards; a negative value means the graph is moved upwards. Defaults to 0
.
public function get translateY():Number
public function set translateY(value:Number):void
See also
GraphTransformer | () | Constructor |
public function GraphTransformer(init:Boolean = true)
Creates a new instance of graph transformer.
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.
|
applyBestFitRotationAngle | () | method |
public static function applyBestFitRotationAngle(graph:LayoutGraph, width:Number, height:Number):Number
Performs a rotation of the given graph such that its resulting bounding box (approximately) fits best to the given area bounds.
Parameters
graph:LayoutGraph | |
width:Number | |
height:Number |
Number |
canLayoutCore | () | method |
override public function canLayoutCore(graph:LayoutGraph):Boolean
Returns always true
.
Parameters
graph:LayoutGraph |
Boolean |
doLayoutCore | () | method |
override public function doLayoutCore(graph:LayoutGraph):void
Performs the selected transformation.
Parameters
graph:LayoutGraph |
findBestFitRotationAngle | () | method |
public static function findBestFitRotationAngle(graph:LayoutGraph, width:Number, height:Number):Number
Returns a rotation angle that, if applied to the given graph, would minimize the zoom-level needed to display the graph in an area of the given dimension.
Parameters
graph:LayoutGraph | |
width:Number | |
height:Number |
Number |
getClass | () | method |
override public function getClass():Class
ReturnsClass |
initGraphTransformer | () | method |
protected final function initGraphTransformer():void
Initializes this object. See the documentation of the corresponding factory method newGraphTransformer()
for details.
See also
newGraphTransformer | () | method |
public static function newGraphTransformer():GraphTransformer
Creates a new instance of graph transformer.
ReturnsGraphTransformer |
scaleToRect | () | method |
public static function scaleToRect(g:LayoutGraph, rect:Rectangle):Vector.<Number>
Scales the coordinates of the given graph in such a way that the resulting bounding box of the graph approximately equals the bounds of the given rectangle.
Note that this operation won't have any effects, if there is only one node in the graph or if there are nodes that are bigger than the requested bounding box size.
The x- and y-scaling factors are returned in a double array of size 2. The first value of the array is the x-scaling factor that has was used and the second value is the y-scaling factor.
Parameters
g:LayoutGraph | |
rect:Rectangle |
Vector.<Number> |
setMaximalBounds | () | method |
public static function setMaximalBounds(graph:LayoutGraph, x:Number, y:Number, w:Number, h:Number):void
Assures that the given graph fits into the given rectangular bounds. If the bounding box fits in the rectangle, nothing is done. Otherwise the graph is scaled and optionally moved to fit. This algorithm does not modify the node's sizes. Note that this operation won't have any effects, if there are nodes that are bigger than the requested bounding box size.
Parameters
graph:LayoutGraph — the graph to modify
| |
x:Number — the upper left x coordinate of the bounds
| |
y:Number — the upper left y coordinate of the bounds
| |
w:Number — the width of the bounds
| |
h:Number — the height of the bounds
|
setPreferedLayoutSize | () | method |
public function setPreferedLayoutSize(width:Number, height:Number):void
Sets the preferred layout size for this layouter.
Parameters
width:Number | |
height:Number |
setScaleFactors | () | method |
public function setScaleFactors(xFactor:Number, yFactor:Number):void
Sets the scaling factors for the x-coordinates and y-coordinates used for the SCALE
operation.
By default the scaling factors are set to 1.0
Parameters
xFactor:Number | |
yFactor:Number |
translate | () | method |
public static function translate(g:LayoutGraph, dx:Number, dy:Number):void
Translates the layout coordinates by the vector (dx,dy)
.
Parameters
g:LayoutGraph | |
dx:Number | |
dy:Number |
MIRROR_XAXIS | Constant |
public static const MIRROR_XAXIS:int = 0
Operation type constant. Specifies that the graph should be mirrored along the x-axis.
See also
MIRROR_YAXIS | Constant |
public static const MIRROR_YAXIS:int = 1
Operation type constant. Specifies that the graph should be mirrored along the y-axis.
See also
ROTATE | Constant |
public static const ROTATE:int = 2
Operation type constant. Specifies that the graph should be rotated.
See also
SCALE | Constant |
public static const SCALE:int = 3
Operation type constant. Specifies that the graph should be scaled.
See also
TRANSLATE | Constant |
public static const TRANSLATE:int = 4
Operation type constant. Specifies that the graph should be translated.
See also