Package com.google.code.appengine.awt

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


    @Override
    public boolean equals(Object obj) {
        if(!(obj instanceof AlphaComposite)) {
            return false;
        }
        AlphaComposite other = (AlphaComposite)obj;
        return (this.rule == other.getRule() && this.alpha == other.getAlpha());
    }
View Full Code Here


    public static AlphaComposite getInstance(int rule, float alpha) {
        if(alpha == 1.0f) {
            return getInstance(rule);
        }
        return new AlphaComposite(rule, alpha);
    }
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

        int bgRGB = bgcolor == null ? 0 : bgcolor.getRGB();
        int srcRGB = 0, dstRGB = 0;
        Object srcVal = null, dstVal = null;
        if(comp instanceof AlphaComposite){
            compType = AlphaCompositeMode;
            AlphaComposite ac = (AlphaComposite) comp;
            rule = ac.getRule();
            srcConstAlpha = (int)(ac.getAlpha() * 255 + 0.5f);
        }else if(comp instanceof XORComposite){
            compType = XORMode;
            XORComposite xor = (XORComposite) comp;
            bgRGB = xor.getXORColor().getRGB();
        }
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) ((float) c.getAlpha() * alpha));
        realPaint = paint;
      }
    }
View Full Code Here

TOP

Related Classes of com.google.code.appengine.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.