|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnanomunchers.ui.Drawing
All of the functions for drawing either Nanomunchers or the graph are done through this class.
Constructor Summary | |
Drawing()
|
Method Summary | |
void |
drawBotAlive(java.awt.Graphics g,
java.awt.Color c,
int x,
int y,
int nextX,
int nextY)
|
void |
drawBotDead(java.awt.Graphics g,
java.awt.Color c,
int x,
int y,
int nextX,
int nextY)
Draws a bot that has exhausted the food supply. |
void |
drawBotSlain(java.awt.Graphics g,
java.awt.Color c,
int x,
int y,
int nextX,
int nextY)
Draws a bot that was killed by conflict |
void |
drawEdge(java.awt.Graphics g,
java.awt.Color c,
Edge e,
int thickness)
|
void |
drawGraph(java.awt.Graphics g,
java.awt.Color c,
int width,
int height)
May stretch the graph a bit out of proportion, tries to ensure the whole graph fitting. |
void |
highlightEdge(java.awt.Graphics g,
java.awt.Color c,
Edge e,
int thickness)
Similar to draw edge, but also draws the end nodes. |
void |
setGraph(Graph g)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Drawing()
Method Detail |
public void setGraph(Graph g)
g
- Graph that may be drawnpublic void drawGraph(java.awt.Graphics g, java.awt.Color c, int width, int height)
g
- Graphics contextc
- color for the edges and nodes of the graphwidth
- maximum for drawingheight
- maximum for drawingpublic void drawEdge(java.awt.Graphics g, java.awt.Color c, Edge e, int thickness)
g
- Graphics contextc
- Color for edgee
- being drawnthickness
- = 1 + 2*thickness pixels for the width of the edge.public void highlightEdge(java.awt.Graphics g, java.awt.Color c, Edge e, int thickness)
g
- Graphics contextc
- Color for edgee
- being drawnthickness
- = 1 + 2*thickness pixels for the width of the edge.public void drawBotAlive(java.awt.Graphics g, java.awt.Color c, int x, int y, int nextX, int nextY)
g
- Graphics contextc
- color for the bot's bodyx
- position of the center of the bot's bodyy
- position of the center of the bot's bodynextX
- future position for the bot's bodynextY
- future position for the bot's bodypublic void drawBotDead(java.awt.Graphics g, java.awt.Color c, int x, int y, int nextX, int nextY)
g
- Graphics contextc
- color for the bot's bodyx
- position of the center of the bot's bodyy
- position of the center of the bot's bodynextX
- future position for the bot's body.nextY
- future position for the bot's body.public void drawBotSlain(java.awt.Graphics g, java.awt.Color c, int x, int y, int nextX, int nextY)
g
- Graphics contextc
- color for the bot's bodyx
- position of the center of the bot's bodyy
- position of the center of the bot's bodynextX
- future position for the bot's body.nextY
- future position for the bot's body.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |