data
Class Node

java.lang.Object
  extended by data.Sprite
      extended by data.Node
All Implemented Interfaces:
Drawable

public class Node
extends Sprite

Author:
"Daniel Pardo" The node class represents nodes of the graph.

Each node contains an id, a name, a size and a link to a graphic.


Field Summary
static int maxID
           
static int overAllVisitedCounter
           
 
Constructor Summary
Node(int iD, float size, java.lang.String name)
           
Node(int iD, float size, java.lang.String name, java.lang.String graphic)
           
 
Method Summary
 boolean draw(javax.media.opengl.GL gl)
          draws an object in OpenGL context
 float getAngle()
          return the angle of the node
 float getAngularWidth()
          return the angular width of the node
 java.util.LinkedList<Node> getChildren()
          return the children of the node
 Node getFather()
          return the father of the node
 java.lang.String getGraphic()
          return the graphic of the node
 int getID()
          returns the ID of the node
 java.lang.String getName()
          return the name of the node
 java.util.LinkedList<Node> getNeighbors()
          return the neighbors of the node
 float getOldAngle()
          return the old angle of the node
 int getOldRing()
          return the old ring of the node
 java.util.LinkedList<Node> getOthers()
          return the others of the node
 int getRing()
          return the ring on that the node lays
 float getSectorEnd()
          return the sector end of the node
 float getSectorStart()
          return the sector start of the node
 float getSize()
          retuns the size of the node
 int getVisitedCounter()
          return the visitedCounter(used by GraphProcessing) of the node
 boolean init(javax.media.opengl.GL gl)
          initializes the Drawable in OpenGL context
 boolean isDeleted()
          return if the node is/shall be deleted
 void setAngle(float angle)
          sets the angle of the node
 void setAngularWidth(float angularWidth)
          sets the angular width of the node
 void setChildren(java.util.LinkedList<Node> children)
          sets the children of the node
 void setDeleted(boolean isDeleted)
          sets if the node is/shall be deleted
 void setFather(Node father)
          sets the father of the node
 void setGraphic(java.lang.String graphic)
          sets the graphic of the node
 void setID(int iD)
          sets the ID of the node
 void setName(java.lang.String name)
          sets the name of the node
 void setNeighbors(java.util.LinkedList<Node> neighbors)
          sets the neighbors of the node
 void setOldAngle(float oldAngle)
          sets the old angle of the node
 void setOldRing(int oldRing)
          sets the old ring of the node
 void setOthers(java.util.LinkedList<Node> others)
          sets the others of the node
 void setRing(int ring)
          sets the ring on that the node lays
 void setSectorEnd(float sectorEnd)
          sets the sector end of the node
 void setSectorStart(float sectorStart)
          sets the sector start of the node
 void setSize(float size)
          sets the size of the node
 void setVisitedCounter(int visitedCounter)
          sets the visitedCounter(used by GraphProcessing) of the node
 java.lang.String toString()
           
 
Methods inherited from class data.Sprite
getPosition, loadTexture, setImageFile, setPosition
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

overAllVisitedCounter

public static int overAllVisitedCounter

maxID

public static int maxID
Constructor Detail

Node

public Node(int iD,
            float size,
            java.lang.String name)

Node

public Node(int iD,
            float size,
            java.lang.String name,
            java.lang.String graphic)
Method Detail

draw

public boolean draw(javax.media.opengl.GL gl)
Description copied from interface: Drawable
draws an object in OpenGL context

Specified by:
draw in interface Drawable
Overrides:
draw in class Sprite
Parameters:
gl - GL-context
Returns:
false if fails ton draaw and shall be deleted

getID

public int getID()
returns the ID of the node

Returns:
ID

setID

public void setID(int iD)
sets the ID of the node

Parameters:
iD -

getSize

public float getSize()
retuns the size of the node

Returns:
size

setSize

public void setSize(float size)
sets the size of the node

Parameters:
size -

getName

public java.lang.String getName()
return the name of the node

Returns:
name

setName

public void setName(java.lang.String name)
sets the name of the node

Parameters:
name -

getGraphic

public java.lang.String getGraphic()
return the graphic of the node

Returns:
graphic

setGraphic

public void setGraphic(java.lang.String graphic)
sets the graphic of the node

Parameters:
graphic -

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getVisitedCounter

public int getVisitedCounter()
return the visitedCounter(used by GraphProcessing) of the node

Returns:
visitedCounter

setVisitedCounter

public void setVisitedCounter(int visitedCounter)
sets the visitedCounter(used by GraphProcessing) of the node

Parameters:
visitedCounter -

getRing

public int getRing()
return the ring on that the node lays

Returns:
ring

setRing

public void setRing(int ring)
sets the ring on that the node lays

Parameters:
ring -

getAngle

public float getAngle()
return the angle of the node

Returns:
angle

setAngle

public void setAngle(float angle)
sets the angle of the node

Parameters:
angle -

getSectorStart

public float getSectorStart()
return the sector start of the node

Returns:
sectorStart

setSectorStart

public void setSectorStart(float sectorStart)
sets the sector start of the node

Parameters:
sectorStart -

getSectorEnd

public float getSectorEnd()
return the sector end of the node

Returns:
sectorEnd

setSectorEnd

public void setSectorEnd(float sectorEnd)
sets the sector end of the node

Parameters:
sectorEnd -

getOldRing

public int getOldRing()
return the old ring of the node

Returns:
oldRing

setOldRing

public void setOldRing(int oldRing)
sets the old ring of the node

Parameters:
oldRing -

getOldAngle

public float getOldAngle()
return the old angle of the node

Returns:
oldAngle

setOldAngle

public void setOldAngle(float oldAngle)
sets the old angle of the node

Parameters:
oldAngle -

init

public boolean init(javax.media.opengl.GL gl)
Description copied from interface: Drawable
initializes the Drawable in OpenGL context

Specified by:
init in interface Drawable
Overrides:
init in class Sprite
Parameters:
gl - gl context
Returns:
false if fails to initialize

setNeighbors

public void setNeighbors(java.util.LinkedList<Node> neighbors)
sets the neighbors of the node

Parameters:
neighbors -

getNeighbors

public java.util.LinkedList<Node> getNeighbors()
return the neighbors of the node

Returns:
neighbors

getChildren

public java.util.LinkedList<Node> getChildren()
return the children of the node

Returns:
children

setChildren

public void setChildren(java.util.LinkedList<Node> children)
sets the children of the node

Parameters:
children -

getOthers

public java.util.LinkedList<Node> getOthers()
return the others of the node

Returns:
others

setOthers

public void setOthers(java.util.LinkedList<Node> others)
sets the others of the node

Parameters:
others -

getFather

public Node getFather()
return the father of the node

Returns:
father

setFather

public void setFather(Node father)
sets the father of the node

Parameters:
father -

isDeleted

public boolean isDeleted()
return if the node is/shall be deleted

Returns:
is deleted?

setDeleted

public void setDeleted(boolean isDeleted)
sets if the node is/shall be deleted

Parameters:
isDeleted -

setAngularWidth

public void setAngularWidth(float angularWidth)
sets the angular width of the node

Parameters:
angularWidth -

getAngularWidth

public float getAngularWidth()
return the angular width of the node

Returns:
angularWidth