1 package ubc.midp.mobilephoto.core.ui.screens;
2
3 import javax.microedition.lcdui.Command;
4 import javax.microedition.lcdui.Form;
5 import javax.microedition.lcdui.Item;
6 import javax.microedition.lcdui.TextField;
7
8 /**
9 * @author tyoung
10 * This form is displayed when the user defines a new photo album (from the AlbumListScreen)
11 * TODO: This feature is not fully implemented. The commands are in place to create
12 * a new album, but currently it just creates a hard-coded album name for testing.
13 *
14 */
15 public class NewLabelScreen extends Form {
16
17 public static final int NEW_ALBUM = 0;
18 public static final int LABEL_PHOTO = 1;
19
20 TextField labelName = new TextField("Name", "", 15, TextField.ANY);
21
22 Command ok;
23 Command cancel;
24
25 private int formType;
26
27 /**
28 * @param arg0
29 */
30 public NewLabelScreen(String name, int type) {
31 super(name);
32 this.formType = type;
33 this.append(labelName);
34 ok = new Command("Save", Command.SCREEN, 0);
35 cancel = new Command("Cancel", Command.EXIT, 1);
36 this.addCommand(ok);
37 this.addCommand(cancel);
38
39 }
40
41 /**
42 * @param arg0
43 * @param arg1
44 */
45 public NewLabelScreen(String title, Item[] items) {
46
47 super(title, items);
48 // TODO Auto-generated constructor stub
49 }
50
51 /**
52 * @return Returns the new Album Name.
53 */
54 public String getLabelName() {
55 return labelName.getString();
56 }
57
58 /**
59 * @param formType the formType to set
60 */
61 public void setFormType(int formType) {
62 this.formType = formType;
63 }
64
65 /**
66 * @return the formType
67 */
68 public int getFormType() {
69 return formType;
70 }
71 }
|