- update item desc layout
- correct column size routers - add show item dec on click right button in orders
This commit is contained in:
@@ -24,6 +24,7 @@ public class Main extends Application {
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws Exception {
|
||||
primaryStage.setTitle("Trader");
|
||||
primaryStage.setMinHeight(590);
|
||||
primaryStage.setScene(new Scene(Screeners.newScreeners(Main.class.getResource("/view/main.fxml"),getUrl("style.css").toExternalForm())));
|
||||
primaryStage.setOnCloseRequest((we)->{
|
||||
try {
|
||||
|
||||
@@ -25,6 +25,7 @@ public class ItemDescController {
|
||||
|
||||
public void setItemDesc(ItemDescModel itemDesc){
|
||||
item = itemDesc;
|
||||
if (popup!=null) popup.setDetachedTitle(item.nameProperty().get());
|
||||
fill();
|
||||
}
|
||||
|
||||
@@ -39,7 +40,7 @@ public class ItemDescController {
|
||||
if (popup != null && popup.isShowing()) return;
|
||||
if (popup == null) {
|
||||
popup = new PopOver(itemDescScreen);
|
||||
popup.detach();
|
||||
popup.setDetachedTitle(item.nameProperty().get());
|
||||
popup.setAutoHide(true);
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package ru.trader.controllers;
|
||||
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.scene.control.ListView;
|
||||
import javafx.scene.input.MouseButton;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import javafx.fxml.FXML;
|
||||
@@ -40,6 +41,23 @@ public class OffersController {
|
||||
vendors.getSelectionModel().select(oldValue);
|
||||
}
|
||||
});
|
||||
tblSell.getSelectionModel().selectedItemProperty().addListener((v, o, n) -> {
|
||||
if (n!=null) Screeners.changeItemDesc(n);
|
||||
});
|
||||
tblBuy.getSelectionModel().selectedItemProperty().addListener((v, o, n) -> {
|
||||
if (n!=null) Screeners.changeItemDesc(n);
|
||||
});
|
||||
tblSell.setOnMouseClicked((e) -> {
|
||||
if (e.getButton() == MouseButton.SECONDARY){
|
||||
Screeners.showItemDesc(tblSell);
|
||||
}
|
||||
});
|
||||
tblBuy.setOnMouseClicked((e) -> {
|
||||
if (e.getButton() == MouseButton.SECONDARY){
|
||||
Screeners.showItemDesc(tblBuy);
|
||||
}
|
||||
});
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,13 +4,17 @@
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
<?import ru.trader.view.support.cells.OfferListCell?>
|
||||
<?import javafx.geometry.Insets?>
|
||||
<VBox xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
|
||||
fx:controller="ru.trader.controllers.ItemDescController">
|
||||
<Label text="Продавцы:"/>
|
||||
fx:controller="ru.trader.controllers.ItemDescController"
|
||||
spacing="4" >
|
||||
<fx:define><Insets fx:id="vbox_margin" left="6" top="3" bottom="3"/></fx:define>
|
||||
|
||||
<Label text="Продавцы:" VBox.margin="$vbox_margin"/>
|
||||
<ListView fx:id="seller" maxHeight="200.0">
|
||||
<cellFactory><OfferListCell/></cellFactory>
|
||||
</ListView>
|
||||
<Label text="Покупатели:"/>
|
||||
<Label text="Покупатели:" VBox.margin="$vbox_margin"/>
|
||||
<ListView fx:id="buyer" maxHeight="200.0">
|
||||
<cellFactory><OfferListCell/></cellFactory>
|
||||
</ListView>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<TitledPane fx:id="sells" animated="false" text="Продаваемые товары">
|
||||
<TableView fx:id="tblSell" editable="true">
|
||||
<columns>
|
||||
<TableColumn minWidth="235.0" text="Товар">
|
||||
<TableColumn minWidth="230.0" text="Товар">
|
||||
<cellValueFactory><PropertyValueFactory property="name"/></cellValueFactory>
|
||||
</TableColumn>
|
||||
<TableColumn minWidth="110.0" resizable="false" text="Цена" onEditCommit="#editPrice">
|
||||
@@ -57,7 +57,7 @@
|
||||
<TitledPane animated="false" text="Покупаемые товары">
|
||||
<TableView fx:id="tblBuy" editable="true">
|
||||
<columns>
|
||||
<TableColumn minWidth="235.0" text="Товар">
|
||||
<TableColumn minWidth="230.0" text="Товар">
|
||||
<cellValueFactory><PropertyValueFactory property="name"/></cellValueFactory>
|
||||
</TableColumn>
|
||||
<TableColumn minWidth="110.0" resizable="false" text="Цена" editable="true" onEditCommit="#editPrice">
|
||||
|
||||
@@ -56,10 +56,10 @@
|
||||
</VBox>
|
||||
<TableView fx:id="tblOrders" HBox.hgrow="ALWAYS">
|
||||
<columns>
|
||||
<TableColumn minWidth="235.0" text="Продавец">
|
||||
<TableColumn minWidth="230.0" text="Продавец">
|
||||
<cellValueFactory><PropertyValueFactory property="vendor"/></cellValueFactory>
|
||||
</TableColumn>
|
||||
<TableColumn minWidth="235.0" text="Товар">
|
||||
<TableColumn minWidth="230.0" text="Товар">
|
||||
<cellValueFactory><PropertyValueFactory property="name"/></cellValueFactory>
|
||||
</TableColumn>
|
||||
<TableColumn minWidth="80.0" text="Цена">
|
||||
|
||||
@@ -14,6 +14,13 @@
|
||||
-fx-background-radius: 0, 0;
|
||||
}
|
||||
|
||||
.list-view:focused {
|
||||
-fx-background-color: -fx-box-border, -fx-control-inner-background;
|
||||
-fx-background-insets: 0,1;
|
||||
-fx-background-radius: 0, 0;
|
||||
}
|
||||
|
||||
|
||||
HBox.fields-group {
|
||||
-fx-spacing: 2;
|
||||
-fx-padding: 5 10;
|
||||
|
||||
Reference in New Issue
Block a user