Package java.awt

Examples of java.awt.RenderingHints


    public void setNumRetries(int numRetries) {

  if (numRetries < 0)
      throw new IllegalArgumentException(JaiI18N.getString("Generic4"));

  RenderingHints rh = nodeSupport.getRenderingHints();
  if (rh == null) {
      RenderingHints hints = new RenderingHints(null);
      nodeSupport.setRenderingHints(hints);
  }

  nodeSupport.getRenderingHints().put(JAI.KEY_NUM_RETRIES,
              new Integer(numRetries));
View Full Code Here


     * Returns the current negotiation preferences or null, if none were
     * set previously.
     */
    public NegotiableCapabilitySet getNegotiationPreferences() {

  RenderingHints rh = nodeSupport.getRenderingHints();

  NegotiableCapabilitySet ncs =
      rh == null ? null : (NegotiableCapabilitySet)rh.get(
               JAI.KEY_NEGOTIATION_PREFERENCES);
  return ncs;
    }
View Full Code Here

     * process.
     */
    public void setNegotiationPreferences(NegotiableCapabilitySet preferences)
    {

  RenderingHints rh = nodeSupport.getRenderingHints();

  // If there are preferences to set
  if (preferences != null) {

      // Check whether RenderingHints exists, if not, create it.
      if (rh == null) {
    RenderingHints hints = new RenderingHints(null);
    nodeSupport.setRenderingHints(hints);
      }

      // Set the provided preferences into the RenderingHints
      nodeSupport.getRenderingHints().put(
View Full Code Here

     * or <code>null</code>.
     *
     * @since JAI 1.1
     */
    public RenderingHints getRenderingHints() {
        RenderingHints hints = nodeSupport.getRenderingHints();
        return hints == null ? null : (RenderingHints)hints.clone();
    }
View Full Code Here

     * @return The default RenderedImage.
     */
    public RenderedImage createDefaultRendering() {
        // Get the default dimensions.
        Dimension defaultDimension = null;
        RenderingHints hints = nodeSupport.getRenderingHints();
        if(hints != null &&
           hints.containsKey(JAI.KEY_DEFAULT_RENDERING_SIZE)) {
            defaultDimension =
                (Dimension)hints.get(JAI.KEY_DEFAULT_RENDERING_SIZE);
        }
        if(defaultDimension == null ||
           (defaultDimension.width <= 0 && defaultDimension.height <= 0)) {
            defaultDimension = JAI.getDefaultRenderingSize();
        }
View Full Code Here

            // 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 =
                    JAI.mergeRenderingHints(nodeHints, hints);
                if(mergedHints != hints) {
                    rcIn = new RenderContext(renderContext.getTransform(),
                                             renderContext.getAreaOfInterest(),
                                             mergedHints);
View Full Code Here

    private static Map configHelper(Map configuration) {

  Map config;

  if (configuration == null) {
      config = new RenderingHints(JAI.KEY_REPLACE_INDEX_COLOR_MODEL,
          Boolean.FALSE);
  } else {

      config = configuration;

      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

     *              this mapping take precedence over any in
     *              <code>defaultHints</code>.
     */
    static RenderingHints mergeRenderingHints(RenderingHints defaultHints,
                                              RenderingHints hints) {
        RenderingHints mergedHints;
        if (hints == null || hints.isEmpty()) {
            mergedHints = defaultHints;
        } else if(defaultHints == null || defaultHints.isEmpty()) {
            mergedHints = hints;
        } else { // Both parameters are non-null and non-empty.
            mergedHints = new RenderingHints((Map)defaultHints);
            mergedHints.add(hints);
        }

        return mergedHints;
    }
View Full Code Here

        if (!odesc.validateArguments(modeName, args, msg)) {
            throw new IllegalArgumentException(msg.toString());
        }

        // Merge rendering hints.  Hints passed in take precedence.
        RenderingHints mergedHints = mergeRenderingHints(renderingHints, hints);

        RenderedOp op = new RenderedOp(operationRegistry, opName,
                                       args, mergedHints);

        // If the operation requests immediate rendering, do so.
View Full Code Here

    private static Map configHelper(Map configuration) {

  Map config;
 
  if (configuration == null) {
      config = new RenderingHints(JAI.KEY_REPLACE_INDEX_COLOR_MODEL,
          Boolean.TRUE);
  } else {

      config = configuration;

      // If the user specified a value for this hint, we don't
      // want to change that
      if (!config.containsKey(JAI.KEY_REPLACE_INDEX_COLOR_MODEL)) {

    RenderingHints hints = new RenderingHints(null);
    // This is effectively a clone of configuration
    hints.putAll(configuration);
    config = hints;
    config.put(JAI.KEY_REPLACE_INDEX_COLOR_MODEL, Boolean.TRUE);
      }
  }
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.