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

📄 applicationcontroller.java

📁 一款j2me的钓鱼游戏,大家可以自由设计鱼.可以部署在eclipse,netbeans.
💻 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 

package org.cesar.inmotion.util;

import java.util.Hashtable;
import javax.microedition.lcdui.*;

// Referenced classes of package org.cesar.inmotion.util:
//            AbstractMIDlet

public abstract class ApplicationController
{

    public static final int PRESENTATION_SCREEN = -10;
    public static final int MAIN_MENU_SCREEN = -11;
    public static final int NO_SCREEN = -12;
    private Hashtable screenTable;
    private int currentScreen;
    private static ApplicationController instance;

    public ApplicationController()
    {
        screenTable = new Hashtable();
        currentScreen = -12;
    }

    public void setPresentation(Displayable displayable)
    {
        screenTable.put(new Integer(-10), displayable);
    }

    public void setMainMenu(Displayable displayable)
    {
        screenTable.put(new Integer(-11), displayable);
    }

    public void addScreen(int i, Displayable displayable)
        throws IllegalArgumentException
    {
        if(i != -10 && i != -11)
            screenTable.put(new Integer(i), displayable);
        else
            throw new IllegalArgumentException();
    }

    public void removeScreen(int i)
    {
        screenTable.remove(getScreen(i));
    }

    public Displayable getScreen(int i)
        throws IllegalArgumentException
    {
        return (Displayable)screenTable.get(new Integer(i));
    }

    public void changeScreen(int i)
    {
        Displayable displayable = (Displayable)screenTable.get(new Integer(i));
        if(displayable != null)
        {
            AbstractMIDlet.getDisplay().setCurrent(displayable);
            currentScreen = i;
        }
    }

    public static ApplicationController getInstance(String s)
    {
        if(instance == null)
            try
            {
                instance = (ApplicationController)Class.forName(s).newInstance();
            }
            catch(ClassNotFoundException classnotfoundexception)
            {
                classnotfoundexception.printStackTrace();
            }
            catch(Exception exception)
            {
                exception.printStackTrace();
            }
        return instance;
    }

    public abstract void paintScreen(String s, Graphics g);

    public abstract void startAppAction();

    public abstract void processAction(int i);

    public int getCurrentScreen()
    {
        return currentScreen;
    }
}

⌨️ 快捷键说明

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