sdcsdc
This commit is contained in:
parent
3e233e5bdf
commit
f29254547d
121
resources/resources/ewol/data/ewol-gui-file-chooser.json
Normal file
121
resources/resources/ewol/data/ewol-gui-file-chooser.json
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
{
|
||||||
|
"type":"popup",
|
||||||
|
"child": [
|
||||||
|
{
|
||||||
|
"type":"sizer",
|
||||||
|
"property": {
|
||||||
|
"mode": "vert",
|
||||||
|
"lock": true,
|
||||||
|
"fill": true,
|
||||||
|
"expand": true
|
||||||
|
},
|
||||||
|
"child": [
|
||||||
|
{
|
||||||
|
"type":"sizer",
|
||||||
|
"property": {
|
||||||
|
"mode": "hori"
|
||||||
|
},
|
||||||
|
"child": [
|
||||||
|
{
|
||||||
|
"type":"checkbox-text",
|
||||||
|
"property": {
|
||||||
|
"name": "[{ID}]file-shooser:show-hiden-file",
|
||||||
|
"label": "_T{ShowHiddenFiles}"
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"type":"spacer",
|
||||||
|
"property": {
|
||||||
|
"expand": "true,false"
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"type":"button-icon-text",
|
||||||
|
"property": {
|
||||||
|
"name": "[{ID}]file-shooser:button-validate",
|
||||||
|
"icon": "THEME_GUI:///Load.svg?lib:ewol",
|
||||||
|
"label": "_T{Validate}"
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"type":"button-icon-text",
|
||||||
|
"property": {
|
||||||
|
"name": "[{ID}]file-shooser:button-cancel",
|
||||||
|
"icon": "THEME_GUI:///Remove.svg?lib:ewol",
|
||||||
|
"label": "_T{Cancel}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}, {
|
||||||
|
"type":"sizer",
|
||||||
|
"property": {
|
||||||
|
"mode": "hori"
|
||||||
|
},
|
||||||
|
"child": [
|
||||||
|
{
|
||||||
|
"type":"spacer",
|
||||||
|
"property": {
|
||||||
|
"expand": "true,false"
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"type":"ListFileSystem",
|
||||||
|
"property": {
|
||||||
|
"name":"[{ID}]file-shooser:list-folder",
|
||||||
|
"min-size":"20,0%",
|
||||||
|
"expand":"false,true",
|
||||||
|
"show-hidden":false,
|
||||||
|
"show-file":false,
|
||||||
|
"show-folder":true,
|
||||||
|
"show-temporary":false
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"type":"spacer",
|
||||||
|
"property": {
|
||||||
|
"expand": "true,false"
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"type":"ListFileSystem",
|
||||||
|
"property": {
|
||||||
|
"name":"[{ID}]file-shooser:list-files",
|
||||||
|
"min-size":"20,0%",
|
||||||
|
"expand":"true,true",
|
||||||
|
"show-hidden":false,
|
||||||
|
"show-file":true,
|
||||||
|
"show-folder":false,
|
||||||
|
"show-temporary":false
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"type":"spacer",
|
||||||
|
"property": {
|
||||||
|
"expand": "true,false"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}, {
|
||||||
|
"type":"sizer",
|
||||||
|
"property": {
|
||||||
|
"mode": "hori"
|
||||||
|
},
|
||||||
|
"child": [
|
||||||
|
<image name:"[{ID}]file-shooser:img-file" src:"THEME_GUI:///File.svg?lib:ewol" expand:false, size:"8,8mm"]}
|
||||||
|
<entry name:"[{ID}]file-shooser:entry-file" expand:"true,false" fill:"true,false"]}
|
||||||
|
]
|
||||||
|
}, {
|
||||||
|
"type":"sizer",
|
||||||
|
"property": {
|
||||||
|
"mode": "hori"
|
||||||
|
},
|
||||||
|
"child": [
|
||||||
|
<image name:"[{ID}]file-shooser:img-folder" src:"THEME_GUI:///Folder.svg?lib:ewol" expand:false, size:"8,8mm"]}
|
||||||
|
<entry name:"[{ID}]file-shooser:entry-folder" expand:"true,false" fill:"true,false"]}
|
||||||
|
<image name:"[{ID}]file-shooser:img-home" src:"THEME_GUI:///Home.svg?lib:ewol" expand:false, size:"8,8mm"]}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type":"label",
|
||||||
|
"property": {
|
||||||
|
"name":"[{ID}]file-shooser:title-label"
|
||||||
|
},
|
||||||
|
"data": "_T{Title}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
119
resources/resources/ewol/data/ewol-gui-file-chooser2.json
Normal file
119
resources/resources/ewol/data/ewol-gui-file-chooser2.json
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
{
|
||||||
|
"widget-type": "popup",
|
||||||
|
"child": [
|
||||||
|
{
|
||||||
|
"widget-type":"sizer",
|
||||||
|
"mode": "vert",
|
||||||
|
"lock": true,
|
||||||
|
"fill": true,
|
||||||
|
"expand": true,
|
||||||
|
"child": [
|
||||||
|
{
|
||||||
|
"widget-type":"sizer",
|
||||||
|
"mode": "hori",
|
||||||
|
"child": [
|
||||||
|
{
|
||||||
|
"widget-type":"checkbox-text",
|
||||||
|
"name": "[{ID}]file-shooser:show-hiden-file",
|
||||||
|
"label": "_T{ShowHiddenFiles}"
|
||||||
|
}, {
|
||||||
|
"widget-type":"spacer",
|
||||||
|
"expand": "true,false"
|
||||||
|
}, {
|
||||||
|
"widget-type":"button-icon-text",
|
||||||
|
"name": "[{ID}]file-shooser:button-validate",
|
||||||
|
"icon": "THEME_GUI:///Load.svg?lib:ewol",
|
||||||
|
"label": "_T{Validate}"
|
||||||
|
}, {
|
||||||
|
"widget-type":"button-icon-text",
|
||||||
|
"name": "[{ID}]file-shooser:button-cancel",
|
||||||
|
"icon": "THEME_GUI:///Remove.svg?lib:ewol",
|
||||||
|
"label": "_T{Cancel}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}, {
|
||||||
|
"widget-type":"sizer",
|
||||||
|
"mode": "hori",
|
||||||
|
"child": [
|
||||||
|
{
|
||||||
|
"widget-type":"spacer",
|
||||||
|
"expand": "true,false"
|
||||||
|
}, {
|
||||||
|
"widget-type":"ListFileSystem",
|
||||||
|
"name":"[{ID}]file-shooser:list-folder",
|
||||||
|
"min-size":"20,0%",
|
||||||
|
"expand":"false,true",
|
||||||
|
"show-hidden":false,
|
||||||
|
"show-file":false,
|
||||||
|
"show-folder":true,
|
||||||
|
"show-temporary":false
|
||||||
|
}, {
|
||||||
|
"widget-type":"spacer",
|
||||||
|
"expand": "true,false"
|
||||||
|
}, {
|
||||||
|
"widget-type":"ListFileSystem",
|
||||||
|
"name":"[{ID}]file-shooser:list-files",
|
||||||
|
"min-size":"20,0%",
|
||||||
|
"expand":"true,true",
|
||||||
|
"show-hidden":false,
|
||||||
|
"show-file":true,
|
||||||
|
"show-folder":false,
|
||||||
|
"show-temporary":false
|
||||||
|
}, {
|
||||||
|
"widget-type":"spacer",
|
||||||
|
"expand": "true,false"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}, {
|
||||||
|
"widget-type":"sizer",
|
||||||
|
"mode": "hori",
|
||||||
|
"child": [
|
||||||
|
{
|
||||||
|
"widget-type":"image",
|
||||||
|
"name": "[{ID}]file-shooser:img-file",
|
||||||
|
"expand": false,
|
||||||
|
"size": "8,8mm",
|
||||||
|
"src": "THEME_GUI:///File.svg?lib:ewol"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"widget-type":"entry",
|
||||||
|
"name": "[{ID}]file-shooser:entry-file",
|
||||||
|
"expand": "true,false",
|
||||||
|
"fill": "true,false"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}, {
|
||||||
|
"widget-type":"sizer",
|
||||||
|
"mode": "hori",
|
||||||
|
"child": [
|
||||||
|
{
|
||||||
|
"widget-type":"image",
|
||||||
|
"name": "[{ID}]file-shooser:img-folder",
|
||||||
|
"expand": false,
|
||||||
|
"size": "8,8mm",
|
||||||
|
"src": "THEME_GUI:///Folder.svg?lib:ewol"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"widget-type":"entry",
|
||||||
|
"name": "[{ID}]file-shooser:entry-folder",
|
||||||
|
"expand": "true,false",
|
||||||
|
"fill": "true,false"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"widget-type":"image",
|
||||||
|
"name": "[{ID}]file-shooser:img-home",
|
||||||
|
"expand": false,
|
||||||
|
"size": "8,8mm",
|
||||||
|
"src": "THEME_GUI:///Home.svg?lib:ewol"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"widget-type":"label",
|
||||||
|
"name":"[{ID}]file-shooser:title-label",
|
||||||
|
"data": "_T{Title}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -12,7 +12,7 @@ Mesh:CheckBox_Cube
|
|||||||
7/0/0 10/1/0 6/2/0| 3/3/1 11/4/1 7/5/1| 6/6/2 8/7/2 2/8/2| 2/9/3 9/10/3 3/11/3| 7/0/0 11/12/0 10/1/0| 3/3/1 9/13/1 11/4/1| 6/6/2 10/14/2 8/7/2| 2/9/3 8/15/3 9/10/3|
|
7/0/0 10/1/0 6/2/0| 3/3/1 11/4/1 7/5/1| 6/6/2 8/7/2 2/8/2| 2/9/3 9/10/3 3/11/3| 7/0/0 11/12/0 10/1/0| 3/3/1 9/13/1 11/4/1| 6/6/2 10/14/2 8/7/2| 2/9/3 8/15/3 9/10/3|
|
||||||
palette:gui_border_2
|
palette:gui_border_2
|
||||||
4/16/4 2/17/4 0/18/4| 6/19/5 5/20/5 7/21/5| 1/22/6 7/23/6 5/24/6| 0/25/7 3/26/7 1/27/7| 4/16/4 6/28/4 2/17/4| 6/19/5 4/29/5 5/20/5| 1/22/6 3/30/6 7/23/6| 0/25/7 2/31/7 3/26/7|
|
4/16/4 2/17/4 0/18/4| 6/19/5 5/20/5 7/21/5| 1/22/6 7/23/6 5/24/6| 0/25/7 3/26/7 1/27/7| 4/16/4 6/28/4 2/17/4| 6/19/5 4/29/5 5/20/5| 1/22/6 3/30/6 7/23/6| 0/25/7 2/31/7 3/26/7|
|
||||||
pallette_gui_border_inside
|
palette:gui_border_inside
|
||||||
8/7/8 15/32/8 9/10/8| 13/33/9 8/7/9 10/14/9| 10/14/10 12/34/10 13/33/10| 15/32/11 11/4/11 9/10/11| 8/7/8 14/35/8 15/32/8| 13/33/9 14/35/9 8/7/9| 10/14/10 11/4/10 12/34/10| 15/32/11 12/34/11 11/4/11|
|
8/7/8 15/32/8 9/10/8| 13/33/9 8/7/9 10/14/9| 10/14/10 12/34/10 13/33/10| 15/32/11 11/4/11 9/10/11| 8/7/8 14/35/8 15/32/8| 13/33/9 14/35/9 8/7/9| 10/14/10 11/4/10 12/34/10| 15/32/11 12/34/11 11/4/11|
|
||||||
palette:gui_center
|
palette:gui_center
|
||||||
15/32/12 13/33/12 12/34/12| 15/32/12 14/35/12 13/33/12|
|
15/32/12 13/33/12 12/34/12| 15/32/12 14/35/12 13/33/12|
|
||||||
@ -79,7 +79,7 @@ Palettes:gui_checked
|
|||||||
vNi 1.450000
|
vNi 1.450000
|
||||||
d 1.000000
|
d 1.000000
|
||||||
illum 2
|
illum 2
|
||||||
Materials:pallette_gui_border_inside
|
Palettes:gui_border_inside
|
||||||
Ns 225.000000
|
Ns 225.000000
|
||||||
Ka 1.000000 1.000000 1.000000
|
Ka 1.000000 1.000000 1.000000
|
||||||
Kd 0.003877 0.001682 0.147314
|
Kd 0.003877 0.001682 0.147314
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
# Object to render (with modification)
|
# Object to render (with modification)
|
||||||
"object-file":"THEME:shape/CheckBox.emf?lib=ewol",
|
"object-file":"THEME:shape/CheckBox.emf?lib=ewol",
|
||||||
|
"object-file-2":"THEME:shape/CheckBox.emf?lib=ewol&filter=^CheckBox.*$",
|
||||||
|
|
||||||
"palette":"THEME:shape/palette_gui.json?lib=ewol",
|
"palette":"THEME:shape/palette_gui.json?lib=ewol",
|
||||||
|
|
||||||
|
@ -5,6 +5,8 @@ import org.atriasoft.etk.math.Vector2f;
|
|||||||
import org.atriasoft.ewol.context.EwolApplication;
|
import org.atriasoft.ewol.context.EwolApplication;
|
||||||
import org.atriasoft.ewol.context.EwolContext;
|
import org.atriasoft.ewol.context.EwolContext;
|
||||||
|
|
||||||
|
import sample.atriasoft.ewol.Log;
|
||||||
|
|
||||||
public class Appl implements EwolApplication {
|
public class Appl implements EwolApplication {
|
||||||
|
|
||||||
//! [ewol_sample_HW_main_application]
|
//! [ewol_sample_HW_main_application]
|
||||||
|
@ -17,54 +17,54 @@ public class MainWindows extends Windows {
|
|||||||
setPropertyTitle("Simple sample test");
|
setPropertyTitle("Simple sample test");
|
||||||
//EwolObject.getContext().getFontDefault().setName("FreeSans");
|
//EwolObject.getContext().getFontDefault().setName("FreeSans");
|
||||||
Sizer sizerMain = new Sizer(DisplayMode.modeVert);
|
Sizer sizerMain = new Sizer(DisplayMode.modeVert);
|
||||||
sizerMain.setPropertyExpand(new Vector2b(true, true));
|
sizerMain.setPropertyExpand(Vector2b.TRUE_TRUE);
|
||||||
sizerMain.setPropertyFill(new Vector2b(true, true));
|
sizerMain.setPropertyFill(Vector2b.TRUE_TRUE);
|
||||||
setSubWidget(sizerMain);
|
setSubWidget(sizerMain);
|
||||||
|
|
||||||
Sizer sizerHori1 = new Sizer(DisplayMode.modeHori);
|
Sizer sizerHori1 = new Sizer(DisplayMode.modeHori);
|
||||||
sizerHori1.setPropertyExpand(new Vector2b(true, true));
|
sizerHori1.setPropertyExpand(Vector2b.TRUE_TRUE);
|
||||||
sizerHori1.setPropertyFill(new Vector2b(true, true));
|
sizerHori1.setPropertyFill(Vector2b.TRUE_TRUE);
|
||||||
sizerMain.subWidgetAdd(sizerHori1);
|
sizerMain.subWidgetAdd(sizerHori1);
|
||||||
|
|
||||||
Sizer sizerHori2 = new Sizer(DisplayMode.modeHori);
|
Sizer sizerHori2 = new Sizer(DisplayMode.modeHori);
|
||||||
sizerHori2.setPropertyExpand(new Vector2b(true, true));
|
sizerHori2.setPropertyExpand(Vector2b.TRUE_TRUE);
|
||||||
sizerHori2.setPropertyFill(new Vector2b(true, true));
|
sizerHori2.setPropertyFill(Vector2b.TRUE_TRUE);
|
||||||
sizerMain.subWidgetAdd(sizerHori2);
|
sizerMain.subWidgetAdd(sizerHori2);
|
||||||
|
|
||||||
{
|
{
|
||||||
Spacer simpleSpacer = new Spacer();
|
Spacer simpleSpacer = new Spacer();
|
||||||
simpleSpacer.setPropertyMinSize(new Dimension(new Vector2f(100, 100), Distance.PIXEL));
|
simpleSpacer.setPropertyMinSize(new Dimension(new Vector2f(100, 100), Distance.PIXEL));
|
||||||
simpleSpacer.setPropertyColor(Color.ALICE_BLUE);
|
simpleSpacer.setPropertyColor(Color.ALICE_BLUE);
|
||||||
simpleSpacer.setPropertyExpand(new Vector2b(true, true));
|
simpleSpacer.setPropertyExpand(Vector2b.TRUE_TRUE);
|
||||||
simpleSpacer.setPropertyFill(new Vector2b(true, true));
|
simpleSpacer.setPropertyFill(Vector2b.TRUE_TRUE);
|
||||||
sizerHori1.subWidgetAdd(simpleSpacer);
|
sizerHori1.subWidgetAdd(simpleSpacer);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
Spacer simpleSpacer = new Spacer();
|
Spacer simpleSpacer = new Spacer();
|
||||||
simpleSpacer.setPropertyColor(Color.DARK_GREEN);
|
simpleSpacer.setPropertyColor(Color.DARK_GREEN);
|
||||||
simpleSpacer.setPropertyExpand(new Vector2b(true, true));
|
simpleSpacer.setPropertyExpand(Vector2b.TRUE_TRUE);
|
||||||
simpleSpacer.setPropertyFill(new Vector2b(true, true));
|
simpleSpacer.setPropertyFill(Vector2b.TRUE_TRUE);
|
||||||
sizerHori1.subWidgetAdd(simpleSpacer);
|
sizerHori1.subWidgetAdd(simpleSpacer);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
Spacer simpleSpacer = new Spacer();
|
Spacer simpleSpacer = new Spacer();
|
||||||
simpleSpacer.setPropertyColor(Color.CHOCOLATE);
|
simpleSpacer.setPropertyColor(Color.CHOCOLATE);
|
||||||
simpleSpacer.setPropertyExpand(new Vector2b(true, true));
|
simpleSpacer.setPropertyExpand(Vector2b.TRUE_TRUE);
|
||||||
simpleSpacer.setPropertyFill(new Vector2b(true, true));
|
simpleSpacer.setPropertyFill(Vector2b.TRUE_TRUE);
|
||||||
sizerHori1.subWidgetAdd(simpleSpacer);
|
sizerHori1.subWidgetAdd(simpleSpacer);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
Spacer simpleSpacer = new Spacer();
|
Spacer simpleSpacer = new Spacer();
|
||||||
simpleSpacer.setPropertyColor(Color.GREEN_YELLOW);
|
simpleSpacer.setPropertyColor(Color.GREEN_YELLOW);
|
||||||
simpleSpacer.setPropertyExpand(new Vector2b(true, true));
|
simpleSpacer.setPropertyExpand(Vector2b.TRUE_TRUE);
|
||||||
simpleSpacer.setPropertyFill(new Vector2b(true, true));
|
simpleSpacer.setPropertyFill(Vector2b.TRUE_TRUE);
|
||||||
sizerHori2.subWidgetAdd(simpleSpacer);
|
sizerHori2.subWidgetAdd(simpleSpacer);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
Spacer simpleSpacer = new Spacer();
|
Spacer simpleSpacer = new Spacer();
|
||||||
simpleSpacer.setPropertyColor(Color.PINK);
|
simpleSpacer.setPropertyColor(Color.PINK);
|
||||||
simpleSpacer.setPropertyExpand(new Vector2b(true, true));
|
simpleSpacer.setPropertyExpand(Vector2b.TRUE_TRUE);
|
||||||
simpleSpacer.setPropertyFill(new Vector2b(true, true));
|
simpleSpacer.setPropertyFill(Vector2b.TRUE_TRUE);
|
||||||
sizerHori2.subWidgetAdd(simpleSpacer);
|
sizerHori2.subWidgetAdd(simpleSpacer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package sample.atriasoft.ewol.ComplexWindiows1;
|
package sample.atriasoft.ewol;
|
||||||
|
|
||||||
public class Log {
|
public class Log {
|
||||||
private static final String LIBNAME = "LoxelEngine";
|
private static final String LIBNAME = "LoxelEngine";
|
@ -5,6 +5,8 @@ import org.atriasoft.etk.math.Vector2f;
|
|||||||
import org.atriasoft.ewol.context.EwolApplication;
|
import org.atriasoft.ewol.context.EwolApplication;
|
||||||
import org.atriasoft.ewol.context.EwolContext;
|
import org.atriasoft.ewol.context.EwolContext;
|
||||||
|
|
||||||
|
import sample.atriasoft.ewol.Log;
|
||||||
|
|
||||||
public class Appl implements EwolApplication {
|
public class Appl implements EwolApplication {
|
||||||
|
|
||||||
//! [ewol_sample_HW_main_application]
|
//! [ewol_sample_HW_main_application]
|
||||||
@ -25,7 +27,7 @@ public class Appl implements EwolApplication {
|
|||||||
//! [ewol_sample_HW_main_set_windows_size]
|
//! [ewol_sample_HW_main_set_windows_size]
|
||||||
//! [ewol_sample_HW_main_set_font_property]
|
//! [ewol_sample_HW_main_set_font_property]
|
||||||
// select font preference of der with a basic application size
|
// select font preference of der with a basic application size
|
||||||
Configs.getConfigFonts().set("FreeSherif", 48);
|
Configs.getConfigFonts().set("FreeSherif", 12);
|
||||||
//! [ewol_sample_HW_main_set_font_property]
|
//! [ewol_sample_HW_main_set_font_property]
|
||||||
//! [ewol_sample_HW_main_set_windows]
|
//! [ewol_sample_HW_main_set_windows]
|
||||||
// Create the windows
|
// Create the windows
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
package sample.atriasoft.ewol.sampleButton;
|
|
||||||
|
|
||||||
public class Log {
|
|
||||||
private static final String LIBNAME = "sampleEntry";
|
|
||||||
|
|
||||||
public static void critical(final String data) {
|
|
||||||
System.out.println("[C] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void debug(final String data) {
|
|
||||||
System.out.println("[D] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void error(final String data) {
|
|
||||||
System.out.println("[E] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void info(final String data) {
|
|
||||||
System.out.println("[I] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void print(final String data) {
|
|
||||||
System.out.println(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void todo(final String data) {
|
|
||||||
System.out.println("[TODO] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void verbose(final String data) {
|
|
||||||
System.out.println("[V] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void warning(final String data) {
|
|
||||||
System.out.println("[W] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Log() {}
|
|
||||||
}
|
|
@ -12,8 +12,8 @@ public class MainWindows extends BasicWindows {
|
|||||||
|
|
||||||
Button simpleButton = new Button();
|
Button simpleButton = new Button();
|
||||||
simpleButton.setPropertyValue("Top Button");
|
simpleButton.setPropertyValue("Top Button");
|
||||||
simpleButton.setPropertyExpand(new Vector2b(true, true));
|
simpleButton.setPropertyExpand(Vector2b.TRUE_TRUE);
|
||||||
simpleButton.setPropertyFill(new Vector2b(true, false));
|
simpleButton.setPropertyFill(Vector2b.TRUE_TRUE);
|
||||||
this.setTestWidget(simpleButton);
|
this.setTestWidget(simpleButton);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,8 @@ import org.atriasoft.etk.math.Vector2f;
|
|||||||
import org.atriasoft.ewol.context.EwolApplication;
|
import org.atriasoft.ewol.context.EwolApplication;
|
||||||
import org.atriasoft.ewol.context.EwolContext;
|
import org.atriasoft.ewol.context.EwolContext;
|
||||||
|
|
||||||
|
import sample.atriasoft.ewol.Log;
|
||||||
|
|
||||||
public class Appl implements EwolApplication {
|
public class Appl implements EwolApplication {
|
||||||
|
|
||||||
//! [ewol_sample_HW_main_application]
|
//! [ewol_sample_HW_main_application]
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
package sample.atriasoft.ewol.sampleEntry;
|
|
||||||
|
|
||||||
public class Log {
|
|
||||||
private static final String LIBNAME = "sampleEntry";
|
|
||||||
|
|
||||||
public static void critical(final String data) {
|
|
||||||
System.out.println("[C] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void debug(final String data) {
|
|
||||||
System.out.println("[D] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void error(final String data) {
|
|
||||||
System.out.println("[E] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void info(final String data) {
|
|
||||||
System.out.println("[I] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void print(final String data) {
|
|
||||||
System.out.println(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void todo(final String data) {
|
|
||||||
System.out.println("[TODO] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void verbose(final String data) {
|
|
||||||
System.out.println("[V] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void warning(final String data) {
|
|
||||||
System.out.println("[W] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Log() {}
|
|
||||||
}
|
|
@ -11,8 +11,8 @@ public class MainWindows extends BasicWindows {
|
|||||||
setPropertyTitle("Simple Entry test");
|
setPropertyTitle("Simple Entry test");
|
||||||
|
|
||||||
Entry simpleEntry = new Entry();
|
Entry simpleEntry = new Entry();
|
||||||
simpleEntry.setPropertyExpand(new Vector2b(true, true));
|
simpleEntry.setPropertyExpand(Vector2b.TRUE_TRUE);
|
||||||
simpleEntry.setPropertyFill(new Vector2b(true, false));
|
simpleEntry.setPropertyFill(Vector2b.TRUE_FALSE);
|
||||||
this.setTestWidget(simpleEntry);
|
this.setTestWidget(simpleEntry);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,8 @@ import org.atriasoft.etk.math.Vector2f;
|
|||||||
import org.atriasoft.ewol.context.EwolApplication;
|
import org.atriasoft.ewol.context.EwolApplication;
|
||||||
import org.atriasoft.ewol.context.EwolContext;
|
import org.atriasoft.ewol.context.EwolContext;
|
||||||
|
|
||||||
|
import sample.atriasoft.ewol.Log;
|
||||||
|
|
||||||
public class Appl implements EwolApplication {
|
public class Appl implements EwolApplication {
|
||||||
|
|
||||||
//! [ewol_sample_HW_main_application]
|
//! [ewol_sample_HW_main_application]
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
package sample.atriasoft.ewol.simpleWindowsLabel;
|
|
||||||
|
|
||||||
public class Log {
|
|
||||||
private static final String LIBNAME = "LoxelEngine";
|
|
||||||
|
|
||||||
public static void critical(final String data) {
|
|
||||||
System.out.println("[C] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void debug(final String data) {
|
|
||||||
System.out.println("[D] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void error(final String data) {
|
|
||||||
System.out.println("[E] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void info(final String data) {
|
|
||||||
System.out.println("[I] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void print(final String data) {
|
|
||||||
System.out.println(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void todo(final String data) {
|
|
||||||
System.out.println("[TODO] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void verbose(final String data) {
|
|
||||||
System.out.println("[V] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void warning(final String data) {
|
|
||||||
System.out.println("[W] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Log() {}
|
|
||||||
}
|
|
@ -18,14 +18,14 @@ public class MainWindows extends BasicWindows {
|
|||||||
Label simpleLabel = new Label();
|
Label simpleLabel = new Label();
|
||||||
simpleLabel.setPropertyValue(
|
simpleLabel.setPropertyValue(
|
||||||
"He<b>llo.</b> <font color='blue'>World</font><br/><br/> - Coucou comment ca vas ???<br/> - Pas trop bien, je me suis cassé la jambe.<br/><br/><center>The end</center>");
|
"He<b>llo.</b> <font color='blue'>World</font><br/><br/> - Coucou comment ca vas ???<br/> - Pas trop bien, je me suis cassé la jambe.<br/><br/><center>The end</center>");
|
||||||
simpleLabel.setPropertyExpand(new Vector2b(true, true));
|
simpleLabel.setPropertyExpand(Vector2b.TRUE_TRUE);
|
||||||
simpleLabel.setPropertyFill(new Vector2b(true, true));
|
simpleLabel.setPropertyFill(Vector2b.TRUE_TRUE);
|
||||||
this.setTestWidget(simpleLabel);
|
this.setTestWidget(simpleLabel);
|
||||||
//! [ewol_sample_HW_windows_label]
|
//! [ewol_sample_HW_windows_label]
|
||||||
} else {
|
} else {
|
||||||
Spacer simpleSpacer = new Spacer();
|
Spacer simpleSpacer = new Spacer();
|
||||||
simpleSpacer.setPropertyExpand(new Vector2b(true, true));
|
simpleSpacer.setPropertyExpand(Vector2b.TRUE_TRUE);
|
||||||
simpleSpacer.setPropertyFill(new Vector2b(true, true));
|
simpleSpacer.setPropertyFill(Vector2b.TRUE_TRUE);
|
||||||
this.setTestWidget(simpleSpacer);
|
this.setTestWidget(simpleSpacer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,8 @@ import org.atriasoft.etk.math.Vector2f;
|
|||||||
import org.atriasoft.ewol.context.EwolApplication;
|
import org.atriasoft.ewol.context.EwolApplication;
|
||||||
import org.atriasoft.ewol.context.EwolContext;
|
import org.atriasoft.ewol.context.EwolContext;
|
||||||
|
|
||||||
|
import sample.atriasoft.ewol.Log;
|
||||||
|
|
||||||
public class Appl implements EwolApplication {
|
public class Appl implements EwolApplication {
|
||||||
|
|
||||||
//! [ewol_sample_HW_main_application]
|
//! [ewol_sample_HW_main_application]
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
package sample.atriasoft.ewol.simpleWindowsWithCheckBox;
|
|
||||||
|
|
||||||
public class Log {
|
|
||||||
private static final String LIBNAME = "LoxelEngine";
|
|
||||||
|
|
||||||
public static void critical(final String data) {
|
|
||||||
System.out.println("[C] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void debug(final String data) {
|
|
||||||
System.out.println("[D] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void error(final String data) {
|
|
||||||
System.out.println("[E] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void info(final String data) {
|
|
||||||
System.out.println("[I] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void print(final String data) {
|
|
||||||
System.out.println(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void todo(final String data) {
|
|
||||||
System.out.println("[TODO] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void verbose(final String data) {
|
|
||||||
System.out.println("[V] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void warning(final String data) {
|
|
||||||
System.out.println("[W] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Log() {}
|
|
||||||
}
|
|
@ -18,5 +18,12 @@ public class MainWindows extends BasicWindows {
|
|||||||
this.testWidget.setPropertyExpand(Vector2b.TRUE_TRUE);
|
this.testWidget.setPropertyExpand(Vector2b.TRUE_TRUE);
|
||||||
this.testWidget.setPropertyFill(Vector2b.TRUE_TRUE);
|
this.testWidget.setPropertyFill(Vector2b.TRUE_TRUE);
|
||||||
this.setTestWidget(this.testWidget);
|
this.setTestWidget(this.testWidget);
|
||||||
|
/*
|
||||||
|
Button simpleButton = new Button();
|
||||||
|
simpleButton.setPropertyValue("Top Button");
|
||||||
|
simpleButton.setPropertyExpand(Vector2b.TRUE_TRUE);
|
||||||
|
simpleButton.setPropertyFill(Vector2b.TRUE_TRUE);
|
||||||
|
this.setTestWidget(simpleButton);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,8 @@ import org.atriasoft.etk.math.Vector2f;
|
|||||||
import org.atriasoft.ewol.context.EwolApplication;
|
import org.atriasoft.ewol.context.EwolApplication;
|
||||||
import org.atriasoft.ewol.context.EwolContext;
|
import org.atriasoft.ewol.context.EwolContext;
|
||||||
|
|
||||||
|
import sample.atriasoft.ewol.Log;
|
||||||
|
|
||||||
public class Appl implements EwolApplication {
|
public class Appl implements EwolApplication {
|
||||||
|
|
||||||
//! [ewol_sample_HW_main_application]
|
//! [ewol_sample_HW_main_application]
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
package sample.atriasoft.ewol.simpleWindowsWithImage;
|
|
||||||
|
|
||||||
public class Log {
|
|
||||||
private static final String LIBNAME = "LoxelEngine";
|
|
||||||
|
|
||||||
public static void critical(final String data) {
|
|
||||||
System.out.println("[C] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void debug(final String data) {
|
|
||||||
System.out.println("[D] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void error(final String data) {
|
|
||||||
System.out.println("[E] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void info(final String data) {
|
|
||||||
System.out.println("[I] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void print(final String data) {
|
|
||||||
System.out.println(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void todo(final String data) {
|
|
||||||
System.out.println("[TODO] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void verbose(final String data) {
|
|
||||||
System.out.println("[V] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void warning(final String data) {
|
|
||||||
System.out.println("[W] " + Log.LIBNAME + " | " + data);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Log() {}
|
|
||||||
}
|
|
@ -31,23 +31,23 @@ public class MainWindows extends BasicWindows {
|
|||||||
|
|
||||||
this.testWidget = new ImageDisplay();
|
this.testWidget = new ImageDisplay();
|
||||||
this.testWidget.setPropertySource(new Uri("DATA", "mireA.png"));
|
this.testWidget.setPropertySource(new Uri("DATA", "mireA.png"));
|
||||||
this.testWidget.setPropertyExpand(new Vector2b(true, true));
|
this.testWidget.setPropertyExpand(Vector2b.TRUE_TRUE);
|
||||||
this.testWidget.setPropertyFill(new Vector2b(true, true));
|
this.testWidget.setPropertyFill(Vector2b.TRUE_TRUE);
|
||||||
this.testWidget.setPropertyMinSize(new Dimension(Vector2f.VALUE_16, Distance.PIXEL));
|
this.testWidget.setPropertyMinSize(new Dimension(Vector2f.VALUE_16, Distance.PIXEL));
|
||||||
this.setTestWidget(this.testWidget);
|
this.setTestWidget(this.testWidget);
|
||||||
{
|
{
|
||||||
Button button = new Button();
|
Button button = new Button();
|
||||||
button.setPropertyValue("Change image");
|
button.setPropertyValue("Change image");
|
||||||
button.setPropertyExpand(new Vector2b(false, false));
|
button.setPropertyExpand(Vector2b.FALSE_FALSE);
|
||||||
button.setPropertyFill(new Vector2b(false, false));
|
button.setPropertyFill(Vector2b.FALSE_FALSE);
|
||||||
button.setPropertyMinSize(new Dimension(new Vector2f(10, 10), Distance.PIXEL));
|
button.setPropertyMinSize(new Dimension(new Vector2f(10, 10), Distance.PIXEL));
|
||||||
this.addButton(button);
|
this.addButton(button);
|
||||||
button.signalClick.connectAuto(this, MainWindows::eventButtonChangeImage);
|
button.signalClick.connectAuto(this, MainWindows::eventButtonChangeImage);
|
||||||
}
|
}
|
||||||
this.buttonAspectRatio = new Button();
|
this.buttonAspectRatio = new Button();
|
||||||
this.buttonAspectRatio.setPropertyValue("keep aspect ratio");
|
this.buttonAspectRatio.setPropertyValue("keep aspect ratio");
|
||||||
this.buttonAspectRatio.setPropertyExpand(new Vector2b(false, false));
|
this.buttonAspectRatio.setPropertyExpand(Vector2b.FALSE_FALSE);
|
||||||
this.buttonAspectRatio.setPropertyFill(new Vector2b(false, false));
|
this.buttonAspectRatio.setPropertyFill(Vector2b.FALSE_FALSE);
|
||||||
this.buttonAspectRatio.setPropertyMinSize(new Dimension(new Vector2f(10, 10), Distance.PIXEL));
|
this.buttonAspectRatio.setPropertyMinSize(new Dimension(new Vector2f(10, 10), Distance.PIXEL));
|
||||||
this.addButton(this.buttonAspectRatio);
|
this.addButton(this.buttonAspectRatio);
|
||||||
this.buttonAspectRatio.signalClick.connectAuto(this, MainWindows::eventButtonChangeKeepRatio);
|
this.buttonAspectRatio.signalClick.connectAuto(this, MainWindows::eventButtonChangeKeepRatio);
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
package org.atriasoft.ewol;
|
package org.atriasoft.ewol;
|
||||||
|
|
||||||
import org.atriasoft.esvg.Esvg;
|
|
||||||
import org.atriasoft.etk.Uri;
|
|
||||||
/** @file
|
/** @file
|
||||||
* @author Edouard DUPIN
|
* @author Edouard DUPIN
|
||||||
* @copyright 2011, Edouard DUPIN, all right reserved
|
* @copyright 2011, Edouard DUPIN, all right reserved
|
||||||
* @license MPL v2.0 (see license file)
|
* @license MPL v2.0 (see license file)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import org.atriasoft.esvg.Esvg;
|
||||||
|
import org.atriasoft.etk.Uri;
|
||||||
import org.atriasoft.etranslate.ETranslate;
|
import org.atriasoft.etranslate.ETranslate;
|
||||||
import org.atriasoft.ewol.context.EwolApplication;
|
import org.atriasoft.ewol.context.EwolApplication;
|
||||||
import org.atriasoft.ewol.context.EwolContext;
|
import org.atriasoft.ewol.context.EwolContext;
|
||||||
@ -28,7 +29,7 @@ public class Ewol {
|
|||||||
* This is the only one things the User might done in his main();
|
* This is the only one things the User might done in his main();
|
||||||
* @note To answare you before you ask the question, this is really simple:
|
* @note To answare you before you ask the question, this is really simple:
|
||||||
* Due to the fect that the current system is multiple-platform, you "main"
|
* Due to the fect that the current system is multiple-platform, you "main"
|
||||||
* Does not exist in the android platform, then ewol call other start
|
* Does not exist in the android platform, then ewol call other start
|
||||||
* and stop function, to permit to have only one code
|
* and stop function, to permit to have only one code
|
||||||
* @note The main can not be in the ewol, due to the fact thet is an librairy
|
* @note The main can not be in the ewol, due to the fact thet is an librairy
|
||||||
* @param application just created instance of the applicationo
|
* @param application just created instance of the applicationo
|
||||||
|
@ -40,6 +40,7 @@ public class GuiShape extends Compositing {
|
|||||||
private ResourceConfigFile config = null; //!< pointer on the config file resources
|
private ResourceConfigFile config = null; //!< pointer on the config file resources
|
||||||
|
|
||||||
private int confObjectFile = -1; //!< Config Id of the object file to display
|
private int confObjectFile = -1; //!< Config Id of the object file to display
|
||||||
|
private int confObjectFile2 = -1; //!< Config Id of the object file to display
|
||||||
private int confProgramFileFrag = -1; //!< ConfigFile opengGl program Name
|
private int confProgramFileFrag = -1; //!< ConfigFile opengGl program Name
|
||||||
private int confProgramFileVert = -1; //!< ConfigFile opengGl program Name
|
private int confProgramFileVert = -1; //!< ConfigFile opengGl program Name
|
||||||
private final List<Vector2i> listAssiciatedId = new ArrayList<>(); //!< Correlation ID between ColorProperty (Y) and OpenGL Program (X)
|
private final List<Vector2i> listAssiciatedId = new ArrayList<>(); //!< Correlation ID between ColorProperty (Y) and OpenGL Program (X)
|
||||||
@ -57,7 +58,7 @@ public class GuiShape extends Compositing {
|
|||||||
|
|
||||||
private ResourcePaletteFile palette;
|
private ResourcePaletteFile palette;
|
||||||
private ResourceTexture2 texture;
|
private ResourceTexture2 texture;
|
||||||
private ResourceMesh mesh = null;
|
private ResourceMesh[] mesh = new ResourceMesh[2];
|
||||||
private Padding sizeObject = Padding.ZERO;
|
private Padding sizeObject = Padding.ZERO;
|
||||||
private int stateActivate = -1; //!< Activate state of the element
|
private int stateActivate = -1; //!< Activate state of the element
|
||||||
private GuiShapeMode stateNew = GuiShapeMode.NORMAL; //!< destination state
|
private GuiShapeMode stateNew = GuiShapeMode.NORMAL; //!< destination state
|
||||||
@ -119,13 +120,32 @@ public class GuiShape extends Compositing {
|
|||||||
draw(null, disableDepthTest);
|
draw(null, disableDepthTest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void draw(final boolean disableDepthTest, int idMesh) {
|
||||||
|
draw(null, disableDepthTest, idMesh);
|
||||||
|
}
|
||||||
|
|
||||||
public void draw(final ResourceTexture2 secondaryTexture, final boolean disableDepthTest) {
|
public void draw(final ResourceTexture2 secondaryTexture, final boolean disableDepthTest) {
|
||||||
|
this.draw(secondaryTexture, disableDepthTest, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void draw(final ResourceTexture2 secondaryTexture, final boolean disableDepthTest, int idMesh) {
|
||||||
if (this.config == null) {
|
if (this.config == null) {
|
||||||
// this is a normal case ... the user can choice to have no config basic file ...
|
// this is a normal case ... the user can choice to have no config basic file ...
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (idMesh == 0 && this.mesh[0] == null) {
|
||||||
|
Log.error("No Object (0) to display ...");
|
||||||
|
return;
|
||||||
|
} else if (idMesh == 1 && this.mesh[1] == null) {
|
||||||
|
Log.error("No Object (1) to display ...");
|
||||||
|
return;
|
||||||
|
} else if (idMesh < 0 && idMesh > 1) {
|
||||||
|
Log.critical("No Object (" + idMesh + ") to display [0..1]");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (this.oGLprogram == null) {
|
if (this.oGLprogram == null) {
|
||||||
Log.error("No shader ...");
|
Log.error("No shader ...");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
OpenGL.enable(Flag.flag_depthTest);
|
OpenGL.enable(Flag.flag_depthTest);
|
||||||
// set Matrix : translation/positionMatrix
|
// set Matrix : translation/positionMatrix
|
||||||
@ -133,12 +153,12 @@ public class GuiShape extends Compositing {
|
|||||||
Matrix4f camMatrix = OpenGL.getCameraMatrix();
|
Matrix4f camMatrix = OpenGL.getCameraMatrix();
|
||||||
Matrix4f tmpMatrix = this.matrixApply.multiply(this.transform);
|
Matrix4f tmpMatrix = this.matrixApply.multiply(this.transform);
|
||||||
this.oGLprogram.use();
|
this.oGLprogram.use();
|
||||||
this.mesh.bindForRendering();
|
this.mesh[idMesh].bindForRendering();
|
||||||
this.oGLprogram.uniformMatrix(this.oGLMatrixProjection, projMatrix);
|
this.oGLprogram.uniformMatrix(this.oGLMatrixProjection, projMatrix);
|
||||||
this.oGLprogram.uniformMatrix(this.oGLMatrixTransformation, tmpMatrix);
|
this.oGLprogram.uniformMatrix(this.oGLMatrixTransformation, tmpMatrix);
|
||||||
this.oGLprogram.uniformMatrix(this.oGLMatrixView, camMatrix);
|
this.oGLprogram.uniformMatrix(this.oGLMatrixView, camMatrix);
|
||||||
|
|
||||||
Set<String> layers = this.mesh.getLayers();
|
Set<String> layers = this.mesh[idMesh].getLayers();
|
||||||
Log.verbose("get layers:" + layers);
|
Log.verbose("get layers:" + layers);
|
||||||
// Texture:
|
// Texture:
|
||||||
float imageDelta = (float) 1 / ResourcePaletteFile.getHeight();
|
float imageDelta = (float) 1 / ResourcePaletteFile.getHeight();
|
||||||
@ -155,7 +175,6 @@ public class GuiShape extends Compositing {
|
|||||||
basicValue -= imageDelta * this.stateTransition;
|
basicValue -= imageDelta * this.stateTransition;
|
||||||
} else if (this.stateNew == GuiShapeMode.SELECT) {
|
} else if (this.stateNew == GuiShapeMode.SELECT) {
|
||||||
basicValue += imageDelta * this.stateTransition;
|
basicValue += imageDelta * this.stateTransition;
|
||||||
|
|
||||||
}
|
}
|
||||||
} else if (this.stateOld == GuiShapeMode.SELECT) {
|
} else if (this.stateOld == GuiShapeMode.SELECT) {
|
||||||
if (this.stateNew == GuiShapeMode.NORMAL) {
|
if (this.stateNew == GuiShapeMode.NORMAL) {
|
||||||
@ -169,23 +188,23 @@ public class GuiShape extends Compositing {
|
|||||||
+ ")");
|
+ ")");
|
||||||
this.oGLprogram.uniformFloat(this.oGLPaletteOffset, basicValue);
|
this.oGLprogram.uniformFloat(this.oGLPaletteOffset, basicValue);
|
||||||
|
|
||||||
Log.error("plop: " + this.offsetScaleOutside);
|
//Log.verbose("plop: " + this.offsetScaleOutside);
|
||||||
Log.error("plop: " + this.offsetScaleInside);
|
//Log.verbose("plop: " + this.offsetScaleInside);
|
||||||
this.oGLprogram.uniformVector(this.oGLOffsetScaleInside, this.offsetScaleInside);
|
this.oGLprogram.uniformVector(this.oGLOffsetScaleInside, this.offsetScaleInside);
|
||||||
this.oGLprogram.uniformVector(this.oGLOffsetScaleOutside, this.offsetScaleOutside);
|
this.oGLprogram.uniformVector(this.oGLOffsetScaleOutside, this.offsetScaleOutside);
|
||||||
|
|
||||||
this.texture.bindForRendering(0);
|
this.texture.bindForRendering(0);
|
||||||
this.mesh.render("palette");
|
this.mesh[idMesh].render("palette");
|
||||||
if (secondaryTexture != null) {
|
if (secondaryTexture != null) {
|
||||||
this.oGLprogram.uniformFloat(this.oGLPaletteOffset, 0);
|
this.oGLprogram.uniformFloat(this.oGLPaletteOffset, 0);
|
||||||
secondaryTexture.bindForRendering(0);
|
secondaryTexture.bindForRendering(0);
|
||||||
this.mesh.render("gui_dynamic_1");
|
this.mesh[idMesh].render("gui_dynamic_1");
|
||||||
|
|
||||||
}
|
}
|
||||||
// Request the draw of the elements:
|
// Request the draw of the elements:
|
||||||
this.mesh.render();
|
this.mesh[idMesh].render();
|
||||||
|
|
||||||
this.mesh.unBindForRendering();
|
this.mesh[idMesh].unBindForRendering();
|
||||||
this.oGLprogram.unUse();
|
this.oGLprogram.unUse();
|
||||||
OpenGL.disable(Flag.flag_depthTest);
|
OpenGL.disable(Flag.flag_depthTest);
|
||||||
}
|
}
|
||||||
@ -289,6 +308,7 @@ public class GuiShape extends Compositing {
|
|||||||
this.confProgramFileVert = this.config.request("program-vert");
|
this.confProgramFileVert = this.config.request("program-vert");
|
||||||
this.confProgramFileFrag = this.config.request("program-frag");
|
this.confProgramFileFrag = this.config.request("program-frag");
|
||||||
this.confObjectFile = this.config.request("object-file");
|
this.confObjectFile = this.config.request("object-file");
|
||||||
|
this.confObjectFile2 = this.config.request("object-file-2");
|
||||||
this.confIdPaletteFile = this.config.request("palette");
|
this.confIdPaletteFile = this.config.request("palette");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -349,8 +369,8 @@ public class GuiShape extends Compositing {
|
|||||||
}
|
}
|
||||||
String objectFile = this.config.getString(this.confObjectFile);
|
String objectFile = this.config.getString(this.confObjectFile);
|
||||||
if (!objectFile.isEmpty()) {
|
if (!objectFile.isEmpty()) {
|
||||||
this.mesh = ResourceMesh.create(Uri.valueOf(objectFile));
|
this.mesh[0] = ResourceMesh.create(Uri.valueOf(objectFile));
|
||||||
List<Vector3f> verticesToModify = this.mesh.getGeneratedPosition();
|
List<Vector3f> verticesToModify = this.mesh[0].getGeneratedPosition();
|
||||||
float top = 0;
|
float top = 0;
|
||||||
float bottom = 0;
|
float bottom = 0;
|
||||||
float left = 0;
|
float left = 0;
|
||||||
@ -372,6 +392,30 @@ public class GuiShape extends Compositing {
|
|||||||
}
|
}
|
||||||
this.sizeObject = new Padding(Math.abs(left), Math.abs(top), Math.abs(right), Math.abs(bottom));
|
this.sizeObject = new Padding(Math.abs(left), Math.abs(top), Math.abs(right), Math.abs(bottom));
|
||||||
}
|
}
|
||||||
|
String objectFile2 = this.config.getString(this.confObjectFile2);
|
||||||
|
if (!objectFile2.isEmpty()) {
|
||||||
|
this.mesh[1] = ResourceMesh.create(Uri.valueOf(objectFile2));
|
||||||
|
List<Vector3f> verticesToModify = this.mesh[1].getGeneratedPosition();
|
||||||
|
float top = 0;
|
||||||
|
float bottom = 0;
|
||||||
|
float left = 0;
|
||||||
|
float right = 0;
|
||||||
|
float back = 0;
|
||||||
|
float font = 0;
|
||||||
|
// estimate size of border:
|
||||||
|
if (verticesToModify == null) {
|
||||||
|
Log.critical("Element is null : verticesToModify 2");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (int iii = 0; iii < verticesToModify.size(); iii++) {
|
||||||
|
left = Math.min(left, verticesToModify.get(iii).x());
|
||||||
|
right = Math.max(right, verticesToModify.get(iii).x());
|
||||||
|
top = Math.min(top, verticesToModify.get(iii).y());
|
||||||
|
bottom = Math.max(bottom, verticesToModify.get(iii).y());
|
||||||
|
back = Math.min(back, verticesToModify.get(iii).z());
|
||||||
|
font = Math.max(font, verticesToModify.get(iii).z());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -438,7 +482,7 @@ public class GuiShape extends Compositing {
|
|||||||
* @brief set the shape property:
|
* @brief set the shape property:
|
||||||
*
|
*
|
||||||
* ********************************************************************************
|
* ********************************************************************************
|
||||||
* * _size *
|
* * size *
|
||||||
* * *
|
* * *
|
||||||
* * * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * *
|
* * * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * *
|
||||||
* * *
|
* * *
|
||||||
@ -447,7 +491,7 @@ public class GuiShape extends Compositing {
|
|||||||
* * | * * | *
|
* * | * * | *
|
||||||
* * * * *
|
* * * * *
|
||||||
* * | * * - - - - - - - - - - - - - - - - - - * * | *
|
* * | * * - - - - - - - - - - - - - - - - - - * * | *
|
||||||
* * * _insideSize * *
|
* * * insideSize * *
|
||||||
* * | * | | * | *
|
* * | * | | * | *
|
||||||
* * * * *
|
* * * * *
|
||||||
* * | * | | * | *
|
* * | * | | * | *
|
||||||
@ -459,7 +503,7 @@ public class GuiShape extends Compositing {
|
|||||||
* * | * | | * | *
|
* * | * | | * | *
|
||||||
* * * * *
|
* * * * *
|
||||||
* * | * | | * | *
|
* * | * | | * | *
|
||||||
* * * _insidePos * *
|
* * * insidePos * *
|
||||||
* * | * * - - - - - - - - - - - - - - - - - - * * | *
|
* * | * * - - - - - - - - - - - - - - - - - - * * | *
|
||||||
* * * * *
|
* * * * *
|
||||||
* * | *************************************************** | *
|
* * | *************************************************** | *
|
||||||
@ -470,7 +514,7 @@ public class GuiShape extends Compositing {
|
|||||||
* * *
|
* * *
|
||||||
* * *
|
* * *
|
||||||
* ********************************************************************************
|
* ********************************************************************************
|
||||||
* _origin
|
* origin
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param center Center of the object
|
* @param center Center of the object
|
||||||
|
@ -3,9 +3,15 @@ package org.atriasoft.ewol.object;
|
|||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
|
|
||||||
import org.atriasoft.ewol.Ewol;
|
import org.atriasoft.ewol.Ewol;
|
||||||
|
import org.atriasoft.ewol.annotation.EwolDescription;
|
||||||
import org.atriasoft.ewol.context.EwolContext;
|
import org.atriasoft.ewol.context.EwolContext;
|
||||||
import org.atriasoft.ewol.internal.Log;
|
import org.atriasoft.ewol.internal.Log;
|
||||||
import org.atriasoft.exml.model.XmlElement;
|
import org.atriasoft.exml.annotation.XmlAttribute;
|
||||||
|
import org.atriasoft.exml.annotation.XmlDefaultManaged;
|
||||||
|
import org.atriasoft.exml.annotation.XmlDefaultOptional;
|
||||||
|
import org.atriasoft.exml.annotation.XmlIgnoreUnknow;
|
||||||
|
import org.atriasoft.exml.annotation.XmlManaged;
|
||||||
|
import org.atriasoft.exml.annotation.XmlName;
|
||||||
|
|
||||||
/** @file
|
/** @file
|
||||||
* @author Edouard DUPIN
|
* @author Edouard DUPIN
|
||||||
@ -17,6 +23,9 @@ import org.atriasoft.exml.model.XmlElement;
|
|||||||
* Basic message classes for ewol system
|
* Basic message classes for ewol system
|
||||||
* this class permit at every Object to communicate between them.
|
* this class permit at every Object to communicate between them.
|
||||||
*/
|
*/
|
||||||
|
@XmlDefaultManaged(value = false)
|
||||||
|
@XmlDefaultOptional
|
||||||
|
@XmlIgnoreUnknow
|
||||||
public class EwolObject {
|
public class EwolObject {
|
||||||
private static Integer valUID = 0; //!< Static used for the unique ID definition
|
private static Integer valUID = 0; //!< Static used for the unique ID definition
|
||||||
|
|
||||||
@ -36,7 +45,7 @@ public class EwolObject {
|
|||||||
return Ewol.getContext().getEObjectManager();
|
return Ewol.getContext().getEObjectManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrive an object with his name (in the global list)
|
* Retrive an object with his name (in the global list)
|
||||||
* @param objectName Name of the object
|
* @param objectName Name of the object
|
||||||
* @return the requested object or null
|
* @return the requested object or null
|
||||||
@ -103,36 +112,14 @@ public class EwolObject {
|
|||||||
return this.uniqueId;
|
return this.uniqueId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@XmlManaged
|
||||||
|
@XmlAttribute
|
||||||
|
@XmlName(value = "name")
|
||||||
|
@EwolDescription(value = "Name of the object.")
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return this.name;
|
return this.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* load attribute properties with an XML node.
|
|
||||||
* @param node Reference on the XML node.
|
|
||||||
* @return true : All has been done corectly.
|
|
||||||
* @return false : An error occured.
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
boolean loadXMLAttributes( exml::Element node){
|
|
||||||
if (node.exist() == false) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
boolean errorOccured = false;
|
|
||||||
|
|
||||||
for( auto it : node.attributes) {
|
|
||||||
auto pair = it.getPair();
|
|
||||||
if (pair.first == "") {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (properties.set(pair.first, pair.second) == false) {
|
|
||||||
errorOccured = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return errorOccured;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the static status of the Object == > mark at true if the user set the object mark as static allocated element ==> not auto remove element
|
* get the static status of the Object == > mark at true if the user set the object mark as static allocated element ==> not auto remove element
|
||||||
* @return true if it might not be removed == > usefull for conficuration class
|
* @return true if it might not be removed == > usefull for conficuration class
|
||||||
@ -141,25 +128,6 @@ public class EwolObject {
|
|||||||
return this.staticObject;
|
return this.staticObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* store properties in this XML node.
|
|
||||||
* @param[in,out] node Reference on the XML node.
|
|
||||||
* @return true : All has been done corectly.
|
|
||||||
* @return false : An error occured.
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
boolean storeXML(exml::Element node){
|
|
||||||
if (node.exist() == false) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
boolean errorOccured = true;
|
|
||||||
for (auto it : properties.getAll(true)) {
|
|
||||||
node.attributes.set(it.first, it.second);
|
|
||||||
}
|
|
||||||
return errorOccured;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the resource status of the element.
|
* Get the resource status of the element.
|
||||||
* @return the resource status.
|
* @return the resource status.
|
||||||
@ -190,16 +158,6 @@ public class EwolObject {
|
|||||||
return this.destroy;
|
return this.destroy;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* load properties with an XML node.
|
|
||||||
* @param node Reference on the XML node.
|
|
||||||
* @return true : All has been done corectly.
|
|
||||||
* @return false : An error occured.
|
|
||||||
*/
|
|
||||||
protected boolean loadXML(final XmlElement node) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove the current parenting.
|
* Remove the current parenting.
|
||||||
*/
|
*/
|
||||||
@ -230,7 +188,7 @@ public class EwolObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Declare this element as a resource (or singleton) this mean the element will
|
* Declare this element as a resource (or singleton) this mean the element will
|
||||||
* not be auto Remove at the end of the programm. It just notify that it is not removed.
|
* not be auto Remove at the end of the programm. It just notify that it is not removed.
|
||||||
* @param val Value of the type of the element.
|
* @param val Value of the type of the element.
|
||||||
*/
|
*/
|
||||||
|
@ -87,7 +87,7 @@ public class ResourceTexturedFont extends ResourceTexture2 {
|
|||||||
this.listElement[2] = new ArrayList<>();
|
this.listElement[2] = new ArrayList<>();
|
||||||
this.listElement[3] = new ArrayList<>();
|
this.listElement[3] = new ArrayList<>();
|
||||||
|
|
||||||
String sizeString = fontBaseUri.getproperty("size");
|
String sizeString = fontBaseUri.getProperty("size");
|
||||||
if (sizeString == null) {
|
if (sizeString == null) {
|
||||||
this.size = 25;
|
this.size = 25;
|
||||||
} else {
|
} else {
|
||||||
|
@ -6,6 +6,7 @@ import org.atriasoft.etk.Color;
|
|||||||
import org.atriasoft.etk.Uri;
|
import org.atriasoft.etk.Uri;
|
||||||
import org.atriasoft.etk.math.Vector2f;
|
import org.atriasoft.etk.math.Vector2f;
|
||||||
import org.atriasoft.etk.math.Vector2i;
|
import org.atriasoft.etk.math.Vector2i;
|
||||||
|
import org.atriasoft.ewol.Gravity;
|
||||||
import org.atriasoft.ewol.Padding;
|
import org.atriasoft.ewol.Padding;
|
||||||
import org.atriasoft.ewol.annotation.EwolDescription;
|
import org.atriasoft.ewol.annotation.EwolDescription;
|
||||||
import org.atriasoft.ewol.annotation.EwolSignal;
|
import org.atriasoft.ewol.annotation.EwolSignal;
|
||||||
@ -75,6 +76,8 @@ public class Button extends Widget {
|
|||||||
this.propertyCanFocus = true;
|
this.propertyCanFocus = true;
|
||||||
onChangePropertyShaper();
|
onChangePropertyShaper();
|
||||||
markToRedraw();
|
markToRedraw();
|
||||||
|
// can not support multiple click...
|
||||||
|
setMouseLimit(1);
|
||||||
this.shape = new GuiShape(this.propertyConfig);
|
this.shape = new GuiShape(this.propertyConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,13 +104,17 @@ public class Button extends Widget {
|
|||||||
protected void changeStatusIn(final GuiShapeMode newStatusId) {
|
protected void changeStatusIn(final GuiShapeMode newStatusId) {
|
||||||
if (this.shape.changeStatusIn(newStatusId)) {
|
if (this.shape.changeStatusIn(newStatusId)) {
|
||||||
if (!this.periodicConnectionHanble.isConnected()) {
|
if (!this.periodicConnectionHanble.isConnected()) {
|
||||||
Log.error("REQUEST: connection on operiodic call");
|
//Log.error("REQUEST: connection on operiodic call");
|
||||||
this.periodicConnectionHanble = EwolObject.getObjectManager().periodicCall.connect(this, Button::periodicCall);
|
this.periodicConnectionHanble = EwolObject.getObjectManager().periodicCall.connect(this, Button::periodicCall);
|
||||||
}
|
}
|
||||||
markToRedraw();
|
markToRedraw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean checkIfOver(Vector2f relPos) {
|
||||||
|
return relPos.x() > this.overPositionStart.x() && relPos.y() > this.overPositionStart.y() && relPos.x() < this.overPositionStop.x() && relPos.y() < this.overPositionStop.y();
|
||||||
|
}
|
||||||
|
|
||||||
@XmlManaged
|
@XmlManaged
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
@XmlName(value = "config")
|
@XmlName(value = "config")
|
||||||
@ -151,44 +158,57 @@ public class Button extends Widget {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onEventInput(final EventInput event) {
|
public boolean onEventInput(final EventInput event) {
|
||||||
Vector2f relPos = relativePosition(event.pos());
|
Vector2f relPos = relativePosition(event.pos());
|
||||||
Log.verbose("Event on Input ... " + event + " relPos = " + relPos);
|
Log.warning("Event on Input ... " + event + " relPos = " + relPos);
|
||||||
|
boolean over = checkIfOver(relPos);
|
||||||
|
//filter if outside the element...
|
||||||
|
if (event.status() == KeyStatus.leave) {
|
||||||
|
changeStatusIn(GuiShapeMode.NORMAL);
|
||||||
|
this.isDown = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (event.inputId() == 0) {
|
if (event.inputId() == 0) {
|
||||||
if (!this.isDown) {
|
if (!this.isDown) {
|
||||||
if (KeyStatus.leave == event.status()) {
|
if (KeyStatus.leave == event.status()) {
|
||||||
changeStatusIn(GuiShapeMode.NORMAL);
|
changeStatusIn(GuiShapeMode.NORMAL);
|
||||||
} else {
|
} else {
|
||||||
Log.verbose("Detect Over : " + this.overPositionStart + " -> " + this.overPositionStop);
|
Log.verbose("Detect Over : " + this.overPositionStart + " -> " + this.overPositionStop);
|
||||||
if (relPos.x() > this.overPositionStart.x() && relPos.y() > this.overPositionStart.y() && relPos.x() < this.overPositionStop.x() && relPos.y() < this.overPositionStop.y()) {
|
if (over) {
|
||||||
changeStatusIn(GuiShapeMode.OVER);
|
changeStatusIn(GuiShapeMode.OVER);
|
||||||
} else {
|
} else {
|
||||||
changeStatusIn(GuiShapeMode.NORMAL);
|
changeStatusIn(GuiShapeMode.NORMAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
if (event.inputId() == 1) {
|
|
||||||
if (KeyStatus.pressSingle == event.status()) {
|
|
||||||
keepFocus();
|
|
||||||
this.signalClick.emit();
|
|
||||||
//nothing to do ...
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (KeyStatus.down == event.status()) {
|
}
|
||||||
keepFocus();
|
if (event.inputId() != 1) {
|
||||||
this.isDown = true;
|
return false;
|
||||||
changeStatusIn(GuiShapeMode.SELECT);
|
}
|
||||||
markToRedraw();
|
if (KeyStatus.pressSingle == event.status() && over) {
|
||||||
this.signalDown.emit();
|
keepFocus();
|
||||||
} else if (KeyStatus.move == event.status()) {
|
this.signalClick.emit();
|
||||||
keepFocus();
|
return true;
|
||||||
markToRedraw();
|
}
|
||||||
} else if (KeyStatus.up == event.status()) {
|
if (KeyStatus.down == event.status() && over) {
|
||||||
keepFocus();
|
keepFocus();
|
||||||
this.isDown = false;
|
this.isDown = true;
|
||||||
this.signalUp.emit();
|
changeStatusIn(GuiShapeMode.SELECT);
|
||||||
changeStatusIn(GuiShapeMode.OVER);
|
markToRedraw();
|
||||||
markToRedraw();
|
this.signalDown.emit();
|
||||||
}
|
return true;
|
||||||
|
}
|
||||||
|
if (KeyStatus.move == event.status() && over) {
|
||||||
|
keepFocus();
|
||||||
|
markToRedraw();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (KeyStatus.up == event.status() && this.isDown) {
|
||||||
|
keepFocus();
|
||||||
|
this.isDown = false;
|
||||||
|
this.signalUp.emit();
|
||||||
|
changeStatusIn(GuiShapeMode.OVER);
|
||||||
|
markToRedraw();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -210,14 +230,17 @@ public class Button extends Widget {
|
|||||||
Padding padding = this.shape.getPadding();
|
Padding padding = this.shape.getPadding();
|
||||||
|
|
||||||
Vector2f tmpSizeShaper = this.minSize;
|
Vector2f tmpSizeShaper = this.minSize;
|
||||||
|
Vector2f delta = Gravity.gravityGenerateDelta(this.propertyGravity, this.size.less(this.minSize));
|
||||||
if (this.propertyFill.x()) {
|
if (this.propertyFill.x()) {
|
||||||
tmpSizeShaper = tmpSizeShaper.withX(this.size.x());
|
tmpSizeShaper = tmpSizeShaper.withX(this.size.x());
|
||||||
|
delta = delta.withX(0.0f);
|
||||||
}
|
}
|
||||||
if (this.propertyFill.y()) {
|
if (this.propertyFill.y()) {
|
||||||
tmpSizeShaper = tmpSizeShaper.withY(this.size.y());
|
tmpSizeShaper = tmpSizeShaper.withY(this.size.y());
|
||||||
|
delta = delta.withY(0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2f tmpOriginShaper = this.size.less(tmpSizeShaper).multiply(0.5f);
|
Vector2f tmpOriginShaper = delta;
|
||||||
Vector2f tmpSizeText = tmpSizeShaper.less(padding.x(), padding.y());
|
Vector2f tmpSizeText = tmpSizeShaper.less(padding.x(), padding.y());
|
||||||
//Vector2f tmpOriginText = this.size.less(tmpSizeText).multiply(0.5f);
|
//Vector2f tmpOriginText = this.size.less(tmpSizeText).multiply(0.5f);
|
||||||
Vector2f tmpOriginText = new Vector2f(0, this.gc.getTextSize());
|
Vector2f tmpOriginText = new Vector2f(0, this.gc.getTextSize());
|
||||||
|
@ -6,6 +6,7 @@ import org.atriasoft.esignal.SignalEmpty;
|
|||||||
import org.atriasoft.etk.Uri;
|
import org.atriasoft.etk.Uri;
|
||||||
import org.atriasoft.etk.math.Vector2f;
|
import org.atriasoft.etk.math.Vector2f;
|
||||||
import org.atriasoft.etk.math.Vector2i;
|
import org.atriasoft.etk.math.Vector2i;
|
||||||
|
import org.atriasoft.ewol.Gravity;
|
||||||
import org.atriasoft.ewol.Padding;
|
import org.atriasoft.ewol.Padding;
|
||||||
import org.atriasoft.ewol.annotation.EwolDescription;
|
import org.atriasoft.ewol.annotation.EwolDescription;
|
||||||
import org.atriasoft.ewol.annotation.EwolSignal;
|
import org.atriasoft.ewol.annotation.EwolSignal;
|
||||||
@ -47,6 +48,7 @@ public class CheckBox extends Widget {
|
|||||||
protected static void periodicCall(final CheckBox self, final EventTime event) {
|
protected static void periodicCall(final CheckBox self, final EventTime event) {
|
||||||
Log.verbose("Periodic call on Entry(" + event + ")");
|
Log.verbose("Periodic call on Entry(" + event + ")");
|
||||||
if (!self.shape.periodicCall(event)) {
|
if (!self.shape.periodicCall(event)) {
|
||||||
|
//Log.error("end periodic call");
|
||||||
self.periodicConnectionHanble.close();
|
self.periodicConnectionHanble.close();
|
||||||
}
|
}
|
||||||
self.markToRedraw();
|
self.markToRedraw();
|
||||||
@ -84,6 +86,8 @@ public class CheckBox extends Widget {
|
|||||||
this.propertyCanFocus = true;
|
this.propertyCanFocus = true;
|
||||||
onChangePropertyShaper();
|
onChangePropertyShaper();
|
||||||
markToRedraw();
|
markToRedraw();
|
||||||
|
// can not support multiple click...
|
||||||
|
setMouseLimit(1);
|
||||||
this.shape = new GuiShape(this.propertyConfig);
|
this.shape = new GuiShape(this.propertyConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,13 +114,17 @@ public class CheckBox extends Widget {
|
|||||||
protected void changeStatusIn(final GuiShapeMode newStatusId) {
|
protected void changeStatusIn(final GuiShapeMode newStatusId) {
|
||||||
if (this.shape.changeStatusIn(newStatusId)) {
|
if (this.shape.changeStatusIn(newStatusId)) {
|
||||||
if (!this.periodicConnectionHanble.isConnected()) {
|
if (!this.periodicConnectionHanble.isConnected()) {
|
||||||
Log.error("REQUEST: connection on operiodic call");
|
//Log.error("REQUEST: connection on periodic call");
|
||||||
this.periodicConnectionHanble = EwolObject.getObjectManager().periodicCall.connect(this, CheckBox::periodicCall);
|
this.periodicConnectionHanble = EwolObject.getObjectManager().periodicCall.connect(this, CheckBox::periodicCall);
|
||||||
}
|
}
|
||||||
markToRedraw();
|
markToRedraw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean checkIfOver(Vector2f relPos) {
|
||||||
|
return relPos.x() > this.overPositionStart.x() && relPos.y() > this.overPositionStart.y() && relPos.x() < this.overPositionStop.x() && relPos.y() < this.overPositionStop.y();
|
||||||
|
}
|
||||||
|
|
||||||
@XmlManaged
|
@XmlManaged
|
||||||
@XmlAttribute
|
@XmlAttribute
|
||||||
@XmlName(value = "config")
|
@XmlName(value = "config")
|
||||||
@ -153,51 +161,65 @@ public class CheckBox extends Widget {
|
|||||||
@Override
|
@Override
|
||||||
protected void onDraw() {
|
protected void onDraw() {
|
||||||
if (this.shape != null) {
|
if (this.shape != null) {
|
||||||
this.shape.draw(true);
|
this.shape.draw(true, this.propertyValue ? 0 : 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onEventInput(final EventInput event) {
|
public boolean onEventInput(final EventInput event) {
|
||||||
Vector2f relPos = relativePosition(event.pos());
|
Vector2f relPos = relativePosition(event.pos());
|
||||||
Log.verbose("Event on Input ... " + event + " relPos = " + relPos);
|
Log.warning("Event on Input ... " + event + " relPos = " + relPos);
|
||||||
|
boolean over = checkIfOver(relPos);
|
||||||
|
//filter if outside the element...
|
||||||
|
if (event.status() == KeyStatus.leave) {
|
||||||
|
changeStatusIn(GuiShapeMode.NORMAL);
|
||||||
|
this.isDown = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (event.inputId() == 0) {
|
if (event.inputId() == 0) {
|
||||||
if (!this.isDown) {
|
if (!this.isDown) {
|
||||||
if (KeyStatus.leave == event.status()) {
|
if (KeyStatus.leave == event.status()) {
|
||||||
changeStatusIn(GuiShapeMode.NORMAL);
|
changeStatusIn(GuiShapeMode.NORMAL);
|
||||||
} else {
|
} else {
|
||||||
Log.verbose("Detect Over : " + this.overPositionStart + " -> " + this.overPositionStop);
|
Log.verbose("Detect Over : " + this.overPositionStart + " -> " + this.overPositionStop);
|
||||||
if (relPos.x() > this.overPositionStart.x() && relPos.y() > this.overPositionStart.y() && relPos.x() < this.overPositionStop.x() && relPos.y() < this.overPositionStop.y()) {
|
if (over) {
|
||||||
changeStatusIn(GuiShapeMode.OVER);
|
changeStatusIn(GuiShapeMode.OVER);
|
||||||
} else {
|
} else {
|
||||||
changeStatusIn(GuiShapeMode.NORMAL);
|
changeStatusIn(GuiShapeMode.NORMAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
if (event.inputId() == 1) {
|
|
||||||
if (KeyStatus.pressSingle == event.status()) {
|
|
||||||
keepFocus();
|
|
||||||
this.signalClick.emit();
|
|
||||||
//nothing to do ...
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (KeyStatus.down == event.status()) {
|
}
|
||||||
keepFocus();
|
if (event.inputId() != 1) {
|
||||||
this.isDown = true;
|
return false;
|
||||||
changeStatusIn(GuiShapeMode.SELECT);
|
}
|
||||||
markToRedraw();
|
if (KeyStatus.pressSingle == event.status() && over) {
|
||||||
this.signalDown.emit();
|
keepFocus();
|
||||||
} else if (KeyStatus.move == event.status()) {
|
this.signalClick.emit();
|
||||||
keepFocus();
|
this.propertyValue = !this.propertyValue;
|
||||||
markToRedraw();
|
return true;
|
||||||
} else if (KeyStatus.up == event.status()) {
|
}
|
||||||
keepFocus();
|
if (KeyStatus.down == event.status() && over) {
|
||||||
this.isDown = false;
|
keepFocus();
|
||||||
this.signalUp.emit();
|
this.isDown = true;
|
||||||
changeStatusIn(GuiShapeMode.OVER);
|
changeStatusIn(GuiShapeMode.SELECT);
|
||||||
markToRedraw();
|
markToRedraw();
|
||||||
}
|
this.signalDown.emit();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (KeyStatus.move == event.status() && over) {
|
||||||
|
keepFocus();
|
||||||
|
markToRedraw();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (KeyStatus.up == event.status() && this.isDown) {
|
||||||
|
keepFocus();
|
||||||
|
this.isDown = false;
|
||||||
|
this.signalUp.emit();
|
||||||
|
changeStatusIn(GuiShapeMode.OVER);
|
||||||
|
markToRedraw();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -219,17 +241,20 @@ public class CheckBox extends Widget {
|
|||||||
Padding padding = this.shape.getPadding();
|
Padding padding = this.shape.getPadding();
|
||||||
|
|
||||||
Vector2f tmpSizeShaper = this.minSize;
|
Vector2f tmpSizeShaper = this.minSize;
|
||||||
|
Vector2f delta = Gravity.gravityGenerateDelta(this.propertyGravity, this.size.less(this.minSize));
|
||||||
if (this.propertyFill.x()) {
|
if (this.propertyFill.x()) {
|
||||||
tmpSizeShaper = tmpSizeShaper.withX(this.size.x());
|
tmpSizeShaper = tmpSizeShaper.withX(this.size.x());
|
||||||
|
delta = delta.withX(0.0f);
|
||||||
}
|
}
|
||||||
if (this.propertyFill.y()) {
|
if (this.propertyFill.y()) {
|
||||||
tmpSizeShaper = tmpSizeShaper.withY(this.size.y());
|
tmpSizeShaper = tmpSizeShaper.withY(this.size.y());
|
||||||
|
delta = delta.withY(0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2f tmpOriginShaper = this.size.less(tmpSizeShaper).multiply(0.5f);
|
Vector2f tmpOriginShaper = delta;
|
||||||
Vector2f tmpSizeText = tmpSizeShaper.less(padding.x(), padding.y());
|
Vector2f tmpSizeInside = tmpSizeShaper.less(padding.x(), padding.y());
|
||||||
//Vector2f tmpOriginText = this.size.less(tmpSizeText).multiply(0.5f);
|
//Vector2f tmpOriginText = this.size.less(tmpSizeText).multiply(0.5f);
|
||||||
Vector2f tmpOriginText = new Vector2f(0, 0);//this.gc.getTextSize());
|
Vector2f tmpOriginInside = new Vector2f(0, 0);//this.gc.getTextSize());
|
||||||
// sometimes, the user define an height bigger than the real size needed == > in this case we need to center the text in the shaper ...
|
// sometimes, the user define an height bigger than the real size needed == > in this case we need to center the text in the shaper ...
|
||||||
/*
|
/*
|
||||||
int minHeight = this.gc.getTextHeight();
|
int minHeight = this.gc.getTextHeight();
|
||||||
@ -240,8 +265,8 @@ public class CheckBox extends Widget {
|
|||||||
// fix all the position in the int class:
|
// fix all the position in the int class:
|
||||||
tmpSizeShaper = Vector2f.clipInt(tmpSizeShaper);
|
tmpSizeShaper = Vector2f.clipInt(tmpSizeShaper);
|
||||||
tmpOriginShaper = Vector2f.clipInt(tmpOriginShaper);
|
tmpOriginShaper = Vector2f.clipInt(tmpOriginShaper);
|
||||||
tmpSizeText = Vector2f.clipInt(tmpSizeText);
|
tmpSizeInside = Vector2f.clipInt(tmpSizeInside);
|
||||||
tmpOriginText = Vector2f.clipInt(tmpOriginText);
|
tmpOriginInside = Vector2f.clipInt(tmpOriginInside);
|
||||||
|
|
||||||
//this.gc.clear();
|
//this.gc.clear();
|
||||||
//this.gc.setSize((int)tmpSizeText.x(), (int)tmpSizeText.y());
|
//this.gc.setSize((int)tmpSizeText.x(), (int)tmpSizeText.y());
|
||||||
@ -252,7 +277,7 @@ public class CheckBox extends Widget {
|
|||||||
//this.gc.text(tmpOriginText, this.propertyValue);
|
//this.gc.text(tmpOriginText, this.propertyValue);
|
||||||
this.overPositionStart = tmpOriginShaper;
|
this.overPositionStart = tmpOriginShaper;
|
||||||
this.overPositionStop = tmpOriginShaper.add(tmpSizeShaper);
|
this.overPositionStop = tmpOriginShaper.add(tmpSizeShaper);
|
||||||
this.shape.setShape(tmpOriginShaper, tmpSizeShaper, tmpOriginText, tmpSizeText);
|
this.shape.setShape(tmpOriginShaper, tmpSizeShaper, tmpOriginInside, tmpSizeInside);
|
||||||
//this.gc.flush();
|
//this.gc.flush();
|
||||||
this.shape.flush();
|
this.shape.flush();
|
||||||
|
|
||||||
|
@ -17,10 +17,9 @@ import org.atriasoft.ewol.annotation.EwolDescription;
|
|||||||
import org.atriasoft.ewol.internal.Log;
|
import org.atriasoft.ewol.internal.Log;
|
||||||
import org.atriasoft.ewol.object.EwolObject;
|
import org.atriasoft.ewol.object.EwolObject;
|
||||||
import org.atriasoft.exml.annotation.XmlAttribute;
|
import org.atriasoft.exml.annotation.XmlAttribute;
|
||||||
|
import org.atriasoft.exml.annotation.XmlFactory;
|
||||||
import org.atriasoft.exml.annotation.XmlManaged;
|
import org.atriasoft.exml.annotation.XmlManaged;
|
||||||
import org.atriasoft.exml.annotation.XmlName;
|
import org.atriasoft.exml.annotation.XmlName;
|
||||||
import org.atriasoft.exml.model.XmlElement;
|
|
||||||
import org.atriasoft.exml.model.XmlNode;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup ewolWidgetGroup
|
* @ingroup ewolWidgetGroup
|
||||||
@ -114,6 +113,13 @@ public class ContainerN extends Widget {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@XmlManaged
|
||||||
|
@XmlFactory(value = WidgetXmlFactory.class)
|
||||||
|
@EwolDescription(value = "Request the widget Expand size while free space is detected (does not generate expand in upper widget)")
|
||||||
|
public List<Widget> getSubWidgets() {
|
||||||
|
return this.subWidget;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Widget getWidgetAtPos(final Vector2f pos) {
|
public Widget getWidgetAtPos(final Vector2f pos) {
|
||||||
if (this.propertyHide) {
|
if (this.propertyHide) {
|
||||||
@ -137,58 +143,6 @@ public class ContainerN extends Widget {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean loadXML(final XmlElement node) {
|
|
||||||
if (node == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// parse generic properties :
|
|
||||||
super.loadXML(node);
|
|
||||||
// remove previous element :
|
|
||||||
subWidgetRemoveAll();
|
|
||||||
|
|
||||||
String tmpAttributeValue = node.getAttribute("lock", "");
|
|
||||||
if (tmpAttributeValue.length() != 0) {
|
|
||||||
setPropertyLockExpand(Vector2b.valueOf(tmpAttributeValue));
|
|
||||||
}
|
|
||||||
boolean invertAdding = false;
|
|
||||||
tmpAttributeValue = node.getAttribute("addmode", "").toLowerCase();
|
|
||||||
if (tmpAttributeValue.contentEquals("invert")) {
|
|
||||||
invertAdding = true;
|
|
||||||
}
|
|
||||||
// parse all the elements :
|
|
||||||
for (XmlNode nodeIt : node.getNodes()) {
|
|
||||||
if (!nodeIt.isElement()) {
|
|
||||||
// trash here all that is not element
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
XmlElement pNode = nodeIt.toElement();
|
|
||||||
String widgetName = pNode.getValue();
|
|
||||||
Log.verbose(" t=" + this.getClass().getCanonicalName() + " Load node name : '" + widgetName + "'");
|
|
||||||
if (!getWidgetManager().exist(widgetName)) {
|
|
||||||
Log.error("[" + getId() + "] {" + this.getClass().getCanonicalName() + "} Unknown basic node='" + widgetName + "' not in : [" + getWidgetManager().list() + "]");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
Log.debug("[" + getId() + "] {" + this.getClass().getCanonicalName() + "} load new element : '" + widgetName + "'");
|
|
||||||
Widget subWidget = getWidgetManager().create(widgetName, pNode);
|
|
||||||
if (subWidget == null) {
|
|
||||||
Log.error("[" + getId() + "] {" + this.getClass().getCanonicalName() + "} Can not create the widget : '" + widgetName + "'");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// add sub element :
|
|
||||||
if (!invertAdding) {
|
|
||||||
subWidgetAdd(subWidget);
|
|
||||||
} else {
|
|
||||||
subWidgetAddStart(subWidget);
|
|
||||||
}
|
|
||||||
if (!subWidget.loadXML(pNode)) {
|
|
||||||
Log.error("[" + getId() + "] {" + this.getClass().getCanonicalName() + "} can not load widget properties : '" + widgetName + "'");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onChangeSize() {
|
public void onChangeSize() {
|
||||||
for (Widget it : this.subWidget) {
|
for (Widget it : this.subWidget) {
|
||||||
@ -247,6 +201,21 @@ public class ContainerN extends Widget {
|
|||||||
requestUpdateSize();
|
requestUpdateSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setSubWidgets(List<Widget> listData) {
|
||||||
|
// Clean all previous widget
|
||||||
|
this.subWidgetRemoveAll();
|
||||||
|
// add separately all widgets
|
||||||
|
for (Widget elem : listData) {
|
||||||
|
if (elem == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
elem.setParent(this);
|
||||||
|
this.subWidget.add(0, elem);
|
||||||
|
}
|
||||||
|
markToRedraw();
|
||||||
|
requestUpdateSize();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* add at end position a Widget (note : This system use an inverted phylisophie (button to top, and left to right)
|
* add at end position a Widget (note : This system use an inverted phylisophie (button to top, and left to right)
|
||||||
* @param newWidget the element pointer
|
* @param newWidget the element pointer
|
||||||
|
@ -21,7 +21,6 @@ import org.atriasoft.ewol.resource.ResourceColorFile;
|
|||||||
import org.atriasoft.exml.annotation.XmlAttribute;
|
import org.atriasoft.exml.annotation.XmlAttribute;
|
||||||
import org.atriasoft.exml.annotation.XmlManaged;
|
import org.atriasoft.exml.annotation.XmlManaged;
|
||||||
import org.atriasoft.exml.annotation.XmlName;
|
import org.atriasoft.exml.annotation.XmlName;
|
||||||
import org.atriasoft.exml.model.XmlElement;
|
|
||||||
import org.atriasoft.gale.key.KeyStatus;
|
import org.atriasoft.gale.key.KeyStatus;
|
||||||
|
|
||||||
public class ImageDisplay extends Widget {
|
public class ImageDisplay extends Widget {
|
||||||
@ -140,50 +139,6 @@ public class ImageDisplay extends Widget {
|
|||||||
return this.propertyUseThemeColor;
|
return this.propertyUseThemeColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean loadXML(final XmlElement node) {
|
|
||||||
if (node == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
super.loadXML(node);
|
|
||||||
// get internal data :
|
|
||||||
|
|
||||||
String tmpAttributeValue = node.getAttribute("ratio", "").toLowerCase();
|
|
||||||
if (tmpAttributeValue.length() != 0) {
|
|
||||||
if (tmpAttributeValue.equals("true")) {
|
|
||||||
this.propertyKeepRatio = true;
|
|
||||||
} else if (tmpAttributeValue.equals("1")) {
|
|
||||||
this.propertyKeepRatio = true;
|
|
||||||
} else {
|
|
||||||
this.propertyKeepRatio = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tmpAttributeValue = node.getAttribute("size", "");
|
|
||||||
if (tmpAttributeValue.length() != 0) {
|
|
||||||
//Log.critical(" Parse SIZE : " + tmpAttributeValue);
|
|
||||||
this.propertyImageSize = Dimension.valueOf(tmpAttributeValue);
|
|
||||||
//Log.critical(" == > " + propertyImageSize);
|
|
||||||
}
|
|
||||||
tmpAttributeValue = node.getAttribute("border", "");
|
|
||||||
if (tmpAttributeValue.length() != 0) {
|
|
||||||
this.propertyBorder = Dimension.valueOf(tmpAttributeValue);
|
|
||||||
}
|
|
||||||
tmpAttributeValue = node.getAttribute("smooth", "");
|
|
||||||
if (tmpAttributeValue.length() != 0) {
|
|
||||||
this.propertySmooth = Boolean.parseBoolean(tmpAttributeValue);
|
|
||||||
}
|
|
||||||
//Log.debug("Load label:" + node.ToElement().getText());
|
|
||||||
if (node.getNodes().size() != 0) {
|
|
||||||
this.propertySource = Uri.valueOf(node.getText());
|
|
||||||
} else {
|
|
||||||
tmpAttributeValue = node.getAttribute("src", "");
|
|
||||||
if (tmpAttributeValue.length() != 0) {
|
|
||||||
this.propertySource = Uri.valueOf(tmpAttributeValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDraw() {
|
protected void onDraw() {
|
||||||
this.compositing.draw();
|
this.compositing.draw();
|
||||||
|
@ -22,7 +22,6 @@ import org.atriasoft.ewol.resource.ResourceColorFile;
|
|||||||
import org.atriasoft.exml.annotation.XmlAttribute;
|
import org.atriasoft.exml.annotation.XmlAttribute;
|
||||||
import org.atriasoft.exml.annotation.XmlManaged;
|
import org.atriasoft.exml.annotation.XmlManaged;
|
||||||
import org.atriasoft.exml.annotation.XmlName;
|
import org.atriasoft.exml.annotation.XmlName;
|
||||||
import org.atriasoft.exml.model.XmlElement;
|
|
||||||
import org.atriasoft.gale.key.KeyStatus;
|
import org.atriasoft.gale.key.KeyStatus;
|
||||||
|
|
||||||
public class Label extends Widget {
|
public class Label extends Widget {
|
||||||
@ -92,18 +91,6 @@ public class Label extends Widget {
|
|||||||
return this.propertyAutoTranslate;
|
return this.propertyAutoTranslate;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean loadXML(final XmlElement node) {
|
|
||||||
if (node == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
super.loadXML(node);
|
|
||||||
// get internal data :
|
|
||||||
Log.debug("Load label:" + node.getText());
|
|
||||||
setPropertyValue(node.getText());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDraw() {
|
protected void onDraw() {
|
||||||
this.text.draw();
|
this.text.draw();
|
||||||
|
@ -32,12 +32,8 @@ import org.atriasoft.ewol.event.InputSystem;
|
|||||||
import org.atriasoft.ewol.internal.Log;
|
import org.atriasoft.ewol.internal.Log;
|
||||||
import org.atriasoft.ewol.object.EwolObject;
|
import org.atriasoft.ewol.object.EwolObject;
|
||||||
import org.atriasoft.exml.annotation.XmlAttribute;
|
import org.atriasoft.exml.annotation.XmlAttribute;
|
||||||
import org.atriasoft.exml.annotation.XmlDefaultManaged;
|
|
||||||
import org.atriasoft.exml.annotation.XmlDefaultOptional;
|
|
||||||
import org.atriasoft.exml.annotation.XmlIgnoreUnknow;
|
|
||||||
import org.atriasoft.exml.annotation.XmlManaged;
|
import org.atriasoft.exml.annotation.XmlManaged;
|
||||||
import org.atriasoft.exml.annotation.XmlName;
|
import org.atriasoft.exml.annotation.XmlName;
|
||||||
import org.atriasoft.exml.model.XmlElement;
|
|
||||||
import org.atriasoft.gale.backend3d.OpenGL;
|
import org.atriasoft.gale.backend3d.OpenGL;
|
||||||
import org.atriasoft.gale.context.ClipboardList;
|
import org.atriasoft.gale.context.ClipboardList;
|
||||||
import org.atriasoft.gale.context.Cursor;
|
import org.atriasoft.gale.context.Cursor;
|
||||||
@ -53,10 +49,6 @@ import org.lwjgl.opengl.GL11;
|
|||||||
* :** Receive Event (keyboard / mouse / ...)
|
* :** Receive Event (keyboard / mouse / ...)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@XmlDefaultManaged(value = false)
|
|
||||||
@XmlDefaultOptional
|
|
||||||
@XmlIgnoreUnknow
|
|
||||||
public class Widget extends EwolObject {
|
public class Widget extends EwolObject {
|
||||||
// ----------------------------------------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------------------------------------
|
||||||
// -- keyboard event properties Area
|
// -- keyboard event properties Area
|
||||||
@ -423,13 +415,6 @@ public class Widget extends EwolObject {
|
|||||||
getWidgetManager().focusKeep(this);
|
getWidgetManager().focusKeep(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean loadXML(final XmlElement node) {
|
|
||||||
super.loadXML(node);
|
|
||||||
markToRedraw();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The widget mark itself that it need to regenerate the nest time.
|
* The widget mark itself that it need to regenerate the nest time.
|
||||||
*/
|
*/
|
||||||
|
@ -15,10 +15,10 @@ import org.atriasoft.exml.model.XmlElement;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public class WidgetManager {
|
public class WidgetManager {
|
||||||
|
|
||||||
// ---------------------------------------------
|
// ---------------------------------------------
|
||||||
// -- Factory area
|
// -- Factory area
|
||||||
// ---------------------------------------------
|
// ---------------------------------------------
|
||||||
private final Map<String, Class<?>> creatorList = new HashMap<>(); //!< List of factory of a widget
|
|
||||||
private WeakReference<Widget> focusWidgetCurrent; //!< Current focus selected
|
private WeakReference<Widget> focusWidgetCurrent; //!< Current focus selected
|
||||||
// ---------------------------------------------
|
// ---------------------------------------------
|
||||||
// -- Focus area
|
// -- Focus area
|
||||||
@ -83,7 +83,7 @@ public class WidgetManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
* add a factory of a specific widget.
|
* add a factory of a specific widget.
|
||||||
* @param name Name of the widget that is associated of the factory.
|
* @param name Name of the widget that is associated of the factory.
|
||||||
* @param klass class interface
|
* @param klass class interface
|
||||||
@ -94,7 +94,7 @@ public class WidgetManager {
|
|||||||
}
|
}
|
||||||
//Keep name in lower case :
|
//Keep name in lower case :
|
||||||
final String nameLower = name.toLowerCase();
|
final String nameLower = name.toLowerCase();
|
||||||
final Class<?> it = this.creatorList.get(nameLower);
|
final Class<?> it = WidgetXmlFactory..creatorList.get(nameLower);
|
||||||
if (it != null) {
|
if (it != null) {
|
||||||
Log.warning("Replace Creator of a specify widget : " + nameLower);
|
Log.warning("Replace Creator of a specify widget : " + nameLower);
|
||||||
return;
|
return;
|
||||||
@ -172,7 +172,7 @@ public class WidgetManager {
|
|||||||
//elog::displayBacktrace();
|
//elog::displayBacktrace();
|
||||||
Widget focusWidgetCurrent = this.focusWidgetCurrent.get();
|
Widget focusWidgetCurrent = this.focusWidgetCurrent.get();
|
||||||
if (newWidget == focusWidgetCurrent) {
|
if (newWidget == focusWidgetCurrent) {
|
||||||
// nothing to do ...
|
// nothing to do ...
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (focusWidgetCurrent != null) {
|
if (focusWidgetCurrent != null) {
|
||||||
@ -186,7 +186,7 @@ public class WidgetManager {
|
|||||||
}
|
}
|
||||||
this.focusWidgetCurrent = new WeakReference<>(newWidget);
|
this.focusWidgetCurrent = new WeakReference<>(newWidget);
|
||||||
if (newWidget != null) {
|
if (newWidget != null) {
|
||||||
Log.debug("Set focus on WidgetID=" + newWidget.getId() );
|
Log.debug("Set focus on WidgetID=" + newWidget.getId());
|
||||||
newWidget.setFocus();
|
newWidget.setFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
28
src/org/atriasoft/ewol/widget/WidgetXmlFactory.java
Normal file
28
src/org/atriasoft/ewol/widget/WidgetXmlFactory.java
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
package org.atriasoft.ewol.widget;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.atriasoft.exml.annotation.XmlFactory.InterfaceXmlFactoryAccess;
|
||||||
|
|
||||||
|
public class WidgetXmlFactory implements InterfaceXmlFactoryAccess {
|
||||||
|
private static Map<String, Class<?>> listWidgetAvaillable = new HashMap<>();
|
||||||
|
static {
|
||||||
|
listWidgetAvaillable.put("Button", Button.class);
|
||||||
|
listWidgetAvaillable.put("Sizer", Sizer.class);
|
||||||
|
listWidgetAvaillable.put("Label", Label.class);
|
||||||
|
listWidgetAvaillable.put("CheckBox", CheckBox.class);
|
||||||
|
listWidgetAvaillable.put("Image", ImageDisplay.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<?> findClass(String name) {
|
||||||
|
return listWidgetAvaillable.get(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String generateName(Object widget) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user