ilog.views.graphlayout
Class GraphLayoutEvent

java.lang.Object
  extended by java.util.EventObject
      extended by ilog.views.graphlayout.GraphLayoutEvent
All Implemented Interfaces:
Serializable

public final class GraphLayoutEvent
extends EventObject

Provides data for the layout step event on layout instances. If you install a GraphLayoutEventListener on a layout instance, a GraphLayoutEvent is delivered to the listeners each time the method IlvGraphLayout.layoutStepPerformed() is called by the layout algorithms. This allows you to obtain the layout report (using getLayoutReport()) more than once during the layout and to be informed of the behavior of the layout algorithm before its completion. You can, for example, implement a progress bar and update it each time you receive the layout event.

Note that the layout event is delivered only if the method IlvGraphLayout.layoutStepPerformed() is called. This depends on the implementation of the method IlvGraphLayout.layout(boolean).

See Also:
GraphLayoutEventListener, IlvGraphLayout.addGraphLayoutEventListener(ilog.views.graphlayout.GraphLayoutEventListener), IlvGraphLayout.layoutStepPerformed(), Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
GraphLayoutEvent(IlvGraphLayout layout)
          Creates the event.
 
Method Summary
 IlvGraphLayout getGraphLayout()
          Returns the graph layout that is the source of the event.
 IlvGraphLayoutReport getLayoutReport()
          Returns the graph layout report contained in the event.
 boolean isLayoutFinished()
          Returns whether the layout just has finished.
 boolean isLayoutStarted()
          Returns whether the layout just has started.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GraphLayoutEvent

public GraphLayoutEvent(IlvGraphLayout layout)
Creates the event.

Parameters:
layout - The layout instance source of the event
Method Detail

isLayoutStarted

public boolean isLayoutStarted()
Returns whether the layout just has started. Returns true if this event is the first event at the beginning of the layout process of a graph, and false otherwise.

If this method returns true, the method isLayoutFinished() called on the same event instance returns false.

You can use this method to detect the first event sent by the layout process of a graph, for instance, in order to print a message or to give feedback to the end user. Note that the method returns false for the events that follow the first event.

Since:
JViews 5.0
See Also:
isLayoutFinished(), IlvJGraphLayoutProgressBar

isLayoutFinished

public boolean isLayoutFinished()
Returns whether the layout just has finished. Returns true if this event is sent at the end of the layout process of a graph, and false otherwise. You can use this method to detect the last event sent by the layout process of a graph, and to get the corresponding layout report code from it using IlvGraphLayoutReport.getCode(). For example, you could use the following code:
 if (event.isLayoutFinished()) 
   System.out.println("final code: " + event.getLayoutReport().getCode());
 

Since:
JViews 5.0
See Also:
isLayoutStarted()

getLayoutReport

public IlvGraphLayoutReport getLayoutReport()
Returns the graph layout report contained in the event. It simply returns the layout report by calling the method IlvGraphLayout.getLayoutReport() on the layout instance that is the source of the event.

Note that if a subclass of IlvGraphLayout overrides the method IlvGraphLayout.createLayoutReport(), this method can return an instance of a subclass of IlvGraphLayoutReport, depending on the class of layout report created.

See Also:
IlvGraphLayout.createLayoutReport()

getGraphLayout

public IlvGraphLayout getGraphLayout()
Returns the graph layout that is the source of the event.

Since:
JViews 8.1


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.