javafx.fxml.FXML Java Examples
The following examples show how to use
javafx.fxml.FXML.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LogsController.java From dev-tools with Apache License 2.0 | 6 votes |
@FXML private void handleGenerate(ActionEvent actionEvent) { reset(); if (!validate()) return; setRunning(true); CompletableFuture.supplyAsync(() -> { Iterator<String> iter = LogsService.logStream( logTypeComboBox.getValue(), Integer.parseInt(delayLowerField.getText()), Integer.parseInt(delayUpperField.getText()), Integer.parseInt(limitField.getText())).iterator(); while (iter.hasNext()) { write(iter.next()); if (!running) break; } return null; }).thenAccept(r -> { setRunning(false); }).exceptionally(e -> { Platform.runLater(() -> { setRunning(false); logMessage.setText(e.getMessage()); }); return null; }).whenComplete((i, t) -> closeFile()); }
Example #2
Source File: KendrickMassPlotWindowController.java From mzmine3 with GNU General Public License v2.0 | 6 votes |
@FXML void toggleKMDRKMY(ActionEvent event) { logger.finest("Toggle KMD and RKM Y-Axis"); XYPlot plot = getChart().getXYPlot(); if (useRKM_Y) { useRKM_Y = false; plot.getRangeAxis().setLabel("KMD(" + customYAxisKMBase + ")"); imageViewKMDRKMY.setImage(iconKMD); } else { useRKM_Y = true; // if the divisor is round(R) switch to round(R)-1 for RKM plot yAxisDivisor = checkDivisor(yAxisDivisor, useRKM_Y, customYAxisKMBase, false); plot.getRangeAxis().setLabel("RKM(" + customYAxisKMBase + ")"); imageViewKMDRKMY.setImage(iconRKM); } kendrickVariableChanged(plot); }
Example #3
Source File: GeneratorController.java From dev-tools with Apache License 2.0 | 6 votes |
@FXML private void handleGeneratePasswordAction(final ActionEvent actionEvent) { int length; try { pwdLength.setBorder(Border.EMPTY); length = validatePasswordLength(); } catch (Exception e) { pwdLength.setBorder(Elements.alertBorder); return; } PasswordGenerator generator = new PasswordGenerator.PasswordGeneratorBuilder() .withLowerChars(pwdLowChars.isSelected()) .withDigits(pwdDigits.isSelected()) .withUpperChars(pwdUpperChars.isSelected()) .withSymbols(pwdSymbols.isSelected()) .build(); generatorResult.setText(generator.generate(length)); }
Example #4
Source File: ResultWindowController.java From mzmine3 with GNU General Public License v2.0 | 6 votes |
@FXML private void viewIsotopeClick(ActionEvent ae){ ResultFormula formula = resultTable.getSelectionModel().getSelectedItem(); if(formula == null) { MZmineCore.getDesktop().displayMessage(null, "Select one result to copy"); return; } logger.finest("Showing isotope pattern for formula " + formula.getFormulaAsString()); IsotopePattern predictedPattern = formula.getPredictedIsotopes(); if (predictedPattern == null) return; Feature peak = peakListRow.getBestPeak(); RawDataFile dataFile = peak.getDataFile(); int scanNumber = peak.getRepresentativeScanNumber(); SpectraVisualizerModule.showNewSpectrumWindow(dataFile, scanNumber, null, peak.getIsotopePattern(), predictedPattern); }
Example #5
Source File: VanKrevelenDiagramWindowController.java From mzmine3 with GNU General Public License v2.0 | 6 votes |
@FXML void toggleBolckSize(ActionEvent event) { logger.finest("Toggle block size"); XYPlot plot = getChart().getXYPlot(); XYBlockPixelSizeRenderer renderer = (XYBlockPixelSizeRenderer) plot.getRenderer(); int height = (int) renderer.getBlockHeightPixel(); if (height == 1) { height++; } else if (height == 5) { height = 1; } else if (height < 5 && height != 1) { height++; } renderer.setBlockHeightPixel(height); renderer.setBlockWidthPixel(height); }
Example #6
Source File: ResultWindowController.java From mzmine3 with GNU General Public License v2.0 | 6 votes |
@FXML public void handleAddAction(ActionEvent actionEvent) { try { DBCompound compound = IDList.getSelectionModel().getSelectedItem(); if (compound == null) { MZmineCore.getDesktop().displayMessage(null, "Select one result to add as compound identity"); return; } peakListRow.addPeakIdentity(compound, false); dispose(); } catch (Exception e){ e.printStackTrace(); } }
Example #7
Source File: KendrickMassPlotWindowController.java From mzmine3 with GNU General Public License v2.0 | 6 votes |
@FXML void toggleAnnotation(ActionEvent event) { logger.finest("Toggle annotations"); XYPlot plot = getChart().getXYPlot(); XYBlockPixelSizeRenderer renderer = (XYBlockPixelSizeRenderer) plot.getRenderer(); Boolean itemNameVisible = renderer.getDefaultItemLabelsVisible(); if (itemNameVisible == false) { renderer.setDefaultItemLabelsVisible(true); } else { renderer.setDefaultItemLabelsVisible(false); } if (plot.getBackgroundPaint() == Color.BLACK) { renderer.setDefaultItemLabelPaint(Color.WHITE); } else { renderer.setDefaultItemLabelPaint(Color.BLACK); } }
Example #8
Source File: KendrickMassPlotWindowController.java From mzmine3 with GNU General Public License v2.0 | 6 votes |
@FXML void toggleBolckSize(ActionEvent event) { logger.finest("Toggle block size"); XYPlot plot = getChart().getXYPlot(); XYBlockPixelSizeRenderer renderer = (XYBlockPixelSizeRenderer) plot.getRenderer(); int height = (int) renderer.getBlockHeightPixel(); if (height == 1) { height++; } else if (height == 5) { height = 1; } else if (height < 5 && height != 1) { height++; } renderer.setBlockHeightPixel(height); renderer.setBlockWidthPixel(height); }
Example #9
Source File: OpenLabelerController.java From OpenLabeler with Apache License 2.0 | 5 votes |
@FXML private void onFileOpenDir(ActionEvent actionEvent) { DirectoryChooser dirChooser = new DirectoryChooser(); dirChooser.setTitle(bundle.getString("menu.openMediaDir").replaceAll("_", "")); File dir = dirChooser.showDialog(tagBoard.getScene().getWindow()); openFileOrDir(dir); }
Example #10
Source File: ProjectParametersSetupDialogController.java From mzmine3 with GNU General Public License v2.0 | 5 votes |
@FXML public void onClickHelp(ActionEvent actionEvent) { final URL helpPage = this.getClass().getResource("ParametersSetupHelp.html"); HelpWindow helpWindow = new HelpWindow(helpPage.toString()); helpWindow.show(); }
Example #11
Source File: MainWindowController.java From mzmine3 with GNU General Public License v2.0 | 5 votes |
@FXML public void handleSetHighPriority(Event event) { TaskController taskController = MZmineCore.getTaskController(); var selectedTasks = tasksView.getSelectionModel().getSelectedItems(); for (WrappedTask t : selectedTasks) { taskController.setTaskPriority(t.getActualTask(), TaskPriority.HIGH); } }
Example #12
Source File: KendrickMassPlotWindowController.java From mzmine3 with GNU General Public License v2.0 | 5 votes |
@FXML void shiftUpXAxis(ActionEvent event) { logger.finest("Shift X-axis up"); Double shiftValue = 0.01; xAxisShift = xAxisShift + shiftValue; XYPlot plot = getChart().getXYPlot(); kendrickVariableChanged(plot); }
Example #13
Source File: ResultWindowController.java From mzmine3 with GNU General Public License v2.0 | 5 votes |
@FXML private void copySmilesOnClick(ActionEvent ae){ SiriusCompound compound = compoundsTable.getSelectionModel().getSelectedItem(); if (compound == null) { MZmineCore.getDesktop().displayMessage(null, "Select one result to copy SMILES value"); return; } String smiles = compound.getSMILES(); copyToClipboard(smiles, "Selected compound does not contain identified SMILES"); }
Example #14
Source File: MainWindowController.java From mzmine3 with GNU General Public License v2.0 | 5 votes |
@FXML public void handleSetNormalPriority(Event event) { TaskController taskController = MZmineCore.getTaskController(); var selectedTasks = tasksView.getSelectionModel().getSelectedItems(); for (WrappedTask t : selectedTasks) { taskController.setTaskPriority(t.getActualTask(), TaskPriority.NORMAL); } }
Example #15
Source File: KendrickMassPlotWindowController.java From mzmine3 with GNU General Public License v2.0 | 5 votes |
@FXML void chargeUpY(ActionEvent event) { logger.finest("Charge Y-axis up"); yAxisCharge = yAxisCharge + 1; XYPlot plot = getChart().getXYPlot(); kendrickVariableChanged(plot); }
Example #16
Source File: KendrickMassPlotWindowController.java From mzmine3 with GNU General Public License v2.0 | 5 votes |
@FXML void toggleBackColor(ActionEvent event) { logger.finest("Toggle background"); XYPlot plot = getChart().getXYPlot(); if (plot.getBackgroundPaint() == Color.WHITE) { plot.setBackgroundPaint(Color.BLACK); } else { plot.setBackgroundPaint(Color.WHITE); } }
Example #17
Source File: KendrickMassPlotWindowController.java From mzmine3 with GNU General Public License v2.0 | 5 votes |
@FXML void chargeDownY(ActionEvent event) { if (yAxisCharge > 1) { yAxisCharge = yAxisCharge - 1; } else yAxisCharge = 1; XYPlot plot = getChart().getXYPlot(); kendrickVariableChanged(plot); }
Example #18
Source File: MenuController.java From Online-Food-Ordering-System with MIT License | 5 votes |
@FXML public void PaymentScreen(ActionEvent event) throws Exception { Stage primaryStage =new Stage(); primaryStage.initStyle(StageStyle.UNDECORATED); Parent root =FXMLLoader.load(getClass().getResource("Payment.fxml")); Scene scene = new Scene(root); primaryStage.setScene(scene); primaryStage.show(); // Hide this current window (if this is what you want) ((Node)(event.getSource())).getScene().getWindow().hide(); }
Example #19
Source File: DetailPCController.java From FlyingAgent with Apache License 2.0 | 5 votes |
@FXML private void onMoreInfo() { spinnerMoreInfo.setVisible(true); Message message = new Message(null, Message.ASK_REQUEST); try { mainController.putO2AObject(message, AgentController.ASYNC); } catch (StaleProxyException e) { e.printStackTrace(); } }
Example #20
Source File: KendrickMassPlotWindowController.java From mzmine3 with GNU General Public License v2.0 | 5 votes |
@FXML void shiftDownY(ActionEvent event) { logger.finest("Shift Y-axis down"); Double shiftValue = -0.01; yAxisShift = yAxisShift + shiftValue; XYPlot plot = getChart().getXYPlot(); kendrickVariableChanged(plot); }
Example #21
Source File: ExportController.java From mapper-generator-javafx with Apache License 2.0 | 5 votes |
/** * bean 文件夹选择器 */ @FXML public void beanDirectoryScan() { File directory = FileDirChooserFactory.createDirectoryScan(null, StringUtils.isEmpty(this.baseDir) ? null : this.baseDir); if (directory != null) { beanLocationText.setText(directory.getPath()); this.baseDir = directory.getPath(); } }
Example #22
Source File: KendrickMassPlotWindowController.java From mzmine3 with GNU General Public License v2.0 | 5 votes |
@FXML void shiftUpYAxis(ActionEvent event) { logger.finest("Shift Y-axis up"); Double shiftValue = 0.01; yAxisShift = yAxisShift + shiftValue; XYPlot plot = getChart().getXYPlot(); kendrickVariableChanged(plot); }
Example #23
Source File: KendrickMassPlotWindowController.java From mzmine3 with GNU General Public License v2.0 | 5 votes |
@FXML void divisorDownZ(ActionEvent event) { logger.finest("Divisor Z-axis down"); int minDivisor = getMinimumRecommendedDivisor(customZAxisKMBase); int maxDivisor = getMaximumRecommendedDivisor(customZAxisKMBase); if (zAxisDivisor > minDivisor && zAxisDivisor <= maxDivisor) { zAxisDivisor--; zAxisDivisor = checkDivisor(zAxisDivisor, useRKM_Z, customZAxisKMBase, false); } XYPlot plot = getChart().getXYPlot(); kendrickVariableChanged(plot); }
Example #24
Source File: RcmController.java From ns-usbloader with GNU General Public License v3.0 | 5 votes |
/** * Drag-n-drop support (drop consumer) * */ @FXML private void handleDrop(DragEvent event){ Node sourceNode = (Node) event.getSource(); File fileDrpd = event.getDragboard().getFiles().get(0); if (fileDrpd.isDirectory()){ event.setDropCompleted(true); event.consume(); return; } String fileNameDrpd = fileDrpd.getAbsolutePath(); switch (sourceNode.getId()){ case "plHbox1": setPayloadFile( 1, fileNameDrpd); break; case "plHbox2": setPayloadFile( 2, fileNameDrpd); break; case "plHbox3": setPayloadFile( 3, fileNameDrpd); break; case "plHbox4": setPayloadFile( 4, fileNameDrpd); break; case "plHbox5": setPayloadFile( 5, fileNameDrpd); } event.setDropCompleted(true); event.consume(); }
Example #25
Source File: KendrickMassPlotWindowController.java From mzmine3 with GNU General Public License v2.0 | 5 votes |
@FXML void chargeUpX(ActionEvent event) { logger.finest("Charge X-axis up"); xAxisCharge = xAxisCharge + 1; XYPlot plot = getChart().getXYPlot(); kendrickVariableChanged(plot); }
Example #26
Source File: ExportController.java From mapper-generator-javafx with Apache License 2.0 | 5 votes |
/** * mapper xml 文件夹选择器 */ @FXML public void xmlDirectoryScan() { File directory = FileDirChooserFactory.createDirectoryScan(null, StringUtils.isEmpty(this.baseDir) ? null : this.baseDir); if (directory != null) { xmlLocationText.setText(directory.getPath()); this.baseDir = directory.getPath(); } }
Example #27
Source File: MainController.java From SlidesRemote with Apache License 2.0 | 5 votes |
@FXML private void onStart() { socketServer = new SocketServer(); if(RegexChecker.isIP(lblIpAddress.getText())) { socketServer.start(); lblStatus.setText("Connected"); } else { lblStatus.setText("Disconnected"); } }
Example #28
Source File: MainController.java From SlidesRemote with Apache License 2.0 | 5 votes |
@FXML private void onRefresh() { comboNetworkName.getItems().clear(); networkAddresses = NetworkUtils.getMyIPv4Addresses(); if(!networkAddresses.isEmpty()) { for(String key: networkAddresses.keySet()) { comboNetworkName.getItems().add(key); } changeQRCodeImg(); } }
Example #29
Source File: ExportController.java From mapper-generator-javafx with Apache License 2.0 | 5 votes |
/** * mapper 文件夹选择器 */ @FXML public void mapperDirectoryScan() { File directory = FileDirChooserFactory.createDirectoryScan(null, StringUtils.isEmpty(this.baseDir) ? null : this.baseDir); if (directory != null) { mapperLocationText.setText(directory.getPath()); this.baseDir = directory.getPath(); } }
Example #30
Source File: LoginController.java From Online-Food-Ordering-System with MIT License | 5 votes |
@FXML public void MenuScreen(ActionEvent event) throws Exception { Stage primaryStage =new Stage(); Parent root =FXMLLoader.load(getClass().getResource("Menu.fxml")); primaryStage.setTitle("Welcome To Foody Menu"); Scene scene = new Scene(root); primaryStage.setScene(scene); primaryStage.show(); // Hide this current window (if this is what you want) ((Node)(event.getSource())).getScene().getWindow().hide(); }