org.rosuda.pograss
Class PoGraSSPDF

java.lang.Object
  extended by org.rosuda.pograss.PoGraSS
      extended by org.rosuda.pograss.PoGraSSPDF

public class PoGraSSPDF
extends PoGraSS

Portable Graphics SubSystem - PDF implementation, based on PS implementation Bugs: in this PS implementation xxxOval, xxxRoundRectangle etc. require dx=dy because in PostScript arc resp. arcto is used where both of them require only one radius argument in fact spacing is done with dx/dy but arc is drawn with dx only, thus resulting in ugly drawing Changelog: 1.0.0 initial release 1.0.1 added support for raw PrintStream constructor added support for monochromatic PS: if equal RGB values are used, set grayscale

Version:
$Id: PoGraSSPDF.java 454 2003-07-30 23:03:55Z starsoft $

Field Summary
 
Fields inherited from class org.rosuda.pograss.PoGraSS
FA_Bold, FA_Ital, FA_MASK_Type, FA_Normal, FF_Mono, FF_SansSerif, FF_Serif, localLayerCache, TA_Center, TA_Left, TA_MASK_Or, TA_Right, version, versionString
 
Constructor Summary
PoGraSSPDF(java.io.PrintStream ps)
           
PoGraSSPDF(java.lang.String fnn)
           
 
Method Summary
 void addComment(java.lang.String c)
           
 void begin()
           
 void closePSoutput()
           
 void defineColor(java.lang.String nam, int R, int G, int B)
           
 void defineColor(java.lang.String nam, java.lang.String cmd)
           
 void drawLine(int x1, int y1, int x2, int y2)
           
 void drawOval(int x, int y, int rx, int ry)
           
 void drawPolygon(int[] x, int[] y, int pts, boolean closed)
           
 void drawRect(int x1, int y1, int x2, int y2)
           
 void drawRoundRect(int x1, int y1, int x2, int y2, int dx, int dy)
           
 void drawString(java.lang.String txt, int x, int y)
           
 void drawString(java.lang.String txt, int x, int y, double ax, double ay)
          draw string with anchor point x,y where ax and ay translate the anchor relative to text extension.
 void drawString(java.lang.String txt, int x, int y, int att)
          draw string with special attributes set (e.g. alignment etc.)
 void end()
           
 void fillOval(int x, int y, int rx, int ry)
           
 void fillPolygon(int[] x, int[] y, int pts)
           
 void fillRect(int x1, int y1, int x2, int y2)
           
 void fillRoundRect(int x1, int y1, int x2, int y2, int dx, int dy)
           
 void lineTo(int x, int y)
           
 void moveTo(int x, int y)
           
 void nextLayer()
           
 void passVersionInfo(int ver, java.lang.String verS)
           
 void setBounds(int w, int h)
           
 void setColor(int R, int G, int B)
           
 void setColor(java.lang.String nam)
           
 void setFillColor(int R, int G, int B)
           
 void setFillColor(java.lang.String nam)
           
 void setFillStyle(int s)
           
 void setFontFace(int face)
          set font face by style
 void setFontSize(int pt)
           
 void setFontStyle(int attr)
           
 void setLineWidth(int w)
           
 void setOptionalFace(java.lang.String name)
          set optional font face. the underlying system will use the face only if it's available.
 void setTitle(java.lang.String t)
           
 
Methods inherited from class org.rosuda.pograss.PoGraSS
beginAlphaBlock, defineColor, drawArc, drawImage, drawPolygon, drawPolyline, drawString, endAlphaBlock, fallbackAlpha, fillArc, getBounds, getHeightEstimate, getWidthEstimate, internalSupportsAlpha, nextObject, nextObject, oval, polygon, rect, resetClip, resetGlobalAlpha, roundRect, setBounds, setBrushColor, setBrushColor, setBrushColor, setBrushColor, setClip, setColor, setColor, setColor, setFontFace, setFontSize, setGlobalAlpha, setLineWidth, setOutPrintStream, setPenColor, setPenColor, setPenColor, setPenColor, useJointColors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PoGraSSPDF

public PoGraSSPDF(java.lang.String fnn)

PoGraSSPDF

public PoGraSSPDF(java.io.PrintStream ps)
Method Detail

defineColor

public void defineColor(java.lang.String nam,
                        java.lang.String cmd)

passVersionInfo

public void passVersionInfo(int ver,
                            java.lang.String verS)
Overrides:
passVersionInfo in class PoGraSS

setBounds

public void setBounds(int w,
                      int h)
Overrides:
setBounds in class PoGraSS

addComment

public void addComment(java.lang.String c)
Overrides:
addComment in class PoGraSS

setTitle

public void setTitle(java.lang.String t)
Overrides:
setTitle in class PoGraSS

defineColor

public void defineColor(java.lang.String nam,
                        int R,
                        int G,
                        int B)
Overrides:
defineColor in class PoGraSS

setColor

public void setColor(int R,
                     int G,
                     int B)
Overrides:
setColor in class PoGraSS

setColor

public void setColor(java.lang.String nam)
Overrides:
setColor in class PoGraSS

setFillColor

public void setFillColor(int R,
                         int G,
                         int B)

setFillColor

public void setFillColor(java.lang.String nam)

drawLine

public void drawLine(int x1,
                     int y1,
                     int x2,
                     int y2)
Overrides:
drawLine in class PoGraSS

moveTo

public void moveTo(int x,
                   int y)
Overrides:
moveTo in class PoGraSS

lineTo

public void lineTo(int x,
                   int y)
Overrides:
lineTo in class PoGraSS

drawPolygon

public void drawPolygon(int[] x,
                        int[] y,
                        int pts,
                        boolean closed)
Overrides:
drawPolygon in class PoGraSS

fillPolygon

public void fillPolygon(int[] x,
                        int[] y,
                        int pts)
Overrides:
fillPolygon in class PoGraSS

drawRect

public void drawRect(int x1,
                     int y1,
                     int x2,
                     int y2)
Overrides:
drawRect in class PoGraSS

fillRect

public void fillRect(int x1,
                     int y1,
                     int x2,
                     int y2)
Overrides:
fillRect in class PoGraSS

drawRoundRect

public void drawRoundRect(int x1,
                          int y1,
                          int x2,
                          int y2,
                          int dx,
                          int dy)
Overrides:
drawRoundRect in class PoGraSS

fillRoundRect

public void fillRoundRect(int x1,
                          int y1,
                          int x2,
                          int y2,
                          int dx,
                          int dy)
Overrides:
fillRoundRect in class PoGraSS

drawOval

public void drawOval(int x,
                     int y,
                     int rx,
                     int ry)
Overrides:
drawOval in class PoGraSS

fillOval

public void fillOval(int x,
                     int y,
                     int rx,
                     int ry)
Overrides:
fillOval in class PoGraSS

setLineWidth

public void setLineWidth(int w)

setFillStyle

public void setFillStyle(int s)
Overrides:
setFillStyle in class PoGraSS

drawString

public void drawString(java.lang.String txt,
                       int x,
                       int y)
Overrides:
drawString in class PoGraSS

drawString

public void drawString(java.lang.String txt,
                       int x,
                       int y,
                       int att)
Description copied from class: PoGraSS
draw string with special attributes set (e.g. alignment etc.) default is left alignment, horizontal

Overrides:
drawString in class PoGraSS

drawString

public void drawString(java.lang.String txt,
                       int x,
                       int y,
                       double ax,
                       double ay)
Description copied from class: PoGraSS
draw string with anchor point x,y where ax and ay translate the anchor relative to text extension. For example ax=0.5, ay=0.5 center the text in both directions relative to the anchor point.

Overrides:
drawString in class PoGraSS

nextLayer

public void nextLayer()
Overrides:
nextLayer in class PoGraSS

begin

public void begin()
Overrides:
begin in class PoGraSS

end

public void end()
Overrides:
end in class PoGraSS

closePSoutput

public void closePSoutput()

setFontFace

public void setFontFace(int face)
Description copied from class: PoGraSS
set font face by style

Overrides:
setFontFace in class PoGraSS

setOptionalFace

public void setOptionalFace(java.lang.String name)
Description copied from class: PoGraSS
set optional font face. the underlying system will use the face only if it's available. you should specify the desired font type by PoGraSS.setFontFace(int) and refine this selection by setting optional face. It is not guaranteed that this face will be used, keep it in mind. example: setFontFace(FF_SansSerif); setOptionalFont("Helvetica"); setOptionalFont("Myriad");

Overrides:
setOptionalFace in class PoGraSS

setFontSize

public void setFontSize(int pt)

setFontStyle

public void setFontStyle(int attr)
Overrides:
setFontStyle in class PoGraSS