[FEAT] use Maven a build system root tool
This commit is contained in:
parent
8dc72f00ed
commit
b60809bc81
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" output="out/maven/classes" path="src">
|
<classpathentry including="**/*.java" kind="src" output="out/maven/classes" path="src">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="optional" value="true"/>
|
<attribute name="optional" value="true"/>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
@ -13,7 +13,7 @@
|
|||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</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>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
@ -52,7 +52,7 @@ def configure(target, my_module):
|
|||||||
'src/org/atriasoft/etk/util/Pair.java',
|
'src/org/atriasoft/etk/util/Pair.java',
|
||||||
'src/org/atriasoft/etk/util/Dynamic.java',
|
'src/org/atriasoft/etk/util/Dynamic.java',
|
||||||
'src/org/atriasoft/etk/util/ArraysTools.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/theme/Theme.java',
|
||||||
'src/org/atriasoft/etk/Tools.java',
|
'src/org/atriasoft/etk/Tools.java',
|
||||||
'src/org/atriasoft/etk/Configs.java',
|
'src/org/atriasoft/etk/Configs.java',
|
||||||
|
15
pom.xml
15
pom.xml
@ -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">
|
<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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>jatria-soft</groupId>
|
<groupId>org.atriasoft</groupId>
|
||||||
<artifactId>etk</artifactId>
|
<artifactId>etk</artifactId>
|
||||||
<version>0.1.0</version>
|
<version>0.1.0</version>
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.version>3.1</maven.compiler.version>
|
<maven.compiler.version>3.13.0</maven.compiler.version>
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
<maven.compiler.source>21</maven.compiler.source>
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
<maven.compiler.target>21</maven.compiler.target>
|
||||||
|
|
||||||
<maven.dependency.version>3.1.1</maven.dependency.version>
|
<maven.dependency.version>3.1.1</maven.dependency.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>gitea</id>
|
<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>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<repository>
|
<repository>
|
||||||
<id>gitea</id>
|
<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>
|
</repository>
|
||||||
<snapshotRepository>
|
<snapshotRepository>
|
||||||
<id>gitea</id>
|
<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>
|
</snapshotRepository>
|
||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
|
|
||||||
|
@ -63,26 +63,17 @@ public record Dimension1f(
|
|||||||
* @return dimension in Pixel
|
* @return dimension in Pixel
|
||||||
*/
|
*/
|
||||||
public float getPixel(final float upperSize) {
|
public float getPixel(final float upperSize) {
|
||||||
switch (this.type) {
|
return switch (this.type) {
|
||||||
case POURCENT:
|
case POURCENT -> upperSize * this.size * 0.01f;
|
||||||
return upperSize * this.size * 0.01f;
|
case PIXEL -> this.size;
|
||||||
case PIXEL:
|
case METER -> this.size * METER_TO_MILLIMETER * BASIC_RATIO;
|
||||||
return this.size;
|
case CENTIMETER -> this.size * CENTIMETER_TO_MILLIMETER * BASIC_RATIO;
|
||||||
case METER:
|
case MILLIMETER -> this.size * BASIC_RATIO;
|
||||||
return this.size * METER_TO_MILLIMETER * BASIC_RATIO;
|
case KILOMETER -> this.size * KILOMETER_TO_MILLIMETER * BASIC_RATIO;
|
||||||
case CENTIMETER:
|
case INCH -> this.size * INCH_TO_MILLIMETER * BASIC_RATIO;
|
||||||
return this.size * CENTIMETER_TO_MILLIMETER * BASIC_RATIO;
|
case FOOT -> this.size * FOOT_TO_MILLIMETER * BASIC_RATIO;
|
||||||
case MILLIMETER:
|
default -> 128.0f;
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -98,11 +89,11 @@ public record Dimension1f(
|
|||||||
* @param config dimension configuration.
|
* @param config dimension configuration.
|
||||||
*/
|
*/
|
||||||
public static Dimension1f valueOf(String config) {
|
public static Dimension1f valueOf(String config) {
|
||||||
final Distance type = Distance.parseEndSmallString(config);
|
Distance type = Distance.parseEndSmallString(config);
|
||||||
config = type.removeEndString(config);
|
config = type.removeEndString(config);
|
||||||
if (type == Distance.UNKNOW) {
|
if (type == Distance.UNKNOW) {
|
||||||
LOGGER.error("FATAL: Can not parse dimension : '" + config + "'");
|
LOGGER.error("FATAL: Can not parse dimension : '{}' CAn not deterùmine extention ... px, cm, ...", config);
|
||||||
return null;
|
type = Distance.PIXEL;
|
||||||
}
|
}
|
||||||
final float tmp = Float.valueOf(config);
|
final float tmp = Float.valueOf(config);
|
||||||
return new Dimension1f(tmp, type);
|
return new Dimension1f(tmp, type);
|
||||||
|
@ -132,7 +132,8 @@ public record Dimension2f(
|
|||||||
case ELEMENT -> throw new UnsupportedOperationException("Unimplemented case: " + type);
|
case ELEMENT -> throw new UnsupportedOperationException("Unimplemented case: " + type);
|
||||||
case EX -> throw new UnsupportedOperationException("Unimplemented case: " + type);
|
case EX -> throw new UnsupportedOperationException("Unimplemented case: " + type);
|
||||||
case PC -> {
|
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;
|
yield null;
|
||||||
}
|
}
|
||||||
case POINT -> throw new UnsupportedOperationException("Unimplemented case: " + type);
|
case POINT -> throw new UnsupportedOperationException("Unimplemented case: " + type);
|
||||||
@ -217,7 +218,8 @@ public record Dimension2f(
|
|||||||
if (this.type != Distance.POURCENT) {
|
if (this.type != Distance.POURCENT) {
|
||||||
return new Vector2i((int) this.size.x(), (int) this.size.y());
|
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);
|
//GALE_DEBUG("Get % : " + m_data + " / " + windDim + " == > " + res);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -269,13 +271,13 @@ public record Dimension2f(
|
|||||||
return get(getType()).toString() + getType().toSmallString();
|
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);
|
final Distance typeX = Distance.parseEndSmallString(contentX);
|
||||||
contentX = typeX.removeEndString(contentX);
|
contentX = typeX.removeEndString(contentX);
|
||||||
final float tmpX = Float.valueOf(contentX);
|
final float tmpX = Float.valueOf(contentX);
|
||||||
|
|
||||||
final Distance typeY = Distance.parseEndSmallString(contentY);
|
final Distance typeY = Distance.parseEndSmallString(contentY);
|
||||||
contentX = typeY.removeEndString(contentY);
|
contentY = typeY.removeEndString(contentY);
|
||||||
final float tmpY = Float.valueOf(contentY);
|
final float tmpY = Float.valueOf(contentY);
|
||||||
|
|
||||||
if (typeX != Distance.UNKNOW) {
|
if (typeX != Distance.UNKNOW) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user