ilog.views.graphlayout.labellayout
Class LabelLayoutEvent

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

public final class LabelLayoutEvent
extends EventObject

If you install a LabelLayoutEventListener on a layout instance, a LabelLayoutEvent is delivered to the listeners each time the method IlvLabelLayout.layoutStepPerformed() is called by the layout algorithms. This allows you to obtain the layout report (using the method 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 IlvLabelLayout.layoutStepPerformed() is called. This depends on the implementation of the method IlvLabelLayout.layout(boolean).

Since:
JViews 5.0
See Also:
LabelLayoutEventListener, IlvLabelLayout.addLabelLayoutEventListener(ilog.views.graphlayout.labellayout.LabelLayoutEventListener), IlvLabelLayout.layoutStepPerformed(), Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
LabelLayoutEvent(IlvLabelLayout layout)
          Creates the event.
 
Method Summary
 IlvLabelLayoutReport getLayoutReport()
          Returns the label layout report contained in the event.
 boolean isLayoutFinished()
          Returns true if this event is sent at the end of the label layout process of a manager, and false otherwise.
 boolean isLayoutStarted()
          Returns true if this event is the first event at the beginning of the label layout process of a manager, and false otherwise.
 
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

LabelLayoutEvent

public LabelLayoutEvent(IlvLabelLayout layout)
Creates the event.

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

isLayoutStarted

public boolean isLayoutStarted()
Returns true if this event is the first event at the beginning of the label layout process of a manager, 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 manager, for instance, in order to print a message or give feedback to the end user. Note that the method returns false for the events that follow the first event.

See Also:
isLayoutFinished()

isLayoutFinished

public boolean isLayoutFinished()
Returns true if this event is sent at the end of the label layout process of a manager, and false otherwise. You can use this method to detect the last event sent by the layout process of a manager, and to get from it the corresponding layout report code using IlvLabelLayoutReport.getCode(). You can use for instance the following code:
 if (event.isLayoutFinished()) 
   System.out.println("final code: " + event.getLayoutReport().getCode());
 

See Also:
isLayoutStarted()

getLayoutReport

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

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

See Also:
IlvLabelLayout.createLayoutReport()


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