Commit 2f45c53df1f7b449b1c54b9ff915b67cd08801a6

Authored by lsagona
1 parent ca62d17fb7
Exists in master and in 1 other branch dev

skeleton for user interface

Showing 6 changed files with 119 additions and 0 deletions Side-by-side Diff

src/main/kotlin/application/App.kt View file @ 2f45c53
  1 +package application
  2 +
  3 +import javafx.application.Application
  4 +import javafx.fxml.FXMLLoader
  5 +import javafx.scene.Parent
  6 +import javafx.scene.Scene
  7 +import javafx.stage.Stage
  8 +
  9 +class App : Application() {
  10 +
  11 +
  12 + override fun start(primaryStage: Stage?) {
  13 +
  14 + val fxmlLoader = FXMLLoader(App::class.java.getResource("/gui/mainApp.fxml"))
  15 +
  16 + val parent: Parent = fxmlLoader.load()
  17 +
  18 +// val controller: MainAppController = fxmlLoader.getController()
  19 +
  20 + val scene = Scene(parent)
  21 +
  22 + primaryStage!!.scene = scene
  23 + primaryStage.title = "Maritime Visualisation"
  24 + primaryStage.width = 667.0
  25 + primaryStage.height = 375.0
  26 + primaryStage.show()
  27 + }
  28 +
  29 + companion object {
  30 + @JvmStatic
  31 + fun main(args: Array<String>) {
  32 + launch(App::class.java)
  33 + }
  34 + }
  35 +
  36 +}
src/main/kotlin/application/ui/MenuBar.kt View file @ 2f45c53
  1 +package application.ui
  2 +
  3 +import javafx.fxml.FXML
  4 +
  5 +class MenuBar {
  6 +
  7 + @FXML
  8 + fun initialize() {
  9 + }
  10 +
  11 +}
src/main/kotlin/application/ui/ShipList.kt View file @ 2f45c53
  1 +package application.ui
  2 +
  3 +class ShipList {
  4 +}
src/main/resources/gui/mainApp.fxml View file @ 2f45c53
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +
  3 +
  4 +<?import javafx.scene.control.ListView?>
  5 +<?import javafx.scene.control.SplitPane?>
  6 +<?import javafx.scene.layout.*?>
  7 +<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0"
  8 + prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.241" xmlns:fx="http://javafx.com/fxml/1">
  9 + <children>
  10 + <fx:include source="menuBar.fxml" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
  11 + AnchorPane.topAnchor="0.0"/>
  12 + <SplitPane dividerPositions="0.29797979797979796" layoutY="25.0" prefHeight="379.0" prefWidth="594.0"
  13 + AnchorPane.bottomAnchor="-4.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="6.0"
  14 + AnchorPane.topAnchor="25.0">
  15 + <items>
  16 + <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0">
  17 + <children>
  18 + <fx:include source="shipList.fxml" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"
  19 + AnchorPane.topAnchor="0.0"/>
  20 + </children>
  21 + </AnchorPane>
  22 + <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0">
  23 + <children>
  24 + <SplitPane dividerPositions="0.5" layoutX="127.0" layoutY="74.0" orientation="VERTICAL"
  25 + prefHeight="200.0" prefWidth="160.0" AnchorPane.bottomAnchor="0.0"
  26 + AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
  27 + <items>
  28 + <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="100.0" prefWidth="160.0"/>
  29 + <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="100.0" prefWidth="160.0"/>
  30 + </items>
  31 + </SplitPane>
  32 + </children>
  33 + </AnchorPane>
  34 + </items>
  35 + </SplitPane>
  36 + </children>
  37 +</AnchorPane>
src/main/resources/gui/menuBar.fxml View file @ 2f45c53
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +
  3 +<?import javafx.scene.control.MenuBar?>
  4 +<?import javafx.scene.control.Menu?>
  5 +<?import javafx.scene.control.MenuItem?>
  6 +<MenuBar prefHeight="25.0" prefWidth="600.0" fx:controller="application.ui.MenuBar" xmlns="http://javafx.com/javafx/8.0.241" xmlns:fx="http://javafx.com/fxml/1">
  7 + <menus>
  8 + <Menu mnemonicParsing="false" text="File">
  9 + <items>
  10 + <MenuItem mnemonicParsing="false" text="Close"/>
  11 + </items>
  12 + </Menu>
  13 + <Menu mnemonicParsing="false" text="Edit">
  14 + <items>
  15 + <MenuItem mnemonicParsing="false" text="Delete"/>
  16 + </items>
  17 + </Menu>
  18 + <Menu mnemonicParsing="false" text="Help">
  19 + <items>
  20 + <MenuItem mnemonicParsing="false" text="About"/>
  21 + </items>
  22 + </Menu>
  23 + </menus>
  24 +</MenuBar>
src/main/resources/gui/shipList.fxml View file @ 2f45c53
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +
  3 +<?import javafx.scene.control.ListView?>
  4 +<?import javafx.scene.layout.AnchorPane?>
  5 +<ListView prefHeight="200.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0"
  6 + AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"
  7 + fx:controller="application.ui.ShipList" xmlns="http://javafx.com/javafx/8.0.241" xmlns:fx="http://javafx.com/fxml/1"/>