Beispiel #1
0
  private void initialize() {
    setName("NewsPanel");
    setLayout(new GridBagLayout());
    refreshLanguage();

    // We create the components
    new TextComponentClipboardMenu(uploadPrioTextField, language);
    new TextComponentClipboardMenu(downloadPrioTextField, language);
    new TextComponentClipboardMenu(displayDaysTextField, language);
    new TextComponentClipboardMenu(downloadDaysTextField, language);
    new TextComponentClipboardMenu(messageBaseTextField, language);
    new TextComponentClipboardMenu(minimumIntervalTextField, language);
    new TextComponentClipboardMenu(concurrentUpdatesTextField, language);
    new TextComponentClipboardMenu(altEditTextField, language);

    // Adds all of the components
    final GridBagConstraints constraints = new GridBagConstraints();
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.WEST;
    constraints.weighty = 0.0;
    constraints.weightx = 0;

    constraints.insets = new Insets(0, 5, 5, 5);
    constraints.gridy = 0;

    constraints.gridx = 0;
    add(displayDaysLabel, constraints);
    constraints.gridx = 1;
    add(displayDaysTextField, constraints);

    constraints.gridx = 0;
    constraints.gridy++;
    add(downloadDaysLabel, constraints);
    constraints.gridx = 1;
    add(downloadDaysTextField, constraints);

    constraints.gridx = 0;
    constraints.gridy++;
    constraints.gridwidth = 2;
    add(alwaysDownloadBackloadCheckBox, constraints);
    constraints.gridwidth = 1;

    constraints.gridx = 0;
    constraints.gridy++;
    add(messageBaseLabel, constraints);
    constraints.gridx = 1;
    add(messageBaseTextField, constraints);

    constraints.gridy++;
    constraints.gridx = 0;
    add(uploadPrioLabel, constraints);
    constraints.gridx = 1;
    add(uploadPrioTextField, constraints);

    constraints.gridy++;
    constraints.gridx = 0;
    add(downloadPrioLabel, constraints);
    constraints.gridx = 1;
    add(downloadPrioTextField, constraints);
    constraints.gridx = 0;

    constraints.gridwidth = 2;

    constraints.gridy++;
    add(automaticBoardUpdateCheckBox, constraints);

    constraints.gridy++;
    add(getUpdatePanel(), constraints);

    constraints.gridy++;
    add(useOneConnectionForMessagesCheckBox, constraints);

    constraints.gridy++;
    add(storeSentMessagesCheckBox, constraints);

    constraints.gridy++;
    add(silentlyRetryCheckBox, constraints);

    constraints.gridwidth = 1;

    constraints.insets = new Insets(0, 5, 0, 5);

    constraints.gridy++;
    constraints.gridx = 0;
    add(altEditCheckBox, constraints);
    constraints.gridx = 1;
    constraints.weightx = 1;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    add(altEditTextField, constraints);
    constraints.weightx = 0;
    constraints.fill = GridBagConstraints.NONE;

    // glue
    constraints.gridy++;
    constraints.gridx = 0;
    constraints.gridwidth = 2;
    constraints.fill = GridBagConstraints.BOTH;
    constraints.weightx = 1;
    constraints.weighty = 1;
    add(new JLabel(""), constraints);

    // Add listeners
    automaticBoardUpdateCheckBox.addActionListener(listener);
    altEditCheckBox.addChangeListener(listener);
  }
Beispiel #2
0
  private void initialize() {
    setName("JunkPanel");
    setLayout(new GridBagLayout());
    refreshLanguage();

    // Adds all of the components
    final GridBagConstraints constraints = new GridBagConstraints();
    constraints.anchor = GridBagConstraints.WEST;
    final Insets insets5555 = new Insets(5, 5, 5, 5);
    constraints.insets = insets5555;
    constraints.weightx = 1.0;
    constraints.gridwidth = 1;
    constraints.gridy = 0;

    constraints.insets = insets5555;
    constraints.gridx = 0;

    add(hideJunkMessagesCheckBox, constraints);

    constraints.gridy++;

    add(markJunkIdentityBadCheckBox, constraints);

    constraints.gridy++;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    {
      final JSeparator separator = new JSeparator(SwingConstants.HORIZONTAL);
      add(separator, constraints);
    }
    constraints.fill = GridBagConstraints.NONE;
    constraints.gridy++;

    add(stopBoardUpdatesWhenDosedCheckBox, constraints);

    constraints.gridy++;

    {
      final JPanel subPanel = new JPanel(new GridBagLayout());
      final GridBagConstraints subConstraints = new GridBagConstraints();
      subConstraints.insets = new Insets(0, 10, 0, 10);
      subConstraints.anchor = GridBagConstraints.WEST;
      subConstraints.gridx = 0;
      subPanel.add(LinvalidSubsequentMessagesThreshold, subConstraints);
      subConstraints.gridx = 1;
      subPanel.add(TfInvalidSubsequentMessagesThreshold, subConstraints);

      add(subPanel, constraints);
    }

    // glue
    constraints.gridy++;
    constraints.gridx = 0;
    constraints.fill = GridBagConstraints.BOTH;
    constraints.weightx = 1;
    constraints.weighty = 1;
    add(new JLabel(""), constraints);

    // Add listeners
    stopBoardUpdatesWhenDosedCheckBox.addActionListener(listener);
  }
Beispiel #3
0
  private JPanel getUpdatePanel() {
    if (updatePanel == null) {
      updatePanel = new JPanel(new GridBagLayout());
      updatePanel.setBorder(new EmptyBorder(0, 30, 0, 5));
      final GridBagConstraints constraints = new GridBagConstraints();
      constraints.insets = new Insets(0, 5, 5, 5);
      constraints.weighty = 0;
      constraints.weightx = 0;
      constraints.anchor = GridBagConstraints.NORTHWEST;
      constraints.gridy = 0;

      constraints.fill = GridBagConstraints.HORIZONTAL;
      constraints.gridx = 0;
      constraints.weightx = 0.5;
      updatePanel.add(minimumIntervalLabel, constraints);
      constraints.fill = GridBagConstraints.NONE;
      constraints.gridx = 1;
      constraints.weightx = 1;
      updatePanel.add(minimumIntervalTextField, constraints);

      constraints.insets =
          new Insets(0, 5, 0, 5); // we have a bottom inset in the containing layout!
      constraints.fill = GridBagConstraints.HORIZONTAL;
      constraints.gridx = 0;
      constraints.gridy++;
      constraints.weightx = 0.5;
      updatePanel.add(concurrentUpdatesLabel, constraints);
      constraints.fill = GridBagConstraints.NONE;
      constraints.gridx = 1;
      constraints.weightx = 1;
      updatePanel.add(concurrentUpdatesTextField, constraints);
    }
    return updatePanel;
  }