Archived
0

modify UI

This commit is contained in:
Mo
2015-10-27 14:22:56 +03:00
parent 6d706e00dd
commit 84585b5936
24 changed files with 485 additions and 279 deletions

View File

@@ -82,7 +82,7 @@ public class Main extends Application {
private static void loadMainScene() throws IOException { private static void loadMainScene() throws IOException {
primaryStage.setTitle(Localization.getString("main.title")); primaryStage.setTitle(Localization.getString("main.title"));
primaryStage.setMinHeight(590); primaryStage.setMinHeight(500);
primaryStage.setScene(new Scene(Screeners.newScreeners(Main.class.getResource("/view/main.fxml"), getUrl("style.css").toExternalForm()))); primaryStage.setScene(new Scene(Screeners.newScreeners(Main.class.getResource("/view/main.fxml"), getUrl("style.css").toExternalForm())));
primaryStage.setOnCloseRequest((we) -> { primaryStage.setOnCloseRequest((we) -> {
try { try {

View File

@@ -34,6 +34,7 @@ public class LoginController {
dialog.getDialogPane().getButtonTypes().addAll(loginButtonType, ButtonType.CANCEL); dialog.getDialogPane().getButtonTypes().addAll(loginButtonType, ButtonType.CANCEL);
Node loginButton = dialog.getDialogPane().lookupButton(loginButtonType); Node loginButton = dialog.getDialogPane().lookupButton(loginButtonType);
loginButton.setDisable(true); loginButton.setDisable(true);
email.setText(Main.SETTINGS.edce().getEmail());
email.textProperty().addListener((observable, oldValue, newValue) -> { email.textProperty().addListener((observable, oldValue, newValue) -> {
loginButton.setDisable(newValue.trim().isEmpty()); loginButton.setDisable(newValue.trim().isEmpty());
Main.SETTINGS.edce().setEmail(newValue); Main.SETTINGS.edce().setEmail(newValue);
@@ -54,7 +55,7 @@ public class LoginController {
if (dialog == null){ if (dialog == null){
createDialog(parent, content); createDialog(parent, content);
} }
Platform.runLater(email::requestFocus); Platform.runLater(password::requestFocus);
Optional<Pair<String, String>> result = dialog.showAndWait(); Optional<Pair<String, String>> result = dialog.showAndWait();
clear(); clear();
return result; return result;

View File

@@ -3,9 +3,7 @@ package ru.trader.controllers;
import javafx.event.ActionEvent; import javafx.event.ActionEvent;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.control.Menu; import javafx.scene.control.*;
import javafx.scene.control.RadioMenuItem;
import javafx.scene.control.ToggleGroup;
import javafx.scene.layout.BorderPane; import javafx.scene.layout.BorderPane;
import javafx.stage.FileChooser; import javafx.stage.FileChooser;
import org.controlsfx.control.action.Action; import org.controlsfx.control.action.Action;
@@ -51,6 +49,10 @@ public class MainController {
private ItemsController itemsController; private ItemsController itemsController;
@FXML @FXML
private RouterController routerController; private RouterController routerController;
@FXML
private TabPane tabs;
@FXML
private Tab track;
@FXML @FXML
private void initialize() { private void initialize() {
@@ -75,7 +77,7 @@ public class MainController {
} }
} catch (IOException e) { } catch (IOException e) {
LOG.error("Error on change locale to {}", n.getUserData()); LOG.error("Error on change locale to {}", n.getUserData());
LOG.error("",e); LOG.error("", e);
} }
}); });
} }
@@ -318,4 +320,8 @@ public class MainController {
market = world; market = world;
Screeners.reinitAll(); Screeners.reinitAll();
} }
public void showTrack(){
tabs.getSelectionModel().select(track);
}
} }

View File

@@ -1,12 +1,12 @@
package ru.trader.controllers; package ru.trader.controllers;
import javafx.beans.binding.Bindings;
import javafx.collections.FXCollections; import javafx.collections.FXCollections;
import javafx.collections.ObservableList; import javafx.collections.ObservableList;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox; import javafx.scene.control.ComboBox;
import javafx.scene.control.TextField; import javafx.scene.control.TextField;
import javafx.scene.control.ToggleButton;
import javafx.scene.control.ToggleGroup;
import ru.trader.model.*; import ru.trader.model.*;
import ru.trader.view.support.NumberField; import ru.trader.view.support.NumberField;
import ru.trader.view.support.autocomplete.AutoCompletion; import ru.trader.view.support.autocomplete.AutoCompletion;
@@ -17,109 +17,116 @@ import ru.trader.view.support.autocomplete.StationsProvider;
public class MissionsController { public class MissionsController {
@FXML @FXML
private TextField receiverText; private TextField starportText;
private AutoCompletion<StationModel> receiver; private AutoCompletion<StationModel> starport;
@FXML @FXML
private NumberField courierProfit; private ComboBox<ItemModel> cargo;
@FXML @FXML
private Button addCourierBtn; private NumberField quantity;
@FXML
private NumberField reward;
@FXML
private ToggleButton courierBtn;
@FXML
private ToggleButton deliveryBtn;
@FXML
private ToggleButton supplyBtn;
@FXML private enum MISSION_TYPE {COURIER, DELIVERY, SUPPLY}
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 ToggleGroup missionTypeGroup;
private final ObservableList<MissionModel> missions; private final ObservableList<MissionModel> missions;
private StationModel station; private StationModel station;
private MISSION_TYPE missionType;
public MissionsController() { public MissionsController() {
missionTypeGroup = new ToggleGroup();
missions = FXCollections.observableArrayList(); missions = FXCollections.observableArrayList();
} }
@FXML @FXML
private void initialize(){ private void initialize(){
missionTypeGroup.selectedToggleProperty().addListener((ov, o, n) ->{
if (courierBtn.equals(n)){
missionType = MISSION_TYPE.COURIER;
starportText.setDisable(false);
cargo.setDisable(true);
quantity.setDisable(true);
reward.setDisable(false);
} else
if (deliveryBtn.equals(n)){
missionType = MISSION_TYPE.DELIVERY;
starportText.setDisable(false);
cargo.setDisable(true);
quantity.setDisable(false);
reward.setDisable(false);
} else
if (supplyBtn.equals(n)){
missionType = MISSION_TYPE.SUPPLY;
if (station != null) {
starport.setValue(station);
}
starportText.setDisable(false);
cargo.setDisable(false);
quantity.setDisable(false);
reward.setDisable(false);
} else {
missionType = null;
starportText.setDisable(true);
cargo.setDisable(true);
quantity.setDisable(true);
reward.setDisable(true);
}
});
courierBtn.setToggleGroup(missionTypeGroup);
deliveryBtn.setToggleGroup(missionTypeGroup);
supplyBtn.setToggleGroup(missionTypeGroup);
init(); init();
addCourierBtn.disableProperty().bind(Bindings.createBooleanBinding(() -> receiver.getValue() == null, receiver.valueProperty())
.or(courierProfit.wrongProperty())
);
addDeliveryBtn.disableProperty().bind(Bindings.createBooleanBinding(() -> buyer.getValue() == null, buyer.valueProperty())
.or(deliveryCount.wrongProperty())
.or(deliveryProfit.wrongProperty())
);
addSupplyBtn.disableProperty().bind(Bindings.createBooleanBinding(() -> item.getValue() == null, item.valueProperty())
.or(supplyCount.wrongProperty())
.or(supplyProfit.wrongProperty())
);
} }
void init(){ void init(){
MarketModel world = MainController.getWorld(); MarketModel world = MainController.getWorld();
item.setItems(world.itemsProperty()); cargo.setItems(world.itemsProperty());
StationsProvider provider = new StationsProvider(world); StationsProvider provider = new StationsProvider(world);
if (receiver == null){ if (starport == null){
receiver = new AutoCompletion<>(receiverText, new CachedSuggestionProvider<>(provider), ModelFabric.NONE_STATION, provider.getConverter()); starport = new AutoCompletion<>(starportText, new CachedSuggestionProvider<>(provider), ModelFabric.NONE_STATION, provider.getConverter());
} else { } else {
receiver.setSuggestions(provider.getPossibleSuggestions()); starport.setSuggestions(provider.getPossibleSuggestions());
receiver.setConverter(provider.getConverter()); starport.setConverter(provider.getConverter());
}
if (buyer == null){
buyer = new AutoCompletion<>(buyerText, new CachedSuggestionProvider<>(provider), ModelFabric.NONE_STATION, provider.getConverter());
} else {
buyer.setSuggestions(provider.getPossibleSuggestions());
buyer.setConverter(provider.getConverter());
} }
} }
void setStations(ObservableList<String> stationNames) { void setStations(ObservableList<String> stationNames) {
receiver.setSuggestions(stationNames); starport.setSuggestions(stationNames);
buyer.setSuggestions(stationNames);
} }
void setItems(ObservableList<ItemModel> items){ void setItems(ObservableList<ItemModel> items){
item.setItems(items); cargo.setItems(items);
} }
@FXML public void add(){
private void addCourier(){ StationModel station = starport.getValue();
StationModel station = receiver.getValue(); ItemModel item = cargo.getValue();
double profit = courierProfit.getValue().doubleValue(); long count = quantity.getValue().longValue();
double profit = reward.getValue().doubleValue();
if (station != null && profit > 0){ if (station != null && profit > 0){
missions.add(new MissionModel(station, profit)); switch (missionType){
case COURIER: missions.add(new MissionModel(station, profit));
break;
case DELIVERY: if (count > 0) missions.add(new MissionModel(station, count, profit));
break;
case SUPPLY: if (item != null && count > 0) missions.add(new MissionModel(station, item, count, profit));
break;
}
} }
} }
@FXML public void remove(int index){
private void addDelivery(){ missions.remove(index);
StationModel station = buyer.getValue();
long count = deliveryCount.getValue().longValue();
double profit = deliveryProfit.getValue().doubleValue();
if (station != null && profit > 0){
missions.add(new MissionModel(station, count, profit));
}
} }
@FXML public void clear(){
private void addSupply(){ missions.clear();
ItemModel item = this.item.getValue();
long count = supplyCount.getValue().longValue();
double profit = supplyProfit.getValue().doubleValue();
if (station != null && item != null && profit > 0){
missions.add(new MissionModel(station, item, count, profit));
}
} }
public ObservableList<MissionModel> getMissions() { public ObservableList<MissionModel> getMissions() {

View File

@@ -3,10 +3,8 @@ package ru.trader.controllers;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.collections.FXCollections; import javafx.collections.FXCollections;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.geometry.Insets;
import javafx.scene.control.*; import javafx.scene.control.*;
import javafx.scene.input.MouseButton; import javafx.scene.input.MouseButton;
import org.controlsfx.control.SegmentedButton;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import ru.trader.core.SERVICE_TYPE; import ru.trader.core.SERVICE_TYPE;
@@ -28,13 +26,11 @@ public class OffersController {
private StationModel station; private StationModel station;
@FXML
private Insets stationsMargin;
@FXML @FXML
private TextField systemText; private TextField systemText;
private AutoCompletion<SystemModel> system; private AutoCompletion<SystemModel> system;
@FXML @FXML
private SegmentedButton stationsBar; private ListView<StationModel> stationsList;
@FXML @FXML
private TableView<OfferModel> tblSell; private TableView<OfferModel> tblSell;
@FXML @FXML
@@ -63,12 +59,12 @@ public class OffersController {
private CheckBox cbMediumLandpad; private CheckBox cbMediumLandpad;
@FXML @FXML
private CheckBox cbLargeLandpad; private CheckBox cbLargeLandpad;
@FXML
private TitledPane stationPane;
private final List<OfferModel> sells = FXCollections.observableArrayList(); private final List<OfferModel> sells = FXCollections.observableArrayList();
private final List<OfferModel> buys = FXCollections.observableArrayList(); private final List<OfferModel> buys = FXCollections.observableArrayList();
private final static ToggleGroup stationsGrp = new ToggleGroup();
// инициализируем форму данными // инициализируем форму данными
@FXML @FXML
private void initialize() { private void initialize() {
@@ -77,14 +73,13 @@ public class OffersController {
LOG.info("Change system to {}", newValue); LOG.info("Change system to {}", newValue);
fillDetails(newValue); fillDetails(newValue);
}); });
stationsGrp.selectedToggleProperty().addListener((v, o, n) -> { stationsList.getSelectionModel().selectedItemProperty().addListener((v, o, n) -> {
if (n != null){ if (n != null) {
fillTables((StationModel) n.getUserData()); fillTables(n);
} else { } else {
fillTables(ModelFabric.NONE_STATION); fillTables(ModelFabric.NONE_STATION);
} }
}); });
stationsBar.setToggleGroup(stationsGrp);
tblSell.getSelectionModel().selectedItemProperty().addListener((v, o, n) -> { tblSell.getSelectionModel().selectedItemProperty().addListener((v, o, n) -> {
if (n != null) Screeners.changeItemDesc(n.getItem()); if (n != null) Screeners.changeItemDesc(n.getItem());
@@ -122,27 +117,21 @@ public class OffersController {
private void fillDetails(SystemModel system){ private void fillDetails(SystemModel system){
if (ModelFabric.isFake(system)) return; if (ModelFabric.isFake(system)) return;
stationsBar.getButtons().clear();
List<StationModel> stations = system.getStations(); List<StationModel> stations = system.getStations();
stations.forEach(s -> stationsBar.getButtons().add(buildStationNode(s))); stationsList.setItems(FXCollections.observableList(stations));
if (!stations.isEmpty()){ if (!stations.isEmpty()){
stationsBar.getButtons().get(0).setSelected(true); stationsList.getSelectionModel().selectFirst();
} else { } else {
fillTables(ModelFabric.NONE_STATION); fillTables(ModelFabric.NONE_STATION);
} }
} }
private ToggleButton buildStationNode(StationModel station){
ToggleButton stationBtn = new ToggleButton(station.getName());
stationBtn.setUserData(station);
return stationBtn;
}
private void fillTables(StationModel station){ private void fillTables(StationModel station){
LOG.info("Change station to {}", station); LOG.info("Change station to {}", station);
this.station = station; this.station = station;
sells.clear(); sells.clear();
buys.clear(); buys.clear();
stationPane.setText(station.getName());
distance.setText(""); distance.setText("");
government.setText(""); government.setText("");
faction.setText(""); faction.setText("");
@@ -253,7 +242,9 @@ public class OffersController {
@Override @Override
public void add(StationModel station) { public void add(StationModel station) {
ViewUtils.doFX(() -> { ViewUtils.doFX(() -> {
stationsBar.getButtons().add(buildStationNode(station)); if (station.getSystem().equals(system.getValue())) {
stationsList.getItems().add(station);
}
refresh(); refresh();
sort(); sort();
}); });
@@ -269,8 +260,9 @@ public class OffersController {
@Override @Override
public void remove(StationModel station) { public void remove(StationModel station) {
ViewUtils.doFX(() -> { ViewUtils.doFX(() -> {
stationsBar.getToggleGroup().getSelectedToggle().setSelected(false); if (station.getSystem().equals(system.getValue())) {
stationsBar.getButtons().removeIf(b -> b.getUserData().equals(station)); stationsList.getItems().remove(station);
}
refresh(); refresh();
sort(); sort();
}); });

View File

@@ -67,15 +67,15 @@ public class RouteSearchController {
fromStation.setItems(n.getStationNamesList()); fromStation.setItems(n.getStationNamesList());
fromStation.getSelectionModel().selectFirst(); fromStation.getSelectionModel().selectFirst();
}); });
fromStation.valueProperty().addListener((ov, o , n) -> { fromStation.valueProperty().addListener((ov, o, n) -> {
SystemModel system = fromSystem.getValue(); SystemModel system = fromSystem.getValue();
if (system == null || n == null){ if (system == null || n == null) {
missionsController.setStation(ModelFabric.NONE_STATION); missionsController.setStation(ModelFabric.NONE_STATION);
} else { } else {
missionsController.setStation(system.get(n)); missionsController.setStation(system.get(n));
} }
}); });
toSystem.valueProperty().addListener((ov, o , n) -> { toSystem.valueProperty().addListener((ov, o, n) -> {
toStation.setItems(n.getStationNamesList()); toStation.setItems(n.getStationNamesList());
toStation.getSelectionModel().selectFirst(); toStation.getSelectionModel().selectFirst();
}); });
@@ -105,20 +105,44 @@ public class RouteSearchController {
missionsList.getItems().forEach(m -> m.toSpecification(specificator)); missionsList.getItems().forEach(m -> m.toSpecification(specificator));
market.getRoutes(f, fS, t, tS, profile.getBalance(), specificator, routes -> { market.getRoutes(f, fS, t, tS, profile.getBalance(), specificator, routes -> {
Optional<RouteModel> path = Screeners.showRouters(routes); Optional<RouteModel> path = Screeners.showRouters(routes);
if (path.isPresent()){ if (path.isPresent()) {
RouteModel route = path.get(); RouteModel route = path.get();
route.addAll(0, missionsList.getItems()); route.addAll(0, missionsList.getItems());
profile.setRoute(route); profile.setRoute(route);
Screeners.showTrackTab();
} }
}); });
} }
@FXML
private void searchTop(){
market.getTopRoutes(profile.getBalance(), routes -> {
Optional<RouteModel> path = Screeners.showRouters(routes);
if (path.isPresent()) {
RouteModel route = path.get();
profile.setRoute(route);
Screeners.showTrackTab();
}
});
}
@FXML
private void addMission(){
missionsController.add();
}
@FXML @FXML
private void removeMission(){ private void removeMission(){
int index = missionsList.getSelectionModel().getSelectedIndex(); int index = missionsList.getSelectionModel().getSelectedIndex();
if (index >= 0){ if (index >= 0){
missionsList.getItems().remove(index); missionsController.remove(index);
} }
}
@FXML
private void clearMissions(){
missionsController.clear();
} }
} }

View File

@@ -6,7 +6,8 @@ import javafx.collections.FXCollections;
import javafx.collections.ObservableList; import javafx.collections.ObservableList;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.Node; import javafx.scene.Node;
import javafx.scene.control.*; import javafx.scene.control.Label;
import javafx.scene.control.ListView;
import javafx.scene.layout.Pane; import javafx.scene.layout.Pane;
import ru.trader.model.*; import ru.trader.model.*;
import ru.trader.model.support.BindingsHelper; import ru.trader.model.support.BindingsHelper;
@@ -52,11 +53,21 @@ public class RouteTrackController {
@FXML @FXML
private void initialize(){ private void initialize(){
MainController.getProfile().routeProperty().addListener(routeListener);
addMissionsList.setItems(missionsController.getMissions()); addMissionsList.setItems(missionsController.getMissions());
buyOrders.setCellFactory(new OrderListCell(false)); buyOrders.setCellFactory(new OrderListCell(false));
sellOrders.setCellFactory(new OrderListCell(true)); sellOrders.setCellFactory(new OrderListCell(true));
editGroup.setVisible(false); editGroup.setVisible(false);
init();
}
void init(){
ProfileModel profile = MainController.getProfile();
profile.routeProperty().addListener(routeListener);
setRoute(profile.getRoute());
}
void unbind(){
MainController.getProfile().routeProperty().removeListener(routeListener);
} }
public void setRoute(RouteModel route){ public void setRoute(RouteModel route){
@@ -65,38 +76,64 @@ public class RouteTrackController {
} }
this.route = route; this.route = route;
fillTrack(); fillTrack();
setIndex(route.getCurrentEntry()); if (route != null) {
this.route.currentEntryProperty().addListener(currentEntryListener); setIndex(route.getCurrentEntry());
this.route.currentEntryProperty().addListener(currentEntryListener);
} else {
setIndex(-1);
}
} }
public void setIndex(int index){ public void setIndex(int index){
trackNode.setActive(index); if (index != -1) {
trackNode.setActive(index);
} else {
update();
}
} }
private void fillTrack(){ private void fillTrack(){
if (trackNode != null) trackNode.activeProperty().removeListener(activeEntryListener); if (trackNode != null) trackNode.activeProperty().removeListener(activeEntryListener);
trackNode = new Track(route); if (route != null) {
track.getChildren().setAll(trackNode.getNode()); trackNode = new Track(route);
trackNode.activeProperty().addListener(activeEntryListener); track.getChildren().setAll(trackNode.getNode());
trackNode.activeProperty().addListener(activeEntryListener);
} else {
trackNode = null;
track.getChildren().clear();
}
} }
private void update(){ private void update(){
int index = trackNode.getActive(); int index = trackNode != null ? trackNode.getActive() : -1;
if (index == -1) return; if (index != -1) {
RouteEntryModel entry = route.get(index); RouteEntryModel entry = route.get(index);
missionsController.setStation(entry.getStation()); missionsController.setStation(entry.getStation());
ObservableList<String> stations = BindingsHelper.observableList(route.getStations(index), StationModel::getFullName); ObservableList<String> stations = BindingsHelper.observableList(route.getStations(index), StationModel::getFullName);
missionsController.setStations(stations); missionsController.setStations(stations);
ObservableList<ItemModel> items = FXCollections.observableList(route.getSellOffers(index).stream().map(OfferModel::getItem).collect(Collectors.toList())); ObservableList<ItemModel> items = FXCollections.observableList(route.getSellOffers(index).stream().map(OfferModel::getItem).collect(Collectors.toList()));
missionsController.setItems(items); missionsController.setItems(items);
station.setText(entry.getStation().getName()); station.setText(entry.getStation().getName());
system.setText(entry.getStation().getSystem().getName()); system.setText(entry.getStation().getSystem().getName());
time.setText(ViewUtils.timeToString(entry.getTime())); time.setText(ViewUtils.timeToString(entry.getTime()));
refuel.setText(String.valueOf(entry.getRefill())); refuel.setText(String.valueOf(entry.getRefill()));
buyOrders.setItems(entry.orders()); buyOrders.setItems(entry.orders());
sellOrders.setItems(entry.sellOrders()); sellOrders.setItems(entry.sellOrders());
missionsList.setItems(entry.missions()); missionsList.setItems(entry.missions());
} else {
missionsController.setStation(ModelFabric.NONE_STATION);
missionsController.setStations(FXCollections.emptyObservableList());
missionsController.setItems(FXCollections.emptyObservableList());
station.setText("");
system.setText("");
time.setText("");
refuel.setText("");
buyOrders.setItems(FXCollections.emptyObservableList());
sellOrders.setItems(FXCollections.emptyObservableList());
missionsList.setItems(FXCollections.emptyObservableList());
}
} }
@FXML @FXML
@@ -111,25 +148,33 @@ public class RouteTrackController {
} }
@FXML @FXML
private void addMissions(){ private void addMissionsToTrack(){
int startIndex = route.isLoop() ? 0 : trackNode.getActive(); int startIndex = trackNode.getActive();
route.addAll(startIndex, missionsList.getItems()); route.addAll(startIndex, addMissionsList.getItems());
}
@FXML
private void addMission(){
missionsController.add();
} }
@FXML @FXML
private void removeMission(){ private void removeMission(){
int index = missionsList.getSelectionModel().getSelectedIndex(); int index = addMissionsList.getSelectionModel().getSelectedIndex();
if (index >= 0){ if (index >= 0){
missionsList.getItems().remove(index); missionsController.remove(index);
} }
} }
@FXML
private void clearMissions(){
missionsController.clear();
}
private final ChangeListener<? super Number> currentEntryListener = (ov, o, n) -> ViewUtils.doFX(() -> setIndex(n.intValue())); private final ChangeListener<? super Number> currentEntryListener = (ov, o, n) -> ViewUtils.doFX(() -> setIndex(n.intValue()));
private final InvalidationListener activeEntryListener = ov -> ViewUtils.doFX(this::update); private final InvalidationListener activeEntryListener = ov -> ViewUtils.doFX(this::update);
private final ChangeListener<RouteModel> routeListener = (ov, o, n) -> { private final ChangeListener<RouteModel> routeListener = (ov, o, n) -> ViewUtils.doFX(() -> setRoute(n));
if (n != null){
ViewUtils.doFX(() -> setRoute(n));
}
};
} }

View File

@@ -264,4 +264,8 @@ public class Screeners {
filterController.init(); filterController.init();
EMDNUpdater.setMarket(MainController.getMarket()); EMDNUpdater.setMarket(MainController.getMarket());
} }
public static void showTrackTab(){
mainController.showTrack();
}
} }

View File

@@ -1,12 +1,13 @@
package ru.trader.controllers; package ru.trader.controllers;
import javafx.collections.FXCollections;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.Parent; import javafx.scene.Parent;
import javafx.scene.control.*; import javafx.scene.control.*;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import ru.trader.EMDNUpdater;
import ru.trader.Main; import ru.trader.Main;
import ru.trader.core.Profile;
import ru.trader.view.support.Localization; import ru.trader.view.support.Localization;
import ru.trader.view.support.NumberField; import ru.trader.view.support.NumberField;
@@ -22,24 +23,60 @@ public class SettingsController {
private CheckBox emdnUpdateOnly; private CheckBox emdnUpdateOnly;
@FXML @FXML
private NumberField emdnUpdateTime; private NumberField emdnUpdateTime;
@FXML @FXML
private NumberField segmentSize; private NumberField jumps;
@FXML @FXML
private NumberField pathsCount; private NumberField lands;
@FXML
private NumberField routesCount;
@FXML
private NumberField fuelPrice;
@FXML
private ComboBox<Profile.PATH_PRIORITY> pathPriority;
@FXML
private NumberField jumpTime;
@FXML
private NumberField landingTime;
@FXML
private NumberField takeoffTime;
@FXML
private NumberField rechargeTime;
@FXML
private CheckBox edceActive;
@FXML
private NumberField edceInterval;
private Dialog<ButtonType> dlg; private Dialog<ButtonType> dlg;
@FXML @FXML
private void initialize(){ private void initialize(){
pathPriority.setItems(FXCollections.observableArrayList(Profile.PATH_PRIORITY.values()));
init(); init();
} }
private void init(){ private void init(){
/*
emdnSubServ.setText(Main.SETTINGS.getEMDNSub()); emdnSubServ.setText(Main.SETTINGS.getEMDNSub());
emdnOn.setSelected(Main.SETTINGS.getEMDNActive()); emdnOn.setSelected(Main.SETTINGS.getEMDNActive());
emdnUpdateOnly.setSelected(Main.SETTINGS.getEMDNUpdateOnly()); emdnUpdateOnly.setSelected(Main.SETTINGS.getEMDNUpdateOnly());
emdnUpdateTime.setValue(Main.SETTINGS.getEMDNAutoUpdate()); emdnUpdateTime.setValue(Main.SETTINGS.getEMDNAutoUpdate());
pathsCount.setValue(Main.SETTINGS.getRoutesCount()); */
Profile profile =Main.SETTINGS.getProfile();
jumps.setValue(profile.getJumps());
lands.setValue(profile.getLands());
routesCount.setValue(profile.getRoutesCount());
fuelPrice.setValue(profile.getFuelPrice());
pathPriority.setValue(profile.getPathPriority());
jumpTime.setValue(profile.getJumpTime());
landingTime.setValue(profile.getLandingTime());
takeoffTime.setValue(profile.getTakeoffTime());
rechargeTime.setValue(profile.getRechargeTime());
edceActive.setSelected(Main.SETTINGS.edce().isActive());
edceInterval.setValue(Main.SETTINGS.edce().getInterval());
} }
private void createDialog(Parent owner, Parent content){ private void createDialog(Parent owner, Parent content){
@@ -59,6 +96,7 @@ public class SettingsController {
} }
private void save() { private void save() {
/*
Main.SETTINGS.setEMDNSub(emdnSubServ.getText()); Main.SETTINGS.setEMDNSub(emdnSubServ.getText());
EMDNUpdater.setSub(emdnSubServ.getText()); EMDNUpdater.setSub(emdnSubServ.getText());
Main.SETTINGS.setEMDNActive(emdnOn.isSelected()); Main.SETTINGS.setEMDNActive(emdnOn.isSelected());
@@ -67,6 +105,21 @@ public class SettingsController {
EMDNUpdater.setUpdateOnly(emdnUpdateOnly.isSelected()); EMDNUpdater.setUpdateOnly(emdnUpdateOnly.isSelected());
Main.SETTINGS.setEMDNAutoUpdate(emdnUpdateTime.getValue().longValue()); Main.SETTINGS.setEMDNAutoUpdate(emdnUpdateTime.getValue().longValue());
EMDNUpdater.setInterval(emdnUpdateTime.getValue().longValue()); EMDNUpdater.setInterval(emdnUpdateTime.getValue().longValue());
*/
Profile profile =Main.SETTINGS.getProfile();
profile.setJumps(jumps.getValue().intValue());
profile.setLands(lands.getValue().intValue());
profile.setRoutesCount(routesCount.getValue().intValue());
profile.setFuelPrice(fuelPrice.getValue().intValue());
profile.setPathPriority(pathPriority.getValue());
profile.setJumpTime(jumpTime.getValue().intValue());
profile.setLandingTime(landingTime.getValue().intValue());
profile.setTakeoffTime(takeoffTime.getValue().intValue());
profile.setRechargeTime(rechargeTime.getValue().intValue());
Main.SETTINGS.edce().setActive(edceActive.isSelected());
Main.SETTINGS.edce().setInterval(edceInterval.getValue().intValue());
} }
public void showDialog(Parent parent, Parent content){ public void showDialog(Parent parent, Parent content){

View File

@@ -7,12 +7,12 @@ import javafx.scene.input.MouseButton;
import javafx.scene.layout.HBox; import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority; import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox; import javafx.scene.layout.VBox;
import javafx.scene.shape.Circle;
import javafx.scene.text.Text; import javafx.scene.text.Text;
import org.controlsfx.glyphfont.Glyph; import org.controlsfx.glyphfont.Glyph;
import ru.trader.model.RouteEntryModel; import ru.trader.model.RouteEntryModel;
import ru.trader.model.RouteModel; import ru.trader.model.RouteModel;
import ru.trader.model.StationModel; import ru.trader.model.StationModel;
import ru.trader.view.support.cells.DistanceCell;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -29,7 +29,7 @@ public class Track {
private final static String CSS_STATION_TEXT = "route-station-text"; private final static String CSS_STATION_TEXT = "route-station-text";
private final RouteModel route; private final RouteModel route;
private final HBox node = new HBox(); private final VBox node = new VBox();
private final IntegerProperty active; private final IntegerProperty active;
private final List<Node> entryNodes; private final List<Node> entryNodes;
@@ -44,7 +44,7 @@ public class Track {
private void build(){ private void build(){
StationModel prev = null; StationModel prev = null;
for (RouteEntryModel entry : route.getEntries()) { for (RouteEntryModel entry : route.getEntries()) {
if (prev != null){ /* if (prev != null){
VBox track = new VBox(); VBox track = new VBox();
VBox.setVgrow(track, Priority.ALWAYS); VBox.setVgrow(track, Priority.ALWAYS);
track.getStyleClass().add(CSS_TRACK); track.getStyleClass().add(CSS_TRACK);
@@ -54,9 +54,11 @@ public class Track {
track.getChildren().addAll(t, Glyph.create("FontAwesome|LONG_ARROW_RIGHT")); track.getChildren().addAll(t, Glyph.create("FontAwesome|LONG_ARROW_RIGHT"));
node.getChildren().addAll(track); node.getChildren().addAll(track);
} }*/
HBox entryNode = new HBox(); HBox entryNode = new HBox();
HBox stationNode = new HBox(); Circle circle = new Circle(5);
entryNode.getChildren().add(circle);
VBox stationNode = new VBox();
VBox icons = new VBox(); VBox icons = new VBox();
VBox.setVgrow(icons, Priority.ALWAYS); VBox.setVgrow(icons, Priority.ALWAYS);

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@@ -114,6 +114,8 @@ router.pane.ship.distance=Distance(LY):
router.pane.route=Route parameters router.pane.route=Route parameters
router.pane.route.from=From: router.pane.route.from=From:
router.pane.route.to=To: router.pane.route.to=To:
router.pane.route.fast=Fasted
router.button.search=Find
router.pane.route.jumps=Jumps: router.pane.route.jumps=Jumps:
router.button.recompute=Recompute router.button.recompute=Recompute
router.button.rebuild=Rebuild router.button.rebuild=Rebuild
@@ -121,6 +123,7 @@ router.button.routes=Routes
router.button.top=TOP 100 router.button.top=TOP 100
router.pane.total=Total router.pane.total=Total
router.pane.total.profit=Profit: router.pane.total.profit=Profit:
router.pane.missions=Missions
# settings.fxml # settings.fxml
settings.title=Settings settings.title=Settings
@@ -169,4 +172,10 @@ login.text.password=Password:
#verify code dialog #verify code dialog
verify.title=Check verification code verify.title=Check verification code
verify.header=The verification code has now been sent to the email address associated with your Elite account. Please enter the code into the box below. verify.header=The verification code has now been sent to the email address associated with your Elite account. Please enter the code into the box below.
verify.content=Confirmation code: verify.content=Confirmation code:
# missions.fxml
missions.label.starport=Starport:
missions.label.cargo=Cargo:
missions.label.quantity=Quantity:
missions.label.reward=Reward:

View File

@@ -114,6 +114,8 @@ router.pane.ship.distance=\u0414\u0438\u0441\u0442\u0430\u043D\u0446\u0438\u044F
router.pane.route=\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u043C\u0430\u0440\u0448\u0440\u0443\u0442\u0430 router.pane.route=\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u043C\u0430\u0440\u0448\u0440\u0443\u0442\u0430
router.pane.route.from=\u041E\u0442: router.pane.route.from=\u041E\u0442:
router.pane.route.to=\u0414\u043E: router.pane.route.to=\u0414\u043E:
router.pane.route.fast=\u0411\u044B\u0441\u0442\u0440\u044B\u0439
router.button.search=\u041D\u0430\u0439\u0442\u0438
router.pane.route.jumps=\u041F\u0440\u044B\u0436\u043A\u043E\u0432: router.pane.route.jumps=\u041F\u0440\u044B\u0436\u043A\u043E\u0432:
router.button.recompute=\u041F\u0435\u0440\u0435\u0441\u0447\u0438\u0442\u0430\u0442\u044C router.button.recompute=\u041F\u0435\u0440\u0435\u0441\u0447\u0438\u0442\u0430\u0442\u044C
router.button.rebuild=\u041F\u0435\u0440\u0435\u0441\u0442\u0440\u043E\u0438\u0442\u044C router.button.rebuild=\u041F\u0435\u0440\u0435\u0441\u0442\u0440\u043E\u0438\u0442\u044C
@@ -121,6 +123,7 @@ router.button.routes=\u041C\u0430\u0440\u0448\u0440\u0443\u0442\u044B
router.button.top=TOP 100 router.button.top=TOP 100
router.pane.total=\u0418\u0442\u043E\u0433\u043E router.pane.total=\u0418\u0442\u043E\u0433\u043E
router.pane.total.profit=\u041F\u0440\u0438\u0431\u044B\u043B\u044C: router.pane.total.profit=\u041F\u0440\u0438\u0431\u044B\u043B\u044C:
router.pane.missions=\u041C\u0438\u0441\u0441\u0438\u0438
# settings.fxml # settings.fxml
settings.title=\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B settings.title=\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B
@@ -170,4 +173,10 @@ login.text.password=\u041F\u0430\u0440\u043E\u043B\u044C:
#verify code dialog #verify code dialog
verify.title=\u041F\u0440\u043E\u0432\u0435\u0440\u043A\u0430 \u043A\u043E\u0434\u0430 \u0430\u043A\u0442\u0438\u0432\u0430\u0446\u0438\u0438 verify.title=\u041F\u0440\u043E\u0432\u0435\u0440\u043A\u0430 \u043A\u043E\u0434\u0430 \u0430\u043A\u0442\u0438\u0432\u0430\u0446\u0438\u0438
verify.header=\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043A\u043E\u0434 \u0430\u043A\u0442\u0438\u0432\u0430\u0446\u0438\u0438, \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044B\u0439 Frontier \u043D\u0430 \u0432\u0430\u0448\u0443 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0443\u044E \u043F\u043E\u0447\u0442\u0443 verify.header=\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043A\u043E\u0434 \u0430\u043A\u0442\u0438\u0432\u0430\u0446\u0438\u0438, \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044B\u0439 Frontier \u043D\u0430 \u0432\u0430\u0448\u0443 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0443\u044E \u043F\u043E\u0447\u0442\u0443
verify.content=\u041A\u043E\u0434 \u0430\u043A\u0442\u0438\u0432\u0430\u0446\u0438\u0438: verify.content=\u041A\u043E\u0434 \u0430\u043A\u0442\u0438\u0432\u0430\u0446\u0438\u0438:
# missions.fxml
missions.label.starport=\u041A\u043E\u0441\u043C\u043E\u043F\u043E\u0440\u0442:
missions.label.cargo=\u0413\u0440\u0443\u0437:
missions.label.quantity=\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E:
missions.label.reward=\u041D\u0430\u0433\u0440\u0430\u0434\u0430:

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.VBox?>
<BorderPane xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" <BorderPane xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="ru.trader.controllers.MainController" fx:controller="ru.trader.controllers.MainController"
fx:id="mainPane" fx:id="mainPane"
@@ -48,7 +48,7 @@
</VBox> </VBox>
</top> </top>
<center> <center>
<TabPane tabClosingPolicy="UNAVAILABLE" BorderPane.alignment="CENTER"> <TabPane fx:id="tabs" tabClosingPolicy="UNAVAILABLE" BorderPane.alignment="CENTER">
<Tab text="%market.items"> <Tab text="%market.items">
<fx:include fx:id="items" source="items.fxml"/> <fx:include fx:id="items" source="items.fxml"/>
</Tab> </Tab>
@@ -56,15 +56,12 @@
<fx:include fx:id="offers" source="offers.fxml"/> <fx:include fx:id="offers" source="offers.fxml"/>
</Tab> </Tab>
<Tab text="%main.tab.routes"> <Tab text="%main.tab.routes">
<fx:include fx:id="router" source="router.fxml"/> <fx:include source="routeSearch.fxml"/>
</Tab> </Tab>
<Tab text="%main.tab.search"> <Tab text="%main.tab.search">
<fx:include source="search.fxml"/> <fx:include source="search.fxml"/>
</Tab> </Tab>
<Tab text="Маршрут"> <Tab fx:id="track" text="Текущий маршрут">
<fx:include source="routeSearch.fxml"/>
</Tab>
<Tab text="Миссии">
<fx:include source="routeTrack.fxml"/> <fx:include source="routeTrack.fxml"/>
</Tab> </Tab>
</TabPane> </TabPane>

View File

@@ -1,71 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?> <?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.cells.ItemListCell?>
<?import ru.trader.view.support.ItemStringConverter?> <?import ru.trader.view.support.ItemStringConverter?>
<?import ru.trader.view.support.NumberField?>
<GridPane xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" <GridPane xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="ru.trader.controllers.MissionsController" fx:controller="ru.trader.controllers.MissionsController"
hgap="10" vgap="5"> hgap="10" vgap="5">
<columnConstraints> <columnConstraints>
<ColumnConstraints minWidth="180" /> <ColumnConstraints minWidth="100" maxWidth="100"/>
<ColumnConstraints minWidth="180" /> <ColumnConstraints minWidth="140" maxWidth="140"/>
<ColumnConstraints minWidth="180" />
</columnConstraints> </columnConstraints>
<Label text="Курьерские"/> <HBox spacing="4" GridPane.columnSpan="2" alignment="CENTER">
<HBox GridPane.rowIndex="1"> <ToggleButton fx:id="courierBtn"><graphic>
<Label text="Доставить на:"/> <ImageView fitWidth="30" preserveRatio="true" pickOnBounds="true" smooth="true">
<TextField fx:id="receiverText" prefWidth="160"/> <image><Image url="@/images/courier_mission.jpg" /></image>
</ImageView></graphic>
</ToggleButton>
<ToggleButton fx:id="deliveryBtn"><graphic>
<ImageView fitWidth="30" preserveRatio="true" pickOnBounds="true" smooth="true">
<image><Image url="@/images/transport_mission.jpg" /></image>
</ImageView></graphic>
</ToggleButton>
<ToggleButton fx:id="supplyBtn"><graphic>
<ImageView fitWidth="30" preserveRatio="true" pickOnBounds="true" smooth="true">
<image><Image url="@/images/delivering_mission.jpg" /></image>
</ImageView></graphic>
</ToggleButton>
</HBox> </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>
<Label GridPane.rowIndex="1" text="%missions.label.starport"/>
<TextField fx:id="starportText" GridPane.rowIndex="1" GridPane.columnIndex="1"/>
<Label GridPane.rowIndex="2" text="%missions.label.cargo"/>
<ComboBox fx:id="cargo" GridPane.rowIndex="2" GridPane.columnIndex="1">
<cellFactory><ItemListCell /></cellFactory>
<converter><ItemStringConverter /></converter>
</ComboBox>
<Label GridPane.rowIndex="3" text="%missions.label.quantity"/>
<NumberField fx:id="quantity" GridPane.rowIndex="3" GridPane.columnIndex="1" value="0"/>
<Label GridPane.rowIndex="4" text="%missions.label.reward"/>
<NumberField fx:id="reward" GridPane.rowIndex="4" GridPane.columnIndex="1" value="0" />
</GridPane> </GridPane>

View File

@@ -4,10 +4,10 @@
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.control.cell.*?> <?import javafx.scene.control.cell.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<?import org.controlsfx.control.SegmentedButton?>
<?import ru.trader.view.support.cells.*?> <?import ru.trader.view.support.cells.*?>
<GridPane xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" <GridPane xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="ru.trader.controllers.OffersController"> fx:controller="ru.trader.controllers.OffersController"
prefHeight="500">
<fx:define><Insets fx:id="stationsMargin" left="5" right="5" /></fx:define> <fx:define><Insets fx:id="stationsMargin" left="5" right="5" /></fx:define>
<fx:define><Insets fx:id="stationsPadding" left="12" right="10" /></fx:define> <fx:define><Insets fx:id="stationsPadding" left="12" right="10" /></fx:define>
@@ -17,14 +17,15 @@
<ColumnConstraints fillWidth="true"/> <ColumnConstraints fillWidth="true"/>
</columnConstraints> </columnConstraints>
<TitledPane GridPane.rowSpan="3" text="%market.systems" minWidth="270" prefHeight="590" collapsible="false"> <VBox GridPane.rowSpan="2" GridPane.vgrow="ALWAYS" minWidth="270">
<TextField fx:id="systemText" /> <TitledPane text="%market.system.name" collapsible="false">
</TitledPane> <TextField fx:id="systemText" />
</TitledPane>
<TitledPane GridPane.columnIndex="1" text="%market.stations" maxHeight="60" collapsible="false"> <TitledPane VBox.vgrow="ALWAYS" text="%market.stations" collapsible="false">
<SegmentedButton fx:id="stationsBar" /> <ListView fx:id="stationsList"/>
</TitledPane> </TitledPane>
<TitledPane GridPane.rowIndex="1" GridPane.columnIndex="1" text="" maxHeight="60" collapsible="false"> </VBox>
<TitledPane fx:id="stationPane" GridPane.columnIndex="1" maxHeight="60" collapsible="false">
<VBox> <VBox>
<HBox spacing="4"> <HBox spacing="4">
<Label text="%offers.text.distance"/> <Label text="%offers.text.distance"/>
@@ -51,7 +52,7 @@
</VBox> </VBox>
</TitledPane> </TitledPane>
<Accordion GridPane.rowIndex="2" GridPane.columnIndex="1" GridPane.hgrow="ALWAYS" GridPane.vgrow="ALWAYS"> <Accordion GridPane.rowIndex="1" GridPane.columnIndex="1" GridPane.hgrow="ALWAYS" GridPane.vgrow="ALWAYS">
<panes> <panes>
<TitledPane fx:id="paneSells" animated="false" text="%offers.pane.sell"> <TitledPane fx:id="paneSells" animated="false" text="%offers.pane.sell">
<TableView fx:id="tblSell" editable="true"> <TableView fx:id="tblSell" editable="true">

View File

@@ -11,19 +11,23 @@
<Label text="Имя:" /> <Label text="Имя:" />
<TextField fx:id="name" /> <TextField fx:id="name" />
<StackPane> <StackPane>
<HBox fx:id="profileInfo"> <HBox fx:id="profileInfo" spacing="4">
<Label text="Баланс:" /> <Label text="Баланс:" />
<NumberField fx:id="balance" /> <NumberField fx:id="balance" />
<Label text="Система:" /> <Label text="Система:" />
<TextField fx:id="systemText" /> <TextField fx:id="systemText" />
<Button fx:id="btnAddSystem"/> <Button fx:id="btnAddSystem" minWidth="30">
<graphic><Glyph text="FontAwesome|EDIT"/></graphic>
</Button>
<Label text="Станция:" /> <Label text="Станция:" />
<ComboBox fx:id="station" /> <ComboBox fx:id="station" />
<Button fx:id="btnAddStation"/> <Button fx:id="btnAddStation" minWidth="30">
<graphic><Glyph text="FontAwesome|EDIT"/></graphic>
</Button>
<Label text="В доке:" /> <Label text="В доке:" />
<CheckBox fx:id="docked" /> <CheckBox fx:id="docked" />
</HBox> </HBox>
<HBox fx:id="shipInfo"> <HBox fx:id="shipInfo" spacing="4">
<Label text="Трюм:" /> <Label text="Трюм:" />
<NumberField fx:id="cargo" maxWidth="60"/> <NumberField fx:id="cargo" maxWidth="60"/>
<Label text="Топливный бак:" /> <Label text="Топливный бак:" />

View File

@@ -2,35 +2,43 @@
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<?import org.controlsfx.glyphfont.*?>
<?import ru.trader.view.support.cells.OfferListCell?>
<?import javafx.geometry.Insets?>
<?import ru.trader.view.support.NumberField?>
<?import org.controlsfx.glyphfont.Glyph?>
<VBox xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" <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" > <TitledPane text="%router.pane.route" minHeight="80" collapsible="false">
<HBox> <VBox spacing="4">
<HBox> <HBox spacing="10" alignment="CENTER">
<Label text="От:" /> <HBox spacing="2" alignment="BASELINE_LEFT">
<TextField fx:id="fromSystemText" /> <Label text="%router.pane.route.from" />
<ComboBox fx:id="fromStation" /> <TextField fx:id="fromSystemText" />
<Button onAction="#currentAsFrom"/> <ComboBox fx:id="fromStation" minWidth="140"/>
<Button minWidth="30" onAction="#currentAsFrom"><graphic><Glyph text="FontAwesome|MAP_MARKER"/></graphic></Button>
</HBox>
<HBox spacing="2" alignment="BASELINE_LEFT">
<Label text="%router.pane.route.to" />
<TextField fx:id="toSystemText" />
<ComboBox fx:id="toStation" minWidth="140"/>
<Button minWidth="30" onAction="#loop"><graphic><Glyph text="FontAwesome|RETWEET"/></graphic></Button>
</HBox>
<CheckBox fx:id="cbFast" text="%router.pane.route.fast"/>
</HBox>
<HBox spacing="10" alignment="CENTER">
<Button prefWidth="80" text="%router.button.search" onAction="#search" />
<Button prefWidth="80" text="%router.button.top" onAction="#searchTop" />
</HBox>
</VBox>
</TitledPane>
<TitledPane text="%router.pane.missions" collapsible="false">
<HBox spacing="10">
<fx:include fx:id="missions" source="missions.fxml"/>
<HBox spacing="4" maxHeight="200">
<VBox spacing="4" alignment="TOP_RIGHT">
<Button prefWidth="30" onAction="#addMission"><graphic><Glyph text="FontAwesome|PLUS"/></graphic></Button>
<Button prefWidth="30" onAction="#removeMission"><graphic><Glyph text="FontAwesome|MINUS"/></graphic></Button>
<Button prefWidth="30" onAction="#clearMissions"><graphic><Glyph text="FontAwesome|TRASH"/></graphic></Button>
</VBox>
<ListView fx:id="missionsList" />
</HBox>
</HBox> </HBox>
<HBox> </TitledPane>
<Label text="До:" />
<TextField fx:id="toSystemText" />
<ComboBox fx:id="toStation" />
<Button onAction="#loop"/>
</HBox>
<CheckBox fx:id="cbFast" text="Быстрый"/>
<Button prefWidth="80" text="Найти" onAction="#search" />
</HBox>
<VBox>
<fx:include fx:id="missions" source="missions.fxml"/>
<HBox>
<ListView fx:id="missionsList" />
<Button prefWidth="30" onAction="#removeMission"><graphic><Glyph text="FontAwesome|MINUS"/></graphic></Button>
</HBox>
</VBox>
</VBox> </VBox>

View File

@@ -1,16 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?> <?import javafx.scene.layout.*?>
<?import ru.trader.view.support.cells.OfferListCell?>
<?import javafx.geometry.Insets?>
<?import ru.trader.view.support.NumberField?>
<?import org.controlsfx.glyphfont.Glyph?> <?import org.controlsfx.glyphfont.Glyph?>
<VBox xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" <HBox xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="ru.trader.controllers.RouteTrackController" fx:controller="ru.trader.controllers.RouteTrackController"
spacing="4" > spacing="4" >
<HBox fx:id="track" minHeight="100"/> <VBox>
<ToggleButton minWidth="30" onAction="#toggleEdit"> <ToggleButton minWidth="30" onAction="#toggleEdit">
<graphic><Glyph text="FontAwesome|EDIT"/></graphic> <graphic><Glyph text="FontAwesome|EDIT"/></graphic>
</ToggleButton> </ToggleButton>
@@ -19,8 +16,12 @@
<fx:include fx:id="missions" source="missions.fxml"/> <fx:include fx:id="missions" source="missions.fxml"/>
<HBox> <HBox>
<ListView fx:id="addMissionsList" maxHeight="150"/> <ListView fx:id="addMissionsList" maxHeight="150"/>
<Button prefWidth="30" onAction="#removeMission"><graphic><Glyph text="FontAwesome|MINUS"/></graphic></Button> <VBox spacing="4" alignment="TOP_RIGHT">
<Button prefWidth="80" text="Добавить" onAction="#addMissions" /> <Button prefWidth="30" onAction="#addMission"><graphic><Glyph text="FontAwesome|PLUS"/></graphic></Button>
<Button prefWidth="30" onAction="#removeMission"><graphic><Glyph text="FontAwesome|MINUS"/></graphic></Button>
<Button prefWidth="30" onAction="#clearMissions"><graphic><Glyph text="FontAwesome|TRASH"/></graphic></Button>
</VBox>
<Button prefWidth="80" text="Добавить" onAction="#addMissionsToTrack" />
</HBox> </HBox>
</VBox> </VBox>
<VBox fx:id="infoGroup"> <VBox fx:id="infoGroup">
@@ -44,4 +45,7 @@
</VBox> </VBox>
</VBox> </VBox>
</StackPane> </StackPane>
</VBox> </VBox>
<VBox fx:id="track" minWidth="200"/>
</HBox>

View File

@@ -16,7 +16,7 @@
<ColumnConstraints fillWidth="true"/> <ColumnConstraints fillWidth="true"/>
</columnConstraints> </columnConstraints>
<TitledPane text="%market.systems" prefHeight="590" collapsible="false"> <TitledPane text="%market.systems" prefHeight="500" collapsible="false">
<GridPane vgap="4"> <GridPane vgap="4">
<columnConstraints> <columnConstraints>
<ColumnConstraints minWidth="100"/> <ColumnConstraints minWidth="100"/>

View File

@@ -1,18 +1,13 @@
<?import javafx.scene.layout.GridPane?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.ColumnConstraints?> <?import javafx.scene.layout.*?>
<?import javafx.scene.control.Label?> <?import ru.trader.view.support.*?>
<?import ru.trader.view.support.NumberField?>
<?import ru.trader.view.support.TitledBorder?>
<?import javafx.scene.control.CheckBox?>
<?import javafx.scene.control.TextField?>
<GridPane xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ru.trader.controllers.SettingsController" <GridPane xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ru.trader.controllers.SettingsController"
styleClass="dialog" vgap="4" hgap="8"> styleClass="dialog" vgap="4" hgap="8">
<columnConstraints> <columnConstraints>
<ColumnConstraints /> <ColumnConstraints />
<ColumnConstraints minWidth="260" maxWidth="260"/> <ColumnConstraints minWidth="260" maxWidth="260"/>
</columnConstraints> </columnConstraints>
<!--
<Label text="%settings.emdn" styleClass="settings-group" GridPane.halignment="CENTER" GridPane.columnSpan="2"/> <Label text="%settings.emdn" styleClass="settings-group" GridPane.halignment="CENTER" GridPane.columnSpan="2"/>
<Label text="%settings.emdn.on" GridPane.rowIndex="1"/> <Label text="%settings.emdn.on" GridPane.rowIndex="1"/>
<CheckBox fx:id="emdnOn" GridPane.columnIndex="1" GridPane.rowIndex="1" disable="true"/> <CheckBox fx:id="emdnOn" GridPane.columnIndex="1" GridPane.rowIndex="1" disable="true"/>
@@ -22,11 +17,32 @@
<CheckBox fx:id="emdnUpdateOnly" GridPane.columnIndex="1" GridPane.rowIndex="3" /> <CheckBox fx:id="emdnUpdateOnly" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<Label text="%settings.emdn.auto" GridPane.rowIndex="4" /> <Label text="%settings.emdn.auto" GridPane.rowIndex="4" />
<NumberField fx:id="emdnUpdateTime" maxWidth="100" GridPane.columnIndex="1" GridPane.rowIndex="4" /> <NumberField fx:id="emdnUpdateTime" maxWidth="100" GridPane.columnIndex="1" GridPane.rowIndex="4" />
<Label text="%settings.performance" styleClass="settings-group" GridPane.halignment="CENTER" GridPane.columnSpan="2" GridPane.rowIndex="5"/> -->
<Label text="%settings.performance.segmentSize" GridPane.rowIndex="6" /> <Label text="EDCE" styleClass="settings-group" GridPane.halignment="CENTER" GridPane.columnSpan="2"/>
<NumberField fx:id="segmentSize" maxWidth="100" GridPane.columnIndex="1" GridPane.rowIndex="6" /> <Label text="Включить" GridPane.rowIndex="1"/>
<Label text="%settings.performance.limit" GridPane.rowIndex="7" /> <CheckBox fx:id="edceActive" GridPane.columnIndex="1" GridPane.rowIndex="1"/>
<NumberField fx:id="pathsCount" maxWidth="100" GridPane.columnIndex="1" GridPane.rowIndex="7" /> <Label text="Интервал" GridPane.rowIndex="2" />
<NumberField fx:id="edceInterval" maxWidth="100" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label text="%settings.performance" styleClass="settings-group" GridPane.halignment="CENTER" GridPane.columnSpan="2" GridPane.rowIndex="3"/>
<Label text="Прыжков:" GridPane.rowIndex="4" />
<NumberField fx:id="jumps" maxWidth="100" GridPane.columnIndex="1" GridPane.rowIndex="4" />
<Label text="Посадок:" GridPane.rowIndex="5" />
<NumberField fx:id="lands" maxWidth="100" GridPane.columnIndex="1" GridPane.rowIndex="5" />
<Label text="Количество маршрутов:" GridPane.rowIndex="6" />
<NumberField fx:id="routesCount" maxWidth="100" GridPane.columnIndex="1" GridPane.rowIndex="6" />
<Label text="Параметры поиска" styleClass="settings-group" GridPane.halignment="CENTER" GridPane.columnSpan="2" GridPane.rowIndex="7"/>
<Label text="Стоимость 1т топлива:" GridPane.rowIndex="8" />
<NumberField fx:id="fuelPrice" maxWidth="100" GridPane.columnIndex="1" GridPane.rowIndex="8" />
<Label text="Тип маршрутов:" GridPane.rowIndex="9" />
<ComboBox fx:id="pathPriority" maxWidth="100" GridPane.columnIndex="1" GridPane.rowIndex="9" />
<Label text="Время гиперпрыжка:" GridPane.rowIndex="10" />
<NumberField fx:id="jumpTime" maxWidth="100" GridPane.columnIndex="1" GridPane.rowIndex="10" />
<Label text="Время посадки:" GridPane.rowIndex="11" />
<NumberField fx:id="landingTime" maxWidth="100" GridPane.columnIndex="1" GridPane.rowIndex="11" />
<Label text="Время взлета:" GridPane.rowIndex="12" />
<NumberField fx:id="takeoffTime" maxWidth="100" GridPane.columnIndex="1" GridPane.rowIndex="12" />
<Label text="Время перезарядки FSD:" GridPane.rowIndex="13" />
<NumberField fx:id="rechargeTime" maxWidth="100" GridPane.columnIndex="1" GridPane.rowIndex="13" />
</GridPane> </GridPane>

View File

@@ -134,4 +134,52 @@ HBox.fields-group hbox-margin{
#items HBox.reset Glyph:hover { #items HBox.reset Glyph:hover {
-fx-opacity: 1; -fx-opacity: 1;
}
#helper {
-fx-border-style: solid;
-fx-border-color: #b83500;
-fx-opacity: 0.85;
}
#helper.root {
-fx-base: #232323;
-fx-background: -fx-base;
-fx-control-inner-background: -fx-base;
-fx-control-inner-background-alt: -fx-base;
-fx-light-text-color: orangered;
-fx-mid-text-color: derive(-fx-light-text-color, -50%);
-fx-dark-text-color: derive(-fx-light-text-color, -90%);
-fx-accent: #c93700;
-fx-default-button: #861818;
-fx-focus-color: #bb6b00;
-fx-faint-focus-color: #bb6b0022;
}
.text-small, .text-medium, .text-big {
-fx-font-weight: bold;
}
.text-big {
-fx-font-size: 19;
}
.text-medium {
-fx-font-size: 14;
}
.text-small {
-fx-font-size: 12;
}
.service-ok {
-fx-text-fill: green;
}
.service-warning {
-fx-text-fill: red;
} }