net.grelf.grip
Class PointList

java.lang.Object
  extended by net.grelf.grip.PointList

public class PointList
extends java.lang.Object

Holds the data for points and lines which can be drawn in GlassPane. This may comprise a shape for measuring and some text. Has the methods for making measurements on any of the shapes and then invoking a MeasurementHandler to process them.


Field Summary
protected  int centreX
           
protected  int centreY
           
 
Constructor Summary
PointList()
          Default constructor.
PointList(MeasurementHandler mh)
           
PointList(PointList ps)
          Copy constructor
 
Method Summary
 void add(java.awt.Point pt)
          Add a point to the list defining a shape.
 void calibrate(ImFrame imf)
          Calibrate an ImFrame by interacting with the user.
 void clear()
          Clear the list to start again.
 java.awt.Point get(int i)
          Get a point from the list defining a shape.
 java.util.List<XYText> getLabels()
          Get a reference to the list of displayable XYText labels (may be null).
 MeasurementHandler getMeasurementHandler()
          Get a reference to the MeasurementHandler associated with this PointList.
 java.util.List<Measurement> getMeasurementList()
          Get a reference to the current list of Measurements.
 java.util.List<java.awt.Point> getPoints()
          Get a reference to the list of points defining a measureable shape.
 void measureArea(ImFrame imf)
          Measure the shape over the given image, assuming it to be a closed curve.
 void measureBlobLine(ImFrame imf)
          Measure the straight line between the centres of two blobs.
 void measureCurve(ImFrame imf)
          Measure the shape over the given image, assuming it to be an open curve.
 void measureLine(ImFrame imf)
          Measure the shape over the given image, assuming it to be a straight line.
 void measurePoint(ImFrame imf)
          Measure the shape over the given image, assuming it to be a single point (ie, just one point in the list).
 void measureRectangle(ImFrame imf)
          Measure the shape over the given image, assuming it to be a rectangle (there are only the two opposite corners in the list of points).
 void measureRectangle(ImFrame imf, java.awt.Point pt1, java.awt.Point pt2)
          Measure the rectangle defined by the two given points (as opposite corners) over the given image.
 void measureStarLine(ImFrame imf)
          Measure the straight line between two stars in a StarChart.
 void measureWhole(ImFrame imf)
          Measure the whole rectangular area of the given image.
 void setLabels(java.util.List<XYText> someLabels)
          Set a reference to a list of XYText labels.
 int size()
          Get the number of points in the list defining a shape.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

centreX

protected int centreX

centreY

protected int centreY
Constructor Detail

PointList

public PointList(MeasurementHandler mh)

PointList

public PointList(PointList ps)
Copy constructor


PointList

public PointList()
Default constructor. Does not set a MeasurementHandler.

Method Detail

getPoints

public java.util.List<java.awt.Point> getPoints()
Get a reference to the list of points defining a measureable shape.


add

public void add(java.awt.Point pt)
Add a point to the list defining a shape. Puts a reference to the point into the list.


clear

public void clear()
Clear the list to start again.


get

public java.awt.Point get(int i)
Get a point from the list defining a shape. Returns a reference to a point in the list.


size

public int size()
Get the number of points in the list defining a shape.


getLabels

public java.util.List<XYText> getLabels()
Get a reference to the list of displayable XYText labels (may be null).


setLabels

public void setLabels(java.util.List<XYText> someLabels)
Set a reference to a list of XYText labels.


getMeasurementHandler

public MeasurementHandler getMeasurementHandler()
Get a reference to the MeasurementHandler associated with this PointList.


getMeasurementList

public java.util.List<Measurement> getMeasurementList()
Get a reference to the current list of Measurements.


calibrate

public void calibrate(ImFrame imf)
Calibrate an ImFrame by interacting with the user.


measureArea

public void measureArea(ImFrame imf)
Measure the shape over the given image, assuming it to be a closed curve.


measureWhole

public void measureWhole(ImFrame imf)
Measure the whole rectangular area of the given image.


measureRectangle

public void measureRectangle(ImFrame imf)
Measure the shape over the given image, assuming it to be a rectangle (there are only the two opposite corners in the list of points).


measureRectangle

public void measureRectangle(ImFrame imf,
                             java.awt.Point pt1,
                             java.awt.Point pt2)
Measure the rectangle defined by the two given points (as opposite corners) over the given image.


measureCurve

public void measureCurve(ImFrame imf)
Measure the shape over the given image, assuming it to be an open curve.


measureLine

public void measureLine(ImFrame imf)
Measure the shape over the given image, assuming it to be a straight line. There should be just two points in the list of points, defining the ends of the line.


measureBlobLine

public void measureBlobLine(ImFrame imf)
Measure the straight line between the centres of two blobs. There should be just two points in the list of points, defining the ends of the line. Their coordinates will be the centres of blobs but truncated to int. If the blobs have both been iodentified as stars, complete with net.grelf.astro.SkyPoint position objects, go on to compute the net.grelf.astro.SkyVector between them.


measureStarLine

public void measureStarLine(ImFrame imf)
Measure the straight line between two stars in a StarChart. There should be just two points in the list of points, defining the ends of the line. Their coordinates will be the plot positions of stars.


measurePoint

public void measurePoint(ImFrame imf)
Measure the shape over the given image, assuming it to be a single point (ie, just one point in the list).