Examples of NegotiableCapability


Examples of javax.media.jai.remote.NegotiableCapability

    public NegotiableCapability getEncodeCapability() {

  Vector generators = new Vector();
  generators.add(RawTileEncoderFactory.class);

  return new NegotiableCapability("tileCodec",
          "raw",
          generators,
          new ParameterListDescriptorImpl(null,
                  null,
                  null,
View Full Code Here

Examples of javax.media.jai.remote.NegotiableCapability

    public NegotiableCapability getDecodeCapability() {

  Vector generators = new Vector();
  generators.add(GZIPTileDecoderFactory.class);

  return new NegotiableCapability("tileCodec",
          "gzip",
          generators,
          new ParameterListDescriptorImpl(null,
                  null,
                  null,
View Full Code Here

Examples of javax.media.jai.remote.NegotiableCapability

      negCollection,
      negCollection,
      negCollection
  };

  NegotiableCapability decodeCap =
      new NegotiableCapability("tileCodec",
             "jpeg",
             generators,
             new ParameterListDescriptorImpl(
               null, //descriptor
               paramNames,
               paramClasses,
               defaults,
               null), // validValues
             false); // non-preference

  // Set the Negotiables representing the valid values on the capability
  decodeCap.setParameter(paramNames[0], nnr1);
  decodeCap.setParameter(paramNames[1], negCollection);
  decodeCap.setParameter(paramNames[2], nnr2);
  decodeCap.setParameter(paramNames[3], negCollection);
  decodeCap.setParameter(paramNames[4], negCollection);
  decodeCap.setParameter(paramNames[5], negCollection);

  return decodeCap;
    }
View Full Code Here

Examples of javax.media.jai.remote.NegotiableCapability

    public NegotiableCapability getDecodeCapability() {

  Vector generators = new Vector();
  generators.add(RawTileDecoderFactory.class);

  return new NegotiableCapability("tileCodec",
          "raw",
          generators,
          new ParameterListDescriptorImpl(null,
                  null,
                  null,
View Full Code Here

Examples of javax.media.jai.remote.NegotiableCapability

    public NegotiableCapability getEncodeCapability() {

  Vector generators = new Vector();
  generators.add(GZIPTileEncoderFactory.class);

  return new NegotiableCapability("tileCodec",
          "gzip",
          generators,
          new ParameterListDescriptorImpl(null,
                  null,
                  null,
View Full Code Here

Examples of javax.media.jai.remote.NegotiableCapability

      negCollection,
      negCollection,
      negCollection
  };

  NegotiableCapability encodeCap =
      new NegotiableCapability("tileCodec",
             "jpeg",
             generators,
             new ParameterListDescriptorImpl(
                null, // descriptor
                paramNames,
                paramClasses,
                defaults,
                null), // validValues
             false); // a non-preference

  // Set the Negotiables representing the valid values on the capability
  encodeCap.setParameter(paramNames[0], nnr1);
  encodeCap.setParameter(paramNames[1], negCollection);
  encodeCap.setParameter(paramNames[2], nnr2);
  encodeCap.setParameter(paramNames[3], negCollection);
  encodeCap.setParameter(paramNames[4], negCollection);
  encodeCap.setParameter(paramNames[5], negCollection);

  return encodeCap;
    }
View Full Code Here

Examples of javax.media.jai.remote.NegotiableCapability

/*  842 */     if ((tileX < getMinTileX()) || (tileX > getMaxTileX()) || (tileY < getMinTileY()) || (tileY > getMaxTileY()))
/*      */     {
/*  844 */       return null;
/*      */     }
/*      */
/*  849 */     NegotiableCapability codecCap = getNegotiatedValue("tileCodec");
/*      */
/*  851 */     TileDecoderFactory tdf = null;
/*  852 */     TileCodecParameterList tcpl = null;
/*      */
/*  854 */     if (codecCap != null)
/*      */     {
/*  856 */       String category = codecCap.getCategory();
/*  857 */       String capabilityName = codecCap.getCapabilityName();
/*  858 */       List generators = codecCap.getGenerators();
/*      */
/*  861 */       for (Iterator i = generators.iterator(); i.hasNext(); ) {
/*  862 */         Class factory = (Class)i.next();
/*  863 */         if ((tdf == null) && (TileDecoderFactory.class.isAssignableFrom(factory)))
/*      */         {
/*      */           try
/*      */           {
/*  867 */             tdf = (TileDecoderFactory)factory.newInstance();
/*      */           } catch (InstantiationException ie) {
/*  869 */             throw new RemoteImagingException(ImageUtil.getStackTraceString(ie));
/*      */           } catch (IllegalAccessException iae) {
/*  871 */             throw new RemoteImagingException(ImageUtil.getStackTraceString(iae));
/*      */           }
/*      */         }
/*      */       }
/*      */
/*  876 */       if (tdf == null) {
/*  877 */         throw new RemoteImagingException(JaiI18N.getString("RMIServerProxy0"));
/*      */       }
/*      */
/*  881 */       TileCodecDescriptor tcd = (TileCodecDescriptor)this.registry.getDescriptor("tileDecoder", capabilityName);
/*      */
/*  885 */       if ((!tcd.includesSampleModelInfo()) || (!tcd.includesLocationInfo()))
/*      */       {
/*  887 */         throw new RemoteImagingException(JaiI18N.getString("RMIServerProxy1"));
/*      */       }
/*      */
/*  891 */       ParameterListDescriptor pld = tcd.getParameterListDescriptor("tileDecoder");
/*      */
/*  894 */       tcpl = new TileCodecParameterList(capabilityName, new String[] { "tileDecoder" }, pld);
/*      */
/*  900 */       if (pld != null)
/*      */       {
/*  902 */         String[] paramNames = pld.getParamNames();
/*      */
/*  905 */         if (paramNames != null) {
/*  906 */           for (int i = 0; i < paramNames.length; i++) { String currParam = paramNames[i];
/*      */             Object currValue;
/*      */             try { currValue = codecCap.getNegotiatedValue(currParam); }
/*      */             catch (IllegalArgumentException iae)
/*      */             {
/*  913 */               continue;
/*      */             }
/*      */
View Full Code Here

Examples of javax.media.jai.remote.NegotiableCapability

/*      */   public byte[] getCompressedTile(Long id, int x, int y)
/*      */     throws RemoteException
/*      */   {
/*  425 */     TileCodecParameterList tcpl = null;
/*  426 */     TileEncoderFactory tef = null;
/*  427 */     NegotiableCapability codecCap = null;
/*      */
/*  429 */     if (negotiated != null) {
/*  430 */       codecCap = ((NegotiableCapabilitySet)negotiated.get(id)).getNegotiatedValue("tileCodec");
/*      */     }
/*      */
/*  434 */     if (codecCap != null)
/*      */     {
/*  436 */       String category = codecCap.getCategory();
/*  437 */       String capabilityName = codecCap.getCapabilityName();
/*  438 */       List generators = codecCap.getGenerators();
/*      */
/*  441 */       for (Iterator i = generators.iterator(); i.hasNext(); )
/*      */       {
/*  443 */         Class factory = (Class)i.next();
/*  444 */         if ((tef == null) && (TileEncoderFactory.class.isAssignableFrom(factory))) {
/*      */           try
/*      */           {
/*  447 */             tef = (TileEncoderFactory)factory.newInstance();
/*      */           } catch (InstantiationException ie) {
/*  449 */             throw new RuntimeException(ie.getMessage());
/*      */           } catch (IllegalAccessException iae) {
/*  451 */             throw new RuntimeException(iae.getMessage());
/*      */           }
/*      */         }
/*      */       }
/*      */
/*  456 */       if (tef == null) {
/*  457 */         throw new RuntimeException(JaiI18N.getString("JAIRMIImageServer0"));
/*      */       }
/*      */
/*  461 */       TileCodecDescriptor tcd = (TileCodecDescriptor)JAI.getDefaultInstance().getOperationRegistry().getDescriptor("tileEncoder", capabilityName);
/*      */
/*  466 */       if ((!tcd.includesSampleModelInfo()) || (!tcd.includesLocationInfo()))
/*      */       {
/*  468 */         throw new RuntimeException(JaiI18N.getString("JAIRMIImageServer1"));
/*      */       }
/*      */
/*  472 */       ParameterListDescriptor pld = tcd.getParameterListDescriptor("tileEncoder");
/*      */
/*  475 */       tcpl = new TileCodecParameterList(capabilityName, new String[] { "tileEncoder" }, pld);
/*      */
/*  479 */       if (pld != null)
/*      */       {
/*  481 */         String[] paramNames = pld.getParamNames();
/*      */
/*  485 */         if (paramNames != null) {
/*  486 */           for (int i = 0; i < paramNames.length; i++) { String currParam = paramNames[i];
/*      */             Object currValue;
/*      */             try { currValue = codecCap.getNegotiatedValue(currParam);
/*      */             } catch (IllegalArgumentException iae) {
/*  491 */               continue;
/*      */             }
/*  493 */             tcpl.setParameter(currParam, currValue);
/*      */           }
View Full Code Here

Examples of javax.media.jai.remote.NegotiableCapability

/*     */
/* 144 */     NegotiableNumericRange nnr2 = new NegotiableNumericRange(jpegPld.getParamValueRange(paramNames[2]));
/*     */
/* 149 */     Object[] defaults = { nnr1, negCollection, nnr2, negCollection, negCollection, negCollection };
/*     */
/* 158 */     NegotiableCapability encodeCap = new NegotiableCapability("tileCodec", "jpeg", generators, new ParameterListDescriptorImpl(null, paramNames, paramClasses, defaults, null), false);
/*     */
/* 171 */     encodeCap.setParameter(paramNames[0], nnr1);
/* 172 */     encodeCap.setParameter(paramNames[1], negCollection);
/* 173 */     encodeCap.setParameter(paramNames[2], nnr2);
/* 174 */     encodeCap.setParameter(paramNames[3], negCollection);
/* 175 */     encodeCap.setParameter(paramNames[4], negCollection);
/* 176 */     encodeCap.setParameter(paramNames[5], negCollection);
/*     */
/* 178 */     return encodeCap;
/*     */   }
View Full Code Here

Examples of javax.media.jai.remote.NegotiableCapability

/*    */   public NegotiableCapability getEncodeCapability()
/*    */   {
/* 87 */     Vector generators = new Vector();
/* 88 */     generators.add(RawTileEncoderFactory.class);
/*    */
/* 90 */     return new NegotiableCapability("tileCodec", "raw", generators, new ParameterListDescriptorImpl(null, null, null, null, null), false);
/*    */   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.