implement search for mission prototype
This commit is contained in:
@@ -0,0 +1,112 @@
|
|||||||
|
package ru.trader.controllers;
|
||||||
|
|
||||||
|
import javafx.beans.binding.Bindings;
|
||||||
|
import javafx.collections.FXCollections;
|
||||||
|
import javafx.collections.ObservableList;
|
||||||
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.scene.control.Button;
|
||||||
|
import javafx.scene.control.ComboBox;
|
||||||
|
import javafx.scene.control.TextField;
|
||||||
|
import ru.trader.model.ItemModel;
|
||||||
|
import ru.trader.model.MarketModel;
|
||||||
|
import ru.trader.model.MissionModel;
|
||||||
|
import ru.trader.model.StationModel;
|
||||||
|
import ru.trader.view.support.NumberField;
|
||||||
|
import ru.trader.view.support.autocomplete.AutoCompletion;
|
||||||
|
import ru.trader.view.support.autocomplete.StationsProvider;
|
||||||
|
|
||||||
|
public class MissionsController {
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private TextField receiverText;
|
||||||
|
private AutoCompletion<StationModel> receiver;
|
||||||
|
@FXML
|
||||||
|
private NumberField courierProfit;
|
||||||
|
@FXML
|
||||||
|
private Button addCourierBtn;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private TextField buyerText;
|
||||||
|
private AutoCompletion<StationModel> buyer;
|
||||||
|
@FXML
|
||||||
|
private NumberField deliveryCount;
|
||||||
|
@FXML
|
||||||
|
private NumberField deliveryProfit;
|
||||||
|
@FXML
|
||||||
|
private Button addDeliveryBtn;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private ComboBox<ItemModel> item;
|
||||||
|
@FXML
|
||||||
|
private NumberField supplyCount;
|
||||||
|
@FXML
|
||||||
|
private NumberField supplyProfit;
|
||||||
|
@FXML
|
||||||
|
private Button addSupplyBtn;
|
||||||
|
|
||||||
|
private final ObservableList<MissionModel> missions;
|
||||||
|
private StationModel station;
|
||||||
|
|
||||||
|
|
||||||
|
public MissionsController() {
|
||||||
|
missions = FXCollections.observableArrayList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private void initialize(){
|
||||||
|
MarketModel world = MainController.getWorld();
|
||||||
|
StationsProvider provider = new StationsProvider(world);
|
||||||
|
receiver = new AutoCompletion<>(receiverText, provider, provider.getConverter());
|
||||||
|
provider = new StationsProvider(world);
|
||||||
|
buyer = new AutoCompletion<>(buyerText, provider, provider.getConverter());
|
||||||
|
item.setItems(world.itemsProperty());
|
||||||
|
addCourierBtn.disableProperty().bind(Bindings.createBooleanBinding(() -> receiver.getCompletion() == null, receiver.completionProperty())
|
||||||
|
.or(courierProfit.wrongProperty())
|
||||||
|
);
|
||||||
|
addDeliveryBtn.disableProperty().bind(Bindings.createBooleanBinding(() -> buyer.getCompletion() == null, buyer.completionProperty())
|
||||||
|
.or(deliveryCount.wrongProperty())
|
||||||
|
.or(deliveryProfit.wrongProperty())
|
||||||
|
);
|
||||||
|
addSupplyBtn.disableProperty().bind(Bindings.createBooleanBinding(() -> item.getValue() == null, item.valueProperty())
|
||||||
|
.or(supplyCount.wrongProperty())
|
||||||
|
.or(supplyProfit.wrongProperty())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private void addCourier(){
|
||||||
|
StationModel station = receiver.getCompletion();
|
||||||
|
double profit = courierProfit.getValue().doubleValue();
|
||||||
|
if (station != null && profit > 0){
|
||||||
|
missions.add(new MissionModel(station, profit));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private void addDelivery(){
|
||||||
|
StationModel station = buyer.getCompletion();
|
||||||
|
long count = deliveryCount.getValue().longValue();
|
||||||
|
double profit = deliveryProfit.getValue().doubleValue();
|
||||||
|
if (station != null && profit > 0){
|
||||||
|
missions.add(new MissionModel(station, count, profit));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private void addSupply(){
|
||||||
|
ItemModel item = this.item.getValue();
|
||||||
|
long count = supplyCount.getValue().longValue();
|
||||||
|
double profit = supplyProfit.getValue().doubleValue();
|
||||||
|
if (item != null && profit > 0){
|
||||||
|
missions.add(new MissionModel(station, item, count, profit));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableList<MissionModel> getMissions() {
|
||||||
|
return missions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStation(StationModel station) {
|
||||||
|
this.station = station;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,92 @@
|
|||||||
package ru.trader.controllers;
|
package ru.trader.controllers;
|
||||||
|
|
||||||
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.scene.control.ComboBox;
|
||||||
|
import javafx.scene.control.ListView;
|
||||||
|
import javafx.scene.control.TextField;
|
||||||
|
import ru.trader.analysis.CrawlerSpecificator;
|
||||||
|
import ru.trader.model.*;
|
||||||
|
import ru.trader.view.support.autocomplete.AutoCompletion;
|
||||||
|
import ru.trader.view.support.autocomplete.SystemsProvider;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
public class RouteSearchController {
|
public class RouteSearchController {
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private TextField fromSystemText;
|
||||||
|
private AutoCompletion<SystemModel> fromSystem;
|
||||||
|
@FXML
|
||||||
|
private ComboBox<StationModel> fromStation;
|
||||||
|
@FXML
|
||||||
|
private TextField toSystemText;
|
||||||
|
private AutoCompletion<SystemModel> toSystem;
|
||||||
|
@FXML
|
||||||
|
private ComboBox<StationModel> toStation;
|
||||||
|
@FXML
|
||||||
|
private ListView<MissionModel> missionsList;
|
||||||
|
@FXML
|
||||||
|
private MissionsController missionsController;
|
||||||
|
|
||||||
|
private MarketModel market;
|
||||||
|
private ProfileModel profile;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private void initialize(){
|
||||||
|
init();
|
||||||
|
missionsList.setItems(missionsController.getMissions());
|
||||||
|
initListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init(){
|
||||||
|
market = MainController.getMarket();
|
||||||
|
profile = MainController.getProfile();
|
||||||
|
SystemsProvider provider = new SystemsProvider(market);
|
||||||
|
fromSystem = new AutoCompletion<>(fromSystemText, provider, provider.getConverter());
|
||||||
|
provider = new SystemsProvider(market);
|
||||||
|
toSystem = new AutoCompletion<>(toSystemText, provider, provider.getConverter());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initListeners(){
|
||||||
|
fromSystem.completionProperty().addListener((ov, o , n) -> fromStation.setItems(n.getStationsList()));
|
||||||
|
fromStation.valueProperty().addListener((ov, o , n) -> missionsController.setStation(n));
|
||||||
|
toSystem.completionProperty().addListener((ov, o , n) -> toStation.setItems(n.getStationsList()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private void currentAsFrom(){
|
||||||
|
fromSystem.setValue(profile.getSystem());
|
||||||
|
fromStation.setValue(profile.getStation());
|
||||||
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private void loop(){
|
||||||
|
toSystem.setValue(fromSystem.getCompletion());
|
||||||
|
toStation.setValue(fromStation.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private void search(){
|
||||||
|
SystemModel f = fromSystem.getCompletion();
|
||||||
|
SystemModel t = toSystem.getCompletion();
|
||||||
|
StationModel fS = fromStation.getValue();
|
||||||
|
StationModel tS = toStation.getValue();
|
||||||
|
|
||||||
|
CrawlerSpecificator specificator = new CrawlerSpecificator();
|
||||||
|
missionsList.getItems().forEach(m -> m.toSpecification(specificator));
|
||||||
|
market.getRoutes(f, fS, t, tS, profile.getBalance(), specificator, routes -> {
|
||||||
|
Optional<RouteModel> path = Screeners.showRouters(routes);
|
||||||
|
if (path.isPresent()){
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private void removeMission(){
|
||||||
|
int index = missionsList.getSelectionModel().getSelectedIndex();
|
||||||
|
if (index >= 0){
|
||||||
|
missionsList.getItems().remove(index);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import javafx.scene.control.ComboBox;
|
|||||||
import javafx.scene.control.ScrollPane;
|
import javafx.scene.control.ScrollPane;
|
||||||
import javafx.scene.control.TableView;
|
import javafx.scene.control.TableView;
|
||||||
import ru.trader.Main;
|
import ru.trader.Main;
|
||||||
|
import ru.trader.analysis.CrawlerSpecificator;
|
||||||
import ru.trader.model.*;
|
import ru.trader.model.*;
|
||||||
import ru.trader.model.support.ChangeMarketListener;
|
import ru.trader.model.support.ChangeMarketListener;
|
||||||
import ru.trader.view.support.NumberField;
|
import ru.trader.view.support.NumberField;
|
||||||
@@ -219,7 +220,7 @@ public class RouterController {
|
|||||||
|
|
||||||
public void rebuild(){
|
public void rebuild(){
|
||||||
if (route != null){
|
if (route != null){
|
||||||
RouteModel r = market.getRoute(route, balance.getValue().doubleValue());
|
RouteModel r = market.getRoute(route);
|
||||||
if (r != null){
|
if (r != null){
|
||||||
route = r;
|
route = r;
|
||||||
orders.clear();
|
orders.clear();
|
||||||
@@ -269,7 +270,7 @@ public class RouterController {
|
|||||||
SystemModel t = target.getValue();
|
SystemModel t = target.getValue();
|
||||||
StationModel sS = sStation.getValue();
|
StationModel sS = sStation.getValue();
|
||||||
StationModel tS = tStation.getValue();
|
StationModel tS = tStation.getValue();
|
||||||
market.getRoutes(s, sS, t, tS, totalBalance.getValue().doubleValue(), routes -> {
|
market.getRoutes(s, sS, t, tS, totalBalance.getValue().doubleValue(), new CrawlerSpecificator(), routes -> {
|
||||||
Optional<RouteModel> path = Screeners.showRouters(routes);
|
Optional<RouteModel> path = Screeners.showRouters(routes);
|
||||||
if (path.isPresent()){
|
if (path.isPresent()){
|
||||||
orders.addAll(path.get().getOrders());
|
orders.addAll(path.get().getOrders());
|
||||||
|
|||||||
@@ -10,8 +10,9 @@ import javafx.collections.ObservableList;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import ru.trader.World;
|
import ru.trader.World;
|
||||||
import ru.trader.analysis.AnalysisCallBack;
|
import ru.trader.analysis.CrawlerSpecificator;
|
||||||
import ru.trader.analysis.Route;
|
import ru.trader.analysis.Route;
|
||||||
|
import ru.trader.controllers.MainController;
|
||||||
import ru.trader.controllers.ProgressController;
|
import ru.trader.controllers.ProgressController;
|
||||||
import ru.trader.controllers.Screeners;
|
import ru.trader.controllers.Screeners;
|
||||||
import ru.trader.core.*;
|
import ru.trader.core.*;
|
||||||
@@ -21,7 +22,6 @@ import ru.trader.services.OrdersSearchTask;
|
|||||||
import ru.trader.services.RoutesSearchTask;
|
import ru.trader.services.RoutesSearchTask;
|
||||||
import ru.trader.view.support.Localization;
|
import ru.trader.view.support.Localization;
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
@@ -35,6 +35,7 @@ public class MarketModel {
|
|||||||
private final Notificator notificator;
|
private final Notificator notificator;
|
||||||
|
|
||||||
private final ListProperty<SystemModel> systems;
|
private final ListProperty<SystemModel> systems;
|
||||||
|
private final ListProperty<StationModel> stations;
|
||||||
// with NONE_SYSTEM
|
// with NONE_SYSTEM
|
||||||
private ListProperty<SystemModel> systemsList;
|
private ListProperty<SystemModel> systemsList;
|
||||||
private final ListProperty<GroupModel> groups;
|
private final ListProperty<GroupModel> groups;
|
||||||
@@ -51,6 +52,7 @@ public class MarketModel {
|
|||||||
systems = new SimpleListProperty<>(BindingsHelper.observableList(market.get(), modeler::get));
|
systems = new SimpleListProperty<>(BindingsHelper.observableList(market.get(), modeler::get));
|
||||||
systemsList = new SimpleListProperty<>(FXCollections.observableArrayList(ModelFabric.NONE_SYSTEM));
|
systemsList = new SimpleListProperty<>(FXCollections.observableArrayList(ModelFabric.NONE_SYSTEM));
|
||||||
systemsList.addAll(systems);
|
systemsList.addAll(systems);
|
||||||
|
stations = new SimpleListProperty<>(BindingsHelper.observableList(market.getVendors(), modeler::get));
|
||||||
systems.addListener(SYSTEMS_CHANGE_LISTENER);
|
systems.addListener(SYSTEMS_CHANGE_LISTENER);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,10 +71,6 @@ public class MarketModel {
|
|||||||
return analyzer;
|
return analyzer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MarketAnalyzer getAnalyzer(AnalysisCallBack callback) {
|
|
||||||
return analyzer.changeCallBack(callback);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ModelFabric getModeler() {
|
public ModelFabric getModeler() {
|
||||||
return modeler;
|
return modeler;
|
||||||
}
|
}
|
||||||
@@ -88,6 +86,10 @@ public class MarketModel {
|
|||||||
return systemsList;
|
return systemsList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ReadOnlyListProperty<StationModel> stationsProperty() {
|
||||||
|
return stations;
|
||||||
|
}
|
||||||
|
|
||||||
public SystemModel get(String name){
|
public SystemModel get(String name){
|
||||||
Place s = market.get(name);
|
Place s = market.get(name);
|
||||||
if (s == null){
|
if (s == null){
|
||||||
@@ -101,16 +103,33 @@ public class MarketModel {
|
|||||||
LOG.info("Add system {} to market {}", system, this);
|
LOG.info("Add system {} to market {}", system, this);
|
||||||
notificator.sendAdd(system);
|
notificator.sendAdd(system);
|
||||||
systems.add(system);
|
systems.add(system);
|
||||||
|
stations.addAll(system.getStations());
|
||||||
return system;
|
return system;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void remove(SystemModel system) {
|
public void remove(SystemModel system) {
|
||||||
LOG.info("Remove system {} from market {}", system, this);
|
LOG.info("Remove system {} from market {}", system, this);
|
||||||
notificator.sendRemove(system);
|
notificator.sendRemove(system);
|
||||||
|
stations.removeAll(system.getStations());
|
||||||
market.remove(system.getSystem());
|
market.remove(system.getSystem());
|
||||||
systems.remove(system);
|
systems.remove(system);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StationModel addStation(SystemModel system, String name) {
|
||||||
|
StationModel station = modeler.get(system.getSystem().addVendor(name));
|
||||||
|
LOG.info("Add station {} to system {}", station, system);
|
||||||
|
stations.add(station);
|
||||||
|
notificator.sendAdd(station);
|
||||||
|
return station;
|
||||||
|
}
|
||||||
|
|
||||||
|
void removeStation(StationModel station) {
|
||||||
|
LOG.info("Remove station {} from system {}", station, station.getSystem());
|
||||||
|
notificator.sendRemove(station);
|
||||||
|
stations.remove(station);
|
||||||
|
station.getSystem().getSystem().remove(station.getStation());
|
||||||
|
}
|
||||||
|
|
||||||
public ReadOnlyListProperty<GroupModel> getGroups(){
|
public ReadOnlyListProperty<GroupModel> getGroups(){
|
||||||
return groups;
|
return groups;
|
||||||
}
|
}
|
||||||
@@ -146,7 +165,7 @@ public class MarketModel {
|
|||||||
return BindingsHelper.observableList(analyzer.getOffers(offerType, item.getItem(), filter), modeler::get);
|
return BindingsHelper.observableList(analyzer.getOffers(offerType, item.getItem(), filter), modeler::get);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<StationModel> getStations(MarketFilter filter){
|
public ObservableList<StationModel> getStations(MarketFilter filter){
|
||||||
return BindingsHelper.observableList(analyzer.getVendors(filter), modeler::get);
|
return BindingsHelper.observableList(analyzer.getVendors(filter), modeler::get);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,12 +183,14 @@ public class MarketModel {
|
|||||||
|
|
||||||
public void getOrders(SystemModel from, StationModel stationFrom, SystemModel to, StationModel stationTo, double balance, Consumer<ObservableList<OrderModel>> result) {
|
public void getOrders(SystemModel from, StationModel stationFrom, SystemModel to, StationModel stationTo, double balance, Consumer<ObservableList<OrderModel>> result) {
|
||||||
ProgressController progress = new ProgressController(Screeners.getMainScreen(), Localization.getString("analyzer.orders.title"));
|
ProgressController progress = new ProgressController(Screeners.getMainScreen(), Localization.getString("analyzer.orders.title"));
|
||||||
|
Profile profile = MainController.getProfile().getProfile().copy();
|
||||||
|
profile.setBalance(balance);
|
||||||
OrdersSearchTask task = new OrdersSearchTask(this,
|
OrdersSearchTask task = new OrdersSearchTask(this,
|
||||||
from == null || from == ModelFabric.NONE_SYSTEM ? null : from.getSystem(),
|
from == null || from == ModelFabric.NONE_SYSTEM ? null : from.getSystem(),
|
||||||
stationFrom == null || stationFrom == ModelFabric.NONE_STATION ? null : stationFrom.getStation(),
|
stationFrom == null || stationFrom == ModelFabric.NONE_STATION ? null : stationFrom.getStation(),
|
||||||
to == null || to == ModelFabric.NONE_SYSTEM ? null : to.getSystem(),
|
to == null || to == ModelFabric.NONE_SYSTEM ? null : to.getSystem(),
|
||||||
stationTo == null || stationTo == ModelFabric.NONE_STATION ? null : stationTo.getStation(),
|
stationTo == null || stationTo == ModelFabric.NONE_STATION ? null : stationTo.getStation(),
|
||||||
balance
|
profile
|
||||||
);
|
);
|
||||||
|
|
||||||
progress.run(task, order -> {
|
progress.run(task, order -> {
|
||||||
@@ -186,22 +207,17 @@ public class MarketModel {
|
|||||||
getOrders(ModelFabric.NONE_SYSTEM, ModelFabric.NONE_STATION, ModelFabric.NONE_SYSTEM, ModelFabric.NONE_STATION, balance, result);
|
getOrders(ModelFabric.NONE_SYSTEM, ModelFabric.NONE_STATION, ModelFabric.NONE_SYSTEM, ModelFabric.NONE_STATION, balance, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getRoutes(SystemModel from, double balance, Consumer<ObservableList<RouteModel>> result){
|
public void getRoutes(SystemModel from, StationModel stationFrom, SystemModel to, StationModel stationTo, double balance, CrawlerSpecificator specificator, Consumer<ObservableList<RouteModel>> result) {
|
||||||
getRoutes(from, ModelFabric.NONE_STATION, ModelFabric.NONE_SYSTEM, ModelFabric.NONE_STATION, balance, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void getRoutes(SystemModel from, SystemModel to, double balance, Consumer<ObservableList<RouteModel>> result){
|
|
||||||
getRoutes(from, ModelFabric.NONE_STATION, to, ModelFabric.NONE_STATION, balance, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void getRoutes(SystemModel from, StationModel stationFrom, SystemModel to, StationModel stationTo, double balance, Consumer<ObservableList<RouteModel>> result) {
|
|
||||||
ProgressController progress = new ProgressController(Screeners.getMainScreen(), Localization.getString("analyzer.routes.title"));
|
ProgressController progress = new ProgressController(Screeners.getMainScreen(), Localization.getString("analyzer.routes.title"));
|
||||||
|
Profile profile = MainController.getProfile().getProfile().copy();
|
||||||
|
profile.setBalance(balance);
|
||||||
RoutesSearchTask task = new RoutesSearchTask(this,
|
RoutesSearchTask task = new RoutesSearchTask(this,
|
||||||
from == null || from == ModelFabric.NONE_SYSTEM ? null : from.getSystem(),
|
from == null || from == ModelFabric.NONE_SYSTEM ? null : from.getSystem(),
|
||||||
stationFrom == null || stationFrom == ModelFabric.NONE_STATION ? null : stationFrom.getStation(),
|
stationFrom == null || stationFrom == ModelFabric.NONE_STATION ? null : stationFrom.getStation(),
|
||||||
to == null || to == ModelFabric.NONE_SYSTEM ? null : to.getSystem(),
|
to == null || to == ModelFabric.NONE_SYSTEM ? null : to.getSystem(),
|
||||||
stationTo == null || stationTo == ModelFabric.NONE_STATION ? null : stationTo.getStation(),
|
stationTo == null || stationTo == ModelFabric.NONE_STATION ? null : stationTo.getStation(),
|
||||||
balance
|
profile,
|
||||||
|
specificator
|
||||||
);
|
);
|
||||||
|
|
||||||
progress.run(task, route -> {
|
progress.run(task, route -> {
|
||||||
@@ -215,15 +231,13 @@ public class MarketModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void getTopRoutes(double balance, Consumer<ObservableList<RouteModel>> result){
|
public void getTopRoutes(double balance, Consumer<ObservableList<RouteModel>> result){
|
||||||
getRoutes(ModelFabric.NONE_SYSTEM, ModelFabric.NONE_STATION, ModelFabric.NONE_SYSTEM, ModelFabric.NONE_STATION, balance, result);
|
getRoutes(ModelFabric.NONE_SYSTEM, ModelFabric.NONE_STATION, ModelFabric.NONE_SYSTEM, ModelFabric.NONE_STATION, balance, new CrawlerSpecificator(), result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public RouteModel getRoute(RouteModel path, double balance) {
|
public RouteModel getRoute(RouteModel path) {
|
||||||
//TODO: implement
|
Route r = analyzer.getRoute(path.getRoute().getVendors());
|
||||||
/*Route r = analyzer.getRoute(path.getRoute());
|
|
||||||
if (r == null) return null;
|
if (r == null) return null;
|
||||||
return modeler.get(r);*/
|
return modeler.get(r);
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Route _getPath(OrderModel order) {
|
Route _getPath(OrderModel order) {
|
||||||
|
|||||||
80
client/src/main/java/ru/trader/model/MissionModel.java
Normal file
80
client/src/main/java/ru/trader/model/MissionModel.java
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
package ru.trader.model;
|
||||||
|
|
||||||
|
import ru.trader.analysis.CrawlerSpecificator;
|
||||||
|
import ru.trader.store.simple.SimpleOffer;
|
||||||
|
|
||||||
|
public class MissionModel {
|
||||||
|
private final StationModel target;
|
||||||
|
private final ItemModel item;
|
||||||
|
private final long count;
|
||||||
|
private final double profit;
|
||||||
|
|
||||||
|
public MissionModel(StationModel target, double profit) {
|
||||||
|
this.target = target;
|
||||||
|
this.profit = profit;
|
||||||
|
item = null;
|
||||||
|
count = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MissionModel(StationModel target, long count, double profit) {
|
||||||
|
this.target = target;
|
||||||
|
this.count = count;
|
||||||
|
this.profit = profit;
|
||||||
|
this.item = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public MissionModel(StationModel target, ItemModel item, long count, double profit) {
|
||||||
|
this.target = target;
|
||||||
|
this.item = item;
|
||||||
|
this.count = count;
|
||||||
|
this.profit = profit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StationModel getTarget() {
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemModel getItem() {
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getCount() {
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getProfit() {
|
||||||
|
return profit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSupply(){
|
||||||
|
return item != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isDelivery(){
|
||||||
|
return count > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isCourier(){
|
||||||
|
return count == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "MissionModel{" +
|
||||||
|
"target=" + target +
|
||||||
|
", item=" + item +
|
||||||
|
", count=" + count +
|
||||||
|
", profit=" + profit +
|
||||||
|
"} ";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void toSpecification(CrawlerSpecificator specificator){
|
||||||
|
if (isSupply()){
|
||||||
|
specificator.buy(SimpleOffer.fakeBuy(target.getStation(), item.getItem(), profit/count, count));
|
||||||
|
} else
|
||||||
|
if (isCourier() || isDelivery()){
|
||||||
|
specificator.add(target.getStation(), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -79,6 +79,10 @@ public class ProfileModel {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Profile getProfile() {
|
||||||
|
return profile;
|
||||||
|
}
|
||||||
|
|
||||||
public MarketModel getMarket() {
|
public MarketModel getMarket() {
|
||||||
return market;
|
return market;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,16 +97,11 @@ public class SystemModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public StationModel add(String name){
|
public StationModel add(String name){
|
||||||
StationModel station = market.getModeler().get(system.addVendor(name));
|
return market.addStation(this, name);
|
||||||
LOG.info("Add station {} to system {}", station, this);
|
|
||||||
market.getNotificator().sendAdd(station);
|
|
||||||
return station;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void remove(StationModel station) {
|
public void remove(StationModel station) {
|
||||||
LOG.info("Remove station {} from system {}", station, this);
|
market.removeStation(station);
|
||||||
market.getNotificator().sendRemove(station);
|
|
||||||
system.remove(station.getStation());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEmpty(){
|
public boolean isEmpty(){
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ import javafx.beans.property.SimpleLongProperty;
|
|||||||
import javafx.concurrent.Task;
|
import javafx.concurrent.Task;
|
||||||
import ru.trader.analysis.AnalysisCallBack;
|
import ru.trader.analysis.AnalysisCallBack;
|
||||||
import ru.trader.core.MarketAnalyzer;
|
import ru.trader.core.MarketAnalyzer;
|
||||||
|
import ru.trader.core.Profile;
|
||||||
import ru.trader.model.MarketModel;
|
import ru.trader.model.MarketModel;
|
||||||
|
import ru.trader.model.ProfileModel;
|
||||||
import ru.trader.view.support.Localization;
|
import ru.trader.view.support.Localization;
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
@@ -19,11 +21,11 @@ public abstract class AnalyzerTask<T> extends Task<T> {
|
|||||||
private final LongProperty found;
|
private final LongProperty found;
|
||||||
private final AtomicReference<Long> foundUpdate;
|
private final AtomicReference<Long> foundUpdate;
|
||||||
|
|
||||||
public AnalyzerTask(MarketModel market) {
|
public AnalyzerTask(MarketModel market, Profile profile) {
|
||||||
foundUpdate = new AtomicReference<>((long) 0);
|
foundUpdate = new AtomicReference<>((long) 0);
|
||||||
found = new SimpleLongProperty(0);
|
found = new SimpleLongProperty(0);
|
||||||
callback = new AnalyzerCallBack();
|
callback = new AnalyzerCallBack();
|
||||||
analyzer = market.getAnalyzer(callback);
|
analyzer = market.getAnalyzer().newInstance(profile, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getFound() {
|
public long getFound() {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package ru.trader.services;
|
|||||||
|
|
||||||
import ru.trader.core.Order;
|
import ru.trader.core.Order;
|
||||||
import ru.trader.core.Place;
|
import ru.trader.core.Place;
|
||||||
|
import ru.trader.core.Profile;
|
||||||
import ru.trader.core.Vendor;
|
import ru.trader.core.Vendor;
|
||||||
import ru.trader.model.MarketModel;
|
import ru.trader.model.MarketModel;
|
||||||
|
|
||||||
@@ -12,15 +13,13 @@ public class OrdersSearchTask extends AnalyzerTask<Collection<Order>>{
|
|||||||
private final Vendor stationFrom;
|
private final Vendor stationFrom;
|
||||||
private final Place to;
|
private final Place to;
|
||||||
private final Vendor stationTo;
|
private final Vendor stationTo;
|
||||||
private final double balance;
|
|
||||||
|
|
||||||
public OrdersSearchTask(MarketModel market, Place from, Vendor stationFrom, Place to, Vendor stationTo, double balance) {
|
public OrdersSearchTask(MarketModel market, Place from, Vendor stationFrom, Place to, Vendor stationTo, Profile profile) {
|
||||||
super(market);
|
super(market, profile);
|
||||||
this.from = from;
|
this.from = from;
|
||||||
this.stationFrom = stationFrom;
|
this.stationFrom = stationFrom;
|
||||||
this.to = to;
|
this.to = to;
|
||||||
this.stationTo = stationTo;
|
this.stationTo = stationTo;
|
||||||
this.balance = balance;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package ru.trader.services;
|
package ru.trader.services;
|
||||||
|
|
||||||
|
import ru.trader.analysis.CrawlerSpecificator;
|
||||||
import ru.trader.analysis.Route;
|
import ru.trader.analysis.Route;
|
||||||
import ru.trader.core.Place;
|
import ru.trader.core.Place;
|
||||||
|
import ru.trader.core.Profile;
|
||||||
import ru.trader.core.Vendor;
|
import ru.trader.core.Vendor;
|
||||||
import ru.trader.model.MarketModel;
|
import ru.trader.model.MarketModel;
|
||||||
|
|
||||||
@@ -12,14 +14,18 @@ public class RoutesSearchTask extends AnalyzerTask<Collection<Route>>{
|
|||||||
private final Vendor stationFrom;
|
private final Vendor stationFrom;
|
||||||
private final Place to;
|
private final Place to;
|
||||||
private final Vendor stationTo;
|
private final Vendor stationTo;
|
||||||
|
private final CrawlerSpecificator specificator;
|
||||||
|
|
||||||
public RoutesSearchTask(MarketModel market, Place from, Vendor stationFrom, Place to, Vendor stationTo, double balance) {
|
public RoutesSearchTask(MarketModel market, Place from, Vendor stationFrom, Place to, Vendor stationTo, Profile profile, CrawlerSpecificator specificator) {
|
||||||
super(market);
|
super(market, profile);
|
||||||
this.from = from;
|
this.from = from;
|
||||||
this.stationFrom = stationFrom;
|
this.stationFrom = stationFrom;
|
||||||
this.to = to;
|
this.to = to;
|
||||||
this.stationTo = stationTo;
|
this.stationTo = stationTo;
|
||||||
market.getAnalyzer().getProfile().setBalance(balance);
|
this.specificator = specificator;
|
||||||
|
if (stationTo != null){
|
||||||
|
specificator.target(stationTo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -28,23 +34,23 @@ public class RoutesSearchTask extends AnalyzerTask<Collection<Route>>{
|
|||||||
|
|
||||||
if (stationFrom != null) {
|
if (stationFrom != null) {
|
||||||
if (stationTo != null) {
|
if (stationTo != null) {
|
||||||
routes = analyzer.getRoutes(stationFrom, stationTo);
|
routes = analyzer.getRoutes(stationFrom, stationTo, specificator);
|
||||||
} else {
|
} else {
|
||||||
if (to != null) {
|
if (to != null) {
|
||||||
routes = analyzer.getRoutes(stationFrom, to);
|
routes = analyzer.getRoutes(stationFrom, to, specificator);
|
||||||
} else {
|
} else {
|
||||||
routes = analyzer.getLoops(stationFrom, 100);
|
routes = analyzer.getRoutes(stationFrom, specificator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (stationTo != null) {
|
if (stationTo != null) {
|
||||||
routes = analyzer.getRoutes(from, stationTo);
|
routes = analyzer.getRoutes(from, specificator);
|
||||||
} else {
|
} else {
|
||||||
if (to != null) {
|
if (to != null) {
|
||||||
routes = analyzer.getRoutes(from, to);
|
routes = analyzer.getRoutes(from, to, specificator);
|
||||||
} else {
|
} else {
|
||||||
if (from != null){
|
if (from != null){
|
||||||
routes = analyzer.getRoutes(from);
|
routes = analyzer.getRoutes(from, specificator);
|
||||||
} else {
|
} else {
|
||||||
routes = analyzer.getTopRoutes(100);
|
routes = analyzer.getTopRoutes(100);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package ru.trader.view.support;
|
||||||
|
|
||||||
|
|
||||||
|
import javafx.util.StringConverter;
|
||||||
|
import ru.trader.controllers.MainController;
|
||||||
|
import ru.trader.model.ItemModel;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
public class ItemStringConverter extends StringConverter<ItemModel> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString(ItemModel item) {
|
||||||
|
return item.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemModel fromString(String name) {
|
||||||
|
Optional<ItemModel> item = MainController.getWorld().itemsProperty().stream().filter(i -> i.getName().equals(name)).findAny();
|
||||||
|
return item.orElse(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package ru.trader.view.support.autocomplete;
|
||||||
|
|
||||||
|
import javafx.util.StringConverter;
|
||||||
|
import ru.trader.model.MarketModel;
|
||||||
|
import ru.trader.model.StationModel;
|
||||||
|
import ru.trader.model.SystemModel;
|
||||||
|
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
public class StationStringConverter extends StringConverter<StationModel> {
|
||||||
|
private final MarketModel market;
|
||||||
|
private static final Pattern STATION_REGEXP = Pattern.compile("([^:]+): (.+)");
|
||||||
|
|
||||||
|
public StationStringConverter(MarketModel market) {
|
||||||
|
this.market = market;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString(StationModel station) {
|
||||||
|
return station.getSystem().getName()+": "+station.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StationModel fromString(String name) {
|
||||||
|
Matcher matcher = STATION_REGEXP.matcher(name);
|
||||||
|
if (matcher.find()){
|
||||||
|
SystemModel system = market.get(matcher.group(1));
|
||||||
|
if (system != null){
|
||||||
|
return system.get(matcher.group(2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package ru.trader.view.support.autocomplete;
|
||||||
|
|
||||||
|
import javafx.util.StringConverter;
|
||||||
|
import org.controlsfx.control.textfield.AutoCompletionBinding;
|
||||||
|
import ru.trader.model.MarketModel;
|
||||||
|
import ru.trader.model.StationModel;
|
||||||
|
|
||||||
|
import java.util.Comparator;
|
||||||
|
|
||||||
|
public class StationsProvider extends CachedSuggestionProvider<StationModel> {
|
||||||
|
|
||||||
|
private final StringConverter<StationModel> converter;
|
||||||
|
private final Comparator<StationModel> comparator;
|
||||||
|
|
||||||
|
|
||||||
|
public StationsProvider(MarketModel market) {
|
||||||
|
super(market.stationsProperty());
|
||||||
|
converter = new StationStringConverter(market);
|
||||||
|
comparator = (s1, s2) -> converter.toString(s1).toLowerCase().compareTo(converter.toString(s2).toLowerCase());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Comparator<StationModel> getComparator() {
|
||||||
|
return comparator;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean isMatch(StationModel suggestion, AutoCompletionBinding.ISuggestionRequest request) {
|
||||||
|
String s = converter.toString(suggestion).toLowerCase();
|
||||||
|
return s.contains(request.getUserText().toLowerCase());
|
||||||
|
}
|
||||||
|
|
||||||
|
public StringConverter<StationModel> getConverter() {
|
||||||
|
return converter;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package ru.trader.view.support.cells;
|
||||||
|
|
||||||
|
import javafx.scene.control.ListCell;
|
||||||
|
import javafx.scene.control.ListView;
|
||||||
|
import javafx.util.Callback;
|
||||||
|
import ru.trader.model.ItemModel;
|
||||||
|
|
||||||
|
public class ItemListCell implements Callback<ListView<ItemModel>, ListCell<ItemModel>> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ListCell<ItemModel> call(ListView<ItemModel> param){
|
||||||
|
return new ListCell<ItemModel>(){
|
||||||
|
private ItemModel i;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateItem(ItemModel item, boolean empty) {
|
||||||
|
super.updateItem(item, empty);
|
||||||
|
if (!empty){
|
||||||
|
if (i != item){
|
||||||
|
textProperty().unbind();
|
||||||
|
textProperty().bind(item.nameProperty());
|
||||||
|
i = item;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
textProperty().unbind();
|
||||||
|
i = null;
|
||||||
|
setText(null);
|
||||||
|
setGraphic(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -61,6 +61,9 @@
|
|||||||
<Tab text="%main.tab.search">
|
<Tab text="%main.tab.search">
|
||||||
<fx:include source="search.fxml"/>
|
<fx:include source="search.fxml"/>
|
||||||
</Tab>
|
</Tab>
|
||||||
|
<Tab text="Маршрут">
|
||||||
|
<fx:include source="routeSearch.fxml"/>
|
||||||
|
</Tab>
|
||||||
</TabPane>
|
</TabPane>
|
||||||
</center>
|
</center>
|
||||||
|
|
||||||
|
|||||||
71
client/src/main/resources/view/missions.fxml
Normal file
71
client/src/main/resources/view/missions.fxml
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<?import javafx.geometry.*?>
|
||||||
|
<?import javafx.scene.control.*?>
|
||||||
|
<?import javafx.scene.layout.*?>
|
||||||
|
|
||||||
|
<?import org.controlsfx.glyphfont.Glyph?>
|
||||||
|
<?import ru.trader.view.support.NumberField?>
|
||||||
|
<?import ru.trader.view.support.cells.ItemListCell?>
|
||||||
|
<?import ru.trader.view.support.ItemStringConverter?>
|
||||||
|
<GridPane xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
|
||||||
|
fx:controller="ru.trader.controllers.MissionsController"
|
||||||
|
hgap="10" vgap="5">
|
||||||
|
|
||||||
|
<columnConstraints>
|
||||||
|
<ColumnConstraints minWidth="180" />
|
||||||
|
<ColumnConstraints minWidth="180" />
|
||||||
|
<ColumnConstraints minWidth="180" />
|
||||||
|
</columnConstraints>
|
||||||
|
|
||||||
|
<Label text="Курьерские"/>
|
||||||
|
<HBox GridPane.rowIndex="1">
|
||||||
|
<Label text="Доставить на:"/>
|
||||||
|
<TextField fx:id="receiverText" prefWidth="160"/>
|
||||||
|
</HBox>
|
||||||
|
<HBox GridPane.rowIndex="3">
|
||||||
|
<Label text="Прибыль:"/>
|
||||||
|
<NumberField fx:id="courierProfit" value="0" />
|
||||||
|
</HBox>
|
||||||
|
<Button fx:id="addCourierBtn" prefWidth="30" onAction="#addCourier" GridPane.rowIndex="4">
|
||||||
|
<graphic><Glyph text="FontAwesome|PLUS"/></graphic>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Label text="Доставка" GridPane.columnIndex="1"/>
|
||||||
|
<HBox GridPane.rowIndex="1" GridPane.columnIndex="1">
|
||||||
|
<Label text="Доставить на:"/>
|
||||||
|
<TextField fx:id="buyerText" prefWidth="160"/>
|
||||||
|
</HBox>
|
||||||
|
<HBox GridPane.rowIndex="2" GridPane.columnIndex="1">
|
||||||
|
<Label text="Кол-во:"/>
|
||||||
|
<NumberField fx:id="deliveryCount" value="0"/>
|
||||||
|
</HBox>
|
||||||
|
<HBox GridPane.rowIndex="3" GridPane.columnIndex="1">
|
||||||
|
<Label text="Прибыль:"/>
|
||||||
|
<NumberField fx:id="deliveryProfit" value="0"/>
|
||||||
|
</HBox>
|
||||||
|
<Button fx:id="addDeliveryBtn" prefWidth="30" onAction="#addDelivery" GridPane.rowIndex="4" GridPane.columnIndex="1">
|
||||||
|
<graphic><Glyph text="FontAwesome|PLUS"/></graphic>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Label text="Поставка" GridPane.columnIndex="2"/>
|
||||||
|
<HBox GridPane.rowIndex="1" GridPane.columnIndex="2">
|
||||||
|
<Label text="Товар:"/>
|
||||||
|
<ComboBox fx:id="item" prefWidth="160">
|
||||||
|
<cellFactory><ItemListCell /></cellFactory>
|
||||||
|
<converter><ItemStringConverter /></converter>
|
||||||
|
</ComboBox>
|
||||||
|
</HBox>
|
||||||
|
<HBox GridPane.rowIndex="2" GridPane.columnIndex="2">
|
||||||
|
<Label text="Кол-во:"/>
|
||||||
|
<NumberField fx:id="supplyCount" value="0"/>
|
||||||
|
</HBox>
|
||||||
|
<HBox GridPane.rowIndex="3" GridPane.columnIndex="2">
|
||||||
|
<Label text="Прибыль:"/>
|
||||||
|
<NumberField fx:id="supplyProfit" value="0"/>
|
||||||
|
</HBox>
|
||||||
|
<Button fx:id="addSupplyBtn" prefWidth="30" onAction="#addSupply" GridPane.rowIndex="4" GridPane.columnIndex="2">
|
||||||
|
<graphic><Glyph text="FontAwesome|PLUS"/></graphic>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
</GridPane>
|
||||||
@@ -6,35 +6,30 @@
|
|||||||
<?import ru.trader.view.support.cells.OfferListCell?>
|
<?import ru.trader.view.support.cells.OfferListCell?>
|
||||||
<?import javafx.geometry.Insets?>
|
<?import javafx.geometry.Insets?>
|
||||||
<?import ru.trader.view.support.NumberField?>
|
<?import ru.trader.view.support.NumberField?>
|
||||||
<HBox xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
|
<?import org.controlsfx.glyphfont.Glyph?>
|
||||||
|
<VBox xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
|
||||||
fx:controller="ru.trader.controllers.RouteSearchController"
|
fx:controller="ru.trader.controllers.RouteSearchController"
|
||||||
spacing="4" >
|
spacing="4" >
|
||||||
<Label text="Имя:" />
|
<HBox>
|
||||||
<TextField fx:id="name" />
|
<HBox>
|
||||||
<Label text="Баланс:" />
|
<Label text="От:" />
|
||||||
<NumberField fx:id="balance" />
|
<TextField fx:id="fromSystemText" />
|
||||||
<Label text="Система:" />
|
<ComboBox fx:id="fromStation" />
|
||||||
<TextField fx:id="systemText" />
|
<Button onAction="#currentAsFrom"/>
|
||||||
<Button fx:id="btnAddSystem"/>
|
</HBox>
|
||||||
<Label text="Станция:" />
|
<HBox>
|
||||||
<ComboBox fx:id="station" />
|
<Label text="До:" />
|
||||||
<Button fx:id="btnAddStation"/>
|
<TextField fx:id="toSystemText" />
|
||||||
|
<ComboBox fx:id="toStation" />
|
||||||
|
<Button onAction="#loop"/>
|
||||||
|
</HBox>
|
||||||
|
<Button prefWidth="80" text="Найти" onAction="#search" />
|
||||||
|
</HBox>
|
||||||
<VBox>
|
<VBox>
|
||||||
|
<fx:include fx:id="missions" source="missions.fxml"/>
|
||||||
<HBox>
|
<HBox>
|
||||||
<Label text="Трюм:" />
|
<ListView fx:id="missionsList" />
|
||||||
<NumberField fx:id="cargo" />
|
<Button prefWidth="30" onAction="#removeMission"><graphic><Glyph text="FontAwesome|MINUS"/></graphic></Button>
|
||||||
</HBox>
|
|
||||||
<HBox>
|
|
||||||
<Label text="Топливный бак:" />
|
|
||||||
<NumberField fx:id="tank" />
|
|
||||||
</HBox>
|
|
||||||
<HBox>
|
|
||||||
<Label text="Масса:" />
|
|
||||||
<NumberField fx:id="mass" />
|
|
||||||
</HBox>
|
|
||||||
<HBox>
|
|
||||||
<Label text="Двигатель:" />
|
|
||||||
<ComboBox fx:id="engine" />
|
|
||||||
</HBox>
|
</HBox>
|
||||||
</VBox>
|
</VBox>
|
||||||
</HBox>
|
</VBox>
|
||||||
|
|||||||
Reference in New Issue
Block a user