Revision: 2341
http://sourceforge.net/p/swingme/code/2341
Author: yuranet
Date: 2015-03-14 18:00:58 +0000 (Sat, 14 Mar 2015)
Log Message:
-----------
IO works even when there is no UI part II
Modified Paths:
--------------
me4se/src/javax/microedition/lcdui/Canvas.java
me4se/src/javax/microedition/lcdui/Command.java
me4se/src/javax/microedition/lcdui/Gauge.java
me4se/src/javax/microedition/lcdui/ScmDeviceComponent.java
me4se/src/javax/microedition/lcdui/ScmDisplayable.java
me4se/src/javax/microedition/midlet/ApplicationManager.java
me4se/src/org/me4se/MIDletRunner.java
me4se/src/org/me4se/System.java
me4se/src/org/me4se/impl/MIDletChooser.java
me4se/src/org/me4se/psi/java1/gcf/http/HttpConnectionImpl.java
Modified: me4se/src/javax/microedition/lcdui/Canvas.java
===================================================================
--- me4se/src/javax/microedition/lcdui/Canvas.java 2015-03-14 17:18:32 UTC (rev 2340)
+++ me4se/src/javax/microedition/lcdui/Canvas.java 2015-03-14 18:00:58 UTC (rev 2341)
@@ -149,7 +149,7 @@
/**
* @ME4SE INTERNAL
*/
- protected boolean _fullScreenMode = ApplicationManager.getInstance().getFlag("canvasHideSoftButtons");
+ protected boolean _fullScreenMode = ApplicationManager.getFlag("canvasHideSoftButtons");
Image videoFrameImage;
@@ -170,7 +170,7 @@
container.setMain(component, false);
- if(ApplicationManager.getInstance().getFlag("SiemensCK")){
+ if(ApplicationManager.getFlag("SiemensCK")){
centerCommand = new Command("CenterBlocker", Command.SCREEN, -15); // label must not be empty to avoid filtering
centerCommand.type = Command.CENTERBLOCKER;
addCommand(centerCommand);
Modified: me4se/src/javax/microedition/lcdui/Command.java
===================================================================
--- me4se/src/javax/microedition/lcdui/Command.java 2015-03-14 17:18:32 UTC (rev 2340)
+++ me4se/src/javax/microedition/lcdui/Command.java 2015-03-14 18:00:58 UTC (rev 2341)
@@ -75,7 +75,7 @@
throw new IllegalArgumentException();
this.priority = priority;
- if(ApplicationManager.getInstance().getFlag("SiemensCK")) {
+ if(ApplicationManager.getFlag("SiemensCK")) {
this.label[0] = SIEMENS_TYPE_CHARS[type];
}
}
Modified: me4se/src/javax/microedition/lcdui/Gauge.java
===================================================================
--- me4se/src/javax/microedition/lcdui/Gauge.java 2015-03-14 17:18:32 UTC (rev 2340)
+++ me4se/src/javax/microedition/lcdui/Gauge.java 2015-03-14 18:00:58 UTC (rev 2341)
@@ -48,7 +48,7 @@
this.maximum = maxValue;
this.value = initialValue;
- component = (ScmGauge) ApplicationManager.getInstance().getComponent(interactive ? "item.gauge.interactive" : "item.gauge");
+ component = (ScmGauge) ApplicationManager.getComponent(interactive ? "item.gauge.interactive" : "item.gauge");
if (component == null)
component = new ScmGauge(interactive);
Modified: me4se/src/javax/microedition/lcdui/ScmDeviceComponent.java
===================================================================
--- me4se/src/javax/microedition/lcdui/ScmDeviceComponent.java 2015-03-14 17:18:32 UTC (rev 2340)
+++ me4se/src/javax/microedition/lcdui/ScmDeviceComponent.java 2015-03-14 18:00:58 UTC (rev 2341)
@@ -146,7 +146,7 @@
int count = parent.getComponentCount();
int i0 = parent.indexOf(this);
int i = i0;
- boolean cycle = ApplicationManager.getInstance().getFlag("cycleList");
+ boolean cycle = ApplicationManager.getFlag("cycleList");
do {
i += dir;
Modified: me4se/src/javax/microedition/lcdui/ScmDisplayable.java
===================================================================
--- me4se/src/javax/microedition/lcdui/ScmDisplayable.java 2015-03-14 17:18:32 UTC (rev 2340)
+++ me4se/src/javax/microedition/lcdui/ScmDisplayable.java 2015-03-14 18:00:58 UTC (rev 2341)
@@ -214,7 +214,7 @@
if (scrollable) {
ScmScrollPane scrollPane = new ScmScrollPane();
scrollPane.add(main);
- if (ApplicationManager.getInstance().getFlag("scrollbar")) {
+ if (ApplicationManager.getFlag("scrollbar")) {
ScmScrollBar sb = new ScmScrollBar();
sb.setBackground(javax.microedition.midlet.ApplicationManager.getInstance().bgColor);
scrollPane.setVerticalBar(sb);
Modified: me4se/src/javax/microedition/midlet/ApplicationManager.java
===================================================================
--- me4se/src/javax/microedition/midlet/ApplicationManager.java 2015-03-14 17:18:32 UTC (rev 2340)
+++ me4se/src/javax/microedition/midlet/ApplicationManager.java 2015-03-14 18:00:58 UTC (rev 2341)
@@ -1031,7 +1031,7 @@
* active = midlet; start(); }
*/
- public Object getComponent(String name) {
+ public static Object getComponent(String name) {
String custom = getProperty(name + ".component");
if (custom == null)
return null;
@@ -1042,13 +1042,13 @@
}
}
- public boolean getFlag(String flag) {
+ public static boolean getFlag(String flag) {
String f = getProperty("me4se.flags");
return f == null ? false
: f.toLowerCase().indexOf(flag.toLowerCase()) != -1;
}
- public boolean getBooleanProperty(String name, boolean dflt) {
+ public static boolean getBooleanProperty(String name, boolean dflt) {
String v = getProperty(name);
return v == null ? dflt : "true".equalsIgnoreCase(v.trim());
}
Modified: me4se/src/org/me4se/MIDletRunner.java
===================================================================
--- me4se/src/org/me4se/MIDletRunner.java 2015-03-14 17:18:32 UTC (rev 2340)
+++ me4se/src/org/me4se/MIDletRunner.java 2015-03-14 18:00:58 UTC (rev 2341)
@@ -45,8 +45,7 @@
if (!ApplicationManager.isInitialized()) {
startMIDlet(null, -1, this, null);
} else {
- boolean restartable = ApplicationManager.getInstance()
- .getBooleanProperty("me4se.restartable", true);
+ boolean restartable = ApplicationManager.getBooleanProperty("me4se.restartable", true);
System.out
.println("Calling ApplicationManager.manager.start(); restartable: "
@@ -82,8 +81,7 @@
public void stop() {
- boolean restartable = ApplicationManager.getInstance().getBooleanProperty(
- "me4se.restartable", true);
+ boolean restartable = ApplicationManager.getBooleanProperty("me4se.restartable", true);
System.out.println("Applet stop() was called. Restartable: " + restartable);
Modified: me4se/src/org/me4se/System.java
===================================================================
--- me4se/src/org/me4se/System.java 2015-03-14 17:18:32 UTC (rev 2340)
+++ me4se/src/org/me4se/System.java 2015-03-14 18:00:58 UTC (rev 2341)
@@ -37,7 +37,7 @@
public static String getProperty(String key) {
// System.out.println("org.me4se.System.getProperty(): trying to access property: "+key);
- String result = ApplicationManager.getInstance().applet == null
+ String result = !ApplicationManager.isInitialized() || ApplicationManager.getInstance().applet == null
? java.lang.System.getProperty(key)
: (String) properties.get(key);
Modified: me4se/src/org/me4se/impl/MIDletChooser.java
===================================================================
--- me4se/src/org/me4se/impl/MIDletChooser.java 2015-03-14 17:18:32 UTC (rev 2340)
+++ me4se/src/org/me4se/impl/MIDletChooser.java 2015-03-14 18:00:58 UTC (rev 2341)
@@ -95,7 +95,7 @@
* Is called when the MIDletChooser is started, activates the list screen.
*/
protected void startApp() {
- if(ApplicationManager.getInstance().getBooleanProperty("me4se.autorestart", false)){
+ if(ApplicationManager.getBooleanProperty("me4se.autorestart", false)){
// if ("com.google.googlenav.GoogleNav".equals(ApplicationManager.manager.jadFile.getMIDlet(1).getClassName())){
commandAction(CMD_RESTART, infoAlert);
}
@@ -139,7 +139,7 @@
if(cmd == CMD_RELOAD ||
(manager.applet != null
- && !manager.getBooleanProperty("me4se.restartable", true)
+ && !ApplicationManager.getBooleanProperty("me4se.restartable", true)
&& (!firstLaunch || manager.jadFile.getMIDletCount() == 1))){
manager.applet.getAppletContext().showDocument(manager.applet.getDocumentBase());
Modified: me4se/src/org/me4se/psi/java1/gcf/http/HttpConnectionImpl.java
===================================================================
--- me4se/src/org/me4se/psi/java1/gcf/http/HttpConnectionImpl.java 2015-03-14 17:18:32 UTC (rev 2340)
+++ me4se/src/org/me4se/psi/java1/gcf/http/HttpConnectionImpl.java 2015-03-14 18:00:58 UTC (rev 2341)
@@ -84,7 +84,7 @@
Object doPrivileged(int action) throws IOException {
Privileged pa = new Privileged(action);
try {
- return ApplicationManager.getInstance().getBooleanProperty("me4se.signed", false) ? AccessController
+ return ApplicationManager.getBooleanProperty("me4se.signed", false) ? AccessController
.doPrivileged(pa) : pa.run();
} catch (PrivilegedActionException e) {
throw new SecurityException(e);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|