Package java.awt

Examples of java.awt.Composite


        // Set up graphic context. It is important to setup the
        // transform first, because the clip is defined in this node's
        // user space.
        Shape defaultClip = g2d.getClip();
        Composite defaultComposite = g2d.getComposite();
        AffineTransform defaultTransform = g2d.getTransform();
        RenderingHints defaultHints = null;

        if (hints != null) {
            defaultHints = g2d.getRenderingHints();
View Full Code Here


        // Ugly Hack alert.  This Makes it use our SrcOver implementation
        // Which doesn't seem to have as many bugs as the JDK one when
        // going between different src's and destinations (of course it's
        // also a lot slower).
        Composite g2dComposite = g2d.getComposite();
        if (g2d.getRenderingHint(RenderingHintsKeyExt.KEY_TRANSCODING) ==
            RenderingHintsKeyExt.VALUE_TRANSCODING_PRINTING) {
            if (SVGComposite.OVER.equals(g2dComposite)) {
                g2d.setComposite(SVGComposite.OVER);
            }
View Full Code Here

        // System.out.println("Calling FilterResRable paintRable");

        // This optimization only apply if we are using
        // SrcOver.  Otherwise things break...
        Composite c = g2d.getComposite();
        if (!SVGComposite.OVER.equals(c))
            return false;

        Filter src = getSource();
        return distributeAcross(src, g2d);
View Full Code Here

        html.println("<td>Painter</td>");
        int w = 25, h = 25;
        try {
            BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
            Graphics2D g2 = img.createGraphics();
            Composite old = g2.getComposite();
            g2.setComposite(AlphaComposite.Clear);
            g2.fillRect(0, 0, w, h);
            g2.setComposite(old);
            painter.paint(g2, null, w, h);
            g2.dispose();
View Full Code Here

        }
        html.println("<td>Font: " + font.getFamily() + " " + font.getSize() + " " + style + "</td>");
        int w = 300, h = 30;
        BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
        Graphics2D g2 = img.createGraphics();
        Composite old = g2.getComposite();
        g2.setComposite(AlphaComposite.Clear);
        g2.fillRect(0, 0, w, h);
        g2.setComposite(old);
        g2.setColor(Color.BLACK);
        g2.setFont(font);
View Full Code Here

        html.println("<td>Insets (" + insets.top + "," + insets.left + "," + insets.bottom + "," + insets.right + ")</pre></td>");
        int w = 50 + insets.left + insets.right;
        int h = 20 + insets.top + insets.bottom;
        BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
        Graphics2D g2 = img.createGraphics();
        Composite old = g2.getComposite();
        g2.setComposite(AlphaComposite.Clear);
        g2.fillRect(0, 0, w, h);
        g2.setComposite(old);
        g2.setColor(Color.BLACK);
        g2.drawRect(insets.left, insets.top, 49, 19);
View Full Code Here

        int w = 50 + insets.left + insets.right;
        int h = 20 + insets.top + insets.bottom;
        try {
            BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
            Graphics2D g2 = img.createGraphics();
            Composite old = g2.getComposite();
            g2.setComposite(AlphaComposite.Clear);
            g2.fillRect(0, 0, w, h);
            g2.setComposite(old);
            g2.setColor(Color.RED);
            g2.fillRect(insets.left, insets.top, 49, 19);
View Full Code Here

        if (w == 0 || h == 0) {
            html.println("<td>&nbsp;</td>");
        } else {
            BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
            Graphics2D g2 = img.createGraphics();
            Composite old = g2.getComposite();
            g2.setComposite(AlphaComposite.Clear);
            g2.fillRect(0, 0, w, h);
            g2.setComposite(old);
            g2.setColor(Color.RED);
            g2.drawRect(0, 0, w - 1, h - 1);
View Full Code Here

    static void printIcon(PrintWriter html, Icon icon) {
        html.println("<td>Icon " + icon.getIconWidth() + " x " + icon.getIconHeight() + "</pre></td>");
        BufferedImage img = new BufferedImage(icon.getIconWidth(), icon.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
        Graphics2D g2 = img.createGraphics();
        Composite old = g2.getComposite();
        g2.setComposite(AlphaComposite.Clear);
        g2.fillRect(0, 0, icon.getIconWidth(), icon.getIconHeight());
        g2.setComposite(old);
        JButton foo = new JButton();
        icon.paintIcon(foo, g2, 0, 0);
View Full Code Here

  /**
   * Draws the preview using the graphics canvas.
   */
  protected void paintPreview(mxGraphics2DCanvas canvas)
  {
    Composite previousComposite = canvas.getGraphics().getComposite();

    // Paints the preview states
    Iterator<mxCellState> it = cellStates.iterator();

    while (it.hasNext())
View Full Code Here

TOP

Related Classes of java.awt.Composite

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.