ilog.tgo.graphic.graphlayout.labellayout
Class IltAnnealingLabelLayout

java.lang.Object
  extended by ilog.views.graphlayout.labellayout.IlvLabelLayout
      extended by ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelLayout
          extended by ilog.tgo.graphic.graphlayout.labellayout.IltAnnealingLabelLayout
All Implemented Interfaces:
LabelingModelListener, Serializable, EventListener

public class IltAnnealingLabelLayout
extends IlvAnnealingLabelLayout

This class adds some new features to the 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:

It is also possible to customize the way labels are placed in the links using the following CSS properties:

See Also:
Serialized Form

Field Summary
 
Fields inherited from class ilog.views.graphlayout.labellayout.IlvLabelLayout
INVERSE_VIEW_COORDINATES, MANAGER_COORDINATES, VIEW_COORDINATES
 
Constructor Summary
IltAnnealingLabelLayout()
          Constructs an IltAnnealingLabelLayout instance.
IltAnnealingLabelLayout(IltAnnealingLabelLayout source)
          Constructor
 
Method Summary
 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.
 
Methods inherited from class ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelLayout
cleanLabel, cleanObstacle, contentsChanged, copyParameters, createLayoutLabelProperty, createLayoutManagerProperty, detach, getAllowedNumberOfIterations, getAutoLayoutHandler, getLabelDescriptor, getLabelMovementPolicy, getLabelOffset, getLabelsOfObstacle, getMaxNumberOfFailIterations, getMinImprovementPercentageToContinue, getNumberIterationsForMinImprovement, getObstacleOffset, getObstacleOffsetInterface, init, isAutoUpdate, isUseQuadtree, layout, refreshAllLabelsOfObstacles, refreshLabelsOfObstacle, setAllowedNumberOfIterations, setAutoLayoutHandler, setAutoUpdate, setLabelDescriptor, setLabelMovementPolicy, setLabelOffset, setMaxNumberOfFailIterations, setMinImprovementPercentageToContinue, setNumberIterationsForMinImprovement, setObstacleOffset, setObstacleOffsetInterface, setUseQuadtree, supportsAllowedTime, supportsPercentageComplete, supportsRandomGenerator, supportsSaveParametersToNamedProperties, supportsStopImmediately, updateLabelPosition
 
Methods inherited from class ilog.views.graphlayout.labellayout.IlvLabelLayout
addLabelLayoutEventListener, addLabelLayoutParameterEventListener, attach, attach, callLayoutStepPerformedIfNeeded, cleanLabelingModel, createLayoutReport, getAllowedTime, getCoordinatesMode, getInstanceId, getLabelingModel, getLayoutReport, getManager, getMinBusyTime, getSeedValueForRandomGenerator, increasePercentageComplete, isGeometryUpToDate, isInputCheckEnabled, isLayoutNeeded, isLayoutRunning, isLayoutTimeElapsed, isParametersUpToDate, isStoppedImmediately, isStoppedPrematurely, isStructureUpToDate, isUseDefaultParameters, isUseSeedValueForRandomGenerator, layoutStepPerformed, removeLabelLayoutEventListener, removeLabelLayoutParameterEventListener, setAllowedTime, setCoordinatesMode, setGeometryUpToDate, setInputCheckEnabled, setLayoutReport, setManager, setMinBusyTime, setParametersUpToDate, setSeedValueForRandomGenerator, setStructureUpToDate, setUseDefaultParameters, setUseSeedValueForRandomGenerator, stopImmediately
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IltAnnealingLabelLayout

public IltAnnealingLabelLayout()
Constructs an IltAnnealingLabelLayout instance.

Before using this instance, you must attach it to the Network Component.

See Also:
IlpNetwork.setLabelLayout(IlvLabelLayout)

IltAnnealingLabelLayout

public IltAnnealingLabelLayout(IltAnnealingLabelLayout source)
Constructor

Method Detail

copy

public IlvLabelLayout copy()
Description copied from class: IlvAnnealingLabelLayout
Copies the layout instance.

This method copies the layout instance by calling the copy constructor.

Overrides:
copy in class IlvAnnealingLabelLayout
Returns:
A copy of the layout instance.
See Also:
IlvAnnealingLabelLayout.IlvAnnealingLabelLayout(IlvAnnealingLabelLayout), IlvAnnealingLabelLayout.copyParameters(ilog.views.graphlayout.labellayout.IlvLabelLayout)

setUsedInLayout

public void setUsedInLayout(IltLabelLayoutConstants type,
                            boolean flag)
Defines that a certain type of 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.

Parameters:
type - Any one of the IltLabelLayoutConstants
flag - The new value
See Also:
setObject(IltLabelLayoutConstants, boolean), setObstacle(IltLabelLayoutConstants, boolean), IltLabelLayoutConstants

isUsedInLayout

public boolean isUsedInLayout(IltLabelLayoutConstants type)
Tests whether a certain type of IltObject is used in the layout.

See Also:
setUsedInLayout(ilog.tgo.graphic.graphlayout.labellayout.IltLabelLayoutConstants, boolean)

isUsesOthers

public boolean isUsesOthers()
Tests whether the layout applies to unclassified objects.


setUsesOthers

public void setUsesOthers(boolean set)
Specifies whether the layout applies to unclassified objects.


isUsesLinks

public boolean isUsesLinks()
Tests whether the layout applies to links.


setUsesLinks

public void setUsesLinks(boolean set)
Specifies whether the layout applies to links.


isUsesNetworkElements

public boolean isUsesNetworkElements()
Tests whether the layout applies to network elements.


setUsesNetworkElements

public void setUsesNetworkElements(boolean set)
Specifies whether the layout applies to network elements.


isUsesBTS

public boolean isUsesBTS()
Tests whether the layout applies to BTS objects.


setUsesBTS

public void setUsesBTS(boolean set)
Specifies whether the layout applies to BTS objects.


isUsesLinearGroups

public boolean isUsesLinearGroups()
Tests whether the layout applies to linear groups.


setUsesLinearGroups

public void setUsesLinearGroups(boolean set)
Specifies whether the layout applies to linear groups.


isUsesPolyGroups

public boolean isUsesPolyGroups()
Tests whether the layout applies to polygonal groups.


setUsesPolyGroups

public void setUsesPolyGroups(boolean set)
Specifies whether the layout applies to polygonal groups.


isUsesRectGroups

public boolean isUsesRectGroups()
Tests whether the layout applies to rectangular groups.


setUsesRectGroups

public void setUsesRectGroups(boolean set)
Specifies whether the layout applies to rectangular groups.


setObject

public void setObject(IltLabelLayoutConstants type,
                      boolean flag)
Sets if the given object will be considered by the label layout or not. An object type that is considered by this instance will have its label placed by the label layout.

Parameters:
type - Object type
flag - Indicate if the object type shall be considered or not
Since:
JViews 7.5

isObject

public boolean isObject(IltLabelLayoutConstants type)
Tests whether a certain type of IltObject should have its label placed by the label layout.

Parameters:
type - Any one of the IltLabelLayoutConstants
Since:
JViews 7.5
See Also:
setObjects(ilog.tgo.graphic.graphlayout.labellayout.IltLabelLayoutConstants[])

setObjects

public void setObjects(IltLabelLayoutConstants[] labels)
Sets the type of objects whose label shall be moved by the label layout.

Parameters:
labels - Objects that will have their labels moved by the label layout
Since:
JViews 7.5

setObjects

public void setObjects(int index,
                       IltLabelLayoutConstants l)
Sets the type of objects whose label shall be moved by the label layout.

Parameters:
index - Object type index
l - Object type
Since:
JViews 7.5

getObjects

public IltLabelLayoutConstants[] getObjects()
Returns the type of objects whose label shall be moved by the label layout.

Returns:
Type of objects whose label shall be moved by the label layout
Since:
JViews 7.5

getObjects

public 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.

Parameters:
index - Object type index
Returns:
Object type
Since:
JViews 7.5

setObstacle

public void setObstacle(IltLabelLayoutConstants type,
                        boolean flag)
Sets if the given object type shall be considered or not as an obstacle by this label layout.

Parameters:
type - Object type
flag - Indicates if the given object type shale be considered or not by this label layout
Since:
JViews 7.5

isObstacle

public boolean isObstacle(IltLabelLayoutConstants type)
Tests whether a certain type of IltObject is considered as obstacle by the label layout

Parameters:
type - Any one of the IltLabelLayoutConstants
Since:
JViews 7.5
See Also:
setObstacle(ilog.tgo.graphic.graphlayout.labellayout.IltLabelLayoutConstants, boolean)

setObstacles

public void setObstacles(IltLabelLayoutConstants[] types)
Sets the obstacles for the label layout.

Note: By default, all object types are considered as obstacles.

Parameters:
types - Object types that shall be considered as obstacles by the label layout
Since:
JTGO 3.5

setObstacles

public void setObstacles(int index,
                         IltLabelLayoutConstants type)
Sets the given object type as an obstacle for the label layout.

Parameters:
index - Obstacle index
type - Object type

getObstacles

public IltLabelLayoutConstants[] getObstacles()
Returns the list of object types that are considered as obstacles by this label layout.

Returns:
The list of obstacles
Since:
JViews 7.5

getObstacles

public IltLabelLayoutConstants getObstacles(int index)
Returns the object type that is considered as obstacle and which is configured at the given index.

Parameters:
index - Obstacle index
Returns:
The object type that is configured in the given index.
Since:
JViews 7.5

performLayout

public IlvLabelLayoutReport performLayout(boolean force,
                                          boolean redraw)
Actually performs the layout.

Overrides:
performLayout in class IlvLabelLayout
Parameters:
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, float, float, boolean).
Returns:
The instance of the layout report created by IlvLabelLayout.createLayoutReport().

See Also:
IlvLabelLayout.performLayout(), IlvLabelLayout.layout(boolean), IlvLabelLayout.isLayoutNeeded(), IlvLabelLayout.isStructureUpToDate(), IlvLabelLayout.isGeometryUpToDate(), IlvLabelLayout.isParametersUpToDate(), IlvDefaultLabelingModel.addLayer(ilog.views.IlvManagerLayer)

save

public void save(String fileName)
Internal method or field: do not use!

performLayout

public IlvLabelLayoutReport performLayout()
Performs the layout. You must call this method each time you want to perform the label layout. Prior to that, the layout must have been attached to a Network component.

Overrides:
performLayout in class IlvLabelLayout
Returns:
The instance of the layout report created by IlvLabelLayout.createLayoutReport().
See Also:
IlpNetwork.setLabelLayout(IlvLabelLayout), IlpEquipment.setLabelLayout(IlvLabelLayout), IlpGraphView.setLabelLayout(IlvLabelLayout)


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.