Demos and Usage of java.awt.Graphics2D.setRenderingHint(Key hintKey,Object hintValue)


   1:     public void paintComponent(Graphics g) {
   2:         Graphics2D g2 = (Graphics2D)g;
   3: 
   4:         ...
   5:         g2.setRenderingHint(Agile2D.KEY_CONVEX_SHAPE_HINT, Boolean.TRUE);
   6:         ...
   7:         g2.setRenderingHint(Agile2D.KEY_IMMUTABLE_SHAPE_HINT, Boolean.TRUE);

View Full Code Here
   1: public class RHints implements Painter {
   2:     public void paint(Graphics2D g) {
   3:         java.awt.RenderingHints.Key antialiasKey = java.awt.RenderingHints.KEY_ANTIALIASING;
   4:         ...
   5:         g.setPaint(Color.black);
   6:         g.setRenderingHint(antialiasKey, antialiasOn);
   7:         g.drawString("Text antialiasing", 10, 20);
   8:         ...
   9: 
  10:         g.setRenderingHint(antialiasKey, antialiasOff);
  11:         ...
  12:         g.setRenderingHint(textAntialiasKey, textAntialiasOn);

View Full Code Here
   1: public class DelegateGraphics2D
   2:         extends Graphics2D
   3: {
   4:         ...
   5:     protected Graphics2D g2;
   6: 
   7:         ...
   8:     {
   9:         g2 = (Graphics2D)g;
  10:     }
  11:         ...
  12:     {
  13:         g2.setRenderingHint(hintKey, hintValue);

View Full Code Here
   1: import java.awt.Color;
   2: import java.awt.Graphics2D;
   3: import java.awt.Rectangle;
   4:         ...
   5:         BufferedImage image = new BufferedImage(boundingBox.width,
   6:         Graphics2D graphics = (Graphics2D) image.getGraphics();
   7:         graphics.setColor(Color.WHITE);
   8:         graphics.fillRect(0, 0, boundingBox.width, boundingBox.height);
   9:         AffineTransform scaleTransform = new AffineTransform();

View Full Code Here
   1: 
   2:     public void render(int w, int h, Graphics2D g2) {
   3:         for (int i = objs.length; i-- > 0; ) {
   4:         ...
   5: 
   6:     public void render(Graphics2D g2) {
   7:         for (int f = 0;f < nface; f++) {
   8:         ...
   9: 
  10:     private void DrawPoly(Graphics2D g2, int poly, Color colour) {
  11:         for (int p = 2; p < polygons[poly][0]+2; p++) {
  12:         ...
  13:         g2.setColor(colour);
  14:         g2.setRenderingHint(Agile2D.KEY_CONVEX_SHAPE_HINT, Boolean.TRUE);

View Full Code Here
   1: 
   2:     public Graphics2D createGraphics2D(int width, 
   3:                                        int height, 
   4:         ...
   5: 
   6:         Graphics2D g2 = null;
   7: 
   8:         ...
   9:         } else {
  10:             g2 = (Graphics2D) g;
  11:         }
  12:         ...
  13:         g2.setBackground(getBackground());
  14:         g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, AntiAlias);

View Full Code Here
   1: package org.freehep.graphics2d;
   2: 
   3:         ...
   4: import java.awt.Graphics;
   5: import java.awt.Graphics2D;
   6: import java.awt.GraphicsConfiguration;
   7:         ...
   8: 
   9:     protected Graphics2D hostGraphics;
  10:     protected double lineWidth;
  11:         ...
  12:                                  Object hintValue) {
  13:         hostGraphics.setRenderingHint(hintKey, hintValue);

View Full Code Here
   1: public class DummyGraphics2d
   2:         extends Graphics2D
   3: {
   4:         ...
   5:     BufferedImage img;
   6:     private Graphics2D g2D;
   7: 
   8:         ...
   9:         img = new BufferedImage(1000, 1000, 2);
  10:         g2D = (Graphics2D)img.getGraphics();
  11:     }
  12:         ...
  13:         System.out.println( "hintValue = " + hintValue );
  14:         g2D.setRenderingHint( hintKey, hintValue );

View Full Code Here
   1: import java.awt.Graphics;
   2: import java.awt.Graphics2D;
   3: import java.awt.GraphicsConfiguration;
   4:         ...
   5: 
   6: public class BugFixProxyGraphics2D extends Graphics2D
   7: {
   8:         ...
   9:   private final Graphics2D parent;
  10: 
  11:         ...
  12:   {
  13:     parent.setRenderingHint(hintKey, hintValue);

View Full Code Here
   1:         }
   2:             Graphics2D g2d = (Graphics2D)g;
   3:         ...
   4:             g2d.setRenderingHint(Agile2D.KEY_IMMUTABLE_IMAGE_HINT, Boolean.FALSE);
   5:             if (bimg == null || bimg.getWidth() != d.width || bimg.getHeight() != d.height) {
   6:         ...
   7: 
   8:                 Graphics2D g2 = bimg.createGraphics();
   9:                 g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, 

View Full Code Here
   1: import java.awt.Graphics;
   2: import java.awt.Graphics2D;
   3: import java.awt.GraphicsConfiguration;
   4:         ...
   5: 
   6: public class SVGGraphics extends Graphics2D{
   7: 
   8:         ...
   9:     private final Graphics2D processingGraphics;
  10:     
  11:         ...
  12:     public void setRenderingHint(RenderingHints.Key hintKey, Object hintValue){
  13:         processingGraphics.setRenderingHint(hintKey,hintValue);

View Full Code Here