|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvitro.graph.GraphView
public class GraphView
Field Summary | |
---|---|
Graph |
model
|
Constructor Summary | |
---|---|
GraphView(Graph model,
Controller controller,
int width,
int height)
|
|
GraphView(Graph model,
Controller controller,
int width,
int height,
ColorScheme palette)
|
|
GraphView(GraphView other)
|
Method Summary | |
---|---|
ColorScheme |
colorScheme()
Obtain the ColorScheme used by this View. |
Controller |
controller()
Obtain a reference to the Controller associated with this View. |
Edge |
createEdge(Node start,
Node end)
|
Node |
createNode(double x,
double y)
|
Node |
createNode(double x,
double y,
String label)
|
boolean |
done()
|
void |
draw(Graphics2D g)
Draw this view. |
void |
flush()
Release any transient view state and update the View to reflect the current state of the Model. |
int |
height()
Obtain the preferred height of this View, in pixels. |
Node[][] |
layoutGrid(int xSize,
int ySize)
|
void |
tick(double time)
Advance the state of the simulation. |
int |
width()
Obtain the preferred width of this View, in pixels. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final Graph model
Constructor Detail |
---|
public GraphView(Graph model, Controller controller, int width, int height, ColorScheme palette)
public GraphView(Graph model, Controller controller, int width, int height)
public GraphView(GraphView other)
Method Detail |
---|
public ColorScheme colorScheme()
View
colorScheme
in interface View
public Controller controller()
View
controller
in interface View
public int width()
View
width
in interface View
public int height()
View
height
in interface View
public Node createNode(double x, double y)
public Node createNode(double x, double y, String label)
public Edge createEdge(Node start, Node end)
public Node[][] layoutGrid(int xSize, int ySize)
public void tick(double time)
View
tick
in interface View
time
- the amount of time that has passed since the last tickpublic void flush()
View
flush
in interface View
public boolean done()
public void draw(Graphics2D g)
View
draw
in interface View
g
- the target Graphics2D surface.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |