Download presentation
Presentation is loading. Please wait.
Published byCassandra Donham Modified over 10 years ago
2
MIDP GUI
3
29-03-20152 Displayable hierarki Displayable ScreenCanvas TextBoxAlertFormList GameCanvas JEM1/jrt
4
29-03-20153 High Level GUI Displayable Screen TextBoxAlertFormList High Level GUI JEM1/jrt
5
Commands 1 MIDlet implements CommandListener mainForm.setCommandListener(this); exitCmd = new Command(“Exit”, Command.EXIT, 2); loginCmd = new Command(“Login”, Command.SCREEN, 3); public void commandAction(Command c, Displayable d) { String label = c.getLabel(); if(label.equals(”Exit")) { destroyApp(true); } else if(label.equals("Login")) {.... } 29-03-20154JEM1/jrt Observer Pattern
6
Commands 2 MIDlet implements CommandListener mainForm.setCommandListener(this); exitCmd = new Command(“Exit”, Command.EXIT, 2); loginCmd = new Command(“Login”, Command.SCREEN, 3); public void commandAction(Command c, Displayable d) { if (d == mainScreen) { if (c == exitCmd) {.... } } else if (d == setupScreen) { if (c == loginCmd) {.... } 29-03-20155JEM1/jrt Control Container Command Dispather
7
29-03-20156 Forms 1 En Form indeholder Items: –ChoiceGroup –CustomItem –DateField –Gauge –ImageItem –Spacer –StringItem –TextField JEM1/jrt
8
29-03-20157 Forms 2 Form f = new Form("FormX"); TextField t = new TextField("TF1:", "abc", 10, TextField.ANY); f.append(t); TextField n = new TextField("TF2:", "123", 10, TextField.NUMERIC); f.append(n); t.setLayout(Item.LAYOUT_LEFT | Item.LAYOUT_TOP); n.setLayout(Item.LAYOUT_RIGHT | Item.LAYOUT_BOTTOM); JEM1/jrt
9
Forms 3 MIDlet implements CommandListener, ItemCommandListener, ItemStateListener { setCommandListener(this); public void commandAction(Command c, Displayable s) setItemCommandListener(this); public void commandAction(Command c, Item item) setItemStateListener(this); public void itemStateChanged(Item item) 29-03-20158JEM1/jrt
10
29-03-20159 Lists 1 List services = new List("Choose one", Choice.EXCLUSIVE) services.append("Check Mail", null); services.append("Compose", null); services.append("Addresses", null); services.append("Options", null); services.append("Sign Out", null); display.setCurrent(services); Også Choice.MULTIPLE, Choice.IMPLICIT JEM1/jrt
11
Lists 2 public void commandAction(Command c, Displayable d) { if (c == List.SELECT_COMMAND && d == services) { int actionIndex = services.getSelectedIndex(); if (actionIndex < 0) return; String action = services.getString(actionIndex);.... 29-03-201510JEM1/jrt
12
Grundregler Få visninger eller valgmuligheder pr skærm Minimer mængden af manuelt input Ingen detaljerede skærmdesign overvejelser Ensartet navngivning og virkemåde af “ens” kommandoer Enkelt og overskueligt flow mellem skærme Test på mange telefonmodeller Gestalt teori og kognitive principper. 29-03-201511JEM1/jrt
13
29-03-201512JEM1/jrt
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.