|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.microedition.lcdui.Displayable
javax.microedition.lcdui.Canvas
org.netbeans.microedition.lcdui.wma.SMSComposer
public class SMSComposer
The SMSComposer
provides an easy and convenient way to send SMS messages
directly from JavaME application.
Field Summary | |
---|---|
static javax.microedition.lcdui.Command |
SEND_COMMAND
Command fired when SMS sent. |
Fields inherited from class javax.microedition.lcdui.Canvas |
---|
DOWN, FIRE, GAME_A, GAME_B, GAME_C, GAME_D, KEY_NUM0, KEY_NUM1, KEY_NUM2, KEY_NUM3, KEY_NUM4, KEY_NUM5, KEY_NUM6, KEY_NUM7, KEY_NUM8, KEY_NUM9, KEY_POUND, KEY_STAR, LEFT, RIGHT, UP |
Constructor Summary | |
---|---|
SMSComposer(javax.microedition.lcdui.Display display)
Creates a new instance of SMSComposer for given Display object. |
Method Summary | |
---|---|
void |
commandAction(javax.microedition.lcdui.Command c,
javax.microedition.lcdui.Displayable d)
Indicates that a command event has occurred on Displayable d. |
org.netbeans.microedition.lcdui.laf.ColorSchema |
getColorSchema()
Returnd component's color schema. |
javax.microedition.lcdui.CommandListener |
getCommandListener()
Returns component's command listener. |
protected void |
keyPressed(int keyCode)
Called when a key is pressed. |
protected void |
keyReleased(int keyCode)
Called when a key is released. |
protected void |
paint(javax.microedition.lcdui.Graphics graphics)
Paints this canvas. |
void |
sendSMS()
Sends the message based on given non null phone number and port number. |
void |
setBGColor(int color)
Sets component's background color. |
void |
setCommandListener(javax.microedition.lcdui.CommandListener listener)
Sets component's command listener. |
void |
setDefaulBorderStyles()
Sets Default border styles. |
void |
setDefaultFonts()
Sets Default fonts. |
void |
setFGColor(int color)
Sets component's foreground color. |
void |
setMessage(java.lang.String message)
Sets the message text. |
void |
setMessageLabel(java.lang.String messageLabel)
Sets the message text label. |
void |
setPhoneNumber(java.lang.String phoneNumber)
Sets the phone number. |
void |
setPhoneNumberLabel(java.lang.String phoneNumberLabel)
Sets the phone number label. |
void |
setPort(int portNum)
Sets the port number |
void |
setSendAutomatically(boolean sendAutomatically)
Controlls execution of sendSMS method. |
protected void |
showNotify()
The implementation calls showNotify() immediately prior to this Canvas
being made visible on the display. |
protected void |
sizeChanged(int w,
int h)
Called when the drawable area of the Canvas has been changed. |
Methods inherited from class javax.microedition.lcdui.Canvas |
---|
getGameAction, getKeyCode, getKeyName, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, hideNotify, isDoubleBuffered, keyRepeated, pointerDragged, pointerPressed, pointerReleased, repaint, repaint, serviceRepaints, setFullScreenMode |
Methods inherited from class javax.microedition.lcdui.Displayable |
---|
addCommand, getHeight, getTicker, getTitle, getWidth, isShown, removeCommand, setTicker, setTitle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static javax.microedition.lcdui.Command SEND_COMMAND
Constructor Detail |
---|
public SMSComposer(javax.microedition.lcdui.Display display)
Display
object.
display
- A non-null display object.Method Detail |
---|
public void setPhoneNumber(java.lang.String phoneNumber)
phoneNumber
- phone numberpublic void setPhoneNumberLabel(java.lang.String phoneNumberLabel)
phoneNumberLabel
- phone number labelpublic void setMessage(java.lang.String message)
message
- message textpublic void setMessageLabel(java.lang.String messageLabel)
messageLabel
- message text labelpublic void setPort(int portNum)
portNum
- port numberpublic void setSendAutomatically(boolean sendAutomatically)
sendSMS
is
invoked when command Send pressed. If sendAutomaticly is Boolean.FALSE then sendSMS
method is not invoked after Send command is pressed.
sendAutomatically
- Boolean.TRUE sendSMS method is executed, Boolean.FALSE sendSMS method is NOT executedpublic void sendSMS() throws java.io.IOException
java.io.IOException
- if the message could not be sent or because
of network failure or if the connection is not availablepublic void setDefaulBorderStyles()
public void setDefaultFonts()
protected void showNotify()
Canvas
being made visible on the display. Canvas
subclasses may override this method
to perform tasks before being shown, such as setting up animations, starting
timers, etc.
showNotify
in class javax.microedition.lcdui.Canvas
protected void sizeChanged(int w, int h)
Canvas
has been changed. This method
has augmented semantics compared to Displayable.sizeChanged.
In addition to the causes listed in Displayable.sizeChanged, a size
change can occur on a Canvas
because of a change between normal and full-screen modes.
If the size of a Canvas
changes while it is actually visible on the display,
it may trigger an automatic repaint request. If this occurs, the call to size Changed will
occur prior to the call to paint. If the Canvas
has become smaller, the
implementation may choose not to trigger a repaint request if the remaining
contents of the Canvas
have been preserved. Similarly, if the Canvas
has become
larger, the implementation may choose to trigger a repaint only for the new region.
In both cases, the preserved contents must remain stationary with respect to the origin
of the Canvas
. If the size change is significant to the contents of the Canvas
,
the application must explicitly issue a repaint request for the changed areas.
Note that the application's repaint request should not cause multiple repaints,
since it can be coalesced with repaint requests that are already pending.
If the size of a Canvas
changes while it is not visible, the implementation
may choose to delay calls to sizeChanged until immediately prior to the call
to showNotify. In that case, there will be only one call to sizeChanged,
regardless of the number of size changes.
An application that is sensitive to size changes can update instance
variables in its implementation of sizeChanged. These updated values
will be available to the code in the showNotify, hideNotify, and paint methods.
sizeChanged
in class javax.microedition.lcdui.Canvas
w
- the new width in pixels of the drawable area of the Canvas
h
- the new height in pixels of the drawable area of the Canvas
public org.netbeans.microedition.lcdui.laf.ColorSchema getColorSchema()
protected void paint(javax.microedition.lcdui.Graphics graphics)
paint
in class javax.microedition.lcdui.Canvas
graphics
- the Graphic
object to be used for rendering the Canvas
protected void keyReleased(int keyCode)
keyReleased
in class javax.microedition.lcdui.Canvas
keyCode
- the key code of the key that was releasedprotected void keyPressed(int keyCode)
keyPressed
in class javax.microedition.lcdui.Canvas
keyCode
- the key code of the key that was pressedpublic void setCommandListener(javax.microedition.lcdui.CommandListener listener)
setCommandListener
in class javax.microedition.lcdui.Displayable
listener
- CommandListenerpublic javax.microedition.lcdui.CommandListener getCommandListener()
public void setBGColor(int color)
color
- background colorpublic void setFGColor(int color)
color
- foreground colorpublic void commandAction(javax.microedition.lcdui.Command c, javax.microedition.lcdui.Displayable d)
commandAction
in interface javax.microedition.lcdui.CommandListener
c
- a Command object identifying the command. This is either
one of the applications have been added to Displayable with addCommand(Command)
or is the implicit SELECT_COMMAND of List.d
- the Displayable on which this event has occurred
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |