From 6a585211a1a8abd28f9f1530352aef3027a7982d Mon Sep 17 00:00:00 2001 From: Stanislav Date: Sun, 27 Mar 2022 21:32:25 +0300 Subject: [PATCH] Visual overhaul --- .github/workflows/windows.yml | 2 +- pom.xml | 12 +- .../LeagueTeamCompApplication.java | 33 +- .../LeagueTeamCompLauncher.java | 8 - .../controller/LeagueTeamCompController.java | 303 ++++++------- .../repository/ChampionRepository.java | 29 +- .../service/LeagueTeamCompService.java | 56 +++ src/main/resources/META-INF/MANIFEST.MF | 3 - .../META-INF/native-image/jni-config.json | 203 +++++++++ .../META-INF/native-image/reflect-config.json | 185 +++++++- .../native-image/resource-config.json | 42 +- .../com/st4s1k/leagueteamcomp/ltc-view.fxml | 368 ++++++++-------- .../com/st4s1k/leagueteamcomp/style.css | 400 +++++++++++++++++- 13 files changed, 1244 insertions(+), 400 deletions(-) delete mode 100644 src/main/java/com/st4s1k/leagueteamcomp/LeagueTeamCompLauncher.java create mode 100644 src/main/java/com/st4s1k/leagueteamcomp/service/LeagueTeamCompService.java delete mode 100644 src/main/resources/META-INF/MANIFEST.MF diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 3539ebc..081e9fe 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -28,7 +28,7 @@ jobs: gluon-license: ${{ secrets.GLUON_LICENSE }} - name: Gluon Build - run: mvn -Pdesktop gluonfx:build + run: mvn gluonfx:compile gluonfx:link - name: Create Release id: create_release diff --git a/pom.xml b/pom.xml index 23825fe..e37dfc5 100644 --- a/pom.xml +++ b/pom.xml @@ -18,12 +18,13 @@ 1.18.22 2.9.0 11.1.1 - 13.0.2 - 13.0.2 + 17 + 17 3.8.1 1.0.12 0.0.8 + 3.0.1 @@ -97,6 +98,7 @@ com.st4s1k.leagueteamcomp.LeagueTeamCompApplication + @@ -126,10 +128,12 @@ com.st4s1k.leagueteamcomp.controller.LeagueTeamCompController + --allow-incomplete-classpath --add-exports javafx.base/com.sun.javafx.event=org.controlsfx.controls --add-exports - com.gluonhq.attach.util/com.gluonhq.attach.util.impl=com.st4s1k.leagueteamcomp + com.gluonhq.attach.util/com.gluonhq.attach.util.impl=com.st4s1k.leagueteamcomp + --add-exports javafx.base/com.sun.javafx.event=ALL-UNNAMED --add-exports @@ -141,7 +145,7 @@ com.github.ekryd.sortpom sortpom-maven-plugin - 3.0.1 + ${sortpom.plugin.version} diff --git a/src/main/java/com/st4s1k/leagueteamcomp/LeagueTeamCompApplication.java b/src/main/java/com/st4s1k/leagueteamcomp/LeagueTeamCompApplication.java index e445a72..25e93a7 100644 --- a/src/main/java/com/st4s1k/leagueteamcomp/LeagueTeamCompApplication.java +++ b/src/main/java/com/st4s1k/leagueteamcomp/LeagueTeamCompApplication.java @@ -1,14 +1,16 @@ package com.st4s1k.leagueteamcomp; import com.google.gson.Gson; +import com.st4s1k.leagueteamcomp.controller.LeagueTeamCompController; import com.st4s1k.leagueteamcomp.model.champion.Champions; import com.st4s1k.leagueteamcomp.repository.ChampionRepository; import javafx.application.Application; import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; import javafx.scene.Scene; -import javafx.scene.control.TabPane; import javafx.scene.image.Image; import javafx.stage.Stage; +import javafx.stage.StageStyle; import lombok.SneakyThrows; import java.net.URI; @@ -16,11 +18,13 @@ import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.util.ResourceBundle; +import java.util.concurrent.CompletableFuture; import static java.net.http.HttpResponse.BodyHandlers; import static java.util.Objects.requireNonNull; public class LeagueTeamCompApplication extends Application { + public static final String ICON_FILE_PATH = "icon.png"; public static final String FXML_FILE_PATH = "ltc-view.fxml"; public static final String BUNDLE_PATH = "com.st4s1k.leagueteamcomp.ltc-view"; @@ -31,42 +35,43 @@ public class LeagueTeamCompApplication extends Application { private static final boolean WINDOW_IS_RESIZABLE = false; public static void main(String[] args) { - System.setProperty("javafx.platform", "Desktop"); launch(); } @Override @SneakyThrows public void start(Stage stage) { - preloadChampions(); - TabPane root = FXMLLoader.load( - requireNonNull(getClass().getResource(FXML_FILE_PATH)), - ResourceBundle.getBundle(BUNDLE_PATH) - ); + loadChampionData(); + FXMLLoader loader = new FXMLLoader(getClass().getResource(FXML_FILE_PATH), ResourceBundle.getBundle(BUNDLE_PATH)); + Parent root = loader.load(); + LeagueTeamCompController controller = loader.getController(); + controller.setStageAndSetupListeners(stage); Scene scene = new Scene(root, WINDOW_WIDTH, WINDOW_HEIGHT); stage.setScene(scene); stage.getIcons().add(new Image(requireNonNull(getClass().getResourceAsStream(ICON_FILE_PATH)))); stage.setTitle(WINDOW_TITLE); stage.setResizable(WINDOW_IS_RESIZABLE); stage.setOnCloseRequest(event -> closeProgram()); + stage.initStyle(StageStyle.UNDECORATED); stage.show(); } - @SneakyThrows - private void preloadChampions() { - Champions champions = getChampionsFromUrl(); - ChampionRepository.init(champions); + private void loadChampionData() { + CompletableFuture.runAsync(() -> ChampionRepository.init(getChampionsFromUrl())); } @SneakyThrows - private Champions getChampionsFromUrl() { + private CompletableFuture getChampionsFromUrl() { HttpRequest request = HttpRequest.newBuilder() .uri(new URI("http://cdn.merakianalytics.com/riot/lol/resources/latest/en-US/champions.json")) .build(); - String response = HttpClient.newHttpClient() + return HttpClient.newHttpClient() .sendAsync(request, BodyHandlers.ofString()) .thenApply(HttpResponse::body) - .join(); + .thenApply(this::getChampions); + } + + private Champions getChampions(String response) { String json = "{\"champions\":" + response + "}"; Champions champions = new Gson().fromJson(json, Champions.class); champions.getChampions().values() diff --git a/src/main/java/com/st4s1k/leagueteamcomp/LeagueTeamCompLauncher.java b/src/main/java/com/st4s1k/leagueteamcomp/LeagueTeamCompLauncher.java deleted file mode 100644 index f733f59..0000000 --- a/src/main/java/com/st4s1k/leagueteamcomp/LeagueTeamCompLauncher.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.st4s1k.leagueteamcomp; - -public class LeagueTeamCompLauncher { - - public static void main(String[] args) { - LeagueTeamCompApplication.main(args); - } -} diff --git a/src/main/java/com/st4s1k/leagueteamcomp/controller/LeagueTeamCompController.java b/src/main/java/com/st4s1k/leagueteamcomp/controller/LeagueTeamCompController.java index 0e307f0..6439bb0 100644 --- a/src/main/java/com/st4s1k/leagueteamcomp/controller/LeagueTeamCompController.java +++ b/src/main/java/com/st4s1k/leagueteamcomp/controller/LeagueTeamCompController.java @@ -3,38 +3,42 @@ import com.st4s1k.leagueteamcomp.model.SummonerRole; import com.st4s1k.leagueteamcomp.model.champion.AttributeRatings; import com.st4s1k.leagueteamcomp.model.champion.Champion; -import com.st4s1k.leagueteamcomp.repository.ChampionRepository; +import com.st4s1k.leagueteamcomp.service.LeagueTeamCompService; import javafx.collections.ListChangeListener; import javafx.collections.ObservableList; +import javafx.css.PseudoClass; import javafx.fxml.FXML; import javafx.fxml.Initializable; +import javafx.scene.Node; import javafx.scene.control.*; import javafx.scene.image.ImageView; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyEvent; -import javafx.scene.shape.Shape; +import javafx.scene.layout.GridPane; import javafx.scene.text.Text; import javafx.scene.text.TextFlow; -import lombok.SneakyThrows; -import org.controlsfx.control.textfield.TextFields; +import javafx.stage.Stage; import java.net.URL; import java.util.*; import java.util.function.DoubleBinaryOperator; -import java.util.function.ToDoubleFunction; import java.util.stream.IntStream; import java.util.stream.Stream; import static com.st4s1k.leagueteamcomp.model.SummonerRole.*; import static com.st4s1k.leagueteamcomp.service.SummonerRoleListGeneratorService.getCombinations; +import static java.util.function.Predicate.not; import static java.util.stream.Collectors.*; -import static javafx.scene.paint.Color.*; +import static javafx.geometry.Pos.CENTER; +import static javafx.scene.control.SelectionMode.MULTIPLE; +import static org.controlsfx.control.textfield.TextFields.bindAutoCompletion; public class LeagueTeamCompController implements Initializable { - private static final double OUTPUT_SCALE = 10; + private static double xOffset = 0; + private static double yOffset = 0; - private ChampionRepository championRepository; + private LeagueTeamCompService service; /* Role Compositions */ @@ -109,8 +113,19 @@ public class LeagueTeamCompController implements Initializable { @FXML private CheckBox cbJgl5; + @FXML + private Button generateButton; + @FXML + private Button resetButton; + /* Champion Suggestions */ + private static final PseudoClass CHAMPION_STAT_GOOD_PSEUDO_CLASS = PseudoClass.getPseudoClass("good"); + private static final PseudoClass CHAMPION_STAT_BAD_PSEUDO_CLASS = PseudoClass.getPseudoClass("bad"); + + @FXML + private Label teamCompResultLabel; + @FXML private TextField allySearchField; @FXML @@ -126,29 +141,96 @@ public class LeagueTeamCompController implements Initializable { private TextFlow enemyTeamResultTextFlow; @FXML - private Label teamCompResultLabel; + private GridPane gridPane; + @FXML + private TabPane tabPane; + @FXML + private Button minimizeButton; + @FXML + private Button closeButton; @Override public void initialize(URL url, ResourceBundle resourceBundle) { - championRepository = ChampionRepository.getInstance(); + service = LeagueTeamCompService.getInstance(); initializeRoleCompositions(); initializeChampionSuggestions(); } - private void initializeRoleCompositions() { + protected void onGenerateButtonClick() { + textArea.clear(); + var summonerNames = List.of( + tf1.getText(), + tf2.getText(), + tf3.getText(), + tf4.getText(), + tf5.getText() + ); + var playersToRoles = Stream.of( + Map.entry(tf1.getText(), getRoles(cbTop1, cbMid1, cbAdc1, cbSup1, cbJgl1)), + Map.entry(tf2.getText(), getRoles(cbTop2, cbMid2, cbAdc2, cbSup2, cbJgl2)), + Map.entry(tf3.getText(), getRoles(cbTop3, cbMid3, cbAdc3, cbSup3, cbJgl3)), + Map.entry(tf4.getText(), getRoles(cbTop4, cbMid4, cbAdc4, cbSup4, cbJgl4)), + Map.entry(tf5.getText(), getRoles(cbTop5, cbMid5, cbAdc5, cbSup5, cbJgl5)) + ).filter(entry -> !entry.getKey().isBlank()) + .filter(entry -> summonerNames.stream().filter(entry.getKey()::equals).count() == 1) + .collect(toMap(Map.Entry::getKey, Map.Entry::getValue)); + var combinations = getCombinations(playersToRoles); + var nameReservedSize = Integer.min(16, IntStream.of( + tf1.getLength(), + tf2.getLength(), + tf3.getLength(), + tf4.getLength(), + tf5.getLength() + ).max().getAsInt()); + var rows = combinations.stream() + .map(playerToRoleRow -> formatPLayerToRoleRow(playerToRoleRow, nameReservedSize)) + .toList(); + var rowsWithSeparator = rows.stream().map(this::appendSeparator).toList(); + rowsWithSeparator.forEach(textArea::appendText); + if (!rowsWithSeparator.isEmpty()) { + var lastRow = rows.get(rowsWithSeparator.size() - 1); + textArea.appendText(getSeparator(lastRow)); + } + } + + protected void onResetButtonClick() { + textArea.clear(); resetAllCheckboxes(); + } + + + public void setStageAndSetupListeners(Stage stage) { + tabPane.setOnMousePressed(event -> { + xOffset = stage.getX() - event.getScreenX(); + yOffset = stage.getY() - event.getScreenY(); + }); + tabPane.setOnMouseDragged(event -> { + stage.setX(event.getScreenX() + xOffset); + stage.setY(event.getScreenY() + yOffset); + }); + closeButton.setOnAction(actionEvent -> stage.close()); + minimizeButton.setOnAction(actionEvent -> stage.setIconified(true)); + } + + private void initializeRoleCompositions() { + gridPane.setAlignment(CENTER); textArea.setEditable(false); + resetAllCheckboxes(); + generateButton.setOnAction(actionEvent -> onGenerateButtonClick()); + resetButton.setOnAction(actionEvent -> onResetButtonClick()); } public void initializeChampionSuggestions() { - enemyList.setCellFactory(param -> populateListCells()); + allyList.getSelectionModel().setSelectionMode(MULTIPLE); + enemyList.getSelectionModel().setSelectionMode(MULTIPLE); + allyList.setCellFactory(param -> populateListCells()); + enemyList.setCellFactory(param -> populateListCells()); - var championKeys = championRepository.getAllChampionKeys(); - TextFields.bindAutoCompletion(enemySearchField, request -> - searchFieldAutoCompletion(request.getUserText(), championKeys)); - TextFields.bindAutoCompletion(allySearchField, request -> - searchFieldAutoCompletion(request.getUserText(), championKeys)); + allySearchField.setOnAction(actionEvent -> onSearchAction(allyList.getItems(), allySearchField.getText())); + enemySearchField.setOnAction(actionEvent -> onSearchAction(enemyList.getItems(), enemySearchField.getText())); + bindAutoCompletion(enemySearchField, request -> searchFieldAutoCompletion(request.getUserText())); + bindAutoCompletion(allySearchField, request -> searchFieldAutoCompletion(request.getUserText())); allyList.setOnKeyPressed(event -> handleDeleteButton(event, allyList)); enemyList.setOnKeyPressed(event -> handleDeleteButton(event, enemyList)); @@ -160,13 +242,13 @@ public void initializeChampionSuggestions() { private ListChangeListener getChampionListChangeListener() { return change -> { - calculateTeamStats(allyList, enemyList, allyTeamResultTextFlow); - calculateTeamStats(enemyList, allyList, enemyTeamResultTextFlow); - long allyRedCount = getRedCount(allyTeamResultTextFlow); - long enemyRedCount = getRedCount(enemyTeamResultTextFlow); - if (allyRedCount > enemyRedCount) { + calculateTeamStats(allyList.getItems(), enemyList.getItems(), allyTeamResultTextFlow); + calculateTeamStats(enemyList.getItems(), allyList.getItems(), enemyTeamResultTextFlow); + long allyBadStatCount = getBadStatCount(allyTeamResultTextFlow); + long enemyBadStatCount = getBadStatCount(enemyTeamResultTextFlow); + if (allyBadStatCount > enemyBadStatCount) { teamCompResultLabel.setText("Enemy Team is better"); - } else if (allyRedCount < enemyRedCount) { + } else if (allyBadStatCount < enemyBadStatCount) { teamCompResultLabel.setText("Ally Team is better"); } else { teamCompResultLabel.setText("Teams are similar"); @@ -174,36 +256,39 @@ private ListChangeListener getChampionListChangeListener() { }; } - private long getRedCount(TextFlow textFlow) { + private long getBadStatCount(TextFlow textFlow) { return textFlow.getChildren().stream() - .map(Text.class::cast) - .map(Shape::getFill) - .filter(RED::equals) + .map(Node::getPseudoClassStates) + .filter(pseudoClasses -> pseudoClasses.contains(CHAMPION_STAT_BAD_PSEUDO_CLASS)) .count(); } - private void calculateTeamStats(ListView championList, ListView opponentChampionList, TextFlow textFlow) { - double damage = getChampionInfoValue(championList, AttributeRatings::getDamage, 3); - double attack = getChampionInfoValue(championList, AttributeRatings::getAttack, 10); - double defense = getChampionInfoValue(championList, AttributeRatings::getDefense, 10); - double magic = getChampionInfoValue(championList, AttributeRatings::getMagic, 10); - double difficulty = getChampionInfoValue(championList, AttributeRatings::getDifficulty, 3); - double control = getChampionInfoValue(championList, AttributeRatings::getControl, 3); - double toughness = getChampionInfoValue(championList, AttributeRatings::getToughness, 3); - double mobility = getChampionInfoValue(championList, AttributeRatings::getMobility, 3); - double utility = getChampionInfoValue(championList, AttributeRatings::getUtility, 3); - double abilityReliance = getChampionInfoValue(championList, AttributeRatings::getAbilityReliance, 100); - - double opponentDamage = getChampionInfoValue(opponentChampionList, AttributeRatings::getDamage, 3); - double opponentAttack = getChampionInfoValue(opponentChampionList, AttributeRatings::getAttack, 10); - double opponentDefense = getChampionInfoValue(opponentChampionList, AttributeRatings::getDefense, 10); - double opponentMagic = getChampionInfoValue(opponentChampionList, AttributeRatings::getMagic, 10); - double opponentDifficulty = getChampionInfoValue(opponentChampionList, AttributeRatings::getDifficulty, 3); - double opponentControl = getChampionInfoValue(opponentChampionList, AttributeRatings::getControl, 3); - double opponentToughness = getChampionInfoValue(opponentChampionList, AttributeRatings::getToughness, 3); - double opponentMobility = getChampionInfoValue(opponentChampionList, AttributeRatings::getMobility, 3); - double opponentUtility = getChampionInfoValue(opponentChampionList, AttributeRatings::getUtility, 3); - double opponentAbilityReliance = getChampionInfoValue(opponentChampionList, AttributeRatings::getAbilityReliance, 100); + private void calculateTeamStats( + List championList, + List opponentChampionList, + TextFlow textFlow + ) { + double damage = service.getChampionInfoValue(championList, AttributeRatings::getDamage, 3); + double attack = service.getChampionInfoValue(championList, AttributeRatings::getAttack, 10); + double defense = service.getChampionInfoValue(championList, AttributeRatings::getDefense, 10); + double magic = service.getChampionInfoValue(championList, AttributeRatings::getMagic, 10); + double difficulty = service.getChampionInfoValue(championList, AttributeRatings::getDifficulty, 3); + double control = service.getChampionInfoValue(championList, AttributeRatings::getControl, 3); + double toughness = service.getChampionInfoValue(championList, AttributeRatings::getToughness, 3); + double mobility = service.getChampionInfoValue(championList, AttributeRatings::getMobility, 3); + double utility = service.getChampionInfoValue(championList, AttributeRatings::getUtility, 3); + double abilityReliance = service.getChampionInfoValue(championList, AttributeRatings::getAbilityReliance, 100); + + double opponentDamage = service.getChampionInfoValue(opponentChampionList, AttributeRatings::getDamage, 3); + double opponentAttack = service.getChampionInfoValue(opponentChampionList, AttributeRatings::getAttack, 10); + double opponentDefense = service.getChampionInfoValue(opponentChampionList, AttributeRatings::getDefense, 10); + double opponentMagic = service.getChampionInfoValue(opponentChampionList, AttributeRatings::getMagic, 10); + double opponentDifficulty = service.getChampionInfoValue(opponentChampionList, AttributeRatings::getDifficulty, 3); + double opponentControl = service.getChampionInfoValue(opponentChampionList, AttributeRatings::getControl, 3); + double opponentToughness = service.getChampionInfoValue(opponentChampionList, AttributeRatings::getToughness, 3); + double opponentMobility = service.getChampionInfoValue(opponentChampionList, AttributeRatings::getMobility, 3); + double opponentUtility = service.getChampionInfoValue(opponentChampionList, AttributeRatings::getUtility, 3); + double opponentAbilityReliance = service.getChampionInfoValue(opponentChampionList, AttributeRatings::getAbilityReliance, 100); Text damageText = getStatText("Damage:", damage); Text attackText = getStatText("Attack:", attack); @@ -247,16 +332,23 @@ private void colorStatText( DoubleBinaryOperator operation ) { if (value == opponentValue) { - statText.setFill(BLACK); + statText.pseudoClassStateChanged(CHAMPION_STAT_BAD_PSEUDO_CLASS, false); + statText.pseudoClassStateChanged(CHAMPION_STAT_GOOD_PSEUDO_CLASS, false); } else if (operation.applyAsDouble(value, opponentValue) == value) { - statText.setFill(GREEN); + statText.pseudoClassStateChanged(CHAMPION_STAT_BAD_PSEUDO_CLASS, false); + statText.pseudoClassStateChanged(CHAMPION_STAT_GOOD_PSEUDO_CLASS, true); } else { - statText.setFill(RED); + statText.pseudoClassStateChanged(CHAMPION_STAT_BAD_PSEUDO_CLASS, true); + statText.pseudoClassStateChanged(CHAMPION_STAT_GOOD_PSEUDO_CLASS, false); } } private Text getStatText(String label, double value) { - return new Text(formatStatLabel(label) + formatStatValue(value)); + return new Text(getStatString(label, value)); + } + + private String getStatString(String label, double value) { + return formatStatLabel(label).concat(formatStatValue(value)); } private String formatStatLabel(String label) { @@ -267,21 +359,6 @@ private String formatStatValue(double value) { return String.format("%4s / 10", String.format("%1$,.1f", value)); } - private double getChampionInfoValue( - ListView championList, - ToDoubleFunction getValue, - double valueScale - ) { - var allyListItems = championList.getItems(); - double teamStatSum = allyListItems.stream() - .map(championRepository::findChampionDataByKey) - .flatMap(Optional::stream) - .map(Champion::getAttributeRatings) - .mapToDouble(getValue) - .reduce(0, Double::sum); - return championList.getItems().isEmpty() ? 0 : teamStatSum / allyListItems.size() / valueScale * OUTPUT_SCALE; - } - private ListCell populateListCells() { return new ListCell<>() { private final ImageView imageView = new ImageView(); @@ -289,16 +366,15 @@ private ListCell populateListCells() { @Override public void updateItem(String championKey, boolean empty) { super.updateItem(championKey, empty); - var championDataOptional = championRepository.findChampionDataByKey(championKey); + var championDataOptional = service.findChampionDataByKey(championKey); if (empty || championKey == null || championDataOptional.isEmpty()) { - setText(null); + setPrefHeight(60); setGraphic(null); } else { var championData = championDataOptional.get(); - setText(championData.getName()); imageView.setImage(championData.getImage()); - imageView.setFitWidth(30); - imageView.setFitHeight(30); + imageView.setFitWidth(50); + imageView.setFitHeight(50); setGraphic(imageView); } } @@ -307,55 +383,14 @@ public void updateItem(String championKey, boolean empty) { public void handleDeleteButton(KeyEvent event, ListView listView) { if (event.getCode() == KeyCode.DELETE) { - var selectedIdx = listView.getSelectionModel().getSelectedIndex(); - if (selectedIdx != -1) { - var newSelectedIdx = selectedIdx == listView.getItems().size() - 1 - ? selectedIdx - 1 - : selectedIdx; - listView.getItems().remove(selectedIdx); - listView.getSelectionModel().select(newSelectedIdx); + var selectedItems = listView.getSelectionModel().getSelectedItems(); + if (!selectedItems.isEmpty()) { + listView.getItems().removeAll(selectedItems); + listView.getSelectionModel().clearSelection(); } } } - @FXML - protected void onGenerateButtonClick() { - textArea.clear(); - var summonerNames = List.of( - tf1.getText(), - tf2.getText(), - tf3.getText(), - tf4.getText(), - tf5.getText() - ); - var playersToRoles = Stream.of( - Map.entry(tf1.getText(), getRoles(cbTop1, cbMid1, cbAdc1, cbSup1, cbJgl1)), - Map.entry(tf2.getText(), getRoles(cbTop2, cbMid2, cbAdc2, cbSup2, cbJgl2)), - Map.entry(tf3.getText(), getRoles(cbTop3, cbMid3, cbAdc3, cbSup3, cbJgl3)), - Map.entry(tf4.getText(), getRoles(cbTop4, cbMid4, cbAdc4, cbSup4, cbJgl4)), - Map.entry(tf5.getText(), getRoles(cbTop5, cbMid5, cbAdc5, cbSup5, cbJgl5)) - ).filter(entry -> !entry.getKey().isBlank()) - .filter(entry -> summonerNames.stream().filter(entry.getKey()::equals).count() == 1) - .collect(toMap(Map.Entry::getKey, Map.Entry::getValue)); - var combinations = getCombinations(playersToRoles); - var nameReservedSize = Integer.min(16, IntStream.of( - tf1.getLength(), - tf2.getLength(), - tf3.getLength(), - tf4.getLength(), - tf5.getLength() - ).max().getAsInt()); - var rows = combinations.stream() - .map(playerToRoleRow -> formatPLayerToRoleRow(playerToRoleRow, nameReservedSize)) - .toList(); - var rowsWithSeparator = rows.stream().map(this::appendSeparator).toList(); - rowsWithSeparator.forEach(textArea::appendText); - if (!rowsWithSeparator.isEmpty()) { - var lastRow = rows.get(rowsWithSeparator.size() - 1); - textArea.appendText(getSeparator(lastRow)); - } - } - private String formatPLayerToRoleRow(List> playerToRoleRow, int nameReservedSize) { return playerToRoleRow.stream() .map(playerToRole -> formatPlayerToRoleEntry(playerToRole, nameReservedSize)) @@ -374,28 +409,12 @@ private String getSeparator(String playerToRoleRow) { return "-".repeat(playerToRoleRow.length()) + "\n"; } - @FXML - protected void onResetButtonClick() { - textArea.clear(); - resetAllCheckboxes(); - } - - @FXML - protected void onEnemySearchAction() { - onSearchAction(enemyList.getItems(), enemySearchField.getText()); - } - - @FXML - protected void onAllySearchAction() { - onSearchAction(allyList.getItems(), allySearchField.getText()); - } - private void onSearchAction( ObservableList listItems, String searchFieldText ) { if (isValidSearchFieldText(listItems, searchFieldText)) { - championRepository.findChampionDataByName(searchFieldText) + service.findChampionDataByName(searchFieldText) .map(Champion::getKey) .ifPresent(listItems::add); } @@ -404,8 +423,8 @@ private void onSearchAction( private boolean isValidSearchFieldText(ObservableList listItems, String searchFieldText) { return listItems.size() < 5 && !listItems.contains(searchFieldText) - && championRepository.existsChampionDataByName(searchFieldText) - && !championRepository.findChampionDataByName(searchFieldText) + && service.existsChampionDataByName(searchFieldText) + && !service.findChampionDataByName(searchFieldText) .map(Champion::getKey) .map(getChampionPool()::contains) .orElse(false); @@ -418,12 +437,10 @@ private List getChampionPool() { ).collect(toList()); } - @SneakyThrows - private List searchFieldAutoCompletion( - String userText, List championKeys - ) { - return championKeys.stream() - .map(championRepository::findChampionDataByKey) + private List searchFieldAutoCompletion(String userText) { + return service.getAllChampionKeys().stream() + .filter(not(getChampionPool()::contains)) + .map(service::findChampionDataByKey) .flatMap(Optional::stream) .map(Champion::getName) .filter(championName -> championName.toLowerCase().startsWith(userText.toLowerCase())) diff --git a/src/main/java/com/st4s1k/leagueteamcomp/repository/ChampionRepository.java b/src/main/java/com/st4s1k/leagueteamcomp/repository/ChampionRepository.java index 8e042c9..57c26aa 100644 --- a/src/main/java/com/st4s1k/leagueteamcomp/repository/ChampionRepository.java +++ b/src/main/java/com/st4s1k/leagueteamcomp/repository/ChampionRepository.java @@ -5,39 +5,52 @@ import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Optional; +import java.util.concurrent.CompletableFuture; public class ChampionRepository { private static ChampionRepository INSTANCE; - private final Champions champions; + private final CompletableFuture champions; public static ChampionRepository getInstance() { return INSTANCE; } - private ChampionRepository(Champions champions) { + private ChampionRepository(CompletableFuture champions) { this.champions = champions; } - public static void init(Champions champions) { + public static void init(CompletableFuture champions) { if (INSTANCE == null) { INSTANCE = new ChampionRepository(champions); } } public List getAllChampionKeys() { - return new ArrayList<>(champions.getChampions().keySet()); + return champions + .thenApply(Champions::getChampions) + .thenApply(Map::keySet) + .thenApply(ArrayList::new) + .getNow(new ArrayList<>()); } public Optional findChampionDataByKey(String championKey) { - return Optional.ofNullable(champions.getChampions().get(championKey)); + return champions + .thenApply(Champions::getChampions) + .thenApply(map -> Optional.ofNullable(map.get(championKey))) + .getNow(Optional.empty()); } public Optional findChampionDataByName(String championName) { - return champions.getChampions().values().stream() - .filter(championData -> championData.getName().equals(championName)) - .findFirst(); + return champions + .thenApply(Champions::getChampions) + .thenApply(Map::values) + .thenApply(values -> values.stream() + .filter(championData -> championData.getName().equals(championName)) + .findFirst()) + .getNow(Optional.empty()); } public boolean existsChampionDataByName(String championName) { diff --git a/src/main/java/com/st4s1k/leagueteamcomp/service/LeagueTeamCompService.java b/src/main/java/com/st4s1k/leagueteamcomp/service/LeagueTeamCompService.java new file mode 100644 index 0000000..4465aba --- /dev/null +++ b/src/main/java/com/st4s1k/leagueteamcomp/service/LeagueTeamCompService.java @@ -0,0 +1,56 @@ +package com.st4s1k.leagueteamcomp.service; + +import com.st4s1k.leagueteamcomp.model.champion.AttributeRatings; +import com.st4s1k.leagueteamcomp.model.champion.Champion; +import com.st4s1k.leagueteamcomp.repository.ChampionRepository; + +import java.util.List; +import java.util.Optional; +import java.util.function.ToDoubleFunction; + +public class LeagueTeamCompService { + + private static LeagueTeamCompService INSTANCE; + private static final double CHAMPION_STAT_OUTPUT_SCALE = 10; + + private ChampionRepository championRepository; + + public static LeagueTeamCompService getInstance() { + if (INSTANCE == null) { + INSTANCE = new LeagueTeamCompService(); + INSTANCE.championRepository = ChampionRepository.getInstance(); + } + return INSTANCE; + } + + public List getAllChampionKeys() { + return championRepository.getAllChampionKeys(); + } + + public Optional findChampionDataByKey(String championKey) { + return championRepository.findChampionDataByKey(championKey); + } + + public Optional findChampionDataByName(String championName) { + return championRepository.findChampionDataByName(championName); + } + + public boolean existsChampionDataByName(String championName) { + return championRepository.existsChampionDataByName(championName); + } + + public double getChampionInfoValue( + List championList, + ToDoubleFunction getValue, + double valueScale + ) { + double teamStatSum = championList.stream() + .map(championRepository::findChampionDataByKey) + .flatMap(Optional::stream) + .map(Champion::getAttributeRatings) + .mapToDouble(getValue) + .reduce(0, Double::sum); + double teamStat = teamStatSum / championList.size() / valueScale * CHAMPION_STAT_OUTPUT_SCALE; + return championList.isEmpty() ? 0 : teamStat; + } +} diff --git a/src/main/resources/META-INF/MANIFEST.MF b/src/main/resources/META-INF/MANIFEST.MF deleted file mode 100644 index 6a5b600..0000000 --- a/src/main/resources/META-INF/MANIFEST.MF +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -Main-Class: com.st4s1k.leagueteamcomp.LeagueTeamCompLauncher - diff --git a/src/main/resources/META-INF/native-image/jni-config.json b/src/main/resources/META-INF/native-image/jni-config.json index 3f7a23d..ee211d7 100644 --- a/src/main/resources/META-INF/native-image/jni-config.json +++ b/src/main/resources/META-INF/native-image/jni-config.json @@ -2,10 +2,213 @@ { "name":"[Lcom.sun.glass.ui.Screen;" }, +{ + "name":"com.sun.glass.ui.Application", + "methods":[ + {"name":"notifyThemeChanged","parameterTypes":["java.lang.String"] }, + {"name":"reportException","parameterTypes":["java.lang.Throwable"] } + ] +}, +{ + "name":"com.sun.glass.ui.Clipboard", + "fields":[{"name":"name"}], + "methods":[ + {"name":"actionPerformed","parameterTypes":["int"] }, + {"name":"contentChanged","parameterTypes":[] } + ] +}, +{ + "name":"com.sun.glass.ui.Cursor", + "methods":[ + {"name":"getNativeCursor","parameterTypes":[] }, + {"name":"getType","parameterTypes":[] } + ] +}, +{ + "name":"com.sun.glass.ui.Pixels", + "methods":[{"name":"attachData","parameterTypes":["long"] }] +}, { "name":"com.sun.glass.ui.Screen", "methods":[{"name":"","parameterTypes":["long","int","int","int","int","int","int","int","int","int","int","int","int","int","int","int","float","float","float","float"] }] }, +{ + "name":"com.sun.glass.ui.Size", + "methods":[{"name":"","parameterTypes":["int","int"] }] +}, +{ + "name":"com.sun.glass.ui.View", + "fields":[{"name":"ptr"}], + "methods":[ + {"name":"getAccessible","parameterTypes":[] }, + {"name":"getHeight","parameterTypes":[] }, + {"name":"getWidth","parameterTypes":[] }, + {"name":"notifyDragDrop","parameterTypes":["int","int","int","int","int"] }, + {"name":"notifyDragEnter","parameterTypes":["int","int","int","int","int"] }, + {"name":"notifyDragLeave","parameterTypes":[] }, + {"name":"notifyDragOver","parameterTypes":["int","int","int","int","int"] }, + {"name":"notifyInputMethod","parameterTypes":["java.lang.String","int[]","int[]","byte[]","int","int","int"] }, + {"name":"notifyInputMethodCandidatePosRequest","parameterTypes":["int"] }, + {"name":"notifyKey","parameterTypes":["int","int","char[]","int"] }, + {"name":"notifyMenu","parameterTypes":["int","int","int","int","boolean"] }, + {"name":"notifyMouse","parameterTypes":["int","int","int","int","int","int","int","boolean","boolean"] }, + {"name":"notifyRepaint","parameterTypes":["int","int","int","int"] }, + {"name":"notifyResize","parameterTypes":["int","int"] }, + {"name":"notifyScroll","parameterTypes":["int","int","int","int","double","double","int","int","int","int","int","double","double"] }, + {"name":"notifyView","parameterTypes":["int"] } + ] +}, +{ + "name":"com.sun.glass.ui.Window", + "methods":[ + {"name":"notifyClose","parameterTypes":[] }, + {"name":"notifyDelegatePtr","parameterTypes":["long"] }, + {"name":"notifyDestroy","parameterTypes":[] }, + {"name":"notifyFocus","parameterTypes":["int"] }, + {"name":"notifyFocusDisabled","parameterTypes":[] }, + {"name":"notifyFocusUngrab","parameterTypes":[] }, + {"name":"notifyMove","parameterTypes":["int","int"] }, + {"name":"notifyMoveToAnotherScreen","parameterTypes":["com.sun.glass.ui.Screen"] }, + {"name":"notifyScaleChanged","parameterTypes":["float","float","float","float"] } + ] +}, +{ + "name":"com.sun.glass.ui.win.WinApplication" +}, +{ + "name":"com.sun.glass.ui.win.WinDnDClipboard", + "methods":[ + {"name":"getInstance","parameterTypes":[] }, + {"name":"setDragButton","parameterTypes":["int"] } + ] +}, +{ + "name":"com.sun.glass.ui.win.WinGestureSupport", + "methods":[ + {"name":"gesturePerformed","parameterTypes":["com.sun.glass.ui.View","int","boolean","boolean","int","int","int","int","float","float","float","float","float","float","float"] }, + {"name":"inertiaGestureFinished","parameterTypes":["com.sun.glass.ui.View"] }, + {"name":"notifyBeginTouchEvent","parameterTypes":["com.sun.glass.ui.View","int","boolean","int"] }, + {"name":"notifyEndTouchEvent","parameterTypes":["com.sun.glass.ui.View"] }, + {"name":"notifyNextTouchEvent","parameterTypes":["com.sun.glass.ui.View","int","long","int","int","int","int"] } + ] +}, +{ + "name":"com.sun.glass.ui.win.WinPixels" +}, +{ + "name":"com.sun.glass.ui.win.WinSystemClipboard", + "fields":[{"name":"ptr"}], + "methods":[{"name":"fosSerialize","parameterTypes":["java.lang.String","long"] }] +}, +{ + "name":"com.sun.glass.ui.win.WinView" +}, +{ + "name":"com.sun.glass.ui.win.WinWindow", + "methods":[ + {"name":"notifyMoving","parameterTypes":["int","int","int","int","float","float","int","int","int","int","int","int","int"] }, + {"name":"notifyResize","parameterTypes":["int","int","int"] } + ] +}, +{ + "name":"com.sun.javafx.font.directwrite.D2D1_COLOR_F", + "fields":[ + {"name":"a"}, + {"name":"b"}, + {"name":"g"}, + {"name":"r"} + ], + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.javafx.font.directwrite.D2D1_MATRIX_3X2_F", + "fields":[ + {"name":"_11"}, + {"name":"_12"}, + {"name":"_21"}, + {"name":"_22"}, + {"name":"_31"}, + {"name":"_32"} + ], + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.javafx.font.directwrite.D2D1_PIXEL_FORMAT", + "fields":[ + {"name":"alphaMode"}, + {"name":"format"} + ], + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.javafx.font.directwrite.D2D1_POINT_2F", + "fields":[ + {"name":"x"}, + {"name":"y"} + ], + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.javafx.font.directwrite.D2D1_RENDER_TARGET_PROPERTIES", + "fields":[ + {"name":"dpiX"}, + {"name":"dpiY"}, + {"name":"minLevel"}, + {"name":"pixelFormat"}, + {"name":"type"}, + {"name":"usage"} + ], + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.javafx.font.directwrite.DWRITE_GLYPH_METRICS", + "fields":[ + {"name":"advanceHeight"}, + {"name":"advanceWidth"}, + {"name":"bottomSideBearing"}, + {"name":"leftSideBearing"}, + {"name":"rightSideBearing"}, + {"name":"topSideBearing"}, + {"name":"verticalOriginY"} + ], + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.javafx.font.directwrite.DWRITE_GLYPH_RUN", + "fields":[ + {"name":"advanceOffset"}, + {"name":"ascenderOffset"}, + {"name":"bidiLevel"}, + {"name":"fontEmSize"}, + {"name":"fontFace"}, + {"name":"glyphAdvances"}, + {"name":"glyphIndices"}, + {"name":"isSideways"} + ], + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.javafx.font.directwrite.DWRITE_MATRIX", + "fields":[ + {"name":"dx"}, + {"name":"dy"}, + {"name":"m11"}, + {"name":"m12"}, + {"name":"m21"}, + {"name":"m22"} + ], + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.javafx.font.directwrite.RECT", + "fields":[ + {"name":"bottom"}, + {"name":"left"}, + {"name":"right"}, + {"name":"top"} + ], + "methods":[{"name":"","parameterTypes":[] }] +}, { "name":"com.sun.prism.impl.PrismSettings", "fields":[ diff --git a/src/main/resources/META-INF/native-image/reflect-config.json b/src/main/resources/META-INF/native-image/reflect-config.json index b20388a..7f8c082 100644 --- a/src/main/resources/META-INF/native-image/reflect-config.json +++ b/src/main/resources/META-INF/native-image/reflect-config.json @@ -9,7 +9,6 @@ { "name":"com.st4s1k.leagueteamcomp.controller.LeagueTeamCompController", "allDeclaredFields":true, - "queryAllDeclaredMethods":true, "methods":[{"name":"","parameterTypes":[] }] }, { @@ -37,6 +36,14 @@ "allDeclaredFields":true, "methods":[{"name":"","parameterTypes":[] }] }, +{ + "name":"com.st4s1k.leagueteamcomp.model.champion.enums.AdaptiveType", + "allDeclaredFields":true +}, +{ + "name":"com.st4s1k.leagueteamcomp.model.champion.enums.AttackType", + "allDeclaredFields":true +}, { "name":"com.st4s1k.leagueteamcomp.model.champion.enums.Resource", "allDeclaredFields":true @@ -80,14 +87,36 @@ { "name":"com.sun.glass.ui.Screen" }, +{ + "name":"com.sun.glass.ui.win.WinDnDClipboard" +}, +{ + "name":"com.sun.glass.ui.win.WinGestureSupport" +}, +{ + "name":"com.sun.glass.ui.win.WinPlatformFactory", + "methods":[{"name":"","parameterTypes":[] }] +}, { "name":"com.sun.javafx.font.directwrite.DWFactory", "methods":[{"name":"getFactory","parameterTypes":[] }] }, +{ + "name":"com.sun.javafx.logging.PrintLogger", + "methods":[{"name":"createInstance","parameterTypes":[] }] +}, +{ + "name":"com.sun.javafx.logging.jfr.JFRPulseLogger", + "methods":[{"name":"createInstance","parameterTypes":[] }] +}, { "name":"com.sun.javafx.reflect.Trampoline", "methods":[{"name":"invoke","parameterTypes":["java.lang.reflect.Method","java.lang.Object","java.lang.Object[]"] }] }, +{ + "name":"com.sun.javafx.scene.control.skin.Utils", + "methods":[{"name":"getResource","parameterTypes":["java.lang.String"] }] +}, { "name":"com.sun.javafx.tk.quantum.QuantumToolkit", "methods":[{"name":"","parameterTypes":[] }] @@ -99,32 +128,84 @@ {"name":"getPipeline","parameterTypes":[] } ] }, +{ + "name":"com.sun.prism.d3d.D3DPipeline", + "methods":[{"name":"getInstance","parameterTypes":[] }] +}, +{ + "name":"com.sun.prism.shader.DrawPgram_Color_Loader", + "methods":[{"name":"loadShader","parameterTypes":["com.sun.prism.ps.ShaderFactory","java.io.InputStream"] }] +}, +{ + "name":"com.sun.prism.shader.DrawRoundRect_Color_Loader", + "methods":[{"name":"loadShader","parameterTypes":["com.sun.prism.ps.ShaderFactory","java.io.InputStream"] }] +}, +{ + "name":"com.sun.prism.shader.FillPgram_Color_Loader", + "methods":[{"name":"loadShader","parameterTypes":["com.sun.prism.ps.ShaderFactory","java.io.InputStream"] }] +}, +{ + "name":"com.sun.prism.shader.FillRoundRect_Color_Loader", + "methods":[{"name":"loadShader","parameterTypes":["com.sun.prism.ps.ShaderFactory","java.io.InputStream"] }] +}, +{ + "name":"com.sun.prism.shader.Solid_TextureFirstPassLCD_Loader", + "methods":[{"name":"loadShader","parameterTypes":["com.sun.prism.ps.ShaderFactory","java.io.InputStream"] }] +}, +{ + "name":"com.sun.prism.shader.Solid_TextureRGB_Loader", + "methods":[{"name":"loadShader","parameterTypes":["com.sun.prism.ps.ShaderFactory","java.io.InputStream"] }] +}, +{ + "name":"com.sun.prism.shader.Solid_TextureSecondPassLCD_Loader", + "methods":[{"name":"loadShader","parameterTypes":["com.sun.prism.ps.ShaderFactory","java.io.InputStream"] }] +}, +{ + "name":"com.sun.prism.shader.Texture_Color_Loader", + "methods":[{"name":"loadShader","parameterTypes":["com.sun.prism.ps.ShaderFactory","java.io.InputStream"] }] +}, +{ + "name":"com.sun.scenario.effect.impl.hw.d3d.D3DShaderSource", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"com.sun.scenario.effect.impl.prism.PrRenderer", + "methods":[{"name":"createRenderer","parameterTypes":["com.sun.scenario.effect.FilterContext"] }] +}, +{ + "name":"com.sun.scenario.effect.impl.prism.ps.PPSLinearConvolveShadowPeer", + "methods":[{"name":"","parameterTypes":["com.sun.scenario.effect.FilterContext","com.sun.scenario.effect.impl.Renderer","java.lang.String"] }] +}, +{ + "name":"com.sun.scenario.effect.impl.prism.ps.PPSRenderer", + "methods":[{"name":"createRenderer","parameterTypes":["com.sun.scenario.effect.FilterContext"] }] +}, { "name":"com.sun.xml.internal.stream.XMLInputFactoryImpl", "methods":[{"name":"","parameterTypes":[] }] }, +{ + "name":"java.lang.Character", + "methods":[{"name":"isIdeographic","parameterTypes":["int"] }] +}, { "name":"java.lang.Class", - "methods":[ - {"name":"forName","parameterTypes":["java.lang.Module","java.lang.String"] }, - {"name":"getModule","parameterTypes":[] } - ] + "methods":[{"name":"getModule","parameterTypes":[] }] }, { "name":"java.lang.Module", - "queriedMethods":[ - {"name":"getDescriptor","parameterTypes":[] }, - {"name":"getLayer","parameterTypes":[] }, - {"name":"getName","parameterTypes":[] }, - {"name":"getResourceAsStream","parameterTypes":["java.lang.String"] } - ] + "queriedMethods":[{"name":"getResourceAsStream","parameterTypes":["java.lang.String"] }] }, { - "name":"java.lang.ModuleLayer", - "methods":[ - {"name":"boot","parameterTypes":[] }, - {"name":"findModule","parameterTypes":["java.lang.String"] } - ] + "name":"java.lang.String" +}, +{ + "name":"java.nio.ByteBuffer", + "methods":[{"name":"order","parameterTypes":["java.nio.ByteOrder"] }] +}, +{ + "name":"java.nio.ByteOrder", + "methods":[{"name":"nativeOrder","parameterTypes":[] }] }, { "name":"java.security.AlgorithmParametersSpi" @@ -158,6 +239,12 @@ "name":"javafx.geometry.Pos", "methods":[{"name":"valueOf","parameterTypes":["java.lang.String"] }] }, +{ + "name":"javafx.scene.Camera" +}, +{ + "name":"javafx.scene.Group" +}, { "name":"javafx.scene.Node", "queryAllDeclaredMethods":true, @@ -169,11 +256,17 @@ {"name":"setLayoutY","parameterTypes":["double"] } ] }, +{ + "name":"javafx.scene.ParallelCamera" +}, { "name":"javafx.scene.Parent", "queryAllDeclaredMethods":true, "methods":[{"name":"getStylesheets","parameterTypes":[] }] }, +{ + "name":"javafx.scene.Scene" +}, { "name":"javafx.scene.control.Button", "queryAllDeclaredMethods":true, @@ -182,8 +275,7 @@ }, { "name":"javafx.scene.control.ButtonBase", - "queryAllDeclaredMethods":true, - "methods":[{"name":"setOnAction","parameterTypes":["javafx.event.EventHandler"] }] + "queryAllDeclaredMethods":true }, { "name":"javafx.scene.control.CheckBox", @@ -207,6 +299,7 @@ "methods":[ {"name":"setAlignment","parameterTypes":["javafx.geometry.Pos"] }, {"name":"setFont","parameterTypes":["javafx.scene.text.Font"] }, + {"name":"setGraphic","parameterTypes":["javafx.scene.Node"] }, {"name":"setMnemonicParsing","parameterTypes":["boolean"] }, {"name":"setText","parameterTypes":["java.lang.String"] } ] @@ -251,10 +344,7 @@ "name":"javafx.scene.control.TextField", "queryAllDeclaredMethods":true, "queryAllPublicConstructors":true, - "methods":[ - {"name":"","parameterTypes":[] }, - {"name":"setOnAction","parameterTypes":["javafx.event.EventHandler"] } - ] + "methods":[{"name":"","parameterTypes":[] }] }, { "name":"javafx.scene.control.TextInputControl", @@ -271,6 +361,9 @@ {"name":"setContent","parameterTypes":["javafx.scene.Node"] } ] }, +{ + "name":"javafx.scene.effect.Effect" +}, { "name":"javafx.scene.image.Image" }, @@ -318,11 +411,15 @@ {"name":"getColumnConstraints","parameterTypes":[] }, {"name":"getRowConstraints","parameterTypes":[] }, {"name":"setColumnIndex","parameterTypes":["javafx.scene.Node","java.lang.Integer"] }, + {"name":"setColumnSpan","parameterTypes":["javafx.scene.Node","java.lang.Integer"] }, + {"name":"setHalignment","parameterTypes":["javafx.scene.Node","javafx.geometry.HPos"] }, {"name":"setMargin","parameterTypes":["javafx.scene.Node","javafx.geometry.Insets"] }, {"name":"setRowIndex","parameterTypes":["javafx.scene.Node","java.lang.Integer"] } ], "queriedMethods":[ {"name":"getColumnIndex","parameterTypes":["javafx.scene.Node"] }, + {"name":"getColumnSpan","parameterTypes":["javafx.scene.Node"] }, + {"name":"getHalignment","parameterTypes":["javafx.scene.Node"] }, {"name":"getRowIndex","parameterTypes":["javafx.scene.Node"] } ] }, @@ -338,12 +435,14 @@ { "name":"javafx.scene.layout.Region", "queryAllDeclaredMethods":true, + "queryAllPublicConstructors":true, "methods":[ - {"name":"setCenterShape","parameterTypes":["boolean"] }, + {"name":"","parameterTypes":[] }, {"name":"setMaxHeight","parameterTypes":["double"] }, {"name":"setMaxWidth","parameterTypes":["double"] }, {"name":"setMinHeight","parameterTypes":["double"] }, {"name":"setMinWidth","parameterTypes":["double"] }, + {"name":"setPadding","parameterTypes":["javafx.geometry.Insets"] }, {"name":"setPrefHeight","parameterTypes":["double"] }, {"name":"setPrefWidth","parameterTypes":["double"] } ] @@ -372,9 +471,45 @@ ], "queriedMethods":[{"name":"getVgrow","parameterTypes":["javafx.scene.Node"] }] }, +{ + "name":"javafx.scene.shape.LineTo" +}, +{ + "name":"javafx.scene.shape.MoveTo" +}, +{ + "name":"javafx.scene.shape.Path" +}, +{ + "name":"javafx.scene.shape.PathElement" +}, +{ + "name":"javafx.scene.shape.Rectangle" +}, +{ + "name":"javafx.scene.shape.SVGPath" +}, +{ + "name":"javafx.scene.shape.Shape" +}, { "name":"javafx.scene.text.Font" }, +{ + "name":"javafx.scene.text.Text" +}, +{ + "name":"javafx.scene.text.TextFlow", + "queryAllDeclaredMethods":true, + "queryAllPublicConstructors":true, + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "name":"javafx.scene.transform.Transform" +}, +{ + "name":"javafx.stage.PopupWindow" +}, { "name":"javafx.stage.Stage" }, @@ -386,6 +521,10 @@ "fields":[{"name":"thisX500Name"}], "queriedMethods":[{"name":"","parameterTypes":["sun.security.x509.X500Name"] }] }, +{ + "name":"sun.misc.Unsafe", + "fields":[{"name":"theUnsafe"}] +}, { "name":"sun.security.pkcs12.PKCS12KeyStore", "methods":[{"name":"","parameterTypes":[] }] diff --git a/src/main/resources/META-INF/native-image/resource-config.json b/src/main/resources/META-INF/native-image/resource-config.json index cb0e1bd..7cba2e7 100644 --- a/src/main/resources/META-INF/native-image/resource-config.json +++ b/src/main/resources/META-INF/native-image/resource-config.json @@ -1,8 +1,42 @@ { "resources":{ - "includes":[]}, - "bundles":[{ + "includes":[ + { + "pattern":"\\Qcom/st4s1k/leagueteamcomp/icon.png\\E" + }, + { + "pattern":"\\Qcom/st4s1k/leagueteamcomp/ltc-view.fxml\\E" + } + ]}, + "bundles":[ + { "name":"com.st4s1k.leagueteamcomp.ltc-view", - "locales":[""] - }] + "locales":[ + "", + "und" + ] + }, + { + "name":"com.sun.javafx.tk.quantum.QuantumMessagesBundle", + "locales":[ + "", + "und" + ] + }, + { + "name":"com/sun/glass/ui/win/themes", + "locales":[ + "", + "en", + "und" + ] + }, + { + "name":"com/sun/javafx/scene/control/skin/resources/controls", + "locales":[ + "", + "und" + ] + } + ] } diff --git a/src/main/resources/com/st4s1k/leagueteamcomp/ltc-view.fxml b/src/main/resources/com/st4s1k/leagueteamcomp/ltc-view.fxml index 205fef6..5cd0374 100644 --- a/src/main/resources/com/st4s1k/leagueteamcomp/ltc-view.fxml +++ b/src/main/resources/com/st4s1k/leagueteamcomp/ltc-view.fxml @@ -4,186 +4,214 @@ - - - - - - - + + + + + + + + - + - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - -