@FXML private void buttonListenerEdit(ActionEvent event) { Employee emp = new Employee(); try { emp.setId(Integer.parseInt(tfInfoId.getText())); emp.setName(tfInfoName.getText()); emp.setPosition(tfInfoPos.getText()); emp.setStreet(tfInfoStreet.getText()); StringTokenizer tokens = new StringTokenizer(tfInfoCSZ.getText(), ","); // REQ#2 String cityState = tokens.nextToken().toString(); String zip = tokens.nextToken(); emp.setCity(cityState.substring(0, cityState.length() - 3)); emp.setState(cityState.substring(cityState.length() - 2)); emp.setZip(zip); emp.setPayRate(Double.parseDouble(tfInfoPayRate.getText())); Environment.updateEmployee(emp); lblEditConfirm.setText("Employee Updated"); } catch (MinimumWageException e) { // REQ#11 REQ#12 lblWageError.setVisible(true); } catch (Exception e) { lblEditConfirm.setText("Error Could Not Update Employee"); } if (rbHourly.isSelected()) { initialize(); populateHourlyEmployee(); } else if (rbSalary.isSelected()) { initialize(); populateSalaryEmployee(); } }
/** Method to read the properties and adding them to the pane */ private void readProperties() { ProfileProperties profile = PropertiesUtils.getProfile(); // Musiclibrary properties musicLibraryPath.setText(profile.getPathToMusicLibrary()); OrderingProperty orderIngProperty = profile.getOrderingMode(); if (orderIngProperty == OrderingProperty.GAA) { orderingMode.setValue(GAA); } else if (orderIngProperty == OrderingProperty.AA) { orderingMode.setValue(AA); } else { orderingMode.setValue(AAA); } if (profile.getPlayListHeader().contains("german")) { playListHeaderMode.setValue(germanHeader); } else { playListHeaderMode.setValue(englishHeader); } // Import properties keepFiles.setSelected(profile.isKeepOriginalFiles()); justTagFiles.setSelected(profile.isJustTagFiles()); // Playlist properties playListExport.setSelected(profile.isPlayListExport()); playListExportPath.setText(profile.getPlayListExportDir()); }
private void namesToggleSelected() { RadioButton selected = (RadioButton) this.namesGroup.getSelectedToggle(); if (selected.getText().equals("Boy")) { this.names.getItems().setAll(this.boyNames); } else { this.names.getItems().setAll(this.girlNames); } }
@FXML private void changeToJIRADefectCount(Event event) { checkLegacyDTS.setSelected(false); checkJIRA.setSelected(true); checkOther.setSelected(false); textPrefix.setDisable(true); textPrefix.setText("ECOA-"); textMax.setText("ECOA-99999"); }
@FXML private void changeToOtherDefectCount(Event event) { checkLegacyDTS.setSelected(false); checkJIRA.setSelected(false); checkOther.setSelected(true); textPrefix.setPromptText("Enter prefix"); textPrefix.setTooltip(new Tooltip("Enter prefix")); textPrefix.setDisable(false); textPrefix.selectAll(); textMax.setText(textPrefix.getText() + "99999"); }
@FXML private void changeToLegacyDefectCount(Event event) { checkLegacyDTS.setSelected(true); checkJIRA.setSelected(false); checkOther.setSelected(false); textPrefix.setDisable(false); textPrefix.setText("9999"); textPrefix.setPromptText("Enter min value"); textPrefix.setTooltip(new Tooltip("Enter min value")); textMax.setText("999999999"); }
public void init() { /* Image img1 = new Image(TermProjectMain.class.getResourceAsStream("bkash.png")); bkash.setImage(img1); Image img2 = new Image(TermProjectMain.class.getResourceAsStream("sure cash.png")); sureCash.setImage(img2); Image img3 = new Image(TermProjectMain.class.getResourceAsStream("dutch bangla.png")); DBBL.setImage(img3); Image img4 = new Image(TermProjectMain.class.getResourceAsStream("mastercard.png")); masterCard.setImage(img4); Image img5 = new Image(TermProjectMain.class.getResourceAsStream("visa.png")); visa.setImage(img5); */ // fromBoxList.setAll(options); // toBoxList.setAll(options); // fromComboBox.getItems().addAll(fromBoxList); c = new clientInfo(); fromComboBox.getItems().addAll(options); // toComboBox.getItems().addAll(toBoxList); toComboBox.getItems().addAll(options); fromComboBox.setVisibleRowCount(4); toComboBox.setVisibleRowCount(4); // the code fragment below ensures that no day before today is selected from the datePicker by // disabling the selecting option for those days and marking them in pink color final Callback<DatePicker, DateCell> dayCellFactory = new Callback<DatePicker, DateCell>() { @Override public DateCell call(final DatePicker datePicker) { return new DateCell() { @Override public void updateItem(LocalDate item, boolean empty) { super.updateItem(item, empty); if (item.isBefore(LocalDate.now())) { setDisable(true); setStyle("-fx-background-color: #ffc0cb;"); } } }; } }; datePick.setDayCellFactory(dayCellFactory); datePick.setEditable(false); final ToggleGroup group = new ToggleGroup(); ACradioButton.setToggleGroup(group); nonACradioButton.setToggleGroup(group); }
public void radioPern(ActionEvent event) { RadioButton o = (RadioButton) event.getSource(); // offertaPernotto = (OffertaPernotto) // accessoCatalogoModel.findOff(o.getId(),TipoOfferta.OffertaPernotto); offertaPernotto = (OffertaPernotto) DAOFactory.getDAOFactory(TipoOfferta.OffertaPernotto) .getOffertaDAO() .findOff(o.getId()); accessoCatalogoView.setEffect(2, offertaPernotto.getCittà()); }
@Override public void initialize(URL arg0, ResourceBundle arg1) { presenter = new Presenter(); FXMLParameter = new ParametriFXML(null, false); rdMaschio.setToggleGroup(group); rdMaschio.setSelected(true); rdFemmina.setToggleGroup(group); dEmissPatente.setValue(LocalDate.of(1980, 1, 1)); dNascita.setValue(LocalDate.of(1980, 1, 1)); }
@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(); }
@Override public void initialize(URL arg0, ResourceBundle arg1) { textTrackName.setText(track.getName()); textDynamicRange.setText(String.format("%.2f dB", track.getDynamicRange())); drawTrack(); radioButtonActiveTrack.setToggleGroup(toggleGroup); radioButtonActiveTrack.setUserData(new WeakReference<>(track)); if (toggleGroup.getSelectedToggle() == null) { radioButtonActiveTrack.setSelected(true); } textAreaComment.textProperty().bindBidirectional(track.commentProperty()); }
@FXML private void selecBuscarProvPorNombre(ActionEvent event) { txtBuscarProvPorNombre.setEditable(true); txtBuscarProvPorRut.setEditable(false); rbBuscarProvPorRut.setSelected(false); btnBuscarProv.setDisable(false); }
/** * Handle user actions on the toggle group to switch between weekly bar chart and monthly line * chart */ @FXML private void handleChartRadioActions() { if (weekRadio.isSelected()) { // remove month line chart from view monthLineChart.setVisible(false); // set week bar chart visible weekBarChart.setVisible(true); } if (monthRadio.isSelected()) { // remove month line chart from view weekBarChart.setVisible(false); // set week bar chart visible monthLineChart.setVisible(true); } }
// METODO ENCARGADO LIMPIAR CAMPOS DE BUSQUEDA @FXML private void limpiarBusquedaEmpleado(ActionEvent event) { tblMostrarUsuarioEmp.getColumns().clear(); txtBuscarEmpPorNombre.setText(""); txtBuscarEmpPorCodigo.setText(""); btnBuscarEmp.setDisable(true); btnNuevoEmpleado.setDisable(true); btnModificarEmpleado.setDisable(true); txtBuscarEmpPorNombre.setEditable(false); txtBuscarEmpPorCodigo.setEditable(false); rbBuscarEmpPorNombre.setSelected(false); rbBuscarEmpPorCodigo.setSelected(false); lblMensajeBd.setText(""); limpiarCamposEmp(); limpiarMensajesEmp(); }
@FXML private void calcular() { try { if (interprete.checarParentesis(txtFuncion.getText())) { interprete.setFuncion(txtFuncion.getText()); if (truncamiento.isSelected()) { interprete.setTipoValores(1); } else { interprete.setTipoValores(2); } getK(); txtResultado.setText( interprete.getFlotante(new BigDecimal(interprete.getResultado())) + ""); setOperaciones(); } else { Alert alert = new Alert(Alert.AlertType.ERROR); alert.setTitle("Información"); alert.setContentText( "Error de sintaxis. Verifique que haya escrito la función correctamente"); alert.showAndWait(); } } catch (Exception e) { Alert alert = new Alert(Alert.AlertType.ERROR); alert.setTitle("Información"); alert.setContentText( "Error de sintaxis. Verifique que haya escrito la función correctamente"); alert.showAndWait(); } }
// METODO ENCARGADO DE LIMPIAR LA BUSQUEDA DE USUARIO JEFE SUCURSAL @FXML private void limpiarBusquedaSuc(ActionEvent event) { tblMostrarSucursales.getColumns().clear(); txtBuscarSucPorNombre.setText(""); txtBuscarSucPorCodigo.setText(""); btnBuscarSuc.setDisable(true); btnNuevoJefeSuc.setDisable(true); txtBuscarSucPorNombre.setEditable(false); txtBuscarSucPorCodigo.setEditable(false); btnModificarJefeSuc.setDisable(false); rbBuscarSucPorNombre.setSelected(false); rbBuscarSucPorCodigo.setSelected(false); lblMensajesSuc.setText(""); limpiarCamposSuc(); limpiarMensajesSuc(); }
// METODO QUE HABILITA EL CAMPO BUSQUEDA POR CODIGO DE EMPLEADO @FXML private void selecBuscarEmpPorCodigo(ActionEvent event) { txtBuscarEmpPorNombre.setEditable(false); txtBuscarEmpPorCodigo.setEditable(true); rbBuscarEmpPorNombre.setSelected(false); btnBuscarEmp.setDisable(false); }
public void updateComponents() { Context context = getMainApplication().getContext(); errorBox.setVisible(false); if (smallPCB.isSelected()) context.setPcbSize(PCBSize.Small); else if (largePCB.isSelected()) context.setPcbSize(PCBSize.Large); ApplicationValues applicationValues = SettingsFactory.getApplicationValues(); applicationValues.getPcbSize().setValue(context.getPcbSize()); applicationValues.save(); continueButton.setDisable( radioButtonsBox.isVisible() && !smallPCB.isSelected() && !largePCB.isSelected()); if (context.getPcbSize() != null && !checkSelectedPcbSize()) { errorBox.setVisible(true); continueButton.setDisable(!ignoreErrorCheckbox.isSelected()); } }
public static Tuple2<Label, RadioButton> addLabelRadioButton( GridPane gridPane, int rowIndex, ToggleGroup toggleGroup, String title, String radioButtonTitle) { Label label = addLabel(gridPane, rowIndex, title, 0); RadioButton radioButton = new RadioButton(radioButtonTitle); radioButton.setToggleGroup(toggleGroup); radioButton.setPadding(new Insets(6, 0, 0, 0)); GridPane.setRowIndex(radioButton, rowIndex); GridPane.setColumnIndex(radioButton, 1); gridPane.getChildren().add(radioButton); return new Tuple2<>(label, radioButton); }
// METODO ENCARGADO DE LIMPIAR LA BUSQUEDA DE PROVEEDORES @FXML private void limpiarBusquedaProv(ActionEvent event) { tblMostrarProveedores.getColumns().clear(); txtBuscarProvPorNombre.setText(""); txtBuscarProvPorRut.setText(""); btnBuscarProv.setDisable(true); btnNuevoProveedor.setDisable(true); txtBuscarProvPorNombre.setEditable(false); txtBuscarProvPorRut.setEditable(false); btnModificarProveedor.setDisable(false); rbBuscarProvPorNombre.setSelected(false); rbBuscarProvPorRut.setSelected(false); lblMensajesProv.setText(""); limpiarCamposProv(); limpiarMensajesProv(); }
@FXML void ACradioButtonClick(ActionEvent event) { /* if(!c.isAc())c.setAC(true); else c.setAC(false); */ // c.setAC(ACradioButton.isSelected()); ACradioButton.requestFocus(); }
private void add_name() { RadioButton selected = (RadioButton) this.namesGroup.getSelectedToggle(); if (selected.getText().equals("Boy")) { if (!this.name.getText().equals("")) { String s = this.name.getText(); this.boyNames.add(s); this.names.getItems().setAll(this.boyNames); this.name.clear(); } } else { if (!this.name.getText().equals("")) { String s = this.name.getText(); this.girlNames.add(s); this.names.getItems().setAll(this.girlNames); this.name.clear(); } } }
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); }
private void setEditMode(boolean edit) { studentList.setMouseTransparent(edit); needToPay.setMouseTransparent(edit); filter.setDisable(edit); submit.setDisable(edit); pay.setDisable(edit); cancel.setVisible(edit); name.setEditable(edit); nrc.setEditable(edit); phone.setEditable(edit); email.setEditable(edit); address.setEditable(edit); male.setDisable(!edit); female.setDisable(!edit); dob.setDisable(!edit); townships.setDisable(!edit); }
@Override public void setClickAction(AnyAction clickAction) { radioButton.setOnAction( new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { clickAction.actionEvent(); } }); }
private void initContent(GridPane pane) { pane.setGridLinesVisible(!true); pane.setPadding(new Insets(20)); pane.setHgap(10); pane.setVgap(10); Label names = new Label("Names:"); pane.add(names, 0, 1); Label name = new Label("Name:"); pane.add(name, 0, 3); this.names = new ListView<String>(); pane.add(this.names, 1, 1, 1, 2); this.names.setPrefWidth(200); this.names.setPrefHeight(200); this.names.getItems().setAll(this.boyNames); // GridPane.setMargin(this.boyNames, new Insets(-25, 0, 0, 0)); this.name = new TextField(); pane.add(this.name, 1, 3, 1, 1); HBox box = new HBox(20); pane.add(box, 1, 0); this.namesGroup = new ToggleGroup(); String[] gender = {"Boy", "Girl"}; for (String s : gender) { RadioButton rb = new RadioButton(); rb.setToggleGroup(this.namesGroup); rb.setText(s); box.getChildren().add(rb); rb.setSelected(true); } ChangeListener<Toggle> listener = (ov, oldValue, newValue) -> this.namesToggleSelected(); this.namesGroup.selectedToggleProperty().addListener(listener); Button add_name = new Button("Add"); pane.add(add_name, 4, 3); add_name.setOnAction(event -> this.add_name()); }
public void initialize(URL location, ResourceBundle resources) { txtFieldGeldEingabe.textProperty().bindBidirectional(viewModel.geldEingabe()); txtFieldZeitEingabe.textProperty().bindBidirectional(viewModel.zeitEinagabe()); labelQualitaet.textProperty().bindBidirectional(viewModel.qualitaetText()); labelZeit.textProperty().bindBidirectional(viewModel.zeitText()); labelSkill.textProperty().bindBidirectional(viewModel.skillText()); labelGehalt.textProperty().bindBidirectional(viewModel.gehaltText()); labelGeld.textProperty().bindBidirectional(viewModel.geldText()); labelGesundheit.textProperty().bindBidirectional(viewModel.gesundheitText()); labelMotivation.textProperty().bindBidirectional(viewModel.motivationText()); SliderGehalt.valueProperty().bindBidirectional(viewModel.gehaltProperty()); SliderGehalt.setValue(1500); SliderGehalt.setShowTickMarks(false); SliderGehalt.setMajorTickUnit(1); SliderGehalt.setMinorTickCount(0); SliderGehalt.setBlockIncrement(100); SliderGehalt.setSnapToTicks(true); labelNeuesGehalt.textProperty().bind(SliderGehalt.valueProperty().asString("%.0f")); buttonStart.setOnAction( event -> { buttonNachsteRunde.setDisable(false); buttonStart.setDisable(true); txtFieldGeldEingabe.setDisable(true); txtFieldZeitEingabe.setDisable(true); viewModel.startRound(); }); buttonNachsteRunde.setOnAction( event -> { RadioButton rb = (RadioButton) ToggleGroupSelect.getSelectedToggle(); viewModel.nextRound(rb.getText()); }); viewModel.setButtonNaechsteRunde(buttonNachsteRunde); viewModel.setButtonStart(buttonStart); viewModel.setTxtFieldGeldEingabe(txtFieldGeldEingabe); viewModel.setTxtFieldZeitEingabe(txtFieldZeitEingabe); }
@Override public void start(Stage pPrimaryStage) { aText.setText(PART_1); pPrimaryStage.setTitle("Welcome to COMP303"); aButton.setOnAction(this); aSkin.selectedToggleProperty().addListener(this); RadioButton rb1 = new RadioButton("Plain"); rb1.setToggleGroup(aSkin); rb1.setUserData("Plain"); rb1.setSelected(true); RadioButton rb2 = new RadioButton("Floral"); rb2.setUserData("Floral"); rb2.setToggleGroup(aSkin); RadioButton rb3 = new RadioButton("Chintz"); rb3.setUserData("Chintz"); rb3.setToggleGroup(aSkin); VBox centerPanel = new VBox(MARGIN); centerPanel.setPadding(new Insets(MARGIN)); centerPanel.setAlignment(Pos.CENTER); centerPanel.getChildren().addAll(aText, aButton); BorderPane root = new BorderPane(); root.setCenter(centerPanel); HBox bottomPanel = new HBox(MARGIN); bottomPanel.setPadding(new Insets(MARGIN)); bottomPanel.setAlignment(Pos.CENTER); bottomPanel.getChildren().addAll(rb1, rb2, rb3); root.setBottom(bottomPanel); aScene = new Scene(root, WIDTH, HEIGHT); pPrimaryStage.setResizable(false); pPrimaryStage.setScene(aScene); pPrimaryStage.show(); }
private void limpiarCamposProv() { txtNombreProveedor.setText(""); txtNombreProveedor.setEditable(false); txtRutProveedor.setText(""); txtRutProveedor.setEditable(false); txtCiudadProveedor.setText(""); txtCiudadProveedor.setEditable(false); txtDireccionProveedor.setText(""); txtDireccionProveedor.setEditable(false); txtTelefonoProveedor.setText(""); txtTelefonoProveedor.setEditable(false); txtEmailProveedor.setText(""); txtEmailProveedor.setEditable(false); rbEstadoActivoProv.setSelected(false); rbEstadoInactivoProv.setSelected(false); rbEstadoActivoProv.setDisable(true); rbEstadoInactivoProv.setDisable(true); btnModificarProveedor.setDisable(true); btnGuardarProveedor.setDisable(true); cbTipos.setValue("Seleccionar"); cbTipos.setDisable(true); }
@FXML public void registrarArticulo(ActionEvent e) { Articulo art = new Articulo(); cruds = new CRUDArticulos(); boolean registrado; int indiceCategoria = cmbCategorias.getSelectionModel().getSelectedIndex() + 1; art.setNombre(tfNombreArticulo.getText()); art.setMarca(tfMarca.getText()); art.setDescripcion_estado(txaDescripcion.getText()); art.setEstado(true); RadioButton chk = (RadioButton) acceso.getSelectedToggle(); if (chk.getText().equals("Prestable")) art.setAcceso(true); else art.setAcceso(false); art.setIdcategoria(indiceCategoria); registrado = cruds.registrarArticulo(art); System.out.println(art.getIdcategoria() + "" + art.isAcceso()); if (registrado) JOptionPane.showMessageDialog(null, "algo salio mal menor"); else JOptionPane.showMessageDialog(null, "se ha registrado con exito menor"); }