private void fillGUI() {
    Object[] attributes;
    boolean enabled;
    if (context != null) {
      attributes = this.context.getAttributes().toArray();
      enabled = true;
    } else {
      attributes = new Object[] {"No context available"};
      enabled = false;
    }

    sequenceColumnChooser.setModel(new DefaultComboBoxModel(attributes));
    sequenceColumnChooser.setEnabled(enabled);

    timelineColumnChooser.setModel(new DefaultComboBoxModel(attributes));
    timelineColumnChooser.setEnabled(enabled);
    if (context != null) {
      timelineColumnChooser.setSelectedIndex(Math.min(attributes.length - 1, 1));
    }

    calculateValueLists();
    fillSequenceChooser();

    setButtonStates(!enabled);
  }
 /*
  * (non-Javadoc)
  *
  * @see java.util.Observer#update(java.util.Observable, java.lang.Object)
  */
 @Override
 public void update(Observable o, Object arg) {
   if (o instanceof qcevolutionbackend) {
     if (null != backend.getCurrentse()) {
       backend.getCurrentse().addObserver(this);
     }
   } else if (o instanceof ProblemManager) {
     Set<String> probs = backend.getProbmanager().getAvailableProblems();
     String[] options = new String[probs.size() + 1];
     options[0] = "Please Select Problem";
     int index = 1;
     Iterator<String> iter = probs.iterator();
     while (iter.hasNext()) {
       options[index++] = iter.next();
     }
     selection_model = new DefaultComboBoxModel(options);
     if (backend.getQproblem() != null) {
       String key = backend.getQproblem().getName();
       selection_model.setSelectedItem(key);
       description.setText(backend.getProbmanager().getSearchEngineDesc(key));
     }
     selection.setModel(selection_model);
   } else {
     if (backend.getCurrentse() != null) {
       if (backend.getCurrentse().getState() == SearchEngineState.Searching) {
         selection.setEnabled(false);
       } else {
         selection.setEnabled(true);
       }
       validate();
     }
   }
 }
Esempio n. 3
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);
  }
Esempio n. 4
0
 public void disableEnableComponents(boolean disable) {
   typeSelection.setEnabled(disable);
   fieldSelection.setEnabled(disable);
   fieldDrop.setEnabled(disable);
   literalEntry.setEnabled(disable);
   addRemoveMappingChoice.setEnabled(disable);
 }
Esempio n. 5
0
 public void setEnableForAllElements(SuperAdapter superAdapter, boolean status) {
   chrBox1.setEnabled(status);
   chrBox2.setEnabled(status);
   refreshButton.setEnabled(status);
   colorRangePanel.setElementsVisible(status, superAdapter);
   setResolutionSliderVisible(status, superAdapter);
   goPanel.setEnabled(status);
 }
    public void updateCombo() {
      boolean enableChooser = myOverrideLAFFonts.isSelected();

      myFontCombo.setEnabled(enableChooser);
      myFontSizeCombo.setEnabled(enableChooser);
      myFontNameLabel.setEnabled(enableChooser);
      myFontSizeLabel.setEnabled(enableChooser);
    }
Esempio n. 7
0
 public void setEnabledForNormalization(String[] normalizationOptions, boolean status) {
   if (normalizationOptions.length == 1) {
     normalizationComboBox.setEnabled(false);
   } else {
     normalizationComboBox.setModel(new DefaultComboBoxModel<String>(normalizationOptions));
     normalizationComboBox.setSelectedIndex(0);
     normalizationComboBox.setEnabled(status && !isWholeGenome());
   }
 }
  private void updateEnabled() {
    combo.setEnabled(action.isSelected());
    list.setEnabled(action.isSelected());

    boolean iconControlsEnabled = !separator.isSelected();
    builtin.setEnabled(iconControlsEnabled);
    file.setEnabled(iconControlsEnabled);
    builtinCombo.setEnabled(iconControlsEnabled && builtin.isSelected());
    fileButton.setEnabled(iconControlsEnabled && file.isSelected());
  }
 private void updateEnabledItems() {
   if (myRbExisting.isSelected()) {
     myExistingListsCombo.setEnabled(true);
     UIUtil.setEnabled(myNewListPanel, false, true);
     myExistingListsCombo.requestFocus();
   } else {
     myExistingListsCombo.setEnabled(false);
     UIUtil.setEnabled(myNewListPanel, true, true);
     myNewListPanel.requestFocus();
   }
   if (myProject != null) {
     myNewListPanel.nameChangedImpl(myProject, null);
   }
 }
Esempio n. 10
0
  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(""));
    }
  }
Esempio n. 11
0
  public void setIndexer(LibrariesIndexer indexer) {
    this.indexer = indexer;

    DropdownItem<DownloadableContribution> previouslySelectedCategory = (DropdownItem<DownloadableContribution>) categoryChooser.getSelectedItem();
    DropdownItem<DownloadableContribution> previouslySelectedType = (DropdownItem<DownloadableContribution>) typeChooser.getSelectedItem();

    categoryChooser.removeActionListener(categoryChooserActionListener);
    typeChooser.removeActionListener(typeChooserActionListener);

    // TODO: Remove setIndexer and make getContribModel 
    // return a FilteredAbstractTableModel
    getContribModel().setIndexer(indexer);

    categoryFilter = null;
    categoryChooser.removeAllItems();

    // Load categories
    categoryChooser.addItem(new DropdownAllItem());
    Collection<String> categories = indexer.getIndex().getCategories();
    for (String category : categories) {
      categoryChooser.addItem(new DropdownLibraryOfCategoryItem(category));
    }

    categoryChooser.setEnabled(categoryChooser.getItemCount() > 1);

    categoryChooser.addActionListener(categoryChooserActionListener);
    if (previouslySelectedCategory != null) {
      categoryChooser.setSelectedItem(previouslySelectedCategory);
    } else {
      categoryChooser.setSelectedIndex(0);
    }

    typeFilter = null;
    typeChooser.removeAllItems();
    typeChooser.addItem(new DropdownAllItem());
    typeChooser.addItem(new DropdownInstalledLibraryItem(indexer.getIndex()));
    java.util.List<String> types = new LinkedList<String>(indexer.getIndex().getTypes());
    Collections.sort(types, new LibraryTypeComparator());
    for (String type : types) {
      typeChooser.addItem(new DropdownLibraryOfTypeItem(type));
    }
    typeChooser.setEnabled(typeChooser.getItemCount() > 1);
    typeChooser.addActionListener(typeChooserActionListener);
    if (previouslySelectedType != null) {
      typeChooser.setSelectedItem(previouslySelectedType);
    } else {
      typeChooser.setSelectedIndex(0);
    }

    filterField.setEnabled(contribModel.getRowCount() > 0);

    // Create LibrariesInstaller tied with the provided index
    installer = new LibraryInstaller(indexer, platform) {
      @Override
      public void onProgress(Progress progress) {
        setProgress(progress);
      }
    };
  }
Esempio n. 12
0
  public void setNormalizationDisplayState(HiC hic) {

    // Test for new dataset ("All"),  or change in chromosome
    if (isWholeGenome()) { // for now only allow observed
      hic.setDisplayOption(MatrixType.OBSERVED);
      displayOptionComboBox.setSelectedIndex(0);
      normalizationComboBox.setSelectedIndex(0);
    } else if (isIntraChromosomal()) {
      if (hic.getDisplayOption() == MatrixType.PEARSON) {
        hic.setDisplayOption(MatrixType.OBSERVED);
        displayOptionComboBox.setSelectedIndex(0);
      }
    }

    normalizationComboBox.setEnabled(!isWholeGenome());
    displayOptionComboBox.setEnabled(true);
  }
Esempio n. 13
0
 private void loadStates() {
   boolean b = enableDefaultEncryption.isSelected();
   cboSavpOption.setEnabled(b);
   this.encryptionProtocolPreferences.setEnabled(b);
   enableSipZrtpAttribute.setEnabled(
       b && this.encryptionConfigurationTableModel.isEnabledLabel("ZRTP"));
   tabCiphers.setEnabled(b && this.encryptionConfigurationTableModel.isEnabledLabel("SDES"));
 }
 @NotNull
 JComponent createComponent() {
   myRemoteCombobox = new JComboBox();
   myRemoteCombobox.setRenderer(new RemoteCellRenderer(myRemoteCombobox.getRenderer()));
   for (GitRemote remote : myRemotes) {
     myRemoteCombobox.addItem(remote);
   }
   myRemoteCombobox.setToolTipText("Select remote");
   if (myRemotes.size() == 1) {
     myRemoteCombobox.setEnabled(false);
   }
   return myRemoteCombobox;
 }
 public void updateLists(List<? extends ChangeList> lists) {
   //noinspection unchecked
   myChooser.setModel(new DefaultComboBoxModel(lists.toArray()));
   myChooser.setEnabled(lists.size() > 1);
   if (lists.contains(mySelectedChangeList)) {
     myChooser.setSelectedItem(mySelectedChangeList);
   } else {
     if (myChooser.getItemCount() > 0) {
       myChooser.setSelectedIndex(0);
     }
   }
   mySelectedChangeList = (ChangeList) myChooser.getSelectedItem();
 }
 private void initAccess() {
   // hide repository popup if necessary
   if (!Users.doesCurrentUserHaveAccess(Users.ACCESS_CLASS_PROJECT_MANAGER)) {
     tabbedPane.removeTabAt(2);
   }
   // if user is not at least advanced data entry set the record to read only
   if (!Users.doesCurrentUserHaveAccess(Users.ACCESS_CLASS_ADVANCED_DATA_ENTRY)) {
     setFormToReadOnly();
     this.getAddNonPreferredNameButton().setVisible(false);
     this.getRemoveNonPreferredNameButton().setVisible(false);
     nameDescriptionType.setEnabled(false);
   }
 }
 public void setType(String type) {
   if ("Control Change".equals(type)) {
     channel.setEnabled(true);
     cc.setEnabled(true);
     min.setEnabled(true);
     max.setEnabled(true);
     min.setValue(0);
     max.setValue(127);
     modeList.setEnabled(false);
   } else if ("NRPN".equals(type)) {
     channel.setEnabled(true);
     cc.setEnabled(true);
     min.setEnabled(true);
     max.setEnabled(true);
     min.setValue(0);
     max.setValue(127);
     modeList.setEnabled(false);
   } else if ("Pitch Bend".equals(type)) {
     channel.setEnabled(true);
     cc.setEnabled(false);
     min.setEnabled(true);
     max.setEnabled(true);
     min.setValue(-8192);
     max.setValue(8191);
     modeList.setEnabled(false);
   } else if ("Basenote".equals(type)) {
     channel.setEnabled(false);
     cc.setEnabled(false);
     min.setEnabled(true);
     max.setEnabled(true);
     min.setValue(0);
     max.setValue(127);
     modeList.setEnabled(false);
   } else if ("Scale".equals(type)) {
     channel.setEnabled(false);
     cc.setEnabled(false);
     min.setEnabled(false);
     max.setEnabled(false);
     modeList.setEnabled(false);
   } else if ("Mode Change".equals(type)) {
     channel.setEnabled(false);
     cc.setEnabled(false);
     min.setEnabled(false);
     max.setEnabled(false);
     modeList.setEnabled(true);
   } else if ("Unassigned".equals(type)) {
     channel.setEnabled(false);
     cc.setEnabled(false);
     min.setEnabled(false);
     max.setEnabled(false);
     modeList.setEnabled(false);
   }
 }
  /**
   * Sets the experiment which will have the custom properties edited.
   *
   * @param exp a value of type 'Experiment'
   */
  public void setExperiment(Experiment exp) {

    m_Exp = exp;
    m_StatusBox.setEnabled(true);
    m_ArrayEditor.setValue(m_Exp.getPropertyArray());
    if (m_Exp.getPropertyArray() == null) {
      m_StatusBox.setSelectedIndex(0);
      m_ConfigureBut.setEnabled(false);
    } else {
      m_StatusBox.setSelectedIndex(m_Exp.getUsePropertyIterator() ? 1 : 0);
      m_ConfigureBut.setEnabled(m_Exp.getUsePropertyIterator());
    }
    validate();
  }
Esempio n. 19
0
  public LibraryManagerUI(Frame parent, Platform platform) {
    super(parent, "Library Manager", Dialog.ModalityType.APPLICATION_MODAL, _("Unable to reach Arduino.cc due to possible network issues."));
    this.platform = platform;

    filtersContainer.add(new JLabel(_("Topic")), 1);
    filtersContainer.remove(2);

    typeChooser = new JComboBox();
    typeChooser.setMaximumRowCount(20);
    typeChooser.setEnabled(false);

    filtersContainer.add(Box.createHorizontalStrut(5), 0);
    filtersContainer.add(new JLabel(_("Type")), 1);
    filtersContainer.add(Box.createHorizontalStrut(5), 2);
    filtersContainer.add(typeChooser, 3);
  }
  private void completePanel() {
    if (criterion != null) {
      jtfCode.setText(criterion.getCode());
      jtfCode.setEditable(false);
      jtfLibelle.setText(criterion.getLibelle());

      jcbSortOrder.setSelectedIndex((criterion.getSortOrder() > 0) ? 0 : 1);

      jcbPlacementCriterion.setSelected(criterion.isPlacement());
      jcbClassementCriterion.setSelected(criterion.isClassement());

      jcbSortOrder.setEnabled(!parent.getWorkConfiguration().isOfficialProfile());
      jcbPlacementCriterion.setEnabled(!parent.getWorkConfiguration().isOfficialProfile());
      jcbClassementCriterion.setEnabled(!parent.getWorkConfiguration().isOfficialProfile());
    }
  }
  /** Creates the property iterator panel initially disabled. */
  public GeneratorPropertyIteratorPanel() {

    String[] options = {"Disabled", "Enabled"};
    ComboBoxModel cbm = new DefaultComboBoxModel(options);
    m_StatusBox.setModel(cbm);
    m_StatusBox.setSelectedIndex(0);
    m_StatusBox.addActionListener(this);
    m_StatusBox.setEnabled(false);
    m_ConfigureBut.setEnabled(false);
    m_ConfigureBut.addActionListener(this);
    JPanel buttons = new JPanel();
    GridBagLayout gb = new GridBagLayout();
    GridBagConstraints constraints = new GridBagConstraints();
    buttons.setBorder(BorderFactory.createEmptyBorder(10, 5, 10, 5));
    //    buttons.setLayout(new GridLayout(1, 2));
    buttons.setLayout(gb);
    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.weightx = 5;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.insets = new Insets(0, 2, 0, 2);
    buttons.add(m_StatusBox, constraints);
    constraints.gridx = 1;
    constraints.gridy = 0;
    constraints.weightx = 5;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    buttons.add(m_ConfigureBut, constraints);
    buttons.setMaximumSize(
        new Dimension(buttons.getMaximumSize().width, buttons.getMinimumSize().height));
    setBorder(BorderFactory.createTitledBorder("Generator properties"));
    setLayout(new BorderLayout());
    add(buttons, BorderLayout.NORTH);
    //    add(Box.createHorizontalGlue());
    m_ArrayEditor.setBorder(BorderFactory.createEtchedBorder());
    m_ArrayEditor.addPropertyChangeListener(
        new PropertyChangeListener() {
          public void propertyChange(PropertyChangeEvent e) {
            System.err.println("Updating experiment property iterator array");
            m_Exp.setPropertyArray(m_ArrayEditor.getValue());
          }
        });
    add(m_ArrayEditor, BorderLayout.CENTER);
  }
Esempio n. 22
0
  private void updateParams(EDPCellData data) {
    paramComboBox.removeAllItems();
    paramKeys = data.getPlugin().getPrintfDescrs(!m_isCrawlRuleEditor);
    if (!m_isCrawlRuleEditor) {
      paramComboBox.addItem(STRING_LITERAL);
    }

    for (Iterator it = paramKeys.values().iterator(); it.hasNext(); ) {
      ConfigParamDescr descr = (ConfigParamDescr) it.next();
      int type = descr.getType();
      if (!m_isCrawlRuleEditor
          && (type == ConfigParamDescr.TYPE_SET || type == ConfigParamDescr.TYPE_RANGE)) continue;
      paramComboBox.addItem(descr);
    }
    paramComboBox.setEnabled(true);
    paramComboBox.setSelectedIndex(0);
    paramComboBox.setToolTipText("Select a parameter to insert into the format string");
    insertButton.setEnabled(true);
  }
Esempio n. 23
0
        @Override
        public void run() {
          final RunningVM[] vms = p.getRunningVMs();
          final Object[] ar = new Object[((vms == null) ? 0 : vms.length) + 1];

          if (vms == null) {
            ar[0] = ERROR_GETTING_PROCESSES_ITEM_TEXT;
          } else if (vms.length == 0) {
            ar[0] = NO_PROCESSES_ITEM_TEXT;
          } else {
            ar[0] = SELECT_PROCESS_ITEM_TEXT;
            arraycopy(vms, 0, ar, 1, vms.length);
          }
          invokeLater(
              () -> {
                combo.setEnabled(true);
                combo.setModel(new DefaultComboBoxModel<>(ar));
                updateInfo();
              });
        }
  private StaticPanel createStaticComboBoxPanel(
      PrimitiveForm primitiveForm, DOTProperty property, String labelText, Object[] items) {
    JLabel label = new JLabel(labelText);
    JComboBox comboBox = new JComboBox(items);
    comboBox.setMaximumSize(new Dimension(300, 25));
    comboBox.setEnabled(_dotDefinitionDialogFrame.isEditable());

    StaticPanel thePanel = new StaticPanel(primitiveForm, property);
    thePanel.setMaximumSize(new Dimension(300, 25));
    thePanel.setLayout(new SpringLayout());
    thePanel.setBorder(BorderFactory.createMatteBorder(2, 2, 2, 2, Color.BLACK));
    thePanel.add(label);
    thePanel.add(comboBox);
    SpringUtilities.makeCompactGrid(thePanel, 2, 5, 5);

    thePanel.setValue(comboBox);
    thePanel.addListener(comboBox);

    return thePanel;
  }
Esempio n. 25
0
  /** Sets the current parameter */
  public void setCurrentParameter(String param) {
    comptype.setEnabled(param != null);
    defval.setEnabled(param != null);
    defval.setText("");

    if (curparam != null) {
      guilines.put(curparam, getGUILine(curparam));
    }

    curparam = param;

    if (param != null) {
      guicallback = false;

      if (!params.containsKey(param)) {
        initParam(param);
      }

      Enumeration enumeration = comppanels.elements();
      ComponentPanelInterface comp;

      while (enumeration.hasMoreElements()) {
        comp = (ComponentPanelInterface) enumeration.nextElement();
        comp.reset(param);
      }

      defval.setText(guipanel.getDefaultValue(param));
      comptype.setSelectedItem(params.get(param));

      if (guilines.containsKey(param)) {
        ((ComponentPanelInterface) comppanels.get(params.get(param)))
            .setGUIBuilderStr((String) guilines.get(param));
      }

      ((ComponentPanelInterface) comppanels.get(params.get(param)))
          .notifyDefaultValue(guipanel.getDefaultValue(param));

      guicallback = true;
    }
  }
Esempio n. 26
0
  /**
   * Does Nothing
   *
   * @param selected, true to enable, false to disable.
   */
  public void setNodeOrLinkSelected(boolean selected) {
    if (tbrToolBar != null) {

      UIViewFrame frame = ProjectCompendium.APP.getCurrentFrame();
      if (selected && frame instanceof UIMapViewFrame) {
        UIMapViewFrame oMapFrame = (UIMapViewFrame) frame;
        UIViewPane pane = oMapFrame.getViewPane();

        int nLinkCount = pane.getNumberOfSelectedLinks();
        if (nLinkCount == 0) return;

        bJustSetting = true;

        int i = 0;
        UILink link = null;
        LinkProperties linkProps = null;
        boolean bDefaultLinkStyle = false;
        boolean bDefaultLinkDashed = false;
        boolean bDefaultLinkWeight = false;
        boolean bDefaultLinkColour = false;
        boolean bDefaultArrowType = false;

        LinkProperties defaultprops = UIUtilities.getLinkProperties("");
        int linkstyle = defaultprops.getLinkStyle();
        int linkdashed = defaultprops.getLinkDashed();
        int linkweight = defaultprops.getLinkWeight();
        int linkcolour = defaultprops.getLinkColour();
        int arrowtype = defaultprops.getArrowType();

        for (Enumeration e = pane.getSelectedLinks(); e.hasMoreElements(); ) {
          link = (UILink) e.nextElement();
          linkProps = link.getLinkProperties();
          if (i == 0) {
            linkstyle = linkProps.getLinkStyle();
            linkdashed = linkProps.getLinkDashed();
            linkweight = linkProps.getLinkWeight();
            linkcolour = linkProps.getLinkColour();
            arrowtype = linkProps.getArrowType();
            i++;
          } else {
            if (arrowtype != linkProps.getArrowType()) {
              bDefaultArrowType = true;
            }
            if (linkstyle != linkProps.getLinkStyle()) {
              bDefaultLinkStyle = true;
            }
            if (linkdashed != linkProps.getLinkDashed()) {
              bDefaultLinkDashed = true;
            }
            if (linkweight != linkProps.getLinkWeight()) {
              bDefaultLinkWeight = true;
            }
            if (linkcolour != linkProps.getLinkColour()) {
              bDefaultLinkColour = true;
            }
          }
        }

        tbrToolBar.setEnabled(true);

        if (bDefaultLinkColour) {
          selectedLinkColour = new Color(defaultprops.getLinkColour());
        } else {
          selectedLinkColour = new Color(linkcolour);
        }

        linkColourPanel.setEnabled(true);
        txtLinkColour.setEnabled(true);

        cbLineWeight.setEnabled(true);
        if (bDefaultLinkWeight) {
          cbLineWeight.setSelectedIndex(defaultprops.getLinkWeight() - 1);
        } else {
          cbLineWeight.setSelectedIndex(linkweight - 1);
        }

        cbArrows.setEnabled(true);
        if (bDefaultArrowType) {
          cbArrows.setSelectedIndex(defaultprops.getArrowType());
        } else {
          cbArrows.setSelectedIndex(arrowtype);
        }

        cbLinkStyle.setEnabled(true);
        if (bDefaultLinkStyle) {
          cbLinkStyle.setSelectedIndex(defaultprops.getLinkStyle());
        } else {
          cbLinkStyle.setSelectedIndex(linkstyle);
        }

        cbLinkDashed.setEnabled(true);
        if (bDefaultLinkDashed) {
          cbLinkDashed.setSelectedIndex(defaultprops.getLinkDashed());
        } else {
          cbLinkDashed.setSelectedIndex(linkdashed);
        }

        bJustSetting = false;

      } else if (!selected) {

        bJustSetting = true;

        linkColourPanel.setEnabled(false);
        txtLinkColour.setEnabled(false);
        tbrToolBar.setEnabled(false);
        cbArrows.setEnabled(false);
        cbLineWeight.setEnabled(false);
        cbLinkStyle.setEnabled(false);
        cbLinkDashed.setEnabled(false);

        bJustSetting = false;
      }
    }
  }
Esempio n. 27
0
  /**
   * Create a choicebox for link line style options and return the panel it is in.
   *
   * @return JPanel the panel holding the new choicebox for the link style options.
   */
  private JPanel createLinkDashedChoiceBox() {

    JPanel drawPanel = new JPanel(new BorderLayout());
    CSH.setHelpIDString(drawPanel, "toolbars.formatlink"); // $NON-NLS-1$

    cbLinkDashed = new JComboBox();
    cbLinkDashed.setToolTipText(
        LanguageProperties.getString(
            LanguageProperties.TOOLBARS_BUNDLE, "UIToolBarFormatLink.selectDashed")); // $NON-NLS-1$
    cbLinkDashed.setOpaque(true);
    cbLinkDashed.setEditable(false);
    cbLinkDashed.setEnabled(false);
    cbLinkDashed.setMaximumRowCount(10);
    cbLinkDashed.setFont(new Font("Dialog", Font.PLAIN, 10)); // $NON-NLS-1$

    cbLinkDashed.addItem(
        new String(
            LanguageProperties.getString(
                LanguageProperties.TOOLBARS_BUNDLE,
                "UIToolBarFormatLink.plainLine"))); //$NON-NLS-1$
    cbLinkDashed.addItem(
        new String(
            LanguageProperties.getString(
                LanguageProperties.TOOLBARS_BUNDLE,
                "UIToolBarFormatLink.largeDashes"))); //$NON-NLS-1$
    cbLinkDashed.addItem(
        new String(
            LanguageProperties.getString(
                LanguageProperties.TOOLBARS_BUNDLE,
                "UIToolBarFormatLink.smallDashes"))); //$NON-NLS-1$

    cbLinkDashed.validate();

    cbLinkDashed.setSelectedIndex(0);

    DefaultListCellRenderer drawRenderer =
        new DefaultListCellRenderer() {
          public Component getListCellRendererComponent(
              JList list, Object value, int modelIndex, boolean isSelected, boolean cellHasFocus) {
            if (list != null) {
              if (isSelected) {
                setBackground(list.getSelectionBackground());
                setForeground(list.getSelectionForeground());
              } else {
                setBackground(list.getBackground());
                setForeground(list.getForeground());
              }
            }

            setText((String) value);
            return this;
          }
        };

    cbLinkDashed.setRenderer(drawRenderer);

    ActionListener drawActionListener =
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            onUpdateLinkDashed(cbLinkDashed.getSelectedIndex());
          }
        };
    cbLinkDashed.addActionListener(drawActionListener);

    drawPanel.add(new JLabel(" "), BorderLayout.WEST); // $NON-NLS-1$
    drawPanel.add(cbLinkDashed, BorderLayout.CENTER);
    return drawPanel;
  }
Esempio n. 28
0
  /**
   * Create a choicbox for link line thickness options and return the panel it is in.
   *
   * @return JPanel the panel holding the new choicebox for the line thickness options.
   */
  private JPanel createWeightChoiceBox() {

    JPanel drawPanel = new JPanel(new BorderLayout());
    CSH.setHelpIDString(drawPanel, "toolbars.formatlink"); // $NON-NLS-1$

    cbLineWeight = new JComboBox();
    cbLineWeight.setToolTipText(
        LanguageProperties.getString(
            LanguageProperties.TOOLBARS_BUNDLE, "UIToolBarFormatLink.selectWeight")); // $NON-NLS-1$
    cbLineWeight.setOpaque(true);
    cbLineWeight.setEditable(false);
    cbLineWeight.setEnabled(false);
    cbLineWeight.setMaximumRowCount(10);
    cbLineWeight.setFont(new Font("Dialog", Font.PLAIN, 10)); // $NON-NLS-1$

    cbLineWeight.addItem(new String("1 px")); // $NON-NLS-1$
    cbLineWeight.addItem(new String("2 px")); // $NON-NLS-1$
    cbLineWeight.addItem(new String("3 px")); // $NON-NLS-1$
    cbLineWeight.addItem(new String("4 px")); // $NON-NLS-1$
    cbLineWeight.addItem(new String("5 px")); // $NON-NLS-1$
    cbLineWeight.addItem(new String("6 px")); // $NON-NLS-1$
    cbLineWeight.addItem(new String("7 px")); // $NON-NLS-1$
    cbLineWeight.addItem(new String("8 px")); // $NON-NLS-1$
    cbLineWeight.addItem(new String("9 px")); // $NON-NLS-1$
    cbLineWeight.addItem(new String("10 px")); // $NON-NLS-1$

    cbLineWeight.validate();

    cbLineWeight.setSelectedIndex(0);

    DefaultListCellRenderer drawRenderer =
        new DefaultListCellRenderer() {
          public Component getListCellRendererComponent(
              JList list, Object value, int modelIndex, boolean isSelected, boolean cellHasFocus) {
            if (list != null) {
              if (isSelected) {
                setBackground(list.getSelectionBackground());
                setForeground(list.getSelectionForeground());
              } else {
                setBackground(list.getBackground());
                setForeground(list.getForeground());
              }
            }

            setText((String) value);
            return this;
          }
        };

    cbLineWeight.setRenderer(drawRenderer);

    ActionListener drawActionListener =
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            int ind = cbLineWeight.getSelectedIndex();

            if (ind == 0) onUpdateLinkWeight(1);
            else if (ind == 1) onUpdateLinkWeight(2);
            else if (ind == 2) onUpdateLinkWeight(3);
            else if (ind == 3) onUpdateLinkWeight(4);
            else if (ind == 4) onUpdateLinkWeight(5);
            else if (ind == 5) onUpdateLinkWeight(6);
            else if (ind == 6) onUpdateLinkWeight(7);
            else if (ind == 7) onUpdateLinkWeight(8);
            else if (ind == 8) onUpdateLinkWeight(9);
            else if (ind == 9) onUpdateLinkWeight(10);
          }
        };
    cbLineWeight.addActionListener(drawActionListener);

    drawPanel.add(new JLabel(" "), BorderLayout.WEST); // $NON-NLS-1$
    drawPanel.add(cbLineWeight, BorderLayout.CENTER);
    return drawPanel;
  }
Esempio n. 29
0
  /** Create the arrow head choicebox. */
  private JPanel createArrowChoiceBox() {

    JPanel drawPanel = new JPanel(new BorderLayout());
    CSH.setHelpIDString(drawPanel, "toolbars.formatlink"); // $NON-NLS-1$

    cbArrows = new JComboBox();
    cbArrows.setToolTipText(
        LanguageProperties.getString(
            LanguageProperties.TOOLBARS_BUNDLE, "UIToolBarFormatLink.selectArrow")); // $NON-NLS-1$
    cbArrows.setOpaque(true);
    cbArrows.setEditable(false);
    cbArrows.setEnabled(false);
    cbArrows.setMaximumRowCount(4);
    cbArrows.setFont(new Font("Dialog", Font.PLAIN, 10)); // $NON-NLS-1$

    Vector arrows = new Vector(5);
    arrows.insertElementAt(
        LanguageProperties.getString(
            LanguageProperties.DIALOGS_BUNDLE, "UILinkEditDialog.noArrows"),
        0); //$NON-NLS-1$
    arrows.insertElementAt(
        LanguageProperties.getString(LanguageProperties.DIALOGS_BUNDLE, "UILinkEditDialog.fromTo"),
        1); //$NON-NLS-1$
    arrows.insertElementAt(
        LanguageProperties.getString(LanguageProperties.DIALOGS_BUNDLE, "UILinkEditDialog.toFfrom"),
        2); //$NON-NLS-1$
    arrows.insertElementAt(
        LanguageProperties.getString(
            LanguageProperties.DIALOGS_BUNDLE, "UILinkEditDialog.bothWays"),
        3); //$NON-NLS-1$
    DefaultComboBoxModel comboModel = new DefaultComboBoxModel(arrows);
    cbArrows.setModel(comboModel);
    cbArrows.setSelectedIndex(0);

    DefaultListCellRenderer comboRenderer =
        new DefaultListCellRenderer() {
          public Component getListCellRendererComponent(
              JList list, Object value, int modelIndex, boolean isSelected, boolean cellHasFocus) {
            if (isSelected) {
              setBackground(list.getSelectionBackground());
              setForeground(list.getSelectionForeground());
            } else {
              setBackground(list.getBackground());
              setForeground(list.getForeground());
            }

            setText((String) value);

            return this;
          }
        };
    cbArrows.setRenderer(comboRenderer);

    cbArrows.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            onUpdateArrowType(cbArrows.getSelectedIndex());
          }
        });

    drawPanel.add(new JLabel(" "), BorderLayout.WEST); // $NON-NLS-1$
    drawPanel.add(cbArrows, BorderLayout.CENTER);
    return drawPanel;
  }
Esempio n. 30
0
 private void refreshCombo() {
   okButton.setEnabled(false);
   combo.setEnabled(false);
   combo.setModel(new DefaultComboBoxModel<>(new Object[] {PROCESSES_LIST_ITEM_TEXT}));
   getDefault().post(comboRefresher);
 }