当前位置: 首页>>代码示例>>Java>>正文


Java FieldChangeListener类代码示例

本文整理汇总了Java中net.rim.device.api.ui.FieldChangeListener的典型用法代码示例。如果您正苦于以下问题:Java FieldChangeListener类的具体用法?Java FieldChangeListener怎么用?Java FieldChangeListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


FieldChangeListener类属于net.rim.device.api.ui包,在下文中一共展示了FieldChangeListener类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: RegisterScreen3

import net.rim.device.api.ui.FieldChangeListener; //导入依赖的package包/类
RegisterScreen3(UiApplication app){
	
	super(NO_VERTICAL_SCROLL | NO_VERTICAL_SCROLLBAR);
	this.setTitle("Registration (3/3)");
	int direction = Display.DIRECTION_NORTH;
	Ui.getUiEngineInstance().setAcceptableDirections(direction);
	_App = app;	
	int g = usernamefield.getPreferredHeight() * 1 + new SeparatorField().getPreferredHeight() * 1;
	VerticalFieldManager monManager = (VerticalFieldManager) getMainManager();
	Bitmap back = EncodedImage.getEncodedImageResource("yBack.jpg").getBitmap();
	monManager.setBackground(BackgroundFactory.createBitmapBackground(back));
	
	AbsoluteFieldManager Vodka = new AbsoluteFieldManager();
	
	VerticalFieldManager LoginViewManager = new VerticalFieldManager();
	LoginViewManager.add(usernamefield);
	LoginViewManager.add(new SeparatorField());
	Vodka.add(LoginViewManager, 0, (Display.getHeight() / 2) - 85);
	OkBtn.setChangeListener(new FieldChangeListener() {
		public void fieldChanged(Field field, int context) {
			_App.popScreen();
			returntouch = false;
			username = usernamefield.getText();
		}
	});
	VerticalFieldManager BtnManager = new VerticalFieldManager();
	Vodka.add(BtnManager, 0, (Display.getHeight() / 2) - g / 2 - 45 /2);
	Vodka.add(OkBtn,5,Display.getHeight() -105);
	monManager.add(Vodka);

}
 
开发者ID:PropheteMath,项目名称:CrapSnap,代码行数:32,代码来源:RegisterScreen3.java

示例2: VideoPlay

import net.rim.device.api.ui.FieldChangeListener; //导入依赖的package包/类
public VideoPlay(byte[] video, UiApplication MonApp) {
	int direction = Display.DIRECTION_NORTH;
	Ui.getUiEngineInstance().setAcceptableDirections(direction);
	_video = video;
	_MonApp = MonApp;
	try {
		this.addMenuItem(_ScreenShootitem);
		ByteArrayInputStream is = new ByteArrayInputStream(video);
		player = javax.microedition.media.Manager.createPlayer(is,
				"video/mp4");
		player.realize();
		player.prefetch();
		player.addPlayerListener(new Playerlst(item));
		VideoControl videoControl = (VideoControl) player
				.getControl("VideoControl");
		Field videoField = (Field) videoControl.initDisplayMode(
				VideoControl.USE_GUI_PRIMITIVE,
				"net.rim.device.api.ui.Field");
		add(videoField);
		VolumeControl volume = (VolumeControl) player
				.getControl("VolumeControl");
		volume.setLevel(30);
		player.start();
		item.setChangeListener(new FieldChangeListener() {
			public void fieldChanged(Field field, int context) {
				close();
			}
		});

	} catch (MediaException me) {
		error = true;
		Dialog.alert("Error while opening the snap :" + me.toString());
		return;
	} catch (IOException ioe) {
		error = true;
		Dialog.alert(ioe.toString());
		return;
	}

}
 
开发者ID:PropheteMath,项目名称:CrapSnap,代码行数:41,代码来源:VideoPlay.java

示例3: FriendSelector

import net.rim.device.api.ui.FieldChangeListener; //导入依赖的package包/类
FriendSelector(JSONObject Current, UiApplication app) {
	int direction = Display.DIRECTION_NORTH;
	Ui.getUiEngineInstance().setAcceptableDirections(direction);
	this.setTitle(" CrapSnap - Select Receiver...");
	Bitmap back = EncodedImage.getEncodedImageResource("Back.jpg")
			.getBitmap();
	this.setBackground(BackgroundFactory.createBitmapBackground(back));
	monApp = app;
	Send.setChangeListener(new FieldChangeListener() {
		public void fieldChanged(Field field, int context) {
			exitbol = false;
			if (CheckBox.getChecked() == true) {
				storybol = true;
			}
			quit();
		}
	});
	
	String[] names;
	try {
		JSONArray friends = Current.getJSONArray("friends");
		names  = new String[friends.length()];
		for (int i = 0; i < friends.length(); i++) {
			JSONObject friend = friends.getJSONObject(i);
			names[i] = friend.getString("name");
		}
		Comparator strComparator = new Comparator() {
		    public int compare(Object o1, Object o2) {
		        return o1.toString().compareTo(o2.toString());
		    }
		};
		Arrays.sort(names, strComparator);
		
		for (int i = 0; i < names.length; i++) {
			ListManager.add(new FriendSelectorObject(names[i]));
			ListManager.add(new SeparatorField());
		}
	} catch (JSONException e) {
		e.printStackTrace();
	}
	
	this.addMenuItem(AddMenuItem);
	this.addMenuItem(CancelMenuItem);
	BtnManager.add(Send);
	MainManager.add(ListManager);
	HorizontalFieldManager StoryManager = new  HorizontalFieldManager();
	CheckBox.setFont(CheckBox.getFont().derive(Font.BOLD, 9, Ui.UNITS_pt));
	StoryManager.add(new LabelField("  "));
	StoryManager.add(CheckBox);
	MainManager.add(StoryManager);
	MainManager.add(BtnManager);
	this.add(MainManager);
}
 
开发者ID:PropheteMath,项目名称:CrapSnap,代码行数:54,代码来源:FriendSelector.java

示例4: AddText

import net.rim.device.api.ui.FieldChangeListener; //导入依赖的package包/类
private void AddText(int X, int Y, String text) {
	Graphics gd = new Graphics(bmpd);
	final Graphics g = new Graphics(bmp);
	try {
		int i;
		String txt = new String("");
		if (text.equals("") == true) {
			Dialog d = new Dialog(Dialog.D_OK_CANCEL,
					"Enter a text to add :", Dialog.OK, null,
					Dialog.DEFAULT_CLOSE);
			inputField = new BasicEditField();
			inputField.setChangeListener(new FieldChangeListener() {
				public void fieldChanged(Field arg0, int arg1) {
					if (g.getFont().getAdvance(inputField.getText()) > Display
							.getWidth() - 20) {
						inputField
								.setMaxSize(inputField.getText().length());
					} else {
						inputField.setMaxSize(200);
					}
				}
			});
			d.add(inputField);
			i = d.doModal();
			txt = inputField.getText();
			caption = txt;
		} else {
			txt = text;
			i = Dialog.OK;
		}
		Y = Y - 10;
		X = (Display.getWidth() / 2) - ((g.getFont().getAdvance(txt)) / 2);
		if (i == Dialog.OK) {
			g.setColor(Color.BLACK);
			g.setGlobalAlpha(128);
			gd.setColor(Color.BLACK);
			gd.setGlobalAlpha(128);
			g.fillRect(0, Y - 4, Display.getWidth(), 45);
			gd.fillRect(0, Y - 4, Display.getWidth(), 45);
			gd.setColor(currentcolor);
			gd.setGlobalAlpha(255);
			g.setColor(currentcolor);
			g.setGlobalAlpha(255);
			g.drawText(txt, X, Y);
			gd.drawText(txt, X, Y);
			gd.drawBitmap(55, 5, 50, 50, _20img, 0, 0);
			gd.drawBitmap(0, Display.getHeight() - 100, 100, 100, _0img, 0,
					0);
			gd.drawBitmap(Display.getWidth() - 55, 5, 55, 50, _2img, 0, 0);
			if (_drawing == false) {
				gd.drawBitmap(5, 5, 50, 50, _10img, 0, 0);
			} else {
				gd.drawBitmap(5, 5, 50, 50, _11img, 0, 0);
			}
			gd.drawBitmap(Display.getWidth() - 100,
					Display.getHeight() - 100, 100, 100, _1img, 0, 0);
			actualize();
		}
	} catch (Exception E) {

	}
}
 
开发者ID:PropheteMath,项目名称:CrapSnap,代码行数:63,代码来源:EditSnap.java

示例5: RegisterScreen2

import net.rim.device.api.ui.FieldChangeListener; //导入依赖的package包/类
RegisterScreen2(UiApplication app, EncodedImage[] imgtab) {
	super(Manager.USE_ALL_WIDTH );
	this.setTitle("Registration (2/3)");
	int direction = Display.DIRECTION_NORTH;
	Ui.getUiEngineInstance().setAcceptableDirections(direction);
	_App = app;
	this.add(new LabelField("Select ALL images containing a ghost :"));

	VerticalFieldManager monManager = (VerticalFieldManager) getMainManager();
	Bitmap back = EncodedImage.getEncodedImageResource("yBack.jpg").getBitmap();
	monManager.setBackground(BackgroundFactory.createBitmapBackground(back));

	
	item0 = new item(imgtab[0]);
	item1 = new item(imgtab[1]);
	item2 = new item(imgtab[2]);
	item3 = new item(imgtab[3]);
	item4 = new item(imgtab[4]);
	item5 = new item(imgtab[5]);
	item6 = new item(imgtab[6]);
	item7 = new item(imgtab[7]);
	item8 = new item(imgtab[8]);

	this.add(new SeparatorField());
	this.add(item0);
	this.add(new SeparatorField());
	this.add(item1);
	this.add(new SeparatorField());
	this.add(item2);
	this.add(new SeparatorField());
	this.add(item3);
	this.add(new SeparatorField());
	this.add(item4);
	this.add(new SeparatorField());
	this.add(item5);
	this.add(new SeparatorField());
	this.add(item6);
	this.add(new SeparatorField());
	this.add(item7);
	this.add(new SeparatorField());
	this.add(item8);
	this.add(new SeparatorField());


	OkBtn.setChangeListener(new FieldChangeListener() {
		public void fieldChanged(Field field, int context) {
			_App.popScreen();
			returntouch = false;
			solution = "" + item0.IsChecked() + item1.IsChecked()
					+ item2.IsChecked() + item3.IsChecked()
					+ item4.IsChecked() + item5.IsChecked()
					+ item6.IsChecked() + item7.IsChecked()
					+ item8.IsChecked();
		}
	});
	this.add(OkBtn);

}
 
开发者ID:PropheteMath,项目名称:CrapSnap,代码行数:59,代码来源:RegisterScreen2.java


注:本文中的net.rim.device.api.ui.FieldChangeListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。