List of usage examples for javafx.stage Modality NONE
Modality NONE
To view the source code for javafx.stage Modality NONE.
Click Source Link
From source file:genrsa.GenRSAController.java
/** * Mtodo usado para cargar la ventana de ataque por la paradoja del cumpleaos * @param event /*from w w w .j a v a 2 s . co m*/ */ public void Paradox(ActionEvent event) { FXMLLoader fxmlLoader; Parent root; try { secondStage = new Stage(); fxmlLoader = new FXMLLoader(getClass().getResource("/Paradox/Paradox.fxml")); root = fxmlLoader.load(); ParadoxController paradoxController = fxmlLoader.<ParadoxController>getController(); paradoxController.setRadix(this.radix); if (this.RSA != null) { paradoxController.getModulus().setText(this.RSA.getN().toString(this.radix).toUpperCase()); paradoxController.getExponent().setText(this.RSA.getE().toString(this.radix).toUpperCase()); } else { paradoxController.setFirstTime(false); } disableOnProgress(true); Scene scene = new Scene(root); secondStage.initModality(Modality.NONE); secondStage.getIcons() .add(new Image(GenRSAController.class.getResourceAsStream("/allImages/genRSA.png"))); secondStage.setTitle("genRSA - Ataque por la Paradoja del Cumpleaos"); secondStage.setScene(scene); secondStage.show(); secondStage.setOnCloseRequest(closeEvent -> { paradoxController.getParadoxAttack().setIsCancelled(true); this.disableOnProgress(false); this.disableButtons(); }); } catch (IOException ex) { //no pongo mensaje de error, porque no se puede dar el caso } }
From source file:investiagenofx2.view.InvestiaGenOFXController.java
private void showInvestmentsSummary(String accountType, Double x, Double y) { try {// www . ja va2s .c om FXMLLoader loader = new FXMLLoader(); loader.setLocation(InvestiaGenOFX.class.getResource("view/investmentsSummary.fxml")); AnchorPane page = (AnchorPane) loader.load(); Stage dialogStage = new Stage(); dialogStage.setTitle("Sommaire des Investissements " + accountType); dialogStage.getIcons().add(new Image("/myIcons/Teddy-Bear-Sick-icon.png")); dialogStage.initModality(Modality.NONE); Scene scene = new Scene(page); dialogStage.initOwner(InvestiaGenOFX.getPrimaryStage()); dialogStage.setX(x); dialogStage.setY(y); dialogStage.setScene(scene); dialogStage.show(); } catch (Exception ex) { Logger.getLogger(InvestiaGenOFXController.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:genrsa.GenRSAController.java
/** * Mtodo usado para cargar la ventana de Cifra * @param event // w w w . j a v a2 s. c o m */ public void DeCipher(ActionEvent event) { FXMLLoader fxmlLoader; Parent root; int iterator; try { secondStage = new Stage(); fxmlLoader = new FXMLLoader(getClass().getResource("/DeCipher/DeCipher.fxml")); root = fxmlLoader.load(); DeCipherController DeCipherCtr = fxmlLoader.<DeCipherController>getController(); DeCipherCtr.setPubKeyBI(this.RSA.getE()); DeCipherCtr.setModulusBI(this.RSA.getN()); DeCipherCtr.setRadix(this.radix); //parte grfica DeCipherCtr.getModulus().setText( this.utilidades.putPoints(this.RSA.getN().toString(this.radix).toUpperCase(), this.radix)); DeCipherCtr.getPubKey().setText( this.utilidades.putPoints(this.RSA.getE().toString(this.radix).toUpperCase(), this.radix)); DeCipherCtr.getModulus1().setText( this.utilidades.putPoints(this.RSA.getN().toString(this.radix).toUpperCase(), this.radix)); //obtengo todas las claves privadas parejas String[] PPK = this.claves_parejas.getText().split("\n"); //las meto en el comboBox ComboBox comboBox = DeCipherCtr.getPrivKeys(); comboBox.getItems().add("Clave Privada"); comboBox.getItems() .add(this.utilidades.putPoints(this.RSA.getD().toString(this.radix).toUpperCase(), this.radix)); comboBox.getItems().add("Claves Privadas Parejas"); for (iterator = 0; iterator < PPK.length; iterator++) { comboBox.getItems().add(PPK[iterator]); } comboBox.setValue( this.utilidades.putPoints(this.RSA.getD().toString(this.radix).toUpperCase(), this.radix)); comboBox.setVisibleRowCount(7); disableOnProgress(true); Scene scene = new Scene(root); secondStage.initModality(Modality.NONE); secondStage.getIcons() .add(new Image(GenRSAController.class.getResourceAsStream("/allImages/genRSA.png"))); secondStage.setTitle("genRSA - Cifrado y Descifrado"); secondStage.setScene(scene); secondStage.show(); secondStage.setOnCloseRequest(closeEvent -> { this.disableOnProgress(false); this.disableButtons(); }); } catch (IOException ex) { //no pongo mensaje de error, porque no se puede dar el caso } }
From source file:gov.va.isaac.gui.refexViews.refexEdit.AddRefexPopup.java
/** * Call setReferencedComponent first/* w w w . j a v a 2 s . c om*/ * * @see gov.va.isaac.interfaces.gui.views.PopupViewI#showView(javafx.stage.Window) */ @Override public void showView(Window parent) { if (createRefexFocus_ == null && editRefex_ == null) { throw new RunLevelException("referenced component nid must be set first"); } setTitle("Create new Sememe"); setResizable(true); initOwner(parent); initModality(Modality.NONE); initStyle(StageStyle.DECORATED); setWidth(600); setHeight(400); show(); }
From source file:genrsa.GenRSAController.java
/** * Mtodo usado para cargar la ventana de Firma * @param event /*from w w w. j ava 2s. c o m*/ */ public void Sign(ActionEvent event) { FXMLLoader fxmlLoader; Parent root; int iterator; try { secondStage = new Stage(); fxmlLoader = new FXMLLoader(getClass().getResource("/Sign/Sign.fxml")); root = fxmlLoader.load(); SignController SignCtr = fxmlLoader.<SignController>getController(); SignCtr.setPubKeyBI(this.RSA.getE()); SignCtr.setModulusBI(this.RSA.getN()); SignCtr.setRadix(this.radix); //parte grfica SignCtr.getModulus().setText( this.utilidades.putPoints(this.RSA.getN().toString(this.radix).toUpperCase(), this.radix)); SignCtr.getPubKey().setText( this.utilidades.putPoints(this.RSA.getE().toString(this.radix).toUpperCase(), this.radix)); SignCtr.getModulus1().setText( this.utilidades.putPoints(this.RSA.getN().toString(this.radix).toUpperCase(), this.radix)); //obtengo todas las claves privadas parejas String[] PPK = this.claves_parejas.getText().split("\n"); //quito la informacion acerca de los bits "--> XXbits" //las meto en el comboBox ComboBox comboBox = SignCtr.getPrivKeys(); comboBox.getItems().add("Clave Privada"); comboBox.getItems() .add(this.utilidades.putPoints(this.RSA.getD().toString(this.radix).toUpperCase(), this.radix)); comboBox.getItems().add("Claves Privadas Parejas"); for (iterator = 0; iterator < PPK.length; iterator++) { comboBox.getItems().add(PPK[iterator]); } comboBox.setValue( this.utilidades.putPoints(this.RSA.getD().toString(this.radix).toUpperCase(), this.radix)); comboBox.setVisibleRowCount(7); disableOnProgress(true); Scene scene = new Scene(root); secondStage.initModality(Modality.NONE); secondStage.getIcons() .add(new Image(GenRSAController.class.getResourceAsStream("/allImages/genRSA.png"))); secondStage.setTitle("genRSA - Firma y Validacin"); secondStage.setScene(scene); secondStage.show(); secondStage.setOnCloseRequest(closeEvent -> { this.disableOnProgress(false); this.disableButtons(); }); } catch (IOException ex) { //no pongo mensaje de error, porque no se puede dar el caso } }
From source file:fr.amap.lidar.amapvox.gui.MainFrameController.java
@FXML private void onActionButtonGetBoundingBox(ActionEvent event) { Mat4D vopMatrixTmp = MatrixUtility.convertMatrix4dToMat4D(vopMatrix); if (vopMatrixTmp == null && checkboxUseVopMatrix.isSelected()) { vopMatrixTmp = Mat4D.identity(); }//from www. j a v a 2 s . c o m final Mat4D transfMatrix = vopMatrixTmp; ObservableList<Node> children = vBoxPointCloudFiltering.getChildren(); final List<PointCloudFilterPaneComponent> tempList = new ArrayList<>(); for (Node n : children) { if (n instanceof PointCloudFilterPaneComponent) { PointCloudFilterPaneComponent comp = (PointCloudFilterPaneComponent) n; tempList.add(comp); } } Service<Void> service = new Service<Void>() { @Override protected Task<Void> createTask() { return new Task<Void>() { @Override protected Void call() throws InterruptedException { final BoundingBox3F boundingBox = new BoundingBox3F(); int count = 0; for (PointCloudFilterPaneComponent pane : tempList) { if (pane.getComboboxPointCloudFilteringType().getSelectionModel() .getSelectedIndex() == 0) { CSVFile file = pane.getCsvFile(); if (Files.exists(file.toPath()) && file.isFile()) { PointCloud pc = new PointCloud(); try { pc.readFromFile(file, transfMatrix); } catch (IOException ex) { } BoundingBox3F boundingBox2; if (count == 0) { boundingBox2 = pc.getBoundingBox(); boundingBox.min = boundingBox2.min; boundingBox.max = boundingBox2.max; } else { boundingBox2 = pc.getBoundingBox(); boundingBox.keepLargest(boundingBox2); } count++; } } } Platform.runLater(new Runnable() { @Override public void run() { Alert alert = new Alert(AlertType.CONFIRMATION); alert.setTitle("Information"); alert.setHeaderText("Bounding box:"); alert.setContentText("Minimum: " + "x: " + boundingBox.min.x + " y: " + boundingBox.min.y + " z: " + boundingBox.min.z + "\n" + "Maximum: " + "x: " + boundingBox.max.x + " y: " + boundingBox.max.y + " z: " + boundingBox.max.z + "\n\n" + "Use for voxel space bounding-box?"); alert.initModality(Modality.NONE); Optional<ButtonType> answer = alert.showAndWait(); if (answer.get() == ButtonType.OK) { voxelSpacePanelVoxelizationController.getTextFieldEnterXMin() .setText(String.valueOf(boundingBox.min.x)); voxelSpacePanelVoxelizationController.getTextFieldEnterYMin() .setText(String.valueOf(boundingBox.min.y)); voxelSpacePanelVoxelizationController.getTextFieldEnterZMin() .setText(String.valueOf(boundingBox.min.z)); voxelSpacePanelVoxelizationController.getTextFieldEnterXMax() .setText(String.valueOf(boundingBox.max.x)); voxelSpacePanelVoxelizationController.getTextFieldEnterYMax() .setText(String.valueOf(boundingBox.max.y)); voxelSpacePanelVoxelizationController.getTextFieldEnterZMax() .setText(String.valueOf(boundingBox.max.z)); } } }); return null; } }; } }; ProgressDialog d = new ProgressDialog(service); d.initOwner(stage); d.show(); service.start(); }
From source file:net.thirdy.blackmarket.controls.LadderHitsDialog.java
public LadderHitsDialog(ExileToolsHit item) { super(AlertType.INFORMATION); String title = item.getShop().getSellerAccount() + (StringUtils.isBlank(item.getShop().getSellerIGN()) ? LangContants.STRING_EMPTY : (" - " + item.getShop().getSellerIGN())); setTitle(title);/*www . j a v a 2 s . com*/ setHeaderText(""); setGraphic(null); String json = item.getLadderHit().toString(); TextArea textArea = new TextArea(json); textArea.setEditable(true); textArea.setWrapText(false); textArea.setMaxWidth(Double.MAX_VALUE); textArea.setMinHeight(400); getDialogPane().setContent(textArea); initModality(Modality.NONE); }
From source file:snpviewer.SnpViewer.java
private void zoomRegion(Rectangle rectangle) { try {// w w w . j a va2 s . co m FXMLLoader loader = new FXMLLoader(getClass().getResource("ZoomRegionView.fxml")); ChromosomeLength chromLength = new ChromosomeLength(genomeVersion); String currentChrom = (String) chromosomeBoxList[chromosomeSelector.getSelectionModel() .getSelectedIndex()]; double startCoordinate = chromLength.getLength(currentChrom) / selectionOverlayPane.getWidth() * rectangle.getX(); double selectionWidth = chromLength.getLength(currentChrom) / selectionOverlayPane.getWidth() * rectangle.getWidth(); if (rectangle.getX() == 0) { startCoordinate = 1; } Pane page = (Pane) loader.load(); Scene scene = new Scene(page); Stage stage = new Stage(); stage.setScene(scene); stage.setTitle("chr" + currentChrom + ":" + nf.format(startCoordinate) + "-" + nf.format(startCoordinate + selectionWidth)); scene.getStylesheets().add(SnpViewer.class.getResource("SnpViewerStyleSheet.css").toExternalForm()); String subPath = "zoom"; stage.initModality(Modality.NONE); stage.getIcons().add(new Image(this.getClass().getResourceAsStream("icon.png"))); stage.show(); ZoomRegionViewController zoomController = (ZoomRegionViewController) loader.getController(); ArrayList<SnpFile> bothFiles = new ArrayList<>(); bothFiles.addAll(affFiles); bothFiles.addAll(unFiles); ArrayList<Pane> zoomPanes = zoomController.setPanes(bothFiles); zoomController.setParentController(this); zoomController.setLoadingRectangle(rectangle); zoomController.setRegionLength(selectionWidth); zoomController.setRegionStart(startCoordinate); zoomController.setChromosome(currentChrom); SplitPane zoomSplit = zoomController.getSplitPane(); Iterator<SnpFile> sIter = bothFiles.iterator(); Iterator<Pane> pIter = zoomPanes.iterator(); if (!sIter.hasNext() || !pIter.hasNext()) { return; } SnpFile firstFile = sIter.next(); Pane firstPane = pIter.next(); drawCoordinatesWithIterator(firstFile, firstPane, subPath, sIter, pIter, 1, bothFiles.size(), currentChrom, startCoordinate, startCoordinate + selectionWidth, true, zoomSplit); zoomController.tidyPanes(); } catch (ChromosomeLength.ChromosomeLengthException | IOException ex) { Dialogs.showErrorDialog(null, "Please see details for stack trace.", "Error displaying zoomed region", "SnpViewer", ex); } }
From source file:snpviewer.SnpViewer.java
public void showSavedRegionsTable() { if (savedRegions.size() > 0) { FXMLLoader tableLoader = new FXMLLoader(getClass().getResource("MultiRegionReporter.fxml")); try {/*w w w .j a v a 2 s . c om*/ Pane tablePane = (Pane) tableLoader.load(); MultiRegionReporterController multiReg = (MultiRegionReporterController) tableLoader .getController(); Scene tableScene = new Scene(tablePane); Stage tableStage = new Stage(); tableStage.setScene(tableScene); tableScene.getStylesheets() .add(SnpViewer.class.getResource("SnpViewerStyleSheet.css").toExternalForm()); tableStage.getIcons().add(new Image(this.getClass().getResourceAsStream("icon.png"))); multiReg.displayData(savedRegions); tableStage.setTitle("Saved Regions"); tableStage.initModality(Modality.NONE); tableStage.show(); } catch (Exception ex) { Dialogs.showErrorDialog(null, "Error displaying" + " Saved Regions - see Details for stack trace.", "Saved Regions Display Error!", "SnpViewer", ex); } } else { Dialogs.showInformationDialog(null, "No regions " + "found.", "Saved Regions", "SnpViewer"); } }
From source file:snpviewer.SnpViewer.java
public void displayFlankingSnpIDs(final String chrom, final double start, final double end) { final Task<List<String>> displayTask = new Task<List<String>>() { @Override// ww w .j a v a 2 s. co m protected List<String> call() { updateProgress(-1, -1); updateTitle("Finding flanking SNPs"); updateMessage("Searching for nearest SNP in all files..."); //work out coordinates based on chromosome and pane sizes /* read SnpFiles to find closest SNPs - use binary search * to find nearby SNP and refine to closest */ List<SnpFile.SnpLine> startAndEndSnps = searchCoordinate(chrom, (int) start, (int) end); if (startAndEndSnps == null) { //DISPLAY ERROR HERE? return null; } String coordResult = "chr" + chrom + ":" + nf.format(startAndEndSnps.get(0).getPosition()) + "-" + nf.format(startAndEndSnps.get(1).getPosition()); String idResult = startAndEndSnps.get(0).getId() + ";" + startAndEndSnps.get(1).getId(); List<String> result = new ArrayList(); result.add(coordResult); result.add(idResult); return result; } }; setProgressMode(true); progressBar.progressProperty().bind(displayTask.progressProperty()); progressMessage.textProperty().unbind(); progressMessage.textProperty().bind(displayTask.messageProperty()); progressTitle.textProperty().unbind(); progressTitle.textProperty().bind(displayTask.titleProperty()); displayTask.setOnSucceeded(new EventHandler<WorkerStateEvent>() { @Override public void handle(WorkerStateEvent e) { setProgressMode(false); progressBar.progressProperty().unbind(); progressBar.progressProperty().set(0); progressTitle.textProperty().unbind(); progressMessage.textProperty().unbind(); progressTitle.setText(""); progressMessage.setText(""); } }); displayTask.setOnFailed(new EventHandler<WorkerStateEvent>() { @Override public void handle(WorkerStateEvent e) { setProgressMode(false); progressBar.progressProperty().unbind(); progressBar.progressProperty().set(0); progressTitle.textProperty().unbind(); progressMessage.textProperty().unbind(); progressTitle.setText(""); progressMessage.setText(""); Dialogs.showErrorDialog(null, "Error displaying flanking SNPs\n", "Display error", "SNP Viewer", displayTask.getException()); } }); displayTask.setOnCancelled(new EventHandler<WorkerStateEvent>() { @Override public void handle(WorkerStateEvent e) { progressMessage.setText("Display flanking SNPs cancelled"); setProgressMode(false); progressBar.progressProperty().unbind(); progressBar.progressProperty().set(0); progressTitle.textProperty().unbind(); progressMessage.textProperty().unbind(); progressTitle.setText(""); progressMessage.setText(""); Dialogs.showErrorDialog(null, "User cancelled display.", "Display error", "SNP Viewer", displayTask.getException()); } }); cancelButton.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent actionEvent) { displayTask.cancel(); } }); new Thread(displayTask).start(); try { List<String> result = displayTask.get(); FXMLLoader loader = new FXMLLoader(getClass().getResource("RegionReporter.fxml")); Stage stage = new Stage(); Pane page = (Pane) loader.load(); Scene scene = new Scene(page); stage.setScene(scene); stage.setTitle("SNP Viewer Region Summary"); stage.getIcons().add(new Image(this.getClass().getResourceAsStream("icon.png"))); RegionReporterController regionReporter = loader.<RegionReporterController>getController(); if (result == null) { regionReporter.setCoordinates("Error!"); regionReporter.setIds("Error!"); } else { regionReporter.setCoordinates(result.get(0)); regionReporter.setIds(result.get(1)); } scene.getStylesheets().add(SnpViewer.class.getResource("SnpViewerStyleSheet.css").toExternalForm()); stage.setResizable(false); stage.initModality(Modality.NONE); stage.show(); } catch (InterruptedException | ExecutionException | IOException ex) { Dialogs.showErrorDialog(null, "Can't display flanking SNP IDs" + " - exception caught!\n\nPlease report this error.", "Error!", "SNP Viewer", ex); } }