File src/salesman/ui/MainWindow.fxml changed (mode: 100644) (index 25b6286..5c051a4) |
1 |
1 |
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
2 |
2 |
|
|
|
3 |
|
<?import javafx.geometry.Insets?> |
3 |
4 |
<?import javafx.scene.control.Label?> |
<?import javafx.scene.control.Label?> |
4 |
5 |
<?import javafx.scene.control.SplitPane?> |
<?import javafx.scene.control.SplitPane?> |
5 |
6 |
<?import javafx.scene.control.TextField?> |
<?import javafx.scene.control.TextField?> |
|
8 |
9 |
<?import javafx.scene.layout.GridPane?> |
<?import javafx.scene.layout.GridPane?> |
9 |
10 |
<?import javafx.scene.layout.Pane?> |
<?import javafx.scene.layout.Pane?> |
10 |
11 |
<?import javafx.scene.layout.RowConstraints?> |
<?import javafx.scene.layout.RowConstraints?> |
|
12 |
|
<?import javafx.scene.layout.VBox?> |
11 |
13 |
|
|
12 |
|
<SplitPane dividerPositions="0.29797979797979796" maxHeight="600.0" maxWidth="-Infinity" minHeight="500.0" minWidth="-Infinity" prefHeight="600.0" prefWidth="1000.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8.0.141"> |
|
|
14 |
|
<SplitPane dividerPositions="0.29797979797979796" maxHeight="600.0" maxWidth="-Infinity" minHeight="500.0" minWidth="-Infinity" prefHeight="600.0" prefWidth="1000.0" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="salesman.ui.MainWindowController"> |
13 |
15 |
<items> |
<items> |
14 |
16 |
<AnchorPane maxHeight="598.0" maxWidth="220.0" minHeight="598.0" minWidth="220.0" prefHeight="598.0" prefWidth="220.0" SplitPane.resizableWithParent="false"> |
<AnchorPane maxHeight="598.0" maxWidth="220.0" minHeight="598.0" minWidth="220.0" prefHeight="598.0" prefWidth="220.0" SplitPane.resizableWithParent="false"> |
15 |
17 |
<children> |
<children> |
16 |
18 |
<AnchorPane layoutY="23.0" maxHeight="300.0" maxWidth="220.0" minHeight="300.0" minWidth="220.0" prefHeight="200.0" prefWidth="200.0" AnchorPane.topAnchor="0.0"> |
<AnchorPane layoutY="23.0" maxHeight="300.0" maxWidth="220.0" minHeight="300.0" minWidth="220.0" prefHeight="200.0" prefWidth="200.0" AnchorPane.topAnchor="0.0"> |
17 |
19 |
<children> |
<children> |
18 |
|
<GridPane layoutX="-41.0" layoutY="51.0" prefHeight="45.0" prefWidth="220.0" AnchorPane.bottomAnchor="257.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> |
|
19 |
|
<columnConstraints> |
|
20 |
|
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> |
|
21 |
|
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> |
|
22 |
|
</columnConstraints> |
|
23 |
|
<rowConstraints> |
|
24 |
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> |
|
25 |
|
</rowConstraints> |
|
|
20 |
|
<VBox fx:id="upperMenu" layoutX="1.0" layoutY="1.0"> |
26 |
21 |
<children> |
<children> |
27 |
|
<Label text="Anzahl Städte" /> |
|
28 |
|
<TextField GridPane.columnIndex="1" /> |
|
|
22 |
|
<GridPane prefHeight="45.0" prefWidth="220.0"> |
|
23 |
|
<columnConstraints> |
|
24 |
|
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> |
|
25 |
|
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> |
|
26 |
|
</columnConstraints> |
|
27 |
|
<rowConstraints> |
|
28 |
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> |
|
29 |
|
</rowConstraints> |
|
30 |
|
<children> |
|
31 |
|
<Label text="Anzahl Städte" /> |
|
32 |
|
<TextField GridPane.columnIndex="1" /> |
|
33 |
|
</children> |
|
34 |
|
</GridPane> |
29 |
35 |
</children> |
</children> |
30 |
|
</GridPane> |
|
|
36 |
|
</VBox> |
31 |
37 |
</children> |
</children> |
|
38 |
|
<padding> |
|
39 |
|
<Insets left="5.0" right="5.0" /> |
|
40 |
|
</padding> |
32 |
41 |
</AnchorPane> |
</AnchorPane> |
33 |
42 |
<GridPane layoutX="10.0" layoutY="451.0" maxWidth="220.0" minWidth="220.0" prefHeight="147.0" prefWidth="220.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"> |
<GridPane layoutX="10.0" layoutY="451.0" maxWidth="220.0" minWidth="220.0" prefHeight="147.0" prefWidth="220.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"> |
34 |
43 |
<columnConstraints> |
<columnConstraints> |
|
54 |
63 |
</AnchorPane> |
</AnchorPane> |
55 |
64 |
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0"> |
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0"> |
56 |
65 |
<children> |
<children> |
57 |
|
<Pane layoutX="207.0" layoutY="88.0" prefHeight="598.0" prefWidth="770.0" style="-fx-background-color: #FFFFFF;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" /> |
|
|
66 |
|
<Pane fx:id="paneCities" layoutX="207.0" layoutY="88.0" prefHeight="598.0" prefWidth="770.0" style="-fx-background-color: #FFFFFF;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" /> |
58 |
67 |
</children></AnchorPane> |
</children></AnchorPane> |
59 |
68 |
</items> |
</items> |
60 |
69 |
</SplitPane> |
</SplitPane> |
File src/salesman/ui/MainWindowController.java changed (mode: 100644) (index a6be95f..71cac5a) |
1 |
1 |
package salesman.ui; |
package salesman.ui; |
2 |
2 |
|
|
|
3 |
|
import javafx.fxml.FXML; |
|
4 |
|
import javafx.fxml.FXMLLoader; |
|
5 |
|
import javafx.scene.control.ComboBox; |
|
6 |
|
import javafx.scene.layout.GridPane; |
|
7 |
|
import javafx.scene.layout.Pane; |
|
8 |
|
import javafx.scene.layout.VBox; |
|
9 |
|
|
|
10 |
|
import java.io.IOException; |
|
11 |
|
|
|
12 |
|
|
3 |
13 |
public class MainWindowController { |
public class MainWindowController { |
|
14 |
|
@FXML |
|
15 |
|
private ComboBox cBalgorithm; |
|
16 |
|
@FXML |
|
17 |
|
private Pane paneCities; |
|
18 |
|
@FXML |
|
19 |
|
private VBox upperMenu; |
|
20 |
|
|
|
21 |
|
|
|
22 |
|
private GridPane actualMenu; |
|
23 |
|
|
|
24 |
|
|
|
25 |
|
|
|
26 |
|
public MainWindowController(){ |
|
27 |
|
} |
|
28 |
|
|
|
29 |
|
@FXML |
|
30 |
|
public void initialize(){ |
|
31 |
|
try { |
|
32 |
|
loadNewMenu("BrutForce"); |
|
33 |
|
} catch (IOException e) { |
|
34 |
|
e.printStackTrace(); |
|
35 |
|
//TODO implement user warning |
|
36 |
|
} |
|
37 |
|
/* cBalgorithm.onActionProperty().addListener(new ChangeListener() { |
|
38 |
|
@Override |
|
39 |
|
public void changed(ObservableValue observable, Object oldValue, Object newValue) { |
|
40 |
|
//TODO implement menu changes |
|
41 |
|
} |
|
42 |
|
});*/ |
|
43 |
|
} |
|
44 |
|
|
|
45 |
|
private void loadNewMenu(String menuName)throws IOException { |
|
46 |
|
GridPane newMenu=null; |
|
47 |
|
switch (menuName){ |
|
48 |
|
case "BrutForce": |
|
49 |
|
newMenu = FXMLLoader.load(getClass().getResource("MenuBrutForce.fxml")); |
|
50 |
|
break; |
|
51 |
|
default: |
|
52 |
|
throw new IllegalArgumentException("String 'menuName' didn't match aany menu available"); |
|
53 |
|
} |
|
54 |
|
if(!(actualMenu ==null)) |
|
55 |
|
upperMenu.getChildren().remove(actualMenu); |
|
56 |
|
upperMenu.getChildren().add(newMenu); |
|
57 |
|
actualMenu=newMenu; |
|
58 |
|
} |
4 |
59 |
} |
} |
File src/salesman/ui/MenuBrutForce.fxml changed (mode: 100644) (index 42e521a..6876886) |
6 |
6 |
<?import javafx.scene.layout.GridPane?> |
<?import javafx.scene.layout.GridPane?> |
7 |
7 |
<?import javafx.scene.layout.RowConstraints?> |
<?import javafx.scene.layout.RowConstraints?> |
8 |
8 |
|
|
9 |
|
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="255.0" prefWidth="220.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8.0.141"> |
|
|
9 |
|
<GridPane alignment="BOTTOM_CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="230.0" prefWidth="220.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8.0.141"> |
10 |
10 |
<columnConstraints> |
<columnConstraints> |
11 |
11 |
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> |
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> |
12 |
12 |
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> |
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> |