Package com.lightcrafts.mediax.jai.util

Examples of com.lightcrafts.mediax.jai.util.ImagingListener


        try {
            op = new MlibHistogramOpImage(src,
                                          xPeriod, yPeriod,
                                          numBins, lowValueFP, highValueFP);
        } catch (Exception e) {
            ImagingListener listener = ImageUtil.getImagingListener(hints);
            String message = JaiI18N.getString("MlibHistogramRIF0");
            listener.errorOccurred(message, e, this, false);
        }

        return op;
    }
View Full Code Here


    public RMIImageImpl() throws RemoteException {
        super();
        try {
            UnicastRemoteObject.exportObject(this);
        } catch(RemoteException e) {
            ImagingListener listener =
                ImageUtil.getImagingListener((RenderingHints)null);
            String message = JaiI18N.getString("RMIImageImpl0");
            listener.errorOccurred(message,
                                   new RemoteImagingException(message, e),
                                   this, false);
/*
            e.printStackTrace();
            throw new RuntimeException(JaiI18N.getString("RMIImageImpl0") +
View Full Code Here

*/
        }
    }

    private static void sendExceptionToListener(String message, Exception e) {
        ImagingListener listener =
            ImageUtil.getImagingListener((RenderingHints)null);
        listener.errorOccurred(message,
                               new RemoteImagingException(message, e),
                               JAIRMIImageServer.class, false);
    }
View Full Code Here

  Vector sources = oldPB.getSources();
  newPB.removeSources();

  // Create a new RenderableOp on the server
  ImageServer remoteImage = getImageServer(rop.getServerName());
        ImagingListener listener =
                ImageUtil.getImagingListener(rop.getRenderingHints());
  Long opID = new Long(0L);
  try {
      opID = remoteImage.getRemoteID();
      remoteImage.createRenderableOp(opID,
             rop.getOperationName(),
             newPB);
  } catch (RemoteException e){
            String message = JaiI18N.getString("RMIServerProxy8");
            listener.errorOccurred(message,
                                   new RemoteImagingException(message, e),
                                   this, false);
//      throw new RemoteImagingException(ImageUtil.getStackTraceString(e));
  }

  // Now look at the sources of the RenderableOp
  if (sources != null) {

      for (int i = 0; i < sources.size(); i++) {

    Object source = sources.elementAt(i);

    if (source instanceof RemoteRenderedOp) {

        // If source is a RenderedOp on a remote machine, create
        // it on the remote machine.
        RMIServerProxy rmisp =
    (RMIServerProxy)(((RemoteRenderedOp)source).getRendering());

        try {
      if (rmisp.getServerName().equalsIgnoreCase(
              rop.getServerName())) {

          // Both the RenderableOp and this source are on
          // the same server.
          remoteImage.setRenderedSource(opID,
                rmisp.getRMIID(),
                i);
          newPB.setSource(rmisp, i);
      } else {

          // The RenderableOp and this source are on
          // different servers.
          remoteImage.setRenderedSource(
               opID,
               rmisp.getRMIID(),
               rmisp.getServerName(),
               rmisp.getOperationName(),
               i);
          newPB.setSource(rmisp, i);
      }
        } catch (RemoteException e) {
                        String message = JaiI18N.getString("RMIServerProxy6");
                        listener.errorOccurred(message,
                                               new RemoteImagingException(message, e),
                                               this, false);
//      throw new RemoteImagingException(ImageUtil.getStackTraceString(e));
        }

    } else if (source instanceof RenderedOp) {

        // If the source is a local RenderedOp, then the only way
        // to access it from a remote machine is to render it and
        // create a SerializableRenderedImage wrapping the
        // rendering, which is set as the source of the remote op.
        RenderedImage ri = ((RenderedOp)source).getRendering();
        try {
      SerializableRenderedImage sri =
          new SerializableRenderedImage(ri);
      remoteImage.setRenderedSource(opID, sri, i);
      newPB.setSource(sri, i);
        } catch (RemoteException e) {
                        String message = JaiI18N.getString("RMIServerProxy6");
                        listener.errorOccurred(message,
                                               new RemoteImagingException(message, e),
                                               this, false);
//      throw new RemoteImagingException(ImageUtil.getStackTraceString(e));
        }

    } else if (source instanceof RenderedImage) {

        // If the source is a local RenderedImage, then the only
        // way to access it from a remote machine is by wrapping
        // it in SerializableRenderedImage and then setting the
        // SRI as the source.
        RenderedImage ri = (RenderedImage)source;
        try {
      SerializableRenderedImage sri =
          new SerializableRenderedImage(ri);
      remoteImage.setRenderedSource(opID, sri, i);
      newPB.setSource(sri, i);
        } catch (RemoteException e) {
                        String message = JaiI18N.getString("RMIServerProxy6");
                        listener.errorOccurred(message,
                                               new RemoteImagingException(message, e),
                                               this, false);
//      throw new RemoteImagingException(ImageUtil.getStackTraceString(e));
        }

    } else if (source instanceof RemoteRenderableOp) {

        // If the source is a RenderableOp on a remote machine,
        // cause the RenderableOp to be created on the remote
        // machine.
        RenderableRMIServerProxy rrmisp =
      createProxy((RemoteRenderableOp)source);

        try {

      // If the source RenderableOp is on the same server
      // as the RenderableOp that represents the operation
      if (rrmisp.getServerName().equalsIgnoreCase(
              rop.getServerName())) {
          remoteImage.setRenderableSource(opID,
                  rrmisp.getRMIID(),
                  i);
          newPB.setSource(rrmisp, i);
      } else {
          // If the source RenderableOp is on a different
          // server than the RenderableOp that represents
          // the operation
          remoteImage.setRenderableRMIServerProxyAsSource(
                opID,
                rrmisp.getRMIID(),
                rrmisp.getServerName(),
                rrmisp.getOperationName(),
                i);
          newPB.setSource(rrmisp, i);
      }
        } catch (RemoteException e) {
                        String message = JaiI18N.getString("RMIServerProxy6");
                        listener.errorOccurred(message,
                                               new RemoteImagingException(message, e),
                                               this, false);
//      throw new RemoteImagingException(ImageUtil.getStackTraceString(e));
        }

    } else if (source instanceof RenderableImage) {

        // If the source is a local RenderableImage, the only way
        // to access it from a remote machine is to wrap it in
        // a SerializableRenderableImage and then set the SRI as
        // the source on the remote operation.
        RenderableImage ri = (RenderableImage)source;
        try {
      SerializableRenderableImage sri =
          new SerializableRenderableImage(ri);
      remoteImage.setRenderableSource(opID, sri, i);
      newPB.setSource(sri, i);
        } catch (RemoteException e) {
                        String message = JaiI18N.getString("RMIServerProxy6");
                        listener.errorOccurred(message,
                                               new RemoteImagingException(message, e),
                                               this, false);
//      throw new RemoteImagingException(ImageUtil.getStackTraceString(e));
        }
    }
View Full Code Here

    }

    private void sendExceptionToListener(RenderContext renderContext,
                                         String message,
                                         Exception e) {
        ImagingListener listener =
            ImageUtil.getImagingListener(renderContext);
        listener.errorOccurred(message,
                               new RemoteImagingException(message, e),
                               this, false);
    }
View Full Code Here

  try {
      Object object = ois.readObject();
      return TileCodecUtils.deserializeRaster(object);
  }
  catch (ClassNotFoundException e) {
            ImagingListener listener =
                ImageUtil.getImagingListener((RenderingHints)null);
            listener.errorOccurred(JaiI18N.getString("ClassNotFound"),
                                   e, this, false);

//            e.printStackTrace();
      return null;
  }
View Full Code Here

            // remove from sorted set
            try {
                iter.remove();
            } catch(ConcurrentModificationException e) {
                ImagingListener listener =
                    ImageUtil.getImagingListener((RenderingHints)null);
                listener.errorOccurred("something wrong with the TileCache",
                                       e, this, false);
//                e.printStackTrace();
            }

            // remove tile from the linked list
View Full Code Here

            System.out.println(ct);
        }
    }

    void sendExceptionToListener(String message, Exception e) {
        ImagingListener listener =
            ImageUtil.getImagingListener((RenderingHints)null);
        listener.errorOccurred(message, e, this, false);
    }
View Full Code Here

            sm = TileCodecUtils.deserializeSampleModel(ois.readObject());
      location = (Point)ois.readObject();
            data = (byte[]) ois.readObject();
        }
        catch (ClassNotFoundException e) {
            ImagingListener listener =
                ImageUtil.getImagingListener((RenderingHints)null);
            listener.errorOccurred(JaiI18N.getString("ClassNotFound"),
                                   e, this, false);
//            e.printStackTrace();
      return null;
        }
  finally {
View Full Code Here

            }
        }
    }

    void sendExceptionToListener(String message, Throwable e) {
        ImagingListener listener =
            ImageUtil.getImagingListener((RenderingHints)null);
        listener.errorOccurred(message, e, this, false);
    }
View Full Code Here

TOP

Related Classes of com.lightcrafts.mediax.jai.util.ImagingListener

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.