diff --git a/code/interpolationsearch/View/build.gradle b/code/interpolationsearch/View/build.gradle index e1b2f7280..889f394b1 100644 --- a/code/interpolationsearch/View/build.gradle +++ b/code/interpolationsearch/View/build.gradle @@ -1,3 +1,17 @@ +// apply from: rootDir.getAbsolutePath() + '/config/scripts/javafx.plugin' +plugins { + id 'application' + id 'org.openjfx.javafxplugin' version '0.0.8' +} + +apply plugin: 'application' +mainClassName = 'ru.unn.agile.ComplexNumber.view.Main' + +javafx { + version = "11.0.2" + modules = [ 'javafx.controls', 'javafx.graphics', 'javafx.base', 'javafx.fxml' ] +} + dependencies { compile project(':interpolationsearch-viewmodel') } diff --git a/code/interpolationsearch/View/src/main/java/ru/unn/agile/interpolationsearch/view/InterpolationSearch.java b/code/interpolationsearch/View/src/main/java/ru/unn/agile/interpolationsearch/view/InterpolationSearch.java index 4c86099a4..c5135be6e 100644 --- a/code/interpolationsearch/View/src/main/java/ru/unn/agile/interpolationsearch/view/InterpolationSearch.java +++ b/code/interpolationsearch/View/src/main/java/ru/unn/agile/interpolationsearch/view/InterpolationSearch.java @@ -1,14 +1,10 @@ package ru.unn.agile.interpolationsearch.view; -import javafx.beans.property.Property; -import javafx.css.PseudoClass; import javafx.fxml.FXML; import javafx.scene.control.*; import ru.unn.agile.interpolationsearch.viewmodel.ViewModel; public class InterpolationSearch { - private final String pointInputTooltip = "Only numbers allowed"; - @FXML private ViewModel viewModel; @FXML @@ -26,18 +22,12 @@ public class InterpolationSearch { @FXML void initialize() { - initTextField(numberTextField, viewModel.numberProperty()); - initTextField(searchValueTextField, viewModel.searchValueProperty()); + numberTextField.textProperty().bindBidirectional(viewModel.numberProperty()); + searchValueTextField.textProperty().bindBidirectional(viewModel.searchValueProperty()); insertNumberButton.setOnAction(e -> viewModel.addNumber()); listNumbers.itemsProperty().bindBidirectional(viewModel.numbersProperty()); searchButton.setOnAction(e -> viewModel.doSearch()); resultTextArea.textProperty().bindBidirectional(viewModel.resultProperty()); } - - private void initTextField(final TextField textField, - final Property property) { - textField.textProperty().bindBidirectional(property); - textField.tooltipProperty().setValue(new Tooltip(pointInputTooltip)); - } } diff --git a/code/interpolationsearch/ViewModel/build.gradle b/code/interpolationsearch/ViewModel/build.gradle index 1993e4c49..3a529c1a5 100644 --- a/code/interpolationsearch/ViewModel/build.gradle +++ b/code/interpolationsearch/ViewModel/build.gradle @@ -1,3 +1,17 @@ +// apply from: rootDir.getAbsolutePath() + '/config/scripts/javafx.plugin' +plugins { + id 'application' + id 'org.openjfx.javafxplugin' version '0.0.8' +} + +apply plugin: 'application' +mainClassName = 'ru.unn.agile.ComplexNumber.view.Main' + +javafx { + version = "11.0.2" + modules = [ 'javafx.controls', 'javafx.graphics', 'javafx.base', 'javafx.fxml' ] +} + dependencies { compile project(':interpolationsearch-model') } diff --git a/code/interpolationsearch/ViewModel/src/main/java/ru/unn/agile/interpolationsearch/viewmodel/ViewModel.java b/code/interpolationsearch/ViewModel/src/main/java/ru/unn/agile/interpolationsearch/viewmodel/ViewModel.java index f38483bbe..a147edaf1 100644 --- a/code/interpolationsearch/ViewModel/src/main/java/ru/unn/agile/interpolationsearch/viewmodel/ViewModel.java +++ b/code/interpolationsearch/ViewModel/src/main/java/ru/unn/agile/interpolationsearch/viewmodel/ViewModel.java @@ -1,6 +1,5 @@ package ru.unn.agile.interpolationsearch.viewmodel; -import javafx.beans.binding.BooleanBinding; import javafx.beans.property.*; import javafx.collections.FXCollections; import ru.unn.agile.interpolationsearch.model.InterpolationSearch; diff --git a/settings.gradle b/settings.gradle index 37dee3f7b..36d2e2bbe 100644 --- a/settings.gradle +++ b/settings.gradle @@ -220,9 +220,6 @@ include "code/polynomial-calculator/View" project(":code/polynomial-calculator/View").name = "polynomial-calculator-view" include "code/polynomial-calculator/ViewModel" project(":code/polynomial-calculator/ViewModel").name = "polynomial-calculator-viewmodel" -// Петров Кирил -include "code/interpolationsearch" -project(":code/interpolationsearch").name = "interpolationsearch" // Повеликин Ростислав include "code/red-black-tree" project(":code/red-black-tree").name = "red-black-tree-Model" @@ -262,6 +259,7 @@ project(":code/dijkstra-algorithm/ViewModel").name = "dijkstra-algorithm-ViewMod // Смирнов Егор include "code/priority-queue" project(":code/priority-queue").name = "priority-queue" +// Interpolation Search include "code/interpolationsearch/Model" project(":code/interpolationsearch/Model").name = "interpolationsearch-model" include "code/interpolationsearch/View"