PageRenderTime 47ms CodeModel.GetById 14ms app.highlight 27ms RepoModel.GetById 1ms app.codeStats 0ms

/GoFastApp/src/com/moogle/gofast/main/GoFastAppScreen.java

http://go-fast-web.googlecode.com/
Java | 572 lines | 293 code | 72 blank | 207 comment | 12 complexity | 3c44cfb46ad72c7db9745c54a6c81bab MD5 | raw file
  1package com.moogle.gofast.main;
  2
  3import javax.microedition.location.LocationProvider;
  4
  5import net.rim.device.api.browser.field2.BrowserField;
  6import net.rim.device.api.browser.field2.BrowserFieldConfig;
  7import net.rim.device.api.gps.BlackBerryCriteria;
  8import net.rim.device.api.gps.BlackBerryLocation;
  9import net.rim.device.api.gps.GPSInfo;
 10import net.rim.device.api.io.transport.ConnectionFactory;
 11import net.rim.device.api.io.transport.TransportInfo;
 12import net.rim.device.api.system.Bitmap;
 13import net.rim.device.api.system.Display;
 14import net.rim.device.api.system.GPRSInfo;
 15import net.rim.device.api.ui.Color;
 16import net.rim.device.api.ui.Field;
 17import net.rim.device.api.ui.FieldChangeListener;
 18import net.rim.device.api.ui.Font;
 19import net.rim.device.api.ui.FontFamily;
 20import net.rim.device.api.ui.Manager;
 21import net.rim.device.api.ui.ScrollChangeListener;
 22import net.rim.device.api.ui.UiApplication;
 23import net.rim.device.api.ui.XYEdges;
 24import net.rim.device.api.ui.XYRect;
 25import net.rim.device.api.ui.component.BitmapField;
 26import net.rim.device.api.ui.component.Dialog;
 27import net.rim.device.api.ui.component.LabelField;
 28import net.rim.device.api.ui.container.GridFieldManager;
 29import net.rim.device.api.ui.container.MainScreen;
 30import net.rim.device.api.ui.container.VerticalFieldManager;
 31import net.rim.device.api.ui.decor.BackgroundFactory;
 32import net.rim.device.api.ui.decor.Border;
 33import net.rim.device.api.ui.decor.BorderFactory;
 34
 35public class GoFastAppScreen extends MainScreen implements FieldChangeListener {
 36	/*
 37	 * private Runnable _popRunnable; private BrowserField myBrowserField;
 38	 */
 39	private BitmapField _banner;
 40	private BitmapField bt1;
 41	private BitmapField bt2;
 42	private BitmapField bt3;
 43	private BitmapField bt4;
 44	private BitmapField bt5;
 45
 46	private BitmapField bt6;
 47	private BitmapField bt7;
 48	private BitmapField bt8;
 49	private BitmapField bt9;
 50	private BitmapField bt10;
 51	private BitmapField bt11;
 52	private BitmapField bt12;
 53	private BitmapField bt13;
 54	private BitmapField bt14;
 55	private BitmapField bt15;
 56	private BitmapField bg;
 57	public VerticalFieldManager vfm;
 58	public BrowserFieldConfig bfc;
 59	public BrowserField myBrowserField;
 60	public LabelField labelname;
 61    public XYRect xyTool;
 62	ConnectionFactory cf;
 63	int[] preferredTransportTypes = { TransportInfo.TRANSPORT_BIS_B };
 64	private ScrollChangeListener paramScrollChangeListener;
 65	private int hiBanner=100;
 66
 67	public GoFastAppScreen() {
 68		// super(NO_VERTICAL_SCROLL);
 69		//http://maps.google.com/maps/geo?q=13.777901,100.807000&output=xml
 70		int dirction = Display.getOrientation();
 71		BlackBerryCriteria myCriteria = new BlackBerryCriteria();
 72		   if (GPSInfo.isGPSModeAvailable(GPSInfo.GPS_MODE_ASSIST)){
 73           	myCriteria.setMode(GPSInfo.GPS_MODE_ASSIST);
 74           	System.out.println("GPSInfo.GPS_MODE_ASSIST="+GPSInfo.GPS_MODE_ASSIST);
 75		   }
 76           else if (GPSInfo.isGPSModeAvailable(GPSInfo.GPS_MODE_AUTONOMOUS)){
 77           	myCriteria.setMode(GPSInfo.GPS_MODE_AUTONOMOUS);
 78           	System.out.println("GPSInfo.GPS_MODE_AUTONOMOUS="+GPSInfo.GPS_MODE_AUTONOMOUS);
 79           }
 80		//myCriteria.setCostAllowed(false);
 81		double lat = 0;
 82		 double log = 0;
 83		try
 84        {
 85            LocationProvider myProvider = LocationProvider.getInstance(myCriteria);
 86         
 87        //    Location location = myProvider.getLocation(3000);
 88            BlackBerryLocation myLocation =
 89                (BlackBerryLocation)myProvider.getLocation(300);
 90            	lat = myLocation.getQualifiedCoordinates().getLatitude();
 91            	log =myLocation.getQualifiedCoordinates().getLongitude();
 92            	System.out.println("myLocation.getAddressInfo();="+myLocation.getAddressInfo());
 93        }catch (Exception e) {
 94			// TODO: handle exception
 95        	System.out.println("Error ==========================="+e.getMessage());
 96		}
 97        System.out.println("Chatchai Debug="+lat);
 98		HeaderBar headerBar = new HeaderBar("Pomotion " + dirction);
 99		// h.showDate(false);
100		// h.showSignal(false);
101		// h.showTime(false);
102		headerBar.setBackgroundColour(0xCCE9FD);
103		headerBar.setBatteryBackground(0xEE1155);
104		headerBar.setFontColour(0x2233FF);
105		VerticalFieldManager vfmBanner = new VerticalFieldManager(USE_ALL_WIDTH);
106		//HorizontalFieldManager vfmBanner = new HorizontalFieldManager(USE_ALL_WIDTH);
107		GridFieldManager gridFieldManagerAoe = new GridFieldManager(2, 1,
108				Field.FIELD_HCENTER | Manager.USE_ALL_WIDTH | Manager.NO_HORIZONTAL_SCROLL
109			 | Manager.NO_VERTICAL_SCROLL);
110		//HorizontalFieldManager horizontalFieldManager = new HorizontalFieldManager(USE_ALL_WIDTH);
111		
112       // LabelField lfTitle = new LabelField("Promotions",USE_ALL_WIDTH );
113		 LabelField lfTitle = new LabelField("Ladprao",USE_ALL_WIDTH);
114        
115
116            try 
117            {
118                FontFamily typeface = FontFamily.forName("Tahoma, sans-serif");
119                Font myFont = typeface.getFont(Font.PLAIN, 30);
120                Font[] fonts = typeface.getFonts();
121                for(int i =0 ;i < fonts.length;i++){
122                	System.out.println("chatchai debug font="+fonts[i].toString());
123                }
124                lfTitle.setFont(myFont); 
125                
126            }
127            catch (ClassNotFoundException e) 
128            {
129               Dialog.inform(e.getMessage());
130            }
131        
132       // lfTitle.setBackground(BackgroundFactory.createSolidBackground(0xEE1155));
133            lfTitle.setBackground(BackgroundFactory.createSolidBackground(0xACB0B0));
134            
135		
136		// Define rows and columns
137		int rows = 1;
138		int cols = 4;
139
140		labelname = new LabelField("", FIELD_HCENTER);
141
142		// Instantiate a GridFieldManager with 1 rows and 5 columns
143		GridFieldManager gridFieldManager = new GridFieldManager(rows, cols,
144				Field.FIELD_HCENTER | Manager.USE_ALL_WIDTH | Manager.NO_HORIZONTAL_SCROLL
145			 | Manager.NO_VERTICAL_SCROLL);
146
147		Bitmap bgImage = Bitmap.getBitmapResource("img/bg.png");
148		 
149		bt1 = new MyBitmapField("bt1", Bitmap
150				.getBitmapResource("img/bb_5_08.jpg"),
151				BitmapField.FOCUSABLE);
152		bt1.setChangeListener(this);
153		bt2 = new MyBitmapField("bt2", Bitmap
154				.getBitmapResource("img/bb_5_13.jpg"),
155				BitmapField.FOCUSABLE);
156		bt2.setChangeListener(this);
157		bt3 = new MyBitmapField("bt3", Bitmap
158				.getBitmapResource("img/bb_5_more.jpg"),
159				BitmapField.FOCUSABLE);
160		bt3.setChangeListener(this);
161		 
162		bt4 = new MyBitmapField("bt4", Bitmap
163				.getBitmapResource("img/bb_5_setting.jpg"),
164				BitmapField.FOCUSABLE);
165		 
166		bt4.setChangeListener(this);
167	 bt5 = new MyBitmapField("bt5", Bitmap
168				.getBitmapResource("img/icon_bb5.jpg"),
169				BitmapField.FOCUSABLE);
170		bt5.setChangeListener(this);
171		/*
172		 * ic_newsfeed_titlebar.png ic_notifications_titlebar.png
173		 * ic_photo_comment.png ic_search_text.png
174		 */
175
176		bt6 = new MyBitmapField("bt1", Bitmap
177				.getBitmapResource("img/icon_bb6.jpg"),
178				BitmapField.FOCUSABLE);
179		bt6.setChangeListener(this);
180		bt7 = new MyBitmapField("bt2", Bitmap
181				.getBitmapResource("img/sport.png"),
182				BitmapField.FOCUSABLE);
183		bt7.setChangeListener(this);
184		/*bt8 = new MyBitmapField("bt3", Bitmap
185				.getBitmapResource("img/ic_pick_album.png"),
186				BitmapField.FOCUSABLE);
187		bt8.setChangeListener(this);
188		bt9 = new MyBitmapField("bt4", Bitmap
189				.getBitmapResource("img/ic_profile_titlebar.png"),
190				BitmapField.FOCUSABLE);
191		bt9.setChangeListener(this);
192		 bt10 = new MyBitmapField("bt5", Bitmap
193				  .getBitmapResource("img/icon5.gif"), BitmapField.FOCUSABLE);
194				   bt10.setChangeListener(this);*/
195				   
196		/*
197		 * bt10 = new MyBitmapField("bt5", Bitmap
198		 * .getBitmapResource("img/icon5.gif"), BitmapField.FOCUSABLE);
199		 * bt10.setChangeListener(this);
200		 * 
201		 * bt11 = new MyBitmapField("bt1", Bitmap
202		 * .getBitmapResource("img/message.gif"), BitmapField.FOCUSABLE);
203		 * bt11.setChangeListener(this); bt12 = new MyBitmapField("bt2", Bitmap
204		 * .getBitmapResource("img/icon2.gif"), BitmapField.FOCUSABLE);
205		 * bt12.setChangeListener(this); bt13 = new MyBitmapField("bt3", Bitmap
206		 * .getBitmapResource("img/icon3.gif"), BitmapField.FOCUSABLE);
207		 * bt13.setChangeListener(this); bt14 = new MyBitmapField("bt4", Bitmap
208		 * .getBitmapResource("img/icon4.gif"), BitmapField.FOCUSABLE);
209		 * bt14.setChangeListener(this); bt15 = new MyBitmapField("bt5", Bitmap
210		 * .getBitmapResource("img/icon5.gif"), BitmapField.FOCUSABLE);
211		 * bt15.setChangeListener(this);
212		 */
213
214		gridFieldManager.setChangeListener(this);
215		//gridFieldManager.setBackground(BackgroundFactory.createBitmapBackground(bgImage));
216		gridFieldManager.setBackground(BackgroundFactory.createSolidBackground(0x000000));
217		gridFieldManager.setCellPadding(1);
218		gridFieldManager.setColumnPadding(50);
219		XYEdges padding = new XYEdges(15, 15, 15, 15);
220		int color = Color.CRIMSON;
221		int lineStyle = Border.STYLE_DOTTED;
222		Border roundedBorder = BorderFactory.createRoundedBorder(padding, 
223		     color, lineStyle);
224		//roundedBorderEdit.setBorder(roundedBorder);
225		//Border border = new Border(new net.rim.device.api.ui.XYEdges(),Border.STYLE_SOLID);
226	 	gridFieldManager.setBorder(roundedBorder);
227		//gridFieldManager.setHorizontalScroll(Field.FIELD_VCENTER);
228	 	
229		// Add button fields to the GridFieldManager
230		gridFieldManager.add(bt1);
231		gridFieldManager.add(bt2);
232		gridFieldManager.add(bt3);
233		gridFieldManager.add(bt4);
234		//setPositionChild(bt7, 0, 0);
235		/*gridFieldManager.add(bt5);
236
237		gridFieldManager.add(bt6);*/
238/*
239		gridFieldManager.add(bt7);
240		gridFieldManager.add(bt8);*/
241		/*gridFieldManager.add(bt8);
242		gridFieldManager.add(bt9);*/
243		
244	/*	gridFieldManager.add(bt8);
245		gridFieldManager.add(bt9);*/
246		//gridFieldManager.add(bt10);
247
248		/*
249		 * gridFieldManager.add(bt11); gridFieldManager.add(bt12);
250		 * gridFieldManager.add(bt13); gridFieldManager.add(bt14);
251		 * gridFieldManager.add(bt15);
252		 */
253
254		vfm = new VerticalFieldManager(USE_ALL_WIDTH);
255		vfm.setChangeListener(this);
256		
257		 //vfm.setBackground(BackgroundFactory.createBitmapBackground(bgImage));
258		vfm.setBackground(BackgroundFactory.createSolidBackground(0xD8D8D8));
259		//setBackground(BackgroundFactory.createSolidBackground(0xD8D8D8));
260		//gridFieldManager.setBackground();
261		//gridFieldManager.setColumnProperty(0, GridFieldManager.FIXED_SIZE, 478);
262		GridFieldManager gridFieldManager2 = new GridFieldManager(rows, cols,
263				Field.FIELD_HCENTER | Manager.USE_ALL_WIDTH | Manager.NO_HORIZONTAL_SCROLL
264			 | Manager.NO_VERTICAL_SCROLL);
265		LayoutManager layoutManager = new LayoutManager();
266		/*CenteredFieldManager center = new CenteredFieldManager(USE_ALL_WIDTH);
267		center.add(lfTitle);*/
268		//center.add(bt9);
269	/*	gridFieldManager2.setCellPadding(1);
270		gridFieldManager2.setColumnPadding(60);*/
271	/*	gridFieldManager2.add(bt5,Field.FIELD_LEFT);
272		gridFieldManager2.add(lfTitle,FIELD_HCENTER|Field.FIELD_VCENTER);
273		gridFieldManager2.add(bt7,FIELD_RIGHT);*/
274		/*gridFieldManager2.add(bt5,0);
275		gridFieldManager2.add(lfTitle,1);
276		gridFieldManager2.add(bt7,2);*/
277		layoutManager.add(bt5);
278	//	layoutManager.add(lfTitle);
279		layoutManager.add(bt7);
280		 
281	//	gridFieldManager2.add(center);
282		//gridFieldManager2.add(bt10);
283		//horizontalFieldManager.add(center);
284		 
285		//horizontalFieldManager.add(bt9); 
286		//vfmBanner.add(lfTitle);
287		gridFieldManager2.setBorder(roundedBorder);
288		vfmBanner.add(layoutManager);
289		vfmBanner.add(gridFieldManager);
290		/*gridFieldManagerAoe.add(gridFieldManager2);
291		gridFieldManagerAoe.add(gridFieldManager);*/
292		//horizontalFieldManager.add(lfTitle);
293		setBanner(vfmBanner);
294		//setBanner(gridFieldManagerAoe);
295		
296		//setTitle("--------------------------");
297		setScrollListener(paramScrollChangeListener);
298		//setBackground(BackgroundFactory.createSolidBackground(0xD8D8D8));
299		//vfm.add(gridFieldManager);
300		// vfm.add(labelname);
301		// add(vfm);
302		cf = new ConnectionFactory();
303		cf.setPreferredTransportTypes(preferredTransportTypes);
304	
305		bfc = new BrowserFieldConfig();
306		bfc.setProperty(BrowserFieldConfig.ALLOW_CS_XHR, Boolean.TRUE);
307		//bfc.setProperty(BrowserFieldConfig.ALLOW_CS_XHR, Boolean.TRUE);
308		//  bfc.setProperty(BrowserFieldConfig.ENABLE_GEARS, Boolean.TRUE);
309		 //Default = Set by rendering engine contentType="text/html; charset=utf-8"
310		//bfc.setProperty(BrowserFieldConfig.HTTP_HEADERS, "Content-Type=text/html;charset=utf-8");    
311		bfc.setProperty(BrowserFieldConfig.JAVASCRIPT_ENABLED, Boolean.TRUE);
312		bfc.setProperty(BrowserFieldConfig.USER_SCALABLE, Boolean.FALSE);
313		  
314		  bfc.setProperty(BrowserFieldConfig.MDS_TRANSCODING_ENABLED,Boolean.FALSE);
315		// Boolean.FALSE);
316		 bfc.setProperty(BrowserFieldConfig.NAVIGATION_MODE,
317		  BrowserFieldConfig.NAVIGATION_MODE_POINTER);
318		/*bfc.setProperty(BrowserFieldConfig.NAVIGATION_MODE,
319				BrowserFieldConfig.NAVIGATION_MODE_CARET);*/
320		bfc.setProperty(BrowserFieldConfig.VIEWPORT_WIDTH, new Integer(Display.getWidth()));
321		// bfc.setProperty(BrowserFieldConfig.CONNECTION_FACTORY, cf);
322
323		// myBrowserField= new BrowserField();
324		myBrowserField = new BrowserField(bfc);
325		/*
326		 * BrowserField myBrowserField = new BrowserField();
327		 * myBrowserField.requestContent
328		 * ("http://localhost:8080/GoFastServtlet/listitems");
329		 * //myBrowserField.requestContent
330		 * ("http://localhost:8080/GoFastServtlet/index.html");
331		 * //myBrowserField.requestContent("http://mooglefast.appspot.com");
332		 * vfm.add(myBrowserField);
333		 */
334		// add(myBrowserField);
335		add(vfm);
336	//	setBackground(BackgroundFactory.createSolidBackground(0x000000));
337		/*myBrowserField
338				.requestContent("http://192.168.1.11:8080/GoFastServtlet/listitems");//("http://css-tricks.com/examples/MovingBoxes/");
339*/
340		 //myBrowserField.requestContent("http://localhost:8080/GoFastServtlet/listitems?page=items&brand=bb&direction=1");
341		 myBrowserField.requestContent("http://localhost:8080/GoFastServtlet/listitems?brand=bb&direction=1");
342
343		vfm.add(myBrowserField);
344		/*
345		 * _popRunnable = new Runnable() { public void run() { popScreen(null);
346		 * } };
347		 */
348		/*
349		 * (new Thread() { public void run() { BrowserField myBrowserField = new
350		 * BrowserField(); add(myBrowserField);
351		 * //myBrowserField.requestContent("http://www.blackberry.com");
352		 * HttpConnection c = null; InputStream is = null; int rc; try { c =
353		 * (HttpConnection
354		 * )Connector.open("http://localhost:8080/GoFastServtlet/listitems");
355		 * 
356		 * // Getting the response code will open the connection, // send the
357		 * request, and read the HTTP response headers. // The headers are
358		 * stored until requested. rc = c.getResponseCode();
359		 * System.out.println("[ aoe debug ] HTTP response1 code: " + rc); if
360		 * (rc != HttpConnection.HTTP_OK) {
361		 * 
362		 * System.out.println("[ aoe debug ] HTTP response2 code: " + rc);
363		 * 
364		 * myBrowserField.displayContent(c,
365		 * "http://localhost:8080/GoFastServtlet/listitems"); //throw new
366		 * IOException("HTTP response code: " + rc);
367		 * 
368		 * }
369		 * 
370		 * // is = c.openInputStream();
371		 * 
372		 * }catch (Exception e) { // TODO: handle exception }
373		 * //myBrowserField.requestContent
374		 * ("http://localhost:8080/GoFastServtlet/listitems"); } }).start();
375		 */
376
377	}
378
379	/*
380	 * protected boolean navigationUnclick(int status, int time) { // TODO
381	 * Auto-generated method stub
382	 * System.out.println("chatchai debug unclick status="+status); return
383	 * super.navigationUnclick(status, time); } protected boolean
384	 * navigationClick(int status, int time) { // TODO Auto-generated method
385	 * stub System.out.println("chatchai debug click status="+status); return
386	 * super.navigationClick(status, time); }
387	 */
388	/*
389	 * public void fieldChanged(Field field, int context) { // TODO
390	 * Auto-generated method stub if(field == bt1) {
391	 * System.out.println("Touched START..."); }
392	 * 
393	 * }
394	 */
395	public void fieldChanged(Field field, int context) {
396		// TODO Auto-generated method stub
397		System.out.println(" xxxxxxxxxxxxxxxxxx " + field);
398
399	}
400
401	class MyparamScrollChangeListener implements ScrollChangeListener {
402
403		public void scrollChanged(Manager paramManager, int paramInt1,
404				int paramInt2) {
405			// TODO Auto-generated method stub
406			
407		}
408		
409		
410	}
411	
412	class MyBitmapField extends BitmapField {
413		public MyBitmapField(String name, Bitmap bitmapField, long syte) {
414			super(bitmapField, syte);
415			this.name = name;
416			
417		}
418
419		private String name;
420
421		public String getName() {
422			return name;
423		}
424
425		public void setName(String name) {
426			this.name = name;
427		}
428
429		protected boolean navigationClick(int arg0, int arg1) {
430			// TODO Auto-generated method stub
431			System.out.println(" click on " + this.name);
432			System.out.println("imei="+GPRSInfo.imeiToString(GPRSInfo.getIMEI(), false));
433			System.out.println("phone number="+net.rim.blackberry.api.phone.Phone.getDevicePhoneNumber(false));
434			// myBrowserField.requestContent("http://localhost:8080/GoFastServtlet/listitems");
435			// myBrowserField.requestContent("http://localhost:8080/GoFastServtlet/index.html");
436			/*
437			 * myBrowserField
438			 * .requestContent("http://mooglefast.appspot.com/listitems");
439			 */
440			// myBrowserField.deleteAll();
441			// vfm.delete(myBrowserField);
442			BrowserField myBrowserField2 = new BrowserField(bfc);
443			// myBrowserField2.setFocus();
444			myBrowserField2.requestContent("http://localhost:8080/GoFastServtlet/listitems?brand=bb&direction=1");
445			//myBrowserField2.requestContent("http://localhost:8080/GoFastServtlet/listitems?page=items&brand=bb&direction=1");
446			// myBrowserField.direquestContent("http://mooglefast.appspot.com/listitems");
447			// vfm.delete(field)
448			/*
449			 * vfm.add(myBrowserField); synchronized (vfm) { add(vfm); }
450			 */
451
452			return super.navigationClick(arg0, arg1);
453		}
454		 MyTooltip _tooltip;
455		
456		public void onFocus(int direction) {
457			
458			
459			labelname.setText(this.name);
460			
461			
462			//this.setBorder(BorderFactory.createRoundedBorder(null));
463			if ( _tooltip != null ) {
464	            _tooltip.removeToolTip();
465	            _tooltip = null;
466	        }
467	        // Display tooltip at 50,50 for 5 seconds
468	        _tooltip = MyTooltip.addToolTip(UiApplication.getUiApplication(), this.name,this.getContentLeft(), hiBanner, 5);;
469	    
470		}
471
472		protected void onUnfocus() {
473			labelname.setText("");
474			 if ( _tooltip != null ) {
475		            // We have displayed a Tooltip - remove it
476		            _tooltip.removeToolTip();
477		            _tooltip = null;
478		        }
479		}
480		
481		
482		 
483
484	}
485	     class CenteredFieldManager extends Manager {  
486		      
487		       
488		         protected CenteredFieldManager(long style)
489		         {
490		        	 super(style);
491		        }
492			// TODO Auto-generated constructor stub}
493
494				protected void sublayout(int width, int height) {  
495		            if (getFieldCount() > 0) {  
496		                Field centeredField = getField(0);  // get the first (and only) field  
497		                layoutChild(centeredField, width, height); // set the field's width and height  
498		                setPositionChild(centeredField, (width-centeredField.getWidth())/2, 0);  // center the field horizontally  
499		               setExtent(width, centeredField.getHeight());  // set the size of this manager to use the entire screen width  
500		           }  
501		       }  
502		   }  
503	     
504	     class LayoutManager extends Manager 
505	     {
506
507	       public LayoutManager() 
508	       { 
509	         //construct a manager with vertical scrolling    
510	         super(VERTICAL_SCROLL);
511	       }
512
513	       //overwrite the nextFocus method for custom navigation  
514	       protected int nextFocus(int direction, boolean alt)  
515	       {
516	             return super.nextFocus(direction, alt);
517	       }
518
519	       protected void sublayout(int width, int height) 
520	       {
521	         Field field;
522	         //get total number of fields within this manager
523	         int numberOfFields = getFieldCount();     
524	         int x = 0;
525	         int y = 0;
526	         System.out.println("******** Fields: " + numberOfFields + " W/H: " + width + " / " + height );
527	         /*
528	          * ******** Fields: 3 W/H: 480 / 360
529******** X/Y: 20 / 80
530******** X/Y: 20 / 80
531******** X/Y: 20 / 80
532	          */
533	         for(int i = 0;i < numberOfFields;i++) {
534	           field = getField(i);      //get the field
535	           x = 20;
536	           y = 80;
537	           System.out.println("******** X/Y: " + x + " / " + y);
538	           if(i==0){
539	        	   setPositionChild(field, 19, 19);  //set the position for the field
540		           layoutChild(field, width, 80);  //lay out the field
541	           }else{
542	        	   /*setPositionChild(field, x, y);  //set the position for the field
543		           layoutChild(field, width, y);  //lay out the field
544		           */
545	        	   setPositionChild(field, 420, 19);  //set the position for the field
546		           layoutChild(field, width, 80);  //lay out the field
547             }
548	           
549	         }
550	         setPosition(0, 80);
551	         setExtent(width, 80);
552
553	       }
554
555	       public int getPreferredWidth() 
556	       {
557	        return 160;
558	       }
559
560	       public int getPreferredHeight() 
561	       {
562	         int height= 0;
563	         int numberOfFields= getFieldCount();
564
565	         for(int i= 0; i < numberOfFields; i++) 
566	         {
567	             height += getField(i).getPreferredHeight();
568	         }
569	         return 160;
570	       }
571	     }
572}