Java Doc for PSGenerator.java in  » Graphic-Library » xmlgraphics-commons-1.2 » org » apache » xmlgraphics » ps » 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 » Graphic Library » xmlgraphics commons 1.2 » org.apache.xmlgraphics.ps 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.xmlgraphics.ps.PSGenerator

PSGenerator
public class PSGenerator (Code)
This class is used to output PostScript code to an OutputStream.
version:
   $Id: PSGenerator.java 549118 2007-06-20 14:27:03Z jeremias $


Field Summary
final public static  ObjectATEND
     Indicator for the PostScript interpreter that the value is provided later in the document (mostly in the %%Trailer section).
final public static  intDEFAULT_LANGUAGE_LEVEL
    
final public static  charLF
    

Constructor Summary
public  PSGenerator(OutputStream out)
     Creates a new instance.

Method Summary
public  voidcommentln(String comment)
     Writes a comment to the stream and ends the line.
public  voidconcatMatrix(double a, double b, double c, double d, double e, double f)
     Concats the transformation matrix.
public  voidconcatMatrix(double[] matrix)
     Concats the transformations matrix.
public  voidconcatMatrix(AffineTransform at)
     Concats the transformations matric.
final public static  StringconvertRealToDSC(float value)
     Converts a value for use in DSC comments.
final public static  StringconvertStringToDSC(String text)
     Converts text by applying escaping rules established in the DSC specs.
final public static  StringconvertStringToDSC(String text, boolean forceParentheses)
     Converts text by applying escaping rules established in the DSC specs.
public  voiddefineRect(double x, double y, double w, double h)
     Adds a rectangle to the current path.
final public static  voidescapeChar(char c, StringBuffer target)
     Escapes a character conforming to the rules established in the PostScript Language Reference (Search for "Literal Text Strings").
public  voidflush()
     Flushes the OutputStream.
public  StringformatDouble(double value)
     Formats a double value for PostScript output.
public  StringformatDouble5(double value)
     Formats a double value for PostScript output (higher resolution).
public  PSStategetCurrentState()
     Returns the current graphics state.
public  OutputStreamgetOutputStream()
     Returns the OutputStream the PSGenerator writes to.
public  intgetPSLevel()
     Returns the selected PostScript level.
public  ResourceTrackergetResourceTracker()
     Resturns the ResourceTracker instance associated with this PSGenerator.
public  booleanisResourceSupplied(PSResource res)
     Indicates whether a particular resource is supplied, rather than needed.
final public  voidnewLine()
     Writes a newline character to the OutputStream.
public  voidnotifyResourceUsage(PSResource res, boolean needed)
     Notifies the generator about the usage of a resource on the current page.
public  voidnotifyStartNewPage()
     Notifies the generator that a new page has been started and that the page resource set can be cleared.
public  SourceresolveURI(String uri)
     Attempts to resolve the given URI.
public  booleanrestoreGraphicsState()
     Restores the last graphics state of the rendering engine.
public  voidsaveGraphicsState()
     Saves the graphics state of the rendering engine.
public  voidsetPSLevel(int level)
     Sets the PostScript level that is used to generate the current document.
public  voidsetResourceTracker(ResourceTracker resTracker)
     Sets the ResourceTracker instance to be associated with this PSGenerator.
public  voiduseColor(Color col)
     Establishes the specified color.
public  voiduseDash(String pattern)
     Establishes the specified dash pattern.
public  voiduseFont(String name, float size)
     Establishes the specified font and size.
public  voiduseLineCap(int linecap)
     Establishes the specified line cap style.
public  voiduseLineWidth(double width)
     Establishes the specified line width.
public  voiduseRGBColor(Color col)
     Establishes the specified color (RGB).
public  voidwrite(String cmd)
     Writes a PostScript command to the stream.
public  voidwriteByteArr(byte[] cmd)
     Writes encoded data to the PostScript stream.
public  voidwriteDSCComment(String name)
     Writes a DSC comment to the output stream.
public  voidwriteDSCComment(String name, Object param)
     Writes a DSC comment to the output stream.
public  voidwriteDSCComment(String name, Object[] params)
     Writes a DSC comment to the output stream.
public  voidwriteResources(boolean pageLevel)
     Writes a DSC comment for the accumulated used resources, either at page level or at document level.
public  voidwriteln(String cmd)
     Writes a PostScript command to the stream and ends the line.

Field Detail
ATEND
final public static Object ATEND(Code)
Indicator for the PostScript interpreter that the value is provided later in the document (mostly in the %%Trailer section).



DEFAULT_LANGUAGE_LEVEL
final public static int DEFAULT_LANGUAGE_LEVEL(Code)
Default postscript language level



LF
final public static char LF(Code)
Line feed used by PostScript




Constructor Detail
PSGenerator
public PSGenerator(OutputStream out)(Code)
Creates a new instance.
Parameters:
  out - the OutputStream to write the generated PostScript code to




Method Detail
commentln
public void commentln(String comment) throws IOException(Code)
Writes a comment to the stream and ends the line. Output of comments can be disabled to reduce the size of the generated file.
Parameters:
  comment - comment to write
exception:
  IOException - In case of an I/O problem



concatMatrix
public void concatMatrix(double a, double b, double c, double d, double e, double f) throws IOException(Code)
Concats the transformation matrix.
Parameters:
  a - A part
Parameters:
  b - B part
Parameters:
  c - C part
Parameters:
  d - D part
Parameters:
  e - E part
Parameters:
  f - F part
exception:
  IOException - In case of an I/O problem



concatMatrix
public void concatMatrix(double[] matrix) throws IOException(Code)
Concats the transformations matrix.
Parameters:
  matrix - Matrix to use
exception:
  IOException - In case of an I/O problem



concatMatrix
public void concatMatrix(AffineTransform at) throws IOException(Code)
Concats the transformations matric.
Parameters:
  at - the AffineTransform whose matrix to use
exception:
  IOException - In case of an I/O problem



convertRealToDSC
final public static String convertRealToDSC(float value)(Code)
Converts a value for use in DSC comments.
Parameters:
  value - the value to convert String The resulting String



convertStringToDSC
final public static String convertStringToDSC(String text)(Code)
Converts text by applying escaping rules established in the DSC specs.
Parameters:
  text - Text to convert String The resulting String



convertStringToDSC
final public static String convertStringToDSC(String text, boolean forceParentheses)(Code)
Converts text by applying escaping rules established in the DSC specs.
Parameters:
  text - Text to convert
Parameters:
  forceParentheses - Force the use of parentheses String The resulting String



defineRect
public void defineRect(double x, double y, double w, double h) throws IOException(Code)
Adds a rectangle to the current path.
Parameters:
  x - upper left corner
Parameters:
  y - upper left corner
Parameters:
  w - width
Parameters:
  h - height
exception:
  IOException - In case of an I/O problem



escapeChar
final public static void escapeChar(char c, StringBuffer target)(Code)
Escapes a character conforming to the rules established in the PostScript Language Reference (Search for "Literal Text Strings").
Parameters:
  c - character to escape
Parameters:
  target - target StringBuffer to write the escaped character to



flush
public void flush() throws IOException(Code)
Flushes the OutputStream.
exception:
  IOException - In case of an I/O problem



formatDouble
public String formatDouble(double value)(Code)
Formats a double value for PostScript output.
Parameters:
  value - value to format the formatted value



formatDouble5
public String formatDouble5(double value)(Code)
Formats a double value for PostScript output (higher resolution).
Parameters:
  value - value to format the formatted value



getCurrentState
public PSState getCurrentState()(Code)
Returns the current graphics state. the current graphics state



getOutputStream
public OutputStream getOutputStream()(Code)
Returns the OutputStream the PSGenerator writes to. the OutputStream



getPSLevel
public int getPSLevel()(Code)
Returns the selected PostScript level. the PostScript level



getResourceTracker
public ResourceTracker getResourceTracker()(Code)
Resturns the ResourceTracker instance associated with this PSGenerator. the ResourceTracker instance or null if none is assigned



isResourceSupplied
public boolean isResourceSupplied(PSResource res)(Code)
Indicates whether a particular resource is supplied, rather than needed.
Parameters:
  res - the resource true if the resource is registered as being supplied.



newLine
final public void newLine() throws IOException(Code)
Writes a newline character to the OutputStream.
throws:
  IOException - In case of an I/O problem



notifyResourceUsage
public void notifyResourceUsage(PSResource res, boolean needed)(Code)
Notifies the generator about the usage of a resource on the current page.
Parameters:
  res - the resource being used
Parameters:
  needed - true if this is a needed resource, false for a supplied resource



notifyStartNewPage
public void notifyStartNewPage()(Code)
Notifies the generator that a new page has been started and that the page resource set can be cleared.



resolveURI
public Source resolveURI(String uri)(Code)
Attempts to resolve the given URI. PSGenerator should be subclasses to provide more sophisticated URI resolution.
Parameters:
  uri - URI to access A javax.xml.transform.Source object, or null if the URIcannot be resolved.



restoreGraphicsState
public boolean restoreGraphicsState() throws IOException(Code)
Restores the last graphics state of the rendering engine. true if the state was restored, false if there's a stack underflow.
exception:
  IOException - In case of an I/O problem



saveGraphicsState
public void saveGraphicsState() throws IOException(Code)
Saves the graphics state of the rendering engine.
exception:
  IOException - In case of an I/O problem



setPSLevel
public void setPSLevel(int level)(Code)
Sets the PostScript level that is used to generate the current document.
Parameters:
  level - the PostScript level (currently 1, 2 and 3 are known)



setResourceTracker
public void setResourceTracker(ResourceTracker resTracker)(Code)
Sets the ResourceTracker instance to be associated with this PSGenerator.
Parameters:
  resTracker - the ResourceTracker instance



useColor
public void useColor(Color col) throws IOException(Code)
Establishes the specified color.
Parameters:
  col - the color.
exception:
  IOException - In case of an I/O problem



useDash
public void useDash(String pattern) throws IOException(Code)
Establishes the specified dash pattern.
Parameters:
  pattern - the dash pattern as defined by the setdash command.
exception:
  IOException - In case of an I/O problem



useFont
public void useFont(String name, float size) throws IOException(Code)
Establishes the specified font and size.
Parameters:
  name - name of the font for the "F" command (see FOP Std Proc Set)
Parameters:
  size - size of the font
exception:
  IOException - In case of an I/O problem



useLineCap
public void useLineCap(int linecap) throws IOException(Code)
Establishes the specified line cap style.
Parameters:
  linecap - the line cap style (0, 1 or 2) as defined by the setlinecap command.
exception:
  IOException - In case of an I/O problem



useLineWidth
public void useLineWidth(double width) throws IOException(Code)
Establishes the specified line width.
Parameters:
  width - the line width as defined by the setlinewidth command.
exception:
  IOException - In case of an I/O problem



useRGBColor
public void useRGBColor(Color col) throws IOException(Code)
Establishes the specified color (RGB).
Parameters:
  col - the color as defined by the setrgbcolor command.
exception:
  IOException - In case of an I/O problem



write
public void write(String cmd) throws IOException(Code)
Writes a PostScript command to the stream.
Parameters:
  cmd - The PostScript code to be written.
exception:
  IOException - In case of an I/O problem



writeByteArr
public void writeByteArr(byte[] cmd) throws IOException(Code)
Writes encoded data to the PostScript stream.
Parameters:
  cmd - The encoded PostScript code to be written.
exception:
  IOException - In case of an I/O problem



writeDSCComment
public void writeDSCComment(String name) throws IOException(Code)
Writes a DSC comment to the output stream.
Parameters:
  name - Name of the DSC comment
exception:
  IOException - In case of an I/O problem
See Also:   org.apache.xmlgraphics.ps.DSCConstants



writeDSCComment
public void writeDSCComment(String name, Object param) throws IOException(Code)
Writes a DSC comment to the output stream. The parameter to the DSC comment can be any object. The object is converted to a String as necessary.
Parameters:
  name - Name of the DSC comment
Parameters:
  param - Single parameter to the DSC comment
exception:
  IOException - In case of an I/O problem
See Also:   org.apache.xmlgraphics.ps.DSCConstants



writeDSCComment
public void writeDSCComment(String name, Object[] params) throws IOException(Code)
Writes a DSC comment to the output stream. The parameters to the DSC comment can be any object. The objects are converted to Strings as necessary. Please see the source code to find out what parameters are currently supported.
Parameters:
  name - Name of the DSC comment
Parameters:
  params - Array of parameters to the DSC comment
exception:
  IOException - In case of an I/O problem
See Also:   org.apache.xmlgraphics.ps.DSCConstants



writeResources
public void writeResources(boolean pageLevel) throws IOException(Code)
Writes a DSC comment for the accumulated used resources, either at page level or at document level.
Parameters:
  pageLevel - true if the DSC comment for the page level should be generated, false for the document level (in the trailer)
exception:
  IOException - In case of an I/O problem



writeln
public void writeln(String cmd) throws IOException(Code)
Writes a PostScript command to the stream and ends the line.
Parameters:
  cmd - The PostScript code to be written.
exception:
  IOException - In case of an I/O problem



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.