[DEV] update new aknot

This commit is contained in:
Edouard DUPIN 2022-05-03 15:06:29 +02:00
parent 4df776a15c
commit 599db5aefa
36 changed files with 1096 additions and 1002 deletions

View File

@ -1,420 +0,0 @@
/*
* @author Edouard DUPIN
* @copyright 2011, Edouard DUPIN, all right reserved
* @license MPL v2.0 (see license file)
*/
package org.atriasoft.ewol.widget;
import java.io.File;
import java.io.IOException;
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.atriasoft.esignal.Signal;
import org.atriasoft.etk.Color;
import org.atriasoft.etk.Uri;
import org.atriasoft.etk.math.Vector2f;
import org.atriasoft.etk.math.Vector2i;
import org.atriasoft.etk.math.Vector3f;
import org.atriasoft.etk.math.Vector3i;
import org.atriasoft.ewol.annotation.EwolDescription;
import org.atriasoft.ewol.annotation.EwolSignal;
import org.atriasoft.ewol.event.EventInput;
import org.atriasoft.ewol.internal.Log;
import org.atriasoft.ewol.resource.ResourceColorFile;
import org.atriasoft.ewol.widget.model.ListRole;
import org.atriasoft.exml.annotation.XmlAttribute;
import org.atriasoft.exml.annotation.XmlManaged;
import org.atriasoft.exml.annotation.XmlName;
import org.atriasoft.gale.key.KeyStatus;
/**
* @ingroup ewolWidgetGroup
*/
class Gird extends Widget {
protected class GirdProperties {
public Widget widget;
public int row;
public int col;
};
protected int sizeRow = 0; //!< size of all lines (row) (if set (otherwise 0)) == > we have a only one size ==> multiple size will have no use ...
protected int uniformSizeRow = 0;
protected List<int> sizeCol = new ArrayList<>(); //!< size of all colomn (if set (otherwise 0))
protected List<GirdProperties> subWidget = new ArrayList<>(); //!< all sub widget are contained in this element
protected Widget tmpWidget = null; //!< use when replace a widget ...
protected boolean gavityButtom = true;
/**
* Constructor
*/
public Gird() {
this.borderSize = _newBorderSize;
if (this.borderSize.x() < 0) {
Log.error("Try to set a border size <0 on x : " + this.borderSize.x() + " == > restore to 0");
this.borderSize.setX(0);
}
if (this.borderSize.y() < 0) {
Log.error("Try to set a border size <0 on y : " + this.borderSize.y() + " == > restore to 0");
this.borderSize.setY(0);
}
markToRedraw();
requestUpdateSize();
}
/**
* set the number of colomn
* @param colNumber Nuber of colomn
*/
public void setColNumber(int _colNumber) {
if ((long)this.sizeCol.size() > _colNumber) {
int errorControl = this.subWidget.size();
// remove subWidget :
for (long iii=this.subWidget.size(); iii >= 0; iii--) {
if (this.subWidget[iii].col > (_colNumber-1)) {
// out of bounds : must remove it ...
if (this.subWidget[iii].widget != null) {
this.subWidget[iii].widget.reset();
// no remove, this element is removed with the function onObjectRemove == > it does not exist anymore ...
if (errorControl == this.subWidget.size()) {
Log.critical("[" + getId() + "] The number of element might have been reduced ... == > it is not the case ==> the herited class must call the \"OnObjectRemove\" function...");
}
} else {
Log.warning("[" + getId() + "] Must not have null pointer on the subWidget list ...");
this.subWidget.erase(this.subWidget.begin()+iii);
}
errorControl = this.subWidget.size();
}
}
// just add the col size:
this.sizeCol.erase(this.sizeCol.end());
} else {
// just add the col size:
for (int iii=this.sizeCol.size()-1; iii<_colNumber-1 ; iii++) {
this.sizeCol.pushBack(0);
}
}
}
/**
* change a size view of a colomn.
* @param colId Id of the colomn [0..x].
* @param size size of the colomn.
*/
public void setColSize(int _colId, int _size) {
if ((long)this.sizeCol.size() > _colId) {
this.sizeCol[_colId] = _size;
} else {
Log.error("Can not set the Colomn size : " + _colId+1
+ " at " + _size + "px we have "
+ this.sizeCol.size() + " colomn");
}
}
/**
* change a size view of a line.
* @param size size of the line.
*/
public void setRowSize(int _size){
this.sizeRow = _size;
}
/**
* get the size view of a colomn.
* @param colId Id of the colomn [0..x].
* @return The size of the colomn.
*/
public int getColSize(int _colId) {
if ((long)this.sizeCol.size() > _colId) {
if (this.sizeCol[_colId] <= 0) {
return 0;
}
return this.sizeCol[_colId];
}
Log.error("Can not get the Colomn size : " + _colId+1 + " we have "+ this.sizeCol.size() + " colomn");
return 0;
}
/**
* get the size view of the lines.
* @return The size of the lines.
*/
public int getRowSize(){
return this.sizeRow;
}
/**
* set the gravity of the widget on the Button (index 0 is on buttom)
*/
public void setGravityButtom() {
this.gavityButtom = true;
markToRedraw();
}
/**
* set the gravity of the widget on the Top (index 0 is on top)
*/
public void setGravityTop() {
this.gavityButtom = false;
markToRedraw();
}
/**
* remove all sub element from the widget.
*/
public void subWidgetRemoveAll() {
int errorControl = this.subWidget.size();
this.subWidget.clear();
}
/**
* add at end position a Widget (note : This system use an inverted phylisophie (button to top, and left to right)
* @param _colId Id of the colomn [0..x].
* @param _rowId Id of the row [0..y].
* @param _newWidget the element pointer
*/
public void subWidgetAdd(int _colId, int _rowId, Widget _newWidget){
if (_newWidget == null) {
return;
}
GirdProperties prop;
prop.row = _rowId;
prop.col = _colId;
prop.widget = _newWidget;
// need to find the correct position :
for (int iii=0; iii<this.subWidget.size(); iii++) {
if (this.subWidget[iii].row < prop.row) {
continue;
} else if (this.subWidget[iii].row > prop.row) {
// find a new position;
this.subWidget.insert(this.subWidget.begin()+iii, prop);
return;
} else {
if (this.subWidget[iii].col < prop.col) {
continue;
} else if (this.subWidget[iii].col > prop.col) {
// find a new position;
this.subWidget.insert(this.subWidget.begin()+iii, prop);
return;
} else {
// The element already exist == > replace it ...
this.tmpWidget = this.subWidget[iii].widget;
this.subWidget[iii].widget = _newWidget;
if (this.tmpWidget != null) {
this.tmpWidget.reset();
if (this.tmpWidget != null) {
Log.critical("[" + getId() + "] Error while replacing a widget ... == > never call when free");
this.tmpWidget = null;
}
}
}
}
}
// not find == > just adding it ...
this.subWidget.pushBack(prop);
}
/**
* remove definitly a widget from the system and this Gird.
* @param _newWidget the element pointer.
*/
public void subWidgetRemove(Widget _newWidget){
for (int iii=0; iii<this.subWidget.size(); iii++) {
if (_newWidget == this.subWidget[iii].widget) {
this.subWidget.erase(this.subWidget.begin()+iii);
return;
}
}
Log.warning("[" + getId() + "] Can not remove unExistant widget");
}
/**
* remove definitly a widget from the system and this Gird.
* @param _colId Id of the colomn [0..x].
* @param _rowId Id of the row [0..y].
*/
public void subWidgetRemove(int _colId, int _rowId){
if ( _colId < 0
|| _rowId < 0) {
Log.warning("[" + getId() + "] try to remove widget with id < 0 col=" + _colId + " row=" + _rowId);
return;
}
int errorControl = this.subWidget.size();
// try to find it ...
for (int iii=0; iii<this.subWidget.size(); iii++) {
if( this.subWidget[iii].row == _rowId
&& this.subWidget[iii].col == _colId) {
this.subWidget.erase(this.subWidget.begin()+iii);
return;
}
}
Log.warning("[" + getId() + "] Can not remove unExistant widget");
}
/**
* Just unlick the specify widget, this function does not remove it from the system (if you can, do nt use it ...).
* @param _newWidget the element pointer.
*/
public void subWidgetUnLink(Widget _newWidget) {
if (_newWidget == null) {
return;
}
for (int iii=0; iii<this.subWidget.size(); iii++) {
if (_newWidget == this.subWidget[iii].widget) {
this.subWidget.erase(this.subWidget.begin()+iii);
return;
}
}
}
/**
* Just unlick the specify widget, this function does not remove it from the system (if you can, do nt use it ...).
* @param _colId Id of the colomn [0..x].
* @param _rowId Id of the row [0..y].
*/
public void subWidgetUnLink(int _colId, int _rowId){
if ( _colId < 0
|| _rowId < 0) {
Log.warning("[" + getId() + "] try to Unlink widget with id < 0 col=" + _colId + " row=" + _rowId);
return;
}
// try to find it ...
for (int iii=0; iii<this.subWidget.size(); iii++) {
if( this.subWidget[iii].row == _rowId
&& this.subWidget[iii].col == _colId) {
this.subWidget.erase(this.subWidget.begin()+iii);
return;
}
}
Log.warning("[" + getId() + "] Can not unLink unExistant widget");
}
protected Vector2i borderSize; //!< Border size needed for all the display
/**
* set the current border size of the current element:
* @param _newBorderSize The border size to set (0 if not used)
*/
public void setBorderSize( Vector2i _newBorderSize) {
borderSize = _newBorderSize;
}
/**
* get the current border size of the current element:
* @return the border size (0 if not used)
*/
public Vector2i getBorderSize() {
return this.borderSize;
};
public void systemDraw( ewol::DrawProperty _displayProp) {
Widget::systemDraw(_displayProp);
for (auto it : this.subWidget) {
if (it.widget != null) {
it.widget.systemDraw(_displayProp);
}
}
}
public void onRegenerateDisplay() {
for (auto it : this.subWidget) {
if (it.widget != null) {
it.widget.onRegenerateDisplay();
}
}
}
public Widget getWidgetAtPos( Vector2f pos) {
if (*propertyHide == true) {
return null;
}
// for all element in the sizer ...
for (auto it : this.subWidget) {
if (it.widget == null) {
continue;
}
Vector2f tmpSize = it.widget.getSize();
Vector2f tmpOrigin = it.widget.getOrigin();
if( (tmpOrigin.x() <= _pos.x() && tmpOrigin.x() + tmpSize.x() >= _pos.x())
&& (tmpOrigin.y() <= _pos.y() && tmpOrigin.y() + tmpSize.y() >= _pos.y()) ) {
Widget tmpWidget = it.widget.getWidgetAtPos(_pos);
if (tmpWidget != null) {
return tmpWidget;
}
// stop searching
break;
}
}
return null;
}
public void onChangeSize() {
//Log.debug("Update size");
this.size -= this.borderSize*2;
for (int iii=0; iii<this.subWidget.size(); iii++) {
if (this.subWidget[iii].widget != null) {
//calculate the origin :
Vector2f tmpOrigin = this.origin + this.borderSize;
if (false == this.gavityButtom) {
tmpOrigin += Vector2f(0, this.size.y()-this.borderSize.y());
}
int tmpSizeWidth = 0;
for (int jjj=0; jjj<this.subWidget[iii].col; jjj++ ){
tmpSizeWidth += abs(this.sizeCol[jjj]);
}
// adding Y origin :
int addingPos = 0;
if (true == this.gavityButtom) {
addingPos = (this.subWidget[iii].row)*this.uniformSizeRow;
} else {
addingPos = -(this.subWidget[iii].row+1)*this.uniformSizeRow;
}
tmpOrigin += Vector2f(tmpSizeWidth, addingPos);
Log.debug(" [" + iii + "] set subwidget origin=" +tmpOrigin + " size=" + Vector2i(abs(this.sizeCol[this.subWidget[iii].col]), this.uniformSizeRow) );
// set the origin :
this.subWidget[iii].widget.setOrigin(Vector2fClipInt32(tmpOrigin));
// all time set oll the space .
this.subWidget[iii].widget.setSize(Vector2fClipInt32(Vector2f(abs(this.sizeCol[this.subWidget[iii].col]), this.uniformSizeRow)));
this.subWidget[iii].widget.onChangeSize();
}
}
this.size += this.borderSize*2;
Log.debug("Calculate size : " + this.size);
markToRedraw();
}
public void calculateMinMaxSize() {
for (int iii=0; iii<this.sizeCol.size(); iii++ ){
if (this.sizeCol[iii] <= 0) {
this.sizeCol[iii] = 0;
}
}
//Log.debug("Update minimum size");
this.minSize = propertyMinSize.getPixel();
this.maxSize = propertyMaxSize.getPixel();
this.uniformSizeRow = 0;
this.minSize += this.borderSize*2;
int lastLineID = 0;
for (int iii=0; iii<this.subWidget.size(); iii++) {
if (this.subWidget[iii].row > lastLineID) {
// change of line :
lastLineID = this.subWidget[iii].row;
}
if (this.subWidget[iii].widget != null) {
this.subWidget[iii].widget.calculateMinMaxSize();
Vector2f tmpSize = this.subWidget[iii].widget.getCalculateMinSize();
Log.debug(" [" + iii + "] subWidgetMinSize=" + tmpSize);
// for all we get the max size :
this.uniformSizeRow = etk::max((int)tmpSize.y(), this.uniformSizeRow);
// for the colomn size : We set the autamatic value in negative :
if (this.sizeCol[this.subWidget[iii].col] <= 0) {
this.sizeCol[this.subWidget[iii].col] = etk::min(this.sizeCol[this.subWidget[iii].col], (int)-tmpSize.x() );
}
}
}
if (this.sizeRow > 0) {
this.uniformSizeRow = this.sizeRow;
}
int tmpSizeWidth = 0;
for (int iii=0; iii<this.sizeCol.size(); iii++ ){
tmpSizeWidth += abs(this.sizeCol[iii]);
}
Log.debug(" tmpSizeWidth=" + tmpSizeWidth);
Log.debug(" this.uniformSizeRow=" + this.uniformSizeRow);
this.minSize += Vector2i(tmpSizeWidth, (lastLineID+1)*this.uniformSizeRow);
Log.debug("Calculate min size : " + this.minSize);
//Log.debug("Vert Result : expand="+ this.userExpand + " minSize="+ this.minSize);
}
}

View File

@ -29,10 +29,10 @@ class ColorChooser entends Sizer {
public Signal<Color> signalChange; public Signal<Color> signalChange;
protected Color propertyValue = Color.WHITE; protected Color propertyValue = Color.WHITE;
@XmlManaged @AKManaged
@XmlAttribute @XmlAttribute
@XmlName(value = "value") @AKName(value = "value")
@EwolDescription(value = "color to select") @AknotDescription(value = "color to select")
public Color getPropertyValue() { public Color getPropertyValue() {
return propertyValue; return propertyValue;
} }

View File

@ -2,4 +2,5 @@ module sample.atriasoft.ewol {
//exports sample.atriasoft.ewol.simpleWindowsWithImage; //exports sample.atriasoft.ewol.simpleWindowsWithImage;
requires org.atriasoft.ewol; requires org.atriasoft.ewol;
requires org.atriasoft.etk; requires org.atriasoft.etk;
requires org.atriasoft.esignal;
} }

View File

@ -1,5 +1,15 @@
package sample.atriasoft.ewol; package sample.atriasoft.ewol;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Arrays;
import java.util.List;
import org.atriasoft.aknot.reflect.ReflectClass;
import org.atriasoft.aknot.reflect.ReflectTools;
import org.atriasoft.esignal.Signal;
import org.atriasoft.esignal.SignalEmpty;
import org.atriasoft.etk.Color; import org.atriasoft.etk.Color;
import org.atriasoft.etk.Dimension3f; import org.atriasoft.etk.Dimension3f;
import org.atriasoft.etk.Distance; import org.atriasoft.etk.Distance;
@ -16,6 +26,7 @@ import org.atriasoft.ewol.widget.Sizer.DisplayMode;
import org.atriasoft.ewol.widget.Spacer; import org.atriasoft.ewol.widget.Spacer;
import org.atriasoft.ewol.widget.Widget; import org.atriasoft.ewol.widget.Widget;
import org.atriasoft.ewol.widget.Windows; import org.atriasoft.ewol.widget.Windows;
import org.atriasoft.exml.parser.Tools;
public class BasicWindows extends Windows { public class BasicWindows extends Windows {
private static final String LABEL_GRAVITY = "gravity<br/>"; private static final String LABEL_GRAVITY = "gravity<br/>";
@ -186,7 +197,96 @@ public class BasicWindows extends Windows {
this.sizerMenuHori.subWidgetAdd(widget); this.sizerMenuHori.subWidgetAdd(widget);
} }
public void connectAllSignals(final Widget widget) throws Exception {
Log.warning("Connect all signal(s) on '{}'", widget.getName());
final Class<?> classType = widget.getClass();
final Field[] fields = classType.getFields();
Log.verbose(" Fields: (" + fields.length + ")");
for (final Field elem : fields) {
// we does not manage static field
if (Modifier.isStatic(elem.getModifiers())) {
continue;
}
// we does not manage private field
// NOTE: if the field is private I do not check the elements ==> the user want a private API !!! (maybe change ...)
if (!Modifier.isPublic(elem.getModifiers())) {
continue;
}
final Boolean isSignal = ReflectTools.getIsSignal(elem, false);
if (!isSignal) {
continue;
}
final String[] names = ReflectTools.getNames(elem, null);
String eventName = elem.toGenericString();
Log.error(" - name={} otherNames={}", eventName, Arrays.toString(names));
if (names.length != 0 && names[0] != null) {
eventName = names[0];
}
final String description = ReflectTools.getDescription(elem);
if (description != null) {
Log.error(" ==> '{}'", description);
}
final Class<?>[] types = ReflectTools.getTypeField(elem);
Log.error(" typeSignal '{}'", Arrays.toString(types));
if (types.length == 2 && types[0] == Signal.class) {
Log.error(" ** Signal<{}>", types[1].getCanonicalName());
final Object signalObject = elem.get(widget);
if (signalObject == null) {
Log.error("Signal is not accessible !!!!!!! ");
} else {
final String valueNameOfSignal = eventName;
@SuppressWarnings("unchecked")
final Signal<Object> tmp = (Signal<Object>) signalObject;
tmp.connect((object) -> {
Log.print("Get event from '{}' value='{}'", valueNameOfSignal, object);
});
}
}
if (types.length == 1 && types[0] == SignalEmpty.class) {
Log.error(" ** SignalEmpty");
}
}
}
public void displayAllPropertyWithType(final Widget widget) throws Exception {
Log.warning("Connect all property(ies) on '{}'", widget.getName());
final Class<?> classType = widget.getClass();
final List<Method> methods = ReflectClass.getFilterGenericFucntion(classType, null, true, true, true);
// Separate the methods and filer as:
// - XXX GetXxx(); & XXX != boolean
// - void setXxx(XXX elem);
// - [bB]oolean isXxx();
// for records:
// - xxx();
final boolean isRecord = Record.class.isAssignableFrom(classType);
final List<Method> methodsGet = ReflectClass.extractGetMethod(classType, methods, null);
for (final Method elem : methodsGet) {
final String name = Tools.decapitalizeFirst(isRecord ? elem.getName() : elem.getName().substring(3));
final Boolean isAttribute = ReflectTools.getIsAttribute(elem, false);
if (!isAttribute) {
continue;
}
final String[] otherNames = ReflectTools.getNames(elem, null);
Log.error(" - '{}' otherNames={}", name, Arrays.toString(otherNames));
final String description = ReflectTools.getDescription(elem);
if (description != null) {
Log.error(" ==> '{}'", description);
}
}
}
public void setTestWidget(final Widget widget) { public void setTestWidget(final Widget widget) {
try {
connectAllSignals(widget);
displayAllPropertyWithType(widget);
} catch (final Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
this.sizerTestAreaHori.subWidgetRemoveAll(); this.sizerTestAreaHori.subWidgetRemoveAll();
{ {
final Spacer simpleSpacer = new Spacer(); final Spacer simpleSpacer = new Spacer();
@ -220,4 +320,5 @@ public class BasicWindows extends Windows {
final Label gravLabel = (Label) (this.buttonGravity.getSubWidgets()[0]); final Label gravLabel = (Label) (this.buttonGravity.getSubWidgets()[0]);
gravLabel.setPropertyValue(LABEL_GRAVITY + gravity.toString()); gravLabel.setPropertyValue(LABEL_GRAVITY + gravity.toString());
} }
} }

View File

@ -4,7 +4,6 @@
open module org.atriasoft.ewol { open module org.atriasoft.ewol {
exports org.atriasoft.ewol; exports org.atriasoft.ewol;
exports org.atriasoft.ewol.annotation;
exports org.atriasoft.ewol.compositing; exports org.atriasoft.ewol.compositing;
exports org.atriasoft.ewol.compositing.tools; exports org.atriasoft.ewol.compositing.tools;
exports org.atriasoft.ewol.context; exports org.atriasoft.ewol.context;
@ -14,7 +13,7 @@ open module org.atriasoft.ewol {
exports org.atriasoft.ewol.resource.font; exports org.atriasoft.ewol.resource.font;
//exports org.atriasoft.ewol.tools; //exports org.atriasoft.ewol.tools;
exports org.atriasoft.ewol.widget; exports org.atriasoft.ewol.widget;
//exports org.atriasoft.ewol.widget.meta; exports org.atriasoft.ewol.widget.meta;
requires transitive org.atriasoft.esignal; requires transitive org.atriasoft.esignal;
requires transitive org.atriasoft.iogami; requires transitive org.atriasoft.iogami;

View File

@ -1,20 +0,0 @@
package org.atriasoft.ewol.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Meta-annotation (annotations used on other annotations)
* used for marking all annotations that are
* part of Exml package. Can be used for recognizing all
* Exml annotations generically, and in future also for
* passing other generic annotation configuration.
*/
@Target(ElementType.ANNOTATION_TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface EwolAnnotation {
// for now, a pure tag annotation, no parameters
}

View File

@ -1,13 +0,0 @@
package org.atriasoft.ewol.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ ElementType.FIELD, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@EwolAnnotation
public @interface EwolDescription {
String[] value();
}

View File

@ -1,13 +0,0 @@
package org.atriasoft.ewol.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ ElementType.FIELD, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@EwolAnnotation
public @interface EwolObjectProperty {
}

View File

@ -1,7 +0,0 @@
package org.atriasoft.ewol.annotation;
public @interface EwolSignal {
String description() default "";
String[] name();
}

View File

@ -2,17 +2,17 @@ package org.atriasoft.ewol.object;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import org.atriasoft.aknot.annotation.AknotAttribute;
import org.atriasoft.aknot.annotation.AknotDefaultAttribute;
import org.atriasoft.aknot.annotation.AknotDefaultManaged;
import org.atriasoft.aknot.annotation.AknotDefaultOptional;
import org.atriasoft.aknot.annotation.AknotDescription;
import org.atriasoft.aknot.annotation.AknotIgnoreUnknown;
import org.atriasoft.aknot.annotation.AknotManaged;
import org.atriasoft.aknot.annotation.AknotName;
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.annotation.XmlAttribute;
import org.atriasoft.exml.annotation.XmlDefaultAttibute;
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
@ -24,10 +24,10 @@ import org.atriasoft.exml.annotation.XmlName;
* 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) @AknotDefaultManaged(value = false)
@XmlDefaultOptional @AknotDefaultOptional
@XmlDefaultAttibute @AknotDefaultAttribute
@XmlIgnoreUnknow @AknotIgnoreUnknown
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
@ -114,10 +114,10 @@ public class EwolObject {
return this.uniqueId; return this.uniqueId;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "name") @AknotName(value = "name")
@EwolDescription(value = "Name of the object.") @AknotDescription(value = "Name of the object.")
public String getName() { public String getName() {
return this.name; return this.name;
} }

View File

@ -1,5 +1,10 @@
package org.atriasoft.ewol.widget; package org.atriasoft.ewol.widget;
import org.atriasoft.aknot.annotation.AknotAttribute;
import org.atriasoft.aknot.annotation.AknotDescription;
import org.atriasoft.aknot.annotation.AknotManaged;
import org.atriasoft.aknot.annotation.AknotName;
import org.atriasoft.aknot.annotation.AknotSignal;
import org.atriasoft.esignal.Connection; import org.atriasoft.esignal.Connection;
import org.atriasoft.esignal.Signal; import org.atriasoft.esignal.Signal;
import org.atriasoft.esignal.SignalEmpty; import org.atriasoft.esignal.SignalEmpty;
@ -8,8 +13,6 @@ import org.atriasoft.etk.math.Vector3b;
import org.atriasoft.etk.math.Vector3f; import org.atriasoft.etk.math.Vector3f;
import org.atriasoft.ewol.Gravity; 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.EwolSignal;
import org.atriasoft.ewol.compositing.GuiShape; import org.atriasoft.ewol.compositing.GuiShape;
import org.atriasoft.ewol.compositing.GuiShapeMode; import org.atriasoft.ewol.compositing.GuiShapeMode;
import org.atriasoft.ewol.compositing.ShapeBox; import org.atriasoft.ewol.compositing.ShapeBox;
@ -18,9 +21,6 @@ import org.atriasoft.ewol.event.EventInput;
import org.atriasoft.ewol.event.EventTime; import org.atriasoft.ewol.event.EventTime;
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.XmlManaged;
import org.atriasoft.exml.annotation.XmlName;
import org.atriasoft.gale.key.KeyKeyboard; import org.atriasoft.gale.key.KeyKeyboard;
import org.atriasoft.gale.key.KeyStatus; import org.atriasoft.gale.key.KeyStatus;
@ -100,17 +100,29 @@ public class Button extends ContainerToggle {
protected ShapeBox shapeProperty = ShapeBox.ZERO; protected ShapeBox shapeProperty = ShapeBox.ZERO;
private GuiShape shape; private GuiShape shape;
@EwolSignal(name = "down", description = "Button is Down") @AknotSignal
@AknotName(value = "down")
@AknotDescription("Button is Down")
public SignalEmpty signalDown = new SignalEmpty(); public SignalEmpty signalDown = new SignalEmpty();
@EwolSignal(name = "up", description = "Button is Up") @AknotSignal
@AknotName(value = "up")
@AknotDescription("Button is Up")
public SignalEmpty signalUp = new SignalEmpty(); public SignalEmpty signalUp = new SignalEmpty();
@EwolSignal(name = "click", description = "Button is Clicked") @AknotSignal
@AknotName(value = "click")
@AknotDescription("Button is Clicked")
public SignalEmpty signalClick = new SignalEmpty(); public SignalEmpty signalClick = new SignalEmpty();
@EwolSignal(name = "enter", description = "The cursor enter inside the button") @AknotSignal
@AknotName(value = "enter")
@AknotDescription("The cursor enter inside the button")
public SignalEmpty signalEnter = new SignalEmpty(); public SignalEmpty signalEnter = new SignalEmpty();
@EwolSignal(name = "leave", description = "The cursor leave the button") @AknotSignal
@AknotName(value = "leave")
@AknotDescription("The cursor leave the button")
public SignalEmpty signalLeave = new SignalEmpty(); public SignalEmpty signalLeave = new SignalEmpty();
@EwolSignal(name = "value", description = "The button value change") @AknotSignal
@AknotName(value = "value")
@AknotDescription("The button value change")
public Signal<Boolean> signalValue = new Signal<>(); public Signal<Boolean> signalValue = new Signal<>();
private boolean buttonPressed = false; private boolean buttonPressed = false;
@ -165,42 +177,42 @@ public class Button extends ContainerToggle {
changeStatusIn(GuiShapeMode.NONE); changeStatusIn(GuiShapeMode.NONE);
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "config") @AknotName(value = "config")
@EwolDescription(value = "configuration of the widget") @AknotDescription(value = "configuration of the widget")
public Uri getPropertyConfig() { public Uri getPropertyConfig() {
return this.propertyConfig; return this.propertyConfig;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "lock") @AknotName(value = "lock")
@EwolDescription(value = "Lock the button in a special state to permit changing state only by the coder") @AknotDescription(value = "Lock the button in a special state to permit changing state only by the coder")
public ButtonLock getPropertyLock() { public ButtonLock getPropertyLock() {
return this.propertyLock; return this.propertyLock;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "value") @AknotName(value = "value")
@EwolDescription(value = "Value display in the entry (decorated text)") @AknotDescription(value = "Value display in the entry (decorated text)")
public boolean getPropertyValue() { public boolean getPropertyValue() {
return this.propertyValue; return this.propertyValue;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "enable-single") @AknotName(value = "enable-single")
@EwolDescription(value = "If one element set in the Button ==> display only set") @AknotDescription(value = "If one element set in the Button ==> display only set")
public boolean isPropertyEnableSingle() { public boolean isPropertyEnableSingle() {
return this.propertyEnableSingle; return this.propertyEnableSingle;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "toggle") @AknotName(value = "toggle")
@EwolDescription(value = "The button can toggle") @AknotDescription(value = "The button can toggle")
public boolean isPropertyToggleMode() { public boolean isPropertyToggleMode() {
return this.propertyToggleMode; return this.propertyToggleMode;
} }

View File

@ -1,16 +1,16 @@
package org.atriasoft.ewol.widget; package org.atriasoft.ewol.widget;
import org.atriasoft.aknot.annotation.AknotDescription;
import org.atriasoft.aknot.annotation.AknotManaged;
import org.atriasoft.aknot.annotation.AknotName;
import org.atriasoft.aknot.annotation.AknotSignal;
import org.atriasoft.aknot.annotation.AknotAttribute;
import org.atriasoft.aknot.annotation.AknotText;
import org.atriasoft.esignal.Signal; import org.atriasoft.esignal.Signal;
import org.atriasoft.esignal.SignalEmpty; import org.atriasoft.esignal.SignalEmpty;
import org.atriasoft.etk.math.Vector3b; import org.atriasoft.etk.math.Vector3b;
import org.atriasoft.ewol.Gravity; import org.atriasoft.ewol.Gravity;
import org.atriasoft.ewol.annotation.EwolDescription;
import org.atriasoft.ewol.annotation.EwolSignal;
import org.atriasoft.ewol.widget.Sizer.DisplayMode; import org.atriasoft.ewol.widget.Sizer.DisplayMode;
import org.atriasoft.exml.annotation.XmlAttribute;
import org.atriasoft.exml.annotation.XmlManaged;
import org.atriasoft.exml.annotation.XmlName;
import org.atriasoft.exml.annotation.XmlText;
public class CheckBox extends Container { public class CheckBox extends Container {
@ -35,13 +35,21 @@ public class CheckBox extends Container {
self.signalValue.emit(value); self.signalValue.emit(value);
} }
@EwolSignal(name = "down", description = "CheckBox is Down") @AknotSignal
@AknotName("down")
@AknotDescription("CheckBox is Down")
public SignalEmpty signalDown = new SignalEmpty(); public SignalEmpty signalDown = new SignalEmpty();
@EwolSignal(name = "up", description = "CheckBox is Up") @AknotSignal
@AknotName("up")
@AknotDescription("CheckBox is Up")
public SignalEmpty signalUp = new SignalEmpty(); public SignalEmpty signalUp = new SignalEmpty();
@EwolSignal(name = "click", description = "CheckBox is Clicked") @AknotSignal
@AknotName("click")
@AknotDescription("CheckBox is Clicked")
public SignalEmpty signalClick = new SignalEmpty(); public SignalEmpty signalClick = new SignalEmpty();
@EwolSignal(name = "value", description = "CheckBox value change") @AknotSignal
@AknotName("value")
@AknotDescription("CheckBox value change")
public Signal<Boolean> signalValue = new Signal<>(); public Signal<Boolean> signalValue = new Signal<>();
final Tick tick; final Tick tick;
final Label label; final Label label;
@ -74,18 +82,18 @@ public class CheckBox extends Container {
this.label.signalPressed.connectAuto(this, CheckBox::eventLabelClick); this.label.signalPressed.connectAuto(this, CheckBox::eventLabelClick);
} }
@XmlManaged @AknotManaged
@XmlText @AknotText
@XmlName(value = "label") @AknotName(value = "label")
@EwolDescription(value = "value of the label") @AknotDescription(value = "value of the label")
public String getPropertyLabel() { public String getPropertyLabel() {
return this.label.getPropertyValue(); return this.label.getPropertyValue();
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "value") @AknotName(value = "value")
@EwolDescription(value = "State of the checkbox") @AknotDescription(value = "State of the checkbox")
public Boolean getPropertyValue() { public Boolean getPropertyValue() {
return this.tick.getPropertyValue(); return this.tick.getPropertyValue();
} }

View File

@ -1,23 +1,23 @@
/* package org.atriasoft.ewol.widget;
import org.atriasoft.aknot.annotation.AknotAttribute;
import org.atriasoft.aknot.annotation.AknotDescription;
/**
* @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)
*/ */
package org.atriasoft.ewol.widget; import org.atriasoft.aknot.annotation.AknotManaged;
import org.atriasoft.aknot.annotation.AknotName;
import org.atriasoft.etk.Dimension3f; import org.atriasoft.etk.Dimension3f;
import org.atriasoft.etk.Uri; import org.atriasoft.etk.Uri;
import org.atriasoft.etk.math.Vector3b; import org.atriasoft.etk.math.Vector3b;
import org.atriasoft.etk.math.Vector3f; import org.atriasoft.etk.math.Vector3f;
import org.atriasoft.ewol.DrawProperty; import org.atriasoft.ewol.DrawProperty;
import org.atriasoft.ewol.Gravity; import org.atriasoft.ewol.Gravity;
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.Exml; import org.atriasoft.exml.Exml;
import org.atriasoft.exml.annotation.XmlAttribute;
import org.atriasoft.exml.annotation.XmlManaged;
import org.atriasoft.exml.annotation.XmlName;
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;
@ -301,10 +301,10 @@ public class Composer extends Container {
return super.getPropertyMinSize(); return super.getPropertyMinSize();
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "sub-file") @AknotName(value = "sub-file")
@EwolDescription(value = "compose with a subXML file") @AknotDescription(value = "compose with a subXML file")
public Uri getPropertySubFile() { public Uri getPropertySubFile() {
return this.propertySubFile; return this.propertySubFile;
} }
@ -351,10 +351,10 @@ public class Composer extends Container {
return super.isFocused(); return super.isFocused();
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "remove-if-under-remove") @AknotName(value = "remove-if-under-remove")
@EwolDescription(value = "Demand the remove iof the widget if the subObject demand a remove") @AknotDescription(value = "Demand the remove iof the widget if the subObject demand a remove")
public boolean isPropertyRemoveIfUnderRemove() { public boolean isPropertyRemoveIfUnderRemove() {
return this.propertyRemoveIfUnderRemove; return this.propertyRemoveIfUnderRemove;
} }

View File

@ -5,15 +5,15 @@
*/ */
package org.atriasoft.ewol.widget; package org.atriasoft.ewol.widget;
import org.atriasoft.aknot.annotation.AknotAttribute;
import org.atriasoft.aknot.annotation.AknotDescription;
import org.atriasoft.aknot.annotation.AknotFactory;
import org.atriasoft.aknot.annotation.AknotManaged;
import org.atriasoft.etk.math.Vector3b; import org.atriasoft.etk.math.Vector3b;
import org.atriasoft.etk.math.Vector3f; import org.atriasoft.etk.math.Vector3f;
import org.atriasoft.ewol.DrawProperty; import org.atriasoft.ewol.DrawProperty;
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.XmlFactory;
import org.atriasoft.exml.annotation.XmlManaged;
/* /*
* @ingroup ewolWidgetGroup * @ingroup ewolWidgetGroup
@ -65,10 +65,10 @@ public class Container extends Widget {
* get the main node widget * get the main node widget
* @return the requested pointer on the node * @return the requested pointer on the node
*/ */
@XmlManaged @AknotManaged
@XmlAttribute(false) @AknotAttribute(false)
@XmlFactory(WidgetXmlFactory.class) @AknotFactory(WidgetXmlFactory.class)
@EwolDescription(value = "Sub-node with multiple names...") @AknotDescription(value = "Sub-node with multiple names...")
public Widget getSubWidget() { public Widget getSubWidget() {
return this.subWidget; return this.subWidget;
} }

View File

@ -10,16 +10,16 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.ListIterator; import java.util.ListIterator;
import org.atriasoft.aknot.annotation.AknotAttribute;
import org.atriasoft.aknot.annotation.AknotDescription;
import org.atriasoft.aknot.annotation.AknotFactory;
import org.atriasoft.aknot.annotation.AknotManaged;
import org.atriasoft.aknot.annotation.AknotName;
import org.atriasoft.etk.math.Vector3b; import org.atriasoft.etk.math.Vector3b;
import org.atriasoft.etk.math.Vector3f; import org.atriasoft.etk.math.Vector3f;
import org.atriasoft.ewol.DrawProperty; import org.atriasoft.ewol.DrawProperty;
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.XmlFactory;
import org.atriasoft.exml.annotation.XmlManaged;
import org.atriasoft.exml.annotation.XmlName;
/** /**
* @ingroup ewolWidgetGroup * @ingroup ewolWidgetGroup
@ -88,10 +88,10 @@ public class ContainerN extends Widget {
} }
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "lock") @AknotName(value = "lock")
@EwolDescription(value = "Lock the subwidget expand") @AknotDescription(value = "Lock the subwidget expand")
public Vector3b getPropertyLockExpand() { public Vector3b getPropertyLockExpand() {
return this.propertyLockExpand; return this.propertyLockExpand;
} }
@ -113,9 +113,9 @@ public class ContainerN extends Widget {
return null; return null;
} }
@XmlManaged @AknotManaged
@XmlFactory(value = WidgetXmlFactory.class) @AknotFactory(value = WidgetXmlFactory.class)
@EwolDescription(value = "Request the widget Expand size while free space is detected (does not generate expand in upper widget)") @AknotDescription(value = "Request the widget Expand size while free space is detected (does not generate expand in upper widget)")
public List<Widget> getSubWidgets() { public List<Widget> getSubWidgets() {
return this.subWidget; return this.subWidget;
} }

View File

@ -5,14 +5,14 @@
*/ */
package org.atriasoft.ewol.widget; package org.atriasoft.ewol.widget;
import org.atriasoft.aknot.annotation.AknotDescription;
import org.atriasoft.aknot.annotation.AknotFactory;
import org.atriasoft.aknot.annotation.AknotManaged;
import org.atriasoft.etk.math.Vector3f; import org.atriasoft.etk.math.Vector3f;
import org.atriasoft.ewol.DrawProperty; import org.atriasoft.ewol.DrawProperty;
import org.atriasoft.ewol.Padding; import org.atriasoft.ewol.Padding;
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.XmlFactory;
import org.atriasoft.exml.annotation.XmlManaged;
/* /*
* @ingroup ewolWidgetGroup * @ingroup ewolWidgetGroup
@ -79,9 +79,9 @@ public class ContainerToggle extends Widget {
return null; return null;
} }
@XmlManaged @AknotManaged
@XmlFactory(value = WidgetXmlFactory.class) @AknotFactory(value = WidgetXmlFactory.class)
@EwolDescription(value = "Request the widget Expand size while free space is detected (does not generate expand in upper widget)") @AknotDescription(value = "Request the widget Expand size while free space is detected (does not generate expand in upper widget)")
public Widget[] getSubWidgets() { public Widget[] getSubWidgets() {
return this.subWidget; return this.subWidget;
} }
@ -157,7 +157,7 @@ public class ContainerToggle extends Widget {
onChangeSize(); onChangeSize();
} }
@XmlManaged(value = false) @AknotManaged(value = false)
public void setSubWidget(final Widget newWidget) { public void setSubWidget(final Widget newWidget) {
setSubWidget(newWidget, 0); setSubWidget(newWidget, 0);
} }

View File

@ -5,17 +5,17 @@
*/ */
package org.atriasoft.ewol.widget; package org.atriasoft.ewol.widget;
import org.atriasoft.aknot.annotation.AknotAttribute;
import org.atriasoft.aknot.annotation.AknotDescription;
import org.atriasoft.aknot.annotation.AknotManaged;
import org.atriasoft.aknot.annotation.AknotName;
import org.atriasoft.etk.Uri; import org.atriasoft.etk.Uri;
import org.atriasoft.etk.math.Vector3f; import org.atriasoft.etk.math.Vector3f;
import org.atriasoft.ewol.DrawProperty; import org.atriasoft.ewol.DrawProperty;
import org.atriasoft.ewol.Padding; import org.atriasoft.ewol.Padding;
import org.atriasoft.ewol.annotation.EwolDescription;
import org.atriasoft.ewol.compositing.GuiShape; import org.atriasoft.ewol.compositing.GuiShape;
import org.atriasoft.ewol.compositing.ShapeBox; import org.atriasoft.ewol.compositing.ShapeBox;
import org.atriasoft.ewol.internal.Log; import org.atriasoft.ewol.internal.Log;
import org.atriasoft.exml.annotation.XmlAttribute;
import org.atriasoft.exml.annotation.XmlManaged;
import org.atriasoft.exml.annotation.XmlName;
/** /**
* Simple Container that have a Shape (not directly instantiate!!!!) * Simple Container that have a Shape (not directly instantiate!!!!)
@ -50,10 +50,10 @@ public class ContainerWithShape extends Container {
Log.warning("[{}] Result min size : {}", getId(), this.minSize); Log.warning("[{}] Result min size : {}", getId(), this.minSize);
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "shape") @AknotName(value = "shape")
@EwolDescription(value = "The uri one the shape for the Pop-up") @AknotDescription(value = "The uri one the shape for the Pop-up")
public Uri getPropertyShape() { public Uri getPropertyShape() {
return this.propertyShape; return this.propertyShape;
} }

View File

@ -3,6 +3,11 @@ package org.atriasoft.ewol.widget;
import java.util.Arrays; import java.util.Arrays;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.atriasoft.aknot.annotation.AknotAttribute;
import org.atriasoft.aknot.annotation.AknotDescription;
import org.atriasoft.aknot.annotation.AknotManaged;
import org.atriasoft.aknot.annotation.AknotName;
import org.atriasoft.aknot.annotation.AknotSignal;
import org.atriasoft.esignal.Connection; import org.atriasoft.esignal.Connection;
import org.atriasoft.esignal.Signal; import org.atriasoft.esignal.Signal;
import org.atriasoft.esignal.SignalEmpty; import org.atriasoft.esignal.SignalEmpty;
@ -10,8 +15,6 @@ import org.atriasoft.etk.Uri;
import org.atriasoft.etk.math.FMath; import org.atriasoft.etk.math.FMath;
import org.atriasoft.etk.math.Vector3f; import org.atriasoft.etk.math.Vector3f;
import org.atriasoft.ewol.Padding; import org.atriasoft.ewol.Padding;
import org.atriasoft.ewol.annotation.EwolDescription;
import org.atriasoft.ewol.annotation.EwolSignal;
import org.atriasoft.ewol.compositing.CompositingText; import org.atriasoft.ewol.compositing.CompositingText;
import org.atriasoft.ewol.compositing.GuiShape; import org.atriasoft.ewol.compositing.GuiShape;
import org.atriasoft.ewol.compositing.GuiShapeMode; import org.atriasoft.ewol.compositing.GuiShapeMode;
@ -20,9 +23,6 @@ import org.atriasoft.ewol.event.EventInput;
import org.atriasoft.ewol.event.EventTime; import org.atriasoft.ewol.event.EventTime;
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.XmlManaged;
import org.atriasoft.exml.annotation.XmlName;
import org.atriasoft.gale.context.ClipBoard; import org.atriasoft.gale.context.ClipBoard;
import org.atriasoft.gale.context.ClipboardList; import org.atriasoft.gale.context.ClipboardList;
import org.atriasoft.gale.key.KeyKeyboard; import org.atriasoft.gale.key.KeyKeyboard;
@ -84,12 +84,18 @@ public class Entry extends Widget {
private Pattern regex = null; //!< regular expression to check content private Pattern regex = null; //!< regular expression to check content
private GuiShape shape; private GuiShape shape;
//.create() //.create()
@EwolSignal(name = "click", description = "the user Click on the Entry box") @AknotSignal
@AknotName(value = "click")
@AknotDescription("the user Click on the Entry box")
public SignalEmpty signalClick = new SignalEmpty(); //!< bang on click the entry box public SignalEmpty signalClick = new SignalEmpty(); //!< bang on click the entry box
@EwolSignal(name = "enter", description = "The cursor enter inside the button") @AknotSignal
@AknotName(value = "enter")
@AknotDescription("The cursor enter inside the button")
public Signal<String> signalEnter = new Signal<>(); //!< Enter key is pressed public Signal<String> signalEnter = new Signal<>(); //!< Enter key is pressed
@EwolSignal(name = "modify", description = "Entry box value change") @AknotSignal
@AknotName(value = "modify")
@AknotDescription("Entry box value change")
public Signal<String> signalModify = new Signal<>(); //!< data change public Signal<String> signalModify = new Signal<>(); //!< data change
// element over: // element over:
Vector3f overPositionStart = Vector3f.ZERO; Vector3f overPositionStart = Vector3f.ZERO;
@ -97,7 +103,7 @@ public class Entry extends Widget {
Vector3f overPositionStop = Vector3f.ZERO; Vector3f overPositionStop = Vector3f.ZERO;
/** /**
* Contuctor * Constructor
* @param _newData The USting that might be set in the Entry box (no event generation!!) * @param _newData The USting that might be set in the Entry box (no event generation!!)
*/ */
public Entry() { public Entry() {
@ -651,10 +657,10 @@ public class Entry extends Widget {
markToRedraw(); markToRedraw();
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "config") @AknotName(value = "config")
@EwolDescription(value = "configuration of the widget") @AknotDescription(value = "configuration of the widget")
public void setPropertyConfig(final Uri propertyConfig) { public void setPropertyConfig(final Uri propertyConfig) {
if (this.propertyConfig.equals(propertyConfig)) { if (this.propertyConfig.equals(propertyConfig)) {
return; return;
@ -663,10 +669,10 @@ public class Entry extends Widget {
onChangePropertyShaper(); onChangePropertyShaper();
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "max") @AknotName(value = "max")
@EwolDescription(value = "Maximum char that can be set on the Entry") @AknotDescription(value = "Maximum char that can be set on the Entry")
public void setPropertyMaxCharacter(final int propertyMaxCharacter) { public void setPropertyMaxCharacter(final int propertyMaxCharacter) {
if (this.propertyMaxCharacter == propertyMaxCharacter) { if (this.propertyMaxCharacter == propertyMaxCharacter) {
return; return;
@ -675,10 +681,10 @@ public class Entry extends Widget {
onChangePropertyMaxCharacter(); onChangePropertyMaxCharacter();
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "password") @AknotName(value = "password")
@EwolDescription(value = "Not display content in password mode") @AknotDescription(value = "Not display content in password mode")
public void setPropertyPassword(final boolean propertyPassword) { public void setPropertyPassword(final boolean propertyPassword) {
if (this.propertyPassword == propertyPassword) { if (this.propertyPassword == propertyPassword) {
return; return;
@ -687,10 +693,10 @@ public class Entry extends Widget {
onChangePropertyPassword(); onChangePropertyPassword();
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "regex") @AknotName(value = "regex")
@EwolDescription(value = "Control what it is write with a regular expression") @AknotDescription(value = "Control what it is write with a regular expression")
public void setPropertyRegex(final String propertyRegex) { public void setPropertyRegex(final String propertyRegex) {
if (this.propertyRegex.equals(propertyRegex)) { if (this.propertyRegex.equals(propertyRegex)) {
return; return;
@ -699,10 +705,10 @@ public class Entry extends Widget {
onChangePropertyRegex(); onChangePropertyRegex();
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "empty-text") @AknotName(value = "empty-text")
@EwolDescription(value = "Text when nothing is written") @AknotDescription(value = "Text when nothing is written")
public void setPropertyTextWhenNothing(final String propertyTextWhenNothing) { public void setPropertyTextWhenNothing(final String propertyTextWhenNothing) {
if (this.propertyTextWhenNothing.equals(propertyTextWhenNothing)) { if (this.propertyTextWhenNothing.equals(propertyTextWhenNothing)) {
return; return;
@ -711,10 +717,10 @@ public class Entry extends Widget {
onChangePropertyTextWhenNothing(); onChangePropertyTextWhenNothing();
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "value") @AknotName(value = "value")
@EwolDescription(value = "Value display in the entry (decorated text)") @AknotDescription(value = "Value display in the entry (decorated text)")
public void setPropertyValue(final String propertyValue) { public void setPropertyValue(final String propertyValue) {
if (this.propertyValue.equals(propertyValue)) { if (this.propertyValue.equals(propertyValue)) {
return; return;

View File

@ -0,0 +1,420 @@
/*
* @author Edouard DUPIN
* @copyright 2011, Edouard DUPIN, all right reserved
* @license MPL v2.0 (see license file)
*/
package org.atriasoft.ewol.widget;
import java.util.ArrayList;
import java.util.List;
import org.atriasoft.etk.math.Vector3f;
import org.atriasoft.ewol.DrawProperty;
import org.atriasoft.ewol.internal.Log;
/**
* @ingroup ewolWidgetGroup
*/
class Gird extends Widget {
protected class GirdProperties {
public Widget widget;
public int row;
public int col;
}
protected int sizeRow = 0; //!< size of all lines (row) (if set (otherwise 0)) == > we have a only one size ==> multiple size will have no use ...
protected int uniformSizeRow = 0;
protected List<Integer> sizeCol = new ArrayList<>(); //!< size of all colomn (if set (otherwise 0))
protected List<GirdProperties> subWidget = new ArrayList<>(); //!< all sub widget are contained in this element
protected Widget tmpWidget = null; //!< use when replace a widget ...
protected boolean gavityButtom = true;
protected Vector3f propertyBorderSize = Vector3f.ZERO; //!< Border size needed for all the display
/**
* Constructor
*/
public Gird() {
}
@Override
public void calculateMinMaxSize() {
for (int iii = 0; iii < this.sizeCol.size(); iii++) {
if (this.sizeCol.get(iii) <= 0) {
this.sizeCol.set(iii, 0);
}
}
//Log.debug("Update minimum size");
this.minSize = this.propertyMinSize.getPixel();
this.maxSize = this.propertyMaxSize.getPixel();
this.uniformSizeRow = 0;
this.minSize = this.minSize.add(this.propertyBorderSize.multiply(2));
int lastLineID = 0;
for (int iii = 0; iii < this.subWidget.size(); iii++) {
if (this.subWidget.get(iii).row > lastLineID) {
// change of line :
lastLineID = this.subWidget.get(iii).row;
}
if (this.subWidget.get(iii).widget != null) {
this.subWidget.get(iii).widget.calculateMinMaxSize();
final Vector3f tmpSize = this.subWidget.get(iii).widget.getCalculateMinSize();
Log.debug(" [" + iii + "] subWidgetMinSize=" + tmpSize);
// for all we get the max size :
this.uniformSizeRow = Math.max((int) tmpSize.y(), this.uniformSizeRow);
// for the colomn size : We set the autamatic value in negative :
if (this.sizeCol.get(this.subWidget.get(iii).col) <= 0) {
this.sizeCol.set(this.subWidget.get(iii).col, Math.min(this.sizeCol.get(this.subWidget.get(iii).col), (int) -tmpSize.x()));
}
}
}
if (this.sizeRow > 0) {
this.uniformSizeRow = this.sizeRow;
}
int tmpSizeWidth = 0;
for (int iii = 0; iii < this.sizeCol.size(); iii++) {
tmpSizeWidth += Math.abs(this.sizeCol.get(iii));
}
Log.debug(" tmpSizeWidth=" + tmpSizeWidth);
Log.debug(" this.uniformSizeRow=" + this.uniformSizeRow);
this.minSize = this.minSize.add(tmpSizeWidth, (lastLineID + 1) * this.uniformSizeRow, 0);
Log.debug("Calculate min size : " + this.minSize);
//Log.debug("Vert Result : expand="+ this.userExpand + " minSize="+ this.minSize);
}
/**
* get the current border size of the current element:
* @return the border size (0 if not used)
*/
public Vector3f getBorderSize() {
return this.propertyBorderSize;
}
/**
* get the size view of a colomn.
* @param colId Id of the colomn [0..x].
* @return The size of the colomn.
*/
public int getColSize(final int colId) {
if ((long) this.sizeCol.size() > colId) {
if (this.sizeCol.get(colId) <= 0) {
return 0;
}
return this.sizeCol.get(colId);
}
Log.error("Can not get the Colomn size : " + colId + 1 + " we have " + this.sizeCol.size() + " colomn");
return 0;
}
public Vector3f getPropertyBorderSize() {
return this.propertyBorderSize;
}
/**
* get the size view of the lines.
* @return The size of the lines.
*/
public int getRowSize() {
return this.sizeRow;
}
@Override
public Widget getWidgetAtPos(final Vector3f pos) {
if (this.propertyHide) {
return null;
}
// for all element in the sizer ...
for (final GirdProperties it : this.subWidget) {
if (it.widget == null) {
continue;
}
final Vector3f tmpSize = it.widget.getSize();
final Vector3f tmpOrigin = it.widget.getOrigin();
if ((tmpOrigin.x() <= pos.x() && tmpOrigin.x() + tmpSize.x() >= pos.x()) && (tmpOrigin.y() <= pos.y() && tmpOrigin.y() + tmpSize.y() >= pos.y())) {
final Widget tmpWidget = it.widget.getWidgetAtPos(pos);
if (tmpWidget != null) {
return tmpWidget;
}
// stop searching
break;
}
}
return null;
}
@Override
public void onChangeSize() {
//Log.debug("Update size");
this.size = this.size.less(this.propertyBorderSize.x() * 2, this.propertyBorderSize.y() * 2, this.propertyBorderSize.y() * 2);
for (int iii = 0; iii < this.subWidget.size(); iii++) {
if (this.subWidget.get(iii).widget != null) {
//calculate the origin :
Vector3f tmpOrigin = this.origin.add(this.propertyBorderSize);
if (!this.gavityButtom) {
tmpOrigin = tmpOrigin.add(0, this.size.y() - this.propertyBorderSize.y(), 0);
}
int tmpSizeWidth = 0;
for (int jjj = 0; jjj < this.subWidget.get(iii).col; jjj++) {
tmpSizeWidth += Math.abs(this.sizeCol.get(jjj));
}
// adding Y origin :
int addingPos = 0;
if (this.gavityButtom) {
addingPos = (this.subWidget.get(iii).row) * this.uniformSizeRow;
} else {
addingPos = -(this.subWidget.get(iii).row + 1) * this.uniformSizeRow;
}
tmpOrigin = tmpOrigin.add(tmpSizeWidth, addingPos, 0);
Log.debug(" [{}] set subwidget origin={} size={}", iii, tmpOrigin, new Vector3f(Math.abs(this.sizeCol.get(this.subWidget.get(iii).col)), this.uniformSizeRow, 0));
// set the origin :
this.subWidget.get(iii).widget.setOrigin(tmpOrigin.clipInteger());
// all time set all the space .
this.subWidget.get(iii).widget.setSize((new Vector3f(Math.abs(this.sizeCol.get(this.subWidget.get(iii).col)), this.uniformSizeRow, 0)).clipInteger());
this.subWidget.get(iii).widget.onChangeSize();
}
}
this.size = this.size.add(this.propertyBorderSize.multiply(0.5f));
Log.debug("Calculate size : " + this.size);
markToRedraw();
}
@Override
public void onRegenerateDisplay() {
for (final GirdProperties it : this.subWidget) {
if (it.widget != null) {
it.widget.onRegenerateDisplay();
}
}
}
/**
* set the current border size of the current element:
* @param newBorderSize The border size to set (0 if not used)
*/
public void setBorderSize(final Vector3f newBorderSize) {
this.propertyBorderSize = newBorderSize;
}
/**
* set the number of colomn
* @param colNumber Nuber of colomn
*/
public void setColNumber(final int colNumber) {
if ((long) this.sizeCol.size() > colNumber) {
int errorControl = this.subWidget.size();
// remove subWidget :
for (int iii = this.subWidget.size(); iii >= 0; iii--) {
if (this.subWidget.get(iii).col > (colNumber - 1)) {
// out of bounds : must remove it ...
if (this.subWidget.get(iii).widget != null) {
this.subWidget.get(iii).widget = null;
// no remove, this element is removed with the function onObjectRemove == > it does not exist anymore ...
if (errorControl == this.subWidget.size()) {
Log.critical(
"[" + getId() + "] The number of element might have been reduced ... == > it is not the case ==> the herited class must call the \"OnObjectRemove\" function...");
}
} else {
Log.warning("[" + getId() + "] Must not have null pointer on the subWidget list ...");
this.subWidget.remove(iii);
}
errorControl = this.subWidget.size();
}
}
// just add the col size:
this.sizeCol.remove(this.sizeCol.size() - 1);
} else {
// just add the col size:
for (int iii = this.sizeCol.size() - 1; iii < colNumber - 1; iii++) {
this.sizeCol.add(0);
}
}
}
/**
* change a size view of a colomn.
* @param colId Id of the colomn [0..x].
* @param size size of the colomn.
*/
public void setColSize(final int colId, final int size) {
if ((long) this.sizeCol.size() > colId) {
this.sizeCol.set(colId, size);
} else {
Log.error("Can not set the Colomn size : " + colId + 1 + " at " + size + "px we have " + this.sizeCol.size() + " colomn");
}
}
/**
* set the gravity of the widget on the Button (index 0 is on buttom)
*/
public void setGravityButtom() {
this.gavityButtom = true;
markToRedraw();
}
/**
* set the gravity of the widget on the Top (index 0 is on top)
*/
public void setGravityTop() {
this.gavityButtom = false;
markToRedraw();
}
public void setPropertyBorderSize(final Vector3f propertyBorderSize) {
this.propertyBorderSize = propertyBorderSize;
if (this.propertyBorderSize.x() < 0) {
Log.error("Try to set a border size <0 on x : " + this.propertyBorderSize.x() + " == > restore to 0");
this.propertyBorderSize = this.propertyBorderSize.withX(0);
}
if (this.propertyBorderSize.y() < 0) {
Log.error("Try to set a border size <0 on y : " + this.propertyBorderSize.y() + " == > restore to 0");
this.propertyBorderSize = this.propertyBorderSize.withY(0);
}
markToRedraw();
requestUpdateSize();
}
/**
* change a size view of a line.
* @param size size of the line.
*/
public void setRowSize(final int size) {
this.sizeRow = size;
}
/**
* add at end position a Widget (note : This system use an inverted phylisophie (button to top, and left to right)
* @param colId Id of the colomn [0..x].
* @param rowId Id of the row [0..y].
* @param newWidget the element pointer
*/
public void subWidgetAdd(final int colId, final int rowId, final Widget newWidget) {
if (newWidget == null) {
return;
}
final GirdProperties prop = new GirdProperties();
prop.row = rowId;
prop.col = colId;
prop.widget = newWidget;
// need to find the correct position :
for (int iii = 0; iii < this.subWidget.size(); iii++) {
if (this.subWidget.get(iii).row < prop.row) {
continue;
} else if (this.subWidget.get(iii).row > prop.row) {
// find a new position;
this.subWidget.add(iii, prop);
return;
} else {
if (this.subWidget.get(iii).col < prop.col) {
continue;
} else if (this.subWidget.get(iii).col > prop.col) {
// find a new position;
this.subWidget.add(iii, prop);
return;
} else {
// The element already exist == > replace it ...
this.tmpWidget = this.subWidget.get(iii).widget;
this.subWidget.get(iii).widget = newWidget;
this.tmpWidget = null;
}
}
}
// not find == > just adding it ...
this.subWidget.add(prop);
}
/**
* remove definitly a widget from the system and this Gird.
* @param colId Id of the colomn [0..x].
* @param rowId Id of the row [0..y].
*/
public void subWidgetRemove(final int colId, final int rowId) {
if (colId < 0 || rowId < 0) {
Log.warning("[" + getId() + "] try to remove widget with id < 0 col=" + colId + " row=" + rowId);
return;
}
final int errorControl = this.subWidget.size();
// try to find it ...
for (int iii = 0; iii < this.subWidget.size(); iii++) {
if (this.subWidget.get(iii).row == rowId && this.subWidget.get(iii).col == colId) {
this.subWidget.remove(iii);
return;
}
}
Log.warning("[" + getId() + "] Can not remove unExistant widget");
}
/**
* remove definitly a widget from the system and this Gird.
* @param newWidget the element pointer.
*/
public void subWidgetRemove(final Widget newWidget) {
for (int iii = 0; iii < this.subWidget.size(); iii++) {
if (newWidget == this.subWidget.get(iii).widget) {
this.subWidget.remove(iii);
return;
}
}
Log.warning("[" + getId() + "] Can not remove unExistant widget");
}
/**
* remove all sub element from the widget.
*/
public void subWidgetRemoveAll() {
final int errorControl = this.subWidget.size();
this.subWidget.clear();
}
/**
* Just unlick the specify widget, this function does not remove it from the system (if you can, do nt use it ...).
* @param colId Id of the colomn [0..x].
* @param rowId Id of the row [0..y].
*/
public void subWidgetUnLink(final int colId, final int rowId) {
if (colId < 0 || rowId < 0) {
Log.warning("[" + getId() + "] try to Unlink widget with id < 0 col=" + colId + " row=" + rowId);
return;
}
// try to find it ...
for (int iii = 0; iii < this.subWidget.size(); iii++) {
if (this.subWidget.get(iii).row == rowId && this.subWidget.get(iii).col == colId) {
this.subWidget.remove(iii);
return;
}
}
Log.warning("[" + getId() + "] Can not unLink unExistant widget");
}
/**
* Just unlick the specify widget, this function does not remove it from the system (if you can, do nt use it ...).
* @param newWidget the element pointer.
*/
public void subWidgetUnLink(final Widget newWidget) {
if (newWidget == null) {
return;
}
for (int iii = 0; iii < this.subWidget.size(); iii++) {
if (newWidget == this.subWidget.get(iii).widget) {
this.subWidget.remove(iii);
return;
}
}
}
@Override
public void systemDraw(final DrawProperty displayProp) {
super.systemDraw(displayProp);
for (final GirdProperties it : this.subWidget) {
if (it.widget != null) {
it.widget.systemDraw(displayProp);
}
}
}
}

View File

@ -5,6 +5,11 @@
*/ */
package org.atriasoft.ewol.widget; package org.atriasoft.ewol.widget;
import org.atriasoft.aknot.annotation.AknotAttribute;
import org.atriasoft.aknot.annotation.AknotDescription;
import org.atriasoft.aknot.annotation.AknotManaged;
import org.atriasoft.aknot.annotation.AknotName;
import org.atriasoft.aknot.annotation.AknotSignal;
import org.atriasoft.egami.ImageByteRGBA; import org.atriasoft.egami.ImageByteRGBA;
import org.atriasoft.esignal.SignalEmpty; import org.atriasoft.esignal.SignalEmpty;
import org.atriasoft.etk.Dimension2f; import org.atriasoft.etk.Dimension2f;
@ -12,15 +17,10 @@ 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.etk.math.Vector3f; import org.atriasoft.etk.math.Vector3f;
import org.atriasoft.ewol.annotation.EwolDescription;
import org.atriasoft.ewol.annotation.EwolSignal;
import org.atriasoft.ewol.compositing.CompositingImage; import org.atriasoft.ewol.compositing.CompositingImage;
import org.atriasoft.ewol.event.EventInput; import org.atriasoft.ewol.event.EventInput;
import org.atriasoft.ewol.internal.Log; import org.atriasoft.ewol.internal.Log;
import org.atriasoft.ewol.resource.ResourceColorFile; import org.atriasoft.ewol.resource.ResourceColorFile;
import org.atriasoft.exml.annotation.XmlAttribute;
import org.atriasoft.exml.annotation.XmlManaged;
import org.atriasoft.exml.annotation.XmlName;
import org.atriasoft.gale.key.KeyStatus; import org.atriasoft.gale.key.KeyStatus;
public class ImageDisplay extends Widget { public class ImageDisplay extends Widget {
@ -38,8 +38,9 @@ public class ImageDisplay extends Widget {
protected boolean propertySmooth = true; //!< display is done in the pixel approximation if false protected boolean propertySmooth = true; //!< display is done in the pixel approximation if false
protected Uri propertySource = null; //!< file name of the image. protected Uri propertySource = null; //!< file name of the image.
protected boolean propertyUseThemeColor = false; //!< Use the themo color management ("THEMECOLOR:///Image.json?lib=ewol") default false protected boolean propertyUseThemeColor = false; //!< Use the themo color management ("THEMECOLOR:///Image.json?lib=ewol") default false
@EwolSignal(name = "pressed") @AknotSignal
@EwolDescription(value = "Image is pressed") @AknotName("pressed")
@AknotDescription(value = "Image is pressed")
public final SignalEmpty signalPressed = new SignalEmpty(); public final SignalEmpty signalPressed = new SignalEmpty();
/** /**
@ -50,18 +51,18 @@ public class ImageDisplay extends Widget {
@Override @Override
public void calculateMinMaxSize() { public void calculateMinMaxSize() {
Log.debug("calculate min size: border=" + this.propertyBorder + " size=" + this.propertyImageSize + " min-size=" + this.propertyMinSize); Log.debug("calculate min size: border=" + this.propertyBorder + " size=" + this.propertyImageSize + " min-size=" + this.propertyMinSize);
Vector2f imageBoder = this.propertyBorder.getPixel().multiply(2.0f); final Vector2f imageBoder = this.propertyBorder.getPixel().multiply(2.0f);
Vector2f imageSize = this.propertyImageSize.getPixel(); final Vector2f imageSize = this.propertyImageSize.getPixel();
Vector3f size = this.propertyMinSize.getPixel(); final Vector3f size = this.propertyMinSize.getPixel();
Log.debug(" ==> border=" + imageBoder + " size=" + imageSize + " min-size=" + size); Log.debug(" ==> border=" + imageBoder + " size=" + imageSize + " min-size=" + size);
if (!imageSize.isZero()) { if (!imageSize.isZero()) {
Vector2f tmp = imageBoder.add(imageSize); final Vector2f tmp = imageBoder.add(imageSize);
this.minSize = new Vector3f(tmp.x(), tmp.y(), 0); this.minSize = new Vector3f(tmp.x(), tmp.y(), 0);
this.maxSize = this.minSize; this.maxSize = this.minSize;
} else { } else {
Vector2i imageSizeReal = this.getPropertyMinSize().getPixeli();//.compositing.getRealSize(); final Vector2i imageSizeReal = this.getPropertyMinSize().getPixeli();//.compositing.getRealSize();
Log.verbose(" Real Size = " + imageSizeReal); Log.verbose(" Real Size = " + imageSizeReal);
Vector3f min1 = this.propertyMinSize.getPixel().add(imageBoder.x(), imageBoder.y(), 0); final Vector3f min1 = this.propertyMinSize.getPixel().add(imageBoder.x(), imageBoder.y(), 0);
this.minSize = new Vector3f(imageBoder.x() + imageSizeReal.x(), imageBoder.y() + imageSizeReal.y(), 0); this.minSize = new Vector3f(imageBoder.x() + imageSizeReal.x(), imageBoder.y() + imageSizeReal.y(), 0);
Log.verbose(" set max : " + this.minSize + " min1=" + min1); Log.verbose(" set max : " + this.minSize + " min1=" + min1);
this.minSize = Vector3f.max(this.minSize, min1); this.minSize = Vector3f.max(this.minSize, min1);
@ -76,66 +77,66 @@ public class ImageDisplay extends Widget {
markToRedraw(); markToRedraw();
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "border") @AknotName(value = "border")
@EwolDescription(value = "Border of the image") @AknotDescription(value = "Border of the image")
public Dimension2f getPropertyBorder() { public Dimension2f getPropertyBorder() {
return this.propertyBorder; return this.propertyBorder;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "size") @AknotName(value = "size")
@EwolDescription(value = "Basic display size of the image") @AknotDescription(value = "Basic display size of the image")
public Dimension2f getPropertyImageSize() { public Dimension2f getPropertyImageSize() {
return this.propertyImageSize; return this.propertyImageSize;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "part-start") @AknotName(value = "part-start")
@EwolDescription(value = "Start display position in the image") @AknotDescription(value = "Start display position in the image")
public Vector2f getPropertyPosStart() { public Vector2f getPropertyPosStart() {
return this.propertyPosStart; return this.propertyPosStart;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "part-stop") @AknotName(value = "part-stop")
@EwolDescription(value = "Start display position in the image") @AknotDescription(value = "Start display position in the image")
public Vector2f getPropertyPosStop() { public Vector2f getPropertyPosStop() {
return this.propertyPosStop; return this.propertyPosStop;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "src") @AknotName(value = "src")
@EwolDescription(value = "Image source path") @AknotDescription(value = "Image source path")
public Uri getPropertySource() { public Uri getPropertySource() {
return this.propertySource; return this.propertySource;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "ratio") @AknotName(value = "ratio")
@EwolDescription(value = "Keep ratio of the image") @AknotDescription(value = "Keep ratio of the image")
public boolean isPropertyKeepRatio() { public boolean isPropertyKeepRatio() {
return this.propertyKeepRatio; return this.propertyKeepRatio;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "smooth") @AknotName(value = "smooth")
@EwolDescription(value = "Smooth display of the image") @AknotDescription(value = "Smooth display of the image")
public boolean isPropertySmooth() { public boolean isPropertySmooth() {
return this.propertySmooth; return this.propertySmooth;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "use-theme-color") @AknotName(value = "use-theme-color")
@EwolDescription(value = "Use the theme color to display images") @AknotDescription(value = "Use the theme color to display images")
public boolean isPropertyUseThemeColor() { public boolean isPropertyUseThemeColor() {
return this.propertyUseThemeColor; return this.propertyUseThemeColor;
} }
@ -172,9 +173,9 @@ public class ImageDisplay extends Widget {
Vector3f origin = new Vector3f(imageBoder.x(), imageBoder.y(), 0); Vector3f origin = new Vector3f(imageBoder.x(), imageBoder.y(), 0);
imageBoder = imageBoder.multiply(2.0f); imageBoder = imageBoder.multiply(2.0f);
Vector2f imageRealSize = this.imageRenderSize.less(imageBoder); Vector2f imageRealSize = this.imageRenderSize.less(imageBoder);
Vector3f imageRealSizeMax = this.size.less(imageBoder.x(), imageBoder.y(), 0); final Vector3f imageRealSizeMax = this.size.less(imageBoder.x(), imageBoder.y(), 0);
Vector2f ratioSizeDisplayRequested = this.propertyPosStop.less(this.propertyPosStart); final Vector2f ratioSizeDisplayRequested = this.propertyPosStop.less(this.propertyPosStart);
//imageRealSizeMax *= ratioSizeDisplayRequested; //imageRealSizeMax *= ratioSizeDisplayRequested;
Vector3f delta = this.propertyGravity.gravityGenerateDelta(this.size.less(this.imageRenderSize.x(), this.imageRenderSize.y(), 0)); Vector3f delta = this.propertyGravity.gravityGenerateDelta(this.size.less(this.imageRenderSize.x(), this.imageRenderSize.y(), 0));
@ -189,19 +190,19 @@ public class ImageDisplay extends Widget {
origin = origin.add(delta); origin = origin.add(delta);
if (this.propertyKeepRatio) { if (this.propertyKeepRatio) {
Vector2i tmpSize = this.compositing.getRealSize(); final Vector2i tmpSize = this.compositing.getRealSize();
//float ratio = tmpSize.x() / tmpSize.y(); //float ratio = tmpSize.x() / tmpSize.y();
float ratio = (tmpSize.x() * ratioSizeDisplayRequested.x()) / (tmpSize.y() * ratioSizeDisplayRequested.y()); final float ratio = (tmpSize.x() * ratioSizeDisplayRequested.x()) / (tmpSize.y() * ratioSizeDisplayRequested.y());
//float ratioCurrent = (imageRealSize.x()*ratioSizeDisplayRequested.x()) / (imageRealSize.y() * ratioSizeDisplayRequested.y()); //float ratioCurrent = (imageRealSize.x()*ratioSizeDisplayRequested.x()) / (imageRealSize.y() * ratioSizeDisplayRequested.y());
float ratioCurrent = imageRealSize.x() / imageRealSize.y(); final float ratioCurrent = imageRealSize.x() / imageRealSize.y();
if (ratio == ratioCurrent) { if (ratio == ratioCurrent) {
// nothing to do ... // nothing to do ...
} else if (ratio < ratioCurrent) { } else if (ratio < ratioCurrent) {
float oldX = imageRealSize.x(); final float oldX = imageRealSize.x();
imageRealSize = imageRealSize.withX(imageRealSize.y() * ratio); imageRealSize = imageRealSize.withX(imageRealSize.y() * ratio);
origin = origin.add((oldX - imageRealSize.x()) * 0.5f, 0, 0); origin = origin.add((oldX - imageRealSize.x()) * 0.5f, 0, 0);
} else { } else {
float oldY = imageRealSize.y(); final float oldY = imageRealSize.y();
imageRealSize = imageRealSize.withY(imageRealSize.x() / ratio); imageRealSize = imageRealSize.withY(imageRealSize.x() / ratio);
origin = origin.add(0, (oldY - imageRealSize.y()) * 0.5f, 0); origin = origin.add(0, (oldY - imageRealSize.y()) * 0.5f, 0);
} }

View File

@ -5,28 +5,29 @@
*/ */
package org.atriasoft.ewol.widget; package org.atriasoft.ewol.widget;
import org.atriasoft.aknot.annotation.AknotAttribute;
import org.atriasoft.aknot.annotation.AknotDescription;
import org.atriasoft.aknot.annotation.AknotManaged;
import org.atriasoft.aknot.annotation.AknotName;
import org.atriasoft.aknot.annotation.AknotSignal;
import org.atriasoft.aknot.annotation.AknotText;
import org.atriasoft.esignal.SignalEmpty; import org.atriasoft.esignal.SignalEmpty;
import org.atriasoft.etk.Uri; import org.atriasoft.etk.Uri;
import org.atriasoft.etk.math.FMath; import org.atriasoft.etk.math.FMath;
import org.atriasoft.etk.math.Vector3f; import org.atriasoft.etk.math.Vector3f;
import org.atriasoft.etranslate.ETranslate; import org.atriasoft.etranslate.ETranslate;
import org.atriasoft.ewol.Padding; import org.atriasoft.ewol.Padding;
import org.atriasoft.ewol.annotation.EwolDescription;
import org.atriasoft.ewol.annotation.EwolSignal;
import org.atriasoft.ewol.compositing.AlignMode; import org.atriasoft.ewol.compositing.AlignMode;
import org.atriasoft.ewol.compositing.CompositingText; import org.atriasoft.ewol.compositing.CompositingText;
import org.atriasoft.ewol.event.EventInput; import org.atriasoft.ewol.event.EventInput;
import org.atriasoft.ewol.internal.Log; import org.atriasoft.ewol.internal.Log;
import org.atriasoft.ewol.resource.ResourceColorFile; import org.atriasoft.ewol.resource.ResourceColorFile;
import org.atriasoft.exml.annotation.XmlAttribute;
import org.atriasoft.exml.annotation.XmlManaged;
import org.atriasoft.exml.annotation.XmlName;
import org.atriasoft.exml.annotation.XmlText;
import org.atriasoft.gale.key.KeyStatus; import org.atriasoft.gale.key.KeyStatus;
public class Label extends Widget { public class Label extends Widget {
@EwolSignal(name = "pressed") @AknotSignal
@EwolDescription(value = "Label is pressed") @AknotName("pressed")
@AknotDescription("Label is pressed")
public SignalEmpty signalPressed = new SignalEmpty(); public SignalEmpty signalPressed = new SignalEmpty();
private String propertyValue = ""; //!< decorated text to display. private String propertyValue = ""; //!< decorated text to display.
private int propertyFontSize = 0; //!< default size of the font. private int propertyFontSize = 0; //!< default size of the font.
@ -179,10 +180,10 @@ public class Label extends Widget {
this.textCompose.flush(); this.textCompose.flush();
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "auto-translate") @AknotName(value = "auto-translate")
@EwolDescription(value = "Translate the String with the marker {T:xxxxxx}") @AknotDescription(value = "Translate the String with the marker {T:xxxxxx}")
public void setPropertyAutoTranslate(final boolean propertyAutoTranslate) { public void setPropertyAutoTranslate(final boolean propertyAutoTranslate) {
if (this.propertyAutoTranslate == propertyAutoTranslate) { if (this.propertyAutoTranslate == propertyAutoTranslate) {
return; return;
@ -197,10 +198,10 @@ public class Label extends Widget {
requestUpdateSize(); requestUpdateSize();
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "font-size") @AknotName(value = "font-size")
@EwolDescription(value = "Default font size (0=> system default)") @AknotDescription(value = "Default font size (0=> system default)")
public void setPropertyFontSize(final int propertyFontSize) { public void setPropertyFontSize(final int propertyFontSize) {
if (this.propertyFontSize == propertyFontSize) { if (this.propertyFontSize == propertyFontSize) {
return; return;
@ -210,10 +211,10 @@ public class Label extends Widget {
requestUpdateSize(); requestUpdateSize();
} }
@XmlManaged @AknotManaged
@XmlText @AknotText
@XmlName(value = "value") @AknotName(value = "value")
@EwolDescription(value = "Displayed value string") @AknotDescription(value = "Displayed value string")
public void setPropertyValue(final String propertyValue) { public void setPropertyValue(final String propertyValue) {
if (this.propertyValue.equals(propertyValue)) { if (this.propertyValue.equals(propertyValue)) {
return; return;

View File

@ -5,22 +5,22 @@
*/ */
package org.atriasoft.ewol.widget; package org.atriasoft.ewol.widget;
import org.atriasoft.aknot.annotation.AknotAttribute;
import org.atriasoft.aknot.annotation.AknotDescription;
import org.atriasoft.aknot.annotation.AknotManaged;
import org.atriasoft.aknot.annotation.AknotName;
import org.atriasoft.aknot.annotation.AknotSignal;
import org.atriasoft.esignal.SignalEmpty; import org.atriasoft.esignal.SignalEmpty;
import org.atriasoft.etk.Uri; import org.atriasoft.etk.Uri;
import org.atriasoft.etk.math.FMath; import org.atriasoft.etk.math.FMath;
import org.atriasoft.etk.math.Vector2i; import org.atriasoft.etk.math.Vector2i;
import org.atriasoft.etk.math.Vector3f; import org.atriasoft.etk.math.Vector3f;
import org.atriasoft.etranslate.ETranslate; import org.atriasoft.etranslate.ETranslate;
import org.atriasoft.ewol.annotation.EwolDescription;
import org.atriasoft.ewol.annotation.EwolSignal;
import org.atriasoft.ewol.compositing.AlignMode; import org.atriasoft.ewol.compositing.AlignMode;
import org.atriasoft.ewol.compositing.CompositingText; import org.atriasoft.ewol.compositing.CompositingText;
import org.atriasoft.ewol.event.EventInput; import org.atriasoft.ewol.event.EventInput;
import org.atriasoft.ewol.internal.Log; import org.atriasoft.ewol.internal.Log;
import org.atriasoft.ewol.resource.ResourceColorFile; import org.atriasoft.ewol.resource.ResourceColorFile;
import org.atriasoft.exml.annotation.XmlAttribute;
import org.atriasoft.exml.annotation.XmlManaged;
import org.atriasoft.exml.annotation.XmlName;
import org.atriasoft.gale.key.KeyStatus; import org.atriasoft.gale.key.KeyStatus;
public class LabelOnSVG extends Widget { public class LabelOnSVG extends Widget {
@ -31,8 +31,9 @@ public class LabelOnSVG extends Widget {
protected int propertyFontSize = 0; //!< default size of the font. protected int propertyFontSize = 0; //!< default size of the font.
protected String propertyValue = ""; //!< decorated text to display. protected String propertyValue = ""; //!< decorated text to display.
@EwolSignal(name = "pressed") @AknotSignal
@EwolDescription(value = "Label is pressed") @AknotName("pressed")
@AknotDescription("Label is pressed")
public SignalEmpty signalPressed = new SignalEmpty(); public SignalEmpty signalPressed = new SignalEmpty();
protected CompositingText text = new CompositingText(); //!< Compositing text element. protected CompositingText text = new CompositingText(); //!< Compositing text element.
protected String value = ""; protected String value = "";
@ -64,14 +65,14 @@ public class LabelOnSVG extends Widget {
@Override @Override
public void calculateMinMaxSize() { public void calculateMinMaxSize() {
Vector3f tmpMax = this.propertyMaxSize.getPixel(); final Vector3f tmpMax = this.propertyMaxSize.getPixel();
Vector3f tmpMin = this.propertyMinSize.getPixel(); final Vector3f tmpMin = this.propertyMinSize.getPixel();
Log.debug("[" + getId() + "] {" + getClass().getCanonicalName() + "} tmpMax : " + tmpMax); Log.debug("[" + getId() + "] {" + getClass().getCanonicalName() + "} tmpMax : " + tmpMax);
if (tmpMax.x() <= 999999) { if (tmpMax.x() <= 999999) {
this.text.setTextAlignment(0, tmpMax.x() - 4, AlignMode.LEFT); this.text.setTextAlignment(0, tmpMax.x() - 4, AlignMode.LEFT);
Log.debug("[" + getId() + "] {" + getClass().getCanonicalName() + "} force Alignement "); Log.debug("[" + getId() + "] {" + getClass().getCanonicalName() + "} force Alignement ");
} }
Vector3f minSize = this.text.calculateSizeDecorated(this.value); final Vector3f minSize = this.text.calculateSizeDecorated(this.value);
Log.debug("[" + getId() + "] {" + getClass().getCanonicalName() + "} minSize : " + minSize); Log.debug("[" + getId() + "] {" + getClass().getCanonicalName() + "} minSize : " + minSize);
this.minSize = new Vector3f(FMath.avg(tmpMin.x(), 4 + minSize.x(), tmpMax.x()), FMath.avg(tmpMin.y(), 4 + minSize.y(), tmpMax.y()), FMath.avg(tmpMin.z(), 4 + minSize.z(), tmpMax.z())); this.minSize = new Vector3f(FMath.avg(tmpMin.x(), 4 + minSize.x(), tmpMax.x()), FMath.avg(tmpMin.y(), 4 + minSize.y(), tmpMax.y()), FMath.avg(tmpMin.z(), 4 + minSize.z(), tmpMax.z()));
@ -114,18 +115,18 @@ public class LabelOnSVG extends Widget {
//return; //return;
} }
this.text.clear(); this.text.clear();
int paddingSize = 2; final int paddingSize = 2;
Vector3f tmpMax = this.propertyMaxSize.getPixel(); final Vector3f tmpMax = this.propertyMaxSize.getPixel();
// to know the size of one line : // to know the size of one line :
Vector3f minSize = this.text.calculateSize('A'); final Vector3f minSize = this.text.calculateSize('A');
//minSize.setX(etk::max(minSize.x(), this.minSize.x())); //minSize.setX(etk::max(minSize.x(), this.minSize.x()));
//minSize.setY(etk::max(minSize.y(), this.minSize.y())); //minSize.setY(etk::max(minSize.y(), this.minSize.y()));
if (tmpMax.x() <= 999999) { if (tmpMax.x() <= 999999) {
this.text.setTextAlignment(0, tmpMax.x() - 2 * paddingSize, AlignMode.LEFT); this.text.setTextAlignment(0, tmpMax.x() - 2 * paddingSize, AlignMode.LEFT);
} }
Vector3f currentTextSize = this.text.calculateSizeDecorated(this.value); final Vector3f currentTextSize = this.text.calculateSizeDecorated(this.value);
Vector2i localSize = new Vector2i((int) this.minSize.x(), (int) this.minSize.y()); Vector2i localSize = new Vector2i((int) this.minSize.x(), (int) this.minSize.y());
@ -145,10 +146,10 @@ public class LabelOnSVG extends Widget {
tmpTextOrigin = tmpTextOrigin.withY(tmpTextOrigin.y() + (this.minSize.y() - 2 * paddingSize) - minSize.y()); tmpTextOrigin = tmpTextOrigin.withY(tmpTextOrigin.y() + (this.minSize.y() - 2 * paddingSize) - minSize.y());
Vector3f textPos = new Vector3f(tmpTextOrigin.x(), tmpTextOrigin.y(), 0); final Vector3f textPos = new Vector3f(tmpTextOrigin.x(), tmpTextOrigin.y(), 0);
Vector3f drawClippingPos = new Vector3f(paddingSize, paddingSize, -0.5f); final Vector3f drawClippingPos = new Vector3f(paddingSize, paddingSize, -0.5f);
Vector3f drawClippingSize = new Vector3f((this.size.x() - paddingSize), (this.size.y() - paddingSize), 1); final Vector3f drawClippingSize = new Vector3f((this.size.x() - paddingSize), (this.size.y() - paddingSize), 1);
// clean the element // clean the element
this.text.reset(); this.text.reset();
@ -168,10 +169,10 @@ public class LabelOnSVG extends Widget {
this.text.flush(); this.text.flush();
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "auto-translate") @AknotName("auto-translate")
@EwolDescription(value = "Translate the String with the marker {T:xxxxxx}") @AknotDescription("Translate the String with the marker {T:xxxxxx}")
public void setPropertyAutoTranslate(final boolean propertyAutoTranslate) { public void setPropertyAutoTranslate(final boolean propertyAutoTranslate) {
if (this.propertyAutoTranslate == propertyAutoTranslate) { if (this.propertyAutoTranslate == propertyAutoTranslate) {
return; return;
@ -186,10 +187,10 @@ public class LabelOnSVG extends Widget {
requestUpdateSize(); requestUpdateSize();
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "font-size") @AknotName("font-size")
@EwolDescription(value = "Default font size (0=> system default)") @AknotDescription("Default font size (0=> system default)")
public void setPropertyFontSize(final int propertyFontSize) { public void setPropertyFontSize(final int propertyFontSize) {
if (this.propertyFontSize == propertyFontSize) { if (this.propertyFontSize == propertyFontSize) {
return; return;
@ -199,10 +200,10 @@ public class LabelOnSVG extends Widget {
requestUpdateSize(); requestUpdateSize();
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "value") @AknotName("value")
@EwolDescription(value = "Displayed value string") @AknotDescription("Displayed value string")
public void setPropertyValue(final String propertyValue) { public void setPropertyValue(final String propertyValue) {
if (this.propertyValue.equals(propertyValue)) { if (this.propertyValue.equals(propertyValue)) {
return; return;

View File

@ -16,6 +16,11 @@ import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
import org.atriasoft.aknot.annotation.AknotAttribute;
import org.atriasoft.aknot.annotation.AknotDescription;
import org.atriasoft.aknot.annotation.AknotManaged;
import org.atriasoft.aknot.annotation.AknotName;
import org.atriasoft.aknot.annotation.AknotSignal;
import org.atriasoft.esignal.Signal; import org.atriasoft.esignal.Signal;
import org.atriasoft.etk.Color; import org.atriasoft.etk.Color;
import org.atriasoft.etk.Uri; import org.atriasoft.etk.Uri;
@ -23,35 +28,34 @@ import org.atriasoft.etk.math.Vector2f;
import org.atriasoft.etk.math.Vector2i; import org.atriasoft.etk.math.Vector2i;
import org.atriasoft.etk.math.Vector3f; import org.atriasoft.etk.math.Vector3f;
import org.atriasoft.etk.math.Vector3i; import org.atriasoft.etk.math.Vector3i;
import org.atriasoft.ewol.annotation.EwolDescription;
import org.atriasoft.ewol.annotation.EwolSignal;
import org.atriasoft.ewol.event.EventInput; import org.atriasoft.ewol.event.EventInput;
import org.atriasoft.ewol.internal.Log; import org.atriasoft.ewol.internal.Log;
import org.atriasoft.ewol.resource.ResourceColorFile; import org.atriasoft.ewol.resource.ResourceColorFile;
import org.atriasoft.ewol.widget.model.ListRole; import org.atriasoft.ewol.widget.model.ListRole;
import org.atriasoft.exml.annotation.XmlAttribute;
import org.atriasoft.exml.annotation.XmlManaged;
import org.atriasoft.exml.annotation.XmlName;
import org.atriasoft.gale.key.KeyStatus; import org.atriasoft.gale.key.KeyStatus;
/** /**
* Generic display folder class. This widget display the content of a single folder : * Generic display folder class. This widget display the content of a single folder :
*/ */
public class ListFileSystem extends WidgetList { public class ListFileSystem extends WidgetList {
@EwolSignal(name = "file-select") @AknotSignal
@EwolDescription(value = "A file has been selected in the List") @AknotName(value = "file-select")
@AknotDescription(value = "A file has been selected in the List")
public Signal<String> signalFileSelect = new Signal<>(); //!< @event "file-select" Generated when a file is selected. public Signal<String> signalFileSelect = new Signal<>(); //!< @event "file-select" Generated when a file is selected.
@EwolSignal(name = "file-validate") @AknotSignal
@EwolDescription(value = "A file has been validated on the list (double clicked or return pressed)") @AknotName(value = "file-validate")
@AknotDescription(value = "A file has been validated on the list (double clicked or return pressed)")
public Signal<String> signalFileValidate = new Signal<>(); //!< @event "file-validate" Generate when the user validate (return) or double click on the element public Signal<String> signalFileValidate = new Signal<>(); //!< @event "file-validate" Generate when the user validate (return) or double click on the element
@EwolSignal(name = "folder-select") @AknotSignal
@EwolDescription(value = "A folder has been selected in the List") @AknotName(value = "folder-select")
@AknotDescription(value = "A folder has been selected in the List")
public Signal<String> signalFolderSelect = new Signal<>(); public Signal<String> signalFolderSelect = new Signal<>();
@EwolSignal(name = "folder-validate") @AknotSignal
@EwolDescription(value = "A folder has been validated on the list (double clicked or return pressed)") @AknotName(value = "folder-validate")
@AknotDescription(value = "A folder has been validated on the list (double clicked or return pressed)")
public Signal<String> signalFolderValidate = new Signal<>(); public Signal<String> signalFolderValidate = new Signal<>();
protected String propertyPath = "/"; //!< Current folder that display point on. protected String propertyPath = "/"; //!< Current folder that display point on.
protected File propertyFile = null; //!< current selected file protected File propertyFile = null; //!< current selected file
@ -144,26 +148,26 @@ public class ListFileSystem extends WidgetList {
return new Vector2i(1, this.list.size() + offset); return new Vector2i(1, this.list.size() + offset);
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "select") @AknotName(value = "select")
@EwolDescription(value = "selection af a specific file") @AknotDescription(value = "selection af a specific file")
public File getPropertyFile() { public File getPropertyFile() {
return this.propertyFile; return this.propertyFile;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "filter") @AknotName(value = "filter")
@EwolDescription(value = "regex to filter files ...") @AknotDescription(value = "regex to filter files ...")
public String getPropertyFilter() { public String getPropertyFilter() {
return this.propertyFilter; return this.propertyFilter;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "Path") @AknotName(value = "Path")
@EwolDescription(value = "Path to display") @AknotDescription(value = "Path to display")
public String getPropertyPath() { public String getPropertyPath() {
return this.propertyPath; return this.propertyPath;
} }
@ -179,26 +183,26 @@ public class ListFileSystem extends WidgetList {
return null; return null;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "show-file") @AknotName(value = "show-file")
@EwolDescription(value = "Display files") @AknotDescription(value = "Display files")
public boolean isPropertyShowFile() { public boolean isPropertyShowFile() {
return this.propertyShowFile; return this.propertyShowFile;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "show-folder") @AknotName(value = "show-folder")
@EwolDescription(value = "display folders") @AknotDescription(value = "display folders")
public boolean isPropertyShowFolder() { public boolean isPropertyShowFolder() {
return this.propertyShowFolder; return this.propertyShowFolder;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "show-hidden") @AknotName(value = "show-hidden")
@EwolDescription(value = "Show the hidden element (file, folder, ...)") @AknotDescription(value = "Show the hidden element (file, folder, ...)")
public boolean isPropertyShowHidden() { public boolean isPropertyShowHidden() {
return this.propertyShowHidden; return this.propertyShowHidden;
} }

View File

@ -5,16 +5,16 @@
*/ */
package org.atriasoft.ewol.widget; package org.atriasoft.ewol.widget;
import org.atriasoft.aknot.annotation.AknotAttribute;
import org.atriasoft.aknot.annotation.AknotDescription;
import org.atriasoft.aknot.annotation.AknotManaged;
import org.atriasoft.aknot.annotation.AknotName;
import org.atriasoft.etk.Dimension3f; import org.atriasoft.etk.Dimension3f;
import org.atriasoft.etk.Distance; import org.atriasoft.etk.Distance;
import org.atriasoft.etk.Uri; import org.atriasoft.etk.Uri;
import org.atriasoft.etk.math.Vector3b; import org.atriasoft.etk.math.Vector3b;
import org.atriasoft.etk.math.Vector3f; import org.atriasoft.etk.math.Vector3f;
import org.atriasoft.ewol.annotation.EwolDescription;
import org.atriasoft.ewol.event.EventInput; import org.atriasoft.ewol.event.EventInput;
import org.atriasoft.exml.annotation.XmlAttribute;
import org.atriasoft.exml.annotation.XmlManaged;
import org.atriasoft.exml.annotation.XmlName;
import org.atriasoft.gale.key.KeyStatus; import org.atriasoft.gale.key.KeyStatus;
/** /**
@ -33,10 +33,10 @@ public class PopUp extends ContainerWithShape {
this.propertyExpand = Vector3b.FALSE; this.propertyExpand = Vector3b.FALSE;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "out-click-remove") @AknotName(value = "out-click-remove")
@EwolDescription(value = "Remove the widget if the use click outside") @AknotDescription(value = "Remove the widget if the use click outside")
public boolean isPropertyCloseOutEvent() { public boolean isPropertyCloseOutEvent() {
return this.propertyCloseOutEvent; return this.propertyCloseOutEvent;
} }

View File

@ -5,13 +5,13 @@
*/ */
package org.atriasoft.ewol.widget; package org.atriasoft.ewol.widget;
import org.atriasoft.aknot.annotation.AknotAttribute;
import org.atriasoft.aknot.annotation.AknotDescription;
import org.atriasoft.aknot.annotation.AknotManaged;
import org.atriasoft.aknot.annotation.AknotName;
import org.atriasoft.etk.Color; import org.atriasoft.etk.Color;
import org.atriasoft.etk.math.Vector3f; import org.atriasoft.etk.math.Vector3f;
import org.atriasoft.ewol.annotation.EwolDescription;
import org.atriasoft.ewol.compositing.CompositingDrawing; import org.atriasoft.ewol.compositing.CompositingDrawing;
import org.atriasoft.exml.annotation.XmlAttribute;
import org.atriasoft.exml.annotation.XmlManaged;
import org.atriasoft.exml.annotation.XmlName;
class ProgressBar extends Widget { class ProgressBar extends Widget {
private static final int DOT_RADIUS = 6; private static final int DOT_RADIUS = 6;
@ -28,39 +28,39 @@ class ProgressBar extends Widget {
@Override @Override
public void calculateMinMaxSize() { public void calculateMinMaxSize() {
Vector3f tmpMin = this.propertyMinSize.getPixel(); final Vector3f tmpMin = this.propertyMinSize.getPixel();
this.minSize = new Vector3f(Math.max(tmpMin.x(), 40.0f), Math.max(tmpMin.y(), ProgressBar.DOT_RADIUS * 2.0f), 10); this.minSize = new Vector3f(Math.max(tmpMin.x(), 40.0f), Math.max(tmpMin.y(), ProgressBar.DOT_RADIUS * 2.0f), 10);
markToRedraw(); markToRedraw();
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "color-off") @AknotName(value = "color-off")
@EwolDescription(value = "Color of the false value") @AknotDescription(value = "Color of the false value")
public Color getPropertyTextColorBgOff() { public Color getPropertyTextColorBgOff() {
return this.propertyTextColorBgOff; return this.propertyTextColorBgOff;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "color-on") @AknotName(value = "color-on")
@EwolDescription(value = "Color of the true value") @AknotDescription(value = "Color of the true value")
public Color getPropertyTextColorBgOn() { public Color getPropertyTextColorBgOn() {
return this.propertyTextColorBgOn; return this.propertyTextColorBgOn;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "color-bg") @AknotName(value = "color-bg")
@EwolDescription(value = "ackground color") @AknotDescription(value = "ackground color")
public Color getPropertyTextColorFg() { public Color getPropertyTextColorFg() {
return this.propertyTextColorFg; return this.propertyTextColorFg;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "value") @AknotName(value = "value")
@EwolDescription(value = "Value of the progress bar [0..1]") @AknotDescription(value = "Value of the progress bar [0..1]")
public float getPropertyValue() { public float getPropertyValue() {
return this.propertyValue; return this.propertyValue;
} }
@ -80,10 +80,10 @@ class ProgressBar extends Widget {
this.draw.setColor(this.propertyTextColorFg); this.draw.setColor(this.propertyTextColorFg);
int tmpSizeX = (int) (this.size.x() - 10); final int tmpSizeX = (int) (this.size.x() - 10);
int tmpSizeY = (int) (this.size.y() - 10); final int tmpSizeY = (int) (this.size.y() - 10);
int tmpOriginX = 5; final int tmpOriginX = 5;
int tmpOriginY = 5; final int tmpOriginY = 5;
this.draw.setColor(this.propertyTextColorBgOn); this.draw.setColor(this.propertyTextColorBgOn);
this.draw.setPos(new Vector3f(tmpOriginX, tmpOriginY, 0)); this.draw.setPos(new Vector3f(tmpOriginX, tmpOriginY, 0));
this.draw.rectangleWidth(new Vector3f(tmpSizeX * this.propertyValue, tmpSizeY, 0)); this.draw.rectangleWidth(new Vector3f(tmpSizeX * this.propertyValue, tmpSizeY, 0));

View File

@ -5,6 +5,10 @@
*/ */
package org.atriasoft.ewol.widget; package org.atriasoft.ewol.widget;
import org.atriasoft.aknot.annotation.AknotAttribute;
import org.atriasoft.aknot.annotation.AknotDescription;
import org.atriasoft.aknot.annotation.AknotManaged;
import org.atriasoft.aknot.annotation.AknotName;
import org.atriasoft.etk.Uri; import org.atriasoft.etk.Uri;
import org.atriasoft.etk.math.FMath; import org.atriasoft.etk.math.FMath;
import org.atriasoft.etk.math.Vector2f; import org.atriasoft.etk.math.Vector2f;
@ -14,13 +18,9 @@ import org.atriasoft.ewol.DrawProperty;
import org.atriasoft.ewol.GravityVertical; import org.atriasoft.ewol.GravityVertical;
import org.atriasoft.ewol.HighSpeedMode; import org.atriasoft.ewol.HighSpeedMode;
import org.atriasoft.ewol.Padding; import org.atriasoft.ewol.Padding;
import org.atriasoft.ewol.annotation.EwolDescription;
import org.atriasoft.ewol.compositing.GuiShape; import org.atriasoft.ewol.compositing.GuiShape;
import org.atriasoft.ewol.event.EventInput; import org.atriasoft.ewol.event.EventInput;
import org.atriasoft.ewol.internal.Log; import org.atriasoft.ewol.internal.Log;
import org.atriasoft.exml.annotation.XmlAttribute;
import org.atriasoft.exml.annotation.XmlManaged;
import org.atriasoft.exml.annotation.XmlName;
import org.atriasoft.gale.key.KeyStatus; import org.atriasoft.gale.key.KeyStatus;
import org.atriasoft.gale.key.KeyType; import org.atriasoft.gale.key.KeyType;
@ -70,26 +70,26 @@ class Scroll extends Container {
} }
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "limit") @AknotName(value = "limit")
@EwolDescription(value = "Limit the scroll maximum position [0..1]% represent the free space in the scoll when arrive at the end") @AknotDescription(value = "Limit the scroll maximum position [0..1]% represent the free space in the scoll when arrive at the end")
public Vector3f getPropertyLimit() { public Vector3f getPropertyLimit() {
return this.propertyLimit; return this.propertyLimit;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "shape-hori") @AknotName(value = "shape-hori")
@EwolDescription(value = "shape for the horizontal display") @AknotDescription(value = "shape for the horizontal display")
public Uri getPropertyShapeHori() { public Uri getPropertyShapeHori() {
return this.propertyShapeHori; return this.propertyShapeHori;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "shape-vert") @AknotName(value = "shape-vert")
@EwolDescription(value = "shape for the vertical display") @AknotDescription(value = "shape for the vertical display")
public Uri getPropertyShapeVert() { public Uri getPropertyShapeVert() {
return this.propertyShapeVert; return this.propertyShapeVert;
} }
@ -103,10 +103,10 @@ class Scroll extends Container {
return this; return this;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "hover") @AknotName(value = "hover")
@EwolDescription(value = "The display bar are hover the subWidget") @AknotDescription(value = "The display bar are hover the subWidget")
public boolean isPropertyHover() { public boolean isPropertyHover() {
return this.propertyHover; return this.propertyHover;
} }

View File

@ -5,21 +5,20 @@
*/ */
package org.atriasoft.ewol.widget; package org.atriasoft.ewol.widget;
import org.atriasoft.aknot.annotation.AknotAttribute;
import org.atriasoft.aknot.annotation.AknotCaseSensitive;
import org.atriasoft.aknot.annotation.AknotDescription;
import org.atriasoft.aknot.annotation.AknotManaged;
import org.atriasoft.aknot.annotation.AknotName;
import org.atriasoft.etk.Dimension3f; import org.atriasoft.etk.Dimension3f;
import org.atriasoft.etk.math.FMath; import org.atriasoft.etk.math.FMath;
import org.atriasoft.etk.math.Vector3b; import org.atriasoft.etk.math.Vector3b;
import org.atriasoft.etk.math.Vector3f; import org.atriasoft.etk.math.Vector3f;
import org.atriasoft.etk.math.Vector3i; import org.atriasoft.etk.math.Vector3i;
import org.atriasoft.ewol.annotation.EwolDescription;
import org.atriasoft.ewol.annotation.EwolObjectProperty;
import org.atriasoft.ewol.internal.Log; import org.atriasoft.ewol.internal.Log;
import org.atriasoft.exml.annotation.XmlAttribute;
import org.atriasoft.exml.annotation.XmlCaseSensitive;
import org.atriasoft.exml.annotation.XmlManaged;
import org.atriasoft.exml.annotation.XmlName;
public class Sizer extends ContainerN { public class Sizer extends ContainerN {
@XmlCaseSensitive(value = false) @AknotCaseSensitive(value = false)
public enum DisplayMode { public enum DisplayMode {
HORIZONTAL, //!< Horizontal mode HORIZONTAL, //!< Horizontal mode
VERTICAL; //!< Vertical mode VERTICAL; //!< Vertical mode
@ -80,20 +79,18 @@ public class Sizer extends ContainerN {
Log.verbose("[{}] Result min size : {}", getId(), this.minSize); Log.verbose("[{}] Result min size : {}", getId(), this.minSize);
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName("border") @AknotName("border")
@EwolObjectProperty @AknotDescription("The sizer border size")
@EwolDescription("The sizer border size")
public Dimension3f getPropertyBorderSize() { public Dimension3f getPropertyBorderSize() {
return this.propertyBorderSize; return this.propertyBorderSize;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName("mode") @AknotName("mode")
@EwolObjectProperty @AknotDescription("The display mode")
@EwolDescription("The display mode")
public DisplayMode getPropertyMode() { public DisplayMode getPropertyMode() {
return this.propertyMode; return this.propertyMode;
} }

View File

@ -1,5 +1,10 @@
package org.atriasoft.ewol.widget; package org.atriasoft.ewol.widget;
import org.atriasoft.aknot.annotation.AknotAttribute;
import org.atriasoft.aknot.annotation.AknotDescription;
import org.atriasoft.aknot.annotation.AknotManaged;
import org.atriasoft.aknot.annotation.AknotName;
/** @file /** @file
* @author Edouard DUPIN * @author Edouard DUPIN
* @copyright 2011, Edouard DUPIN, all right reserved * @copyright 2011, Edouard DUPIN, all right reserved
@ -8,18 +13,14 @@ package org.atriasoft.ewol.widget;
import org.atriasoft.etk.Color; import org.atriasoft.etk.Color;
import org.atriasoft.etk.math.Vector3f; import org.atriasoft.etk.math.Vector3f;
import org.atriasoft.ewol.annotation.EwolDescription;
import org.atriasoft.ewol.compositing.CompositingDrawing; import org.atriasoft.ewol.compositing.CompositingDrawing;
import org.atriasoft.exml.annotation.XmlAttribute;
import org.atriasoft.exml.annotation.XmlManaged;
import org.atriasoft.exml.annotation.XmlName;
public class Spacer extends Widget { public class Spacer extends Widget {
private final CompositingDrawing draw = new CompositingDrawing(); //!< Compositing drawing element private final CompositingDrawing draw = new CompositingDrawing(); //!< Compositing drawing element
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "color") @AknotName("color")
@EwolDescription(value = "background of the spacer") @AknotDescription("background of the spacer")
protected Color propertyColor = Color.NONE; //!< Background color protected Color propertyColor = Color.NONE; //!< Background color
/** /**

View File

@ -1,16 +1,16 @@
package org.atriasoft.ewol.widget; package org.atriasoft.ewol.widget;
import org.atriasoft.aknot.annotation.AknotAttribute;
import org.atriasoft.aknot.annotation.AknotDescription;
import org.atriasoft.aknot.annotation.AknotManaged;
import org.atriasoft.aknot.annotation.AknotName;
import org.atriasoft.aknot.annotation.AknotSignal;
import org.atriasoft.esignal.Connection; import org.atriasoft.esignal.Connection;
import org.atriasoft.esignal.Signal; import org.atriasoft.esignal.Signal;
import org.atriasoft.etk.Uri; import org.atriasoft.etk.Uri;
import org.atriasoft.etk.math.FMath; import org.atriasoft.etk.math.FMath;
import org.atriasoft.ewol.annotation.EwolDescription;
import org.atriasoft.ewol.annotation.EwolSignal;
import org.atriasoft.ewol.internal.Log; import org.atriasoft.ewol.internal.Log;
import org.atriasoft.ewol.widget.meta.SpinBase; import org.atriasoft.ewol.widget.meta.SpinBase;
import org.atriasoft.exml.annotation.XmlAttribute;
import org.atriasoft.exml.annotation.XmlManaged;
import org.atriasoft.exml.annotation.XmlName;
/** /**
* a composed Spin is a Spin with an inside composed with the specify XML element * a composed Spin is a Spin with an inside composed with the specify XML element
@ -18,9 +18,13 @@ import org.atriasoft.exml.annotation.XmlName;
*/ */
public class Spin extends SpinBase { public class Spin extends SpinBase {
// Event list of properties // Event list of properties
@EwolSignal(name = "value", description = "Spin updated value (depend of the mantis)") @AknotSignal
@AknotName("value")
@AknotDescription("Spin updated value (depend of the mantis)")
public Signal<Long> signalValue = new Signal<>(); public Signal<Long> signalValue = new Signal<>();
@EwolSignal(name = "valueDouble", description = "Spin value change value in 'double' (application of the mantis)") @AknotSignal
@AknotName("valueDouble")
@AknotDescription("Spin value change value in 'double' (application of the mantis)")
public Signal<Double> signalValueDouble = new Signal<>(); public Signal<Double> signalValueDouble = new Signal<>();
protected long propertyValue = 0; //!< Current value of the Spin. protected long propertyValue = 0; //!< Current value of the Spin.
protected long propertyMin = Long.MIN_VALUE; //!< Minimum value protected long propertyMin = Long.MIN_VALUE; //!< Minimum value
@ -68,42 +72,42 @@ public class Spin extends SpinBase {
Log.warning("updateGui [STOP]"); Log.warning("updateGui [STOP]");
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "increment") @AknotName("increment")
@EwolDescription(value = "Increment value at each button event or keybord event") @AknotDescription("Increment value at each button event or keybord event")
public long getPropertyIncrement() { public long getPropertyIncrement() {
return this.propertyIncrement; return this.propertyIncrement;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "mantis") @AknotName("mantis")
@EwolDescription(value = "fix-point mantis element (number of digit under the .)") @AknotDescription("fix-point mantis element (number of digit under the .)")
public int getPropertyMantis() { public int getPropertyMantis() {
return this.propertyMantis; return this.propertyMantis;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "max") @AknotName(value = "max")
@EwolDescription(value = "Maximum value of the spin (depend on mantis)") @AknotDescription(value = "Maximum value of the spin (depend on mantis)")
public long getPropertyMax() { public long getPropertyMax() {
return this.propertyMax; return this.propertyMax;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "min") @AknotName("min")
@EwolDescription(value = "Minimum value of the spin (depend on mantis)") @AknotDescription("Minimum value of the spin (depend on mantis)")
public long getPropertyMin() { public long getPropertyMin() {
return this.propertyMin; return this.propertyMin;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "value") @AknotName("value")
@EwolDescription(value = "Value of the Spin") @AknotDescription("Value of the Spin")
public long getPropertyValue() { public long getPropertyValue() {
return this.propertyValue; return this.propertyValue;
} }

View File

@ -1,5 +1,10 @@
package org.atriasoft.ewol.widget; package org.atriasoft.ewol.widget;
import org.atriasoft.aknot.annotation.AknotAttribute;
import org.atriasoft.aknot.annotation.AknotDescription;
import org.atriasoft.aknot.annotation.AknotManaged;
import org.atriasoft.aknot.annotation.AknotName;
import org.atriasoft.aknot.annotation.AknotSignal;
import org.atriasoft.esignal.Connection; import org.atriasoft.esignal.Connection;
import org.atriasoft.esignal.Signal; import org.atriasoft.esignal.Signal;
import org.atriasoft.esignal.SignalEmpty; import org.atriasoft.esignal.SignalEmpty;
@ -7,17 +12,12 @@ import org.atriasoft.etk.Uri;
import org.atriasoft.etk.math.Vector3f; import org.atriasoft.etk.math.Vector3f;
import org.atriasoft.etk.math.Vector3i; import org.atriasoft.etk.math.Vector3i;
import org.atriasoft.ewol.Padding; import org.atriasoft.ewol.Padding;
import org.atriasoft.ewol.annotation.EwolDescription;
import org.atriasoft.ewol.annotation.EwolSignal;
import org.atriasoft.ewol.compositing.GuiShape; import org.atriasoft.ewol.compositing.GuiShape;
import org.atriasoft.ewol.compositing.GuiShapeMode; import org.atriasoft.ewol.compositing.GuiShapeMode;
import org.atriasoft.ewol.event.EventInput; import org.atriasoft.ewol.event.EventInput;
import org.atriasoft.ewol.event.EventTime; import org.atriasoft.ewol.event.EventTime;
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.XmlManaged;
import org.atriasoft.exml.annotation.XmlName;
import org.atriasoft.gale.key.KeyStatus; import org.atriasoft.gale.key.KeyStatus;
/** /**
@ -64,13 +64,21 @@ public class Tick extends Widget {
private Boolean propertyValue = false; //!< string that must be displayed private Boolean propertyValue = false; //!< string that must be displayed
private GuiShape shape; private GuiShape shape;
@EwolSignal(name = "down", description = "Tick is Down") @AknotSignal
@AknotName("down")
@AknotDescription("Tick is Down")
public SignalEmpty signalDown = new SignalEmpty(); public SignalEmpty signalDown = new SignalEmpty();
@EwolSignal(name = "up", description = "Tick is Up") @AknotSignal
@AknotName("up")
@AknotDescription("Tick is Up")
public SignalEmpty signalUp = new SignalEmpty(); public SignalEmpty signalUp = new SignalEmpty();
@EwolSignal(name = "click", description = "Tick is Clicked") @AknotSignal
@AknotName("click")
@AknotDescription("Tick is Clicked")
public SignalEmpty signalClick = new SignalEmpty(); public SignalEmpty signalClick = new SignalEmpty();
@EwolSignal(name = "value", description = "Tick value change") @AknotSignal
@AknotName("value")
@AknotDescription("Tick value change")
public Signal<Boolean> signalValue = new Signal<>(); public Signal<Boolean> signalValue = new Signal<>();
// element over: // element over:
Vector3f overPositionStart = Vector3f.ZERO; Vector3f overPositionStart = Vector3f.ZERO;
@ -124,18 +132,18 @@ public class Tick extends Widget {
return relPos.x() > this.overPositionStart.x() && relPos.y() > this.overPositionStart.y() && relPos.x() < this.overPositionStop.x() && relPos.y() < this.overPositionStop.y(); return relPos.x() > this.overPositionStart.x() && relPos.y() > this.overPositionStart.y() && relPos.x() < this.overPositionStop.x() && relPos.y() < this.overPositionStop.y();
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "config") @AknotName("config")
@EwolDescription(value = "configuration of the widget") @AknotDescription("configuration of the widget")
public Uri getPropertyConfig() { public Uri getPropertyConfig() {
return this.propertyConfig; return this.propertyConfig;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "value") @AknotName("value")
@EwolDescription(value = "State of the Tick") @AknotDescription("State of the Tick")
public Boolean getPropertyValue() { public Boolean getPropertyValue() {
return this.propertyValue; return this.propertyValue;
} }

View File

@ -9,6 +9,11 @@ package org.atriasoft.ewol.widget;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.atriasoft.aknot.annotation.AknotAttribute;
import org.atriasoft.aknot.annotation.AknotDescription;
import org.atriasoft.aknot.annotation.AknotManaged;
import org.atriasoft.aknot.annotation.AknotName;
import org.atriasoft.aknot.annotation.AknotSignal;
import org.atriasoft.esignal.Signal; import org.atriasoft.esignal.Signal;
import org.atriasoft.etk.Color; import org.atriasoft.etk.Color;
import org.atriasoft.etk.Dimension3f; import org.atriasoft.etk.Dimension3f;
@ -20,8 +25,6 @@ import org.atriasoft.etk.math.Vector3b;
import org.atriasoft.etk.math.Vector3f; import org.atriasoft.etk.math.Vector3f;
import org.atriasoft.ewol.DrawProperty; import org.atriasoft.ewol.DrawProperty;
import org.atriasoft.ewol.Gravity; import org.atriasoft.ewol.Gravity;
import org.atriasoft.ewol.annotation.EwolDescription;
import org.atriasoft.ewol.annotation.EwolSignal;
import org.atriasoft.ewol.compositing.CompositingDrawing; import org.atriasoft.ewol.compositing.CompositingDrawing;
import org.atriasoft.ewol.event.EntrySystem; import org.atriasoft.ewol.event.EntrySystem;
import org.atriasoft.ewol.event.EventEntry; import org.atriasoft.ewol.event.EventEntry;
@ -30,9 +33,6 @@ import org.atriasoft.ewol.event.EventShortCut;
import org.atriasoft.ewol.event.InputSystem; 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.XmlManaged;
import org.atriasoft.exml.annotation.XmlName;
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;
@ -93,7 +93,8 @@ public class Widget extends EwolObject {
// ---------------------------------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------------------------------
// -- Shortcut : management of the shortcut // -- Shortcut : management of the shortcut
// ---------------------------------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------------------------------
@EwolSignal(name = "shortcut") @AknotSignal
@AknotName("shortcut")
public Signal<String> signalShortcut; //!< signal handle of the message public Signal<String> signalShortcut; //!< signal handle of the message
// ---------------------------------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------------------------------
@ -270,66 +271,66 @@ public class Widget extends EwolObject {
return this.origin; return this.origin;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "focus") @AknotName("focus")
@EwolDescription(value = "enable the widget to have the focus capacity") @AknotDescription("enable the widget to have the focus capacity")
public boolean getPropertyCanFocus() { public boolean getPropertyCanFocus() {
return this.propertyCanFocus; return this.propertyCanFocus;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "expand") @AknotName("expand")
@EwolDescription(value = "Request the widget Expand size while space is available") @AknotDescription("Request the widget Expand size while space is available")
public Vector3b getPropertyExpand() { public Vector3b getPropertyExpand() {
return this.propertyExpand; return this.propertyExpand;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "expand-free") @AknotName("expand-free")
@EwolDescription(value = "Request the widget Expand size while free space is detected (does not generate expand in upper wideget)") @AknotDescription("Request the widget Expand size while free space is detected (does not generate expand in upper wideget)")
public Vector3b getPropertyExpandIfFree() { public Vector3b getPropertyExpandIfFree() {
return this.propertyExpandIfFree; return this.propertyExpandIfFree;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "fill") @AknotName("fill")
@EwolDescription(value = "Fill the widget available size") @AknotDescription("Fill the widget available size")
public Vector3b getPropertyFill() { public Vector3b getPropertyFill() {
return this.propertyFill; return this.propertyFill;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "gravity") @AknotName("gravity")
@EwolDescription(value = "Gravity orientation") @AknotDescription("Gravity orientation")
public Gravity getPropertyGravity() { public Gravity getPropertyGravity() {
return this.propertyGravity; return this.propertyGravity;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "hide") @AknotName("hide")
@EwolDescription(value = "The widget start hided") @AknotDescription("The widget start hided")
public boolean getPropertyHide() { public boolean getPropertyHide() {
return this.propertyHide; return this.propertyHide;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "max-size") @AknotName("max-size")
@EwolDescription(value = "User maximum size") @AknotDescription("User maximum size")
public Dimension3f getPropertyMaxSize() { public Dimension3f getPropertyMaxSize() {
return this.propertyMaxSize; return this.propertyMaxSize;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "min-size") @AknotName("min-size")
@EwolDescription(value = "User minimum size") @AknotDescription("User minimum size")
public Dimension3f getPropertyMinSize() { public Dimension3f getPropertyMinSize() {
return this.propertyMinSize; return this.propertyMinSize;
} }

View File

@ -1,5 +1,9 @@
package org.atriasoft.ewol.widget; package org.atriasoft.ewol.widget;
import org.atriasoft.aknot.annotation.AknotAttribute;
import org.atriasoft.aknot.annotation.AknotDescription;
import org.atriasoft.aknot.annotation.AknotManaged;
import org.atriasoft.aknot.annotation.AknotName;
import org.atriasoft.etk.Uri; import org.atriasoft.etk.Uri;
import org.atriasoft.etk.math.FMath; import org.atriasoft.etk.math.FMath;
import org.atriasoft.etk.math.Matrix4f; import org.atriasoft.etk.math.Matrix4f;
@ -8,13 +12,9 @@ import org.atriasoft.etk.math.Vector3f;
import org.atriasoft.ewol.DrawProperty; import org.atriasoft.ewol.DrawProperty;
import org.atriasoft.ewol.HighSpeedMode; import org.atriasoft.ewol.HighSpeedMode;
import org.atriasoft.ewol.Padding; import org.atriasoft.ewol.Padding;
import org.atriasoft.ewol.annotation.EwolDescription;
import org.atriasoft.ewol.compositing.GuiShape; import org.atriasoft.ewol.compositing.GuiShape;
import org.atriasoft.ewol.event.EventInput; import org.atriasoft.ewol.event.EventInput;
import org.atriasoft.ewol.internal.Log; import org.atriasoft.ewol.internal.Log;
import org.atriasoft.exml.annotation.XmlAttribute;
import org.atriasoft.exml.annotation.XmlManaged;
import org.atriasoft.exml.annotation.XmlName;
import org.atriasoft.gale.backend3d.OpenGL; import org.atriasoft.gale.backend3d.OpenGL;
import org.atriasoft.gale.key.KeyStatus; import org.atriasoft.gale.key.KeyStatus;
import org.atriasoft.gale.key.KeyType; import org.atriasoft.gale.key.KeyType;
@ -59,18 +59,18 @@ class WidgetScrolled extends Widget {
onChangePropertyShapeHori(); onChangePropertyShapeHori();
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "shape-hori") @AknotName("shape-hori")
@EwolDescription(value = "shape for the horizontal display") @AknotDescription("shape for the horizontal display")
public Uri getPropertyShapeHori() { public Uri getPropertyShapeHori() {
return this.propertyShapeHori; return this.propertyShapeHori;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "shape-vert") @AknotName("shape-vert")
@EwolDescription(value = "shape for the vertical display") @AknotDescription("shape for the vertical display")
public Uri getPropertyShapeVert() { public Uri getPropertyShapeVert() {
return this.propertyShapeVert; return this.propertyShapeVert;
} }

View File

@ -3,10 +3,10 @@ package org.atriasoft.ewol.widget;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import org.atriasoft.aknot.model.InterfaceFactoryAccess;
import org.atriasoft.ewol.widget.meta.FileChooser; import org.atriasoft.ewol.widget.meta.FileChooser;
import org.atriasoft.exml.annotation.XmlFactory.InterfaceXmlFactoryAccess;
public class WidgetXmlFactory implements InterfaceXmlFactoryAccess { public class WidgetXmlFactory implements InterfaceFactoryAccess {
private static Map<String, Class<?>> listWidgetAvaillable = new HashMap<>(); private static Map<String, Class<?>> listWidgetAvaillable = new HashMap<>();
static { static {
listWidgetAvaillable.put("Sizer", Sizer.class); listWidgetAvaillable.put("Sizer", Sizer.class);
@ -24,7 +24,7 @@ public class WidgetXmlFactory implements InterfaceXmlFactoryAccess {
} }
@Override @Override
public Class<?> findClass(final String name) { public Class<?> findClass(final String name, final boolean caseSensitive) {
return listWidgetAvaillable.get(name); return listWidgetAvaillable.get(name);
} }

View File

@ -9,21 +9,21 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.ListIterator; import java.util.ListIterator;
import org.atriasoft.aknot.annotation.AknotAttribute;
import org.atriasoft.aknot.annotation.AknotDescription;
import org.atriasoft.aknot.annotation.AknotManaged;
import org.atriasoft.aknot.annotation.AknotName;
import org.atriasoft.etk.Color; import org.atriasoft.etk.Color;
import org.atriasoft.etk.Uri; import org.atriasoft.etk.Uri;
import org.atriasoft.etk.math.Matrix4f; import org.atriasoft.etk.math.Matrix4f;
import org.atriasoft.etk.math.Vector3f; import org.atriasoft.etk.math.Vector3f;
import org.atriasoft.etk.math.Vector3i; import org.atriasoft.etk.math.Vector3i;
import org.atriasoft.ewol.DrawProperty; import org.atriasoft.ewol.DrawProperty;
import org.atriasoft.ewol.annotation.EwolDescription;
import org.atriasoft.ewol.compositing.CompositingDrawing; import org.atriasoft.ewol.compositing.CompositingDrawing;
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.ewol.object.EwolObject; import org.atriasoft.ewol.object.EwolObject;
import org.atriasoft.ewol.resource.ResourceColorFile; import org.atriasoft.ewol.resource.ResourceColorFile;
import org.atriasoft.exml.annotation.XmlAttribute;
import org.atriasoft.exml.annotation.XmlManaged;
import org.atriasoft.exml.annotation.XmlName;
import org.atriasoft.gale.backend3d.OpenGL; import org.atriasoft.gale.backend3d.OpenGL;
/** /**
@ -35,15 +35,15 @@ public class Windows extends Widget {
protected List<Widget> popUpWidgetList = new ArrayList<>(); protected List<Widget> popUpWidgetList = new ArrayList<>();
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "file-color") @AknotName("file-color")
@EwolDescription(value = "File color of the Windows") @AknotDescription("File color of the Windows")
public Uri propertyColorConfiguration = new Uri("THEME", "color/Windows.json", "ewol"); //!< Configuration file of the windows theme public Uri propertyColorConfiguration = new Uri("THEME", "color/Windows.json", "ewol"); //!< Configuration file of the windows theme
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "title") @AknotName("title")
@EwolDescription(value = "Title of the windows") @AknotDescription("Title of the windows")
public String propertyTitle = "No title"; //!< Current title of the windows public String propertyTitle = "No title"; //!< Current title of the windows
protected ResourceColorFile resourceColor = null; //!< theme color property (name of file in @ref propertyColorConfiguration) protected ResourceColorFile resourceColor = null; //!< theme color property (name of file in @ref propertyColorConfiguration)
@ -67,7 +67,7 @@ public class Windows extends Widget {
if (this.subWidget != null) { if (this.subWidget != null) {
this.subWidget.drawWidgetTree(level); this.subWidget.drawWidgetTree(level);
} }
for (Widget it : this.popUpWidgetList) { for (final Widget it : this.popUpWidgetList) {
if (it != null) { if (it != null) {
it.drawWidgetTree(level); it.drawWidgetTree(level);
} }
@ -96,7 +96,7 @@ public class Windows extends Widget {
} }
} }
// get all subwidget "pop-up" // get all subwidget "pop-up"
for (Widget it : this.popUpWidgetList) { for (final Widget it : this.popUpWidgetList) {
if (it != null) { if (it != null) {
tmpObject = it.getSubObjectNamed(objectName); tmpObject = it.getSubObjectNamed(objectName);
if (tmpObject != null) { if (tmpObject != null) {
@ -112,7 +112,7 @@ public class Windows extends Widget {
public Widget getWidgetAtPos(final Vector3f pos) { public Widget getWidgetAtPos(final Vector3f pos) {
Log.verbose("Get widget at pos : " + pos); Log.verbose("Get widget at pos : " + pos);
// calculate relative position // calculate relative position
Vector3f relativePos = relativePosition(pos); final Vector3f relativePos = relativePosition(pos);
// event go directly on the pop-up // event go directly on the pop-up
if (this.popUpWidgetList.size() != 0) { if (this.popUpWidgetList.size() != 0) {
return this.popUpWidgetList.get(this.popUpWidgetList.size() - 1).getWidgetAtPos(pos); return this.popUpWidgetList.get(this.popUpWidgetList.size() - 1).getWidgetAtPos(pos);
@ -144,7 +144,7 @@ public class Windows extends Widget {
this.subWidget.setOrigin(Vector3f.ZERO); this.subWidget.setOrigin(Vector3f.ZERO);
this.subWidget.onChangeSize(); this.subWidget.onChangeSize();
} }
for (Widget it : this.popUpWidgetList) { for (final Widget it : this.popUpWidgetList) {
if (it != null) { if (it != null) {
it.calculateMinMaxSize(); it.calculateMinMaxSize();
it.setSize(this.size); it.setSize(this.size);
@ -159,7 +159,7 @@ public class Windows extends Widget {
if (this.subWidget != null) { if (this.subWidget != null) {
this.subWidget.systemRegenerateDisplay(); this.subWidget.systemRegenerateDisplay();
} }
for (Widget it : this.popUpWidgetList) { for (final Widget it : this.popUpWidgetList) {
if (it != null) { if (it != null) {
it.systemRegenerateDisplay(); it.systemRegenerateDisplay();
} }
@ -210,7 +210,7 @@ public class Windows extends Widget {
Log.verbose("A child has been removed"); Log.verbose("A child has been removed");
ListIterator<Widget> it = this.popUpWidgetList.listIterator(); ListIterator<Widget> it = this.popUpWidgetList.listIterator();
while (it.hasNext()) { while (it.hasNext()) {
Widget elem = it.next(); final Widget elem = it.next();
if (elem == child) { if (elem == child) {
Log.verbose(" Find it ..."); Log.verbose(" Find it ...");
if (elem != null) { if (elem != null) {
@ -245,7 +245,7 @@ public class Windows extends Widget {
return; return;
} }
this.propertyTitle = propertyTitle; this.propertyTitle = propertyTitle;
EwolContext context = EwolObject.getContext(); final EwolContext context = EwolObject.getContext();
if (context.getWindows() == this) { if (context.getWindows() == this) {
context.setTitle(propertyTitle); context.setTitle(propertyTitle);
} else { } else {
@ -290,8 +290,8 @@ public class Windows extends Widget {
// clear the matrix system : // clear the matrix system :
OpenGL.setBasicMatrix(Matrix4f.IDENTITY); OpenGL.setBasicMatrix(Matrix4f.IDENTITY);
Vector3i tmpSize = new Vector3i((int) this.size.x(), (int) this.size.y(), (int) this.size.z()); final Vector3i tmpSize = new Vector3i((int) this.size.x(), (int) this.size.y(), (int) this.size.z());
DrawProperty displayProp = new DrawProperty(tmpSize, Vector3i.ZERO, tmpSize); final DrawProperty displayProp = new DrawProperty(tmpSize, Vector3i.ZERO, tmpSize);
systemDraw(displayProp); systemDraw(displayProp);
OpenGL.disable(OpenGL.Flag.flag_blend); OpenGL.disable(OpenGL.Flag.flag_blend);
} }
@ -317,7 +317,7 @@ public class Windows extends Widget {
} }
// second display the pop-up // second display the pop-up
for (Widget it : this.popUpWidgetList) { for (final Widget it : this.popUpWidgetList) {
if (it != null) { if (it != null) {
it.systemDraw(displayProp); it.systemDraw(displayProp);
//Log.debug("Draw Pop-up"); //Log.debug("Draw Pop-up");

View File

@ -7,11 +7,14 @@ package org.atriasoft.ewol.widget.meta;
import java.io.File; import java.io.File;
import org.atriasoft.aknot.annotation.AknotAttribute;
import org.atriasoft.aknot.annotation.AknotDescription;
import org.atriasoft.aknot.annotation.AknotManaged;
import org.atriasoft.aknot.annotation.AknotName;
import org.atriasoft.aknot.annotation.AknotSignal;
import org.atriasoft.esignal.Signal; import org.atriasoft.esignal.Signal;
import org.atriasoft.esignal.SignalEmpty; import org.atriasoft.esignal.SignalEmpty;
import org.atriasoft.etk.Uri; import org.atriasoft.etk.Uri;
import org.atriasoft.ewol.annotation.EwolDescription;
import org.atriasoft.ewol.annotation.EwolSignal;
import org.atriasoft.ewol.internal.Log; import org.atriasoft.ewol.internal.Log;
import org.atriasoft.ewol.widget.Button; import org.atriasoft.ewol.widget.Button;
import org.atriasoft.ewol.widget.CheckBox; import org.atriasoft.ewol.widget.CheckBox;
@ -20,9 +23,6 @@ import org.atriasoft.ewol.widget.Entry;
import org.atriasoft.ewol.widget.ImageDisplay; import org.atriasoft.ewol.widget.ImageDisplay;
import org.atriasoft.ewol.widget.Label; import org.atriasoft.ewol.widget.Label;
import org.atriasoft.ewol.widget.ListFileSystem; import org.atriasoft.ewol.widget.ListFileSystem;
import org.atriasoft.exml.annotation.XmlAttribute;
import org.atriasoft.exml.annotation.XmlManaged;
import org.atriasoft.exml.annotation.XmlName;
/** /**
* File Chooser is a simple selector of file for opening, saving, and what you want ... * File Chooser is a simple selector of file for opening, saving, and what you want ...
@ -158,12 +158,14 @@ public class FileChooser extends Composer {
self.autoDestroy(); self.autoDestroy();
} }
@EwolSignal(name = "cancel") @AknotSignal
@EwolDescription(value = "Cancel button is pressed") @AknotName(value = "cancel")
@AknotDescription(value = "Cancel button is pressed")
public SignalEmpty signalCancel; //!< abort the display of the pop-up or press cancel button public SignalEmpty signalCancel; //!< abort the display of the pop-up or press cancel button
@EwolSignal(name = "validate") @AknotSignal
@EwolDescription(value = "Validate button is pressed") @AknotName(value = "validate")
@AknotDescription(value = "Validate button is pressed")
public Signal<String> signalValidate; //!< select file(s) public Signal<String> signalValidate; //!< select file(s)
// properties // properties
public String propertyPath = System.getProperty("user.home"); //!< Current path to explore public String propertyPath = System.getProperty("user.home"); //!< Current path to explore
@ -271,9 +273,9 @@ public class FileChooser extends Composer {
} }
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "file") @AknotName(value = "file")
public void setPropertyFile(final String propertyFile) { public void setPropertyFile(final String propertyFile) {
if (this.propertyFile.equals(propertyFile)) { if (this.propertyFile.equals(propertyFile)) {
return; return;
@ -282,10 +284,10 @@ public class FileChooser extends Composer {
onChangePropertyFile(); onChangePropertyFile();
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "label-cancel") @AknotName(value = "label-cancel")
@EwolDescription(value = "Label for cancel button") @AknotDescription(value = "Label for cancel button")
public void setPropertyLabelCancel(final String propertyLabelCancel) { public void setPropertyLabelCancel(final String propertyLabelCancel) {
if (this.propertyLabelCancel.equals(propertyLabelCancel)) { if (this.propertyLabelCancel.equals(propertyLabelCancel)) {
return; return;
@ -294,10 +296,10 @@ public class FileChooser extends Composer {
onChangePropertyLabelCancel(); onChangePropertyLabelCancel();
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "title") @AknotName(value = "title")
@EwolDescription(value = "Titile of the Pop-up") @AknotDescription(value = "Titile of the Pop-up")
public void setPropertyLabelTitle(final String propertyLabelTitle) { public void setPropertyLabelTitle(final String propertyLabelTitle) {
if (this.propertyLabelTitle.equals(propertyLabelTitle)) { if (this.propertyLabelTitle.equals(propertyLabelTitle)) {
return; return;
@ -306,10 +308,10 @@ public class FileChooser extends Composer {
onChangePropertyLabelTitle(); onChangePropertyLabelTitle();
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "label-validate") @AknotName(value = "label-validate")
@EwolDescription(value = "Label for validate button") @AknotDescription(value = "Label for validate button")
public void setPropertyLabelValidate(final String propertyLabelValidate) { public void setPropertyLabelValidate(final String propertyLabelValidate) {
if (this.propertyLabelValidate.equals(propertyLabelValidate)) { if (this.propertyLabelValidate.equals(propertyLabelValidate)) {
return; return;
@ -318,10 +320,10 @@ public class FileChooser extends Composer {
onChangePropertyLabelValidate(); onChangePropertyLabelValidate();
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "path") @AknotName(value = "path")
@EwolDescription(value = "Path of the File chooser") @AknotDescription(value = "Path of the File chooser")
public void setPropertyPath(final String propertyPath) { public void setPropertyPath(final String propertyPath) {
if (this.propertyPath.equals(propertyPath)) { if (this.propertyPath.equals(propertyPath)) {
return; return;

View File

@ -1,9 +1,12 @@
package org.atriasoft.ewol.widget.meta; package org.atriasoft.ewol.widget.meta;
import org.atriasoft.aknot.annotation.AknotAttribute;
import org.atriasoft.aknot.annotation.AknotDescription;
import org.atriasoft.aknot.annotation.AknotManaged;
import org.atriasoft.aknot.annotation.AknotName;
import org.atriasoft.etk.Uri; import org.atriasoft.etk.Uri;
import org.atriasoft.etk.math.Vector3b; import org.atriasoft.etk.math.Vector3b;
import org.atriasoft.ewol.Gravity; import org.atriasoft.ewol.Gravity;
import org.atriasoft.ewol.annotation.EwolDescription;
import org.atriasoft.ewol.internal.Log; import org.atriasoft.ewol.internal.Log;
import org.atriasoft.ewol.resource.ResourceConfigFile; import org.atriasoft.ewol.resource.ResourceConfigFile;
import org.atriasoft.ewol.widget.Button; import org.atriasoft.ewol.widget.Button;
@ -12,9 +15,6 @@ import org.atriasoft.ewol.widget.Entry;
import org.atriasoft.ewol.widget.Sizer; import org.atriasoft.ewol.widget.Sizer;
import org.atriasoft.ewol.widget.Widget; import org.atriasoft.ewol.widget.Widget;
import org.atriasoft.ewol.widget.model.SpinPosition; import org.atriasoft.ewol.widget.model.SpinPosition;
import org.atriasoft.exml.annotation.XmlAttribute;
import org.atriasoft.exml.annotation.XmlManaged;
import org.atriasoft.exml.annotation.XmlName;
/** /**
* @ingroup ewolWidgetGroup * @ingroup ewolWidgetGroup
@ -53,18 +53,18 @@ public class SpinBase extends Sizer {
updateGui(); updateGui();
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "shape") @AknotName(value = "shape")
@EwolDescription(value = "shape for the display") @AknotDescription(value = "shape for the display")
public Uri getPropertyShape() { public Uri getPropertyShape() {
return this.propertyShape; return this.propertyShape;
} }
@XmlManaged @AknotManaged
@XmlAttribute @AknotAttribute
@XmlName(value = "spin-mode") @AknotName(value = "spin-mode")
@EwolDescription(value = "The display spin mode") @AknotDescription(value = "The display spin mode")
public SpinPosition getPropertySpinMode() { public SpinPosition getPropertySpinMode() {
return this.propertySpinMode; return this.propertySpinMode;
} }