Java Doc for GUIControl.java in  » 6.0-JDK-Modules » j2me » javax » microedition » media » control » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » javax.microedition.media.control 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.microedition.media.control.GUIControl

GUIControl
public interface GUIControl extends javax.microedition.media.Control(Code)
GUIControl extends Control and is defined for controls that provide GUI functionalities.

Controls that support a GUI component should implement this interface.



Field Summary
 intUSE_GUI_PRIMITIVE
     This defines a mode on how the GUI is displayed. It is used in conjunction with initDisplayMode.

When USE_GUI_PRIMITIVE is specified for initDisplayMode, a GUI primitive will be returned.



Method Summary
 ObjectinitDisplayMode(int mode, Object arg)
     Initialize the mode on how the GUI is displayed.
Parameters:
  mode - The mode that determines how the GUI isdisplayed.

Field Detail
USE_GUI_PRIMITIVE
int USE_GUI_PRIMITIVE(Code)
This defines a mode on how the GUI is displayed. It is used in conjunction with initDisplayMode.

When USE_GUI_PRIMITIVE is specified for initDisplayMode, a GUI primitive will be returned. This object is where the GUI of this control will be displayed. It can be used in conjunction with other GUI objects, and conforms to the GUI behaviors as specified by the platform.

For a given platform, the object returned must implement or extend from the appropriate GUI primitive of the platform. For platforms that support only AWT such as some CDC implementations, the object must extend from java.awt.Component; for MIDP implementations with only LCDUI support, it must extend from javax.microedition.lcdui.Item.

In these cases, the arg argument must be null or a String that specifies the fully-qualified classname of the GUI primitive.

On some platforms that support multiple types of GUI primitives, the arg argument must be used to arbitrate among the options. The arg argument must be a String that specifies the fully-qualified classname of the GUI primitive to be returned by the method.

For example, a platform that supports both AWT and LCDUI must use either "java.awt.Component" or "javax.microedition.lcdui.Item" as the arg argument. The object returned will be of either type according to what's specified.

Here are some sample usage scenarios:

For CDC implementations with only AWT support:

 
 try {
 Player p = Manager.createPlayer("http://abc.mpg");
 p.realize();
 GUIControl gc;
 if ((gc = (GUIControl)p.getControl("GUIControl")) != null)
 add((Component)gc.initDisplayMode(GUIControl.USE_GUI_PRIMITIVE, null));
 p.start();
 } catch (MediaException pe) {
 } catch (IOException ioe) {
 }
 
 

For MIDP implementations with only LCDUI support:

 
 try {
 Player p = Manager.createPlayer("http://abc.mpg");
 p.realize();
 GUIControl gc;
 if ((gc = (GUIControl)p.getControl("GUIControl")) != null) {
 Form form = new Form("My GUI");
 form.append((Item)gc.initDisplayMode(GUIControl.USE_GUI_PRIMITIVE, null));
 Display.getDisplay().setCurrent(form);
 }
 p.start();
 } catch (MediaException pe) {
 } catch (IOException ioe) {
 }
 
 

For implementations with both AWT and LCDUI support:

 
 try {
 Player p = Manager.createPlayer("http://abc.mpg");
 p.realize();
 GUIControl gc;
 if ((gc = (GUIControl)p.getControl("GUIControl")) != null)
 add((Component)gc.initDisplayMode(GUIControl.USE_GUI_PRIMITIVE,
 "java.awt.Component");
 p.start();
 } catch (MediaException pe) {
 } catch (IOException ioe) {
 }
 
 

Value 0 is assigned to USE_GUI_PRIMITIVE.






Method Detail
initDisplayMode
Object initDisplayMode(int mode, Object arg)(Code)
Initialize the mode on how the GUI is displayed.
Parameters:
  mode - The mode that determines how the GUI isdisplayed. GUIControl defines onlyone mode:USE_GUI_PRIMITIVE.Subclasses of this may introduce more modes.
Parameters:
  arg - The exact semantics of this argument isspecified in the respective mode definitions. The exact semantics and type of the object returnedare specified in the respective mode definitions.
exception:
  IllegalStateException - Thrown if initDisplayMode is called again after it has previously been called successfully.
exception:
  IllegalArgumentException - Thrown ifthe mode or arg argument is invalid. mode must bedefined by GUIControl or its subclasses; or a custom modesupported by this implementation.arg must conform to the constraints defined by the respective mode definitions.Refer to the mode definitions for the required typeof arg.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.