public class GGPanel extends GGBackground
Modifier and Type | Method and Description |
---|---|
void |
arc(double radius,
double startAngle,
double extentAngle,
boolean fill)
Draws an arc (without bounding lines to center) with center
at current graph position, radius in user x-coordinates,
start angle and angle extent.
|
void |
arc(double centerX,
double centerY,
double radius,
double startAngle,
double extentAngle,
boolean fill)
Draws an arc (without bounding lines to center) with given center
coordinates, radius in user x-coordinates,
start angle and angle extent.
|
void |
arc(PointD center,
double radius,
double startAngle,
double extentAngle,
boolean fill)
Draws an arc (without bounding lines to center) with given center,
radius in user x-coordinates, start angle and angle extent.
|
void |
circle(double radius,
boolean fill)
Draws a circle with center at current graph position and given radius in user x-coordinates.
|
void |
circle(double centerX,
double centerY,
double radius,
boolean fill)
Draws a circle with given center coordinates and given radius in user x-coordinates.
|
void |
circle(PointD center,
double radius,
boolean fill)
Draws a circle with given center and given radius in user x-coordinates.
|
void |
clean()
Clears the frame buffer by painting it with the current background color.
|
void |
color(int color)
Sets the current paint color.
|
void |
draw(double x,
double y)
Draws a line from current graph position to the given coordinates
and sets the graph position to these coordinates.
|
void |
draw(PointD pt)
Draws a line from current graph position to the given point
and sets the graph position to this point.
|
void |
erase()
Same as clear(), but remains the current graph position unchanged.
|
double |
getUserHeight()
Returns the height (y-direction) in user coordinates.
|
double |
getUserWidth()
Returns the width (x-direction) in user coordinates.
|
double |
getXmax()
Returns the right value of the x-coordinate axis.
|
double |
getXmin()
Returns the left value of the x-coordinate axis.
|
double |
getYmax()
Returns the top value of the y-coordinate axis.
|
double |
getYmin()
Returns the bottom value of the y-coordinate axis.
|
void |
line(double x1,
double y1,
double x2,
double y2)
Draws a line from (x1, y1) to (x2, y2)
|
void |
line(PointD pt1,
PointD pt2)
Draws a line from the first vertext to the second vertex.
|
void |
move(double x,
double y)
Sets the current graph position to the given coordinates
(without drawin anything).
|
void |
move(PointD pt)
Sets the current graph position to the given point
(without drawin anything).
|
void |
point()
Draws a single point at the current graph position.
|
void |
point(double x,
double y)
Draws a single point at given coordinates.
|
void |
point(PointD pt)
Draws a single point at given coordinates.
|
void |
polygon(double[] x,
double[] y,
boolean fill)
Draws a polygon with given vertexes.
|
void |
polygon(PointD[] vertexes,
boolean fill)
Draws a polygon with given vertexes.
|
void |
rectangle(double width,
double height,
boolean fill)
Draws a rectangle with center at the current graph position
and given width and height.
|
void |
rectangle(double x1,
double y1,
double x2,
double y2,
boolean fill)
Draws/fills a rectangle with given opposite vertexes.
|
void |
rectangle(PointD pt1,
PointD pt2,
boolean fill)
Draws a rectangle with given opposite vertexes.
|
void |
sector(double radius,
double startAngle,
double extentAngle,
boolean fill)
Draws a sector (arc with bounding lines to center, pie)
with center at current graph position, radius in user x-coordinates,
start angle and angle extent.
|
void |
sector(double centerX,
double centerY,
double radius,
double startAngle,
double extentAngle,
boolean fill)
Draws a sector (arc with bounding lines to center, pie)
with given center coordinates, radius in user x-coordinates,
start angle and angle extent.
|
void |
sector(PointD center,
double radius,
double startAngle,
double extentAngle,
boolean fill)
Draws a sector (arc with bounding lines to center, pie)
with given center, radius in user x-coordinates,
start angle and angle extent.
|
void |
setAutoRefreshEnabled(boolean enable)
Enables the automatic refresh in every drawing method.
|
int |
toPixelDx(double dx)
Transforms horizontal user coordinates increment to pixel increment.
|
int |
toPixelDy(double dy)
Transforms vertical user coordinates increment to pixel increment.
|
android.graphics.Point |
toPixelPoint(PointD pt)
Transforms horizontal user coordinates to pixel coordinates.
|
int |
toPixelX(double x)
Transforms horizontal user coordinates to pixel coordinates.
|
int |
toPixelY(double y)
Transforms vertical user coordinates to pixel coordinates.
|
double |
toUserDx(int dx)
Transforms horizontal pixel coordinates increment to user increment.
|
double |
toUserDy(int dy)
Transforms vertical pixel coordinates increment to user increment.
|
PointD |
toUserPoint(android.graphics.Point ptPix)
Transforms pixel coordinates to user coordinates.
|
double |
toUserX(int xPix)
Transforms horizontal pixel coordinates to user coordinates.
|
double |
toUserY(int yPix)
Transforms vertical pixel coordinates to user coordinates.
|
void |
triangle(double x1,
double y1,
double x2,
double y2,
double x3,
double y3,
boolean fill)
Draws a triangle with given vertexes.
|
void |
triangle(PointD pt1,
PointD pt2,
PointD pt3,
boolean fill)
Draws a triangle with given vertexes.
|
void |
window(double ymin,
double ymax,
double xratio)
Sets the user coordinate system
(x from left to right, y from bottom to top).
|
void |
window(double xmin,
double xmax,
double ymin,
double ymax)
Sets the user coordinate system (x from left to right, y from bottom to top).
|
_drawRectangle, clear, clear, drawArc, drawCircle, drawFrame, drawGridLines, drawImage, drawLine, drawLine, drawPoint, drawPolygon, drawRectangle, drawRectangle, drawRectangle, drawSector, drawSprite, drawText, fillArc, fillCell, fillCell, fillCircle, fillPolygon, fillRectangle, fillRectangle, fillSector, floodFill, getBgAry, getBgBitmap, getBgBuffer, getBgColor, getBgImage, getCanvas, getColor, getColor, getLineWidth, getPaintColor, getShader, restore, save, setLineWidth, setPaintColor, setPaintMode, setShader, setXORMode
public int toPixelX(double x)
x
- the user x-coordinatepublic int toPixelDx(double dx)
dx
- the user x incrementpublic int toPixelDy(double dy)
dy
- the user y incrementpublic double toUserDx(int dx)
dx
- the pixel x incrementpublic double toUserDy(int dy)
dy
- the pixel y incrementpublic int toPixelY(double y)
y
- the user y-coordinatepublic android.graphics.Point toPixelPoint(PointD pt)
pt
- the user x-y-coordinatespublic double toUserX(int xPix)
xPix
- the pixel x-coordinatepublic double toUserY(int yPix)
yPix
- the pixel x-coordinatepublic PointD toUserPoint(android.graphics.Point ptPix)
ptPix
- the pixel x-y-coordinatespublic void window(double xmin, double xmax, double ymin, double ymax)
xmin
- x-axis value at leftxmax
- x-axis value at rightymin
- y-axis value at bottomymax
- y-axis value at toppublic void window(double ymin, double ymax, double xratio)
ymin
- y-axis value at bottomymax
- y-axis value at topxratio
- the fractional part of window width (x direction) where
the origin is placedpublic void line(double x1, double y1, double x2, double y2)
x1
- the x-coordinate of the first vertex.y1
- the y-coordinate of the first vertex.x2
- the x-coordinate of the second vertex.y2
- the y-coordinate of the second vertex.public void line(PointD pt1, PointD pt2)
pt1
- the first vertexpt2
- the second vertexpublic void move(double x, double y)
x
- the x-coordinate of the graph positiony
- the y-coordinate of the graph positionpublic void move(PointD pt)
pt
- the new graph positionpublic void draw(double x, double y)
x
- the x-coordinate of the end pointy
- the y-coordinate of the end pointpublic void draw(PointD pt)
pt
- the end pointpublic void circle(double centerX, double centerY, double radius, boolean fill)
centerX
- the x-coordinate of the centercenterY
- the y-coordinate of the centerradius
- the radius in x-coordinate unitsfill
- if true, the shape is filledpublic void circle(PointD center, double radius, boolean fill)
center
- the center of the circleradius
- the radius in x-coordinate unitsfill
- if true, the shape is filledpublic void circle(double radius, boolean fill)
radius
- the radius in x-coordinate unitsfill
- if true, the shape is filledpublic void rectangle(double x1, double y1, double x2, double y2, boolean fill)
x1
- x-coordinate of the first vertexy1
- y-coordinate of the first vertexx2
- x-coordinate of the opposite vertexy2
- y-coordinate of the opposite vertexfill
- if true, the shape is filledpublic void rectangle(PointD pt1, PointD pt2, boolean fill)
pt1
- the first vertexpt2
- the opposite vertexfill
- if true, the shape is filledpublic void rectangle(double width, double height, boolean fill)
width
- the width of the rectangleheight
- the height of the rectanglefill
- if true, the shape is filledpublic void arc(double centerX, double centerY, double radius, double startAngle, double extentAngle, boolean fill)
centerX
- the x-coordinate of the centercenterY
- the y-coordinate of the centerradius
- the radius in x-coordinate unitsstartAngle
- the start angle in degrees
(zero at east, positive counter-clockwise)extentAngle
- the angle extent in degreesfill
- if true, the shape is filledpublic void arc(PointD center, double radius, double startAngle, double extentAngle, boolean fill)
center
- the center of the arcradius
- the radius in x-coordinate unitsstartAngle
- the start angle in degrees
(zero at east, positive counter-clockwise)extentAngle
- the angle extent in degreesfill
- if true, the shape is filledpublic void arc(double radius, double startAngle, double extentAngle, boolean fill)
radius
- the radius in x-coordinate unitsstartAngle
- the start angle in degrees
(zero at east, positive counter-clockwise)extentAngle
- the angle extent in degreesfill
- if true, the shape is filledpublic void sector(double centerX, double centerY, double radius, double startAngle, double extentAngle, boolean fill)
centerX
- the x-coordinate of the centercenterY
- the y-coordinate of the centerradius
- the radius in x-coordinate unitsstartAngle
- the start angle in degrees
(zero at east, positive counter-clockwise)extentAngle
- the angle extent in degreesfill
- if true, the shape is filledpublic void sector(PointD center, double radius, double startAngle, double extentAngle, boolean fill)
center
- the center of the arcradius
- the radius in x-coordinate unitsstartAngle
- the start angle in degrees
(zero at east, positive counter-clockwise)extentAngle
- the angle extent in degreesfill
- if true, the shape is filledpublic void sector(double radius, double startAngle, double extentAngle, boolean fill)
radius
- the radius in x-coordinate unitsstartAngle
- the start angle in degrees
(zero at east, positive counter-clockwise)extentAngle
- the angle extent in degreesfill
- if true, the shape is filledpublic void polygon(double[] x, double[] y, boolean fill)
x
- an array of the x-coordinates of the vertexesy
- an array of the y-coordinates of the vertexesfill
- if true, the shape is filledpublic void polygon(PointD[] vertexes, boolean fill)
vertexes
- an array of the vertexesfill
- if true, the shape is filledpublic void triangle(double x1, double y1, double x2, double y2, double x3, double y3, boolean fill)
x1
- the x-coordinate of the first vertexy1
- the y-coordinate of the first vertexx2
- the x-coordinate of the second vertexy2
- the y-coordinate of the second vertexx3
- the x-coordinate of the third vertexy3
- the y-coordinate of the third vertexfill
- if true, the shape is filledpublic void triangle(PointD pt1, PointD pt2, PointD pt3, boolean fill)
pt1
- the first vertexpt2
- the second vertexpt3
- the third vertexfill
- if true, the shape is filledpublic void point(double x, double y)
x
- the x-coordinate of the pointy
- the y-coordinate of the pointpublic void point(PointD pt)
pt
- the point where to drawpublic void point()
public void clean()
public void erase()
public double getXmin()
public double getXmax()
public double getYmin()
public double getYmax()
public void color(int color)
color
- the new paint colorpublic double getUserWidth()
public double getUserHeight()
public void setAutoRefreshEnabled(boolean enable)
enable
- if true, the automatic refresh is enabled; otherwise disabled