Archived
0

Change offers layout

This commit is contained in:
iMoHax
2014-07-28 16:07:35 +04:00
parent 778fbb57e0
commit fe8c3d1126
2 changed files with 52 additions and 65 deletions

View File

@@ -1,13 +1,12 @@
package ru.trader.controllers; package ru.trader.controllers;
import javafx.collections.FXCollections; import javafx.collections.FXCollections;
import javafx.scene.control.ListView;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.control.ComboBox;
import javafx.scene.control.TableColumn; import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView; import javafx.scene.control.TableView;
import ru.trader.core.Vendor;
import ru.trader.model.*; import ru.trader.model.*;
import ru.trader.model.support.ChangeMarketListener; import ru.trader.model.support.ChangeMarketListener;
@@ -21,7 +20,7 @@ public class OffersController {
private VendorModel vendor; private VendorModel vendor;
@FXML @FXML
private ComboBox<VendorModel> vendors; private ListView<VendorModel> vendors;
@FXML @FXML
private TableView<OfferDescModel> tblSell; private TableView<OfferDescModel> tblSell;

View File

@@ -9,50 +9,40 @@
<?import ru.trader.view.support.cells.OfferCellValueImpl?> <?import ru.trader.view.support.cells.OfferCellValueImpl?>
<?import ru.trader.view.support.cells.DoubleCell?> <?import ru.trader.view.support.cells.DoubleCell?>
<GridPane 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.OffersController"> fx:controller="ru.trader.controllers.OffersController">
<columnConstraints> <TitledPane text="Станции" minWidth="260" prefHeight="500" collapsible="false">
<ColumnConstraints hgrow="SOMETIMES" prefWidth="100.0"/> <ListView fx:id="vendors" />
</columnConstraints> </TitledPane>
<rowConstraints>
<RowConstraints fillHeight="false" maxHeight="40.0" valignment="CENTER" vgrow="SOMETIMES"/> <Accordion HBox.hgrow="ALWAYS">
<RowConstraints valignment="TOP" vgrow="SOMETIMES"/>
</rowConstraints>
<HBox alignment="TOP_CENTER" fillHeight="false" spacing="10.0">
<GridPane.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0"/>
</GridPane.margin>
<Label text="Продавец:"/>
<ComboBox fx:id="vendors" prefHeight="25.0" prefWidth="222.0"/>
</HBox>
<Accordion fx:id="list" GridPane.rowIndex="1">
<panes> <panes>
<TitledPane fx:id="sells" animated="false" text="Продаваемые товары"> <TitledPane fx:id="sells" animated="false" text="Продаваемые товары">
<TableView fx:id="tblSell" editable="true"> <TableView fx:id="tblSell" editable="true">
<columns> <columns>
<TableColumn minWidth="200.0" prefWidth="200.0" text="Товар"> <TableColumn minWidth="235.0" text="Товар">
<cellValueFactory><PropertyValueFactory property="name"/></cellValueFactory> <cellValueFactory><PropertyValueFactory property="name"/></cellValueFactory>
</TableColumn> </TableColumn>
<TableColumn minWidth="100.0" prefWidth="100.0" resizable="false" text="Цена" onEditCommit="#editPrice"> <TableColumn minWidth="110.0" resizable="false" text="Цена" onEditCommit="#editPrice">
<cellFactory><PriceCellImpl/></cellFactory> <cellFactory><PriceCellImpl/></cellFactory>
<cellValueFactory><PropertyValueFactory property="price"/></cellValueFactory> <cellValueFactory><PropertyValueFactory property="price"/></cellValueFactory>
</TableColumn> </TableColumn>
<TableColumn fx:id="sortSell" minWidth="80.0" prefWidth="80.0" resizable="false" text="Прибыль" sortType="DESCENDING"> <TableColumn fx:id="sortSell" minWidth="80.0" resizable="false" text="Прибыль" sortType="DESCENDING">
<cellFactory><DoubleCell/></cellFactory> <cellFactory><DoubleCell/></cellFactory>
<cellValueFactory><PropertyValueFactory property="profit"/></cellValueFactory> <cellValueFactory><PropertyValueFactory property="profit"/></cellValueFactory>
</TableColumn> </TableColumn>
<TableColumn minWidth="80.0" prefWidth="80.0" resizable="false" text="AVG SELL"> <TableColumn minWidth="80.0" resizable="false" text="AVG SELL">
<cellFactory><DoubleCell/></cellFactory> <cellFactory><DoubleCell/></cellFactory>
<cellValueFactory><PropertyValueFactory property="avgSell"/></cellValueFactory> <cellValueFactory><PropertyValueFactory property="avgSell"/></cellValueFactory>
</TableColumn> </TableColumn>
<TableColumn minWidth="80.0" prefWidth="80.0" resizable="false" text="AVG BUY"> <TableColumn minWidth="80.0" resizable="false" text="AVG BUY">
<cellFactory><DoubleCell/></cellFactory> <cellFactory><DoubleCell/></cellFactory>
<cellValueFactory><PropertyValueFactory property="avgBuy"/></cellValueFactory> <cellValueFactory><PropertyValueFactory property="avgBuy"/></cellValueFactory>
</TableColumn> </TableColumn>
<TableColumn minWidth="120.0" prefWidth="120.0" text="BEST SELL"> <TableColumn minWidth="120.0" text="BEST SELL">
<cellValueFactory><OfferCellValueImpl property="bestSell"/></cellValueFactory> <cellValueFactory><OfferCellValueImpl property="bestSell"/></cellValueFactory>
</TableColumn> </TableColumn>
<TableColumn minWidth="120.0" prefWidth="120.0" text="BEST BUY"> <TableColumn minWidth="120.0" text="BEST BUY">
<cellValueFactory><OfferCellValueImpl property="bestBuy"/></cellValueFactory> <cellValueFactory><OfferCellValueImpl property="bestBuy"/></cellValueFactory>
</TableColumn> </TableColumn>
</columns> </columns>
@@ -64,33 +54,32 @@
</sortOrder> </sortOrder>
</TableView> </TableView>
</TitledPane> </TitledPane>
<TitledPane animated="false" layoutX="10.0" layoutY="10.0" text="Покупаемые товары"> <TitledPane animated="false" text="Покупаемые товары">
<content>
<TableView fx:id="tblBuy" editable="true"> <TableView fx:id="tblBuy" editable="true">
<columns> <columns>
<TableColumn minWidth="200.0" prefWidth="200.0" text="Товар"> <TableColumn minWidth="235.0" text="Товар">
<cellValueFactory><PropertyValueFactory property="name"/></cellValueFactory> <cellValueFactory><PropertyValueFactory property="name"/></cellValueFactory>
</TableColumn> </TableColumn>
<TableColumn minWidth="100.0" prefWidth="100.0" resizable="false" text="Цена" editable="true" onEditCommit="#editPrice"> <TableColumn minWidth="110.0" resizable="false" text="Цена" editable="true" onEditCommit="#editPrice">
<cellFactory><PriceCellImpl/></cellFactory> <cellFactory><PriceCellImpl/></cellFactory>
<cellValueFactory><PropertyValueFactory property="price"/></cellValueFactory> <cellValueFactory><PropertyValueFactory property="price"/></cellValueFactory>
</TableColumn> </TableColumn>
<TableColumn fx:id="sortBuy" minWidth="80.0" prefWidth="80.0" resizable="false" text="Прибыль" sortType="DESCENDING"> <TableColumn fx:id="sortBuy" minWidth="80.0" resizable="false" text="Прибыль" sortType="DESCENDING">
<cellFactory><DoubleCell/></cellFactory> <cellFactory><DoubleCell/></cellFactory>
<cellValueFactory><PropertyValueFactory property="profit"/></cellValueFactory> <cellValueFactory><PropertyValueFactory property="profit"/></cellValueFactory>
</TableColumn> </TableColumn>
<TableColumn minWidth="80.0" prefWidth="80.0" resizable="false" text="AVG SELL"> <TableColumn minWidth="80.0" resizable="false" text="AVG SELL">
<cellFactory><DoubleCell/></cellFactory> <cellFactory><DoubleCell/></cellFactory>
<cellValueFactory><PropertyValueFactory property="avgSell"/></cellValueFactory> <cellValueFactory><PropertyValueFactory property="avgSell"/></cellValueFactory>
</TableColumn> </TableColumn>
<TableColumn minWidth="80.0" prefWidth="80.0" resizable="false" text="AVG BUY"> <TableColumn minWidth="80.0" resizable="false" text="AVG BUY">
<cellFactory><DoubleCell/></cellFactory> <cellFactory><DoubleCell/></cellFactory>
<cellValueFactory><PropertyValueFactory property="avgBuy"/></cellValueFactory> <cellValueFactory><PropertyValueFactory property="avgBuy"/></cellValueFactory>
</TableColumn> </TableColumn>
<TableColumn minWidth="120.0" prefWidth="120.0" text="BEST SELL"> <TableColumn minWidth="120.0" text="BEST SELL">
<cellValueFactory><OfferCellValueImpl property="bestSell"/></cellValueFactory> <cellValueFactory><OfferCellValueImpl property="bestSell"/></cellValueFactory>
</TableColumn> </TableColumn>
<TableColumn minWidth="120.0" prefWidth="120.0" text="BEST BUY"> <TableColumn minWidth="120.0" text="BEST BUY">
<cellValueFactory><OfferCellValueImpl property="bestBuy"/></cellValueFactory> <cellValueFactory><OfferCellValueImpl property="bestBuy"/></cellValueFactory>
</TableColumn> </TableColumn>
</columns> </columns>
@@ -101,11 +90,10 @@
<fx:reference source="sortBuy"/> <fx:reference source="sortBuy"/>
</sortOrder> </sortOrder>
</TableView> </TableView>
</content>
</TitledPane> </TitledPane>
</panes> </panes>
<expandedPane> <expandedPane>
<fx:reference source="sells"/> <fx:reference source="sells"/>
</expandedPane> </expandedPane>
</Accordion> </Accordion>
</GridPane> </HBox>