public class PixelGraphics2D extends AbstractVectorGraphics
| Modifier and Type | Field and Description |
|---|---|
protected Graphics2D |
hostGraphics |
static RenderingHints.Key |
KEY_SYMBOL_BLIT |
protected double |
lineWidth |
protected int |
resolution |
protected GenericTagHandler |
tagHandler |
static Object |
VALUE_SYMBOL_BLIT_OFF |
static Object |
VALUE_SYMBOL_BLIT_ON |
NUMBER_OF_HORIZ_ALIGNMENTS, NUMBER_OF_SYMBOLS, NUMBER_OF_VERTICAL_ALIGNMENTS, SYMBOL_BOX, SYMBOL_CIRCLE, SYMBOL_CROSS, SYMBOL_DIAMOND, SYMBOL_DN_TRIANGLE, SYMBOL_HLINE, SYMBOL_PLUS, SYMBOL_STAR, SYMBOL_UP_TRIANGLE, SYMBOL_VLINE, TEXT_BASELINE, TEXT_BOTTOM, TEXT_CENTER, TEXT_LEFT, TEXT_RIGHT, TEXT_TOP| Modifier | Constructor and Description |
|---|---|
protected |
PixelGraphics2D()
Constructor for the case that you only know the hostgraphics later on.
|
|
PixelGraphics2D(Graphics graphics) |
protected |
PixelGraphics2D(PixelGraphics2D graphics) |
| Modifier and Type | Method and Description |
|---|---|
void |
addRenderingHints(Map<?,?> hints) |
void |
clearRect(double x,
double y,
double width,
double height) |
void |
clearRect(int x,
int y,
int width,
int height) |
void |
clip(Shape clip) |
void |
clipRect(double x,
double y,
double width,
double height) |
void |
clipRect(int x,
int y,
int width,
int height) |
void |
copyArea(int x,
int y,
int width,
int height,
int dx,
int dy) |
Graphics |
create() |
Graphics |
create(double x,
double y,
double width,
double height) |
protected Shape |
createShape(double[] xPoints,
double[] yPoints,
int nPoints,
boolean close)
Implementation of createShape makes sure that the points are different by
at least one pixel.
|
void |
dispose() |
void |
draw(Shape s) |
void |
drawArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle) |
void |
drawGlyphVector(GlyphVector g,
float x,
float y) |
void |
drawImage(BufferedImage img,
BufferedImageOp op,
int x,
int y) |
boolean |
drawImage(Image img,
AffineTransform xform,
ImageObserver obs) |
boolean |
drawImage(Image img,
int x,
int y,
Color bgcolor,
ImageObserver observer) |
boolean |
drawImage(Image img,
int x,
int y,
ImageObserver observer) |
boolean |
drawImage(Image img,
int x,
int y,
int width,
int height,
Color bgcolor,
ImageObserver observer) |
boolean |
drawImage(Image img,
int x,
int y,
int width,
int height,
ImageObserver observer) |
boolean |
drawImage(Image img,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
Color bgcolor,
ImageObserver observer) |
boolean |
drawImage(Image img,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
ImageObserver observer) |
void |
drawLine(int x1,
int y1,
int x2,
int y2) |
void |
drawOval(int x,
int y,
int width,
int height) |
void |
drawPolygon(int[] xPoints,
int[] yPoints,
int nPoints) |
void |
drawPolygon(Polygon p) |
void |
drawPolyline(int[] xPoints,
int[] yPoints,
int nPoints) |
void |
drawRect(int x,
int y,
int width,
int height) |
void |
drawRenderableImage(RenderableImage img,
AffineTransform xform) |
void |
drawRenderedImage(RenderedImage img,
AffineTransform xform) |
void |
drawString(AttributedCharacterIterator iterator,
float x,
float y) |
void |
drawString(AttributedCharacterIterator iterator,
int x,
int y) |
void |
drawString(String str,
double x,
double y)
Draws a string.
|
void |
drawString(String str,
float x,
float y) |
void |
drawString(String str,
int x,
int y) |
void |
drawSymbol(double x,
double y,
double size,
int symbol) |
void |
endExport() |
void |
fill(Shape s) |
void |
fillAndDrawSymbol(double x,
double y,
double size,
int symbol,
Color fillColor) |
void |
fillArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle) |
void |
fillOval(int x,
int y,
int width,
int height) |
void |
fillPolygon(int[] xPoints,
int[] yPoints,
int nPoints) |
void |
fillPolygon(Polygon p) |
void |
fillRect(int x,
int y,
int width,
int height) |
void |
fillSymbol(double x,
double y,
double size,
int symbol) |
Shape |
getClip() |
Rectangle |
getClipBounds() |
Rectangle |
getClipBounds(Rectangle r) |
Composite |
getComposite() |
GraphicsConfiguration |
getDeviceConfiguration() |
FontMetrics |
getFontMetrics(Font f) |
FontRenderContext |
getFontRenderContext() |
Object |
getRenderingHint(RenderingHints.Key hintKey) |
RenderingHints |
getRenderingHints() |
Stroke |
getStroke() |
AffineTransform |
getTransform() |
boolean |
hit(Rectangle rect,
Shape s,
boolean onStroke)
Checks whether or not the specified
Shape intersects
the specified Rectangle, which is in device
space. |
static boolean |
isDisplayLocal() |
static boolean |
isDisplayX11() |
void |
printComment(String comment) |
void |
rotate(double theta) |
void |
rotate(double theta,
double x,
double y) |
void |
scale(double sx,
double sy) |
void |
setBackground(Color color)
Sets the background color.
|
void |
setClip(double x,
double y,
double width,
double height) |
void |
setClip(int x,
int y,
int width,
int height) |
void |
setClip(Shape clip) |
void |
setColor(Color color)
Sets the current color and the current paint.
|
void |
setComposite(Composite comp) |
void |
setFont(Font font)
Sets the current font.
|
protected void |
setHostGraphics(Graphics graphics) |
void |
setLineWidth(double width) |
void |
setPaint(Paint paint)
Sets the current paint.
|
void |
setPaintMode() |
void |
setRenderingHint(RenderingHints.Key hintKey,
Object hintValue) |
void |
setRenderingHints(Map<?,?> hints) |
void |
setStroke(Stroke s) |
void |
setTransform(AffineTransform Tx) |
void |
setXORMode(Color c1) |
void |
shear(double shx,
double shy) |
void |
startExport() |
String |
toString() |
void |
transform(AffineTransform Tx) |
void |
translate(double tx,
double ty) |
void |
translate(int x,
int y) |
createShape, drawArc, drawLine, drawOval, drawPolygon, drawPolyline, drawRect, drawRoundRect, drawRoundRect, drawString, drawString, drawString, drawString, drawString, drawSymbol, drawSymbol, fillAndDraw, fillAndDrawSymbol, fillArc, fillOval, fillPolygon, fillRect, fillRoundRect, fillRoundRect, fillSymbol, fillSymbol, getBackground, getColor, getColorMode, getCreator, getFont, getPaint, getPrintColor, getProperties, getProperty, getPropertyColor, getPropertyDimension, getPropertyDouble, getPropertyInsets, getPropertyInt, getPropertyRectangle, initProperties, isDeviceIndependent, isProperty, setColorMode, setCreator, setDeviceIndependent, setLineWidth, setPropertiescreate, create, fill, getSymbol, getTextAlignment, getXalignment, getYalignmentdraw3DRect, fill3DRectdrawBytes, drawChars, finalize, getClipRect, getFontMetrics, hitClippublic static final RenderingHints.Key KEY_SYMBOL_BLIT
public static final Object VALUE_SYMBOL_BLIT_ON
public static final Object VALUE_SYMBOL_BLIT_OFF
protected Graphics2D hostGraphics
protected double lineWidth
protected int resolution
protected GenericTagHandler tagHandler
public PixelGraphics2D(Graphics graphics)
protected PixelGraphics2D(PixelGraphics2D graphics)
protected PixelGraphics2D()
protected void setHostGraphics(Graphics graphics)
public void startExport()
startExport in class VectorGraphicspublic void endExport()
endExport in class VectorGraphicspublic void printComment(String comment)
printComment in class VectorGraphicspublic Graphics create(double x, double y, double width, double height)
create in class VectorGraphicspublic void clearRect(int x,
int y,
int width,
int height)
clearRect in class AbstractVectorGraphicspublic void clipRect(int x,
int y,
int width,
int height)
clipRect in class VectorGraphicspublic void copyArea(int x,
int y,
int width,
int height,
int dx,
int dy)
copyArea in class VectorGraphicspublic Graphics create()
create in class VectorGraphicspublic void dispose()
dispose in class VectorGraphicspublic void drawArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
drawArc in class AbstractVectorGraphicspublic boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer)
drawImage in class VectorGraphicspublic boolean drawImage(Image img, int x, int y, ImageObserver observer)
drawImage in class VectorGraphicspublic boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer)
drawImage in class VectorGraphicspublic boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer)
drawImage in class VectorGraphicspublic boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer)
drawImage in class VectorGraphicspublic boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)
drawImage in class VectorGraphicspublic void drawLine(int x1,
int y1,
int x2,
int y2)
drawLine in class AbstractVectorGraphicspublic void drawOval(int x,
int y,
int width,
int height)
drawOval in class AbstractVectorGraphicspublic void drawPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
drawPolygon in class AbstractVectorGraphicspublic void drawPolygon(Polygon p)
drawPolygon in class Graphicspublic void drawPolyline(int[] xPoints,
int[] yPoints,
int nPoints)
drawPolyline in class AbstractVectorGraphicspublic void drawRect(int x,
int y,
int width,
int height)
drawRect in class AbstractVectorGraphicspublic void drawString(String str, int x, int y)
drawString in class AbstractVectorGraphicspublic void fillArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
fillArc in class AbstractVectorGraphicspublic void fillOval(int x,
int y,
int width,
int height)
fillOval in class AbstractVectorGraphicspublic void fillPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
fillPolygon in class AbstractVectorGraphicspublic void fillPolygon(Polygon p)
fillPolygon in class Graphicspublic void fillRect(int x,
int y,
int width,
int height)
fillRect in class AbstractVectorGraphicspublic void drawSymbol(double x,
double y,
double size,
int symbol)
drawSymbol in class AbstractVectorGraphicspublic void fillSymbol(double x,
double y,
double size,
int symbol)
fillSymbol in class AbstractVectorGraphicspublic void fillAndDrawSymbol(double x,
double y,
double size,
int symbol,
Color fillColor)
fillAndDrawSymbol in class AbstractVectorGraphicspublic void setLineWidth(double width)
setLineWidth in class AbstractVectorGraphicspublic Shape getClip()
getClip in class VectorGraphicspublic Rectangle getClipBounds()
getClipBounds in class VectorGraphicspublic Rectangle getClipBounds(Rectangle r)
getClipBounds in class VectorGraphicspublic FontMetrics getFontMetrics(Font f)
getFontMetrics in class VectorGraphicspublic void setClip(int x,
int y,
int width,
int height)
setClip in class VectorGraphicspublic void setClip(Shape clip)
setClip in class VectorGraphicspublic void setFont(Font font)
AbstractVectorGraphicssetFont in class AbstractVectorGraphicsfont - to be setpublic void setColor(Color color)
AbstractVectorGraphicssetColor in class AbstractVectorGraphicscolor - to be setpublic void setPaint(Paint paint)
AbstractVectorGraphicssetPaint in class AbstractVectorGraphicspaint - to be setpublic void setPaintMode()
setPaintMode in class VectorGraphicspublic void setXORMode(Color c1)
setXORMode in class VectorGraphicspublic void translate(int x,
int y)
translate in class AbstractVectorGraphicspublic void addRenderingHints(Map<?,?> hints)
addRenderingHints in class VectorGraphicspublic void clip(Shape clip)
clip in class VectorGraphicspublic void draw(Shape s)
draw in class VectorGraphicspublic void drawGlyphVector(GlyphVector g, float x, float y)
drawGlyphVector in class VectorGraphicspublic void drawImage(BufferedImage img, BufferedImageOp op, int x, int y)
drawImage in class VectorGraphicspublic boolean drawImage(Image img, AffineTransform xform, ImageObserver obs)
drawImage in class VectorGraphicspublic void drawRenderableImage(RenderableImage img, AffineTransform xform)
drawRenderableImage in class VectorGraphicspublic void drawRenderedImage(RenderedImage img, AffineTransform xform)
drawRenderedImage in class VectorGraphicspublic void drawString(AttributedCharacterIterator iterator, float x, float y)
drawString in class VectorGraphicspublic void drawString(AttributedCharacterIterator iterator, int x, int y)
drawString in class AbstractVectorGraphicspublic void drawString(String str, float x, float y)
drawString in class AbstractVectorGraphicspublic void fill(Shape s)
fill in class VectorGraphicspublic Composite getComposite()
getComposite in class VectorGraphicspublic GraphicsConfiguration getDeviceConfiguration()
getDeviceConfiguration in class VectorGraphicspublic FontRenderContext getFontRenderContext()
getFontRenderContext in class VectorGraphicspublic Object getRenderingHint(RenderingHints.Key hintKey)
getRenderingHint in class VectorGraphicspublic RenderingHints getRenderingHints()
getRenderingHints in class VectorGraphicspublic Stroke getStroke()
getStroke in class VectorGraphicspublic AffineTransform getTransform()
getTransform in class VectorGraphicspublic boolean hit(Rectangle rect, Shape s, boolean onStroke)
AbstractVectorGraphicsShape intersects
the specified Rectangle, which is in device
space.hit in class AbstractVectorGraphicsrect - the area in device space to check for a hits - the Shape to check for a hitonStroke - flag used to choose between testing the stroked or the filled shape.Graphics2D.hit(Rectangle, Shape, boolean)public void rotate(double theta)
rotate in class VectorGraphicspublic void rotate(double theta,
double x,
double y)
rotate in class AbstractVectorGraphicspublic void scale(double sx,
double sy)
scale in class VectorGraphicspublic void setBackground(Color color)
AbstractVectorGraphicssetBackground in class AbstractVectorGraphicscolor - background color to be setpublic void setComposite(Composite comp)
setComposite in class VectorGraphicspublic void setRenderingHint(RenderingHints.Key hintKey, Object hintValue)
setRenderingHint in class VectorGraphicspublic void setRenderingHints(Map<?,?> hints)
setRenderingHints in class VectorGraphicspublic void setStroke(Stroke s)
setStroke in class VectorGraphicspublic void setTransform(AffineTransform Tx)
setTransform in class VectorGraphicspublic void shear(double shx,
double shy)
shear in class VectorGraphicspublic void transform(AffineTransform Tx)
transform in class VectorGraphicspublic void translate(double tx,
double ty)
translate in class VectorGraphicspublic void clearRect(double x,
double y,
double width,
double height)
clearRect in class VectorGraphicspublic void clipRect(double x,
double y,
double width,
double height)
clipRect in class VectorGraphicspublic void drawString(String str, double x, double y)
VectorGraphicsdrawString in class VectorGraphicspublic void setClip(double x,
double y,
double width,
double height)
setClip in class VectorGraphicspublic String toString()
toString in class VectorGraphicspublic static boolean isDisplayX11()
public static boolean isDisplayLocal()
protected Shape createShape(double[] xPoints, double[] yPoints, int nPoints, boolean close)
createShape in class AbstractVectorGraphicsxPoints - X coordinates of the polyline.yPoints - Y coordinates of the polyline.nPoints - number of points of the polyline.close - is shape closedCopyright © 2014. All rights reserved.