Skip to content

Commit

Permalink
Various code cleanups, removal of unused config, started using SVG fo…
Browse files Browse the repository at this point in the history
…r the globe icon (easier to replace via CSS).
  • Loading branch information
dlemmermann committed Nov 12, 2023
1 parent 047108a commit 522e7fc
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 95 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
[![Maven Central](https://img.shields.io/maven-central/v/com.dlsc.phonenumberfx/phonenumberfx)](https://search.maven.org/search?q=g:com.dlsc.phonenumberfx%20AND%20a:phonenumberfx)

This repository contains a single control that is being used for entering valid phone numbers
for any country in the world. The library has a dependency to Google's _libphonenumber_ library,
for any country in the world. The library has a dependency to [Google's _libphonenumber_ library](https://github.com/google/libphonenumber/),
which is rather big in size, hence we decided to distribute this control via its own project on
GitHub (as opposed to adding it to the GemsFX project.)

The demo website of Google's library [can be found here](https://libphonenumber.appspot.com).
59 changes: 0 additions & 59 deletions phonenumberfx-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,6 @@
<main.class>com.dlsc.phonenumberfx.demo.PhoneNumberFieldApp</main.class>
</properties>

<repositories>
<repository>
<id>jpro - sandec repository</id>
<url>https://sandec.jfrog.io/artifactory/repo</url>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<id>jpro - sandec repository</id>
<url>https://sandec.jfrog.io/artifactory/repo</url>
</pluginRepository>
</pluginRepositories>

<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -118,33 +104,6 @@
</executions>
</plugin>

<plugin>
<groupId>com.sandec.jpro</groupId>
<artifactId>jpro-maven-plugin</artifactId>
<version>2022.1.8</version>
<configuration>
<visible>false</visible>
<mainClassName>
${main.class}
</mainClassName>
<openingPath>/</openingPath>
</configuration>
<executions>
<execution>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>create-jpro-release</id>
<phase>package</phase>
<goals>
<goal>release</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>

Expand Down Expand Up @@ -179,24 +138,6 @@
</exclusions>
</dependency>

<dependency>
<groupId>com.sandec.jpro</groupId>
<artifactId>jpro-webapi</artifactId>
<version>2022.1.8</version>
<exclusions>
<exclusion>
<groupId>org.openjfx</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>fr.brouillard.oss</groupId>
<artifactId>cssfx</artifactId>
<version>11.5.1</version>
</dependency>

<dependency>
<groupId>com.dlsc.phonenumberfx</groupId>
<artifactId>phonenumberfx</artifactId>
Expand Down
4 changes: 0 additions & 4 deletions phonenumberfx-demo/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@

requires javafx.controls;

requires jpro.webapi;

requires fr.brouillard.oss.cssfx;

requires com.dlsc.phonenumberfx;

exports com.dlsc.phonenumberfx.demo;
Expand Down
18 changes: 0 additions & 18 deletions phonenumberfx/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,6 @@
<version>8.13.24</version>
</dependency>

<dependency>
<groupId>org.kordamp.ikonli</groupId>
<artifactId>ikonli-core</artifactId>
<version>${ikonli.version}</version>
</dependency>

<dependency>
<groupId>org.kordamp.ikonli</groupId>
<artifactId>ikonli-javafx</artifactId>
<version>${ikonli.version}</version>
</dependency>

<dependency>
<groupId>org.kordamp.ikonli</groupId>
<artifactId>ikonli-bootstrapicons-pack</artifactId>
<version>${ikonli.version}</version>
</dependency>

<!-- Testing -->

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@
import javafx.scene.image.ImageView;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.Region;
import javafx.scene.layout.StackPane;
import javafx.util.Callback;
import org.kordamp.ikonli.bootstrapicons.BootstrapIcons;
import org.kordamp.ikonli.javafx.FontIcon;

import java.util.ArrayList;
import java.util.HashMap;
Expand Down Expand Up @@ -112,7 +111,9 @@ public PhoneNumberField() {
return wrapper;
}

return new FontIcon(BootstrapIcons.GLOBE2);
Region globeRegion = new Region();
globeRegion.getStyleClass().add("globe");
return globeRegion;
});
}

Expand Down
3 changes: 0 additions & 3 deletions phonenumberfx/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
requires transitive javafx.controls;

requires libphonenumber;
requires org.kordamp.ikonli.core;
requires org.kordamp.ikonli.javafx;
requires org.kordamp.ikonli.bootstrapicons;

exports com.dlsc.phonenumberfx;
exports com.dlsc.phonenumberfx.skins;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.phone-number-field {

}

.phone-number-field > .combo-box {
Expand Down Expand Up @@ -63,6 +62,20 @@
-fx-alignment: center;
}

.phone-number-field > .combo-box .globe {
-size: 1.2em;
-fx-pref-width: -size;
-fx-pref-height: -size;
-fx-min-width: -size;
-fx-min-height: -size;
-fx-max-width: -size;
-fx-max-height: -size;
-fx-background: -fx-control-inner-background;
-fx-background-color: -fx-text-background-color;
-fx-scale-shape: true;
-fx-shape: "M0 12 Q0 8.7188 1.5938 5.9688 Q3.2031 3.2031 5.9531 1.6094 Q8.7188 0 12 0 Q15.2812 0 18.0312 1.6094 Q20.7969 3.2031 22.3906 5.9688 Q24 8.7188 24 12 Q24 15.2812 22.3906 18.0469 Q20.7969 20.7969 18.0312 22.4062 Q15.2812 24 12 24 Q8.7188 24 5.9531 22.4062 Q3.2031 20.7969 1.5938 18.0469 Q0 15.2812 0 12 ZM11.2812 1.5938 Q9.6875 2.0781 8.4062 4.4062 Q8.0781 5.0469 7.8438 5.6875 Q9.4375 6.0781 11.2812 6.1562 L11.2812 1.5938 ZM6.4062 5.2812 Q6.7188 4.4844 7.1094 3.7188 Q7.5156 2.9531 8 2.3125 Q6.0781 3.125 4.5625 4.5625 Q5.4375 4.9531 6.4062 5.2812 ZM5.2812 11.2812 Q5.3594 8.875 5.9219 6.7188 Q4.7188 6.3125 3.5938 5.7656 Q1.7656 8.1562 1.5156 11.2812 L5.2812 11.2812 ZM7.3594 7.125 Q6.7969 9.2031 6.7969 11.2812 L11.2812 11.2812 L11.2812 7.5938 Q9.2031 7.5938 7.3594 7.125 ZM12.7188 7.5938 L12.7188 11.2812 L17.2031 11.2812 Q17.2031 9.2031 16.6406 7.125 Q14.7969 7.5938 12.7188 7.5938 ZM6.7969 12.7188 Q6.875 14.9531 7.3594 16.875 Q9.2812 16.4062 11.2812 16.4062 L11.2812 12.7188 L6.7969 12.7188 ZM12.7188 12.7188 L12.7188 16.4062 Q14.7969 16.4062 16.6406 16.875 Q17.125 14.9531 17.2031 12.7188 L12.7188 12.7188 ZM7.8438 18.3125 Q8.0781 19.0469 8.4062 19.5938 Q9.6875 21.9219 11.2812 22.4062 L11.2812 17.8438 Q9.4375 17.9219 7.8438 18.3125 ZM8 21.6875 Q7.5156 21.0469 7.1094 20.2812 Q6.7188 19.5156 6.4062 18.7188 Q5.4375 18.9531 4.5625 19.4375 Q6.0781 20.875 8 21.6875 ZM5.9219 17.2812 Q5.3594 15.0469 5.2812 12.7188 L1.5156 12.7188 Q1.7656 15.8438 3.5938 18.2344 Q4.6406 17.6875 5.9219 17.2812 ZM16 21.6875 Q17.9219 20.875 19.4375 19.4375 Q18.5625 18.9531 17.5938 18.7188 Q17.2812 19.5156 16.875 20.2812 Q16.4844 21.0469 16 21.6875 ZM12.7188 17.8438 L12.7188 22.4062 Q14.3125 21.9219 15.5938 19.5938 Q15.9219 18.9531 16.1562 18.3125 Q14.4844 17.9219 12.7188 17.8438 ZM18.0781 17.2812 Q19.3594 17.6875 20.4062 18.2344 Q22.2344 15.8438 22.4844 12.7188 L18.7188 12.7188 Q18.6406 15.0469 18.0781 17.2812 ZM22.4844 11.2812 Q22.2344 8.1562 20.4062 5.7656 Q19.3594 6.3125 18.0781 6.7188 Q18.6406 8.875 18.7188 11.2812 L22.4844 11.2812 ZM16.875 3.6875 Q17.2812 4.4844 17.5938 5.2812 Q18.5625 5.0469 19.4375 4.5625 Q17.9219 3.125 16 2.3125 Q16.4844 2.9531 16.875 3.6875 ZM16.1562 5.6875 Q15.9219 5.0469 15.5938 4.4062 Q14.3125 2.0781 12.7188 1.5938 L12.7188 6.1562 Q14.5625 6.0781 16.1562 5.6875 Z"
}

.phone-number-field > .combo-box .list-view .country-calling-code-cell {
-fx-padding: 5px;
}
Expand Down
Binary file not shown.
6 changes: 0 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,10 @@
</scm>

<properties>
<project.identifier>phonenumberfx</project.identifier>
<project.github.repository>dlsc-software-consulting-gmbh/PhoneNumberFX</project.github.repository>
<local.repository.path>/tmp/repository</local.repository.path>
<java.version>11</java.version>
<javafx.version>17.0.8</javafx.version>
<ikonli.version>12.3.1</ikonli.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<asciidoctor.maven.plugin.version>1.6.0</asciidoctor.maven.plugin.version>
<asciidoctorj.version>1.6.2</asciidoctorj.version>
<jruby.version>9.2.6.0</jruby.version>
</properties>

<dependencyManagement>
Expand Down

0 comments on commit 522e7fc

Please sign in to comment.