Package java.awt

Examples of java.awt.RenderingHints


        // Unpack the RenderContext and set local variables based thereon
        AffineTransform usr2dev = renderContext.getTransform();
        if(usr2dev == null) {
            usr2dev = new AffineTransform();
        }
        RenderingHints hints = renderContext.getRenderingHints();
        Shape aoi = renderContext.getAreaOfInterest();
        if(aoi == null) {
            aoi = dimensions.getBounds();
        }
View Full Code Here


    /**
     * Serialize the RenderingHintsState.
     */
    private void writeObject(ObjectOutputStream out) throws IOException {
        // -- Create a serializable form of the RenderingHints object. --
  RenderingHints hints = (RenderingHints)theObject;

        // Create an empty Hashtable.
        Hashtable table = new Hashtable();

        // If there are hints, add them to the table.
        if (hints != null && !hints.isEmpty()) {
            // Get a view of the hints' keys.
            Set keySet = hints.keySet();

            // Proceed if the key set is non-empty.
            if (!keySet.isEmpty()) {
                // Get an iterator for the key set.
                Iterator keyIterator = keySet.iterator();

                // Get the cached hint table.
                Hashtable hintTable = getHintTable();

                // Get the suppressed key Vector.
                Vector suppressedKeys = getSuppressedKeys();

                // Loop over the keys.
                while (keyIterator.hasNext()) {
                    // Get the next key.
                    Object key = keyIterator.next();

                    // Skip this element if the key is suppressed.
                    if (suppressedKeys != null &&
                        suppressedKeys.indexOf(key) != -1) {
                        continue;
                    }

                    // Get the field of the key.
                    Object keyElement = SerializerFactory.getState(key, null);

                    // If the key was not in the table it is not a public
                    // static field in one of the KEY_CLASSES so skip it.
                    if (keyElement == null) {
                        continue;
                    }

                    // Get the next value.
                    Object value = hints.get(key);

                    // Pack the key/value pair in a Hashtable entry.
                    HintElement valueElement = null;
                    try {
                        // Try to create a HintElement from the value directly.
View Full Code Here

        throws IOException, ClassNotFoundException {
        // Read serialized form from the stream.
        Hashtable table = (Hashtable)in.readObject();

        // Create an empty RenderingHints object.
        RenderingHints hints = new RenderingHints(null);

  theObject = hints;

        // If the table is empty just return.
        if (table.isEmpty()) {
            return;
        }

        // -- Restore the transient RenderingHints object. --

        // Get an enumeration of the table keys.
        Enumeration keys = table.keys();

        // Loop over the table keys.
        while (keys.hasMoreElements()) {
            // Get the next key element.
            SerializableState keyElement = (SerializableState)keys.nextElement();

            // Get the key object corresponding to this key element.
            Object key = keyElement.getObject();

            // Get the value element.
            HintElement valueElement = (HintElement)table.get(keyElement);

            // Get the value object corresponding to this value element.
            Object value = valueElement.getObject();

            // Add an entry to the hints.
            hints.put(key, value);
        }
    }
View Full Code Here

        throws IOException, ClassNotFoundException {
        // Read serialized form from the stream.
        Hashtable table = (Hashtable)in.readObject();

        // Create an empty RenderingHints object.
        hints = new RenderingHints(null);

        // If the table is empty just return.
        if(table.isEmpty()) {
            return;
        }
View Full Code Here

    /**
     * Returns a clone of the <code>RenderingHints</code> of this node or
     * <code>null</code>.
     */
    public RenderingHints getRenderingHints() {
        RenderingHints hints = nodeSupport.getRenderingHints();
        return hints == null ? null : (RenderingHints)hints.clone();
    }
View Full Code Here

        if ( key == null || value == null ) {
            throw new IllegalArgumentException(JaiI18N.getString("Generic0"));
        }

        RenderingHints rh = nodeSupport.getRenderingHints();
        if(rh == null) {
            nodeSupport.setRenderingHints(new RenderingHints(key, value));
        } else {
            rh.put(key, value);
            nodeSupport.setRenderingHints(rh);
        }
    }
View Full Code Here

     *         <code>null</code> if the key is not mapped to any value.
     *
     * @since JAI 1.1
     */
    public synchronized Object getRenderingHint(RenderingHints.Key key) {
        RenderingHints rh = nodeSupport.getRenderingHints();
        return rh == null ? null : rh.get(key);
    }
View Full Code Here

        // -- TiledImageGraphics state --
        // Cache the Hashtable of properties.
        properties = tiledImage.getProperties();

        // Create RenderingHints from the properties.
        renderingHints = new RenderingHints(properties);
    }
View Full Code Here

     * @param paramBlock The parameters used to create the image.
     * @return A <code>RenderedImage</code>.
     */
    public RenderedImage create(RenderContext renderContext,
                                ParameterBlock paramBlock) {
        RenderingHints renderHints = renderContext.getRenderingHints();
        if (operationName != null) {
            OperationRegistry registry =
                renderHints == null ? null :
                (OperationRegistry)renderHints.get(JAI.KEY_OPERATION_REGISTRY);

            RenderedImage rendering;

            if(registry == null) {
                // Call the JAI.create method to get the best implementation
View Full Code Here

        Map config;

        if (configuration == null) {

            config = new RenderingHints(JAI.KEY_REPLACE_INDEX_COLOR_MODEL,
                                        Boolean.FALSE);

        } else {

            config = configuration;

      // If the user has specified a hint for this, then we don't
      // want to change it, so change only if this hint is not
      // already specified
            if (!(config.containsKey(JAI.KEY_REPLACE_INDEX_COLOR_MODEL))) {
                RenderingHints hints = (RenderingHints)configuration;
                config = (RenderingHints)hints.clone();
                config.put(JAI.KEY_REPLACE_INDEX_COLOR_MODEL, Boolean.FALSE);
            }
        }

        return config;
View Full Code Here

TOP

Related Classes of java.awt.RenderingHints

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.