Java Doc for CommonGraphics2D.java in  » Apache-Harmony-Java-SE » org-package » org » apache » harmony » awt » gl » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Apache Harmony Java SE » org package » org.apache.harmony.awt.gl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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.



Field Summary
protected  ColorbgColor
    
protected  Blitterblitter
    
protected  MultiRectAreaclip
    
protected  Compositecomposite
    
final protected static  booleandebugOutput
    
protected  SurfacedstSurf
    
protected  ColorfgColor
    
protected  Fontfont
    
protected  FontRenderContextfrc
    
protected  RenderingHintshints
    
protected  JavaShapeRasterizerjsr
    
protected  TextRendererjtr
    
protected  double[]matrix
    
public  PointorigPoint
    
protected  Paintpaint
    
protected  Strokestroke
    
protected  AffineTransformtransform
    

Constructor Summary
protected  CommonGraphics2D()
    
protected  CommonGraphics2D(int tx, int ty)
    
protected  CommonGraphics2D(int tx, int ty, MultiRectArea clip)
    

Method Summary
public  voidaddRenderingHints(Map hints)
    
public  voidclearRect(int x, int y, int width, int height)
    
public  voidclip(Shape s)
    
public  voidclipRect(int x, int y, int width, int height)
    
protected  voidcopyInternalFields(CommonGraphics2D copy)
     Copies graphics class fields.
public  voiddispose()
    
public  voiddraw(Shape s)
    
public  voiddrawArc(int x, int y, int width, int height, int sa, int ea)
    
public  booleandrawImage(Image image, int x, int y, Color bgcolor, ImageObserver imageObserver)
    
public  booleandrawImage(Image image, int x, int y, ImageObserver imageObserver)
    
public  booleandrawImage(Image image, int x, int y, int width, int height, Color bgcolor, ImageObserver imageObserver)
    
public  booleandrawImage(Image image, int x, int y, int width, int height, ImageObserver imageObserver)
    
public  booleandrawImage(Image image, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver imageObserver)
    
public  booleandrawImage(Image image, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver imageObserver)
    
public  voiddrawImage(BufferedImage bufImage, BufferedImageOp op, int x, int y)
    
public  booleandrawImage(Image image, AffineTransform trans, ImageObserver imageObserver)
    
public  voiddrawLine(int x1, int y1, int x2, int y2)
    
public  voiddrawOval(int x, int y, int width, int height)
    
public  voiddrawPolygon(int[] xpoints, int[] ypoints, int npoints)
    
public  voiddrawPolygon(Polygon polygon)
    
public  voiddrawPolyline(int[] xpoints, int[] ypoints, int npoints)
    
public  voiddrawRenderableImage(RenderableImage img, AffineTransform xform)
    
public  voiddrawRenderedImage(RenderedImage rimg, AffineTransform xform)
    
public  voiddrawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
    
public  voiddrawString(AttributedCharacterIterator iterator, float x, float y)
    
public  voiddrawString(AttributedCharacterIterator iterator, int x, int y)
    
public  voiddrawString(String str, int x, int y)
    
public  voidfill(Shape s)
    
public  voidfillArc(int x, int y, int width, int height, int sa, int ea)
    
protected  voidfillMultiRectArea(MultiRectArea mra)
     This method fills the given MultiRectArea with current paint.
protected  voidfillMultiRectAreaColor(MultiRectArea mra)
     This method fills the given MultiRectArea with solid color.
protected  voidfillMultiRectAreaPaint(MultiRectArea mra)
     This method fills the given MultiRectArea with any paint.
public  voidfillOval(int x, int y, int width, int height)
    
public  voidfillPolygon(int[] xpoints, int[] ypoints, int npoints)
    
public  voidfillPolygon(Polygon polygon)
    
public  voidfillRect(int x, int y, int width, int height)
    
public  voidfillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
    
public  ColorgetBackground()
    
public  ShapegetClip()
    
public  RectanglegetClipBounds()
    
public  ColorgetColor()
    
public  CompositegetComposite()
    
public  FontgetFont()
    
public  FontMetricsgetFontMetrics(Font font)
    
public  FontRenderContextgetFontRenderContext()
    
public  PaintgetPaint()
    
public  ObjectgetRenderingHint(RenderingHints.Key key)
    
public  RenderingHintsgetRenderingHints()
    
public  StrokegetStroke()
    
public  AffineTransformgetTransform()
    
public  booleanhit(Rectangle rect, Shape s, boolean onStroke)
    
public  voidrotate(double theta)
    
public  voidrotate(double theta, double x, double y)
    
public  voidscale(double sx, double sy)
    
public  voidsetBackground(Color color)
    
public  voidsetClip(int x, int y, int width, int height)
    
public  voidsetClip(Shape s)
    
public  voidsetColor(Color color)
    
public  voidsetComposite(Composite composite)
    
public  voidsetFont(Font font)
    
public  voidsetPaint(Paint paint)
    
public  voidsetPaintMode()
    
public  voidsetRenderingHint(RenderingHints.Key key, Object value)
    
public  voidsetRenderingHints(Map hints)
    
public  voidsetStroke(Stroke stroke)
    
public  voidsetTransform(AffineTransform transform)
    
protected  voidsetTransformedClip(MultiRectArea clip)
    
public  voidsetXORMode(Color color)
    
public  voidshear(double shx, double shy)
    
public  voidtransform(AffineTransform at)
    
public  voidtranslate(double tx, double ty)
    
public  voidtranslate(int tx, int ty)
    

Field Detail
bgColor
protected Color bgColor(Code)



blitter
protected Blitter blitter(Code)



clip
protected MultiRectArea clip(Code)



composite
protected Composite composite(Code)



debugOutput
final protected static boolean debugOutput(Code)



dstSurf
protected Surface dstSurf(Code)



fgColor
protected Color fgColor(Code)



font
protected Font font(Code)



frc
protected FontRenderContext frc(Code)



hints
protected RenderingHints hints(Code)



jsr
protected JavaShapeRasterizer jsr(Code)



jtr
protected TextRenderer jtr(Code)



matrix
protected double[] matrix(Code)



origPoint
public Point origPoint(Code)



paint
protected Paint paint(Code)



stroke
protected Stroke stroke(Code)



transform
protected AffineTransform transform(Code)




Constructor Detail
CommonGraphics2D
protected CommonGraphics2D()(Code)



CommonGraphics2D
protected CommonGraphics2D(int tx, int ty)(Code)



CommonGraphics2D
protected CommonGraphics2D(int tx, int ty, MultiRectArea clip)(Code)




Method Detail
addRenderingHints
public void addRenderingHints(Map hints)(Code)



clearRect
public void clearRect(int x, int y, int width, int height)(Code)



clip
public void clip(Shape s)(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)



draw
public void draw(Shape s)(Code)
Draw methods



drawArc
public void drawArc(int x, int y, int width, int height, int sa, int ea)(Code)



drawImage
public boolean drawImage(Image image, int x, int y, Color bgcolor, ImageObserver imageObserver)(Code)



drawImage
public boolean drawImage(Image image, int x, int y, ImageObserver imageObserver)(Code)



drawImage
public boolean drawImage(Image image, int x, int y, int width, int height, Color bgcolor, ImageObserver imageObserver)(Code)



drawImage
public boolean drawImage(Image image, int x, int y, int width, int height, 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, 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)



drawImage
public void drawImage(BufferedImage bufImage, BufferedImageOp op, int x, int y)(Code)



drawImage
public boolean drawImage(Image image, AffineTransform trans, 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)



drawPolygon
public void drawPolygon(Polygon polygon)(Code)



drawPolyline
public void drawPolyline(int[] xpoints, int[] ypoints, int npoints)(Code)



drawRenderableImage
public void drawRenderableImage(RenderableImage img, AffineTransform xform)(Code)



drawRenderedImage
public void drawRenderedImage(RenderedImage rimg, AffineTransform xform)(Code)



drawRoundRect
public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)(Code)



drawString
public void drawString(AttributedCharacterIterator iterator, float x, float y)(Code)
String methods



drawString
public void drawString(AttributedCharacterIterator iterator, int x, int y)(Code)



drawString
public void drawString(String str, int x, int y)(Code)



fill
public void fill(Shape s)(Code)
Fill methods



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)



fillPolygon
public void fillPolygon(Polygon polygon)(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



getClip
public Shape getClip()(Code)



getClipBounds
public Rectangle getClipBounds()(Code)



getColor
public Color getColor()(Code)



getComposite
public Composite getComposite()(Code)



getFont
public Font getFont()(Code)



getFontMetrics
public FontMetrics getFontMetrics(Font font)(Code)



getFontRenderContext
public FontRenderContext getFontRenderContext()(Code)



getPaint
public Paint getPaint()(Code)



getRenderingHint
public Object getRenderingHint(RenderingHints.Key key)(Code)



getRenderingHints
public RenderingHints getRenderingHints()(Code)



getStroke
public Stroke getStroke()(Code)



getTransform
public AffineTransform getTransform()(Code)



hit
public boolean hit(Rectangle rect, Shape s, boolean onStroke)(Code)



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)



setClip
public void setClip(Shape s)(Code)



setColor
public void setColor(Color color)(Code)



setComposite
public void setComposite(Composite composite)(Code)



setFont
public void setFont(Font font)(Code)



setPaint
public void setPaint(Paint paint)(Code)



setPaintMode
public void setPaintMode()(Code)



setRenderingHint
public void setRenderingHint(RenderingHints.Key key, Object value)(Code)



setRenderingHints
public void setRenderingHints(Map hints)(Code)



setStroke
public void setStroke(Stroke stroke)(Code)



setTransform
public void setTransform(AffineTransform transform)(Code)



setTransformedClip
protected void setTransformedClip(MultiRectArea clip)(Code)



setXORMode
public void setXORMode(Color color)(Code)



shear
public void shear(double shx, double shy)(Code)



transform
public void transform(AffineTransform at)(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)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.