<?xml version="1.0" encoding="UTF-8"?>


<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import org.controlsfx.glyphfont.Glyph?>
<?import javafx.geometry.Insets?>
<GridPane xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
    fx:controller="ru.trader.controllers.RouteTrackController"
    vgap="4" hgap="4">
    <padding>
        <Insets left="5" right="5" top="5" bottom="5"/>
    </padding>

    <columnConstraints>
        <ColumnConstraints minWidth="300" maxWidth="300"/>
        <ColumnConstraints minWidth="300" maxWidth="300"/>
        <ColumnConstraints minWidth="30"  maxWidth="40"/>
        <ColumnConstraints minWidth="220" />
    </columnConstraints>

    <VBox GridPane.rowIndex="0" GridPane.columnIndex="0" GridPane.columnSpan="3" spacing="4">
        <HBox spacing="4"><Label text="%helper.system" /><Label fx:id="system" /></HBox>
        <HBox spacing="4"><Label text="%helper.station" /><Label fx:id="station" /></HBox>
        <HBox spacing="4"><Label text="%helper.time" /><Label fx:id="time" /></HBox>
        <HBox fx:id="refuelGroup" spacing="4"><Label text="%helper.refuel" /><Label fx:id="refuel" /></HBox>
    </VBox>

    <Label GridPane.rowIndex="1" GridPane.columnIndex="0" text="%helper.sell" />
    <ListView GridPane.rowIndex="2" GridPane.columnIndex="0" fx:id="sellOrders" maxHeight="150"/>

    <Label GridPane.rowIndex="1" GridPane.columnIndex="1" text="%helper.buy" />
    <ListView GridPane.rowIndex="2" GridPane.columnIndex="1" fx:id="buyOrders" maxHeight="150"/>

    <VBox GridPane.rowIndex="2" GridPane.columnIndex="2" spacing="4" alignment="TOP_RIGHT">
        <Button prefWidth="30" onAction="#addOrder"><graphic><Glyph text="FontAwesome|PLUS"/></graphic></Button>
        <Button prefWidth="30" onAction="#removeOrder"><graphic><Glyph text="FontAwesome|MINUS"/></graphic></Button>
        <Button prefWidth="30" onAction="#clearOrders"><graphic><Glyph text="FontAwesome|TRASH"/></graphic></Button>
    </VBox>

    <Label GridPane.rowIndex="3" GridPane.columnIndex="0" GridPane.columnSpan="2" text="%helper.missions" />
    <StackPane GridPane.rowIndex="4" GridPane.columnIndex="0" GridPane.columnSpan="2" maxHeight="150">
        <HBox fx:id="missionsGroup">
            <ListView fx:id="missionsList" HBox.hgrow="ALWAYS"/>
        </HBox>
        <HBox fx:id="editGroup" spacing="4">
            <fx:include fx:id="missions" source="missions.fxml"/>
            <ListView fx:id="addMissionsList"/>
            <VBox spacing="4">
                <Button prefWidth="30" onAction="#addMission"><graphic><Glyph text="FontAwesome|PLUS"/></graphic></Button>
                <Button prefWidth="30" onAction="#removeMission"><graphic><Glyph text="FontAwesome|MINUS"/></graphic></Button>
                <Button prefWidth="30" onAction="#clearMissions"><graphic><Glyph text="FontAwesome|TRASH"/></graphic></Button>
                <VBox VBox.vgrow="ALWAYS" alignment="BOTTOM_LEFT">
                    <Button prefWidth="30" onAction="#addAllMissionsToTrack"><graphic><Glyph text="FontAwesome|CHECK"/></graphic></Button>
                </VBox>
            </VBox>
        </HBox>
    </StackPane>

    <VBox GridPane.rowIndex="4" GridPane.columnIndex="2" alignment="TOP_RIGHT" spacing="4">
        <ToggleButton fx:id="tbMissionsEdit" prefWidth="30" onAction="#toggleMissionsEdit"><graphic><Glyph text="FontAwesome|PLUS"/></graphic></ToggleButton>
        <Button prefWidth="30" onAction="#removeMissionFromTrack"><graphic><Glyph text="FontAwesome|MINUS"/></graphic></Button>
        <Button prefWidth="30" onAction="#removeAllMissionsFromTrack"><graphic><Glyph text="FontAwesome|TRASH"/></graphic></Button>
    </VBox>
    <ScrollPane GridPane.rowIndex="0" GridPane.columnIndex="3" GridPane.rowSpan="5" GridPane.fillHeight="true">
        <VBox>
            <AnchorPane fx:id="track"/>
            <VBox spacing="4">
                <HBox spacing="2"><TextField fx:id="newEntrySystemText"/><Button minWidth="30" onAction="#newEntryAsCurrent"><graphic><Glyph text="FontAwesome|MAP_MARKER"/></graphic></Button></HBox>
                <HBox><ComboBox fx:id="newEntryStation"/></HBox>
                <HBox spacing="2">
                    <Button prefWidth="30" onAction="#addEntry"><graphic><Glyph text="FontAwesome|PLUS"/></graphic></Button>
                    <Button prefWidth="30" onAction="#removeLast"><graphic><Glyph text="FontAwesome|MINUS"/></graphic></Button>
                    <Button prefWidth="30" onAction="#clear"><graphic><Glyph text="FontAwesome|TRASH"/></graphic></Button>
                    <Button prefWidth="30" onAction="#copyToClipboard"><graphic><Glyph text="FontAwesome|COPY"/></graphic></Button>
                    <Button prefWidth="30" onAction="#setActive"><graphic><Glyph text="FontAwesome|CHECK"/></graphic></Button>
                </HBox>
            </VBox>
        </VBox>
    </ScrollPane>
</GridPane>
