| java.awt.Graphics2D org.apache.harmony.awt.gl.CommonGraphics2D
All known Subclasses: org.apache.harmony.awt.gl.windows.WinGDIPGraphics2D, org.apache.harmony.awt.gl.image.BufferedImageGraphics2D, org.apache.harmony.x.print.Graphics2D2PS, org.apache.harmony.awt.gl.windows.WinGDIGraphics2D, org.apache.harmony.awt.gl.opengl.OGLGraphics2D, org.apache.harmony.awt.gl.linux.XGraphics2D,
CommonGraphics2D | abstract public class CommonGraphics2D extends Graphics2D (Code) | | CommonGraphics2D class is a super class for all system-dependent
implementations. It implements major part of Graphics and Graphics2D
abstract methods.
CommonGraphics2D Class Internals
Line and Shape Rasterizers
The CommonGraphics2D class splits all shapes into a set of rectangles
to unify the drawing process for different operating systems and architectures.
For this purpose Java 2D* uses the JavaShapeRasterizer and the JavaLineRasterizer
classes from the org.apache.harmony.awt.gl.render package. The JavaShapeRasterizer
class splits an object implementing a Shape interface into a set of rectangles and
produces a MultiRectArea object. The JavaLineRasterizer class makes line drawing
more accurate and processes lines with strokes, which are instances of the BasicStroke
class.
To port the shape drawing to another platform you just need to override
rectangle-drawing methods. However, if your operating system has functions to draw
particular shapes, you can optimize your subclass of the CommonGraphics2D class by
using this functionality in overridden methods.
Blitters
Blitter classes draw images on the display or buffered images. All blitters inherit
the org.apache.harmony.awt.gl.render.Blitter interface.
Blitters are divided into:
- Native blitters for simple types of images, which the underlying native library
can draw.
- Java* blitters for those types of images, which the underlying native library
cannot handle.
DRL Java 2D* also uses blitters to fill the shapes and the user-defined subclasses
of the java.awt.Paint class with paints, which the system does not support.
Text Renderers
Text renderers draw strings and glyph vectors. All text renderers are subclasses
of the org.apache.harmony.awt.gl.TextRenderer class.
|
Method Summary | |
public void | addRenderingHints(Map, ?> hints) | public void | clearRect(int x, int y, int width, int height) | public void | clip(Shape s) | public void | clipRect(int x, int y, int width, int height) | protected void | copyInternalFields(CommonGraphics2D copy) Copies graphics class fields. | public void | dispose() | public void | draw(Shape s) | public void | drawArc(int x, int y, int width, int height, int sa, int ea) | public boolean | drawImage(Image image, int x, int y, Color bgcolor, ImageObserver imageObserver) | public boolean | drawImage(Image image, int x, int y, ImageObserver imageObserver) | public boolean | drawImage(Image image, int x, int y, int width, int height, Color bgcolor, ImageObserver imageObserver) | public boolean | drawImage(Image image, int x, int y, int width, int height, ImageObserver imageObserver) | public boolean | drawImage(Image image, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver imageObserver) | public boolean | drawImage(Image image, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver imageObserver) | public void | drawImage(BufferedImage bufImage, BufferedImageOp op, int x, int y) | public boolean | drawImage(Image image, AffineTransform trans, ImageObserver imageObserver) | public void | drawLine(int x1, int y1, int x2, int y2) | public void | drawOval(int x, int y, int width, int height) | public void | drawPolygon(int[] xpoints, int[] ypoints, int npoints) | public void | drawPolygon(Polygon polygon) | public void | drawPolyline(int[] xpoints, int[] ypoints, int npoints) | public void | drawRenderableImage(RenderableImage img, AffineTransform xform) | public void | drawRenderedImage(RenderedImage rimg, AffineTransform xform) | public void | drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) | public void | drawString(AttributedCharacterIterator iterator, float x, float y) | public void | drawString(AttributedCharacterIterator iterator, int x, int y) | public void | drawString(String str, int x, int y) | public void | fill(Shape s) | public void | fillArc(int x, int y, int width, int height, int sa, int ea) | protected void | fillMultiRectArea(MultiRectArea mra) This method fills the given MultiRectArea with current paint. | protected void | fillMultiRectAreaColor(MultiRectArea mra) This method fills the given MultiRectArea with solid color. | protected void | fillMultiRectAreaPaint(MultiRectArea mra) This method fills the given MultiRectArea with any paint. | public void | fillOval(int x, int y, int width, int height) | public void | fillPolygon(int[] xpoints, int[] ypoints, int npoints) | public void | fillPolygon(Polygon polygon) | public void | fillRect(int x, int y, int width, int height) | public void | fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) | public Color | getBackground() | public Shape | getClip() | public Rectangle | getClipBounds() | public Color | getColor() | public Composite | getComposite() | public Font | getFont() | public FontMetrics | getFontMetrics(Font font) | public FontRenderContext | getFontRenderContext() | public Paint | getPaint() | public Object | getRenderingHint(RenderingHints.Key key) | public RenderingHints | getRenderingHints() | public Stroke | getStroke() | public AffineTransform | getTransform() | public boolean | hit(Rectangle rect, Shape s, boolean onStroke) | public void | rotate(double theta) | public void | rotate(double theta, double x, double y) | public void | scale(double sx, double sy) | public void | setBackground(Color color) | public void | setClip(int x, int y, int width, int height) | public void | setClip(Shape s) | public void | setColor(Color color) | public void | setComposite(Composite composite) | public void | setFont(Font font) | public void | setPaint(Paint paint) | public void | setPaintMode() | public void | setRenderingHint(RenderingHints.Key key, Object value) | public void | setRenderingHints(Map, ?> hints) | public void | setStroke(Stroke stroke) | public void | setTransform(AffineTransform transform) | protected void | setTransformedClip(MultiRectArea clip) | public void | setXORMode(Color color) | public void | shear(double shx, double shy) | public void | transform(AffineTransform at) | public void | translate(double tx, double ty) | public void | translate(int tx, int ty) |
debugOutput | final protected static boolean debugOutput(Code) | | |
matrix | protected double[] matrix(Code) | | |
CommonGraphics2D | protected CommonGraphics2D()(Code) | | |
CommonGraphics2D | protected CommonGraphics2D(int tx, int ty)(Code) | | |
addRenderingHints | public void addRenderingHints(Map, ?> hints)(Code) | | |
clearRect | public void clearRect(int x, int y, int width, int height)(Code) | | |
clipRect | public void clipRect(int x, int y, int width, int height)(Code) | | |
copyInternalFields | protected void copyInternalFields(CommonGraphics2D copy)(Code) | | Copies graphics class fields.
Used in create method
Parameters: copy - Graphics class to copy |
dispose | public void dispose()(Code) | | |
drawArc | public void drawArc(int x, int y, int width, int height, int sa, int ea)(Code) | | |
drawImage | public boolean drawImage(Image image, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver imageObserver)(Code) | | |
drawImage | public boolean drawImage(Image image, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver imageObserver)(Code) | | |
drawLine | public void drawLine(int x1, int y1, int x2, int y2)(Code) | | |
drawOval | public void drawOval(int x, int y, int width, int height)(Code) | | |
drawPolygon | public void drawPolygon(int[] xpoints, int[] ypoints, int npoints)(Code) | | |
drawPolyline | public void drawPolyline(int[] xpoints, int[] ypoints, int npoints)(Code) | | |
drawRoundRect | public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)(Code) | | |
drawString | public void drawString(String str, int x, int y)(Code) | | |
fillArc | public void fillArc(int x, int y, int width, int height, int sa, int ea)(Code) | | |
fillMultiRectArea | protected void fillMultiRectArea(MultiRectArea mra)(Code) | | This method fills the given MultiRectArea with current paint.
It calls fillMultiRectAreaColor and fillMultiRectAreaPaint
methods depending on the type of current paint.
Parameters: mra - MultiRectArea to fill |
fillMultiRectAreaColor | protected void fillMultiRectAreaColor(MultiRectArea mra)(Code) | | This method fills the given MultiRectArea with solid color.
Parameters: mra - MultiRectArea to fill |
fillMultiRectAreaPaint | protected void fillMultiRectAreaPaint(MultiRectArea mra)(Code) | | This method fills the given MultiRectArea with any paint.
Parameters: mra - MultiRectArea to fill |
fillOval | public void fillOval(int x, int y, int width, int height)(Code) | | |
fillPolygon | public void fillPolygon(int[] xpoints, int[] ypoints, int npoints)(Code) | | |
fillRect | public void fillRect(int x, int y, int width, int height)(Code) | | |
fillRoundRect | public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)(Code) | | |
getBackground | public Color getBackground()(Code) | | Get methods
|
rotate | public void rotate(double theta)(Code) | | Transformation methods
|
rotate | public void rotate(double theta, double x, double y)(Code) | | |
scale | public void scale(double sx, double sy)(Code) | | |
setBackground | public void setBackground(Color color)(Code) | | Set methods
|
setClip | public void setClip(int x, int y, int width, int height)(Code) | | |
setPaintMode | public void setPaintMode()(Code) | | |
setRenderingHints | public void setRenderingHints(Map, ?> hints)(Code) | | |
shear | public void shear(double shx, double shy)(Code) | | |
translate | public void translate(double tx, double ty)(Code) | | |
translate | public void translate(int tx, int ty)(Code) | | |
Methods inherited from java.awt.Graphics2D | abstract public void addRenderingHints(Map, ?> hints)(Code)(Java Doc) abstract public void clip(Shape s)(Code)(Java Doc) abstract public void draw(Shape s)(Code)(Java Doc) public void draw3DRect(int x, int y, int width, int height, boolean raised)(Code)(Java Doc) abstract public void drawGlyphVector(GlyphVector g, float x, float y)(Code)(Java Doc) abstract public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs)(Code)(Java Doc) abstract public void drawImage(BufferedImage img, BufferedImageOp op, int x, int y)(Code)(Java Doc) abstract public void drawRenderableImage(RenderableImage img, AffineTransform xform)(Code)(Java Doc) abstract public void drawRenderedImage(RenderedImage img, AffineTransform xform)(Code)(Java Doc) abstract public void drawString(String str, int x, int y)(Code)(Java Doc) abstract public void drawString(String str, float x, float y)(Code)(Java Doc) abstract public void drawString(AttributedCharacterIterator iterator, int x, int y)(Code)(Java Doc) abstract public void drawString(AttributedCharacterIterator iterator, float x, float y)(Code)(Java Doc) abstract public void fill(Shape s)(Code)(Java Doc) public void fill3DRect(int x, int y, int width, int height, boolean raised)(Code)(Java Doc) abstract public Color getBackground()(Code)(Java Doc) abstract public Composite getComposite()(Code)(Java Doc) abstract public GraphicsConfiguration getDeviceConfiguration()(Code)(Java Doc) abstract public FontRenderContext getFontRenderContext()(Code)(Java Doc) abstract public Paint getPaint()(Code)(Java Doc) abstract public Object getRenderingHint(Key hintKey)(Code)(Java Doc) abstract public RenderingHints getRenderingHints()(Code)(Java Doc) abstract public Stroke getStroke()(Code)(Java Doc) abstract public AffineTransform getTransform()(Code)(Java Doc) abstract public boolean hit(Rectangle rect, Shape s, boolean onStroke)(Code)(Java Doc) abstract public void rotate(double theta)(Code)(Java Doc) abstract public void rotate(double theta, double x, double y)(Code)(Java Doc) abstract public void scale(double sx, double sy)(Code)(Java Doc) abstract public void setBackground(Color color)(Code)(Java Doc) abstract public void setComposite(Composite comp)(Code)(Java Doc) abstract public void setPaint(Paint paint)(Code)(Java Doc) abstract public void setRenderingHint(Key hintKey, Object hintValue)(Code)(Java Doc) abstract public void setRenderingHints(Map, ?> hints)(Code)(Java Doc) abstract public void setStroke(Stroke s)(Code)(Java Doc) abstract public void setTransform(AffineTransform Tx)(Code)(Java Doc) abstract public void shear(double shx, double shy)(Code)(Java Doc) abstract public void transform(AffineTransform Tx)(Code)(Java Doc) abstract public void translate(int x, int y)(Code)(Java Doc) abstract public void translate(double tx, double ty)(Code)(Java Doc)
|
|
|