Java Doc for PDFRenderer.java in  » PDF » PDF-Renderer » com » sun » pdfview » 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 » PDF » PDF Renderer » com.sun.pdfview 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.pdfview.BaseWatchable
      com.sun.pdfview.PDFRenderer

PDFRenderer
public class PDFRenderer extends BaseWatchable implements Runnable(Code)
This class turns a set of PDF Commands from a PDF page into an image. It encapsulates the state of drawing in terms of stroke, fill, transform, etc., as well as pushing and popping these states. When the run method is called, this class goes through all remaining commands in the PDF Page and draws them to its buffered image. It then updates any ImageConsumers with the drawn data.

Inner Class :class GraphicsState implements Cloneable

Field Summary
final public static  intNOCAP
    
final public static  float[]NODASH
    
final public static  intNOJOIN
    
final public static  floatNOLIMIT
    
final public static  floatNOPHASE
    
final public static  floatNOWIDTH
    
final public static  longUPDATE_DURATION
    

Constructor Summary
public  PDFRenderer(PDFPage page, ImageInfo imageinfo, BufferedImage bi)
    
public  PDFRenderer(PDFPage page, Graphics2D g, Rectangle imgbounds, Rectangle2D clip, Color bgColor)
     create a new PDFGraphics state, given a Graphics2D.

Method Summary
public  voidaddObserver(ImageObserver observer)
    
public  voidcleanup()
    
public  voidclip(GeneralPath s)
     add the path to the current clip.
public  voiddraw(GeneralPath p, BasicStroke bs)
     draw an outline.
public  Rectangle2DdrawImage(PDFImage image)
     draw an image.
public  Rectangle2Dfill(GeneralPath s)
    
public  AffineTransformgetInitialTransform()
    
public  GeneralPathgetLastShape()
    
public  BasicStrokegetStroke()
    
public  AffineTransformgetTransform()
    
public  intiterate()
     Draws the next command in the PDFPage to the buffered image.
public  voidpop()
     restore the state of this object to what it was when the previous push() was called.
public  voidpush()
     push the current graphics state onto the stack.
public  voidremoveObserver(ImageObserver observer)
    
public  voidsetFillAlpha(float alpha)
    
public  voidsetFillPaint(PDFPaint paint)
    
public  voidsetLastShape(GeneralPath shape)
    
public  voidsetStroke(BasicStroke bs)
    
public  voidsetStrokeAlpha(float alpha)
    
public  voidsetStrokePaint(PDFPaint paint)
    
public  voidsetStrokeParts(float w, int cap, int join, float limit, float[] ary, float phase)
     Set some or all aspects of the current stroke.
Parameters:
  w - the width of the stroke, or NOWIDTH to leave it unchanged
Parameters:
  cap - the end cap style, or NOCAP to leave it unchanged
Parameters:
  join - the join style, or NOJOIN to leave it unchanged
Parameters:
  limit - the miter limit, or NOLIMIT to leave it unchanged
Parameters:
  phase - the phase of the dash array, or NOPHASE to leave itunchanged
Parameters:
  ary - the dash array, or null to leave it unchanged.
public  voidsetTransform(AffineTransform at)
     replace the current transform with the given one.
public  voidsetup()
     Setup rendering.
public  Rectangle2Dstroke(GeneralPath s)
     draw an outline using the current stroke and draw paint
Parameters:
  s - the path to stroke a Rectangle2D to which the current region beingdrawn will be added.
public  voidtransform(AffineTransform at)
    

Field Detail
NOCAP
final public static int NOCAP(Code)



NODASH
final public static float[] NODASH(Code)



NOJOIN
final public static int NOJOIN(Code)



NOLIMIT
final public static float NOLIMIT(Code)



NOPHASE
final public static float NOPHASE(Code)



NOWIDTH
final public static float NOWIDTH(Code)



UPDATE_DURATION
final public static long UPDATE_DURATION(Code)
how long (in milliseconds) to wait between image updates




Constructor Detail
PDFRenderer
public PDFRenderer(PDFPage page, ImageInfo imageinfo, BufferedImage bi)(Code)
create a new PDFGraphics state
Parameters:
  page - the current page
Parameters:
  imageinfo - the paramters of the image to render



PDFRenderer
public PDFRenderer(PDFPage page, Graphics2D g, Rectangle imgbounds, Rectangle2D clip, Color bgColor)(Code)
create a new PDFGraphics state, given a Graphics2D. This version will not create an image, and you will get a NullPointerException if you attempt to call getImage().
Parameters:
  page - the current page
Parameters:
  g - the Graphics2D object to use for drawing
Parameters:
  imgbounds - the bounds of the image into which to fit the page
Parameters:
  clip - the portion of the page to draw, in page space, or nullif the whole page should be drawn
Parameters:
  bgColor - the color to draw the background of the image, ornull for no color (0 alpha value)




Method Detail
addObserver
public void addObserver(ImageObserver observer)(Code)
Add an image observer



cleanup
public void cleanup()(Code)
Called when iteration has stopped



clip
public void clip(GeneralPath s)(Code)
add the path to the current clip. The new clip will be the intersection of the old clip and given path.



draw
public void draw(GeneralPath p, BasicStroke bs)(Code)
draw an outline.
Parameters:
  p - the path to draw
Parameters:
  bs - the stroke with which to draw the path



drawImage
public Rectangle2D drawImage(PDFImage image)(Code)
draw an image.
Parameters:
  image - the image to draw



fill
public Rectangle2D fill(GeneralPath s)(Code)
fill an outline using the current fill paint
Parameters:
  s - the path to fill



getInitialTransform
public AffineTransform getInitialTransform()(Code)
get the initial transform from page space to Java space



getLastShape
public GeneralPath getLastShape()(Code)
Get the last shape drawn



getStroke
public BasicStroke getStroke()(Code)
get the current stroke as a BasicStroke



getTransform
public AffineTransform getTransform()(Code)
get the current affinetransform



iterate
public int iterate() throws Exception(Code)
Draws the next command in the PDFPage to the buffered image. The image will be notified about changes no less than every UPDATE_DURATION milliseconds.
  • Watchable.RUNNING when there are commands to be processed
  • Watchable.NEEDS_DATA when there are no commands to beprocessed, but the page is not yet complete
  • Watchable.COMPLETED when the page is done and allthe commands have been processed
  • Watchable.STOPPED if the image we are rendering intohas gone away



pop
public void pop()(Code)
restore the state of this object to what it was when the previous push() was called.



push
public void push()(Code)
push the current graphics state onto the stack. Continue working with the current object; calling pop() restores the state of this object to its state when push() was called.



removeObserver
public void removeObserver(ImageObserver observer)(Code)
Remove an image observer



setFillAlpha
public void setFillAlpha(float alpha)(Code)
set the stroke alpha



setFillPaint
public void setFillPaint(PDFPaint paint)(Code)
set the fill color



setLastShape
public void setLastShape(GeneralPath shape)(Code)
Set the last shape drawn



setStroke
public void setStroke(BasicStroke bs)(Code)
set the current stroke as a BasicStroke



setStrokeAlpha
public void setStrokeAlpha(float alpha)(Code)
set the stroke alpha



setStrokePaint
public void setStrokePaint(PDFPaint paint)(Code)
set the stroke color



setStrokeParts
public void setStrokeParts(float w, int cap, int join, float limit, float[] ary, float phase)(Code)
Set some or all aspects of the current stroke.
Parameters:
  w - the width of the stroke, or NOWIDTH to leave it unchanged
Parameters:
  cap - the end cap style, or NOCAP to leave it unchanged
Parameters:
  join - the join style, or NOJOIN to leave it unchanged
Parameters:
  limit - the miter limit, or NOLIMIT to leave it unchanged
Parameters:
  phase - the phase of the dash array, or NOPHASE to leave itunchanged
Parameters:
  ary - the dash array, or null to leave it unchanged. phaseand ary must both be valid, or phase must be NOPHASE while ary is null.



setTransform
public void setTransform(AffineTransform at)(Code)
replace the current transform with the given one.



setup
public void setup()(Code)
Setup rendering. Called before iteration begins



stroke
public Rectangle2D stroke(GeneralPath s)(Code)
draw an outline using the current stroke and draw paint
Parameters:
  s - the path to stroke a Rectangle2D to which the current region beingdrawn will be added. May also be null, in which case no dirtyregion will be recorded.



transform
public void transform(AffineTransform at)(Code)
concatenate the given transform with the current transform



Methods inherited from com.sun.pdfview.BaseWatchable
protected void cleanup()(Code)(Java Doc)
protected synchronized void execute(boolean synchronous)(Code)(Java Doc)
public int getStatus()(Code)(Java Doc)
public synchronized void go()(Code)(Java Doc)
public synchronized void go(boolean synchronous)(Code)(Java Doc)
public synchronized void go(int steps)(Code)(Java Doc)
public synchronized void go(long millis)(Code)(Java Doc)
public boolean isExecutable()(Code)(Java Doc)
public boolean isFinished()(Code)(Java Doc)
abstract protected int iterate() throws Exception(Code)(Java Doc)
public void run()(Code)(Java Doc)
protected void setError(Exception error)(Code)(Java Doc)
protected void setStatus(int status)(Code)(Java Doc)
protected void setup()(Code)(Java Doc)
public void stop()(Code)(Java Doc)
public void waitForFinish()(Code)(Java Doc)

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.