JGraph
v5.13.0.0


com.jgraph.layout
Class JGraphLayoutProgress

java.lang.Object
  extended by com.jgraph.layout.JGraphLayoutProgress

public class JGraphLayoutProgress
extends Object

Describes the state of a long-running layout. The UI can listen to property changes to inform the user of the layout progress, and it can set the isStopped property to signal the layout to terminate.


Field Summary
protected  PropertyChangeSupport changeSupport
          Property change support is delegated to this class.
protected  boolean isStopped
          Specifies whether the layout was stopped in the user interface.
static String ISSTOPPED_PROPERTY
          Bound property name for isStopped.
protected  int maximum
          Specifies the maximum progress, for example 100%.
static String MAXIMUM_PROPERTY
          Bound property name for maximum.
protected  int progress
          Specifies the current progress.
static String PROGRESS_PROPERTY
          Bound property name for progress.
 
Constructor Summary
JGraphLayoutProgress()
          Constructs a new layout progress with a maximum progress of 0.
JGraphLayoutProgress(int maximum)
          Constructs a new layout progress for the specified maximum progress.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a property change listener.
 PropertyChangeSupport getChangeSupport()
           
 int getMaximum()
           
 int getProgress()
           
 boolean isStopped()
          Stoppable layouts should check this within their inner-most loops and return immediately if this returns true.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes a property change listener.
 void reset(int maximum)
          Resets the progress to 0 and sets isStopped to false.
 void setChangeSupport(PropertyChangeSupport changeSupport)
           
 void setMaximum(int maximum)
          Sets the maximum progress of the layout.
 void setProgress(int progress)
          Sets the current progress of the layout.
 void setStopped(boolean isStopped)
          Signals the layout to stop running.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAXIMUM_PROPERTY

public static final String MAXIMUM_PROPERTY
Bound property name for maximum.

See Also:
Constant Field Values

PROGRESS_PROPERTY

public static final String PROGRESS_PROPERTY
Bound property name for progress.

See Also:
Constant Field Values

ISSTOPPED_PROPERTY

public static final String ISSTOPPED_PROPERTY
Bound property name for isStopped.

See Also:
Constant Field Values

changeSupport

protected PropertyChangeSupport changeSupport
Property change support is delegated to this class.


maximum

protected int maximum
Specifies the maximum progress, for example 100%.


progress

protected int progress
Specifies the current progress.


isStopped

protected boolean isStopped
Specifies whether the layout was stopped in the user interface.

Constructor Detail

JGraphLayoutProgress

public JGraphLayoutProgress()
Constructs a new layout progress with a maximum progress of 0.


JGraphLayoutProgress

public JGraphLayoutProgress(int maximum)
Constructs a new layout progress for the specified maximum progress.

Parameters:
maximum -
Method Detail

reset

public void reset(int maximum)
Resets the progress to 0 and sets isStopped to false.


getChangeSupport

public PropertyChangeSupport getChangeSupport()
Returns:
Returns the changeSupport.

setChangeSupport

public void setChangeSupport(PropertyChangeSupport changeSupport)
Parameters:
changeSupport - The changeSupport to set.

isStopped

public boolean isStopped()
Stoppable layouts should check this within their inner-most loops and return immediately if this returns true.

Returns:
Returns true if the layout should terminate.

setStopped

public void setStopped(boolean isStopped)
Signals the layout to stop running.

Fires a property change for the ISSTOPPED_PROPERTY.

Parameters:
isStopped - Whether the layout should stop.

getMaximum

public int getMaximum()
Returns:
Returns the maximum progress.

setMaximum

public void setMaximum(int maximum)
Sets the maximum progress of the layout. This should be set at construction time only.

Fires a property change for the MAXIMUM_PROPERTY.

Parameters:
maximum - The maximum to set.

getProgress

public int getProgress()
Returns:
Returns the progress.

setProgress

public void setProgress(int progress)
Sets the current progress of the layout.

Fires a property change for the PROGRESS_PROPERTY.

Parameters:
progress - The progress to set.

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a property change listener.

Parameters:
listener -

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a property change listener.

Parameters:
listener -

JGraph
v5.13.0.0


Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.