com.objectxp.msg.smart
Class OperatorLogo

java.lang.Object
  extended by com.objectxp.msg.Message
      extended by com.objectxp.msg.SmsMessage
          extended by com.objectxp.msg.smart.SmartMessage
              extended by com.objectxp.msg.smart.OperatorLogo
All Implemented Interfaces:
MultiPartMessage, java.io.Serializable, java.lang.Cloneable

public class OperatorLogo
extends SmartMessage

This class represents an OperatorLogo message for SmartMessaging enabled phones. The class accepts images of type java.awt.Image. The dimension of operator logos is 14x72 pixels. Images which are larger than this will be cropped to this size.

Example:

 ...
 SmsService service = new GsmSmsService();
 ...
 OperatorLogo logo = new OperatorLogo();
 java.awt.Image img = Toolkit.getDefaultToolkit().getImage("c:/img/operator.gif");
 logo.setOoperatorLogo(img,"228","02");
 logo.setRecipient("+41791234567"); 
 service.sendMessage(logo);
 ...
 
For more information about the available country and operator codes see GSM world info

See Also:
Serialized Form

Field Summary
static int MAX_HEIGHT
          Maximum height of a Operator Logo (14 pixels)
static int MAX_WIDTH
          Maximum width of a Operator Logo (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
OperatorLogo()
          Create a new Operator Logo Message.
OperatorLogo(SmsService service)
          Deprecated. since jSMS 1.7, use OperatorLogo()
 
Method Summary
 java.lang.String getCountryCode()
          Returns a String representing the country code.
 java.awt.Image getImage()
          Transformes and returns the OTA image as Image object.
 java.lang.String getMessage()
          Get the Message (User Data) as String.
 java.lang.String getOperatorCode()
          Returns a String representing the operator code.
 byte[] getOtaImage()
           
 byte[] getUserData()
          Get the User Data of this message.
 void setOperatorLogo(byte[] image)
          Set the Operator Logo.
 void setOperatorLogo(java.awt.Image img, java.lang.String countryCode, java.lang.String operatorCode)
          Set the operator logo image.
 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 Operator Logo (14 pixels)

See Also:
Constant Field Values

MAX_WIDTH

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

See Also:
Constant Field Values
Constructor Detail

OperatorLogo

public OperatorLogo()
             throws java.lang.IllegalArgumentException
Create a new Operator Logo Message.

Throws:
java.lang.IllegalArgumentException

OperatorLogo

public OperatorLogo(SmsService service)
Deprecated. since jSMS 1.7, use OperatorLogo()

Create a new Operator Logo Message.

Parameters:
service - the initialized SmsService used for sending the message
Method Detail

setOperatorLogo

public void setOperatorLogo(byte[] image)
Set the Operator Logo. The byte[] passed to this method must contain:

Parameters:
image - the operator logo
Throws:
java.lang.IllegalArgumentException - if the image is either null or doesn't contain exactly 133 bytes.

getCountryCode

public java.lang.String getCountryCode()
Returns a String representing the country code.

Returns:
the country code

getOperatorCode

public java.lang.String getOperatorCode()
Returns a String representing the operator code.

Returns:
the operator code

setOperatorLogo

public void setOperatorLogo(java.awt.Image img,
                            java.lang.String countryCode,
                            java.lang.String operatorCode)
                     throws java.lang.IllegalArgumentException
Set the operator logo image. The image has to be in the right size (14 pixel height and 72 pixels width). If the image is larger than this, it will be cropped to the maximum size (cropping will start at coordinate 0,0).
If the specified image contains colors or grayscales it will be converted to black and white. To get optimal results, it is strongly recommended to use only monochrome images.

Parameters:
img - a java.awt.Image representing the logo (e.g. GIF or JPEG)
countryCode - String representing the country code (e.g. "228" for Switzerland)
operatorCode - String representing the operator code (e.g. "01" for Swisscom)
Throws:
java.lang.IllegalArgumentException - if the image, operator code or country code is null

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-2008. All rights reserved object XP