Package java.awt

Examples of java.awt.AlphaComposite


  {

    if (comp instanceof AlphaComposite)
    {

      final AlphaComposite composite = (AlphaComposite) comp;

      if (composite.getRule() == 3)
      {

        alpha = composite.getAlpha();
        this.composite = composite;

        if (realPaint != null && (realPaint instanceof Color))
        {
View Full Code Here


    realPaint = paint;

    if ((composite instanceof AlphaComposite) && (paint instanceof Color))
    {

      final AlphaComposite co = (AlphaComposite) composite;

      if (co.getRule() == 3)
      {
        final Color c = (Color) paint;
        this.paint = new Color(c.getRed(), c.getGreen(), c.getBlue(), (int) ((float) c.getAlpha() * alpha));
        realPaint = paint;
      }
View Full Code Here

        }

        // we want to check that the two objects are equal, but can't rely on
        // AlphaComposite's equals() method because it is just the default
        // method inherited from Object...
        final AlphaComposite ac1 = (AlphaComposite) c1;
        final AlphaComposite ac2 = (AlphaComposite) c2;
        assertEquals(ac1.getRule(), ac2.getRule());
        assertEquals(ac1.getAlpha(), ac2.getAlpha(), 0.001f);
    }
View Full Code Here

            stream.writeObject(composite.getClass());
            if (composite instanceof Serializable) {
                stream.writeObject(composite);
            }
            else if (composite instanceof AlphaComposite) {
                final AlphaComposite ac = (AlphaComposite) composite;
                stream.writeInt(ac.getRule());
                stream.writeFloat(ac.getAlpha());
            }
        }
        else {
            stream.writeBoolean(true);
        }
View Full Code Here

                pack();
                setSize(600,600);
                addWindowListener(new figureClosingAdapter());
                setVisible(true);
              
               AlphaComposite acomp = AlphaComposite.SrcOver.derive(GlobalValues.alphaComposite);
              
               // set the composite for all the Plot2DPanels within the FrameView
               for (int i = 0; i < canvas.length; i++)  {
                   Plot2DPanel innerPlot = innerPlots[i];
                   Graphics2D g2d = (Graphics2D)innerPlot.getGraphics();
View Full Code Here

    public boolean equals(Object o) {
        if (o instanceof SVGComposite) {
            SVGComposite svgc = (SVGComposite)o;
            return (svgc.getRule() == getRule());
        } else if (o instanceof AlphaComposite) {
            AlphaComposite ac = (AlphaComposite)o;
            switch (getRule().getRule()) {
            case CompositeRule.RULE_OVER:
                return (ac == AlphaComposite.SrcOver);
            case CompositeRule.RULE_IN:
                return (ac == AlphaComposite.SrcIn);
View Full Code Here

            return;
        }

        if ((composite != null) &&
            (composite instanceof AlphaComposite)) {
            AlphaComposite ac = (AlphaComposite)composite;
            if (ac.getAlpha() < 0.001)
                return;         // No point in drawing
        }

        // Set up graphic context. It is important to setup the transform first,
        // because the clip is defined in this node's user space.
View Full Code Here

        {
            Graphics2D g2d = (Graphics2D) g;

            // Darken card with alpha blended overlay
            Composite composite = g2d.getComposite();
            AlphaComposite alphaComposite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, cardAlpha);
            g2d.setComposite(alphaComposite);
            g2d.setColor(new Color(0, 155, 0));
            g2d.fillRoundRect(0, 0, getWidth(), getHeight(), cardRectRadius, cardRectRadius);
            g2d.setComposite(composite);
View Full Code Here

            return;
        }

        if ((composite != null) &&
            (composite instanceof AlphaComposite)) {
            AlphaComposite ac = (AlphaComposite)composite;
            if (ac.getAlpha() < 0.001)
                return;         // No point in drawing
        }

        // Set up graphic context. It is important to setup the transform first,
        // because the clip is defined in this node's user space.
View Full Code Here

        Color xorcolor = null;
        CompositeContext cont = null;

        if(comp instanceof AlphaComposite){
            isAlphaComp = true;
            AlphaComposite ac = (AlphaComposite) comp;
            rule = ac.getRule();
            alpha = ac.getAlpha();
        }else if(comp instanceof XORComposite){
            isXORComp = true;
            XORComposite xcomp = (XORComposite) comp;
            xorcolor = xcomp.getXORColor();
        }else{
View Full Code Here

TOP

Related Classes of java.awt.AlphaComposite

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.