Class Graph


public class Graph
extends java.lang.Object

Field Summary

(package private) Color
Normal_Color
(package private) Color
actual_Color
(package private) Color
cost_Color
private ArrayList
nodes
private int
radius
(package private) Color
select_Color
private Node
startNode
(package private) Color
start_Color
private ArrayList
vertexes

Constructor Summary

Graph()

Method Summary

void
addNode(Node n)
void
addVertex(Vertex v)
(package private) Vertex
clickedOnWeight(int x, int y)
double
getMaxWeight()
Node
getNode(String name)
Node
getNode(int i)
ArrayList
getNodes()
int
getRadius()
Returns the radius.
int
getSize()
Node
getStartNode()
Returns the startVertex.
Vertex
getVertex(Node n1, Node n2)
Vertex
getVertex(int i)
ArrayList
getVertexes()
double
getWeight(int s, int d)
void
removeAllVertexesWithNode(Node n)
void
removeNode(Node n)
void
reset()
void
setNode(int i, Node node)
void
setNodes(ArrayList nodes)
Sets the nodes.
void
setRadius(int radius)
Sets the radius.
void
setStartNode(Node startVertex)
Sets the startVertex.
protected void
setStartNode(String string)
void
setVertex(Vertex vertex)
void
setVertexes(ArrayList vertexes)
Sets the vertexes.
void
updateNodeCosts()

Field Details

Normal_Color

(package private) final Color Normal_Color

actual_Color

(package private) final Color actual_Color

cost_Color

(package private) final Color cost_Color

nodes

private ArrayList nodes

radius

private int radius

select_Color

(package private) final Color select_Color

startNode

private Node startNode

start_Color

(package private) final Color start_Color

vertexes

private ArrayList vertexes

Constructor Details

Graph

public Graph()

Method Details

addNode

public void addNode(Node n)

addVertex

public void addVertex(Vertex v)

clickedOnWeight

(package private)  Vertex clickedOnWeight(int x,
                                          int y)

getMaxWeight

public double getMaxWeight()
Returns:

getNode

public Node getNode(String name)

getNode

public Node getNode(int i)

getNodes

public ArrayList getNodes()

getRadius

public int getRadius()
Returns the radius.
Returns:
int

getSize

public int getSize()
Returns:

getStartNode

public Node getStartNode()
Returns the startVertex.
Returns:
Node

getVertex

public Vertex getVertex(Node n1,
                        Node n2)

getVertex

public Vertex getVertex(int i)

getVertexes

public ArrayList getVertexes()

getWeight

public double getWeight(int s,
                        int d)
Parameters:
s -
Returns:

removeAllVertexesWithNode

public void removeAllVertexesWithNode(Node n)
Parameters:
n -

removeNode

public void removeNode(Node n)
Parameters:
n -

reset

public void reset()

setNode

public void setNode(int i,
                    Node node)

setNodes

public void setNodes(ArrayList nodes)
Sets the nodes.
Parameters:
nodes - The nodes to set

setRadius

public void setRadius(int radius)
Sets the radius.
Parameters:
radius - The radius to set

setStartNode

public void setStartNode(Node startVertex)
Sets the startVertex.
Parameters:
startVertex - The startVertex to set

setStartNode

protected void setStartNode(String string)
Parameters:
string -

setVertex

public void setVertex(Vertex vertex)

setVertexes

public void setVertexes(ArrayList vertexes)
Sets the vertexes.
Parameters:
vertexes - The vertexes to set

updateNodeCosts

public void updateNodeCosts()