The IlvAnnealingLabelLayout class supports
generic parameters defined in the IlvLabelLayout class. The following sections
describe the particular way in which these parameters are used by
the subclass
IlvAnnealingLabelLayout
.
Allowed time
The label layout algorithm stops if the allowed time setting has
elapsed. This feature works similarly to the same feature in IlvGraphLayout; see Allowed time. If the layout stops early
because the allowed time has elapsed, the result code in the
layout report is:
IlvLabelLayoutReport.STOPPED_AND_VALID
if the labels were moved to some better (but not yet optimal) positions.IlvLabelLayoutReport.STOPPED_AND_INVALID
if the time elapsed even before that.
Percentage of completion calculation
The label layout algorithm calculates the estimated percentage of
completion. This value can be obtained from the label layout
report during the run of the layout. (For a detailed description
of this feature, see Percentage of completion calculation and Layout events and listeners.)
Random generator seed value
The Annealing Label Layout is a randomized heuristic. It uses a
random number generator to control the movements. For the default
behavior, the random generator is initialized using the current
system clock. Therefore, different layouts are obtained if you
perform the layout repeatedly on the same graph. You can specify
the particular value to be used as a seed value.
Example of specifying seed value
To specify the seed value
10
:
In CSS
Add to the
LabelLayout
section:
useSeedValueForRandomGenerator: "true"; seedValueForRandomGenerator: "10";
In Java™
Call:
layout.setUseSeedValueForRandomGenerator(true); layout.setSeedValueForRandomGenerator(10);
Save parameters to named properties
The label layout algorithm can save its layout parameters into
named properties. This can be used to save layout parameters to
.ivl
files. (For a detailed description of this feature, see Using named properties to save layout
parameters.)
Stop immediately
The label layout algorithm stops after cleanup if the method
stopImmediately
is called. This method works for the
IlvLabelLayout
class similarly to the corresponding method in the
IlvGraphLayout
class. For a description of this method in the IlvGraphLayout class, see Stop immediately. If the layout stops early
in this way, the result code in the layout report is:
IlvLabelLayoutReport.STOPPED_AND_VALID
if the labels were moved to some better (but not yet optimal) positions.IlvLabelLayoutReport.STOPPED_AND_INVALID
if the layout stopped even before that.
Use default parameters
After modifying any label layout
parameter, you may want the layout algorithm to use the default
values. You select the default values for all global parameters
by:
layout.setUseDefaultParameters(true);
Rogue Wave JViews
Diagrammer keeps the previous settings when selecting the
default values mode. You can switch back to your own settings
by:
layout.setUseDefaultParameters(false);
This setting affects only the global
layout parameters. The label descriptors have no default values,
so parameters of the label descriptors do not change depending on
this flag.