|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.reades.mapthing.Node
public class Node
A simple node class that holds references to a position and an identifier. You would usually want to extend this class to do something more clever, but this is also used internally to hold the transformed coordinates within a Polygons/Lines/Points object.
The idea here is that we take our complex geographic coordinates from the data source and turn them into simple objects that are easy to draw in Processing as this will be faster and it will also be simpler to move them around and do things like zoom and pan.
Link
,
Serialized FormField Summary | |
---|---|
boolean |
DEBUG
|
Constructor Summary | |
---|---|
Node(int id,
double nx,
double ny)
Create a Node object |
|
Node(int id,
double nx,
double ny,
double nz,
double val)
Create a Node object |
|
Node(int id,
double nx,
double ny,
double nz,
double val,
String nm)
Create a Node object |
|
Node(int id,
double nx,
double ny,
double nz,
String nm)
Create a Node object |
|
Node(int id,
double nx,
double ny,
String nm)
Create a Node object |
Method Summary | |
---|---|
int |
getId()
Get the (preferably) unique identifier |
String |
getName()
Get the (preferably) unique name |
double |
getValue()
A better way to get a value that is distinct from some z-value such as an altitude. |
float |
getX()
The x-position of the node |
float |
getY()
The y-position of the node |
float |
getZ()
The z-position of the node -- you can overload this as the value of the node if you like since it doesn't have to be a geographical z-axis. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public boolean DEBUG
Constructor Detail |
---|
public Node(int id, double nx, double ny)
id
- a (preferably) unique identifier for the nodenx
- the x-position of the node (usually in pixels)ny
- the y-position of the node (usually in pixels)public Node(int id, double nx, double ny, String nm)
id
- a (preferably) unique identifier for the nodenx
- the x-position of the node (usually in pixels)ny
- the y-position of the node (usually in pixels)nm
- the name of the node (useful for having labels)public Node(int id, double nx, double ny, double nz, String nm)
id
- a (preferably) unique identifier for the nodenx
- the x-position of the node (usually in pixels)ny
- the y-position of the node (usually in pixels)nz
- the z-position of the node (usually in pixels)nm
- the name of the node (useful for having labels)public Node(int id, double nx, double ny, double nz, double val)
id
- a (preferably) unique identifier for the nodenx
- the x-position of the node (usually in pixels)ny
- the y-position of the node (usually in pixels)nz
- the z-position of the node (usually in pixels)val
- the value of the node (usually some kind of double)public Node(int id, double nx, double ny, double nz, double val, String nm)
id
- a (preferably) unique identifier for the nodenx
- the x-position of the node (usually in pixels)ny
- the y-position of the node (usually in pixels)nz
- the z-position of the node (usually in pixels)val
- the value of the node (usually some kind of double)nm
- the name of the node (useful for having labels)Method Detail |
---|
public int getId()
public String getName()
public float getX()
public float getY()
public float getZ()
public double getValue()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |