Example SmartHome (Standalone)

SmartHome UI using Widget Library
EXAMPLE for UI
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: SDK
Last updated:
23 January 2018
[//]: # (Markdown)
[//]: # (Copyright 2017 IS2T. All rights reserved.)
[//]: # (For demonstration purpose only.)
[//]: # (IS2T PROPRIETARY. Use is subject to license terms.)

# Overview
Connect to various appliances (thermostats, lights, doors, power controls...), monitor and control them with useful services including home status overview, and various control for temperature, light and door.
This project contains the business and view of smarthome, as well as an entry point.

# Usage
## Run on MicroEJ Simulator
1. Right Click on the project
2. Select **Run as -> MicroEJ Application**
3. Select your platform 
4. Press **Ok**

## Run on device
### Build
1. Right Click on [Main.java](com.microej.demo.smarthome/src/main/java/com/microej/demo/smarthome/Main.java)
2. Select **Run as -> Run Configuration** 
3. Select **MicroEJ Application** configuration kind
4. Click on **New launch configuration** icon
5. In **Execution** tab
	1. In **Target** frame, in **Platform** field, select a relevant platform (but not a virtual device)
	2. In **Execution** frame
		1. Select **Execute on Device**
		2. In **Settings** field, select **Build & Deploy**
	3. In **Configuration** frame
		1. In **Target->Memory** set
			1. **Java heap size** to **65536**.
			2. **Number of threads** to **6**.
			3. **Maximum size of thread stack** to **5**.
6. Press **Apply**
7. Press **Run**
8. Copy the generated `.out` file path

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

# Requirements
* MicroEJ Studio or SDK 4.1 or later
* A platform with at least:
  * EDC-1.2 or higher
  * BON-1.2 or higher
  * MICROUI-2.0 or higher

# Dependencies
_All dependencies are retrieved transitively by Ivy resolver_.

# Source
N/A

# Restrictions
None.

Demo Widget

This demo illustrates the Widget library based on MicroUI 2 and MWT 2.
EXAMPLE for UI
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: Studio & SDK
Last updated:
23 January 2018
# Overview
This demo illustrates the Widget library (`ej.widget`, `ej.style`, `ej.animation`, `ej.color`) based on MicroUI 2 and MWT 2.
The main page allows to lead to all the pages of the application illustrating the following widgets:

* button,
* label,
* scrolling list,
* scroll bar,
* slider,
* radio button,
* check box,
* switch,
* progress bar,
* vertical lists,
* keyboard,
* chart,
* wheel,
* carousel.

# Rendering
This demo includes various implementations of widgets and screen transitions.

## Vector drawings
Widgets are drawn using 2D primitives with and without anti-aliasing. This approach uses more CPU time but no ROM (no graphic resources except the code itself).

See `GraphicsContext` and `AntiAliasedShapes` classes for more information. 

## Raster graphics (images)
Widgets are drawn using images. This approach requires more ROM depending on the size and number of images used. It is most of the time faster than vector drawing and requires less CPU load.

Images can be either embedded encoded (PNG for example, decoded at runtime) or embedded as bitmaps (directly drawn to the display, the conversion is done on at build time).

See UI reference manual for more information.

## Pictograms (monochrome images)
Widgets are drawn using monochrome images that can be colored dynamically. This approach requires less ROM than using colorful images but can only be applied for monochrome elements.

It can be achieved using fonts (MicroEJ font designer can import images into a font) or monochrome images with alpha transparency.

See UI reference manual for more information.

# Transitions
This demo includes two implementations of screens transition.

## Snapshot
Screens are dynamically created as images (buffer in RAM) for the transition. This approach requires more RAM (twice the size of the screen in buffers) but is faster than the 2nd implementation.

## Dynamic
Screens are drawn while moving. For each step of the transition, all widgets are drawn in the moving screen. This approach uses more CPU but less RAM. Transition speed might be slower depending on the number of widgets to draw.


# Project Setup
First of all, you have to download the entire repository by using the `Download` button or by cloning the repository. After having retrieved the repository content, open MicroEJ and then import _Existing project into workspace_ by selecting either the ZIP file or the root directory.

## Requirements
* MicroEJ Studio or SDK 4.1 or later
* A platform with at least:
  * EDC-1.2 or higher
  * MICROUI-2.0 or higher
  * MWT-2.1 or higher
* Hardware: this demo has been tested on ST STM32F746G-DISCO (480x272 display) board.

## Project structure
* `src/main/java`: Java sources.
  * `com.microej.demo.widget.keyboard`: layouts of the keyboard.
  * `com.microej.demo.widget.page`: pages of the demo.
  * `com.microej.demo.widget.style`: look and feel management of the demo.
  * `ej.widget`: additional widgets.
  * `MainActivity`: activity of the sandboxed demo.
  * `WidgetsDemo`: entry point of the standalone demo.
* `src/main/resources`: images, fontsâ¦

# Usage
## Run on MicroEJ Simulator
1. Right Click on the project
1. Select **Run as -> MicroEJ Application**
1. Select your platform 
1. Press **Ok**

## Run on device
### Build
1. Right Click on [WidgetsDemo.java](ej.demo.ui.widget/src/main/java/com/microej/demo/widget/WidgetsDemo.java)
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 relevant platform (but not a virtual device)
	1. In **Execution** frame
		1. Select **Execute on Device**
		1. In **Settings** field, select **Build & Deploy**
1. Press **Apply**
1. Press **Run**
1. Copy the generated `.out` file path shown by the console

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

# MicroUI vs. MWT+Widget
By default, consider using MWT+Widget.
It is however possible to develop a GUI with MicroUI without MWT+Widget libraries:

* when there is no or little user interaction,
* for simple screens and a limited number of widgets,
* for simple screen layout,
* for small screens (which implies they need to be simple!),
* for quick image-based design tests.

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

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

How-to use the Widget Library

This library contains simple examples to understand how to use the main Widgets library APIs.
HOWTO for UI
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: SDK
Last updated:
29 August 2017
# Overview
This library contains simple examples to understand how to use the main Widgets library APIs. It is recommended to study them in the following order :

- [com.microej.howto.mwt.colors.Gradient](Widgets-Get-Started/src/main/java/com/microej/howto/mwt/colors/Gradient.java)

![Gradient](screenshots/Gradient.png)


# Usage
For each example:
## Run on MicroEJ Simulator
1. Right Click on the example to run `.java` file
2. Select **Run as -> MicroEJ Application**
3. Select your platform 
4. Press **Ok**


## Run on device
### Build
1. Right Click on the example to build `.java` file
2. Select **Run as -> Run Configuration** 
3. Select **MicroEJ Application** configuration kind
4. Click on **New launch configuration** icon
5. In **Execution** tab
	1. In **Target** frame, in **Platform** field, select a relevant platform (but not a virtual device)
	2. In **Execution** frame
		1. Select **Execute on Device**
		2. In **Settings** field, select **Build & Deploy**
6. Press **Apply**
7. Press **Run**
8. Copy the generated `.out` file path
	
# Requirements
* MicroEJ Studio or SDK 4.0 or later
* A platform with at least:
	* EDC-1.2 or later
	* BON-1.2 or later
	* MICROUI-2.0 or later
	* MWT-2.1 or later

* Add the following line to your `module.ivy` or your `ivy.xml`:
> `<dependency org="ej.library.ui" name="widget" rev="2.0.0-alpha.10"/>`


# Dependencies
_All dependencies are retrieved transitively by Ivy resolver_.


# Source
N/A

# Restrictions
None.

How-to use the MicroUI Library

This library contains simple examples to understand how to use the main MicroUI library APIs.
HOWTO for UI
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: SDK
Last updated:
29 August 2017
<!--
	Markdown
	Copyright 2016 IS2T. All rights reserved.
	Use of this source code is governed by a BSD-style license that can be found at http://www.is2t.com/open-source-bsd-license/.
-->

# Overview
This library contains simple examples to understand how to use the main MicroUI library APIs. It is recommended to study them in the following order :


- [com.microej.howto.microui.drawing.Primitives](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/drawing/Primitives.java)

![Primitives](screenshots/Primitives.png)

- [com.microej.howto.microui.drawing.PrimitivesAntiAliased](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/drawing/PrimitivesAntiAliased.java)

![PrimitivesAntiAliased](screenshots/PrimitivesAntiAliased.png)

- [com.microej.howto.microui.font.Text](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/font/Text.java)

![Text](screenshots/Text.png)

- [com.microej.howto.microui.font.PictosWithCustomFont](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/font/PictosWithCustomFont.java)

![PictosWithCustomFont](screenshots/PictosWithCustomFont.png)

- [com.microej.howto.microui.image.TransparentImages](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/image/TransparentImages.java)

![TransparentImages](screenshots/TransparentImages.png)

- [com.microej.howto.microui.image.FlippedImages](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/image/FlippedImages.java)

![FlippedImages](screenshots/FlippedImages.png)

- [com.microej.howto.microui.image.RotatedImages](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/image/RotatedImages.java)

![RotatedImages](screenshots/RotatedImages.png)

- [com.microej.howto.microui.image.ScaledImages](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/image/ScaledImages.java)

![ScaledImages](screenshots/ScaledImages.png)

- [com.microej.howto.microui.image.TilingWithImages](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/image/TilingWithImages.java)

![TilingWithImages](screenshots/TilingWithImages.png)

- [com.microej.howto.microui.image.DeformedImages](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/image/DeformedImages.java)

![DeformedImages](screenshots/DeformedImages.png)

- [com.microej.howto.microui.events.InputEvents](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/events/InputEvents.java)

![InputEvents](screenshots/InputEvents.png)

- [com.microej.howto.microui.animation.AnimationSampleWithFullRepaint](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/animation/AnimationSampleWithFullRepaint.java)

- [com.microej.howto.microui.animation.AnimationSampleWithFlyingImage](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/animation/AnimationSampleWithFlyingImage.java)


Note that the same set of resources (images and fonts) is used across all of the examples.

# Usage
For each example:
## Run on MicroEJ Simulator
1. Right Click on the example to run `.java` file
2. Select **Run as -> MicroEJ Application**
3. Select your platform 
4. Press **Ok**


## Run on device
### Build
1. Right Click on the example to build `.java` file
2. Select **Run as -> Run Configuration** 
3. Select **MicroEJ Application** configuration kind
4. Click on **New launch configuration** icon
5. In **Execution** tab
	1. In **Target** frame, in **Platform** field, select a relevant platform (but not a virtual device)
	2. In **Execution** frame
		1. Select **Execute on Device**
		2. In **Settings** field, select **Build & Deploy**
6. Press **Apply**
7. Press **Run**
8. Copy the generated `.out` file path
	
# Requirements
* MicroEJ Studio or SDK 4.0 or later
* A platform with at least:
	* EDC-1.2 or higher
	* BON-1.2 or higher
	* MICROUI-2.0 or higher

# Dependencies
_All dependencies are retrieved transitively by Ivy resolver_.

# Credits


| <p align="center">Font</p> | <p align="center">Author</p> | <p align="center">License</p> |
| --- | :---: | --- |
| Font Awesome | Dave Gandy <br/> http://fontawseome.io  | [SIL OFL 1.1 license - http://scripts.sil.org/OFL](/MicroUI-Get-Started/src/main/resources/fonts/OFL.txt)|
| Sans | Adobe |[SIL Open Font License.txt](/MicroUI-Get-Started/src/main/resources/fonts/Adobe-Source-SIL-Open-Font-License.txt)|


# Source
N/A

# Restrictions
None.

Arabic Font (Standalone)

Example that shows how to use arabic fonts.
EXAMPLE for UI
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: SDK
Last updated:
29 August 2017
# Overview
This example shows how to use the arabic fonts.

# Usage

1. First of all, you must have a font containing the characters of the unicode block called `Arabic Presentation Forms-B` i.e. the range `0xFE70-0xFEFF`.

2. Then your strings must be formed with the characters of this range too (as you can see with the strings of HowToUseArabicFontDisplayable.TITLE and HowToUseArabicFontDisplayable.AVAILABLE_TEXTS, /u0020 corresponds to the space character).
3. Finally the order of the strings must be reversed.

## Run on MicroEJ Simulator
1. Right Click on the project
1. Select **Run as -> MicroEJ Application**
1. Select your platform 
1. Press **Ok**

## Run on device
### Build
1. Right Click on [HowToUseArabicFont.java](HowToUseArabicFont/src/main/java/com/microej/example/arabicfont/HowToUseArabicFont.java)
1. Select **Run as -> Run Configuration**
1. Select **MicroEJ Application** configuration kind
1. Click on **New launch configuration** icon
1. Select **Execute on Device**
1. Select **Build & Deploy**
1. Go to **Execution** tab
	* Select your platform 
1. Press **Apply**
1. Press **Run**
1. 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
	* MICROUI-2.0 or higher
	
## Dependencies
_All dependencies are retrieved transitively by Ivy resolver_.

# Source
N/A

# Restrictions
None.

Motion

Motion library, providing animated tasks and a set of defined motions.
LIBRARY for UI
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: Studio & SDK
Last updated:
6 July 2017
<!--
	Markdown
	Copyright 2014-2016 IS2T. All rights reserved.
	IS2T PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
-->

# Overview
A motion library, providing animated tasks and a set of defined motions 
(linear, elastic, bounce, etc.), useful for HMI animations.

# Usage
Add the following line to your `module.ivy` or your `ivy.xml`:
> `<dependency org="ej.library.runtime" name="components" rev="3.+"/>`

# Requirements
  - EDC-1.2 or higher
  - BON-1.2 or higher

# Dependencies
None.

# Source
N/A

# Restrictions
None.

Widget

Widget library.
LIBRARY for UI
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: Studio & SDK
Last updated:
6 July 2017
<!--
	Markdown
	Copyright 2015-2016 IS2T. All rights reserved.
	IS2T PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
-->

# Overview
This library contains all that is necessary to create an HMI on MWT 2:
- a dynamic style resolution (_ej.style_),
- a set of widgets (_ej.widget_),
- a set of containers (_ej.widget.container_),
- an animation framework (_ej.animation_),
- a navigation framework (_ej.widget.navigation_),
- some color utilities (_ej.color_).

# Style
The style framework is used to customize a user interface.

A style is a set of attributes to apply to an element (spacing, coloring, font, size, etc.).

The stylesheet is augmented with rules: a selector associated with a partial style. The rules are ordered from the most specific to the least one. The resolution of an element style is done by applying the rules matching the element (in order), then inheriting a part of its parents style (recursively), then completing it by the default style. 

# Widgets
The widgets are graphical elements on which a style can be applied.

The framework contains a set of predefined widgets: label, image, button, toggle, radio, check, switch, text, slider, scrollbar, progress bar.

It is also possible to create its own widgets by subclassing StyledWidget.

# Containers
The containers are graphical elements on which a style can be applied and that can contain other elements (widgets or containers). Each container defines a policy to lay out its children.

The framework contains a set of predefined layout policies: canvas, dock, grid, list, scroll, split.

It is also possible to create its own layout policies by subclassing StyledComposite.

# Animation
The animation framework provides an animator that can schedule several animations at the same framerate.

# Navigation
The navigation framework provides the capability to navigate from one page to another and going back to pages history.

The pages are composed of widgets and containers. A page is represented by a URL.

A URL resolver is responsible for creating the pages from a URL.

A pages stack manages the history of pages. It can either keep the pages in cache or create it again while going back to history.

The navigation desktop associates a URL resolver and a pages stack to navigate between the pages. It may also animate the transition between the pages.

# Color
The color utilities provide some convenient functions to manipulate the colors.

The color helper manipulates (decompose, recompose) the color components red, green, blue.

The light helper computes and modifies the level of light in a color.

# Usage
Add the following line to your `module.ivy` or your `ivy.xml`:
> `<dependency org="ej.library.ui" name="widget" rev="2.2.0"/>`
	
# Requirements
  - EDC 1.2 or later
  - BON 1.2 or later
  - MICROUI 2 or later
  - MWT 2 or later

# Dependencies
_All dependencies are retrieved transitively by Ivy resolver_.

# Source
N/A

# Restrictions
None.

MicroUI (Foundation Library API)

The MicroEJ User Interface and User eXperience API.
LIBRARY for UI
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: Studio & SDK
Last updated:
5 July 2017
<!--
	Markdown
	Copyright 2015-2016 IS2T. All rights reserved.
	IS2T PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
-->

# Overview
This library contains classes and interfaces stubs of Micro User Interface API (ESR002).

# Usage
Add the following line to your `module.ivy` or your `ivy.xml`:
> `<dependency org="ej.api" name="microui" rev="2.+"/>`

# Requirements
  - EDC-1.2 or higher
  - BON-1.2 or higher

# Dependencies
None.

# Source
N/A

# Restrictions
None.

MWT

This library contains all that is necessary to create an HMI with widgets.
LIBRARY for UI
Supported MicroEJ Version: 4.1
Supported MicroEJ Edition: Studio & SDK
Last updated:
5 July 2017
<!--
	Markdown
	Copyright 2015-2017 IS2T. All rights reserved.
	IS2T PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
-->

# Overview
This library contains all that is necessary to create an HMI with widgets.

# Usage
Add the following line to your `module.ivy` or your `ivy.xml`:
> `<dependency org="ej.library.ui" name="mwt" rev="2.2.0"/>`
	
# Requirements
  - EDC 1.2 or later
  - BON 1.2 or later
  - MICROUI 2 or later

# Dependencies
_All dependencies are retrieved transitively by Ivy resolver_.

# Source
N/A

# Restrictions
None.

B&W Smartwatch using MWT (Standalone)

A black and white smartwatch. This application has been designed for a 240x240 screen. It has been tested on a STM32-F412-DISCO board.
EXAMPLE for UI
Supported MicroEJ Version: 4.0
Supported MicroEJ Edition: SDK
Last updated:
23 January 2017
# Overview
A black and white smartwatch. This application has been designed for a 2BPP 240x240 screen. It has been tested on a STM32-F412-DISCO board.

![BlackClock](screenshots/BlackClock.png) ![Weather](screenshots/Weather.png) ![DigitalClock](screenshots/DigitalClock.png) ![Distance](screenshots/Distance.png) ![Battery](screenshots/Battery.png) ![Notifications](screenshots/Notifications.png)

## Usage
## Run on MicroEJ Simulator
1. Right Click on the project
2. Select **Run as -> MicroEJ Application**
3. Select your platform 
4. Press **Ok**


## Run on device
### Build
1. Right Click on [SmartWatchApp.java](src/main/java/com/microej/demo/smartwatch/SmartWatchApp.java)
2. Select **Run as -> Run Configuration**
3. Select **MicroEJ Application** configuration kind
4. Click on **New launch configuration** icon
5. In **Execution** tab
	1. In **Target** frame, in **Platform** field, select a relevant platform (but not a virtual device)
	2. In **Execution** frame
		1. Select **Execute on Device**
		2. In **Settings** field, select **Build & Deploy**
6. Press **Apply**
7. Press **Run**
8. Copy the generated `.out` file path shown by the console

### 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
	* MICROUI-2.0 or higher
	* MWT-2.0 or higher

## Dependencies
_All dependencies are retrieved transitively by Ivy resolver_.

# Source
N/A

## Restrictions
None.

B&W Smartwatch using MWT (Sandboxed)

A black and white smartwatch. This application has been designed for a 240x240 screen. It has been tested on a STM32-F412-DISCO board.
EXAMPLE for UI
Supported MicroEJ Version: 4.0
Supported MicroEJ Edition: Studio
Last updated:
23 January 2017
# Overview
A black and white smartwatch. This application has been designed for a 2BPP 240x240 screen. It has been tested on a STM32-F412-DISCO board.

![WhiteClock](screenshots/WhiteClock.png) ![Weather](screenshots/Weather.png) ![DigitalClock](screenshots/DigitalClock.png) ![Distance](screenshots/Distance.png) ![Battery](screenshots/Battery.png) ![Notifications](screenshots/Notifications.png)

## Usage
## Run on MicroEJ Simulator
1. Right Click on the project
2. Select **Run as -> MicroEJ Application**
3. Select your platform 
4. Press **Ok**


## Run on device
### Build
1. Right Click on [SmartWatchApp.java](src/main/java/com/microej/demo/smartwatch/SmartWatchApp.java)
2. Select **Run as -> Run Configuration**
3. Select **MicroEJ Application** configuration kind
4. Click on **New launch configuration** icon
5. In **Execution** tab
	1. In **Target** frame, in **Platform** field, select a relevant platform (but not a virtual device)
	2. In **Execution** frame
		1. Select **Execute on Device**
		2. In **Settings** field, select **Build & Deploy**
6. Press **Apply**
7. Press **Run**
8. Copy the generated `.out` file path shown by the console

### 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
	* MICROUI-2.0 or higher
	* MWT-2.0 or higher

## Dependencies
_All dependencies are retrieved transitively by Ivy resolver_.

# Source
N/A

## Restrictions
None.

Arabic Font (Standalone)

Example that shows how to use arabic fonts.
EXAMPLE for UI
Supported MicroEJ Version: 4.0
Supported MicroEJ Edition: SDK
Last updated:
23 January 2017
# Overview
This example shows how to use the arabic fonts.

# Usage

1. First of all, you must have a font containing the characters of the unicode block called `Arabic Presentation Forms-B` i.e. the range `0xFE70-0xFEFF`.

2. Then your strings must be formed with the characters of this range too (as you can see with the strings of HowToUseArabicFontDisplayable.TITLE and HowToUseArabicFontDisplayable.AVAILABLE_TEXTS, /u0020 corresponds to the space character).
3. Finally the order of the strings must be reversed.

## Run on MicroEJ Simulator
1. Right Click on the project
1. Select **Run as -> MicroEJ Application**
1. Select your platform 
1. Press **Ok**

## Run on device
### Build
1. Right Click on [HowToUseArabicFont.java](HowToUseArabicFont/src/main/java/com/microej/example/arabicfont/HowToUseArabicFont.java)
1. Select **Run as -> Run Configuration**
1. Select **MicroEJ Application** configuration kind
1. Click on **New launch configuration** icon
1. Select **Execute on Device**
1. Select **Build & Deploy**
1. Go to **Execution** tab
	* Select your platform 
1. Press **Apply**
1. Press **Run**
1. 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
	* MICROUI-2.0 or higher
	
## Dependencies
_All dependencies are retrieved transitively by Ivy resolver_.

# Source
N/A

# Restrictions
None.

How-to use the MicroUI Library

This library contains simple examples to understand how to use the main MicroUI library APIs.
HOWTO for UI
Supported MicroEJ Version: 4.0
Supported MicroEJ Edition: Studio & SDK
Last updated:
7 October 2016
<!--
	Markdown
	Copyright 2016 IS2T. All rights reserved.
	Use of this source code is governed by a BSD-style license that can be found at http://www.is2t.com/open-source-bsd-license/.
-->

# Overview
This library contains simple examples to understand how to use the main MicroUI library APIs. It is recommended to study them in the following order :


- [com.microej.howto.microui.drawing.Primitives](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/drawing/Primitives.java)

![Primitives](screenshots/Primitives.png)

- [com.microej.howto.microui.drawing.PrimitivesAntiAliased](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/drawing/PrimitivesAntiAliased.java)

![PrimitivesAntiAliased](screenshots/PrimitivesAntiAliased.png)

- [com.microej.howto.microui.font.Text](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/font/Text.java)

![Text](screenshots/Text.png)

- [com.microej.howto.microui.font.PictosWithCustomFont](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/font/PictosWithCustomFont.java)

![PictosWithCustomFont](screenshots/PictosWithCustomFont.png)

- [com.microej.howto.microui.image.TransparentImages](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/image/TransparentImages.java)

![TransparentImages](screenshots/TransparentImages.png)

- [com.microej.howto.microui.image.FlippedImages](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/image/FlippedImages.java)

![FlippedImages](screenshots/FlippedImages.png)

- [com.microej.howto.microui.image.RotatedImages](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/image/RotatedImages.java)

![RotatedImages](screenshots/RotatedImages.png)

- [com.microej.howto.microui.image.ScaledImages](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/image/ScaledImages.java)

![ScaledImages](screenshots/ScaledImages.png)

- [com.microej.howto.microui.image.TilingWithImages](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/image/TilingWithImages.java)

![TilingWithImages](screenshots/TilingWithImages.png)

- [com.microej.howto.microui.image.DeformedImages](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/image/DeformedImages.java)

![DeformedImages](screenshots/DeformedImages.png)

- [com.microej.howto.microui.events.InputEvents](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/events/InputEvents.java)

![InputEvents](screenshots/InputEvents.png)

- [com.microej.howto.microui.animation.AnimationSampleWithFullRepaint](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/animation/AnimationSampleWithFullRepaint.java)

- [com.microej.howto.microui.animation.AnimationSampleWithFlyingImage](/MicroUI-Get-Started/src/main/java/com/microej/howto/microui/animation/AnimationSampleWithFlyingImage.java)


Note that the same set of resources (images and fonts) is used across all of the examples.

# Usage
For each example:
## Run on MicroEJ Simulator
1. Right Click on the example to run `.java` file
2. Select **Run as -> MicroEJ Application**
3. Select your platform 
4. Press **Ok**


## Run on device
### Build
1. Right Click on the example to build `.java` file
2. Select **Run as -> Run Configuration** 
3. Select **MicroEJ Application** configuration kind
4. Click on **New launch configuration** icon
5. In **Execution** tab
	1. In **Target** frame, in **Platform** field, select a relevant platform (but not a virtual device)
	2. In **Execution** frame
		1. Select **Execute on Device**
		2. In **Settings** field, select **Build & Deploy**
6. Press **Apply**
7. Press **Run**
8. Copy the generated `.out` file path
	
# Requirements
* MicroEJ Studio or SDK 4.0 or later
* A platform with at least:
	* EDC-1.2 or higher
	* BON-1.2 or higher
	* MICROUI-2.0 or higher

# Dependencies
_All dependencies are retrieved transitively by Ivy resolver_.

# Credits


| <p align="center">Font</p> | <p align="center">Author</p> | <p align="center">License</p> |
| --- | :---: | --- |
| Font Awesome | Dave Gandy <br/> http://fontawseome.io  | [SIL OFL 1.1 license - http://scripts.sil.org/OFL](/MicroUI-Get-Started/src/main/resources/fonts/OFL.txt)|
| Sans | Adobe |[SIL Open Font License.txt](/MicroUI-Get-Started/src/main/resources/fonts/Source - SIL Open Font License.txt)|


# Source
N/A

# Restrictions
None.

How-to use the Widget Library

This library contains simple examples to understand how to use the main Widgets library APIs.
HOWTO for UI
Supported MicroEJ Version: 4.0
Supported MicroEJ Edition: Studio & SDK
Last updated:
16 September 2016
<!--
	Markdown
	Copyright 2015-2016 IS2T. All rights reserved.
	IS2T PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
-->

# Overview
This library contains simple examples to understand how to use the main Widgets library APIs. It is recommended to study them in the following order :

- [com.microej.howto.mwt.colors.Gradient](/Widgets-Get-Started/src/main/java/com/microej/howto/mwt/colors/Gradient.java)

![Gradient](screenshots/Gradient.png)


# Usage
For each example:
## Run on MicroEJ Simulator
1. Right Click on the example to run `.java` file
2. Select **Run as -> MicroEJ Application**
3. Select your platform 
4. Press **Ok**


## Run on device
### Build
1. Right Click on the example to build `.java` file
2. Select **Run as -> Run Configuration** 
3. Select **MicroEJ Application** configuration kind
4. Click on **New launch configuration** icon
5. In **Execution** tab
	1. In **Target** frame, in **Platform** field, select a relevant platform (but not a virtual device)
	2. In **Execution** frame
		1. Select **Execute on Device**
		2. In **Settings** field, select **Build & Deploy**
6. Press **Apply**
7. Press **Run**
8. Copy the generated `.out` file path
	
# Requirements
* MicroEJ Studio or SDK 4.0 or later
* A platform with at least:
	* EDC-1.2 or later
	* BON-1.2 or later
	* MICROUI-2.0 or later
	* MWT-2.1 or later

* Add the following line to your `module.ivy` or your `ivy.xml`:
> `<dependency org="ej.library.ui" name="widget" rev="2.0.0-alpha.10"/>`


# Dependencies
_All dependencies are retrieved transitively by Ivy resolver_.


# Source
N/A

# Restrictions
None.

MicroUI (Foundation Library API)

The MicroEJ User Interface and User eXperience API.
LIBRARY for UI
Supported MicroEJ Version: 4.0
Supported MicroEJ Edition: Studio & SDK
Last updated:
14 September 2016
<!--
	Markdown
	Copyright 2015-2016 IS2T. All rights reserved.
	IS2T PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
-->

# Overview
This library contains classes and interfaces stubs of Micro User Interface API (ESR002).

# Usage
Add the following line to your `module.ivy` or your `ivy.xml`:
> `<dependency org="ej.api" name="microui" rev="2.+"/>`

# Requirements
  - EDC-1.2 or higher
  - BON-1.2 or higher

# Dependencies
None.

# Source
N/A

# Restrictions
None.

MWT (Foundation Library API)

The MicroEJ Widget Toolkit API.
LIBRARY for UI
Supported MicroEJ Version: 4.0
Supported MicroEJ Edition: Studio & SDK
Last updated:
14 September 2016
<!--
	Markdown
	Copyright 2015-2016 IS2T. All rights reserved.
	IS2T PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
-->

# Overview
This library contains classes and interfaces stubs of Micro Widget Toolkit API (ESR011).

# Usage
Add the following line to your `module.ivy` or your `ivy.xml`:
> `<dependency org="ej.api" name="mwt" rev="2.+"/>`

# Requirements
  - EDC-1.2 or higher
  - BON-1.2 or higher
  - MICROUI-2.0 or higher

# Dependencies
None.

# Source
N/A

# Restrictions
None.

Motion

Motion library, providing animated tasks and a set of defined motions.
LIBRARY for UI
Supported MicroEJ Version: 4.0
Supported MicroEJ Edition: Studio & SDK
Last updated:
14 September 2016
<!--
	Markdown
	Copyright 2014-2016 IS2T. All rights reserved.
	IS2T PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
-->

# Overview
A motion library, providing animated tasks and a set of defined motions 
(linear, elastic, bounce, etc.), useful for HMI animations.

# Usage
Add the following line to your `module.ivy` or your `ivy.xml`:
> `<dependency org="ej.library.runtime" name="components" rev="3.+"/>`

# Requirements
  - EDC-1.2 or higher
  - BON-1.2 or higher

# Dependencies
None.

# Source
N/A

# Restrictions
None.

Widget

Widget library.
LIBRARY for UI
Supported MicroEJ Version: 4.0
Supported MicroEJ Edition: Studio & SDK
Last updated:
14 September 2016
<!--
	Markdown
	Copyright 2015-2016 IS2T. All rights reserved.
	IS2T PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
-->

# Overview
This library contains all that is necessary to create an HMI on MWT 2:
- a dynamic style resolution (_ej.style_),
- a set of widgets (_ej.widget_),
- a set of containers (_ej.container_),
- an animation framework (_ej.animation_),
- a navigation framework (_ej.navigation_),
- some color utilities (_ej.color_).

# Style
The style framework is used to customize a user interface.

A style is a set of attributes to apply to an element (spacing, coloring, font, size, etc.).

The stylesheet is augmented with rules: a selector associated with a partial style. The rules are ordered from the most specific to the least one. The resolution of an element style is done by applying the rules matching the element (in order), then inheriting a part of its parents style (recursively), then completing it by the default style. 

# Widgets
The widgets are graphical elements on which a style can be applied.

The framework contains a set of predefined widgets: label, image, button, toggle, radio, check, switch, text, slider, scrollbar, progress bar.

It is also possible to create its own widgets by subclassing StyledWidget.

# Containers
The containers are graphical elements on which a style can be applied and that can contain other elements (widgets or containers). Each container defines a policy to lay out its children.

The framework contains a set of predefined layout policies: canvas, dock, grid, list, scroll, split.

It is also possible to create its own layout policies by subclassing StyledComposite.

# Animation
The animation framework provides an animator that can schedule several animations at the same framerate.

# Navigation
The navigation framework provides the capability to navigate from one page to another and going back to pages history.

The pages are composed of widgets and containers. A page is represented by a URL.

A URL resolver is responsible for creating the pages from a URL.

A pages stack manages the history of pages. It can either keep the pages in cache or create it again while going back to history.

The navigation desktop associates a URL resolver and a pages stack to navigate between the pages. It may also animate the transition between the pages.

# Color
The color utilities provide some convenient functions to manipulate the colors.

The color helper manipulates (decompose, recompose) the color components red, green, blue.

The light helper computes and modifies the level of light in a color.

# Usage
Add the following line to your `module.ivy` or your `ivy.xml`:
> `<dependency org="ej.library.ui" name="widget" rev="2.0.0-alpha.4"/>`
	
# Requirements
  - EDC 1.2 or later
  - BON 1.2 or later
  - MICROUI 2 or later
  - MWT 2 or later

# Dependencies
_All dependencies are retrieved transitively by Ivy resolver_.

# Source
N/A

# Restrictions
None.

Widget (Standalone)

This demo illustrates the Widget library (ej.widget, ej.container, ej.style, ej.navigation, ej.color) based on MicroUI 2 and MWT 2.
EXAMPLE for UI
Supported MicroEJ Version: 4.0
Supported MicroEJ Edition: SDK
Last updated:
30 June 2016
# Overview
This demo illustrates the Widget library (ej.widget, ej.container, ej.style, ej.navigation, ej.color) based on MicroUI 2 and MWT 2.
The main page allows to lead to all the pages of the application illustrating the following widgets:
- button,
- label,
- scrolling list,
- scroll bar,
- slider,
- radio button,
- check box,
- switch,
- progress bar,
- vertical lists.

# Rendering
This demo includes various implementations of widgets and screen transitions.

## Vector drawings
Widgets are drawn using 2D primitives with and without anti-aliasing. This approach uses more CPU time but no ROM (no graphic resources except the code itself).

See `GraphicsContext` and `AntiAliasedShapes` classes for more information. 

## Raster graphics (images)
Widgets are drawn using images. This approach requires more ROM depending on the size and number of images used. It is most of the time faster than vector drawing and requires less CPU load.

Images can be either embedded encoded (PNG for example, decoded at runtime) or embedded as bitmaps (directly drawn to the display, the conversion is done on at build time).

See UI reference manual for more information.

## Pictograms (monochrome images)
Widgets are drawn using monochrome images that can be colored dynamically. This approach requires less ROM than using colorful images but can only be applied for monochrome elements.

It can be achieved using fonts (MicroEJ font designer can import images into a font) or monochrome images with alpha transparency.

See UI reference manual for more information.

# Transitions
This demo includes two implementations of screens transition.

## Snapshot
Screens are dynamically created as images (buffer in RAM) for the transition. This approach requires more RAM (twice the size of the screen in buffers) but is faster than the 2nd implementation.

## Dynamic
Screens are drawn while moving. For each step of the transition, all widgets are drawn in the moving screen. This approach uses more CPU but less RAM. Transition speed might be slower depending on the number of widgets to draw.


# Project Setup
First of all, you have to download the entire repository by using the `Download` button or by cloning the repository. After having retrieved the repository content, open MicroEJ and then import _Existing project into workspace_ by selecting either the ZIP file or the root directory.

## Requirements
* MicroEJ Studio or SDK 4.0 or later
* A platform with at least:
	* EDC-1.2 or higher
	* MICROUI-2.0 or higher
	* MWT-2.1 or higher
* Hardware: this demo has been tested on ST STM32F746G-DISCO (480x272 display) board.

## Project structure
  - `src/main/java`: Java sources.
  		`ej.demo.ui.widget.page`: pages of the demo.
  		`ej.demo.ui.widget.style`: look and feel management of the demo.
  		`WidgetsDemo`: entry point of the demo.
  - `src/main/resources`: images, fontsâ¦

# Usage
## Run on MicroEJ Simulator
1. Right Click on the project
1. Select **Run as -> MicroEJ Application**
1. Select your platform 
1. Press **Ok**

## Run on device
### Build
1. Right Click on [WidgetsDemo.java](ej.demo.ui.widget/src/main/java/ej/demo/ui/widget/WidgetsDemo.java)
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 relevant platform (but not a virtual device)
	1. In **Execution** frame
		1. Select **Execute on Device**
		2. In **Settings** field, select **Build & Deploy**
1. Press **Apply**
1. Press **Run**
1. Copy the generated `.out` file path shown by the console

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

# MicroUI vs. MWT+Widget
By default, consider using MWT+Widget.
It is however possible to develop a GUI with MicroUI without MWT+Widget libraries:
* when there is no or little user interaction,
* for simple screens and a limited number of widgets,
* for simple screen layout,
* for small screens (which implies they need to be simple!),
* for quick image-based design tests.

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

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

Widget (Sandboxed)

This demo illustrates the Widget library (ej.widget, ej.container, ej.style, ej.navigation, ej.color) based on MicroUI 2 and MWT 2.
EXAMPLE for UI
Supported MicroEJ Version: 4.0
Supported MicroEJ Edition: Studio & SDK
Last updated:
30 June 2016
# Overview
This demo illustrates the Widget library (ej.widget, ej.container, ej.style, ej.navigation, ej.color) based on MicroUI 2 and MWT 2.
The main page allows to lead to all the pages of the application illustrating the following widgets:
- button,
- label,
- scrolling list,
- scroll bar,
- slider,
- radio button,
- check box,
- switch,
- progress bar,
- vertical lists.

# Rendering
This demo includes various implementations of widgets and screen transitions.

## Vector drawings
Widgets are drawn using 2D primitives with and without anti-aliasing. This approach uses more CPU time but no ROM (no graphic resources except the code itself).

See `GraphicsContext` and `AntiAliasedShapes` classes for more information. 

## Raster graphics (images)
Widgets are drawn using images. This approach requires more ROM depending on the size and number of images used. It is most of the time faster than vector drawing and requires less CPU load.

Images can be either embedded encoded (PNG for example, decoded at runtime) or embedded as bitmaps (directly drawn to the display, the conversion is done on at build time).

See UI reference manual for more information.

## Pictograms (monochrome images)
Widgets are drawn using monochrome images that can be colored dynamically. This approach requires less ROM than using colorful images but can only be applied for monochrome elements.

It can be achieved using fonts (MicroEJ font designer can import images into a font) or monochrome images with alpha transparency.

See UI reference manual for more information.

# Transitions
This demo includes two implementations of screens transition.

## Snapshot
Screens are dynamically created as images (buffer in RAM) for the transition. This approach requires more RAM (twice the size of the screen in buffers) but is faster than the 2nd implementation.

## Dynamic
Screens are drawn while moving. For each step of the transition, all widgets are drawn in the moving screen. This approach uses more CPU but less RAM. Transition speed might be slower depending on the number of widgets to draw.


# Project Setup
First of all, you have to download the entire repository by using the `Download` button or by cloning the repository. After having retrieved the repository content, open MicroEJ and then import _Existing project into workspace_ by selecting either the ZIP file or the root directory.

## Requirements
* MicroEJ Studio or SDK 4.0 or later
* A platform with at least:
	* EDC-1.2 or higher
	* MICROUI-2.0 or higher
	* MWT-2.1 or higher
* Hardware: this demo has been tested on ST STM32F746G-DISCO (480x272 display) board.

## Project structure
  - `src/main/java`: Java sources.
  		`ej.demo.ui.widget.page`: pages of the demo.
  		`ej.demo.ui.widget.style`: look and feel management of the demo.
  		`WidgetsDemo`: entry point of the demo.
  - `src/main/resources`: images, fontsâ¦

# Usage
## Run on MicroEJ Simulator
1. Right Click on the project
1. Select **Run as -> MicroEJ Application**
1. Select your platform 
1. Press **Ok**

## Run on device
### Build and Deploy
1. Right Click on [WidgetsDemo.java](ej.demo.ui.widget/src/main/java/ej/demo/ui/widget/WidgetsDemo.java)
1. Select **Run as -> Run Configurations...** 
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 relevant platform
	1. In **Execution** frame
		1. Select **Execute on Device**
		2. In **Settings** field, select **Build & Deploy**
1. In **Configuration** tab
	1. In **Board** frame
		1. Set **Host** field to your board IP address
1. Press **Apply**
1. Press **Run**

# MicroUI vs. MWT+Widget
By default, consider using MWT+Widget.
It is however possible to develop a GUI with MicroUI without MWT+Widget libraries:
* when there is no or little user interaction,
* for simple screens and a limited number of widgets,
* for simple screen layout,
* for small screens (which implies they need to be simple!),
* for quick image-based design tests.

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

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

Adding a Front Panel Mock

This Application Note explains the steps involved in adding a visual component (ie: a Front Panel Mock) to a MicroEJ Java Platform in the Simulator. It explains in details all the steps required to create the Front Panel Mock and test it with a simple application that draws on the display and reacts to hardware button presses.
EXAMPLE for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
6 April 2016

Tutorial: Widgets Design With the MWT Library

This Application Note explains all aspects of the MWT library.
EXAMPLE for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
6 April 2016

Renesas YLCDRX63N Platform Reference Implementation (GCC, uC/OS-III)

This MicroEJ platform is included in MicroEJ SDK 3.1 installer. The platform reference implementation can be opened with File->new->Java Platform then select the appropriate platform architecture and platform.
JPF_RENESAS for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
5 April 2016

NXP FRDM-KL46Z Platform Reference Implementation (Keil, Baremetal)

This MicroEJ platform is included in MicroEJ SDK 3.1 installer. The platform reference implementation can be opened with File->new->Java Platform then select the appropriate platform architecture and platform.
JPF_NXP for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
5 April 2016

NXP Kinetis K70 Platform Reference Implementation (IAR, uC/OS)

This MicroEJ platform is included in MicroEJ SDK 3.1 installer. The platform reference implementation can be opened with File->new->Java Platform then select the appropriate platform architecture and platform.
JPF_NXP for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
5 April 2016

NXP LPC1788 Developer's Kit Platform Reference Implementation (Keil, RTX)

This MicroEJ platform is included in MicroEJ SDK 3.1 installer. The platform reference implementation can be opened with File->new->Java Platform then select the appropriate platform architecture and platform.
JPF_NXP for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
5 April 2016

STM3220G-EVAL Platform Reference Implementation (GCC, FreeRTOS / Keil, RTX / IAR uC/OS)

This MicroEJ platform is included in MicroEJ SDK 3.1 installer. The platform reference implementation can be opened with File->new->Java Platform then select the appropriate platform architecture and platform.
JPF_ST for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
5 April 2016

STM3240G-EVAL Platform Reference Implementation (GCC, FreeRTOS / Keil, RTX)

This MicroEJ platform is included in MicroEJ SDK 3.1 installer. The platform reference implementation can be opened with File->new->Java Platform then select the appropriate platform architecture and platform.
JPF_ST for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
5 April 2016

STM32F429I-DISCO Platform Reference Implementation (Keil, RTX)

This MicroEJ platform is included in MicroEJ SDK 3.1 installer. The platform reference implementation can be opened with File->new->Java Platform then select the appropriate platform architecture and platform.
JPF_ST for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
5 April 2016

Renesas RSK RZ/A1H Platform Reference Implementation (IAR, ThreadX)

This MicroEJ platform is included in MicroEJ SDK 3.1 installer. The platform reference implementation can be opened with File->new->Java Platform then select the appropriate platform architecture and platform.
JPF_RENESAS for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
5 April 2016

MWT

These MicroEJ projects provide examples for MWT.
EXAMPLE for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
18 September 2015
# Overview
This repository provides a collection of MWT examples. Each example has its own Eclipse/MicroEJ project.

## Project structure
Each folder is an Eclipse/MicroEJ project. They share a common structure:
- `src/main/java`
  - Java sources
- `src/main/resources`
  - Fonts/images
- `launches/`: MicroEJ launches

## Basic
This project shows how to create a basic MWT application. If you are new to MWT, you should start with this example.
It demonstrates the core concepts of MWT:
- Theme and Look,
- Widgets and Renderers,
- Composite.

It also shows how to periodically update the widget data.
Traces to standard output show which thread executes key methods.

### Requirements
- JRE 7 (or later) x86.
- MicroEJ 3.1 or later.
- Java platform with (at least) EDC-1.2, MWT-1.0.

## Button
This project shows how to create two buttons to modify a label with MWT.

### Requirements
- JRE 7 (or later) x86.
- MicroEJ 3.1 or later.
- Java platform with (at least) EDC-1.2, MWT-1.0.

## SlidingWidget
 This example shows how to slide widgets inside a composite. Two implementations are provided. 
 The first implementation is full widget based (all widgets are drawn during the animations - take more CPU time, consume no additional RAM) and the second implementation is screenshot based (1. current framebuffer content is saved to an image1 (local RAM buffer). 2. New screen is drawn in image2. 3. Animation is done by drawing image1 and image2. Consumes more RAM but takes less CPU time).
 
### Requirements
- JRE 7 (or later) x86.
- MicroEJ 3.1 or later.
- Java platform with (at least) EDC-1.2, BON-1.2, MICROUI-1.5.0, MWT-1.0, EJ.MOTION-2.1.

## Setup
Import the projects in MicroEJ.

## Usage
Import the projects. Each project comes with a Run Configuration. Simply run it to execute the example on SimJPF.

## Changes
Share Basic and Button examples.
Add SlidingWidget example and restructure Basic and Button examples.

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

Arabic Font

Example that shows how to use arabic fonts.
EXAMPLE for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
23 July 2015
# Overview
The following projects show how to use the arabic fonts.

## HowToUseArabicFont
This example shows how to correctly render the arabic strings.

Here are the steps to do it:
1. First of all, you must have a font containing the characters of the unicode block called `Arabic Presentation
Forms-B` i.e. the range `0xFE70-0xFEFF`.
2. Then your strings must be formed with the characters of this range too (as you
can see with the strings of HowToUseArabicFontDisplayable.TITLE and HowToUseArabicFontDisplayable.AVAILABLE_TEXTS, /u0020 corresponds to the space character).
3. Finally the order of the strings must be reversed.

### Requirements
- JRE 7 (or later) x86.
- MicroEJ 3.1 or later.
- Java platform with (at least) EDC-1.2, MICROUI-1.5.0.

### Project structure
- `src/main/java`
  - Java sources
- `src/main/resources`
  - Font
- `launches/`: MicroEJ launches

### Launches
A Simulation and an Embedded launches are available.

## Changes
- HowToUseArabicFont example.

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

STM32F429I-DISCO Platform Reference Implementation (Keil, FreeRTOS)

MicroEJ HMI Platform Example for ST STM32F429I-DISCOVERY / Keil / FreeRTOS.
JPF_ST for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
2 July 2015

STM32F429I-DISCO Platform Reference Implementation (GCC, FreeRTOS)

MicroEJ HMI Platform Example for ST STM32F429I-DISCOVERY / GCC / FreeRTOS.
JPF_ST for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
2 July 2015

STM32F429I-DISCO Platform Reference Implementation (IAR, FreeRTOS)

MicroEJ HMI Platform Example for ST STM32F429I-DISCOVERY / IAR / FreeRTOS.
JPF_ST for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
2 July 2015

Renesas RSK RZ/A1H Platform Reference Implementation (GCC, FreeRTOS)

MicroEJ HMI Platform Example for Renesas RZ/A1H / GCC / FreeRTOS.
JPF_RENESAS for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
2 July 2015

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.

Widget

This MicroEJ project provides widget examples for MWT v1.
EXAMPLE for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
16 April 2015
# Overview
This demo represents a settings menu you can find on your smartphone. The main page show all available settings, each one leading to a page illustrating a different widget such as:
- button (with text or pictogram),
- label,
- scrolling list/text,
- scroll bar 
- wheel (with font zoom in/out),
- slider,
- radio button, 
- check-box, 
- switch, 
- progress bar, 
- horizontal/vertical lists.

This demo includes MicroEJ launchers configuration for the following Java platforms:
- MicroEJ simulator
- ST STM32F429I-EVAL
- ST STM32429I-DISCO

Each launcher can be configured in Run -> Run configuration... -> MicroEJ Application -> Widgets XXXX -> JRE: set VM arguments to the specific options values.
- `-Dmicroej.java.property.com.is2t.demo.NoLayer=SET` to deactivate the MicroUI layers in the transitions between pages.
- `-Dmicroej.java.property.com.is2t.demo.NoAnimation=SET` to deactivate the transition animations between pages.
By default, layers and transitions are enabled.

# Project Setup

First of all, you have to download the entire repository by using the `Download` button or by cloning the repository. After having retrieved the repository content, open 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.
- Java platform with (at least): MICROUI-1.5, MWT-1.0, EDC-1.2, MICROUI-LAYER-2.0.0.
- Hardware: this demo has been tested on ST STM32F429I-EVAL (480x272 display) and STM32429I-DISCO (240x320 display) boards.

## Project structure

  - `src/`
  	- Java sources
  		com.is2t.demo.widgets.automaton: automaton of the demo.
  		com.is2t.demo.widgets.page: pages of the demo and flow management between page.
  		com.is2t.demo.widgets.theme: look and feel management of the demo.
  		com.is2t.demo.widgets.widget: specific widgets and renderers of the demo.
  		Widgets: entry point of the demo.
  	- Resources: images, fonts...
  - `launches/`: MicroEJ launches in the project `com.is2t.demo.widgets`
  - `lib/`: to access each library javadoc, open the <libraryname>-javadoc.jar (unzip)
  	- com.is2t.demo.utilities.jar: useful functions like automaton, colorhelper...
  	- com.is2t.demo.layers.jar: GUI layers management
  	- com.is2t.demo.transition.jar: specific transition library with layer
  	- ej.components.jar: component framework library
  	- ej.flow.jar: navigation management library
  	- ej.flow.mwt.jar: page navigation library
  	- ej.motion.jar: motion library 
	- widgets.jar: Widgets library
T

# Usage
To launch the application, right-click on the project, select _Run as_, _MicroEJ Application_ and choose _Widgets (Simulation)_. Another launcher is available to execute on the target board.

# Changes
- April 2015: initial version

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

Showroom

These MicroEJ projects demonstrate MicroUI libraries features.
EXAMPLE for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
16 April 2015
# Overview
This showroom application demonstrates MicroEJ UI libraries features.
For illustration: [video](http://www.youtube.com/watch?v=Wm-UgvCvTKI).

On start-up, the application starts the desktop. It contains several applications, each represented with an icon (picto). The applications are registered with the component framework (`ej.components`). Touch the picto to start the application. Go back to the desktop from any application by touching the home picto in the top right corner.  

Each application has an additional project .activor that is used by the component framework (`ej.components`) to add itself to the desktop (provide name, entry point, picto, how to start/top the application).

Some demos are using the MICROUI LAYERS library and requires a specific hardware acceleration for transparency to run smoothly. To run this demo on devices without hardware transparency acceleration,  

Available applications:

**Settings**: This demo represents a settings menu you can find on your smartphone. It demonstrates widgets like scrolling list/text, font zoom in/out, check-box, switch, progress bar, horizontal/vertical lists.
Screens left/right animations are configured to use the MICROUI-LAYERS library with fade in of the incoming screen (transparency 0 to 255) and fade out of the out-coming screen (transparency 255 to 0).
Project: `com.is2t.demo.settings`

**Graph**: This demo shows a curve representing randomly generated data. 
- You can affect the values manually by dragging the right cursor. 
- The colourized drawing below the curve can be dynamically disabled with one of the one board button.
- Touching the curve will stop it and display the current curve value of the touched area.
This demo uses the NLS library for the top messages in US and FR translations.
Project: `com.is2t.demo.graph`

**Domotic**: A simulation of a domotic application which can control the shutters, ligh and temperature in each room of an house. No source code are provided for this demo, only a .jar.
Project: `com.is2t.demo.domotic`

**Circular Progress Bar**: demonstrates a circular progress bar. Touch the setting value on the left to set the new value. The light value on the right will progressively reach this value.
Project: `com.is2t.demo.circularprogressbar`

**Elastic**: Elastic is a small game where the goal is to move the spider on the screen which can bounce against the wall depending from the speed. An anti-aliased line is drawn between your finger and the spider.
Project: `com.is2t.demo.elastic`

**Stretch**: The demos shows the deformation of an image.
Project: `com.is2t.demo.stretch`

**Desktop**: is the desktop for all applications. Holds the weather, date and clock widgets.
Project: `com.is2t.com.showroom`

Other projects:
- `com.is2t.fonts`: contains the common fonts used in the applications.
- `com.is2t.layers`: layers framework.
- `com.is2t.transition`: transition framework which use layers.
- `com.is2t.utilities`: various utilities.
- `com.is2t.widgets`: main widgets.

This demo includes MicroEJ launchers configuration for the following Java platform:
- simulator
- ST STM32F429I-EVAL
- Renesas RSK+RZA1H

Each launcher can be configured in Run -> Run configuration... -> MicroEJ Application -> Showroom XXXX -> JRE: set VM arguments to the specific options values.
- `-Dmicroej.java.property.com.is2t.demo.NoLayer=SET` to deactivate the layers in the transitions between pages.
- `-Dmicroej.java.property.com.is2t.demo.NoAnimation=SET` to deactivate totally the transitions between pages.


# Project Setup

First of all, you have to download the entire repository by using the `Download` button or by cloning the repository. After having retreived 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
- Java platform with (at least): MicroUI1.5, MWT1.0, EDC1.2, EJ.COMPONENTS2.0, MICROUI LAYER 2.0.0, EJ.FLOW2.0, EJ.FLOW.MWT3.0, EJ.MOTION2.1
- Hardware: this demo has been tested on ST STM32F429I-EVAL (480x272 display) and Renesas RSK+RZA1H (800x480 display) boards.

## Project structure

Each project follows this structure:
  - `src/`
  	- Java sources
  	- Resources: images, fonts...
  - `launches/`: MicroEJ launches in the project `com.is2t.demo.showroom`

# Usage
To launch the application, right-click on the project, select _Run as_, _MicroEJ Application_ and choose _Showroom (Simulation)_ Another launcher is available to execute on the target board.

# Changes
- Dec 2014: initial version

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

Gradient

This MicroEJ project presents how to compute and draw a gradient.
EXAMPLE for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
16 April 2015
# Overview
This MicroEJ project presents how to compute and draw a gradient.

### Requirements
- JRE 7 x86 or later
- MicroEJ 3.0 or later
- A Java Platform with MicroUI 1.4 or later

### Project structure
- `src/`: Java sources
- `launches/`: MicroEJ launches
- `LICENCE.md`
- `README.md`

## Usage
- Launch MicroEJ.
- File->Import->General->Existing project into workspace: import Example-Gradient folder.
- To launch the application, right-click on the project, select _Run as_, _MicroEJ Application_ and choose _Show Gradient (Simulation)_.

## Changes
- Simple example.

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

MicroUI Example

MicroUI example for UI/UX design.
EXAMPLE for UI
Supported MicroEJ Version: 3.1
Supported MicroEJ Edition: SDK
Last updated:
12 March 2015