/** Listener to handle button actions */
 public void actionPerformed(ActionEvent e) {
   // Check if the user changed the service filter option
   if (e.getSource() == service_box) {
     service_list.setEnabled(service_box.isSelected());
     service_list.clearSelection();
     remove_service_button.setEnabled(false);
     add_service_field.setEnabled(service_box.isSelected());
     add_service_field.setText("");
     add_service_button.setEnabled(false);
   }
   // Check if the user pressed the add service button
   if ((e.getSource() == add_service_button) || (e.getSource() == add_service_field)) {
     String text = add_service_field.getText();
     if ((text != null) && (text.length() > 0)) {
       service_data.addElement(text);
       service_list.setListData(service_data);
     }
     add_service_field.setText("");
     add_service_field.requestFocus();
   }
   // Check if the user pressed the remove service button
   if (e.getSource() == remove_service_button) {
     Object[] sels = service_list.getSelectedValues();
     for (int i = 0; i < sels.length; i++) {
       service_data.removeElement(sels[i]);
     }
     service_list.setListData(service_data);
     service_list.clearSelection();
   }
 }
示例#2
0
 private SettingConfig generateSetting() {
   SettingConfig s = new SettingConfig();
   s.dir = TEXT_dir.getText();
   s.logBuffer = SizeType.get((String) SELECT_logBuffer.getSelectedItem()).getSize();
   try {
     s.delay = Integer.parseInt((String) SELECT_delay.getSelectedItem());
     if (s.delay < 100) s.delay = 100;
   } catch (Exception e) {
   }
   s.seek = CHK_seek.isSelected();
   if (s.seek) {
     try {
       s.seekType = SeekType.get((String) SELECT_seekType.getSelectedItem());
     } catch (Exception e) {
     }
     try {
       s.seekPos = Long.parseLong(TEXT_seekPos.getText());
     } catch (Exception e) {
     }
   }
   s.charset = CharsetType.get((String) SELECT_charset.getSelectedItem());
   try {
     s.overflowNum = Integer.parseInt(TEXT_limit.getText());
   } catch (Exception e) {
   }
   s.showLineNumber = CHK_showLineNumber.isSelected();
   s.softWrap = CHK_softWrap.isSelected();
   return s;
 }
示例#3
0
 public void actionPerformed(ActionEvent ae) {
   String cname = nameF.getText().trim();
   int state = conditions[stateC.getSelectedIndex()];
   try {
     if (isSpecialCase(cname)) {
       handleSpecialCase(cname, state);
     } else {
       JComponent comp = (JComponent) Class.forName(cname).newInstance();
       ComponentUI cui = UIManager.getUI(comp);
       cui.installUI(comp);
       results.setText("Map entries for " + cname + ":\n\n");
       if (inputB.isSelected()) {
         loadInputMap(comp.getInputMap(state), "");
         results.append("\n");
       }
       if (actionB.isSelected()) {
         loadActionMap(comp.getActionMap(), "");
         results.append("\n");
       }
       if (bindingB.isSelected()) {
         loadBindingMap(comp, state);
       }
     }
   } catch (ClassCastException cce) {
     results.setText(cname + " is not a subclass of JComponent.");
   } catch (ClassNotFoundException cnfe) {
     results.setText(cname + " was not found.");
   } catch (InstantiationException ie) {
     results.setText(cname + " could not be instantiated.");
   } catch (Exception e) {
     results.setText("Exception found:\n" + e);
     e.printStackTrace();
   }
 }
示例#4
0
 /**
  * The ActionListener implementation
  *
  * @param event the event.
  */
 public void actionPerformed(ActionEvent event) {
   String searchText = textField.getText().trim();
   if (searchText.equals("") && !saveAs.isSelected() && (fileLength > 10000000)) {
     textPane.setText("Blank search text is not allowed for large IdTables.");
   } else {
     File outputFile = null;
     if (saveAs.isSelected()) {
       outputFile = chooser.getSelectedFile();
       if (outputFile != null) {
         String name = outputFile.getName();
         int k = name.lastIndexOf(".");
         if (k != -1) name = name.substring(0, k);
         name += ".txt";
         File parent = outputFile.getAbsoluteFile().getParentFile();
         outputFile = new File(parent, name);
         chooser.setSelectedFile(outputFile);
       }
       if (chooser.showSaveDialog(this) != JFileChooser.APPROVE_OPTION) System.exit(0);
       outputFile = chooser.getSelectedFile();
     }
     textPane.setText("");
     Searcher searcher = new Searcher(searchText, event.getSource().equals(searchPHI), outputFile);
     searcher.start();
   }
 }
  @Override
  public void actionPerformed(ActionEvent e) {
    if (e.getSource() == imageView) {
      selectedView = imageView.getSelectedIndex();
      owner.viewUpdated();
    } else if (e.getSource() == showCorners) {
      bShowCorners = showCorners.isSelected();
      owner.viewUpdated();
    } else if (e.getSource() == showLines) {
      bShowLines = showLines.isSelected();
      owner.viewUpdated();
    } else if (e.getSource() == showContour) {
      bShowContour = showContour.isSelected();
      owner.viewUpdated();
    } else if (e.getSource() == refineChoice) {
      refineType = PolygonRefineType.values()[refineChoice.getSelectedIndex()];

      updateRefineSettings();
      owner.configUpdate();
    } else if (e.getSource() == setConvex) {
      config.convex = setConvex.isSelected();
      owner.configUpdate();
    } else if (e.getSource() == setBorder) {
      config.convex = setBorder.isSelected();
      owner.configUpdate();
    }
  }
  public boolean isModified() {
    boolean isModified = false;
    HttpConfigurable httpConfigurable = myHttpConfigurable;
    if (!Comparing.equal(myProxyExceptions.getText().trim(), httpConfigurable.PROXY_EXCEPTIONS))
      return true;
    isModified |= httpConfigurable.USE_PROXY_PAC != myAutoDetectProxyRb.isSelected();
    isModified |= httpConfigurable.USE_PAC_URL != myPacUrlCheckBox.isSelected();
    isModified |= !Comparing.strEqual(httpConfigurable.PAC_URL, myPacUrlTextField.getText());
    isModified |= httpConfigurable.USE_HTTP_PROXY != myUseHTTPProxyRb.isSelected();
    isModified |= httpConfigurable.PROXY_AUTHENTICATION != myProxyAuthCheckBox.isSelected();
    isModified |=
        httpConfigurable.KEEP_PROXY_PASSWORD != myRememberProxyPasswordCheckBox.isSelected();
    isModified |= httpConfigurable.PROXY_TYPE_IS_SOCKS != mySocks.isSelected();

    isModified |=
        !Comparing.strEqual(httpConfigurable.PROXY_LOGIN, myProxyLoginTextField.getText());
    isModified |=
        !Comparing.strEqual(
            httpConfigurable.getPlainProxyPassword(),
            new String(myProxyPasswordTextField.getPassword()));

    try {
      isModified |=
          httpConfigurable.PROXY_PORT != Integer.valueOf(myProxyPortTextField.getText()).intValue();
    } catch (NumberFormatException e) {
      isModified = true;
    }
    isModified |= !Comparing.strEqual(httpConfigurable.PROXY_HOST, myProxyHostTextField.getText());
    return isModified;
  }
示例#7
0
  void applyDirectives() {
    findRemoveDirectives(true);

    StringBuffer buffer = new StringBuffer();
    String head = "", toe = "; \n";

    if (crispBox.isSelected()) buffer.append(head + "crisp=true" + toe);
    if (!fontField.getText().trim().equals(""))
      buffer.append(head + "font=\"" + fontField.getText().trim() + "\"" + toe);
    if (globalKeyEventsBox.isSelected()) buffer.append(head + "globalKeyEvents=true" + toe);
    if (pauseOnBlurBox.isSelected()) buffer.append(head + "pauseOnBlur=true" + toe);
    if (!preloadField.getText().trim().equals(""))
      buffer.append(head + "preload=\"" + preloadField.getText().trim() + "\"" + toe);
    /*if ( transparentBox.isSelected() )
    buffer.append( head + "transparent=true" + toe );*/

    Sketch sketch = editor.getSketch();
    SketchCode code = sketch.getCode(0); // first tab
    if (buffer.length() > 0) {
      code.setProgram("/* @pjs " + buffer.toString() + " */\n\n" + code.getProgram());
      if (sketch.getCurrentCode() == code) // update textarea if on first tab
      {
        editor.setText(sketch.getCurrentCode().getProgram());
        editor.setSelection(0, 0);
      }

      sketch.setModified(false);
      sketch.setModified(true);
    }
  }
 /** Listener to handle button actions */
 public void actionPerformed(ActionEvent e) {
   // Check if the user pressed the ok button
   if (e.getSource() == ok_button) {
     filter_include_list = include_panel.getServiceList();
     filter_exclude_list = exclude_panel.getServiceList();
     if (status_box.isSelected()) {
       filter_active = status_active.isSelected();
       filter_complete = status_complete.isSelected();
     } else {
       filter_active = false;
       filter_complete = false;
     }
     ok_pressed = true;
     dialog.dispose();
   }
   // Check if the user pressed the cancel button
   if (e.getSource() == cancel_button) {
     dialog.dispose();
   }
   // Check if the user changed the status filter option
   if (e.getSource() == status_box) {
     status_active.setEnabled(status_box.isSelected());
     status_complete.setEnabled(status_box.isSelected());
   }
 }
  // TODO use annotation to create a guiwrapper so isModified could be simplified
  public void applyConfigurationData(
      JenkinsAppSettings jenkinsAppSettings, JenkinsSettings jenkinsSettings)
      throws ConfigurationException {
    formValidator.validate();

    if (!StringUtils.equals(jenkinsAppSettings.getServerUrl(), serverUrl.getText())) {
      jenkinsSettings.getFavoriteJobs().clear();
      jenkinsSettings.setLastSelectedView(null);
    }

    jenkinsAppSettings.setServerUrl(serverUrl.getText());
    jenkinsAppSettings.setDelay(getBuildDelay());
    jenkinsAppSettings.setJobRefreshPeriod(getJobRefreshPeriod());
    jenkinsAppSettings.setRssRefreshPeriod(getRssRefreshPeriod());
    jenkinsSettings.setCrumbData(crumbDataField.getText());

    jenkinsAppSettings.setIgnoreSuccessOrStable(successOrStableCheckBox.isSelected());
    jenkinsAppSettings.setDisplayUnstableOrFail(unstableOrFailCheckBox.isSelected());
    jenkinsAppSettings.setDisplayAborted(abortedCheckBox.isSelected());
    jenkinsAppSettings.setSuffix(replaceWithSuffix.getText());

    if (StringUtils.isNotBlank(username.getText())) {
      jenkinsSettings.setUsername(username.getText());
    } else {
      jenkinsSettings.setUsername("");
    }

    if (isPasswordModified()) {
      jenkinsSettings.setPassword(getPassword());
      resetPasswordModification();
    }
  }
  /*
   * Gets the user choice for font, style and size and redraws the text
   *     accordingly.
   */
  public void setSampleFont() {
    // Get the font name from the JComboBox
    fontName = (String) facenameCombo.getSelectedItem();

    sampleField.setText(textField.getText());

    // Get the font style from the JCheckBoxes
    fontStyle = 0;
    if (italicCheckBox.isSelected()) fontStyle += Font.ITALIC;
    if (boldCheckBox.isSelected()) fontStyle += Font.BOLD;

    // Get the font size
    fontSize = 0;

    fontSize = Integer.parseInt((String) sizeCombo.getSelectedItem());

    // THE FOLLOWING IS NO LONGER NEEDED
    //            if(smallButton.isSelected())
    //                  fontSize=SMALL;
    //            else if(mediumButton.isSelected())
    //                  fontSize=MEDIUM;
    //            else if(largeButton.isSelected())
    //                  fontSize=LARGE;

    // Set the font of the text field
    sampleField.setFont(new Font(fontName, fontStyle, fontSize));
    sampleField.setForeground(fontColor);
    sampleField.repaint();

    pack();
  } // end setSampleFont method
  // counts up the score of the user.
  @SuppressWarnings("unchecked")
  public int scoreCounter() {
    if (b1.isSelected()) {
      score1++;
    } else if (c1.isSelected()) {
      score1++;
    } else if (d1.isSelected()) {
      score1++;
    } else if (e1.isSelected()) {
      score1++;
    } else if (f1.isSelected()) {
      score1++;
    } else if (g1.isSelected()) {
      score1++;
    } else if (h1.isSelected()) {
      score1++;
    } else if (i1.isSelected()) {
      score1++;
    } else if (j1.isSelected()) {
      score1++;
    } else if (k1.isSelected()) {
      score1++;
    }

    System.out.println(score1);

    return score1;
  }
  private void updateControls() {
    if (myCbReplaceWrite != null) {
      if (myCbReplaceAll.isSelected()) {
        myCbReplaceWrite.makeSelectable();
      } else {
        myCbReplaceWrite.makeUnselectable(true);
      }
    }

    if (myCbReplaceAll != null) {
      myTypeSelectorManager.setAllOccurrences(myCbReplaceAll.isSelected());
    } else {
      myTypeSelectorManager.setAllOccurrences(false);
    }

    if (myDeclareFinalIfAll && myCbReplaceAll != null && myCbReplaceAll.isSelected()) {
      myCbFinal.setEnabled(false);
      myCbFinal.setSelected(true);
    } else if (myCbReplaceWrite != null
        && myCbReplaceWrite.isEnabled()
        && myCbReplaceWrite.isSelected()) {
      myCbFinal.setEnabled(false);
      myCbFinal.setSelected(false);
    } else {
      myCbFinal.setEnabled(true);
      myCbFinal.setSelected(myCbFinalState);
    }
  }
 /**
  * This method sets the status of debug option based on the user input.If user checks the debug
  * check box first time then it will add a debugging end point otherwise it will prompt the user
  * for removal of associated end point for debugging if user already has some debug end point
  * associated and unchecked the debug check box.
  */
 private void debugOptionStatus() {
   if (debugCheck.isSelected()) {
     makeDebugEnable();
     try {
       waRole.setDebuggingEndpoint(dbgSelEndpoint);
       waRole.setStartSuspended(jvmCheck.isSelected());
     } catch (WindowsAzureInvalidProjectOperationException e1) {
       PluginUtil.displayErrorDialogAndLog(message("adRolErrTitle"), message("dlgDbgErr"), e1);
     }
   } else {
     if (isDebugChecked && !"".equals(comboEndPoint.getSelectedItem())) {
       String msg =
           String.format("%s%s", message("dlgDbgEdPtAscMsg"), comboEndPoint.getSelectedItem());
       int choice =
           Messages.showOkCancelDialog(
               msg, message("dlgDbgEndPtErrTtl"), Messages.getQuestionIcon());
       if (choice == Messages.OK) {
         removeDebugAssociatedEndpoint();
       } else {
         makeAllDisable();
         try {
           waRole.setDebuggingEndpoint(null);
         } catch (WindowsAzureInvalidProjectOperationException e) {
           PluginUtil.displayErrorDialogAndLog(message("adRolErrTitle"), message("dlgDbgErr"), e);
         }
       }
     } else {
       removeDebugAssociatedEndpoint();
     }
   }
 }
示例#14
0
 @Override
 public void onExit() {
   // save all painters
   for (EntryListPanel panel : listPanelSet) {
     myjava.gui.syntax.Painter painter = panel.getPainter();
     if (!painter.equals(myjava.gui.syntax.Painter.getDefaultInstance())) {
       myjava.gui.syntax.Painter.add(painter);
       setConfig("painter.userDefined." + painter.getName(), painter.toWritableString());
     }
     if (painter.equals(painterComboBox.getSelectedItem())) {
       // selected painter
       setConfig("syntax.selectedPainter", painter.getName());
       myjava.gui.syntax.Painter.setCurrentInstance(painter);
     }
   }
   // remove "removed painters"
   for (myjava.gui.syntax.Painter removed : removedPainters) {
     removeConfig0("painter.userDefined." + removed.getName());
     myjava.gui.syntax.Painter.remove(removed);
   }
   // highlight?
   boolean _highlightSyntax = highlightSyntax.isSelected();
   boolean _matchBracket = matchBracket.isSelected();
   MyUmbrellaLayerUI.setHighlightingStatus(_highlightSyntax, _matchBracket);
   setConfig("syntax.highlight", _highlightSyntax + "");
   setConfig("syntax.matchBrackets", _matchBracket + "");
 }
  public void apply(CodeStyleSettings settings) {
    stopTableEditing();

    settings.LAYOUT_STATIC_IMPORTS_SEPARATELY = myImportLayoutPanel.areStaticImportsEnabled();
    settings.USE_FQ_CLASS_NAMES = myCbUseFQClassNames.isSelected();
    settings.USE_SINGLE_CLASS_IMPORTS = myCbUseSingleClassImports.isSelected();
    settings.INSERT_INNER_CLASS_IMPORTS = myCbInsertInnerClassImports.isSelected();
    try {
      settings.CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND = Integer.parseInt(myClassCountField.getText());
    } catch (NumberFormatException e) {
      // just a bad number
    }
    try {
      settings.NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND = Integer.parseInt(myNamesCountField.getText());
    } catch (NumberFormatException e) {
      // just a bad number
    }

    final PackageEntryTable list = myImportLayoutPanel.getImportLayoutList();
    list.removeEmptyPackages();
    settings.IMPORT_LAYOUT_TABLE.copyFrom(list);

    myPackageList.removeEmptyPackages();
    settings.PACKAGES_TO_USE_IMPORT_ON_DEMAND.copyFrom(myPackageList);

    myFqnInJavadocOption.apply(settings);
  }
示例#16
0
 /*
  * Checks if the preferences have changed from the cached preferences.
  */
 private boolean prefsChanged() {
   return (prefs.getResolution() != resolution.getSelectedItem())
       || (prefs.getFullscreen() != fullscreen.isSelected())
       || (prefs.getBitrate() != bitrate.getValue())
       || (prefs.getUseOpenGlRenderer() != openGlRenderer.isSelected())
       || (prefs.getLocalAudio() != localAudio.isSelected());
 }
  @Override
  public void apply(@NotNull HttpConfigurable settings) {
    if (!isValid()) {
      return;
    }

    if (isModified(settings)) {
      settings.AUTHENTICATION_CANCELLED = false;
    }

    settings.USE_PROXY_PAC = myAutoDetectProxyRb.isSelected();
    settings.USE_PAC_URL = myPacUrlCheckBox.isSelected();
    settings.PAC_URL = getText(myPacUrlTextField);
    settings.USE_HTTP_PROXY = myUseHTTPProxyRb.isSelected();
    settings.PROXY_TYPE_IS_SOCKS = mySocks.isSelected();
    settings.PROXY_AUTHENTICATION = myProxyAuthCheckBox.isSelected();
    settings.KEEP_PROXY_PASSWORD = myRememberProxyPasswordCheckBox.isSelected();

    settings.setProxyLogin(getText(myProxyLoginTextField));
    settings.setPlainProxyPassword(new String(myProxyPasswordTextField.getPassword()));
    settings.PROXY_EXCEPTIONS = StringUtil.nullize(myProxyExceptions.getText(), true);

    settings.PROXY_PORT = myProxyPortTextField.getNumber();
    settings.PROXY_HOST = getText(myProxyHostTextField);
  }
 private void updateSoftWrapSettingsRepresentation() {
   boolean softWrapsEnabled = myCbUseSoftWrapsAtEditor.isSelected();
   myCbUseCustomSoftWrapIndent.setEnabled(softWrapsEnabled);
   myCustomSoftWrapIndent.setEnabled(
       myCbUseCustomSoftWrapIndent.isEnabled() && myCbUseCustomSoftWrapIndent.isSelected());
   myCustomSoftWrapIndentLabel.setEnabled(myCustomSoftWrapIndent.isEnabled());
   myCbShowSoftWrapsOnlyOnCaretLine.setEnabled(softWrapsEnabled);
 }
示例#19
0
 private void prepocitej() {
   filex =
       new Filex(
           new File(jtext.getText()), jRelativneKProgramu.isSelected(), jActive.isSelected());
   jCurrVal.setText(filex.getEffectiveFile().getPath());
   jtext.setEnabled(jActive.isSelected());
   jRelativneKProgramu.setEnabled(jActive.isSelected());
 }
示例#20
0
 @Override
 public void save(TagCompound tagCompound) {
   tagCompound.getCompoundData().put("friend", new TagByte(friendlyCheckBox.isSelected()));
   tagCompound.getCompoundData().put("aggro", new TagByte(aggressiveCheckBox.isSelected()));
   tagCompound.getCompoundData().put("farm", new TagByte(farmCheckBox.isSelected()));
   tagCompound.getCompoundData().put("raid", new TagByte(raidCheckBox.isSelected()));
   tagCompound.getCompoundData().put("duel", new TagByte(duelCheckBox.isSelected()));
 }
示例#21
0
 /*
  * Writes the preferences to the disk.
  */
 private void writePreferences() {
   prefs.setFullscreen(fullscreen.isSelected());
   prefs.setBitrate(bitrate.getValue());
   prefs.setResolution((Resolution) resolution.getSelectedItem());
   prefs.setUseOpenGlRenderer(openGlRenderer.isSelected());
   prefs.setLocalAudio(localAudio.isSelected());
   PreferencesManager.writePreferences(prefs);
 }
  @Override
  public void process() {

    // put all the edits together
    CompoundEdit edit = new CompoundEdit();

    boolean removeAnnotation = removeMatched.isSelected();

    Pattern pattern =
        caseInsensitive.isSelected()
            ? Pattern.compile(patternField.getText(), Pattern.CASE_INSENSITIVE)
            : Pattern.compile(patternField.getText());

    BasicPatternMatcher<Note> matcher = new BasicPatternMatcher<Note>(Note.class, pattern);

    Annotation target = (Annotation) annotationComboBox.getSelectedItem();

    List<Annotation> createdAnnotations = new ArrayList<Annotation>();
    List<Annotation> removedAnnotations = new ArrayList<Annotation>();

    for (AnnotatedEntity entity : getSelectionController().getSelection().getEntities()) {

      for (Annotation annotation : entity.getAnnotations()) {

        String matched = annotation.accept(matcher);

        if (!matched.isEmpty()) {
          if (target instanceof StringAnnotation) {
            createdAnnotations.add(((StringAnnotation) target).getInstance(matched));
            if (removeAnnotation) {
              removedAnnotations.add(annotation);
            }
          } else if (target.getClass().equals(Charge.class)) {
            Charge charge = (Charge) target.newInstance();
            charge.setValue(Double.parseDouble(matched));
            createdAnnotations.add(charge);
            if (removeAnnotation) {
              removedAnnotations.add(annotation);
            }
          }
        }
      }

      edit.addEdit(new AddAnnotationEdit(entity, createdAnnotations));
      for (Annotation a : removedAnnotations) {
        edit.addEdit(new RemoveAnnotationEdit(entity, a));
        entity.removeAnnotation(a);
      }
      entity.addAnnotations(createdAnnotations);
      createdAnnotations.clear();
      removedAnnotations.clear();
    }

    // inform the compound edit that we've finished editing
    edit.end();

    addEdit(edit);
  }
示例#23
0
  private void updateOtherFileNames(BeautiOptions options) {
    if (options.fileNameStem != null) {
      //            fileNameStemField.setText(options.fileNameStem);

      options.logFileName = options.fileNameStem + ".log";
      if (addTxt.isSelected()) options.logFileName = options.logFileName + ".txt";
      logFileNameField.setText(options.logFileName);

      //            if (options.mapTreeFileName == null) {
      //			    mapTreeFileNameField.setText(options.fileNameStem + ".MAP.tree");
      //            } else {
      //                mapTreeFileNameField.setText(options.mapTreeFileName);
      //            }

      updateTreeFileNameList();
      treeFileNameField.setText(displayTreeList(options.treeFileName));

      if (options.substTreeLog) {
        substTreeFileNameField.setText(displayTreeList(options.substTreeFileName));
      } else {
        substTreeFileNameField.setText("");
      }

      options.operatorAnalysisFileName = options.fileNameStem + ".ops";
      if (addTxt.isSelected()) {
        options.operatorAnalysisFileName = options.operatorAnalysisFileName + ".txt";
      }
      operatorAnalaysisFileNameField.setEnabled(options.operatorAnalysis);
      if (options.operatorAnalysis) {
        operatorAnalaysisFileNameField.setText(options.operatorAnalysisFileName);
      } else {
        operatorAnalaysisFileNameField.setText("");
      }

      //            mapTreeLogCheck.setEnabled(true);
      //            mapTreeLogCheck.setSelected(options.mapTreeLog);
      //            mapTreeFileNameField.setEnabled(options.mapTreeLog);

      substTreeLogCheck.setEnabled(true);
      substTreeLogCheck.setSelected(options.substTreeLog);

    } else {
      //            fileNameStemField.setText(fileNameStem);
      //            fileNameStemField.setEnabled(false);
      logFileNameField.setText(DEFAULT_FILE_NAME_STEM + ".log");
      treeFileNameField.setText(DEFAULT_FILE_NAME_STEM + "." + STARBEASTOptions.TREE_FILE_NAME);
      //            mapTreeLogCheck.setEnabled(false);
      //            mapTreeFileNameField.setEnabled(false);
      //            mapTreeFileNameField.setText("untitled");
      substTreeLogCheck.setSelected(false);
      substTreeFileNameField.setEnabled(false);
      substTreeFileNameField.setText("");
      operatorAnalaysisCheck.setSelected(false);
      operatorAnalaysisFileNameField.setText("");
    }
  }
示例#24
0
 private boolean areAll(boolean selected) {
   final Set<Map.Entry<SearchEngine, JCheckBox>> entries = engineCheckboxes.entrySet();
   for (Map.Entry<SearchEngine, JCheckBox> entry : entries) {
     final JCheckBox cBox = entry.getValue();
     if (selected && !cBox.isSelected() || !selected && cBox.isSelected()) {
       return false;
     }
   }
   return true;
 }
  /**
   * getToppingCost method
   *
   * @return The cost of the selected toppings.
   */
  public double getToppingCost() {
    double toppingCost = 0.0;

    if (creamCheese.isSelected()) toppingCost += CREAM_CHEESE;
    if (butter.isSelected()) toppingCost += BUTTER;
    if (peachJelly.isSelected()) toppingCost += PEACH_JELLY;
    if (blueberryJam.isSelected()) toppingCost += BLUEBERRY_JAM;

    return toppingCost;
  }
 private void saveSettings() {
   final JavaRefactoringSettings settings = JavaRefactoringSettings.getInstance();
   settings.INTRODUCE_PARAMETER_CREATE_FINALS = myDeclareFinalCheckBox.isSelected();
   if (myGetterPanel.isVisible()) {
     settings.INTRODUCE_PARAMETER_REPLACE_FIELDS_WITH_GETTERS = getReplaceFieldsWithGetter();
   }
   if (myForceReturnCheckBox.isEnabled() && mySignaturePanel.isVisible()) {
     GroovyApplicationSettings.getInstance().FORCE_RETURN = myForceReturnCheckBox.isSelected();
   }
 }
  public void apply() {
    myManager.setEnabled(myEnabledCheckBox.isSelected());
    myManager.setEnabledForTabs(myTabsEnabledCheckBox.isSelected());
    FileColorManagerImpl.setEnabledForProjectView(myProjectViewEnabledCheckBox.isSelected());

    myLocalTable.apply();
    mySharedTable.apply();

    UISettings.getInstance().fireUISettingsChanged();
  }
  public boolean isModified() {
    boolean modified;

    modified = myEnabledCheckBox.isSelected() != myManager.isEnabled();
    modified |= myTabsEnabledCheckBox.isSelected() != myManager.isEnabledForTabs();
    modified |= myProjectViewEnabledCheckBox.isSelected() != myManager.isEnabledForProjectView();
    modified |= myLocalTable.isModified() || mySharedTable.isModified();

    return modified;
  }
 /** Listener to handle button actions */
 public void actionPerformed(ActionEvent e) {
   // Check if the user pressed the remove button
   if (e.getSource() == remove_button) {
     int row = table.getSelectedRow();
     model.removeRow(row);
     table.clearSelection();
     table.repaint();
     valueChanged(null);
   }
   // Check if the user pressed the remove all button
   if (e.getSource() == remove_all_button) {
     model.clearAll();
     table.setRowSelectionInterval(0, 0);
     table.repaint();
     valueChanged(null);
   }
   // Check if the user pressed the filter button
   if (e.getSource() == filter_button) {
     filter.showDialog();
     if (filter.okPressed()) {
       // Update the display with new filter
       model.setFilter(filter);
       table.repaint();
     }
   }
   // Check if the user pressed the start button
   if (e.getSource() == start_button) {
     start();
   }
   // Check if the user pressed the stop button
   if (e.getSource() == stop_button) {
     stop();
   }
   // Check if the user wants to switch layout
   if (e.getSource() == layout_button) {
     details_panel.remove(details_soap);
     details_soap.removeAll();
     if (details_soap.getOrientation() == JSplitPane.HORIZONTAL_SPLIT) {
       details_soap = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
     } else {
       details_soap = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
     }
     details_soap.setTopComponent(request_panel);
     details_soap.setRightComponent(response_panel);
     details_soap.setResizeWeight(.5);
     details_panel.add(details_soap, BorderLayout.CENTER);
     details_panel.validate();
     details_panel.repaint();
   }
   // Check if the user is changing the reflow option
   if (e.getSource() == reflow_xml) {
     request_text.setReflowXML(reflow_xml.isSelected());
     response_text.setReflowXML(reflow_xml.isSelected());
   }
 }
示例#30
0
 /** Save the settings of this panel */
 private void saveSettings() {
   settings.setValue(SettingsClass.JUNK_HIDE_JUNK_MESSAGES, hideJunkMessagesCheckBox.isSelected());
   settings.setValue(
       SettingsClass.JUNK_MARK_JUNK_IDENTITY_BAD, markJunkIdentityBadCheckBox.isSelected());
   settings.setValue(
       SettingsClass.DOS_STOP_BOARD_UPDATES_WHEN_DOSED,
       stopBoardUpdatesWhenDosedCheckBox.isSelected());
   settings.setValue(
       SettingsClass.DOS_INVALID_SUBSEQUENT_MSGS_THRESHOLD,
       TfInvalidSubsequentMessagesThreshold.getText());
 }