net.paulhertz.aifile
Class LineVertex

java.lang.Object
  extended by net.paulhertz.aifile.LineVertex
All Implemented Interfaces:
Vertex2DINF

public class LineVertex
extends Object
implements Vertex2DINF

Stores a line vertex consisting of a single point.


Field Summary
static int segmentType
          path segment type
 
Constructor Summary
LineVertex()
           
LineVertex(float x, float y)
           
 
Method Summary
 LineVertex clone()
           
 float[] coords()
           
 void draw(PApplet parent)
          Draws a path to the display.
 void draw(PGraphics pg)
          Draws a path to an offscreen buffer.
 int segmentType()
           
 void setX(float newX)
           
 void setY(float newY)
           
 void write(PrintWriter output)
          Writes a path segment to file.
 float x()
           
 float y()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

segmentType

public static final int segmentType
path segment type

See Also:
Constant Field Values
Constructor Detail

LineVertex

public LineVertex(float x,
                  float y)

LineVertex

public LineVertex()
Method Detail

x

public float x()
Specified by:
x in interface Vertex2DINF
Returns:
x-coordinate as a float

setX

public void setX(float newX)

y

public float y()
Specified by:
y in interface Vertex2DINF
Returns:
y-coordinate as a float

setY

public void setY(float newY)

segmentType

public int segmentType()
Specified by:
segmentType in interface Vertex2DINF
Returns:
type of segment, either BezShape.LINE_SEGMENT or BezShape.CURVE_SEGMENT

coords

public float[] coords()
Specified by:
coords in interface Vertex2DINF
Returns:
coordinates as an array of float

clone

public LineVertex clone()
Specified by:
clone in interface Vertex2DINF
Overrides:
clone in class Object
Returns:
a deep copy of a Vertex2DINF

draw

public void draw(PApplet parent)
Description copied from interface: Vertex2DINF
Draws a path to the display. It is only valid to call this within a Processing beginShape/endShape pair where an initial vertex has been set with a call to vertex().

Specified by:
draw in interface Vertex2DINF
Parameters:
parent - the PApplet that handles drawing

draw

public void draw(PGraphics pg)
Description copied from interface: Vertex2DINF
Draws a path to an offscreen buffer. It is only valid to call this within a Processing beginShape/endShape pair where an initial vertex has been set with a call to vertex().

Specified by:
draw in interface Vertex2DINF
Parameters:
pg - a PGraphics instance

write

public void write(PrintWriter output)
Description copied from interface: Vertex2DINF
Writes a path segment to file. Multiple calls to this method should be bracketed by AIFileWriter.psMoveTo and AIFileWriter.paintPath commands

Specified by:
write in interface Vertex2DINF
Parameters:
output - a PrintWriter for output to file


Processing library IgnoCodeLib by Paul Hertz. (C) 2013