<?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?>
<?import ru.trader.view.support.cells.PathRouteCell?>
<?import ru.trader.view.support.cells.DistanceCell?>
<HBox xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
      fx:controller="ru.trader.controllers.PathsController" styleClass="dialog"
      prefWidth="1050">
    <TableView fx:id="tblPaths" editable="true">
        <columns>
            <TableColumn minWidth="600.0" text="%routes.path">
                <cellFactory><PathRouteCell /></cellFactory>
            </TableColumn>
            <TableColumn minWidth="70.0" text="%routes.jumps">
                <cellValueFactory><PropertyValueFactory property="jumps"/></cellValueFactory>
            </TableColumn>
            <TableColumn minWidth="70.0" text="%routes.refills">
                <cellValueFactory><PropertyValueFactory property="refuels"/></cellValueFactory>
            </TableColumn>
            <TableColumn minWidth="70.0" text="%routes.lands">
                <cellValueFactory><PropertyValueFactory property="lands"/></cellValueFactory>
            </TableColumn>
            <TableColumn minWidth="80.0" text="%market.order.distance">
                <cellFactory><DistanceCell /></cellFactory>
                <cellValueFactory><PropertyValueFactory property="distance"/></cellValueFactory>
            </TableColumn>
            <TableColumn minWidth="70.0" text="%market.order.profit">
                <cellValueFactory><PropertyValueFactory property="profit"/></cellValueFactory>
            </TableColumn>
            <TableColumn fx:id="profitByTime" minWidth="70.0" text="%market.offer.avg" sortType="DESCENDING">
                <cellFactory><DoubleCell format="\%.0f"/></cellFactory>
                <cellValueFactory><PropertyValueFactory property="profitByTime"/></cellValueFactory>
            </TableColumn>
        </columns>
        <columnResizePolicy>
            <TableView fx:constant="UNCONSTRAINED_RESIZE_POLICY"/>
        </columnResizePolicy>
        <sortOrder>
            <fx:reference source="profitByTime"/>
        </sortOrder>
    </TableView>
</HBox>
