Package java.awt

Examples of java.awt.RenderingHints$KeyValue


    public void setRetryInterval(int retryInterval) {

  if (retryInterval < 0)
      throw new IllegalArgumentException(JaiI18N.getString("Generic3"));

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

  nodeSupport.getRenderingHints().put(JAI.KEY_RETRY_INTERVAL,
              new Integer(retryInterval));
View Full Code Here


     * value is returned, else the default number of retries as defined by
     * <code>RemoteJAI.DEFAULT_NUM_RETRIES</code> is returned.
     */
    public int getNumRetries() {

  RenderingHints rh = nodeSupport.getRenderingHints();
  if (rh == null) {
      return RemoteJAI.DEFAULT_NUM_RETRIES;
  } else {
      Integer i = (Integer)rh.get(JAI.KEY_NUM_RETRIES);
      if (i == null)
    return RemoteJAI.DEFAULT_NUM_RETRIES;
      else
    return i.intValue();
  }
View Full Code Here

    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

TOP

Related Classes of java.awt.RenderingHints$KeyValue

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.