Package javax.media.jai.util

Examples of javax.media.jai.util.ImagingException


            try {
                method.invoke(g2d, args);
            } catch(Exception e) {
                String message = JaiI18N.getString("TiledGraphicsGraphics4") + method;
                sendExceptionToListener(message, new ImagingException(e));
//                e.printStackTrace();
//                throw new RuntimeException(e.getMessage());
            }
        }
    }
View Full Code Here


      // find the RemoteCRIF from the registry.
      remoteCRIF = RemoteCRIFRegistry.get(nodeSupport.getRegistry(),
            protocolName);

      if (remoteCRIF == null) {
    throw new ImagingException(
            JaiI18N.getString("RemoteRenderableOp0"));
      }
  }

  return remoteCRIF;
View Full Code Here

    try {
        Thread.sleep(retryInterval);
    } catch (InterruptedException ie) {
//        throw new RuntimeException(ie.toString());
                    sendExceptionToListener(JaiI18N.getString("Generic5"),
                                            new ImagingException(JaiI18N.getString("Generic5"), ie));
    }
      }
  }

  if (serverCap == null && count > numRetries) {
View Full Code Here

                        im = null;
                    }
                } else {
                    String message = JaiI18N.getString("CodecRIFUtil0");
                    listener.errorOccurred(message,
                                           new ImagingException(message,
                                                                memoryError),
                                           this, false);
                    // Re-throw the error.
//                    throw memoryError;
                }
View Full Code Here

        Method method = null;
        try {
            method = GRAPHICS2D_CLASS.getMethod(name, argTypes);
        } catch(Exception e) {
            String message = JaiI18N.getString("TiledImageGraphics2") + name;
            sendExceptionToListener(message, new ImagingException(e));
//            throw new RuntimeException(e.getMessage());
        }

        // Transform requested area to obtain actual bounds.
        Rectangle bounds = new Rectangle(x, y, width, height);
        bounds = getTransform().createTransformedShape(bounds).getBounds();

        // Determine the range of tile indexes
        int minTileX = tiledImage.XToTileX(bounds.x);
        if(minTileX < tileXMinimum)
            minTileX = tileXMinimum;
        int minTileY = tiledImage.YToTileY(bounds.y);
        if(minTileY < tileYMinimum)
            minTileY = tileYMinimum;
        int maxTileX = tiledImage.XToTileX(bounds.x + bounds.width - 1);
        if(maxTileX > tileXMaximum)
            maxTileX = tileXMaximum;
        int maxTileY = tiledImage.YToTileY(bounds.y + bounds.height - 1);
        if(maxTileY > tileYMaximum)
            maxTileY = tileYMaximum;

        // Loop over the tiles
        for(int tileY = minTileY; tileY <= maxTileY; tileY++) {
            int tileMinY = tiledImage.tileYToY(tileY);
            for(int tileX = minTileX; tileX <= maxTileX; tileX++) {
                int tileMinX = tiledImage.tileXToX(tileX);

                // Get the WritableRaster of the current tile
                WritableRaster wr = tiledImage.getWritableTile(tileX, tileY);
                wr = wr.createWritableTranslatedChild(0, 0);

                // Create an equivalent BufferedImage
                BufferedImage bi =
                    new BufferedImage(colorModel, wr,
                                      colorModel.isAlphaPremultiplied(),
                                      properties);

                // Create the associated Graphics2D
                Graphics2D g2d = bi.createGraphics();

                // Initialize the Graphics2D state
                copyState(g2d);

                // Bias the tile origin so that the global coordinates
                // map correctly onto the tile.
                try {
                    Point2D origin2D =
                        g2d.getTransform().transform(new Point2D.Double(),
                                                    null);
                    Point pt = new Point((int)origin2D.getX() - tileMinX,
                                         (int)origin2D.getY() - tileMinY);
                    Point2D pt2D =
                        g2d.getTransform().inverseTransform(pt, null);
                    g2d.translate(pt2D.getX(), pt2D.getY());
                } catch(Exception e) {
                    String message = JaiI18N.getString("TiledImageGraphics3");
                    sendExceptionToListener(message, new ImagingException(e));
//                    throw new RuntimeException(e.getMessage());
                }

                // Perform the graphics operation
                try {
                    Object retVal = method.invoke(g2d, args);
                    if(retVal != null && retVal.getClass() == boolean.class) {
                        returnValue = ((Boolean)retVal).booleanValue();
                    }
                } catch(Exception e) {
                    String message =
                        JaiI18N.getString("TiledImageGraphics3") + " " + name;
                    sendExceptionToListener(message, new ImagingException(e));
//                    throw new RuntimeException(e.getMessage());
                }

                // Dispose of the Graphics2D
                g2d.dispose();
View Full Code Here

/*     */
/* 167 */             im = null;
/*     */           }
/*     */         } else {
/* 170 */           String message = JaiI18N.getString("CodecRIFUtil0");
/* 171 */           listener.errorOccurred(message, new ImagingException(message, memoryError), this, false);
/*     */         }
/*     */
/*     */       }
/*     */       catch (IOException e)
/*     */       {
View Full Code Here

/*  211 */       URL url = new URL(spec.toString());
/*  212 */       stream = url.openStream();
/*      */     } catch (Exception e) {
/*  214 */       String message = JaiI18N.getString("IIPResolution4") + spec.toString();
/*      */
/*  216 */       listener.errorOccurred(message, new ImagingException(message, e), IIPResolutionOpImage.class, false);
/*      */     }
/*      */
/*  221 */     return stream;
/*      */   }
View Full Code Here

/*  242 */         charsAppended = true;
/*      */       }
/*      */     } catch (Exception e) {
/*  245 */       String message = JaiI18N.getString("IIPResolution5");
/*      */
/*  247 */       listener.errorOccurred(message, new ImagingException(message, e), IIPResolutionOpImage.class, false);
/*      */     }
/*      */
/*  252 */     return charsAppended ? buf.toString().toLowerCase() : null;
/*      */   }
View Full Code Here

/*      */       try {
/*  276 */         stream.read(b);
/*      */       } catch (Exception e) {
/*  278 */         String message = JaiI18N.getString("IIPResolution6");
/*      */
/*  280 */         listener.errorOccurred(message, new ImagingException(message, e), IIPResolutionOpImage.class, false);
/*      */       }
/*      */
/*  284 */       String msg = new String(b);
/*  285 */       if (throwException)
/*  286 */         throwIIPException(msg);
View Full Code Here

/*  308 */       stream.read(b);
/*  309 */       stream.read();
/*  310 */       stream.read();
/*      */     } catch (Exception e) {
/*  312 */       String message = JaiI18N.getString("IIPResolution7");
/*  313 */       listener.errorOccurred(message, new ImagingException(message, e), IIPResolutionOpImage.class, false);
/*      */     }
/*      */
/*  318 */     return b;
/*      */   }
View Full Code Here

TOP

Related Classes of javax.media.jai.util.ImagingException

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.