www.pudn.com > 20061029005.rar > BasicInitNavigation.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 javax.microedition.lcdui.*; 
 
// Referenced classes of package org.cesar.inmotion.util: 
//            ResourceBundle, AbstractMIDlet, ApplicationController 
 
public class BasicInitNavigation extends List 
    implements CommandListener 
{ 
 
    private Form instructionForm; 
    private Command backComm; 
    private Command selectComm; 
    private Command emptyComm; 
    private int instrucIndex; 
 
    public BasicInitNavigation(String s, String s1, String s2, String s3, String as[], String s4, String s5) 
    { 
        super(ResourceBundle.getString(s5, s1), 3); 
        int i; 
        for(i = 0; i < as.length; i++) 
            append(ResourceBundle.getString(s5, as[i]), null); 
 
        append(ResourceBundle.getString(s5, s4), null); 
        instrucIndex = i; 
        setCommandListener(this); 
        backComm = new Command(ResourceBundle.getString(s5, s3), 2, 2); 
        selectComm = new Command(ResourceBundle.getString(s5, s2), 4, 1); 
        emptyComm = new Command("", 1, 1); 
        addCommand(selectComm); 
        addCommand(backComm); 
        instructionForm = new Form(ResourceBundle.getString(s5, s4)); 
        instructionForm.append(new StringItem(null, ResourceBundle.getString(s5, s))); 
        instructionForm.addCommand(emptyComm); 
        instructionForm.addCommand(new Command(ResourceBundle.getString(s5, s3), 2, 2)); 
        instructionForm.setCommandListener(this); 
    } 
 
    protected void processListOptions() 
    { 
        if(getSelectedIndex() == instrucIndex) 
            AbstractMIDlet.getDisplay().setCurrent(instructionForm); 
        else 
            ApplicationController.getInstance(AbstractMIDlet.getAppClassName()).processAction(getSelectedIndex()); 
    } 
 
    public void commandAction(Command command, Displayable displayable) 
    { 
        String s = command.getLabel(); 
        if(command == backComm) 
            ApplicationController.getInstance(AbstractMIDlet.getAppClassName()).changeScreen(-10); 
        else 
        if(command == selectComm || command == List.SELECT_COMMAND) 
            processListOptions(); 
        else 
        if(command != emptyComm) 
            AbstractMIDlet.getDisplay().setCurrent(this); 
    } 
 
    public void setInstrucIndex(int i) 
    { 
        instrucIndex = i; 
    } 
}