-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui for prestage upload in seagrid-rich-client
- Loading branch information
pkmsoftpro
committed
Sep 15, 2018
1 parent
f5c8f7a
commit 6eaf83a
Showing
5 changed files
with
183 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
src/main/java/org/seagrid/desktop/ui/prestageupload/PrestageUploadWindow.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
*/ | ||
package org.seagrid.desktop.ui.prestageupload; | ||
|
||
import javafx.application.Application; | ||
import javafx.fxml.FXMLLoader; | ||
import javafx.scene.Parent; | ||
import javafx.scene.Scene; | ||
import javafx.stage.Modality; | ||
import javafx.stage.Stage; | ||
import org.seagrid.desktop.ui.experiment.create.ExperimentCreateWindow; | ||
import org.seagrid.desktop.ui.prestageupload.controller.PrestageUploadController; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.io.IOException; | ||
|
||
public class PrestageUploadWindow extends Application{ | ||
private final static Logger logger = LoggerFactory.getLogger(PrestageUploadWindow.class); | ||
|
||
private static Stage createPrimaryStage; | ||
|
||
@Override | ||
public void start(Stage primaryStage) throws Exception { | ||
Parent root = FXMLLoader.load(getClass().getResource("/views/prestageupload/upload-files.fxml")); | ||
primaryStage.setTitle("SEAGrid Desktop Client - Prestage Upload"); | ||
primaryStage.setScene(new Scene(root, 400, 150)); | ||
primaryStage.show(); | ||
} | ||
|
||
public static void displayUploadFiles() throws IOException { | ||
if(createPrimaryStage == null || !createPrimaryStage.isShowing()) { | ||
createPrimaryStage = new Stage(); | ||
FXMLLoader loader = new FXMLLoader(ExperimentCreateWindow.class.getResource( | ||
"/views/prestageupload/upload-files.fxml")); | ||
Parent root = loader.load(); | ||
createPrimaryStage.setTitle("SEAGrid Desktop Client - Prestage Upload"); | ||
createPrimaryStage.setScene(new Scene(root, 400, 150)); | ||
createPrimaryStage.initModality(Modality.WINDOW_MODAL); | ||
createPrimaryStage.show(); | ||
} | ||
createPrimaryStage.requestFocus(); | ||
} | ||
|
||
public static void main(String[] args) { | ||
launch(args); | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
src/main/java/org/seagrid/desktop/ui/prestageupload/controller/PrestageUploadController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
*/ | ||
package org.seagrid.desktop.ui.prestageupload.controller; | ||
|
||
import javafx.fxml.FXML; | ||
import javafx.scene.control.Button; | ||
import javafx.scene.layout.GridPane; | ||
import javafx.stage.FileChooser; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.io.File; | ||
|
||
public class PrestageUploadController { | ||
private final static Logger logger = LoggerFactory.getLogger(PrestageUploadController.class); | ||
|
||
@FXML | ||
private Button pickFile; | ||
|
||
@FXML | ||
private Button saveButton; | ||
|
||
private FileChooser fileChooser; | ||
|
||
@FXML | ||
public GridPane preuploadGridPane; | ||
|
||
@FXML | ||
public void initialize() { | ||
|
||
pickFile.setOnAction(event -> { | ||
fileChooser = new FileChooser(); | ||
fileChooser.setTitle("Open Resource File"); | ||
File selectedFiles = fileChooser.showOpenDialog(null); | ||
}); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.geometry.Insets?> | ||
<?import javafx.scene.control.Button?> | ||
<?import javafx.scene.control.Label?> | ||
<?import javafx.scene.layout.*?> | ||
<StackPane prefWidth="350.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="org.seagrid.desktop.ui.prestageupload.controller.PrestageUploadController"> | ||
<children> | ||
<StackPane> | ||
<children> | ||
<VBox spacing="10.0"> | ||
<children> | ||
<GridPane fx:id="preuploadGridPane" prefHeight="120.0" prefWidth="250.0"> | ||
<children> | ||
<Label text="Select File" GridPane.columnIndex="0" GridPane.rowIndex="0" /> | ||
<Button fx:id="pickFile" mnemonicParsing="false" text="Upload" GridPane.columnIndex="1" | ||
GridPane.rowIndex="0" onAction="#initialize"> | ||
|
||
</Button> | ||
</children> | ||
<columnConstraints> | ||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="148.0" minWidth="10.0" prefWidth="109.0" /> | ||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="228.0" minWidth="10.0" prefWidth="189.0" /> | ||
</columnConstraints> | ||
<rowConstraints> | ||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | ||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | ||
</rowConstraints> | ||
</GridPane> | ||
<StackPane prefHeight="-1.0" prefWidth="-1.0"> | ||
<children> | ||
<Button fx:id="saveButton" alignment="BOTTOM_LEFT" defaultButton="true" mnemonicParsing="false" text="Save" StackPane.alignment="BOTTOM_LEFT" /> | ||
</children> | ||
</StackPane> | ||
</children> | ||
</VBox> | ||
</children> | ||
</StackPane> | ||
</children> | ||
<padding> | ||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> | ||
</padding> | ||
</StackPane> |