Compare commits

...

2 Commits

Author SHA1 Message Date
Edouard DUPIN
2743abe410 [FIX] missing files 2025-05-24 00:25:14 +02:00
Edouard DUPIN
6c4ac572b6 [FIX] arbo 2025-05-24 00:24:25 +02:00
108 changed files with 992 additions and 213 deletions

40
.classpath Normal file
View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/testResources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/classes" path="src/main">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

23
.project Normal file
View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ewol</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>

50
pom.xml
View File

@ -1,14 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.atriasoft</groupId>
<artifactId>ewol</artifactId>
<version>0.1.0</version>
<properties>
<maven.compiler.version>3.13.0</maven.compiler.version>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.dependency.version>3.1.1</maven.dependency.version>
</properties>
<licenses>
<license>
<name>Mozilla Public License 2.0</name>
<url>https://opensource.org/licenses/MPL-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>dev1</id>
<name>Edouard DUPIN</name>
<email>edouard.dupin@proton.me</email>
<roles>
<role>Lead Developer</role>
</roles>
</developer>
</developers>
<repositories>
<repository>
@ -66,7 +78,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.11.0-M2</version>
<version>5.11.0</version>
<scope>test</scope>
</dependency>
<dependency>
@ -78,29 +90,33 @@
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<sourceDirectory>src/main</sourceDirectory>
<resources>
<resource>
<directory>${basedir}/src/resources</directory>
</resource>
</resources>
<testSourceDirectory>test/src</testSourceDirectory>
<testSourceDirectory>src/test</testSourceDirectory>
<testResources>
<testResource>
<directory>${basedir}/src/testResources</directory>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<version>3.14.0</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<!--<encoding>${project.build.sourceEncoding}</encoding>-->
<source>21</source>
<target>21</target>
</configuration>
</plugin>
<!-- Create the source bundle -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-sources</id>
@ -114,7 +130,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<version>3.2.5</version>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
@ -133,7 +149,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
<configuration>
<show>private</show>
<nohelp>true</nohelp>
@ -147,7 +163,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
<configuration>
<show>public</show>
</configuration>

40
samples/.classpath Normal file
View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/classes" path="src/main">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

23
samples/.project Normal file
View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ewol-sample</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=21
org.eclipse.jdt.core.compiler.compliance=21
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=21

View File

@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

View File

@ -3,27 +3,38 @@
<groupId>org.atriasoft</groupId>
<artifactId>ewol-sample</artifactId>
<version>0.1.0</version>
<properties>
<maven.compiler.version>3.13.0</maven.compiler.version>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.dependency.version>3.1.1</maven.dependency.version>
</properties>
<licenses>
<license>
<name>Mozilla Public License 2.0</name>
<url>https://opensource.org/licenses/MPL-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>dev1</id>
<name>Edouard DUPIN</name>
<email>edouard.dupin@proton.me</email>
<roles>
<role>Lead Developer</role>
</roles>
</developer>
</developers>
<repositories>
<repository>
<id>gitea</id>
<url>https://gitea.atria-soft.org/api/packages/org.atriasoft/maven</url>
<id>gitea</id>
<url>https://gitea.atria-soft.org/api/packages/org.atriasoft/maven</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>gitea</id>
<url>https://gitea.atria-soft.org/api/packages/org.atriasoft/maven</url>
<id>gitea</id>
<url>https://gitea.atria-soft.org/api/packages/org.atriasoft/maven</url>
</repository>
<snapshotRepository>
<id>gitea</id>
<url>https://gitea.atria-soft.org/api/packages/org.atriasoft/maven</url>
<id>gitea</id>
<url>https://gitea.atria-soft.org/api/packages/org.atriasoft/maven</url>
</snapshotRepository>
</distributionManagement>
@ -33,37 +44,46 @@
<artifactId>ewol</artifactId>
<version>0.1.0</version>
</dependency>
<!-- generic logger of SLF4J to console (in color) -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.1.0-alpha1</version>
<scope>test</scope>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.5.18</version>
</dependency>
</dependencies>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.12.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.janino</groupId>
<artifactId>janino</artifactId>
<version>3.1.12</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<sourceDirectory>src/main</sourceDirectory>
<resources>
<resource>
<directory>${basedir}/src/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<version>3.14.0</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<!--<encoding>${project.build.sourceEncoding}</encoding>-->
<source>21</source>
<target>21</target>
</configuration>
</plugin>
<!-- Create the source bundle -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.1</version>
<version>4.0.0-beta-1</version>
<executions>
<execution>
<id>attach-sources</id>
@ -79,7 +99,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
</plugin>
<plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
@ -91,7 +111,7 @@
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugin>
<!-- Java-doc generation for stand-alone site -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>

View File

@ -36,8 +36,11 @@ import org.atriasoft.ewol.widget.Spacer;
import org.atriasoft.ewol.widget.Spin;
import org.atriasoft.ewol.widget.Widget;
import org.atriasoft.ewol.widget.Windows;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class BasicWindows extends Windows {
private static final Logger LOGGER = LoggerFactory.getLogger(BasicWindows.class);
private static final String LABEL_GRAVITY = "gravity: ";
public static void staticRequestNext(final BasicWindows self) {
@ -133,7 +136,7 @@ public class BasicWindows extends Windows {
checkBox.setPropertyFill(Vector3b.TRUE);
checkBox.setPropertyValue(value);
this.sizerMenu.subWidgetAdd(checkBox);
final Connection con = checkBox.signalValue.connect((valueButton) -> {
final Connection con = checkBox.signalValue.connect(valueButton -> {
try {
pojo.setExistingValue(widget, valueButton);
} catch (final AknotException e) {
@ -173,11 +176,12 @@ public class BasicWindows extends Windows {
spin.setPropertyFill(Vector3b.TRUE);
spin.setPropertyValue((int) value.size().x());
lineSizer.subWidgetAdd(spin);
final Connection con = spin.signalValue.connect((valueButton) -> {
final Connection con = spin.signalValue.connect(valueButton -> {
try {
final Object oldValue = pojo.getValue(widget);
if (oldValue instanceof final Dimension2f castedValue) {
LOGGER.warn("Set new value: {}", castedValue.withSize(castedValue.size().withX(valueButton)));
LOGGER.warn("Set new value: {}",
castedValue.withSize(castedValue.size().withX(valueButton)));
pojo.setExistingValue(widget, castedValue.withSize(castedValue.size().withX(valueButton)));
}
} catch (final AknotException e) {
@ -205,11 +209,12 @@ public class BasicWindows extends Windows {
spin.setPropertyFill(Vector3b.TRUE);
spin.setPropertyValue((int) value.size().y());
lineSizer.subWidgetAdd(spin);
final Connection con = spin.signalValue.connect((valueButton) -> {
final Connection con = spin.signalValue.connect(valueButton -> {
try {
final Object oldValue = pojo.getValue(widget);
if (oldValue instanceof final Dimension2f castedValue) {
LOGGER.warn("Set new value: {}", castedValue.withSize(castedValue.size().withY(valueButton)));
LOGGER.warn("Set new value: {}",
castedValue.withSize(castedValue.size().withY(valueButton)));
pojo.setExistingValue(widget, castedValue.withSize(castedValue.size().withY(valueButton)));
}
} catch (final AknotException e) {
@ -249,11 +254,12 @@ public class BasicWindows extends Windows {
spin.setPropertyFill(Vector3b.TRUE);
spin.setPropertyValue((int) value.size().x());
lineSizer.subWidgetAdd(spin);
final Connection con = spin.signalValue.connect((valueButton) -> {
final Connection con = spin.signalValue.connect(valueButton -> {
try {
final Object oldValue = pojo.getValue(widget);
if (oldValue instanceof final Dimension3f castedValue) {
LOGGER.warn("Set new value: {}", castedValue.withSize(castedValue.size().withX(valueButton)));
LOGGER.warn("Set new value: {}",
castedValue.withSize(castedValue.size().withX(valueButton)));
pojo.setExistingValue(widget, castedValue.withSize(castedValue.size().withX(valueButton)));
}
} catch (final AknotException e) {
@ -281,11 +287,12 @@ public class BasicWindows extends Windows {
spin.setPropertyFill(Vector3b.TRUE);
spin.setPropertyValue((int) value.size().y());
lineSizer.subWidgetAdd(spin);
final Connection con = spin.signalValue.connect((valueButton) -> {
final Connection con = spin.signalValue.connect(valueButton -> {
try {
final Object oldValue = pojo.getValue(widget);
if (oldValue instanceof final Dimension3f castedValue) {
LOGGER.warn("Set new value: {}", castedValue.withSize(castedValue.size().withY(valueButton)));
LOGGER.warn("Set new value: {}",
castedValue.withSize(castedValue.size().withY(valueButton)));
pojo.setExistingValue(widget, castedValue.withSize(castedValue.size().withY(valueButton)));
}
} catch (final AknotException e) {
@ -313,11 +320,12 @@ public class BasicWindows extends Windows {
spin.setPropertyFill(Vector3b.TRUE);
spin.setPropertyValue((int) value.size().z());
lineSizer.subWidgetAdd(spin);
final Connection con = spin.signalValue.connect((valueButton) -> {
final Connection con = spin.signalValue.connect(valueButton -> {
try {
final Object oldValue = pojo.getValue(widget);
if (oldValue instanceof final Dimension3f castedValue) {
LOGGER.warn("Set new value: {}", castedValue.withSize(castedValue.size().withZ(valueButton)));
LOGGER.warn("Set new value: {}",
castedValue.withSize(castedValue.size().withZ(valueButton)));
pojo.setExistingValue(widget, castedValue.withSize(castedValue.size().withZ(valueButton)));
}
} catch (final AknotException e) {
@ -344,7 +352,7 @@ public class BasicWindows extends Windows {
spin.setPropertyFill(Vector3b.TRUE);
spin.setPropertyValue((int) (double) value);
this.sizerMenu.subWidgetAdd(spin);
final Connection con = spin.signalValue.connect((valueButton) -> {
final Connection con = spin.signalValue.connect(valueButton -> {
try {
LOGGER.warn("Set new value: {}", valueButton);
pojo.setExistingValue(widget, (double) valueButton);
@ -371,7 +379,7 @@ public class BasicWindows extends Windows {
spin.setPropertyFill(Vector3b.TRUE);
spin.setPropertyValue((int) (float) value);
this.sizerMenu.subWidgetAdd(spin);
final Connection con = spin.signalValue.connect((valueButton) -> {
final Connection con = spin.signalValue.connect(valueButton -> {
try {
LOGGER.warn("Set new value: {}", valueButton);
pojo.setExistingValue(widget, (float) valueButton);
@ -456,7 +464,7 @@ public class BasicWindows extends Windows {
spin.setPropertyFill(Vector3b.TRUE);
spin.setPropertyValue(value);
this.sizerMenu.subWidgetAdd(spin);
final Connection con = spin.signalValue.connect((valueButton) -> {
final Connection con = spin.signalValue.connect(valueButton -> {
try {
LOGGER.warn("Set new value: {}", valueButton);
pojo.setExistingValue(widget, (int) (long) valueButton);
@ -484,7 +492,7 @@ public class BasicWindows extends Windows {
spin.setPropertyFill(Vector3b.TRUE);
spin.setPropertyValue(value);
this.sizerMenu.subWidgetAdd(spin);
final Connection con = spin.signalValue.connect((valueButton) -> {
final Connection con = spin.signalValue.connect(valueButton -> {
try {
LOGGER.warn("Set new value: {}", valueButton);
pojo.setExistingValue(widget, valueButton);
@ -511,7 +519,7 @@ public class BasicWindows extends Windows {
element.setPropertyFill(Vector3b.TRUE);
element.setPropertyValue(value);
this.sizerMenu.subWidgetAdd(element);
final Connection con = element.signalModify.connect((valueButton) -> {
final Connection con = element.signalModify.connect(valueButton -> {
try {
LOGGER.warn("Set new value: {}", valueButton);
pojo.setExistingValue(widget, valueButton);
@ -538,7 +546,7 @@ public class BasicWindows extends Windows {
element.setPropertyFill(Vector3b.TRUE);
element.setPropertyValue(value.toString());
this.sizerMenu.subWidgetAdd(element);
final Connection con = element.signalModify.connect((valueButton) -> {
final Connection con = element.signalModify.connect(valueButton -> {
try {
LOGGER.warn("Set new value: {}", valueButton);
pojo.setExistingValue(widget, Uri.valueOf(valueButton));
@ -570,7 +578,7 @@ public class BasicWindows extends Windows {
checkBox.setPropertyFill(Vector3b.TRUE);
checkBox.setPropertyValue(value.x());
lineSizer.subWidgetAdd(checkBox);
final Connection con = checkBox.signalValue.connect((valueButton) -> {
final Connection con = checkBox.signalValue.connect(valueButton -> {
try {
final Object oldValue = pojo.getValue(widget);
if (oldValue instanceof final Vector2b castedValue) {
@ -590,7 +598,7 @@ public class BasicWindows extends Windows {
checkBox.setPropertyFill(Vector3b.TRUE);
checkBox.setPropertyValue(value.y());
lineSizer.subWidgetAdd(checkBox);
final Connection con = checkBox.signalValue.connect((valueButton) -> {
final Connection con = checkBox.signalValue.connect(valueButton -> {
try {
final Object oldValue = pojo.getValue(widget);
if (oldValue instanceof final Vector2b castedValue) {
@ -634,7 +642,7 @@ public class BasicWindows extends Windows {
spin.setPropertyFill(Vector3b.TRUE);
spin.setPropertyValue((int) value.x());
lineSizer.subWidgetAdd(spin);
final Connection con = spin.signalValue.connect((valueButton) -> {
final Connection con = spin.signalValue.connect(valueButton -> {
try {
final Object oldValue = pojo.getValue(widget);
if (oldValue instanceof final Vector2f castedValue) {
@ -666,7 +674,7 @@ public class BasicWindows extends Windows {
spin.setPropertyFill(Vector3b.TRUE);
spin.setPropertyValue((int) value.y());
lineSizer.subWidgetAdd(spin);
final Connection con = spin.signalValue.connect((valueButton) -> {
final Connection con = spin.signalValue.connect(valueButton -> {
try {
final Object oldValue = pojo.getValue(widget);
if (oldValue instanceof final Vector2f castedValue) {
@ -710,7 +718,7 @@ public class BasicWindows extends Windows {
spin.setPropertyFill(Vector3b.TRUE);
spin.setPropertyValue(value.x());
lineSizer.subWidgetAdd(spin);
final Connection con = spin.signalValue.connect((valueButton) -> {
final Connection con = spin.signalValue.connect(valueButton -> {
try {
final Object oldValue = pojo.getValue(widget);
if (oldValue instanceof final Vector2i castedValue) {
@ -742,7 +750,7 @@ public class BasicWindows extends Windows {
spin.setPropertyFill(Vector3b.TRUE);
spin.setPropertyValue(value.y());
lineSizer.subWidgetAdd(spin);
final Connection con = spin.signalValue.connect((valueButton) -> {
final Connection con = spin.signalValue.connect(valueButton -> {
try {
final Object oldValue = pojo.getValue(widget);
if (oldValue instanceof final Vector2i castedValue) {
@ -778,7 +786,7 @@ public class BasicWindows extends Windows {
checkBox.setPropertyFill(Vector3b.TRUE);
checkBox.setPropertyValue(value.x());
lineSizer.subWidgetAdd(checkBox);
final Connection con = checkBox.signalValue.connect((valueButton) -> {
final Connection con = checkBox.signalValue.connect(valueButton -> {
try {
final Object oldValue = pojo.getValue(widget);
if (oldValue instanceof final Vector3b castedValue) {
@ -798,7 +806,7 @@ public class BasicWindows extends Windows {
checkBox.setPropertyFill(Vector3b.TRUE);
checkBox.setPropertyValue(value.y());
lineSizer.subWidgetAdd(checkBox);
final Connection con = checkBox.signalValue.connect((valueButton) -> {
final Connection con = checkBox.signalValue.connect(valueButton -> {
try {
final Object oldValue = pojo.getValue(widget);
if (oldValue instanceof final Vector3b castedValue) {
@ -817,7 +825,7 @@ public class BasicWindows extends Windows {
checkBox.setPropertyFill(Vector3b.TRUE);
checkBox.setPropertyValue(value.z());
lineSizer.subWidgetAdd(checkBox);
final Connection con = checkBox.signalValue.connect((valueButton) -> {
final Connection con = checkBox.signalValue.connect(valueButton -> {
try {
final Object oldValue = pojo.getValue(widget);
if (oldValue instanceof final Vector3b castedValue) {
@ -861,7 +869,7 @@ public class BasicWindows extends Windows {
spin.setPropertyFill(Vector3b.TRUE);
spin.setPropertyValue((int) value.x());
lineSizer.subWidgetAdd(spin);
final Connection con = spin.signalValue.connect((valueButton) -> {
final Connection con = spin.signalValue.connect(valueButton -> {
try {
final Object oldValue = pojo.getValue(widget);
if (oldValue instanceof final Vector3f castedValue) {
@ -893,7 +901,7 @@ public class BasicWindows extends Windows {
spin.setPropertyFill(Vector3b.TRUE);
spin.setPropertyValue((int) value.y());
lineSizer.subWidgetAdd(spin);
final Connection con = spin.signalValue.connect((valueButton) -> {
final Connection con = spin.signalValue.connect(valueButton -> {
try {
final Object oldValue = pojo.getValue(widget);
if (oldValue instanceof final Vector3f castedValue) {
@ -925,7 +933,7 @@ public class BasicWindows extends Windows {
spin.setPropertyFill(Vector3b.TRUE);
spin.setPropertyValue((int) value.z());
lineSizer.subWidgetAdd(spin);
final Connection con = spin.signalValue.connect((valueButton) -> {
final Connection con = spin.signalValue.connect(valueButton -> {
try {
final Object oldValue = pojo.getValue(widget);
if (oldValue instanceof final Vector3f castedValue) {
@ -969,7 +977,7 @@ public class BasicWindows extends Windows {
spin.setPropertyFill(Vector3b.TRUE);
spin.setPropertyValue(value.x());
lineSizer.subWidgetAdd(spin);
final Connection con = spin.signalValue.connect((valueButton) -> {
final Connection con = spin.signalValue.connect(valueButton -> {
try {
final Object oldValue = pojo.getValue(widget);
if (oldValue instanceof final Vector3i castedValue) {
@ -1001,7 +1009,7 @@ public class BasicWindows extends Windows {
spin.setPropertyFill(Vector3b.TRUE);
spin.setPropertyValue(value.y());
lineSizer.subWidgetAdd(spin);
final Connection con = spin.signalValue.connect((valueButton) -> {
final Connection con = spin.signalValue.connect(valueButton -> {
try {
final Object oldValue = pojo.getValue(widget);
if (oldValue instanceof final Vector3i castedValue) {
@ -1033,7 +1041,7 @@ public class BasicWindows extends Windows {
spin.setPropertyFill(Vector3b.TRUE);
spin.setPropertyValue(value.z());
lineSizer.subWidgetAdd(spin);
final Connection con = spin.signalValue.connect((valueButton) -> {
final Connection con = spin.signalValue.connect(valueButton -> {
try {
final Object oldValue = pojo.getValue(widget);
if (oldValue instanceof final Vector3i castedValue) {
@ -1059,7 +1067,8 @@ public class BasicWindows extends Windows {
LOGGER.warn(" ==> type='{}'", pojo.getType());
LOGGER.warn(" ==> sub-type='{}'", pojo.getSubType());
final String eventName = pojo.getNames() != null && pojo.getNames().length != 0 ? pojo.getNames()[0] : pojo.getBeanName();
final String eventName = pojo.getNames() != null && pojo.getNames().length != 0 ? pojo.getNames()[0]
: pojo.getBeanName();
if (pojo.getSubType() != null && pojo.getType() == Signal.class) {
LOGGER.warn(" ** Signal<{}>", pojo.getSubType());
@ -1070,8 +1079,8 @@ public class BasicWindows extends Windows {
final String valueNameOfSignal = eventName;
@SuppressWarnings("unchecked")
final Signal<Object> tmp = (Signal<Object>) signalObject;
tmp.connect((object) -> {
LOGGER.print("Get event from '{}' value='{}'", valueNameOfSignal, object);
tmp.connect(object -> {
LOGGER.info("Get event from '{}' value='{}'", valueNameOfSignal, object);
});
}
}
@ -1084,7 +1093,7 @@ public class BasicWindows extends Windows {
final String valueNameOfSignal = eventName;
final SignalEmpty tmp = (SignalEmpty) signalObject;
tmp.connect(() -> {
LOGGER.print("Get event from '{}'", valueNameOfSignal);
LOGGER.info("Get event from '{}'", valueNameOfSignal);
});
}
@ -1100,7 +1109,8 @@ public class BasicWindows extends Windows {
LOGGER.warn(" ==> description='{}'", pojo.getDescription());
LOGGER.warn(" ==> type='{}'", pojo.getType());
LOGGER.warn(" ==> sub-type='{}'", pojo.getSubType());
final String propertyName = pojo.getNames() != null && pojo.getNames().length != 0 ? pojo.getNames()[0] : pojo.getBeanName();
final String propertyName = pojo.getNames() != null && pojo.getNames().length != 0 ? pojo.getNames()[0]
: pojo.getBeanName();
if (pojo.getType() == int.class || pojo.getType() == Integer.class) {
addMenuInt(widget, pojo);
} else if (pojo.getType() == long.class || pojo.getType() == Long.class) {

View File

@ -4,19 +4,20 @@ import org.atriasoft.etk.Configs;
import org.atriasoft.etk.math.Vector2f;
import org.atriasoft.ewol.context.EwolApplication;
import org.atriasoft.ewol.context.EwolContext;
import sample.atriasoft.ewol.Log;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Appl implements EwolApplication {
private static final Logger LOGGER = LoggerFactory.getLogger(Appl.class);
//! [ewol_sample_HW_main_application]
private void localCreate(final EwolContext context) {
//! [ewol_sample_HW_main_parse_arguments]
// parse all the argument of the application
for (int iii = 0; iii < context.getCmd().size(); iii++) {
String tmpppp = context.getCmd().get(iii);
final String tmpppp = context.getCmd().get(iii);
if (tmpppp == "-h" || tmpppp == "--help") {
LOGGER.print(" -h/--help display this help");
LOGGER.info(" -h/--help display this help");
System.exit(0);
}
}
@ -31,7 +32,7 @@ public class Appl implements EwolApplication {
//! [ewol_sample_HW_main_set_font_property]
//! [ewol_sample_HW_main_set_windows]
// Create the windows
MainWindows basicWindows = new MainWindows();
final MainWindows basicWindows = new MainWindows();
// configure the ewol context to use the new windows
context.setWindows(basicWindows);
//! [ewol_sample_HW_main_set_windows]

View File

@ -4,19 +4,20 @@ import org.atriasoft.etk.Configs;
import org.atriasoft.etk.math.Vector2f;
import org.atriasoft.ewol.context.EwolApplication;
import org.atriasoft.ewol.context.EwolContext;
import sample.atriasoft.ewol.Log;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Appl implements EwolApplication {
private static final Logger LOGGER = LoggerFactory.getLogger(Appl.class);
//! [ewol_sample_HW_main_application]
private void localCreate(final EwolContext context) {
//! [ewol_sample_HW_main_parse_arguments]
// parse all the argument of the application
for (int iii = 0; iii < context.getCmd().size(); iii++) {
String tmpppp = context.getCmd().get(iii);
final String tmpppp = context.getCmd().get(iii);
if (tmpppp == "-h" || tmpppp == "--help") {
LOGGER.print(" -h/--help display this help");
LOGGER.info(" -h/--help display this help");
System.exit(0);
}
}
@ -31,52 +32,52 @@ public class Appl implements EwolApplication {
//! [ewol_sample_HW_main_set_font_property]
//! [ewol_sample_HW_main_set_windows]
// Create the windows
MainWindows basicWindows = new MainWindows();
final MainWindows basicWindows = new MainWindows();
// configure the ewol context to use the new windows
context.setWindows(basicWindows);
//! [ewol_sample_HW_main_set_windows]
}
@Override
public void onCreate(final EwolContext context) {
LOGGER.info("Application onCreate: [BEGIN]");
localCreate(context);
LOGGER.info("Application onCreate: [ END ]");
}
@Override
public void onDestroy(final EwolContext context) {
LOGGER.info("Application onDestroy: [BEGIN]");
LOGGER.info("Application onDestroy: [ END ]");
}
@Override
public void onPause(final EwolContext context) {
LOGGER.info("Application onPause: [BEGIN]");
LOGGER.info("Application onPause: [ END ]");
}
@Override
public void onResume(final EwolContext context) {
LOGGER.info("Application onResume: [BEGIN]");
LOGGER.info("Application onResume: [ END ]");
}
@Override
public void onStart(final EwolContext context) {
LOGGER.info("Application onStart: [BEGIN]");
LOGGER.info("Application onStart: [ END ]");
}
@Override
public void onStop(final EwolContext context) {
LOGGER.info("Application onStop: [BEGIN]");
LOGGER.info("Application onStop: [ END ]");
}
}

View File

@ -4,19 +4,20 @@ import org.atriasoft.etk.Configs;
import org.atriasoft.etk.math.Vector2f;
import org.atriasoft.ewol.context.EwolApplication;
import org.atriasoft.ewol.context.EwolContext;
import sample.atriasoft.ewol.Log;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Appl implements EwolApplication {
private static final Logger LOGGER = LoggerFactory.getLogger(Appl.class);
//! [ewol_sample_HW_main_application]
private void localCreate(final EwolContext context) {
//! [ewol_sample_HW_main_parse_arguments]
// parse all the argument of the application
for (int iii = 0; iii < context.getCmd().size(); iii++) {
String tmpppp = context.getCmd().get(iii);
final String tmpppp = context.getCmd().get(iii);
if (tmpppp == "-h" || tmpppp == "--help") {
LOGGER.print(" -h/--help display this help");
LOGGER.info(" -h/--help display this help");
System.exit(0);
}
}
@ -31,52 +32,52 @@ public class Appl implements EwolApplication {
//! [ewol_sample_HW_main_set_font_property]
//! [ewol_sample_HW_main_set_windows]
// Create the windows
MainWindows basicWindows = new MainWindows();
final MainWindows basicWindows = new MainWindows();
// configure the ewol context to use the new windows
context.setWindows(basicWindows);
//! [ewol_sample_HW_main_set_windows]
}
@Override
public void onCreate(final EwolContext context) {
LOGGER.info("Application onCreate: [BEGIN]");
localCreate(context);
LOGGER.info("Application onCreate: [ END ]");
}
@Override
public void onDestroy(final EwolContext context) {
LOGGER.info("Application onDestroy: [BEGIN]");
LOGGER.info("Application onDestroy: [ END ]");
}
@Override
public void onPause(final EwolContext context) {
LOGGER.info("Application onPause: [BEGIN]");
LOGGER.info("Application onPause: [ END ]");
}
@Override
public void onResume(final EwolContext context) {
LOGGER.info("Application onResume: [BEGIN]");
LOGGER.info("Application onResume: [ END ]");
}
@Override
public void onStart(final EwolContext context) {
LOGGER.info("Application onStart: [BEGIN]");
LOGGER.info("Application onStart: [ END ]");
}
@Override
public void onStop(final EwolContext context) {
LOGGER.info("Application onStop: [BEGIN]");
LOGGER.info("Application onStop: [ END ]");
}
}

View File

@ -4,19 +4,20 @@ import org.atriasoft.etk.Configs;
import org.atriasoft.etk.math.Vector2f;
import org.atriasoft.ewol.context.EwolApplication;
import org.atriasoft.ewol.context.EwolContext;
import sample.atriasoft.ewol.Log;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Appl implements EwolApplication {
private static final Logger LOGGER = LoggerFactory.getLogger(Appl.class);
//! [ewol_sample_HW_main_application]
private void localCreate(final EwolContext context) {
//! [ewol_sample_HW_main_parse_arguments]
// parse all the argument of the application
for (int iii = 0; iii < context.getCmd().size(); iii++) {
String tmpppp = context.getCmd().get(iii);
final String tmpppp = context.getCmd().get(iii);
if (tmpppp == "-h" || tmpppp == "--help") {
LOGGER.print(" -h/--help display this help");
LOGGER.info(" -h/--help display this help");
System.exit(0);
}
}
@ -31,52 +32,52 @@ public class Appl implements EwolApplication {
//! [ewol_sample_HW_main_set_font_property]
//! [ewol_sample_HW_main_set_windows]
// Create the windows
MainWindows basicWindows = new MainWindows();
final MainWindows basicWindows = new MainWindows();
// configure the ewol context to use the new windows
context.setWindows(basicWindows);
//! [ewol_sample_HW_main_set_windows]
}
@Override
public void onCreate(final EwolContext context) {
LOGGER.info("Application onCreate: [BEGIN]");
localCreate(context);
LOGGER.info("Application onCreate: [ END ]");
}
@Override
public void onDestroy(final EwolContext context) {
LOGGER.info("Application onDestroy: [BEGIN]");
LOGGER.info("Application onDestroy: [ END ]");
}
@Override
public void onPause(final EwolContext context) {
LOGGER.info("Application onPause: [BEGIN]");
LOGGER.info("Application onPause: [ END ]");
}
@Override
public void onResume(final EwolContext context) {
LOGGER.info("Application onResume: [BEGIN]");
LOGGER.info("Application onResume: [ END ]");
}
@Override
public void onStart(final EwolContext context) {
LOGGER.info("Application onStart: [BEGIN]");
LOGGER.info("Application onStart: [ END ]");
}
@Override
public void onStop(final EwolContext context) {
LOGGER.info("Application onStop: [BEGIN]");
LOGGER.info("Application onStop: [ END ]");
}
}

View File

@ -4,11 +4,12 @@ import org.atriasoft.etk.Configs;
import org.atriasoft.etk.math.Vector2f;
import org.atriasoft.ewol.context.EwolApplication;
import org.atriasoft.ewol.context.EwolContext;
import sample.atriasoft.ewol.Log;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Appl implements EwolApplication {
private static final Logger LOGGER = LoggerFactory.getLogger(Appl.class);
//! [ewol_sample_HW_main_application]
private void localCreate(final EwolContext context) {
//! [ewol_sample_HW_main_parse_arguments]
@ -16,7 +17,7 @@ public class Appl implements EwolApplication {
for (int iii = 0; iii < context.getCmd().size(); iii++) {
final String tmpppp = context.getCmd().get(iii);
if (tmpppp == "-h" || tmpppp == "--help") {
LOGGER.print(" -h/--help display this help");
LOGGER.info(" -h/--help display this help");
System.exit(0);
}
}
@ -36,47 +37,47 @@ public class Appl implements EwolApplication {
context.setWindows(basicWindows);
//! [ewol_sample_HW_main_set_windows]
}
@Override
public void onCreate(final EwolContext context) {
LOGGER.info("Application onCreate: [BEGIN]");
localCreate(context);
LOGGER.info("Application onCreate: [ END ]");
}
@Override
public void onDestroy(final EwolContext context) {
LOGGER.info("Application onDestroy: [BEGIN]");
LOGGER.info("Application onDestroy: [ END ]");
}
@Override
public void onPause(final EwolContext context) {
LOGGER.info("Application onPause: [BEGIN]");
LOGGER.info("Application onPause: [ END ]");
}
@Override
public void onResume(final EwolContext context) {
LOGGER.info("Application onResume: [BEGIN]");
LOGGER.info("Application onResume: [ END ]");
}
@Override
public void onStart(final EwolContext context) {
LOGGER.info("Application onStart: [BEGIN]");
LOGGER.info("Application onStart: [ END ]");
}
@Override
public void onStop(final EwolContext context) {
LOGGER.info("Application onStop: [BEGIN]");
LOGGER.info("Application onStop: [ END ]");
}
}

View File

@ -17,6 +17,13 @@ public class MainWindows extends BasicWindows {
public MainWindows() {
setPropertyTitle("Test all compositing");
this.titles.add("test button toogle");
this.values.add("""
<Button name='My name is Bob' toggle='true' fill='true,false,false' expand='true'>
<Label>hello, how are you</Label>
<Label>You <br/>Click - Me <b>!?<!--kjlkjlkjlkj-->d</b></Label>
</Button>
""");
this.titles.add("test Slider");
this.values.add("""
<Slider name='My name is Bob' fill='true,false,false' expand='true'/>
@ -33,13 +40,6 @@ public class MainWindows extends BasicWindows {
</Button>
""");
this.titles.add("test button toogle");
this.values.add("""
<Button name='My name is Bob' toggle='true' fill='true,false,false' expand='true'>
<Label>hello, how are you</Label>
<Label>You <br/>Click - Me <b>!?<!--kjlkjlkjlkj-->d</b></Label>
</Button>
""");
this.titles.add("test checkBox");
this.values.add("""
<CheckBox
@ -57,10 +57,13 @@ public class MainWindows extends BasicWindows {
public void requestNext() {
System.out.print("Request change !!!!");
this.index++;
if (this.titles.size() <= this.index) {
this.index = 0;
}
setPropertyTitle(this.titles.get(this.index));
final String dataString = this.values.get(this.index);
final Widget data = Composer.composerGenerateString(dataString);
this.setTestWidget(data);
setTestWidget(data);
}
}

View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- environment detection (defaut: dev) -->
<property name="LOG_LEVEL_ENV" value="${LOG_LEVEL:-dev}" />
<!-- Appender for development -->
<if condition="property(&quot;LOG_LEVEL_ENV&quot;).equals(&quot;dev&quot;)">
<then>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%green(%d{HH:mm:ss.SSS}) %highlight(%-5level) %-30((%file:%line\)): %msg%n</pattern>
</encoder>
</appender>
<logger name="org.atriasoft.etk" level="DEBUG" />
<logger name="org.atriasoft.ewol" level="DEBUG" />
<logger name="org.atriasoft.esignal" level="DEBUG" />
<logger name="org.atriasoft.esvg" level="DEBUG" />
<logger name="sample.atriasoft.ewol" level="DEBUG" />
<root level="INFO">
<appender-ref ref="CONSOLE" />
</root>
</then>
</if>
<!-- Appender for production -->
<if condition="property(&quot;LOG_LEVEL_ENV&quot;).matches(&quot;^prod.*&quot;)">
<then>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>[%thread] %level %logger - %msg%n</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="CONSOLE" />
</root>
</then>
</if>
<if condition="property(&quot;LOG_LEVEL_ENV&quot;).equals(&quot;prod-debug&quot;)">
<then>
<logger name="org.atriasoft.ewol" level="DEBUG" />
</then>
</if>
<if condition="property(&quot;LOG_LEVEL_ENV&quot;).equals(&quot;prod-trace&quot;)">
<then>
<logger name="org.atriasoft.ewol" level="TRACE" />
<logger name="org.atriasoft.etk" level="DEBUG" />
</then>
</if>
<if condition="property(&quot;LOG_LEVEL_ENV&quot;).equals(&quot;prod-trace-full&quot;)">
<then>
<logger name="org.atriasoft.ewol" level="TRACE" />
<logger name="org.atriasoft.v" level="TRACE" />
</then>
</if>
</configuration>

View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- environment detection (defaut: dev) -->
<property name="LOG_LEVEL_ENV" value="${LOG_LEVEL:-dev}" />
<!-- Appender for development -->
<if condition="property(&quot;LOG_LEVEL_ENV&quot;).equals(&quot;dev&quot;)">
<then>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%green(%d{HH:mm:ss.SSS}) %highlight(%-5level) %-30((%file:%line\)): %msg%n</pattern>
</encoder>
</appender>
<logger name="org.atriasoft.etk" level="DEBUG" />
<logger name="org.atriasoft.ewol" level="DEBUG" />
<logger name="org.atriasoft.esignal" level="DEBUG" />
<logger name="org.atriasoft.esvg" level="DEBUG" />
<logger name="sample.atriasoft.ewol" level="DEBUG" />
<root level="INFO">
<appender-ref ref="CONSOLE" />
</root>
</then>
</if>
<!-- Appender for production -->
<if condition="property(&quot;LOG_LEVEL_ENV&quot;).matches(&quot;^prod.*&quot;)">
<then>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>[%thread] %level %logger - %msg%n</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="CONSOLE" />
</root>
</then>
</if>
<if condition="property(&quot;LOG_LEVEL_ENV&quot;).equals(&quot;prod-debug&quot;)">
<then>
<logger name="org.atriasoft.ewol" level="DEBUG" />
</then>
</if>
<if condition="property(&quot;LOG_LEVEL_ENV&quot;).equals(&quot;prod-trace&quot;)">
<then>
<logger name="org.atriasoft.ewol" level="TRACE" />
<logger name="org.atriasoft.etk" level="DEBUG" />
</then>
</if>
<if condition="property(&quot;LOG_LEVEL_ENV&quot;).equals(&quot;prod-trace-full&quot;)">
<then>
<logger name="org.atriasoft.ewol" level="TRACE" />
<logger name="org.atriasoft.v" level="TRACE" />
</then>
</if>
</configuration>

View File

@ -0,0 +1,397 @@
/** @file
* @author Edouard DUPIN
* @copyright 2011, Edouard DUPIN, all right reserved
* @license MPL v2.0 (see license file)
*/
package org.atriasoft.ewol.compositing;
import org.atriasoft.egami.ImageByte;
import org.atriasoft.egami.ImageByteRGBA;
import org.atriasoft.egami.ToolImage;
import org.atriasoft.esvg.EsvgDocument;
import org.atriasoft.etk.Color;
import org.atriasoft.etk.Uri;
import org.atriasoft.etk.math.Matrix4f;
import org.atriasoft.etk.math.Vector2f;
import org.atriasoft.etk.math.Vector2i;
import org.atriasoft.etk.math.Vector3f;
import org.atriasoft.gale.backend3d.OpenGL;
import org.atriasoft.gale.backend3d.OpenGL.RenderMode;
import org.atriasoft.gale.resource.ResourceProgram;
import org.atriasoft.gale.resource.ResourceTexture2;
import org.atriasoft.gale.resource.ResourceVirtualArrayObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class CompositingSVG extends Compositing {
private static final Logger LOGGER = LoggerFactory.getLogger(CompositingSVG.class);
public static final int NB_VBO = 3;
public static final int SIZE_AUTO = 0;
public static final int VBO_ID_COLOR = 2;
// VBO table property:
public static final int VBO_ID_COORD = 0;
public static final int VBO_ID_COORD_TEX = 1;
private float angle = 0; //!< Angle to set at the axes
private Color color = new Color(1, 1, 1); //!< The text foreground color
private String svgData;
protected int oGLMatrixProjection = -1; //!< openGL id on the element (Projection matrix)
protected int oGLMatrixTransformation = -1; //!< openGL id on the element (transformation matrix)
protected int oGLMatrixView = -1; //!< openGL id on the element (view matrix)
private ResourceProgram oGLprogram = null; //!< pointer on the opengl display program
private Vector3f position = Vector3f.ZERO; //!< The current position to draw
private Vector2i requestSize = new Vector2i(2, 2);
private ResourceTexture2 resource = null;
private ResourceTexture2 resourceImage = null; //!< texture resources
private ResourceVirtualArrayObject vbo = null;
private Color[] vboDataColors = null;
private Vector3f[] vboDataCoords = null;
private Vector2f[] vboDataCoordsTex = null;
public CompositingSVG() {
this("<svg></svg>", CompositingSVG.SIZE_AUTO);
}
public CompositingSVG(final String data, final int size) {
this.svgData = data;
// Create the VBO:
this.vbo = ResourceVirtualArrayObject.createDynamic();
if (this.vbo == null) {
LOGGER.error("can not instanciate VBO ...");
return;
}
// TO facilitate some debugs we add a name of the VBO:
this.vbo.setName("[VBO] of " + this.getClass().getCanonicalName());
setSource(data, size);
loadProgram();
}
/**
* clear alll tre registered element in the current element
*/
@Override
public void clear() {
// call upper class
super.clear();
// reset Buffer :
this.vbo.clear();
// reset temporal variables :
this.position = Vector3f.ZERO;
this.color = Color.WHITE;
this.angle = 0;
}
/**
* draw All the registered text in the current element on openGL
* @param disableDepthTest disable the Depth test for display
*/
@Override
public void draw(final boolean disableDepthTest) {
/*
if (this.VBO.bufferSize(this.vboIdCoord) <= 0) {
//LOGGER.warn("Nothink to draw...");
return;
}
*/
if (this.resourceImage == null) {
return;
}
if (this.oGLprogram == null) {
LOGGER.error("No shader ...");
return;
}
//LOGGER.warn("Display image : " + this.VBO.bufferSize(this.vboIdCoord));
if (disableDepthTest) {
OpenGL.disable(OpenGL.Flag.flag_depthTest);
} else {
OpenGL.enable(OpenGL.Flag.flag_depthTest);
}
// set Matrix : translation/positionMatrix
final Matrix4f projMatrix = OpenGL.getMatrix();
final Matrix4f camMatrix = OpenGL.getCameraMatrix();
this.oGLprogram.use();
this.vbo.bindForRendering();
this.oGLprogram.uniformMatrix(this.oGLMatrixProjection, projMatrix);
this.oGLprogram.uniformMatrix(this.oGLMatrixTransformation, this.matrixApply);
this.oGLprogram.uniformMatrix(this.oGLMatrixView, camMatrix);
// TextureID
this.resourceImage.bindForRendering(0);
this.vbo.renderArrays(RenderMode.TRIANGLE);
this.vbo.unBindForRendering();
this.oGLprogram.unUse();
}
@Override
public void flush() {
this.vbo.setPosition(this.vboDataCoords);
this.vbo.setTextureCoordinate(this.vboDataCoordsTex);
this.vbo.setColors(this.vboDataColors);
this.vbo.setVertexCount(this.vboDataCoords.length);
this.vbo.flush();
}
/**
* get the current display position (sometime needed in the gui control)
* @return the current position.
*/
public Vector3f getPos() {
return this.position;
}
/**
* get the source image registered size in the file (<0 when multiple size image)
* @return tre image registered size
*/
public Vector2i getRealSize() {
if (this.resourceImage == null) {
return Vector2i.ZERO;
}
return this.resourceImage.getUsableSize();
}
/**
* Sometimes the user declare an image but not allocate the ressources all the time, this is to know it ..
* @return the validity od the resources.
*/
public boolean hasSources() {
return this.resource != null;
}
/**
* load the openGL program and get all the ID needed
*/
private void loadProgram() {
// get the shader resource:
this.oGLprogram = ResourceProgram.create(new Uri("DATA", "textured3D.vert", "ewol"),
new Uri("DATA", "textured3D.frag", "ewol"));
if (this.oGLprogram != null) {
this.oGLMatrixTransformation = this.oGLprogram.getUniform("in_matrixTransformation");
this.oGLMatrixProjection = this.oGLprogram.getUniform("in_matrixProjection");
this.oGLMatrixView = this.oGLprogram.getUniform("in_matrixView");
}
}
public void print(final Vector2f size) {
printPart(size, Vector2f.ZERO, Vector2f.ONE);
}
/**
* add a compleate of the image to display with the requested size
* @param size size of the output image
*/
public void print(final Vector2i size) {
print(new Vector2f(size.x(), size.y()));
}
/**
* add a part of the image to display with the requested size
* @param size size of the output image
* @param sourcePosStart Start position in the image [0..1] (can be bigger but this repeate the image).
* @param sourcePosStop Stop position in the image [0..1] (can be bigger but this repeate the image).
*/
public void printPart(final Vector2f size, final Vector2f sourcePosStartIn, final Vector2f sourcePosStopIn) {
if (this.resource == null) {
return;
}
final Vector2f openGLSize = new Vector2f(this.resource.getOpenGlSize().x(), this.resource.getOpenGlSize().y());
final Vector2i usefullSize = this.resource.getUsableSize();
final Vector2f ratio = new Vector2f(usefullSize.x() / openGLSize.x(), usefullSize.y() / openGLSize.y());
final Vector2f sourcePosStart = sourcePosStartIn.multiply(ratio);
final Vector2f sourcePosStop = sourcePosStopIn.multiply(ratio);
LOGGER.trace(" openGLSize=" + openGLSize + " usableSize=" + usefullSize + " start=" + sourcePosStart
+ " stop=" + sourcePosStop);
this.vboDataColors = new Color[6];
this.vboDataCoords = new Vector3f[6];
this.vboDataCoordsTex = new Vector2f[6];
if (this.angle == 0.0f) {
Vector3f point = this.position;
int indexElem = 0;
Vector2f tex = new Vector2f(sourcePosStart.x(), sourcePosStop.y());
this.vboDataCoords[indexElem] = point;
this.vboDataCoordsTex[indexElem] = tex;
this.vboDataColors[indexElem] = this.color;
indexElem++;
tex = new Vector2f(sourcePosStop.x(), sourcePosStop.y());
point = new Vector3f(this.position.x() + size.x(), this.position.y(), 0);
this.vboDataCoords[indexElem] = point;
this.vboDataCoordsTex[indexElem] = tex;
this.vboDataColors[indexElem] = this.color;
indexElem++;
tex = new Vector2f(sourcePosStop.x(), sourcePosStart.y());
point = new Vector3f(this.position.x() + size.x(), this.position.y() + size.y(), 0);
this.vboDataCoords[indexElem] = point;
this.vboDataCoordsTex[indexElem] = tex;
this.vboDataColors[indexElem] = this.color;
indexElem++;
this.vboDataCoords[indexElem] = point;
this.vboDataCoordsTex[indexElem] = tex;
this.vboDataColors[indexElem] = this.color;
indexElem++;
tex = new Vector2f(sourcePosStart.x(), sourcePosStart.y());
point = new Vector3f(this.position.x(), this.position.y() + size.y(), 0);
this.vboDataCoords[indexElem] = point;
this.vboDataCoordsTex[indexElem] = tex;
this.vboDataColors[indexElem] = this.color;
indexElem++;
tex = new Vector2f(sourcePosStart.x(), sourcePosStop.y());
point = new Vector3f(this.position.x(), this.position.y(), 0);
this.vboDataCoords[indexElem] = point;
this.vboDataCoordsTex[indexElem] = tex;
this.vboDataColors[indexElem] = this.color;
return;
}
final Vector3f center = this.position.add(new Vector3f(size.x(), size.y(), 0)).divide(2.0f);
final Vector3f limitedSize = new Vector3f(size.x() * 0.5f, size.y() * 0.5f, 0.0f);
Vector3f point = Vector3f.ZERO;
Vector2f tex = new Vector2f(sourcePosStart.x(), sourcePosStop.y());
int indexElem = 0;
point = new Vector3f(-limitedSize.x(), -limitedSize.y(), 0);
point = point.rotateNew(new Vector3f(0, 0, 1), this.angle).add(center);
this.vboDataCoords[indexElem] = point;
this.vboDataCoordsTex[indexElem] = tex;
this.vboDataColors[indexElem] = this.color;
indexElem++;
tex = new Vector2f(sourcePosStop.x(), sourcePosStop.y());
point = new Vector3f(limitedSize.x(), -limitedSize.y(), 0);
point = point.rotateNew(new Vector3f(0, 0, 1), this.angle).add(center);
this.vboDataCoords[indexElem] = point;
this.vboDataCoordsTex[indexElem] = tex;
this.vboDataColors[indexElem] = this.color;
indexElem++;
tex = new Vector2f(sourcePosStop.x(), sourcePosStart.y());
point = new Vector3f(limitedSize.x(), limitedSize.y(), 0);
point = point.rotateNew(new Vector3f(0, 0, 1), this.angle).add(center);
this.vboDataCoords[indexElem] = point;
this.vboDataCoordsTex[indexElem] = tex;
this.vboDataColors[indexElem] = this.color;
indexElem++;
this.vboDataCoords[indexElem] = point;
this.vboDataCoordsTex[indexElem] = tex;
this.vboDataColors[indexElem] = this.color;
indexElem++;
tex = new Vector2f(sourcePosStart.x(), sourcePosStart.y());
point = new Vector3f(-limitedSize.x(), limitedSize.y(), 0);
point = point.rotateNew(new Vector3f(0, 0, 1), this.angle).add(center);
this.vboDataCoords[indexElem] = point;
this.vboDataCoordsTex[indexElem] = tex;
this.vboDataColors[indexElem] = this.color;
indexElem++;
tex = new Vector2f(sourcePosStart.x(), sourcePosStop.y());
point = new Vector3f(-limitedSize.x(), -limitedSize.y(), 0);
point = point.rotateNew(new Vector3f(0, 0, 1), this.angle).add(center);
this.vboDataCoords[indexElem] = point;
this.vboDataCoordsTex[indexElem] = tex;
this.vboDataColors[indexElem] = this.color;
}
/**
* set a unique rotation of this element (not set in the rotate Generic system)
* @param angleRad Angle to set in radiant.
*/
public void setAngle(final float angleRad) {
this.angle = angleRad;
}
/**
* set the Color of the current foreground font
* @param color Color to set on foreground (for next print)
*/
public void setColor(final Color color) {
this.color = color;
}
public void setPos(final Vector2f pos) {
setPos(new Vector3f(pos.x(), pos.y(), 0));
}
/**
* set position for the next text writen
* @param pos Position of the text (in 3D)
*/
public void setPos(final Vector3f pos) {
this.position = pos;
}
public void setRelPos(final Vector2f pos) {
setRelPos(new Vector3f(pos.x(), pos.y(), 0));
}
/**
* set relative position for the next text writen
* @param pos ofset apply of the text (in 3D)
*/
public void setRelPos(final Vector3f pos) {
this.position = this.position.add(pos);
}
public void setSource(final ImageByteRGBA image) {
clear();
this.svgData = null;
this.requestSize = image.getSize();
this.resourceImage = new ResourceTexture2();
this.resourceImage.set(image);
}
public void setSource(final String data) {
setSource(data, 32);
}
public void setSource(final String data, final int size) {
setSource(data, new Vector2i(size, size));
}
public void setSource(final String data, final Vector2i size) {
clear();
final EsvgDocument doc = new EsvgDocument();
doc.parse(data);
final ImageByte tmp = ToolImage.convertImageByte(doc.renderImageFloatRGBA(size));
if (tmp == null) {
LOGGER.error("Can not load the Raw SVG ... ");
return;
}
this.resourceImage.set(tmp);
if (this.svgData.equals(data) && this.requestSize.x() == size.x() && this.requestSize.y() == size.y()) {
// Nothing to do ...
return;
}
final ResourceTexture2 resource = this.resource;
final ResourceTexture2 resourceTex = this.resourceImage;
this.svgData = data;
this.requestSize = size;
this.resource = null;
this.resourceImage = null;
final Vector2i tmpSize = new Vector2i(size.x(), size.y());
// link to new one
this.resource = ResourceTexture2.create();
if (this.resource == null) {
LOGGER.error("Can not get Image resource");
}
}
}

View File

@ -30,7 +30,7 @@ public class LabelOnSVG extends Widget {
protected int colorDefaultFgText = -1; //!< Default color of the text
protected ResourceColorFile colorProperty; //!< theme color property
protected boolean propertyAutoTranslate = true; //!< if at true the data is translate automaticaly translate.
protected int propertyFontSize = 0; //!< default size of the font.
protected String propertyValue = ""; //!< decorated text to display.
@AknotSignal
@ -39,7 +39,7 @@ public class LabelOnSVG extends Widget {
public SignalEmpty signalPressed = new SignalEmpty();
protected CompositingText text = new CompositingText(); //!< Compositing text element.
protected String value = "";
public LabelOnSVG() {
this.colorProperty = ResourceColorFile.create(new Uri("THEME", "/color/Label.json", "ewol"));
if (this.colorProperty != null) {
@ -49,7 +49,7 @@ public class LabelOnSVG extends Widget {
setMouseLimit(1);
setPropertyCanFocus(false);
}
/**
* Constructor
* @param newLabel The displayed decorated text.
@ -64,7 +64,7 @@ public class LabelOnSVG extends Widget {
setPropertyCanFocus(false);
setPropertyValue(newLabel);
}
@Override
public void calculateMinMaxSize() {
final Vector3f tmpMax = this.propertyMaxSize.getPixel();
@ -76,30 +76,30 @@ public class LabelOnSVG extends Widget {
}
final Vector3f minSize = this.text.calculateSizeDecorated(this.value);
LOGGER.debug("[" + getId() + "] {" + getClass().getCanonicalName() + "} minSize : " + minSize);
this.minSize = new Vector3f(FMath.avg(tmpMin.x(), 4 + minSize.x(), tmpMax.x()),
FMath.avg(tmpMin.y(), 4 + minSize.y(), tmpMax.y()), FMath.avg(tmpMin.z(), 4 + minSize.z(), tmpMax.z()));
LOGGER.trace("[" + getId() + "] {" + getClass().getCanonicalName() + "} Result min size : " + tmpMin + " < "
+ this.minSize + " < " + tmpMax);
}
public int getPropertyFontSize() {
return this.propertyFontSize;
}
public String getPropertyValue() {
return this.propertyValue;
}
public boolean isPropertyAutoTranslate() {
return this.propertyAutoTranslate;
}
@Override
protected void onDraw() {
this.text.draw();
}
@Override
public boolean onEventInput(final EventInput event) {
//LOGGER.debug("Event on Label ...");
@ -112,7 +112,7 @@ public class LabelOnSVG extends Widget {
}
return false;
}
@Override
public void onRegenerateDisplay() {
if (!needRedraw()) {
@ -120,24 +120,24 @@ public class LabelOnSVG extends Widget {
}
this.text.clear();
final int paddingSize = 2;
final Vector3f tmpMax = this.propertyMaxSize.getPixel();
// to know the size of one line :
final Vector3f minSize = this.text.calculateSize('A');
//minSize.setX(etk::max(minSize.x(), this.minSize.x()));
//minSize.setY(etk::max(minSize.y(), this.minSize.y()));
if (tmpMax.x() <= 999999) {
this.text.setTextAlignment(0, tmpMax.x() - 2 * paddingSize, AlignMode.LEFT);
}
final Vector3f currentTextSize = this.text.calculateSizeDecorated(this.value);
Vector2i localSize = new Vector2i((int) this.minSize.x(), (int) this.minSize.y());
// no change for the text origin :
Vector3f tmpTextOrigin = new Vector3f((this.size.x() - this.minSize.x()) / 2.0f,
(this.size.y() - this.minSize.y()) / 2.0f, 0);
if (this.propertyFill.x()) {
localSize = localSize.withX((int) this.size.x());
tmpTextOrigin = tmpTextOrigin.withX(0);
@ -148,14 +148,14 @@ public class LabelOnSVG extends Widget {
}
tmpTextOrigin = tmpTextOrigin.add(paddingSize, paddingSize, 0);
localSize = localSize.less(2 * paddingSize, 2 * paddingSize);
tmpTextOrigin = tmpTextOrigin.withY(tmpTextOrigin.y() + (this.minSize.y() - 2 * paddingSize) - minSize.y());
final Vector3f textPos = new Vector3f(tmpTextOrigin.x(), tmpTextOrigin.y(), 0);
final Vector3f drawClippingPos = new Vector3f(paddingSize, paddingSize, -0.5f);
final Vector3f drawClippingSize = new Vector3f((this.size.x() - paddingSize), (this.size.y() - paddingSize), 1);
// clean the element
this.text.reset();
if (this.propertyFontSize != 0) {
@ -170,10 +170,10 @@ public class LabelOnSVG extends Widget {
this.text.setTextAlignment(tmpTextOrigin.x(), tmpTextOrigin.x() + localSize.x(), AlignMode.LEFT);
this.text.setClipping(drawClippingPos, drawClippingSize);
this.text.printDecorated(this.value);
this.text.flush();
}
@AknotManaged
@AknotAttribute
@AknotName("auto-translate")
@ -191,7 +191,7 @@ public class LabelOnSVG extends Widget {
markToRedraw();
requestUpdateSize();
}
@AknotManaged
@AknotAttribute
@AknotName("font-size")
@ -204,7 +204,7 @@ public class LabelOnSVG extends Widget {
markToRedraw();
requestUpdateSize();
}
@AknotManaged
@AknotAttribute
@AknotName("value")
@ -222,5 +222,5 @@ public class LabelOnSVG extends Widget {
requestUpdateSize();
this.propertyValue = propertyValue;
}
}

View File

@ -37,7 +37,7 @@ public class Spin extends SpinBase {
protected Connection connectionEntry = new Connection();
protected Connection connectionButtonUp = new Connection();
protected Connection connectionButtonDown = new Connection();
/**
* Constructor
* @param _mode mode to display the spin
@ -47,14 +47,14 @@ public class Spin extends SpinBase {
super(new Uri("THEME", "shape/Spin.json", "ewol"));
connectGui();
}
public void checkValue(long value) {
value = FMath.clamp(this.propertyMin, value, this.propertyMax);
this.propertyValue = value;
this.widgetEntry.setPropertyValue(Long.toString(value));
this.signalValue.emit(this.propertyValue);
}
public void connectGui() {
LOGGER.warn("updateGui [START]");
super.updateGui();
@ -70,7 +70,7 @@ public class Spin extends SpinBase {
checkValue(this.propertyValue);
LOGGER.warn("updateGui [STOP]");
}
@AknotManaged
@AknotAttribute
@AknotName("increment")
@ -78,7 +78,7 @@ public class Spin extends SpinBase {
public long getPropertyIncrement() {
return this.propertyIncrement;
}
@AknotManaged
@AknotAttribute
@AknotName("mantis")
@ -86,7 +86,7 @@ public class Spin extends SpinBase {
public int getPropertyMantis() {
return this.propertyMantis;
}
@AknotManaged
@AknotAttribute
@AknotName(value = "max")
@ -94,7 +94,7 @@ public class Spin extends SpinBase {
public long getPropertyMax() {
return this.propertyMax;
}
@AknotManaged
@AknotAttribute
@AknotName("min")
@ -102,7 +102,7 @@ public class Spin extends SpinBase {
public long getPropertyMin() {
return this.propertyMin;
}
@AknotManaged
@AknotAttribute
@AknotName("value")
@ -110,7 +110,7 @@ public class Spin extends SpinBase {
public long getPropertyValue() {
return this.propertyValue;
}
protected void onCallbackDown(final Boolean value) {
if (value) {
return;
@ -118,15 +118,19 @@ public class Spin extends SpinBase {
final long data = this.propertyValue - this.propertyIncrement;
checkValue(data);
}
protected void onCallbackModify(final String value) {
if (value.isEmpty()) {
return;
}
final long value1 = Long.valueOf(value);
checkValue(value1);
try {
final long value1 = Long.valueOf(value);
checkValue(value1);
} catch (final NumberFormatException ex) {
LOGGER.error("This is not a value {} ==> {}", value, ex.getLocalizedMessage());
}
}
protected void onCallbackUp(final Boolean value) {
if (value) {
return;
@ -134,23 +138,23 @@ public class Spin extends SpinBase {
final long data = this.propertyValue + this.propertyIncrement;
checkValue(data);
}
protected void onChangePropertyIncrement() {
}
protected void onChangePropertyMantis() {
}
protected void onChangePropertyMax() {
checkValue(this.propertyValue);
}
protected void onChangePropertyMin() {
checkValue(this.propertyValue);
}
protected void onChangePropertyValue() {
markToRedraw();
if (this.widgetEntry == null) {
@ -159,7 +163,7 @@ public class Spin extends SpinBase {
}
checkValue(this.propertyValue);
}
public void setPropertyIncrement(final long propertyIncrement) {
if (this.propertyIncrement == propertyIncrement) {
return;
@ -167,7 +171,7 @@ public class Spin extends SpinBase {
this.propertyIncrement = propertyIncrement;
onChangePropertyIncrement();
}
public void setPropertyMantis(final int propertyMantis) {
if (this.propertyMantis == propertyMantis) {
return;
@ -175,7 +179,7 @@ public class Spin extends SpinBase {
this.propertyMantis = propertyMantis;
onChangePropertyMantis();
}
public void setPropertyMax(final long propertyMax) {
if (this.propertyMax == propertyMax) {
return;
@ -183,7 +187,7 @@ public class Spin extends SpinBase {
this.propertyMax = propertyMax;
onChangePropertyMax();
}
public void setPropertyMin(final long propertyMin) {
if (this.propertyMin == propertyMin) {
return;
@ -191,7 +195,7 @@ public class Spin extends SpinBase {
this.propertyMin = propertyMin;
onChangePropertyMin();
}
public void setPropertyValue(final long propertyValue) {
if (this.propertyValue == propertyValue) {
return;

Some files were not shown because too many files have changed in this diff Show More