All Packages Class Hierarchy This Package Previous Next Index
Class convexHull.Graphics2D
java.lang.Object
|
+----convexHull.Graphics2D
- public class Graphics2D
- extends Object
This class allows to draw scaled graphics.
-
g
-
-
maxx
-
-
maxy
-
-
minx
-
-
miny
-
-
outh
-
-
outw
-
-
Graphics2D(Graphics, double, double, double, double, int, int)
- Constructor - sets the bounding box for the graphics.
-
clearRect(double, double, double, double)
- Clears given rectangle.
-
drawLine(double, double, double, double)
- Draw line.
-
drawPoint(double, double, int)
- Draw a point with given size.
-
drawRect(double, double, double, double)
- Draw rectangle.
-
drawString(String, double, double)
- Draw a string at specified coordinates.
-
setColor(Color)
- Sets the current color.
-
th(double)
- Translate the height in model units into screen units.
-
tw(double)
- Translate the width in model units into screen units.
-
tx(double)
- Translate the x coordinate into screen coordinates.
-
ty(double)
- Translate the y coordinate into screen coordinates.
g
private Graphics g
minx
private double minx
miny
private double miny
maxx
private double maxx
maxy
private double maxy
outw
private int outw
outh
private int outh
Graphics2D
public Graphics2D(Graphics g,
double minx,
double miny,
double maxx,
double maxy,
int outw,
int outh)
- Constructor - sets the bounding box for the graphics.
[minx,miny] will be the left bottom corner of the window.
- Parameters:
- g - Graphics associted with this 2D graphics
- minx - left edge
- maxx - right edge
- miny - bottom edge
- maxy - top edge
- outw - output width
- outh - output height
setColor
public void setColor(Color color)
- Sets the current color.
- Parameters:
- color - new color
clearRect
public void clearRect(double x,
double y,
double w,
double h)
- Clears given rectangle.
- Parameters:
- x - the x coordinate
- y - the y coordinate
- w - the width of the rectangle
- h - the height of the rectangle
drawRect
public void drawRect(double x,
double y,
double w,
double h)
- Draw rectangle.
- Parameters:
- x - the x coordinate
- y - the y coordinate
- w - the width of the rectangle
- h - the height of the rectangle
drawLine
public void drawLine(double x1,
double y1,
double x2,
double y2)
- Draw line.
- Parameters:
- x1 - the x coordinate of the starting point
- y1 - the y coordinate of the starting point
- x2 - the x coordinate of the ending point
- y2 - the y coordinate of the ending point
drawPoint
public void drawPoint(double x,
double y,
int size)
- Draw a point with given size.
- Parameters:
- x - the x coordinate of the point
- y - the y coordinate of the point
- the - size of the point in pixels (drawn as a rectangle)
drawString
public void drawString(String s,
double x,
double y)
- Draw a string at specified coordinates.
- Parameters:
- s - string to draw
- x - the x coordinate of the string
- y - the y coordinate of the string
tx
private int tx(double x)
- Translate the x coordinate into screen coordinates.
ty
private int ty(double y)
- Translate the y coordinate into screen coordinates.
tw
private int tw(double w)
- Translate the width in model units into screen units.
th
private int th(double h)
- Translate the height in model units into screen units.
All Packages Class Hierarchy This Package Previous Next Index