Java Doc for SerializableRenderedImage.java in  » 6.0-JDK-Modules » Java-Advanced-Imaging » javax » media » jai » remote » 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 » 6.0 JDK Modules » Java Advanced Imaging » javax.media.jai.remote 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.media.jai.remote.SerializableRenderedImage

SerializableRenderedImage
final public class SerializableRenderedImage implements RenderedImage,Serializable(Code)
A serializable wrapper class for classes which implement the RenderedImage interface.

A SerializableRenderedImage provides a means to serialize a RenderedImage. Transient fields are handled using Serializers registered with SerializerFactory. Two means are available for providing the wrapped RenderedImage data to a remote version of a SerializableRenderedImage object: either via deep copy or by "on-demand" copying. If a deep copy is requested, the entire image Raster is copied during object serialization and tiles are extracted from it as needed using the Raster.createChild() method. If a deep copy is not used, the image data are transmitted "on-demand" using socket communications. If the request is made on the local host, the image data are provided in both cases merely by forwarding the request to the wrapped RenderedImage. Note that a single SerializableRenderedImage object should be able to service multiple remote hosts.

The properties associated with the RenderedImage being wrapped are serialized and accessible to a remote version of a SerializableRenderedImage object. However it should be noted that only those properties which are serializable are available to the SerializableRenderedImage object.

This class makes no guarantee as to the stability of the data of the wrapped image, at least in the case where a deep copy is not made. Consequently if the data of a RenderedImage change but affected tiles have already been transmitted then the modifications will not be visible remotely. For example, this implies that a SerializableRenderedImage should not be used to wrap a RenderedOp the data of which are subject to change if the chain in which the node is present is edited. Instead the SerializableRenderedImage should be used to wrap the image returned by invoking either getRendering() or createInstance() on the RenderedOp. A similar situation will obtain if the wrapped image is a WritableRenderedImage. If in this case the wrapped image is also a PlanarImage, then the image returned by createSnapshot() should be wrapped instead.

An example of the usage of this class is as follows:

 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.Serializable;
 public class SomeSerializableClass implements Serializable {
 protected transient RenderedImage image;
 // Fields omitted.
 public SomeSerializableClass(RenderedImage image) {
 this.image = image;
 }
 // Methods omitted.
 // Serialization method.
 private void writeObject(ObjectOutputStream out) throws IOException {
 out.defaultWriteObject();
 out.writeObject(new SerializableRenderedImage(image));
 }
 // Deserialization method.
 private void readObject(ObjectInputStream in)
 throws IOException, ClassNotFoundException {
 in.defaultReadObject();
 image = (RenderedImage)in.readObject();
 }
 }
 

See Also:   java.awt.image.RenderedImage
See Also:   java.awt.image.WritableRenderedImage
See Also:   javax.media.jai.PlanarImage
See Also:   javax.media.jai.RenderedOp
since:
   JAI 1.1



Constructor Summary
 SerializableRenderedImage()
     The default constructor.
public  SerializableRenderedImage(RenderedImage source, boolean useDeepCopy, OperationRegistry registry, String formatName, TileCodecParameterList encodingParam, TileCodecParameterList decodingParam)
     Constructs a SerializableRenderedImage wrapper for a RenderedImage source.
public  SerializableRenderedImage(RenderedImage source, boolean useDeepCopy)
     Constructs a SerializableRenderedImage wrapper for a RenderedImage source.
public  SerializableRenderedImage(RenderedImage source)
     Constructs a SerializableRenderedImage wrapper for a RenderedImage source.

Method Summary
public  WritableRastercopyData(WritableRaster dest)
    
public  voiddispose()
     Provides a hint that an image will no longer be accessed from a reference in user space.
protected  voidfinalize()
     If a deep copy is not being used, unset the data server availability flag and wait for the server thread to rejoin the current thread.
public  ColorModelgetColorModel()
    
public  RastergetData()
    
public  RastergetData(Rectangle rect)
    
public  intgetHeight()
    
public  ObjectgetImageID()
     Returns a unique identifier (UID) for this RenderedImage.
public  intgetMinTileX()
    
public  intgetMinTileY()
    
public  intgetMinX()
    
public  intgetMinY()
    
public  intgetNumXTiles()
    
public  intgetNumYTiles()
    
public  ObjectgetProperty(String name)
    
public  String[]getPropertyNames()
    
public  SampleModelgetSampleModel()
    
public  VectorgetSources()
     If this SerializableRenderedImage has not been serialized, this method returns a Vector containing only the RenderedImage passed to the constructor; if this image has been deserialized, it returns null.
public  RastergetTile(int tileX, int tileY)
    
public  intgetTileGridXOffset()
    
public  intgetTileGridYOffset()
    
public  intgetTileHeight()
    
public  intgetTileWidth()
    
public  intgetWidth()
    
 voidsendExceptionToListener(String message, Exception e)
    


Constructor Detail
SerializableRenderedImage
SerializableRenderedImage()(Code)
The default constructor.



SerializableRenderedImage
public SerializableRenderedImage(RenderedImage source, boolean useDeepCopy, OperationRegistry registry, String formatName, TileCodecParameterList encodingParam, TileCodecParameterList decodingParam) throws NotSerializableException(Code)
Constructs a SerializableRenderedImage wrapper for a RenderedImage source. Image data may be serialized tile-by-tile or via a single deep copy. Tile encoding and decoding may be effected via a TileEncoder and TileDecoder specified by format name.

It may be noted that if the TileCodec utilizes Serializers for encoding the image data, and none is available for the DataBuffer of the supplied image, an error/exception may be encountered.
Parameters:
  source - The RenderedImage source.
Parameters:
  useDeepCopy - Whether a deep copy of the entire image Rasterwill be made during object serialization.
Parameters:
  registry - The OperationRegistry to use increating the TileEncoder. TheTileDecoder will of necessity becreated using the default OperationRegistryas the specified OperationRegistry is notserialized. If null the default registrywill be used.
Parameters:
  formatName - The name of the format used to encode the data.If null simple tile serialization willbe performed either directly or by use of a "raw"TileCodec.
Parameters:
  encodingParam - The parameters to be used for data encoding. Ifnull the default encodingTileCodecParameterList for thisformat will be used. Ignored ifformatName is null.
Parameters:
  decodingParam - The parameters to be used for data decoding. Ifnull a complementaryTileCodecParameterList will bederived from encodingParam. Ignoredif formatName is null.
exception:
  IllegalArgumentException - if sourceis null.
exception:
  IllegalArgumentException - if no Serializersare available for the types ofSampleModel, and ColorModelcontained in the specified image.




SerializableRenderedImage
public SerializableRenderedImage(RenderedImage source, boolean useDeepCopy)(Code)
Constructs a SerializableRenderedImage wrapper for a RenderedImage source. Image data may be serialized tile-by-tile or via a single deep copy. No TileCodec will be used, i.e., data will be transmitted using the serialization protocol for Rasters.
Parameters:
  source - The RenderedImage source.
Parameters:
  useDeepCopy - Whether a deep copy of the entire image Rasterwill be made during object serialization.
exception:
  IllegalArgumentException - if sourceis null.
exception:
  IllegalArgumentException - if no Serializersare available for the types of DataBuffer,SampleModel, and ColorModelcontained in the specified image.



SerializableRenderedImage
public SerializableRenderedImage(RenderedImage source)(Code)
Constructs a SerializableRenderedImage wrapper for a RenderedImage source. Image data will be serialized tile-by-tile if possible. No TileCodec will be used, i.e., data will be transmitted using the serialization protocol for Rasters.
Parameters:
  source - The RenderedImage source.
exception:
  IllegalArgumentException - if sourceis null.
exception:
  IllegalArgumentException - if no Serializersare available for the types of DataBuffer,SampleModel, and ColorModelcontained in the specified image.




Method Detail
copyData
public WritableRaster copyData(WritableRaster dest)(Code)



dispose
public void dispose()(Code)
Provides a hint that an image will no longer be accessed from a reference in user space. The results are equivalent to those that occur when the program loses its last reference to this image, the garbage collector discovers this, and finalize is called. This can be used as a hint in situations where waiting for garbage collection would be overly conservative, e.g., there are a large number of socket connections which may be opened to transmit tile data.

SerializableRenderedImage defines this method to behave as follows:

  • if the image is acting as a server, i.e., has never been serialized and may be providing data to serialized versions of itself, it makes itself unavailable to further client requests and closes its socket;
  • if the image is acting as a client, i.e., has been serialized and may be requesting data from a remote, pre-serialization version of itself, it sends a message to its remote self indicating that it will no longer be making requests.

The results of referencing an image after a call to dispose() are undefined.




finalize
protected void finalize() throws Throwable(Code)
If a deep copy is not being used, unset the data server availability flag and wait for the server thread to rejoin the current thread.



getColorModel
public ColorModel getColorModel()(Code)



getData
public Raster getData()(Code)



getData
public Raster getData(Rectangle rect)(Code)



getHeight
public int getHeight()(Code)



getImageID
public Object getImageID()(Code)
Returns a unique identifier (UID) for this RenderedImage. This UID may be used when the potential redundancy of the value returned by the hashCode() method is unacceptable. An example of this is in generating a key for storing image tiles in a cache.



getMinTileX
public int getMinTileX()(Code)



getMinTileY
public int getMinTileY()(Code)



getMinX
public int getMinX()(Code)



getMinY
public int getMinY()(Code)



getNumXTiles
public int getNumXTiles()(Code)



getNumYTiles
public int getNumYTiles()(Code)



getProperty
public Object getProperty(String name)(Code)



getPropertyNames
public String[] getPropertyNames()(Code)



getSampleModel
public SampleModel getSampleModel()(Code)



getSources
public Vector getSources()(Code)
If this SerializableRenderedImage has not been serialized, this method returns a Vector containing only the RenderedImage passed to the constructor; if this image has been deserialized, it returns null.



getTile
public Raster getTile(int tileX, int tileY)(Code)



getTileGridXOffset
public int getTileGridXOffset()(Code)



getTileGridYOffset
public int getTileGridYOffset()(Code)



getTileHeight
public int getTileHeight()(Code)



getTileWidth
public int getTileWidth()(Code)



getWidth
public int getWidth()(Code)



sendExceptionToListener
void sendExceptionToListener(String message, Exception e)(Code)



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.