Trialing treeview on help

main
Sunguin Peng 9 years ago
parent b7a3d416ca
commit 5c004886d6

@ -5,6 +5,8 @@ import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.scene.control.ListView;
import javafx.scene.control.TextArea;
import javafx.scene.control.TreeItem;
import javafx.scene.control.TreeView;
import javafx.scene.layout.Pane;
import javafx.scene.text.Text;
import javafx.scene.text.TextFlow;
@ -14,26 +16,62 @@ import javafx.scene.text.TextFlow;
*/
public class HelpController extends Controller {
@FXML
private ListView listView;
private TreeView listView;
@FXML
private TextFlow textArea;
public static final ObservableList menu = FXCollections.observableArrayList();
//public static final ObservableList menu = FXCollections.observableArrayList();
Text text = new Text();
TreeItem main_root = new TreeItem("Main Root");
TreeItem importing = new TreeItem("Importing Data");
TreeItem importing_start = new TreeItem("Importing on Startup");
TreeItem importing_after = new TreeItem("Importing after Startup");
TreeItem viewing = new TreeItem("Viewing Data");
TreeItem manipulating = new TreeItem("Manipulating Data");
TreeItem adding = new TreeItem("Adding Data");
TreeItem filter = new TreeItem("Filtering Data");
TreeItem edit = new TreeItem("Editing Data");
TreeItem delete = new TreeItem("Deleting Data");
TreeItem analysing = new TreeItem("Analysing Data");
TreeItem graphing = new TreeItem("Graphs");
TreeItem distance = new TreeItem("Distance Calculator");
public void load() {
menu.addAll("Importing Data", "Viewing Data", "Manipulating Data", "Analysis");
//menu.addAll("Importing Data", "Viewing Data", "Manipulating Data", "Analysis");
listView.setRoot(main_root);
listView.setShowRoot(false);
main_root.getChildren().add(importing);
importing.getChildren().add(importing_start);
importing.getChildren().add(importing_after);
main_root.getChildren().add(viewing);
main_root.getChildren().add(manipulating);
manipulating.getChildren().add(adding);
manipulating.getChildren().add(filter);
manipulating.getChildren().add(edit);
manipulating.getChildren().add(delete);
main_root.getChildren().add(analysing);
analysing.getChildren().add(graphing);
analysing.getChildren().add(distance);
text = new Text("Please select an option on the left side menu to display its contents.");
textArea.getChildren().add(text);
listView.setItems(menu);
}
public void sss() {
String menuValue = listView.getSelectionModel().getSelectedItem().toString();
Object menuValue = null;
if (listView.getSelectionModel().getSelectedItem() != null) {
menuValue = listView.getSelectionModel().getSelectedItem();
}
textArea.getChildren().clear();
if (menuValue == "Importing Data") {
if (menuValue.equals("TreeItem[ value: Importing on Startup ]")) {
text = new Text("You can import data from the first start up of the application and " +
"from the 'File' menu on the top of the screen.\nTo import data, select the type " +
"of data you wish to import. Then select the file (.csv and .txt file) from the " +
@ -72,6 +110,11 @@ public class HelpController extends Controller {
"\nThe second method is by accessing the 'Analysis' button on the menu on the top of the page. " +
"You can select which type of analysis you want from here.");
textArea.getChildren().add(text);
} else if (menuValue == "Graphs") {
text = new Text("gachiGASM");
textArea.getChildren().add(text);
} else {
text = new Text("Fuck you");
}
}

@ -1,13 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.media.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.text.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.control.TreeView?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.text.Font?>
<?import javafx.scene.text.TextFlow?>
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng202.group9.GUI.HelpController">
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1" fx:controller="seng202.group9.GUI.HelpController">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="286.0" minWidth="10.0" prefWidth="200.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="471.0" minWidth="10.0" prefWidth="400.0" />
@ -23,11 +26,6 @@
<Font size="24.0" />
</font>
</Label>
<ListView fx:id="listView" onMouseClicked="#sss" prefHeight="303.0" prefWidth="208.0" GridPane.rowIndex="1">
<GridPane.margin>
<Insets bottom="10.0" left="10.0" right="10.0" />
</GridPane.margin>
</ListView>
<ScrollPane prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="1">
<GridPane.margin>
<Insets bottom="10.0" right="10.0" />
@ -36,6 +34,11 @@
<TextFlow fx:id="textArea" maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="289.0" prefWidth="364.0" textAlignment="JUSTIFY" />
</content>
</ScrollPane>
<TreeView fx:id="listView" onMouseClicked="#sss" prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="1">
<GridPane.margin>
<Insets bottom="10.0" left="10.0" right="10.0" />
</GridPane.margin>
</TreeView>
</children>
<padding>
<Insets top="10.0" />

Loading…
Cancel
Save