com.cult3d
Class TextureGraphics

java.lang.Object
  |
  +--java.awt.Graphics
        |
        +--com.cult3d.TextureGraphics

public class TextureGraphics
extends java.awt.Graphics

This is a graphics context that allow an application to draw onto off-screen images.

See Also:
TextureImage

Method Summary
 void clearRect(int x, int y, int width, int height)
          Clears the specified rectangle by filling it with the background color of the current drawing surface.
 void clipRect(int x, int y, int width, int height)
          Intersects the current clip with the specified rectangle.
 void copyArea(int x, int y, int width, int height, int dx, int dy)
          Not implemented in this version.
 java.awt.Graphics create()
          Creates a new Graphics object that is a copy of this Graphics object.
 void dispose()
          Dispose of the system resources used by this graphics context.
 void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
          Not implemented in this version.
 boolean drawImage(java.awt.Image img, int x, int y, java.awt.Color bgcolor, java.awt.image.ImageObserver observer)
           
 boolean drawImage(java.awt.Image img, int x, int y, java.awt.image.ImageObserver observer)
          Draws the specified image at the specified coordinate (x, y).
 boolean drawImage(java.awt.Image img, int x, int y, int width, int height, java.awt.Color bgcolor, java.awt.image.ImageObserver observer)
          Not implemented in this version.
 boolean drawImage(java.awt.Image img, int x, int y, int width, int height, java.awt.image.ImageObserver observer)
          Not implemented in this version.
 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 in this version.
 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 in this version.
 void drawLine(int x1, int y1, int x2, int y2)
          Draws a line between the coordinates (x1,y1) and (x2,y2) using the current color.
 void drawOval(int x, int y, int width, int height)
          Not implemented in this version.
 void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
          Draws the outline of a polygon defined by arrays of x coordinates and y coordinates using the current color.
 void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
          Draws a sequence of connected lines defined by arrays of x coordinates and y coordinates using the current color.
 void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
          Not implemented in this version.
 void drawString(java.lang.String str, int x, int y)
          Draws the specified String using the current font and color.
 void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
          Not implemented in this version.
 void fillOval(int x, int y, int width, int height)
          Not implemented in this version.
 void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
          Not implemented in this version.
 void fillRect(int x, int y, int width, int height)
          Fills the specified rectangle with the current color.
 void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
          Not implemented in this version.
 java.awt.Shape getClip()
          Return a Shape object representing the current clipping area.
 java.awt.Rectangle getClipBounds()
          Returns the bounding rectangle of the current clipping area.
 java.awt.Color getColor()
          Gets the current color.
 java.awt.Font getFont()
          Gets the current font.
 java.awt.FontMetrics getFontMetrics(java.awt.Font f)
          Gets the font metrics for the specified font.
 void setClip(int x, int y, int width, int height)
          Sets the current clip to the rectangle specified by the given coordinates.
 void setClip(java.awt.Shape clip)
          Set the current clipping area to an arbitrary clip shape.
 void setColor(java.awt.Color c)
          Sets the current color to the specified color.
 void setFont(java.awt.Font font)
          Sets the font for all subsequent text rendering operations.
 void setPaintMode()
          Sets the logical pixel operation function to the Paint, or overwrite mode.
 void setXORMode(java.awt.Color c1)
          Not implemented in this version.
 void translate(int x, int y)
          Translates the origin of the graphics context to the point (x, y) in the current coordinate system.
 
Methods inherited from class java.awt.Graphics
create, draw3DRect, drawBytes, drawChars, drawPolygon, drawRect, drawString, fill3DRect, fillPolygon, finalize, getClipBounds, getClipRect, getFontMetrics, hitClip, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

create

public java.awt.Graphics create()
Creates a new Graphics object that is a copy of this Graphics object.
Overrides:
create in class java.awt.Graphics

translate

public void translate(int x,
                      int y)
Translates the origin of the graphics context to the point (x, y) in the current coordinate system. All coordinates used in subsequent rendering operations on this graphics context will be relative to this new origin.
Parameters:
x - the x coordinate of the new translation origin
y - the y coordinate of the new translation origin
Overrides:
translate in class java.awt.Graphics

getColor

public java.awt.Color getColor()
Gets the current color.
Overrides:
getColor in class java.awt.Graphics
See Also:
setColor(java.awt.Color)

setColor

public void setColor(java.awt.Color c)
Sets the current color to the specified color. All subsequent rendering operations will use this specified color.
Parameters:
c - the new rendering color
Overrides:
setColor in class java.awt.Graphics
See Also:
getColor()

setPaintMode

public void setPaintMode()
Sets the logical pixel operation function to the Paint, or overwrite mode. All subsequent rendering operations will overwrite the destination with the current color.
Overrides:
setPaintMode in class java.awt.Graphics

setXORMode

public void setXORMode(java.awt.Color c1)
Not implemented in this version.
Throws:
IllegalAccessError -  
Overrides:
setXORMode in class java.awt.Graphics

getFont

public java.awt.Font getFont()
Gets the current font.
Overrides:
getFont in class java.awt.Graphics
See Also:
setFont(java.awt.Font)

setFont

public void setFont(java.awt.Font font)
Sets the font for all subsequent text rendering operations.
Parameters:
font - the specified font
Overrides:
setFont in class java.awt.Graphics
See Also:
getFont(), drawString(java.lang.String, int, int), Graphics.drawBytes(byte[], int, int, int, int), Graphics.drawChars(char[], int, int, int, int)

getFontMetrics

public java.awt.FontMetrics getFontMetrics(java.awt.Font f)
Gets the font metrics for the specified font.
Parameters:
f - the specified font
Overrides:
getFontMetrics in class java.awt.Graphics
See Also:
getFont()

getClipBounds

public java.awt.Rectangle getClipBounds()
Returns the bounding rectangle of the current clipping area. The coordinates in the rectangle are relative to the coordinate system origin of this graphics context.
Overrides:
getClipBounds in class java.awt.Graphics
See Also:
getClip(), clipRect(int, int, int, int), setClip(int, int, int, int), setClip(Shape)

clipRect

public void clipRect(int x,
                     int y,
                     int width,
                     int height)
Intersects the current clip with the specified rectangle. The resulting clipping area is the intersection of the current clipping area and the specified rectangle. This method can only be used to make the current clip smaller. To set the current clip larger, use any of the setClip methods. Rendering operations have no effect outside of the clipping area.
Parameters:
x - the x coordinate of the rectangle to intersect the clip with
y - the y coordinate of the rectangle to intersect the clip with
width - the width of the rectangle to intersect the clip with
height - the height of the rectangle to intersect the clip with
Overrides:
clipRect in class java.awt.Graphics
See Also:
setClip(int, int, int, int), setClip(Shape)

setClip

public void setClip(int x,
                    int y,
                    int width,
                    int height)
Sets the current clip to the rectangle specified by the given coordinates. Rendering operations have no effect outside of the clipping area.
Parameters:
x - the x coordinate of the new clip rectangle
y - the y coordinate of the new clip rectangle
width - the width of the new clip rectangle
height - the height of the new clip rectangle
Overrides:
setClip in class java.awt.Graphics
See Also:
clipRect(int, int, int, int), setClip(Shape)

getClip

public java.awt.Shape getClip()
Return a Shape object representing the current clipping area.
Overrides:
getClip in class java.awt.Graphics
See Also:
getClipBounds(), clipRect(int, int, int, int), setClip(int, int, int, int), setClip(Shape)

setClip

public void setClip(java.awt.Shape clip)
Set the current clipping area to an arbitrary clip shape. The only Shape objects which are supported are Rectangle objects.
Overrides:
setClip in class java.awt.Graphics
See Also:
getClip(), clipRect(int, int, int, int), setClip(int, int, int, int)

copyArea

public void copyArea(int x,
                     int y,
                     int width,
                     int height,
                     int dx,
                     int dy)
Not implemented in this version.
Overrides:
copyArea in class java.awt.Graphics

drawLine

public void drawLine(int x1,
                     int y1,
                     int x2,
                     int y2)
Draws a line between the coordinates (x1,y1) and (x2,y2) using the current color.
Parameters:
x1 - the x coordinate of the start of the line
y1 - the y coordinate of the start of the line
x2 - the x coordinate of the end of the line
y2 - the y coordinate of the end of the line
Overrides:
drawLine in class java.awt.Graphics

fillRect

public void fillRect(int x,
                     int y,
                     int width,
                     int height)
Fills the specified rectangle with the current color.
Parameters:
x - the x coordinate of the rectangle to be filled
y - the y coordinate of the rectangle to be filled
width - the width of the rectangle to be filled
height - the height of the rectangle to be filled
Overrides:
fillRect in class java.awt.Graphics
See Also:
Graphics.drawRect(int, int, int, int), clearRect(int, int, int, int)

clearRect

public void clearRect(int x,
                      int y,
                      int width,
                      int height)
Clears the specified rectangle by filling it with the background color of the current drawing surface.
Parameters:
x - the x coordinate of the rectangle to clear
y - the y coordinate of the rectangle to clear
width - the width of the rectangle to clear
height - the height of the rectangle to clear
Overrides:
clearRect in class java.awt.Graphics
See Also:
fillRect(int, int, int, int), Graphics.drawRect(int, int, int, int)

drawRoundRect

public void drawRoundRect(int x,
                          int y,
                          int width,
                          int height,
                          int arcWidth,
                          int arcHeight)
Not implemented in this version.
Throws:
IllegalAccessError -  
Overrides:
drawRoundRect in class java.awt.Graphics

fillRoundRect

public void fillRoundRect(int x,
                          int y,
                          int width,
                          int height,
                          int arcWidth,
                          int arcHeight)
Not implemented in this version.
Throws:
IllegalAccessError -  
Overrides:
fillRoundRect in class java.awt.Graphics

drawOval

public void drawOval(int x,
                     int y,
                     int width,
                     int height)
Not implemented in this version.
Throws:
IllegalAccessError -  
Overrides:
drawOval in class java.awt.Graphics

fillOval

public void fillOval(int x,
                     int y,
                     int width,
                     int height)
Not implemented in this version.
Throws:
IllegalAccessError -  
Overrides:
fillOval in class java.awt.Graphics

drawArc

public void drawArc(int x,
                    int y,
                    int width,
                    int height,
                    int startAngle,
                    int arcAngle)
Not implemented in this version.
Throws:
IllegalAccessError -  
Overrides:
drawArc in class java.awt.Graphics

fillArc

public void fillArc(int x,
                    int y,
                    int width,
                    int height,
                    int startAngle,
                    int arcAngle)
Not implemented in this version.
Throws:
IllegalAccessError -  
Overrides:
fillArc in class java.awt.Graphics

drawPolyline

public void drawPolyline(int[] xPoints,
                         int[] yPoints,
                         int nPoints)
Draws a sequence of connected lines defined by arrays of x coordinates and y coordinates using the current color. The figure is not automatically closed if the first coordinate is different from the last coordinate.
Parameters:
xPoints - an array of x points
yPoints - an array of y points
nPoints - the total number of points
Overrides:
drawPolyline in class java.awt.Graphics
See Also:
drawPolygon(int[], int[], int)

drawPolygon

public void drawPolygon(int[] xPoints,
                        int[] yPoints,
                        int nPoints)
Draws the outline of a polygon defined by arrays of x coordinates and y coordinates using the current color. The figure is automatically closed by drawing a line connecting the first coordinate to the last if they are different.
Parameters:
xPoints - an array of x points
yPoints - an array of y points
nPoints - the total number of points
Overrides:
drawPolygon in class java.awt.Graphics
See Also:
drawPolyline(int[], int[], int)

fillPolygon

public void fillPolygon(int[] xPoints,
                        int[] yPoints,
                        int nPoints)
Not implemented in this version.
Throws:
IllegalAccessError -  
Overrides:
fillPolygon in class java.awt.Graphics

drawString

public void drawString(java.lang.String str,
                       int x,
                       int y)
Draws the specified String using the current font and color. The x,y position is the starting point of the baseline of the String.
Parameters:
str - the String to be drawn
x - the x coordinate of the baseline of the text
y - the y coordinate of the baseline of the text
Overrides:
drawString in class java.awt.Graphics

drawImage

public boolean drawImage(java.awt.Image img,
                         int x,
                         int y,
                         java.awt.image.ImageObserver observer)
Draws the specified image at the specified coordinate (x, y).
Parameters:
img - the specified image to be drawn
x - the x coordinate
y - the y coordinate
observer - ignored
Overrides:
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)
Not implemented in this version.
Throws:
IllegalAccessError -  
Overrides:
drawImage in class java.awt.Graphics

drawImage

public boolean drawImage(java.awt.Image img,
                         int x,
                         int y,
                         java.awt.Color bgcolor,
                         java.awt.image.ImageObserver observer)
Overrides:
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 bgcolor,
                         java.awt.image.ImageObserver observer)
Not implemented in this version.
Throws:
IllegalAccessError -  
Overrides:
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 in this version.
Throws:
IllegalAccessError -  
Overrides:
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 in this version.
Throws:
IllegalAccessError -  
Overrides:
drawImage in class java.awt.Graphics

dispose

public void dispose()
Dispose of the system resources used by this graphics context.
Overrides:
dispose in class java.awt.Graphics