public class IlvLabelLayoutReport extends Object implements Serializable
The layout report is returned by the method IlvLabelLayout.performLayout(boolean, boolean)
. It can be also
obtained during the layout using the layout event listener mechanism.
Modifier and Type | Field and Description |
---|---|
static int |
EXCEPTION_DURING_LAYOUT
An exception has been raised during layout.
|
static int |
GREATEST_CODE
The largest integer value used as an error code.
|
static int |
INITIAL_CODE
The initial value of the code.
|
static int |
LAYOUT_DONE
The label layout was performed normally.
|
static int |
LAYOUT_FINISHED
The layout was finished.
|
static int |
LAYOUT_STARTED
The layout was started.
|
static int |
NO_LABELS
The label layout was not performed because there are no labels.
|
static int |
NOT_NEEDED
The label layout was not performed because there was no significant
change in the manager since the last time the layout was performed
successfully.
|
static int |
STOPPED_AND_INVALID
The label layout was performed but stopped because either the layout
time elapsed or
IlvLabelLayout.stopImmediately() was called. |
static int |
STOPPED_AND_VALID
The label layout was performed but stopped because either the layout
time elapsed or
IlvLabelLayout.stopImmediately() was called. |
Modifier | Constructor and Description |
---|---|
protected |
IlvLabelLayoutReport()
Creates a new instance of the report object.
|
Modifier and Type | Method and Description |
---|---|
String |
codeToString(int code)
Returns a message string (in English) corresponding to the code value
that can be obtained by
getCode() . |
String |
codeToString(int code,
ULocale locale)
Returns a message string corresponding to the code value that can be
obtained by
getCode() . |
int |
getCode()
Returns the code describing the current state of the layout algorithm.
|
long |
getLayoutTime()
Returns the total duration of the label layout algorithm
(milliseconds).
|
int |
getPercentageComplete()
If the label layout algorithm supports the percentage completion
feature, this method returns the current percentage of completion
during layout.
|
void |
setCode(int code)
Sets the code for the current state of the label layout algorithm.
|
public static final int INITIAL_CODE
getCode()
returns
this value if a different code was not set using setCode(int)
.public static final int NO_LABELS
getCode()
,
Constant Field Valuespublic static final int NOT_NEEDED
getCode()
,
Constant Field Valuespublic static final int LAYOUT_DONE
getCode()
,
Constant Field Valuespublic static final int STOPPED_AND_VALID
IlvLabelLayout.stopImmediately()
was called.
The result can be considered a valid layout. Iterative layout
algorithms that can be stopped at any iteration set this result code
if they do not run to completion (see IlvLabelLayout.supportsStopImmediately()
and IlvLabelLayout.supportsAllowedTime()
).getCode()
,
Constant Field Valuespublic static final int STOPPED_AND_INVALID
IlvLabelLayout.stopImmediately()
was called.
The result cannot be considered a valid layout. Noniterative layout
algorithms set this result code if they do not run to completion (see
IlvLabelLayout.supportsStopImmediately()
and IlvLabelLayout.supportsAllowedTime()
). The labels are either at
intermediate positions (that is, the positions seem to be placed
randomly) or have not changed at all, depending on the specific
behavior of the layout algorithm.getCode()
,
Constant Field Valuespublic static final int LAYOUT_STARTED
public static final int LAYOUT_FINISHED
public static final int EXCEPTION_DURING_LAYOUT
getCode()
,
Constant Field Valuespublic static final int GREATEST_CODE
GREATEST_CODE+1
for the definition of a new code.getCode()
,
Constant Field Valuesprotected IlvLabelLayoutReport()
IlvLabelLayout.createLayoutReport()
.public long getLayoutTime()
IlvLabelLayout.isLayoutNeeded()
and IlvLabelLayout.layout(boolean)
.public int getPercentageComplete()
0
at the beginning
of layout, increases during layout, and reaches 100
at
the end of layout.
public void setCode(int code)
LAYOUT_DONE
, STOPPED_AND_VALID
, NOT_NEEDED
, and
so on) or those defined in subclasses of
IlvLabelLayoutReport
. The codes are mutually exclusive.
The last value specified using setCode(int)
is returned
by getCode()
.
Note that you should call this method only if you create your own
layout class inside the implementation of IlvLabelLayout.layout(boolean)
. To obtain the layout report, use IlvLabelLayout.getLayoutReport()
.
getCode()
public int getCode()
LAYOUT_DONE
, STOPPED_AND_VALID
, NOT_NEEDED
, and
so on) or those defined in subclasses of
IlvLabelLayoutReport
.
Note that this method returns LAYOUT_STARTED
if it is called
inside the method LabelLayoutEventListener.layoutStepPerformed(LabelLayoutEvent)
at
the beginning of the layout process (except if the layout is not
needed).
It returns LAYOUT_FINISHED
if it is called inside the method
LabelLayoutEventListener.layoutStepPerformed(LabelLayoutEvent)
at
the end of the layout process (except if the layout is not needed).
Whenever the code LAYOUT_STARTED
is returned, the code
LAYOUT_FINISHED
will also be returned, even when an
exception occurs during the layout process or the layout is stopped
prematurely (by IlvLabelLayout.stopImmediately()
or because
the layout time elapsed).
public String codeToString(int code)
getCode()
. Subclasses of
IlvLabelLayoutReport
can override and extend this method
if they allow additional return values for getCode()
.
For example, the method returns the string "layout done" for the
input code LAYOUT_DONE
and the string
"layout not needed" for the input code NOT_NEEDED
.
code
- The code describing the current state of the layout
algorithm.getCode()
public String codeToString(int code, ULocale locale)
getCode()
. Use this method if you need a
localized variant of the message strings. Subclasses of
IlvLabelLayoutReport
can override and extend this method
if they allow additional return values for getCode()
.
For example, the method returns the string "label layout done" for
the input code LAYOUT_DONE
and the string
"label layout not needed" for the input code NOT_NEEDED
. If
the resource file
ilog.views.graphlayout.labellayout.messages
is available
for the input locale, the method returns the corresponding translated
strings.
code
- The code describing the current state of the layout
algorithm.locale
- The locale.getCode()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.