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

📄 pixelgraphics.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:   PixelGraphics.java

package se.southend.drops.gui;

import javax.microedition.lcdui.*;

public class PixelGraphics
{

    public PixelGraphics(int width, int height)
    {
        this.width = width;
        this.height = height;
        rgbImage = Image.createImage(width, height);
        alphaImage = Image.createImage(width, height);
        gRgb = rgbImage.getGraphics();
        gAlpha = alphaImage.getGraphics();
        gAlpha.setColor(255);
    }

    public Image createImage()
    {
        int argb[] = new int[width * height];
        rgbImage.getRGB(argb, 0, width, 0, 0, width, height);
        int alpha[] = new int[width * height];
        alphaImage.getRGB(alpha, 0, width, 0, 0, width, height);
        for(int i = 0; i < argb.length; i++)
            argb[i] = argb[i] | alpha[i] << 24;

        return Image.createRGBImage(argb, width, height, true);
    }

    public void clipRect(int x, int y, int width, int height)
    {
        gRgb.clipRect(x, y, width, height);
        gAlpha.clipRect(x, y, width, height);
    }

    public void copyArea(int x_src, int y_src, int width, int height, int x_dest, int y_dest, int anchor)
    {
        gRgb.copyArea(x_src, y_src, width, height, x_dest, y_dest, anchor);
        gAlpha.copyArea(x_src, y_src, width, height, x_dest, y_dest, anchor);
    }

    public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
    {
        gRgb.drawArc(x, y, width, height, startAngle, arcAngle);
        gAlpha.drawArc(x, y, width, height, startAngle, arcAngle);
    }

    public void drawChar(char character, int x, int y, int anchor)
    {
        gRgb.drawChar(character, x, y, anchor);
        gAlpha.drawChar(character, x, y, anchor);
    }

    public void drawChars(char data[], int offset, int length, int x, int y, int anchor)
    {
        gRgb.drawChars(data, offset, length, x, y, anchor);
        gAlpha.drawChars(data, offset, length, x, y, anchor);
    }

    public void drawImage(Image img, int x, int y, int anchor)
    {
        gRgb.drawImage(img, x, y, anchor);
        gAlpha.drawImage(img, x, y, anchor);
    }

    public void drawLine(int x1, int y1, int x2, int y2)
    {
        gRgb.drawLine(x1, y1, x2, y2);
        gAlpha.drawLine(x1, y1, x2, y2);
    }

    public void drawRGB(int rgbData[], int offset, int scanlength, int x, int y, int width, int height, 
            boolean processAlpha)
    {
        gRgb.drawRGB(rgbData, offset, scanlength, x, y, width, height, processAlpha);
        gAlpha.drawRGB(rgbData, offset, scanlength, x, y, width, height, processAlpha);
    }

    public void drawRect(int x, int y, int width, int height)
    {
        gRgb.drawRect(x, y, width, height);
        gAlpha.drawRect(x, y, width, height);
    }

    public void drawRegion(Image src, int x_src, int y_src, int width, int height, int transform, int x_dest, 
            int y_dest, int anchor)
    {
        gRgb.drawRegion(src, x_src, y_src, width, height, transform, x_dest, y_dest, anchor);
        gAlpha.drawRegion(src, x_src, y_src, width, height, transform, x_dest, y_dest, anchor);
    }

    public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
    {
        gRgb.drawRoundRect(x, y, width, height, arcWidth, arcHeight);
        gAlpha.drawRoundRect(x, y, width, height, arcWidth, arcHeight);
    }

    public void drawString(String str, int x, int y, int anchor)
    {
        gRgb.drawString(str, x, y, anchor);
        gAlpha.drawString(str, x, y, anchor);
    }

    public void drawSubstring(String str, int offset, int len, int x, int y, int anchor)
    {
        gRgb.drawSubstring(str, offset, len, x, y, anchor);
        gAlpha.drawSubstring(str, offset, len, x, y, anchor);
    }

    public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
    {
        gRgb.fillArc(x, y, width, height, startAngle, arcAngle);
        gAlpha.fillArc(x, y, width, height, startAngle, arcAngle);
    }

    public void fillRect(int x, int y, int width, int height)
    {
        gRgb.fillRect(x, y, width, height);
        gAlpha.fillRect(x, y, width, height);
    }

    public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
    {
        gRgb.fillRoundRect(x, y, width, height, arcWidth, arcHeight);
        gAlpha.fillRoundRect(x, y, width, height, arcWidth, arcHeight);
    }

    public void fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3)
    {
        gRgb.fillTriangle(x1, y1, x2, y2, x3, y3);
        gAlpha.fillTriangle(x1, y1, x2, y2, x3, y3);
    }

    public int getBlueComponent()
    {
        return gRgb.getBlueComponent();
    }

    public int getClipHeight()
    {
        return gRgb.getClipHeight();
    }

    public int getClipWidth()
    {
        return gRgb.getClipWidth();
    }

    public int getClipX()
    {
        return gRgb.getClipX();
    }

    public int getClipY()
    {
        return gRgb.getClipY();
    }

    public int getColor()
    {
        return gRgb.getColor();
    }

    public int getDisplayColor(int color)
    {
        return gRgb.getDisplayColor(color);
    }

    public Font getFont()
    {
        return gRgb.getFont();
    }

    public int getGrayScale()
    {
        return gRgb.getGrayScale();
    }

    public int getGreenComponent()
    {
        return gRgb.getGreenComponent();
    }

    public int getRedComponent()
    {
        return gRgb.getRedComponent();
    }

    public int getStrokeStyle()
    {
        return gRgb.getStrokeStyle();
    }

    public int getTranslateX()
    {
        return gRgb.getTranslateX();
    }

    public int getTranslateY()
    {
        return gRgb.getTranslateY();
    }

    public void setClip(int x, int y, int width, int height)
    {
        gRgb.setClip(x, y, width, height);
        gAlpha.setClip(x, y, width, height);
    }

    public void setColor(int RGB)
    {
        gRgb.setColor(RGB);
    }

    public void setColor(int red, int green, int blue)
    {
        gRgb.setColor(red, green, blue);
    }

    public void setFont(Font font)
    {
        gRgb.setFont(font);
        gAlpha.setFont(font);
    }

    public void setGrayScale(int value)
    {
        gRgb.setGrayScale(value);
    }

    public void setStrokeStyle(int style)
    {
        gRgb.setStrokeStyle(style);
        gAlpha.setStrokeStyle(style);
    }

    public void translate(int x, int y)
    {
        gRgb.translate(x, y);
        gAlpha.translate(x, y);
    }

    private Image rgbImage;
    private Image alphaImage;
    private Graphics gRgb;
    private Graphics gAlpha;
    private int width;
    private int height;
}

⌨️ 快捷键说明

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