|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.layout.AbstractLayoutStage | +--y.layout.labeling.AbstractLabelingAlgorithm
This class an anstract 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 | |
AbstractLabelingAlgorithm()
|
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)
|
YList |
getRects()
Debug only. |
boolean |
getRemoveEdgeOverlaps()
Returns how label candidates which overlap with edges are handeled. |
boolean |
getRemoveNodeOverlaps()
Returns how label candidates which overlap with nodes are handeled. |
Object |
getSelectionKey()
Sets the labeling selection. |
boolean |
isEdgeGroupOverlapAllowed()
Returns whether edge labels may overlap with edges belonging to the same edge group. |
boolean |
isStoreRects()
Debug only. |
void |
label(LayoutGraph gl)
Place the labels in the graph. |
protected abstract void |
label(LayoutGraph g,
y.layout.labeling.Label[] labels)
Place some 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. |
protected void |
removeEdgesOverlaps(LayoutGraph gd,
y.layout.labeling.Label[] labels)
Determines which candidates overlap with edges and remove them from the candidate list. |
protected void |
removeNodesOverlaps(LayoutGraph gd,
y.layout.labeling.Label[] labels)
Determines which candidates overlap with nodes and remove them from the candidate list. |
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)
|
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. |
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 |
public AbstractLabelingAlgorithm()
Method Detail |
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)
protected void removeNodesOverlaps(LayoutGraph gd, y.layout.labeling.Label[] labels)
gd
- the graphlabels
- a list of LabelCandidatesprotected void removeEdgesOverlaps(LayoutGraph gd, y.layout.labeling.Label[] labels)
gd
- the graphlabels
- a list of LabelCandidatespublic void setProfitModel(ProfitModel model)
public double getProfit(LabelCandidate l)
protected abstract void label(LayoutGraph g, y.layout.labeling.Label[] labels)
public YList getRects()
public void setStoreRects(boolean s)
public boolean isStoreRects()
public boolean isEdgeGroupOverlapAllowed()
public void setEdgeGroupOverlapAllowed(boolean edgeGroupOverlapAllowed)
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |