[FIX] missing files

This commit is contained in:
Edouard DUPIN 2025-05-24 00:25:14 +02:00
parent 6c4ac572b6
commit 2743abe410
29 changed files with 2712 additions and 0 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>

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

@ -0,0 +1,6 @@
module sample.atriasoft.ewol {
//exports sample.atriasoft.ewol.simpleWindowsWithImage;
requires org.atriasoft.ewol;
requires org.atriasoft.etk;
requires org.atriasoft.esignal;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,83 @@
package sample.atriasoft.ewol.ComplexWindiows1;
import org.atriasoft.etk.Configs;
import org.atriasoft.etk.math.Vector2f;
import org.atriasoft.ewol.context.EwolApplication;
import org.atriasoft.ewol.context.EwolContext;
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++) {
final String tmpppp = context.getCmd().get(iii);
if (tmpppp == "-h" || tmpppp == "--help") {
LOGGER.info(" -h/--help display this help");
System.exit(0);
}
}
//! [ewol_sample_HW_main_parse_arguments]
//! [ewol_sample_HW_main_set_windows_size]
// TODO : Remove this: Move if in the windows properties
context.setSize(new Vector2f(800, 600));
//! [ewol_sample_HW_main_set_windows_size]
//! [ewol_sample_HW_main_set_font_property]
// select font preference of der with a basic application size
Configs.getConfigFonts().set("FreeSherif", 12);
//! [ewol_sample_HW_main_set_font_property]
//! [ewol_sample_HW_main_set_windows]
// Create the windows
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

@ -0,0 +1,15 @@
package sample.atriasoft.ewol.ComplexWindiows1;
import org.atriasoft.etk.Uri;
import org.atriasoft.ewol.Ewol;
public class ComplexeWindows1Main {
public static void main(final String[] args) {
Ewol.init();
//Uri.addLibrary("ne", MainCollisionTest.class, "testDataLoxelEngine/");
Uri.setApplication(ComplexeWindows1Main.class);
Ewol.run(new Appl(), args);
}
private ComplexeWindows1Main() {}
}

View File

@ -0,0 +1,71 @@
package sample.atriasoft.ewol.ComplexWindiows1;
import org.atriasoft.etk.Color;
import org.atriasoft.etk.Dimension3f;
import org.atriasoft.etk.Distance;
import org.atriasoft.etk.math.Vector3b;
import org.atriasoft.etk.math.Vector3f;
import org.atriasoft.ewol.widget.Sizer;
import org.atriasoft.ewol.widget.Sizer.DisplayMode;
import org.atriasoft.ewol.widget.Spacer;
import org.atriasoft.ewol.widget.Windows;
public class MainWindows extends Windows {
public MainWindows() {
//! [ewol_sample_HW_windows_title]
setPropertyTitle("Simple sample test");
//EwolObject.getContext().getFontDefault().setName("FreeSans");
Sizer sizerMain = new Sizer(DisplayMode.VERTICAL);
sizerMain.setPropertyExpand(Vector3b.TRUE);
sizerMain.setPropertyFill(Vector3b.TRUE);
setSubWidget(sizerMain);
Sizer sizerHori1 = new Sizer(DisplayMode.HORIZONTAL);
sizerHori1.setPropertyExpand(Vector3b.TRUE);
sizerHori1.setPropertyFill(Vector3b.TRUE);
sizerMain.subWidgetAdd(sizerHori1);
Sizer sizerHori2 = new Sizer(DisplayMode.HORIZONTAL);
sizerHori2.setPropertyExpand(Vector3b.TRUE);
sizerHori2.setPropertyFill(Vector3b.TRUE);
sizerMain.subWidgetAdd(sizerHori2);
{
Spacer simpleSpacer = new Spacer();
simpleSpacer.setPropertyMinSize(new Dimension3f(new Vector3f(100, 100, 100), Distance.PIXEL));
simpleSpacer.setPropertyColor(Color.ALICE_BLUE);
simpleSpacer.setPropertyExpand(Vector3b.TRUE);
simpleSpacer.setPropertyFill(Vector3b.TRUE);
sizerHori1.subWidgetAdd(simpleSpacer);
}
{
Spacer simpleSpacer = new Spacer();
simpleSpacer.setPropertyColor(Color.DARK_GREEN);
simpleSpacer.setPropertyExpand(Vector3b.TRUE);
simpleSpacer.setPropertyFill(Vector3b.TRUE);
sizerHori1.subWidgetAdd(simpleSpacer);
}
{
Spacer simpleSpacer = new Spacer();
simpleSpacer.setPropertyColor(Color.CHOCOLATE);
simpleSpacer.setPropertyExpand(Vector3b.TRUE);
simpleSpacer.setPropertyFill(Vector3b.TRUE);
sizerHori1.subWidgetAdd(simpleSpacer);
}
{
Spacer simpleSpacer = new Spacer();
simpleSpacer.setPropertyColor(Color.GREEN_YELLOW);
simpleSpacer.setPropertyExpand(Vector3b.TRUE);
simpleSpacer.setPropertyFill(Vector3b.TRUE);
sizerHori2.subWidgetAdd(simpleSpacer);
}
{
Spacer simpleSpacer = new Spacer();
simpleSpacer.setPropertyColor(Color.PINK);
simpleSpacer.setPropertyExpand(Vector3b.TRUE);
simpleSpacer.setPropertyFill(Vector3b.TRUE);
sizerHori2.subWidgetAdd(simpleSpacer);
}
}
}

View File

@ -0,0 +1,83 @@
package sample.atriasoft.ewol.simpleWindowsLabel;
import org.atriasoft.etk.Configs;
import org.atriasoft.etk.math.Vector2f;
import org.atriasoft.ewol.context.EwolApplication;
import org.atriasoft.ewol.context.EwolContext;
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++) {
final String tmpppp = context.getCmd().get(iii);
if (tmpppp == "-h" || tmpppp == "--help") {
LOGGER.info(" -h/--help display this help");
System.exit(0);
}
}
//! [ewol_sample_HW_main_parse_arguments]
//! [ewol_sample_HW_main_set_windows_size]
// TODO : Remove this: Move if in the windows properties
context.setSize(new Vector2f(800, 600));
//! [ewol_sample_HW_main_set_windows_size]
//! [ewol_sample_HW_main_set_font_property]
// select font preference of der with a basic application size
Configs.getConfigFonts().set("FreeSherif", 12);
//! [ewol_sample_HW_main_set_font_property]
//! [ewol_sample_HW_main_set_windows]
// Create the windows
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

@ -0,0 +1,31 @@
package sample.atriasoft.ewol.simpleWindowsLabel;
import org.atriasoft.etk.math.Vector3b;
import org.atriasoft.ewol.widget.Label;
import org.atriasoft.ewol.widget.Spacer;
import sample.atriasoft.ewol.BasicWindows;
public class MainWindows extends BasicWindows {
public MainWindows() {
//! [ewol_sample_HW_windows_title]
setPropertyTitle("Simple sample test");
//EwolObject.getContext().getFontDefault().setName("FreeSans");
//! [ewol_sample_HW_windows_label]
if (true) {
//! [ewol_sample_HW_windows_title]
final Label simpleLabel = new Label();
simpleLabel.setPropertyValue("He<b>llo.</b> <font color='blue'>World</font><br/><br/> - How are You ???<br/> - Not so Well, I break my leg.<br/><br/><center>The end</center>");
simpleLabel.setPropertyExpand(Vector3b.TRUE);
simpleLabel.setPropertyFill(Vector3b.TRUE);
this.setTestWidget(simpleLabel);
//! [ewol_sample_HW_windows_label]
} else {
final Spacer simpleSpacer = new Spacer();
simpleSpacer.setPropertyExpand(Vector3b.TRUE);
simpleSpacer.setPropertyFill(Vector3b.TRUE);
this.setTestWidget(simpleSpacer);
}
}
}

View File

@ -0,0 +1,15 @@
package sample.atriasoft.ewol.simpleWindowsLabel;
import org.atriasoft.etk.Uri;
import org.atriasoft.ewol.Ewol;
public class SimpleWindowsLabelMain {
public static void main(final String[] args) {
Ewol.init();
//Uri.addLibrary("ne", MainCollisionTest.class, "testDataLoxelEngine/");
Uri.setApplication(SimpleWindowsLabelMain.class);
Ewol.run(new Appl(), args);
}
private SimpleWindowsLabelMain() {}
}

View File

@ -0,0 +1,83 @@
package sample.atriasoft.ewol.simpleWindowsWithCheckBox;
import org.atriasoft.etk.Configs;
import org.atriasoft.etk.math.Vector2f;
import org.atriasoft.ewol.context.EwolApplication;
import org.atriasoft.ewol.context.EwolContext;
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++) {
final String tmpppp = context.getCmd().get(iii);
if (tmpppp == "-h" || tmpppp == "--help") {
LOGGER.info(" -h/--help display this help");
System.exit(0);
}
}
//! [ewol_sample_HW_main_parse_arguments]
//! [ewol_sample_HW_main_set_windows_size]
// TODO : Remove this: Move if in the windows properties
context.setSize(new Vector2f(800, 600));
//! [ewol_sample_HW_main_set_windows_size]
//! [ewol_sample_HW_main_set_font_property]
// select font preference of der with a basic application size
Configs.getConfigFonts().set("FreeSherif", 12);
//! [ewol_sample_HW_main_set_font_property]
//! [ewol_sample_HW_main_set_windows]
// Create the windows
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

@ -0,0 +1,29 @@
package sample.atriasoft.ewol.simpleWindowsWithCheckBox;
import org.atriasoft.etk.math.Vector3b;
import org.atriasoft.ewol.widget.CheckBox;
import sample.atriasoft.ewol.BasicWindows;
public class MainWindows extends BasicWindows {
CheckBox testWidget;
public MainWindows() {
//! [ewol_sample_HW_windows_title]
setPropertyTitle("Simple CheckBox");
this.testWidget = new CheckBox("<b>Hello, how Are</b> You?<br/>second-life?");
//this.testWidget.setPropertySource(new Uri("DATA", "mireA.png"));
this.testWidget.setPropertyExpand(Vector3b.TRUE);
this.testWidget.setPropertyFill(Vector3b.TRUE);
this.setTestWidget(this.testWidget);
/*
Button simpleButton = new Button();
simpleButton.setPropertyValue("Top Button");
simpleButton.setPropertyExpand(Vector3b.TRUE);
simpleButton.setPropertyFill(Vector3b.TRUE);
this.setTestWidget(simpleButton);
*/
}
}

View File

@ -0,0 +1,15 @@
package sample.atriasoft.ewol.simpleWindowsWithCheckBox;
import org.atriasoft.etk.Uri;
import org.atriasoft.ewol.Ewol;
public class SimpleWindowsWithCheckBoxMain {
public static void main(final String[] args) {
Ewol.init();
//Uri.addLibrary("test-data", SimpleWindowsWithImageMain.class, "test-ewol/");
Uri.setApplication(SimpleWindowsWithCheckBoxMain.class, "test-ewol/");
Ewol.run(new Appl(), args);
}
private SimpleWindowsWithCheckBoxMain() {}
}

View File

@ -0,0 +1,83 @@
package sample.atriasoft.ewol.simpleWindowsWithImage;
import org.atriasoft.etk.Configs;
import org.atriasoft.etk.math.Vector2f;
import org.atriasoft.ewol.context.EwolApplication;
import org.atriasoft.ewol.context.EwolContext;
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++) {
final String tmpppp = context.getCmd().get(iii);
if (tmpppp == "-h" || tmpppp == "--help") {
LOGGER.info(" -h/--help display this help");
System.exit(0);
}
}
//! [ewol_sample_HW_main_parse_arguments]
//! [ewol_sample_HW_main_set_windows_size]
// TODO : Remove this: Move if in the windows properties
context.setSize(new Vector2f(800, 600));
//! [ewol_sample_HW_main_set_windows_size]
//! [ewol_sample_HW_main_set_font_property]
// select font preference of der with a basic application size
Configs.getConfigFonts().set("FreeSherif", 12);
//! [ewol_sample_HW_main_set_font_property]
//! [ewol_sample_HW_main_set_windows]
// Create the windows
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

@ -0,0 +1,57 @@
package sample.atriasoft.ewol.simpleWindowsWithImage;
import org.atriasoft.etk.Dimension3f;
import org.atriasoft.etk.Distance;
import org.atriasoft.etk.Uri;
import org.atriasoft.etk.math.Vector3b;
import org.atriasoft.etk.math.Vector3f;
import org.atriasoft.ewol.widget.Button;
import org.atriasoft.ewol.widget.ImageDisplay;
import sample.atriasoft.ewol.BasicWindows;
public class MainWindows extends BasicWindows {
public static void eventButtonChangeImage(final MainWindows self, final Boolean value) {
if (value) {
self.testWidget.setPropertySource(new Uri("DATA", "mireC.png"));
} else {
self.testWidget.setPropertySource(new Uri("DATA", "mireA.png"));
}
}
public static void eventButtonChangeKeepRatio(final MainWindows self) {
final boolean state = self.testWidget.isPropertyKeepRatio();
self.testWidget.setPropertyKeepRatio(!state);
//self.buttonAspectRatio.setPropertyValue(state ? "fkeep aspect ratio" : "un-keep aspect ratio");
}
ImageDisplay testWidget;
Button buttonAspectRatio;
public MainWindows() {
//! [ewol_sample_HW_windows_title]
setPropertyTitle("Simple Image");
this.testWidget = new ImageDisplay();
this.testWidget.setPropertySource(new Uri("DATA", "mireA.png"));
this.testWidget.setPropertyExpand(Vector3b.TRUE);
this.testWidget.setPropertyFill(Vector3b.TRUE);
this.testWidget.setPropertyMinSize(new Dimension3f(Vector3f.VALUE_16, Distance.PIXEL));
this.setTestWidget(this.testWidget);
{
final Button button = Button.createToggleLabelButton("mireA.png", "mireC.png");
button.setPropertyExpand(Vector3b.FALSE);
button.setPropertyFill(Vector3b.FALSE);
button.setPropertyMinSize(new Dimension3f(Vector3f.VALUE_16, Distance.PIXEL));
this.addButton(button);
button.signalValue.connectAuto(this, MainWindows::eventButtonChangeImage);
}
this.buttonAspectRatio = Button.createLabelButton("keep aspect ratio");
this.buttonAspectRatio.setPropertyExpand(Vector3b.FALSE);
this.buttonAspectRatio.setPropertyFill(Vector3b.FALSE);
this.buttonAspectRatio.setPropertyMinSize(new Dimension3f(Vector3f.VALUE_16, Distance.PIXEL));
this.addButton(this.buttonAspectRatio);
this.buttonAspectRatio.signalClick.connectAuto(this, MainWindows::eventButtonChangeKeepRatio);
}
}

View File

@ -0,0 +1,15 @@
package sample.atriasoft.ewol.simpleWindowsWithImage;
import org.atriasoft.etk.Uri;
import org.atriasoft.ewol.Ewol;
public class SimpleWindowsWithImageMain {
public static void main(final String[] args) {
Ewol.init();
//Uri.addLibrary("test-data", SimpleWindowsWithImageMain.class, "test-ewol/");
Uri.setApplication(SimpleWindowsWithImageMain.class, "test-ewol/");
Ewol.run(new Appl(), args);
}
private SimpleWindowsWithImageMain() {}
}

View File

@ -0,0 +1,83 @@
package sample.atriasoft.ewol.validationWidget;
import org.atriasoft.etk.Configs;
import org.atriasoft.etk.math.Vector2f;
import org.atriasoft.ewol.context.EwolApplication;
import org.atriasoft.ewol.context.EwolContext;
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++) {
final String tmpppp = context.getCmd().get(iii);
if (tmpppp == "-h" || tmpppp == "--help") {
LOGGER.info(" -h/--help display this help");
System.exit(0);
}
}
//! [ewol_sample_HW_main_parse_arguments]
//! [ewol_sample_HW_main_set_windows_size]
// TODO : Remove this: Move if in the windows properties
context.setSize(new Vector2f(800, 600));
//! [ewol_sample_HW_main_set_windows_size]
//! [ewol_sample_HW_main_set_font_property]
// select font preference of der with a basic application size
Configs.getConfigFonts().set("FreeSherif", 12);
//! [ewol_sample_HW_main_set_font_property]
//! [ewol_sample_HW_main_set_windows]
// Create the windows
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

@ -0,0 +1,69 @@
package sample.atriasoft.ewol.validationWidget;
import java.util.ArrayList;
import java.util.List;
import org.atriasoft.ewol.widget.Composer;
import org.atriasoft.ewol.widget.Widget;
import sample.atriasoft.ewol.BasicWindows;
public class MainWindows extends BasicWindows {
private int index = -1;
private final List<String> values = new ArrayList<>();
private final List<String> titles = new ArrayList<>();
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'/>
""");
this.titles.add("test Entry");
this.values.add("""
<Entry name='My name is Bob' fill='true,false,false' expand='true'/>
""");
this.titles.add("test button");
this.values.add("""
<Button name='My name button' fill='true,false,false' expand='true'>
<Label>hello, how are you</Label>
</Button>
""");
this.titles.add("test checkBox");
this.values.add("""
<CheckBox
name='My name button'
fill='true,false,false'
expand='true'
label='<b>Hello, how Are</b> You?<br/>second-life?'>
</CheckBox>
""");
// set first item
requestNext();
}
@Override
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);
setTestWidget(data);
}
}

View File

@ -0,0 +1,15 @@
package sample.atriasoft.ewol.validationWidget;
import org.atriasoft.etk.Uri;
import org.atriasoft.ewol.Ewol;
public class ValidatorMain {
public static void main(final String[] args) {
Ewol.init();
//Uri.addLibrary("ne", MainCollisionTest.class, "testDataLoxelEngine/");
Uri.setApplication(MainWindows.class);
Ewol.run(new Appl(), args);
}
private ValidatorMain() {}
}

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,28 @@
/** Basic module interface.
*
* @author Edouard DUPIN */
open module org.atriasoft.ewol {
exports org.atriasoft.ewol;
exports org.atriasoft.ewol.compositing;
exports org.atriasoft.ewol.compositing.tools;
exports org.atriasoft.ewol.context;
exports org.atriasoft.ewol.event;
exports org.atriasoft.ewol.object;
exports org.atriasoft.ewol.resource;
exports org.atriasoft.ewol.resource.font;
//exports org.atriasoft.ewol.tools;
exports org.atriasoft.ewol.widget;
exports org.atriasoft.ewol.widget.meta;
requires transitive org.atriasoft.esignal;
requires transitive org.atriasoft.iogami;
requires transitive org.atriasoft.gale;
requires transitive org.atriasoft.etk;
requires transitive org.atriasoft.esvg;
requires transitive org.atriasoft.exml;
requires transitive org.atriasoft.ejson;
requires org.atriasoft.loader3d;
requires org.atriasoft.egami;
requires java.base;
}

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

@ -0,0 +1,55 @@
EMF(STRING)
# Blender v3.2.2 EMF File: 'Slider.blend'
Mesh:Background_Cube
Vertex:8
-19.899271 0.013653 -7.090058|20.135780 -0.013816 -7.091342|-11.978650 7.060808 -0.005660|12.109317 7.009231 -0.006946|-11.988304 -7.009315 -0.006822|12.099687 -7.025841 -0.006946|-19.970213 0.015238 7.080030|20.212339 -0.013868 7.078948|
UV-mapping:
0.074219 0.995849|0.120606 0.943115|0.121582 0.993408|0.073324 0.991157|0.112927 0.992387|0.078245 0.948093|0.102023 0.957458|0.101769 0.970961|0.080974 0.959440|0.082167 0.983774|0.113157 0.949323|0.078476 0.953015|0.074219 0.944092|0.111927 0.985005|0.174907 0.947863|0.178598 0.993618|0.131613 0.991157|0.142456 0.948632|0.178368 0.988235|0.137534 0.984544|0.171985 0.949093|0.173216 0.991157|0.136074 0.991157|0.174677 0.949093|0.135074 0.992387|0.136304 0.949093|0.178368 0.944941|0.175907 0.989926|
Normal(face):12
-0.000484 -0.710494 0.703703|0.658059 -0.000452 -0.752966|-0.663681 0.000517 -0.748015|0.000534 0.710552 0.703645|-0.000496 -0.710521 0.703676|0.001554 0.708234 0.705976|-0.666861 0.000396 0.745182|-0.000510 -0.710438 -0.703759|0.661515 -0.000454 0.749932|0.000465 0.710438 -0.703759|-0.000491 -0.710395 -0.703803|0.001479 0.708140 -0.706070|
Face:12
palette:gui_border_1
5/0/0 6/1/0 4/2/0| 5/3/1 3/4/1 7/5/1| 2/6/2 4/7/2 6/8/2| 3/9/3 6/10/3 7/11/3| 5/0/4 7/12/4 6/1/4| 3/9/5 2/13/5 6/10/5|
palette:gui_border_2
0/14/6 4/15/6 2/16/6| 5/17/7 0/18/7 1/19/7| 1/20/8 3/21/8 5/22/8| 0/23/9 3/24/9 1/25/9| 5/17/10 4/26/10 0/18/10| 0/23/11 2/27/11 3/24/11|
Mesh:Slider_Cube.001
Vertex:12
-1.392792 10.016173 4.974034|1.417824 10.013016 4.974034|-0.007534 11.437571 4.974034|1.384170 -10.026020 4.974034|0.002411 -11.410795 4.974034|-1.396495 -10.011983 4.974034|-1.392791 10.016173 -5.048842|1.417825 10.013015 -5.048842|-0.007534 11.437570 -5.048842|1.384170 -10.026021 -5.048842|0.002412 -11.410795 -5.048842|-1.396495 -10.011985 -5.048842|
UV-mapping:
0.000000 0.000000|
Normal(face):20
0.707877 -0.706335 0.000000|0.706907 0.707306 -0.000000|0.000000 0.000000 -1.000000|-1.000000 0.000185 -0.000000|-0.707083 -0.707130 -0.000000|-0.716152 0.697944 -0.000000|0.999999 -0.001679 0.000000|0.000000 0.000000 1.000000|-0.707082 -0.707131 0.000000|
Face:20
palette:gui_slider
4/0/0 9/0/0 3/0/0| 1/0/1 8/0/1 2/0/1| 7/0/2 9/0/2 11/0/2| 6/0/3 5/0/3 0/0/3| 5/0/4 10/0/4 4/0/4| 2/0/5 6/0/5 0/0/5| 3/0/6 7/0/6 1/0/6| 5/0/7 1/0/7 0/0/7| 4/0/7 3/0/7 5/0/7| 2/0/7 0/0/7 1/0/7| 4/0/0 10/0/0 9/0/0| 1/0/1 7/0/1 8/0/1| 9/0/2 10/0/2 11/0/2| 11/0/2 6/0/2 7/0/2| 6/0/2 8/0/2 7/0/2| 6/0/3 11/0/3 5/0/3| 5/0/8 11/0/8 10/0/8| 2/0/5 8/0/5 6/0/5| 3/0/6 9/0/6 7/0/6| 5/0/7 3/0/7 1/0/7|
# Just for information:
Palettes:gui_border_1
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.000000 0.002615 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
vNi 1.450000
d 1.000000
illum 2
# Just for information:
Palettes:gui_border_2
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.000000 0.800000 0.170495
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
vNi 1.450000
d 1.000000
illum 2
# Just for information:
Palettes:gui_slider
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.638272 0.000000 0.447210
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
vNi 1.450000
d 1.000000
illum 2

View File

@ -0,0 +1,25 @@
{
# padding "outside" the object in pixel ==> prevent bad display
"padding-out-left":2,
"padding-out-right":2,
"padding-out-top":2,
"padding-out-buttom":2,
# padding "inside" the object in pixel ==> prevent bad display
"padding-in-left":0,
"padding-in-right":0,
"padding-in-top":0,
"padding-in-buttom":0,
# render program:
"program-vert":"THEME:shape/aaRenderShapeScale.vert?lib=ewol",
"program-frag":"THEME:shape/aaRenderShape.frag?lib=ewol",
# Object to render (with modification)
"object-file":"THEME:shape/Slider.emf?lib=ewol&filter=^Background.*$",
"object-file-2":"THEME:shape/Slider.emf?lib=ewol&filter=^Slider.*$",
"palette":"THEME:shape/palette_gui.json?lib=ewol",
"change-time":100
}