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.geometry.Pos; |
| 12 | import javafx.scene.Group; |
| 13 | import javafx.scene.Scene; |
| 14 | import javafx.scene.control.Button; |
| 15 | import javafx.scene.control.Label; |
| 16 | import javafx.scene.control.Tab; |
| 17 | import javafx.scene.control.TabPane; |
| 18 | import javafx.scene.control.TextField; |
| 19 | import javafx.scene.control.TextFieldBuilder; |
| 20 | import javafx.scene.image.Image; |
| 21 | import javafx.scene.image.ImageView; |
| 22 | import javafx.scene.layout.GridPane; |
| 23 | import javafx.scene.layout.HBox; |
| 24 | import javafx.scene.layout.StackPane; |
| 25 | import javafx.scene.layout.VBox; |
| 26 | import javafx.stage.Stage; |
| 27 | |
| 28 | /** |
| 29 | * |
| 30 | * @author Raghav Kashyap raghavkashyap@paxterrasolutions.com |
| 31 | |
| 32 | * TestON is free software: you can redistribute it and/or modify |
| 33 | * it under the terms of the GNU General Public License as published by |
| 34 | * the Free Software Foundation, either version 2 of the License, or |
| 35 | * (at your option) any later version. |
| 36 | |
| 37 | * TestON is distributed in the hope that it will be useful, |
| 38 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 39 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 40 | * GNU General Public License for more details. |
| 41 | |
| 42 | * You should have received a copy of the GNU General Public License |
| 43 | * along with TestON. If not, see <http://www.gnu.org/licenses/>. |
| 44 | |
| 45 | */ |
| 46 | public class ExecutionConsole extends Application { |
| 47 | |
| 48 | Stage copyStage; |
| 49 | Scene scene; |
| 50 | TextField value ; |
| 51 | String Title,enteredValue ; |
| 52 | Button submit ; |
| 53 | ExecutionConsole(String Title,Button enter, TextField value) { |
| 54 | this.Title = Title; |
| 55 | this.submit = enter; |
| 56 | this.value = value; |
| 57 | } |
| 58 | |
| 59 | @Override public void start(final Stage primaryStage) throws Exception { |
| 60 | copyStage = primaryStage; |
| 61 | |
| 62 | Group root = new Group(); |
| 63 | GridPane basePane = new GridPane(); |
| 64 | basePane.setPadding(new Insets(2, 0, 2, 0)); |
| 65 | basePane.setVgap(5); |
| 66 | basePane.setHgap(2); |
| 67 | value.setEditable(true); |
| 68 | value.clear(); |
| 69 | enteredValue = ""; |
| 70 | Label info = new Label("Please pass the appropriate value"); |
| 71 | |
| 72 | |
| 73 | basePane.add(value, 0, 1); |
| 74 | basePane.add(submit, 1, 1); |
| 75 | basePane.add(info, 0, 0); |
| 76 | scene = new Scene(root, 550, 60); |
| 77 | |
| 78 | root.getChildren().addAll(basePane); |
| 79 | primaryStage.setTitle(Title); |
| 80 | primaryStage.setScene(scene); |
| 81 | primaryStage.show(); |
| 82 | } |
| 83 | |
| 84 | public void closeWindow(){ |
| 85 | copyStage.close(); |
| 86 | } |
| 87 | public void setValue(String value){ |
| 88 | enteredValue = value; |
| 89 | } |
| 90 | public String getValue(){ |
| 91 | return enteredValue; |
| 92 | } |
| 93 | |
| 94 | public void setTitles(String title){ |
| 95 | copyStage.setTitle(title); |
| 96 | } |
| 97 | |
| 98 | } |