Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.trapezium.attractor
Class AttractorSelector  view AttractorSelector download AttractorSelector.java

java.lang.Object
  extended bycom.trapezium.attractor.AttractorSelector
Direct Known Subclasses:
FarPreservingAttractorSelector, NearPreservingAttractorSelector

public class AttractorSelector
extends java.lang.Object

The AttractorSelector or one of its subclasses is created by the CoordAttractor factory method "createAttractorSelector". It is used to track the currently selected attractor as a floater is matched one by one to each attractor. Subclasses handle marking of the preserved floaters in each attracted floater set.

Since:
1.0
Version:
1.0, 8 Oct 1998

Field Summary
protected  int selectedAttractor
           
protected  float selectionDistance
           
 
Constructor Summary
AttractorSelector()
          Class constructor
 
Method Summary
 void attemptAttractorSelection(int attractorOffset, float distanceToFloater)
          Attempt the selection of a particular attractor.
 int getSelection()
          Get the selected attractor offset
 void reset()
          Initialize the object, AttractorSelector reset each time matching for a new floater is started.
 void updatePreservedInfo(int[] floaterOffsets, float[] floaterDistances, int floaterOffset)
          Template, subclasses use this to mark preserved floaters in the array parameters passed from the CoordAttractor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

selectedAttractor

protected int selectedAttractor

selectionDistance

protected float selectionDistance
Constructor Detail

AttractorSelector

public AttractorSelector()
Class constructor

Method Detail

reset

public void reset()
Initialize the object, AttractorSelector reset each time matching for a new floater is started.


attemptAttractorSelection

public void attemptAttractorSelection(int attractorOffset,
                                      float distanceToFloater)
Attempt the selection of a particular attractor. Floaters are attracted to the nearest attractor.


updatePreservedInfo

public void updatePreservedInfo(int[] floaterOffsets,
                                float[] floaterDistances,
                                int floaterOffset)
Template, subclasses use this to mark preserved floaters in the array parameters passed from the CoordAttractor.


getSelection

public int getSelection()
Get the selected attractor offset