Package uk.ac.starlink.ttools.plot
Class PointArrayPixellator
- java.lang.Object
-
- uk.ac.starlink.ttools.plot.PointArrayPixellator
-
- All Implemented Interfaces:
Pixellator
public class PointArrayPixellator extends java.lang.Object implements Pixellator
Pixellator based on an array ofPointobjects. This implementation is designed to be particularly efficient for iterating over.- Since:
- 28 Mar 2007
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description PointArrayPixellator(java.awt.Point[] points)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.RectanglegetBounds()Returns a copy of the bounding rectangle for this pixellator.intgetX()Returns the X value for the current point.intgetY()Returns the Y value for the current point.booleannext()Moves to the next point in the sequence.voidstart()Makes this object ready to iterate.
-
-
-
Method Detail
-
getBounds
public java.awt.Rectangle getBounds()
Description copied from interface:PixellatorReturns a copy of the bounding rectangle for this pixellator. All points iterated over by this object will fall within this rectangle. If this object has no points,nullmay be returned.- Specified by:
getBoundsin interfacePixellator- Returns:
- bounds
-
start
public void start()
Description copied from interface:PixellatorMakes this object ready to iterate. Should be called before any call toPixellator.next().- Specified by:
startin interfacePixellator
-
next
public boolean next()
Description copied from interface:PixellatorMoves to the next point in the sequence. Must be called before any call toPixellator.getX()/Pixellator.getY(). Returns value indicates whether there is a next point.- Specified by:
nextin interfacePixellator- Returns:
- next true iff there are more points
-
getX
public int getX()
Description copied from interface:PixellatorReturns the X value for the current point.- Specified by:
getXin interfacePixellator- Returns:
- x
-
getY
public int getY()
Description copied from interface:PixellatorReturns the Y value for the current point.- Specified by:
getYin interfacePixellator- Returns:
- y
-
-