public class IlvGraphLayoutReport extends Object implements Serializable
The layout report is returned by the method IlvGraphLayout.performLayout()
. It can be also obtained during the
layout using the layout event listener mechanism.
Modifier and Type | Field and Description |
---|---|
static int |
EMPTY_GRAPHER
The layout was not performed because the graph is empty.
|
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 layout was performed normally.
|
static int |
LAYOUT_FINISHED
The layout was finished.
|
static int |
LAYOUT_STARTED
The layout was started.
|
static int |
NO_MOVEABLE_NODE
Deprecated.
Beginning with JViews 3.5, this code is no longer used. In
all cases when this code was set, the code
LAYOUT_DONE is
set instead. |
static int |
NO_RESHAPEABLE_LINK
Deprecated.
Beginning with JViews 3.5, this code is no longer used. In
all cases when this code was set, the code
LAYOUT_DONE is
set instead. |
static int |
NOT_NEEDED
The layout was not performed because there was no significant change
in the graph since the last time the layout was performed
successfully.
|
static int |
STOPPED_AND_INVALID
The layout was performed but stopped because either the layout time
elapsed or
IlvGraphLayout.stopImmediately() was called, and the
result cannot be considered a valid layout. |
static int |
STOPPED_AND_VALID
The layout was performed but stopped because either the layout time
elapsed or
IlvGraphLayout.stopImmediately() was called, and the
result can be considered a valid layout. |
Modifier | Constructor and Description |
---|---|
protected |
IlvGraphLayoutReport()
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,
com.ibm.icu.util.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 layout algorithm (in milliseconds).
|
int |
getPercentageComplete()
Returns the current percentage of completion during layout, if the
layout algorithm supports the percentage completion feature.
|
void |
setCode(int code)
Sets the code for the current state of the layout algorithm.
|
public static final int INITIAL_CODE
getCode()
returns
this value if no different code was ever set.getCode()
,
Constant Field Valuespublic static final int EMPTY_GRAPHER
getCode()
,
Constant Field Valuespublic static final int NO_MOVEABLE_NODE
LAYOUT_DONE
is
set instead.IlvGraphLayout
supports the preservation of fixed nodes (see IlvGraphLayout.supportsPreserveFixedNodes()
) and the method IlvGraphLayout.setPreserveFixedNodes(boolean)
has been called with a
true
argument.getCode()
,
Constant Field Valuespublic static final int NO_RESHAPEABLE_LINK
LAYOUT_DONE
is
set instead.IlvGraphLayout
supports the preservation of fixed links (see IlvGraphLayout.supportsPreserveFixedLinks()
) and the method IlvGraphLayout.setPreserveFixedLinks(boolean)
has been called with a
true
argument.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
IlvGraphLayout.stopImmediately()
was called, and 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 IlvGraphLayout.supportsStopImmediately()
and IlvGraphLayout.supportsAllowedTime()
).getCode()
,
Constant Field Valuespublic static final int STOPPED_AND_INVALID
IlvGraphLayout.stopImmediately()
was called, and the
result cannot be considered a valid layout. Noniterative layout
algorithms set this result code if they do not run to completion (see
IlvGraphLayout.supportsStopImmediately()
and IlvGraphLayout.supportsAllowedTime()
). The nodes and links 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
getCode()
,
GraphLayoutEvent.isLayoutStarted()
,
Constant Field Valuespublic static final int LAYOUT_FINISHED
getCode()
,
GraphLayoutEvent.isLayoutFinished()
,
Constant Field Valuespublic 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 IlvGraphLayoutReport()
IlvGraphLayout.createLayoutReport()
.public long getLayoutTime()
IlvGraphLayout.isLayoutNeeded()
and IlvGraphLayout.layout(boolean)
.public int getPercentageComplete()
0
at the beginning of layout, increases
during layout, and reaches 100
at the end of layout.
IlvGraphLayout.supportsPercentageComplete()
,
IlvGraphLayout.increasePercentageComplete(int)
public void setCode(int code)
LAYOUT_DONE,
STOPPED_AND_VALID, NOT_NEEDED
, and so on) or those defined in
subclasses of IlvGraphLayoutReport
. 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 IlvGraphLayout.layout(boolean)
. To obtain the layout report, use IlvGraphLayout.getLayoutReport()
.
code
- The new code for the current state.
getCode()
public int getCode()
LAYOUT_DONE
, STOPPED_AND_VALID
, NOT_NEEDED
, and
so on) or those defined in subclasses of
IlvGraphLayoutReport
.
The method can be called by GraphLayoutEventListener.layoutStepPerformed(ilog.views.graphlayout.GraphLayoutEvent)
to inform the listener
about the status of layout. This method returns LAYOUT_STARTED
if it is called at the beginning of the layout
process (unless the layout is not needed).
It returns LAYOUT_FINISHED
if it is called at the end of the
layout process (unless the layout is not needed or the graph is
empty).
Whenever the code LAYOUT_STARTED
is returned, the code
LAYOUT_FINISHED
will also be returned, even in cases when an
exception occurs during the layout process, the layout is stopped
prematurely (by IlvGraphLayout.stopImmediately()
, or because
the layout time elapsed).
public String codeToString(int code)
getCode()
. Subclasses of
IlvGraphLayoutReport
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, com.ibm.icu.util.ULocale locale)
getCode()
. Use this method if you need a
localized variant of the message strings. Subclasses of
IlvGraphLayoutReport
can override and extend this method
if they allow additional return values for getCode()
.
For example, the method returns the string "graph layout done" for
the input code LAYOUT_DONE
and the string
"graph layout not needed" for the input code NOT_NEEDED
. If
the resource file ilog.views.graphlayout.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 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.