[FEAT] use Maven a build system root tool

This commit is contained in:
Edouard DUPIN 2024-06-07 09:26:18 +02:00
parent 8dc72f00ed
commit b60809bc81
5 changed files with 30 additions and 38 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="out/maven/classes" path="src">
<classpathentry including="**/*.java" kind="src" output="out/maven/classes" path="src">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
@ -13,7 +13,7 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>

View File

@ -52,7 +52,7 @@ def configure(target, my_module):
'src/org/atriasoft/etk/util/Pair.java',
'src/org/atriasoft/etk/util/Dynamic.java',
'src/org/atriasoft/etk/util/ArraysTools.java',
'src/org/atriasoft/etk/internal/Log.java',
'src/org/atriasoft/etk/internal/LOGGER.java',
'src/org/atriasoft/etk/theme/Theme.java',
'src/org/atriasoft/etk/Tools.java',
'src/org/atriasoft/etk/Configs.java',

15
pom.xml
View File

@ -1,30 +1,29 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>jatria-soft</groupId>
<groupId>org.atriasoft</groupId>
<artifactId>etk</artifactId>
<version>0.1.0</version>
<properties>
<maven.compiler.version>3.1</maven.compiler.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.version>3.13.0</maven.compiler.version>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.dependency.version>3.1.1</maven.dependency.version>
</properties>
<repositories>
<repository>
<id>gitea</id>
<url>https://gitea.atria-soft.org/api/packages/jatria-soft/maven</url>
<url>https://gitea.atria-soft.org/api/packages/org.atriasoft/maven</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>gitea</id>
<url>https://gitea.atria-soft.org/api/packages/jatria-soft/maven</url>
<url>https://gitea.atria-soft.org/api/packages/org.atriasoft/maven</url>
</repository>
<snapshotRepository>
<id>gitea</id>
<url>https://gitea.atria-soft.org/api/packages/jatria-soft/maven</url>
<url>https://gitea.atria-soft.org/api/packages/org.atriasoft/maven</url>
</snapshotRepository>
</distributionManagement>

View File

@ -63,26 +63,17 @@ public record Dimension1f(
* @return dimension in Pixel
*/
public float getPixel(final float upperSize) {
switch (this.type) {
case POURCENT:
return upperSize * this.size * 0.01f;
case PIXEL:
return this.size;
case METER:
return this.size * METER_TO_MILLIMETER * BASIC_RATIO;
case CENTIMETER:
return this.size * CENTIMETER_TO_MILLIMETER * BASIC_RATIO;
case MILLIMETER:
return this.size * BASIC_RATIO;
case KILOMETER:
return this.size * KILOMETER_TO_MILLIMETER * BASIC_RATIO;
case INCH:
return this.size * INCH_TO_MILLIMETER * BASIC_RATIO;
case FOOT:
return this.size * FOOT_TO_MILLIMETER * BASIC_RATIO;
default:
return 128.0f;
}
return switch (this.type) {
case POURCENT -> upperSize * this.size * 0.01f;
case PIXEL -> this.size;
case METER -> this.size * METER_TO_MILLIMETER * BASIC_RATIO;
case CENTIMETER -> this.size * CENTIMETER_TO_MILLIMETER * BASIC_RATIO;
case MILLIMETER -> this.size * BASIC_RATIO;
case KILOMETER -> this.size * KILOMETER_TO_MILLIMETER * BASIC_RATIO;
case INCH -> this.size * INCH_TO_MILLIMETER * BASIC_RATIO;
case FOOT -> this.size * FOOT_TO_MILLIMETER * BASIC_RATIO;
default -> 128.0f;
};
}
/**
@ -98,11 +89,11 @@ public record Dimension1f(
* @param config dimension configuration.
*/
public static Dimension1f valueOf(String config) {
final Distance type = Distance.parseEndSmallString(config);
Distance type = Distance.parseEndSmallString(config);
config = type.removeEndString(config);
if (type == Distance.UNKNOW) {
LOGGER.error("FATAL: Can not parse dimension : '" + config + "'");
return null;
LOGGER.error("FATAL: Can not parse dimension : '{}' CAn not deterùmine extention ... px, cm, ...", config);
type = Distance.PIXEL;
}
final float tmp = Float.valueOf(config);
return new Dimension1f(tmp, type);

View File

@ -132,7 +132,8 @@ public record Dimension2f(
case ELEMENT -> throw new UnsupportedOperationException("Unimplemented case: " + type);
case EX -> throw new UnsupportedOperationException("Unimplemented case: " + type);
case PC -> {
LOGGER.error("Does not support other than Px and % type of dimention : " + type + " automaticly convert with {72,72} pixel/inch");
LOGGER.error("Does not support other than Px and % type of dimention : " + type
+ " automaticly convert with {72,72} pixel/inch");
yield null;
}
case POINT -> throw new UnsupportedOperationException("Unimplemented case: " + type);
@ -217,7 +218,8 @@ public record Dimension2f(
if (this.type != Distance.POURCENT) {
return new Vector2i((int) this.size.x(), (int) this.size.y());
}
final Vector2i res = new Vector2i((int) (uppersize.x() * this.size.x() * 0.01f), (int) (uppersize.y() * this.size.y() * 0.01f));
final Vector2i res = new Vector2i((int) (uppersize.x() * this.size.x() * 0.01f),
(int) (uppersize.y() * this.size.y() * 0.01f));
//GALE_DEBUG("Get % : " + m_data + " / " + windDim + " == > " + res);
return res;
}
@ -269,13 +271,13 @@ public record Dimension2f(
return get(getType()).toString() + getType().toSmallString();
}
public static Dimension2f valueOf(String contentX, final String contentY) {
public static Dimension2f valueOf(String contentX, String contentY) {
final Distance typeX = Distance.parseEndSmallString(contentX);
contentX = typeX.removeEndString(contentX);
final float tmpX = Float.valueOf(contentX);
final Distance typeY = Distance.parseEndSmallString(contentY);
contentX = typeY.removeEndString(contentY);
contentY = typeY.removeEndString(contentY);
final float tmpY = Float.valueOf(contentY);
if (typeX != Distance.UNKNOW) {