Package javax.media.jai.util

Examples of javax.media.jai.util.ImagingListener


/*     */
/*  75 */     if (!SerializableStateImpl.class.isAssignableFrom(ssi)) {
/*  76 */       throw new IllegalArgumentException(JaiI18N.getString("SerializerImpl0"));
/*     */     }
/*     */
/*  79 */     ImagingListener listener = ImageUtil.getImagingListener((RenderingHints)null);
/*     */
/*  81 */     Class[] classes = null;
/*     */     try {
/*  83 */       Method m1 = ssi.getMethod("getSupportedClasses", null);
/*  84 */       classes = (Class[])m1.invoke(null, null);
/*     */     } catch (NoSuchMethodException e) {
/*  86 */       String message = JaiI18N.getString("SerializerImpl1");
/*  87 */       listener.errorOccurred(message, new RemoteImagingException(message, e), SerializerImpl.class, false);
/*     */     }
/*     */     catch (IllegalAccessException e)
/*     */     {
/*  91 */       String message = JaiI18N.getString("SerializerImpl1");
/*  92 */       listener.errorOccurred(message, new RemoteImagingException(message, e), SerializerImpl.class, false);
/*     */     }
/*     */     catch (InvocationTargetException e)
/*     */     {
/*  96 */       String message = JaiI18N.getString("SerializerImpl1");
/*  97 */       listener.errorOccurred(message, new RemoteImagingException(message, e), SerializerImpl.class, false);
/*     */     }
/*     */
/* 102 */     boolean supportsSubclasses = false;
/*     */     try {
/* 104 */       Method m2 = ssi.getMethod("permitsSubclasses", null);
/* 105 */       Boolean b = (Boolean)m2.invoke(null, null);
/* 106 */       supportsSubclasses = b.booleanValue();
/*     */     } catch (NoSuchMethodException e) {
/* 108 */       String message = JaiI18N.getString("SerializerImpl4");
/* 109 */       listener.errorOccurred(message, new RemoteImagingException(message, e), SerializerImpl.class, false);
/*     */     }
/*     */     catch (IllegalAccessException e)
/*     */     {
/* 113 */       String message = JaiI18N.getString("SerializerImpl4");
/* 114 */       listener.errorOccurred(message, new RemoteImagingException(message, e), SerializerImpl.class, false);
/*     */     }
/*     */     catch (InvocationTargetException e)
/*     */     {
/* 118 */       String message = JaiI18N.getString("SerializerImpl4");
/* 119 */       listener.errorOccurred(message, new RemoteImagingException(message, e), SerializerImpl.class, false);
/*     */     }
/*     */
/* 124 */     int numClasses = classes.length;
/* 125 */     for (int i = 0; i < numClasses; i++) {
/* 126 */       Serializer s = new SerializerImpl(ssi, classes[i], supportsSubclasses);
View Full Code Here


/*     */   public boolean permitsSubclasses() {
/* 193 */     return this.areSubclassesPermitted;
/*     */   }
/*     */
/*     */   private void sendExceptionToListener(String message, Exception e) {
/* 197 */     ImagingListener listener = ImageUtil.getImagingListener((RenderingHints)null);
/*     */
/* 199 */     listener.errorOccurred(message, new ImagingException(message, e), this, false);
/*     */   }
View Full Code Here

/* 507 */     ParameterBlock newPB = (ParameterBlock)oldPB.clone();
/* 508 */     Vector sources = oldPB.getSources();
/* 509 */     newPB.removeSources();
/*     */
/* 512 */     ImageServer remoteImage = getImageServer(rop.getServerName());
/* 513 */     ImagingListener listener = ImageUtil.getImagingListener(rop.getRenderingHints());
/*     */
/* 515 */     Long opID = new Long(0L);
/*     */     try {
/* 517 */       opID = remoteImage.getRemoteID();
/* 518 */       remoteImage.createRenderableOp(opID, rop.getOperationName(), newPB);
/*     */     }
/*     */     catch (RemoteException e)
/*     */     {
/* 522 */       String message = JaiI18N.getString("RMIServerProxy8");
/* 523 */       listener.errorOccurred(message, new RemoteImagingException(message, e), this, false);
/*     */     }
/*     */
/* 530 */     if (sources != null)
/*     */     {
/* 532 */       for (int i = 0; i < sources.size(); i++)
/*     */       {
/* 534 */         Object source = sources.elementAt(i);
/*     */
/* 536 */         if ((source instanceof RemoteRenderedOp))
/*     */         {
/* 540 */           RMIServerProxy rmisp = (RMIServerProxy)((RemoteRenderedOp)source).getRendering();
/*     */           try
/*     */           {
/* 544 */             if (rmisp.getServerName().equalsIgnoreCase(rop.getServerName()))
/*     */             {
/* 549 */               remoteImage.setRenderedSource(opID, rmisp.getRMIID(), i);
/*     */
/* 552 */               newPB.setSource(rmisp, i);
/*     */             }
/*     */             else
/*     */             {
/* 557 */               remoteImage.setRenderedSource(opID, rmisp.getRMIID(), rmisp.getServerName(), rmisp.getOperationName(), i);
/*     */
/* 563 */               newPB.setSource(rmisp, i);
/*     */             }
/*     */           } catch (RemoteException e) {
/* 566 */             String message = JaiI18N.getString("RMIServerProxy6");
/* 567 */             listener.errorOccurred(message, new RemoteImagingException(message, e), this, false);
/*     */           }
/*     */
/*     */         }
/* 573 */         else if ((source instanceof RenderedOp))
/*     */         {
/* 579 */           RenderedImage ri = ((RenderedOp)source).getRendering();
/*     */           try {
/* 581 */             SerializableRenderedImage sri = new SerializableRenderedImage(ri);
/*     */
/* 583 */             remoteImage.setRenderedSource(opID, sri, i);
/* 584 */             newPB.setSource(sri, i);
/*     */           } catch (RemoteException e) {
/* 586 */             String message = JaiI18N.getString("RMIServerProxy6");
/* 587 */             listener.errorOccurred(message, new RemoteImagingException(message, e), this, false);
/*     */           }
/*     */
/*     */         }
/* 593 */         else if ((source instanceof RenderedImage))
/*     */         {
/* 599 */           RenderedImage ri = (RenderedImage)source;
/*     */           try {
/* 601 */             SerializableRenderedImage sri = new SerializableRenderedImage(ri);
/*     */
/* 603 */             remoteImage.setRenderedSource(opID, sri, i);
/* 604 */             newPB.setSource(sri, i);
/*     */           } catch (RemoteException e) {
/* 606 */             String message = JaiI18N.getString("RMIServerProxy6");
/* 607 */             listener.errorOccurred(message, new RemoteImagingException(message, e), this, false);
/*     */           }
/*     */
/*     */         }
/* 613 */         else if ((source instanceof RemoteRenderableOp))
/*     */         {
/* 618 */           RenderableRMIServerProxy rrmisp = createProxy((RemoteRenderableOp)source);
/*     */           try
/*     */           {
/* 625 */             if (rrmisp.getServerName().equalsIgnoreCase(rop.getServerName()))
/*     */             {
/* 627 */               remoteImage.setRenderableSource(opID, rrmisp.getRMIID(), i);
/*     */
/* 630 */               newPB.setSource(rrmisp, i);
/*     */             }
/*     */             else
/*     */             {
/* 635 */               remoteImage.setRenderableRMIServerProxyAsSource(opID, rrmisp.getRMIID(), rrmisp.getServerName(), rrmisp.getOperationName(), i);
/*     */
/* 641 */               newPB.setSource(rrmisp, i);
/*     */             }
/*     */           } catch (RemoteException e) {
/* 644 */             String message = JaiI18N.getString("RMIServerProxy6");
/* 645 */             listener.errorOccurred(message, new RemoteImagingException(message, e), this, false);
/*     */           }
/*     */
/*     */         }
/* 651 */         else if ((source instanceof RenderableImage))
/*     */         {
/* 657 */           RenderableImage ri = (RenderableImage)source;
/*     */           try {
/* 659 */             SerializableRenderableImage sri = new SerializableRenderableImage(ri);
/*     */
/* 661 */             remoteImage.setRenderableSource(opID, sri, i);
/* 662 */             newPB.setSource(sri, i);
/*     */           } catch (RemoteException e) {
/* 664 */             String message = JaiI18N.getString("RMIServerProxy6");
/* 665 */             listener.errorOccurred(message, new RemoteImagingException(message, e), this, false);
/*     */           }
/*     */
/*     */         }
/*     */
/*     */       }
View Full Code Here

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

/*     */   {
/*     */     try
/*     */     {
/* 176 */       UnicastRemoteObject.exportObject(this);
/*     */     } catch (RemoteException e) {
/* 178 */       ImagingListener listener = ImageUtil.getImagingListener((RenderingHints)null);
/*     */
/* 180 */       String message = JaiI18N.getString("RMIImageImpl0");
/* 181 */       listener.errorOccurred(message, new RemoteImagingException(message, e), this, false);
/*     */     }
/*     */   }
View Full Code Here

/* 1463 */     printStream.close();
/* 1464 */     return stackTraceString;
/*      */   }
/*      */
/*      */   public static ImagingListener getImagingListener(RenderingHints hints) {
/* 1468 */     ImagingListener listener = null;
/* 1469 */     if (hints != null) {
/* 1470 */       listener = (ImagingListener)hints.get(JAI.KEY_IMAGING_LISTENER);
/*      */     }
/* 1472 */     if (listener == null)
/* 1473 */       listener = JAI.getDefaultInstance().getImagingListener();
View Full Code Here

/*      */     }
/* 1510 */     return new BigInteger(uid);
/*      */   }
/*      */
/*      */   static void sendExceptionToListener(String message, Exception e) {
/* 1514 */     ImagingListener listener = getImagingListener((RenderingHints)null);
/*      */
/* 1516 */     listener.errorOccurred(message, e, ImageUtil.class, false);
/*      */   }
View Full Code Here

/*    */     try {
/* 70 */       op = new HistogramOpImage(src, roi, xStart, yStart, xPeriod, yPeriod, numBins, lowValue, highValue);
/*    */     }
/*    */     catch (Exception e)
/*    */     {
/* 76 */       ImagingListener listener = ImageUtil.getImagingListener(hints);
/* 77 */       String message = JaiI18N.getString("HistogramRIF0");
/* 78 */       listener.errorOccurred(message, e, this, false);
/*    */     }
/*    */
/* 81 */     return op;
/*    */   }
View Full Code Here

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

/*    */
/* 83 */       RenderedImage image = RIFRegistry.create(registry, "stream", newParamBlock, renderHints);
/*    */
/* 87 */       return image == null ? null : new StreamImage(image, src);
/*    */     } catch (IOException e) {
/* 89 */       ImagingListener listener = ImageUtil.getImagingListener(renderHints);
/*    */
/* 91 */       String message = JaiI18N.getString("URLRIF0");
/* 92 */       listener.errorOccurred(message, e, this, false);
/*    */     }
/* 94 */     return null;
/*    */   }
View Full Code Here

TOP

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