Compare commits

...

2 Commits

Author SHA1 Message Date
d8eeff4eb0 [DEBUG] correct xml api 2022-08-28 19:45:04 +02:00
12d84496e8 ---No commit message--- 2022-08-28 19:42:16 +02:00
6 changed files with 40 additions and 14 deletions

View File

@ -4,7 +4,6 @@ import org.atriasoft.etk.Configs;
import org.atriasoft.etk.math.Vector2f; 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 org.atriasoft.ewol.widget.MainWindows;
import sample.atriasoft.ewol.Log; import sample.atriasoft.ewol.Log;

View File

@ -0,0 +1,31 @@
package sample.atriasoft.ewol.sampleEntry;
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

@ -2,7 +2,6 @@ package sample.atriasoft.ewol.sampleEntry;
import org.atriasoft.etk.Uri; import org.atriasoft.etk.Uri;
import org.atriasoft.ewol.Ewol; import org.atriasoft.ewol.Ewol;
import org.atriasoft.ewol.widget.MainWindows;
public class SampleEntryMain { public class SampleEntryMain {
public static void main(final String[] args) { public static void main(final String[] args) {

View File

@ -301,7 +301,6 @@ public class EwolContext extends GaleApplication {
@Override @Override
public void onPointer(final KeySpecial special, final KeyType type, final int pointerID, final Vector2f pos, final KeyStatus state) { public void onPointer(final KeySpecial special, final KeyType type, final int pointerID, final Vector2f pos, final KeyStatus state) {
// TODO: WTF !!!
this.input.setLastKeyboardSpecial(special); this.input.setLastKeyboardSpecial(special);
switch (state) { switch (state) {
case move: case move:

View File

@ -18,7 +18,7 @@ import org.atriasoft.ewol.DrawProperty;
import org.atriasoft.ewol.Gravity; import org.atriasoft.ewol.Gravity;
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.Exml; import org.atriasoft.exml.XmlMapper;
import org.atriasoft.exml.exception.ExmlException; import org.atriasoft.exml.exception.ExmlException;
import org.atriasoft.gale.context.ClipboardList; import org.atriasoft.gale.context.ClipboardList;
import org.atriasoft.gale.context.Cursor; import org.atriasoft.gale.context.Cursor;
@ -58,13 +58,11 @@ public class Composer extends Container {
requestComposer = false; requestComposer = false;
} }
data = data.replace("{ID}", Long.toString(id)); data = data.replace("{ID}", Long.toString(id));
Composer[] result = null; Composer result = null;
try { try {
result = Exml.parse(data, Composer.class, "Composer");//new WidgetXmlFactory()); XmlMapper mapper = new XmlMapper();
} catch (final ExmlException ex) { result = mapper.parse(data, Composer.class); //new WidgetXmlFactory());
Log.error("Fail to load Data !!! {}", ex.toString()); } catch (final ExmlException | AknotException ex) {
ex.printStackTrace();
} catch (final AknotException ex) {
Log.error("Fail to load Data !!! {}", ex.toString()); Log.error("Fail to load Data !!! {}", ex.toString());
ex.printStackTrace(); ex.printStackTrace();
} }
@ -72,9 +70,9 @@ public class Composer extends Container {
return null; return null;
} }
if (requestComposer) { if (requestComposer) {
return result[0]; return result;
} }
return result[0].getSubWidget(); return result.getSubWidget();
} }
protected boolean propertyRemoveIfUnderRemove; //!< Remove the composer if sub element request a remove protected boolean propertyRemoveIfUnderRemove; //!< Remove the composer if sub element request a remove

View File

@ -49,7 +49,7 @@ public class Spin extends SpinBase {
public void checkValue(long value) { public void checkValue(long value) {
value = FMath.clamp(this.propertyMin, value, this.propertyMax); value = FMath.clamp(this.propertyMin, value, this.propertyMax);
this.propertyValue = value; this.propertyValue = value;
// TODO: manage the mantis ... // todo: manage the mantis ...
this.widgetEntry.setPropertyValue(Long.toString(value)); this.widgetEntry.setPropertyValue(Long.toString(value));
this.signalValue.emit(this.propertyValue); this.signalValue.emit(this.propertyValue);
} }
@ -60,7 +60,7 @@ public class Spin extends SpinBase {
if (this.widgetEntry != null && !this.connectionEntry.isConnected()) { if (this.widgetEntry != null && !this.connectionEntry.isConnected()) {
this.connectionEntry = this.widgetEntry.signalModify.connect(this, Spin::onCallbackModify); this.connectionEntry = this.widgetEntry.signalModify.connect(this, Spin::onCallbackModify);
// TODO: set a regExp Filter // todo: set a regExp Filter
} }
if (this.widgetButtonUp != null && !this.connectionButtonUp.isConnected()) { if (this.widgetButtonUp != null && !this.connectionButtonUp.isConnected()) {
this.connectionButtonUp = this.widgetButtonUp.signalValue.connect(this, Spin::onCallbackUp); this.connectionButtonUp = this.widgetButtonUp.signalValue.connect(this, Spin::onCallbackUp);