Archived
0

modify offers layout

This commit is contained in:
iMoHax
2014-08-27 12:11:34 +04:00
parent 68171375d7
commit c011ea05d5
2 changed files with 10 additions and 9 deletions

View File

@@ -2,6 +2,7 @@ package ru.trader.view.support.cells;
import javafx.scene.control.TableCell;
import javafx.scene.control.TableColumn;
import javafx.scene.layout.HBox;
import javafx.scene.text.Text;
import javafx.scene.text.TextFlow;
import javafx.util.Callback;
@@ -29,7 +30,7 @@ public class PriceCellImpl implements Callback<TableColumn<OfferDescModel, Doubl
OfferDescModel offerDesc = (OfferDescModel) getTableRow().getItem();
if (offerDesc!=null){
double d = offerDesc.getDiff();
TextFlow txt = new TextFlow();
HBox txt = new HBox();
Text price = new Text(String.format("%.0f", offerDesc.getPrice()));
Text diff = new Text(String.format(" (%+.0f)", d));
diff.getStyleClass().add(CSS_DIFF);

View File

@@ -23,19 +23,19 @@
<TableColumn minWidth="230.0" text="Товар">
<cellValueFactory><PropertyValueFactory property="name"/></cellValueFactory>
</TableColumn>
<TableColumn minWidth="110.0" resizable="false" text="Цена" onEditCommit="#editPrice">
<TableColumn minWidth="110.0" text="Цена" onEditCommit="#editPrice">
<cellFactory><PriceCellImpl/></cellFactory>
<cellValueFactory><PropertyValueFactory property="price"/></cellValueFactory>
</TableColumn>
<TableColumn fx:id="sortSell" minWidth="80.0" resizable="false" text="Прибыль" sortType="DESCENDING">
<TableColumn fx:id="sortSell" minWidth="80.0" text="Прибыль" sortType="DESCENDING">
<cellFactory><DoubleCell/></cellFactory>
<cellValueFactory><PropertyValueFactory property="profit"/></cellValueFactory>
</TableColumn>
<TableColumn minWidth="80.0" resizable="false" text="AVG SELL">
<TableColumn minWidth="80.0" text="AVG SELL">
<cellFactory><DoubleCell/></cellFactory>
<cellValueFactory><PropertyValueFactory property="avgSell"/></cellValueFactory>
</TableColumn>
<TableColumn minWidth="80.0" resizable="false" text="AVG BUY">
<TableColumn minWidth="80.0" text="AVG BUY">
<cellFactory><DoubleCell/></cellFactory>
<cellValueFactory><PropertyValueFactory property="avgBuy"/></cellValueFactory>
</TableColumn>
@@ -60,19 +60,19 @@
<TableColumn minWidth="230.0" text="Товар">
<cellValueFactory><PropertyValueFactory property="name"/></cellValueFactory>
</TableColumn>
<TableColumn minWidth="110.0" resizable="false" text="Цена" editable="true" onEditCommit="#editPrice">
<TableColumn minWidth="110.0" text="Цена" editable="true" onEditCommit="#editPrice">
<cellFactory><PriceCellImpl/></cellFactory>
<cellValueFactory><PropertyValueFactory property="price"/></cellValueFactory>
</TableColumn>
<TableColumn fx:id="sortBuy" minWidth="80.0" resizable="false" text="Прибыль" sortType="DESCENDING">
<TableColumn fx:id="sortBuy" minWidth="80.0" text="Прибыль" sortType="DESCENDING">
<cellFactory><DoubleCell/></cellFactory>
<cellValueFactory><PropertyValueFactory property="profit"/></cellValueFactory>
</TableColumn>
<TableColumn minWidth="80.0" resizable="false" text="AVG SELL">
<TableColumn minWidth="80.0" text="AVG SELL">
<cellFactory><DoubleCell/></cellFactory>
<cellValueFactory><PropertyValueFactory property="avgSell"/></cellValueFactory>
</TableColumn>
<TableColumn minWidth="80.0" resizable="false" text="AVG BUY">
<TableColumn minWidth="80.0" text="AVG BUY">
<cellFactory><DoubleCell/></cellFactory>
<cellValueFactory><PropertyValueFactory property="avgBuy"/></cellValueFactory>
</TableColumn>