|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.LabelLayoutTranslator
public class LabelLayoutTranslator
Layout stage that automatically translates label layout information provided by the standard
label layout classes EdgeLabelLayout
and NodeLabelLayout
to layout data
of type LabelLayoutData
that is accessible by the keys defined in class LabelLayoutKeys
.
HierarchicLayouter
. This can be done by
assigning the stage by an appropriate call to
setLabelLayouter
.
Note that care must be taken on the choice of label model that is used by the
classes EdgeLabelLayout
and NodeLabelLayout
. The calculated label positions
must be consistent with the label positions allowed by the label model. The best label layout
results are achieved by choosing FreeEdgeLabelModel
for edge layouts and
FreeNodeLabelModel
for node layouts.
Field Summary |
---|
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
LabelLayoutTranslator()
Creates a new instance of LabelLayoutTranslator. |
Method Summary | |
---|---|
boolean |
canLayout(LayoutGraph graph)
The returned result gets calculated by the core layouter. |
void |
doLayout(LayoutGraph graph)
Before invoking the core layouter this stage translates traditional label layout information to data provider based label layout data. |
Layouter |
getCoreLayouter()
Returns the core layouter. |
boolean |
isAutoFlippingEnabled()
Determines whether or not this stage should automatically flip edge label content depending on the label's rotation angle. |
boolean |
isResettingEdgeLabelOrientation()
Returns whether or not to reset the orientation of edge labels. |
boolean |
isResettingNodeLabelOrientation()
Returns whether or not to reset the orientation of node labels. |
boolean |
isTranslateEdgeLabelsEnabled()
Returns whether edge label translation is enabled. |
boolean |
isTranslateNodeLabelsEnabled()
Returns whether node label translation is enabled. |
boolean |
isWriteBackEdgeLabelsEnabled()
Returns whether edge labels are written back to their model. |
boolean |
isWriteBackNodeLabelsEnabled()
Returns whether node labels are written back to their model. |
void |
setAutoFlippingEnabled(boolean enabled)
Specifies whether or not this stage should automatically flip edge label content depending on the label's rotation angle. |
void |
setCoreLayouter(Layouter core)
Sets the core layouter. |
void |
setResettingEdgeLabelOrientation(boolean resettingEdgeLabelOrientation)
Whether or not to reset the orientation of edge labels. |
void |
setResettingNodeLabelOrientation(boolean resettingNodeLabelOrientation)
Whether or not to reset the orientation of node labels. |
void |
setTranslateEdgeLabelsEnabled(boolean translateEdgeLabelsEnabled)
Determines whether edge label translation should be enabled. |
void |
setTranslateNodeLabelsEnabled(boolean translateNodeLabelsEnabled)
Determines whether node label translation should be enabled. |
void |
setWriteBackEdgeLabelsEnabled(boolean writeBack)
Determines whether edge label information is written back to the model. |
void |
setWriteBackNodeLabelsEnabled(boolean writeBack)
Determines whether node label information is written back to the model. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LabelLayoutTranslator()
Method Detail |
---|
public void setCoreLayouter(Layouter core)
LayoutStage
setCoreLayouter
in interface LayoutStage
public Layouter getCoreLayouter()
LayoutStage
getCoreLayouter
in interface LayoutStage
public void doLayout(LayoutGraph graph)
doLayout
in interface Layouter
public boolean isAutoFlippingEnabled()
More precisely, if this option is enabled and the up vector of the OrientedRectangle
associated with an
EdgeLabelLayout
(see method LabelLayout.getOrientedBox()
) points downward ({OrientedRectangle#getUpY} > 0),
this stage automatically flips the label, i.e., it rotates the label by 180 degree without changing
the label's center.
By default, this property is set to true
.
true
if this stage automatically flips edge label
content depending on the label's rotation angle and false
otherwise.LayoutTool.autoFlipBox(y.geom.OrientedRectangle)
public void setAutoFlippingEnabled(boolean enabled)
More precisely, if this option is enabled and the up vector of the OrientedRectangle
associated with an
EdgeLabelLayout
(see method LabelLayout.getOrientedBox()
) points downward ({OrientedRectangle#getUpY} > 0),
this stage automatically flips the label, i.e., it rotates the label by 180 degree without changing
the label's center.
By default, this property is set to true
.
enabled
- if true
, this stage will automatically flip
edge label content depending on the label's rotation angle.LayoutTool.autoFlipBox(y.geom.OrientedRectangle)
public boolean isResettingNodeLabelOrientation()
public void setResettingNodeLabelOrientation(boolean resettingNodeLabelOrientation)
resettingNodeLabelOrientation
- whether to reset the orientationpublic boolean isResettingEdgeLabelOrientation()
public void setResettingEdgeLabelOrientation(boolean resettingEdgeLabelOrientation)
resettingEdgeLabelOrientation
- whether to reset the orientationpublic boolean canLayout(LayoutGraph graph)
canLayout
in interface Layouter
public boolean isWriteBackEdgeLabelsEnabled()
true
.
public void setWriteBackEdgeLabelsEnabled(boolean writeBack)
writeBack
- whether to write back the informationpublic boolean isWriteBackNodeLabelsEnabled()
false
.
public void setWriteBackNodeLabelsEnabled(boolean writeBack)
writeBack
- whether to write back the informationpublic boolean isTranslateNodeLabelsEnabled()
false
.
public void setTranslateNodeLabelsEnabled(boolean translateNodeLabelsEnabled)
translateNodeLabelsEnabled
- whether to enable the translation for node labelspublic boolean isTranslateEdgeLabelsEnabled()
true
.
public void setTranslateEdgeLabelsEnabled(boolean translateEdgeLabelsEnabled)
translateEdgeLabelsEnabled
- whether to enable the translation for edge labels
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |