@Override public void actionPerformed(ActionEvent e) { if (e.getSource() == logout) { Main.Frame.setPanel(new LoginPanel()); } /*Ao filtrar por AUTOR*/ if (e.getSource() == autor) { Main.Frame.setPanel(new AutorPanel()); } /*Ao filtrar por TRABALHO ARTISTICO*/ if (e.getSource() == titulo) { Main.Frame.setPanel(new TrabalhoPanel()); } /*Ao filtrar por GÊNERO*/ if (e.getSource() == genero) { genero.setSelected(true); autor.setSelected(false); titulo.setSelected(false); list.removeAll(); selecionado1.setText(""); selecionado2.setText(""); selecionado3.setText(""); PreencheGenero(); } if (e.getSource() == adicionar) { this.setVisible(false); Main.Frame.setPanel(new AdicionarPanel()); } }
public void commitValues(final ElementStyleSheet styleSheet) { if (centerAlignButton.isSelected()) { styleSheet.setStyleProperty(ElementStyleKeys.ALIGNMENT, ElementAlignment.CENTER); } else if (rightAlignButton.isSelected()) { styleSheet.setStyleProperty(ElementStyleKeys.ALIGNMENT, ElementAlignment.RIGHT); } else { styleSheet.setStyleProperty(ElementStyleKeys.ALIGNMENT, ElementAlignment.LEFT); } if (middleAlignButton.isSelected()) { styleSheet.setStyleProperty(ElementStyleKeys.VALIGNMENT, ElementAlignment.MIDDLE); } else if (bottomAlignButton.isSelected()) { styleSheet.setStyleProperty(ElementStyleKeys.VALIGNMENT, ElementAlignment.BOTTOM); } else { styleSheet.setStyleProperty(ElementStyleKeys.VALIGNMENT, ElementAlignment.TOP); } styleSheet.setStyleProperty( TextStyleKeys.VERTICAL_TEXT_ALIGNMENT, textAlignModel.getSelectedKey()); styleSheet.setStyleProperty( TextStyleKeys.LINEHEIGHT, BorderPropertiesPane.parseLength(lineHeightField.getText())); if (wrapTextCheckbox.isSelected()) { styleSheet.setStyleProperty(TextStyleKeys.TEXT_WRAP, TextWrap.WRAP); } else { styleSheet.setStyleProperty(TextStyleKeys.TEXT_WRAP, TextWrap.NONE); } styleSheet.setStyleProperty( TextStyleKeys.WHITE_SPACE_COLLAPSE, whitespaceModel.getSelectedKey()); }
/** * Sets the status of the output directory panel * * @param abool true to enable the output panel */ public void enableOutputDirPanel(boolean abool) { yesOverwriteRadio.setEnabled(abool); noOverwriteRadio.setEnabled(abool); noOverwriteRadio.setSelected(abool); outputDirBrowseBtn.setEnabled(abool); workingDirField.setEnabled(abool); }
public void syncPanel() { panelPat.syncPanel(); regionAButton.setBorderPainted(dlg.panelMain.mark.getRegion() == Reg.A); regionBButton.setBorderPainted(dlg.panelMain.mark.getRegion() == Reg.B); regionCButton.setBorderPainted(dlg.panelMain.mark.getRegion() == Reg.C); elevBox.setText(dlg.panelMain.mark.getElevation()); heightBox.setText(dlg.panelMain.mark.getObjectHeight()); sourceBox.setText(dlg.panelMain.mark.getSource()); infoBox.setText(dlg.panelMain.mark.getInfo()); for (Sts sts : statuses.keySet()) { int item = statuses.get(sts); if (dlg.panelMain.mark.getStatus() == sts) statusBox.setSelectedIndex(item); } for (Cns cns : constructions.keySet()) { int item = constructions.get(cns); if (dlg.panelMain.mark.getConstr() == cns) constrBox.setSelectedIndex(item); } for (Con con : conspicuities.keySet()) { int item = conspicuities.get(con); if (dlg.panelMain.mark.getConsp() == con) conBox.setSelectedIndex(item); } for (Con con : reflectivities.keySet()) { int item = reflectivities.get(con); if (dlg.panelMain.mark.getRefl() == con) reflBox.setSelectedIndex(item); } }
@Override public void actionPerformed(ActionEvent e) { for (Shp shp : shapes.keySet()) { JRadioButton button = shapes.get(shp); if (button.isSelected()) { SmedAction.panelMain.mark.setShape(shp); SmedAction.panelMain.mark.setObject(objects.get(shp)); button.setBorderPainted(true); } else { button.setBorderPainted(false); } } if (SmedAction.panelMain.mark.testValid()) { SmedAction.panelMain.panelChan.topmarkButton.setVisible(true); SmedAction.panelMain.panelChan.lightButton.setVisible(true); if (SmedAction.panelMain.mark.getCategory() == Cat.LAM_PORT) { switch (SmedAction.panelMain.mark.getRegion()) { case A: SmedAction.panelMain.mark.setObjPattern(Pat.NOPAT); SmedAction.panelMain.mark.setObjColour(Col.RED); break; case B: SmedAction.panelMain.mark.setObjPattern(Pat.NOPAT); SmedAction.panelMain.mark.setObjColour(Col.GREEN); break; case C: SmedAction.panelMain.mark.setObjPattern(Pat.HSTRP); SmedAction.panelMain.mark.setObjColour(Col.RED); SmedAction.panelMain.mark.addObjColour(Col.WHITE); SmedAction.panelMain.mark.addObjColour(Col.RED); SmedAction.panelMain.mark.addObjColour(Col.WHITE); break; } } else { SmedAction.panelMain.mark.setObjPattern(Pat.HSTRP); switch (SmedAction.panelMain.mark.getRegion()) { case A: SmedAction.panelMain.mark.setObjColour(Col.RED); SmedAction.panelMain.mark.addObjColour(Col.GREEN); SmedAction.panelMain.mark.addObjColour(Col.RED); break; case B: SmedAction.panelMain.mark.setObjColour(Col.GREEN); SmedAction.panelMain.mark.addObjColour(Col.RED); SmedAction.panelMain.mark.addObjColour(Col.GREEN); break; case C: SmedAction.panelMain.mark.setObjColour(Col.RED); SmedAction.panelMain.mark.addObjColour(Col.GREEN); SmedAction.panelMain.mark.addObjColour(Col.RED); SmedAction.panelMain.mark.addObjColour(Col.GREEN); break; } } SmedAction.panelMain.panelMore.syncPanel(); } else { SmedAction.panelMain.panelChan.topmarkButton.setVisible(false); SmedAction.panelMain.panelChan.lightButton.setVisible(false); } }
@Override public void actionPerformed(ActionEvent arg0) { // Pre-creation sanity if (gridPanel != null) { // Variable declaration String name, phone; // Make sure the fields have values if ((name = nameField.getText()) == "") { // Tell the user if not JOptionPane.showMessageDialog(null, "Please enter the client's name"); return; } if ((phone = phoneField.getText()) == "") { JOptionPane.showMessageDialog(null, "Please enter the client's phone number"); return; } if (hiddenRadio.isSelected()) { JOptionPane.showMessageDialog(null, "Please select the client's smoking preference"); return; } // Calculate the party size int partySize = partyBox.getSelectedIndex() + 8; // Place the reservation bookRoom(name, phone, smokingRadio.isSelected(), partySize); } else { System.out.println("Grid panel is null"); } }
/** * Action of family radio button MultisensorItemPanel {@literal &} IndicatorTOItem must overrides */ protected void setFamily(String family) { _family = family; if (log.isDebugEnabled()) { log.debug("setFamily: for type \"" + _itemType + "\", family \"" + family + "\""); } _iconFamilyPanel.remove(_iconPanel); _iconPanel = new JPanel(new FlowLayout()); _iconFamilyPanel.add(_iconPanel, 0); HashMap<String, NamedIcon> map = ItemPalette.getIconMap(_itemType, _family); if (map != null) { _currentIconMap = map; } if (!_supressDragging) { _iconFamilyPanel.remove(_dragIconPanel); _dragIconPanel = new JPanel(new FlowLayout()); _iconFamilyPanel.add(_dragIconPanel, 0); makeDndIconPanel(_currentIconMap, "BeanStateUnknown"); } addIconsToPanel(_currentIconMap); _iconFamilyPanel.invalidate(); hideIcons(); Enumeration<AbstractButton> en = _familyButtonGroup.getElements(); while (en.hasMoreElements()) { JRadioButton but = (JRadioButton) en.nextElement(); if (_family != null && _family.equals(but.getText())) { but.setSelected(true); break; } } }
public void reset() { basePackageField.setText(myData.getBasePackage()); myFSCRadioButton.setSelected(myData.getFsc()); myRunSeparateCompilerRadioButton.setSelected(!myData.getFsc()); updateLibrariesList(); setCompilerLibraryById( new LibraryId(myData.getCompilerLibraryName(), myData.getCompilerLibraryLevel())); myMaximumHeapSize.setText(Integer.toString(myData.getMaximumHeapSize())); myVmParameters.setText(myData.getVmOptions()); myEnableWarnings.setSelected(myData.getWarnings()); myDeprecationWarnings.setSelected(myData.getDeprecationWarnings()); myUncheckedWarnings.setSelected(myData.getUncheckedWarnings()); myOptimiseBytecode.setSelected(myData.getOptimiseBytecode()); myExplainTypeErrors.setSelected(myData.getExplainTypeErrors()); myEnableContinuations.setSelected(myData.getContinuations()); myDebuggingInfoLevel.setSelectedItem(myData.getDebuggingInfoLevel()); myCompilerOptions.setText(myData.getCompilerOptions()); myPlugins = new ArrayList( CompilerPlugin.fromPaths(myData.getPluginPaths(), myEditorContext.getModule())); getPluginsModel().setItems(myPlugins); }
/** Construct the panel's GUI. */ private void initGUI() { PanelManager mainPanelManager = new PanelManager(this); PanelManager destPanelManager = new PanelManager("Destination"); PanelManager regionPanelManager = new PanelManager("Process"); ButtonGroup destinationGroup = new ButtonGroup(); ButtonGroup imageVOIGroup = new ButtonGroup(); newImageRadio = WidgetFactory.buildRadioButton("New image", true, destinationGroup); destPanelManager.add(newImageRadio); replaceImageRadio = WidgetFactory.buildRadioButton("Replace image", false, destinationGroup); destPanelManager.addOnNextLine(replaceImageRadio); // Only if the image is unlocked can it be replaced. if (srcImage.getLockStatus() == ModelStorageBase.UNLOCKED) { replaceImageRadio.setEnabled(true); if (ViewUserInterface.getReference().doForceInPlace()) { replaceImageRadio.setSelected(true); newImageRadio.setEnabled(false); } } else { replaceImageRadio.setEnabled(false); } wholeImageRadio = WidgetFactory.buildRadioButton("Whole image", true, imageVOIGroup); regionPanelManager.add(wholeImageRadio); voiRegionsRadio = WidgetFactory.buildRadioButton("VOI region(s)", false, imageVOIGroup); regionPanelManager.addOnNextLine(voiRegionsRadio); mainPanelManager.add(destPanelManager.getPanel()); mainPanelManager.add(regionPanelManager.getPanel()); }
@Override public void setEnabled(boolean b) { evolutionOption.setEnabled(b); bruteForceOption.setEnabled(b); evolutionPanel.setEnabled(b && evolutionOption.isSelected()); super.setEnabled(b); }
private void enableLabelCreationPanel(boolean b) { annotationSelectButton.setEnabled(b); annotationLangSelector.setEnabled(b); customLabelButton.setEnabled(b); sameAsRendererLabelButton.setEnabled(b); annotationIriLabel.setEnabled(b); }
setBackground(new Color(167, 202, 255)); ArrayList<Producer> tempProd = DataStorage.getDatabase(); ArrayList<Artist> tempArtist; ArrayList<Album> tempAlbum; int i = 1; for (Producer producer : tempProd) { tempArtist = producer.getArtistList(); for (Artist artist : tempArtist) { tempAlbum = artist.getAlbums(); for (Album album : tempAlbum) { JRadioButton albumButton = new JRadioButton(i + " - " + album.getAlbumName() + " - " + album.getArtist().getName() + " - " + album.getYear()); group.add(albumButton); albumButtons.add(albumButton); add(albumButton); albumButton.setBackground(new Color(167, 202, 255)); i++; } } } this.dialog = dialog; ActionListener buttonEvent = new ButtonHandler(); edit.addActionListener(buttonEvent); add(edit); }
protected void _init() { super._init(); if (_replacedObjects.objectForKey("_jRadioButton1") == null) { _setFontForComponent(_jRadioButton1, "Hiragino Kaku Gothic Pro", 13, Font.PLAIN); } if (_replacedObjects.objectForKey("_nsMatrix0") == null) { _jRadioButton1.setSize(77, 18); _jRadioButton1.setLocation(0, 0); _nsMatrix0.add(_jRadioButton1); _jRadioButton0.setSize(77, 18); _jRadioButton0.setLocation(81, 0); _nsMatrix0.add(_jRadioButton0); _setFontForComponent(_nsMatrix0, "Hiragino Kaku Gothic Pro", 13, Font.PLAIN); } if (_replacedObjects.objectForKey("_nsCustomView0") == null) { if (!(_nsCustomView0.getLayout() instanceof EOViewLayout)) { _nsCustomView0.setLayout(new EOViewLayout()); } _nsMatrix0.setSize(158, 18); _nsMatrix0.setLocation(81, 7); ((EOViewLayout) _nsCustomView0.getLayout()) .setAutosizingMask(_nsMatrix0, EOViewLayout.MinYMargin); _nsCustomView0.add(_nsMatrix0); } if (_replacedObjects.objectForKey("_jRadioButton0") == null) { _setFontForComponent(_jRadioButton0, "Hiragino Kaku Gothic Pro", 13, Font.PLAIN); } }
/** * Wird aufgerufen, wenn ein FSM-Programm gestartet bzw. gestoppt wird. Während einer * Programm-Ausführung sollte das Programm nicht verändert werden können (locked == true) */ public void setLocked(boolean locked) { if (locked) { this.setEnabled(false); this.automataPanel.setLocked(true); editMode.setEnabled(false); deleteMode.setEnabled(false); createState.setEnabled(false); markStartState.setEnabled(false); markFinalState.setEnabled(false); createTransistion.setEnabled(false); createComment.setEnabled(false); zoomIn.setEnabled(false); zoomOut.setEnabled(false); layout.setEnabled(false); nondeterministic.setEnabled(false); deterministic.setEnabled(false); } else { this.setEnabled(true); this.automataPanel.setLocked(false); editMode.setEnabled(true); deleteMode.setEnabled(true); createState.setEnabled(true); markStartState.setEnabled(true); markFinalState.setEnabled(true); createTransistion.setEnabled(true); createComment.setEnabled(true); zoomIn.setEnabled(true); zoomOut.setEnabled(true); layout.setEnabled(true); nondeterministic.setEnabled(true); deterministic.setEnabled(true); } }
private JRadioButton makeSearchInRadioButton(String label) { JRadioButton button = new JRadioButton(label, false); button.setActionCommand(label); searchIn.add(button); return button; }
public IPredicate getPredicate() { IPredicate predicate = null; if (myStandardSeach.isSelected()) { Enumeration optionsEnum = myOptions.elements(); while (optionsEnum.hasMoreElements()) { TextOption option = (TextOption) optionsEnum.nextElement(); if (option.isSelected()) { IPredicate optionPredicate = option.getPredicate(); if (predicate == null) { predicate = optionPredicate; } else { predicate = new AndPredicate(predicate, optionPredicate); } } } } else if (myAdvancedSearch.isSelected()) { try { String searchString = myAdvancedTextField.getText(); PredicateParser predParser = new PredicateParser(); predicate = predParser.parse(searchString); } catch (ParseException e) { String error = e.getMessage(); Debug.handleError(myContext.getFrame(), error, true); } } return predicate; }
public static Component generateComponent(GeneralComponentValueObj generalComponent) { switch (generalComponent.getComponentType()) { case CHECK_BOX: JCheckBox checkBoxComponent = new JCheckBox(generalComponent.getComponentDescription()); checkBoxComponent.setSelected(Boolean.parseBoolean(generalComponent.getComponentValue())); return checkBoxComponent; case RADIO_BUTTON: JRadioButton radioButtonComponent = new JRadioButton(generalComponent.getComponentDescription()); radioButtonComponent.setSelected( Boolean.parseBoolean(generalComponent.getComponentValue())); return radioButtonComponent; case FRAME: JFrame frameComponent = new JFrame(generalComponent.getComponentDescription()); frameComponent.setBounds( ((FrameComponentValueObj) generalComponent).getxAnchor(), ((FrameComponentValueObj) generalComponent).getyAnchor(), ((FrameComponentValueObj) generalComponent).getWidth(), ((FrameComponentValueObj) generalComponent).getHeight()); return frameComponent; case TEXTFIELD: JTextField textfieldComponent = new JTextField(generalComponent.getComponentValue()); return textfieldComponent; // case COMBO_BOX: // JComboBox comboBoxComponent = new JComboBox(generalComponent.getComponentValue()); // return comboBoxComponent; default: throw new IllegalArgumentException( "Unsupported componentType: " + generalComponent.getComponentType() + " caught while creating component from GeneralComponentValueObj"); } }
public boolean isAnimated() { return animated && (radioButton == null || radioButton.getParent() == null || !(radioButton.getParent() instanceof WebListElement || radioButton.getParent() instanceof WebTreeElement)); }
/** Store changes to table preferences. This method is called when the user clicks Ok. */ @Override public void storeSettings() { prefs.putBoolean(JabRefPreferences.NAMES_AS_IS, namesAsIs.isSelected()); prefs.putBoolean(JabRefPreferences.NAMES_FIRST_LAST, namesFf.isSelected()); prefs.putBoolean(JabRefPreferences.NAMES_NATBIB, namesNatbib.isSelected()); prefs.putBoolean(JabRefPreferences.NAMES_LAST_ONLY, lastNamesOnly.isSelected()); prefs.putBoolean(JabRefPreferences.ABBR_AUTHOR_NAMES, abbrNames.isSelected()); prefs.putInt( JabRefPreferences.AUTO_RESIZE_MODE, autoResizeMode.isSelected() ? JTable.AUTO_RESIZE_ALL_COLUMNS : JTable.AUTO_RESIZE_OFF); prefs.putBoolean(JabRefPreferences.PRIMARY_SORT_DESCENDING, priDesc.isSelected()); prefs.putBoolean(JabRefPreferences.SECONDARY_SORT_DESCENDING, secDesc.isSelected()); prefs.putBoolean(JabRefPreferences.TERTIARY_SORT_DESCENDING, terDesc.isSelected()); prefs.put(JabRefPreferences.PRIMARY_SORT_FIELD, priField.getText().toLowerCase().trim()); prefs.put(JabRefPreferences.SECONDARY_SORT_FIELD, secField.getText().toLowerCase().trim()); prefs.put(JabRefPreferences.TERTIARY_SORT_FIELD, terField.getText().toLowerCase().trim()); prefs.putBoolean(JabRefPreferences.FLOAT_MARKED_ENTRIES, floatMarked.isSelected()); // updatefont String oldVal = prefs.get(JabRefPreferences.NUMERIC_FIELDS); String newVal = numericFields.getText().trim(); if (newVal.isEmpty()) { newVal = null; } if (newVal != null && oldVal == null || newVal == null && oldVal != null || newVal != null && !newVal.equals(oldVal)) { prefs.put(JabRefPreferences.NUMERIC_FIELDS, newVal); BibtexFields.setNumericFieldsFromPrefs(); } }
private int findNext(int pos, String txt, String value) { int ix = forwardButton.isSelected() ? txt.indexOf(value, pos) : txt.lastIndexOf(value, pos); if (selectedLinesButton.isSelected() && (ix < target.getSelectionStart() || ix > target.getSelectionEnd())) { ix = -1; } if (wholeWordCheck.isSelected()) { while (ix != -1 && ((ix > 0 && Character.isLetterOrDigit(txt.charAt(ix - 1))) || (ix < txt.length() - value.length() - 1 && Character.isLetterOrDigit(txt.charAt(ix + value.length()))))) { ix = forwardButton.isSelected() ? ++ix : --ix; ix = forwardButton.isSelected() ? txt.indexOf(value, ix) : txt.lastIndexOf(value, ix); } } if (ix == -1 && wrapCheck.isSelected()) { if (forwardButton.isSelected() && pos > 0) { return findNext(0, txt, value); } else if (backwardButton.isSelected() && pos < txt.length() - 1) { return findNext(txt.length() - 1, txt, value); } } return ix; }
@Override public void actionPerformed(ActionEvent e) { texto2 = "Hay espacios en blanco"; if ((car.getText().length() == 0) || (nom.getText().length() == 0) || (cre.getText().length() == 0) || (!(nacional.isSelected()) && !(extranjero.isSelected()))) { JOptionPane.showMessageDialog(this, texto2, "Error", JOptionPane.ERROR_MESSAGE); } else { this.calcularPago(); texto = "Carnet: " + car.getText() + "\n" + "Nombre: " + nom.getText() + "\n" + "Creditos: " + cre.getText() + "\n" + "Año de ingreso: " + n.getSelectedItem() + "\n" + "Nacionalidad: " + this.nacionalidad() + "\n" + "Total a pagar: " + pag.getText(); JOptionPane.showMessageDialog(null, texto, "Información", JOptionPane.INFORMATION_MESSAGE); } }
public void storePrefs() { Preferences prefs = Preferences.userNodeForPackage(DurationFormatter.class); if (radioFormatHHQuarters.isSelected()) { prefs.putInt( DurationFormatter.PREF_DISPLAY_MODE, DurationFormatter.DISPLAY_DURATION_HH_QUARTER); } else if (radioFormatHHMM.isSelected()) { prefs.putInt(DurationFormatter.PREF_DISPLAY_MODE, DurationFormatter.DISPLAY_DURATION_HHMM); } try { prefs.flush(); } catch (BackingStoreException e) { LOG.error("Cannot store Prefs: ", e); } conf.setStorePasswd(storePasswordCheckBox.isSelected()); conf.setShowTimerOnStartup(showTimerOnStartupCheckBox.isSelected()); for (Entry<String, JTextField> pt : persistenceFields.entrySet()) { conf.setConfigProperty(pt.getKey(), pt.getValue().getText()); } conf.setConfigProperty( AnnotatedWorkRecordView.PREF_RESTORE_ON_INIT, Boolean.toString(initAnnotatedWorkRecordsOnStartup.isSelected())); workDaySettingsPanel.commit(); }
public void resetChanges() { DataEditorRecordNavigationSettings configuration = getConfiguration(); RecordNavigationTarget navigationTarget = configuration.getNavigationTarget(); if (navigationTarget == RecordNavigationTarget.VIEWER) viewerRadioButton.setSelected(true); else if (navigationTarget == RecordNavigationTarget.EDITOR) editorRadioButton.setSelected(true); else if (navigationTarget == RecordNavigationTarget.ASK) askRadioButton.setSelected(true); }
void jbInit() throws Exception { setLayout(new AlignLayout(2, 5, 5)); all = new JRadioButton("All"); all.setSelected(true); select = new JRadioButton("User Data"); select.setSelected(false); select.addItemListener( new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { select_itemStateChanged(e); } }); userData = new JTextField(15); // userData.setEnabled(false); ToggleDocument td = new ToggleDocument(); td.addToggleDocumentListener(this); userData.setDocument(td); ButtonGroup bg = new ButtonGroup(); bg.add(all); bg.add(select); add(all); add(new JLabel("")); add(select); add(userData); setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); }
/** Loads the default settings from Preferences to set up the dialog. */ public void legacyLoadDefaults() { String defaultsString = Preferences.getDialogDefaults(getDialogName()); if ((defaultsString != null) && (newImage != null)) { try { StringTokenizer st = new StringTokenizer(defaultsString, ","); textSearchWindowSide.setText("" + MipavUtil.getInt(st)); textSimilarityWindowSide.setText("" + MipavUtil.getInt(st)); textNoiseStandardDeviation.setText("" + MipavUtil.getFloat(st)); textDegree.setText("" + MipavUtil.getFloat(st)); doRician = MipavUtil.getBoolean(st); doRicianCheckBox.setSelected(doRician); textDegree.setEnabled(doRician); labelDegree.setEnabled(doRician); image25DCheckBox.setSelected(MipavUtil.getBoolean(st)); if (MipavUtil.getBoolean(st)) { newImage.setSelected(true); } else { replaceImage.setSelected(true); } } catch (Exception ex) { // since there was a problem parsing the defaults string, start over with the original // defaults Preferences.debug("Resetting defaults for dialog: " + getDialogName()); Preferences.removeProperty(getDialogName()); } } }
public String getValue() { return (enable.isSelected() ? "1" : "0") + "," + (radioCut.isSelected() ? OPTION_CUT : OPTION_LEAVE) + "," + (radioCut.isSelected() ? cutNumber.getValue() : leaveNumber.getValue()); }
private void onOK() { if (!isValidInput()) { return; } dispose(); String firstName = firstNameField.getText().trim(); String lastName = lastNameField.getText().trim(); String emailAddress = emailAddressField.getText().trim(); SexOfPerson sexOfPerson; if (femaleRadioButton.isSelected()) { sexOfPerson = SexOfPerson.FEMALE; } else { sexOfPerson = SexOfPerson.MALE; } String country = (String) countryComboBox.getSelectedObject(); Integer birthdayYear = (Integer) birthdayYearComboBox.getSelectedItem(); Month birthdayMonth = (Month) birthdayMonthComboBox.getSelectedItem(); Integer birthdayDay = (Integer) birthdayDayComboBox.getSelectedItem(); char[] passwordArr = passwordField.getPassword(); String password = new String(passwordArr); Arrays.fill(passwordArr, (char) 0); Image profilePicture = null; if (imageFromFileRadioButton.isSelected()) { if (fileSelector.getFilePath() != null) { profilePicture = new FileImage(fileSelector.getFilePath()); } } Request request = new CreateUserRequest( communicator.getHttpClient(), frame, firstName, lastName, emailAddress, sexOfPerson, country, birthdayYear, birthdayMonth, birthdayDay, password, profilePicture) { @Override protected void onCreateUser(String status, Person person) { if (status.equals("INVALID_PROFILE_PICTURE")) { communicator.promptForCreateAccount("Invalid profile picture"); } else if (status.equals("ERROR_CREATING_USER")) { communicator.promptForCreateAccount("Error creating user"); } else if (status.equals("CONNECTION_ERROR")) { communicator.promptForCreateAccount("Error connecting to Modeling Commons"); } else if (status.equals("SUCCESS")) { communicator.setPerson(person); communicator.promptForUpload(); } else { communicator.promptForCreateAccount("Unknown server error"); } } }; request.execute(); }
@Override public void actionPerformed(ActionEvent e) { if (e.getSource() == reset) { fn.setText(null); vn.setText(null); m.setSelected(false); w.setSelected(false); } if (e.getSource() == ok) { String s = fn.getText(); System.out.println(s); String s1 = vn.getText(); System.out.println(s1); } if (m.isSelected()) { System.out.println("männlich"); System.out.println(" "); } else { if (w.isSelected()) { System.out.println("weiblich"); System.out.println(" "); } if (e.getSource() == exit) { System.exit(0); } repaint(); } }
private void genderActionPerformed(ActionEvent evt) { if (evt.getSource() == radioFemale) { radioMale.setEnabled(!radioFemale.isSelected()); } else { radioFemale.setEnabled(!radioMale.isSelected()); } }
private void configureUI() { // UIManager.put("ToolTip.hideAccelerator", Boolean.FALSE); Options.setDefaultIconSize(new Dimension(18, 18)); Options.setUseNarrowButtons(settings.isUseNarrowButtons()); Options.setTabIconsEnabled(settings.isTabIconsEnabled()); UIManager.put(Options.POPUP_DROP_SHADOW_ENABLED_KEY, settings.isPopupDropShadowEnabled()); // Swing Settings LookAndFeel selectedLaf = settings.getSelectedLookAndFeel(); // Work around caching in MetalRadioButtonUI JRadioButton radio = new JRadioButton(); radio.getUI().uninstallUI(radio); JCheckBox checkBox = new JCheckBox(); checkBox.getUI().uninstallUI(checkBox); try { UIManager.setLookAndFeel(selectedLaf); SwingUtilities.updateComponentTreeUI(this); } catch (UnsupportedLookAndFeelException uslafe) { System.out.println("UnsupportedLookAndFeelException: " + uslafe.getMessage()); } catch (Exception e) { System.out.println("Can't change L&F: " + e); } // // FensterIcon // String IconLocation = ResourceManager.getString("icon.IconImage"); // System.out.println("[i] set IconImage: " + // getClass().getResource(IconLocation).toString()); // setIconImage( new // ImageIcon(getClass().getResource(IconLocation)).getImage()); }