RunningMIDletSuiteInfopublic class RunningMIDletSuiteInfo extends MIDletSuiteInfo Simple attribute storage for MIDlet suites |
Fields Summary |
---|
public MIDletProxy | proxyProxy if running. It is set from AppManagerUI.java. | public Image | iconIcon for this suite. | private static Image | multiSuiteIconCache of the suite icon. | private static Image | singleSuiteIconCache of the single suite icon. |
Constructors Summary |
---|
public RunningMIDletSuiteInfo(int theID)Constructs a RunningMIDletSuiteInfo object for a suite.
super(theID);
| public RunningMIDletSuiteInfo(int theID, String theMidletToRun, String theDisplayName, boolean isEnabled)Constructs a RunningMIDletSuiteInfo object for a suite.
super(theID, theMidletToRun, theDisplayName, isEnabled);
icon = getDefaultSingleSuiteIcon();
| public RunningMIDletSuiteInfo(int theID, MIDletSuiteImpl theMidletSuite, MIDletSuiteStorage mss)Constructs a RunningMIDletSuiteInfo object for a suite.
super(theID, theMidletSuite);
icon = getIcon(theID, theMidletSuite.getProperty("MIDlet-Icon"), mss);
if (icon == null && numberOfMidlets == 1) {
MIDletInfo midlet =
new MIDletInfo(theMidletSuite.getProperty("MIDlet-1"));
// MIDlet icons are optional, so it the icon may be null
icon = getIcon(theID, midlet.icon, mss);
}
if (icon == null) {
icon = getDefaultSingleSuiteIcon();
}
| public RunningMIDletSuiteInfo(MIDletSuiteInfo info, MIDletSuiteStorage mss)Constructs a RunningMIDletSuiteInfo from MIDletSuiteInfo.
super(info.suiteId, info.midletToRun, info.displayName,
info.enabled);
storageId = info.storageId;
numberOfMidlets = info.numberOfMidlets;
trusted = info.trusted;
preinstalled = info.preinstalled;
iconName = info.iconName;
loadIcon(mss);
|
Methods Summary |
---|
public boolean | equals(MIDletProxy midlet)Compares this MIDletSuiteInfo with the passed in MIDletProxy.
Returns true if both belong to the same suite and
if current proxy or midetToRun points to the same class as
in the passed in MIDletProxy.
if (suiteId == midlet.getSuiteId()) {
if (proxy != null) {
return proxy == midlet;
}
if ((numberOfMidlets == 1 ||
suiteId == MIDletSuite.INTERNAL_SUITE_ID) &&
midletToRun != null) {
return midletToRun.equals(midlet.getClassName());
}
return true;
}
return false;
| private static Image | getDefaultMultiSuiteIcon()Gets the MIDlet suite icon from storage.
if (multiSuiteIcon == null) {
multiSuiteIcon = GraphicalInstaller.
getImageFromInternalStorage("_ch_suite");
}
return multiSuiteIcon;
| private static Image | getDefaultSingleSuiteIcon()Gets the single MIDlet suite icon from storage.
if (singleSuiteIcon == null) {
singleSuiteIcon = GraphicalInstaller.
getImageFromInternalStorage("_ch_single");
}
return singleSuiteIcon;
| public static Image | getIcon(int theID, java.lang.String iconName, MIDletSuiteStorage mss)Gets suite icon either from image cache, or from the suite jar.
byte[] iconBytes;
try {
iconBytes = mss.getMIDletSuiteIcon(theID, iconName);
if (iconBytes == null) {
if (Logging.REPORT_LEVEL <= Logging.WARNING) {
Logging.report(Logging.WARNING, LogChannels.LC_AMS,
"getIcon: iconBytes == null");
}
return null;
}
return Image.createImage(iconBytes, 0, iconBytes.length);
} catch (Throwable t) {
if (Logging.REPORT_LEVEL <= Logging.WARNING) {
Logging.report(Logging.WARNING, LogChannels.LC_AMS,
"getIcon threw an " + t.getClass());
}
return null;
}
| public void | loadIcon(MIDletSuiteStorage mss)Loads an icon for this suite.
if (iconName != null) {
icon = getIcon(suiteId, iconName, mss);
}
if (icon == null) {
if (numberOfMidlets == 1) {
icon = getDefaultSingleSuiteIcon();
} else {
icon = getDefaultMultiSuiteIcon();
}
}
| public java.lang.String | toString()Returns a string representation of the MIDletSuiteInfo object.
For debug only.
StringBuffer b = new StringBuffer();
b.append("id = " + suiteId);
b.append(", midletToRun = " + midletToRun);
b.append(", proxy = " + proxy);
return b.toString();
|
|