當前位置: 首頁>>代碼示例>>Java>>正文


Java ListSelectionEvent.getValueIsAdjusting方法代碼示例

本文整理匯總了Java中javax.swing.event.ListSelectionEvent.getValueIsAdjusting方法的典型用法代碼示例。如果您正苦於以下問題:Java ListSelectionEvent.getValueIsAdjusting方法的具體用法?Java ListSelectionEvent.getValueIsAdjusting怎麽用?Java ListSelectionEvent.getValueIsAdjusting使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.event.ListSelectionEvent的用法示例。


在下文中一共展示了ListSelectionEvent.getValueIsAdjusting方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: valueChanged

import javax.swing.event.ListSelectionEvent; //導入方法依賴的package包/類
@Override
public void valueChanged (ListSelectionEvent e) {
    if (!e.getValueIsAdjusting() && revisionsPanel1.lstRevisions.isFocusOwner()) {
        GitRevisionInfo selectedRevision = revisionsPanel1.getSelectedRevision();
        Revision oldRevision = currRevision;
        if (selectedRevision == null && currRevision != null) {
            currRevision = null;
            firePropertyChange(PROP_REVISION_CHANGED, oldRevision, currRevision);
        } else if (selectedRevision != null) {
            Revision newRev = new Revision(selectedRevision.getRevision(), selectedRevision.getRevision(),
                    selectedRevision.getShortMessage(), selectedRevision.getFullMessage());
            if (!newRev.equals(oldRevision)) {
                currRevision = newRev;
                firePropertyChange(PROP_REVISION_CHANGED, oldRevision, currRevision);
            }
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:19,代碼來源:RepositoryBrowserPanel.java

示例2: valueChanged

import javax.swing.event.ListSelectionEvent; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public void valueChanged(ListSelectionEvent e) {
    if (e.getValueIsAdjusting()) return;
    int[] idx = this.stopList.getSelectedIndices();
    if (idx.length > 0) {
        TradeRouteStop stop = this.stopListModel.get(idx[0]);
        this.cargoPanel.initialize(stop);
        this.goodsPanel.setEnabled(true);
    } else {
        this.goodsPanel.setEnabled(false);
    }
    updateButtons();
}
 
開發者ID:FreeCol,項目名稱:freecol,代碼行數:17,代碼來源:TradeRouteInputPanel.java

示例3: valueChanged

import javax.swing.event.ListSelectionEvent; //導入方法依賴的package包/類
@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();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:14,代碼來源:TableCustomizer.java

示例4: valueChanged

import javax.swing.event.ListSelectionEvent; //導入方法依賴的package包/類
public void valueChanged(ListSelectionEvent evt) {
	if (evt.getValueIsAdjusting()) return;

	selRows = dataT.getSelectedRows();
	boolean[] oSelected = selected;

	selected = new boolean[data.size()];
	for (int i = 0; i < selRows.length; i++) {
		int index = tm.displayToDataIndex.get(selRows[i]);
		selected[index] = true;
	}
	selectionChangedRedraw(oSelected);
}
 
開發者ID:iedadata,項目名稱:geomapapp,代碼行數:14,代碼來源:UnknownDataSet.java

示例5: valueChanged

import javax.swing.event.ListSelectionEvent; //導入方法依賴的package包/類
@Override
public void valueChanged (ListSelectionEvent e) {
    if (e.getSource() == panel.lstTags && !e.getValueIsAdjusting()) {
        GitTag selectedTag = null;
        Object selectedObject = panel.lstTags.getSelectedValue();
        if (selectedObject instanceof GitTag) {
            selectedTag = (GitTag) panel.lstTags.getSelectedValue();
        }
        updateTagInfo(selectedTag);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:ManageTags.java

示例6: valueChanged

import javax.swing.event.ListSelectionEvent; //導入方法依賴的package包/類
@Override
public void valueChanged (ListSelectionEvent e) {
    if (!e.getValueIsAdjusting() && e.getLastIndex() > -1 && e.getFirstIndex() > -1) {
        reselected = true;
        selectedRevision = null;
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:RevisionListPanel.java

示例7: valueChanged

import javax.swing.event.ListSelectionEvent; //導入方法依賴的package包/類
@Override
public void valueChanged(ListSelectionEvent e) {
    spinnerCheck();

    if (!e.getValueIsAdjusting()
            && !candsList.isSelectionEmpty()) {
        ListElement elem = (ListElement) candsList.getSelectedValue();
        candidateChanged_.notifyAllListeners(
                new Pair<>(elem.getWord(), elem.getPos()),
                elem.getPkg());
    }
}
 
開發者ID:CLARIN-PL,項目名稱:WordnetLoom,代碼行數:13,代碼來源:CandidatesViewUI.java

示例8: valueChanged

import javax.swing.event.ListSelectionEvent; //導入方法依賴的package包/類
@Override
public void valueChanged (ListSelectionEvent e) {
    if (!e.getValueIsAdjusting()) {
        if (e.getSource() == panel.list.getSelectionModel()) {
            changeSupport.fireChange();
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:9,代碼來源:ItemSelector.java

示例9: onDictionaryHighlightChange

import javax.swing.event.ListSelectionEvent; //導入方法依賴的package包/類
/**
 * Fires when the user (un)highlights a dictionary.
 *
 * @param event the triggering event
 */
private void onDictionaryHighlightChange(final ListSelectionEvent event) {
    if (!event.getValueIsAdjusting()) {
        final Optional<Dictionary> highlightedDictionary = dictionaries.getHighlightedEntry();
        final boolean enable = highlightedDictionary.isPresent()
                && highlightedDictionary.get() instanceof Dictionary.UserDictionary;
        dictionaryRemoveButton.setEnabled(enable);
    }
}
 
開發者ID:FWDekker,項目名稱:intellij-randomness,代碼行數:14,代碼來源:WordSettingsDialog.java

示例10: valueChanged

import javax.swing.event.ListSelectionEvent; //導入方法依賴的package包/類
@Override
@MaskAnnotation
public void valueChanged(ListSelectionEvent e) {
    if (e.getSource().equals(frame.getHistoryList())) {
        frame.historyListChange(e);
    } else if (e.getSource() instanceof JList) {
        if (e.getValueIsAdjusting()) {
            frame.dbListValueChanged();
        }
    } else {
        frame.tableValueChanged(e);
    }
}
 
開發者ID:ajtdnyy,項目名稱:PackagePlugin,代碼行數:14,代碼來源:ListSelectionListenerImpl.java

示例11: valueChanged

import javax.swing.event.ListSelectionEvent; //導入方法依賴的package包/類
public void valueChanged(ListSelectionEvent event) {
    if (event.getValueIsAdjusting()) {
        return;
    }
    output.append("ROW SELECTION EVENT. ");
    outputSelection();
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:8,代碼來源:TableSelectionDemoX.java

示例12: valueChanged

import javax.swing.event.ListSelectionEvent; //導入方法依賴的package包/類
/**
 * zaznaczenie w tabeli zostalo zmienione
 *
 * @param event
 */
@Override
public void valueChanged(ListSelectionEvent event) {
    if (unitsList == null) {
        return;
    }
    if (event != null && event.getValueIsAdjusting()) {
        return;
    }
    if (event == null) {
        return;
    }

    int returnValue = unitsList.getSelectedIndex();
    if(returnValue < 0){
        return;
    }
    Sense unit = listModel.get(returnValue);
    boolean superMode = workbench.getParam(SUPER_MODE) != null
            && workbench.getParam(SUPER_MODE).equals(SUPER_MODE_VALUE);
    btnDelete.setEnabled(unit != null ? superMode : false);
    btnAddToSyns.setEnabled(unit != null ? (superMode)
            && !LexicalDA.checkIfInAnySynset(unit) : false);

    // powiadomienie zainteresowanych
    unitsList.setEnabled(false);
    listeners.notifyAllListeners(unitsList.getSelectedIndices().length == 1 ? unit : null);
    unitsList.setEnabled(true);
    unitsList.grabFocus();

    SwingUtilities.invokeLater(() -> unitsList.grabFocus());
}
 
開發者ID:CLARIN-PL,項目名稱:WordnetLoom,代碼行數:37,代碼來源:LexicalUnitsViewUI.java

示例13: valueChanged

import javax.swing.event.ListSelectionEvent; //導入方法依賴的package包/類
/**
 * 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$
  }
}
 
開發者ID:ajmath,項目名稱:VASSAL-src,代碼行數:18,代碼來源:TranslateWindow.java

示例14: valueChanged

import javax.swing.event.ListSelectionEvent; //導入方法依賴的package包/類
@Override
public void valueChanged(ListSelectionEvent e) {
	if (!e.getValueIsAdjusting()) {
		Object id = listComponent.getSelectedValue();
		if (id != null) {
			ObjectVisualizer visualizer = ObjectVisualizerService.getVisualizerForObject(clusterModel);
			visualizer.startVisualization(id);
		}
	}
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:11,代碼來源:ClusterModelObjectViewer.java

示例15: valueChanged

import javax.swing.event.ListSelectionEvent; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public void valueChanged(ListSelectionEvent e) {
    if (e.getValueIsAdjusting() == false) {
        boolean enabled = isEditable()
            && this.list.getSelectedValue() != null;
        this.editButton.setEnabled(enabled);
        this.addButton.setEnabled(isEditable()
            && getOption().getTemplate() != null);
        this.removeButton.setEnabled(enabled);
        this.upButton.setEnabled(enabled);
        this.downButton.setEnabled(enabled);
    }
}
 
開發者ID:FreeCol,項目名稱:freecol,代碼行數:17,代碼來源:ListOptionUI.java


注:本文中的javax.swing.event.ListSelectionEvent.getValueIsAdjusting方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。