admin | bae64d8 | 2013-08-01 10:50:15 -0700 | [diff] [blame] | 1 | /* |
| 2 | * To change this template, choose Tools | Templates |
| 3 | * and open the template in the editor. |
| 4 | */ |
| 5 | package tai_ofa; |
| 6 | |
| 7 | import javafx.application.Application; |
| 8 | import javafx.event.ActionEvent; |
| 9 | import javafx.event.EventHandler; |
| 10 | import javafx.geometry.Insets; |
| 11 | import javafx.scene.Scene; |
| 12 | import javafx.scene.control.Button; |
| 13 | import javafx.scene.control.ComboBox; |
| 14 | import javafx.scene.control.Label; |
| 15 | import javafx.scene.control.TextField; |
| 16 | import javafx.scene.layout.GridPane; |
| 17 | import javafx.scene.layout.HBox; |
| 18 | import javafx.scene.layout.StackPane; |
| 19 | import javafx.stage.Stage; |
| 20 | |
| 21 | /** |
| 22 | * |
| 23 | * @author Raghav Kashyap (raghavkashyap@paxterrasolutions.com) |
| 24 | |
| 25 | * TestON is free software: you can redistribute it and/or modify |
| 26 | * it under the terms of the GNU General Public License as published by |
| 27 | * the Free Software Foundation, either version 2 of the License, or |
| 28 | * (at your option) any later version. |
| 29 | |
| 30 | * TestON is distributed in the hope that it will be useful, |
| 31 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 32 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 33 | * GNU General Public License for more details. |
| 34 | |
| 35 | * You should have received a copy of the GNU General Public License |
| 36 | * along with TestON. If not, see <http://www.gnu.org/licenses/>. |
| 37 | |
| 38 | */ |
| 39 | class OFATopologyLink extends Application { |
| 40 | |
| 41 | Label device1; |
| 42 | ComboBox<String> devicesInTopoEditor; |
| 43 | ComboBox<String> destDevicesInTopoEditor; |
| 44 | ComboBox<String> interfaceList2; |
| 45 | ComboBox<String> interfaceList4; |
| 46 | GridPane propertyGrid = new GridPane(); |
| 47 | Button finishSelectedLink; |
| 48 | Button cancelButton; |
| 49 | TextField nameText; |
| 50 | TextField typeText; |
| 51 | Stage copyStage; |
| 52 | |
| 53 | /** |
| 54 | * @param args the command line arguments |
| 55 | */ |
| 56 | public static void main(String[] args) { |
| 57 | launch(args); |
| 58 | } |
| 59 | |
| 60 | @Override |
| 61 | public void start(final Stage primaryStage) { |
| 62 | copyStage = primaryStage; |
| 63 | primaryStage.setTitle("Selected Link Popup"); |
| 64 | propertyGrid.setVgap(8); |
| 65 | propertyGrid.setHgap(30); |
| 66 | primaryStage.setResizable(false); |
| 67 | propertyGrid.setPadding(new Insets(10, 0, 0, 50)); |
| 68 | devicesInTopoEditor = new ComboBox<String>(); |
| 69 | interfaceList2 = new ComboBox<String>(); |
| 70 | Label attribute = new Label("Attribute"); |
| 71 | attribute.setStyle("-fx-padding: 0; -fx-background-color: lightgray; -fx-border-width: 2;-fx-border-color: gray;"); |
| 72 | propertyGrid.add(attribute, 0, 1); |
| 73 | |
| 74 | Label value = new Label("Value"); |
| 75 | value.setStyle("-fx-padding: 0; -fx-background-color: lightgray; -fx-border-width: 2;-fx-border-color: gray;"); |
| 76 | propertyGrid.add(value, 1, 1); |
| 77 | Label name = new Label("Name"); |
| 78 | propertyGrid.add(name, 0, 2); |
| 79 | nameText = new TextField(); |
| 80 | propertyGrid.add(nameText, 1, 2); |
| 81 | |
| 82 | Label type = new Label("Type"); |
| 83 | propertyGrid.add(type, 0, 3); |
| 84 | typeText = new TextField(); |
| 85 | propertyGrid.add(typeText, 1, 3); |
| 86 | device1 = new Label("Source Device"); |
| 87 | propertyGrid.add(device1, 0, 4); |
| 88 | devicesInTopoEditor.setMinWidth(170); |
| 89 | propertyGrid.add(devicesInTopoEditor, 1, 4); |
| 90 | |
| 91 | Label interface1 = new Label("Interface"); |
| 92 | propertyGrid.add(interface1, 0, 5); |
| 93 | interfaceList2 = new ComboBox<String>(); |
| 94 | interfaceList2.setMinWidth(170); |
| 95 | propertyGrid.add(interfaceList2, 1, 5); |
| 96 | |
| 97 | Label device2 = new Label("Destination Device"); |
| 98 | propertyGrid.add(device2, 0, 6); |
| 99 | destDevicesInTopoEditor = new ComboBox<String>(); |
| 100 | destDevicesInTopoEditor.setMinWidth(170); |
| 101 | propertyGrid.add(destDevicesInTopoEditor, 1, 6); |
| 102 | |
| 103 | Label device3 = new Label("Interface"); |
| 104 | propertyGrid.add(device3, 0, 7); |
| 105 | interfaceList4 = new ComboBox<String>(); |
| 106 | interfaceList4.setMinWidth(170); |
| 107 | propertyGrid.add(interfaceList4, 1, 7); |
| 108 | |
| 109 | HBox propertyButton = new HBox(5); |
| 110 | propertyButton.setPadding(new Insets(0, 0, 0, 0)); |
| 111 | finishSelectedLink = new Button("Save"); |
| 112 | |
| 113 | cancelButton = new Button("Cancel"); |
| 114 | propertyButton.getChildren().addAll(new Label(" "), finishSelectedLink, cancelButton); |
| 115 | propertyGrid.add(propertyButton, 1, 8); |
| 116 | |
| 117 | cancelButton.setOnAction(new EventHandler<ActionEvent>() { |
| 118 | @Override |
| 119 | public void handle(ActionEvent arg0) { |
| 120 | primaryStage.close(); |
| 121 | } |
| 122 | }); |
| 123 | StackPane root = new StackPane(); |
| 124 | root.getChildren().add(propertyGrid); |
| 125 | primaryStage.setScene(new Scene(root, 450, 320)); |
| 126 | primaryStage.show(); |
| 127 | } |
| 128 | } |