public class IltAnnealingLabelLayout extends IlvAnnealingLabelLayout
IlvAnnealingLabelLayout
.
In particular, it allows you to select the objects you want to layout. By default, this label layout considers only links and their labels. All other objects are considered as obstacles but their label is not positioned by the label label.
The way this label layout places the labels for nodes and links can
be customized using CSS. See IlpLabelLayoutRenderer
for information on how to declare that this label layout will be used in
a Network component.
You can specify which business objects will have their
labels positioned by using methods setObjects(IltLabelLayoutConstants[])
or setObjects(int, IltLabelLayoutConstants)
. This property can be
customized using CSS in the following way:
LabelLayout { class: 'ilog.tgo.graphic.graphlayout.labellayout.IltAnnealingLabelLayout'; // Any properties configurable for given class. objects[0]: LINKS; objects[1]: NETWORK_ELEMENTS; objects[2]: POLY_GROUPS; }
You can specify which business objects will be considered
as obstacles by using methods setObstacles(IltLabelLayoutConstants[])
or setObstacles(int, IltLabelLayoutConstants)
. By default all object
types are considered as obstacles, but if you want to fine tune this configuration,
you can customize this list using CSS in the following way:
LabelLayout { class: 'ilog.tgo.graphic.graphlayout.labellayout.IltAnnealingLabelLayout'; // Any properties configurable for given class. obstacles[0]: LINKS; obstacles[1]: NETWORK_ELEMENTS; obstacles[2]: POLY_GROUPS; }
Once this label layout is being used, you can customize the way the labels are placed in the nodes using the following CSS properties:
IlpObjectCustomization.getLabelSpacing()
: this is
considered as the maximal distance the label is allowed to be placed away from
the object base. It is also the preferred distance.
IlpObjectCustomization.getLabelPosition()
: this property
is considered as the direction where the label should be preferably be placed.
It is also possible to customize the way labels are placed in the links using the following CSS properties:
IlpObjectCustomization.getLinkLabelMinPercentageFromStart()
:
Returns the percentage relative to the length of the link that defines the start
point of the area of the link that should be used for the label.
IlpObjectCustomization.getLinkLabelMaxPercentageFromStart()
:
Returns the percentage relative to the length of the link that defines the end
point of the area of the link that should be used for the label.
IlpObjectCustomization.getLinkLabelPreferredPercentageFromStart()
:
Returns the percentage relative to the length of the link that defines the
preferred position for the label.
IlpObjectCustomization.getLinkLabelMaxDistFromPath()
:
Returns the maximal distance from the location on the path.
IlpObjectCustomization.getLinkLabelPreferredDistFromPath()
:
Returns the preferred distance from the location on the path.
IlpObjectCustomization.getLinkLabelPreferredSide()
:
Returns the preferred side of the link where the label is placed.
IlpObjectCustomization.getLinkLabelAllowedSide()
:
Returns the allowed side of the link where the label is placed.
IlpObjectCustomization.getLinkLabelSideAssociation()
:
Returns the side association of the label.
IlpObjectCustomization.getLinkLabelTopOverlap()
:
Returns the amount the label can overlap the related obstacle or reference
link at the top side of the label.
IlpObjectCustomization.getLinkLabelBottomOverlap()
:
Returns the amount the label can overlap the related obstacle or reference
link at the bottom side of the label.
IlpObjectCustomization.getLinkLabelLeftOverlap()
:
Returns the amount the label can overlap the related obstacle or reference
link at the left side of the label.
IlpObjectCustomization.getLinkLabelRightOverlap()
:
Returns the amount the label can overlap the related obstacle or reference
link at the right side of the label.
INVERSE_VIEW_COORDINATES, MANAGER_COORDINATES, VIEW_COORDINATES
Constructor and Description |
---|
IltAnnealingLabelLayout()
Constructs an
IltAnnealingLabelLayout instance. |
IltAnnealingLabelLayout(IltAnnealingLabelLayout source)
Constructor
|
Modifier and Type | Method and Description |
---|---|
IlvLabelLayout |
copy()
Copies the layout instance.
|
IltLabelLayoutConstants[] |
getObjects()
Returns the type of objects whose label shall be moved
by the label layout.
|
IltLabelLayoutConstants |
getObjects(int index)
Returns the type of object whose label shall be
moved by the label layout and which is configured
at the given index.
|
IltLabelLayoutConstants[] |
getObstacles()
Returns the list of object types that are considered as obstacles
by this label layout.
|
IltLabelLayoutConstants |
getObstacles(int index)
Returns the object type that is considered as obstacle and
which is configured at the given index.
|
boolean |
isObject(IltLabelLayoutConstants type)
Tests whether a certain type of
IltObject should
have its label placed by the label layout. |
boolean |
isObstacle(IltLabelLayoutConstants type)
Tests whether a certain type of
IltObject is considered
as obstacle by the label layout |
boolean |
isUsedInLayout(IltLabelLayoutConstants type)
Tests whether a certain type of
IltObject is used in the layout. |
boolean |
isUsesBTS()
Tests whether the layout applies to BTS objects.
|
boolean |
isUsesLinearGroups()
Tests whether the layout applies to linear groups.
|
boolean |
isUsesLinks()
Tests whether the layout applies to links.
|
boolean |
isUsesNetworkElements()
Tests whether the layout applies to network elements.
|
boolean |
isUsesOthers()
Tests whether the layout applies to unclassified objects.
|
boolean |
isUsesPolyGroups()
Tests whether the layout applies to polygonal groups.
|
boolean |
isUsesRectGroups()
Tests whether the layout applies to rectangular groups.
|
IlvLabelLayoutReport |
performLayout()
Performs the layout.
|
IlvLabelLayoutReport |
performLayout(boolean force,
boolean redraw)
Actually performs the layout.
|
void |
save(String fileName) |
void |
setObject(IltLabelLayoutConstants type,
boolean flag)
Sets if the given object will be considered by the label layout
or not.
|
void |
setObjects(IltLabelLayoutConstants[] labels)
Sets the type of objects whose label shall be moved
by the label layout.
|
void |
setObjects(int index,
IltLabelLayoutConstants l)
Sets the type of objects whose label shall be moved
by the label layout.
|
void |
setObstacle(IltLabelLayoutConstants type,
boolean flag)
Sets if the given object type shall be considered or not as
an obstacle by this label layout.
|
void |
setObstacles(IltLabelLayoutConstants[] types)
Sets the obstacles for the label layout.
|
void |
setObstacles(int index,
IltLabelLayoutConstants type)
Sets the given object type as an obstacle for the label layout.
|
void |
setUsedInLayout(IltLabelLayoutConstants type,
boolean flag)
Defines that a certain type of
IltObject will be
taken into account by the label layout. |
void |
setUsesBTS(boolean set)
Specifies whether the layout applies to BTS objects.
|
void |
setUsesLinearGroups(boolean set)
Specifies whether the layout applies to linear groups.
|
void |
setUsesLinks(boolean set)
Specifies whether the layout applies to links.
|
void |
setUsesNetworkElements(boolean set)
Specifies whether the layout applies to network elements.
|
void |
setUsesOthers(boolean set)
Specifies whether the layout applies to unclassified objects.
|
void |
setUsesPolyGroups(boolean set)
Specifies whether the layout applies to polygonal groups.
|
void |
setUsesRectGroups(boolean set)
Specifies whether the layout applies to rectangular groups.
|
cleanLabel, cleanObstacle, contentsChanged, copyParameters, createLayoutLabelProperty, createLayoutManagerProperty, detach, getAllowedNumberOfIterations, getAutoLayoutHandler, getLabelDescriptor, getLabelDescriptorProvider, getLabelMovementPolicy, getLabelOffset, getLabelsOfObstacle, getMaxNumberOfFailIterations, getMinImprovementPercentageToContinue, getNumberIterationsForMinImprovement, getObstacleOffset, getObstacleOffsetInterface, init, isAutoUpdate, isUseQuadtree, layout, refreshAllLabelsOfObstacles, refreshLabelsOfObstacle, setAllowedNumberOfIterations, setAutoLayoutHandler, setAutoUpdate, setLabelDescriptor, setLabelDescriptorProvider, setLabelMovementPolicy, setLabelOffset, setMaxNumberOfFailIterations, setMinImprovementPercentageToContinue, setNumberIterationsForMinImprovement, setObstacleOffset, setObstacleOffsetInterface, setUseQuadtree, supportsAllowedTime, supportsPercentageComplete, supportsRandomGenerator, supportsSaveParametersToNamedProperties, supportsStopImmediately, updateLabelPosition
addLabelLayoutEventListener, addLabelLayoutParameterEventListener, attach, attach, callLayoutStepPerformedIfNeeded, cleanLabelingModel, createLayoutReport, getAllowedTime, getCoordinatesMode, getInstanceId, getLabelingModel, getLayoutReport, getManager, getMinBusyTime, getSeedValueForRandomGenerator, increasePercentageComplete, isGeometryUpToDate, isInputCheckEnabled, isLayoutNeeded, isLayoutRunning, isLayoutRunning, isLayoutTimeElapsed, isParametersUpToDate, isStoppedImmediately, isStoppedPrematurely, isStructureUpToDate, isUseDefaultParameters, isUseSeedValueForRandomGenerator, layoutStepPerformed, onParameterChanged, onParameterChanged, removeLabelLayoutEventListener, removeLabelLayoutParameterEventListener, setAllowedTime, setCoordinatesMode, setGeometryUpToDate, setInputCheckEnabled, setLayoutReport, setLayoutRunning, setManager, setMinBusyTime, setParametersUpToDate, setSeedValueForRandomGenerator, setStructureUpToDate, setUseDefaultParameters, setUseSeedValueForRandomGenerator, stopImmediately
public IltAnnealingLabelLayout()
IltAnnealingLabelLayout
instance.
Before using this instance, you must attach it to the Network Component.
public IltAnnealingLabelLayout(IltAnnealingLabelLayout source)
public IlvLabelLayout copy()
IlvAnnealingLabelLayout
This method copies the layout instance by calling the copy constructor.
copy
in class IlvAnnealingLabelLayout
IlvAnnealingLabelLayout.IlvAnnealingLabelLayout(IlvAnnealingLabelLayout)
,
IlvAnnealingLabelLayout.copyParameters(IlvLabelLayout)
public void setUsedInLayout(IltLabelLayoutConstants type, boolean flag)
IltObject
will be
taken into account by the label layout.
When a type of IltObject
is taken into account
by the label layout, its label will be positioned by the label layout and
the object itself is considered as an obstacle when the label layout is
applied.
type
- Any one of the IltLabelLayoutConstants
flag
- The new valuesetObject(IltLabelLayoutConstants, boolean)
,
setObstacle(IltLabelLayoutConstants, boolean)
,
IltLabelLayoutConstants
public boolean isUsedInLayout(IltLabelLayoutConstants type)
IltObject
is used in the layout.public boolean isUsesOthers()
public void setUsesOthers(boolean set)
public boolean isUsesLinks()
public void setUsesLinks(boolean set)
public boolean isUsesNetworkElements()
public void setUsesNetworkElements(boolean set)
public boolean isUsesBTS()
public void setUsesBTS(boolean set)
public boolean isUsesLinearGroups()
public void setUsesLinearGroups(boolean set)
public boolean isUsesPolyGroups()
public void setUsesPolyGroups(boolean set)
public boolean isUsesRectGroups()
public void setUsesRectGroups(boolean set)
public void setObject(IltLabelLayoutConstants type, boolean flag)
type
- Object typeflag
- Indicate if the object type shall be considered or notpublic boolean isObject(IltLabelLayoutConstants type)
IltObject
should
have its label placed by the label layout.type
- Any one of the IltLabelLayoutConstants
setObjects(ilog.tgo.graphic.graphlayout.labellayout.IltLabelLayoutConstants[])
public void setObjects(IltLabelLayoutConstants[] labels)
labels
- Objects that will have their labels
moved by the label layoutpublic void setObjects(int index, IltLabelLayoutConstants l)
index
- Object type indexl
- Object typepublic IltLabelLayoutConstants[] getObjects()
public IltLabelLayoutConstants getObjects(int index)
index
- Object type indexpublic void setObstacle(IltLabelLayoutConstants type, boolean flag)
type
- Object typeflag
- Indicates if the given object type shale be considered
or not by this label layoutpublic boolean isObstacle(IltLabelLayoutConstants type)
IltObject
is considered
as obstacle by the label layouttype
- Any one of the IltLabelLayoutConstants
setObstacle(ilog.tgo.graphic.graphlayout.labellayout.IltLabelLayoutConstants, boolean)
public void setObstacles(IltLabelLayoutConstants[] types)
Note: By default, all object types are considered as obstacles.
types
- Object types that shall be considered as
obstacles by the label layoutpublic void setObstacles(int index, IltLabelLayoutConstants type)
index
- Obstacle indextype
- Object typepublic IltLabelLayoutConstants[] getObstacles()
public IltLabelLayoutConstants getObstacles(int index)
index
- Obstacle indexpublic IlvLabelLayoutReport performLayout(boolean force, boolean redraw)
performLayout
in class IlvLabelLayout
force
- If true
, the method IlvLabelLayout.isLayoutNeeded()
is not called. No check is made to determine if it is necessary to
perform the layout.redraw
- If true
, the attached labeling model will be
asked to redraw all objects after layout. To move the labels, the
implementation of this method passes the value of the
redraw
argument to the method IlvLabelingModel.moveLabel(java.lang.Object, double, double, boolean)
.IlvLabelLayout.createLayoutReport()
.
IlvLabelLayout.performLayout()
,
IlvLabelLayout.layout(boolean)
,
IlvLabelLayout.isLayoutNeeded()
,
IlvLabelLayout.isStructureUpToDate()
,
IlvLabelLayout.isGeometryUpToDate()
,
IlvLabelLayout.isParametersUpToDate()
,
IlvDefaultLabelingModel.addLayer(ilog.views.IlvManagerLayer)
public void save(String fileName)
public IlvLabelLayoutReport performLayout()
performLayout
in class IlvLabelLayout
IlvLabelLayout.createLayoutReport()
.IlpNetwork.setLabelLayout(IlvLabelLayout)
,
IlpEquipment.setLabelLayout(IlvLabelLayout)
,
IlpGraphView.setLabelLayout(IlvLabelLayout)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.