Touch

This MicroEJ project helps to configure and test the touch panel.
TOOL for UI
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: SDK
Last updated:
1 August 2018
+
<!--
	Markdown
	
	Copyright 2017 IS2T. All rights reserved.
	Modification and distribution is permitted under certain conditions.
	
	IS2T PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
-->

# Overview
This test has several features:
* The **Threshold** test page tests the touch press threshold on a UI object, like a button.
* The **Filtering** test page tests the touch drag event, with the display flickering if a drag event was detected.
* The **Calibration** test page tests the touch coordinates, displaying a grid on the whole screen and printing the coordinates of a touch press.
* The **Drag** test page tests the touch drag event, by displaying all the intermediary touch points between a press and a release
* The **Target** test page tests the touch coordinates, display a target randomly on the screen and printing the delta between the coordinates of a touch press and the center of target.

# Requirements
* MicroEJ SDK 4.0 or later
* Java JDK 1.7 or later 

## Run on device
### Build
1. Right Click on the project.
1. Select **Run as -> Run Configuration**
1. Select **MicroEJ Application** configuration kind
1. Click on **New launch configuration** icon
1. In **Execution** tab
	1. In **Target** frame, in **Platform** field, select a platform
	1. In **Execution** frame
		1. Select **Execute on Device**
1. Press **Apply**
1. Press **Run**

# Dependencies
_All dependencies are retrieved transitively by Ivy resolver_.

# Source
N/A

# Restrictions
None.

Dependencies Discoverer

Tool to list the binary dependencies (class, interfaces, methods, fields) of a piece of code.
TOOL for MISC
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: Studio & SDK
Last updated:
23 January 2018
+
# Overview
This project is a tool to list all dependencies of a Java code and to discover the missing dependencies of this Java code against MicroEJ OS.

# Usage
## Online
1. In your MicroEJ or Eclipse workspace, import this project and drop all your JARs into [classpath](classpath/) folder.
2. Right click on **DependencyDiscoverer** project.
3. Select **Run As -> Java Application**.
4. Double click on **DependencyDiscoverer**.
5. Right click on **DependencyDiscoverer** project.
6. Select Refresh
7. A **result.txt** file will be generated at the root of the project.

## Offline
1. Drop all your JARs into [classpath](classpath/) folder.
2. Get a MicroEJ offline repository (zip archive). For example repository 4.0 from [developer.microej.com/4.0/ivy](http://developer.microej.com/4.0/ivy).
3. Unzip MicroEJ repository into [againstClasspath](againstClasspath/) folder.
4. Set `OFFLINE` variable in [DependencyDiscovererOptions.java](src/com/microej/tool/dependencydiscoverer/DependencyDiscovererOptions.java) to `true`.
5. Right click on **DependencyDiscoverer** project.
6. Select **Run As -> Java Application**.
7. Double click on **DependencyDiscoverer**.
8. Right click on **DependencyDiscoverer** project.
9. Select Refresh
10. A **result.txt** file will be generated at the root of the project.

## Adding additional MicroEJ libraries.
You may have some additional MicroEJ libraries, to include them, drop them into [againstClasspath](againstClasspath) folder.

## Interpreting the results.
Open the **result.txt** file with a text editor. Each line contains a missing dependency. If the file is empty, your library is compatible with MicroEJ OS!

Each line may be :
  * A **class** described as `package.of.class.Class`.
  * An **inner class** described as `package.of.class.Class$InnerClassName` (InnerClassName is a number if it is an anonymous class).
  * A **field** described as `package.of.class.Class.fieldName`.
  * A **constructor** described as `package.of.class.Class.<init>({parameters types see under})V`.
  * A **method** described as `package.of.class.Class.methodName({parameters types see under}){return type}`.
  
The types may be:
  * **B**: byte
  * **C**: char
  * **D**: double
  * **F**: float
  * **I**: int
  * **J**: long
  * **L{ClassName};**: reference to a {ClassName} instance
  * **S**: short
  * **V**: void
  * **Z**: boolean
  * **[{type}**: array of {type} (type may be an array it self)

## Porting a library to MicroEJ OS
To port your library with missing dependencies to MicroEJ OS, the following steps shall be taken:
1. Contact MicroEJ support, some common libraries are available on demand. 
2. Refactor your libraries to avoid those dependencies.

# Requirements
* MicroEJ Studio 4.0 or later, or MicroEJ SDK 4.0 or later, or Eclipse 4.2 or later.
* A JRE 7 or higher.

# Dependencies
None.

# Source
N/A

# Restrictions
None.

Excel to NLS

Transform an Excel file (xlsx) to a set of NLS files.
TOOL for MISC
Supported MicroEJ Version: 4.0
Supported MicroEJ Edition: SDK
Last updated:
23 January 2017
+
# Overview
Internalization is an important part of many projects so that users can select the language they want for their system. MicroEJ offers a library named NLS (National Language Support) to help developers internationalize the messages in their applications. NLS imposes the structure of the translation files, with a simple and efficient "[key]=[message]" format. Nevertheless, each company may have its own format for the translation files they share with their translators, often using Microsoft Excel.

Here, we demonstrate how an Excel file (xlsx) can be converted to files in NLS format. We use the Apache POI library to perform this transformation. You can adapt this tool to your specific file format.

Two Eclipse projects are provided:
1. [Excel-to-NLS](/Excel-to-NLS) converts an Excel file to a set of NLS files and saves them as resources of the second project.
2. [HelloWorld](/HelloWorld) takes all the generated files and uses NLS library to display the same message in several languages.

## Project Setup
Excel-to-NLS comes without the JAR files from Apache POI. You have to download them from http://poi.apache.org. You have to copy the following JAR files to the [lib](/Excel-to-NLS/lib) folder of the project:
- poi-[version].jar
- poi-ooxml-[version].jar
- poi-ooxml-schemas-[version].jar
- xmlbeans-[version].jar

Then, right-click on the project and select **Properties**. In the left menu, select **Java Build Path** and open the **Libraries** tab. Add the above JARs to the Java build path.

HelloWorld is already fully configured.

### Project structure
- Tool-Excel-to-NLS

 - Excel-to-NLS
  - `excel/`:  folder with a example xlsx file
  - `launches/`: Java launch configuration
  - `lib/`:  folder to place the required JAR files  
  - `src/main/java/`: Java sources
  
 - HelloWorld
  - `excel/`:  folder with a example xlsx file
  - `launches/`: MicroEJ launch configuration 
  - `src/main/java/`: Java sources
  - `src/main/resources/`: resources
  
 - `LICENCE.md`
 - `README.md`

# Usage
## Run XLS to NLS tool
1. Execute the App class of the Excel-to-NLS project as a regular Java Application. A [Java launch configuration](/Excel-to-NLS/launches/Excel-to-NLS.launch) is provided for convenience, right-click on [launches/Excel-to-NLS.launch](/Excel-to-NLS/launches/Excel-to-NLS.launch) and select **Run as->Excel-to-NLS**. This will generate a set of NLS files and drop them in the appropriate folder of the HelloWorld project.

2. Execute the [Main](/HelloWorld/src/main/java/ej/examples/nls/Main.java) class of the HelloWorld project as a MicroEJ Application. A [MicroEJ launch configuration](/HelloWorld/launches/HelloWorld on STM32429I-DISCO SimJPF.properties) is provided with the path to the [nls.list](/HelloWorld/src/main/resources/nls.list) file properly configured. This will print the same message with all the available locales in the Eclipse console.

## Run on MicroEJ Simulator
1. Right Click on [Main.java](HelloWorld/src/main/java/ej/examples/nls/Main.java)
2. Select **Run as -> Run Configuration** 
3. Select **MicroEJ Application** configuration kind
4. Click on **New launch configuration** icon
5. Go to **Execution** tab
	* Select your platform 
6. Go to **Configuration** tab
	* Go to **Libraries -> NLS**
		* Check Use NLS messages
		* Set the **NLS list file** to`${project_loc:HelloWorld}/src/main/resources/HelloWorld/HelloWorld.nls.list`
7. Press **Apply**
8. Press **Run**


## Run on device
### Build
1. Right Click on [Main.java](HelloWorld/src/main/java/ej/examples/nls/Main.java)
2. Select **Run as -> Run Configuration**
3. Select **MicroEJ Application** configuration kind
4. Click on **New launch configuration** icon
5. Select **Execute on Device**
6. Select **Build & Deploy**
7. Go to **Execution** tab
	* Select your platform 
8. Go to **Configuration** tab
	* Go to **Libraries -> NLS**
		* Check Use NLS messages
		* Set the **NLS list file** to`${project_loc:HelloWorld}/src/main/resources/HelloWorld/HelloWorld.nls.list`
9. Press **Apply**
10. Press **Run**
11. Copy the generated `.out` file path

### Flash
1. Use the appropriate flashing tool.

# Requirements
* MicroEJ Studio or SDK 4.0 or later
* A platform with at least:
	* EDC-1.2 or higher
	* NLS-2.0 or higher
	
## Dependencies
_All dependencies are retrieved transitively by Ivy resolver_.

# License
See the license file [LICENSE.md](LICENSE.md) located at the root of this repository.

# Changes
See the changelog file [CHANGELOG.md](CHANGELOG.md) located at the root of this repository.

Dependencies Discoverer

Tool to list the binary dependencies (class, interfaces, methods, fields) of a piece of code.
TOOL for MISC
Supported MicroEJ Version: 4.0
Supported MicroEJ Edition: Studio & SDK
Last updated:
23 January 2017
+
# Overview
This project is a tool to list all dependencies of a Java code and to discover the missing dependencies of this Java code against MicroEJ OS.

# Usage
## Online
1. In your MicroEJ or Eclipse workspace, import this project and drop all your JARs into [classpath](classpath/) folder.
2. Right click on **DependencyDiscoverer** project.
3. Select **Run As -> Java Application**.
4. Double click on **DependencyDiscoverer**.
5. Right click on **DependencyDiscoverer** project.
6. Select Refresh
7. A **result.txt** file will be generated at the root of the project.

## Offline
1. Drop all your JARs into [classpath](classpath/) folder.
2. Get a MicroEJ offline repository (zip archive). For example repository 4.0 from [developer.microej.com/4.0/ivy](http://developer.microej.com/4.0/ivy).
3. Unzip MicroEJ repository into [againstClasspath](againstClasspath/) folder.
4. Set `OFFLINE` variable in [DependencyDiscovererOptions.java](src/com/microej/tool/dependencydiscoverer/DependencyDiscovererOptions.java) to `true`.
5. Right click on **DependencyDiscoverer** project.
6. Select **Run As -> Java Application**.
7. Double click on **DependencyDiscoverer**.
8. Right click on **DependencyDiscoverer** project.
9. Select Refresh
10. A **result.txt** file will be generated at the root of the project.

## Adding additional MicroEJ libraries.
You may have some additional MicroEJ libraries, to include them, drop them into [againstClasspath](againstClasspath) folder.

## Interpreting the results.
Open the **result.txt** file with a text editor. Each line contains a missing dependency. If the file is empty, your library is compatible with MicroEJ OS!

Each line may be :
  * A **class** described as `package.of.class.Class`.
  * An **inner class** described as `package.of.class.Class$InnerClassName` (InnerClassName is a number if it is an anonymous class).
  * A **field** described as `package.of.class.Class.fieldName`.
  * A **constructor** described as `package.of.class.Class.<init>({parameters types see under})V`.
  * A **method** described as `package.of.class.Class.methodName({parameters types see under}){return type}`.
  
The types may be:
  * **B**: byte
  * **C**: char
  * **D**: double
  * **F**: float
  * **I**: int
  * **J**: long
  * **L{ClassName};**: reference to a {ClassName} instance
  * **S**: short
  * **V**: void
  * **Z**: boolean
  * **[{type}**: array of {type} (type may be an array it self)

## Porting a library to MicroEJ OS
To port your library with missing dependencies to MicroEJ OS, the following steps shall be taken:
1. Contact MicroEJ support, some common libraries are available on demand. 
2. Refactor your libraries to avoid those dependencies.

# Requirements
* MicroEJ Studio 4.0 or later, or MicroEJ SDK 4.0 or later, or Eclipse 4.2 or later.
* A JRE 7 or higher.

# Dependencies
None.

# Source
N/A

# Restrictions
None.

Excel to NLS

Transform an Excel file (xlsx) to a set of NLS files.
TOOL for MISC
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
31 July 2015
+
# Overview
Internalization is an important part of many projets so that users can select the language they want for their system. MicroEJ offers a library named NLS (National Language Support) to help developers to internationalize the messages in their applications. NLS imposes the structure of the translation files, with a simple and efficient "[key]=[message]" format. Nevertheless, each company may be have their own format for the translation files they share with their translators, often using Microsoft Excel.

Here, we demonstrate how an Excel file (xlsx) can be converted to files that respect the NLS format. We use the Apache POI library to make this transformation. You can adapt this tool to your specific file format.

Two Eclipse projets are provided:
1. Excel-to-NLS converts an Excel file to a set of NLS files and drops the result in the second project.
2. HelloWorld takes all the generated files and uses NLS to display the same message in several languages.

## Project Setup
Excel-to-NLS comes without the JAR files from Apache POI. You have to download them from http://poi.apache.org. You have to copy the following JAR files to the `lib` folder of the project:
- poi-[version].jar
- poi-ooxml-[version].jar
- poi-ooxml-schemas-[version].jar
- xmlbeans-[version].jar

Then, right-click on the project and select Properties. In the left menu, select Java Build Path and open the Libraries tab. Add the above JARs to the Java build path.

HelloWorld is already fully configured.

### Requirements
MicroEJ 3.1.0 or above must be installed on your computer.

### Project structure
- Tool-Excel-to-NLS

 - Excel-to-NLS
  - `excel/`:  folder with a example xlsx file
  - `launches/`: Java launch configuration
  - `lib/`:  folder to place the dependency JAR files  
  - `src/main/java/`: Java sources
  
 - HelloWorld
  - `excel/`:  folder with a example xlsx file
  - `launches/`: MicroEJ launch configuration 
  - `src/main/java/`: Java sources
  - `src/main/resources/`: resources
  
 - `LICENCE.md`
 - `README.md`


## Usage
First, execute the App class of the Excel-to-NLS project. A Java launch configuration is provided for convenience, right-click on launchs/Excel-to-NLS.launch and select Run as->Excel-to-NLS. This will generate a set of NLS files and drop them in the appropriate folder of the HelloWorld project.

Second, execute the Main class of the HelloWorld project. A MicroEJ launch configuration is provided with the path to the NLS.list properly configured. This will print the same message with all the available locales in the Eclipse console.

## License
See the license file `LICENSE.md` located at the root of this repository.

Touch

This MicroEJ project helps to configure and test the touch panel.
TOOL for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
16 June 2015
+
# Overview
This MicroEJ project helps to configure and test the touch panel:
- Filtering: drag events must not be generated when a finger is pressed but not moving.
- Calibration: position of touch panel on the screen.
- Drag distribution: the drag events position must be regularly distributed when swiping.

It is useful to run this project to test the BSP touch panel driver and make sure the events sent to the Java MicroUI library are correct.
 
## Project Setup
First of all, you have to download the repository by using the Download button or by cloning the repository.
After having retrieved the repository content, open your MicroEJ and then import Existing project into workspace by selecting either the ZIP file or the root directory.

### Requirements
- JRE 7 (or later) x86
- MicroEJ 3.1 or later
- The Java platform to test with at least: EDC 1.2 & MicroUI 1.5.

### Project structure
- `Tool-Java-Touch/src/main/java`: Java sources.
	- `com.is2t.pointer.framework`: test framework.
	- `com.is2t.pointer.tests`: all tests.

## Usage
To launch the application, right-click on the `com.is2t.pointer.tests.TestsPointer` class,
select `Run as`, `MicroEJ Application` and choose the platform to test.
To run it on the hardware, go to `Run` menu, `Run Configurationsâ¦`, choose the `TestsPointer` launch,
in `Execution` tab choose `Execute on EmbJPF` and `Run`.

Each test can be run independently: select the test and follow the same procedure.

## Changes
2015/06/15: initial version.

## License
See the license file `LICENSE.md` located at the root of this repository.

Sonar

This project presents how to run the SonarQube(TM) source code quality analyzer on a MicroEJ Java project.
TOOL for MISC
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
16 April 2015
+
# Overview
This project presents how to run the SonarQube⢠source code quality analyzer on a MicroEJ Java project.
This project installs and runs a local SonarQube server and provides locally a report holding the code inspection.

SonarQube is a an open source platform for continuous inspection of code quality. SonarQube offers reports on duplicated code, coding standards, unit tests, code coverage, code complexity, potential bugs, comments and architecture.

SonarQube is available at www.sonarqube.org.

### Requirements
- JRE 7 x86 or later.
- MicroEJ 3.0 or later.

### Project structure
- `launches/`: Ant analysis launch.
- `lib/`: SonarQube server & client, HTTP ant task.
- `rules/`: MicroEJ coding rules.
- `scripts/`: ant scripts to run SonarQube server and execute analysis.
- `LICENSE.md`.
- `README.md`.

### Configuration
You can either runs the SonarQube analysis on one of the MicroEJ java example (see 1) or one of your Java project (see 2).
1- The provided example assumes the MyMVCSample example Java project is present in the workspace. To do that: File->New->MicroEJ->Java Example-> select any JPF (e.g. STM32F429I-DISCO KickStart) and select MicroUI->MVC example.
2- Open the ExampleTool-Sonar/scripts/sonarAnalysis.ant file, edit it to match the project you want to analyze:
- pathelement location,
- sonar.projectName,
- sonar.projectKey,
- sonar.projectVersion.

## Usage
### Launch an analysis
- Launch MicroEJ.
- File->Import->General->Existing project into workspace: import ExampleTool-Sonar folder.
- Edit the configuration (/scripts/sonarAnalysis.ant) as described in the configuration section if needed.
- Right-click on scripts/sonarAnalysis.ant->Run asâ¦->Ant build.
- The server is automatically started.
- The report can be viewed at http://localhost:9000/dashboard/index/com.is2t:MyMVCSample (note: adapt the path to match your project's name if required).

### Launch the server
- Right-click on scripts/sonarServer.ant->Run asâ¦->Ant build.
- All your previous analysis are available at http://localhost:9000/.

## Changes
- Initial version.

## License
See the license file 'LICENSE.md' located at the root of this repository.