@Override public void valueChanged(ListSelectionEvent event) { if (event != null && event.getValueIsAdjusting()) { return; } if (event == null) { return; } int returnValue = synsetList.getSelectedIndex(); Sense unit = senseListModel.getObjectAt(returnValue); synsetList.setEnabled(false); listeners.notifyAllListeners(synsetList.getSelectedIndices().length == 1 ? unit : null); synsetList.setEnabled(true); SwingUtilities.invokeLater(() -> { synsetList.grabFocus(); }); }
public PersistenceClientEntitySelectionVisual(String name, WizardDescriptor wizard , boolean requireReferencedClasses ) { setName(name); initComponents(); ListSelectionListener selectionListener = new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { updateButtons(); } }; listAvailable.getSelectionModel().addListSelectionListener(selectionListener); listSelected.getSelectionModel().addListSelectionListener(selectionListener); disableNoIdSelection = wizard.getProperty(PersistenceClientEntitySelection.DISABLENOIDSELECTION) == Boolean.TRUE; if ( requireReferencedClasses ){ cbAddRelated.setSelected( true ); cbAddRelated.setVisible( false ); } }
/** * initialize the submissions tables */ public void initSubTable() { subTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent event) { if (subTable.getSelectedRow() > -1) { // print first column value from selected row // System.out.println(subTable.getValueAt(subTable.getSelectedRow(), 0).toString()); downSubBtn.setEnabled(true); gradeField.setEditable(true); sendGradeBtn.setEnabled(true); } else { downSubBtn.setEnabled(false); gradeField.setEditable(false); sendGradeBtn.setEnabled(false); } } }); }
@Override public void valueChanged(javax.swing.event.ListSelectionEvent listSelectionEvent) { if (listSelectionEvent.getValueIsAdjusting()) { return ; } int selectedRows[] = outline.getSelectedRows(); //System.err.println("TableSelectionListener.valueChanged(): selected rows = "+Arrays.toString(selectedRows)); ArrayList<Node> selectedNodes = new ArrayList<Node> (selectedRows.length); for (int i = 0; i < selectedRows.length;i++) { Node n = getNodeFromRow(selectedRows[i]); if (n != null) { selectedNodes.add(n); } } //System.err.println(" => selectedNodes = "+selectedNodes); callSelectionChanged(selectedNodes.toArray (new Node[selectedNodes.size ()])); }
@Override public void valueChanged(ListSelectionEvent e) { if( e.getSource() == list ) { ListSelectionListener[] lsl = listeners.getListeners(ListSelectionListener.class); if( lsl.length > 0 ) { ListSelectionEvent e2 = new ListSelectionEvent(this, e.getFirstIndex(), e.getLastIndex(), e.getValueIsAdjusting()); for( ListSelectionListener l : lsl ) { l.valueChanged(e2); } } } }
/** * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent) */ public void valueChanged(ListSelectionEvent e) { JList jl = (JList) e.getSource(); if (jl.getSelectionModel().getValueIsAdjusting()) return; KPartiteGraph bpg2 = (KPartiteGraph)kpg.copy(); // BipartiteGraph bpg2 = (BipartiteGraph) kpg.copy(); Object[] selected = jl.getSelectedValues(); // System.out.println("Value Changed " + Arrays.asList(selected)); for (int i = 0; i < selected.length; i++) { Vertex v2 = dates.getVertex((String) selected[i]); if (v2 == null) { System.out.println( "No original vertex with label " + selected[i]); } bpg2.removeVertex((Vertex) v2.getEqualVertex(bpg2)); } wellKnownRenderer.setHiddenList(Arrays.asList(selected)); foldAndDisplay(bpg2); }
public void valueChanged(ListSelectionEvent e) { if (e.getValueIsAdjusting()) return; super.valueChanged(e); for (WWIcon icon : icons) { if (icon == null) continue; icon.setHighlighted( false ); } int[] selRows = table.getSelectedRows(); for (int row : selRows) { int index = model.current[ row ]; icons[index].setHighlighted(true); } layer.firePropertyChange(AVKey.LAYER, null, layer); }
public DiffColorsPanel() { initComponents (); setName(loc("LBL_DiffOptions_Tab")); //NOI18N lCategories.setSelectionMode (ListSelectionModel.SINGLE_SELECTION); lCategories.setVisibleRowCount (6); lCategories.addListSelectionListener (new ListSelectionListener() { public void valueChanged (ListSelectionEvent e) { if (!listen) return; refreshUI (); } }); lCategories.setCellRenderer (new CategoryRenderer()); cbBackground.addActionListener (this); btnResetToDefaults.addActionListener(this); }
public void valueChanged(ListSelectionEvent e) { if (e.getValueIsAdjusting() == false) { JList list = (JList) e.getSource(); String selectedValue = (String) list.getSelectedValue(); String oldValue = textComponent.getText(); textComponent.setText(selectedValue); if (!oldValue.equalsIgnoreCase(selectedValue)) { textComponent.selectAll(); textComponent.requestFocus(); } updateSampleFont(); } }
private void styleListValueChanged(ListSelectionEvent e) { int style = -1; String selectedStyle = (String) styleList.getSelectedValue(); if (selectedStyle == PLAIN) { style = Font.PLAIN; } if (selectedStyle == BOLD) { style = Font.BOLD; } if (selectedStyle == ITALIC) { style = Font.ITALIC; } if (selectedStyle == BOLD_ITALIC) { style = Font.BOLD + Font.ITALIC; } font = new Font(font.getFamily(), style, font.getSize()); previewLabel.setFont(font); }
public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { switch (clustList.getSelectedIndex()) { case 0: optClustering.removeAll(); optClustering.add(new KMeansOptPanel(ClusterPanel.this, new loadListener(), model), BorderLayout.CENTER); optClustering.revalidate(); optClustering.repaint(); if (session.getListOfClustering().size() == 0) { canGoOn = false; } break; case 1: optClustering.removeAll(); optClustering.add(new FuzzyOptPanel(ClusterPanel.this, new loadListener(), model), BorderLayout.CENTER); optClustering.revalidate(); optClustering.repaint(); if (session.getListOfClustering().size() == 0) { canGoOn = false; } break; default: clustList.setSelectedIndex(0); } } }
@Override public void valueChanged(ListSelectionEvent e) { if (e.getValueIsAdjusting() == false) { @SuppressWarnings("unchecked") JList<String> list = (JList<String>) e.getSource(); String selectedValue = (String) list.getSelectedValue(); String oldValue = textComponent.getText(); textComponent.setText(selectedValue); if (!oldValue.equalsIgnoreCase(selectedValue)) { textComponent.selectAll(); textComponent.requestFocus(); } updateSampleFont(); } }
DatabaseSelectionView(Window owner) { this.manageConnectionsdialog = new ManageDatabaseConnectionsDialog(owner); this.setLayout(new BorderLayout()); JList connectionList = this.manageConnectionsdialog.getConnectionListCopy(); ExtendedJScrollPane connectionsPanel = new ExtendedJScrollPane(connectionList); connectionsPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(0, 250, 10, 250), BorderFactory.createLineBorder(Color.LIGHT_GRAY))); this.add(connectionsPanel, "Center"); this.testLabel = new FixedWidthLabel(370, "", (Icon)null); this.testLabel.setIconTextGap(10); connectionList.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { DatabaseSelectionView.this.resetTestStatus(); DatabaseSelectionView.this.testButton.setEnabled(DatabaseSelectionView.this.getSelectedConnection() != null); DatabaseSelectionView.this.editButton.setEnabled(DatabaseSelectionView.this.getSelectedConnection() != null); DatabaseSelectionView.this.fireStateChanged(); } }); this.createButtonPanel(); }
public void valueChanged(ListSelectionEvent e) { JButton removeButton = buttons.get(Button.remove); JButton upButton = buttons.get(Button.up); JButton downButton = buttons.get(Button.down); int index = viewersList.getSelectedIndex(); if (index == -1) { removeButton.setEnabled(false); upButton.setEnabled(false); downButton.setEnabled(false); } else { removeButton.setEnabled(true); if (index == 0) { upButton.setEnabled(false); } else { upButton.setEnabled(true); } if (index == ((DefaultListModel) viewersList.getModel()).getSize()) { downButton.setEnabled(false); } else { downButton.setEnabled(true); } } }
@Override public void valueChanged(ListSelectionEvent e) { if (e.getValueIsAdjusting()) { return; } final TopComponent tc = (TopComponent) SwingUtilities.getAncestorOfClass(TopComponent.class, table); if (tc == null) return; // table is no longer in component hierarchy // this method may be called outside of AWT if a node fires change events from some other thread, see #79174 final Node [] nodeArray = getSelectedNodes(); if (SwingUtilities.isEventDispatchThread()) { tc.setActivatedNodes(nodeArray); } else { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { tc.setActivatedNodes(nodeArray); } }); } }
@Override public void valueChanged (ListSelectionEvent evt) { if (!evt.getValueIsAdjusting()) { HgTag tag = null; if (panel.tagList.getSelectedValue() instanceof HgTag) { tag = (HgTag) panel.tagList.getSelectedValue(); } if (tag == null) { panel.btnRemove.setEnabled(false); panel.btnUpdate.setEnabled(false); } else { panel.btnRemove.setEnabled(tag.canRemove()); panel.btnUpdate.setEnabled(true); panel.changesetPanel1.setInfo(tag.getRevisionInfo()); panel.txtTagName.setText(tag.getName()); panel.txtTagName.setCaretPosition(0); panel.txtTaggedRevision.setText(annotateRevision(tag.getRevisionInfo())); panel.txtTaggedRevision.setCaretPosition(0); panel.lblLocal.setVisible(tag.isLocal()); } } }
public void addListener() { WebAppListener listener = new WebAppListener(); bAdd.addActionListener(listener); bEdit.addActionListener(listener); bDelete.addActionListener(listener); bStart.addActionListener(listener); bStop.addActionListener(listener); bRestart.addActionListener(listener); t.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { WebAppPanel.instance.syncStatus(); } }); }
@Override public void valueChanged(ListSelectionEvent e) { if (dataviewUI == null) { return; } if (e.getSource() == table.getSelectionModel() && table.getRowSelectionAllowed()) { boolean rowSelected = table.getSelectedRows().length > 0; if (rowSelected && getModel().isEditable()) { dataviewUI.enableDeleteBtn(!dataviewUI.isDirty()); } else { dataviewUI.enableDeleteBtn(false); } } }
@Override public void valueChanged(ListSelectionEvent e) { int row = networkTable.getSelectedRow(); moveDown.setEnabled(model.canMoveGeneratorDown(row)); moveUp.setEnabled(model.canMoveGeneratorUp(row)); remove.setEnabled(model.canRemoveGenerator(row)); add.setEnabled(model.canAddGenerator(row)); }
@Override public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { AndroidPlatformInfo.PathRecord selectedValue = (AndroidPlatformInfo.PathRecord) classPathList.getSelectedValue(); removeClasspath.setEnabled(selectedValue == null ? false : selectedValue.isUserRecord()); } }
void registerListeners() { tableModel.addTableModelListener(this); tableMultiProperties.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent lse) { if (!lse.getValueIsAdjusting()) { updateRemoveButton(); } } }); cellEditor.registerCellEditorListener(); }
@Override public void valueChanged(ListSelectionEvent e) { if( e.getSource() == list ) { updateButtons(); } }
@Override public void valueChanged(ListSelectionEvent e) { if (e.getValueIsAdjusting()) { return; } int[] index = columnsTable.getSelectedRows(); boolean empty = (index.length == 0); boolean multi = (index.length > 1); deleteColumnButton.setEnabled(!empty); moveUpColumnButton.setEnabled(!empty && !multi && (index[0] > 0)); moveDownColumnButton.setEnabled(!empty && !multi && (index[0] < columns.size()-1)); updateColumnSection(); }
@Override public void valueChanged(ListSelectionEvent e) { int[] index = rowsTable.getSelectedRows(); boolean empty = (index.length == 0); boolean multi = (index.length > 1); deleteRowButton.setEnabled(!empty); moveUpRowButton.setEnabled(!empty && !multi && (index[0] > 0)); moveDownRowButton.setEnabled(!empty && !multi && (index[0] < rowTableModel.getRowCount()-1)); }
@Override public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { AndroidPlatformInfo.PathRecord selectedValue1 = (AndroidPlatformInfo.PathRecord) sourcesList.getSelectedValue(); removeSources.setEnabled(selectedValue1 == null ? false : selectedValue1.isUserRecord()); } }
private void initFilterClassesList() { filterClassesTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { filterRemoveButton.setEnabled(filterClassesTable.getSelectedRow() >= 0); } }); filterRemoveButton.setEnabled(filterClassesTable.getSelectedRow() >= 0); filterClassesTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); filterClassesTable.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE); }
@SuppressWarnings("unchecked") @Override public void valueChanged(ListSelectionEvent e) { JList<String> v_Tables = (JList<String>)e.getSource(); String v_TableName = v_Tables.getSelectedValue(); if ( !JavaHelp.isNull(v_TableName) ) { if ( !v_TableName.equals(this.getTableName()) ) { this.getAppFrame().setTableName(v_TableName); } } }
@Override public void valueChanged(ListSelectionEvent arg0) { if (arg0 != null && arg0.getValueIsAdjusting()) { return; } int index = unitsList.getSelectedIndex(); // odczytanie indeksu boolean singleSelection = unitsList.getSelectedIndices() == null || unitsList.getSelectedIndices().length < 2; buttonUp.setEnabled(singleSelection && index > 0 && (listModel.getSplitPosition() != index || index > 1)); buttonDown.setEnabled(singleSelection && index != -1 && index + 1 < listModel.getSize() && (index > 0 || index + 1 != listModel.getSplitPosition())); buttonToNew.setEnabled(null != lastSynset && listModel.getCollection().size() > 1); int selectionSize = unitsList.getSelectedIndices().length; // nie można usunąć linii podziału buttonDelete.setEnabled(selectionSize > 0 && selectionSize < listModel.getSize()); buttonSwitchToLexicalPerspective.setEnabled(singleSelection && index != -1 && index != listModel.getSplitPosition()); // powiadomienie zainteresowanych listeners.notifyAllListeners(listModel.getObjectAt(index), LIST_SELECTION_CHANGED); }
public @Override void setModel(TaskModel mod) { model = mod; model.addListDataListener(new Listener()); model.addListSelectionListener(new ListSelectionListener() { public @Override void valueChanged(ListSelectionEvent e) { pane.updateBoldFont(model.getSelectedHandle()); } }); }
@Override public void valueChanged(ListSelectionEvent e) { super.valueChanged(e); int row = getSelectedRow(); if (!e.getValueIsAdjusting() && row > -1) { if (forkProbEditor != null) { forkProbEditor.stopEditing(); forkProbEditor.setData(sd, cd, stationKey, cd.getClassKeys().get(row)); descrTextPane.setText(((ForkStrategy) sd.getForkStrategy(stationKey, cd.getClassKeys().get(row))).getDescription()); InGateWaySectionPanel.this.doLayout(); InGateWaySectionPanel.this.repaint(); } } }
@Override public void valueChanged(ListSelectionEvent e) { // The selection in the table has changed; might have happened via user action (click, arrow) or // as a side effect of a focus change. super.valueChanged(e); if (!e.getValueIsAdjusting()) { final int selectedRow = getSelectedRow(); final MachineCodeTableModel machineCodeTableModel = (MachineCodeTableModel) getModel(); if (selectedRow >= 0 && selectedRow < machineCodeTableModel.getRowCount()) { focus().setCodeLocation(machineCodeTableModel.rowToLocation(selectedRow)); } } }
@Override public void valueChanged(ListSelectionEvent e){ super.valueChanged(e); if(getSelectedRow()>=0){ if(dataModel instanceof GeometricInteractiveVDSLayerModel) ((GeometricInteractiveVDSLayerModel)dataModel).changeSelection(getSelectedRow(), display); } }
@Override public void valueChanged (ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { if (e.getSource() == panel.list.getSelectionModel()) { changeSupport.fireChange(); } } }
@Override public void valueChanged(ListSelectionEvent e) { if (e.getValueIsAdjusting()) { return; } resultTextField.setText(getImage()); }
ConfigurationsPanel(ModelHandle2 handle, NbMavenProjectImpl project) { this(); this.handle = handle; this.project = project; // btnAdd.setVisible(false); // btnEdit.setVisible(false); // btnRemove.setVisible(false); // addProfileConfigurations(); initListUI(); checkButtonEnablement(); lstConfigurations.setCellRenderer(new DefaultListCellRenderer() { @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { Component supers = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); ModelHandle2.Configuration conf = (ModelHandle2.Configuration)value; if (conf == ConfigurationsPanel.this.handle.getActiveConfiguration()) { supers.setFont(supers.getFont().deriveFont(Font.BOLD)); } return supers; } }); lstConfigurations.addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { checkButtonEnablement(); } }); createListModel(); }
@Override public void valueChanged(ListSelectionEvent evt) { if(jList3.getSelectedValue()!=null) { //System.out.println("it not copying oo "); String list_item =jList3.getSelectedValue().trim(); StringSelection ss = new StringSelection(list_item); Clipboard clpbrd = Toolkit.getDefaultToolkit().getSystemClipboard(); clpbrd.setContents(ss, ss); } }
/** * Maps {@code JTable.valueChanged(ListSelectionEvent)} through queue */ public void valueChanged(final ListSelectionEvent listSelectionEvent) { runMapping(new MapVoidAction("valueChanged") { @Override public void map() { ((JTable) getSource()).valueChanged(listSelectionEvent); } }); }
/** * Registiert die Aktion, die ausgeführt wird, wenn ein Medium ausgewählt * wird. */ private void registriereMedienAnzeigenAktion() { _ui.getMedienAuflisterTable() .getSelectionModel() .addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { informiereUeberAenderung(); } }); }
/** * When a key is selected in the table, display the source and translated * texts in the right hand panels */ public void valueChanged(ListSelectionEvent e) { if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel) e.getSource(); if (lsm.isSelectionEmpty()) { return; } else { String key = keys[lsm.getMinSelectionIndex()]; currentKey = keyTarget.getI18nData().getFullPrefix() + key; //$NON-NLS-1$ } }
public void valueChanged(ListSelectionEvent e) { int i = list.getSelectedIndex(); if(i!=-1) { i = model.indexOf( i ); } drawSelectedTrack(Color.black); selectedIndex = i; drawSelectedTrack(Color.white); return; }