/** 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();
   }
 }
Exemple #2
0
  private void setComponentsEnabled(boolean enabled) {
    list.setEnabled(enabled);
    process.setEnabled(enabled);
    remove.setEnabled(enabled);
    xres.setEnabled(enabled);
    yres.setEnabled(enabled);
    aspect.setEnabled(enabled);

    boolean b = aspect.isSelected() && enabled;
    colorLabel.setEnabled(b);
    colorBox.setEnabled(b);
    redLabel.setEnabled(b);
    red.setEnabled(b);
    redValue.setEnabled(b);
    greenLabel.setEnabled(b);
    green.setEnabled(b);
    greenValue.setEnabled(b);
    blueLabel.setEnabled(b);
    blue.setEnabled(b);
    blueValue.setEnabled(b);

    format.setEnabled(enabled);
    algorithm.setEnabled(enabled);
    prepend.setEnabled(enabled);
    append.setEnabled(enabled);
    output.setEnabled(enabled);
  }
  @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;
  }
 public void habilitarCampos(boolean value) {
   tfClave.setEnabled(value);
   tfMarca.setEnabled(value);
   tfNombre.setEnabled(value);
   tfExistencia.setEnabled(value);
   tfPrecio.setEnabled(value);
 }
  /**
   * Closes dialog box when the OK button is pressed, sets variables and calls algorithm.
   *
   * @param event Event that triggers function.
   */
  public void actionPerformed(ActionEvent event) {
    String command = event.getActionCommand();
    Object source = event.getSource();

    if (command.equals("OK")) {

      if (setVariables()) {
        callAlgorithm();
      }
    } else if (command.equals("Cancel")) {
      dispose();
    } else if (command.equals("Help")) {
      // MipavUtil.showHelp("");
    } else if (source.equals(doRicianCheckBox)) {
      if (doRicianCheckBox.isSelected()) {
        labelDegree.setEnabled(true);
        textDegree.setEnabled(true);
      } else {
        labelDegree.setEnabled(false);
        textDegree.setEnabled(false);
      }
    } else { // else if (source == thresholdCheckbox)
      super.actionPerformed(event);
    }
  }
  /**
   * Closes dialog box when the OK button is pressed and calls the algorithm.
   *
   * @param event Event that triggers function.
   */
  public void actionPerformed(ActionEvent event) {
    String command = event.getActionCommand();
    Object source = event.getSource();

    if (command.equals("OK")) {

      if (setVariables()) {
        callAlgorithm();
      }
    } else if (command.equals("Script")) {
      callAlgorithm();
    } else if (command.equals("Cancel")) {
      dispose();
    } else if (source == blueSmoothBox) {
      if (blueSmoothBox.isSelected()) {
        interpolationLabel.setEnabled(true);
        interpolationText.setEnabled(true);
      } else {
        interpolationLabel.setEnabled(false);
        interpolationText.setEnabled(false);
      }
    } else {
      super.actionPerformed(event);
    }
  }
  private void onBatch() {
    final boolean b = useBatchInputCheckbox.isSelected();

    orientationComboBox.setEnabled(b);
    lengthField.setEnabled(b);
    dpiXField.setEnabled(b);
    dpiYField.setEnabled(b);
    startDepthField.setEnabled(b);
    depthIncField.setEnabled(b);
    applyToAllButton.setEnabled(b);
    applyToSelectedButton.setEnabled(b);

    if (!b) {
      orientationLabel.setEnabled(b);
      lengthLabel.setEnabled(b);
      dpiXLabel.setEnabled(b);
      dpiYLabel.setEnabled(b);
      startDepthLabel.setEnabled(b);
      depthIncLabel.setEnabled(b);
    } else {
      orientationLabel.setEnabled(orientationComboBox.getSelectedIndex() != 2); // [Blank]
      lengthLabel.setEnabled(!lengthField.getText().equals(""));
      dpiXLabel.setEnabled(!dpiXField.getText().equals(""));
      dpiYLabel.setEnabled(!dpiYField.getText().equals(""));
      startDepthLabel.setEnabled(!startDepthField.getText().equals(""));
      depthIncLabel.setEnabled(!depthIncField.getText().equals(""));
    }
  }
Exemple #8
0
 public void enableChat() {
   openChat.setEnabled(false);
   chatWith.setEnabled(false);
   pickText.setEnabled(false);
   desText.setEnabled(false);
   send.setEnabled(true);
   chatText.setEnabled(true);
   new Thread(this).start();
 }
Exemple #9
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("");
    }
  }
Exemple #10
0
 /** Update button enable/disable state according enableCheckBox. */
 private void updateButtonsState() {
   sipProtocolCheckBox.setEnabled(enableCheckBox.isSelected());
   jabberProtocolCheckBox.setEnabled(enableCheckBox.isSelected());
   rtpProtocolCheckBox.setEnabled(enableCheckBox.isSelected());
   ice4jProtocolCheckBox.setEnabled(enableCheckBox.isSelected());
   fileCountField.setEnabled(enableCheckBox.isSelected());
   fileSizeField.setEnabled(enableCheckBox.isSelected());
   fileSizeLabel.setEnabled(enableCheckBox.isSelected());
   fileCountLabel.setEnabled(enableCheckBox.isSelected());
 }
  /** Sets up how the different GUI components should be viewed at startup. */
  private void initializeDisplay() {
    if (itemNames.getItemCount() > 0) {
      itemNames.setSelectedIndex(0);

    } else {
      txtFlavor.setEnabled(false);
      txtStock.setEnabled(false);
      txtSalePrice.setEnabled(false);
      btnUpdate.setEnabled(false);
      btnDelete.setEnabled(false);
      btnNew.doClick();
    }
  }
  private void setEnableStatusOfUseProxy(boolean enableStatus) {
    httpLabel.setEnabled(enableStatus);
    httpsLabel.setEnabled(enableStatus);
    ftpLabel.setEnabled(enableStatus);

    proxyAddressLabel.setEnabled(enableStatus);
    proxyPortLabel.setEnabled(enableStatus);
    proxyUserNameLabel.setEnabled(enableStatus);
    proxyPasswordLabel.setEnabled(enableStatus);
    httpProxyAddressTextField.setEnabled(enableStatus);
    httpProxyPortSpinner.setEnabled(enableStatus);
    httpProxyUserNameTextField.setEnabled(enableStatus);
    httpProxyPasswordField.setEnabled(enableStatus);

    httpsProxyAddressTextField.setEnabled(enableStatus);
    httpsProxyPortSpinner.setEnabled(enableStatus);
    httpsProxyUserNameTextField.setEnabled(enableStatus);
    httpsProxyPasswordField.setEnabled(enableStatus);

    ftpProxyAddressTextField.setEnabled(enableStatus);
    ftpProxyPortSpinner.setEnabled(enableStatus);
    ftpProxyUserNameTextField.setEnabled(enableStatus);
    ftpProxyPasswordField.setEnabled(enableStatus);

    socksLabel.setEnabled(!enableStatus);

    socksProxyAddressLabel.setEnabled(!enableStatus);
    socksProxyPortLabel.setEnabled(!enableStatus);
    socksProxyUserNameLabel.setEnabled(!enableStatus);
    socksProxyPasswordLabel.setEnabled(!enableStatus);
    socksProxyAddressTextField.setEnabled(!enableStatus);
    socksProxyPortSpinner.setEnabled(!enableStatus);
    socksProxyUserNameTextField.setEnabled(!enableStatus);
    socksProxyPasswordField.setEnabled(!enableStatus);
  }
Exemple #13
0
  /** Set the values in the panel to reflect the setting in the chart */
  protected void revertSettings() {

    setFieldValue(yAxisMinValueField, chartAdaptor.getMinYLimit());
    setFieldValue(yAxisMaxValueField, chartAdaptor.getMaxYLimit());

    setFieldValue(yAxisDivisionsField, chartAdaptor.getYNumMajorTicks() - 1);

    boolean yAutoScales = chartAdaptor.isYAutoScale();
    yAutoScaleCheckbox.setSelected(yAutoScales);

    yAxisMinValueField.setEnabled(!yAutoScales);
    yAxisMaxValueField.setEnabled(!yAutoScales);

    yAxisDivisionsField.setEnabled(!yAutoScales);
  }
Exemple #14
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();
  }
 public void disableEnableComponents(boolean disable) {
   typeSelection.setEnabled(disable);
   fieldSelection.setEnabled(disable);
   fieldDrop.setEnabled(disable);
   literalEntry.setEnabled(disable);
   addRemoveMappingChoice.setEnabled(disable);
 }
  @Override
  public JComponent createForm() {

    JComponent component = super.createForm();

    annotationComboBox.setRenderer(
        new DefaultListCellRenderer() {
          @Override
          public Component getListCellRendererComponent(
              JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
            super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
            if (value != null) {
              Annotation annotation = (Annotation) value;
              this.setText(annotation.getBrief());
            } else {
              this.setText("-- select annotation --");
            }
            return this;
          }
        });

    component.setLayout(new FormLayout("right:p, 4dlu, left:p", "p, 4dlu, p, 4dlu, p, 4dlu, p"));

    CellConstraints cc = new CellConstraints();

    component.add(getLabel("annotationLabel"), cc.xy(1, 1));
    component.add(annotationComboBox, cc.xy(3, 1));
    component.add(getLabel("patternLabel"), cc.xy(1, 3));
    component.add(patternField, cc.xy(3, 3));
    component.add(getLabel("ciLabel"), cc.xy(1, 5));
    component.add(caseInsensitive, cc.xy(3, 5));
    component.add(getLabel("remove"), cc.xy(1, 7));
    component.add(removeMatched, cc.xy(3, 7));

    patternField.setEnabled(false);
    caseInsensitive.setSelected(true);
    caseInsensitive.setEnabled(false);

    // action listener will fill out a suggested pattern for selected annotation types
    annotationComboBox.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            Object obj = annotationComboBox.getSelectedItem();
            if (obj == null) {
              patternField.setEnabled(false);
              caseInsensitive.setEnabled(false);
              setEnabled(false);
            } else {
              patternField.setEnabled(true);
              caseInsensitive.setEnabled(true);
              patternField.setText(getDefault(obj.getClass()));
              patternField.setCaretPosition(0);
              setEnabled(true);
            }
          }
        });

    return component;
  }
  /** 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());
      }
    }
  }
Exemple #18
0
  /** Load the settings of this panel */
  private void loadSettings() {
    uploadPrioTextField.setText(settings.getValue(SettingsClass.FCP2_DEFAULT_PRIO_MESSAGE_UPLOAD));
    downloadPrioTextField.setText(
        settings.getValue(SettingsClass.FCP2_DEFAULT_PRIO_MESSAGE_DOWNLOAD));
    useOneConnectionForMessagesCheckBox.setSelected(
        settings.getBoolValue(SettingsClass.FCP2_USE_ONE_CONNECTION_FOR_MESSAGES));

    displayDaysTextField.setText(settings.getValue(SettingsClass.MAX_MESSAGE_DISPLAY));
    downloadDaysTextField.setText(settings.getValue(SettingsClass.MAX_MESSAGE_DOWNLOAD));
    messageBaseTextField.setText(settings.getValue(SettingsClass.MESSAGE_BASE));
    alwaysDownloadBackloadCheckBox.setSelected(
        settings.getBoolValue(SettingsClass.ALWAYS_DOWNLOAD_MESSAGES_BACKLOAD));

    minimumIntervalTextField.setText(
        settings.getValue(SettingsClass.BOARD_AUTOUPDATE_MIN_INTERVAL));
    concurrentUpdatesTextField.setText(
        settings.getValue(SettingsClass.BOARD_AUTOUPDATE_CONCURRENT_UPDATES));

    // this setting is in MainFrame
    automaticBoardUpdateCheckBox.setSelected(
        MainFrame.getInstance().isAutomaticBoardUpdateEnabled());
    refreshUpdateState();

    storeSentMessagesCheckBox.setSelected(
        settings.getBoolValue(SettingsClass.STORAGE_STORE_SENT_MESSAGES));
    silentlyRetryCheckBox.setSelected(settings.getBoolValue(SettingsClass.SILENTLY_RETRY_MESSAGES));

    altEditCheckBox.setSelected(settings.getBoolValue(SettingsClass.ALTERNATE_EDITOR_ENABLED));
    altEditTextField.setEnabled(altEditCheckBox.isSelected());
    altEditTextField.setText(settings.getValue(SettingsClass.ALTERNATE_EDITOR_COMMAND));
  }
Exemple #19
0
  /**
   * Call this to set a custom gradle executor. We'll enable all fields appropriately and setup the
   * foundation settings. We'll also fire off a refresh.
   *
   * @param file the file to use as a custom executor. Null not to use one.
   */
  private void setCustomGradleExecutor(File file) {
    String storagePath;
    boolean isUsingCustom = false;
    if (file == null) {
      isUsingCustom = false;
      storagePath = null;
    } else {
      isUsingCustom = true;
      storagePath = file.getAbsolutePath();
    }

    // set the executor in the foundation
    if (gradlePluginLord.setCustomGradleExecutor(file)) {
      // refresh the tasks only if we actually changed the executor
      gradlePluginLord.addRefreshRequestToQueue();
    }

    // set the UI values
    useCustomGradleExecutorCheckBox.setSelected(isUsingCustom);
    customGradleExecutorField.setText(storagePath);

    // enable the UI appropriately.
    browseForCustomGradleExecutorButton.setEnabled(isUsingCustom);
    customGradleExecutorField.setEnabled(isUsingCustom);

    // store the settings
    settingsNode.setValueOfChild(CUSTOM_GRADLE_EXECUTOR, storagePath);
  }
Exemple #20
0
  // Initialize all the GUI components and display the frame
  private static void initGUI() {
    // Set up the status bar
    statusField = new JLabel();
    statusField.setText(statusMessages[DISCONNECTED]);
    statusColor = new JTextField(1);
    statusColor.setBackground(Color.red);
    statusColor.setEditable(false);
    statusBar = new JPanel(new BorderLayout());
    statusBar.add(statusColor, BorderLayout.WEST);
    statusBar.add(statusField, BorderLayout.CENTER);

    // Set up the options pane
    JPanel optionsPane = initOptionsPane();

    // Set up the chat pane
    JPanel chatPane = new JPanel(new BorderLayout());
    chatText = new JTextArea(10, 20);
    chatText.setLineWrap(true);
    chatText.setEditable(false);
    chatText.setForeground(Color.blue);
    JScrollPane chatTextPane =
        new JScrollPane(
            chatText,
            JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
            JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    chatLine = new JTextField();
    chatLine.setEnabled(false);
    chatLine.addActionListener(
        new ActionAdapter() {
          public void actionPerformed(ActionEvent e) {
            String s = chatLine.getText();
            if (!s.equals("")) {
              appendToChatBox("OUTGOING: " + s + "\n");
              chatLine.selectAll();

              // Send the string
              sendString(s);
            }
          }
        });
    chatPane.add(chatLine, BorderLayout.SOUTH);
    chatPane.add(chatTextPane, BorderLayout.CENTER);
    chatPane.setPreferredSize(new Dimension(200, 200));

    // Set up the main pane
    JPanel mainPane = new JPanel(new BorderLayout());
    mainPane.add(statusBar, BorderLayout.SOUTH);
    mainPane.add(optionsPane, BorderLayout.WEST);
    mainPane.add(chatPane, BorderLayout.CENTER);

    // Set up the main frame
    mainFrame = new JFrame("Simple TCP Chat");
    mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    mainFrame.setContentPane(mainPane);
    mainFrame.setSize(mainFrame.getPreferredSize());
    mainFrame.setLocation(200, 200);
    mainFrame.pack();
    mainFrame.setVisible(true);
  }
  public void enableOrder(boolean state) {
    textPlay.setEnabled(state);
    butPlay.setEnabled(state);

    if (state) {
      orderSent = false;
    }
  }
 private JTextField initializeGoToTextField() {
   JTextField textField = new JTextField();
   textField.setFont(new Font("Arial", Font.ITALIC, 10));
   textField.setEnabled(false);
   textField.addActionListener(this);
   textField.addFocusListener(this);
   return textField;
 }
 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());
 }
 private void updateSoftWrapSettingsRepresentation() {
   boolean softWrapsEnabled = myCbUseSoftWrapsAtEditor.isSelected();
   myCbUseCustomSoftWrapIndent.setEnabled(softWrapsEnabled);
   myCustomSoftWrapIndent.setEnabled(
       myCbUseCustomSoftWrapIndent.isEnabled() && myCbUseCustomSoftWrapIndent.isSelected());
   myCustomSoftWrapIndentLabel.setEnabled(myCustomSoftWrapIndent.isEnabled());
   myCbShowSoftWrapsOnlyOnCaretLine.setEnabled(softWrapsEnabled);
 }
  private void enableProxyAuthentication(boolean enabled) {
    myProxyPasswordLabel.setEnabled(enabled);
    myProxyLoginLabel.setEnabled(enabled);

    myProxyLoginTextField.setEnabled(enabled);
    myProxyPasswordTextField.setEnabled(enabled);

    myRememberProxyPasswordCheckBox.setEnabled(enabled);
  }
Exemple #26
0
  // 部屋に入室している状態のコンポーネント設定
  private void enteredRoom(String roomName) {
    this.roomName = roomName;
    setTitle(APPNAME + " " + roomName);

    msgTextField.setEnabled(true);
    submitButton.setEnabled(true);

    addRoomButton.setEnabled(false);
    enterRoomButton.setText("退室");
    enterRoomButton.setActionCommand("exitRoom");
  }
  private void enableProxy(boolean enabled) {
    myHostNameLabel.setEnabled(enabled);
    myPortNumberLabel.setEnabled(enabled);
    myProxyHostTextField.setEnabled(enabled);
    myProxyPortTextField.setEnabled(enabled);
    mySocks.setEnabled(enabled);
    myHTTP.setEnabled(enabled);
    myProxyExceptions.setEnabled(enabled);
    myProxyExceptionsLabel.setEnabled(enabled);
    myNoProxyForLabel.setEnabled(enabled);

    myProxyAuthCheckBox.setEnabled(enabled);
    enableProxyAuthentication(enabled && myProxyAuthCheckBox.isSelected());
    myCheckButton.setEnabled(canEnableConnectionCheck());

    final boolean autoDetectProxy = myAutoDetectProxyRb.isSelected();
    myPacUrlCheckBox.setEnabled(autoDetectProxy);
    myClearPasswordsButton.setEnabled(autoDetectProxy);
    myPacUrlTextField.setEnabled(autoDetectProxy && myPacUrlCheckBox.isSelected());
  }
Exemple #28
0
  // 部屋に入室していない状態のコンポーネント設定
  private void exitedRoom() {
    roomName = null;
    setTitle(APPNAME);

    msgTextField.setEnabled(false);
    submitButton.setEnabled(false);

    addRoomButton.setEnabled(true);
    enterRoomButton.setText("入室");
    enterRoomButton.setActionCommand("enterRoom");
    userList.setModel(new DefaultListModel());
  }
  /**
   * Enabled / disable publishing controls depending on the state of the "Enable Publishing" mark.
   */
  private void onPublishingEnabled() {
    boolean enabled = chPublishingEnabled.isSelected();

    lbPublishingPublic.setEnabled(enabled);
    chPublishingPublic.setEnabled(enabled);
    lbLastPublishingDate.setEnabled(enabled);
    tfLastPublishingDate.setEnabled(enabled);
    lbPublishingTags.setEnabled(enabled);
    lbPublishingTitle.setEnabled(enabled);
    lbPublishingURL.setEnabled(enabled);
    lnkPublishingURL.setEnabled(enabled);
    btnCopyToClipboard.setEnabled(enabled);
    tfPublishingTags.setEnabled(enabled);
    tfPublishingTitle.setEnabled(enabled);
    lbPublishingRating.setEnabled(enabled);
    sscPublishingRating.setEnabled(enabled);

    if (enabled && StringUtils.isEmpty(getPublishingTitle())) {
      tfPublishingTitle.setText(getGuideTitle());
    }
  }
 /** Constructor */
 public ServiceFilterPanel(String text, Vector list) {
   empty_border = new EmptyBorder(5, 5, 0, 5);
   indent_border = new EmptyBorder(5, 25, 5, 5);
   service_box = new JCheckBox(text);
   service_box.addActionListener(this);
   service_data = new Vector();
   if (list != null) {
     service_box.setSelected(true);
     service_data = (Vector) list.clone();
   }
   service_list = new JList(service_data);
   service_list.setBorder(new EtchedBorder());
   service_list.setVisibleRowCount(5);
   service_list.addListSelectionListener(this);
   service_list.setEnabled(service_box.isSelected());
   service_scroll = new JScrollPane(service_list);
   service_scroll.setBorder(new EtchedBorder());
   remove_service_button = new JButton("Remove");
   remove_service_button.addActionListener(this);
   remove_service_button.setEnabled(false);
   remove_service_panel = new JPanel();
   remove_service_panel.setLayout(new FlowLayout());
   remove_service_panel.add(remove_service_button);
   service_area = new JPanel();
   service_area.setLayout(new BorderLayout());
   service_area.add(service_scroll, BorderLayout.CENTER);
   service_area.add(remove_service_panel, BorderLayout.EAST);
   service_area.setBorder(indent_border);
   add_service_field = new JTextField();
   add_service_field.addActionListener(this);
   add_service_field.getDocument().addDocumentListener(this);
   add_service_field.setEnabled(service_box.isSelected());
   add_service_button = new JButton("Add");
   add_service_button.addActionListener(this);
   add_service_button.setEnabled(false);
   add_service_panel = new JPanel();
   add_service_panel.setLayout(new BorderLayout());
   JPanel dummy = new JPanel();
   dummy.setBorder(empty_border);
   add_service_panel.add(dummy, BorderLayout.WEST);
   add_service_panel.add(add_service_button, BorderLayout.EAST);
   add_service_area = new JPanel();
   add_service_area.setLayout(new BorderLayout());
   add_service_area.add(add_service_field, BorderLayout.CENTER);
   add_service_area.add(add_service_panel, BorderLayout.EAST);
   add_service_area.setBorder(indent_border);
   setLayout(new BorderLayout());
   add(service_box, BorderLayout.NORTH);
   add(service_area, BorderLayout.CENTER);
   add(add_service_area, BorderLayout.SOUTH);
   setBorder(empty_border);
 }