Package visualizationElements
Klasse Graph
java.lang.Object
visualizationElements.VisualizationElement
visualizationElements.Graph
Represents a graph to visualize search algorithms.
-
Feldübersicht
-
Konstruktorübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
Draws the visualization element.private void
drawDirectedAngeledEdge
(Graphics g, Edge edge) Draws an directed angled edge.private void
drawDirectedDirectEdge
(Graphics g, Edge edge) Draws an directed direct edge.private void
drawUndirectedAngeledEdge
(Graphics g, Edge edge) Draws an undirected angled Edge.private void
drawUndirectedDirectEdge
(Graphics g, Edge edge) Draws an undirected direct Edge.getEdges()
private boolean
Decides whether the graph has an edge between two vertexes.boolean
void
setDirected
(boolean isDirected) void
void
setEdgeStyle
(EdgeStyle edgeStyle) void
setVertexes
(Vector<Vertex> vertexes)
-
Felddetails
-
vertexes
-
edges
-
isDirected
private boolean isDirected -
edgeStyle
-
-
Konstruktordetails
-
Graph
Creates a new Graph.- Parameter:
vertexes
- Vertexes containing to the graph.edges
- Edge containing to the graph.isDirected
- Value whether the graph is directed or undirected.edgeStyle
- Value in which style the edges will be drawn.
-
-
Methodendetails
-
draw
Beschreibung aus Klasse kopiert:VisualizationElement
Draws the visualization element.- Angegeben von:
draw
in KlasseVisualizationElement
- Parameter:
g
- The Graphics object to draw the element to the DrawArea.
-
setDirected
public void setDirected(boolean isDirected) - Parameter:
isDirected
- the isDirected to set
-
isDirected
public boolean isDirected()- Gibt zurück:
- the isDirected
-
setEdgeStyle
- Parameter:
edgeStyle
- the edgeStyle to set
-
getEdgeStyle
- Gibt zurück:
- the edge style
-
setVertexes
- Parameter:
vertexes
- The vertexes of the graph.
-
getVertexes
- Gibt zurück:
- the graph's vertexes.
-
setEdges
- Parameter:
edges
- The edges of the graph.
-
getEdges
- Gibt zurück:
- the graph's edges.
-
drawDirectedAngeledEdge
Draws an directed angled edge.- Parameter:
g
- Graphics object to draw to drawArea.edge
- The edge to draw.
-
drawDirectedDirectEdge
Draws an directed direct edge.- Parameter:
g
- Graphics object to draw to drawArea.edge
- The edge to draw.
-
drawUndirectedDirectEdge
Draws an undirected direct Edge.- Parameter:
g
- Graphics object to draw to drawArea.edge
- The edge to draw.
-
drawUndirectedAngeledEdge
Draws an undirected angled Edge.- Parameter:
g
- Graphics object to draw to drawArea.edge
- The edge to draw.
-
hasEdge
Decides whether the graph has an edge between two vertexes.- Parameter:
source
- The source vertex.destination
- The destination vertex.- Gibt zurück:
- True if there is an edge between the two vertexes, false otherwise.
-