Exemple #1
0
 private void updateObjects() {
   if (activeIdentifier != null) {
     Collection<VarScoped> objects = scopeFacet.getObjectsWithVariables(activeIdentifier);
     objectChooser.removeAllItems();
     String scopeName = selectedScope.getName();
     for (VarScoped cdo : objects) {
       if (cdo.getLocalScopeName().equals(scopeName)) {
         if (scopeFacet.get(activeIdentifier, selectedScope, cdo) != null) {
           objectChooser.addItem(new ObjectNameDisplayer(cdo));
         }
       }
     }
     if (objectChooser.getItemCount() != 0) {
       objectChooser.setSelectedIndex(0);
     }
   }
 }
Exemple #2
0
  /* (non-Javadoc)
   * @see pcgen.gui2.prefs.PreferencesPanel#initPreferences()
   */
  @Override
  public void applyOptionValuesToControls() {
    switch (SettingsHandler.getTabPlacement()) {
      case SwingConstants.TOP:
        mainTabPlacementCombo.setSelectedIndex(0);

        break;

      case SwingConstants.BOTTOM:
        mainTabPlacementCombo.setSelectedIndex(1);

        break;

      case SwingConstants.LEFT:
        mainTabPlacementCombo.setSelectedIndex(2);

        break;

      case SwingConstants.RIGHT:
        mainTabPlacementCombo.setSelectedIndex(3);

        break;

      default:
        Logging.errorPrint(
            "In PreferencesDialog.applyOptionValuesToControls (tab placement) the tab option "
                + SettingsHandler.getTabPlacement()
                + " is unsupported.");

        break;
    }

    switch (SettingsHandler.getChaTabPlacement()) {
      case SwingConstants.TOP:
        charTabPlacementCombo.setSelectedIndex(0);

        break;

      case SwingConstants.BOTTOM:
        charTabPlacementCombo.setSelectedIndex(1);

        break;

      case SwingConstants.LEFT:
        charTabPlacementCombo.setSelectedIndex(2);

        break;

      case SwingConstants.RIGHT:
        charTabPlacementCombo.setSelectedIndex(3);

        break;

      default:
        Logging.errorPrint(
            "In PreferencesDialog.applyOptionValuesToControls (cha tab placement) the tab option "
                + SettingsHandler.getChaTabPlacement()
                + " is unsupported.");

        break;
    }

    switch (SettingsHandler.getNameDisplayStyle()) {
      case Constants.DISPLAY_STYLE_NAME:
        tabLabelsCombo.setSelectedIndex(0);

        break;

      case Constants.DISPLAY_STYLE_NAME_CLASS:
        tabLabelsCombo.setSelectedIndex(1);

        break;

      case Constants.DISPLAY_STYLE_NAME_RACE:
        tabLabelsCombo.setSelectedIndex(2);

        break;

      case Constants.DISPLAY_STYLE_NAME_RACE_CLASS:
        tabLabelsCombo.setSelectedIndex(3);

        break;

      case Constants.DISPLAY_STYLE_NAME_FULL:
        tabLabelsCombo.setSelectedIndex(4);

        break;

      default:
        Logging.errorPrint(
            "In PreferencesDialog.applyOptionValuesToControls (name display style) the tab option "
                + SettingsHandler.getNameDisplayStyle()
                + " is unsupported.");

        break;
    }

    displayAbilitiesAsTab.setSelected(SettingsHandler.isAbilitiesShownAsATab());
    expertGUICheckBox.setSelected(SettingsHandler.isExpertGUI());
  }