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

📄 pointform.java

📁 Program helping you to remember the route. It cab be route from conference room to coffee-room, it
💻 JAVA
字号:
import javax.microedition.lcdui.*;

public class PointForm extends Form implements CommandListener
{ 
    TripMate    main;
    Trip        trip;
    int         pointIndex;
    PointList   list;
    Point       point;
    TextField   description;
    ChoiceGroup direction;

    PointForm(Trip trip, int pointIndex, TripMate main, PointList list) 
    {
        super("Trip point");
        this.main = main;
        this.trip = trip;
        this.pointIndex = pointIndex;
        this.list = list;
        point = trip.points[pointIndex];
        int prevTime = (pointIndex == 0) ? trip.time : trip.points[pointIndex-1].time;
        direction = new ChoiceGroup("Direction", Choice.EXCLUSIVE, TripMate.directions, TripMate.arrows);
        direction.setSelectedIndex(point.direction, true);
        description = new TextField("Description", point.description, 256, TextField.ANY);        
        append(direction);
        append(description);
        append(new StringItem("Time", Converter.timeToString(point.time - prevTime)));
        setCommandListener(this);
        addCommand(TripMate.UPDATE_CMD);
        addCommand(TripMate.BACK_CMD);
        Display.getDisplay(main).setCurrent(this);
    }
           
    public void commandAction(Command c, Displayable d) 
    {    
        if (c == TripMate.UPDATE_CMD) {
            int i = direction.getSelectedIndex();
            if (i >= 0) { 
                point.direction = i;
            }
            point.description = description.getString();
            main.updatePoint(point);
            list.set(pointIndex, point.description, main.arrows[point.direction]);
        }
        Display.getDisplay(main).setCurrent(list);
    }
}

⌨️ 快捷键说明

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