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

📄 mcanvas.java

📁 飞信的j2me源代码
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
                g.drawString("" + ee.toString().charAt(i), j, k, 0x10 | 4);
                j += 5;
                if ((i % 18) == 0) {
                    k += 10;
                j = 5;
                }
            }
        }
    }

    private void left()
    {
        if(tabNum > 0)
            tabNum--;
        else
        if(tabNum == 0)
            if(strangerSec.isExpand && !buddySec.isSelected)
            {
                strangerSec.isExpand = false;
                MMIDlet.ml_StrangerList.isPaint = false;
                currentList = MMIDlet.ml_StrangerList;
                strangerSec.isSelected = true;
            } else
            if(buddySec.isExpand && !strangerSec.isSelected)
            {
                buddySec.isExpand = false;
                currentList = MMIDlet.ml_BuddyList;
                MMIDlet.ml_BuddyList.isPaint = false;
                int i = Setting.DISPLAY_ITEM_NUM * (Setting.ITEM_HEIGHT + 1);
                strangerSec.y -= i;
                MMIDlet.ml_StrangerList.setY(MMIDlet.ml_StrangerList.getY() - i);
                buddySec.isSelected = true;
            }
    }

    private void right()
    {
        if(tabNum < 2)
        {
            if(tabNum == 0)
                lastList = currentList;
            tabNum++;
        }
    }

    private void down()
    {
        if(tabNum == 0)
        {
            if(buddySec.isSelected)
            {
                buddySec.isSelected = false;
                if(buddySec.isExpand)
                {
                    if(MMIDlet.ml_BuddyList.size() > 0)
                    {
                        currentList = MMIDlet.ml_BuddyList;
                        MMIDlet.ml_BuddyList.isSelected = true;
                    } else
                    {
                        strangerSec.isSelected = true;
                    }
                } else
                {
                    strangerSec.isSelected = true;
                }
            } else
            if(strangerSec.isSelected)
            {
                if(strangerSec.isExpand)
                {
                    if(MMIDlet.ml_StrangerList.size() > 0)
                    {
                        strangerSec.isSelected = false;
                        MMIDlet.ml_StrangerList.isSelected = true;
                    }
                }
            } else
            {
                if(currentList == MMIDlet.ml_StrangerList)
                {
                    MMIDlet.ml_StrangerList.down();
                } else
                {
                    if(currentList == MMIDlet.ml_BuddyList)
                        if(currentList.isEnd())
                        {
                            strangerSec.isSelected = true;
                            MMIDlet.ml_BuddyList.isSelected = false;
                        } else
                        {
                            MMIDlet.ml_BuddyList.down();
                        }
                }
            }
        } else
        if(currentList != null)
            currentList.down();
    }

    /*private void up()
    {
        if(tabNum == 0)
        {
            if(buddySec.isSelected)
                break MISSING_BLOCK_LABEL_238;
            if(strangerSec.isSelected)
            {
                strangerSec.isSelected = false;
                if(buddySec.isExpand)
                {
                    midlet;
                    if(MMIDlet.ml_BuddyList.size() > 0)
                    {
                        midlet;
                        currentList = MMIDlet.ml_BuddyList;
                        midlet;
                        MMIDlet.ml_BuddyList.isSelected = true;
                        break MISSING_BLOCK_LABEL_238;
                    }
                }
                buddySec.isSelected = true;
            } else
            {
                midlet;
                if(currentList == MMIDlet.ml_StrangerList)
                {
                    if(currentList.isHome())
                    {
                        strangerSec.isSelected = true;
                        midlet;
                        MMIDlet.ml_StrangerList.isSelected = false;
                    } else
                    {
                        midlet;
                        MMIDlet.ml_StrangerList.up();
                    }
                } else
                {
                    midlet;
                    if(currentList == MMIDlet.ml_BuddyList)
                        if(currentList.isHome())
                        {
                            buddySec.isSelected = true;
                            midlet;
                            MMIDlet.ml_BuddyList.isSelected = false;
                        } else
                        {
                            midlet;
                            MMIDlet.ml_BuddyList.up();
                        }
                }
            }
        } else
        if(currentList != null)
            currentList.up();
    }*/
    
    private void up()
    {
        if(tabNum == 0)
        {
            if(!buddySec.isSelected){
                if(strangerSec.isSelected)
                {
                    strangerSec.isSelected = false;
                    if(buddySec.isExpand)
                    {
                        if(MMIDlet.ml_BuddyList.size() > 0)
                        {
                            currentList = MMIDlet.ml_BuddyList;
                            MMIDlet.ml_BuddyList.isSelected = true;
                            return;
                        }
                    }
                    buddySec.isSelected = true;
                } else
                {
                    if(currentList == MMIDlet.ml_StrangerList)
                    {
                        if(currentList.isHome())
                        {
                            strangerSec.isSelected = true;
                            MMIDlet.ml_StrangerList.isSelected = false;
                        } else
                        {
                            MMIDlet.ml_StrangerList.up();
                        }
                    } else
                    {
                        if(currentList == MMIDlet.ml_BuddyList)
                            if(currentList.isHome())
                            {
                                buddySec.isSelected = true;
                                MMIDlet.ml_BuddyList.isSelected = false;
                            } else
                            {
                                MMIDlet.ml_BuddyList.up();
                            }
                    }
                }
            } 
        }else
        if(currentList != null){
            currentList.up();
        }
    }

    private void fire()
    {
        if(tabNum == 0)
        {
            if(buddySec.isSelected)
            {
                buddySec.isExpand = !buddySec.isExpand;
                MMIDlet.ml_BuddyList.isPaint = buddySec.isExpand;
                if(buddySec.isExpand)
                {
                    if(MMIDlet.ml_BuddyList.size() > 0)
                    {
                        buddySec.isSelected = false;
                        MMIDlet.ml_BuddyList.isSelected = true;
                    } else
                    {
                        MMIDlet.ml_BuddyList.isSelected = false;
                    }
                    currentList = MMIDlet.ml_BuddyList;
                    strangerSec.isExpand = false;
                    MMIDlet.ml_StrangerList.isPaint = false;
                    int i = Setting.DISPLAY_ITEM_NUM * (Setting.ITEM_HEIGHT + 1);
                    strangerSec.y += i;
                    MMIDlet.ml_StrangerList.setY(i + MMIDlet.ml_StrangerList.getY());
                } else
                {
                    int j = Setting.DISPLAY_ITEM_NUM * (Setting.ITEM_HEIGHT + 1);
                    strangerSec.y -= j;
                    MMIDlet.ml_StrangerList.setY(MMIDlet.ml_StrangerList.getY() - j);
                }
            } else
            if(strangerSec.isSelected)
            {
                strangerSec.isExpand = !strangerSec.isExpand;
                MMIDlet.ml_StrangerList.isPaint = strangerSec.isExpand;
                if(strangerSec.isExpand)
                {
                    currentList = MMIDlet.ml_StrangerList;
                    if(buddySec.isExpand)
                    {
                        buddySec.isExpand = false;
                        MMIDlet.ml_BuddyList.isPaint = false;
                        int k = Setting.DISPLAY_ITEM_NUM * (Setting.ITEM_HEIGHT + 1);
                        strangerSec.y -= k;
                        MMIDlet.ml_StrangerList.setY(MMIDlet.ml_StrangerList.getY() - k);
                    }
                }
                currentList.isSelected = false;
            } else
            {
                selectedItem();
            }
        } else
        {
            selectedItem();
        }
    }

    private void selectedItem()
    {
        if(currentList != null)
        {
            MMIDlet.selectedItem = currentList.currentItem();
            if(MMIDlet.selectedItem != null)
            {
                if(MMIDlet.selectedItem.type == MListItem.BUDDY_ITEM)
                {
                    midlet.showBuddyCommandList(MMIDlet.selectedItem.buddy);
                } else
                {
                    if(MMIDlet.selectedItem.type == MListItem.CHAT_SESSION_ITEM)
                    {
                        midlet.showChatSessionCommandList(MMIDlet.selectedItem.chatSession);
                    }
                }
            }
        }
    }

    private void paintHeader(Graphics g)
    {
        g.setColor(0x487ae9);
        g.fillRect(0, 0, Setting.WIDTH, Setting.HEAD_HEIGHT);
        blt(img_BigIcon, 0, 0, Setting.BUDDY_ICON_SIZE, Setting.BUDDY_ICON_SIZE, 1, 0, g);
        g.setColor(0xffffff);
        g.drawString("Fetion", Setting.BUDDY_ICON_SIZE + 2, 0, 20);
        dateNow.setTime(System.currentTimeMillis());
        now.setTime(dateNow);
        sb_Time.delete(0, sb_Time.length());
        sb_Time.append(now.get(11)).append(':');
        int i = now.get(12);
        if(i < 10)
            sb_Time.append('0');
        sb_Time.append(i);
        g.drawString(sb_Time.toString(), Setting.WIDTH - 1, 0, 24);  //修改
    }

    public static void drawIntegerNumber(int i, int j, int k, Image image, Graphics g)
    {
        int l;
        do
        {
            l = i / 10;
            int i1 = i - l * 10;
            blt(image, Setting.SMALL_ICON_SIZE * i1, 0, Setting.SMALL_ICON_SIZE, Setting.SMALL_ICON_SIZE, j, k, g);
            j -= Setting.SMALL_ICON_SIZE;
            i /= 10;
        } while(l != 0);
    }

    public static void blt(Image image, int i, int j, int k, int l, int i1, int j1, Graphics g)
    {
        g.setClip(i1, j1, k, l);
        g.drawImage(image, i1 - i, j1 - j, 20);
        g.setClip(0, 0, Setting.WIDTH, Setting.HEIGHT);
    }

    protected void paint(Graphics g)
    {
        setFullScreenMode(true);
        HEIGHT = getHeight();
        start = System.currentTimeMillis();
        if(isKeyPressed)
            updateKeyState(keyCode);
        g.setColor(0xe7ebff);
        g.fillRect(0, 0, Setting.WIDTH, Setting.HEIGHT);
        g.drawImage(img_BackGround, 0, Setting.HEIGHT / 2, 6);
        paintHeader(g);
        if(isPaintFirstPage)
        {
            paintFirstPage(g);
            try
            {
                Paint_Error(g);
            }
            catch(Exception exception) { }
            return;
        }
        switch(tabNum)
        {
        default:
            break;

        case 0: // '\0'
            if(lastList != null)
            {
                currentList = lastList;
                lastList = null;
            }
            paintGroupTab(g);
            break;

        case 1: // '\001'
            currentList = MMIDlet.ml_SessionList;
            break;

        case 2: // '\002'
            currentList = MMIDlet.ml_BlackList;
            break;
        }
        paintMList(g);
        paintTab(g);
        paintFooter(g);

⌨️ 快捷键说明

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