Package com.lightcrafts.mediax.jai.remote

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


      */
    private void readObject(ObjectInputStream in)
        throws IOException, ClassNotFoundException {
        in.defaultReadObject();
        if ((boolean)in.readBoolean()) {
            SerializableState ss = (SerializableState)in.readObject();
            RenderedImage ri =(RenderedImage)(ss.getObject());
            theImage = PlanarImage.wrapRenderedImage(ri);
        } else {
            theImage = null;
        }
        iter = null;
View Full Code Here


        RenderContext renderContext = null;

        // Read serialized form from the stream.
        AffineTransform usr2dev = (AffineTransform)in.readObject();
 
  SerializableState aoi = (SerializableState)in.readObject();
  Shape shape = (Shape)aoi.getObject();

  SerializableState rhs = (SerializableState)in.readObject();
        RenderingHints hints = (RenderingHints)rhs.getObject();

        // Restore the transient RenderContext.
  renderContext = new RenderContext(usr2dev, shape, hints);
        theObject = renderContext;
    }
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

        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

               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

TOP

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

Copyright © 2015 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.