本文整理匯總了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);
}
}
}
}
示例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();
}
示例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();
}
示例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);
}
示例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);
}
}
示例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;
}
}
示例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());
}
}
示例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();
}
}
}
示例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);
}
}
示例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);
}
}
示例11: valueChanged
import javax.swing.event.ListSelectionEvent; //導入方法依賴的package包/類
public void valueChanged(ListSelectionEvent event) {
if (event.getValueIsAdjusting()) {
return;
}
output.append("ROW SELECTION EVENT. ");
outputSelection();
}
示例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());
}
示例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$
}
}
示例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);
}
}
}
示例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);
}
}