ch.epfl.craft.maglib.magnet
Class SpringLayout

java.lang.Object
  extended bych.epfl.craft.maglib.magnet.SpringLayout

public class SpringLayout
extends java.lang.Object

A spring layout lays out some SpringPoints in function of the Springs between them

Once the model is set up, call doIteration() to move to the next state

Version:
1.0
Author:
Gregory Dyke

Field Summary
protected  java.util.ArrayList points
           
protected  java.util.ArrayList springs
           
 
Constructor Summary
SpringLayout()
          Create a new SpringLayout
 
Method Summary
 int addPoint(double x, double y, boolean isfixed)
           
 int addPoint(java.awt.Point p, boolean isfixed)
           
 int addPoint(SpringPoint p)
           
 void addSpring(int head, int tail, double len, double konst)
           
 void addSpring(Spring s)
           
 void addSpring(SpringPoint head, SpringPoint tail, double len, double konst)
           
 void doIteration()
          Do an iteration of springlayouting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

points

protected java.util.ArrayList points

springs

protected java.util.ArrayList springs
Constructor Detail

SpringLayout

public SpringLayout()
Create a new SpringLayout

Method Detail

doIteration

public void doIteration()
Do an iteration of springlayouting


addPoint

public int addPoint(SpringPoint p)

addPoint

public int addPoint(double x,
                    double y,
                    boolean isfixed)

addPoint

public int addPoint(java.awt.Point p,
                    boolean isfixed)

addSpring

public void addSpring(Spring s)

addSpring

public void addSpring(SpringPoint head,
                      SpringPoint tail,
                      double len,
                      double konst)

addSpring

public void addSpring(int head,
                      int tail,
                      double len,
                      double konst)


Copyright © CRAFT EPFL. All Rights Reserved.