public void valueChanged(ListSelectionEvent e) {
      ListSelectionModel lsm = (ListSelectionModel) e.getSource();

      int firstIndex = e.getFirstIndex();
      int lastIndex = e.getLastIndex();
      boolean isAdjusting = e.getValueIsAdjusting();
      output.append(
          "Event for indexes "
              + firstIndex
              + " - "
              + lastIndex
              + "; isAdjusting is "
              + isAdjusting
              + "; selected indexes:");

      if (lsm.isSelectionEmpty()) {
        output.append(" <none>");
      } else {
        // Find out which indexes are selected.
        int minIndex = lsm.getMinSelectionIndex();
        int maxIndex = lsm.getMaxSelectionIndex();
        for (int i = minIndex; i <= maxIndex; i++) {
          if (lsm.isSelectedIndex(i)) {
            output.append(" " + i);
          }
        }
      }
      output.append(newline);
      output.setCaretPosition(output.getDocument().getLength());
    }
Пример #2
0
  public void valueChanged(ListSelectionEvent e) {
    if (e.getSource() == fontList) {
      tempValue = (String) fontList.getSelectedValue();
      if (tempValue != null) {
        fontBox.setText(tempValue);
      } else fontBox.setText("");
    } else if (e.getSource() == styleList) {
      tempValue = (String) styleList.getSelectedValue();
      if (tempValue != null) {
        styleBox.setText(tempValue);
      } else styleBox.setText("");
    } else if (e.getSource() == sizeList) {
      tempValue = (String) sizeList.getSelectedValue();
      if (tempValue != null) {
        sizeBox.setText(tempValue);
      } else sizeBox.setText("");
    }

    if (fontValid()) {
      this.lastFont = new Font(getFontName(), getFontStyle(), getFontSize());
      this.lastColor = colorChooser.getColor();

      updatePreview();
    }
  }
Пример #3
0
    public void valueChanged(ListSelectionEvent evt) {
      if (!evt.getValueIsAdjusting()) {
        JFileChooser chooser = getFileChooser();
        FileSystemView fsv = chooser.getFileSystemView();
        JList list = (JList) evt.getSource();

        int fsm = chooser.getFileSelectionMode();
        boolean useSetDirectory = usesSingleFilePane && (fsm == JFileChooser.FILES_ONLY);

        if (chooser.isMultiSelectionEnabled()) {
          File[] files = null;
          Object[] objects = list.getSelectedValues();
          if (objects != null) {
            if (objects.length == 1
                && ((File) objects[0]).isDirectory()
                && chooser.isTraversable(((File) objects[0]))
                && (useSetDirectory || !fsv.isFileSystem(((File) objects[0])))) {
              setDirectorySelected(true);
              setDirectory(((File) objects[0]));
            } else {
              ArrayList<File> fList = new ArrayList<File>(objects.length);
              for (Object object : objects) {
                File f = (File) object;
                boolean isDir = f.isDirectory();
                if ((chooser.isFileSelectionEnabled() && !isDir)
                    || (chooser.isDirectorySelectionEnabled() && fsv.isFileSystem(f) && isDir)) {
                  fList.add(f);
                }
              }
              if (fList.size() > 0) {
                files = fList.toArray(new File[fList.size()]);
              }
              setDirectorySelected(false);
            }
          }
          chooser.setSelectedFiles(files);
        } else {
          File file = (File) list.getSelectedValue();
          if (file != null
              && file.isDirectory()
              && chooser.isTraversable(file)
              && (useSetDirectory || !fsv.isFileSystem(file))) {

            setDirectorySelected(true);
            setDirectory(file);
            if (usesSingleFilePane) {
              chooser.setSelectedFile(null);
            }
          } else {
            setDirectorySelected(false);
            if (file != null) {
              chooser.setSelectedFile(file);
            }
          }
        }
      }
    }
 public void valueChanged(ListSelectionEvent lse) {
   final String S_ProcName = "valueChanged";
   ICFBamId64GenObj selectedObj;
   if (lse.getValueIsAdjusting()) {
     return;
   }
   if (dataTable == null) {
     return;
   }
   int dataRow = dataTable.getSelectedRow();
   int modelIndex = dataTable.convertRowIndexToModel(dataRow);
   PickerTableModel tblDataModel = getDataModel();
   Object selectedRowData = tblDataModel.getValueAt(modelIndex, COLID_ROW_HEADER);
   if (selectedRowData != null) {
     if (selectedRowData instanceof ICFBamId64GenObj) {
       int selectedCount = dataTable.getSelectedRowCount();
       if (selectedCount <= 0) {
         selectedObj = null;
       } else if (selectedCount == 1) {
         selectedObj = (ICFBamId64GenObj) selectedRowData;
       } else {
         selectedObj = null;
       }
     } else {
       selectedObj = null;
       throw CFLib.getDefaultExceptionFactory()
           .newUnsupportedClassException(
               getClass(), S_ProcName, "selectedRowData", selectedRowData, "ICFBamId64GenObj");
     }
   } else {
     selectedObj = null;
   }
   setSwingFocus(selectedObj);
   adjustFeedback();
 }
Пример #5
0
  // Listener method for list selection changes.
  public void valueChanged(ListSelectionEvent e) {
    if (e.getValueIsAdjusting() == false) {

      if (list.getSelectedIndex() == -1) {
        // No selection: disable delete, up, and down buttons.
        deleteButton.setEnabled(false);
        upButton.setEnabled(false);
        downButton.setEnabled(false);
        nameField.setText("");

      } else if (list.getSelectedIndices().length > 1) {
        // Multiple selection: disable up and down buttons.
        deleteButton.setEnabled(true);
        upButton.setEnabled(false);
        downButton.setEnabled(false);

      } else {
        // Single selection: permit all operations.
        deleteButton.setEnabled(true);
        upButton.setEnabled(true);
        downButton.setEnabled(true);
        nameField.setText(list.getSelectedValue().toString());
      }
    }
  }
Пример #6
0
    public void valueChanged(ListSelectionEvent e) {
      ListSelectionModel lsm = (ListSelectionModel) e.getSource();

      int index = list.getSelectedIndex();
      Directory dir = directoryList.getDirectory(index);

      waitField.setValue(dir.getWaitInterval());
      checkField.setValue(dir.getInterval());
      if (dir.copy) {
        copyButton.setSelected(true);
      } else {
        moveButton.setSelected(true);
      }
      if (dir.destination != null) {

        destination.setText("Destination Directory: " + dir.destination.toString());
        startButton.setEnabled(true);
        if (dir.backupNumber == 0) {
          startButton.setEnabled(true);
          stopButton.setEnabled(false);
        } else {
          startButton.setEnabled(false);
          stopButton.setEnabled(true);
        }
      } else {
        destination.setText("Destination Directory: ");
        startButton.setEnabled(false);
      }
    }
Пример #7
0
  /**
   * Called when user selects a component in the list of configuration forms.
   *
   * @param e the <tt>ListSelectionEvent</tt>
   */
  public void valueChanged(ListSelectionEvent e) {
    if (!e.getValueIsAdjusting()) {
      ConfigurationForm configForm = (ConfigurationForm) configList.getSelectedValue();

      if (configForm != null) showFormContent(configForm);
    }
  }
  // Implementation of valueChanged
  public void valueChanged(ListSelectionEvent e) {
    if (e.getSource() == table.getSelectionModel()) {
      ListSelectionModel ls = table.getSelectionModel();

      int index = ls.getMinSelectionIndex();
      long id = (long) table.getValueAt(index, 0);

      updateFeesData(id);
    } else {
      ListSelectionModel ls = feestable.getSelectionModel();

      int index = ls.getMinSelectionIndex();

      float feespayed = (float) feestable.getValueAt(index, 1);
      float totalfees = (float) feestable.getValueAt(index, 2);

      feespayedlabel.setText("Fees Payed: " + feespayed);
      totalfeeslabel.setText("Total Fees: " + totalfees);

      if (totalfees - feespayed > 0) {
        feesduelabel.setText("Fees Due: " + (totalfees - feespayed));
      }

      panel_6.revalidate();
    }
  }
Пример #9
0
 @Override
 public void valueChanged(ListSelectionEvent e) {
   if (!e.getValueIsAdjusting()) {
     DustEntity sel = ((LabEntity) lstEntities.getSelectedValue()).entity;
     selectEntityFrame(sel, false);
     updateState();
   }
 }
Пример #10
0
  public void valueChanged(ListSelectionEvent evt) {
    if (evt.getSource() == mYParamList.getJList()) {
      mSelYParam = mYParamList.getJList().getSelectedIndex();
      setAdvancedValues();
    }

    generatePlotName();
  }
 public void valueChanged(ListSelectionEvent e) {
   if (e.getValueIsAdjusting() == false) {
     Object[] tcs = list.getSelectedValues();
     typeCodes = new ArrayList<String>();
     for (int i = 0; i < tcs.length; i++) {
       String typeCode = (String) tcs[i];
       typeCodes.add(typeCode);
     }
   }
 }
Пример #12
0
 @Override
 public void valueChanged(ListSelectionEvent event) {
   Object source = event.getSource();
   if (source.equals(gui.getFontName())) {
     gui.getTestText()
         .setFont(
             new Font(
                 gui.getFontName().getSelectedValue(),
                 Font.PLAIN,
                 (int) gui.getSizeSpinner().getValue()));
   }
 }
Пример #13
0
  /**
   * Implements ListSelectionListener.valueChanged. Enables or disables call and hangup buttons
   * depending on the selection in the contactlist.
   */
  public void valueChanged(ListSelectionEvent e) {
    Object o = mainFrame.getContactListPanel().getContactList().getSelectedValue();

    if ((e.getFirstIndex() != -1 || e.getLastIndex() != -1) && (o instanceof MetaContact)) {
      setCallMetaContact(true);

      // Switch automatically to the appropriate pps in account selector
      // box and enable callButton if telephony is supported.
      Contact contact = ((MetaContact) o).getDefaultContact(OperationSetBasicTelephony.class);

      if (contact != null) {
        callButton.setEnabled(true);

        if (contact.getProtocolProvider().isRegistered())
          getAccountSelectorBox().setSelected(contact.getProtocolProvider());
      } else {
        callButton.setEnabled(false);
      }
    } else if (phoneNumberCombo.isComboFieldEmpty()) {
      callButton.setEnabled(false);
    }
  }
  // This method is required by ListSelectionListener.
  public void valueChanged(ListSelectionEvent e) {
    if (e.getValueIsAdjusting() == false) {

      if (list.getSelectedIndex() == -1) {
        // No selection, disable load button.
        loadButton.setEnabled(false);

      } else {
        // Selection, enable the load button.
        loadButton.setEnabled(true);
      }
    }
  }
 public void valueChanged(ListSelectionEvent lse) {
   final String S_ProcName = "valueChanged";
   ICFSecurityISOTimezoneObj selectedObj;
   if (lse.getValueIsAdjusting()) {
     return;
   }
   if (dataTable == null) {
     return;
   }
   int dataRow = dataTable.getSelectedRow();
   int modelIndex = dataTable.convertRowIndexToModel(dataRow);
   FinderTableModel tblDataModel = getDataModel();
   Object selectedRowData = tblDataModel.getValueAt(modelIndex, COLID_ROW_HEADER);
   if (selectedRowData != null) {
     if (selectedRowData instanceof ICFSecurityISOTimezoneObj) {
       int selectedCount = dataTable.getSelectedRowCount();
       if (selectedCount <= 0) {
         selectedObj = null;
       } else if (selectedCount == 1) {
         selectedObj = (ICFSecurityISOTimezoneObj) selectedRowData;
       } else {
         selectedObj = null;
       }
     } else {
       selectedObj = null;
       throw CFLib.getDefaultExceptionFactory()
           .newUnsupportedClassException(
               getClass(),
               S_ProcName,
               "selectedRowData",
               selectedRowData,
               "ICFSecurityISOTimezoneObj");
     }
   } else {
     selectedObj = null;
   }
   Container cont = getParent();
   while ((cont != null) && (!(cont instanceof CFJInternalFrame))) {
     cont = cont.getParent();
   }
   if (cont != null) {
     CFJInternalFrame frame = (CFJInternalFrame) cont;
     if (frame instanceof ICFSecuritySwingISOTimezoneJPanelCommon) {
       ICFSecuritySwingISOTimezoneJPanelCommon jpanelCommon =
           (ICFSecuritySwingISOTimezoneJPanelCommon) frame;
       jpanelCommon.setSwingFocus(selectedObj);
     }
   }
 }
Пример #16
0
    public void valueChanged(ListSelectionEvent evt) {
      Object source = evt.getSource();
      if (source == familyList) {
        String family = (String) familyList.getSelectedValue();
        if (family != null) familyField.setText(family);
      } else if (source == sizeList) {
        String size = (String) sizeList.getSelectedValue();
        if (size != null) sizeField.setText(size);
      } else if (source == styleList) {
        String style = (String) styleList.getSelectedValue();
        if (style != null) styleField.setText(style);
      }

      updatePreview();
    }
    /// Pass user's interaction with list to appropriate handler
    public void valueChanged(ListSelectionEvent e) {
      if (e.getSource() == sourceList) {
        if (!e.getValueIsAdjusting()) {
          int indexS = sourceList.getSelectedIndex();
          srcID = indexS + 1;
          drawTest.repaint();
        }
      }

      if (e.getSource() == destList) {
        if (!e.getValueIsAdjusting()) {
          int indexD = destList.getSelectedIndex();
          dstID = indexD + 17;
          drawTest.repaint();
        }
      }

      if (e.getSource() == routerList) {
        if (!e.getValueIsAdjusting()) {
          indexR = routerList.getSelectedIndex();

          Router temp = statMux.getRouter(indexR);
          int[] pList = temp.getPriorityList();
          audioVal.setText(String.valueOf(pList[0]));
          videoVal.setText(String.valueOf(pList[1]));
          textVal.setText(String.valueOf(pList[2]));
        }
      }

      if (e.getSource() == packTypeList) {
        if (!e.getValueIsAdjusting()) {
          int temp = packTypeList.getSelectedIndex();
          if (temp == 0) {
            type = PacketType.AUDIO;
          } else if (temp == 1) {
            type = PacketType.VIDEO;
          } else {
            type = PacketType.TEXT;
          }
          drawTest.repaint();
        }
      }
    }
Пример #18
0
  public void valueChanged(ListSelectionEvent e) {
    int maxRows;
    int[] selRows;
    Object value;

    if (!e.getValueIsAdjusting()) {
      selRows = aTable.getSelectedRows();

      if (selRows.length > 0) {
        for (int i = 0; i < 3; i++) {
          // get Table data
          TableModel tm = aTable.getModel();
          value = tm.getValueAt(selRows[0], i);
          System.out.println("Selection : " + value);
        }
        System.out.println();
      }
    }
  }
Пример #19
0
 private void prefsBeanListValueChanged(ListSelectionEvent e) {
   BeanPreferences bean = (BeanPreferences) mPrefsBeans.elementAt(e.getFirstIndex());
   mListViewEditorPane.getViewport().add(bean.getEditor());
   mListViewEditorPane.revalidate();
 }
 public void valueChanged(ListSelectionEvent le) {
   if (!le.getValueIsAdjusting()) {
     Kits currentKit = (Kits) kitList.getSelectedValue();
     if (currentKit != null) buildKitData(currentKit);
   }
 }
Пример #21
0
 public void valueChanged(ListSelectionEvent e) {
   Object[] values = ((JList) e.getSource()).getSelectedValues();
   String txtItem = "";
   for (int i = 0; i < values.length; i++) txtItem += values[i].toString();
   texta.setText(lblName.getText() + text0.getText() + '\n' + lblPlace.getText() + txtItem);
 }
 public void valueChanged(ListSelectionEvent evt) {
   ardoise.changerEtat((String) ((JList) evt.getSource()).getSelectedValue());
   ardoise.repaint();
   ardoise.donnePere().elementModified();
 }
Пример #23
0
 // Listens to the list
 public void valueChanged(ListSelectionEvent e) {
   JList list = (JList) e.getSource();
   updateLabel(imageNames[list.getSelectedIndex()]);
 }
Пример #24
0
 public void valueChanged(ListSelectionEvent e) {
   if (!e.getValueIsAdjusting()) {
     mapSelection();
   }
 }
 public void valueChanged(ListSelectionEvent e) {
   if (currentChooser != null && !e.getValueIsAdjusting()) currentChooser.newInstanceSelected();
 }
 /**
  * ************************************************************************ List Selection
  * Listener
  *
  * @param e event
  */
 public void valueChanged(ListSelectionEvent e) {
   if (e.getValueIsAdjusting()) return;
   //	log.config( "VMatch.valueChanged");
   setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
   setCursor(Cursor.getDefaultCursor());
 } //  valueChanged