Java Doc for ImageCache.java in  » GIS » udig-1.1 » net » refractions » udig » ui » 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 » GIS » udig 1.1 » net.refractions.udig.ui 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.refractions.udig.ui.ImageCache

ImageCache
final public class ImageCache (Code)
A weakly referenced cache of image descriptors to arrays of image instances (representing normal, gray and disabled images). This is used to hold images in memory while their descriptors are defined. When the image descriptors become weakly referred to, the corresponding images in the array of images will be disposed. Weak references of equivalent image descriptors are mapped to the same array of images (where equivalent descriptors are equals(Object)). It is recommended to use this class as a singleton, since it creates a thread for cleaning out images. It is the responsibility of the user to ensure that the image descriptors are kept around as long as the images are needed. The users of this cache should not explicitly dispose the images. Upon request of a disabled or gray image, the normal image will be created as well (if it was not already in the cache) in order to create the disabled or gray version of the image. This cache makes no guarantees on how long the cleaning process will take, or when exactly it will occur. This class may be instantiated; it is not intended to be subclassed.
since:
   3.1


Field Summary
final public static  intDISABLE
     Types of images supported by the image cache.
final public static  intGRAY
    
final public static  intREGULAR
    

Constructor Summary
public  ImageCache()
     Constructs a new instance of ImageCache, and starts a thread to monitor the reference queue for image clean up.
public  ImageCache(int initialLoadCapacity)
     Constructs a new instance of ImageCache, and starts a thread to monitor the reference queue for image clean up.
public  ImageCache(int initialLoadCapacity, float loadFactor)
     Constructs a new instance of ImageCache, and starts a thread to monitor the reference queue for image clean up.

Method Summary
final public  voiddispose()
     Cleans up all images in the cache.
final public  ImagegetImage(ImageDescriptor imageDescriptor)
     Returns the regular image for the given image descriptor.
final public  ImagegetImage(ImageDescriptor imageDescriptor, int typeOfImage)
     Returns the requested image for the given image descriptor and image type.
final public  ImagegetMissingImage()
     Returns the image to display when no image can be found, or none is specified.

Field Detail
DISABLE
final public static int DISABLE(Code)
Types of images supported by the image cache.



GRAY
final public static int GRAY(Code)



REGULAR
final public static int REGULAR(Code)




Constructor Detail
ImageCache
public ImageCache()(Code)
Constructs a new instance of ImageCache, and starts a thread to monitor the reference queue for image clean up.



ImageCache
public ImageCache(int initialLoadCapacity)(Code)
Constructs a new instance of ImageCache, and starts a thread to monitor the reference queue for image clean up. If the passed initial load capacity is negative, the image map is created with the default HashMap constructor.
Parameters:
  initialLoadCapacity - Initial load capacity for the image hash map.



ImageCache
public ImageCache(int initialLoadCapacity, float loadFactor)(Code)
Constructs a new instance of ImageCache, and starts a thread to monitor the reference queue for image clean up. If the passed initial load capacity is negative or if the load factor is nonpositive, the image map is created with the default HashMap constructor.
Parameters:
  initialLoadCapacity - Initial load capacity for the image hash map.
Parameters:
  loadFactor - Load factor for the image hash map.




Method Detail
dispose
final public void dispose()(Code)
Cleans up all images in the cache. This disposes of all of the images, and drops references to them. This should only be called when the images and the image cache are no longer needed (i.e.: shutdown). Note that the image disposal is handled by the cleaner thread.



getImage
final public Image getImage(ImageDescriptor imageDescriptor)(Code)
Returns the regular image for the given image descriptor. This caches the result so that future attempts to get the image for an equivalent or identical image descriptor will only access the cache. When all references to equivalent image descriptors are dropped, the images (regular, gray and disabled) will be cleaned up if they have been created. This clean up makes no guarantees about how long or when it will take place.
Parameters:
  descriptor - The image descriptor with which a regular image should becreated; may be null. The regular image, either newly created or from the cache. Thisvalue is null if the image descriptor passed in isnull. Note that a missing image will be returnedif a problem occurs in the creation of the image.



getImage
final public Image getImage(ImageDescriptor imageDescriptor, int typeOfImage)(Code)
Returns the requested image for the given image descriptor and image type. This caches the result so that future attempts to get the image for an equivalent or identical image descriptor will only access the cache. When all references to equivalent image descriptors are dropped, the images (regular, gray and disabled) will be cleaned up if they have been created. This clean up makes no guarantees about how long or when it will take place.
Parameters:
  descriptor - The image descriptor with which the requested image should becreated; may be null.
Parameters:
  typeOfImage - The type of the desired image:ImageCache.DISABLED,ImageCache.GRAY orImageCache.NORMAL. The image for the requested image type, either newly created orfrom the cache. This value is null if the imagedescriptor passed in is null, or if the imagetype is invalid. Note that a missing image will be returned if aproblem occurs in the creation of the image.



getMissingImage
final public Image getMissingImage()(Code)
Returns the image to display when no image can be found, or none is specified. This image is only disposed when the cache is disposed. The image to display for missing images. This value will never benull.



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.