You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by te...@apache.org on 2008/05/27 00:21:57 UTC

svn commit: r660326 [3/17] - in /harmony/enhanced/microemulator: ./ microemu-android/ microemu-android/src/ microemu-android/src/org/ microemu-android/src/org/microemu/ microemu-android/src/org/microemu/android/ microemu-android/src/org/microemu/androi...

Added: harmony/enhanced/microemulator/microemu-examples/microemu-demo/me-2 SimpleDemo.launch
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-examples/microemu-demo/me-2%20SimpleDemo.launch?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-examples/microemu-demo/me-2 SimpleDemo.launch (added)
+++ harmony/enhanced/microemulator/microemu-examples/microemu-demo/me-2 SimpleDemo.launch Mon May 26 15:20:19 2008
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/microemu-javase-swing/src/main/java/org/microemu/app/Main.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.microemu.app.Main"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="org.microemu.midp.examples.simpledemo.SimpleDemoMIDlet"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="microemu-demo"/>
+</launchConfiguration>

Added: harmony/enhanced/microemulator/microemu-examples/microemu-demo/microemu-demo.html
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-examples/microemu-demo/microemu-demo.html?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-examples/microemu-demo/microemu-demo.html (added)
+++ harmony/enhanced/microemulator/microemu-examples/microemu-demo/microemu-demo.html Mon May 26 15:20:19 2008
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+	<head>
+		<title>MicroEmulator</title>
+	</head>
+	<body>
+		<applet code="org.microemu.applet.Main"
+		        width="226" height="471"
+		        archive="lib/microemu-javase-applet.jar,apps/microemu-demo.jar">
+            <param name="midlet" value="org.microemu.midp.examples.simpledemo.SimpleDemoMIDlet"/>
+        </applet>
+	</body>
+</html>

Propchange: harmony/enhanced/microemulator/microemu-examples/microemu-demo/microemu-demo.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-examples/microemu-demo/microemu-demo.jad
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-examples/microemu-demo/microemu-demo.jad?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-examples/microemu-demo/microemu-demo.jad (added)
+++ harmony/enhanced/microemulator/microemu-examples/microemu-demo/microemu-demo.jad Mon May 26 15:20:19 2008
@@ -0,0 +1,9 @@
+MIDlet-Jar-URL: microemu-demo.jar
+MIDlet-Name: microemu-demo
+MIDlet-Vendor: MicroEmulator Team
+MIDlet-Version: 2.0.1-SNAPSHOT
+MIDlet-1: SimpleDemo, /me2-icon.png, org.microemu.midp.examples.simpledemo.SimpleDemoMIDlet
+Created-By: Bartek Teodorczyk
+MIDlet-Icon: /pyx.png
+MicroEdition-Configuration: CLDC-1.1
+MicroEdition-Profile: MIDP-2.0

Added: harmony/enhanced/microemulator/microemu-examples/microemu-demo/pom.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-examples/microemu-demo/pom.xml?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-examples/microemu-demo/pom.xml (added)
+++ harmony/enhanced/microemulator/microemu-examples/microemu-demo/pom.xml Mon May 26 15:20:19 2008
@@ -0,0 +1,187 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns="http://maven.apache.org/POM/4.0.0">
+    <!-- @version $Revision: 1626 $ ($Author: vlads $) $Date: 2008-03-04 21:47:36 -0500 (Tue, 04 Mar 2008) $ -->
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.microemu</groupId>
+        <artifactId>microemu-examples</artifactId>
+        <version>2.0.3-SNAPSHOT</version><!--me-version-->
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>microemu-demo</artifactId>
+    <name>microemu-demo</name>
+
+    <description>demo example</description>
+
+    <dependencies>
+<!--
+        <dependency>
+            <groupId>org.microemu</groupId>
+            <artifactId>midpapi20</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+-->
+        <dependency>
+            <groupId>org.microemu</groupId>
+            <artifactId>microemu-javase-swing</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+
+    </dependencies>
+
+    <properties>
+        <wtkNotSupported>true</wtkNotSupported>
+    </properties>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.3</source>
+                    <target>1.1</target>
+                    <compilerArguments>
+                        <bootclasspath>${basedir}/../../api/cldcapi11/target/cldcapi11-${project.version}.jar${path.separator}${basedir}/../../api/midpapi20/target/midpapi20-${project.version}.jar</bootclasspath>
+                   </compilerArguments>
+                   <!--compilerArguments>
+                        <bootclasspath>${env.WTK_HOME}/lib/cldcapi11.jar${path.separator}${env.WTK_HOME}/lib/midpapi20.jar</bootclasspath>
+                   </compilerArguments-->
+                </configuration>
+            </plugin>
+
+            <!-- Add EclipseME nature to the generated project-->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-eclipse-plugin</artifactId>
+                <configuration>
+                    <buildcommands>
+                        <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
+                        <buildcommand>eclipseme.core.preverifier</buildcommand>
+                    </buildcommands>
+                    <projectnatures>
+                        <projectnature>org.eclipse.jdt.core.javanature</projectnature>
+                        <projectnature>eclipseme.core.nature</projectnature>
+                    </projectnatures>
+                    <classpathContainers>
+                        <classpathContainer>J2MELIB</classpathContainer>
+                        <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
+                    </classpathContainers>
+                </configuration>
+            </plugin>
+
+            <!-- Create application loadable on the phone -->
+            <plugin>
+                <groupId>com.pyx4me</groupId>
+                <artifactId>j2me-maven-plugin</artifactId>
+                <version>${pyx4meVersion}</version>
+                <executions>
+                   <execution>
+                        <goals>
+                            <goal>package</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <!--wtkHome>${env.WTK_HOME}</wtkHome-->
+                    <useWtkLibs>false</useWtkLibs>
+                    <proguard>false</proguard>
+                    <obfuscate>false</obfuscate>
+                    <proguardPreverify>${wtkNotSupported}</proguardPreverify>
+                    <proguardInclude>${basedir}/proguard.conf</proguardInclude>
+                    <proguardOptions>
+                        <options>
+                            <option>-overloadaggressively</option>
+                            <option>-dontoptimize</option>
+                            <option>-allowaccessmodification</option>
+                            <option>-defaultpackage 'me2e'</option>
+                            <option>-dontusemixedcaseclassnames</option>
+                        </options>
+                    </proguardOptions>
+                    <jadAttributes>
+                        <Created-By>Bartek Teodorczyk</Created-By>
+                    </jadAttributes>
+                    <midlets>
+                        <MIDlet>
+                            <name>SimpleDemo</name>
+                            <icon>/me2-icon.png</icon>
+                            <class>org.microemu.midp.examples.simpledemo.SimpleDemoMIDlet</class>
+                        </MIDlet>
+                    </midlets>
+                    <libs>
+                        <lib>${basedir}/../../api/cldcapi11/target/cldcapi11-${project.version}.jar</lib>
+                        <lib>${basedir}/../../api/midpapi20/target/midpapi20-${project.version}.jar</lib>
+                    </libs>
+                    <dependencies>
+                        <dependency>
+                            <groupId>org.microemu</groupId>
+                            <artifactId>microemu-javase-swing</artifactId>
+                            <exclude>true</exclude>
+                            <withTrail>true</withTrail>
+                        </dependency>
+                    </dependencies>
+                </configuration>
+            </plugin>
+
+            <!--
+            <plugin>
+                <groupId>com.pyx4me</groupId>
+                <artifactId>gammu-maven-plugin</artifactId>
+                <version>${pyx4meVersion}</version>
+                <configuration>
+                    <gammurc>${env.HOME}/gammurc</gammurc>
+                </configuration>
+            </plugin>
+            -->
+
+            <plugin>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-assembly-4download</id>
+                        <phase>site</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <tasks>
+                                <copy overwrite="true"
+                                    file="${project.build.directory}/${project.build.finalName}-me.jar"
+                                    tofile="${project.build.directory}/site/${artifactId}.jar"/>
+                                <copy overwrite="true"
+                                    file="${project.build.directory}/${project.build.finalName}-me.jad"
+                                    tofile="${project.build.directory}/site/${artifactId}.jad"/>
+                                <replace value="${artifactId}.jar" token="${project.build.finalName}-me.jar" dir="${project.build.directory}/site">
+                                    <include name="${artifactId}.jad"></include>
+                                </replace>
+                            </tasks>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+        </plugins>
+    </build>
+
+    <profiles>
+        <profile>
+            <id>osx</id>
+            <activation>
+                <os>
+                    <family>mac</family>
+                </os>
+            </activation>
+            <properties>
+                <wtkNotSupported>true</wtkNotSupported>
+            </properties>
+        </profile>
+    </profiles>
+
+</project>

Propchange: harmony/enhanced/microemulator/microemu-examples/microemu-demo/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/AlertPanel.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/AlertPanel.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/AlertPanel.java (added)
+++ harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/AlertPanel.java Mon May 26 15:20:19 2008
@@ -0,0 +1,65 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.microemu.midp.examples.simpledemo;
+
+import javax.microedition.lcdui.Alert;
+import javax.microedition.lcdui.AlertType;
+import javax.microedition.lcdui.Command;
+import javax.microedition.lcdui.Displayable;
+import javax.microedition.lcdui.List;
+
+public class AlertPanel extends BaseExamplesList {
+
+	static final Command okCommand = new Command("Agree", Command.OK, 1);
+	
+	Alert alertCmd;
+	
+	Alert alerts[] = {
+			new Alert("Alarm alert", "This is alarm alert", null, AlertType.ALARM),
+			new Alert("Confirmation alert", "This is confirmation alert with 5 sec timeout", null, AlertType.CONFIRMATION),
+			new Alert("Error alert", "This is error alert", null, AlertType.ERROR),
+			new Alert("Info alert", "This is info alert with 5 sec timeout", null, AlertType.INFO),
+			new Alert("Warning alert", "This is warning alert", null, AlertType.WARNING),
+			alertCmd = new Alert("Command alert", "This is alert with command", null, AlertType.INFO)};
+
+	public AlertPanel() {
+		super("Alert", List.IMPLICIT);
+
+		for (int i = 0; i < alerts.length; i++) {
+			if (i == 1 || i == 3) {
+				alerts[i].setTimeout(5000);
+			}
+			append(alerts[i].getTitle(), null);
+		}
+	}
+
+	public void commandAction(Command c, Displayable d) {
+		if (d == this) {
+			if (c == List.SELECT_COMMAND) {
+				if (alertCmd == alerts[getSelectedIndex()]) {
+					alertCmd.addCommand(okCommand);
+				}
+				SimpleDemoMIDlet.setCurrentDisplayable(alerts[getSelectedIndex()]);
+			}
+		}
+		super.commandAction(c, d);
+	}
+
+}

Propchange: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/AlertPanel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/BaseExamplesCanvas.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/BaseExamplesCanvas.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/BaseExamplesCanvas.java (added)
+++ harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/BaseExamplesCanvas.java Mon May 26 15:20:19 2008
@@ -0,0 +1,64 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.microemu.midp.examples.simpledemo;
+
+import javax.microedition.lcdui.Canvas;
+import javax.microedition.lcdui.Command;
+import javax.microedition.lcdui.CommandListener;
+import javax.microedition.lcdui.Displayable;
+import javax.microedition.lcdui.Graphics;
+
+public abstract class BaseExamplesCanvas extends Canvas implements CommandListener {
+
+	protected boolean fullScreenMode = false;
+	
+	protected static final Command fullScreenModeCommand = new Command("Full Screen", Command.ITEM, 5);
+	
+	public BaseExamplesCanvas(String title) {
+		super();
+		super.setTitle(title);
+		
+		addCommand(BaseExamplesForm.backCommand);
+		addCommand(fullScreenModeCommand);
+		setCommandListener(this);
+	}
+
+	public int writeln(Graphics g, int line, String s) {
+		int y = (g.getFont().getHeight() + 1) * line;
+		g.drawString(s, 0, y, Graphics.LEFT | Graphics.TOP);
+		return y;
+	}
+	
+	public void commandAction(Command c, Displayable d) {
+		if (d == this) {
+			if (c == BaseExamplesForm.backCommand) {
+				SimpleDemoMIDlet.showMenu();
+			} else if (c == fullScreenModeCommand) {
+				setFullScreenMode(!fullScreenMode);
+				repaint();
+			}
+		}
+	}
+	
+	public void setFullScreenMode(boolean mode) {
+		fullScreenMode = mode;
+		super.setFullScreenMode(mode);
+	}
+}

Propchange: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/BaseExamplesCanvas.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/BaseExamplesForm.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/BaseExamplesForm.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/BaseExamplesForm.java (added)
+++ harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/BaseExamplesForm.java Mon May 26 15:20:19 2008
@@ -0,0 +1,45 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.microemu.midp.examples.simpledemo;
+
+import javax.microedition.lcdui.Command;
+import javax.microedition.lcdui.CommandListener;
+import javax.microedition.lcdui.Displayable;
+import javax.microedition.lcdui.Form;
+
+public abstract class BaseExamplesForm extends Form implements CommandListener {
+
+	static final Command backCommand = new Command("Back", Command.BACK, 1);
+
+	public BaseExamplesForm(String title) {
+		super(title);
+
+		addCommand(backCommand);
+		setCommandListener(this);
+	}
+
+	public void commandAction(Command c, Displayable d) {
+		if (d == this) {
+			if (c == backCommand) {
+				SimpleDemoMIDlet.showMenu();
+			}
+		}
+	}
+}

Propchange: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/BaseExamplesForm.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/BaseExamplesList.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/BaseExamplesList.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/BaseExamplesList.java (added)
+++ harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/BaseExamplesList.java Mon May 26 15:20:19 2008
@@ -0,0 +1,44 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.microemu.midp.examples.simpledemo;
+
+import javax.microedition.lcdui.Command;
+import javax.microedition.lcdui.CommandListener;
+import javax.microedition.lcdui.Displayable;
+import javax.microedition.lcdui.List;
+
+public abstract class BaseExamplesList extends List implements CommandListener {
+
+	public BaseExamplesList(String title, int listType) {
+		super(title, listType);
+
+		addCommand(BaseExamplesForm.backCommand);
+		setCommandListener(this);
+	}
+
+	public void commandAction(Command c, Displayable d) {
+		if (d == this) {
+			if (c == BaseExamplesForm.backCommand) {
+				SimpleDemoMIDlet.showMenu();
+			}
+		}
+	}
+
+}

Propchange: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/BaseExamplesList.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/CanvasPanel.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/CanvasPanel.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/CanvasPanel.java (added)
+++ harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/CanvasPanel.java Mon May 26 15:20:19 2008
@@ -0,0 +1,248 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.microemu.midp.examples.simpledemo;
+
+import java.util.Random;
+
+import javax.microedition.lcdui.Command;
+import javax.microedition.lcdui.Displayable;
+import javax.microedition.lcdui.Font;
+import javax.microedition.lcdui.Graphics;
+
+public class CanvasPanel extends BaseExamplesCanvas implements HasRunnable {
+
+	private static final int POSNUMBER = 20;
+
+	private static final Command neCommand = new Command("3 NE Move", Command.ITEM, 1);
+
+	private static final Command nwCommand = new Command("1 NW Move", Command.ITEM, 2);
+
+	private static final Command seCommand = new Command("9 SE Move", Command.ITEM, 3);
+
+	private static final Command swCommand = new Command("7 SW Move", Command.ITEM, 4);
+
+	private boolean cancel = false;
+
+	private boolean moving = true;
+
+	private int moveX = 2, moveY = 2;
+
+	private int posX = 0, posY = 0;
+
+	private int ballMoveX = 2, ballMoveY = -3;
+	
+	private int ballPosX = 15, ballPosY = 15;
+	
+	private int ballColor = 0x5691F0;
+
+	private Random ballRandom = new Random();
+
+	private Runnable timerTask = new Runnable() {
+
+		public void run() {
+			while (!cancel) {
+				if (moving && isShown()) {
+					synchronized (this) {
+						if (moveX > 0) {
+							if (posX >= POSNUMBER) {
+								posX = 0;
+							}
+						} else {
+							if (posX < 0) {
+								posX = POSNUMBER;
+							}
+						}
+						if (moveY > 0) {
+							if (posY >= POSNUMBER) {
+								posY = 0;
+							}
+						} else {
+							if (posY < 0) {
+								posY = POSNUMBER;
+							}
+						}
+						posX += moveX;
+						posY += moveY;
+					}
+					repaint();
+				}
+				try {
+					Thread.sleep(100);
+				} catch (InterruptedException ex) {
+					break;
+				}
+			}
+		}
+	};
+
+	public CanvasPanel() {
+		super("Canvas");
+
+		addCommand(neCommand);
+		addCommand(nwCommand);
+		addCommand(seCommand);
+		addCommand(swCommand);
+	}
+
+	public void startRunnable() {
+		cancel = false;
+		Thread thread = new Thread(timerTask, "CanvasPanelThread");
+		thread.start();
+	}
+
+
+	public void stopRunnable() {
+		cancel = true;
+	}
+
+	public void commandAction(Command c, Displayable d) {
+		if (d == this) {
+			synchronized (this) {
+				if (c == nwCommand) {
+					moveX = -1;
+					moveY = -1;
+					moving = true;
+				} else if (c == neCommand) {
+					moveX = 1;
+					moveY = -1;
+					moving = true;
+				} else if (c == swCommand) {
+					moveX = -1;
+					moveY = 1;
+					moving = true;
+				} else if (c == seCommand) {
+					moveX = 1;
+					moveY = 1;
+					moving = true;
+				} 
+			}
+		}
+		super.commandAction(c, d);
+	}
+
+	protected void keyPressed(int keyCode) {
+		if (keyCode == '1' /*nwCommand*/) {
+			moveX = -1;
+			moveY = -1;
+			moving = true;
+		} else if (keyCode == '2') {
+			moveX = 0;
+			moveY = -1;
+			moving = true;
+		} else if (keyCode == '3' /*neCommand*/) {
+			moveX = 1;
+			moveY = -1;
+			moving = true;
+		} else if (keyCode == '4') {
+			moveX = -1;
+			moveY = 0;
+			moving = true;
+		} else if (keyCode == '6') {
+			moveX = 1;
+			moveY = 0;
+			moving = true;
+		} else if (keyCode == '7' /*swCommand*/) {
+			moveX = -1;
+			moveY = 1;
+			moving = true;
+		} else if (keyCode == '8') {
+			moveX = 0;
+			moveY = 1;
+			moving = true;
+		} else if (keyCode == '9' /*seCommand*/) {
+			moveX = 1;
+			moveY = 1;
+			moving = true;
+		} else if (keyCode == '5' /*fullScreenModeCommand*/) {
+			super.setFullScreenMode(!fullScreenMode);
+			repaint();
+		} else if (keyCode == KEY_POUND) {
+			moving = !moving;
+		} else if (keyCode == '0' /*backCommand*/) {
+			SimpleDemoMIDlet.showMenu();
+		} else if (fullScreenMode) {
+			setFullScreenMode(false);
+		}
+	}
+
+	public void paint(Graphics g) {
+		int width = getWidth();
+        int height = getHeight();
+
+		g.setGrayScale(255);
+		g.fillRect(0, 0, width, height);
+
+		g.setColor(0x5691F0);
+		g.drawRect(0, 0, width - 1, height - 1);
+
+		g.setGrayScale(0);
+		g.drawRect(2, 2, width - 5, height - 5);
+
+		int pos = posX;
+		while (pos < width - 5) {
+			g.drawLine(3 + pos, 3, 3 + pos, height - 4);
+			pos += POSNUMBER;
+		}
+		pos = posY;
+		while (pos < height - 5) {
+			g.drawLine(3, 3 + pos, width - 4, 3 + pos);
+			pos += POSNUMBER;
+		}
+
+		// Paint canvas info in the middle
+		String text = width + " x " + height;
+
+		Font f = g.getFont();
+		int w = f.stringWidth(text) + 4;
+		int h = 2 * f.getHeight() + 4;
+
+		int arcWidth = w;
+		int arcHeight = h;
+		g.setColor(0xFFCC11);
+		g.drawRoundRect((width - w)/2, (height - h)/2, w, h, arcWidth, arcHeight);
+		g.setColor(0xFFEE99);
+		g.fillRoundRect((width - w)/2, (height - h)/2, w, h, arcWidth, arcHeight);
+
+		g.setColor(0xBB5500);
+		g.drawString(text, width/2, (height - f.getHeight())/2, Graphics.HCENTER | Graphics.TOP);
+
+		// Pint Ball
+		g.setColor(ballColor);
+		g.fillRoundRect(ballPosX - 4, ballPosY - 4, 8, 8, 8, 8);
+
+		ballPosX += ballMoveX;
+		ballPosY += ballMoveY;
+
+		boolean changeColor = false;
+		if ((ballPosX < 4) || (ballPosX > width - 4)) {
+			ballMoveX = -ballMoveX;
+			changeColor = true;
+		}
+		if ((ballPosY < 4) || (ballPosY > height - 4)) {
+			ballMoveY = -ballMoveY;
+			changeColor = true;
+		}
+		if (changeColor) {
+			ballColor = ballRandom.nextInt(0xFF) + (ballRandom.nextInt(0xFF) << 8) + (ballRandom.nextInt(0xFF) << 16);
+		}
+	}
+
+
+}

Propchange: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/CanvasPanel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/DateFieldPanel.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/DateFieldPanel.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/DateFieldPanel.java (added)
+++ harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/DateFieldPanel.java Mon May 26 15:20:19 2008
@@ -0,0 +1,32 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.microemu.midp.examples.simpledemo;
+
+import javax.microedition.lcdui.DateField;
+
+public class DateFieldPanel extends BaseExamplesForm {
+
+	public DateFieldPanel() {
+		super("DateField");
+
+		append(new DateField("Time", DateField.TIME));
+		append(new DateField("Date & time", DateField.DATE_TIME));
+	}
+}

Propchange: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/DateFieldPanel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/GaugePanel.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/GaugePanel.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/GaugePanel.java (added)
+++ harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/GaugePanel.java Mon May 26 15:20:19 2008
@@ -0,0 +1,68 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.microemu.midp.examples.simpledemo;
+
+import javax.microedition.lcdui.Gauge;
+
+public class GaugePanel extends BaseExamplesForm implements HasRunnable {
+
+	private boolean cancel = false;
+
+	private Gauge noninteractive = new Gauge("Noninteractive", false, 25, 0);
+
+	private Runnable timerTask = new Runnable() {
+
+		public void run() {
+			while (!cancel) {
+				if (isShown()) {
+					int value = noninteractive.getValue();
+
+					if (noninteractive.getValue() >= 25) {
+						noninteractive.setValue(0);
+					} else {
+						noninteractive.setValue(++value);
+					}
+				}
+				try {
+					Thread.sleep(500);
+				} catch (InterruptedException ex) {
+					break;
+				}
+			}
+		}
+	};
+
+	public GaugePanel() {
+		super("Gauge");
+		append(new Gauge("Interactive", true, 25, 0));
+		append(noninteractive);
+	}
+
+	public void startRunnable() {
+		cancel = false;
+		Thread thread = new Thread(timerTask, "GaugePanelThread");
+		thread.start();
+	}
+
+	public void stopRunnable() {
+		cancel = true;
+	}
+
+}

Propchange: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/GaugePanel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/HTTPPanel.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/HTTPPanel.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/HTTPPanel.java (added)
+++ harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/HTTPPanel.java Mon May 26 15:20:19 2008
@@ -0,0 +1,156 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.microemu.midp.examples.simpledemo;
+
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.microedition.io.Connection;
+import javax.microedition.io.Connector;
+import javax.microedition.io.HttpConnection;
+import javax.microedition.lcdui.Alert;
+import javax.microedition.lcdui.AlertType;
+import javax.microedition.lcdui.Command;
+import javax.microedition.lcdui.Displayable;
+import javax.microedition.lcdui.StringItem;
+import javax.microedition.lcdui.TextField;
+
+/**
+ * @author vlads
+ *
+ */
+public class HTTPPanel extends BaseExamplesForm {
+
+	static final Command goCommand = new Command("Go", Command.OK, 1);
+	
+	// See file src/site/resources/test/index.php
+	static String demoLocation;
+	
+	TextField url;
+	
+	StringItem message;
+	
+	StringItem status;
+	
+	Thread requestThread = null;
+	
+	public HTTPPanel() {
+		super("HTTP Connection");
+		
+		String host = SimpleDemoMIDlet.instance.getAppProperty("microemu.accessible.host");
+		if (host == null) {
+			demoLocation = "http://www.microemu.org/test/";
+		} else {
+			demoLocation = "http://" + host + "/test/";
+		}
+		
+		append(url = new TextField("URL:", demoLocation, 128, TextField.URL));
+		append(message = new StringItem("Message:", null));
+		append(status = new StringItem("Status:", null));
+		
+		addCommand(goCommand);
+	}
+
+	private void makeConnection() {
+		if (requestThread == null) {
+			requestThread = new Thread(new ConnectionRun());
+			requestThread.start();
+		} else {
+			message.setText("Request still running");  
+		}
+	}
+	
+	class ConnectionRun implements Runnable {
+
+		public void run() {
+			tryConnect();
+		}
+	}
+	
+	private void tryConnect() {
+		Connection c = null;
+		InputStream is = null;
+		try {
+			status.setText("Connecting...");
+			c = Connector.open(url.getString(), Connector.READ, true);
+			HttpConnection hcon = (HttpConnection) c;
+			status.setText("http:" + String.valueOf(hcon.getResponseCode()) + " len:" + String.valueOf(hcon.getLength()));
+			int length = (int) hcon.getLength();
+            byte[] data = null;
+            if (length != -1) {
+                data = new byte[length];
+                is = new DataInputStream(hcon.openInputStream());
+                ((DataInputStream)is).readFully(data);
+            } else {
+            	// If content length is not given, read in chunks.
+                int chunkSize = 512;
+                is = hcon.openInputStream();
+                byte[] readData = new byte[chunkSize];
+                int index = 0;
+                do {
+                    int onebyte = is.read();
+                    if (onebyte == -1) {
+                        break;
+                    }
+                    readData[index] = (byte)onebyte;
+                    index ++;
+                    if (readData.length <= index) {
+                        byte[] newData = new byte[index + chunkSize];
+                        System.arraycopy(readData, 0, newData, 0, readData.length);
+                        readData = newData;
+                    }
+                } while (index < 1000);
+                data = new byte[index];
+                System.arraycopy(readData, 0, data, 0, index);
+            }
+            message.setText(new String(data));            
+		} catch (Throwable e) {
+			System.out.println(e.toString());
+			e.printStackTrace();
+			status.setText(e.toString());
+			message.setText("");
+			Alert alert = new Alert("Error", e.getMessage() + " " + e.toString(), null, AlertType.ERROR);
+			alert.setTimeout(Alert.FOREVER);
+			SimpleDemoMIDlet.setCurrentDisplayable(alert);
+		} finally {
+			requestThread = null;
+			if (is != null) {
+                try {
+					is.close();
+				} catch (IOException e) {
+				}
+			}
+            if (c != null) {
+                try {
+					c.close();
+				} catch (IOException e) {
+				}
+            }
+		}
+	}
+	
+	public void commandAction(Command c, Displayable d) {
+		if (c == goCommand) {
+			makeConnection();
+		}
+		super.commandAction(c, d);
+	}
+}

Propchange: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/HTTPPanel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/HasRunnable.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/HasRunnable.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/HasRunnable.java (added)
+++ harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/HasRunnable.java Mon May 26 15:20:19 2008
@@ -0,0 +1,27 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.microemu.midp.examples.simpledemo;
+
+public interface HasRunnable {
+
+	public void startRunnable();
+	
+	public void stopRunnable();
+}

Propchange: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/HasRunnable.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/ImageItemPanel.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/ImageItemPanel.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/ImageItemPanel.java (added)
+++ harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/ImageItemPanel.java Mon May 26 15:20:19 2008
@@ -0,0 +1,44 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.microemu.midp.examples.simpledemo;
+
+import java.io.IOException;
+
+import javax.microedition.lcdui.Image;
+import javax.microedition.lcdui.ImageItem;
+
+public class ImageItemPanel extends BaseExamplesForm {
+
+	public ImageItemPanel() {
+		super("ImageItem");
+
+		try {
+			Image image = Image.createImage("/org/microemu/midp/examples/simpledemo/image.png");
+			append(new ImageItem("Default Layout", image, ImageItem.LAYOUT_DEFAULT, null));
+			append(new ImageItem("Left Layout", image, ImageItem.LAYOUT_LEFT, null));
+			append(new ImageItem("Center Layout", image, ImageItem.LAYOUT_CENTER, null));
+			append(new ImageItem("Right Layout", image, ImageItem.LAYOUT_RIGHT, null));
+		} catch (IOException ex) {
+			append("Cannot load images");
+		}
+
+	}
+
+}

Propchange: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/ImageItemPanel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/KeyCanvasPanel.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/KeyCanvasPanel.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/KeyCanvasPanel.java (added)
+++ harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/KeyCanvasPanel.java Mon May 26 15:20:19 2008
@@ -0,0 +1,217 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.microemu.midp.examples.simpledemo;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Vector;
+
+import javax.microedition.lcdui.Graphics;
+
+public class KeyCanvasPanel extends BaseExamplesCanvas {
+
+	static Hashtable actionNames = new Hashtable();
+	
+	static Hashtable shortNames = new Hashtable();
+	
+	int lastKeyCode = 0;
+
+	int sameKeyCount = 0;
+	
+	int lastKeyRepeatedKeyCode = 0;
+	
+	int keyRepeatedCount = 0;
+	
+	long keyRepeatedTime = 0;
+	
+	long keyRepeatedInitialDellay = 0;
+	
+	String lastKeyEvent = null;
+	
+	Vector keysHistory = new Vector();
+	
+	Vector keysPressed = new Vector();
+	
+	boolean debug = true;
+	
+	static { 		
+		initActionNames();
+	}
+	
+	public KeyCanvasPanel() {
+		super("KeyCanvas");
+	}
+
+	protected void paint(Graphics g) {
+		int width = getWidth();
+        int height = getHeight();
+
+		g.setGrayScale(255);
+		g.fillRect(0, 0, width, height);
+		
+		g.setColor(0);
+		int line = 0;
+		writeln(g, line++, "Key Canvas - Press any key!");
+		if (fullScreenMode) {
+			writeln(g, line++, "Back - same key 3 times");
+		}
+		if (sameKeyCount > 0) {
+			writeln(g, line++, "KeyCode: " + lastKeyCode); 
+			writeln(g, line++, "As char: " +  (char) lastKeyCode);
+			writeln(g, line++, "GameAction: " + gameActionName(getGameAction(lastKeyCode)));
+			writeln(g, line++, "KeyName: " + getKeyName(lastKeyCode));
+			StringBuffer pressed = new StringBuffer();
+			for(Enumeration en = keysPressed.elements(); en.hasMoreElements(); ) {
+			    pressed.append(en.nextElement());
+			}
+			writeln(g, line++, "Pressed: " + pressed.toString());
+			writeln(g, line++, "Event: " + lastKeyEvent);
+		}
+		if (keysHistory.size() > 0) {
+			writeln(g, line++, "- history -");
+			for (int i = keysHistory.size() - 1; i >= 0; i--) {
+				if (writeln(g, line++, (String) keysHistory.elementAt(i)) > height) {
+					break;
+				}
+			}
+		}
+	}
+	
+	public String getKeyName(int keyCode) {
+		try {
+			return super.getKeyName(keyCode);
+		} catch (IllegalArgumentException e) {
+			return "not valid key code";
+		}
+	}
+	
+	protected void keyPressed(int keyCode) {
+		if (lastKeyCode == keyCode) {
+			sameKeyCount ++;
+			if ((fullScreenMode) && (sameKeyCount >= 3)) {
+				setFullScreenMode(false);
+				SimpleDemoMIDlet.showMenu();
+			}
+		} else {
+			sameKeyCount = 1;
+			logEvent(String.valueOf(keyCode) + " " + getKeyName(keyCode));
+		}
+		keyRepeatedTime = System.currentTimeMillis();
+		lastKeyCode = keyCode;
+		lastKeyEvent = "keyPressed";
+		keysPressed.addElement(shortName(keyCode));
+		if (debug) {
+		    System.out.println(lastKeyEvent + " " + keyCode);
+		}
+		repaint();
+	}
+	
+	public void keyReleased(int keyCode) {
+		lastKeyEvent = "keyReleased";
+		lastKeyCode = keyCode;
+		if (debug) {
+            System.out.println(lastKeyEvent + " " + keyCode);
+        }
+		keysPressed.removeElement(shortName(keyCode));
+		keyRepeatedCount = 1;
+        keyRepeatedTime = 0;
+        keyRepeatedInitialDellay = 0;
+		repaint();
+	}
+
+	public void keyRepeated(int keyCode) {
+	    long keyRepeatedDellay = 0;
+		if (lastKeyRepeatedKeyCode == keyCode) {
+			keyRepeatedCount ++;
+		} else {
+			keyRepeatedCount = 1;
+		}
+		keyRepeatedDellay = System.currentTimeMillis() - keyRepeatedTime; 
+        if (keyRepeatedInitialDellay == 0) {
+            keyRepeatedInitialDellay = keyRepeatedDellay;
+        }
+        keyRepeatedTime = System.currentTimeMillis();
+        
+		lastKeyEvent = "keyRepeated (" + Utils.d00(keyRepeatedCount) + ")";
+		if (keyRepeatedDellay != 0) {
+		    lastKeyEvent += " " + keyRepeatedInitialDellay + "/" + keyRepeatedDellay + " ms";
+		}
+		lastKeyCode = keyCode;
+		lastKeyRepeatedKeyCode = keyCode;
+		if (debug) {
+            System.out.println(lastKeyEvent + " " + keyCode);
+        }
+		repaint();
+	}
+
+	private void logEvent(String e) {
+		StringBuffer sb = new StringBuffer();
+        sb.append(Utils.when());
+        sb.append("   ").append(e);
+		keysHistory.addElement(sb.toString());
+	}
+
+	
+	static String gameActionName(int gameAction) {
+		return (String)actionNames.get(new Integer(gameAction));
+	}
+
+	String shortName(int keyCode) {
+	    int gameAction = getGameAction(keyCode);
+        String n = (String)shortNames.get(new Integer(gameAction));
+        if (n != null) {
+            return n;
+        } else {
+            return ""+(char) keyCode;
+        }
+    }
+	
+	private static void actionName(int gameAction, String name, String shortName) {
+		actionNames.put(new Integer(gameAction), name);
+		shortNames.put(new Integer(gameAction), shortName);
+	}
+	
+	private static void initActionNames() {
+		actionName(UP, "UP", "u");
+		actionName(DOWN, "DOWN", "d");
+		actionName(LEFT, "LEFT", "l");
+		actionName(RIGHT, "RIGHT", "r");
+		actionName(FIRE, "FIRE", "f");
+
+		actionName(GAME_A, "GAME_A", "a");
+		actionName(GAME_B, "GAME_B", "b");
+		actionName(GAME_C, "GAME_C", "c");
+		actionName(GAME_D, "GAME_D", "d");
+
+		actionName(KEY_NUM0, "KEY_NUM0", "0");
+		actionName(KEY_NUM1, "KEY_NUM1", "1");
+		actionName(KEY_NUM2, "KEY_NUM2", "2");
+		actionName(KEY_NUM3, "KEY_NUM3", "3");
+		actionName(KEY_NUM4, "KEY_NUM4", "4");
+		actionName(KEY_NUM5, "KEY_NUM5", "5");
+		actionName(KEY_NUM6, "KEY_NUM6", "6");
+		actionName(KEY_NUM7, "KEY_NUM7", "7");
+		actionName(KEY_NUM8, "KEY_NUM8", "8");
+		actionName(KEY_NUM9, "KEY_NUM9", "9");
+		actionName(KEY_STAR, "KEY_STAR", "*");
+		actionName(KEY_POUND, "KEY_POUND", "#");
+	}
+
+}

Propchange: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/KeyCanvasPanel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/ListPanel.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/ListPanel.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/ListPanel.java (added)
+++ harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/ListPanel.java Mon May 26 15:20:19 2008
@@ -0,0 +1,60 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.microemu.midp.examples.simpledemo;
+
+import javax.microedition.lcdui.Command;
+import javax.microedition.lcdui.Displayable;
+import javax.microedition.lcdui.List;
+
+public class ListPanel extends BaseExamplesList {
+
+	String options[] = { "Option A", "Option B", "Option C", "Option D" };
+
+	List lists[] = { new List("Exclusive", List.EXCLUSIVE, options, null),
+			new List("Implicit", List.IMPLICIT, options, null),
+			new List("Multiple", List.MULTIPLE, options, null) };
+
+	public ListPanel() {
+		super("List", List.IMPLICIT);
+
+		for (int i = 0; i < lists.length; i++) {
+			lists[i].addCommand(BaseExamplesForm.backCommand);
+			lists[i].setCommandListener(this);
+			append(lists[i].getTitle(), null);
+		}
+
+	}
+
+	public void commandAction(Command c, Displayable d) {
+		if (d == this) {
+			if (c == List.SELECT_COMMAND) {
+				SimpleDemoMIDlet.setCurrentDisplayable(lists[getSelectedIndex()]);
+			} 
+		} else if (c == BaseExamplesForm.backCommand) {
+			for (int i = 0; i < lists.length; i++) {
+				if (d == lists[i]) {
+					SimpleDemoMIDlet.setCurrentDisplayable(this);
+				}
+			}
+		}
+		super.commandAction(c, d);
+	}
+
+}

Propchange: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/ListPanel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/PointerCanvasPanel.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/PointerCanvasPanel.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/PointerCanvasPanel.java (added)
+++ harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/PointerCanvasPanel.java Mon May 26 15:20:19 2008
@@ -0,0 +1,119 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.microemu.midp.examples.simpledemo;
+
+import javax.microedition.lcdui.Graphics;
+
+public class PointerCanvasPanel extends BaseExamplesCanvas {
+
+	private static final int CROSS_SIZE = 3;
+	
+	int ppX;
+	
+	int ppY;
+
+	int poX;
+	
+	int poY;
+	
+	String lastPointerEvent = null;
+	
+	boolean pointerPressed = false;
+	
+	public PointerCanvasPanel() {
+		super("PointerCanvas");
+	}
+	
+	protected void paint(Graphics g) {
+		int width = getWidth();
+        int height = getHeight();
+
+		g.setGrayScale(255);
+		g.fillRect(0, 0, width, height);
+		
+		g.setColor(0);
+		int line = 0;
+		writeln(g, line++, "Pointer Canvas");
+		if (fullScreenMode) {
+			writeln(g, line++, "Back - Press any key");
+		}
+		
+		if (!hasPointerEvents()) {
+			writeln(g, line++, "Do not have PointerEvents");
+		} else {
+			if (!hasPointerMotionEvents()) {
+				writeln(g, line++, "Do not have PointerMotionEvents");	
+			}
+			
+			if (lastPointerEvent != null) {
+				writeln(g, line++, ppX +"x"+ ppY + " " + lastPointerEvent);
+				
+				if (pointerPressed) {
+					g.setColor(0xFFEE99);
+					g.setStrokeStyle(Graphics.DOTTED);
+				} else {
+					g.setColor(0x5691F0);
+				}
+				g.drawRect(poX, poY, ppX - poX, ppY - poY);
+				g.setStrokeStyle(Graphics.SOLID);
+				
+				g.setColor(0xBB5500);
+				g.drawLine(ppX - CROSS_SIZE, ppY + CROSS_SIZE, ppX + CROSS_SIZE, ppY - CROSS_SIZE);
+				g.drawLine(ppX - CROSS_SIZE, ppY - CROSS_SIZE, ppX + CROSS_SIZE, ppY + CROSS_SIZE);
+			} else {
+				writeln(g, line++, "Click anywhere and drag");	
+			}
+		}
+	}
+
+	public void pointerPressed(int x, int y) {
+		lastPointerEvent = "Pressed " + Utils.when();
+		this.ppX = x;
+		this.ppY = y;
+		this.poX = x;
+		this.poY = y;
+		pointerPressed = true;
+		repaint();
+	}
+
+	public void pointerReleased(int x, int y) {
+		lastPointerEvent = "Released " + Utils.when();
+		this.ppX = x;
+		this.ppY = y;
+		pointerPressed = false;
+		repaint();
+	}
+
+	public void pointerDragged(int x, int y) {
+		lastPointerEvent = "Dragged " + Utils.when();
+		this.ppX = x;
+		this.ppY = y;
+		repaint();
+	}
+	
+	protected void keyPressed(int keyCode) {
+		if (fullScreenMode) {
+			setFullScreenMode(false);
+			repaint();
+		} else {
+			SimpleDemoMIDlet.showMenu();
+		}
+	}
+}

Propchange: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/PointerCanvasPanel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/SimpleDemoMIDlet.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/SimpleDemoMIDlet.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/SimpleDemoMIDlet.java (added)
+++ harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/SimpleDemoMIDlet.java Mon May 26 15:20:19 2008
@@ -0,0 +1,122 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.microemu.midp.examples.simpledemo;
+
+import javax.microedition.lcdui.Command;
+import javax.microedition.lcdui.CommandListener;
+import javax.microedition.lcdui.Display;
+import javax.microedition.lcdui.Displayable;
+import javax.microedition.lcdui.List;
+import javax.microedition.lcdui.Screen;
+import javax.microedition.lcdui.Ticker;
+import javax.microedition.midlet.MIDlet;
+
+public class SimpleDemoMIDlet extends MIDlet implements CommandListener {
+
+	static SimpleDemoMIDlet instance;
+
+	static final Command exitCommand = new Command("Exit", Command.EXIT, 1);
+
+	List menuList = null;
+
+	Displayable screenPanels[];
+
+	public SimpleDemoMIDlet() {
+		instance = this;
+	}
+
+	public void destroyApp(boolean unconditional) {
+		if (screenPanels != null) {
+			for (int i = 0; i < screenPanels.length; i++) {
+				if (screenPanels[i] instanceof HasRunnable) {
+					((HasRunnable) screenPanels[i]).stopRunnable();
+				}
+			}
+		}
+	}
+
+	public void pauseApp() {
+	}
+
+	public void startApp() {
+		if (menuList == null) {
+			screenPanels = new Displayable[] {
+					new AlertPanel(),
+					new CanvasPanel(),
+					new GameCanvasPanel(),
+					new KeyCanvasPanel(),
+					new PointerCanvasPanel(),
+					new DateFieldPanel(),
+					new GaugePanel(),
+					new ImageItemPanel(),
+					new ListPanel(),
+					new TextFieldPanel(),
+					new TextBoxPanel(),
+					new HTTPPanel()};
+
+			Ticker ticker = new Ticker("This is SimpleDemo ticker");
+
+			menuList = new List("SimpleDemo", List.IMPLICIT);
+
+			for (int i = 0; i < screenPanels.length; i++) {
+				menuList.append(screenPanels[i].getTitle(), null);
+				if ((screenPanels[i] instanceof Screen) && (i < 4)) {
+					((Screen)screenPanels[i]).setTicker(ticker);
+				}
+			}
+			menuList.addCommand(exitCommand);
+			menuList.setCommandListener(this);
+		}
+
+		showMenu();
+	}
+
+	public static SimpleDemoMIDlet getInstance() {
+		return instance;
+	}
+
+	public static void showMenu() {
+		setCurrentDisplayable(instance.menuList);
+	}
+	
+	public static void setCurrentDisplayable(Displayable nextDisplayable) {
+		Display display = Display.getDisplay(instance);
+		Displayable current = display.getCurrent();
+		if (current instanceof HasRunnable) {
+			((HasRunnable) current).stopRunnable();
+		}
+		if (nextDisplayable instanceof HasRunnable) {
+			((HasRunnable) nextDisplayable).startRunnable();
+		}
+		display.setCurrent(nextDisplayable);
+	}
+	
+	public void commandAction(Command c, Displayable d) {
+		if (d == menuList) {
+			if (c == List.SELECT_COMMAND) {
+				setCurrentDisplayable(screenPanels[menuList.getSelectedIndex()]);
+			} else if (c == exitCommand) {
+				destroyApp(true);
+				notifyDestroyed();
+			}
+		}
+	}
+
+}

Propchange: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/SimpleDemoMIDlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/TextBoxPanel.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/TextBoxPanel.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/TextBoxPanel.java (added)
+++ harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/TextBoxPanel.java Mon May 26 15:20:19 2008
@@ -0,0 +1,66 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.microemu.midp.examples.simpledemo;
+
+import javax.microedition.lcdui.Command;
+import javax.microedition.lcdui.Displayable;
+import javax.microedition.lcdui.List;
+import javax.microedition.lcdui.TextBox;
+import javax.microedition.lcdui.TextField;
+
+public class TextBoxPanel extends BaseExamplesList {
+
+	TextBox textBoxes[] = { new TextBox("Any character", null, 128, TextField.ANY),
+			new TextBox("Email", null, 128, TextField.EMAILADDR),
+			new TextBox("Numeric", null, 128, TextField.NUMERIC),
+			new TextBox("Phone number", null, 128, TextField.PHONENUMBER),
+			new TextBox("URL", null, 128, TextField.URL),
+			new TextBox("Decimal", null, 128, TextField.DECIMAL),
+			new TextBox("Password", null, 128, TextField.PASSWORD), };
+
+	Command okCommand = new Command("Ok", Command.OK, 2);
+
+	public TextBoxPanel() {
+		super("TextBox", List.IMPLICIT);
+
+		for (int i = 0; i < textBoxes.length; i++) {
+			textBoxes[i].addCommand(BaseExamplesForm.backCommand);
+			textBoxes[i].addCommand(okCommand);
+			textBoxes[i].setCommandListener(this);
+			append(textBoxes[i].getTitle(), null);
+		}
+	}
+
+	public void commandAction(Command c, Displayable d) {
+		if (d == this) {
+			if (c == List.SELECT_COMMAND) {
+				SimpleDemoMIDlet.setCurrentDisplayable(textBoxes[getSelectedIndex()]);
+			}
+		} else if ((c == BaseExamplesForm.backCommand) || (c == okCommand)) {
+			for (int i = 0; i < textBoxes.length; i++) {
+				if (d == textBoxes[i]) {
+					SimpleDemoMIDlet.setCurrentDisplayable(this);
+				}
+			}
+		}
+		super.commandAction(c, d);
+	}
+
+}

Propchange: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/TextBoxPanel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/TextFieldPanel.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/TextFieldPanel.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/TextFieldPanel.java (added)
+++ harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/TextFieldPanel.java Mon May 26 15:20:19 2008
@@ -0,0 +1,45 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.microemu.midp.examples.simpledemo;
+
+import javax.microedition.lcdui.TextField;
+
+public class TextFieldPanel extends BaseExamplesForm {
+
+	TextField textBoxes[] = { new TextField("Any character", null, 128, TextField.ANY),
+			new TextField("Email", null, 128, TextField.EMAILADDR),
+			new TextField("Numeric", null, 128, TextField.NUMERIC),
+			new TextField("Phone number", null, 128, TextField.PHONENUMBER),
+			new TextField("URL", null, 128, TextField.URL),
+			new TextField("Decimal", null, 128, TextField.DECIMAL),
+			new TextField("Password", null, 128, TextField.PASSWORD), };
+
+	public TextFieldPanel() {
+		super("TextField");
+
+		append("Ala ma kota");
+		for (int i = 0; i < textBoxes.length; i++) {
+			//textBoxes[i].addCommand(backCommand);
+			//textBoxes[i].setCommandListener(this);
+			append(textBoxes[i]);
+		}
+
+	}
+}

Propchange: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/TextFieldPanel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/Utils.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/Utils.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/Utils.java (added)
+++ harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/Utils.java Mon May 26 15:20:19 2008
@@ -0,0 +1,48 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.microemu.midp.examples.simpledemo;
+
+import java.util.Calendar;
+import java.util.Date;
+
+/**
+ * @author vlads
+ *
+ */
+public class Utils {
+    
+    public static String d00(int i) {
+        if (i > 9) {
+            return String.valueOf(i);
+        } else {
+            return "0" + String.valueOf(i);
+        }
+    }
+    
+    public static String when() {
+        StringBuffer sb = new StringBuffer();
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(new Date());
+        sb.append(d00(calendar.get(Calendar.HOUR_OF_DAY))).append(":");
+        sb.append(d00(calendar.get(Calendar.MINUTE))).append(":");
+        sb.append(d00(calendar.get(Calendar.SECOND)));
+        return sb.toString();
+    }
+}

Propchange: harmony/enhanced/microemulator/microemu-examples/microemu-demo/src/main/java/org/microemu/midp/examples/simpledemo/Utils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-examples/microemu-fcview/me-2 FCView jsr-75.launch
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-examples/microemu-fcview/me-2%20FCView%20jsr-75.launch?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-examples/microemu-fcview/me-2 FCView jsr-75.launch (added)
+++ harmony/enhanced/microemulator/microemu-examples/microemu-fcview/me-2 FCView jsr-75.launch Mon May 26 15:20:19 2008
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/microemu-fcview"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="microemu-fcview"/>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="--impl org.microemu.cldc.file.FileSystem&#13;&#10;org.microemu.examples.fcview.FCViewMIDlet"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.microemu.app.Main"/>
+</launchConfiguration>

Added: harmony/enhanced/microemulator/microemu-examples/microemu-fcview/pom.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-examples/microemu-fcview/pom.xml?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-examples/microemu-fcview/pom.xml (added)
+++ harmony/enhanced/microemulator/microemu-examples/microemu-fcview/pom.xml Mon May 26 15:20:19 2008
@@ -0,0 +1,176 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns="http://maven.apache.org/POM/4.0.0">
+    <!-- @version $Revision: 1626 $ ($Author: vlads $) $Date: 2008-03-04 21:47:36 -0500 (Tue, 04 Mar 2008) $ -->
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.microemu</groupId>
+        <artifactId>microemu-examples</artifactId>
+        <version>2.0.3-SNAPSHOT</version><!--me-version-->
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>microemu-fcview</artifactId>
+    <name>microemu-fcview</name>
+
+    <description>microemulator File Connection View, jsr-75 example</description>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.microemu</groupId>
+            <artifactId>microemu-jsr-75</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.microemu</groupId>
+            <artifactId>microemu-javase-swing</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+
+<!--
+        <dependency>
+            <groupId>com.pyx4me</groupId>
+            <artifactId>cldcunit</artifactId>
+            <version>${pyx4meVersion}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.pyx4me</groupId>
+            <artifactId>cldcunit-se</artifactId>
+            <version>${pyx4meVersion}</version>
+            <scope>provided</scope>
+        </dependency>
+-->
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+    </dependencies>
+
+    <!--properties>
+        <wtk.optionalpda.enabled>true</wtk.optionalpda.enabled>
+    </properties-->
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.3</source>
+                    <target>1.1</target>
+                    <compilerArguments>
+                        <bootclasspath>${basedir}/../../api/cldcapi11/target/cldcapi11-${project.version}.jar${path.separator}${basedir}/../../api/midpapi20/target/midpapi20-${project.version}.jar</bootclasspath>
+                   </compilerArguments>
+                </configuration>
+            </plugin>
+
+            <!-- Add EclipseME nature to the generated project-->
+            <!--
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-eclipse-plugin</artifactId>
+                <configuration>
+                    <buildcommands>
+                        <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
+                        <buildcommand>eclipseme.core.preverifier</buildcommand>
+                    </buildcommands>
+                    <projectnatures>
+                        <projectnature>org.eclipse.jdt.core.javanature</projectnature>
+                        <projectnature>eclipseme.core.nature</projectnature>
+                    </projectnatures>
+                    <classpathContainers>
+                        <classpathContainer>J2MELIB</classpathContainer>
+                        <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
+                    </classpathContainers>
+                </configuration>
+            </plugin>
+            -->
+
+            <!-- Create application loadable on the phone -->
+            <plugin>
+                <groupId>com.pyx4me</groupId>
+                <artifactId>j2me-maven-plugin</artifactId>
+                <version>${pyx4meVersion}</version>
+                <executions>
+                   <execution>
+                        <goals>
+                            <goal>package</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <useWtkLibs>false</useWtkLibs>
+                    <proguard>true</proguard>
+                    <obfuscate>false</obfuscate>
+                    <proguardPreverify>true</proguardPreverify>
+                    <test>false</test>
+                    <jadAttributes>
+                        <Created-By>Vlad Skarzhevskyy</Created-By>
+                    </jadAttributes>
+                    <midlets>
+                        <MIDlet>
+                            <name>FileBrowser</name>
+                            <class>org.microemu.examples.fcview.FCViewMIDlet</class>
+                        </MIDlet>
+                        <!--MIDlet>
+                            <name>UnitTests</name>
+                            <class>org.microemu.FileUnitTestsMIDLet</class>
+                            <test>true</test>
+                        </MIDlet-->
+                    </midlets>
+                    <libs>
+                        <lib>${basedir}/../../api/cldcapi11/target/cldcapi11-${project.version}.jar</lib>
+                        <lib>${basedir}/../../api/midpapi20/target/midpapi20-${project.version}.jar</lib>
+                    </libs>
+                    <dependencies>
+                        <dependency>
+                            <groupId>org.microemu</groupId>
+                            <artifactId>microemu-javase-swing</artifactId>
+                            <exclude>true</exclude>
+                            <withTrail>true</withTrail>
+                        </dependency>
+                    </dependencies>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-assembly-4download</id>
+                        <phase>site</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <tasks>
+                                <copy overwrite="true"
+                                    file="${project.build.directory}/${project.build.finalName}-me.jar"
+                                    tofile="${project.build.directory}/site/${artifactId}.jar"/>
+                                <copy overwrite="true"
+                                    file="${project.build.directory}/${project.build.finalName}-me.jad"
+                                    tofile="${project.build.directory}/site/${artifactId}.jad"/>
+                                <replace value="${artifactId}.jar" token="${project.build.finalName}-me.jar" dir="${project.build.directory}/site">
+                                    <include name="${artifactId}.jad"></include>
+                                </replace>
+                            </tasks>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+        </plugins>
+    </build>
+
+</project>
\ No newline at end of file

Propchange: harmony/enhanced/microemulator/microemu-examples/microemu-fcview/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/microemulator/microemu-examples/microemu-fcview/src/main/java/org/microemu/examples/fcview/FCViewMIDlet.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/microemulator/microemu-examples/microemu-fcview/src/main/java/org/microemu/examples/fcview/FCViewMIDlet.java?rev=660326&view=auto
==============================================================================
--- harmony/enhanced/microemulator/microemu-examples/microemu-fcview/src/main/java/org/microemu/examples/fcview/FCViewMIDlet.java (added)
+++ harmony/enhanced/microemulator/microemu-examples/microemu-fcview/src/main/java/org/microemu/examples/fcview/FCViewMIDlet.java Mon May 26 15:20:19 2008
@@ -0,0 +1,78 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.microemu.examples.fcview;
+
+import javax.microedition.lcdui.Alert;
+import javax.microedition.lcdui.AlertType;
+import javax.microedition.lcdui.Display;
+import javax.microedition.lcdui.Displayable;
+import javax.microedition.midlet.MIDlet;
+import javax.microedition.midlet.MIDletStateChangeException;
+
+/**
+ * @author vlads
+ *
+ */
+public class FCViewMIDlet extends MIDlet {
+
+	static FCViewMIDlet instance;
+
+	FilesList list;
+	
+	public FCViewMIDlet() {
+		super();
+		instance = this;
+		this.list = new FilesList();
+	}
+
+	
+	protected void startApp() throws MIDletStateChangeException {
+		try {
+			System.out.println("FileConnection " + System.getProperty("microedition.io.file.FileConnection.version"));
+			this.list.setDir(null);
+			setCurrentDisplayable(this.list);
+		} catch (SecurityException e) {
+			Alert alert = new Alert("Error",  "Unable to access the restricted API", null, AlertType.ERROR);
+	        alert.setTimeout(Alert.FOREVER);
+	        setCurrentDisplayable(alert);
+		}
+	}
+
+
+	protected void destroyApp(boolean unconditional) {
+		
+	}
+
+	protected void pauseApp() {
+		
+	}
+
+	public static void setCurrentDisplayable(Displayable nextDisplayable) {
+		Display display = Display.getDisplay(instance);
+		display.setCurrent(nextDisplayable);
+	}
+
+
+	public static void exit() {
+		instance.destroyApp(true);
+		instance.notifyDestroyed();
+	}
+
+}

Propchange: harmony/enhanced/microemulator/microemu-examples/microemu-fcview/src/main/java/org/microemu/examples/fcview/FCViewMIDlet.java
------------------------------------------------------------------------------
    svn:eol-style = native