Explorar o código

Prepare for rebase

Julian Ohl %!s(int64=8) %!d(string=hai) anos
pai
achega
f4753a3ddf

+ 0 - 257
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/GUIController.java

@@ -1,257 +0,0 @@
-package de.tu_darmstadt.informatik.tk.scopviz.ui;
-
-import java.net.URL;
-import java.util.ResourceBundle;
-
-import javax.swing.JPanel;
-
-import de.tu_darmstadt.informatik.tk.scopviz.main.GraphManager;
-import de.tu_darmstadt.informatik.tk.scopviz.main.Main;
-import de.tu_darmstadt.informatik.tk.scopviz.ui.handlers.ResizeListener;
-import javafx.beans.value.ChangeListener;
-import javafx.beans.value.ObservableValue;
-import javafx.embed.swing.SwingNode;
-import javafx.fxml.FXML;
-import javafx.fxml.Initializable;
-import javafx.scene.control.Button;
-import javafx.scene.control.ListCell;
-import javafx.scene.control.ListView;
-import javafx.scene.control.MenuItem;
-import javafx.scene.control.ScrollPane;
-import javafx.scene.control.TableCell;
-import javafx.scene.control.TableColumn;
-import javafx.scene.control.TableView;
-import javafx.scene.control.cell.PropertyValueFactory;
-import javafx.scene.control.cell.TextFieldTableCell;
-import javafx.scene.layout.Pane;
-import javafx.util.Callback;
-import javafx.util.Pair;
-
-/**
- * Controller class for the various GUI elements, gets instanced and initialized
- * by the FXML loading process. Can access GUI elements specified in the FXML
- * file through matching variable name here and id attribute in the FXML,
- * 
- * @author Dominik Renkel, Jan Enders
- * @version 1.1
- *
- */
-public class GUIController implements Initializable {
-
-	// The SwingNode and its containing Pane that house the graph viewer
-	@FXML
-	public SwingNode swingNode;
-	@FXML
-	public Pane pane;
-
-	// The Button present in the UI
-	@FXML
-	public Button zoomIn;
-	@FXML
-	public Button zoomOut;
-	@FXML
-	public Button createNode;
-	@FXML
-	public Button createEdge;
-
-	// The contents of the corresponding ScrollPanes
-	@FXML
-	public TableView<Pair<Object, String>> toolbox;
-	@FXML
-	public TableView<KeyValuePair> properties;
-	@FXML
-	public ListView<String> metricListView;
-	@FXML
-	public ListView<String> layerListView;
-
-	@FXML
-	public TableColumn<Pair<Object, String>, String> toolboxStringColumn;
-	@FXML
-	public TableColumn<Pair<Object, String>, Object> toolboxObjectColumn;
-
-	@FXML
-	public TableColumn<KeyValuePair, String> propertiesStringColumn;
-	@FXML
-	public TableColumn propertiesObjectColumn;
-	
-	
-	//The different menu items in the menu bar at the top
-	@FXML
-	public MenuItem newFileMenuItem;
-	
-	@FXML
-	public MenuItem openFileMenuItem;
-	
-	@FXML
-	public MenuItem saveFileMenuItem;
-	
-	@FXML
-	public MenuItem saveAsFileMenuItem;
-	
-	@FXML
-	public MenuItem deleteMenuItem;
-	
-	@FXML
-	public MenuItem undoMenuItem;
-	
-	@FXML
-	public MenuItem selectNodeMenuItem;
-	
-	@FXML
-	public MenuItem selectEdgeMenuItem;
-	
-	
-	/**
-	 * Initializes all the references to the UI elements specified in the FXML
-	 * file. Gets called during FXML loading. Asserts the correct injection of
-	 * all referenced UI elements and initializes them.
-	 */
-	@Override
-	public void initialize(URL arg0, ResourceBundle arg1) {
-		// Assert the correct injection of all references from FXML
-		assert swingNode != null : "fx:id=\"swingNode\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert pane != null : "fx:id=\"pane\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-
-		assert zoomIn != null : "fx:id=\"zoomIn\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert zoomOut != null : "fx:id=\"zoomOut\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert createNode != null : "fx:id=\"createNode\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert createEdge != null : "fx:id=\"createEdge\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-
-		assert layerListView != null : "fx:id=\"layerListView\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-	
-		assert toolbox != null : "fx:id=\"toolbox\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert properties != null : "fx:id=\"properties\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert metricListView != null : "fx:id=\"metricListView\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-
-		assert toolboxStringColumn != null : "fx:id=\"toolboxString\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert toolboxObjectColumn != null : "fx:id=\"toolboxObject\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-
-		assert propertiesStringColumn != null : "fx:id=\"propertiesString\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert propertiesObjectColumn != null : "fx:id=\"propertiesObject\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		
-		assert newFileMenuItem != null : "fx:id=\"newFileMenuItem\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert openFileMenuItem != null : "fx:id=\"openFileMenuItem\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert saveFileMenuItem != null : "fx:id=\"saveFileMenuItem\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert saveAsFileMenuItem != null : "fx:id=\"saveAsFileMenuItem\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert deleteMenuItem != null : "fx:id=\"deleteMenuItem\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert undoMenuItem != null : "fx:id=\"undoMenuItem\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert selectNodeMenuItem != null : "fx:id=\"selectNodeMenuItem\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		assert selectEdgeMenuItem != null : "fx:id=\"selectEdgeMenuItem\" was not injected: check your FXML file 'NewBetterCoolerWindowTest.fxml'.";
-		
-		initializeToolbox();
-		initializeProperties();
-		
-		// Remove Header for TableViews
-		removeHeaderTableView(toolbox);
-		removeHeaderTableView(properties);
-
-		// Initialize the Managers for the various managers for UI elements
-		ToolboxManager.initializeItems(toolbox);
-		PropertiesManager.initializeItems(properties);
-		ButtonManager.initialize(this);
-		GraphManager.setGuiController(this);
-
-		// Bind all the handlers to their corresponding UI elements
-		initializeMenuBarItems();
-		initializeZoomButtons();
-		initializeCreateButtons();
-		initializeDisplayPane();
-	}
-	
-	/**
-	 * Sets the handlers for the items of the menu bar
-	 */
-	private void initializeMenuBarItems(){
-		newFileMenuItem.setOnAction(MenuBarManager.newFileHandler);
-		openFileMenuItem.setOnAction(MenuBarManager.openFileHandler);
-		saveFileMenuItem.setOnAction(MenuBarManager.saveFileHandler);
-		saveAsFileMenuItem.setOnAction(MenuBarManager.saveAsFileHandler);
-		deleteMenuItem.setOnAction(MenuBarManager.deleteHandler);
-		undoMenuItem.setOnAction(MenuBarManager.undoHandler);
-		
-	}
-	
-	/**
-	 * Sets the handlers for the zoomin and zoomout buttons.
-	 */
-	private void initializeZoomButtons() {
-		zoomIn.setOnAction(ButtonManager.zoomInHandler);
-		zoomOut.setOnAction(ButtonManager.zoomOutHandler);
-	}
-
-	/**
-	 * Sets the Handlers for the create node and create edge buttons.
-	 */
-	private void initializeCreateButtons() {
-		createNode.setOnAction(ButtonManager.createNodeHandler);
-		createEdge.setOnAction(ButtonManager.createEdgeHandler);
-		swingNode.setOnMouseClicked(ButtonManager.clickedHandler);
-	}
-
-	/**
-	 * Sets the minimum size and adds the handlers to the graph display.
-	 */
-	private void initializeDisplayPane() {
-		pane.heightProperty().addListener(new ResizeListener(swingNode, pane));
-		pane.widthProperty().addListener(new ResizeListener(swingNode, pane));
-		swingNode.setContent((JPanel) Main.getInstance().getVisualizer().getView());
-		pane.setMinSize(200, 200);
-	}
-
-	/**
-	 * 
-	 */
-	@SuppressWarnings({ "unchecked" })
-	private void initializeToolbox() {
-		toolboxStringColumn.setCellValueFactory(new ToolboxManager.PairKeyFactory());
-		toolboxObjectColumn.setCellValueFactory(new ToolboxManager.PairValueFactory());
-
-		toolbox.getColumns().setAll(toolboxObjectColumn, toolboxStringColumn);
-
-		toolboxObjectColumn.setCellFactory(
-				new Callback<TableColumn<Pair<Object, String>, Object>, TableCell<Pair<Object, String>, Object>>() {
-					@Override
-					public TableCell<Pair<Object, String>, Object> call(
-							TableColumn<Pair<Object, String>, Object> column) {
-						return new ToolboxManager.PairValueCell();
-					}
-				});
-
-	}
-
-	/**
-	 * 
-	 */
-	@SuppressWarnings("unchecked")
-	private void initializeProperties() {
-		propertiesStringColumn.setCellValueFactory(new PropertyValueFactory<KeyValuePair, String>("key"));
-
-		propertiesObjectColumn.setCellValueFactory(new PropertyValueFactory<KeyValuePair, Object>("value"));
-		propertiesObjectColumn.setCellFactory(TextFieldTableCell.forTableColumn());
-		propertiesObjectColumn.setOnEditCommit(PropertiesManager.setOnEditCommitHandler);
-
-		properties.getColumns().setAll(propertiesStringColumn, propertiesObjectColumn);
-	}
-
-	/**
-	 * Removes the TableView Header for a given TableView
-	 * 
-	 * @param tableView
-	 */
-	private void removeHeaderTableView(TableView<?> tableView) {
-		tableView.widthProperty().addListener(new ChangeListener<Number>() {
-			@Override
-			public void changed(ObservableValue<? extends Number> ov, Number t, Number t1) {
-				// Get the table header
-				Pane header = (Pane) tableView.lookup("TableHeaderRow");
-				if (header != null && header.isVisible()) {
-					header.setMaxHeight(0);
-					header.setMinHeight(0);
-					header.setPrefHeight(0);
-					header.setVisible(false);
-					header.setManaged(false);
-				}
-			}
-		});
-	}
-}

+ 0 - 62
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/ui/MenuBarManager.java

@@ -1,62 +0,0 @@
-package de.tu_darmstadt.informatik.tk.scopviz.ui;
-
-import javafx.event.ActionEvent;
-import javafx.event.EventHandler;
-
-public class MenuBarManager {
-
-	
-	public static EventHandler<ActionEvent> newFileHandler = new EventHandler<ActionEvent>() {
-
-		@Override
-		public void handle(ActionEvent t) {
-
-		}
-	};
-
-	
-	public static EventHandler<ActionEvent> openFileHandler = new EventHandler<ActionEvent>() {
-
-		@Override
-		public void handle(ActionEvent t) {
-
-		}
-	};
-
-	
-	public static EventHandler<ActionEvent> saveFileHandler = new EventHandler<ActionEvent>() {
-
-		@Override
-		public void handle(ActionEvent t) {
-
-		}
-	};
-
-	
-	public static EventHandler<ActionEvent> saveAsFileHandler = new EventHandler<ActionEvent>() {
-
-		@Override
-		public void handle(ActionEvent t) {
-			
-		}
-	};
-
-	
-	public static EventHandler<ActionEvent> deleteHandler = new EventHandler<ActionEvent>() {
-
-		@Override
-		public void handle(ActionEvent t) {
-
-		}
-	};
-
-	
-	public static EventHandler<ActionEvent> undoHandler = new EventHandler<ActionEvent>() {
-
-		@Override
-		public void handle(ActionEvent t) {
-
-		}
-	};
-
-}

+ 0 - 139
scopviz/src/main/resources/NewBetterCoolerWindowTest.fxml

@@ -1,139 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<?import javafx.embed.swing.SwingNode?>
-<?import javafx.scene.control.Button?>
-<?import javafx.scene.control.ListView?>
-<?import javafx.scene.control.Menu?>
-<?import javafx.scene.control.MenuBar?>
-<?import javafx.scene.control.MenuItem?>
-<?import javafx.scene.control.SeparatorMenuItem?>
-<?import javafx.scene.control.SplitPane?>
-<?import javafx.scene.control.TableColumn?>
-<?import javafx.scene.control.TableView?>
-<?import javafx.scene.layout.AnchorPane?>
-<?import javafx.scene.layout.Pane?>
-<?import javafx.scene.layout.VBox?>
-
-<VBox minHeight="400.0" minWidth="640.0" prefHeight="400.0" prefWidth="640.0" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.tu_darmstadt.informatik.tk.scopviz.ui.GUIController">
-  <children>
-    <MenuBar stylesheets="@GUITheme.css" VBox.vgrow="NEVER">
-      <menus>
-        <Menu mnemonicParsing="false" text="File">
-          <items>
-            <MenuItem fx:id="newFileMenuItem" mnemonicParsing="false" text="New" />
-            <MenuItem fx:id="openFileMenuItem" mnemonicParsing="false" text="Open…" />
-            <Menu mnemonicParsing="false" text="Open Recent" />
-            <SeparatorMenuItem mnemonicParsing="false" />
-            <MenuItem mnemonicParsing="false" text="Close" />
-            <MenuItem fx:id="saveFileMenuItem" mnemonicParsing="false" text="Save" />
-            <MenuItem fx:id="saveAsFileMenuItem" mnemonicParsing="false" text="Save As…" />
-            <MenuItem mnemonicParsing="false" text="Revert" />
-            <SeparatorMenuItem mnemonicParsing="false" />
-            <MenuItem mnemonicParsing="false" text="Preferences…" />
-            <SeparatorMenuItem mnemonicParsing="false" />
-            <MenuItem mnemonicParsing="false" text="Quit" />
-          </items>
-        </Menu>
-        <Menu mnemonicParsing="false" text="Edit">
-          <items>
-            <MenuItem fx:id="undoMenuItem" mnemonicParsing="false" text="Undo" />
-            <MenuItem mnemonicParsing="false" text="Redo" />
-            <SeparatorMenuItem mnemonicParsing="false" />
-            <MenuItem mnemonicParsing="false" text="Cut" />
-            <MenuItem mnemonicParsing="false" text="Copy" />
-            <MenuItem mnemonicParsing="false" text="Paste" />
-            <MenuItem fx:id="deleteMenuItem" mnemonicParsing="false" text="Delete" />
-            <SeparatorMenuItem mnemonicParsing="false" />
-            <MenuItem fx:id="selectNodeMenuItem" mnemonicParsing="false" text="Knotenmodus" />
-            <MenuItem fx:id="selectEdgeMenuItem" mnemonicParsing="false" text="Kantenmodus" />
-            <SeparatorMenuItem mnemonicParsing="false" />
-            <MenuItem mnemonicParsing="false" text="Select All" />
-            <MenuItem mnemonicParsing="false" text="Unselect All" />
-          </items>
-        </Menu>
-        <Menu mnemonicParsing="false" text="Help">
-          <items>
-            <MenuItem mnemonicParsing="false" text="About MyHelloApp" />
-          </items>
-        </Menu>
-      </menus>
-    </MenuBar>
-    <AnchorPane maxHeight="-1.0" maxWidth="-1.0" prefHeight="-1.0" prefWidth="-1.0" VBox.vgrow="ALWAYS">
-         <children>
-            <SplitPane dividerPositions="0.15" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
-              <items>
-                <AnchorPane SplitPane.resizableWithParent="false">
-                     <children>
-                        <SplitPane dividerPositions="0.5" orientation="VERTICAL" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
-                          <items>
-                            <AnchorPane>
-                                 <children>
-                                    <TableView fx:id="toolbox" stylesheets="@GUITheme.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
-                                      <columns>
-                                        <TableColumn fx:id="toolboxObjectColumn" editable="false" maxWidth="-1.0" minWidth="90.0" prefWidth="-1.0" sortable="false" />
-                                        <TableColumn fx:id="toolboxStringColumn" editable="false" maxWidth="-1.0" minWidth="90.0" prefWidth="-1.0" sortable="false" />
-                                      </columns>
-                                    </TableView>
-                                    <Button fx:id="createNode" mnemonicParsing="false" text="Knoten hinzufügen" textAlignment="JUSTIFY" AnchorPane.bottomAnchor="45.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" />
-                                    <Button fx:id="createEdge" mnemonicParsing="false" text="Kante hinzufügen" textAlignment="JUSTIFY" AnchorPane.bottomAnchor="10.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" />
-                                 </children>
-                              </AnchorPane>
-                            <AnchorPane>
-                                 <children>
-                                    <TableView fx:id="properties" editable="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
-                                      <columns>
-                                        <TableColumn fx:id="propertiesStringColumn" editable="false" maxWidth="-1.0" minWidth="90.0" prefWidth="-1.0" sortable="false" />
-                                        <TableColumn fx:id="propertiesObjectColumn" maxWidth="-1.0" minWidth="90.0" prefWidth="-1.0" sortable="false" />
-                                      </columns>
-                                       <columnResizePolicy>
-                                          <TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
-                                       </columnResizePolicy>
-                                    </TableView>
-                                 </children>
-                              </AnchorPane>
-                          </items>
-                        </SplitPane>
-                     </children>
-                  </AnchorPane>
-                <AnchorPane SplitPane.resizableWithParent="false">
-                     <children>
-                        <SplitPane dividerPositions="0.8" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
-                          <items>
-                            <AnchorPane styleClass="background" SplitPane.resizableWithParent="false">
-                                 <children>
-                                    <Pane fx:id="pane" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
-                                       <children>
-                                          <SwingNode fx:id="swingNode" />
-                                       </children></Pane>
-                                    <Button fx:id="zoomOut" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" prefHeight="30.0" prefWidth="30.0" text="-" textAlignment="JUSTIFY" AnchorPane.bottomAnchor="10.0" AnchorPane.rightAnchor="10.0" />
-                                    <Button fx:id="zoomIn" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" mnemonicParsing="false" prefHeight="30.0" prefWidth="30.0" text="+" textAlignment="JUSTIFY" AnchorPane.bottomAnchor="45.0" AnchorPane.rightAnchor="10.0" />
-                                 </children>
-                              </AnchorPane>
-                            <AnchorPane SplitPane.resizableWithParent="false">
-                                 <children>
-                                    <SplitPane dividerPositions="0.5" orientation="VERTICAL" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
-                                      <items>
-                                        <AnchorPane>
-                                             <children>
-                                                <ListView fx:id="layerListView" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
-                                             </children>
-                                          </AnchorPane>
-                                        <AnchorPane>
-                                             <children>
-                                                <ListView fx:id="metricListView" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
-                                             </children>
-                                          </AnchorPane>
-                                      </items>
-                                    </SplitPane>
-                                 </children>
-                              </AnchorPane>
-                          </items>
-                        </SplitPane>
-                     </children>
-                  </AnchorPane>
-              </items>
-            </SplitPane>
-         </children>
-    </AnchorPane>
-  </children>
-</VBox>