ch.epfl.craft.maglib.magnet
Class SpringPoint

java.lang.Object
  extended byjava.awt.geom.Point2D
      extended byjava.awt.geom.Point2D.Double
          extended bych.epfl.craft.maglib.magnet.SpringPoint
All Implemented Interfaces:
java.lang.Cloneable

public class SpringPoint
extends java.awt.geom.Point2D.Double

A node to be manipulated in a spring layout

A SpringPoint encapsulates a Point and its fixedness

Version:
1.0
Author:
Gregory Dyke

Nested Class Summary
 
Nested classes inherited from class java.awt.geom.Point2D
java.awt.geom.Point2D.Double, java.awt.geom.Point2D.Float
 
Field Summary
protected  Vector2D currentforce
           
protected  boolean isfixed
           
 
Fields inherited from class java.awt.geom.Point2D.Double
x, y
 
Constructor Summary
SpringPoint(double x, double y, boolean isfixed)
          Create a new SpringPoint
SpringPoint(java.awt.geom.Point2D p, boolean isfixed)
           
 
Method Summary
 Vector2D getCurrentforce()
           
 boolean isFixed()
           
 void move(Vector2D that)
           
 void movebyForce()
           
 void setCurrentforce(Vector2D currentforce)
           
 
Methods inherited from class java.awt.geom.Point2D.Double
getX, getY, setLocation, toString
 
Methods inherited from class java.awt.geom.Point2D
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, hashCode, setLocation
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

isfixed

protected boolean isfixed

currentforce

protected Vector2D currentforce
Constructor Detail

SpringPoint

public SpringPoint(double x,
                   double y,
                   boolean isfixed)
Create a new SpringPoint

Parameters:
x - x coordinate of point
isfixed - whether the point can be moved or not.

SpringPoint

public SpringPoint(java.awt.geom.Point2D p,
                   boolean isfixed)
Method Detail

isFixed

public boolean isFixed()

getCurrentforce

public Vector2D getCurrentforce()

setCurrentforce

public void setCurrentforce(Vector2D currentforce)

move

public void move(Vector2D that)

movebyForce

public void movebyForce()


Copyright © CRAFT EPFL. All Rights Reserved.