[DEV] clean request of periodic call

This commit is contained in:
Edouard DUPIN 2021-06-01 00:11:04 +02:00
parent 8128f19f7b
commit f595e4cfd0

View File

@ -157,9 +157,10 @@ public class Entry extends Widget {
protected void changeStatusIn(final GuiShapeMode newStatusId) { protected void changeStatusIn(final GuiShapeMode newStatusId) {
if (this.shape.changeStatusIn(newStatusId)) { if (this.shape.changeStatusIn(newStatusId)) {
Log.error("REQUEST: connection on operiodic call"); if (!this.periodicConnectionHanble.isConnected()) {
this.periodicConnectionHanble.close(); Log.error("REQUEST: connection on operiodic call");
this.periodicConnectionHanble = EwolObject.getObjectManager().periodicCall.connectDynamic(this, eventTime -> { periodicCall(eventTime);}); this.periodicConnectionHanble = EwolObject.getObjectManager().periodicCall.connectDynamic(this, eventTime -> { periodicCall(eventTime);});
}
markToRedraw(); markToRedraw();
} }
} }
@ -347,7 +348,7 @@ public class Entry extends Widget {
@Override @Override
public boolean onEventEntry(final EventEntry event) { public boolean onEventEntry(final EventEntry event) {
Log.warning("Event on Entry ... " + event); Log.verbose("Event on Entry ... " + event);
if (event.type() == KeyKeyboard.CHARACTER) { if (event.type() == KeyKeyboard.CHARACTER) {
if (event.status() == KeyStatus.down) { if (event.status() == KeyStatus.down) {
// remove current selected data ... // remove current selected data ...
@ -424,18 +425,16 @@ public class Entry extends Widget {
@Override @Override
public boolean onEventInput(final EventInput event) { public boolean onEventInput(final EventInput event) {
Vector2f relPos = relativePosition(event.pos()); Vector2f relPos = relativePosition(event.pos());
Log.warning("Event on Input ... " + event + " relPos = "+ relPos); Log.verbose("Event on Input ... " + event + " relPos = "+ relPos);
if (event.inputId() == 0) { if (event.inputId() == 0) {
if (!isFocused()) { if (!isFocused()) {
if (KeyStatus.leave == event.status()) { if (KeyStatus.leave == event.status()) {
changeStatusIn(GuiShapeMode.NORMAL); changeStatusIn(GuiShapeMode.NORMAL);
} else { } else {
Log.warning("Detect Over : " + this.overPositionStart + " -> " + this.overPositionStop); Log.verbose("Detect Over : " + this.overPositionStart + " -> " + this.overPositionStop);
if (relPos.x() > this.overPositionStart.x() && relPos.y() > this.overPositionStart.y() && relPos.x() < this.overPositionStop.x() && relPos.y() < this.overPositionStop.y()) { if (relPos.x() > this.overPositionStart.x() && relPos.y() > this.overPositionStart.y() && relPos.x() < this.overPositionStop.x() && relPos.y() < this.overPositionStop.y()) {
Log.warning("Detect mouse inside ....");
changeStatusIn(GuiShapeMode.OVER); changeStatusIn(GuiShapeMode.OVER);
} else { } else {
Log.warning("Detect mouse outside ....");
changeStatusIn(GuiShapeMode.NORMAL); changeStatusIn(GuiShapeMode.NORMAL);
} }
} }
@ -585,8 +584,7 @@ public class Entry extends Widget {
this.gc.setColorStroke(Color.GREEN); this.gc.setColorStroke(Color.GREEN);
this.gc.setStrokeWidth(5); this.gc.setStrokeWidth(5);
//this.gc.rectangleRounded(new Vector2f(20, 2), new Vector2f(55, 70), new Vector2f(15, 15)); //this.gc.rectangleRounded(new Vector2f(20, 2), new Vector2f(55, 70), new Vector2f(15, 15));
this.gc.line(new Vector2f(this.displayCursorPositionPixel, 2), new Vector2f(this.displayCursorPositionPixel, 70)); this.gc.line(new Vector2f(this.displayCursorPositionPixel, 2), new Vector2f(this.displayCursorPositionPixel, this.gc.getTextHeight()-4));
this.gc.line(new Vector2f(this.displayCursorPosSelection, 2), new Vector2f(this.displayCursorPositionPixel, 70));
this.gc.setColorFill(Color.BLACK); this.gc.setColorFill(Color.BLACK);