public abstract class AbstractShapeHelper extends Object implements GLG2DShapeHelper
Constructor and Description |
---|
AbstractShapeHelper() |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes the helper object.
|
void |
drawArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle,
boolean fill) |
void |
drawLine(int x1,
int y1,
int x2,
int y2) |
void |
drawOval(int x,
int y,
int width,
int height,
boolean fill) |
void |
drawPolygon(int[] xPoints,
int[] yPoints,
int nPoints,
boolean fill) |
void |
drawPolyline(int[] xPoints,
int[] yPoints,
int nPoints) |
void |
drawRect(int x,
int y,
int width,
int height,
boolean fill) |
void |
drawRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight,
boolean fill) |
void |
fill(Shape shape) |
Stroke |
getStroke() |
void |
pop(GLGraphics2D parentG2d)
Sets the new
GLGraphics2D context in a stack after a pop. |
void |
push(GLGraphics2D newG2d)
Sets the new
GLGraphics2D context in a stack. |
void |
resetHints()
Clears all hints back to their default states.
|
void |
setG2D(GLGraphics2D g2d)
Sets the current
GLGraphics2D parent. |
void |
setHint(RenderingHints.Key key,
Object value)
Sets a new rendering hint.
|
void |
setStroke(Stroke stroke) |
static void |
visitShape(Shape shape,
PathVisitor visitor) |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
draw
public void setG2D(GLGraphics2D g2d)
G2DDrawingHelper
GLGraphics2D
parent. The current GL
and
GLContext
objects can be accessed from this. This should clear all
internal stacks in the helper object because previous painting iterations
may not have called dispose() for each time they called create().setG2D
in interface G2DDrawingHelper
g2d
- The parent context for subsequent drawing operations.public void push(GLGraphics2D newG2d)
G2DDrawingHelper
GLGraphics2D
context in a stack. This is called when
Graphics2D.create()
is called and each helper is given notice to
push any necessary information onto the stack. This is used in conjunction
with G2DDrawingHelper.pop(GLGraphics2D)
.push
in interface G2DDrawingHelper
newG2d
- The new context, top of the stack.public void pop(GLGraphics2D parentG2d)
G2DDrawingHelper
GLGraphics2D
context in a stack after a pop. This is
called when Graphics2D.dispose()
is called and each helper is given
notice to pop any necessary information off the stack. This is used in
conjunction with G2DDrawingHelper.push(GLGraphics2D)
.pop
in interface G2DDrawingHelper
parentG2d
- The new context, top of the stack - which is actually the parent
of what was popped.public void setHint(RenderingHints.Key key, Object value)
G2DDrawingHelper
GLGraphics2D
object, but all new state changes are propagated to
all listeners.setHint
in interface G2DDrawingHelper
key
- The rendering hint key.value
- The new hint value.public void resetHints()
G2DDrawingHelper
resetHints
in interface G2DDrawingHelper
public void dispose()
G2DDrawingHelper
Graphics2D
object. This should dispose all GL resources when
all drawing is finished and no more calls will be executing on this OpenGL
context and these resources.dispose
in interface G2DDrawingHelper
public void setStroke(Stroke stroke)
setStroke
in interface GLG2DShapeHelper
public Stroke getStroke()
getStroke
in interface GLG2DShapeHelper
public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight, boolean fill)
drawRoundRect
in interface GLG2DShapeHelper
public void drawRect(int x, int y, int width, int height, boolean fill)
drawRect
in interface GLG2DShapeHelper
public void drawLine(int x1, int y1, int x2, int y2)
drawLine
in interface GLG2DShapeHelper
public void drawOval(int x, int y, int width, int height, boolean fill)
drawOval
in interface GLG2DShapeHelper
public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle, boolean fill)
drawArc
in interface GLG2DShapeHelper
public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
drawPolyline
in interface GLG2DShapeHelper
public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints, boolean fill)
drawPolygon
in interface GLG2DShapeHelper
public void fill(Shape shape)
fill
in interface GLG2DShapeHelper
public static void visitShape(Shape shape, PathVisitor visitor)
Copyright © 2010-2013. All Rights Reserved.