Package com.lightcrafts.mediax.jai.remote

Examples of com.lightcrafts.mediax.jai.remote.SerializableState


    /** Deserialize a <code>Raster</code> from its serialized version */
    public static Raster deserializeRaster(Object object) {
        if (!(object instanceof SerializableState))
            return null;

  SerializableState ss = (SerializableState)object;
  Class c = ss.getObjectClass();
  if (Raster.class.isAssignableFrom(c)) {
      return (Raster)ss.getObject();
  }
  return null;
    }
View Full Code Here


    /** Deserialize a <code>SampleModel</code> from its serialized version */
    public static SampleModel deserializeSampleModel(Object object) {
  if (!(object instanceof SerializableState))
      return null;

  SerializableState ss = (SerializableState)object;
        Class c = ss.getObjectClass();
        if (SampleModel.class.isAssignableFrom(c)) {
            return (SampleModel)ss.getObject();
        }
        return null;
    }
View Full Code Here

      */
    private void readObject(ObjectInputStream in)
        throws IOException, ClassNotFoundException {
        in.defaultReadObject();
        Object object = in.readObject();
        SerializableState ss = (SerializableState)object;
        data = (DataBuffer)ss.getObject();
    }
View Full Code Here

        Enumeration keys = table.keys();

        // Loop over the table keys.
        while (keys.hasMoreElements()) {
            // Get the next key element.
            SerializableState keyElement = (SerializableState)keys.nextElement();

            // Get the key object corresponding to this key element.
            Object key = keyElement.getObject();

            // Get the value element.
            HintElement valueElement = (HintElement)table.get(keyElement);

            // Get the value object corresponding to this value element.
View Full Code Here

      */
    private void readObject(ObjectInputStream in)
        throws IOException, ClassNotFoundException {
        int width;
        int height;
        SerializableState sampleModelState = null;
        SerializableState dataBufferState = null;
        Point location = null;

        width = in.readInt();
        height = in.readInt();
        sampleModelState = (SerializableState)in.readObject();
        dataBufferState = (SerializableState)in.readObject();
        location = (Point)in.readObject();

        // Restore the SampleModel from its serialized form.
        SampleModel sampleModel = (SampleModel)sampleModelState.getObject();
        if (sampleModel == null) {
            theObject = null;
            return;
        }

        // Restore the DataBuffer from its serialized form.
        DataBuffer dataBuffer = (DataBuffer)dataBufferState.getObject();

        // Reconstruct the Raster.
        theObject = Raster.createRaster(sampleModel, dataBuffer, location);
    }
View Full Code Here

  // Check to see whether any of the parameters are images
  JAIRMIUtil.checkClientParameters(newPB, serverName);

  try {
      SerializableState rhs = SerializerFactory.getState(hints, null);
      remoteImage.createRenderedOp(id, operationName, newPB, rhs);
  } catch (RemoteException e) {
            String message = JaiI18N.getString("RMIServerProxy5");
            listener.errorOccurred(message,
                                   new RemoteImagingException(message, e),
View Full Code Here

      } else {
    oldSrc = new SerializableRenderedImage(oldSrcRendering);
      }

      Object srcInvalidRegion = rce.getInvalidRegion();
      SerializableState shapeState =
    SerializerFactory.getState((Shape)srcInvalidRegion, null);

      Long oldRenderingID = null;
      try {
    oldRenderingID =
View Full Code Here

      layout.setTileWidth(remoteImage.getTileWidth(id));
      layout.setTileHeight(remoteImage.getTileHeight(id));
      layout.setTileGridXOffset(remoteImage.getTileGridXOffset(id));
      layout.setTileGridYOffset(remoteImage.getTileGridYOffset(id));

      SerializableState smState = remoteImage.getSampleModel(id);
      layout.setSampleModel((SampleModel)(smState.getObject()));
      SerializableState cmState = remoteImage.getColorModel(id);
      layout.setColorModel((ColorModel)(cmState.getObject()));
            return layout;
  } catch (RemoteException re) {
            String message = JaiI18N.getString("RMIServerProxy14");
            listener.errorOccurred(message,
                                   new RemoteImagingException(message, re),
View Full Code Here

    } catch (java.io.IOException ioe) {
        throw new RemoteImagingException(ImageUtil.getStackTraceString(ioe));
    }
      } else {
    // Ask for uncompressed tiles.
    SerializableState rp = remoteImage.getTile(id, tileX, tileY);
    return (Raster)(rp.getObject());
      }
  } catch (RemoteException e) {
            String message = JaiI18N.getString("RMIServerProxy15");
            listener.errorOccurred(message,
                                   new RemoteImagingException(message, e),
View Full Code Here

      */
    private void readObject(ObjectInputStream in)
        throws IOException, ClassNotFoundException {
        int width;
        int height;
        SerializableState sampleModelState = null;
        SerializableState dataBufferState = null;
        Point location = null;
       
        width = in.readInt();
        height = in.readInt();
        sampleModelState = (SerializableState)in.readObject();
        dataBufferState = (SerializableState)in.readObject();
        location = (Point)in.readObject();

        // Restore the SampleModel from its serialized form.
        SampleModel sampleModel = (SampleModel)sampleModelState.getObject();
        if(sampleModel == null) {
            raster = null;
            return;
        }

        // Restore the DataBuffer from its serialized form.
        DataBuffer dataBuffer = (DataBuffer)dataBufferState.getObject();

        // Reconstruct the Raster.
        raster = Raster.createRaster(sampleModel, dataBuffer, location);
    }
View Full Code Here

TOP

Related Classes of com.lightcrafts.mediax.jai.remote.SerializableState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.