List of usage examples for javafx.scene.control ButtonType CANCEL
ButtonType CANCEL
To view the source code for javafx.scene.control ButtonType CANCEL.
Click Source Link
From source file:acmi.l2.clientmod.l2smr.Controller.java
@FXML private void modify() { ModifyDialog modifyDialog = new ModifyDialog(); if (ButtonType.OK == modifyDialog.showAndWait().orElse(ButtonType.CANCEL)) { Collection<Actor> selected = this.table.getSelectionModel().getSelectedItems(); selected.forEach(modifyDialog.getTransform()); updateSMAPane();/*from ww w .j a va 2 s . c o m*/ try (UnrealPackage up = new UnrealPackage( new File(getMapsDir(), this.unrChooser.getSelectionModel().getSelectedItem()), false)) { for (Actor actor : selected) { UnrealPackage.ExportEntry entry = up.getExportTable().get(actor.getInd()); byte[] raw = entry.getObjectRawData(); Offsets offsets = actor.getOffsets(); StaticMeshActorUtil.setLocation(raw, offsets, actor.getX(), actor.getY(), actor.getZ()); entry.setObjectRawData(raw); } } catch (UncheckedIOException e) { onException("Staticmesh modify failed", e); } } }
From source file:fr.amap.lidar.amapvox.gui.MainFrameController.java
public TaskElement addFileToTaskList(final File file) { ObservableList<TaskElement> taskElements = listViewTaskList.getItems(); int idxCfgToReplace = -1; //don't add the task if it is already inside the task list int index = 0; for (TaskElement taskElement : taskElements) { if (file.equals(taskElement.getLinkedFile())) { idxCfgToReplace = index;//from w w w . j av a2s .c o m break; } index++; } //get the task type String type; try { type = Configuration.readType(file); } catch (JDOMException | IOException ex) { showErrorDialog(ex); return null; } TaskElement element = null; switch (type) { case "voxelisation-ALS": element = new TaskElement(file, new ServiceProvider() { @Override public Service provide() { return new ALSVoxelizationService(file); } }); //element = new TaskElement(s, file); element.setTaskIcon(TaskElement.VOXELIZATION_IMG); element.addTaskListener(new TaskAdapter() { @Override public void onSucceeded(Service service) { Platform.runLater(new Runnable() { @Override public void run() { File outputFile = ((ALSVoxelizationService) service).getValue(); if (outputFile != null) { addFileToProductsList(outputFile); } } }); } }); break; case "voxelisation-TLS": final TLSVoxCfg tLSVoxCfg = new TLSVoxCfg(); try { tLSVoxCfg.readConfiguration(file); } catch (Exception ex) { showErrorDialog(ex); return null; } switch (tLSVoxCfg.getInputType()) { case RSP_PROJECT: element = new TaskElement(file, new ServiceProvider() { @Override public Service provide() { if (tlsVoxNbThreads == -1) { return new RSPVoxelizationService(file, (int) sliderRSPCoresToUse.getValue()); } else { return new RSPVoxelizationService(file, tlsVoxNbThreads); } } }); element.setTaskIcon(TaskElement.VOXELIZATION_IMG); element.addTaskListener(new TaskAdapter() { @Override public void onSucceeded(Service service) { Platform.runLater(new Runnable() { @Override public void run() { List<File> voxFiles = ((RSPVoxelizationService) service).getValue(); for (File voxFile : voxFiles) { addFileToProductsList(voxFile); } } }); } }); break; case RXP_SCAN: element = new TaskElement(file, new ServiceProvider() { @Override public Service provide() { return new RXPVoxelizationService(file); } }); element.setTaskIcon(TaskElement.VOXELIZATION_IMG); element.addTaskListener(new TaskAdapter() { @Override public void onSucceeded(Service service) { Platform.runLater(new Runnable() { @Override public void run() { addFileToProductsList(tLSVoxCfg.getOutputFile()); } }); } }); break; case PTG_PROJECT: element = new TaskElement(file, new ServiceProvider() { @Override public Service provide() { if (tlsVoxNbThreads == -1) { return new PTGVoxelizationService(file, (int) sliderRSPCoresToUse.getValue()); } else { return new PTGVoxelizationService(file, tlsVoxNbThreads); } } }); element.setTaskIcon(TaskElement.VOXELIZATION_IMG); element.addTaskListener(new TaskAdapter() { @Override public void onSucceeded(Service service) { Platform.runLater(new Runnable() { @Override public void run() { List<File> voxFiles = ((PTGVoxelizationService) service).getValue(); for (File voxFile : voxFiles) { addFileToProductsList(voxFile); } } }); } }); break; case PTX_PROJECT: element = new TaskElement(file, new ServiceProvider() { @Override public Service provide() { if (tlsVoxNbThreads == -1) { return new PTXVoxelizationService(file, (int) sliderRSPCoresToUse.getValue()); } else { return new PTXVoxelizationService(file, tlsVoxNbThreads); } } }); element.setTaskIcon(TaskElement.VOXELIZATION_IMG); element.addTaskListener(new TaskAdapter() { @Override public void onSucceeded(Service service) { Platform.runLater(new Runnable() { @Override public void run() { List<File> voxFiles = ((PTXVoxelizationService) service).getValue(); for (File voxFile : voxFiles) { addFileToProductsList(voxFile); } } }); } }); break; } break; case "transmittance": /*TransmittanceCfg transCfg = new TransmittanceCfg(new TransmittanceParameters()); try { transCfg.readConfiguration(file); } catch (JDOMException | IOException ex) { showErrorDialog(ex); return null; }*/ element = new TaskElement(file, new ServiceProvider() { @Override public Service provide() { return new TransmittanceSimService(file); } }); element.setTaskIcon(TaskElement.TRANSMITTANCE_IMG); element.addTaskListener(new TaskAdapter() { @Override public void onSucceeded(Service service) { Platform.runLater(new Runnable() { @Override public void run() { //if(transCfg.getParameters().isGenerateBitmapFile()){ List<File> bitmapFiles = ((TransmittanceSimService) service).getValue() .getOutputBitmapFiles(); if (bitmapFiles != null) { for (File file : bitmapFiles) { addFileToProductsList(file); } } //} } }); } }); break; case "LAI2000": case "LAI2200": element = new TaskElement(file, new ServiceProvider() { @Override public Service provide() { return new Lai2xxxSimService(file); } }); element.setTaskIcon(TaskElement.CANOPEE_ANALYZER_IMG); break; case "Hemi-Photo": element = new TaskElement(file, new ServiceProvider() { @Override public Service provide() { return new HemiPhotoSimService(file); } }); element.setTaskIcon(TaskElement.HEMI_IMG); element.addTaskListener(new TaskAdapter() { @Override public void onSucceeded(Service service) { Platform.runLater(new Runnable() { @Override public void run() { File outputFile = ((HemiPhotoSimService) service).getValue(); if (outputFile != null) { addFileToProductsList(outputFile); } } }); } }); break; case "merging": element = new TaskElement(file, new ServiceProvider() { @Override public Service provide() { return new VoxFileMergingService(file); } }); element.setTaskIcon(TaskElement.MISC_IMG); element.addTaskListener(new TaskAdapter() { @Override public void onSucceeded(Service service) { Platform.runLater(new Runnable() { @Override public void run() { File outputFile = ((VoxFileMergingService) service).getValue(); if (outputFile != null) { addFileToProductsList(outputFile); } } }); } }); break; case "butterfly-removing": element = new TaskElement(file, new ServiceProvider() { @Override public Service provide() { return new ButterflyRemoverService(file); } }); element.setTaskIcon(TaskElement.MISC_IMG); element.addTaskListener(new TaskAdapter() { @Override public void onSucceeded(Service service) { Platform.runLater(new Runnable() { @Override public void run() { File outputFile = ((ButterflyRemoverService) service).getValue(); if (outputFile != null) { addFileToProductsList(outputFile); } } }); } }); break; } if (element != null) { if (idxCfgToReplace != -1) { if (listViewTaskList.getItems().get(idxCfgToReplace) .getButtonType() == TaskElement.ButtonType.CANCEL) { Alert alert = new Alert(AlertType.WARNING); alert.setContentText("This task is currently running, cancel the operation first."); alert.show(); } else { listViewTaskList.getItems().set(idxCfgToReplace, element); } } else { listViewTaskList.getItems().add(element); } element.addTaskListener(new TaskAdapter() { @Override public void onFailed(Exception ex) { showErrorDialog(ex); } }); } return element; }
From source file:fr.amap.lidar.amapvox.gui.MainFrameController.java
@FXML private void onActionButtonLoadSelectedTask(ActionEvent event) { File selectedFile = listViewTaskList.getSelectionModel().getSelectedItem().getLinkedFile(); if (selectedFile != null) { try {/*from w w w.j av a 2s .c om*/ String type = Configuration.readType(selectedFile); MultiResCfg cfg1; if (type.equals("multi-resolutions")) { showErrorDialog(new Exception("This mode is not supported anymore")); } else if (type.equals("Hemi-Photo")) { tabPaneMain.getSelectionModel().select(1); tabPaneVirtualMeasures.getSelectionModel().select(2); HemiPhotoCfg cfg = HemiPhotoCfg.readCfg(selectedFile); HemiParameters hemiParameters = cfg.getParameters(); switch (hemiParameters.getMode()) { case ECHOS: listViewHemiPhotoScans.getItems().setAll(hemiParameters.getRxpScansList()); break; case PAD: textfieldVoxelFilePathHemiPhoto.setText(hemiParameters.getVoxelFile().getAbsolutePath()); listViewHemiPhotoSensorPositions.getItems().setAll(hemiParameters.getSensorPositions()); break; } textfieldPixelNumber.setText(String.valueOf(hemiParameters.getPixelNumber())); textfieldAzimutsNumber.setText(String.valueOf(hemiParameters.getAzimutsNumber())); textfieldZenithsNumber.setText(String.valueOf(hemiParameters.getZenithsNumber())); checkboxGenerateSectorsTextFileHemiPhoto.setSelected(hemiParameters.isGenerateTextFile()); if (hemiParameters.isGenerateTextFile()) { textfieldHemiPhotoOutputTextFile .setText(hemiParameters.getOutputTextFile().getAbsolutePath()); } checkboxHemiPhotoGenerateBitmapFile.setSelected(hemiParameters.isGenerateBitmapFile()); if (hemiParameters.isGenerateBitmapFile()) { comboboxHemiPhotoBitmapOutputMode.getSelectionModel() .select(hemiParameters.getBitmapMode().getMode()); textfieldHemiPhotoOutputBitmapFile .setText(hemiParameters.getOutputBitmapFile().getAbsolutePath()); } } else if (type.equals("transmittance") || type.equals("LAI2000") || type.equals("LAI2200")) { tabPaneMain.getSelectionModel().select(1); TransmittanceCfg cfg = TransmittanceCfg.readCfg(selectedFile); //cfg.readConfiguration(selectedFile); TransmittanceParameters params = cfg.getParameters(); if (type.equals("transmittance")) { textfieldVoxelFilePathTransmittance.setText(params.getInputFile().getAbsolutePath()); tabPaneVirtualMeasures.getSelectionModel().select(0); comboboxChooseDirectionsNumber.getSelectionModel() .select(new Integer(params.getDirectionsNumber())); textfieldDirectionRotationTransmittanceMap .setText(String.valueOf(params.getDirectionsRotation())); checkboxTransmittanceMapToricity.setSelected(params.isToricity()); checkboxGenerateBitmapFile.setSelected(params.isGenerateBitmapFile()); if (params.isGenerateBitmapFile() && params.getBitmapFile() != null) { textfieldOutputBitmapFilePath.setText(params.getBitmapFile().getAbsolutePath()); } checkboxGenerateTextFile.setSelected(params.isGenerateTextFile()); if (params.isGenerateTextFile() && params.getTextFile() != null) { textfieldOutputTextFilePath.setText(params.getTextFile().getAbsolutePath()); } if (params.getPositions() != null) { listViewTransmittanceMapSensorPositions.getItems().setAll(params.getPositions()); } textfieldLatitudeRadians.setText(String.valueOf(params.getLatitudeInDegrees())); data.clear(); List<SimulationPeriod> simulationPeriods = params.getSimulationPeriods(); if (simulationPeriods != null) { data.addAll(simulationPeriods); } } else { textfieldVoxelFilePathCanopyAnalyzer.setText(params.getInputFile().getAbsolutePath()); if (type.equals("LAI2000")) { toggleButtonLAI2000Choice.setSelected(true); } else if (type.equals("LAI2200")) { toggleButtonLAI2200Choice.setSelected(true); } tabPaneVirtualMeasures.getSelectionModel().select(1); comboboxChooseCanopyAnalyzerSampling.getSelectionModel() .select(Integer.valueOf(params.getDirectionsNumber())); boolean[] masks = params.getMasks(); if (masks != null && masks.length == 5) { toggleButtonCanopyAnalyzerRingMask1.setSelected(masks[0]); toggleButtonCanopyAnalyzerRingMask2.setSelected(masks[1]); toggleButtonCanopyAnalyzerRingMask3.setSelected(masks[2]); toggleButtonCanopyAnalyzerRingMask4.setSelected(masks[3]); toggleButtonCanopyAnalyzerRingMask5.setSelected(masks[4]); } checkboxGenerateLAI2xxxFormat.setSelected(params.isGenerateLAI2xxxTypeFormat()); List<Point3d> positions = params.getPositions(); if (positions != null) { listViewCanopyAnalyzerSensorPositions.getItems().setAll(positions); } checkboxGenerateCanopyAnalyzerTextFile.setSelected(params.isGenerateTextFile()); if (params.isGenerateTextFile() && params.getTextFile() != null) { textfieldOutputCanopyAnalyzerTextFile.setText(params.getTextFile().getAbsolutePath()); } } } else if (type.equals("merging")) { VoxMergingCfg cfg = new VoxMergingCfg(); cfg.readConfiguration(selectedFile); tabPaneVoxelisation.getSelectionModel().select(2); List<File> files = cfg.getFiles(); if (files != null) { listViewProductsFiles.getItems().addAll(files); } textFieldOutputFileMerging.setText(cfg.getOutputFile().getAbsolutePath()); textFieldPADMax.setText(String.valueOf(cfg.getVoxelParameters().infos.getMaxPAD())); } else if (type.equals("voxelisation-ALS") || type.equals("voxelisation-TLS") || type.equals("multi-voxelisation")) { Configuration cfg; if (type.equals("voxelisation-ALS")) { cfg = new ALSVoxCfg(); } else if (type.equals("voxelisation-TLS")) { cfg = new TLSVoxCfg(); } else { cfg = new MultiVoxCfg(); } cfg.readConfiguration(selectedFile); //VoxelisationConfiguration cfg = new VoxelisationConfiguration(); VoxelParameters voxelParameters = ((VoxelAnalysisCfg) cfg).getVoxelParameters(); checkboxWriteShotSegment.setSelected(((VoxelAnalysisCfg) cfg).isExportShotSegment()); LaserSpecification laserSpecification = voxelParameters.getLaserSpecification(); if (laserSpecification != null) { if (laserSpecification.getName().equals("custom")) { checkboxCustomLaserSpecification.setSelected(true); DecimalFormatSymbols symb = new DecimalFormatSymbols(); symb.setDecimalSeparator('.'); DecimalFormat formatter = new DecimalFormat("#####.######", symb); textFieldBeamDiameterAtExit .setText(formatter.format(laserSpecification.getBeamDiameterAtExit())); textFieldBeamDivergence .setText(formatter.format(laserSpecification.getBeamDivergence())); } else { checkboxCustomLaserSpecification.setSelected(false); comboboxLaserSpecification.getSelectionModel().select(laserSpecification); } } textFieldResolution.setText(String.valueOf(voxelParameters.infos.getResolution())); DTMFilteringParams dtmFilteringParams = voxelParameters.getDtmFilteringParams(); if (dtmFilteringParams == null) { dtmFilteringParams = new DTMFilteringParams(); } checkboxUseDTMFilter.setSelected(dtmFilteringParams.useDTMCorrection()); File tmpFile = dtmFilteringParams.getDtmFile(); if (tmpFile != null) { textfieldDTMPath.setText(tmpFile.getAbsolutePath()); textfieldDTMValue.setText(String.valueOf(dtmFilteringParams.getMinDTMDistance())); checkboxApplyVOPMatrix.setSelected(dtmFilteringParams.isUseVOPMatrix()); } checkboxUsePointcloudFilter.setSelected(voxelParameters.isUsePointCloudFilter()); List<PointcloudFilter> pointcloudFilters = voxelParameters.getPointcloudFilters(); if (pointcloudFilters != null) { clearPointcloudFiltersPane(); for (PointcloudFilter filter : pointcloudFilters) { PointCloudFilterPaneComponent pane = addPointcloudFilterComponent(); pane.setCSVFile(filter.getPointcloudFile()); pane.getTextfieldPointCloudErrorMargin() .setText(String.valueOf(filter.getPointcloudErrorMargin())); int index; if (filter.isKeep()) { index = 0; } else { index = 1; } pane.getComboboxPointCloudFilteringType().getSelectionModel().select(index); } } checkboxUsePopMatrix.setSelected(((VoxelAnalysisCfg) cfg).isUsePopMatrix()); checkboxUseSopMatrix.setSelected(((VoxelAnalysisCfg) cfg).isUseSopMatrix()); checkboxUseVopMatrix.setSelected(((VoxelAnalysisCfg) cfg).isUseVopMatrix()); if (type.equals("voxelisation-ALS") || type.equals("multi-voxelisation")) { List<Integer> classifiedPointsToDiscard = ((ALSVoxCfg) cfg).getClassifiedPointsToDiscard(); for (Integer i : classifiedPointsToDiscard) { listviewClassifications.getItems().get(i).setSelected(false); } } else if (type.equals("voxelisation-TLS")) { filteringPaneController.setFilters(((TLSVoxCfg) cfg).getEchoFilters()); checkboxEmptyShotsFilter.setSelected(((TLSVoxCfg) cfg).isEnableEmptyShotsFiltering()); } textFieldPADMax.setText( String.valueOf(((VoxelAnalysisCfg) cfg).getVoxelParameters().infos.getMaxPAD())); popMatrix = ((VoxelAnalysisCfg) cfg).getPopMatrix(); sopMatrix = ((VoxelAnalysisCfg) cfg).getSopMatrix(); vopMatrix = ((VoxelAnalysisCfg) cfg).getVopMatrix(); if (popMatrix == null) { popMatrix = new Matrix4d(); popMatrix.setIdentity(); } if (sopMatrix == null) { sopMatrix = new Matrix4d(); sopMatrix.setIdentity(); } if (vopMatrix == null) { vopMatrix = new Matrix4d(); vopMatrix.setIdentity(); } updateResultMatrix(); List<Filter> filters = ((VoxelAnalysisCfg) cfg).getShotFilters(); if (filters != null) { listviewFilters.getItems().clear(); listviewFilters.getItems().addAll(filters); } if (((VoxelAnalysisCfg) cfg).getVoxelParameters().getEchoesWeightParams() .getWeightingMode() == EchoesWeightParams.WEIGHTING_NONE) { checkboxEnableWeighting.setSelected(false); } else { checkboxEnableWeighting.setSelected(true); fillWeightingData(((VoxelAnalysisCfg) cfg).getVoxelParameters().getEchoesWeightParams() .getWeightingData()); } LADParams ladParameters = voxelParameters.getLadParams(); if (ladParameters == null) { ladParameters = new LADParams(); } comboboxLADChoice.getSelectionModel().select(ladParameters.getLadType()); radiobuttonLADHomogeneous.setSelected(ladParameters.getLadEstimationMode() == 0); textFieldTwoBetaAlphaParameter .setText(String.valueOf(ladParameters.getLadBetaFunctionAlphaParameter())); textFieldTwoBetaBetaParameter .setText(String.valueOf(ladParameters.getLadBetaFunctionBetaParameter())); /*comboboxTransMode.getSelectionModel().select(new Integer(voxelParameters.getTransmittanceMode())); comboboxPathLengthMode.getSelectionModel().select(voxelParameters.getPathLengthMode());*/ if (type.equals("voxelisation-ALS") || type.equals("multi-voxelisation")) { tabPaneVoxelisation.getSelectionModel().select(0); if (((ALSVoxCfg) cfg).getInputType() != SHOTS_FILE) { textFieldTrajectoryFileALS .setText(((ALSVoxCfg) cfg).getTrajectoryFile().getAbsolutePath()); trajectoryFile = ((ALSVoxCfg) cfg).getTrajectoryFile(); } GroundEnergyParams groundEnergyParameters = ((ALSVoxCfg) cfg).getVoxelParameters() .getGroundEnergyParams(); if (groundEnergyParameters == null) { groundEnergyParameters = new GroundEnergyParams(); } checkboxCalculateGroundEnergy.setSelected(groundEnergyParameters.isCalculateGroundEnergy()); if (groundEnergyParameters.getGroundEnergyFile() != null) { comboboxGroundEnergyOutputFormat.getSelectionModel() .select(groundEnergyParameters.getGroundEnergyFileFormat()); textFieldOutputFileGroundEnergy .setText(groundEnergyParameters.getGroundEnergyFile().getAbsolutePath()); } if (type.equals("voxelisation-ALS")) { textFieldInputFileALS.setText(((ALSVoxCfg) cfg).getInputFile().getAbsolutePath()); selectALSInputMode(((ALSVoxCfg) cfg).getInputFile()); textFieldOutputFileALS.setText(((ALSVoxCfg) cfg).getOutputFile().getAbsolutePath()); checkboxMultiResAfterMode2.setSelected( ((ALSVoxCfg) cfg).getVoxelParameters().getNaNsCorrectionParams().isActivate()); textfieldNbSamplingThresholdMultires.setText(String.valueOf(((ALSVoxCfg) cfg) .getVoxelParameters().getNaNsCorrectionParams().getNbSamplingThreshold())); checkboxMultiFiles.setSelected(false); } else if (type.equals("multi-voxelisation")) { List<Input> inputs = ((MultiVoxCfg) cfg).getMultiProcessInputs(); StringBuilder inputFiles = new StringBuilder(); for (Input input : inputs) { inputFiles.append(input.inputFile.getAbsolutePath()).append(";"); } textFieldInputFileALS.setText(inputFiles.toString()); if (inputs.size() > 0) { textFieldOutputFileALS .setText(inputs.get(0).outputFile.getParentFile().getAbsolutePath()); textFieldResolution.setText( String.valueOf(inputs.get(0).voxelParameters.infos.getResolution())); } checkboxMultiFiles.setSelected(true); } } else { tabPaneVoxelisation.getSelectionModel().select(1); textFieldInputFileTLS.setText(((TLSVoxCfg) cfg).getInputFile().getAbsolutePath()); textFieldOutputPathTLS.setText(((TLSVoxCfg) cfg).getOutputFile().getAbsolutePath()); switch (((TLSVoxCfg) cfg).getInputType()) { case RSP_PROJECT: comboboxModeTLS.getSelectionModel().select(1); break; case RXP_SCAN: comboboxModeTLS.getSelectionModel().select(0); break; case POINTS_FILE: comboboxModeTLS.getSelectionModel().select(2); break; case SHOTS_FILE: comboboxModeTLS.getSelectionModel().select(5); break; case PTG_PROJECT: comboboxModeTLS.getSelectionModel().select(3); break; case PTX_PROJECT: comboboxModeTLS.getSelectionModel().select(2); break; } checkboxMergeAfter.setSelected(((TLSVoxCfg) cfg).getVoxelParameters().isMergingAfter()); if (((TLSVoxCfg) cfg).getVoxelParameters().getMergedFile() != null) { textFieldMergedFileName .setText(((TLSVoxCfg) cfg).getVoxelParameters().getMergedFile().getName()); } List<LidarScan> matricesAndFiles = ((TLSVoxCfg) cfg).getLidarScans(); if (matricesAndFiles != null) { items = matricesAndFiles; listviewRxpScans.getItems().setAll(items); } } if (type.equals("voxelisation-ALS") || type.equals("voxelisation-TLS")) { voxelSpacePanelVoxelizationController.getTextFieldEnterXMin() .setText(String.valueOf(voxelParameters.infos.getMinCorner().x)); voxelSpacePanelVoxelizationController.getTextFieldEnterYMin() .setText(String.valueOf(voxelParameters.infos.getMinCorner().y)); voxelSpacePanelVoxelizationController.getTextFieldEnterZMin() .setText(String.valueOf(voxelParameters.infos.getMinCorner().z)); voxelSpacePanelVoxelizationController.getTextFieldEnterXMax() .setText(String.valueOf(voxelParameters.infos.getMaxCorner().x)); voxelSpacePanelVoxelizationController.getTextFieldEnterYMax() .setText(String.valueOf(voxelParameters.infos.getMaxCorner().y)); voxelSpacePanelVoxelizationController.getTextFieldEnterZMax() .setText(String.valueOf(voxelParameters.infos.getMaxCorner().z)); voxelSpacePanelVoxelizationController.getTextFieldXNumber() .setText(String.valueOf(voxelParameters.infos.getSplit().x)); voxelSpacePanelVoxelizationController.getTextFieldYNumber() .setText(String.valueOf(voxelParameters.infos.getSplit().y)); voxelSpacePanelVoxelizationController.getTextFieldZNumber() .setText(String.valueOf(voxelParameters.infos.getSplit().z)); } } } catch (Exception e) { logger.error("Configuration file cannot be load", e); Alert alert = new Alert(AlertType.CONFIRMATION); alert.setHeaderText("Incorrect file"); alert.setContentText("File is corrupted or cannot be read!\n" + "Do you want to keep it?"); Optional<ButtonType> result = alert.showAndWait(); if (result.get() == ButtonType.CANCEL) { listViewTaskList.getItems().remove(selectedFile); } } } }
From source file:fr.amap.lidar.amapvox.gui.MainFrameController.java
private void exportDartMaket(final File voxelFile) { Stage exportDartFrame = new Stage(); DartExporterFrameController controller; Parent root;/*from w ww .j av a 2 s . com*/ if (Util.checkIfVoxelFile(voxelFile)) { try { FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/export/DartExporterDialog.fxml")); root = loader.load(); controller = loader.getController(); controller.setStage(exportDartFrame); controller.setParent(this); controller.setVoxelFile(voxelFile); exportDartFrame.setScene(new Scene(root)); } catch (IOException ex) { logger.error("Cannot load fxml file", ex); } exportDartFrame.show(); } else { logger.error("File is not a voxel file: " + voxelFile.getAbsolutePath()); Alert alert = new Alert(AlertType.CONFIRMATION); alert.setHeaderText("Incorrect file"); alert.setContentText("File is corrupted or cannot be read!\n" + "Do you want to keep it?"); Optional<ButtonType> result = alert.showAndWait(); if (result.get() == ButtonType.CANCEL) { listViewProductsFiles.getItems().remove(voxelFile); } } }
From source file:fr.amap.lidar.amapvox.gui.MainFrameController.java
private void exportDartPlots(final File voxelFile) { if (Util.checkIfVoxelFile(voxelFile)) { fileChooserSaveDartFile.setInitialFileName("plots.xml"); fileChooserSaveDartFile.setInitialDirectory(voxelFile.getParentFile()); final File plotFile = fileChooserSaveDartFile.showSaveDialog(stage); if (plotFile != null) { Alert alert = new Alert(AlertType.CONFIRMATION); alert.setTitle("Coordinate system"); alert.setContentText("Choose your coordinate system"); ButtonType buttonTypeGlobal = new ButtonType("Global"); ButtonType buttonTypeLocal = new ButtonType("Local"); alert.getButtonTypes().setAll(buttonTypeGlobal, buttonTypeLocal); Optional<ButtonType> result = alert.showAndWait(); final boolean global; if (result.get() == buttonTypeGlobal) { global = true;// w ww . j a v a2s . c o m } else if (result.get() == buttonTypeLocal) { global = false; } else { return; } final DartPlotsXMLWriter dartPlotsXML = new DartPlotsXMLWriter(); final Service service = new Service() { @Override protected Task createTask() { return new Task<Object>() { @Override protected Object call() throws Exception { dartPlotsXML.writeFromVoxelFile(voxelFile, plotFile, global); return null; } }; } }; ProgressDialog progressDialog = new ProgressDialog(service); progressDialog.show(); service.start(); Button buttonCancel = new Button("cancel"); progressDialog.setGraphic(buttonCancel); buttonCancel.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { service.cancel(); dartPlotsXML.setCancelled(true); } }); } } else { logger.error("File is not a voxel file: " + voxelFile.getAbsolutePath()); Alert alert = new Alert(AlertType.CONFIRMATION); alert.setHeaderText("Incorrect file"); alert.setContentText("File is corrupted or cannot be read!\n" + "Do you want to keep it?"); Optional<ButtonType> result = alert.showAndWait(); if (result.get() == ButtonType.CANCEL) { listViewProductsFiles.getItems().remove(voxelFile); } } }
From source file:org.beryx.viewreka.fxapp.Viewreka.java
private boolean tryClose(Tab tab) { if (project == null) return false; CodeTabData tabData = getData(tab);/*from ww w .j av a 2s . c om*/ if (tabData.isDirty()) { ButtonType answer = Dialogs.confirmYesNoCancel("Close File", "This file has unsaved changes", "Save changes before closing the file?"); if (answer == ButtonType.YES) { saveFile(); } else if (answer == ButtonType.CANCEL) { return false; } } String filePath = tabData.getFilePath(); ProjectSettings projectSettings = project.getProjectSettingsManager().getSettings(); List<String> openFiles = getOpenFiles(projectSettings); openFiles.remove(filePath); return true; }
From source file:org.beryx.viewreka.fxapp.Viewreka.java
public boolean tryCloseProject() { if (hasUnsavedChanges()) { ButtonType answer = Dialogs.confirmYesNoCancel("Close Project", "One or more files have unsaved changes", "Save changes before closing the project?"); if (answer == ButtonType.YES) { saveAll();//from w ww . ja v a 2s . c o m } else if (answer == ButtonType.CANCEL) { return false; } } forceCloseProject(true); return true; }
From source file:org.cryptomator.ui.controllers.MainController.java
@FXML private void didClickRemoveSelectedEntry(ActionEvent e) { Alert confirmDialog = DialogBuilderUtil.buildConfirmationDialog( // localization.getString("main.directoryList.remove.confirmation.title"), // localization.getString("main.directoryList.remove.confirmation.header"), // localization.getString("main.directoryList.remove.confirmation.content"), // SystemUtils.IS_OS_MAC_OSX ? ButtonType.CANCEL : ButtonType.OK); Optional<ButtonType> choice = confirmDialog.showAndWait(); if (ButtonType.OK.equals(choice.get())) { vaults.remove(selectedVault.get()); if (vaults.isEmpty()) { activeController.set(welcomeController.get()); }//w w w. j av a 2 s.co m } }
From source file:org.cryptomator.ui.controllers.UnlockController.java
@FXML private void didClickSavePasswordCheckbox(ActionEvent event) { if (!savePassword.isSelected() && hasStoredPassword()) { Alert confirmDialog = DialogBuilderUtil.buildConfirmationDialog( // localization.getString("unlock.savePassword.delete.confirmation.title"), // localization.getString("unlock.savePassword.delete.confirmation.header"), // localization.getString("unlock.savePassword.delete.confirmation.content"), // SystemUtils.IS_OS_MAC_OSX ? ButtonType.CANCEL : ButtonType.OK); Optional<ButtonType> choice = confirmDialog.showAndWait(); if (ButtonType.OK.equals(choice.get())) { keychainAccess.get().deletePassphrase(vault.getId()); } else if (ButtonType.CANCEL.equals(choice.get())) { savePassword.setSelected(true); }// w ww . j a v a 2s. c om } }
From source file:org.simmi.GeneSetHead.java
License:asdf
public void cogBlastDlg(Set<String> species) { Dialog<String> cogdlg = new Dialog(); ToggleGroup group = new ToggleGroup(); VBox vbox = new VBox(); RadioButton docker = new RadioButton("docker"); docker.setToggleGroup(group);/*w w w .jav a2 s .c o m*/ RadioButton local = new RadioButton("local"); local.setToggleGroup(group); docker.setSelected(true); TextField dbpath = new TextField("/cdd_delta"); TextField host = new TextField("geneset"); vbox.getChildren().add(docker); vbox.getChildren().add(local); vbox.getChildren().add(dbpath); vbox.getChildren().add(host); cogdlg.getDialogPane().setContent(vbox); /*String dbPath = "/data/Cog"; JTextField tf = new JTextField( dbPath ); JTextField host = new JTextField("localhost"); JOptionPane.showMessageDialog( null, new Object[] {tf, host} );*/ cogdlg.getDialogPane().getButtonTypes().add(ButtonType.OK); cogdlg.getDialogPane().getButtonTypes().add(ButtonType.CANCEL); cogdlg.setResultConverter(param -> { if (!param.getButtonData().isCancelButton()) { return dbpath.getText(); } return ""; }); Optional<String> ostr = cogdlg.showAndWait(); if (ostr.isPresent()) { String str = ostr.get(); if (str.length() > 0) SwingUtilities.invokeLater(() -> { geneset.cogBlast(species, dbpath.getText(), host.getText(), false, docker.isSelected()); }); } }