routing
Class Nodes

java.lang.Object
  |
  +--routing.Nodes

public class Nodes
extends java.lang.Object

Container class for the class Node.


Field Summary
protected  int maxMark
          Highest existing mark
protected  int[] minScale
          Scale boundaries for the visiblity of the nodes
protected  int[] minTextScale
          Scale boundaries for the visiblity of the node texts
protected  int nullMark
          Value of the mark which corresponds to unmarked
 
Constructor Summary
Nodes(Edges edges)
          Konstruktor.
Nodes(int numOfClasses)
          Konstruktor.
 
Method Summary
 void clearAllMarks()
          Die Markierungen aller Knoten werden gelöscht.
 java.util.Enumeration elements()
          Gibt Enumeration über alle Knoten zurück.
 Node findNearest(int x, int y)
          Finds the nearest node to the position (x,y).
 Node get(long id)
          Gibt den Knoten zurück, der die angegebene ID besitzt.
 long getNextFreeId()
          Returns the next free identifier.
 int getNumOfClasses()
          Returns the number of node classes.
 void initPresentation(java.awt.Color[] color, java.awt.Color highlightColor)
          Initialisiert die Darstellung der Knoten.
 Node newNode(long id, int x, int y, java.lang.String name)
          Creates a new node in the container.
 int numOfNodes()
          Gibt die Anzahl der gespeicherten Knoten zurück.
 Node read(java.io.DataInput in)
          Liest einen Knoten vom DataInput.
 boolean removeNode(Node node)
          Removes the node if its number of edges is zero.
 void setMinScaleArray(int[] newMinScale)
          Setzt die Maßstabsgrenzen der Kantenklassen neu.
 void setMinTextScaleArray(int[] newMinTextScale)
          Setzt die Text-Maßstabsgrenzen der Kantenklassen neu.
 void setNumOfClasses(int num)
          Sets the number of node classes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nullMark

protected int nullMark
Value of the mark which corresponds to unmarked


maxMark

protected int maxMark
Highest existing mark


minScale

protected int[] minScale
Scale boundaries for the visiblity of the nodes


minTextScale

protected int[] minTextScale
Scale boundaries for the visiblity of the node texts

Constructor Detail

Nodes

public Nodes(int numOfClasses)
Konstruktor.

Parameters:
numOfClasses - Anzahl der Knotenklassen

Nodes

public Nodes(Edges edges)
Konstruktor.

Parameters:
edges - Container über Kanten
Method Detail

clearAllMarks

public void clearAllMarks()
Die Markierungen aller Knoten werden gelöscht.


elements

public java.util.Enumeration elements()
Gibt Enumeration über alle Knoten zurück.

Returns:
Enumeration der Knoten

findNearest

public Node findNearest(int x,
                        int y)
Finds the nearest node to the position (x,y).

Parameters:
x - x-coordinate
y - y-coordinate
Returns:
the node

get

public Node get(long id)
Gibt den Knoten zurück, der die angegebene ID besitzt. Gibt es keinen solchen Knoten, wird null zurückgegeben.

Parameters:
id - ID des Knotens
Returns:
ggf. gefundener Knoten

getNextFreeId

public long getNextFreeId()
Returns the next free identifier.

Returns:
free identifier

getNumOfClasses

public int getNumOfClasses()
Returns the number of node classes.

Returns:
number of node classes

initPresentation

public void initPresentation(java.awt.Color[] color,
                             java.awt.Color highlightColor)
Initialisiert die Darstellung der Knoten.

Parameters:
color - Farben für die Kantenklassen
highlightColor - Hervorhebungsfarbe

newNode

public Node newNode(long id,
                    int x,
                    int y,
                    java.lang.String name)
Creates a new node in the container.

Parameters:
id - id of the node
x - x-coordinate
y - y-coordinate
name - name (may be null)
Returns:
the new node

numOfNodes

public int numOfNodes()
Gibt die Anzahl der gespeicherten Knoten zurück.

Returns:
Anzahl

read

public Node read(java.io.DataInput in)
Liest einen Knoten vom DataInput. Schlägt das Einlesen fehl, wird null zurückgegeben.

Parameters:
in - Data-Input
Returns:
eingelesener Knoten

removeNode

public boolean removeNode(Node node)
Removes the node if its number of edges is zero.

Parameters:
node - node to be removed
Returns:
successful?

setMinScaleArray

public void setMinScaleArray(int[] newMinScale)
Setzt die Maßstabsgrenzen der Kantenklassen neu.

Parameters:
newMinScale - Maßstabsgrenzen

setMinTextScaleArray

public void setMinTextScaleArray(int[] newMinTextScale)
Setzt die Text-Maßstabsgrenzen der Kantenklassen neu.

Parameters:
newMinTextScale - Text-Maßstabsgrenzen

setNumOfClasses

public void setNumOfClasses(int num)
Sets the number of node classes.

Parameters:
num - number of node classes