Java Doc for ImageDescriptor.java in  » IDE-Eclipse » jface » org » eclipse » jface » resource » 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 » IDE Eclipse » jface » org.eclipse.jface.resource 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.eclipse.jface.resource.DeviceResourceDescriptor
      org.eclipse.jface.resource.ImageDescriptor

All known Subclasses:   org.eclipse.jface.resource.URLImageDescriptor,  org.eclipse.jface.resource.DerivedImageDescriptor,  org.eclipse.jface.resource.FileImageDescriptor,  org.eclipse.jface.resource.ImageDataImageDescriptor,  org.eclipse.jface.resource.CompositeImageDescriptor,  org.eclipse.jface.resource.MissingImageDescriptor,
ImageDescriptor
abstract public class ImageDescriptor extends DeviceResourceDescriptor (Code)
An image descriptor is an object that knows how to create an SWT image. It does not hold onto images or cache them, but rather just creates them on demand. An image descriptor is intended to be a lightweight representation of an image that can be manipulated even when no SWT display exists.

This package defines a concrete image descriptor implementation which reads an image from a file (FileImageDescriptor). It also provides abstract framework classes (this one and CompositeImageDescriptor) which may be subclassed to define news kinds of image descriptors.

Using this abstract class involves defining a concrete subclass and providing an implementation for the getImageData method.

There are two ways to get an Image from an ImageDescriptor. The method createImage will always return a new Image which must be disposed by the caller. Alternatively, createResource() returns a shared Image. When the caller is done with an image obtained from createResource, they must call destroyResource() rather than disposing the Image directly. The result of createResource() can be safely cast to an Image.


See Also:   org.eclipse.swt.graphics.Image


Field Summary
final protected static  ImageDataDEFAULT_IMAGE_DATA
     A small red square used to warn that an image cannot be created.

Constructor Summary
protected  ImageDescriptor()
     Constructs an image descriptor.

Method Summary
public static  ImageDescriptorcreateFromFile(Class location, String filename)
     Creates and returns a new image descriptor from a file.
public static  ImageDescriptorcreateFromImage(Image img)
     Creates and returns a new image descriptor for the given image.
public static  ImageDescriptorcreateFromImage(Image img, Device theDevice)
     Creates and returns a new image descriptor for the given image.
public static  ImageDescriptorcreateFromImageData(ImageData data)
     Creates and returns a new image descriptor given ImageData describing the image.
public static  ImageDescriptorcreateFromURL(URL url)
     Creates and returns a new image descriptor from a URL.
Parameters:
  url - The URL of the image file.
public  ImagecreateImage()
     Creates and returns a new SWT image for this image descriptor.
public  ImagecreateImage(boolean returnMissingImageOnError)
     Creates and returns a new SWT image for this image descriptor.
public  ImagecreateImage(Device device)
     Creates and returns a new SWT image for this image descriptor.
public  ImagecreateImage(boolean returnMissingImageOnError, Device device)
     Creates and returns a new SWT image for this image descriptor.
public  ObjectcreateResource(Device device)
    
public static  ImageDescriptorcreateWithFlags(ImageDescriptor originalImage, int swtFlags)
     Creates an ImageDescriptor based on the given original descriptor, but with additional SWT flags.

Note that this sort of ImageDescriptor is slower and consumes more resources than a regular image descriptor.

public  voiddestroyResource(Object previouslyCreatedObject)
    
abstract public  ImageDatagetImageData()
     Creates and returns a new SWT ImageData object for this image descriptor.
public static  ImageDescriptorgetMissingImageDescriptor()
     Returns the shared image descriptor for a missing image.

Field Detail
DEFAULT_IMAGE_DATA
final protected static ImageData DEFAULT_IMAGE_DATA(Code)
A small red square used to warn that an image cannot be created.





Constructor Detail
ImageDescriptor
protected ImageDescriptor()(Code)
Constructs an image descriptor.




Method Detail
createFromFile
public static ImageDescriptor createFromFile(Class location, String filename)(Code)
Creates and returns a new image descriptor from a file. Convenience method for new FileImageDescriptor(location,filename).
Parameters:
  location - the class whose resource directory contain the file
Parameters:
  filename - the file name a new image descriptor



createFromImage
public static ImageDescriptor createFromImage(Image img)(Code)
Creates and returns a new image descriptor for the given image. Note that disposing the original Image will cause the descriptor to become invalid.
since:
   3.1
Parameters:
  img - image to create a newly created image descriptor



createFromImage
public static ImageDescriptor createFromImage(Image img, Device theDevice)(Code)
Creates and returns a new image descriptor for the given image. This method takes the Device that created the Image as an argument, allowing the original Image to be reused if the descriptor is asked for another Image on the same device. Note that disposing the original Image will cause the descriptor to become invalid. ImageDescriptor.createFromImage(Image)
since:
   3.1
Parameters:
  img - image to create
Parameters:
  theDevice - the device that was used to create the Image a newly created image descriptor



createFromImageData
public static ImageDescriptor createFromImageData(ImageData data)(Code)
Creates and returns a new image descriptor given ImageData describing the image.
since:
   3.1
Parameters:
  data - contents of the image newly created image descriptor



createFromURL
public static ImageDescriptor createFromURL(URL url)(Code)
Creates and returns a new image descriptor from a URL.
Parameters:
  url - The URL of the image file. a new image descriptor



createImage
public Image createImage()(Code)
Creates and returns a new SWT image for this image descriptor. Note that each call returns a new SWT image object. The returned image must be explicitly disposed using the image's dispose call. The image will not be automatically garbage collected. A default image is returned in the event of an error.

Note: this method differs from createResource(Device) in that the returned image must be disposed directly, whereas an image obtained from createResource(...) must be disposed by calling destroyResource(...). It is not possible to mix-and-match. If you obtained the Image from this method, you must not dispose it by calling destroyResource. Clients are encouraged to use create/destroyResource and downcast the result to Image rather than using createImage.

Note: it is still possible for this method to return null in extreme cases, for example if SWT runs out of image handles.

a new image or null if the image could not becreated



createImage
public Image createImage(boolean returnMissingImageOnError)(Code)
Creates and returns a new SWT image for this image descriptor. The returned image must be explicitly disposed using the image's dispose call. The image will not be automatically garbage collected. In the event of an error, a default image is returned if returnMissingImageOnError is true, otherwise null is returned.

Note: Even if returnMissingImageOnError is true, it is still possible for this method to return null in extreme cases, for example if SWT runs out of image handles.


Parameters:
  returnMissingImageOnError - flag that determines if a default image is returned on error a new image or null if the image could not becreated



createImage
public Image createImage(Device device)(Code)
Creates and returns a new SWT image for this image descriptor. The returned image must be explicitly disposed using the image's dispose call. The image will not be automatically garbage collected. A default image is returned in the event of an error.

Note: it is still possible for this method to return null in extreme cases, for example if SWT runs out of image handles.


Parameters:
  device - the device on which to create the image a new image or null if the image could not becreated
since:
   2.0



createImage
public Image createImage(boolean returnMissingImageOnError, Device device)(Code)
Creates and returns a new SWT image for this image descriptor. The returned image must be explicitly disposed using the image's dispose call. The image will not be automatically garbage collected. In the even of an error, a default image is returned if returnMissingImageOnError is true, otherwise null is returned.

Note: Even if returnMissingImageOnError is true, it is still possible for this method to return null in extreme cases, for example if SWT runs out of image handles.


Parameters:
  returnMissingImageOnError - flag that determines if a default image is returned on error
Parameters:
  device - the device on which to create the image a new image or null if the image could not becreated
since:
   2.0



createResource
public Object createResource(Device device) throws DeviceResourceException(Code)



createWithFlags
public static ImageDescriptor createWithFlags(ImageDescriptor originalImage, int swtFlags)(Code)
Creates an ImageDescriptor based on the given original descriptor, but with additional SWT flags.

Note that this sort of ImageDescriptor is slower and consumes more resources than a regular image descriptor. It will also never generate results that look as nice as a hand-drawn image. Clients are encouraged to supply their own disabled/grayed/etc. images rather than using a default image and transforming it.


Parameters:
  originalImage - image to transform
Parameters:
  swtFlags - any flag that can be passed to the flags argument of Image#Image(Device, Image, int) an ImageDescriptor that creates new images by transforming the given image descriptor
See Also:   Image.Image(DeviceImageint)
See Also:   
since:
   3.1



destroyResource
public void destroyResource(Object previouslyCreatedObject)(Code)



getImageData
abstract public ImageData getImageData()(Code)
Creates and returns a new SWT ImageData object for this image descriptor. Note that each call returns a new SWT image data object.

This framework method is declared public so that it is possible to request an image descriptor's image data without creating an SWT image object.

Returns null if the image data could not be created.

a new image data or null



getMissingImageDescriptor
public static ImageDescriptor getMissingImageDescriptor()(Code)
Returns the shared image descriptor for a missing image. the missing image descriptor



Methods inherited from org.eclipse.jface.resource.DeviceResourceDescriptor
abstract public Object createResource(Device device)(Code)(Java Doc)
abstract public void destroyResource(Object previouslyCreatedObject)(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.