Search this API

y.view
Interface Graph2DLayoutExecutor.LayoutThreadHandle

Enclosing class:
Graph2DLayoutExecutor

public static interface Graph2DLayoutExecutor.LayoutThreadHandle

The interface of the handle that is returned by Graph2DLayoutExecutor.doLayout(Graph2DView, y.layout.Layouter, Runnable, y.view.Graph2DLayoutExecutor.ExceptionListener) that can be used to query the state of the layout calculation. Particularly, method getAbortHandler() provides access to an AbortHandler instance that may be used to stop or cancel an asynchronous layout calculation.

See Also:
Graph2DLayoutExecutor
 

Method Summary
 void cancel()
          Cancels the ongoing layout calculation.
 AbortHandler getAbortHandler()
          Returns the AbortHandler instance for the current layout calculation.
 java.lang.Throwable getException()
          Returns the exception (if any) that happened during the layout calculation.
 java.lang.Thread getThread()
          Returns the thread that is used for the layout calculation or null if the thread has not yet been started.
 boolean isRunning()
          Determines whether the layout calculation is still running.
 

Method Detail

getThread

java.lang.Thread getThread()
Returns the thread that is used for the layout calculation or null if the thread has not yet been started.

Returns:
The thread or null

cancel

void cancel()
Cancels the ongoing layout calculation. This will try to abort the layout calculation and will prevent the result of the layout run from being applied to the graph. If the layout is already being animated, the animation will be cut short.

See Also:
isRunning()

isRunning

boolean isRunning()
Determines whether the layout calculation is still running.


getException

java.lang.Throwable getException()
Returns the exception (if any) that happened during the layout calculation.

Returns:
The exception or null if no exception has been recorded.

getAbortHandler

AbortHandler getAbortHandler()
Returns the AbortHandler instance for the current layout calculation. This method will return null if the layout calculation has finished already.

Note: If there is already an AbortHandler associated with the graph, the instance that is returned here won't be the same as the one that is provided by Graph2DLayoutExecutor.getDefaultAbortHandler().

Returns:
AbortHandler instance for the current layout calculation or null if the layout calculation has finished already.

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.