Purple Code

com.purpletech.awt
Class PureGraphics

java.lang.Object
  |
  +--java.awt.Graphics
        |
        +--com.purpletech.awt.PureGraphics

public class PureGraphics
extends java.awt.Graphics

Pure Graphics - a Graphics with no ties to any AWT native nonsense. Currently only implemented for Images -- you can draw an Image, but you can't do most of the normal painting/filling operations. Someday I'll implement diagonal line-drawing, polygon-filling, etc. Note that drawLine() works, but only if the line is vertical or horizontal :-)

Based on code by Jef Poskanzer - jef@acme.com - http://www.acme.com/java/

Author:
Alex Chaffee (alexc@purpletech.com)

Method Summary
 void clearRect(int x, int y, int w, int h)
           
 void clipRect(int x, int y, int w, int h)
          not implemented
 void copyArea(int x, int y, int w, int h, int dx, int dy)
          not implemented
 java.awt.Graphics create()
          Create a new Graphics Object based on this one.
 void dispose()
           
 void drawArc(int x, int y, int w, int h, int startAngle, int endAngle)
          not implemented
 void drawBytes(byte[] data, int offset, int length, int x, int y)
          not implemented
 void drawChars(char[] data, int offset, int length, int x, int y)
          not implemented
 boolean drawImage(java.awt.Image img, int x, int y, java.awt.Color bg, java.awt.image.ImageObserver observer)
          Draws an image at x,y in nonblocking mode with a solid background color and a callback object.
 boolean drawImage(java.awt.Image img, int x, int y, java.awt.image.ImageObserver observer)
          Draws an image at x,y in nonblocking mode with a callback object.
 boolean drawImage(java.awt.Image img, int x, int y, int width, int height, java.awt.Color bg, java.awt.image.ImageObserver observer)
          Draws an image scaled to x,y,w,h in nonblocking mode with a solid background color and a callback object.
 boolean drawImage(java.awt.Image img, int x, int y, int width, int height, java.awt.image.ImageObserver observer)
          Draws an image scaled to x,y,w,h in nonblocking mode with a callback object.
 boolean drawImage(java.awt.Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, java.awt.Color bgcolor, java.awt.image.ImageObserver observer)
          not implemented
 boolean drawImage(java.awt.Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, java.awt.image.ImageObserver observer)
          not implemented
 void drawLine(int x1in, int y1in, int x2in, int y2in)
          not implemented for diagonal lines
 void drawOval(int x, int y, int w, int h)
          not implemented
 void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
          not implemented
 void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
          not implemented
 void drawRoundRect(int x, int y, int w, int h, int arcWidth, int arcHeight)
          not implemented
 void drawString(java.text.AttributedCharacterIterator a, int b, int c)
          not implemented
 void drawString(java.lang.String str, int x, int y)
          not implemented
 void fillArc(int x, int y, int w, int h, int startAngle, int endAngle)
          not implemented
 void fillOval(int x, int y, int w, int h)
          not implemented
 void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
          not implemented
 void fillRect(int x, int y, int w, int h)
           
protected  void fillRect(int x, int y, int w, int h, int rgb)
           
 void fillRoundRect(int x, int y, int w, int h, int arcWidth, int arcHeight)
          not implemented
 java.awt.Shape getClip()
          not implemented
 java.awt.Rectangle getClipBounds()
          not implemented
 java.awt.Rectangle getClipRect()
          not implemented
 java.awt.Color getColor()
           
 java.awt.Font getFont()
          not implemented
 java.awt.FontMetrics getFontMetrics(java.awt.Font font)
          not implemented
 void setClip(int x, int y, int w, int h)
          not implemented
 void setClip(java.awt.Shape clip)
          not implemented
 void setColor(java.awt.Color c)
           
 void setFont(java.awt.Font font)
          not implemented
 void setPaintMode()
          not implemented
 void setXORMode(java.awt.Color c)
          not implemented
 void translate(int x, int y)
          Translates the origin of the graphics context to the point (xy) in the current coordinate system.
 
Methods inherited from class java.awt.Graphics
create, draw3DRect, drawPolygon, drawRect, fill3DRect, fillPolygon, finalize, getClipBounds, getFontMetrics, hitClip, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

create

public java.awt.Graphics create()
Create a new Graphics Object based on this one.

Specified by:
create in class java.awt.Graphics

translate

public void translate(int x,
                      int y)
Translates the origin of the graphics context to the point (xy) in the current coordinate system. Modifies this graphics context so that its new origin corresponds to the point (xy) in this graphics context's original coordinate system. All coordinates used in subsequent rendering operations on this graphics context will be relative to this new origin.

Specified by:
translate in class java.awt.Graphics
Parameters:
x - the x coordinate.
y - the y coordinate.
Since:
JDK1.0

dispose

public void dispose()
Specified by:
dispose in class java.awt.Graphics

getFont

public java.awt.Font getFont()
not implemented

Specified by:
getFont in class java.awt.Graphics

setFont

public void setFont(java.awt.Font font)
not implemented

Specified by:
setFont in class java.awt.Graphics

getFontMetrics

public java.awt.FontMetrics getFontMetrics(java.awt.Font font)
not implemented

Specified by:
getFontMetrics in class java.awt.Graphics

getColor

public java.awt.Color getColor()
Specified by:
getColor in class java.awt.Graphics

setColor

public void setColor(java.awt.Color c)
Specified by:
setColor in class java.awt.Graphics

setPaintMode

public void setPaintMode()
not implemented

Specified by:
setPaintMode in class java.awt.Graphics

setXORMode

public void setXORMode(java.awt.Color c)
not implemented

Specified by:
setXORMode in class java.awt.Graphics

getClipRect

public java.awt.Rectangle getClipRect()
not implemented

Overrides:
getClipRect in class java.awt.Graphics

getClipBounds

public java.awt.Rectangle getClipBounds()
not implemented

Specified by:
getClipBounds in class java.awt.Graphics

clipRect

public void clipRect(int x,
                     int y,
                     int w,
                     int h)
not implemented

Specified by:
clipRect in class java.awt.Graphics

setClip

public void setClip(int x,
                    int y,
                    int w,
                    int h)
not implemented

Specified by:
setClip in class java.awt.Graphics

getClip

public java.awt.Shape getClip()
not implemented

Specified by:
getClip in class java.awt.Graphics

setClip

public void setClip(java.awt.Shape clip)
not implemented

Specified by:
setClip in class java.awt.Graphics

drawLine

public void drawLine(int x1in,
                     int y1in,
                     int x2in,
                     int y2in)
not implemented for diagonal lines

Specified by:
drawLine in class java.awt.Graphics

fillRect

public void fillRect(int x,
                     int y,
                     int w,
                     int h)
Specified by:
fillRect in class java.awt.Graphics

clearRect

public void clearRect(int x,
                      int y,
                      int w,
                      int h)
Specified by:
clearRect in class java.awt.Graphics

fillRect

protected void fillRect(int x,
                        int y,
                        int w,
                        int h,
                        int rgb)

drawString

public void drawString(java.lang.String str,
                       int x,
                       int y)
not implemented

Specified by:
drawString in class java.awt.Graphics

drawString

public void drawString(java.text.AttributedCharacterIterator a,
                       int b,
                       int c)
not implemented

Specified by:
drawString in class java.awt.Graphics

drawChars

public void drawChars(char[] data,
                      int offset,
                      int length,
                      int x,
                      int y)
not implemented

Overrides:
drawChars in class java.awt.Graphics

drawBytes

public void drawBytes(byte[] data,
                      int offset,
                      int length,
                      int x,
                      int y)
not implemented

Overrides:
drawBytes in class java.awt.Graphics

drawImage

public boolean drawImage(java.awt.Image img,
                         int x,
                         int y,
                         java.awt.image.ImageObserver observer)
Draws an image at x,y in nonblocking mode with a callback object.

NOTE: Does indeed block! Make sure the image has been fully loaded.

Specified by:
drawImage in class java.awt.Graphics

drawImage

public boolean drawImage(java.awt.Image img,
                         int x,
                         int y,
                         int width,
                         int height,
                         java.awt.image.ImageObserver observer)
Draws an image scaled to x,y,w,h in nonblocking mode with a callback object.

Specified by:
drawImage in class java.awt.Graphics

drawImage

public boolean drawImage(java.awt.Image img,
                         int x,
                         int y,
                         java.awt.Color bg,
                         java.awt.image.ImageObserver observer)
Draws an image at x,y in nonblocking mode with a solid background color and a callback object.

Specified by:
drawImage in class java.awt.Graphics

drawImage

public boolean drawImage(java.awt.Image img,
                         int x,
                         int y,
                         int width,
                         int height,
                         java.awt.Color bg,
                         java.awt.image.ImageObserver observer)
Draws an image scaled to x,y,w,h in nonblocking mode with a solid background color and a callback object. not implemented

Specified by:
drawImage in class java.awt.Graphics

drawImage

public boolean drawImage(java.awt.Image img,
                         int dx1,
                         int dy1,
                         int dx2,
                         int dy2,
                         int sx1,
                         int sy1,
                         int sx2,
                         int sy2,
                         java.awt.image.ImageObserver observer)
not implemented

Specified by:
drawImage in class java.awt.Graphics

drawImage

public boolean drawImage(java.awt.Image img,
                         int dx1,
                         int dy1,
                         int dx2,
                         int dy2,
                         int sx1,
                         int sy1,
                         int sx2,
                         int sy2,
                         java.awt.Color bgcolor,
                         java.awt.image.ImageObserver observer)
not implemented

Specified by:
drawImage in class java.awt.Graphics

copyArea

public void copyArea(int x,
                     int y,
                     int w,
                     int h,
                     int dx,
                     int dy)
not implemented

Specified by:
copyArea in class java.awt.Graphics

drawRoundRect

public void drawRoundRect(int x,
                          int y,
                          int w,
                          int h,
                          int arcWidth,
                          int arcHeight)
not implemented

Specified by:
drawRoundRect in class java.awt.Graphics

fillRoundRect

public void fillRoundRect(int x,
                          int y,
                          int w,
                          int h,
                          int arcWidth,
                          int arcHeight)
not implemented

Specified by:
fillRoundRect in class java.awt.Graphics

drawPolygon

public void drawPolygon(int[] xPoints,
                        int[] yPoints,
                        int nPoints)
not implemented

Specified by:
drawPolygon in class java.awt.Graphics

fillPolygon

public void fillPolygon(int[] xPoints,
                        int[] yPoints,
                        int nPoints)
not implemented

Specified by:
fillPolygon in class java.awt.Graphics

drawOval

public void drawOval(int x,
                     int y,
                     int w,
                     int h)
not implemented

Specified by:
drawOval in class java.awt.Graphics

fillOval

public void fillOval(int x,
                     int y,
                     int w,
                     int h)
not implemented

Specified by:
fillOval in class java.awt.Graphics

drawArc

public void drawArc(int x,
                    int y,
                    int w,
                    int h,
                    int startAngle,
                    int endAngle)
not implemented

Specified by:
drawArc in class java.awt.Graphics

fillArc

public void fillArc(int x,
                    int y,
                    int w,
                    int h,
                    int startAngle,
                    int endAngle)
not implemented

Specified by:
fillArc in class java.awt.Graphics

drawPolyline

public void drawPolyline(int[] xPoints,
                         int[] yPoints,
                         int nPoints)
not implemented

Specified by:
drawPolyline in class java.awt.Graphics

Documentation generated March 5 2003