Java Doc for ThumbPanel.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) 


javax.swing.JPanel
   com.sun.pdfview.ThumbPanel

ThumbPanel
public class ThumbPanel extends JPanel implements Runnable,Scrollable,ImageObserver(Code)
A panel of thumbnails, one for each page of a PDFFile. You can add a PageChangeListener to be informed of when the user clicks one of the pages.

Inner Class :class GotoLater implements Runnable

Field Summary
 Threadanim
    
 intborder
    
 booleandefaultNotSet
     Whether the default width has been guesstimated for this PDFFile yet.
 intdefaultWidth
     Guesstimate of the width of a thumbnail that hasn't been processed yet.
 PDFFilefile
    
 Imageimages
    
 intlineheight
     Height of each line.
 PageChangeListenerlistener
    
 intneeddrawn
     Which thumbnail needs to be drawn next, or -1 if the previous needy thumbnail is being processed.
 intshowing
     Which thumbnail is selected, or -1 if no thumbnail selected.
 intxloc
     Array of the x locations of each of the thumbnails.

Constructor Summary
public  ThumbPanel(PDFFile file)
     Creates a new ThumbPanel based on a PDFFile.

Method Summary
public  voidaddPageChangeListener(PageChangeListener pl)
     Adds a PageChangeListener to receive notification of page clicks.
public  DimensiongetPreferredScrollableViewportSize()
    
public  intgetScrollableBlockIncrement(Rectangle visrect, int orientation, int direction)
    
public  booleangetScrollableTracksViewportHeight()
    
public  booleangetScrollableTracksViewportWidth()
    
public  intgetScrollableUnitIncrement(Rectangle visrect, int orientation, int direction)
    
public  voidhandleClick(int x, int y)
     Handles a mouse click in the panel.
public  booleanimageUpdate(Image img, int infoflags, int x, int y, int width, int height)
     Handles notification of any image updates.
public  voidpageShown(int pagenum)
     Sets the currently viewed page, indicates it with a highlight border, and makes sure the thumbnail is visible.
public  voidpaint(Graphics g)
     Updates the positions of the thumbnails, and draws them to the screen.
public  voidremovePageChangeListener(PageChangeListener pl)
     Removes a PageChangeListener from the notification list.
public  voidrun()
     Renders each of the pages in the PDFFile into a thumbnail.
public  voidsetDefaultWidth(int width)
     Sets the default width of an un-processed thumbnail.
public  voidshowPage(int pagenum)
     Notifies the listeners that a page has been selected.
public  voidstop()
     Stops the render thread.

Field Detail
anim
Thread anim(Code)
Thread that renders each thumbnail in turn



border
int border(Code)
Size of the border between images



defaultNotSet
boolean defaultNotSet(Code)
Whether the default width has been guesstimated for this PDFFile yet.



defaultWidth
int defaultWidth(Code)
Guesstimate of the width of a thumbnail that hasn't been processed yet.



file
PDFFile file(Code)
The PDFFile being displayed



images
Image images(Code)
Array of images, one per page in the file



lineheight
int lineheight(Code)
Height of each line. Thumbnails will be scaled to this height (minus the border).



listener
PageChangeListener listener(Code)
The PageChangeListener that is listening for page changes



needdrawn
int needdrawn(Code)
Which thumbnail needs to be drawn next, or -1 if the previous needy thumbnail is being processed.



showing
int showing(Code)
Which thumbnail is selected, or -1 if no thumbnail selected.



xloc
int xloc(Code)
Array of the x locations of each of the thumbnails. Every 0 stored in this array indicates the start of a new line of thumbnails.




Constructor Detail
ThumbPanel
public ThumbPanel(PDFFile file)(Code)
Creates a new ThumbPanel based on a PDFFile. The file may be null. Automatically starts rendering thumbnails for that file.




Method Detail
addPageChangeListener
public void addPageChangeListener(PageChangeListener pl)(Code)
Adds a PageChangeListener to receive notification of page clicks.



getPreferredScrollableViewportSize
public Dimension getPreferredScrollableViewportSize()(Code)



getScrollableBlockIncrement
public int getScrollableBlockIncrement(Rectangle visrect, int orientation, int direction)(Code)



getScrollableTracksViewportHeight
public boolean getScrollableTracksViewportHeight()(Code)



getScrollableTracksViewportWidth
public boolean getScrollableTracksViewportWidth()(Code)



getScrollableUnitIncrement
public int getScrollableUnitIncrement(Rectangle visrect, int orientation, int direction)(Code)



handleClick
public void handleClick(int x, int y)(Code)
Handles a mouse click in the panel. Figures out which page was clicked, and calls showPage.
Parameters:
  x - the x coordinate of the mouse click
Parameters:
  y - the y coordinate of the mouse click



imageUpdate
public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height)(Code)
Handles notification of any image updates. Not used any more.



pageShown
public void pageShown(int pagenum)(Code)
Sets the currently viewed page, indicates it with a highlight border, and makes sure the thumbnail is visible.



paint
public void paint(Graphics g)(Code)
Updates the positions of the thumbnails, and draws them to the screen.



removePageChangeListener
public void removePageChangeListener(PageChangeListener pl)(Code)
Removes a PageChangeListener from the notification list.



run
public void run()(Code)
Renders each of the pages in the PDFFile into a thumbnail. Preferentially works on the needdrawn thumbnail, otherwise, go in order.



setDefaultWidth
public void setDefaultWidth(int width)(Code)
Sets the default width of an un-processed thumbnail.
Parameters:
  width - the width of an unknown thumbnail, in pixels.



showPage
public void showPage(int pagenum)(Code)
Notifies the listeners that a page has been selected. Performs the notification in the AWT thread. Also highlights the selected page. Does this first so that feedback is immediate.



stop
public void stop()(Code)
Stops the render thread. Be sure to call this before dropping a ThumbPanel.



Methods inherited from javax.swing.JPanel
public AccessibleContext getAccessibleContext()(Code)(Java Doc)
public PanelUI getUI()(Code)(Java Doc)
public String getUIClassID()(Code)(Java Doc)
protected String paramString()(Code)(Java Doc)
public void setUI(PanelUI ui)(Code)(Java Doc)
public void updateUI()(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.