add settings dialog
This commit is contained in:
@@ -22,14 +22,18 @@ import java.util.Locale;
|
||||
|
||||
public class Main extends Application {
|
||||
private final static Logger LOG = LoggerFactory.getLogger(Main.class);
|
||||
public static Settings SETTINGS;
|
||||
private static Stage primaryStage;
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws Exception {
|
||||
Main.primaryStage = primaryStage;
|
||||
loadMainScene();
|
||||
loadResources();
|
||||
primaryStage.show();
|
||||
SETTINGS = new Settings(new File("profile.properties"));
|
||||
SETTINGS.load();
|
||||
World.start();
|
||||
Main.primaryStage = primaryStage;
|
||||
loadMainScene();
|
||||
loadResources();
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
|
||||
@@ -65,14 +69,15 @@ public class Main extends Application {
|
||||
primaryStage.setOnCloseRequest((we)->{
|
||||
try {
|
||||
if (World.getMarket().isChange()){
|
||||
Action res = Screeners.showConfirm(Localization.getString("dialogs.save"));
|
||||
Action res = Screeners.showConfirm(Localization.getString("dialog.confirm.save"));
|
||||
if (res == Dialog.Actions.YES) World.save();
|
||||
else if (res == Dialog.Actions.CANCEL) we.consume();
|
||||
}
|
||||
World.shutdown();
|
||||
SETTINGS.save();
|
||||
Screeners.closeAll();
|
||||
} catch (FileNotFoundException | UnsupportedEncodingException | XMLStreamException e) {
|
||||
LOG.error("Ошибка при сохранении",e);
|
||||
LOG.error("Error on save world",e);
|
||||
Screeners.showException(e);
|
||||
}
|
||||
});
|
||||
@@ -86,6 +91,7 @@ public class Main extends Application {
|
||||
Screeners.loadOrdersStage(getUrl(("orders.fxml")));
|
||||
Screeners.loadTopOrdersStage(getUrl(("topOrders.fxml")));
|
||||
Screeners.loadPathsStage(getUrl(("paths.fxml")));
|
||||
Screeners.loadSettingsStage(getUrl(("settings.fxml")));
|
||||
}
|
||||
|
||||
private static URL getUrl(String filename) throws MalformedURLException {
|
||||
|
||||
109
client/src/main/java/ru/trader/Settings.java
Normal file
109
client/src/main/java/ru/trader/Settings.java
Normal file
@@ -0,0 +1,109 @@
|
||||
package ru.trader;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.Properties;
|
||||
|
||||
public class Settings {
|
||||
private final static Logger LOG = LoggerFactory.getLogger(Settings.class);
|
||||
|
||||
private final Properties values = new Properties();
|
||||
private final File file;
|
||||
|
||||
public Settings(File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public void load() {
|
||||
try (InputStream is = new FileInputStream(file)) {
|
||||
values.load(is);
|
||||
} catch (FileNotFoundException e) {
|
||||
LOG.warn("File {} not found", file);
|
||||
} catch (IOException e) {
|
||||
LOG.error("Error on load settings", e);
|
||||
}
|
||||
}
|
||||
|
||||
public void save(){
|
||||
try (OutputStream os = new FileOutputStream(file)) {
|
||||
values.store(os,"settings");
|
||||
} catch (IOException e) {
|
||||
LOG.error("Error on load settings", e);
|
||||
}
|
||||
}
|
||||
|
||||
public void setEMDNActive(boolean active){
|
||||
values.setProperty("emdn.active", active ? "1":"0");
|
||||
}
|
||||
|
||||
public boolean getEMDNActive(){
|
||||
return !"0".equals(values.getProperty("emdn.active","0"));
|
||||
}
|
||||
|
||||
public void setEMDNSub(String address){
|
||||
values.setProperty("emdn.sub", address);
|
||||
}
|
||||
|
||||
public String getEMDNSub(){
|
||||
return values.getProperty("emdn.sub","tcp://firehose.elite-market-data.net:9050");
|
||||
}
|
||||
|
||||
public void setEMDNUpdateOnly(boolean updateOnly){
|
||||
values.setProperty("emdn.updateOnly", updateOnly ? "1":"0");
|
||||
}
|
||||
|
||||
public boolean getEMDNUpdateOnly(){
|
||||
return !"0".equals(values.getProperty("emdn.updateOnly","0"));
|
||||
}
|
||||
|
||||
public void setEMDNAutoUpdate(long autoUpdate){
|
||||
values.setProperty("emdn.auto", String.valueOf(autoUpdate));
|
||||
}
|
||||
|
||||
public long getEMDNAutoUpdate(){
|
||||
return Long.valueOf(values.getProperty("emdn.auto","0"));
|
||||
}
|
||||
|
||||
public void setBalance(double balance){
|
||||
values.setProperty("ship.balance", String.valueOf(balance));
|
||||
}
|
||||
|
||||
public double getBalance(){
|
||||
return Double.valueOf(values.getProperty("ship.balance","1000"));
|
||||
}
|
||||
|
||||
public void setCargo(int cargo){
|
||||
values.setProperty("ship.cargo", String.valueOf(cargo));
|
||||
}
|
||||
|
||||
public int getCargo(){
|
||||
return Integer.valueOf(values.getProperty("ship.cargo","4"));
|
||||
}
|
||||
|
||||
public void setTank(double tank){
|
||||
values.setProperty("ship.tank", String.valueOf(tank));
|
||||
}
|
||||
|
||||
public double getTank(){
|
||||
return Double.valueOf(values.getProperty("ship.tank","20"));
|
||||
}
|
||||
|
||||
public void setDistance(double distance){
|
||||
values.setProperty("ship.distance", String.valueOf(distance));
|
||||
}
|
||||
|
||||
public double getDistance(){
|
||||
return Double.valueOf(values.getProperty("ship.distance","7"));
|
||||
}
|
||||
|
||||
public void setJumps(int jumps){
|
||||
values.setProperty("ship.jumps", String.valueOf(jumps));
|
||||
}
|
||||
|
||||
public int getJumps(){
|
||||
return Integer.valueOf(values.getProperty("ship.jumps","3"));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,14 +19,13 @@ import java.io.UnsupportedEncodingException;
|
||||
public class World {
|
||||
private static Market world;
|
||||
private static final String STORE_FILE="world.xml";
|
||||
private final static EMDN emdn = new EMDN("tcp://firehose.elite-market-data.net:9050", true);
|
||||
private final static EMDN emdn = new EMDN();
|
||||
|
||||
static {
|
||||
try {
|
||||
File file = new File(STORE_FILE);
|
||||
if (file.exists()) world = Store.loadFromFile(file);
|
||||
else world = new SimpleMarket();
|
||||
emdn.start();
|
||||
} catch (ParserConfigurationException | SAXException | IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@@ -52,7 +51,23 @@ public class World {
|
||||
return emdn.getVendor(name);
|
||||
}
|
||||
|
||||
private static void initEmdn(){
|
||||
emdn.connectTo(Main.SETTINGS.getEMDNSub());
|
||||
if (Main.SETTINGS.getEMDNActive()){
|
||||
emdn.start();
|
||||
}
|
||||
}
|
||||
|
||||
public static EMDN getEmdn(){
|
||||
return emdn;
|
||||
}
|
||||
|
||||
public static void start(){
|
||||
initEmdn();
|
||||
}
|
||||
|
||||
public static void shutdown(){
|
||||
emdn.shutdown();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -122,8 +122,8 @@ public class MainController {
|
||||
|
||||
public Optional<ItemModel> addItem(){
|
||||
Optional<String> res = Dialogs.create()
|
||||
.title(Localization.getString("dialogs.addItem.title"))
|
||||
.message(Localization.getString("dialogs.addItem.message"))
|
||||
.title(Localization.getString("dialog.addItem.title"))
|
||||
.message(Localization.getString("dialog.addItem.message"))
|
||||
.showTextInput();
|
||||
ItemModel item = null;
|
||||
if (res.isPresent()){
|
||||
@@ -142,6 +142,10 @@ public class MainController {
|
||||
Screeners.showEditVendor(offersController.getVendor());
|
||||
}
|
||||
|
||||
public void editSettings(){
|
||||
Screeners.showSettings();
|
||||
}
|
||||
|
||||
private void reload(){
|
||||
world = new MarketModel(World.getMarket());
|
||||
market = world;
|
||||
|
||||
@@ -9,6 +9,7 @@ import javafx.scene.control.Button;
|
||||
import javafx.scene.control.ComboBox;
|
||||
import javafx.scene.control.ScrollPane;
|
||||
import javafx.scene.control.TableView;
|
||||
import ru.trader.Main;
|
||||
import ru.trader.model.*;
|
||||
import ru.trader.view.support.NumberField;
|
||||
import ru.trader.view.support.RouteNode;
|
||||
@@ -57,11 +58,26 @@ public class RouterController {
|
||||
@FXML
|
||||
private void initialize(){
|
||||
init();
|
||||
balance.numberProperty().addListener((ov, o, n) -> totalBalance.setValue(n));
|
||||
cargo.numberProperty().addListener((ov, o, n) -> market.setCargo(n.intValue()));
|
||||
tank.numberProperty().addListener((ov, o, n) -> market.setTank(n.doubleValue()));
|
||||
distance.numberProperty().addListener((ov, o, n) -> market.setDistance(n.doubleValue()));
|
||||
jumps.numberProperty().addListener((ov, o, n) -> market.setJumps(n.intValue()));
|
||||
balance.numberProperty().addListener((ov, o, n) -> {
|
||||
totalBalance.setValue(n);
|
||||
Main.SETTINGS.setBalance(n.doubleValue());
|
||||
});
|
||||
cargo.numberProperty().addListener((ov, o, n) -> {
|
||||
market.setCargo(n.intValue());
|
||||
Main.SETTINGS.setCargo(n.intValue());
|
||||
});
|
||||
tank.numberProperty().addListener((ov, o, n) -> {
|
||||
market.setTank(n.doubleValue());
|
||||
Main.SETTINGS.setTank(n.doubleValue());
|
||||
});
|
||||
distance.numberProperty().addListener((ov, o, n) -> {
|
||||
market.setDistance(n.doubleValue());
|
||||
Main.SETTINGS.setDistance(n.doubleValue());
|
||||
});
|
||||
jumps.numberProperty().addListener((ov, o, n) -> {
|
||||
market.setJumps(n.intValue());
|
||||
Main.SETTINGS.setJumps(n.intValue());
|
||||
});
|
||||
|
||||
balance.setOnAction((v)->cargo.requestFocus());
|
||||
cargo.setOnAction((v) -> tank.requestFocus());
|
||||
@@ -69,11 +85,11 @@ public class RouterController {
|
||||
distance.setOnAction((v)->jumps.requestFocus());
|
||||
jumps.setOnAction((v)->balance.requestFocus());
|
||||
|
||||
balance.setValue(1000);
|
||||
cargo.setValue(4);
|
||||
tank.setValue(20);
|
||||
distance.setValue(7);
|
||||
jumps.setValue(3);
|
||||
balance.setValue(Main.SETTINGS.getBalance());
|
||||
cargo.setValue(Main.SETTINGS.getCargo());
|
||||
tank.setValue(Main.SETTINGS.getTank());
|
||||
distance.setValue(Main.SETTINGS.getDistance());
|
||||
jumps.setValue(Main.SETTINGS.getJumps());
|
||||
|
||||
editBtn.disableProperty().bind(tblOrders.getSelectionModel().selectedIndexProperty().isEqualTo(-1));
|
||||
removeBtn.disableProperty().bind(Bindings.createBooleanBinding(()-> {
|
||||
|
||||
@@ -26,6 +26,7 @@ public class Screeners {
|
||||
private static Parent ordersScreen;
|
||||
private static Parent topOrdersScreen;
|
||||
private static Parent pathsScreen;
|
||||
private static Parent settingsScreen;
|
||||
|
||||
private static MainController mainController;
|
||||
private static ItemDescController itemDescController;
|
||||
@@ -34,6 +35,7 @@ public class Screeners {
|
||||
private static OrdersController ordersController;
|
||||
private static TopOrdersController topOrdersController;
|
||||
private static PathsController pathsController;
|
||||
private static SettingsController settingsController;
|
||||
|
||||
private static FXMLLoader initLoader(URL url){
|
||||
FXMLLoader loader = new FXMLLoader(url, Localization.getResources());
|
||||
@@ -106,6 +108,15 @@ public class Screeners {
|
||||
stage.setScene(new Scene(pathsScreen));
|
||||
}
|
||||
|
||||
public static void loadSettingsStage(URL fxml) throws IOException {
|
||||
FXMLLoader loader = initLoader(fxml);
|
||||
settingsScreen = loader.load();
|
||||
addStylesheet(settingsScreen);
|
||||
settingsController = loader.getController();
|
||||
Stage stage = new Stage();
|
||||
stage.setScene(new Scene(settingsScreen));
|
||||
}
|
||||
|
||||
public static void show(Node node){
|
||||
mainController.getMainPane().setCenter(node);
|
||||
}
|
||||
@@ -164,4 +175,8 @@ public class Screeners {
|
||||
public static PathRouteModel showRouters(ObservableList<PathRouteModel> routers) {
|
||||
return pathsController.showDialog(mainScreen, pathsScreen, routers);
|
||||
}
|
||||
|
||||
public static void showSettings() {
|
||||
settingsController.showDialog(mainScreen, settingsScreen);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
package ru.trader.controllers;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.control.CheckBox;
|
||||
import javafx.scene.control.TextField;
|
||||
import org.controlsfx.control.ButtonBar;
|
||||
import org.controlsfx.control.action.AbstractAction;
|
||||
import org.controlsfx.control.action.Action;
|
||||
import org.controlsfx.dialog.Dialog;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import ru.trader.Main;
|
||||
import ru.trader.World;
|
||||
import ru.trader.emdn.EMDN;
|
||||
import ru.trader.view.support.Localization;
|
||||
import ru.trader.view.support.NumberField;
|
||||
|
||||
|
||||
public class SettingsController {
|
||||
private final static Logger LOG = LoggerFactory.getLogger(SettingsController.class);
|
||||
|
||||
@FXML
|
||||
private CheckBox emdnOn;
|
||||
@FXML
|
||||
private TextField emdnSubServ;
|
||||
@FXML
|
||||
private CheckBox emdnUpdateOnly;
|
||||
@FXML
|
||||
private NumberField emdnUpdateTime;
|
||||
|
||||
@FXML
|
||||
private void initialize(){
|
||||
emdnOn.setSelected(Main.SETTINGS.getEMDNActive());
|
||||
emdnSubServ.setText(Main.SETTINGS.getEMDNSub());
|
||||
emdnUpdateOnly.setSelected(Main.SETTINGS.getEMDNUpdateOnly());
|
||||
emdnUpdateTime.setValue(Main.SETTINGS.getEMDNAutoUpdate());
|
||||
}
|
||||
|
||||
private final Action actSave = new AbstractAction(Localization.getString("dialog.button.save")) {
|
||||
{
|
||||
ButtonBar.setType(this, ButtonBar.ButtonType.OK_DONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handle(ActionEvent event) {
|
||||
Dialog dlg = (Dialog) event.getSource();
|
||||
save();
|
||||
dlg.hide();
|
||||
}
|
||||
};
|
||||
|
||||
private void save() {
|
||||
Main.SETTINGS.setEMDNActive(emdnOn.isSelected());
|
||||
Main.SETTINGS.setEMDNSub(emdnSubServ.getText());
|
||||
Main.SETTINGS.setEMDNUpdateOnly(emdnUpdateOnly.isSelected());
|
||||
Main.SETTINGS.setEMDNAutoUpdate(emdnUpdateTime.getValue().longValue());
|
||||
EMDN emdn = World.getEmdn();
|
||||
emdn.connectTo(emdnSubServ.getText());
|
||||
if (emdnOn.isSelected()){
|
||||
emdn.start();
|
||||
} else {
|
||||
emdn.shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
public Action showDialog(Parent parent, Parent content){
|
||||
Dialog dlg = new Dialog(parent, Localization.getString("settings.title"));
|
||||
dlg.setContent(content);
|
||||
dlg.getActions().addAll(actSave, Dialog.Actions.CANCEL);
|
||||
dlg.setResizable(false);
|
||||
return dlg.show();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package ru.trader.controllers;
|
||||
|
||||
import javafx.application.Platform;
|
||||
import javafx.beans.property.DoubleProperty;
|
||||
import javafx.beans.property.ReadOnlyStringProperty;
|
||||
import javafx.beans.property.SimpleDoubleProperty;
|
||||
@@ -37,7 +36,7 @@ public class VendorEditorController {
|
||||
|
||||
private VendorModel vendor;
|
||||
|
||||
private final Action actSave = new AbstractAction(Localization.getString("vEditor.save")) {
|
||||
private final Action actSave = new AbstractAction(Localization.getString("dialog.button.save")) {
|
||||
{
|
||||
ButtonBar.setType(this, ButtonBar.ButtonType.OK_DONE);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package ru.trader.view.support;
|
||||
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.layout.StackPane;
|
||||
|
||||
public class TitledBorder extends StackPane
|
||||
{
|
||||
private Label titleLabel = new Label();
|
||||
private StackPane contentPane = new StackPane();
|
||||
private Node content;
|
||||
private final static String CSS_CONTENT = "bordered-titled-content";
|
||||
private final static String CSS_TITLE = "bordered-titled-title";
|
||||
private final static String CSS_BORDER = "bordered-titled-border";
|
||||
|
||||
|
||||
public void setContent(Node content){
|
||||
content.getStyleClass().add(CSS_CONTENT);
|
||||
contentPane.getChildren().clear();
|
||||
contentPane.getChildren().add(content);
|
||||
}
|
||||
|
||||
public Node getContent(){
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setTitle(String title){
|
||||
titleLabel.setText(" " + title + " ");
|
||||
}
|
||||
|
||||
public String getTitle(){
|
||||
return titleLabel.getText();
|
||||
}
|
||||
|
||||
public TitledBorder(){
|
||||
StackPane.setAlignment(titleLabel, Pos.TOP_CENTER);
|
||||
titleLabel.getStyleClass().add(CSS_TITLE);
|
||||
getStyleClass().add(CSS_BORDER);
|
||||
getChildren().addAll(titleLabel, contentPane);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -29,6 +29,13 @@ routes.jumps=Jumps
|
||||
routes.refills=Refills
|
||||
routes.lands=Landings
|
||||
|
||||
# Dialog
|
||||
dialog.confirm.save=Changes were not saved, save changes?
|
||||
dialog.button.save=Save
|
||||
dialog.button.edit=Edit
|
||||
dialog.button.remove=Remove
|
||||
dialog.button.clear=Clear
|
||||
|
||||
# main.fxml
|
||||
main.title=Trader
|
||||
main.menu.file=File
|
||||
@@ -36,17 +43,15 @@ main.menu.file.save=Save
|
||||
main.menu.file.import=Import...
|
||||
main.menu.file.language=Language
|
||||
main.menu.file.language.item=English
|
||||
main.menu.file.settings=Settings
|
||||
main.menu.edit=Edit
|
||||
main.menu.edit.addStation=Add Station
|
||||
main.menu.edit.addItem=Add Commodity
|
||||
main.menu.edit.editStation=Edit Station
|
||||
|
||||
# save confirm dialog
|
||||
dialogs.save=Changes were not saved, save changes?
|
||||
|
||||
# add item dialog
|
||||
dialogs.addItem.title=Adding new commodity
|
||||
dialogs.addItem.message=Enter commodity name
|
||||
dialog.addItem.title=Adding new commodity
|
||||
dialog.addItem.message=Enter commodity name
|
||||
|
||||
# items.fxml
|
||||
|
||||
@@ -69,7 +74,6 @@ orders.title=Create orders
|
||||
topOrders.title=TOP orders
|
||||
|
||||
# vEditor.fxml
|
||||
vEditor.save=Save
|
||||
vEditor.title.add=Add Station
|
||||
vEditor.title.edit=Edit Station
|
||||
|
||||
@@ -86,9 +90,14 @@ router.pane.route=Route parameters
|
||||
router.pane.route.from=From:
|
||||
router.pane.route.to=To:
|
||||
router.pane.route.jumps=Jumps:
|
||||
route.button.edit=Edit
|
||||
route.button.remove=Remove
|
||||
route.button.clear=Clear
|
||||
route.button.top=TOP 100
|
||||
router.pane.total=Total
|
||||
router.pane.total.profit=Profit:
|
||||
|
||||
# settings.fxml
|
||||
settings.title=Settings
|
||||
settings.emdn=Elite Market Data Network
|
||||
settings.emdn.on=Active
|
||||
settings.emdn.sub=Server SUB:
|
||||
settings.emdn.updateOnly=Update price only:
|
||||
settings.emdn.auto=Auto update (sec.):
|
||||
|
||||
@@ -29,6 +29,14 @@ routes.jumps=\u041F\u0440\u044B\u0436\u043A\u043E\u0432
|
||||
routes.refills=\u0417\u0430\u043F\u0440\u0430\u0432\u043E\u043A
|
||||
routes.lands=\u041F\u043E\u0441\u0430\u0434\u043E\u043A
|
||||
|
||||
# Dialog
|
||||
dialog.confirm.save=\u0418\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u043D\u0435 \u0431\u044B\u043B\u0438 \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u044B, \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C?
|
||||
dialog.button.save=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C
|
||||
dialog.button.edit=\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C
|
||||
dialog.button.remove=\u0423\u0434\u0430\u043B\u0438\u0442\u044C
|
||||
dialog.button.clear=\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C
|
||||
|
||||
|
||||
# main.fxml
|
||||
main.title=\u0422\u043E\u0440\u0433\u043E\u0439\u0434
|
||||
main.menu.file=\u0424\u0430\u0439\u043B
|
||||
@@ -36,17 +44,16 @@ main.menu.file.save=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C
|
||||
main.menu.file.import=\u0418\u043C\u043F\u043E\u0440\u0442...
|
||||
main.menu.file.language=\u042F\u0437\u044B\u043A
|
||||
main.menu.file.language.item=\u0420\u0443\u0441\u0441\u043A\u0438\u0439
|
||||
main.menu.file.settings=\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B
|
||||
main.menu.edit=\u041F\u0440\u0430\u0432\u043A\u0430
|
||||
main.menu.edit.addStation=\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0441\u0442\u0430\u043D\u0446\u0438\u044E
|
||||
main.menu.edit.addItem=\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0442\u043E\u0432\u0430\u0440
|
||||
main.menu.edit.editStation=\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0442\u0430\u043D\u0446\u0438\u044E
|
||||
|
||||
# save confirm dialog
|
||||
dialogs.save=\u0418\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u043D\u0435 \u0431\u044B\u043B\u0438 \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u044B, \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C?
|
||||
|
||||
# add item dialog
|
||||
dialogs.addItem.title=\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043D\u043E\u0432\u043E\u0433\u043E \u0442\u043E\u0432\u0430\u0440\u0430
|
||||
dialogs.addItem.message=\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u0442\u043E\u0432\u0430\u0440\u0430
|
||||
dialog.addItem.title=\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043D\u043E\u0432\u043E\u0433\u043E \u0442\u043E\u0432\u0430\u0440\u0430
|
||||
dialog.addItem.message=\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u0442\u043E\u0432\u0430\u0440\u0430
|
||||
|
||||
# items.fxml
|
||||
|
||||
@@ -69,7 +76,6 @@ orders.title=\u0421\u043E\u0437\u0434\u0430\u043D\u0438\u0435 \u0437\u0430\u043A
|
||||
topOrders.title=TOP \u0437\u0430\u043A\u0430\u0437\u043E\u0432
|
||||
|
||||
# vEditor.fxml
|
||||
vEditor.save=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C
|
||||
vEditor.title.add=\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u0442\u0430\u043D\u0446\u0438\u0438
|
||||
vEditor.title.edit=\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435 \u0441\u0442\u0430\u043D\u0446\u0438\u0438
|
||||
|
||||
@@ -86,9 +92,15 @@ router.pane.route=\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u043C\
|
||||
router.pane.route.from=\u041E\u0442:
|
||||
router.pane.route.to=\u0414\u043E:
|
||||
router.pane.route.jumps=\u041F\u0440\u044B\u0436\u043A\u043E\u0432:
|
||||
route.button.edit=\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C
|
||||
route.button.remove=\u0423\u0434\u0430\u043B\u0438\u0442\u044C
|
||||
route.button.clear=\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C
|
||||
route.button.top=TOP 100
|
||||
router.pane.total=\u0418\u0442\u043E\u0433\u043E
|
||||
router.pane.total.profit=\u041F\u0440\u0438\u0431\u044B\u043B\u044C:
|
||||
|
||||
# settings.fxml
|
||||
settings.title=\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B
|
||||
settings.emdn=Elite Market Data Network
|
||||
settings.emdn.on=\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C
|
||||
settings.emdn.sub=\u0421\u0435\u0440\u0432\u0435\u0440 SUB:
|
||||
settings.emdn.updateOnly=\u0422\u043E\u043B\u044C\u043A\u043E \u043E\u0431\u043D\u043E\u0432\u043B\u044F\u0442\u044C \u0446\u0435\u043D\u044B:
|
||||
settings.emdn.auto=\u041E\u0431\u043D\u043E\u0432\u043B\u044F\u0442\u044C \u0430\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438 \u0447\u0435\u0440\u0435\u0437 (\u0441\u0435\u043A.):
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
<Menu text="%main.menu.file">
|
||||
<MenuItem text="%main.menu.file.save" onAction="#save"/>
|
||||
<MenuItem text="%main.menu.file.import" onAction="#importWorld"/>
|
||||
<MenuItem text="%main.menu.file.settings" onAction="#editSettings"/>
|
||||
<Menu fx:id="langs" text="%main.menu.file.language"/>
|
||||
</Menu>
|
||||
<Menu text="%main.menu.edit">
|
||||
|
||||
@@ -47,9 +47,9 @@
|
||||
<Separator GridPane.columnSpan="2" GridPane.rowIndex="3" GridPane.margin="$separator_margin"/>
|
||||
<VBox GridPane.columnSpan="2" GridPane.rowIndex="4" spacing="5">
|
||||
<HBox alignment="CENTER" spacing="5">
|
||||
<Button fx:id="editBtn" text="%route.button.edit" onAction="#editOrders"/>
|
||||
<Button fx:id="removeBtn" text="%route.button.remove" onAction="#removeSelected"/>
|
||||
<Button text="%route.button.clear" onAction="#removeAll" />
|
||||
<Button fx:id="editBtn" text="%dialog.button.edit" onAction="#editOrders"/>
|
||||
<Button fx:id="removeBtn" text="%dialog.button.remove" onAction="#removeSelected"/>
|
||||
<Button text="%dialog.button.clear" onAction="#removeAll" />
|
||||
</HBox>
|
||||
<HBox alignment="CENTER" spacing="5">
|
||||
<Button prefWidth="80" text="%market.offers" onAction="#showOrders" />
|
||||
|
||||
26
client/src/main/resources/view/settings.fxml
Normal file
26
client/src/main/resources/view/settings.fxml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?import javafx.scene.layout.GridPane?>
|
||||
<?import javafx.scene.layout.ColumnConstraints?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?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"
|
||||
styleClass="dialog" vgap="4" hgap="8">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints />
|
||||
<ColumnConstraints minWidth="260" maxWidth="260"/>
|
||||
</columnConstraints>
|
||||
<Label text="%settings.emdn" styleClass="settings-group" GridPane.halignment="CENTER" GridPane.columnSpan="2"/>
|
||||
<Label text="%settings.emdn.on" GridPane.rowIndex="1"/>
|
||||
<CheckBox fx:id="emdnOn" GridPane.columnIndex="1" GridPane.rowIndex="1"/>
|
||||
<Label text="%settings.emdn.sub" GridPane.rowIndex="2" />
|
||||
<TextField fx:id="emdnSubServ" GridPane.columnIndex="1" GridPane.rowIndex="2" />
|
||||
<Label text="%settings.emdn.updateOnly" GridPane.rowIndex="3" />
|
||||
<CheckBox fx:id="emdnUpdateOnly" GridPane.columnIndex="1" GridPane.rowIndex="3" />
|
||||
<Label text="%settings.emdn.auto" GridPane.rowIndex="4" />
|
||||
<NumberField fx:id="emdnUpdateTime" maxWidth="100" GridPane.columnIndex="1" GridPane.rowIndex="4" />
|
||||
</GridPane>
|
||||
|
||||
@@ -49,6 +49,10 @@ HBox.fields-group hbox-margin{
|
||||
-fx-alignment: center;
|
||||
}
|
||||
|
||||
.settings-group {
|
||||
-fx-font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
/* Path */
|
||||
.path {
|
||||
|
||||
Reference in New Issue
Block a user