private boolean setType(String action) {
   if (action.equals("ByteBinary")) {
     params.setProperty("type", Integer.toString(BufferedImage.TYPE_BYTE_BINARY));
     buttonByteBinary.setSelected(true);
     buttonBPP1.setEnabled(true);
     buttonBPP2.setEnabled(true);
     buttonBPP4.setEnabled(true);
     buttonBPP8.setEnabled(false);
     if (buttonBPP8.isSelected()) {
       setBPP("bpp4");
     }
   } else if (action.equals("ByteIndexed")) {
     params.setProperty("type", Integer.toString(BufferedImage.TYPE_BYTE_INDEXED));
     buttonByteIndexed.setSelected(true);
     buttonBPP1.setEnabled(false);
     buttonBPP2.setEnabled(false);
     buttonBPP4.setEnabled(false);
     buttonBPP8.setEnabled(true);
     setBPP("bpp8");
   } else if (action.equals("ByteGrayScale")) {
     params.setProperty("type", Integer.toString(BufferedImage.TYPE_BYTE_GRAY));
     buttonByteGrayScaled.setSelected(true);
     buttonBPP1.setEnabled(false);
     buttonBPP2.setEnabled(false);
     buttonBPP4.setEnabled(false);
     buttonBPP8.setEnabled(true);
     setBPP("bpp8");
   } else {
     return false;
   }
   return true;
 }
 private void refreshSelection(int choice) {
   if (choice == POINT_PRIX) {
     pointsPrix.setSelected(true);
     prixParPoint.setEditable(true);
     prixParPoint.setEnabled(true);
     pointsService.setSelected(false);
     pointsParAutre.setEditable(false);
     pointsParAutre.setEnabled(false);
     pointsParCoiffure.setEditable(false);
     pointsParCoiffure.setEnabled(false);
     pointsParCoupe.setEditable(false);
     pointsParCoupe.setEnabled(false);
     pointsParCouleur.setEditable(false);
     pointsParCouleur.setEnabled(false);
   } else if (choice == POINT_SERVICE) {
     pointsPrix.setSelected(false);
     prixParPoint.setEditable(false);
     prixParPoint.setEnabled(false);
     pointsService.setSelected(true);
     pointsParAutre.setEditable(true);
     pointsParAutre.setEnabled(true);
     pointsParCoiffure.setEditable(true);
     pointsParCoiffure.setEnabled(true);
     pointsParCoupe.setEditable(true);
     pointsParCoupe.setEnabled(true);
     pointsParCouleur.setEditable(true);
     pointsParCouleur.setEnabled(true);
   }
 }
  @Override
  public void setDialogConfiguration(Properties configuration) {
    if (mDefaultColumn == -1) {
      int column = mTableModel.findColumn(configuration.getProperty(PROPERTY_COLUMN));
      if (column == -1) mComboBoxColumn.setSelectedItem(configuration.getProperty(PROPERTY_COLUMN));
      else mComboBoxColumn.setSelectedItem(mTableModel.getColumnTitle(column));

      mRadioButtonIsStructure.setSelected(
          "true".equals(configuration.getProperty(PROPERTY_IS_STRUCTURE)));

      int sortMode =
          findListIndex(configuration.getProperty(PROPERTY_SORT_MODE), SORT_MODE_CODE, -1);
      if (sortMode == -1) {
        String itemString = configuration.getProperty(PROPERTY_LIST, "");
        mRadioButton.setSelected(itemString.length() != 0);
        mTextArea.setText(itemString.replace('\t', '\n'));
        if ("true".equals(configuration.getProperty(PROPERTY_IS_STRUCTURE)))
          updateMacroListEditor(true);
      } else {
        mTextArea.setText("");
        mRadioButton.setSelected(true);
        mRadioButtonSort.setSelected(true);
        mComboBoxSortMode.setSelectedIndex(sortMode);
        mComboBoxSortColumn.setSelectedItem(configuration.getProperty(PROPERTY_SORT_COLUMN, ""));
      }
    } else {
      boolean isCustomOrder = (mTableModel.getCategoryCustomOrder(mDefaultColumn) != null);
      mRadioButton.setSelected(isCustomOrder);
      updateList(null, false);
    }

    enableItems();
  }
示例#4
0
  private void updateShipLoadNames() {
    log.debug("Update ship load names");
    panelShipLoads.removeAll();
    if (_track != null) {
      // set radio button
      shipLoadNameAll.setSelected(_track.getShipLoadOption().equals(Track.ALL_LOADS));
      shipLoadNameInclude.setSelected(_track.getShipLoadOption().equals(Track.INCLUDE_LOADS));
      shipLoadNameExclude.setSelected(_track.getShipLoadOption().equals(Track.EXCLUDE_LOADS));

      pShipLoadControls.setVisible(!shipLoadNameAll.isSelected());

      if (!shipLoadNameAll.isSelected()) {
        int x = 0;
        int y = 0; // vertical position in panel

        int numberOfLoads = getNumberOfCheckboxesPerLine() / 2 + 1;
        for (String loadName : _track.getShipLoadNames()) {
          JLabel load = new JLabel();
          load.setText(loadName);
          addItemTop(panelShipLoads, load, x++, y);
          // limit the number of loads per line
          if (x > numberOfLoads) {
            y++;
            x = 0;
          }
        }
        revalidate();
      }
    } else {
      shipLoadNameAll.setSelected(true);
    }
    panelShipLoads.repaint();
    panelShipLoads.revalidate();
  }
 @Override
 public void selectFlightConfigType(final FlightConfigType flightConfigType) {
   switch (flightConfigType) {
     case QUAD_X:
       _quadXRadioButton.setSelected(true);
       break;
     case QUAD_PLUS:
       _quadPlusRadioButton.setSelected(true);
       break;
     case HEX_PLUS:
       _hexPlusRadioButton.setSelected(true);
       break;
     case HEX_X:
       _hexXRadioButton.setSelected(true);
       break;
     case TRI:
       _triRadioButton.setSelected(true);
       break;
     case QUAD_Y4:
       _quadY4RadioButton.setSelected(true);
       break;
     case HEX_Y6:
       _hexY6RadioButton.setSelected(true);
       break;
     case OCTO_X8:
       _octoX8RadioButton.setSelected(true);
       break;
     case OCTO_PLUS:
       _octoPlusRadioButton.setSelected(true);
       break;
     case OCTO_X:
       _octoXRadioButton.setSelected(true);
       break;
   }
 }
示例#6
0
  @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());
    }
  }
  private void initControls(final LauncherParameters launcherParameters) {
    final LauncherParameters.LauncherType launcherType = launcherParameters.getLauncherType();
    myDefaultOSApplicationRadioButton.setSelected(
        launcherType == LauncherParameters.LauncherType.OSDefault);
    myBrowserRadioButton.setSelected(launcherType == LauncherParameters.LauncherType.Browser);
    myPlayerRadioButton.setSelected(launcherType == LauncherParameters.LauncherType.Player);

    myBrowserSelector.setSelected(launcherParameters.getBrowser());

    myPlayerTextWithBrowse.setText(
        FileUtil.toSystemDependentName(launcherParameters.getPlayerPath()));
    myPlayerTextWithBrowse.addBrowseFolderListener(
        null,
        null,
        myProject,
        new FileChooserDescriptor(true, true, false, false, false, false) {
          @Override
          public boolean isFileSelectable(final VirtualFile file) {
            return SystemInfo.isMac
                    && file.isDirectory()
                    && "app".equalsIgnoreCase(file.getExtension())
                || !file.isDirectory();
          }
        });
    myNewPlayerInstanceCheckBox.setVisible(SystemInfo.isMac);
  }
  @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();
    }
  }
示例#9
0
  /**
   * Builds and displays the window to the user.
   *
   * @param currentSortMode - The current sort mode which will be pre-selected in the list
   */
  public void showSortDialog(Comparator<Note> currentSortMode) {
    JLabel label = new JLabel(tr("Select note sorting method"));
    if (currentSortMode == NoteData.DEFAULT_COMPARATOR) {
      defaultSort.setSelected(true);
    } else if (currentSortMode == NoteData.DATE_COMPARATOR) {
      dateSort.setSelected(true);
    } else if (currentSortMode == NoteData.USER_COMPARATOR) {
      userSort.setSelected(true);
    } else if (currentSortMode == NoteData.LAST_ACTION_COMPARATOR) {
      lastActionSort.setSelected(true);
    } else {
      Main.warn("sort mode not recognized");
    }

    ButtonGroup bg = new ButtonGroup();
    bg.add(defaultSort);
    bg.add(userSort);
    bg.add(dateSort);
    bg.add(lastActionSort);

    JPanel panel = new JPanel();
    panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
    panel.add(label);
    panel.add(defaultSort);
    panel.add(userSort);
    panel.add(dateSort);
    panel.add(lastActionSort);

    setContent(panel);

    showDialog();
  }
示例#10
0
  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 ReadOnlyStatusDialog(Project project, final FileInfo[] files) {
    super(project);
    myFiles = files;
    initFileList();

    ActionListener listener =
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            myChangelist.setEnabled(myUsingVcsRadioButton.isSelected());
          }
        };
    myUsingVcsRadioButton.addActionListener(listener);
    myUsingFileSystemRadioButton.addActionListener(listener);

    if (myUsingVcsRadioButton.isEnabled()) {
      myUsingVcsRadioButton.setSelected(true);
    } else {
      myUsingFileSystemRadioButton.setSelected(true);
    }
    myChangelist.setEnabled(myUsingVcsRadioButton.isSelected());
    myFileList.setCellRenderer(new FileListRenderer());
    setTitle(VcsBundle.message("dialog.title.clear.read.only.file.status"));

    init();
  }
  /*
   * Update radio button names in the same order as the table
   */
  private void updateControlPanel() {
    schedule.removeAll();
    noneButton.setName(""); // Name holds schedule id for the selected radio button
    noneButton.setSelected(true);
    commentTextArea.setText(""); // no text for the noneButton
    enableButtons(false);
    schedule.add(noneButton);
    schGroup.add(noneButton);

    for (int i = trainsScheduleModel.getFixedColumn();
        i < trainsScheduleModel.getColumnCount();
        i++) {
      log.debug("Column name: {}", trainsScheduleTable.getColumnName(i));
      TrainSchedule ts =
          trainScheduleManager.getScheduleByName(trainsScheduleTable.getColumnName(i));
      if (ts != null) {
        JRadioButton b = new JRadioButton();
        b.setText(ts.getName());
        b.setName(ts.getId());
        schedule.add(b);
        schGroup.add(b);
        addRadioButtonAction(b);
        if (b.getName().equals(trainManager.getTrainScheduleActiveId())) {
          b.setSelected(true);
          enableButtons(true);
          // update comment field
          commentTextArea.setText(ts.getComment());
        }
      }
    }
    schedule.revalidate();
  }
示例#14
0
 /*
  * Metodo mostrarLibro()
  * sin parametros, sin retorno, muestra los datos del elemento del vector seleccionado
  */
 private void mostrarLibro() {
   int seleccion = librosCombo.getSelectedIndex();
   Libro l = (Libro) librosCombo.getItemAt(seleccion);
   tituloLibro.setText(l.getTituloLibro());
   autorNombres.setText(l.getAutorNombres());
   apellidosAutor.setText(l.getApellidosAutor());
   nombreEditorial.setText(l.getNombreEditorial());
   añoPublicacion.setText(String.valueOf(l.getAñoPublicacion()));
   codigoISBN.setText(l.getCodigoISBN());
   lugarPublicacion.setText(l.getLugarPublicacion());
   numeroPaginas.setText(String.valueOf(l.getNumeroPaginas()));
   descripcionArea.setText(l.getDescripcionLibro());
   subgeneroCombo.setSelectedItem(l.getSubgeneroLibro());
   // generoLiricoRadio.setSelected(true);
   // semestreSpinner.setValue(1);}
   if (l.getGenero() == 'N') {
     generoNarrativoRadio.setSelected(true);
   } else if (l.getGenero() == 'D') {
     generoDramaRadio.setSelected(true);
   } else {
     generoLiricoRadio.setSelected(true);
   }
   españolCheck.setSelected(l.isEspañolCheck());
   inglesCheck.setSelected(l.isInglesCheck());
   mandarinCheck.setSelected(l.isMandarinCheck());
 }
  public void updateDisplayStrings() {

    String lastUsedSeedText =
        (det.getLastUsedSeed() != SeedDetermination.NULL_SEED)
            ? " (" + String.valueOf(det.getLastUsedSeed()) + ")"
            : "";

    fromLastRun.setText("From last run" + lastUsedSeedText);
    fromLastRun.setEnabled(det.foundLastUsedSeed());
    fromLastRun.setSelected(det.foundLastUsedSeed());

    newSeed.setText("New seed (" + det.getNewSeed() + ")");

    ConfigFile f = det.getConfigFile();
    if (f == null) {
      fromConfig.setText("From config");
      fromConfig.setEnabled(false);
    } else {
      String s = f.getSeedInConfig();
      fromConfig.setEnabled(s != null);
      fromConfig.setText("From config (" + s + ")");
    }

    newSeed.setSelected(!fromConfig.isEnabled() && !det.foundLastUsedSeed());
    fromConfig.setSelected(!det.foundLastUsedSeed && fromConfig.isEnabled());
    customSeed.setSelected(false);

    if (det.foundLastUsedSeed()) {
      det.choose(SeedDeterminationChoice.fromLastRun);
    } else if (fromConfig.isEnabled()) {
      det.choose(SeedDeterminationChoice.fromConfig);
    } else {
      det.choose(SeedDeterminationChoice.newSeed);
    }
  }
  public ParseFileWizardStep(String i18nKey, CSVDataReader reader) {
    super(i18nKey);
    this.editor = new MetaDataDeclarationEditor(reader, false);

    skipCommentsBox.setSelected(
        reader.getParameterAsBoolean(CSVDataReader.PARAMETER_SKIP_COMMENTS));

    useFirstRowAsColumnNamesBox.setSelected(
        reader.getParameterAsBoolean(CSVDataReader.PARAMETER_USE_FIRST_ROW_AS_ATTRIBUTE_NAMES));

    useQuotesBox.setSelected(reader.getParameterAsBoolean(CSVDataReader.PARAMETER_USE_QUOTES));

    String sep = LineParser.DEFAULT_SPLIT_EXPRESSION;
    regexButton.setSelected(true);
    try {
      sep = reader.getParameter(CSVDataReader.PARAMETER_COLUMN_SEPARATORS);
    } catch (UndefinedParameterError e1) {
      e1.printStackTrace();
    }
    if (sep.equals(LineParser.SPLIT_BY_COMMA_EXPRESSION)) {
      commaButton.setSelected(true);
    }
    if (sep.equals(LineParser.SPLIT_BY_SEMICOLON_EXPRESSION)) {
      semicolonButton.setSelected(true);
    }
    if (sep.equals(LineParser.SPLIT_BY_TAB_EXPRESSION)) {
      tabButton.setSelected(true);
    }
    if (sep.equals(LineParser.SPLIT_BY_SPACE_EXPRESSION)) {
      spaceButton.setSelected(true);
    }
  }
示例#17
0
 /**
  * Adds the connection speed options to the display.
  *
  * @param index The default index.
  * @param comp The component to add to the display.
  * @return See above.
  */
 private JPanel buildConnectionSpeed(int index, JComponent comp) {
   JPanel p = new JPanel();
   p.setBorder(BorderFactory.createTitledBorder("Connection Speed"));
   buttonsGroup = new ButtonGroup();
   JRadioButton button = new JRadioButton();
   button.setText("LAN");
   button.setActionCommand("" + HIGH_SPEED);
   button.addActionListener(this);
   button.setSelected(index == LoginCredentials.HIGH);
   buttonsGroup.add(button);
   p.add(button);
   button = new JRadioButton();
   button.setText("High (Broadband)");
   button.setActionCommand("" + MEDIUM_SPEED);
   button.setSelected(index == LoginCredentials.MEDIUM);
   button.addActionListener(this);
   buttonsGroup.add(button);
   p.add(button);
   button = new JRadioButton();
   button.setText("Low (Dial-up)");
   button.setActionCommand("" + LOW_SPEED);
   button.setSelected(index == LoginCredentials.LOW);
   button.addActionListener(this);
   buttonsGroup.add(button);
   p.add(button);
   if (comp == null) return p;
   JPanel content = new JPanel();
   content.setLayout(new BoxLayout(content, BoxLayout.Y_AXIS));
   content.add(comp);
   p = UIUtilities.buildComponentPanel(p);
   content.add(p);
   return content;
 }
 /** Show the filter dialog */
 public void showDialog() {
   empty_border = new EmptyBorder(5, 5, 0, 5);
   indent_border = new EmptyBorder(5, 25, 5, 5);
   include_panel =
       new ServiceFilterPanel("Include messages based on target service:", filter_include_list);
   exclude_panel =
       new ServiceFilterPanel("Exclude messages based on target service:", filter_exclude_list);
   status_box = new JCheckBox("Filter messages based on status:");
   status_box.addActionListener(this);
   status_active = new JRadioButton("Active messages only");
   status_active.setSelected(true);
   status_active.setEnabled(false);
   status_complete = new JRadioButton("Complete messages only");
   status_complete.setEnabled(false);
   status_group = new ButtonGroup();
   status_group.add(status_active);
   status_group.add(status_complete);
   if (filter_active || filter_complete) {
     status_box.setSelected(true);
     status_active.setEnabled(true);
     status_complete.setEnabled(true);
     if (filter_complete) {
       status_complete.setSelected(true);
     }
   }
   status_options = new JPanel();
   status_options.setLayout(new BoxLayout(status_options, BoxLayout.Y_AXIS));
   status_options.add(status_active);
   status_options.add(status_complete);
   status_options.setBorder(indent_border);
   status_panel = new JPanel();
   status_panel.setLayout(new BorderLayout());
   status_panel.add(status_box, BorderLayout.NORTH);
   status_panel.add(status_options, BorderLayout.CENTER);
   status_panel.setBorder(empty_border);
   ok_button = new JButton("Ok");
   ok_button.addActionListener(this);
   cancel_button = new JButton("Cancel");
   cancel_button.addActionListener(this);
   buttons = new JPanel();
   buttons.setLayout(new FlowLayout());
   buttons.add(ok_button);
   buttons.add(cancel_button);
   panel = new JPanel();
   panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
   panel.add(include_panel);
   panel.add(exclude_panel);
   panel.add(status_panel);
   panel.add(buttons);
   dialog = new JDialog();
   dialog.setTitle("SOAP Monitor Filter");
   dialog.setContentPane(panel);
   dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
   dialog.setModal(true);
   dialog.pack();
   Dimension d = dialog.getToolkit().getScreenSize();
   dialog.setLocation((d.width - dialog.getWidth()) / 2, (d.height - dialog.getHeight()) / 2);
   ok_pressed = false;
   dialog.show();
 }
示例#19
0
  /**
   * Clears and focuses the search field if it is not focused. Otherwise, cycles to the next search
   * type.
   */
  public void startSearch() {
    if (increment.isSelected() && incSearch) {
      repeatIncremental();
      return;
    }
    if (!searchField.hasFocus()) {
      // searchField.setText("");
      searchField.selectAll();
      searchField.requestFocus();
    } else {
      if (increment.isSelected()) {
        floatSearch.setSelected(true);
      } else if (floatSearch.isSelected()) {
        hideSearch.setSelected(true);
      } else if (hideSearch.isSelected()) {
        showResultsInDialog.setSelected(true);
      } else if (showResultsInDialog.isSelected()) {
        searchAllBases.setSelected(true);
      } else {
        increment.setSelected(true);
      }
      increment.revalidate();
      increment.repaint();

      searchField.requestFocus();
    }
  }
 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);
 }
  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);
  }
示例#22
0
 /** Set preferences controls according to this <code>Properties</code>. */
 public void setPreferences(Properties preferences) {
   prefs = preferences;
   if (prefs.getProperty(Lister.PREFS_SEL_REMEMBER).equals("true")) {
     lastRadio.setSelected(true);
   } else {
     defaultRadio.setSelected(true);
   }
 }
示例#23
0
 private void setTrainActionButton() {
   moveRB.setSelected(trainManager.getTrainsFrameTrainAction().equals(TrainsTableFrame.MOVE));
   terminateRB.setSelected(
       trainManager.getTrainsFrameTrainAction().equals(TrainsTableFrame.TERMINATE));
   resetRB.setSelected(trainManager.getTrainsFrameTrainAction().equals(TrainsTableFrame.RESET));
   conductorRB.setSelected(
       trainManager.getTrainsFrameTrainAction().equals(TrainsTableFrame.CONDUCTOR));
 }
  public AnchorPointClassificationPanel(
      Object displacement, String title, List<QualifiedName> properties) {
    this.title = title;

    fixed = new JRadioButton();
    property = new JRadioButton();

    ButtonGroup bg = new ButtonGroup();
    bg.add(fixed);
    bg.add(property);

    propertyCBx = new JComboBox();
    propertyCBx.setRenderer(new PropertyNameRenderer());
    for (QualifiedName qn : properties) {
      propertyCBx.addItem(new PropertyName(qn));
    }
    propertyCBy = new JComboBox();
    propertyCBy.setRenderer(new PropertyNameRenderer());
    for (QualifiedName qn : properties) {
      propertyCBy.addItem(new PropertyName(qn));
    }

    anchorEditor = new AnchorEditor();

    if (displacement instanceof Pair<?, ?>) {
      property.setSelected(true);
      propertyCBx.setSelectedItem(((Pair<?, ?>) displacement).first);
      propertyCBy.setSelectedItem(((Pair<?, ?>) displacement).second);
    } else if (displacement instanceof Point2d) {
      fixed.setSelected(true);
      anchorEditor.setValue(((Point2d) displacement).x, ((Point2d) displacement).y);
    } else {
      fixed.setSelected(true);
    }
    if (properties == null || properties.isEmpty()) {
      propertyCBx.setEnabled(false);
      propertyCBy.setEnabled(false);
      property.setEnabled(false);
    }

    FormLayout fl =
        new FormLayout(
            "$rgap, 15dlu, left:default:grow(1.0)",
            "$sepheight, center:[20dlu,default], $ug, $sepheight, bottom:10dlu, center:$cpheight, bottom:10dlu,center:$cpheight");
    DefaultFormBuilder builder = new DefaultFormBuilder(fl);
    CellConstraints cc = new CellConstraints();
    builder.addSeparator(get("$MD11713"), cc.xyw(1, 1, 3));
    builder.add(fixed, cc.xy(2, 2));
    builder.add(anchorEditor, cc.xy(3, 2));

    builder.addSeparator(get("$MD11714"), cc.xyw(1, 4, 3));
    builder.add(property, cc.xywh(2, 5, 1, 4));
    builder.addLabel(get("$MD10835"), cc.xy(3, 5));
    builder.add(propertyCBx, cc.xy(3, 6));
    builder.addLabel(get("$MD10836"), cc.xy(3, 7));
    builder.add(propertyCBy, cc.xy(3, 8));
    add(builder.getPanel());
  }
示例#25
0
 /**
  * Sets the radiobuttons to the correct mode
  *
  * @param mode The new mode
  */
 public void setMode(ClientMode mode) {
   if (client.getMode().equals(ClientMode.GenerateNumbers)) {
     btnCompute.setSelected(true);
   } else if (client.getMode().equals(ClientMode.ReturnData)) {
     btnReturn.setSelected(true);
   } else if (client.getMode().equals(ClientMode.Sleep)) {
     btnSleep.setSelected(true);
   }
 }
示例#26
0
  /*
   * Set actions of radioButtons to change family
   */
  protected JPanel makeFamilyButtons(Iterator<String> it, boolean setDefault) {
    JPanel familyPanel = new JPanel();
    familyPanel.setLayout(new BoxLayout(familyPanel, BoxLayout.Y_AXIS));
    String txt = Bundle.getMessage("IconFamiliesLabel", Bundle.getMessage(_itemType));
    JPanel p = new JPanel(new FlowLayout());
    p.add(new JLabel(txt));
    familyPanel.add(p);
    _familyButtonGroup = new ButtonGroup();
    JPanel buttonPanel = new JPanel(new FlowLayout());
    String family = null;
    JRadioButton button = null;
    int count = 0;
    while (it.hasNext()) {
      family = it.next();
      count++;
      button = new JRadioButton(ItemPalette.convertText(family));
      button.addActionListener(
          new ActionListener() {
            String fam;

            public void actionPerformed(ActionEvent e) {
              setFamily(fam);
            }

            ActionListener init(String f) {
              fam = f;
              if (log.isDebugEnabled()) {
                log.debug(
                    "ActionListener.init : for type \"" + _itemType + "\", family \"" + fam + "\"");
              }
              return this;
            }
          }.init(family));
      if (family.equals(_family)) {
        button.setSelected(true);
      }
      if (count > 4) {
        count = 0;
        familyPanel.add(buttonPanel);
        buttonPanel = new JPanel(new FlowLayout());
        buttonPanel.setLayout(new FlowLayout()); // new BoxLayout(p, BoxLayout.Y_AXIS)
      }
      buttonPanel.add(button);
      _familyButtonGroup.add(button);
    }
    familyPanel.add(buttonPanel);
    if (setDefault && !family.equals(_family)) {
      _family = family; // let last family be the selected one
      if (button != null) {
        button.setSelected(true);
      } else {
        log.warn("null button after setting family");
      }
    }
    familyPanel.add(buttonPanel);
    return familyPanel;
  }
  protected void _init() {
    ButtonHandler handler = new ButtonHandler();

    // Core
    JPanel corePanel = new JPanel();
    corePanel.setLayout(new BoxLayout(corePanel, BoxLayout.X_AXIS));
    corePanel.add(
        coreIncluded = new JRadioButton(jEdit.getProperty("options.clojure.included-core-label")));
    corePanel.add(coreCustom = new JRadioButton(jEdit.getProperty("options.clojure.choose-label")));
    ButtonGroup coreGroup = new ButtonGroup();
    coreGroup.add(coreIncluded);
    coreGroup.add(coreCustom);
    corePanel.add(new JSeparator(JSeparator.VERTICAL));
    corePanel.add(corePath = new JTextField());
    coreBrowse = new JButton(jEdit.getProperty("vfs.browser.browse.label"));
    coreBrowse.addActionListener(new BrowseHandler(corePath));
    corePanel.add(coreBrowse);
    String core = plugin.getClojureCore();
    if (core.equals(ClojurePlugin.includedCore)) {
      coreIncluded.setSelected(true);
      corePath.setEnabled(false);
      coreBrowse.setEnabled(false);
    } else {
      coreCustom.setSelected(true);
      corePath.setText(core);
    }
    coreIncluded.addActionListener(handler);
    coreCustom.addActionListener(handler);
    addComponent("Core:", corePanel);

    // Contrib
    JPanel contribPanel = new JPanel();
    contribPanel.setLayout(new BoxLayout(contribPanel, BoxLayout.X_AXIS));
    contribPanel.add(contribIncluded = new JRadioButton("Included (1.1.0)"));
    contribPanel.add(contribCustom = new JRadioButton("Choose jar"));
    ButtonGroup contribGroup = new ButtonGroup();
    contribGroup.add(contribIncluded);
    contribGroup.add(contribCustom);
    contribPanel.add(new JSeparator(JSeparator.VERTICAL));
    contribPanel.add(contribPath = new JTextField());
    contribBrowse = new JButton(jEdit.getProperty("vfs.browser.browse.label"));
    contribBrowse.addActionListener(new BrowseHandler(contribPath));
    contribPanel.add(contribBrowse);
    String contrib = plugin.getClojureContrib();
    if (contrib.equals(ClojurePlugin.includedContrib)) {
      contribIncluded.setSelected(true);
      contribPath.setEnabled(false);
      contribBrowse.setEnabled(false);
    } else {
      contribCustom.setSelected(true);
      contribPath.setText(contrib);
    }
    contribIncluded.addActionListener(handler);
    contribCustom.addActionListener(handler);
    addComponent("Contrib:", contribPanel);
  }
 public static void ChooseGender(
     Boolean confirm, JRadioButton radioLakilaki, JRadioButton radioPerempuan) {
   if (confirm == true) {
     radioLakilaki.setSelected(true);
     radioPerempuan.setSelected(false);
   } else {
     radioLakilaki.setSelected(false);
     radioPerempuan.setSelected(true);
   }
 }
示例#29
0
  private void updateGUI() {

    isUpdating = true;

    ckManual.setSelected(settings.useManualClasses);

    rbFreq.setSelected(settings.frequencyType == StatPanelSettings.TYPE_COUNT);
    rbRelative.setSelected(settings.frequencyType == StatPanelSettings.TYPE_RELATIVE);
    rbNormalized.setSelected(settings.frequencyType == StatPanelSettings.TYPE_NORMALIZED);

    rbLeftRule.setSelected(settings.isLeftRule);

    ckCumulative.setSelected(settings.isCumulative);
    ckOverlayNormal.setSelected(settings.hasOverlayNormal);
    ckOverlayPolygon.setSelected(settings.hasOverlayPolygon);
    ckShowGrid.setSelected(settings.showGrid);
    ckAutoWindow.setSelected(settings.isAutomaticWindow);
    ckShowFrequencyTable.setSelected(settings.showFrequencyTable);

    lblYMin.setVisible(showYSettings);
    fldYMin.setVisible(showYSettings);
    lblYMax.setVisible(showYSettings);
    fldYMax.setVisible(showYSettings);
    lblYInterval.setVisible(showYSettings);
    fldYInterval.setVisible(showYSettings);

    // enable/disable window dimension components
    dimPanel.setEnabled(!ckAutoWindow.isSelected());
    fldXMin.setEnabled(!ckAutoWindow.isSelected());
    fldXMax.setEnabled(!ckAutoWindow.isSelected());
    fldXInterval.setEnabled(!ckAutoWindow.isSelected());
    fldYMin.setEnabled(!ckAutoWindow.isSelected());
    fldYMax.setEnabled(!ckAutoWindow.isSelected());
    fldYInterval.setEnabled(!ckAutoWindow.isSelected());

    lblXMin.setEnabled(!ckAutoWindow.isSelected());
    lblXMax.setEnabled(!ckAutoWindow.isSelected());
    lblXInterval.setEnabled(!ckAutoWindow.isSelected());
    lblYMin.setEnabled(!ckAutoWindow.isSelected());
    lblYMax.setEnabled(!ckAutoWindow.isSelected());
    lblYInterval.setEnabled(!ckAutoWindow.isSelected());

    // enable/disable normal overlay option
    ckOverlayNormal.setEnabled(settings.frequencyType == StatPanelSettings.TYPE_NORMALIZED);

    if (ckAutoWindow.isSelected()) {
      fldXMin.setText("" + statDialog.format(settings.xMin));
      fldXMax.setText("" + statDialog.format(settings.xMax));
      fldYMin.setText("" + statDialog.format(settings.yMin));
      fldYMax.setText("" + statDialog.format(settings.yMax));
    }

    isUpdating = false;
    repaint();
  }
示例#30
0
 public void init() {
   snapToVerticesCheckBox.setSelected(blackboard.get(SnapToVerticesPolicy.ENABLED_KEY, false));
   toleranceTextField.setText("" + SnapManager.getToleranceInPixels(blackboard));
   snapToFeaturesCheckBox.setSelected(blackboard.get(SnapToFeaturesPolicy.ENABLED_KEY, false));
   snapToGridCheckBox.setSelected(blackboard.get(SnapToGridPolicy.ENABLED_KEY, false));
   gridSizeTextField.setText("" + blackboard.get(SnapToGridPolicy.GRID_SIZE_KEY, 20d));
   showGridCheckBox.setSelected(blackboard.get(GridRenderer.ENABLED_KEY, false));
   showGridDotsRadioButton.setSelected(blackboard.get(GridRenderer.DOTS_ENABLED_KEY, false));
   showGridLinesRadioButton.setSelected(blackboard.get(GridRenderer.LINES_ENABLED_KEY, true));
   updateEnabled();
 }