Archived
0

Create repository

This commit is contained in:
iMoHax
2014-07-16 16:38:48 +04:00
committed by iMoHax
commit 15bfe2e0f3
79 changed files with 5741 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import ru.trader.view.support.cells.OfferListCell?>
<VBox xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="ru.trader.controllers.ItemDescController">
<Label text="Продавцы:"/>
<ListView fx:id="seller" maxHeight="200.0">
<cellFactory>
<OfferListCell/>
</cellFactory>
</ListView>
<Label text="Покупатели:"/>
<ListView fx:id="buyer" maxHeight="200.0">
<cellFactory>
<OfferListCell/>
</cellFactory>
</ListView>
</VBox>

View File

@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.cell.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.control.*?>
<?import ru.trader.view.support.cells.OfferCellValueImpl?>
<?import ru.trader.view.support.cells.DoubleCell?>
<VBox xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="ru.trader.controllers.ItemsController">
<TableView fx:id="tblItems" editable="true" VBox.vgrow="ALWAYS">
<columns>
<TableColumn editable="true" minWidth="200.0" prefWidth="200.0" text="Товар">
<cellValueFactory>
<PropertyValueFactory property="name"/>
</cellValueFactory>
</TableColumn>
<TableColumn editable="true" resizable="false" text="Покупка">
<columns>
<TableColumn minWidth="120.0" prefWidth="120.0" text="Мин.">
<cellValueFactory>
<OfferCellValueImpl property="minSell"/>
</cellValueFactory>
</TableColumn>
<TableColumn minWidth="80.0" prefWidth="80.0" text="Ср.">
<cellFactory>
<DoubleCell/>
</cellFactory>
<cellValueFactory>
<PropertyValueFactory property="avgSell"/>
</cellValueFactory>
</TableColumn>
<TableColumn minWidth="120.0" prefWidth="120.0" text="Макс.">
<cellValueFactory>
<OfferCellValueImpl property="maxSell"/>
</cellValueFactory>
</TableColumn>
</columns>
</TableColumn>
<TableColumn editable="true" resizable="false" text="Продажа">
<columns>
<TableColumn minWidth="120.0" prefWidth="120.0" text="Мин.">
<cellValueFactory>
<OfferCellValueImpl property="minBuy"/>
</cellValueFactory>
</TableColumn>
<TableColumn minWidth="80.0" prefWidth="80.0" text="Ср.">
<cellFactory>
<DoubleCell/>
</cellFactory>
<cellValueFactory>
<PropertyValueFactory property="avgBuy"/>
</cellValueFactory>
</TableColumn>
<TableColumn minWidth="120.0" prefWidth="120.0" text="Макс.">
<cellValueFactory>
<OfferCellValueImpl property="maxBuy"/>
</cellValueFactory>
</TableColumn>
</columns>
</TableColumn>
<TableColumn editable="true" resizable="false" text="Прибыль">
<columns>
<TableColumn fx:id="minProfit" minWidth="80.0" prefWidth="80.0" text="Мин.">
<cellFactory>
<DoubleCell/>
</cellFactory>
</TableColumn>
<TableColumn fx:id="avgProfit" minWidth="80.0" prefWidth="80.0" text="Ср.">
<cellFactory>
<DoubleCell/>
</cellFactory>
</TableColumn>
<TableColumn fx:id="maxProfit" minWidth="80.0" prefWidth="80.0" text="Макс." sortType="DESCENDING">
<cellFactory>
<DoubleCell/>
</cellFactory>
</TableColumn>
</columns>
</TableColumn>
</columns>
<columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY"/>
</columnResizePolicy>
<sortOrder>
<fx:reference source="maxProfit"/>
</sortOrder>
</TableView>
</VBox>

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<BorderPane xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="ru.trader.controllers.MainController"
fx:id="mainPane"
>
<top>
<MenuBar>
<Menu text="Файл">
<MenuItem text="Сохранить" onAction="#save"/>
<MenuItem text="Импорт..." onAction="#importWorld"/>
</Menu>
<Menu text="Правка">
<MenuItem text="Добавить станцию" onAction="#addVendor"/>
<MenuItem text="Добавить товар" onAction="#addItem"/>
<MenuItem text="Редактировать станцию" onAction="#editVendor"/>
</Menu>
</MenuBar>
</top>
<center>
<TabPane tabClosingPolicy="UNAVAILABLE" BorderPane.alignment="CENTER">
<Tab text="Товары">
<fx:include fx:id="items" source="items.fxml"/>
</Tab>
<Tab text="Станции">
<fx:include fx:id="offers" source="offers.fxml"/>
</Tab>
<Tab text="Маршруты">
<fx:include source="routers.fxml"/>
</Tab>
</TabPane>
</center>
</BorderPane>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import ru.trader.view.support.NumberField?>
<VBox xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="ru.trader.controllers.OffersEditorController">
<Label fx:id="name"/>
<HBox>
<Label text="Продажа:"/>
<NumberField fx:id="sell"/>
<Label text="Покупка:"/>
<NumberField fx:id="buy"/>
</HBox>
</VBox>

View File

@@ -0,0 +1,159 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.control.cell.PropertyValueFactory?>
<?import ru.trader.view.support.cells.PriceCellImpl?>
<?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"
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">
<panes>
<TitledPane fx:id="sells" animated="false" text="Продаваемые товары">
<TableView fx:id="tblSell" editable="true">
<columns>
<TableColumn minWidth="200.0" prefWidth="200.0" text="Товар">
<cellValueFactory>
<PropertyValueFactory property="name"/>
</cellValueFactory>
</TableColumn>
<TableColumn minWidth="100.0" prefWidth="100.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">
<cellFactory>
<DoubleCell/>
</cellFactory>
<cellValueFactory>
<PropertyValueFactory property="profit"/>
</cellValueFactory>
</TableColumn>
<TableColumn minWidth="80.0" prefWidth="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">
<cellFactory>
<DoubleCell/>
</cellFactory>
<cellValueFactory>
<PropertyValueFactory property="avgBuy"/>
</cellValueFactory>
</TableColumn>
<TableColumn minWidth="120.0" prefWidth="120.0" text="BEST SELL">
<cellValueFactory>
<OfferCellValueImpl property="bestSell"/>
</cellValueFactory>
</TableColumn>
<TableColumn minWidth="120.0" prefWidth="120.0" text="BEST BUY">
<cellValueFactory>
<OfferCellValueImpl property="bestBuy"/>
</cellValueFactory>
</TableColumn>
</columns>
<columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY"/>
</columnResizePolicy>
<sortOrder>
<fx:reference source="sortSell"/>
</sortOrder>
</TableView>
</TitledPane>
<TitledPane animated="false" layoutX="10.0" layoutY="10.0" text="Покупаемые товары">
<content>
<TableView fx:id="tblBuy" editable="true">
<columns>
<TableColumn minWidth="200.0" prefWidth="200.0" text="Товар">
<cellValueFactory>
<PropertyValueFactory property="name"/>
</cellValueFactory>
</TableColumn>
<TableColumn minWidth="100.0" prefWidth="100.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">
<cellFactory>
<DoubleCell/>
</cellFactory>
<cellValueFactory>
<PropertyValueFactory property="profit"/>
</cellValueFactory>
</TableColumn>
<TableColumn minWidth="80.0" prefWidth="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">
<cellFactory>
<DoubleCell/>
</cellFactory>
<cellValueFactory>
<PropertyValueFactory property="avgBuy"/>
</cellValueFactory>
</TableColumn>
<TableColumn minWidth="120.0" prefWidth="120.0" text="BEST SELL">
<cellValueFactory>
<OfferCellValueImpl property="bestSell"/>
</cellValueFactory>
</TableColumn>
<TableColumn minWidth="120.0" prefWidth="120.0" text="BEST BUY">
<cellValueFactory>
<OfferCellValueImpl property="bestBuy"/>
</cellValueFactory>
</TableColumn>
</columns>
<columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY"/>
</columnResizePolicy>
<sortOrder>
<fx:reference source="sortBuy"/>
</sortOrder>
</TableView>
</content>
</TitledPane>
</panes>
<expandedPane>
<fx:reference source="sells"/>
</expandedPane>
</Accordion>
</GridPane>

View File

@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.cell.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.control.*?>
<?import ru.trader.view.support.cells.DoubleCell?>
<?import ru.trader.view.support.cells.OfferCellValueImpl?>
<?import ru.trader.view.support.cells.OfferTableCell?>
<HBox xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="ru.trader.controllers.OrdersController">
<TableView fx:id="tblOrders" editable="true">
<columns>
<TableColumn minWidth="200.0" prefWidth="200.0" text="Товар">
<cellValueFactory>
<PropertyValueFactory property="name"/>
</cellValueFactory>
</TableColumn>
<TableColumn minWidth="80.0" prefWidth="80.0" text="Цена">
<cellFactory>
<DoubleCell/>
</cellFactory>
<cellValueFactory>
<PropertyValueFactory property="price"/>
</cellValueFactory>
</TableColumn>
<TableColumn fx:id="count" minWidth="80.0" prefWidth="80.0" text="Кол-во">
<cellValueFactory>
<PropertyValueFactory property="count"/>
</cellValueFactory>
</TableColumn>
<TableColumn minWidth="120.0" prefWidth="120.0" text="Покупатель">
<cellValueFactory>
<OfferCellValueImpl property="buyer"/>
</cellValueFactory>
</TableColumn>
<TableColumn minWidth="80.0" prefWidth="80.0" text="Прибыль">
<cellFactory>
<DoubleCell/>
</cellFactory>
<cellValueFactory>
<PropertyValueFactory property="profit"/>
</cellValueFactory>
</TableColumn>
<TableColumn resizable="false" text="Максимум">
<columns>
<TableColumn fx:id="maxCount" minWidth="80.0" prefWidth="80.0" text="Кол-во">
<cellValueFactory>
<PropertyValueFactory property="max"/>
</cellValueFactory>
</TableColumn>
<TableColumn fx:id="bestProfit" minWidth="80.0" prefWidth="80.0" text="Прибыль"
sortType="DESCENDING">
<cellFactory>
<DoubleCell/>
</cellFactory>
<cellValueFactory>
<PropertyValueFactory property="bestProfit"/>
</cellValueFactory>
</TableColumn>
</columns>
</TableColumn>
</columns>
<columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY"/>
</columnResizePolicy>
<sortOrder>
<fx:reference source="bestProfit"/>
</sortOrder>
</TableView>
<TableView fx:id="tblBuyers">
<columns>
<TableColumn minWidth="120.0" prefWidth="120.0" text="Покупатель">
<cellFactory>
<OfferTableCell/>
</cellFactory>
<cellValueFactory>
<PropertyValueFactory property="price"/>
</cellValueFactory>
</TableColumn>
<TableColumn fx:id="curProfit" minWidth="80.0" prefWidth="80.0" text="Прибыль" sortType="DESCENDING">
<cellFactory>
<DoubleCell/>
</cellFactory>
<cellValueFactory>
<PropertyValueFactory property="profit"/>
</cellValueFactory>
</TableColumn>
</columns>
<columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY"/>
</columnResizePolicy>
<sortOrder>
<fx:reference source="curProfit"/>
</sortOrder>
</TableView>
</HBox>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import ru.trader.view.support.NumberField?>
<VBox xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="ru.trader.controllers.RoutersController">
<HBox>
<HBox>
<Label text="Баланс:"/>
<NumberField fx:id="balance" value="1000"/>
</HBox>
<HBox>
<Label text="Трюм:"/>
<NumberField fx:id="cargo" value="4"/>
</HBox>
<Label text="Станция:"/>
<ComboBox fx:id="vendors"/>
<Button fx:id="buy" text="Купить"/>
<Button fx:id="sell" text="Продать"/>
</HBox>
</VBox>

View File

@@ -0,0 +1,11 @@
.good .diff {
-fx-fill: green;
-fx-font-weight: bold;
}
.bad .diff {
-fx-fill: red;
-fx-font-weight: bold;
}

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.control.cell.PropertyValueFactory?>
<VBox xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8"
fx:controller="ru.trader.controllers.VendorEditorController">
<HBox alignment="CENTER" GridPane.columnSpan="3">
<TextField fx:id="name" alignment="CENTER"/>
</HBox>
<TableView fx:id="items" editable="true" prefWidth="400.0">
<columns>
<TableColumn minWidth="200.0" prefWidth="200.0" text="Товар" editable="false">
<cellValueFactory>
<PropertyValueFactory property="name"/>
</cellValueFactory>
</TableColumn>
<TableColumn fx:id="buy" minWidth="80.0" prefWidth="80.0" maxWidth="80.0" text="Продажа">
<cellValueFactory>
<PropertyValueFactory property="bprice"/>
</cellValueFactory>
</TableColumn>
<TableColumn fx:id="sell" minWidth="80.0" prefWidth="80.0" maxWidth="80.0" text="Покупка">
<cellValueFactory>
<PropertyValueFactory property="sprice"/>
</cellValueFactory>
</TableColumn>
</columns>
</TableView>
</VBox>