|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.layout.AbstractLayoutStage
y.layout.labeling.AbstractLabelingAlgorithm
public abstract class AbstractLabelingAlgorithm
This class is an abstract base class for labeling algorithms. A labeling algorithm places a set of labels.
| Field Summary |
|---|
| Fields inherited from interface y.layout.Layouter |
|---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES |
| Constructor Summary | |
|---|---|
protected |
AbstractLabelingAlgorithm()
Creates a new instance of this class. |
| Method Summary | |
|---|---|
boolean |
canLayout(LayoutGraph graph)
Returns true. |
void |
doLayout(LayoutGraph graph)
Place the labels in the graph. |
boolean |
getPlaceEdgeLabels()
Returns if labels assigned to nodes in a graph should be placed. |
boolean |
getPlaceNodeLabels()
Returns if labels assigned to nodes in a graph should be placed. |
double |
getProfit(LabelCandidate l)
Returns the profit model that is used to rank the available positions for each label. |
ProfitModel |
getProfitModel()
|
YList |
getRects()
Debug only. |
boolean |
getRemoveEdgeOverlaps()
Returns how label candidates which overlap with edges are handled. |
boolean |
getRemoveNodeOverlaps()
Returns how label candidates which overlap with nodes are handled. |
Object |
getSelectionKey()
Sets the labeling selection. |
boolean |
isApplyPostprocessing()
Returns true if the postprocessing step is applied. |
boolean |
isEdgeGroupOverlapAllowed()
Returns whether edge labels may overlap with edges belonging to the same edge group. |
boolean |
isStoreRects()
Debug only. |
boolean |
isUseAlternativeSideHandling()
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. |
void |
label(LayoutGraph gl)
Place the labels in the graph. |
void |
label(LayoutGraph gl,
Object key)
Place a subset of the labels. |
void |
label(LayoutGraph gl,
YList nodeLabels,
YList edgeLabels)
Place some labels in the graph. |
void |
setApplyPostprocessing(boolean applyPostprocessing)
Sets if the postprocessing step should be applied. |
void |
setEdgeGroupOverlapAllowed(boolean edgeGroupOverlapAllowed)
Sets the policy for edge groups. |
void |
setPlaceEdgeLabels(boolean value)
Sets if labels assigned to nodes in a graph should be placed. |
void |
setPlaceNodeLabels(boolean value)
Sets if labels assigned to nodes in a graph should be placed. |
void |
setProfitModel(ProfitModel model)
Sets the profit model that is used to rank the available positions for each label. |
void |
setRemoveEdgeOverlaps(boolean flag)
Sets how to handle label candidates which overlap with edges. |
void |
setRemoveNodeOverlaps(boolean flag)
Sets how to handle label candidates which overlap with nodes. |
void |
setSelection(Object key)
Sets the key, under which the labeling selection can be retrieved. |
void |
setStoreRects(boolean s)
Debug only. |
void |
setUseAlternativeSideHandling(boolean useAlternativeSideHandling)
If set, 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. |
| Methods inherited from class y.layout.AbstractLayoutStage |
|---|
canLayoutCore, doLayoutCore, getCoreLayouter, setCoreLayouter |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractLabelingAlgorithm()
| Method Detail |
|---|
public ProfitModel getProfitModel()
public boolean isApplyPostprocessing()
public void setApplyPostprocessing(boolean applyPostprocessing)
FreeEdgeLabelModel and node labels whose node lable model is FreeNodeLabelModel.
public boolean isUseAlternativeSideHandling()
public void setUseAlternativeSideHandling(boolean useAlternativeSideHandling)
FreeEdgeLabelModel.
public void setRemoveNodeOverlaps(boolean flag)
true these candidates are not
considered, if false these candidates are considered, but a penalty is assigned to them.
public void setRemoveEdgeOverlaps(boolean flag)
true these candidates are not
considered, if false these candidates are considered, but a penalty is assigned to them.
public boolean getRemoveNodeOverlaps()
true these candidates are not
considered, if false these candidates are considered, but a penalty is assigned to them.
public boolean getRemoveEdgeOverlaps()
true these candidates are not
considered, if false these candidates are considered, but a penalty is assigned to them.
public void setPlaceNodeLabels(boolean value)
true node labels are placed, if
false node labels are ignored. This method has higher priority than the selection, i.e. even if a node
label is selected it is not set when setPlaceNodeLabels(false) has been invoked before.
public void setPlaceEdgeLabels(boolean value)
true node labels placed, if
false node labels are ignored. This method has higher priority than the selection, i.e. even if an
edge label is selected it is not set when setPlaceEdgeLabels(false) has been invoked before.
public boolean getPlaceNodeLabels()
true node labels placed, if
false node labels are ignored.
public boolean getPlaceEdgeLabels()
true node labels placed, if
false node labels are ignored.
public void setSelection(Object key)
key - The key for a DataProvider. Labels which should be placed return true.public Object getSelectionKey()
public boolean canLayout(LayoutGraph graph)
true.
public void doLayout(LayoutGraph graph)
label() method.
graph - The graph to label.public void label(LayoutGraph gl)
gl - The graph to label.
public void label(LayoutGraph gl,
Object key)
key - The key for a DataProvider in gl. Labels which should be placed return
true.
public void label(LayoutGraph gl,
YList nodeLabels,
YList edgeLabels)
public void setProfitModel(ProfitModel model)
LabelRanking is set.
public double getProfit(LabelCandidate l)
LabelRanking is set.
public YList getRects()
public void setStoreRects(boolean s)
public boolean isStoreRects()
public boolean isEdgeGroupOverlapAllowed()
public void setEdgeGroupOverlapAllowed(boolean edgeGroupOverlapAllowed)
|
© Copyright 2000-2008, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||