com.objectxp.msg.smart
Class PictureMessage

java.lang.Object
  extended bycom.objectxp.msg.Message
      extended bycom.objectxp.msg.SmsMessage
          extended bycom.objectxp.msg.smart.SmartMessage
              extended bycom.objectxp.msg.smart.ImageMessage
                  extended bycom.objectxp.msg.smart.PictureMessage
All Implemented Interfaces:
java.lang.Cloneable, MultiPartMessage, java.io.Serializable

public class PictureMessage
extends com.objectxp.msg.smart.ImageMessage

This class represents a PictureMessage for SmartMessaging enabled phones.

Example:

 ...
 SmsService service = new GsmSmsService();
 ...
 PictureMessage picture = new PictureMessage();
 java.awt.Image img = Toolkit.getDefaultToolkit().getImage("c:/tmp/morning.gif");
 picture.setPictureMessage("Good morning",img);
 picture.setRecipient("+41791234567"); 
 service.sendMessage(picture);
 ...
 

See Also:
Serialized Form

Field Summary
static int MAX_HEIGHT
          Maximum height of a Picture (28 pixels)
static int MAX_WIDTH
          Maximum width of a Picture (72 pixels)
 
Fields inherited from class com.objectxp.msg.SmsMessage
CLASS_0, CLASS_1, CLASS_2, CLASS_3, DC_8BIT, DC_DEFAULT, DC_GROUP_DATA, DC_GROUP_GENERAL, DC_GROUP_MSG_WAITING_DISCARD, DC_GROUP_MSG_WAITING_STORE, DC_UCS2, INDICATION_ACTIVE, INDICATION_INACTIVE, INDICATION_TYPE_EMAIL, INDICATION_TYPE_FAX, INDICATION_TYPE_OTHER, INDICATION_TYPE_VOICEMAIL, NO_CLASS
 
Fields inherited from class com.objectxp.msg.Message
ACK_TIME, MT_BINARY, MT_STATUS, MT_TEXT, SENDER_TYPE_ALPHA, SENDER_TYPE_GUESS, SENDER_TYPE_NUMBER
 
Constructor Summary
PictureMessage()
          Creates a new PictureMessage.
PictureMessage(SmsService service)
          Deprecated. since jSMS 1.7, use PictureMessage()
 
Method Summary
 java.awt.Image getImage()
          Transformes and returns the OTA image as Image object.
 java.lang.String getMessage()
          Get the Message (User Data) as String.
 byte[] getOtaImage()
           
 java.lang.String getText()
          Gets the text of this message.
 byte[] getUserData()
          Get the User Data of this message.
 void setPictureMessage(java.lang.String text, byte[] img)
          Set the image and a text.
 void setPictureMessage(java.lang.String text, java.awt.Image img)
          Set the image and a text.
 java.lang.String toString()
          Constructs a string representation of this Message
 
Methods inherited from class com.objectxp.msg.smart.SmartMessage
buildParts, buildParts, getParts
 
Methods inherited from class com.objectxp.msg.SmsMessage
containsUserDataHeader, copyFields, getAlphabet, getBytes, getCodingGroup, getDeferredDeliveryAsDate, getDeferredDeliveryInMinutes, getID, getIndicationState, getIndicationType, getMessageClass, getParent, getPID, getRecipient, getRecipientAddress, getSender, getSenderAddress, getType, getUserDataHeader, getValidityPeriodAsDate, getValidityPeriodInMinutes, hasDeferredDelivery, hasMessageClass, hasValidityPeriod, isCompressed, isMMS, isRejectDuplicates, isRelativeDeferredDelivery, isRelativeValidityPeriod, isReplyPath, requestStatusReport, requestStatusReport, setAlphabet, setCodingGroup, setCompression, setDeferredDelivery, setDeferredDelivery, setIndicationState, setIndicationType, setMessage, setMessage, setMessageClass, setMMS, setParent, setPID, setRecipient, setRecipientAddress, setRejectDuplicates, setReplyPath, setSender, setSenderAddress, setType, setUserData, setUserDataHeader, setUserDataHeader, setValidityPeriod, setValidityPeriod
 
Methods inherited from class com.objectxp.msg.Message
clone, getProperty, getSenderType, getTimestamp, setID, setProperty, setSenderType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_HEIGHT

public static final int MAX_HEIGHT
Maximum height of a Picture (28 pixels)

See Also:
Constant Field Values

MAX_WIDTH

public static final int MAX_WIDTH
Maximum width of a Picture (72 pixels)

See Also:
Constant Field Values
Constructor Detail

PictureMessage

public PictureMessage()
Creates a new PictureMessage.


PictureMessage

public PictureMessage(SmsService service)
               throws java.lang.IllegalArgumentException
Deprecated. since jSMS 1.7, use PictureMessage()

Creates a new PictureMessage.

Parameters:
service - the initialized SmsService used for sending the message
Throws:
java.lang.IllegalArgumentException - if the SmsService is null or has not yet been initialized
Method Detail

setPictureMessage

public void setPictureMessage(java.lang.String text,
                              java.awt.Image img)
Set the image and a text. The image has to be in the right size (28 pixel height and 72 pixels width). If the image is larger then this, it will be cropped to the maximum size (cropping will start at coordinate 0,0).
If the specified image contains color or grayscales it will be converted to black and white. To get optimal results, it is strongly recommended to use only monochrome images.

Parameters:
text - String representing the text part
img - a java.awt.Image representing the picture (e.g. GIF or JPEG)

setPictureMessage

public void setPictureMessage(java.lang.String text,
                              byte[] img)
Set the image and a text.

Parameters:
text - String representing the text part
img - :The byte[] must represent a ota-image with 28 x 72 pixels and thus contain 256 bytes.

getText

public java.lang.String getText()
Gets the text of this message.

Returns:
the text

getMessage

public java.lang.String getMessage()
Description copied from class: SmsMessage
Get the Message (User Data) as String.

Overrides:
getMessage in class SmsMessage
Returns:
the User Data converted to a String object.
See Also:
SmsMessage.getUserData()

getUserData

public byte[] getUserData()
Description copied from class: SmsMessage
Get the User Data of this message.

Overrides:
getUserData in class SmsMessage
Returns:
the user data or null if the message contains no user data

toString

public java.lang.String toString()
Description copied from class: Message
Constructs a string representation of this Message

Overrides:
toString in class SmsMessage

getImage

public java.awt.Image getImage()
Transformes and returns the OTA image as Image object.

Returns:
the OTA image as Image object

getOtaImage

public byte[] getOtaImage()
Returns:
the OTA image.


object XP, Inc. © 2000-2007. All rights reserved object XP