public class IlvRandomLabelLayout extends IlvLabelLayout
This is the simplest label layout algorithm. The labels are moved at
randomly-computed positions inside an user-defined region which can be
specified using the method setLayoutRegion(ilog.views.IlvRect)
. This algorithm
exists mainly for demonstration purpose.
See the corresponding chapter of the User's Manual for details on the algorithm, the features and limitations, code samples, and so on.
INVERSE_VIEW_COORDINATES, MANAGER_COORDINATES, VIEW_COORDINATES
Constructor and Description |
---|
IlvRandomLabelLayout()
Creates a new instance of the Random Layout algorithm.
|
IlvRandomLabelLayout(IlvRandomLabelLayout source)
Creates a new label layout instance by copying an existing one.
|
Modifier and Type | Method and Description |
---|---|
IlvLabelLayout |
copy()
Copies the layout instance.
|
void |
copyParameters(IlvLabelLayout source)
Copies the parameters from a given layout instance.
|
protected IlvLabelLayoutManagerProperty |
createLayoutManagerProperty(String name,
boolean withDefaults)
Returns a new instance of
IlvRandomLabelLayoutManagerProperty
that stores the parameter settings of this layout class. |
IlvRect |
getLayoutRegion()
Returns the layout region of the layout.
|
protected void |
init()
Initializes instance variables.
|
protected void |
layout(boolean redraw)
Computes the layout using the Random Layout algorithm.
|
void |
setLayoutRegion(IlvRect region)
Sets the layout region of the layout.
|
boolean |
supportsAllowedTime()
Indicates that this layout class can stop the layout computation when
the user-defined allowed time is exceeded.
|
boolean |
supportsPercentageComplete()
Indicates that this layout class can estimate the percentage of
completion during the run of layout.
|
boolean |
supportsRandomGenerator()
Indicates that this layout class uses randomly-generated numbers that
can be initialized with a user-defined seed value.
|
boolean |
supportsSaveParametersToNamedProperties()
Indicates whether the layout class can transfer the layout parameters
to named properties.
|
boolean |
supportsStopImmediately()
Indicates that this layout class can interrupt the current run of the
layout immediately in a controlled way.
|
addLabelLayoutEventListener, addLabelLayoutParameterEventListener, attach, attach, callLayoutStepPerformedIfNeeded, cleanLabel, cleanLabelingModel, cleanObstacle, contentsChanged, createLayoutLabelProperty, createLayoutReport, detach, getAllowedTime, getCoordinatesMode, getInstanceId, getLabelingModel, getLayoutReport, getManager, getMinBusyTime, getSeedValueForRandomGenerator, increasePercentageComplete, isGeometryUpToDate, isInputCheckEnabled, isLayoutNeeded, isLayoutRunning, isLayoutRunning, isLayoutTimeElapsed, isParametersUpToDate, isStoppedImmediately, isStoppedPrematurely, isStructureUpToDate, isUseDefaultParameters, isUseSeedValueForRandomGenerator, layoutStepPerformed, onParameterChanged, onParameterChanged, performLayout, performLayout, removeLabelLayoutEventListener, removeLabelLayoutParameterEventListener, setAllowedTime, setCoordinatesMode, setGeometryUpToDate, setInputCheckEnabled, setLayoutReport, setLayoutRunning, setManager, setMinBusyTime, setParametersUpToDate, setSeedValueForRandomGenerator, setStructureUpToDate, setUseDefaultParameters, setUseSeedValueForRandomGenerator, stopImmediately
public IlvRandomLabelLayout()
attach(IlvManager)
. attach(IlvLabelingModel)
. performLayout
. public IlvRandomLabelLayout(IlvRandomLabelLayout source)
copy()
method. Any subclass should
provide a copy constructor.
Note that layout parameters which are specific to a label or obstacle are not copied. Global layout parameters are copied.
source
- The layout instance that is copied.protected void init()
You should not call this method directly. The method is called internally by the constructor without arguments and by the copy constructor. The method must be overridden by subclasses that need to initialize additional instance variables.
init
in class IlvLabelLayout
public IlvLabelLayout copy()
This method copies the layout instance by calling the copy constructor.
Note that layout parameters which are specific to a label or obstacle are not copied. Global layout parameters are copied.
copy
in class IlvLabelLayout
IlvRandomLabelLayout(IlvRandomLabelLayout)
,
copyParameters(ilog.views.graphlayout.labellayout.IlvLabelLayout)
public void copyParameters(IlvLabelLayout source)
Note that layout parameters which are specific to a label or obstacle are not copied. Global layout parameters are copied.
copyParameters
in class IlvLabelLayout
source
- The layout instance from which the parameters are copied.copy()
protected void layout(boolean redraw)
IlvLabelLayout.performLayout()
.
layout
in class IlvLabelLayout
redraw
- If true
, the attached labeling model will be
asked to redraw the manager after layout. When the layout algorithm
moves the labels, it is required to pass the value of the
redraw
argument to the method IlvLabelingModel.moveLabel(Object, double, double, boolean)
.IlvLabelLayout.performLayout()
public void setLayoutRegion(IlvRect region)
public IlvRect getLayoutRegion()
public final boolean supportsPercentageComplete()
supportsPercentageComplete
in class IlvLabelLayout
true
.IlvLabelLayout.increasePercentageComplete(int)
,
IlvLabelLayoutReport.getPercentageComplete()
public final boolean supportsRandomGenerator()
useSeedValueForRandomGenerator
with a true
argument.
supportsRandomGenerator
in class IlvLabelLayout
true
.IlvLabelLayout.setSeedValueForRandomGenerator(long)
,
IlvLabelLayout.getSeedValueForRandomGenerator()
,
IlvLabelLayout.setUseSeedValueForRandomGenerator(boolean)
,
IlvLabelLayout.isUseSeedValueForRandomGenerator()
public final boolean supportsAllowedTime()
IlvLabelLayoutReport.STOPPED_AND_INVALID
in
this case.
supportsAllowedTime
in class IlvLabelLayout
true
.IlvLabelLayout.setAllowedTime(long)
,
IlvLabelLayout.getAllowedTime()
,
IlvLabelLayoutReport.getCode()
public boolean supportsStopImmediately()
IlvLabelLayoutReport.STOPPED_AND_INVALID
in this
case.
supportsStopImmediately
in class IlvLabelLayout
true
.IlvLabelLayout.stopImmediately()
,
IlvLabelLayout.isStoppedImmediately()
,
IlvLabelLayoutReport.getCode()
public boolean supportsSaveParametersToNamedProperties()
.ivl
file.
supportsSaveParametersToNamedProperties
in class IlvLabelLayout
true
.IlvDefaultLabelingModel.saveParametersToNamedProperties(ilog.views.graphlayout.labellayout.IlvLabelLayout, boolean)
,
IlvDefaultLabelingModel.loadParametersFromNamedProperties(ilog.views.graphlayout.labellayout.IlvLabelLayout)
,
IlvDefaultLabelingModel.removeParametersFromNamedProperties()
protected IlvLabelLayoutManagerProperty createLayoutManagerProperty(String name, boolean withDefaults)
IlvRandomLabelLayoutManagerProperty
that stores the parameter settings of this layout class.
The method is used by IlvDefaultLabelingModel.saveParametersToNamedProperties(IlvLabelLayout,
boolean)
to create a named property that contains parameter settings
of this layout instance.
createLayoutManagerProperty
in class IlvLabelLayout
IlvLabelLayoutManagerProperty
,
IlvDefaultLabelingModel.saveParametersToNamedProperties(ilog.views.graphlayout.labellayout.IlvLabelLayout, boolean)
,
IlvDefaultLabelingModel.loadParametersFromNamedProperties(ilog.views.graphlayout.labellayout.IlvLabelLayout)
,
IlvDefaultLabelingModel.removeParametersFromNamedProperties()
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.