ch.epfl.craft.maglib.magnet
Interface MagnetNode

All Known Implementing Classes:
DefaultMagnetNode

public interface MagnetNode

Defines the requirements for an object that can be used as a tree node in a MagnetView

A MagnetNode encapsulates a userObject which represent the data itself.

Version:
1.0
Author:
Jerome Caffaro

Method Summary
 int getForceField()
          Returns the force of the field generated by this magnet.
 java.awt.Point getOrigin()
          Returns the orgin of this MagnetNode instance.
 float getSimilarityWith(MagnetNode aMagnetNode)
          Returns the similarity with aMagnetNode
 void setForceField(int force)
          Sets the force of the field generated by this magnet
 void setOrigin(java.awt.Point newOrigin)
          Sets the orgin of this MagnetNode instance.
 void setTargetOrigin(java.awt.Point newTargetOrigin)
          Sets the target orgin of this MagnetNode instance.
 void setUserObject(java.lang.Object object)
          Resets the user object of the receiver to object.
 

Method Detail

getOrigin

public java.awt.Point getOrigin()
Returns the orgin of this MagnetNode instance.

Returns:
the origin of this MagnetNode instance.

setOrigin

public void setOrigin(java.awt.Point newOrigin)
Sets the orgin of this MagnetNode instance. Using this method will set the origin of the node immediately, while using setTargetOrigin(java.awt.Point) would do it progressively at some given speed.

Parameters:
newOrigin - the new origin of this MagnetNode instance.

setTargetOrigin

public void setTargetOrigin(java.awt.Point newTargetOrigin)
Sets the target orgin of this MagnetNode instance. Using this method will set the origin of the node progressively, while using setOrigin(java.awt.Point) would do it immediately.

Parameters:
newTargetOrigin - the target origin of this MagnetNode instance.

setForceField

public void setForceField(int force)
Sets the force of the field generated by this magnet

Parameters:
force - the force of the field

getForceField

public int getForceField()
Returns the force of the field generated by this magnet.

Returns:
force the force of the field

getSimilarityWith

public float getSimilarityWith(MagnetNode aMagnetNode)
Returns the similarity with aMagnetNode

Parameters:
aMagnetNode - a aMagnetNode.
Returns:
the similarity between this MagnetNode instance and aMagnetNode.

setUserObject

public void setUserObject(java.lang.Object object)
Resets the user object of the receiver to object.

Parameters:
object - the object that represents the data of this node.


Copyright © CRAFT EPFL. All Rights Reserved.