Package java.awt

Examples of java.awt.AlphaComposite


        thumbRect = knobBounds;

        java.awt.Composite holdComposite = g2.getComposite();

        AlphaComposite ac = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.4f);
        g2.setComposite(ac);

        paintThumbLocal(g2);

        g2.setComposite(holdComposite);
View Full Code Here


            // the current alpha
            float alpha = 1.0f;

            Composite composite = imageGraphics.getComposite();
            if (composite instanceof AlphaComposite) {
                AlphaComposite alphaComposite = (AlphaComposite)composite;
                alpha = alphaComposite.getAlpha();
            }

            if (opacity < alpha) {
                imageGraphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, opacity));
            }
View Full Code Here

     * @param g2d the Graphics2D to use
     */
    public void paint(Graphics2D g2d){
        if ((composite != null) &&
            (composite instanceof AlphaComposite)) {
            AlphaComposite ac = (AlphaComposite)composite;
            if (ac.getAlpha() < 0.001)
                return;         // No point in drawing
        }
        Rectangle2D bounds = getBounds();
        if (bounds == null) return;

View Full Code Here

     */
    public void setComposite(Composite comp) {
       
    if (comp instanceof AlphaComposite) {

      AlphaComposite composite = (AlphaComposite) comp;

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

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

        if (realPaint != null && (realPaint instanceof Color)) {

          Color c = (Color) realPaint;
View Full Code Here

        this.paint = paint;
    realPaint = paint;

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

        //super.paintComponent(g);

        Graphics2D g2 = (Graphics2D)g;

        AlphaComposite ac = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f);
        g2.setComposite(ac);

        g2.setColor( themeColor );

        g2.fillRect(0,0,getWidth(),getHeight());
View Full Code Here

     */
    @Test
    public void testGetBarComposite() {
        System.out.println("getBarComposite");
        ChartSettings instance = new ChartSettings();
        AlphaComposite result = instance.getBarComposite();
        assertNotNull(result);
    }
View Full Code Here

        int width, int height) {
      real.paintBorder(c, g, x, y, width, height);
      g.setColor(severity.color());
      Graphics2D gg = (Graphics2D) g;
      Composite composite = gg.getComposite();
      AlphaComposite alpha = AlphaComposite.getInstance(
          AlphaComposite.SRC_OVER, 0.05F);
      Insets ins = getBorderInsets(c);
      try {
        gg.setComposite(alpha);
        gg.fillRect(x, y, width, height);
View Full Code Here

            return;
        }
        int newCompState;
        CompositeType newCompType;
        if (comp instanceof AlphaComposite) {
            AlphaComposite alphacomp = (AlphaComposite) comp;
            newCompType = CompositeType.forAlphaComposite(alphacomp);
            if (newCompType == CompositeType.SrcOverNoEa) {
                if (paintState == PAINT_OPAQUECOLOR ||
                    (paintState > PAINT_ALPHACOLOR &&
                     paint.getTransparency() == Transparency.OPAQUE))
View Full Code Here

            eargb = foregroundColor.getRGB();
            if (compositeState <= COMP_ALPHA &&
                imageComp != CompositeType.SrcNoEa &&
                imageComp != CompositeType.SrcOverNoEa)
            {
                AlphaComposite alphacomp = (AlphaComposite) composite;
                int a = Math.round(alphacomp.getAlpha() * (eargb >>> 24));
                eargb = (eargb & 0x00ffffff) | (a << 24);
            }
        }
        this.eargb = eargb;
        this.pixel = surfaceData.pixelFor(eargb);
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.