protected String createGraphTitle(SourceIdentifier sourceIdentifier) {
    ApplicationPreferences applicationPreferences = mainFrame.getApplicationPreferences();
    Map<String, String> sourceNames = null;
    boolean showingPrimaryIdentifier = false;
    if (applicationPreferences != null) {
      sourceNames = applicationPreferences.getSourceNames();
      showingPrimaryIdentifier = applicationPreferences.isShowingPrimaryIdentifier();
    }
    String title =
        ViewActions.getPrimarySourceTitle(
            sourceIdentifier.getIdentifier(), sourceNames, showingPrimaryIdentifier);

    return title + " @ " + DateTimeFormatters.DATETIME_IN_SYSTEM_ZONE_SPACE.format(Instant.now());
  }
Beispiel #2
0
  public void saveSettings() {
    applicationPreferences.setScrollingToBottom(scrollingToBottomCheckbox.isSelected());
    applicationPreferences.setColoringWholeRow(coloringWholeRowCheckbox.isSelected());
    applicationPreferences.setShowingFullCallstack(showFullCallstackCheckbox.isSelected());
    applicationPreferences.setShowingStackTrace(showStackTraceCheckbox.isSelected());
    applicationPreferences.setUsingWrappedExceptionStyle(
        usingWrappedExceptionStyleCheckbox.isSelected());

    applicationPreferences.setLookAndFeel((String) lookAndFeelCombo.getSelectedItem());
    applicationPreferences.setDefaultConditionName(
        (String) defaultConditionCombo.getSelectedItem());

    applicationPreferences.setApplicationPath(new File(appPathTextField.getText()));

    applicationPreferences.setGlobalLoggingEnabled(globalLoggingEnabledCheckbox.isSelected());
    applicationPreferences.setLoggingStatisticEnabled(loggingStatsEnabledCheckbox.isSelected());
    applicationPreferences.setTrayActive(trayActiveCheckbox.isSelected());
    applicationPreferences.setHidingOnClose(hidingOnCloseCheckbox.isSelected());
  }
Beispiel #3
0
  public void initUI() {
    scrollingToBottomCheckbox.setSelected(applicationPreferences.isScrollingToBottom());
    coloringWholeRowCheckbox.setSelected(applicationPreferences.isColoringWholeRow());
    showFullCallstackCheckbox.setSelected(applicationPreferences.isShowingFullCallstack());
    showStackTraceCheckbox.setSelected(applicationPreferences.isShowingStackTrace());
    usingWrappedExceptionStyleCheckbox.setSelected(
        applicationPreferences.isUsingWrappedExceptionStyle());

    // look and feel
    {
      ArrayList<String> lookAndFeels = new ArrayList<>();
      for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
        lookAndFeels.add(info.getName());
      }
      Collections.sort(lookAndFeels);
      int selectedIndex = 0;
      String lookAndFeel = applicationPreferences.getLookAndFeel();
      if (lookAndFeel == null || "".equals(lookAndFeel)) {
        lookAndFeel = UIManager.getLookAndFeel().getName();
      }
      int idx = lookAndFeels.indexOf(lookAndFeel);
      if (idx > -1) {
        selectedIndex = idx;
      } else {
        idx = lookAndFeels.indexOf(ApplicationPreferences.STARTUP_LOOK_AND_FEEL);
        if (idx > -1) {
          selectedIndex = idx;
        }
      }
      lookAndFeelCombo.setModel(
          new DefaultComboBoxModel<>(lookAndFeels.toArray(new String[lookAndFeels.size()])));
      lookAndFeelCombo.setSelectedIndex(selectedIndex);
    }

    // default condition name
    {
      List<String> conditionNames = applicationPreferences.retrieveAllConditions();
      String defaultName = applicationPreferences.getDefaultConditionName();
      int idx = conditionNames.indexOf(defaultName);
      if (idx < 0) {
        idx = 0;
      }

      defaultConditionCombo.setModel(
          new DefaultComboBoxModel<>(conditionNames.toArray(new String[conditionNames.size()])));
      defaultConditionCombo.setSelectedIndex(idx);
    }
    String appPath = applicationPreferences.getApplicationPath().getAbsolutePath();
    appPathTextField.setText(appPath);
    appPathTextField.setToolTipText(appPath);

    globalLoggingEnabledCheckbox.setSelected(applicationPreferences.isGlobalLoggingEnabled());
    loggingStatsEnabledCheckbox.setSelected(applicationPreferences.isLoggingStatisticEnabled());
    trayActiveCheckbox.setSelected(applicationPreferences.isTrayActive());
    trayActiveCheckbox.setEnabled(TraySupport.isAvailable());
    hidingOnCloseCheckbox.setSelected(applicationPreferences.isHidingOnClose());
    hidingOnCloseCheckbox.setEnabled(TraySupport.isAvailable());
  }