public void enter() {
    Blackboard Identificadores = app.getBlackboard();
    ID_Inmueble = Integer.parseInt(Identificadores.get("IdInmueble").toString());

    // Mostramos los datos para el inmueble
    PatrimonioPostgre General = new PatrimonioPostgre();
    ArrayList Datos = General.DatosRegistro(ID_Inmueble);
    if (Datos == null) return;
    Iterator alIt = Datos.iterator();
    Iterator itControles = Registro.iterator();
    while (itControles.hasNext()) {
      try {
        JComponent comp = (JComponent) itControles.next();
        Object obj = alIt.next();
        if (comp instanceof JTextField)
          ((JTextField) comp).setText((obj != null) ? obj.toString() : "");
        if (comp instanceof JCheckBox) {
          String check = (obj != null) ? obj.toString() : "";
          if (check == "TRUE") {
            ((JCheckBox) comp).setSelected(true);
          } else {
            ((JCheckBox) comp).setSelected(false);
          }
        }
        if (comp instanceof JComboBox)
          ((JComboBox) comp).setSelectedItem((obj != null) ? obj.toString() : "");
      } catch (Exception A) {
        A.printStackTrace();
      }
    }
  }
Exemplo n.º 2
0
 public void setValue(Object value) {
   if (Boolean.TRUE.equals(value)) {
     checkBox.setSelected(true);
   } else {
     checkBox.setSelected(false);
   }
 }
  public EditDateTimeQuestionFrame(DateTimeQuestion dateTimeQuestion, SurveyPanel surveyPanel)
      throws IOException, ParseException {

    super(dateTimeQuestion, surveyPanel);
    this.dateTimeQuestion = dateTimeQuestion;

    this.setSize(600, 400);

    questionField.setText(question.getQuestion());
    hintField.setText(dateTimeQuestion.getHint());
    // errorMessageField.setText("");

    onlyDateBox = new JCheckBox("tylko data");
    onlyDateBox.setSelected(dateTimeQuestion.isOnlyDate());
    onlyDateBox.setBounds(FIELDS_X_POSITION, CURRENT_Y_POSITION, FIELDS_WIDTH, FIELDS_HEIGHT);
    this.add(onlyDateBox);

    CURRENT_Y_POSITION = CURRENT_Y_POSITION + FIELDS_HEIGHT + SPACE_HEIGHT;

    onlyTimeBox = new JCheckBox("tylko czas");
    onlyTimeBox.setSelected(dateTimeQuestion.isOnlyTime());
    onlyTimeBox.setBounds(FIELDS_X_POSITION, CURRENT_Y_POSITION, FIELDS_WIDTH, FIELDS_HEIGHT);
    this.add(onlyTimeBox);

    CURRENT_Y_POSITION = CURRENT_Y_POSITION + FIELDS_HEIGHT + SPACE_HEIGHT;

    saveButton.setBounds(
        ADD_BUTTON_X_POSITION, CURRENT_Y_POSITION + SPACE_HEIGHT, BUTTON_WIDTH, BUTTON_HEIGHT);

    cancelButton.setBounds(
        CANCEL_BUTTON_X_POSITION, CURRENT_Y_POSITION + SPACE_HEIGHT, BUTTON_WIDTH, BUTTON_HEIGHT);
  }
Exemplo n.º 4
0
 public void checkBoxActionPerformed(java.awt.event.ActionEvent ae) {
   if (ae.getSource() == buildMsgBox) {
     trainManager.setBuildMessagesEnabled(buildMsgBox.isSelected());
   }
   if (ae.getSource() == buildReportBox) {
     trainManager.setBuildReportEnabled(buildReportBox.isSelected());
   }
   if (ae.getSource() == printPreviewBox) {
     trainManager.setPrintPreviewEnabled(printPreviewBox.isSelected());
     setPrintButtonText(); // set the button text for Print or Preview
   }
   if (ae.getSource() == openFileBox) {
     trainManager.setOpenFileEnabled(openFileBox.isSelected());
     runFileBox.setSelected(false);
     trainManager.setRunFileEnabled(false);
   }
   if (ae.getSource() == runFileBox) {
     trainManager.setRunFileEnabled(runFileBox.isSelected());
     openFileBox.setSelected(false);
     trainManager.setOpenFileEnabled(false);
   }
   if (ae.getSource() == showAllBox) {
     trainsModel.setShowAll(showAllBox.isSelected());
   }
 }
Exemplo n.º 5
0
 public void setFilterConditionItem(FilterConditionItem filterConditionItem) {
   this.filterConditionItem = filterConditionItem;
   textField.setText(String.valueOf(filterConditionItem.getLeft().getText()));
   criteriaCombo.setSelectedItem(filterConditionItem.getCriteria());
   colValCheckBox.setSelected(
       filterConditionItem.getRight() != null
           && filterConditionItem.getRight()[0] instanceof CellValue);
   casecheckBox.setSelected(!filterConditionItem.isCaseSensitive());
   if (filterConditionItem.getCriteria() == Criteria.IS_IN
       || filterConditionItem.getCriteria() == Criteria.IS_NOT_IN) {
     setMultiTextbox(true);
     ((ComparedValuePanel) lowerPanel.getComponent(0))
         .textField_1.setText(filterConditionItem.getRight()[0].getText());
     for (int i = 0; i < filterConditionItem.getRight().length; i++) {
       IValue val = filterConditionItem.getRight()[i];
       if (i == 0) {
         ((ComparedValuePanel) lowerPanel.getComponent(0)).textField_1.setText(val.getText());
       } else {
         addComparedValuePanel().textField_1.setText(val.getText());
       }
     }
   } else {
     setMultiTextbox(false);
     ((ComparedValuePanel) lowerPanel.getComponent(0))
         .textField_1.setText(filterConditionItem.getRight()[0].getText());
   }
 }
  @Override
  public void reset(@NotNull HttpConfigurable settings) {
    myNoProxyRb.setSelected(true); // default
    myAutoDetectProxyRb.setSelected(settings.USE_PROXY_PAC);
    myPacUrlCheckBox.setSelected(settings.USE_PAC_URL);
    myPacUrlTextField.setText(settings.PAC_URL);
    myUseHTTPProxyRb.setSelected(settings.USE_HTTP_PROXY);
    myProxyAuthCheckBox.setSelected(settings.PROXY_AUTHENTICATION);

    enableProxy(settings.USE_HTTP_PROXY);

    myProxyLoginTextField.setText(settings.getProxyLogin());
    myProxyPasswordTextField.setText(settings.getPlainProxyPassword());

    myProxyPortTextField.setNumber(settings.PROXY_PORT);
    myProxyHostTextField.setText(settings.PROXY_HOST);
    myProxyExceptions.setText(StringUtil.notNullize(settings.PROXY_EXCEPTIONS));

    myRememberProxyPasswordCheckBox.setSelected(settings.KEEP_PROXY_PASSWORD);
    mySocks.setSelected(settings.PROXY_TYPE_IS_SOCKS);
    myHTTP.setSelected(!settings.PROXY_TYPE_IS_SOCKS);

    boolean showError = !StringUtil.isEmptyOrSpaces(settings.LAST_ERROR);
    myErrorLabel.setVisible(showError);
    myErrorLabel.setText(showError ? errorText(settings.LAST_ERROR) : null);

    final String oldStyleText =
        CommonProxy.getMessageFromProps(CommonProxy.getOldStyleProperties());
    myOtherWarning.setVisible(oldStyleText != null);
    if (oldStyleText != null) {
      myOtherWarning.setText(oldStyleText);
      myOtherWarning.setIcon(Messages.getWarningIcon());
    }
  }
Exemplo n.º 7
0
 @Override
 public void load() {
   for (AnimationComboListener listener : comboListeners) {
     listener.load();
   }
   otherCombo.setSelectedIndex(
       MCPatcherUtils.getBoolean(MCPatcherUtils.HD_TEXTURES, "customOther", true) ? 1 : 0);
   boolean is64bit = false;
   try {
     String datamodel =
         System.getProperty("sun.arch.data.model"); // sun-specific, but gets the arch of the jvm
     String arch =
         System.getProperty(
             "os.arch"); // generic, but gets the arch of the os, not the jvm (may be a 32-bit jvm
                         // on a 64-bit os)
     if (datamodel != null) {
       is64bit = (Integer.parseInt(datamodel) >= 64);
     } else if (arch != null) {
       is64bit = arch.contains("64");
     } else {
       is64bit = false;
     }
   } catch (Throwable e) {
   }
   textureCacheCheckBox.setSelected(
       MCPatcherUtils.getBoolean(MCPatcherUtils.HD_TEXTURES, "useTextureCache", is64bit));
   shrinkGLMemoryCheckBox.setSelected(
       MCPatcherUtils.getBoolean(MCPatcherUtils.HD_TEXTURES, "reclaimGLMemory", false));
   autoRefreshTexturesCheckBox.setSelected(
       MCPatcherUtils.getBoolean(MCPatcherUtils.HD_TEXTURES, "autoRefreshTextures", false));
 }
Exemplo n.º 8
0
 public void actionPerformed(java.awt.event.ActionEvent A) {
   try {
     Object source = A.getSource();
     if (source == okButton) {
       if (save()) {
         dispose();
       }
     } else if (source == cancelButton) {
       dispose();
     } else if (source == tlCheckBox) {
       if (tlCheckBox.isSelected()) {
         adminCheckBox.setSelected(false);
       }
       enableAdminPriv();
       checkOkSetEnabled();
     } else if (source == adminCheckBox) {
       if (adminCheckBox.isSelected()) {
         tlCheckBox.setSelected(false);
       }
       enableAdminPriv();
       checkOkSetEnabled();
     } else {
       checkOkSetEnabled();
     }
   } catch (Throwable t) {
     Log.quit(t);
   }
 }
Exemplo n.º 9
0
  /**
   * Construct the widget. with interval, min, max entry boxes and ok and cancel buttons.
   *
   * @param displayControl The display
   * @param title title for frame
   * @param info the color scale info
   * @param showDialog true to show the dialog
   */
  public ColorScaleDialog(
      DisplayControlImpl displayControl, String title, ColorScaleInfo info, boolean showDialog) {
    ok = false;
    this.displayControl = displayControl;

    myInfo = new ColorScaleInfo(info);

    if (showDialog) {
      dialog =
          GuiUtils.createDialog(
              ((displayControl != null) ? displayControl.getWindow() : null), title, true);
    }

    doMakeContents(showDialog);
    String place = myInfo.getPlacement();
    // account for old bundles
    if (place != null) {
      placementBox.setSelectedItem(place);
    }
    // orientationBox.setSelectedItem(myInfo.getOrientation());
    visibilityCbx.setSelected(myInfo.getIsVisible());
    unitCbx.setSelected(myInfo.isUnitVisible());
    labelVisibilityCbx.setSelected(myInfo.getLabelVisible());
    alphaCbx.setSelected(myInfo.getUseAlpha());

    if (showDialog) {
      dialog.setVisible(true);
    }
  }
  public JComponent getSettingsComponent(final GraphVisualizer visualizer) {
    JPanel ret = new JPanel();

    GridLayout gl = new GridLayout(2, 1);
    ret.setLayout(gl);

    final JCheckBox gradientColorCB = new JCheckBox("Gradient color");
    final JCheckBox strokeLinesCB = new JCheckBox("Draw stroke lines");
    gradientColorCB.setSelected(this.gradientColor);
    strokeLinesCB.setSelected(this.strokeLines);

    ChangeListener cl =
        new ChangeListener() {
          public void stateChanged(ChangeEvent changeEvent) {
            VectorBezierEdgeRenderer.this.gradientColor = gradientColorCB.isSelected();
            VectorBezierEdgeRenderer.this.strokeLines = strokeLinesCB.isSelected();
            visualizer.getGraphArea().repaint();
          }
        };

    gradientColorCB.addChangeListener(cl);
    strokeLinesCB.addChangeListener(cl);

    ret.add(gradientColorCB);
    ret.add(strokeLinesCB);

    return ret;
  }
Exemplo n.º 11
0
  private JPanel buildCheckboxPanel() {
    JPanel tp = new JPanel();

    tp.setBorder(BorderFactory.createTitledBorder("Webserver Options"));
    tp.setLayout(new GridLayout(1, 2));
    String doLocalServer = JConfig.queryConfiguration("server.enabled", "false");
    String doAllowSyndication = JConfig.queryConfiguration("allow.syndication", "true");

    localServerBrowseBox = new JCheckBox("Use internal web server");
    localServerBrowseBox.setToolTipText(
        "<html><body>Turning this on enables JBidwatchers internal web server; 'Show in Browser' will go through JBidwatcher<br>first, in order to allow it to show old/deleted auctions,and to avoid the need to log in regularly.<br>The internal web server is password protected with your auction server username/password.</body></html>");
    // localServerBrowseBox.setToolTipText("Turning this on enables JBidwatchers internal web
    // server; 'Show in Browser' will go through JBidwatcher first, in order to allow it to show
    // old/deleted auctions, and to avoid the need to log in regularly.  The internal web server is
    // password protected with your auction server username/password.");
    localServerBrowseBox.setSelected(doLocalServer.equals("true"));
    tp.add(localServerBrowseBox);

    openSyndication = new JCheckBox("Allow syndication to bypass authentication");
    openSyndication.setToolTipText(
        "Allows syndication requests and thumbnail requests to be resolved without requiring a username/password.");
    openSyndication.setSelected(doAllowSyndication.equals("true"));
    tp.add(openSyndication);

    return tp;
  }
Exemplo n.º 12
0
  public void updateValues() {
    String doLocalServer = JConfig.queryConfiguration("server.enabled", "false");
    String doAllowSyndication = JConfig.queryConfiguration("allow.syndication", "true");

    localServerBrowseBox.setSelected(doLocalServer.equals("true"));
    openSyndication.setSelected(doAllowSyndication.equals("true"));
  }
Exemplo n.º 13
0
 public void loadData(SettingConfig settingConfig) {
   TEXT_dir.setText(settingConfig.dir);
   try {
     SELECT_logBuffer.setSelectedItem(SizeType.get(settingConfig.logBuffer).getName());
   } catch (Exception e) {
   }
   try {
     SELECT_delay.setSelectedItem(settingConfig.delay + "");
   } catch (Exception e) {
   }
   CHK_seek.setSelected(settingConfig.seek);
   CHK_showLineNumber.setSelected(settingConfig.showLineNumber);
   CHK_softWrap.setSelected(settingConfig.softWrap);
   TEXT_seekPos.setText(settingConfig.seekPos + "");
   try {
     SELECT_seekType.setSelectedItem(settingConfig.seekType.name());
   } catch (Exception e) {
   }
   try {
     SELECT_charset.setSelectedItem(settingConfig.charset.getName());
   } catch (Exception e) {
   }
   TEXT_limit.setText(settingConfig.overflowNum + "");
   checkSeek();
 }
 public void updateFrom(CvsApplicationLevelConfiguration config) {
   myPServerSettingsPanel.updateFrom(config);
   myCharset.setSelectedItem(config.ENCODING);
   myUseGZIPCompression.setSelected(config.USE_GZIP);
   myLogOutput.setSelected(config.DO_OUTPUT);
   mySendEnvironment.setSelected(config.SEND_ENVIRONMENT_VARIABLES_TO_SERVER);
 }
Exemplo n.º 15
0
 /** Nasatavení počtu kroků pro vykreslení. 0=automatické určení. */
 public final synchronized void setSteps(int steps) {
   if (steps < 0 || steps > MAX_STEPS) {
     steps = 0;
   }
   if (steps == 0) {
     guiSteps.setEnabled(false);
     guiChangingValue = true; // zabráním opětovnému vyvolání akce změny při změně gui
     guiStepsAuto.setSelected(true);
     // zabráním aby byla hodnota "0" v gui prvku pro počet kroů
     if (((Integer) guiSteps.getValue()).intValue() == 0) {
       guiSteps.setValue(100);
     }
     guiChangingValue = false;
   } else {
     guiSteps.setEnabled(true);
     guiChangingValue = true; // zabráním opětovnému vyvolání akce změny při změně gui
     guiStepsAuto.setSelected(false);
     guiSteps.setValue(steps);
     guiChangingValue = false;
   }
   this.steps = steps;
   for (ObjectListener l : listeners) {
     l.eventSpecificPropertiesChanged(this);
   }
 }
Exemplo n.º 16
0
 public SISCFrame(AppContext ctx) {
   setLayout(new BorderLayout());
   SchemePanel.SchemeDocument d = new SchemePanel.SchemeDocument();
   sp = new SchemePanel(ctx, d, new JTextPane(d));
   input = new JTextArea(4, 70);
   input.setText("; Enter s-expressions here");
   JSplitPane split = new JSplitPane(JSplitPane.VERTICAL_SPLIT, sp, input);
   JPanel execPanel = new JPanel();
   execPanel.setLayout(new BoxLayout(execPanel, BoxLayout.X_AXIS));
   execPanel.add(Box.createHorizontalGlue());
   eval = new JButton("Evaluate");
   clear = new JButton("Clear");
   autoClear = new JCheckBox("Auto-Clear");
   submitOnEnter = new JCheckBox("Evaluate on Enter");
   autoClear.setSelected(true);
   submitOnEnter.setSelected(true);
   execPanel.add(submitOnEnter);
   execPanel.add(autoClear);
   execPanel.add(clear);
   execPanel.add(eval);
   add(split, BorderLayout.CENTER);
   add(execPanel, BorderLayout.SOUTH);
   eval.addActionListener(this);
   clear.addActionListener(this);
   input.addKeyListener(this);
   /*	addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent e) {
   System.exit(0);
         }
         });*/
 }
Exemplo n.º 17
0
  public void setOptions(BeautiOptions options) {
    this.options = options;

    chainLengthField.setValue(options.chainLength);
    echoEveryField.setValue(options.echoEvery);
    logEveryField.setValue(options.logEvery);

    if (options.fileNameStem != null) {
      fileNameStemField.setText(options.fileNameStem);
    } else {
      fileNameStemField.setText(DEFAULT_FILE_NAME_STEM);
      fileNameStemField.setEnabled(false);
    }

    operatorAnalaysisCheck.setSelected(options.operatorAnalysis);

    updateOtherFileNames(options);

    if (options.contains(Microsatellite.INSTANCE)) {
      samplePriorCheckBox.setSelected(false);
      samplePriorCheckBox.setVisible(false);
    } else {
      samplePriorCheckBox.setVisible(true);
      samplePriorCheckBox.setSelected(options.samplePriorOnly);
    }

    optionsPanel.validate();
    optionsPanel.repaint();
  }
Exemplo n.º 18
0
  public BatteryAddonView(BatteryAddonModel model) {
    mBatterySlider = new JSlider(SwingConstants.HORIZONTAL, 0, 100, 50);
    mBatterySlider.setMajorTickSpacing(10);
    mBatterySlider.setMinorTickSpacing(5);
    mBatterySlider.setPaintTicks(true);
    mBatterySlider.setPaintLabels(true);
    mBatterySlider.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));

    mBatteryPresence = new JCheckBox("Is Present");
    mBatteryPresence.setSelected(true);

    mBatteryAC = new JCheckBox("AC plugged");
    mBatteryAC.setSelected(true);

    mBatteryStatusList = new JComboBox(mBatteryStatus);

    mBatteryHealthList = new JComboBox(mBatteryHealth);

    mBatteryNext = new JButton("Next time event");

    mFileChooser = new JFileChooser();
    mOpenButton = new JButton("Open a File");

    mBatteryEmulation = new JButton("Emulate Battery");
  }
Exemplo n.º 19
0
  void load() {
    FileInputStream fstream = null;

    try {
      fstream = new FileInputStream("settings.txt");
    } catch (FileNotFoundException ex) {
      Logger.getLogger(OptFrame.class.getName()).log(Level.SEVERE, null, ex);
    }

    DataInputStream in = new DataInputStream(fstream);
    BufferedReader br = new BufferedReader(new InputStreamReader(in));

    try {
      interp_text.setText(br.readLine().trim());
      size_panel_x.setText(br.readLine().trim());
      size_panel_y.setText(br.readLine().trim());
      sizePx.setText(br.readLine().trim());
      sizePy.setText(br.readLine().trim());
      distP.setText(br.readLine().trim());
      isSavingLogs = Boolean.parseBoolean(br.readLine().trim());
      seedInfoPath_field.setText(br.readLine().trim());
      saveDest_text.setText(br.readLine().trim());

      if (isSavingLogs) saveLogs_check.setSelected(true);
      else saveLogs_check.setSelected(false);
    } catch (IOException ex) {
      Logger.getLogger(OptFrame.class.getName()).log(Level.SEVERE, null, ex);
    }
  }
  public void reset(CodeStyleSettings settings) {
    myCbUseFQClassNames.setSelected(settings.USE_FQ_CLASS_NAMES);
    myCbUseSingleClassImports.setSelected(settings.USE_SINGLE_CLASS_IMPORTS);
    myCbInsertInnerClassImports.setSelected(settings.INSERT_INNER_CLASS_IMPORTS);
    myClassCountField.setText(Integer.toString(settings.CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND));
    myNamesCountField.setText(Integer.toString(settings.NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND));

    myImportLayoutPanel.getImportLayoutList().copyFrom(settings.IMPORT_LAYOUT_TABLE);
    myPackageList.copyFrom(settings.PACKAGES_TO_USE_IMPORT_ON_DEMAND);
    myFqnInJavadocOption.reset(settings);

    myImportLayoutPanel
        .getCbLayoutStaticImportsSeparately()
        .setSelected(settings.LAYOUT_STATIC_IMPORTS_SEPARATELY);

    final JBTable importLayoutTable = myImportLayoutPanel.getImportLayoutTable();
    AbstractTableModel model = (AbstractTableModel) importLayoutTable.getModel();
    model.fireTableDataChanged();

    model = (AbstractTableModel) myPackageTable.getModel();
    model.fireTableDataChanged();

    if (importLayoutTable.getRowCount() > 0) {
      importLayoutTable.getSelectionModel().setSelectionInterval(0, 0);
    }
    if (myPackageTable.getRowCount() > 0) {
      myPackageTable.getSelectionModel().setSelectionInterval(0, 0);
    }
  }
    @Override
    public Component getTreeCellRendererComponent(
        JTree tree,
        Object value,
        boolean sel,
        boolean expanded,
        boolean leaf,
        int row,
        boolean hasFocus) {
      super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);

      if (!(value instanceof File)) {
        labelRenderer.getTreeCellRendererComponent(tree, value, sel, expanded, false, row, false);
        labelRenderer.setIcon(null);
        return labelRenderer;
      }

      File file = (File) value;
      checkBox.setText(RecursiveLibraryDirectoryPanel.this.getText(file));
      // setColors(compTemp, tree, tree.getPathForRow(row), checkBox, sel);
      checkBox.setBackground(this.getBackground());
      checkBox.setForeground(this.getForeground());

      if (isExcluded(file)) {
        checkBox.setSelected(false);
        checkBox.setIcon(null);
      } else if (isFullyIncluded(file)) {
        checkBox.setSelected(true);
        checkBox.setIcon(null);
      } else {
        checkBox.setSelected(true);
        checkBox.setIcon(partiallyIncludedIcon);
      }
      return checkBox;
    }
  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);
    }
  }
  /** {@inheritDoc} */
  @Override
  public void contentHasChanged(boolean empty, String text) {
    if (labelHandler != null) {
      labelHandler.handleLabelStateFor(this, empty);
    }

    // check or unceheck sn / ski checkboxes
    final ServiceDigitalIdentityMultivalueAdapter serviceDigitalIdentityMultivalueAdapter =
        (ServiceDigitalIdentityMultivalueAdapter)
            certificateButton.getMultivaluePanel().getMultivalueModel();
    final List<DigitalIdentityType> digitalId =
        serviceDigitalIdentityMultivalueAdapter.getDigitalIdentityList().getDigitalId();

    boolean hasSn = false;
    boolean hasSki = false;

    for (Iterator<DigitalIdentityType> iterator = digitalId.iterator(); iterator.hasNext(); ) {
      DigitalIdentityType digitalIdentityType = iterator.next();
      if (digitalIdentityType.getX509SubjectName() != null) {
        hasSn = true;
      }
      if (digitalIdentityType.getX509SKI() != null) {
        hasSki = true;
      }
    }

    boxSN.setSelected(hasSn);
    boxSKI.setSelected(hasSki);

    alignSnSki();
  }
  public SimpleOpenTaskDialog(@NotNull final Project project, @NotNull final Task task) {
    super(project, false);
    myProject = project;
    myTask = task;
    TaskManagerImpl taskManager = (TaskManagerImpl) TaskManager.getManager(myProject);
    setTitle("Open Task");
    myTaskNameLabel.setText(TaskUtil.getTrimmedSummary(task));

    TaskManagerImpl manager = (TaskManagerImpl) TaskManager.getManager(project);
    ControlBinder binder = new ControlBinder(manager.getState());
    binder.bindAnnotations(this);
    binder.reset();

    TaskRepository repository = task.getRepository();
    if (repository == null
        || !repository
            .getRepositoryType()
            .getPossibleTaskStates()
            .contains(TaskState.IN_PROGRESS)) {
      myMarkAsInProgressBox.setVisible(false);
    }

    myClearContext.setSelected(taskManager.getState().clearContext);

    if (!manager.isVcsEnabled()) {
      myCreateChangelist.setEnabled(false);
      myCreateChangelist.setSelected(false);
    } else {
      myCreateChangelist.setSelected(taskManager.getState().createChangelist);
      myCreateChangelist.setEnabled(true);
    }
    init();
    getPreferredFocusedComponent();
  }
  private void resetFromFile(@NotNull VirtualFile file, @NotNull Project project) {
    final Module moduleForFile = ModuleUtilCore.findModuleForFile(file, project);
    if (moduleForFile == null) {
      return;
    }

    final VirtualFile parent = file.getParent();
    if (parent == null) {
      return;
    }

    if (myModule == null) {
      final Object prev = myModuleCombo.getSelectedItem();
      myModuleCombo.setSelectedItem(moduleForFile);

      if (!moduleForFile.equals(myModuleCombo.getSelectedItem())) {
        myModuleCombo.setSelectedItem(prev);
        return;
      }
    } else if (!myModule.equals(moduleForFile)) {
      return;
    }

    final JCheckBox checkBox = myCheckBoxes.get(parent.getName());
    if (checkBox == null) {
      return;
    }

    for (JCheckBox checkBox1 : myCheckBoxes.values()) {
      checkBox1.setSelected(false);
    }
    checkBox.setSelected(true);
    myFileNameCombo.getEditor().setItem(file.getName());
  }
Exemplo n.º 26
0
  @Override
  public void updateOptionsList() {
    myIsInSchemeChange = true;

    myLineSpacingField.setText(Float.toString(getLineSpacing()));
    FontPreferences fontPreferences = getFontPreferences();
    List<String> fontFamilies = fontPreferences.getEffectiveFontFamilies();
    myPrimaryCombo.setFontName(fontPreferences.getFontFamily());
    boolean isThereSecondaryFont = fontFamilies.size() > 1;
    myUseSecondaryFontCheckbox.setSelected(isThereSecondaryFont);
    mySecondaryCombo.setFontName(isThereSecondaryFont ? fontFamilies.get(1) : null);
    myEditorFontSizeField.setText(
        String.valueOf(fontPreferences.getSize(fontPreferences.getFontFamily())));

    boolean readOnly = ColorAndFontOptions.isReadOnly(myOptions.getSelectedScheme());
    myPrimaryCombo.setEnabled(!readOnly);
    mySecondaryCombo.setEnabled(isThereSecondaryFont && !readOnly);
    myOnlyMonospacedCheckBox.setEnabled(!readOnly);
    myLineSpacingField.setEnabled(!readOnly);
    myEditorFontSizeField.setEnabled(!readOnly);
    myUseSecondaryFontCheckbox.setEnabled(!readOnly);

    myEnableLigaturesCheckbox.setEnabled(!readOnly);
    myLigaturesInfoLinkLabel.setEnabled(!readOnly);
    myEnableLigaturesCheckbox.setSelected(fontPreferences.useLigatures());

    myIsInSchemeChange = false;
  }
  /** 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());
      }
    }
  }
  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);
    }
  }
Exemplo n.º 29
0
  public AboutPanel() {
    setTitle("About Panel");
    ImageIcon img = new ImageIcon("icons/preferences.jpg");
    setIconImage(img.getImage());
    Container contentPane = getContentPane();
    contentPane.setLayout(new MigLayout());

    setBackground(Color.GRAY);

    int style1 = Font.CENTER_BASELINE;
    Font font = new Font("Arial", style1, 13);

    about = new JLabel();
    about.setFont(font);
    String key = userPrefs.getRegistrationKey();
    if (key == null || key.length() == 0) {
      userPrefs.setRegistrationKey("Community Edition");
    }
    about.setText("<html>WattzAp Community Edition<br/><br/>Version 2.5.1<br/>19th August 2015");
    add(about, "alignx right, span");

    debug = new JCheckBox("Enable Debugging");
    if (userPrefs.isDebug()) {
      debug.setSelected(true);
    } else {
      debug.setSelected(false);
    }
    debug.addActionListener(this);
    add(debug);

    Dimension d = new Dimension(550, 300);
    this.setPreferredSize(d);
    pack();
    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  }
 private void init() {
   nameChkBox.setSelected((g_options & NAME) != 0);
   physNameChkBox.setSelected((g_options & PHYSICAL_NAME) != 0);
   aliasChkBox.setSelected((g_options & ALIAS) != 0);
   descripChkBox.setSelected((g_options & DESCRIPTION) != 0);
   stereotypeChkBox.setSelected((g_options & STEREOTYPE) != 0);
 } // end init()