grafica
Class GPoint

java.lang.Object
  extended by grafica.GPoint

public class GPoint
extends Object

Point class. A GPoint is composed of two coordinates (x, y) and a text label

Author:
Javier Gracia Carpio http://www.openprocessing.org/user/16300

Constructor Summary
GPoint(float x, float y)
          Constructor
GPoint(float x, float y, String label)
          Constructor
GPoint(GPoint point)
          Constructor
GPoint(PVector v)
          Constructor
GPoint(PVector v, String label)
          Constructor
 
Method Summary
 String getLabel()
          Returns the point text label
 boolean getValid()
          Returns if the point coordinates are valid or not
 float getX()
          Returns the point x coordinate
 float getY()
          Returns the point y coordinate
 boolean isValid()
          Returns if the point coordinates are valid or not
 void set(float newX, float newY, String newLabel)
          Sets the point x and y coordinates and the label
 void set(GPoint point)
          Sets the point x and y coordinates and the label
 void set(PVector v, String newLabel)
          Sets the point x and y coordinates and the label
 void setLabel(String newLabel)
          Sets the point text label
 void setX(float newX)
          Sets the point x coordinate
 void setXY(float newX, float newY)
          Sets the point x and y coordinates
 void setXY(PVector v)
          Sets the point x and y coordinates
 void setY(float newY)
          Sets the point y coordinate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GPoint

public GPoint(float x,
              float y,
              String label)
Constructor

Parameters:
x - the x coordinate
y - the y coordinate
label - the text label

GPoint

public GPoint(float x,
              float y)
Constructor

Parameters:
x - the x coordinate
y - the y coordinate

GPoint

public GPoint(PVector v,
              String label)
Constructor

Parameters:
v - the Processing vector containing the point coordinates
label - the text label

GPoint

public GPoint(PVector v)
Constructor

Parameters:
v - the Processing vector containing the point coordinates

GPoint

public GPoint(GPoint point)
Constructor

Parameters:
point - a GPoint
Method Detail

set

public void set(float newX,
                float newY,
                String newLabel)
Sets the point x and y coordinates and the label

Parameters:
newX - the new x coordinate
newY - the new y coordinate
newLabel - the new point text label

set

public void set(GPoint point)
Sets the point x and y coordinates and the label

Parameters:
point - the point to use as a reference

set

public void set(PVector v,
                String newLabel)
Sets the point x and y coordinates and the label

Parameters:
v - the Processing vector with the new point coordinates
newLabel - the new point text label

setX

public void setX(float newX)
Sets the point x coordinate

Parameters:
newX - the new x coordinate

setY

public void setY(float newY)
Sets the point y coordinate

Parameters:
newY - the new y coordinate

setXY

public void setXY(float newX,
                  float newY)
Sets the point x and y coordinates

Parameters:
newX - the new x coordinate
newY - the new y coordinate

setXY

public void setXY(PVector v)
Sets the point x and y coordinates

Parameters:
v - the Processing vector with the new point coordinates

setLabel

public void setLabel(String newLabel)
Sets the point text label

Parameters:
newLabel - the new point text label

getX

public float getX()
Returns the point x coordinate

Returns:
the point x coordinate

getY

public float getY()
Returns the point y coordinate

Returns:
the point y coordinate

getLabel

public String getLabel()
Returns the point text label

Returns:
the point text label

getValid

public boolean getValid()
Returns if the point coordinates are valid or not

Returns:
true if the point coordinates are valid

isValid

public boolean isValid()
Returns if the point coordinates are valid or not

Returns:
true if the point coordinates are valid


Processing library grafica by Javier Gracia Carpio. (c) 2013