Package java.awt.image.renderable

Examples of java.awt.image.renderable.RenderContext


     */
    public void setSource(Long id,
                          RenderableOp source,
                          RenderContextProxy renderContextProxy)
        throws RemoteException {
            RenderContext renderContext =
                renderContextProxy.getRenderContext();
            RenderedImage r = source.createRendering(renderContext);
            PlanarImage pi = PlanarImage.wrapRenderedImage(r);
            addSource(id, pi, pi);
    }
View Full Code Here


     *
     * @param out The <code>ObjectOutputStream</code>.
     */
    private void writeObject(ObjectOutputStream out) throws IOException {

        RenderContext renderContext = (RenderContext)theObject;

        // Extract the affine transform.
        AffineTransform usr2dev = renderContext.getTransform();

        // Extract the hints.
  RenderingHints hints = renderContext.getRenderingHints();

  // Extract the AOI
        Shape aoi = renderContext.getAreaOfInterest();

        // Write serialized form to the stream.
        out.writeObject(usr2dev);
  out.writeObject(SerializerFactory.getState(aoi));
        out.writeObject(SerializerFactory.getState(hints, null));
View Full Code Here

      * @param out The <code>ObjectInputStream</code>.
      */
    private void readObject(ObjectInputStream in)
        throws IOException, ClassNotFoundException {

        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 createRendering(Long id,
           SerializableState renderContextState)
  throws RemoteException {

  RenderableImage ri = (RenderableImage)nodes.get(id);
  RenderContext renderContext =
      (RenderContext)renderContextState.getObject();
  RenderedImage rendering = ri.createRendering(renderContext);
  if (rendering instanceof Serializable) {
      return rendering;
  } else {
View Full Code Here

  if (crif == null) {
      throw new RuntimeException(
            JaiI18N.getString("JAIRMIImageServer3"));
  }

  RenderContext rc =
      crif.mapRenderContext(id,
          (RenderContext)rcs.getObject(),
          (ParameterBlock)rop.getParameterBlock(),
          rop);
  return SerializerFactory.getState(rc, null);
View Full Code Here

          } 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")) {
         
View Full Code Here

        double sx = (double)w/dimensions.getWidth();
        double sy = (double)h/dimensions.getHeight();
        AffineTransform usr2dev = new AffineTransform();
        usr2dev.setToScale(sx, sy);

        return createRendering(new RenderContext(usr2dev, hints));
    }
View Full Code Here

        return createRendering(new RenderContext(usr2dev, hints));
    }

    public RenderedImage createDefaultRendering() {
        return createRendering(new RenderContext(new AffineTransform()));
    }
View Full Code Here

    shape = (Shape)aoi;
      }
  }
 
  if(aoi == null && hints.isEmpty()) {
      renderContext = new RenderContext(usr2dev);
  } else if(aoi == null) {
      renderContext = new RenderContext(usr2dev, hints);
  } else if(hints.isEmpty()) {
      renderContext = new RenderContext(usr2dev, shape);
  } else {
      renderContext = new RenderContext(usr2dev, shape, hints);
  }
    }
View Full Code Here

      (ParameterBlock)nodeSupport.getParameterBlock().clone();

  // If there are any hints set on the node, create a new
  // RenderContext which merges them with those in the RenderContext
  // passed in with the passed in hints taking precedence.
  RenderContext rcIn = renderContext;
  RenderingHints nodeHints = nodeSupport.getRenderingHints();
  if(nodeHints != null) {
      RenderingHints hints = renderContext.getRenderingHints();
      RenderingHints mergedHints;
      if (hints == null) {
    mergedHints = nodeHints;
      } else if (nodeHints == null || nodeHints.isEmpty()) {
    mergedHints = hints;
      } else {
    mergedHints = new RenderingHints((Map)nodeHints);
                mergedHints.add(hints);
      }

      if(mergedHints != hints) {
    rcIn = new RenderContext(renderContext.getTransform(),
           renderContext.getAreaOfInterest(),
           mergedHints);
      }
  }

  // Get all sources - whether rendered or renderable.
  Vector sources = nodeSupport.getParameterBlock().getSources();

        try {
            if (sources != null) {
                Vector renderedSources = new Vector();
                for (int i = 0; i < sources.size(); i++) {

        RenderedImage rdrdImage = null;
        Object source = sources.elementAt(i);
        if (source instanceof RenderableImage) {
      RenderContext rcOut =
          remoteCRIF.mapRenderContext(
                 serverName,
                 nodeSupport.getOperationName(),
                 i,
                 renderContext,
View Full Code Here

TOP

Related Classes of java.awt.image.renderable.RenderContext

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.