All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class lyon.dclap.Gr2PICT

java.lang.Object
   |
   +----java.awt.Graphics
           |
           +----lyon.dclap.Gr2PICT

public class Gr2PICT
extends java.awt.Graphics
Gr2PICT is a Graphics subclass that draws to PICT format.

Version:
1.0
Author:
Don Gilbert

Variable Index

 o clipr
 o CLONE
 o clr
 o fAlign
 o font
 o g
 o origin
 o os
 o PAGEHEIGHT
 o PAGEWIDTH
 o trouble

Constructor Index

 o Gr2PICT(OutputStream, Graphics)
Constructs a new Gr2PICT Object.
 o Gr2PICT(OutputStream, Graphics, int)

Method Index

 o beginPicGroup()
 o checkError()
 o clearRect(int, int, int, int)
Clears the specified rectangle by filling it with the current background color of the current drawing surface.
 o clipRect(int, int, int, int)
Clips to a rectangle.
 o copyArea(int, int, int, int, int, int)
Copies an area of the screen.
 o create()
Creates a new Gr2PICT Object that is a copy of the original Gr2PICT Object.
 o create(int, int, int, int)
Creates a new Graphics Object with the specified parameters, based on the original Graphics Object.
 o dispose()
Disposes of this graphics context.
 o doImage(Image, int, int, int, int, ImageObserver, Color)
// possible data for imaging // hexadecimal digits protected final static char hd[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; // number of chars in a full row of pixel data protected final static int charsPerRow = 12*6;
 o draw3DRect(int, int, int, int, boolean)
Draws a highlighted 3-D rectangle.
 o drawArc(int, int, int, int, int, int)
Draws an arc bounded by the specified rectangle from startAngle to endAngle.
 o drawBytes(byte[], int, int, int, int)
Draws the specified bytes using the current font and color.
 o drawChars(char[], int, int, int, int)
Draws the specified characters using the current font and color.
 o drawImage(Image, int, int, Color, ImageObserver)
Draws the specified image at the specified coordinate (x, y).
 o drawImage(Image, int, int, ImageObserver)
Draws the specified image at the specified coordinate (x, y).
 o drawImage(Image, int, int, int, int, Color, ImageObserver)
Draws the specified image inside the specified rectangle.
 o drawImage(Image, int, int, int, int, ImageObserver)
Draws the specified image inside the specified rectangle.
 o drawImage(Image, int, int, int, int, int, int, int, int, Color, ImageObserver)
 o drawImage(Image, int, int, int, int, int, int, int, int, ImageObserver)
 o drawLine(int, int, int, int)
Draws a line between the coordinates (x1,y1) and (x2,y2).
 o drawOval(int, int, int, int)
Draws an oval inside the specified rectangle using the current color.
 o drawPolygon(int[], int[], int)
Draws a polygon defined by an array of x points and y points.
 o drawPolygon(Polygon)
Draws a polygon defined by the specified point.
 o drawPolyline(int[], int[], int)
 o drawRect(int, int, int, int)
Draws the outline of the specified rectangle using the current color.
 o drawRoundRect(int, int, int, int, int, int)
Draws an outlined rounded corner rectangle using the current color.
 o drawString(String, int, int)
Draws the specified String using the current font and color.
 o emitbyte(int)
 o emitcolor(Color)
 o emitcomment(int, int, String)
 o emitHeader(int, int)
Top of every PICT file
 o emitint(int)
 o emitop(int)
 o emitpolygon(Polygon)
 o emitrect(int, int, int, int)
 o emitroundrect(int, int, int, int, int, int, int)
 o emitstring(String)
 o emitword(int)
 o endPicGroup()
 o fill3DRect(int, int, int, int, boolean)
Paints a highlighted 3-D rectangle using the current color.
 o fillArc(int, int, int, int, int, int)
Fills an arc using the current color.
 o fillOval(int, int, int, int)
Fills an oval inside the specified rectangle using the current color.
 o fillPolygon(int[], int[], int)
Fills a polygon with the current color.
 o fillPolygon(Polygon)
Fills the specified polygon with the current color.
 o fillRect(int, int, int, int)
Fills the specified rectangle with the current color.
 o fillRoundRect(int, int, int, int, int, int)
Draws a rounded rectangle filled in with the current color.
 o finalize()
Disposes of this graphics context once it is no longer referenced.
 o getClip()
 o getClipBounds()
 o getClipRect()
Returns the bounding rectangle of the current clipping area.
 o getColor()
Gets the current color.
 o getFont()
Gets the current font.
 o getFontMetrics()
Gets the current font metrics.
 o getFontMetrics(Font)
Gets the current font metrics for the specified font.
 o laserLine(int, int)
 o setClip(int, int, int, int)
 o setClip(Shape)
 o setColor(Color)
Sets the current color to the specified color.
 o setFont(Font)
Sets the font for all subsequent text-drawing operations.
 o setPaintMode()
Sets the default paint mode to overwrite the destination with the current color.
 o setXORMode(Color)
Sets the paint mode to alternate between the current color and the new specified color.
 o toString()
Returns a String object representing this Graphic's value.
 o translate(int, int)
Translates the specified parameters into the origin of the graphics context.

Variables

 o CLONE
 public static final int CLONE
 o PAGEHEIGHT
 protected static final int PAGEHEIGHT
 o PAGEWIDTH
 protected static final int PAGEWIDTH
 o os
 protected java.io.DataOutputStream os
 o clr
 protected java.awt.Color clr
 o font
 protected java.awt.Font font
 o clipr
 protected java.awt.Rectangle clipr
 o origin
 protected java.awt.Point origin
 o trouble
 protected boolean trouble
 o g
 protected java.awt.Graphics g
 o fAlign
 private int fAlign

Constructors

 o Gr2PICT
 public Gr2PICT(java.io.OutputStream o,
                java.awt.Graphics g)
Constructs a new Gr2PICT Object. Unlike regular Graphics objects, Gr2PICT contexts can be created directly.

Parameters:
o - Output stream for PostScript output
See Also:
create
 o Gr2PICT
 public Gr2PICT(java.io.OutputStream o,
                java.awt.Graphics g,
                int what)

Methods

 o getClipBounds
 public java.awt.Rectangle getClipBounds()
Overrides:
getClipBounds in class java.awt.Graphics
 o setClip
 public void setClip(int a,
                     int b,
                     int c,
                     int d)
Overrides:
setClip in class java.awt.Graphics
 o setClip
 public void setClip(java.awt.Shape a)
Overrides:
setClip in class java.awt.Graphics
 o getClip
 public java.awt.Shape getClip()
Overrides:
getClip in class java.awt.Graphics
 o drawPolyline
 public void drawPolyline(int a[],
                          int b[],
                          int c)
Overrides:
drawPolyline in class java.awt.Graphics
 o drawImage
 public boolean drawImage(java.awt.Image i,
                          int a,
                          int b,
                          int c,
                          int d,
                          int e,
                          int f,
                          int g,
                          int h,
                          java.awt.image.ImageObserver o)
Overrides:
drawImage in class java.awt.Graphics
 o drawImage
 public boolean drawImage(java.awt.Image i,
                          int a,
                          int b,
                          int c,
                          int d,
                          int e,
                          int f,
                          int g,
                          int h,
                          java.awt.Color cl,
                          java.awt.image.ImageObserver o)
Overrides:
drawImage in class java.awt.Graphics
 o emitbyte
 protected void emitbyte(int v)
 o emitword
 protected void emitword(int v)
 o emitint
 protected void emitint(int v)
 o emitstring
 protected void emitstring(java.lang.String s)
 o emitop
 protected final void emitop(int op)
 o emitcolor
 protected final void emitcolor(java.awt.Color c)
 o emitrect
 protected final void emitrect(int x,
                               int y,
                               int width,
                               int height)
 o emitroundrect
 protected final void emitroundrect(int opcode,
                                    int x,
                                    int y,
                                    int width,
                                    int height,
                                    int arcWidth,
                                    int arcHeight)
 o emitpolygon
 protected void emitpolygon(java.awt.Polygon p)
 o emitcomment
 protected void emitcomment(int kind,
                            int datasize,
                            java.lang.String data)
 o beginPicGroup
 public final void beginPicGroup()
 o endPicGroup
 public final void endPicGroup()
 o laserLine
 public void laserLine(int num,
                       int denom)
 o emitHeader
 protected void emitHeader(int picwidth,
                           int picheight)
Top of every PICT file

 o create
 public java.awt.Graphics create()
Creates a new Gr2PICT Object that is a copy of the original Gr2PICT Object.

Overrides:
create in class java.awt.Graphics
 o create
 public java.awt.Graphics create(int x,
                                 int y,
                                 int width,
                                 int height)
Creates a new Graphics Object with the specified parameters, based on the original Graphics Object. This method translates the specified parameters, x and y, to the proper origin coordinates and then clips the Graphics Object to the area.

Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the area
height - the height of the area
Overrides:
create in class java.awt.Graphics
See Also:
translate
 o translate
 public void translate(int x,
                       int y)
Translates the specified parameters into the origin of the graphics context. All subsequent operations on this graphics context will be relative to this origin.

Parameters:
x - the x coordinate
y - the y coordinate
Overrides:
translate in class java.awt.Graphics
See Also:
scale
 o getColor
 public java.awt.Color getColor()
Gets the current color.

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

Parameters:
c - the color to be set
Overrides:
setColor in class java.awt.Graphics
See Also:
getColor
 o setPaintMode
 public void setPaintMode()
Sets the default paint mode to overwrite the destination with the current color.

Overrides:
setPaintMode in class java.awt.Graphics
 o setXORMode
 public void setXORMode(java.awt.Color c1)
Sets the paint mode to alternate between the current color and the new specified color.

Parameters:
c1 - the second color
Overrides:
setXORMode in class java.awt.Graphics
 o getFont
 public java.awt.Font getFont()
Gets the current font.

Overrides:
getFont in class java.awt.Graphics
See Also:
setFont
 o setFont
 public void setFont(java.awt.Font f)
Sets the font for all subsequent text-drawing operations.

Parameters:
font - the specified font
Overrides:
setFont in class java.awt.Graphics
See Also:
drawChars
 o getFontMetrics
 public java.awt.FontMetrics getFontMetrics()
Gets the current font metrics.

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

Parameters:
f - the specified font
Overrides:
getFontMetrics in class java.awt.Graphics
See Also:
getFontMetrics
 o getClipRect
 public java.awt.Rectangle getClipRect()
Returns the bounding rectangle of the current clipping area.

Overrides:
getClipRect in class java.awt.Graphics
See Also:
clipRect
 o clipRect
 public void clipRect(int x,
                      int y,
                      int width,
                      int height)
Clips to a rectangle. The resulting clipping area is the intersection of the current clipping area and the specified rectangle. Graphic operations have no effect outside of the clipping area.

Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
Overrides:
clipRect in class java.awt.Graphics
See Also:
getClipRect
 o copyArea
 public void copyArea(int x,
                      int y,
                      int width,
                      int height,
                      int dx,
                      int dy)
Copies an area of the screen.

Parameters:
x - the x-coordinate of the source
y - the y-coordinate of the source
width - the width
height - the height
dx - the horizontal distance
dy - the vertical distance
Overrides:
copyArea in class java.awt.Graphics
 o drawLine
 public void drawLine(int x1,
                      int y1,
                      int x2,
                      int y2)
Draws a line between the coordinates (x1,y1) and (x2,y2). The line is drawn below and to the left of the logical coordinates.

Parameters:
x1 - the first point's x coordinate
y1 - the first point's y coordinate
x2 - the second point's x coordinate
y2 - the second point's y coordinate
Overrides:
drawLine in class java.awt.Graphics
 o 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
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
Overrides:
fillRect in class java.awt.Graphics
See Also:
clearRect
 o drawRect
 public void drawRect(int x,
                      int y,
                      int width,
                      int height)
Draws the outline of the specified rectangle using the current color. Use drawRect(x, y, width-1, height-1) to draw the outline inside the specified rectangle.

Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
Overrides:
drawRect in class java.awt.Graphics
See Also:
clearRect
 o clearRect
 public void clearRect(int x,
                       int y,
                       int width,
                       int height)
Clears the specified rectangle by filling it with the current background color of the current drawing surface. Which drawing surface it selects depends on how the graphics context was created.

Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
Overrides:
clearRect in class java.awt.Graphics
See Also:
drawRect
 o drawRoundRect
 public void drawRoundRect(int x,
                           int y,
                           int width,
                           int height,
                           int arcWidth,
                           int arcHeight)
Draws an outlined rounded corner rectangle using the current color.

Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
arcWidth - the diameter of the arc
arcHeight - the radius of the arc
Overrides:
drawRoundRect in class java.awt.Graphics
See Also:
fillRoundRect
 o fillRoundRect
 public void fillRoundRect(int x,
                           int y,
                           int width,
                           int height,
                           int arcWidth,
                           int arcHeight)
Draws a rounded rectangle filled in with the current color.

Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
arcWidth - the diameter of the arc
arcHeight - the radius of the arc
Overrides:
fillRoundRect in class java.awt.Graphics
See Also:
drawRoundRect
 o draw3DRect
 public void draw3DRect(int x,
                        int y,
                        int width,
                        int height,
                        boolean raised)
Draws a highlighted 3-D rectangle.

Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
raised - a boolean that states whether the rectangle is raised or not
Overrides:
draw3DRect in class java.awt.Graphics
 o fill3DRect
 public void fill3DRect(int x,
                        int y,
                        int width,
                        int height,
                        boolean raised)
Paints a highlighted 3-D rectangle using the current color.

Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
raised - a boolean that states whether the rectangle is raised or not
Overrides:
fill3DRect in class java.awt.Graphics
 o drawOval
 public void drawOval(int x,
                      int y,
                      int width,
                      int height)
Draws an oval inside the specified rectangle using the current color.

Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
Overrides:
drawOval in class java.awt.Graphics
See Also:
fillOval
 o fillOval
 public void fillOval(int x,
                      int y,
                      int width,
                      int height)
Fills an oval inside the specified rectangle using the current color.

Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
Overrides:
fillOval in class java.awt.Graphics
See Also:
drawOval
 o drawArc
 public void drawArc(int x,
                     int y,
                     int width,
                     int height,
                     int startAngle,
                     int arcAngle)
Draws an arc bounded by the specified rectangle from startAngle to endAngle. 0 degrees is at the 3-o'clock position.Positive arc angles indicate counter-clockwise rotations, negative arc angles are drawn clockwise.

Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
startAngle - the beginning angle
arcAngle - the angle of the arc (relative to startAngle).
Overrides:
drawArc in class java.awt.Graphics
See Also:
fillArc
 o fillArc
 public void fillArc(int x,
                     int y,
                     int width,
                     int height,
                     int startAngle,
                     int arcAngle)
Fills an arc using the current color. This generates a pie shape.

Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the arc
height - the height of the arc
startAngle - the beginning angle
arcAngle - the angle of the arc (relative to startAngle).
Overrides:
fillArc in class java.awt.Graphics
See Also:
drawArc
 o drawPolygon
 public void drawPolygon(int xPoints[],
                         int yPoints[],
                         int nPoints)
Draws a polygon defined by an array of x points and y points.

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:
fillPolygon
 o drawPolygon
 public void drawPolygon(java.awt.Polygon p)
Draws a polygon defined by the specified point.

Parameters:
p - the specified polygon
Overrides:
drawPolygon in class java.awt.Graphics
See Also:
fillPolygon
 o fillPolygon
 public void fillPolygon(int xPoints[],
                         int yPoints[],
                         int nPoints)
Fills a polygon with the current color.

Parameters:
xPoints - an array of x points
yPoints - an array of y points
nPoints - the total number of points
Overrides:
fillPolygon in class java.awt.Graphics
See Also:
drawPolygon
 o fillPolygon
 public void fillPolygon(java.awt.Polygon p)
Fills the specified polygon with the current color.

Parameters:
p - the polygon
Overrides:
fillPolygon in class java.awt.Graphics
See Also:
drawPolygon
 o 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
y - the y coordinate
Overrides:
drawString in class java.awt.Graphics
See Also:
drawBytes
 o drawChars
 public void drawChars(char data[],
                       int offset,
                       int length,
                       int x,
                       int y)
Draws the specified characters using the current font and color.

Parameters:
data - the array of characters to be drawn
offset - the start offset in the data
length - the number of characters to be drawn
x - the x coordinate
y - the y coordinate
Overrides:
drawChars in class java.awt.Graphics
See Also:
drawBytes
 o drawBytes
 public void drawBytes(byte data[],
                       int offset,
                       int length,
                       int x,
                       int y)
Draws the specified bytes using the current font and color.

Parameters:
data - the data to be drawn
offset - the start offset in the data
length - the number of bytes that are drawn
x - the x coordinate
y - the y coordinate
Overrides:
drawBytes in class java.awt.Graphics
See Also:
drawChars
 o doImage
 public boolean doImage(java.awt.Image img,
                        int x,
                        int y,
                        int width,
                        int height,
                        java.awt.image.ImageObserver observer,
                        java.awt.Color bgcolor)
// possible data for imaging // hexadecimal digits protected final static char hd[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; // number of chars in a full row of pixel data protected final static int charsPerRow = 12*6;

 o 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). If the image is incomplete the image observer will be notified later.

Parameters:
img - the specified image to be drawn
x - the x coordinate
y - the y coordinate
observer - notifies if the image is complete or not
Overrides:
drawImage in class java.awt.Graphics
See Also:
ImageObserver
 o drawImage
 public boolean drawImage(java.awt.Image img,
                          int x,
                          int y,
                          int width,
                          int height,
                          java.awt.image.ImageObserver observer)
Draws the specified image inside the specified rectangle. The image is scaled if necessary. If the image is incomplete the image observer will be notified later.

Parameters:
img - the specified image to be drawn
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
observer - notifies if the image is complete or not
Overrides:
drawImage in class java.awt.Graphics
See Also:
ImageObserver
 o drawImage
 public boolean drawImage(java.awt.Image img,
                          int x,
                          int y,
                          java.awt.Color bgcolor,
                          java.awt.image.ImageObserver observer)
Draws the specified image at the specified coordinate (x, y). If the image is incomplete the image observer will be notified later.

Parameters:
img - the specified image to be drawn
x - the x coordinate
y - the y coordinate
bgcolor - the background color
observer - notifies if the image is complete or not
Overrides:
drawImage in class java.awt.Graphics
See Also:
ImageObserver
 o 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)
Draws the specified image inside the specified rectangle. The image is scaled if necessary. If the image is incomplete the image observer will be notified later.

Parameters:
img - the specified image to be drawn
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
bgcolor - the background color
observer - notifies if the image is complete or not
Overrides:
drawImage in class java.awt.Graphics
See Also:
ImageObserver
 o dispose
 public void dispose()
Disposes of this graphics context. The Graphics context cannot be used after being disposed of.

Overrides:
dispose in class java.awt.Graphics
See Also:
finalize
 o finalize
 public void finalize()
Disposes of this graphics context once it is no longer referenced.

Overrides:
finalize in class java.awt.Graphics
See Also:
dispose
 o toString
 public java.lang.String toString()
Returns a String object representing this Graphic's value.

Overrides:
toString in class java.awt.Graphics
 o checkError
 public boolean checkError()

All Packages  Class Hierarchy  This Package  Previous  Next  Index