|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectsema.Drawing
Graphics and parameters. This class is in charge of all the drawing within the simulation. An element of the world must use this class to draw itself, because Drawing is the only class in Sema which knows the graphics context. The main advantage is that the elements don't have to convert dimensions between simulated units and pixels.
| Field Summary | |
float |
boxFactor
Default boxfactor to use for the simulation. |
float |
centerX
X-coordinate to center the map by default. |
float |
centerY
Y-coordinate to center the map by default. |
float |
maxTfactor
Max value of the time factor slider in the interface. |
float |
maxZoom
Max value of the zoom slider in the interface. |
float |
minTfactor
Max value of the time factor slider in the interface. |
float |
minZoom
Min value of the zoom slider in the interface. |
float |
pixelsByBoxZoom1x
Pixels by square box side, when zoom=1. |
float |
pixelsByUnitZoom1x
Pixels by simulated unit, when zoom=1. |
int |
realDelay
Default virtual delay (in ms) between to displays of the world in the graphical interface. |
float |
tFactor
Default temporal factor. |
float |
virtualDelay
Default virtual delay (in ms) between to displays of the world in the graphical interface. |
| Constructor Summary | |
Drawing(float pixelsByUnitZoom1x,
float boxLength,
float minZoom,
float maxZoom,
float minTfactor,
float maxTfactor,
float tFactor,
float zoomFactor,
int virtualD,
int realD,
float centerX,
float centerY,
int boxFactor)
New graphical interface for the simulation. |
|
| Method Summary | |
void |
draw(java.awt.Graphics2D g,
java.util.Vector boxToRefresh)
Draws the world. |
void |
drawCircle(float x,
float y,
float radius)
Draws a circle. |
void |
drawImage(java.awt.Image image,
float x,
float y,
float xLength,
float yLength)
Draws a picture. |
void |
drawImage(java.awt.Image image,
float x0,
float y0,
float xLength,
float yLength,
float angle,
float x,
float y)
Draws a picture, provided an angle and a center of rotation. |
void |
drawLine(float x1,
float y1,
float x2,
float y2)
Draws a line. |
void |
drawRect(float x,
float y,
float xLength,
float yLength)
Draws a rectangle. |
void |
drawRect(float x0,
float y0,
float xLength,
float yLength,
float angle,
float x,
float y)
Draws a rectangle, provided its angle and a center of rotation. |
void |
drawRoundRect(float x,
float y,
float xLength,
float yLength)
Draws a round rectangle. |
void |
drawString(java.lang.String s,
float x,
float y)
|
void |
fillCircle(float x,
float y,
float radius)
Fills a circle. |
void |
fillRect(float x,
float y,
float xLength,
float yLength)
Fills a rectangle. |
void |
fillRect(float x0,
float y0,
float xLength,
float yLength,
float angle,
float x,
float y)
Fills a rectangle, provided its angle and a center of rotation. |
void |
fillRoundRect(float x,
float y,
float xLength,
float yLength)
Fills a round rectangle. |
float |
getPixelsByBox()
Pixels by square box side (with current zoom). |
float |
getPixelsByUnit()
Pixels by simulated unit (with current zoom). |
float |
getZoom()
Current zoom. |
void |
setColor(java.awt.Color c)
Sets the color of drawing. |
void |
setZoom(float z)
Sets the current zoom. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public final float boxFactor
public final float pixelsByUnitZoom1x
public final float pixelsByBoxZoom1x
public final float centerX
public final float centerY
public final float minZoom
public final float maxZoom
public final float minTfactor
public final float maxTfactor
public final float tFactor
public final float virtualDelay
public final int realDelay
System.currentTimeMillis() is an integer (a long),
it doesn't need to be a float.
| Constructor Detail |
public Drawing(float pixelsByUnitZoom1x,
float boxLength,
float minZoom,
float maxZoom,
float minTfactor,
float maxTfactor,
float tFactor,
float zoomFactor,
int virtualD,
int realD,
float centerX,
float centerY,
int boxFactor)
| Method Detail |
public void draw(java.awt.Graphics2D g,
java.util.Vector boxToRefresh)
public void setZoom(float z)
public float getZoom()
public float getPixelsByBox()
public float getPixelsByUnit()
public void setColor(java.awt.Color c)
public void drawLine(float x1,
float y1,
float x2,
float y2)
public void drawRect(float x,
float y,
float xLength,
float yLength)
public void drawRoundRect(float x,
float y,
float xLength,
float yLength)
public void fillRoundRect(float x,
float y,
float xLength,
float yLength)
public void drawRect(float x0,
float y0,
float xLength,
float yLength,
float angle,
float x,
float y)
public void fillRect(float x,
float y,
float xLength,
float yLength)
public void fillRect(float x0,
float y0,
float xLength,
float yLength,
float angle,
float x,
float y)
public void drawCircle(float x,
float y,
float radius)
public void fillCircle(float x,
float y,
float radius)
public void drawImage(java.awt.Image image,
float x,
float y,
float xLength,
float yLength)
public void drawImage(java.awt.Image image,
float x0,
float y0,
float xLength,
float yLength,
float angle,
float x,
float y)
public void drawString(java.lang.String s,
float x,
float y)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||