0% found this document useful (0 votes)
102 views26 pages

J2ME Display Class Flow Chart

This presentation summarizes the class hierarchy and functions of the Java ME Display class library. It includes diagrams of classes like Display, Displayable, MIDlet, Screen, Form, List, Canvas, Graphics, Font, Command, and their relationships. It also lists key functions for each class and objects used for data display. The last section describes command types, choice types, and constraints.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views26 pages

J2ME Display Class Flow Chart

This presentation summarizes the class hierarchy and functions of the Java ME Display class library. It includes diagrams of classes like Display, Displayable, MIDlet, Screen, Form, List, Canvas, Graphics, Font, Command, and their relationships. It also lists key functions for each class and objects used for data display. The last section describes command types, choice types, and constraints.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 26

J2ME Display Class

Flow Chart
Madhusudhan Reddy C
J2ME Display Class Flow Chart

This presentation is to illustrate the class hierarchy of


the Java Micro Edition(J2ME) Display Class library
structure. It has diagrams and explanations of the java
classes used to display an application and list the
functions of each class.
The Midlet class is included as it is needed for
application creation. There is also a list of objects that
define the type of data used in the display class. And
the format needed for JAR and JAD Manifest files,
with the basic MIDLet shell.
Display Class Heiarchy
Display Displayable
MIDlet
Import: MIDletStatechange-
javax.microedition.lcdui.Display Exception
Functions:
static Display getDisplay(MIDlet midlet)
Displayable getCurrent()
void setCurrent(Alert alert, Displayable displayable)
void setCurrent(Displayable displayable)
boolean isColor()
int numColors()
void callSerial(Runnable runnable)
Displayable Class
Displayable Screen extends displayable
Command
implements
Commandlistener
Import: Item
javax.microedition.lcdui.Displayable Canvas
Ticker
Functions: Graphics
void addCommand(Command command)
void removeCommand(Command command)
void setCommand(CommandListner commandlistner)
boolean isShown()
MIDlet Class
MIDlet
Import:
javax.microedition.midlet.MIDlet

Functions:
abstract void destroyApp(boolean unconditional)
abstract void pauseApp()
abstract void startApp()
final void notifyDestroyApp()
final void notifyPaused()
final void resumeRequest()
final String getAppProperty(String Key)
MIDletStatechange-Exception
Class
MIDletStatechange-Exception

Import:
javax.microedition.midlet.MIDletStatechange-Exception
Functions:
MIDletStateChangeException()
MIDletStatechangeException(String string)
Screen Class
Screen extends displayable Alert extends screen
Form extends screen
List extends screen implements
Import: Choice
javax.microedition.lcdui.Screen Textbox extends screen
Functions:
String getTitle()
void setTitle(String string)
Ticker getTicker()
void setTicker(Ticker ticker)
Alert Class
Alert extends screen
Functions: Import:
Alert(String title) javax.microedition.lcdui.Alert
Alert(String title, String message, Image image, AlertType alertType)
Image getImage()
void setImage(Image image)
String getString()
void setString(String str)
int getDefaultTimeout()
int getTimeout()
void setTimeout(int time)
void setType(AlertType alertType)
Form Class
Form extends screen
Functions: Import:
Form(String title) javax.microedition.lcdui.Form
Form(String title, Item[] items)
int append(Image image)
int append(Item item)
int append(String string)
void delete(int index)
void insert(int index, Item item)
void setItemStateListener(ItemStateListener itemStateListener)
int size()
String getLabel()
void setLabel(String label)
List Class
Form extends screen
Functions: Import:
List(String title, int listType)
javax.microedition.lcdui.List
List(String title, int listType, String[] stringElements, Image[] imageElements)
int append(String string, Image image)
void delete(int indexNum)
void insert(int indexNum, String string, Image image)
void set(int indexNum, String stringPart, Image imagePart)
boolean isSelected(int indexNum)
String getString(int indexNum)
Image setImage(int indexNum) int getSelected Index()
int getSelectedFlag(boolean[] selectedArray_return)
int size() void setSelectedFlags(boolean[] selectedArray)
void setSelectedIndex(int indexNum, boolean selected)
Textbox Class
Textbox
Import:
javax.microedition.lcdui.Textbox

Functions:
Textbox(String title, String text, int maxSize, int listType, int consraint)
void delete(int offset, int length) int getConstraints()

void delete(int indexNum) void setConstraints(int constraints)

void insert(String src, int position) int setMaxSize()

void insert(char[] data, int offset, int length) int getMaxSize(int maxSize)

void set(int indexNum, String stringPart, Image imagePart) int getCaretPosition()


int size()
int setChar(char[] data)
String getString()
Command Class
Command

Import:
javax.microedition.lcdui.Command
Functions:
Command(String label, int commandType, int priority)
int getCommandType()
String getLabel()
int getPriority()
Commandlistener Class
Commandlistener

Import:
javax.microedition.lcdui.Commandlistener
Functions:
void commandAction(Command command, Displayable displayable)
Item Class
Item ChoiceGroup extends Item
implements Choice
DateField extends Item
Import: TextField extends Item
javax.microedition.lcdui.Item Gauge extends Item
Functions: StringItem extends Item
String getLabel() ImageItem extends Item
void setLabel(String label)
Canvas Class
Canvas Graphics
Functions: Import:
int getWidth() int getHeight javax.microedition.lcdui.Canvas
Paint: abstract void paint(Graphics) final void repaint()
final void repaint(int x, int y, int width, int height) final void servicePaints() boolean
isDoubleBuffered()
Notify: void showNotify() void hideNotify()
Key and Game Action: void keyPressed(int keycode) void
keyReleased(int keycode) void keyRepeated(int keycode) boolean
hasRepeatEvents() String getKeyName(int keycode) int getKeyCode(int
gameAction Constant) int getGameAction(int keycode)
String getKeyname(int keycode)
Pointer Event: boolean hasPointerEvents() boolean
hasPointerMotionEvents() void pointerDragged(int x, int y) void pointerPressed(int x,
int y) void pointerReleased(int x, int y)
Graphics Class
Graphics Font Import:
Functions: javax.microedition.lcdui.Graphics

void setColor(int RGB) void setColor(int red, int green, int blue) int getColor()
int getBlueComponent() int getGreenComponent() int getRedComponent()
int setGrayScale(int value) int getGrayscale()
Stroke Style: int getStrokeStyle() void setStrokeStyle(int style)
Line: void drawLine(int x1, int y1, int x2, int y2)
Arc: void drawArc(int x1, int y1, int x2, int y2, startAngle, endAngle)
void fillArc(int x1, int y1, int x2, inty2, startAngle, endAngle)
Rectangle: void drawRect(int x1, int y1, int x2, int y2) void
drawroundRect(int x1, int y1, int x2, int y2, int arcW, int arcH) void fillRect(int
x1, int y1, int x2, int y2) void fillRoundedRect(int x1, int y1,
int x2, inty2, int arcW, int arcH)
Graphics Class cont.
Graphics Font Import:
Functions: javax.microedition.lcdui.Graphics

Text: void drawChar(char character, int x, int y, int anchor) void


drawChars(char[] data, int offset, int len, int x, int y, int anchor) void
drawString(String str, int x, int y, int anchor) void
drawSubstrings(String str, int offset, int len, int x, int y, int anchor) Font
getFont() void setFont(Font font)
Image: void drawImage(Image img, int x, inty, int anchor)
Translate: void translate(int x, int y) int getTranslateX() int getTranslateY()
Clip Region: void setClip(int x1, int y1, int x2, int y2) void clipRect(int
x1, int y1, int x2, int y2) int getClipX() int getClipY() int
getClipHeight() int getClipWidth()
Font Class
Font Import:
Functions: javax.microedition.lcdui.Font

static Font getFont(int face, int style, int size) static Font getDefaultfont()
Face, Style, Size: int get Face() int getStyle() int getSize() boolean isPlain()
boolean isBold() boolean isItalic() boolean isUnderlined()
Height/Width: int getHeight() int getBaselinePosition() int
charWidth(char ch) int charsWidth(char[] ch, int offset,
int length) int substring Width(String str, int offset, int length)
Command Type:
Parameter Options
BACK ITEM CANCEL OK EXIT
SCREEN HELP STOP
Choice Type: EXCLUSIVE (radio button) MULTIPLE (check box)
IMPLICIT (menu list)
Mode: DATE TIME DATE.TIME
Constraint Type: CONSTRAINT_MASK ANY EMAILADDR
NUMERIC PASSWORD PNONENUMBER URL
Value Type: LAYOUT_DEFAULT LAYOUT_LEFT LAYOUT_RIGHT
LAYOUT_CENTER LAYOUT_NEWLINE_BEFORE
LAYOUT_NEWLINE_AFTER
KeyCodes: KEY_NUM0(48) KEY_NUM1(49) KEY_NUM2(50)
KEY_NUM3(51) KEY_NUM4(52) KEY_NUM5(53) KEY_NUM6(54)
KEY_NUM7(55) KEY_NUM8(56) KEY_NUM9(57) KEY_STAR(42)
KEY_POUND(35)
GameAction: UP(1) DOWN(6) LEFT(2) RIGHT(5) FIRE(8)
GAME_A(9) GAME_B(10) GAME_C(11) GAME_D(12)
Font: Face.SYSTEM (0) Face.MONOSPACE (32) Face.PROPORTIONAL (64)
style.PLAIN (0) style.BOLD (1) style.ITALIC (2)
style.UNDERLINED (4) size.SMALL (8) size.MEDIUM (0) size.LARGE (16)
Text Anchor Point: LEFT RIGHT TOP BOTTOM HCENTER
BASELINE
Image Anchor Point: LEFT RIGHT TOP BOTTOM
HCENTER VCENTER
Data Type: java.lang.Boolean
Classes
java.lang.Byte
java.lang.Character java.lang.Interger java.lang.Long
java.lang.Short

Collection: java.util.Enumeration java.util.Stack


java.util.Hashtable java.util.Vector

Calendar and Time: java.util.Calendar java.util.Date


java.util.TimeZone

Input/Output: java.io.Reader java.io.Writer


java.io.PrintStream java.io.InputStream
java.io.OutputStream java.io.InputStreamReader
java.io.OutputStreamWriter java.io.DataInput
java.io.DataOutput java.io.DataInputStream
java.io.DataOuptputStream java.io.ByteArrayInputStream
java.io.ByteArrayOutputStream
Classes
Internationalization:
java.io.InputStreamReader java.io.OutputStreamWriter

Utility: java.lang.Math java.util.Random

Error: java.lang.Error java.lang.OutOfMemoryError


java.lang.VirtualMachineError

System: java.lang.Class java.lang.Object java.lang.Runnable


java.lang.Runtime java.lang.String java.lang.StringBuffer
java.lang.System java.lang.Thread java.lang.Throwable
Classes
Exception: java.io.EOFException java.io.IOException
java.io.UTFDataformatException java.io.InterruptedIOException
java.io.UnsupportedEncodingException
java.util.emptyStackException java.util.NoSuchElementException
java.lang.Exception java.lang.InterruptedException
java.lang.InstantiationException java.lang.ArithmeticException
java.lang.ArrayIndexOutOfBoundsException
java.lang.ArrayStoreException java.lang.ClassCastException
java.lang.ClassNotFoundException java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.IllegalMonitorStateException
java.lang.IllegalThreadStateException
java.lang.IndexOutOfBoundsException
java.lang.NegativeArraySizeException
java.lang.NullPointerException java.lang.NumberFormatException
java.lang.RuntimeException java.lang.SecurityException
java.lang.StringIndexOutOfBoundsException
JAR Manifest File
Java archive file:

MIDlet-Name:
MIDlet-Version:
MIDlet-Vendor:
MIDlet-n: Name, Icon, classname
MicroEdition-Profile: MIDP-1.0
MicroEdition-configuration:CLDC-1.0
MIDlet-Icon:
MIDlet-Description:
MIDlet-Info-URL: Location
JAD Manifest File
Java application descriptor file:

MIDlet-Name:
MIDlet-Version:
MIDlet-Vendor:
MIDlet-n: Name, Icon, classname
MIDlet-Jar-URL: Location
MIDlet-Jar-Size: Bytes
MIDlet-Data-Size: Byte persistents for storage
MIDlet-Description:
MIDlet-Delete-Confirm:
MIDlet-Install-Notify:
The Basic MIDlet shell
import java.io.*

public class YourbasicMidlet Shell extends MIDlet


{
public void start App()
{
}
public void pauseApp()
{
}
public void destroyApp()
{
}
}
J2ME

END

You might also like