Package javax.media.jai.remote

Examples of javax.media.jai.remote.SerializableState


      */
    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


      */
    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

    public RenderedImage createScaledRendering(int w,
                 int h,
                 RenderingHints hints)
  throws RemoteImagingException {

  SerializableState ss = SerializerFactory.getState(hints, null);

  try {
      return imageServer.createScaledRendering(id, w, h, ss);
  } catch (RemoteException re) {
            String message = JaiI18N.getString("RMIServerProxy10");
View Full Code Here

     * @return a RenderedImage containing the rendered data.
     */
    public RenderedImage createRendering(RenderContext renderContext)
  throws RemoteImagingException {

  SerializableState ss = SerializerFactory.getState(renderContext, null);
  try {
      return imageServer.createRendering(id, ss);
  } catch (RemoteException re) {
            String message = JaiI18N.getString("RMIServerProxy10");
            listener.errorOccurred(message,
View Full Code Here

               oldHints,
               newParamBlock,
               newHints,
               op);

  SerializableState shapeState =
      SerializerFactory.getState((Shape)invalidRegion, null);

  return shapeState;
    }
View Full Code Here

      JAIRMIUtil.checkServerParameters(parameters, nodes);
      op.setParameters(parameters);

  } else if (propName.equals("renderinghints")) {

      SerializableState newState = (SerializableState)newValue;
      op.setRenderingHints((RenderingHints)newState.getObject());
  }

  return id;
    }
View Full Code Here

        obj = objectIn.readObject();
          } catch (Exception e) {
        throw new RuntimeException(e.getMessage());
          }
         
          SerializableState ss = (SerializableState)obj;
          RenderContext rc = (RenderContext)ss.getObject();
         
          ri = source.createRendering(rc);

      } else if (str.equals("createScaledRendering")) {
         
          // Read the Object from the object stream.
          obj = null;
          try {
        obj = objectIn.readObject();
          } catch (Exception e) {
        throw new RuntimeException(e.getMessage());
          }
         
          int w = ((Integer)obj).intValue();
         
          try {
        obj = objectIn.readObject();
          } catch (Exception e) {
        throw new RuntimeException(e.getMessage());
          }
         
          int h = ((Integer)obj).intValue();
         
          try {
        obj = objectIn.readObject();
          } catch (Exception e) {
        throw new RuntimeException(e.getMessage());
          }
         
          SerializableState ss = (SerializableState)obj;
          RenderingHints rh = (RenderingHints)ss.getObject();
         
          ri = source.createScaledRendering(w, h, rh);
      }

      if (useTileCodec) {
View Full Code Here

        int numInterfaces = interfaces.length;
        interfaceMap = new Hashtable(numInterfaces);
        for(int i = 0; i < numInterfaces; i++) {
            Class iface = interfaces[i];
            SerializableState state = implementations[i];

            if(!iface.isAssignableFrom(state.getObjectClass())) {
                throw new RuntimeException(JaiI18N.getString("InterfaceHandler1"));
            }

            Object impl = state.getObject();
            interfaceMap.put(iface, impl);
        }
    }
View Full Code Here

  // Create the RenderableOp on the server and it's sources on the
  // appropriate machines.
  RemoteRenderableOp rrop = (RemoteRenderableOp)image;
  RenderableRMIServerProxy rmisp = createProxy(rrop);

  SerializableState rcs =
      SerializerFactory.getState(renderContext, null);

  // Perform the mapRenderContext on the server.
  try {
      SerializableState rcpOut =
    rmisp.getImageServer(serverName).mapRenderContext(
                    i,
                    rmisp.getRMIID(),
                    operationName,
                    rcs);
View Full Code Here

    public Rectangle2D getBounds2D(String serverName,
           String operationName,
           ParameterBlock paramBlock)
  throws RemoteImagingException {

  SerializableState bounds = null;

  // Create a RemoteRenderableOp that represents the operation.
  RemoteRenderableOp original = new RemoteRenderableOp("jairmi",
                   serverName,
                   operationName,
                   paramBlock);

  // Create the RenderableOp on the server alongwith creating the
  // sources on appropriate machines.
  RenderableRMIServerProxy rmisp = createProxy(original);

  try {
      bounds =
    rmisp.getImageServer(serverName).getBounds2D(rmisp.getRMIID(),
                   operationName);
  } catch (RemoteException e) {
            String message = JaiI18N.getString("JAIRMICRIF6");
            sendExceptionToListener(null, message, e);
//      throw new RemoteImagingException(ImageUtil.getStackTraceString(e));
  }

  return (Rectangle2D.Float)bounds.getObject();
    }
View Full Code Here

TOP

Related Classes of javax.media.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.