Stubbed out the new global script editor UI, not hooked up to anything yet though.

This commit is contained in:
Brendan Robert 2015-05-25 23:49:10 -05:00
parent c32a533cc9
commit 240ea8aad8
5 changed files with 167 additions and 3 deletions

View File

@ -46,6 +46,9 @@ public abstract class ApplicationUIController {
@FXML
abstract public void imageTabActivated(Event event);
@FXML
abstract public void scriptTabActivated(Event event);
@FXML // This method is called by the FXMLLoader when initialization is complete
public void initialize() {
}

View File

@ -84,8 +84,7 @@ public class ApplicationUIControllerImpl extends ApplicationUIController {
}
public static enum TABS {
image, map, tile
image, map, tile, scripting
};
TABS currentTab;
@ -103,6 +102,11 @@ public class ApplicationUIControllerImpl extends ApplicationUIController {
public void tileTabActivated(Event event) {
currentTab = TABS.tile;
}
@Override
public void scriptTabActivated(Event event) {
currentTab = TABS.scripting;
}
@Override
public Editor getVisibleEditor() {
@ -113,8 +117,9 @@ public class ApplicationUIControllerImpl extends ApplicationUIController {
return mapController.getCurrentEditor();
case tile:
return tileController.getCurrentTileEditor();
default:
return null;
}
return null;
}
public static final DataFormat SCRIPT_DATA_FORMAT = new DataFormat("MythosScript");

View File

@ -0,0 +1,67 @@
package org.badvision.outlaweditor.ui.impl;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.ListView;
/**
* FXML Controller class
*
* @author blurry
*/
public class GlobalScriptTabControllerImpl implements Initializable {
@FXML
private ListView<?> globalScriptList;
@FXML
private ListView<?> dataTypeList;
@FXML
private ListView<?> variableList;
/**
* Initializes the controller class.
*/
@Override
public void initialize(URL url, ResourceBundle rb) {
// TODO
}
@FXML
private void onScriptAddPressed(ActionEvent event) {
}
@FXML
private void onScriptDeletePressed(ActionEvent event) {
}
@FXML
private void onScriptClonePressed(ActionEvent event) {
}
@FXML
private void onDataTypeAddPressed(ActionEvent event) {
}
@FXML
private void onDataTypeDeletePressed(ActionEvent event) {
}
@FXML
private void onDeleteClonePressed(ActionEvent event) {
}
@FXML
private void onVariableAddPressed(ActionEvent event) {
}
@FXML
private void onVariableDeletePressed(ActionEvent event) {
}
@FXML
private void onVariableClonePressed(ActionEvent event) {
}
}

View File

@ -27,6 +27,11 @@
<fx:include fx:id="image" source="imageEditorTab.fxml" />
</content>
</Tab>
<Tab onSelectionChanged="#scriptTabActivated" text="Scripting">
<content>
<fx:include fx:id="scripting" source="globalScriptEditorTab.fxml" />
</content>
</Tab>
</tabs>
</TabPane>
</children>

View File

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.*?>
<?import java.lang.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<AnchorPane id="mapsTab" minHeight="0.0" minWidth="0.0" prefHeight="480.0" prefWidth="677.0" stylesheets="@styles/applicationui.css" xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.badvision.outlaweditor.ui.impl.GlobalScriptTabControllerImpl">
<children>
<HBox prefHeight="438.0" prefWidth="677.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<VBox HBox.hgrow="ALWAYS">
<children>
<Label text="Scripts" />
<ToolBar prefWidth="200.0">
<items>
<Button mnemonicParsing="false" onAction="#onScriptAddPressed" text="+" />
<Button mnemonicParsing="false" onAction="#onScriptDeletePressed" text="-" />
<Button mnemonicParsing="false" onAction="#onScriptClonePressed" text="Clone" />
</items>
</ToolBar>
<ScrollPane fitToHeight="true" fitToWidth="true" prefHeight="419.0" prefWidth="201.0">
<content>
<AnchorPane id="Content" minHeight="0.0" minWidth="0.0" prefHeight="95.0" prefWidth="198.0">
<children>
<ListView fx:id="globalScriptList" editable="true" prefHeight="130.0" prefWidth="199.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
</children>
</AnchorPane>
</content>
</ScrollPane>
</children>
<padding>
<Insets right="5.0" />
</padding>
</VBox>
<VBox layoutX="10.0" layoutY="10.0" HBox.hgrow="ALWAYS">
<children>
<Label text="Data Types" />
<ToolBar prefWidth="200.0">
<items>
<Button mnemonicParsing="false" onAction="#onDataTypeAddPressed" text="+" />
<Button mnemonicParsing="false" onAction="#onDataTypeDeletePressed" text="-" />
<Button mnemonicParsing="false" onAction="#onDeleteClonePressed" text="Clone" />
</items>
</ToolBar>
<ScrollPane fitToHeight="true" fitToWidth="true" prefHeight="419.0" prefWidth="201.0">
<content>
<AnchorPane id="Content" minHeight="0.0" minWidth="0.0" prefHeight="95.0" prefWidth="198.0">
<children>
<ListView fx:id="dataTypeList" editable="true" prefHeight="130.0" prefWidth="199.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
</children>
</AnchorPane>
</content>
</ScrollPane>
</children>
<padding>
<Insets right="5.0" />
</padding>
</VBox>
<VBox layoutX="211.0" layoutY="10.0" HBox.hgrow="ALWAYS">
<children>
<Label text="Global Variables" />
<ToolBar prefWidth="200.0">
<items>
<Button mnemonicParsing="false" onAction="#onVariableAddPressed" text="+" />
<Button mnemonicParsing="false" onAction="#onVariableDeletePressed" text="-" />
<Button mnemonicParsing="false" onAction="#onVariableClonePressed" text="Clone" />
</items>
</ToolBar>
<ScrollPane fitToHeight="true" fitToWidth="true" prefHeight="419.0" prefWidth="201.0">
<content>
<AnchorPane id="Content" minHeight="0.0" minWidth="0.0" prefHeight="95.0" prefWidth="198.0">
<children>
<ListView fx:id="variableList" editable="true" prefHeight="130.0" prefWidth="199.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
</children>
</AnchorPane>
</content>
</ScrollPane>
</children>
</VBox>
</children>
</HBox>
</children>
</AnchorPane>