JGraphAddons
v1.0


org.jgraph.layout
Class JGraphLayoutAlgorithm

java.lang.Object
  |
  +--org.jgraph.layout.JGraphLayoutAlgorithm
Direct Known Subclasses:
AnnealingLayoutAlgorithm, CircleGraphLayout, GEMLayoutAlgorithm, MoenLayoutAlgorithm, RadialTreeLayoutAlgorithm, SpringEmbeddedLayoutAlgorithm, SugiyamaLayoutAlgorithm, TreeLayoutAlgorithm

public abstract class JGraphLayoutAlgorithm
extends Object


Field Summary
protected static Set LAYOUT_ATTRIBUTES
           
 
Constructor Summary
JGraphLayoutAlgorithm()
           
 
Method Summary
static void applyLayout(JGraph sourceGraph, Object[] cells, JGraphLayoutAlgorithm layout)
           
static JDialog createDialog(JGraphLayoutSettings settings, JDialog parent, String title, String close, String apply)
          A utility method to create a simple dialog with close and apply button.
static JDialog createDialog(JGraphLayoutSettings settings, JFrame parent, String title, String close, String apply)
          A utility method to create a simple dialog with close and apply button.
 JGraphLayoutSettings createSettings()
          Subclassers may return a new JComponent that allows to configure the layout.
 String getHint()
          Get a human readable hint for using this layout.
 int getMaximumProgress()
          Returns the maximum progress
 int getProgress()
          Returns the current progress
 boolean isAllowedToRun()
           
static JDialog populateDialog(JGraphLayoutSettings settings, JDialog dialog, String close, String apply)
          A utility method to create a simple dialog with close and apply button.
 void run(JGraph graph, Object[] cells)
          Call run with step = 0;
abstract  void run(JGraph jgraph, Object[] cells, int step)
          Executes the layout algorithm.
 void setAllowedToRun(boolean isAllowedToRun)
           
 void setMaximumProgress(int maximumProgress)
          Sets the maximum progress.
 void setProgress(int progress)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LAYOUT_ATTRIBUTES

protected static Set LAYOUT_ATTRIBUTES
Constructor Detail

JGraphLayoutAlgorithm

public JGraphLayoutAlgorithm()
Method Detail

createSettings

public JGraphLayoutSettings createSettings()
Subclassers may return a new JComponent that allows to configure the layout. The default implementation returns null.
Note: Settings creation may be expensive so the UI should cache the values returned by this method.


getHint

public String getHint()
Get a human readable hint for using this layout.


run

public void run(JGraph graph,
                Object[] cells)
Call run with step = 0;


run

public abstract void run(JGraph jgraph,
                         Object[] cells,
                         int step)
Executes the layout algorithm.


isAllowedToRun

public boolean isAllowedToRun()
Returns:
Returns the isAllowedToRun.

setAllowedToRun

public void setAllowedToRun(boolean isAllowedToRun)
Parameters:
isAllowedToRun - The isAllowedToRun to set.

getMaximumProgress

public int getMaximumProgress()
Returns the maximum progress


setMaximumProgress

public void setMaximumProgress(int maximumProgress)
Sets the maximum progress.


getProgress

public int getProgress()
Returns the current progress


setProgress

public void setProgress(int progress)
Parameters:
progress - The progress to set.

createDialog

public static JDialog createDialog(JGraphLayoutSettings settings,
                                   JFrame parent,
                                   String title,
                                   String close,
                                   String apply)
A utility method to create a simple dialog with close and apply button.


createDialog

public static JDialog createDialog(JGraphLayoutSettings settings,
                                   JDialog parent,
                                   String title,
                                   String close,
                                   String apply)
A utility method to create a simple dialog with close and apply button.


populateDialog

public static JDialog populateDialog(JGraphLayoutSettings settings,
                                     JDialog dialog,
                                     String close,
                                     String apply)
A utility method to create a simple dialog with close and apply button.


applyLayout

public static void applyLayout(JGraph sourceGraph,
                               Object[] cells,
                               JGraphLayoutAlgorithm layout)
Returns:

JGraphAddons
v1.0


Copyright (C) 2003-2004 Gaudenz Alder. All rights reserved.