[DEV] remove dependency with scenarium
This commit is contained in:
parent
e179925a5f
commit
f0eb83909f
@ -1,29 +1,32 @@
|
||||
<composer>
|
||||
<Composer>
|
||||
<Sizer mode="VERTICAL" lock="true" fill="true" expand="true">
|
||||
<Label name="[{ID}]file-chooser:title-label">_T{Change height map}</Label>
|
||||
<Sizer mode="HORIZONTAL">
|
||||
<Image name="[{ID}]HeighMap:img-radius" src="width.svg" expand="false" size="45,45px"/>
|
||||
<Sizer mode="HORIZONTAL" lock="true" expand="true,false,false">
|
||||
<Image src="width.svg" expand="false" image-size="48,48px"/>
|
||||
<Spacer min-size="2,2mm"/>
|
||||
<Slider name="[{ID}]HeighMap:slider-width"
|
||||
expand="true,false"
|
||||
fill="true,false"
|
||||
onChangeValue="onChangeRadius($1)" />
|
||||
minimum="0.1"
|
||||
maximum="40" />
|
||||
</Sizer>
|
||||
<Sizer mode="HORIZONTAL">
|
||||
<Image name="[{ID}]HeighMap:img-top" src="top.svg" expand="false" size="45,45px"/>
|
||||
<Sizer mode="HORIZONTAL" lock="true" expand="true,false,false">
|
||||
<Image src="top.svg" expand="false" image-size="48,48px"/>
|
||||
<Spacer min-size="2,2mm"/>
|
||||
<Slider name="[{ID}]HeighMap:slider-top"
|
||||
expand="true,false"
|
||||
fill="true,false"
|
||||
onChangeValue="onChangeTop($1)" />
|
||||
minimum="-128"
|
||||
maximum="128" />
|
||||
</Sizer>
|
||||
<Sizer mode="HORIZONTAL">
|
||||
<Image name="[{ID}]HeighMap:img-bottom" src="bottom.svg" expand="false" size="45,45px"/>
|
||||
<Sizer mode="HORIZONTAL" lock="true" expand="true,false,false">
|
||||
<Image src="bottom.svg" expand="false" image-size="48,48px"/>
|
||||
<Spacer min-size="2,2mm"/>
|
||||
<Slider name="[{ID}]HeighMap:slider-bottom"
|
||||
expand="true,false"
|
||||
fill="true,false"
|
||||
onChangeValue="onChangeBottom($1)" />
|
||||
minimum="-128"
|
||||
maximum="128"/>
|
||||
</Sizer>
|
||||
</Sizer>
|
||||
</composer>
|
||||
</Composer>
|
@ -13,8 +13,8 @@ import org.atriasoft.loader3d.resources.ResourceMeshHeightMap;
|
||||
import toolbox.Maths;
|
||||
|
||||
public class Ground {
|
||||
int sizeX = 16;
|
||||
int sizeY = 16;
|
||||
int sizeX = 64;
|
||||
int sizeY = 64;
|
||||
float[][] heightMap = new float[this.sizeY][this.sizeX];
|
||||
String[][] colorMap = new String[this.sizeY][this.sizeX * 2];
|
||||
ResourceMeshHeightMap mesh = new ResourceMeshHeightMap();
|
||||
|
@ -1,7 +1,7 @@
|
||||
package sample.atriasoft.ege.mapFactory;
|
||||
|
||||
import io.scenarium.logger.LogLevel;
|
||||
import io.scenarium.logger.Logger;
|
||||
import org.atriasoft.reggol.LogLevel;
|
||||
import org.atriasoft.reggol.Logger;
|
||||
|
||||
public class Log {
|
||||
private static final boolean FORCE_ALL = false;
|
||||
|
@ -4,22 +4,14 @@ import org.atriasoft.etk.math.Vector3b;
|
||||
import org.atriasoft.ewol.widget.Button;
|
||||
import org.atriasoft.ewol.widget.Sizer;
|
||||
import org.atriasoft.ewol.widget.Sizer.DisplayMode;
|
||||
import org.atriasoft.ewol.widget.Widget;
|
||||
import org.atriasoft.ewol.widget.Windows;
|
||||
|
||||
import sample.atriasoft.ege.mapFactory.tools.MapToolInterface;
|
||||
import sample.atriasoft.ege.mapFactory.tools.ToolMapHeight;
|
||||
|
||||
public class MainWindows extends Windows {
|
||||
|
||||
public static void eventButtonIncrease(final MainWindows self, Boolean value) {
|
||||
//Vector2b state = self.testWidget.getPropertyFill();
|
||||
//self.testWidget.setPropertyFill(state.withY(!state.y()));
|
||||
// if (self.heightButton.getPropertyValue() == "Increase") {
|
||||
// self.heightButton.setPropertyValue("Decrease");
|
||||
// } else {
|
||||
// self.heightButton.setPropertyValue("Increase");
|
||||
// }
|
||||
}
|
||||
|
||||
public static void eventButtonTool(final MainWindows self, Boolean value) {
|
||||
//Vector2b state = self.testWidget.getPropertyFill();
|
||||
//self.testWidget.setPropertyFill(state.withY(!state.y()));
|
||||
@ -60,15 +52,11 @@ public class MainWindows extends Windows {
|
||||
sizerMenu.subWidgetAdd(this.toolButton);
|
||||
this.toolButton.signalValue.connectAuto(this, MainWindows::eventButtonTool);
|
||||
|
||||
this.heightButton = Button.createToggleLabelButton("Increase", "Decrease");
|
||||
this.heightButton.setPropertyExpand(Vector3b.TRUE_FALSE_FALSE);
|
||||
this.heightButton.setPropertyFill(Vector3b.TRUE);
|
||||
sizerMenu.subWidgetAdd(this.heightButton);
|
||||
this.heightButton.signalValue.connectAuto(this, MainWindows::eventButtonIncrease);
|
||||
|
||||
// set default tools:
|
||||
this.scene.setCurrentTool(new ToolMapHeight());
|
||||
|
||||
MapToolInterface tool = new ToolMapHeight();
|
||||
this.scene.setCurrentTool(tool);
|
||||
Widget toolDisplay = tool.getWidget();
|
||||
sizerMenu.subWidgetAdd(toolDisplay);
|
||||
}
|
||||
|
||||
}
|
@ -2,11 +2,14 @@ package sample.atriasoft.ege.mapFactory.tools;
|
||||
|
||||
import org.atriasoft.ewol.event.EventEntry;
|
||||
import org.atriasoft.ewol.event.EventInput;
|
||||
import org.atriasoft.ewol.widget.Widget;
|
||||
|
||||
import sample.atriasoft.ege.mapFactory.EgeScene;
|
||||
import sample.atriasoft.ege.mapFactory.model.Map;
|
||||
|
||||
public interface MapToolInterface {
|
||||
Widget getWidget();
|
||||
|
||||
void onDraw(Map map);
|
||||
|
||||
boolean onEventEntry(final EventEntry event, Map map, EgeScene widget);
|
||||
|
@ -2,10 +2,14 @@ package sample.atriasoft.ege.mapFactory.tools;
|
||||
|
||||
import org.atriasoft.ege.geometry.Ray;
|
||||
import org.atriasoft.etk.Color;
|
||||
import org.atriasoft.etk.Uri;
|
||||
import org.atriasoft.etk.math.Transform3D;
|
||||
import org.atriasoft.etk.math.Vector3f;
|
||||
import org.atriasoft.ewol.event.EventEntry;
|
||||
import org.atriasoft.ewol.event.EventInput;
|
||||
import org.atriasoft.ewol.widget.Composer;
|
||||
import org.atriasoft.ewol.widget.Slider;
|
||||
import org.atriasoft.ewol.widget.Widget;
|
||||
import org.atriasoft.gale.key.KeyStatus;
|
||||
import org.atriasoft.gale.resource.ResourceColored3DObject;
|
||||
|
||||
@ -15,7 +19,24 @@ import sample.atriasoft.ege.mapFactory.model.Map;
|
||||
import toolbox.Maths;
|
||||
|
||||
public class ToolMapHeight implements MapToolInterface {
|
||||
protected static void onCallbackMaxChange(final ToolMapHeight self, final float value) {
|
||||
Log.warning("get new value {}", value);
|
||||
self.onCallbackMax(value);
|
||||
}
|
||||
|
||||
protected static void onCallbackMinChange(final ToolMapHeight self, final float value) {
|
||||
Log.warning("get new value {}", value);
|
||||
self.onCallbackMin(value);
|
||||
}
|
||||
|
||||
protected static void onCallbackWidthChange(final ToolMapHeight self, final float value) {
|
||||
Log.warning("get new value {}", value);
|
||||
self.onCallbackValue(value);
|
||||
}
|
||||
|
||||
int uniqueID = 555245;
|
||||
Vector3f positionRay = null;
|
||||
|
||||
float widthBrush = 3.0f;
|
||||
float maxBrush = 10.0f;
|
||||
float minBrush = -10.0f;
|
||||
@ -25,6 +46,35 @@ public class ToolMapHeight implements MapToolInterface {
|
||||
this.dynamicElement = ResourceColored3DObject.create();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Widget getWidget() {
|
||||
final Widget data = Composer.composerGenerateFile(new Uri("DATA", "ToolMapHeight.xml"), this.uniqueID);
|
||||
|
||||
if (data.getSubObjectNamed("[" + Long.toString(this.uniqueID) + "]HeighMap:slider-width") instanceof final Slider tmp) {
|
||||
tmp.signalValue.connectAuto(this, ToolMapHeight::onCallbackWidthChange);
|
||||
}
|
||||
if (data.getSubObjectNamed("[" + Long.toString(this.uniqueID) + "]HeighMap:slider-top") instanceof final Slider tmp) {
|
||||
tmp.signalValue.connectAuto(this, ToolMapHeight::onCallbackMaxChange);
|
||||
}
|
||||
if (data.getSubObjectNamed("[" + Long.toString(this.uniqueID) + "]HeighMap:slider-bottom") instanceof final Slider tmp) {
|
||||
tmp.signalValue.connectAuto(this, ToolMapHeight::onCallbackMinChange);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
protected void onCallbackMax(final float value) {
|
||||
this.maxBrush = value;
|
||||
}
|
||||
|
||||
protected void onCallbackMin(final float value) {
|
||||
this.minBrush = value;
|
||||
}
|
||||
|
||||
protected void onCallbackValue(final float value) {
|
||||
this.widthBrush = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDraw(Map map) {
|
||||
// TODO Auto-generated method stub
|
||||
|
@ -1,7 +1,7 @@
|
||||
package org.atriasoft.eagle.internal;
|
||||
|
||||
import io.scenarium.logger.LogLevel;
|
||||
import io.scenarium.logger.Logger;
|
||||
import org.atriasoft.reggol.LogLevel;
|
||||
import org.atriasoft.reggol.Logger;
|
||||
|
||||
public class Log {
|
||||
private static final String LIB_NAME = "eagle";
|
||||
|
@ -1,7 +1,7 @@
|
||||
package org.atriasoft.ege.internal;
|
||||
|
||||
import io.scenarium.logger.LogLevel;
|
||||
import io.scenarium.logger.Logger;
|
||||
import org.atriasoft.reggol.LogLevel;
|
||||
import org.atriasoft.reggol.Logger;
|
||||
|
||||
public class Log {
|
||||
private static final boolean FORCE_ALL = false;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package org.atriasoft.garoux.internal;
|
||||
|
||||
import io.scenarium.logger.LogLevel;
|
||||
import io.scenarium.logger.Logger;
|
||||
import org.atriasoft.reggol.LogLevel;
|
||||
import org.atriasoft.reggol.Logger;
|
||||
|
||||
public class Log {
|
||||
private static final String LIB_NAME = "garoux";
|
||||
|
@ -1,7 +1,7 @@
|
||||
package org.atriasoft.phyligram.internal;
|
||||
|
||||
import io.scenarium.logger.LogLevel;
|
||||
import io.scenarium.logger.Logger;
|
||||
import org.atriasoft.reggol.LogLevel;
|
||||
import org.atriasoft.reggol.Logger;
|
||||
|
||||
public class Log {
|
||||
private static final String LIB_NAME = "phyligram";
|
||||
|
@ -1,7 +1,7 @@
|
||||
package test.atriasoft.ege;
|
||||
|
||||
import io.scenarium.logger.LogLevel;
|
||||
import io.scenarium.logger.Logger;
|
||||
import org.atriasoft.reggol.LogLevel;
|
||||
import org.atriasoft.reggol.Logger;
|
||||
|
||||
public class Log {
|
||||
private static final String LIB_NAME = "ege-test";
|
||||
|
@ -1,7 +1,7 @@
|
||||
package test.atriasoft.ege;
|
||||
|
||||
import io.scenarium.logger.LogLevel;
|
||||
import io.scenarium.logger.Logger;
|
||||
import org.atriasoft.reggol.LogLevel;
|
||||
import org.atriasoft.reggol.Logger;
|
||||
|
||||
public class Log2 {
|
||||
private static final String LIB_NAME = "ege-test-2";
|
||||
|
@ -11,7 +11,7 @@ package test.atriasoft.ege;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.scenarium.logger.Logger;
|
||||
import org.atriasoft.reggol.Logger;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
|
||||
|
Loading…
x
Reference in New Issue
Block a user