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

View File

@@ -9,50 +9,40 @@
<?import ru.trader.view.support.cells.OfferCellValueImpl?>
<?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">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" prefWidth="100.0"/>
</columnConstraints>
<rowConstraints>
<RowConstraints fillHeight="false" maxHeight="40.0" valignment="CENTER" vgrow="SOMETIMES"/>
<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">
<TitledPane text="Станции" minWidth="260" prefHeight="500" collapsible="false">
<ListView fx:id="vendors" />
</TitledPane>
<Accordion HBox.hgrow="ALWAYS">
<panes>
<TitledPane fx:id="sells" animated="false" text="Продаваемые товары">
<TableView fx:id="tblSell" editable="true">
<columns>
<TableColumn minWidth="200.0" prefWidth="200.0" text="Товар">
<TableColumn minWidth="235.0" text="Товар">
<cellValueFactory><PropertyValueFactory property="name"/></cellValueFactory>
</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>
<cellValueFactory><PropertyValueFactory property="price"/></cellValueFactory>
</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>
<cellValueFactory><PropertyValueFactory property="profit"/></cellValueFactory>
</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>
<cellValueFactory><PropertyValueFactory property="avgSell"/></cellValueFactory>
</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>
<cellValueFactory><PropertyValueFactory property="avgBuy"/></cellValueFactory>
</TableColumn>
<TableColumn minWidth="120.0" prefWidth="120.0" text="BEST SELL">
<TableColumn minWidth="120.0" text="BEST SELL">
<cellValueFactory><OfferCellValueImpl property="bestSell"/></cellValueFactory>
</TableColumn>
<TableColumn minWidth="120.0" prefWidth="120.0" text="BEST BUY">
<TableColumn minWidth="120.0" text="BEST BUY">
<cellValueFactory><OfferCellValueImpl property="bestBuy"/></cellValueFactory>
</TableColumn>
</columns>
@@ -64,33 +54,32 @@
</sortOrder>
</TableView>
</TitledPane>
<TitledPane animated="false" layoutX="10.0" layoutY="10.0" text="Покупаемые товары">
<content>
<TitledPane animated="false" text="Покупаемые товары">
<TableView fx:id="tblBuy" editable="true">
<columns>
<TableColumn minWidth="200.0" prefWidth="200.0" text="Товар">
<TableColumn minWidth="235.0" text="Товар">
<cellValueFactory><PropertyValueFactory property="name"/></cellValueFactory>
</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>
<cellValueFactory><PropertyValueFactory property="price"/></cellValueFactory>
</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>
<cellValueFactory><PropertyValueFactory property="profit"/></cellValueFactory>
</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>
<cellValueFactory><PropertyValueFactory property="avgSell"/></cellValueFactory>
</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>
<cellValueFactory><PropertyValueFactory property="avgBuy"/></cellValueFactory>
</TableColumn>
<TableColumn minWidth="120.0" prefWidth="120.0" text="BEST SELL">
<TableColumn minWidth="120.0" text="BEST SELL">
<cellValueFactory><OfferCellValueImpl property="bestSell"/></cellValueFactory>
</TableColumn>
<TableColumn minWidth="120.0" prefWidth="120.0" text="BEST BUY">
<TableColumn minWidth="120.0" text="BEST BUY">
<cellValueFactory><OfferCellValueImpl property="bestBuy"/></cellValueFactory>
</TableColumn>
</columns>
@@ -101,11 +90,10 @@
<fx:reference source="sortBuy"/>
</sortOrder>
</TableView>
</content>
</TitledPane>
</panes>
<expandedPane>
<fx:reference source="sells"/>
</expandedPane>
</Accordion>
</GridPane>
</HBox>