Package javax.microedition.lcdui

Examples of javax.microedition.lcdui.List


    private List getRecentContactsList()
    {
        if(recentContacts == null)
        {
            recentContacts = new List("Recent Contacts", List.IMPLICIT);
            recentContacts.addCommand(getOKCmd());
            recentContacts.addCommand(getBackCmd());
            recentContacts.setSelectCommand(OKCmd);
            recentContacts.setCommandListener(this);
        }
View Full Code Here


    private List getRecentContactsList()
    {
        if(recentContacts == null)
        {
            recentContacts = new List("Recent Contacts", List.IMPLICIT);
            recentContacts.addCommand(getOKCmd());
            recentContacts.addCommand(getBackCmd());
            recentContacts.setSelectCommand(OKCmd);
            recentContacts.setCommandListener(this);
        }
View Full Code Here

    private List getErrorList()
    {
        if(errorForm == null)
        {
            errorForm = new List("Errors", Choice.IMPLICIT);
            errorForm.addCommand(OKCmd);
            errorForm.addCommand(getClearCmd());
            errorForm.addCommand(backCmd);
            errorForm.setSelectCommand(OKCmd);
            errorForm.setCommandListener(this);
View Full Code Here

        optGenSwitches.setSelectedIndex(GEN_OPT_SOUND, true);
        optCommentFontSize = new TextField(T._("Comment font size"), "14", 2, TextField.NUMERIC);
        optGenForm.append(optGenSwitches);
        optGenForm.append(optCommentFontSize);

        optForm = new List(T._("Options"), Choice.IMPLICIT, optGroupList, null);
        optForm.setCommandListener(this);
        optForm.addCommand(backCommand);
        optForm.addCommand(selectCommand);

        // -- In-game submenus -------------------------------------------
        igProblemMenuList = new List(T._("Problem"), Choice.IMPLICIT, igProblemMenuItems, null);
        igProblemMenuList.setCommandListener(this);
        igProblemMenuList.addCommand(backCommand);
        igPlayMenuList = new List(T._("Play"), Choice.IMPLICIT, igPlayMenuItems, null);
        igPlayMenuList.setCommandListener(this);
        igPlayMenuList.addCommand(backCommand);
        igViewMenuList = new List(T._("View"), Choice.IMPLICIT, igViewMenuItems, null);
        igViewMenuList.setCommandListener(this);
        igViewMenuList.addCommand(backCommand);
        igScoreMenuList = new List(T._("Score"), Choice.IMPLICIT, igScoreMenuItems, null);
        igScoreMenuList.setCommandListener(this);
        igScoreMenuList.addCommand(backCommand);

        // -- Problem filter ---------------------------------------------
        probFilterForm = new Form(T._("Problem filter"));
        probFilterForm.setCommandListener(this);
        if (fileSelectScreen != null)
            probFilterForm.addCommand(updPathsCommand);
        probFilterForm.addCommand(startCommand);
        probFilterForm.addCommand(backCommand);

        probFilterGenre = new ChoiceGroup(T._("Genre"), Choice.POPUP);
        //probFilterGenre.setSelectedIndex(0, true);
        probFilterDiffFrom = new ChoiceGroup(T._("Difficulty From"), Choice.POPUP, levelList, null);
        probFilterDiffFrom.setSelectedIndex(0, true);
        probFilterDiffTo = new ChoiceGroup(T._("Difficulty To"), ChoiceGroup.POPUP, levelList, null);
        probFilterDiffTo.setSelectedIndex(0, true);
        probFilterDiffTo.setSelectedIndex(levelList.length - 1, true);
        probFilterSortByGenre = new ChoiceGroup(T._("Sort By Genre"), ChoiceGroup.POPUP, sortList, null);
        probFilterSortByGenre.setSelectedIndex(0, true);
        probFilterSortByDifficulty = new ChoiceGroup(T._("Sort By Difficulty"), ChoiceGroup.POPUP, sortList, null);
        probFilterSortByDifficulty.setSelectedIndex(0, true);
        probFilterSortByPopularity = new ChoiceGroup(T._("Sort By Popularity"), ChoiceGroup.POPUP, sortList, null);
        probFilterSortByPopularity.setSelectedIndex(0, true);
        probFilterShow = new ChoiceGroup(T._("Show"), ChoiceGroup.MULTIPLE, showList, null);
        probFilterShow.setSelectedIndex(0, true);
        probFilterShow.setSelectedIndex(2, true);
        probFilterShow.setSelectedIndex(3, true);
        probFilterPath = new ChoiceGroup(T._("Path"), ChoiceGroup.MULTIPLE);

        probFilterForm.append(probFilterGenre);
        probFilterForm.append(probFilterDiffFrom);
        probFilterForm.append(probFilterDiffTo);
        probFilterForm.append(probFilterShow);
        probFilterForm.append(probFilterSortByGenre);
        probFilterForm.append(probFilterSortByPopularity);
        probFilterForm.append(probFilterSortByDifficulty);
        probFilterForm.append(probFilterPath);

        probPathList = new List(T._("Problem Paths"), List.IMPLICIT);
        probPathList.addCommand(addCommand);
        probPathList.addCommand(removeCommand);
        probPathList.addCommand(removeAllCommand);
        probPathList.addCommand(backCommand);
        probPathList.setSelectCommand(removeCommand);
View Full Code Here

                    setCurrent(optProbForm);
                    break;
            }
        } else if (d == igProblemMenuList || d == igPlayMenuList
                || d == igViewMenuList || d == igScoreMenuList) {
            List l = (List) d;
            String s = l.getString(l.getSelectedIndex());
            if (s == igMenuMain)
                setCurrent(this);
            else if (s == igMenuPass)
                listener.igMenuPass();
            /*else if (s == igMenuFreePlay)
View Full Code Here

            }
        }).start();
    }

    void probRemovePath() {
        List l = (List) display.getCurrent();
        int i = l.getSelectedIndex();
        if (i >= 0) {
            try {
                String path = l.getString(i);
                pdb.removePath(path);
                listener.mainMenuInvalidateProblems();
                probUpdateFromPDB();
            } catch (Exception e) {
                probError(T._("Unable to remove path!"), e, null);
View Full Code Here

        }).start();
    }

    public void commandAction(Command c, Displayable d) {
        if (c == selectCommand || c == upCommand) {
            List curr = (List) d;
            final String currFile;
            if (c == upCommand)
                currFile = UP_DIRECTORY;
            else
                currFile = curr.getString(curr.getSelectedIndex());
            if (currFile.endsWith(FilePath.separator) || currFile.equals(UP_DIRECTORY))
                new Thread(new Runnable() {
                    public void run() {
                        traverseDirectory(currFile);
                    }
                }).start();
            else
                selectFile(currFile, selectCommand);
        } else if (c == customCommand) {
            List curr = (List) d;
            String currFile = curr.getString(curr.getSelectedIndex());
            selectFile(currFile, customCommand);
        } else if (c == propCommand) {
            List curr = (List) d;
            final String currFile = curr.getString(curr.getSelectedIndex());
            new Thread(new Runnable() {
                public void run() {
                    showProperties(currFile);
                }
            }).start();
        } else if (c == backCommand) {
            listener.fileSelectDone();
        } else if (c == backToBCommand) {
            new Thread(new Runnable() {
                public void run() {
                    showCurrDir();
                }
            }).start();
        } else if (c == newCommand) {
            createFile();
        } else if (c == newOkCommand) {
            String newName = nameInput.getString();
            if (newName == null || newName.length() == 0) {
                Alert alert = new Alert(T._("Error!"),
                        T._("File Name is empty. Please provide file name."), null,
                        AlertType.ERROR);
                alert.setTimeout(Alert.FOREVER);
                display.setCurrent(alert);
            } else {
                // Create file in a separate thread and disable all commands
                // except for "cancel"
                display.getCurrent().removeCommand(newOkCommand);
                display.getCurrent().removeCommand(upCommand);
                executeCreateFile(newName, typeInput.getSelectedIndex() != 0);
            }
        } else if (c == deleteCommand) {
            List curr = (List) d;
            String currFile = curr.getString(curr.getSelectedIndex());
            executeDelete(currFile);
        }
    }
View Full Code Here

            executeDelete(currFile);
        }
    }

    List createBrowser() {
        List browser = new List(currDirName, Choice.IMPLICIT);
        browser.setSelectCommand(selectCommand);

        if (customCommand != null)
            browser.addCommand(customCommand);
        // Do not allow creating files/directories beside root
        if (!MEGA_ROOT.equals(currDirName)) {
            if (allowNew)
                browser.addCommand(newCommand);
            browser.addCommand(propCommand);
            if (allowDel)
                browser.addCommand(deleteCommand);
            browser.addCommand(upCommand);
        }
        browser.addCommand(backCommand);
        browser.setCommandListener(this);

        return browser;
    }
View Full Code Here

        display.setCurrent(wc);

        try {
            Enumeration e;
            FileConnection currDir = null;
            List browser = createBrowser();

            if (MEGA_ROOT.equals(currDirName)) {
                e = FileSystemRegistry.listRoots();
            } else {
                currDir = (FileConnection) Connector.open("file://localhost/"
                        + currDirName);
                e = currDir.list();
                // not root - draw UP_DIRECTORY
                browser.append(UP_DIRECTORY, dirIcon);
            }

            while (e.hasMoreElements()) {
                String fileName = (String) e.nextElement();
                if (fileName.charAt(fileName.length() - 1) == FilePath.separatorChar)
                    browser.append(fileName, dirIcon);
                else if (fileName.toLowerCase().endsWith(".sgf"))
                    browser.append(fileName, sgfFileIcon);
                else if (fileName.toLowerCase().endsWith(".sgfi"))
                    browser.append(fileName, sgfiFileIcon);
                else
                    browser.append(fileName, fileIcon);
            }

            if (currDir != null)
                currDir.close();
View Full Code Here

        optGenSwitches.setSelectedIndex(GEN_OPT_SOUND, true);
        optCommentFontSize = new TextField(T._("Comment font size"), "14", 2, TextField.NUMERIC);
        optGenForm.append(optGenSwitches);
        optGenForm.append(optCommentFontSize);

        optForm = new List(T._("Options"), Choice.IMPLICIT, optGroupList, null);
        optForm.setCommandListener(this);
        optForm.addCommand(backCommand);
        optForm.addCommand(selectCommand);

        // -- In-game submenus -------------------------------------------
        igProblemMenuList = new List(T._("Problem"), Choice.IMPLICIT, igProblemMenuItems, null);
        igProblemMenuList.setCommandListener(this);
        igProblemMenuList.addCommand(backCommand);
        igPlayMenuList = new List(T._("Play"), Choice.IMPLICIT, igPlayMenuItems, null);
        igPlayMenuList.setCommandListener(this);
        igPlayMenuList.addCommand(backCommand);
        igViewMenuList = new List(T._("View"), Choice.IMPLICIT, igViewMenuItems, null);
        igViewMenuList.setCommandListener(this);
        igViewMenuList.addCommand(backCommand);
        igScoreMenuList = new List(T._("Score"), Choice.IMPLICIT, igScoreMenuItems, null);
        igScoreMenuList.setCommandListener(this);
        igScoreMenuList.addCommand(backCommand);

        // -- Problem filter ---------------------------------------------
        probFilterForm = new Form(T._("Problem filter"));
        probFilterForm.setCommandListener(this);
        if (fileSelectScreen != null)
            probFilterForm.addCommand(updPathsCommand);
        probFilterForm.addCommand(startCommand);
        probFilterForm.addCommand(backCommand);

        probFilterGenre = new ChoiceGroup(T._("Genre"), Choice.POPUP);
        //probFilterGenre.setSelectedIndex(0, true);
        probFilterDiffFrom = new ChoiceGroup(T._("Difficulty From"), Choice.POPUP, levelList, null);
        probFilterDiffFrom.setSelectedIndex(0, true);
        probFilterDiffTo = new ChoiceGroup(T._("Difficulty To"), ChoiceGroup.POPUP, levelList, null);
        probFilterDiffTo.setSelectedIndex(0, true);
        probFilterDiffTo.setSelectedIndex(levelList.length - 1, true);
        probFilterSortByGenre = new ChoiceGroup(T._("Sort By Genre"), ChoiceGroup.POPUP, sortList, null);
        probFilterSortByGenre.setSelectedIndex(0, true);
        probFilterSortByDifficulty = new ChoiceGroup(T._("Sort By Difficulty"), ChoiceGroup.POPUP, sortList, null);
        probFilterSortByDifficulty.setSelectedIndex(0, true);
        probFilterSortByPopularity = new ChoiceGroup(T._("Sort By Popularity"), ChoiceGroup.POPUP, sortList, null);
        probFilterSortByPopularity.setSelectedIndex(0, true);
        probFilterShow = new ChoiceGroup(T._("Show"), ChoiceGroup.MULTIPLE, showList, null);
        probFilterShow.setSelectedIndex(0, true);
        probFilterShow.setSelectedIndex(2, true);
        probFilterShow.setSelectedIndex(3, true);
        probFilterPath = new ChoiceGroup(T._("Path"), ChoiceGroup.MULTIPLE);

        probFilterForm.append(probFilterGenre);
        probFilterForm.append(probFilterDiffFrom);
        probFilterForm.append(probFilterDiffTo);
        probFilterForm.append(probFilterShow);
        probFilterForm.append(probFilterSortByGenre);
        probFilterForm.append(probFilterSortByPopularity);
        probFilterForm.append(probFilterSortByDifficulty);
        probFilterForm.append(probFilterPath);

        probPathList = new List(T._("Problem Paths"), List.IMPLICIT);
        probPathList.addCommand(addCommand);
        probPathList.addCommand(removeCommand);
        probPathList.addCommand(removeAllCommand);
        probPathList.addCommand(backCommand);
        probPathList.setSelectCommand(removeCommand);
View Full Code Here

TOP

Related Classes of javax.microedition.lcdui.List

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.