⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rectanglesprite.java

📁 Sony Ericsson手机上的Facebook客户端全套代码
💻 JAVA
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   RectangleSprite.java

package se.southend.drops.gui;

import javax.microedition.lcdui.Graphics;
import se.southend.drops.scene.Sprite;

public class RectangleSprite extends Sprite
{

    public RectangleSprite(int rgb, int width, int height)
    {
        setColor(rgb);
        setAlpha(255);
        setSize(width, height);
    }

    public int getColor()
    {
        return color;
    }

    public void setColor(int rgb)
    {
        color = rgb;
    }

    public int getAlpha()
    {
        return alpha;
    }

    public void setAlpha(int alpha)
    {
        this.alpha = alpha;
    }

    public void setSize(int width, int height)
    {
        width = width >= 0 ? width : -width;
        height = height >= 0 ? height : -height;
        if(width > this.width)
            argb = null;
        this.width = width;
        this.height = height;
    }

    public int getWidth()
    {
        return width;
    }

    public int getHeight()
    {
        return height;
    }

    public void paint(Graphics graphics)
    {
        if(!isOnScreen())
            return;
        int xScr = getScreenX();
        int yScr = getScreenY();
        int yEnd = yScr + height;
        if(alpha < 255)
        {
            int value = alpha << 24 | color;
            if(argb == null)
                argb = new int[width * 8];
            if(argb[0] != value)
            {
                for(int i = argb.length - 1; i >= 0; i--)
                    argb[i] = value;

            }
            int y;
            for(y = yEnd - 8; y >= yScr; y -= 8)
                graphics.drawRGB(argb, 0, width, xScr, y, width, 8, true);

            if(y < yEnd)
                graphics.drawRGB(argb, 0, width, xScr, yScr, width, (8 + y) - yScr, true);
        } else
        {
            graphics.setColor(color);
            graphics.fillRect(xScr, yScr, width, height);
        }
    }

    private static final int TILE_HEIGHT = 8;
    private int argb[];
    private int color;
    private int alpha;
    private int width;
    private int height;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -