PageRenderTime 9ms CodeModel.GetById 1ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/extensions/org/mt4jx/components/visibleComponents/widgets/menus/MenuItem.java

http://mt4j.googlecode.com/
Java | 54 lines | 45 code | 9 blank | 0 comment | 0 complexity | c04c33659bef92c2671220018bf6750c MD5 | raw file
 1package org.mt4jx.components.visibleComponents.widgets.menus;
 2
 3import org.mt4j.input.inputProcessors.IGestureEventListener;
 4
 5import processing.core.PImage;
 6
 7public class MenuItem {
 8	private String menuText = "";
 9	private short type = 0;
10	private PImage menuImage = null;
11	private IGestureEventListener gestureListener = null;
12	
13	
14	public static short TEXT = 1;
15	public static short PICTURE = 2;
16	public static short NONE = 0;
17	
18	public MenuItem(String text, IGestureEventListener al) {
19		this.type = TEXT;
20		this.menuText = text;
21		this.gestureListener = al;
22	}
23	public MenuItem(PImage image, IGestureEventListener al) {
24		this.type = PICTURE;
25		this.menuImage = image;
26		this.gestureListener = al;
27	}
28	public String getMenuText() {
29		return menuText;
30	}
31	public void setMenuText(String menuText) {
32		this.menuText = menuText;
33		this.type = TEXT;
34	}
35	public PImage getMenuImage() {
36		return menuImage;
37	}
38	public void setMenuImage(PImage menuImage) {
39		this.menuImage = menuImage;
40		this.type = PICTURE;
41	}
42	public short getType() {
43		return type;
44	}
45	public IGestureEventListener getGestureListener() {
46		return gestureListener;
47	}
48	public void setGestureListener(IGestureEventListener gestureListener) {
49		this.gestureListener = gestureListener;
50	}
51	
52	
53	
54}