Package java.awt

Examples of java.awt.RenderingHints.containsKey()


                // Nothing changed: return the source directly.
                return src;
            } else {
                // Remove TileCache hint from RenderingHints if present.
                RenderingHints hints = renderHints;
                if(hints != null && hints.containsKey(JAI.KEY_TILE_CACHE)) {
                    hints = new RenderingHints((Map)renderHints);
                    hints.remove(JAI.KEY_TILE_CACHE);
                }

                // Only the ColorModel is changing.
View Full Code Here


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

        // Translate (and scale) the result if necessary.
        if(!postTransform.isIdentity()) {
            Interpolation interp =
                Interpolation.getInstance(Interpolation.INTERP_NEAREST);
            RenderingHints hints = renderContext.getRenderingHints();
            if(hints != null && hints.containsKey(JAI.KEY_INTERPOLATION)) {
                interp = (Interpolation)hints.get(JAI.KEY_INTERPOLATION);
            }
            rendering = JAI.create("affine", rendering,
                                   postTransform, interp);
        }
View Full Code Here

                listener.errorOccurred(JaiI18N.getString("AffineNotInvertible"),
                                       e, this, false);

            }
            pb = (new ParameterBlock()).addSource(ri).add(afn);
            if(hints != null && hints.containsKey(JAI.KEY_INTERPOLATION)) {
                pb.add(hints.get(JAI.KEY_INTERPOLATION));
            }
            ri = JAI.createRenderable("affine", pb);
        }
View Full Code Here

  public void test(TestHarness harness) {
 
    RenderingHints h = new RenderingHints(
      RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF
    );
    harness.check(h.containsKey(RenderingHints.KEY_TEXT_ANTIALIASING));
    harness.check(!h.containsKey(RenderingHints.KEY_ANTIALIASING));
   
    // an argument that is not a RenderingHint.Key should generate
    // a ClassCastException...
    boolean pass = false;
View Full Code Here

 
    RenderingHints h = new RenderingHints(
      RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF
    );
    harness.check(h.containsKey(RenderingHints.KEY_TEXT_ANTIALIASING));
    harness.check(!h.containsKey(RenderingHints.KEY_ANTIALIASING));
   
    // an argument that is not a RenderingHint.Key should generate
    // a ClassCastException...
    boolean pass = false;
    try
View Full Code Here

    // an argument that is not a RenderingHint.Key should generate
    // a ClassCastException...
    boolean pass = false;
    try
    {
      h.containsKey(new Integer(1));
    }
    catch (ClassCastException e
    {
      pass = true;
    }
View Full Code Here

    // the API spec clearly states that a null argument should generate a
    // NullPointerException...
    pass = false;
    try
    {
      h.containsKey(null);
    }
    catch (NullPointerException e)
    {
      pass = true;
    }
View Full Code Here

    RenderingHints h1 = new RenderingHints(
      RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF
    );
    RenderingHints h2 = (RenderingHints) h1.clone();
    harness.check(h2.containsKey(RenderingHints.KEY_TEXT_ANTIALIASING));
    harness.check(h2.get(RenderingHints.KEY_TEXT_ANTIALIASING).equals(RenderingHints.VALUE_TEXT_ANTIALIAS_OFF));
   
    // check that updating h1 doesn't affect h2
    h1.clear();
    harness.check(h2.containsKey(RenderingHints.KEY_TEXT_ANTIALIASING));
View Full Code Here

    harness.check(h2.containsKey(RenderingHints.KEY_TEXT_ANTIALIASING));
    harness.check(h2.get(RenderingHints.KEY_TEXT_ANTIALIASING).equals(RenderingHints.VALUE_TEXT_ANTIALIAS_OFF));
   
    // check that updating h1 doesn't affect h2
    h1.clear();
    harness.check(h2.containsKey(RenderingHints.KEY_TEXT_ANTIALIASING));
    harness.check(h2.get(RenderingHints.KEY_TEXT_ANTIALIASING).equals(RenderingHints.VALUE_TEXT_ANTIALIAS_OFF));
   
  }

}
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.