/** @see Editor#addSelectorForm() */ @Override public void addSelectorForm() { JComboBox<Bus> jcbBus; Bus[] buses = Bus.getBusArray(this); if (isDeleteOperation) { jcbBus = new JComboBox<Bus>(); jcbBus.setPreferredSize(fieldSize); for (Bus b : buses) { if (b.id != item.id) { jcbBus.addItem(b); } } } else { jcbBus = new JComboBox<Bus>(buses); jcbBus.setPreferredSize(fieldSize); jcbBus.setSelectedIndex(-1); if (item != null) { for (int i = 0; i < buses.length; i++) { if (buses[i].id == item.id) { jcbBus.setSelectedIndex(i); } } } } model = jcbBus; addField(TABLE_BUS_BUSID, model); }
private void setValues() { ranValue1 = (int) (Math.random() * 100); ranValue2 = ranValue1 * 5; jLabel2.setText(Integer.toString(ranValue2)); // selectValue(); jComboBox1.setSelectedIndex(0); jComboBox2.setSelectedIndex(0); }
private void resetSettings() { downloadDirectoryTextField.setText(Groovesquid.getConfig().getDownloadDirectory()); maxParallelDownloadsSpinner.setValue(Groovesquid.getConfig().getMaxParallelDownloads()); fileNameSchemeTextField.setText(Groovesquid.getConfig().getFileNameScheme()); String[] downloadCompleteActions = Config.DownloadComplete.names(); DefaultComboBoxModel downloadCompleteComboBoxModel = new DefaultComboBoxModel(); downloadCompletedComboBox.setModel(downloadCompleteComboBoxModel); for (String downloadCompleteAction : downloadCompleteActions) { downloadCompleteComboBoxModel.addElement(I18n.getLocaleString(downloadCompleteAction)); } downloadCompletedComboBox.setSelectedIndex(Groovesquid.getConfig().getDownloadComplete()); String[] startTabs = Config.StartTab.names(); DefaultComboBoxModel startTabComboBoxModel = new DefaultComboBoxModel(); startTabComboBox.setModel(startTabComboBoxModel); for (String startTab : startTabs) { startTabComboBoxModel.addElement(I18n.getLocaleString(startTab)); } startTabComboBox.setSelectedIndex(Groovesquid.getConfig().getStartTab()); String[] fileExistsActions = Config.FileExists.names(); DefaultComboBoxModel fileExistsComboBoxModel = new DefaultComboBoxModel(); fileExistsComboBox.setModel(fileExistsComboBoxModel); for (String fileExistsAction : fileExistsActions) { fileExistsComboBoxModel.addElement(I18n.getLocaleString(fileExistsAction)); } fileExistsComboBox.setSelectedIndex(Groovesquid.getConfig().getFileExists()); if (Groovesquid.getConfig().getProxyHost() != null && Groovesquid.getConfig().getProxyPort() != null) { proxyHostTextField.setText(Groovesquid.getConfig().getProxyHost()); proxyPortTextField.setText(Groovesquid.getConfig().getProxyPort().toString()); } }
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); } }
private void setupAttributes() { Color frameColor = (Color) AttributeFigure.getDefaultAttribute("FrameColor"); Color fillColor = (Color) AttributeFigure.getDefaultAttribute("FillColor"); Color textColor = (Color) AttributeFigure.getDefaultAttribute("TextColor"); Integer arrowMode = (Integer) AttributeFigure.getDefaultAttribute("ArrowMode"); String fontName = (String) AttributeFigure.getDefaultAttribute("FontName"); FigureEnumeration k = view().selectionElements(); while (k.hasMoreElements()) { Figure f = k.nextFigure(); frameColor = (Color) f.getAttribute("FrameColor"); fillColor = (Color) f.getAttribute("FillColor"); textColor = (Color) f.getAttribute("TextColor"); arrowMode = (Integer) f.getAttribute("ArrowMode"); fontName = (String) f.getAttribute("FontName"); } fFrameColor.setSelectedIndex(ColorMap.colorIndex(frameColor)); fFillColor.setSelectedIndex(ColorMap.colorIndex(fillColor)); // fTextColor.select(ColorMap.colorIndex(textColor)); if (arrowMode != null) { fArrowChoice.setSelectedIndex(arrowMode.intValue()); } if (fontName != null) { fFontChoice.setSelectedItem(fontName); } }
/* * (non-Javadoc) * * @see net.sf.borg.ui.options.OptionsView.OptionsPanel#loadOptions() */ @Override public void loadOptions() { backupDir.setText(Prefs.getPref(PrefName.BACKUPDIR)); OptionsPanel.setCheckBox(colorprint, PrefName.COLORPRINT); OptionsPanel.setCheckBox(splashbox, PrefName.SPLASH); OptionsPanel.setCheckBox(stackbox, PrefName.STACKTRACE); OptionsPanel.setCheckBox(useSysTray, PrefName.USESYSTRAY); OptionsPanel.setCheckBox(startToSysTray, PrefName.BACKGSTART); OptionsPanel.setCheckBox(dateInSysTray, PrefName.SYSTRAYDATE); OptionsPanel.setCheckBox(dynamicLoading, PrefName.DYNAMIC_LOADING); OptionsPanel.setCheckBox(verboseLogging, PrefName.DEBUG); OptionsPanel.setCheckBox(useProxy, PrefName.USE_PROXY); String shutdown_action = Prefs.getPref(PrefName.SHUTDOWN_ACTION); if (shutdown_action.isEmpty() || SHUTDOWN_ACTION.PROMPT.toString().equals(shutdown_action)) shutdownAction.setSelectedIndex(0); else if (SHUTDOWN_ACTION.NONE.toString().equals(shutdown_action)) shutdownAction.setSelectedIndex(1); else if (SHUTDOWN_ACTION.BACKUP.toString().equals(shutdown_action)) shutdownAction.setSelectedIndex(2); else if (SHUTDOWN_ACTION.EMAIL.toString().equals(shutdown_action)) shutdownAction.setSelectedIndex(3); int socket = Prefs.getIntPref(PrefName.SOCKETPORT); socketPort.setText(Integer.toString(socket)); proxyHostText.setText(Prefs.getPref(PrefName.PROXY_HOST)); int port = Prefs.getIntPref(PrefName.PROXY_PORT); proxyPortText.setText(Integer.toString(port)); }
public void run() { try { thread.sleep(1111); } catch (Exception e) { return; } Thread me = Thread.currentThread(); while (thread == me) { for (int i = 0; i < ImageOps.imgName.length; i++) { imgCombo.setSelectedIndex(i); for (int j = 0; j < ImageOps.opsName.length; j++) { opsCombo.setSelectedIndex(j); if (j <= 1) { for (int k = 50; k <= 200; k += 10) { demo.slider1.setValue(k); try { thread.sleep(200); } catch (InterruptedException e) { return; } } } try { thread.sleep(4444); } catch (InterruptedException e) { return; } } } } thread = null; }
protected void renderValue(MultiValueResolutionDecision decision) { model.removeAllElements(); switch (decision.getDecisionType()) { case UNDECIDED: model.addElement(tr("Choose a value")); cbDecisionRenderer.setFont(getFont().deriveFont(Font.ITALIC)); cbDecisionRenderer.setSelectedIndex(0); break; case KEEP_ONE: model.addElement(decision.getChosenValue()); cbDecisionRenderer.setFont(getFont()); cbDecisionRenderer.setSelectedIndex(0); break; case KEEP_NONE: model.addElement(tr("deleted")); cbDecisionRenderer.setFont(getFont().deriveFont(Font.ITALIC)); cbDecisionRenderer.setSelectedIndex(0); break; case KEEP_ALL: model.addElement(decision.getChosenValue()); cbDecisionRenderer.setFont(getFont()); cbDecisionRenderer.setSelectedIndex(0); break; } }
/** Create common UI for property wizards */ void populate() { getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS)); Util.setShuffleLocation(this, 400, 400); jlItemChoice = new JLabel(Messages.getString("CustomPropertyWizard.0")); jlName = new JLabel(Messages.getString("CustomPropertyWizard.1")); jcbItemChoice = new JComboBox(); jcbItemChoice.addItem(Messages.getString("Item_Track")); jcbItemChoice.addItem(Messages.getString("Item_File")); jcbItemChoice.addItem(Messages.getString("Item_Style")); jcbItemChoice.addItem(Messages.getString("Item_Author")); jcbItemChoice.addItem(Messages.getString("Item_Album")); jcbItemChoice.addItem(Messages.getString("Item_Device")); jcbItemChoice.addItem(Messages.getString("Item_Directory")); jcbItemChoice.addItem(Messages.getString("Item_Playlist")); // playlist // jcbItemChoice.addItem(Messages.getString("Item_Year")); // file // actually // okp = new OKCancelPanel(this); okp.getOKButton().setEnabled(false); // In physical perspective, default item is file, otherwise, it is track if (PerspectiveManager.getCurrentPerspective().getClass().equals(FilesPerspective.class)) { jcbItemChoice.setSelectedIndex(1); } else { jcbItemChoice.setSelectedIndex(0); } jcbItemChoice.addItemListener(this); jpMain = new JPanel(); }
public void AtualizaComboPlaca(int plc) { List<Veiculo> listaVeiculos; try { listaVeiculos = mbVeiculo.VeiculoPorServico(lstServicoData); String placa = cmbPlaca.getSelectedItem().toString(); if (plc == 0) { cmbMarca.setSelectedIndex(0); cmbModelo.setSelectedIndex(0); } else { for (int i = 0; i < listaVeiculos.size(); i++) { if (placa == listaVeiculos.get(i).getPlaca()) { cmbMarca.setSelectedItem(listaVeiculos.get(i).getModelo().getMarca()); cmbModelo.setSelectedItem(listaVeiculos.get(i).getModelo()); } } } } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
ExtraFeaturesPanel(int toolIndex /*ToolModel tool*/) { // this.tool = tool; this.toolIndex = toolIndex; setLayout(new MigLayout()); ef = target.getExtraFeatures(toolIndex); swapMotors = new JCheckBox("Use 2A/2B to drive DC motor instead of 1A/1B", ef.swapMotorController); add(swapMotors, "span 3,growx,wrap"); Vector<String> choices = new Vector<String>(); choices.add("Channel A"); choices.add("Channel B"); choices.add("Channel C"); extCh = new JComboBox(choices); extCh.setSelectedIndex(ef.heaterChannel); add(new JLabel("Extruder heater uses:")); add(extCh); add(new JLabel("(default ch. B)"), "wrap"); hbpCh = new JComboBox(choices); hbpCh.setSelectedIndex(ef.hbpChannel); add(new JLabel("Platform heater uses:")); add(hbpCh); add(new JLabel("(default ch. A)"), "wrap"); abpCh = new JComboBox(choices); abpCh.setSelectedIndex(ef.abpChannel); add(new JLabel("ABP motor uses:")); add(abpCh); add(new JLabel("(default ch. C)"), "wrap"); }
private void resetApplianceEditForm() { siteIDInput.setText(""); sourceIDInput.setText(""); sourceNameInput.setText(""); circuitInput.removeAllItems(); roomInput.removeAllItems(); sourceTypeInput.setSelectedItem("Appliance"); measurementTypeInput.setSelectedIndex(0); applianceGroupInput.setSelectedIndex(0); applianceTypeInput.setSelectedIndex(0); brandInput.setText(""); modelInput.setText(""); serialInput.setText(""); connectionInput.setSelectedIndex(0); controlInput.setSelectedIndex(0); switchTypeInput.setSelectedIndex(0); displayInput.setSelectedIndex(0); epsInput.setSelectedIndex(0); delayStartInput.setSelectedIndex(0); onWInput.setText(""); asWInput.setText(""); psWInput.setText(""); offWInput.setText(""); dsWInput.setText(""); yearOfPurchaseInput.setText(""); usageInput.setText(""); usageUnitsInput.setSelectedIndex(0); feature1Input.setText(""); feature2Input.setText(""); feature3Input.setText(""); feature4Input.setText(""); feature5Input.setText(""); notesInput.setText(""); }
private void setValueToEditor(LafParameterStorage storage) { this.storage = storage; if (parameter.getParameterClass() == boolean.class || parameter.getParameterClass() == Boolean.class) { Boolean value = (Boolean) LafParameterProvider.getInstance().getValue(parameter, entityId, storage); if (value == null) { jcbEditor.setSelectedIndex(0); } else if (value) { jcbEditor.setSelectedIndex(1); } else { jcbEditor.setSelectedIndex(2); } } else { Object o = LafParameterProvider.getInstance().getValue(parameter, entityId, storage); if (parameter.getFixedValueList() != null) { jcbEditor.setSelectedIndex(0); for (int i = 0; i < parameter.getFixedValueList().length; i++) { if (LangUtils.equals(o, parameter.getFixedValueList()[i])) { jcbEditor.setSelectedIndex(i + 1); } } } else { jtfEditor.setText(o == null ? "" : o.toString()); } } }
public void afficherFilmChoisis(String titre) { Video film = this.obtenirVideo(titre); String catos = this.obtenirCategoriesEnString( comboCollection.getItemAt(comboCollection.getSelectedIndex()).toString()); if (mode[0].isSelected()) { String filmOuSerie = "SERIE TV"; String eval = ""; if (film.getEval() == 1) { eval = String.valueOf(film.getEval()) + " etoile"; } else if (film.getEval() > 1) { eval = String.valueOf(film.getEval()) + " etoiles"; } if (film.isFilm()) { filmOuSerie = "FILM"; } infos_film[0].setText(titre); infos_film[1].setText(String.valueOf(film.getAnnee())); infos_film[2].setText(filmOuSerie); infos_film[3].setText(eval); } else { textTitre.setText(film.getTitre()); textAnnee.setText(String.valueOf(film.getAnnee())); comboEval.setSelectedIndex(film.getEval()); boolean isFilm = film.isFilm(); if (isFilm) { comboType.setSelectedIndex(1); } else { comboType.setSelectedIndex(2); } } textCommentaires.setText(film.getCommentaires()); textCategories.setText(catos); }
public void initComponents() { cmbFeatures.setEnabled(false); cmbFeatures.setSelectedIndex(-1); cmbValues.setEnabled(false); cmbValues.setSelectedIndex(-1); resetButton.setEnabled(false); }
/** Method to create link annotation GUI. */ private void createGUI() { // Create and setup an Appearance panel setBorder( new TitledBorder( new EtchedBorder(EtchedBorder.LOWERED), messageBundle.getString("viewer.utilityPane.annotation.ink.appearance.title"), TitledBorder.LEFT, TitledBorder.DEFAULT_POSITION)); // Line thickness lineThicknessBox = new JComboBox(LINE_THICKNESS_LIST); lineThicknessBox.setSelectedIndex(DEFAULT_LINE_THICKNESS); lineThicknessBox.addItemListener(this); add(new JLabel(messageBundle.getString("viewer.utilityPane.annotation.ink.lineThickness"))); add(lineThicknessBox); // Line style lineStyleBox = new JComboBox(LINE_STYLE_LIST); lineStyleBox.setSelectedIndex(DEFAULT_LINE_STYLE); lineStyleBox.addItemListener(this); add(new JLabel(messageBundle.getString("viewer.utilityPane.annotation.ink.lineStyle"))); add(lineStyleBox); // border colour colorBorderButton = new JButton(); colorBorderButton.addActionListener(this); colorBorderButton.setOpaque(true); colorBorderButton.setBackground(DEFAULT_BORDER_COLOR); add(new JLabel(messageBundle.getString("viewer.utilityPane.annotation.ink.colorBorderLabel"))); add(colorBorderButton); }
private void setupAttributes() { Color frameColor = (Color) AttributeFigure.getDefaultAttribute(FigureAttributeConstant.FRAME_COLOR); Color fillColor = (Color) AttributeFigure.getDefaultAttribute(FigureAttributeConstant.FILL_COLOR); Integer arrowMode = (Integer) AttributeFigure.getDefaultAttribute(FigureAttributeConstant.ARROW_MODE); String fontName = (String) AttributeFigure.getDefaultAttribute(FigureAttributeConstant.FONT_NAME); FigureEnumeration fe = view().selection(); while (fe.hasNextFigure()) { Figure f = fe.nextFigure(); frameColor = (Color) f.getAttribute(FigureAttributeConstant.FRAME_COLOR); fillColor = (Color) f.getAttribute(FigureAttributeConstant.FILL_COLOR); arrowMode = (Integer) f.getAttribute(FigureAttributeConstant.ARROW_MODE); fontName = (String) f.getAttribute(FigureAttributeConstant.FONT_NAME); } fFrameColor.setSelectedIndex(ColorMap.colorIndex(frameColor)); fFillColor.setSelectedIndex(ColorMap.colorIndex(fillColor)); if (arrowMode != null) { fArrowChoice.setSelectedIndex(arrowMode.intValue()); } if (fontName != null) { fFontChoice.setSelectedItem(fontName); } }
/* * This resets the map whenever reset is selected. */ public void reset() { mapPanel.clearList(); pane.getHorizontalScrollBar().setValue(0); pane.getVerticalScrollBar().setValue(0); list1.setSelectedIndex(0); list2.setSelectedIndex(0); mapPanel.repaint(); }
public void setSelectedChromosomesNoRefresh( Chromosome xChrom, Chromosome yChrom, Context xContext, Context yContext) { chrBox1.setSelectedIndex(yChrom.getIndex()); chrBox2.setSelectedIndex(xChrom.getIndex()); rulerPanelX.setContext(xContext, HiCRulerPanel.Orientation.HORIZONTAL); rulerPanelY.setContext(yContext, HiCRulerPanel.Orientation.VERTICAL); resolutionSlider.setEnabled(!xChrom.getName().equals(Globals.CHR_ALL)); }
private void hideAaTypeOptions() { _het_models_aa.setVisible(false); _het_models_aa_combobox.setSelectedIndex(0); _aa_matrices_combobox.setSelectedIndex(0); _use_emp_base_freq_label.setVisible(false); _use_emp_base_freq_checkbox.setVisible(false); _use_emp_base_freq_checkbox.setSelected(false); }
/** Configure this panel for the Shapiro, Rambaut and Drummond 2006 codon position model */ private void setSRD06Model() { nucSubstCombo.setSelectedIndex(0); heteroCombo.setSelectedIndex(1); codingCombo.setSelectedIndex(1); substUnlinkCheck.setSelected(true); heteroUnlinkCheck.setSelected(true); freqsUnlinkCheck.setSelected(false); }
public void initUI() { scrollingToBottomCheckbox.setSelected(applicationPreferences.isScrollingToBottom()); coloringWholeRowCheckbox.setSelected(applicationPreferences.isColoringWholeRow()); showFullCallstackCheckbox.setSelected(applicationPreferences.isShowingFullCallstack()); showStackTraceCheckbox.setSelected(applicationPreferences.isShowingStackTrace()); usingWrappedExceptionStyleCheckbox.setSelected( applicationPreferences.isUsingWrappedExceptionStyle()); // look and feel { ArrayList<String> lookAndFeels = new ArrayList<>(); for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { lookAndFeels.add(info.getName()); } Collections.sort(lookAndFeels); int selectedIndex = 0; String lookAndFeel = applicationPreferences.getLookAndFeel(); if (lookAndFeel == null || "".equals(lookAndFeel)) { lookAndFeel = UIManager.getLookAndFeel().getName(); } int idx = lookAndFeels.indexOf(lookAndFeel); if (idx > -1) { selectedIndex = idx; } else { idx = lookAndFeels.indexOf(ApplicationPreferences.STARTUP_LOOK_AND_FEEL); if (idx > -1) { selectedIndex = idx; } } lookAndFeelCombo.setModel( new DefaultComboBoxModel<>(lookAndFeels.toArray(new String[lookAndFeels.size()]))); lookAndFeelCombo.setSelectedIndex(selectedIndex); } // default condition name { List<String> conditionNames = applicationPreferences.retrieveAllConditions(); String defaultName = applicationPreferences.getDefaultConditionName(); int idx = conditionNames.indexOf(defaultName); if (idx < 0) { idx = 0; } defaultConditionCombo.setModel( new DefaultComboBoxModel<>(conditionNames.toArray(new String[conditionNames.size()]))); defaultConditionCombo.setSelectedIndex(idx); } String appPath = applicationPreferences.getApplicationPath().getAbsolutePath(); appPathTextField.setText(appPath); appPathTextField.setToolTipText(appPath); globalLoggingEnabledCheckbox.setSelected(applicationPreferences.isGlobalLoggingEnabled()); loggingStatsEnabledCheckbox.setSelected(applicationPreferences.isLoggingStatisticEnabled()); trayActiveCheckbox.setSelected(applicationPreferences.isTrayActive()); trayActiveCheckbox.setEnabled(TraySupport.isAvailable()); hidingOnCloseCheckbox.setSelected(applicationPreferences.isHidingOnClose()); hidingOnCloseCheckbox.setEnabled(TraySupport.isAvailable()); }
public void setNativeFPS(int nfps) { nativeFPS = nfps; if (nfps == 60) nativeFPSCombo.setSelectedIndex(0); else if (nfps == 120) nativeFPSCombo.setSelectedIndex(1); else { nativeFPSCombo.insertItemAt(String.valueOf(nativeFPS), 2); nativeFPSCombo.setSelectedIndex(2); } }
/** * Creates an AttributeComparisonPanel from a list of attributes * * @param attributes the list of attributes of some feature type */ AttributeComparisonPanel(String[] attributes) { super(); attributeCombo = new JComboBox(attributes); attributeCombo.setSelectedIndex(0); operatorCombo = new JComboBox(OPERATORS); operatorCombo.setSelectedIndex(0); valueField = new JTextField(""); // $NON-NLS-1$ initGUI(); }
// Mode ajout public void modeAjout() { resetCollection(); loadCollection(); resetCategorie(); loadCategorie(); comboCollection.setEnabled(false); textTitre.setVisible(true); textTitre.setEnabled(true); textTitre.setEditable(true); textTitre.setText(""); textTitre.requestFocusInWindow(); textAnnee.setVisible(true); textAnnee.setEnabled(true); textAnnee.setEditable(true); textAnnee.setText(""); comboType.setVisible(true); comboType.setEnabled(true); comboType.setSelectedIndex(1); comboEval.setVisible(true); comboEval.setEnabled(true); comboEval.setSelectedIndex(0); // Juste au cas que ca foire scrollCom.setEnabled(true); scrollCat.setEnabled(true); textCommentaires.setEnabled(true); textCommentaires.setEditable(true); textCommentaires.setBackground(Color.WHITE); textCommentaires.setText(""); textCategories.setEnabled(true); textCategories.setEditable(false); textCategories.setBackground(GRIS); textCategories.setText(""); optionCategories[0].setEnabled(true); optionCategories[1].setEnabled(false); for (int i = 0; i < infos_film.length; i++) { infos_film[i].setVisible(false); } for (int k = 0; k < modeButton.length; k++) { if (k == 2) { modeButton[k].setEnabled(true); modeButton[k].setVisible(true); } else { modeButton[k].setEnabled(false); modeButton[k].setVisible(false); } } }
public GlobalAttributes() { setLayout(new BorderLayout()); LabelledList list = new LabelledList(includeAggregationMethodAttributes() ? "Add Data..." : "Redraw"); add(list, BorderLayout.CENTER); if (includeAggregationMethodAttributes()) { NumberTextField stepsField = new NumberTextField(1, true) { public double newValue(double value) { value = (long) value; if (value <= 0) return currentValue; else { interval = (long) value; return value; } } }; list.addLabelled("Every", stepsField); list.addLabelled("", new JLabel("...Timesteps")); String[] optionsLabel = {"Current", "Maximum", "Minimum", "Mean"}; final JComboBox optionsBox = new JComboBox(optionsLabel); optionsBox.setSelectedIndex(aggregationMethod); optionsBox.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { aggregationMethod = optionsBox.getSelectedIndex(); } }); list.addLabelled("Using", optionsBox); } String[] optionsLabel2 = new String[] { "When Adding Data", "Every 0.1 Seconds", "Every 0.5 Seconds", "Every Second", "Every 2 Seconds", "Every 5 Seconds", "Every 10 Seconds", "Never" }; final JComboBox optionsBox2 = new JComboBox(optionsLabel2); optionsBox2.setSelectedIndex(redraw); optionsBox2.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { redraw = optionsBox2.getSelectedIndex(); generator.update(); // keep up-to-date } }); if (includeAggregationMethodAttributes()) list.addLabelled("Redraw", optionsBox2); else list.add(optionsBox2); }
public void load() { if (MCPatcherUtils.getBoolean(MCPatcherUtils.HD_TEXTURES, customTag, true)) { comboBox.setSelectedIndex(OPT_CUSTOM_ANIMATED); } else if (MCPatcherUtils.getBoolean(MCPatcherUtils.HD_TEXTURES, animatedTag, true)) { comboBox.setSelectedIndex(OPT_DEFAULT); } else { comboBox.setSelectedIndex(OPT_NOT_ANIMATED); } }
// Mode recherche public void modeRecherche() { resetCollection(); comboCollection.setEnabled(false); textTitre.setVisible(true); textTitre.setEnabled(true); textTitre.setEditable(true); textTitre.setText(""); textTitre.requestFocusInWindow(); textAnnee.setVisible(true); textAnnee.setEnabled(true); textAnnee.setEditable(true); textAnnee.setText(""); comboType.setVisible(true); comboType.setEnabled(true); comboType.setSelectedIndex(0); comboEval.setVisible(true); comboEval.setEnabled(false); // comboEval.setFont(); comboEval.setSelectedIndex(0); textCommentaires.setEnabled(true); textCommentaires.setEditable(false); textCommentaires.setBackground(GRIS); textCommentaires.setText(""); textCategories.setEnabled(true); textCategories.setEditable(false); textCategories.setBackground(GRIS); textCategories.setText(""); for (int i = 0; i < infos_film.length; i++) { infos_film[i].setVisible(false); } for (int k = 0; k < modeButton.length; k++) { modeButton[k].setEnabled(false); modeButton[k].setVisible(false); } modeButton[5].setVisible(true); // modeButton[6].setVisible(true); boolean enabled = true; if (listeEstVide()) { enabled = false; } optionCategories[0].setEnabled(enabled); optionCategories[1].setEnabled(enabled); modeButton[5].setEnabled(enabled); modeButton[6].setEnabled(true); }
/** * Handle a refresh of the style panel after the fig has moved. * * <p><em>Warning</em>. There is a circular trap here. Editing the boundary box will also trigger * a refresh, and so we reset the boundary box, which causes funny behaviour (the cursor keeps * jumping to the end of the text). * * <p>The solution is to not reset the boundary box field if the boundaries have not changed. * * <p> */ public void refresh() { Fig target = getPanelTarget(); if (target instanceof FigEdgeModelElement) { hasEditableBoundingBox(false); } else { hasEditableBoundingBox(true); } if (target == null) return; // The boundary box as held in the target fig, and as listed in // the // boundary box style field (null if we don't have anything // valid) Rectangle figBounds = target.getBounds(); Rectangle styleBounds = parseBBox(); // Only reset the text if the two are not the same (i.e the fig // has // moved, rather than we've just edited the text, when // setTargetBBox() // will have made them the same). Note that styleBounds could // be null, // so we do the test this way round. if (!(figBounds.equals(styleBounds))) { bboxField.setText( figBounds.x + "," + figBounds.y + "," + figBounds.width + "," + figBounds.height); } // Change the fill colour if (target.getFilled()) { Color c = target.getFillColor(); fillField.setSelectedItem(c); if (c != null && !fillField.getSelectedItem().equals(c)) { fillField.insertItemAt(c, fillField.getItemCount() - 1); fillField.setSelectedItem(c); } } else { fillField.setSelectedIndex(0); } // Change the line colour if (target.getLineWidth() > 0) { Color c = target.getLineColor(); lineField.setSelectedItem(c); if (c != null && !lineField.getSelectedItem().equals(c)) { lineField.insertItemAt(c, lineField.getItemCount() - 1); lineField.setSelectedItem(c); } } else { lineField.setSelectedIndex(0); } }
private void loadPreferences() { // grab the preferences so that they can be used to fill out the layout ThumbMakerPreferences myPreferences = ThumbMakerPreferences.getInstance(); // x resolution text box xres.setText(myPreferences.getStringPref(ThumbMakerPreferences.RES_WIDTH_PREF_NAME)); // y resolution text box yres.setText(myPreferences.getStringPref(ThumbMakerPreferences.RES_HEIGHT_PREF_NAME)); // aspect ratio checkbox aspect.setSelected( myPreferences .getStringPref(ThumbMakerPreferences.DO_MAINTAIN_ASPECT_PREF_NAME) .equalsIgnoreCase(ThumbMakerPreferences.BOOLEAN_TRUE_STRING)); // load the color values from the preferences int redValueNumber = myPreferences.getIntegerPref(ThumbMakerPreferences.RED_VALUE_PREF_NAME); int greenValueNumber = myPreferences.getIntegerPref(ThumbMakerPreferences.GREEN_VALUE_PREF_NAME); int blueValueNumber = myPreferences.getIntegerPref(ThumbMakerPreferences.BLUE_VALUE_PREF_NAME); // set the background color image colorBox.setBackground(new Color(redValueNumber, greenValueNumber, blueValueNumber)); // red slider red.setValue(redValueNumber); redValue.setText("" + redValueNumber); // green slider green.setValue(greenValueNumber); greenValue.setText("" + greenValueNumber); // blue slider blue.setValue(blueValueNumber); blueValue.setText("" + blueValueNumber); // algorithm combo box algorithm.setSelectedIndex( myPreferences.getIntegerPref(ThumbMakerPreferences.RESIZE_ALG_PREF_NAME)); // format combo box format.setSelectedIndex( myPreferences.getIntegerPref(ThumbMakerPreferences.THUMB_FORMAT_PREF_NAME)); // prepend field prepend.setText(myPreferences.getStringPref(ThumbMakerPreferences.STRING_TO_PREPEND_PREF_NAME)); // append field append.setText(myPreferences.getStringPref(ThumbMakerPreferences.STRING_TO_APPEND_PREF_NAME)); // output folder field output.setText( (new File(myPreferences.getStringPref(ThumbMakerPreferences.FILE_PATH_STRING_PREF_NAME))) .getAbsolutePath()); }