public void init() { pieChart = new PieChart(pieChartData); chartPane.getChildren().add(pieChart); AnchorPane.setBottomAnchor(pieChart, 0.0); AnchorPane.setLeftAnchor(pieChart, 0.0); AnchorPane.setTopAnchor(pieChart, 45.0); AnchorPane.setRightAnchor(pieChart, 0.0); autoRefreshCheckBox.setSelected(lastAutoRefresh); observableList.addListener(this); }
private void updateUI() { final boolean running = model.isRunning(); final boolean scriptRunning = model.isScriptRunning(); startButton.setDisable(running || scriptRunning); stopButton.setDisable(!running && !scriptRunning); scriptsButton.setDisable(running || scriptRunning); final Settings settings = model.loadSettings(); goldField.setText(settings.getGoldThreshold() + ""); elixirField.setText(settings.getElixirThreshold() + ""); deField.setText(settings.getDarkElixirThreshold() + ""); maxThField.setText(settings.getMaxThThreshold() + ""); detectEmptyCollectorsCheckBox.setSelected(settings.isDetectEmptyCollectors()); isMatchAllConditionsCheckBox.setSelected(settings.isMatchAllConditions()); collectResourcesCheckBox.setSelected(settings.isCollectResources()); trainTroopsSlider.setValue(settings.getTrainMaxTroops()); logLevelComboBox.getSelectionModel().select(settings.getLogLevel()); autoAttackComboBox.getSelectionModel().select(settings.getAttackStrategy()); rax1ComboBox.getSelectionModel().select(settings.getRaxInfo()[0]); rax2ComboBox.getSelectionModel().select(settings.getRaxInfo()[1]); rax3ComboBox.getSelectionModel().select(settings.getRaxInfo()[2]); rax4ComboBox.getSelectionModel().select(settings.getRaxInfo()[3]); rax5ComboBox.getSelectionModel().select(settings.getRaxInfo()[4]); rax6ComboBox.getSelectionModel().select(settings.getRaxInfo()[5]); extraFuncCheckBox.setSelected(settings.isExtraFunctions()); }
private void getuserinfo(String name) throws IOException { ToServer.writeUTF("iserinfo"); ToServer.writeUTF(name); txaddname.setText(FromServer.readUTF()); txaddpass.setText(FromServer.readUTF()); txgroupname.setText(FromServer.readUTF()); if (FromServer.readUTF().equals("1")) cboxadmin.setSelected(true); else cboxadmin.setSelected(false); }
@Override public void initialize(URL url, ResourceBundle resourceBundle) { playMusic.setSelected(settings.getBoolean("playMusic", true)); playSound.setSelected(settings.getBoolean("playSound", true)); for (Node checkBox : settingsRegion.getChildrenUnmodifiable()) { HBox.setHgrow(checkBox, Priority.ALWAYS); } logo.fitWidthProperty().bind(root.widthProperty()); }
@FXML public void clear() { User_name.requestFocus(); User_name.setText(null); pass.setText(null); Erromassage.setText(""); note.setText(null); CB1.setSelected(false); CB2.setSelected(false); }
@FXML private void initialize() { // Only show visible investment accounts accountComboBox.setPredicate( account -> account.instanceOf(AccountType.INVEST) && account.isVisible()); final Preferences preferences = getPreferences(); subAccountCheckBox.setSelected(preferences.getBoolean(RECURSIVE, true)); longNameCheckBox.setSelected(preferences.getBoolean(VERBOSE, false)); }
public void setBuddy(Buddy buddy) { if (buddy != null) { iconLabel.setImage(new Image(buddy.getIcon())); nameLabel.setText(buddy.getName()); onlineCheckBox.setSelected(buddy.isOnline()); } else { iconLabel.setImage(null); nameLabel.setText(null); onlineCheckBox.setSelected(false); } }
private TitledPane createTitledPane(CreditRequest creditRequest) { TitledPane titledPane = new TitledPane(); titledPane.setText("UserId: " + creditRequest.getUserId()); VBox vBox = new VBox(); TextFlow textFlow = new TextFlow(); Label label = new Label(creditRequest.toString()); label.setWrapText(true); textFlow.getChildren().add(label); textFlow.getChildren().add(new Label("Validate: ")); CheckBox isValidCheckBox = new CheckBox(); CheckBox rejectCheckBox = new CheckBox(); isValidCheckBox .selectedProperty() .addListener( (observable, oldValue, newValue) -> { if (newValue == true) { rejectCheckBox.setSelected(false); creditRequest.setValidated(true); } else { creditRequest.setValidated(null); } }); textFlow.getChildren().add(isValidCheckBox); textFlow.getChildren().add(new Label("Reject: ")); rejectCheckBox .selectedProperty() .addListener( (observable, oldValue, newValue) -> { if (newValue == true) { isValidCheckBox.setSelected(false); creditRequest.setValidated(false); } else { creditRequest.setValidated(null); } }); textFlow.getChildren().add(rejectCheckBox); Button creditHistoryButton = new Button("View Credit History"); creditHistoryButton.setOnAction( e -> { session.setUserUnderValidationId(creditRequest.getUserId()); screens.toCreditHistoryPage(); }); vBox.getChildren().add(textFlow); vBox.getChildren().add(creditHistoryButton); titledPane.setContent(vBox); return titledPane; }
public void setFddObjectModel(FddObjectModel fddObjectModel) { logger.entry(); if (fddObjectModel != null) { fddObjectModel .getInteractionClasses() .values() .stream() .forEach( (value) -> { interactions.add(new InteractionState(value)); }); InteractionTableView.setItems(interactions); interactions.forEach( (interaction) -> { interaction .onProperty() .addListener( (observable, oldValue, newValue) -> { if (!newValue) { cb.setSelected(false); } else if (interactions.stream().allMatch(a -> a.isOn())) { cb.setSelected(true); } }); }); InteractionTableColumn.setCellValueFactory(new PropertyValueFactory<>("interactionName")); CheckTableColumn.setCellValueFactory( new Callback< TableColumn.CellDataFeatures<InteractionState, Boolean>, ObservableValue<Boolean>>() { @Override public ObservableValue<Boolean> call( TableColumn.CellDataFeatures<InteractionState, Boolean> param) { return param.getValue().onProperty(); } }); CheckTableColumn.setCellFactory(CheckBoxTableCell.forTableColumn(CheckTableColumn)); cb.setUserData(CheckTableColumn); cb.setOnAction( (ActionEvent event) -> { CheckBox cb1 = (CheckBox) event.getSource(); TableColumn tc = (TableColumn) cb1.getUserData(); InteractionTableView.getItems() .stream() .forEach( (item) -> { item.setOn(cb1.isSelected()); }); }); CheckTableColumn.setGraphic(cb); } logger.exit(); }
public void coinTossChoice(ActionEvent event) { Boolean isSelected; // System.out.println(event.s)); if (event.getSource().equals(chkHeads)) { chkTails.setSelected(false); btnCoinFlip.setDisable(false); } else if (event.getSource().equals(chkTails)) { chkHeads.setSelected(false); btnCoinFlip.setDisable(false); } else { btnCoinFlip.setDisable(true); } }
public ActionFlow(TextField actionText, TextField aLeft, TextField aRight) { ActionText = actionText; this.aLeft = aLeft; this.aRight = aRight; actionBox = new CheckBox(); actionBox.setSelected(false); }
@Override public void clearForm() { modTrans = null; amountField.setDecimal(BigDecimal.ZERO); reconciledButton.setDisable(false); reconciledButton.setSelected(false); reconciledButton.setIndeterminate(false); if (payeeTextField != null) { // transfer slips do not use the payee field payeeTextField.setEditable(true); payeeTextField.clear(); } datePicker.setEditable(true); if (!Options.rememberLastDateProperty().get()) { datePicker.setValue(LocalDate.now()); } memoTextField.clear(); numberComboBox.setValue(null); numberComboBox.setDisable(false); attachmentPane.clear(); }
public ActionFlow(String actionText, String aLeft, String aRight) { ActionText = new TextField(actionText); this.aLeft = new TextField(aLeft); this.aRight = new TextField(aRight); actionBox = new CheckBox(); actionBox.setSelected(false); }
public RNADrawingView() { // set up gui drawingPane.setPrefWidth(400); drawingPane.setPrefHeight(400); warningLabel.setTextFill(Color.RED); animateCheckbox.setSelected(false); buttonBox.getChildren().addAll(foldButton, drawButton, animateCheckbox); inputBox.getChildren().addAll(sequenceField, bracketField, buttonBox); buttonInputBox.getChildren().addAll(inputBox, warningLabel, buttonBox); drawingPane.getChildren().add(drawing); root.setTop(buttonInputBox); root.setBottom(drawingPane); buttonBox.setAlignment(Pos.BOTTOM_LEFT); inputBox.setPadding(new Insets(10, 5, 10, 5)); HBox.setMargin(foldButton, new Insets(0, 2.5, 0, 2.5)); HBox.setMargin(drawButton, new Insets(0, 2.5, 0, 2.5)); HBox.setMargin(animateCheckbox, new Insets(0, 2.5, 0, 2.5)); VBox.setMargin(sequenceField, new Insets(0, 0, 5, 0)); this.scene = new Scene(root); scene.getStylesheets().add("resources/assignment6and7.css"); drawingPane.getStyleClass().add("drawingPane"); }
/** * shows the options to edit the selected shape * * @param selectedShape the shape currently selected */ public void shapeSelected(ReactiveShape selectedShape) { shape = selectedShape; switch (shape.getShapeType()) { case ReactiveShape.RECTANGLE: type.setValue(TYPE_RECTANGLE); break; case ReactiveShape.CIRCLE: type.setValue(TYPE_CIRCLE); break; case ReactiveShape.TRIANGLE: type.setValue(TYPE_TRIANGLE); break; } backgroundPane.setVisible(false); shapePane.setVisible(true); color.setValue(shape.getColor()); filled.setSelected(shape.isFilled()); borderThickness.setText("" + shape.getBorderThickness()); borderColor.setValue(shape.getBorderColor()); width.setText("" + (int) shape.getWidth()); height.setText("" + (int) shape.getHeight()); }
private void createNewStage(int level, Stage owner, boolean onTop) { Stage stage = new Stage(); stage.initOwner(owner); stage.setTitle(level == 0 ? "Root" : "Child " + level); stage.setAlwaysOnTop(onTop); VBox root = new VBox(15); root.setPadding(new Insets(20)); Scene scene = new Scene(root); stage.setScene(scene); ToggleButton onTopButton = new ToggleButton(onTop ? DISABLE_ON_TOP : ENABLE_ON_TOP); onTopButton.setSelected(onTop); stage .alwaysOnTopProperty() .addListener( (observable, oldValue, newValue) -> { onTopButton.setSelected(newValue); onTopButton.setText(newValue ? DISABLE_ON_TOP : ENABLE_ON_TOP); }); onTopButton.setOnAction(event -> stage.setAlwaysOnTop(!stage.isAlwaysOnTop())); CheckBox box = new CheckBox("Child stage always on top"); box.setSelected(true); Button newStageButton = new Button("Open child stage"); newStageButton.setOnAction(event -> createNewStage(level + 1, stage, box.isSelected())); root.getChildren().addAll(onTopButton, box, newStageButton); stage.show(); }
@SuppressWarnings("unchecked") @Override public void setValue(Boolean value) { if (value != null) { checkBox.setSelected(value); embeddedEditor.setValue(embeddedParameter.getValue()); } }
/** * @return "COMPLETE" or "ONGOING" depending on whether the current task's status is true or * false, respectively. */ protected String statusCheck() { boolean b = shl.getCurrentTab().getStatus(); if (b == true) { // status.getStyleClass().add("green"); status.setTextFill(Color.GREEN); finished.setSelected(true); return "COMPLETE"; } else { status.setTextFill(Color.RED); finished.setSelected(false); verified.setSelected(false); return "ONGOING"; } }
@FXML public void Selecteditem() throws SQLException { TuserPermission InsertData = (TuserPermission) tableUser.getSelectionModel().getSelectedItem(); selected = InsertData.getId(); String Sql = " SELECT * FROM users WHERE id = '" + InsertData.getId() + "'"; DB.rs = DB.statemen.executeQuery(Sql); if (DB.rs.next()) { User_name.setText(DB.rs.getString("user_name")); pass.setText(DB.rs.getString("pass")); note.setText(DB.rs.getString("note")); CB1.setSelected(DB.rs.getBoolean("permission1")); CB2.setSelected(DB.rs.getBoolean("permission2")); } }
// METODO ENCARGADO DE CARGAR LOS DATOS AL FORMULARIO EEMPLEADOS SEGUN EL ITEM SELECCIONADO private void cargarDatosEmpleadoAlFormulario(String dato) { ResultSet cargaDatosParaFormularioEmpeados = usuarioDao.datosParaFormularioEmpleados(dato); try { while (cargaDatosParaFormularioEmpeados.next()) { txtNombreEmpleado.setText( cargaDatosParaFormularioEmpeados.getString("NOMBRE_USUARIO").trim()); txtApellidoEmpleado.setText(cargaDatosParaFormularioEmpeados.getString("APELLIDOS").trim()); rbEstadoActivoEmpleado.setDisable(false); rbEstadoInactivoEmpleado.setDisable(false); String cargo = cargaDatosParaFormularioEmpeados.getString("CARGO").trim(); ckbGerente.setDisable(false); ckbJefeDeBodega.setDisable(false); if (cargo.equals("Gerente")) { ckbGerente.setSelected(true); } else { ckbJefeDeBodega.setSelected(true); } txtTelefonoEmpleado.setText(cargaDatosParaFormularioEmpeados.getString("TELEFONO").trim()); txtEmailEmpleado.setText(cargaDatosParaFormularioEmpeados.getString("E_MAIL").trim()); int estadoEmpleado = cargaDatosParaFormularioEmpeados.getInt("ESTADOID"); rbEstadoActivoEmpleado.setDisable(false); rbEstadoInactivoEmpleado.setDisable(false); if (estadoEmpleado == 1) { rbEstadoActivoEmpleado.setSelected(true); } else { rbEstadoInactivoEmpleado.setSelected(true); } } cargaDatosParaFormularioEmpeados.close(); } catch (SQLException ex) { System.out.println("Error " + ex); } txtNombreEmpleado.setEditable(true); txtApellidoEmpleado.setEditable(true); txtTelefonoEmpleado.setEditable(true); txtEmailEmpleado.setEditable(true); btnModificarEmpleado.setDisable(false); ckbGerente.setDisable(true); ckbJefeDeBodega.setDisable(true); }
private void limpiarCamposEmp() { txtNombreEmpleado.setText(""); txtNombreEmpleado.setEditable(false); txtApellidoEmpleado.setText(""); txtApellidoEmpleado.setEditable(false); ckbGerente.setSelected(false); ckbGerente.setDisable(true); ckbJefeDeBodega.setSelected(false); ckbJefeDeBodega.setDisable(true); txtTelefonoEmpleado.setText(""); txtTelefonoEmpleado.setEditable(false); txtEmailEmpleado.setText(""); txtEmailEmpleado.setEditable(false); rbEstadoActivoEmpleado.setSelected(false); rbEstadoActivoEmpleado.setDisable(true); rbEstadoInactivoEmpleado.setSelected(false); rbEstadoInactivoEmpleado.setDisable(true); }
/** * Sets the record to be edited in the dialog. * * @param order */ public void setOrder(Order order) { this.order = order; timeOrderField.setText(order.getTime()); employeeOrderField.setText(order.getEmployee()); clientOrderField.setText(order.getClient()); priceOrderField.setText(order.getPrice()); paidOrderCheckBox.setSelected(order.isPaid()); }
public void initialize() { constants = Constants.getInstance(); if (constants.getValue("s_autoupload").equalsIgnoreCase("1")) { chckboxautoUpload.setSelected(true); } else { chckboxautoUpload.setSelected(false); } txtnralcode.setText(constants.getValue("s_nralcode")); txtfiles.setText(constants.getValue("s_archiveCount")); txtinterval.setText(constants.getValue("s_backupInterval")); txtDir.setText(constants.getValue("s_dumpDir")); generateBackupPaths(); // generateRestore(); }
public void updateServicos(Map<Integer, String> items) { servicos.getChildren().clear(); for (Map.Entry<Integer, String> entry : items.entrySet()) { CheckBox checkbox = new CheckBox(); checkbox.setId("servico-" + entry.getKey()); checkbox.setText(entry.getValue()); checkbox.setMinWidth((checkbox.getText().length() + 3) * checkbox.getFont().getSize()); checkbox.setSelected(main.getConfig().get(PainelConfig.KEY_SERVICOS).is(entry.getKey())); servicos.getChildren().add(checkbox); } }
public void open(File f) { Properties open = new Properties(); InputStream input = null; try { input = new FileInputStream(f); open.load(input); selectProviderCb.setValue(open.getProperty("provider")); selectGrainCb.setValue(open.getProperty("grain")); weightTf.setText(open.getProperty("weight")); infoTa.setText(open.getProperty("info")); for (Entry<String, TextField> entry : propertiesTf.entrySet()) { String propertyName = entry.getKey(); TextField tf = entry.getValue(); CheckBox cb = propertiesCb.get(propertyName); tf.setText(open.getProperty(propertyName)); if (open.getProperty(propertyName + "_ENABLED").equals("ON")) { tf.setDisable(false); cb.setSelected(true); } else { tf.setDisable(true); cb.setSelected(false); } } mainStage.setTitle(f.getName()); } catch (Exception ex) { infoTa.setText("Не могу открыть файл"); } finally { if (input != null) { try { input.close(); } catch (IOException e) { e.printStackTrace(); } } } }
/** * @return "Verified" or "Unverified" whether the current task's statusV is true or false, * respectively. */ protected String statusVCheck() { boolean b = shl.getCurrentTab().getStatusV(); boolean r = shl.getCurrentTab().getRejection(); if (r == true) { statusV.setTextFill(Color.RED); reject.setSelected(true); return "REJECTED"; } else if (b == true) { statusV.setTextFill(Color.GREEN); verified.setSelected(true); return "Verified"; } else { verified.setSelected(false); statusV.setTextFill(Color.BROWN); return "Unverified"; } }
@Override public Pane getVisSettings() { GridPane pane = new GridPane(); pane.setPadding(new Insets(10, 0, 0, 0)); pane.setHgap(5); pane.setVgap(5); // Dimension selection box ComboBox<String> dimCombo = new ComboBox<>(); ObservableList<String> dimensions = FXCollections.observableArrayList(); dimensions.add("X"); dimensions.add("Y"); dimensions.add("Z"); dimCombo.setItems(dimensions); dimCombo.setValue(dimensions.get(2)); dimCombo .valueProperty() .addListener( (ov, oldStr, newStr) -> { if (newStr.equals("X")) { renderer.setViewingDimension(0); } else if (newStr.equals("Y")) { renderer.setViewingDimension(1); } else { renderer.setViewingDimension(2); } renderer.render(); Controller.getInstance().updateHistogram(); }); Label dimLabel = new Label(); dimLabel.setText("Projection dimension: "); dimLabel.setLabelFor(dimCombo); pane.add(dimLabel, 0, 0); pane.add(dimCombo, 1, 0); // Scale checkbox CheckBox scaleBox = new CheckBox("Scale: "); scaleBox.setSelected(true); scaleBox .selectedProperty() .addListener( (ov, old_val, new_val) -> { renderer.setScaling(new_val); renderer.render(); }); pane.add(scaleBox, 0, 1); return pane; }
@Override public void start(Stage primaryStage) throws Exception { Button button = new Button("Open Root stage with child"); CheckBox box = new CheckBox("Root is always on top"); box.setSelected(true); VBox root = new VBox(15, box, button); root.setPadding(new Insets(20)); Scene scene = new Scene(root); button.setOnAction(event -> createNewStage(0, null, box.isSelected())); primaryStage.setScene(scene); primaryStage.show(); }
@Override public void refresh() { Context context = getMainApplication().getContext(); context.setPcbPlacement(null); PCBSize pcbSize = context.getPcbSize(); if (pcbSize == null) pcbSize = SettingsFactory.getApplicationValues().getPcbSize().getValue(); if (pcbSize == PCBSize.Small) smallPCB.setSelected(true); else if (pcbSize == PCBSize.Large) largePCB.setSelected(true); errorBox.setVisible(false); ignoreErrorCheckbox.setSelected(false); updateComponents(); }
// METODO ENCARGADO DE HABILITAR LOS CAMPOS PARA UN NUEVO EMPLEADO @FXML private void nuevoEmpleado(ActionEvent event) { limpiarCamposEmp(); txtNombreEmpleado.setEditable(true); txtApellidoEmpleado.setEditable(true); ckbGerente.setDisable(false); ckbJefeDeBodega.setDisable(false); ckbGerente.setSelected(true); txtTelefonoEmpleado.setEditable(true); txtEmailEmpleado.setEditable(true); rbEstadoActivoEmpleado.setDisable(false); btnGuardarEmpleado.setDisable(false); btnNuevoEmpleado.setDisable(true); }