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, setProperties
create, create, fill, getSymbol, getTextAlignment, getXalignment, getYalignment
draw3DRect, fill3DRect
drawBytes, drawChars, finalize, getClipRect, getFontMetrics, hitClip
public 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 VectorGraphics
public void endExport()
endExport
in class VectorGraphics
public void printComment(String comment)
printComment
in class VectorGraphics
public Graphics create(double x, double y, double width, double height)
create
in class VectorGraphics
public void clearRect(int x, int y, int width, int height)
clearRect
in class AbstractVectorGraphics
public void clipRect(int x, int y, int width, int height)
clipRect
in class VectorGraphics
public void copyArea(int x, int y, int width, int height, int dx, int dy)
copyArea
in class VectorGraphics
public Graphics create()
create
in class VectorGraphics
public void dispose()
dispose
in class VectorGraphics
public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
drawArc
in class AbstractVectorGraphics
public boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer)
drawImage
in class VectorGraphics
public boolean drawImage(Image img, int x, int y, ImageObserver observer)
drawImage
in class VectorGraphics
public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer)
drawImage
in class VectorGraphics
public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer)
drawImage
in class VectorGraphics
public 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 VectorGraphics
public 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 VectorGraphics
public void drawLine(int x1, int y1, int x2, int y2)
drawLine
in class AbstractVectorGraphics
public void drawOval(int x, int y, int width, int height)
drawOval
in class AbstractVectorGraphics
public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
drawPolygon
in class AbstractVectorGraphics
public void drawPolygon(Polygon p)
drawPolygon
in class Graphics
public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
drawPolyline
in class AbstractVectorGraphics
public void drawRect(int x, int y, int width, int height)
drawRect
in class AbstractVectorGraphics
public void drawString(String str, int x, int y)
drawString
in class AbstractVectorGraphics
public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
fillArc
in class AbstractVectorGraphics
public void fillOval(int x, int y, int width, int height)
fillOval
in class AbstractVectorGraphics
public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
fillPolygon
in class AbstractVectorGraphics
public void fillPolygon(Polygon p)
fillPolygon
in class Graphics
public void fillRect(int x, int y, int width, int height)
fillRect
in class AbstractVectorGraphics
public void drawSymbol(double x, double y, double size, int symbol)
drawSymbol
in class AbstractVectorGraphics
public void fillSymbol(double x, double y, double size, int symbol)
fillSymbol
in class AbstractVectorGraphics
public void fillAndDrawSymbol(double x, double y, double size, int symbol, Color fillColor)
fillAndDrawSymbol
in class AbstractVectorGraphics
public void setLineWidth(double width)
setLineWidth
in class AbstractVectorGraphics
public Shape getClip()
getClip
in class VectorGraphics
public Rectangle getClipBounds()
getClipBounds
in class VectorGraphics
public Rectangle getClipBounds(Rectangle r)
getClipBounds
in class VectorGraphics
public FontMetrics getFontMetrics(Font f)
getFontMetrics
in class VectorGraphics
public void setClip(int x, int y, int width, int height)
setClip
in class VectorGraphics
public void setClip(Shape clip)
setClip
in class VectorGraphics
public void setFont(Font font)
AbstractVectorGraphics
setFont
in class AbstractVectorGraphics
font
- to be setpublic void setColor(Color color)
AbstractVectorGraphics
setColor
in class AbstractVectorGraphics
color
- to be setpublic void setPaint(Paint paint)
AbstractVectorGraphics
setPaint
in class AbstractVectorGraphics
paint
- to be setpublic void setPaintMode()
setPaintMode
in class VectorGraphics
public void setXORMode(Color c1)
setXORMode
in class VectorGraphics
public void translate(int x, int y)
translate
in class AbstractVectorGraphics
public void addRenderingHints(Map<?,?> hints)
addRenderingHints
in class VectorGraphics
public void clip(Shape clip)
clip
in class VectorGraphics
public void draw(Shape s)
draw
in class VectorGraphics
public void drawGlyphVector(GlyphVector g, float x, float y)
drawGlyphVector
in class VectorGraphics
public void drawImage(BufferedImage img, BufferedImageOp op, int x, int y)
drawImage
in class VectorGraphics
public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs)
drawImage
in class VectorGraphics
public void drawRenderableImage(RenderableImage img, AffineTransform xform)
drawRenderableImage
in class VectorGraphics
public void drawRenderedImage(RenderedImage img, AffineTransform xform)
drawRenderedImage
in class VectorGraphics
public void drawString(AttributedCharacterIterator iterator, float x, float y)
drawString
in class VectorGraphics
public void drawString(AttributedCharacterIterator iterator, int x, int y)
drawString
in class AbstractVectorGraphics
public void drawString(String str, float x, float y)
drawString
in class AbstractVectorGraphics
public void fill(Shape s)
fill
in class VectorGraphics
public Composite getComposite()
getComposite
in class VectorGraphics
public GraphicsConfiguration getDeviceConfiguration()
getDeviceConfiguration
in class VectorGraphics
public FontRenderContext getFontRenderContext()
getFontRenderContext
in class VectorGraphics
public Object getRenderingHint(RenderingHints.Key hintKey)
getRenderingHint
in class VectorGraphics
public RenderingHints getRenderingHints()
getRenderingHints
in class VectorGraphics
public Stroke getStroke()
getStroke
in class VectorGraphics
public AffineTransform getTransform()
getTransform
in class VectorGraphics
public boolean hit(Rectangle rect, Shape s, boolean onStroke)
AbstractVectorGraphics
Shape
intersects
the specified Rectangle
, which is in device
space.hit
in class AbstractVectorGraphics
rect
- 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 VectorGraphics
public void rotate(double theta, double x, double y)
rotate
in class AbstractVectorGraphics
public void scale(double sx, double sy)
scale
in class VectorGraphics
public void setBackground(Color color)
AbstractVectorGraphics
setBackground
in class AbstractVectorGraphics
color
- background color to be setpublic void setComposite(Composite comp)
setComposite
in class VectorGraphics
public void setRenderingHint(RenderingHints.Key hintKey, Object hintValue)
setRenderingHint
in class VectorGraphics
public void setRenderingHints(Map<?,?> hints)
setRenderingHints
in class VectorGraphics
public void setStroke(Stroke s)
setStroke
in class VectorGraphics
public void setTransform(AffineTransform Tx)
setTransform
in class VectorGraphics
public void shear(double shx, double shy)
shear
in class VectorGraphics
public void transform(AffineTransform Tx)
transform
in class VectorGraphics
public void translate(double tx, double ty)
translate
in class VectorGraphics
public void clearRect(double x, double y, double width, double height)
clearRect
in class VectorGraphics
public void clipRect(double x, double y, double width, double height)
clipRect
in class VectorGraphics
public void drawString(String str, double x, double y)
VectorGraphics
drawString
in class VectorGraphics
public void setClip(double x, double y, double width, double height)
setClip
in class VectorGraphics
public String toString()
toString
in class VectorGraphics
public static boolean isDisplayX11()
public static boolean isDisplayLocal()
protected Shape createShape(double[] xPoints, double[] yPoints, int nPoints, boolean close)
createShape
in class AbstractVectorGraphics
xPoints
- 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.