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

📄 button.java

📁 moto手机专用的LWT类库源码
💻 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) fieldsfirst ansi 
// Source File Name:   Button.java

package com.motorola.lwt;

import javax.microedition.lcdui.Graphics;

// Referenced classes of package com.motorola.lwt:
//            InteractableComponent, Component

public class Button extends InteractableComponent
{

    public static int BUTTON_ACTION_EVENT = 1;

    public Button()
    {
        super(null);
    }

    public Button(String s)
    {
        super(s);
    }

    public int getPreferredWidth()
    {
        return labelWidth + 10;
    }

    public int getPreferredHeight()
    {
        return labelHeight + 6;
    }

    public void componentActuated()
    {
        dispatchComponentEvent(BUTTON_ACTION_EVENT);
    }

    public void paint(Graphics g)
    {
        g.setFont(itsFont);
        g.setColor(enabled ? 0 : 0x808080);
        if(hasFocus())
            g.drawRect(0, 0, width - 1, height - 1);
        g.drawLine(3, 2, width - 4, 2);
        g.drawLine(3, height - 3, width - 4, height - 3);
        g.drawLine(2, 3, 2, height - 4);
        g.drawLine(width - 3, 3, width - 3, height - 4);
        if(pressed)
        {
            g.setColor(0);
            g.fillRect(3, 3, width - 6, height - 6);
            g.setColor(0xffffff);
        } else
        {
            g.setColor(0x808080);
            g.fillRect(3, 3, width - 6, height - 6);
            g.setColor(enabled ? 0 : 0x404040);
        }
        if(label != null)
            g.drawString(label, width >> 1, 2, 17);
    }

}

⌨️ 快捷键说明

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