Java Doc for ImageItem.java in  » 6.0-JDK-Modules » j2me » javax » microedition » lcdui » 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.lcdui 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.microedition.lcdui.Item
      javax.microedition.lcdui.ImageItem

ImageItem
public class ImageItem extends Item (Code)
An item that can contain an image.

Each ImageItem object contains a reference to an Image object. This Image may be mutable or immutable. If the Image is mutable, the effect is as if snapshot of its contents is taken at the time the ImageItem is constructed with this Image and when setImage is called with an Image. The snapshot is used whenever the contents of the ImageItem are to be displayed. Even if the application subsequently draws into the Image, the snapshot is not modified until the next call to setImage. The snapshot is not updated when the container of the ImageItem becomes current or becomes visible on the display. (This is because the application does not have control over exactly when Displayables and Items appear and disappear from the display.)

The value null may be specified for the image contents of an ImageItem. If this occurs (and if the label is also null) the ImageItem will occupy no space on the screen.

ImageItem contains layout directives that were originally defined in MIDP 1.0. These layout directives have been moved to the Item class and now apply to all items. The declarations are left in ImageItem for source compatibility purposes.

The altText parameter specifies a string to be displayed in place of the image if the image exceeds the capacity of the display. The altText parameter may be null.


since:
   MIDP 1.0


Field Summary
 StringaltText
    
 intappearanceMode
    
 ImageItemLFimageItemLF
     The look&feel associated with this ImageItem.
 ImageimmutableImg
     The snapshot of the Image of this ImageItem; If the Image of this ImageItem was set to a mutable Image this variable is updated with a new snapshot each time setImage() is called.
 ImagemutableImg
     If the ImageItem was created with a mutable image or its Image was set to a mutable image, that mutable image is stored in the mutImg variable so that ImageItem.getImage() could return it.

Constructor Summary
public  ImageItem(String label, Image img, int layout, String altText)
     Creates a new ImageItem with the given label, image, layout directive, and alternate text string.
public  ImageItem(String label, Image image, int layout, String altText, int appearanceMode)
     Creates a new ImageItem object with the given label, image, layout directive, alternate text string, and appearance mode. Either label or alternative text may be present or null.

The appearanceMode parameter (see Appearance Modes) is a hint to the platform of the application's intended use for this ImageItem.


Method Summary
public  StringgetAltText()
     Gets the text string to be used if the image exceeds the device's capacity to display it.
public  intgetAppearanceMode()
     Returns the appearance mode of the ImageItem.
public  ImagegetImage()
     Gets the image contained within the ImageItem, or null if there is no contained image.
public  intgetLayout()
     Gets the layout directives used for placing the image.
public  voidsetAltText(String text)
     Sets the alternate text of the ImageItem, or null if no alternate text is provided.
public  voidsetImage(Image img)
     Sets the Image object contained within the ImageItem.
public  voidsetLayout(int layout)
     Sets the layout directives.

Field Detail
altText
String altText(Code)
The alternate text of this ImageItem



appearanceMode
int appearanceMode(Code)
The appearance hint



imageItemLF
ImageItemLF imageItemLF(Code)
The look&feel associated with this ImageItem. Set in the constructor. getLF() should return this instance.



immutableImg
Image immutableImg(Code)
The snapshot of the Image of this ImageItem; If the Image of this ImageItem was set to a mutable Image this variable is updated with a new snapshot each time setImage() is called.



mutableImg
Image mutableImg(Code)
If the ImageItem was created with a mutable image or its Image was set to a mutable image, that mutable image is stored in the mutImg variable so that ImageItem.getImage() could return it.




Constructor Detail
ImageItem
public ImageItem(String label, Image img, int layout, String altText)(Code)
Creates a new ImageItem with the given label, image, layout directive, and alternate text string. Calling this constructor is equivalent to calling

 ImageItem(label, image, layout, altText, PLAIN);     

Parameters:
  label - the label string
Parameters:
  img - the image, can be mutable or immutable
Parameters:
  layout - a combination of layout directives
Parameters:
  altText - the text that may be used in place of the image
throws:
  IllegalArgumentException - if the layout value is nota legal combination of directives
See Also:   ImageItem.ImageItem(String,Image,int,String,int)



ImageItem
public ImageItem(String label, Image image, int layout, String altText, int appearanceMode)(Code)
Creates a new ImageItem object with the given label, image, layout directive, alternate text string, and appearance mode. Either label or alternative text may be present or null.

The appearanceMode parameter (see Appearance Modes) is a hint to the platform of the application's intended use for this ImageItem. To provide hyperlink- or button-like behavior, the application should associate a default Command with this ImageItem and add an ItemCommandListener to this ImageItem.

Here is an example showing the use of an ImageItem as a button:


 ImageItem imgItem = 
 new ImageItem("Default: ", img,     
 Item.LAYOUT_CENTER, null,    
 Item.BUTTON);    
 imgItem.setDefaultCommand(
 new Command("Set", Command.ITEM, 1); 
 // icl is ItemCommandListener   
 imgItem.setItemCommandListener(icl);      

Parameters:
  label - the label string
Parameters:
  image - the image, can be mutable or immutable
Parameters:
  layout - a combination of layout directives
Parameters:
  altText - the text that may be used in place of the image
throws:
  IllegalArgumentException - if the layout value is nota legal combination of directives
Parameters:
  appearanceMode - the appearance mode of the ImageItem,one of ImageItem.PLAIN, ImageItem.HYPERLINK, or ImageItem.BUTTON
throws:
  IllegalArgumentException - if appearanceMode invalid





Method Detail
getAltText
public String getAltText()(Code)
Gets the text string to be used if the image exceeds the device's capacity to display it. the alternate text value, or null if none
See Also:   ImageItem.setAltText



getAppearanceMode
public int getAppearanceMode()(Code)
Returns the appearance mode of the ImageItem. See Appearance Modes. the appearance mode value,one of ImageItem.PLAIN, ImageItem.HYPERLINK, or ImageItem.BUTTON



getImage
public Image getImage()(Code)
Gets the image contained within the ImageItem, or null if there is no contained image. image used by the ImageItem
See Also:   ImageItem.setImage



getLayout
public int getLayout()(Code)
Gets the layout directives used for placing the image. a combination of layout directive values
See Also:   ImageItem.setLayout



setAltText
public void setAltText(String text)(Code)
Sets the alternate text of the ImageItem, or null if no alternate text is provided.
Parameters:
  text - the new alternate text
See Also:   ImageItem.getAltText



setImage
public void setImage(Image img)(Code)
Sets the Image object contained within the ImageItem. The image may be mutable or immutable. If img is null, the ImageItem is set to be empty. If img is mutable, the effect is as if a snapshot is taken of img's contents immediately prior to the call to setImage. This snapshot is used whenever the contents of the ImageItem are to be displayed. If img is already the Image of this ImageItem, the effect is as if a new snapshot of img's contents is taken. Thus, after painting into a mutable image contained by an ImageItem, the application can call

 imageItem.setImage(imageItem.getImage());       

to refresh the ImageItem's snapshot of its Image.

If the ImageItem is visible on the display when the snapshot is updated through a call to setImage, the display is updated with the new snapshot as soon as it is feasible for the implementation to so do.


Parameters:
  img - the Image for thisImageItem, or null if none
See Also:   ImageItem.getImage



setLayout
public void setLayout(int layout)(Code)
Sets the layout directives.
Parameters:
  layout - a combination of layout directive values
throws:
  IllegalArgumentException - if the value of layoutis not a validcombination of layout directives
See Also:   ImageItem.getLayout



Fields inherited from javax.microedition.lcdui.Item
final public static int BUTTON(Code)(Java Doc)
final public static int HYPERLINK(Code)(Java Doc)
final public static int LAYOUT_2(Code)(Java Doc)
final public static int LAYOUT_BOTTOM(Code)(Java Doc)
final public static int LAYOUT_CENTER(Code)(Java Doc)
final public static int LAYOUT_DEFAULT(Code)(Java Doc)
final public static int LAYOUT_EXPAND(Code)(Java Doc)
final public static int LAYOUT_LEFT(Code)(Java Doc)
final public static int LAYOUT_NEWLINE_AFTER(Code)(Java Doc)
final public static int LAYOUT_NEWLINE_BEFORE(Code)(Java Doc)
final public static int LAYOUT_RIGHT(Code)(Java Doc)
final public static int LAYOUT_SHRINK(Code)(Java Doc)
final public static int LAYOUT_TOP(Code)(Java Doc)
final public static int LAYOUT_VCENTER(Code)(Java Doc)
final public static int LAYOUT_VEXPAND(Code)(Java Doc)
final public static int LAYOUT_VSHRINK(Code)(Java Doc)
final public static int PLAIN(Code)(Java Doc)
final static int VALID_LAYOUT(Code)(Java Doc)
ItemCommandListener commandListener(Code)(Java Doc)
Command commands(Code)(Java Doc)
Command defaultCommand(Code)(Java Doc)
ItemLF itemLF(Code)(Java Doc)
String label(Code)(Java Doc)
int layout(Code)(Java Doc)
int lockedHeight(Code)(Java Doc)
int lockedWidth(Code)(Java Doc)
int numCommands(Code)(Java Doc)
Screen owner(Code)(Java Doc)
int userPreferredHeight(Code)(Java Doc)
int userPreferredWidth(Code)(Java Doc)

Methods inherited from javax.microedition.lcdui.Item
boolean acceptFocus()(Code)(Java Doc)
public void addCommand(Command cmd)(Code)(Java Doc)
ItemLF getLF()(Code)(Java Doc)
public String getLabel()(Code)(Java Doc)
public int getLayout()(Code)(Java Doc)
public int getMinimumHeight()(Code)(Java Doc)
public int getMinimumWidth()(Code)(Java Doc)
public int getPreferredHeight()(Code)(Java Doc)
public int getPreferredWidth()(Code)(Java Doc)
void itemDeleted()(Code)(Java Doc)
void lSetOwner(Screen owner)(Code)(Java Doc)
void lUpdateLockedSize()(Code)(Java Doc)
public void notifyStateChanged()(Code)(Java Doc)
public void removeCommand(Command cmd)(Code)(Java Doc)
void removeCommandImpl(Command cmd)(Code)(Java Doc)
public void setDefaultCommand(Command cmd)(Code)(Java Doc)
public void setItemCommandListener(ItemCommandListener l)(Code)(Java Doc)
public void setLabel(String label)(Code)(Java Doc)
public void setLayout(int layout)(Code)(Java Doc)
void setLayoutImpl(int layout)(Code)(Java Doc)
public void setPreferredSize(int width, int height)(Code)(Java Doc)

Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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