Examples of Graphics2D


Examples of ae.java.awt.Graphics2D

        } else {
            dest = ICCBIFilter(src, srcColorSpace, dest, destColorSpace);
        }

        if (savdest != null) {
            Graphics2D big = savdest.createGraphics();
            try {
                big.drawImage(dest, 0, 0, null);
            } finally {
                big.dispose();
            }
            return savdest;
        } else {
            return dest;
        }
View Full Code Here

Examples of com.google.code.appengine.awt.Graphics2D

   * @param axisChart
   * @param iAxisChartDataSet
   **************************************************************************************/
  static void render( AxisChart axisChart, IAxisChartDataSet iAxisChartDataSet )
  {
    Graphics2D g2d = axisChart.getGraphics2D();
    BarChartProperties barChartProperties = (BarChartProperties) iAxisChartDataSet.getChartTypeProperties();
    float barWidth;

    //---y axis position on screen to start drawing.
    float startingX;
View Full Code Here

Examples of com.jgraph.gaeawt.java.awt.Graphics2D

      //throw new ImagingOpException ("Unable to transform source");
    }

    if (finalDst != null)
    {
      Graphics2D g = finalDst.createGraphics();
      g.setComposite(AlphaComposite.Src);
      g.drawImage(dst, 0, 0, null);
    }
    else
    {
      finalDst = dst;
    }
View Full Code Here

Examples of java.awt.Graphics2D

  }


  public void paintComponent(Graphics grp) {
    if (Settings.propEnableAntialiasing.getBoolean()) {
      final Graphics2D g2d = (Graphics2D) grp;
      if (null != g2d) {
        g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
            RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
      }
    }

    // Using the information of the clip bounds, we can speed up painting
View Full Code Here

Examples of java.awt.Graphics2D

           rect = new Rectangle(0,y-1,getWidth(),2);
          }
          mCueLine.setRect(rect);
        }

        Graphics2D g2 = (Graphics2D) getGraphics();
        Color c = new Color(255, 0, 0, mCueLine.getHeight() > 2 ? 40 : 180);
        g2.setColor(c);
        g2.fill(mCueLine);
      }

      return true;
    }
View Full Code Here

Examples of java.awt.Graphics2D

    }
  }

  protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text) {
    if (g instanceof Graphics2D && Settings.propTrayIsAntialiasing.getBoolean()) {
      Graphics2D g2d = (Graphics2D) g;
      g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
    }

    if (menuItem.isArmed()) {
      g.setColor(selectionForeground);
    } else {
View Full Code Here

Examples of java.awt.Graphics2D

           // create a BufferedImage of only 1 pixel height for fetching the rows
           // of the image in the correct format (ARGB)
           // This speeds up things by more than factor 2, compared to the standard
           // BufferedImage.getRGB solution
           BufferedImage row = new BufferedImage(width, 1, BufferedImage.TYPE_INT_ARGB);
           Graphics2D g2d = row.createGraphics();
           int pixels[] = ((DataBufferInt) row.getRaster().getDataBuffer()).getData();
           // make sure alpha values do not add up for each row:
           g2d.setComposite(AlphaComposite.Src);
           // calculate scanline by scanline in order to safe memory.
           // It also seems to run faster like that
           for (y = 0; y < height; y++) {
               g2d.drawImage(image, null, 0, -y);
               // now pixels contains the rgb values of the row y!
               if (numNodes > MAX_NODES) {
                   // Prune one level if the color tree is too large.
                   root.pruneLevel();
                   depth--;
View Full Code Here

Examples of java.awt.Graphics2D

               // create a BufferedImage of only 1 pixel height for fetching
               // the rows of the image in the correct format (ARGB)
               // This speeds up things by more than factor 2, compared to the
               // standard BufferedImage.getRGB solution
               BufferedImage row = new BufferedImage(width, 1, BufferedImage.TYPE_INT_ARGB);
               Graphics2D g2d = row.createGraphics();
               int pixels[] = ((DataBufferInt) row.getRaster().getDataBuffer()).getData();
               // make sure alpha values do not add up for each row:
               g2d.setComposite(AlphaComposite.Src);
               // calculate scanline by scanline in order to safe memory.
               // It also seems to run faster like that
               Node node;
               int x, y, i, id;
               int pixel, red, green, blue, alpha;
               int pos = 0;
               for (y = 0; y < height; y++) {
                   g2d.drawImage(image, null, 0, -y);
                   // now pixels contains the rgb values of the row y!
                   // filter this row now:
                   for (x = 0; x < width;) {
                       pixel = pixels[x];
                       red = (pixel >> 16) & 0xff;
View Full Code Here

Examples of java.awt.Graphics2D

    InputStream inImg = saver.read(ctx, imgURL);
    BufferedImage old_img = (BufferedImage)ImageIO.read(inImg)
    int width = old_img.getWidth();
    int height = old_img.getHeight();
    BufferedImage new_img = new BufferedImage(height,width,BufferedImage.TYPE_INT_RGB);       
        Graphics2D g2d =new_img.createGraphics();
       
        AffineTransform origXform = g2d.getTransform();
        AffineTransform newXform = (AffineTransform)(origXform.clone());
        // center of rotation is center of the panel
    double radian = 0;
        double xRot = 0;
        double yRot = 0;
    switch(orient){
    case 3:
      radian = 180.0;
      xRot = width/2.0;
      yRot = height/2.0;
    case 6:
      radian = 90.0;
          xRot = height/2.0;
          yRot = xRot;
      break;
    case 8:
      radian = 270.0;
          xRot = width/2.0;
          yRot = xRot;
          break;
        default:
          return false;
    }
        newXform.rotate(Math.toRadians(radian), xRot, yRot);

        g2d.setTransform(newXform);  
        // draw image centered in panel
        g2d.drawImage(old_img, 0, 0, null);
        // Reset to Original
        g2d.setTransform(origXform);
        OutputStream out = saver.write(ctx, imgURL);
        try{
          ImageIO.write(new_img, "JPG", out);
        }finally{
          out.close();
View Full Code Here

Examples of java.awt.Graphics2D

              : (location.x + c.getWidth() - p.x ), 1, 2,
              toolBarPanel.getHeight() - 1);
        }

        if (!oldCueLineBounds.equals(mCueLine.getBounds())) {
          Graphics2D g2d = (Graphics2D) toolBarPanel.getGraphics();
          toolBarPanel.paintImmediately(oldCueLineBounds);

          Color color = new Color(255, 0, 0, 180);
          g2d.setColor(color);
          g2d.fill(mCueLine);

          g2d.dispose();
        }
      }
    }
  }
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.