本文整理汇总了Java中java.awt.event.ItemEvent.DESELECTED属性的典型用法代码示例。如果您正苦于以下问题:Java ItemEvent.DESELECTED属性的具体用法?Java ItemEvent.DESELECTED怎么用?Java ItemEvent.DESELECTED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.awt.event.ItemEvent
的用法示例。
在下文中一共展示了ItemEvent.DESELECTED属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fireItemStateChanged
protected void fireItemStateChanged(ItemEvent e) {
switch (e.getStateChange()) {
case ItemEvent.SELECTED:
if (e.getItem() instanceof JSeparator) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
selectNextItem();
}
});
}
break;
case ItemEvent.DESELECTED:
if (!(e.getItem() instanceof JSeparator)) {
lastSelectedIndex = model.getIndexOf(e.getItem());
}
break;
}
super.fireItemStateChanged(e);
}
示例2: CheckBoxWithText
/**
*
*/
public CheckBoxWithText(String title) {
super();
setText(title);
super.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
// TODO Auto-generated method stub
if (e.getStateChange() == ItemEvent.SELECTED) {
textField.setEnabled(true);
} else if (e.getStateChange() == ItemEvent.DESELECTED) {
textField.setEnabled(false);
}
}
});
}
示例3: setActivated
/**
* activates or deactivates the widget in the panel
* @param activated boolean true to activate and false to deactivate
*/
public void setActivated(boolean activated) {
if(widget!=null && widget.isClickable()){
widget.setActive(activated);
if(activated){
labelPanel.setBackground(highlightColor);
jLabel.setForeground(Color.GRAY);
}else{
labelPanel.setBackground(Color.GRAY);
jLabel.setForeground(highlightColor);
}
if(widget!=null){
widget.onActiveChanged();
}
//notify the listeners over the widet the state change event
for(ItemListener listener: listeners){
ItemEvent e = new ItemEvent(this,0,widget, isActivated() ? ItemEvent.SELECTED : ItemEvent.DESELECTED);
listener.itemStateChanged(e);
}
}
}
示例4: sourceFolderItemStateChanged
private void sourceFolderItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_sourceFolderItemStateChanged
if (ignoreEvent) {
return;
}
if (evt.getStateChange() == ItemEvent.DESELECTED) {
int index = findIndex(evt.getItem());
// if index == -1 then item was removed and will not be saved
if (index != -1) {
saveClasspath(index);
}
} else {
loadClasspath();
}
updateButtons();
}
示例5: sourceFolderItemStateChanged
private void sourceFolderItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_sourceFolderItemStateChanged
if (ignoreEvent) {
return;
}
if (evt.getStateChange() == ItemEvent.DESELECTED) {
int index = findIndex(evt.getItem());
// if index == -1 then item was removed and will not be saved
if (index != -1) {
saveOutput(index);
}
} else {
loadOutput();
}
}
示例6: itemStateChanged
@Override
public void itemStateChanged(ItemEvent evt) {
if(evt.getStateChange() == ItemEvent.SELECTED) {
RepositoryConnection rc = (RepositoryConnection) evt.getItem();
if (rc != null) {
currentPanel.refresh(rc);
updateVisibility();
editedRC = new RepositoryConnection(rc);
}
} else if(evt.getStateChange() == ItemEvent.DESELECTED) {
updateVisibility();
}
}
示例7: itemStateChanged
@Override
public void itemStateChanged(ItemEvent e) {
switch(e.getStateChange()) {
case ItemEvent.SELECTED:
filterMask &= ~itemMask;
break;
case ItemEvent.DESELECTED:
filterMask |= itemMask;
break;
default:
return;
}
treePanel.setFilterMask(filterMask);
NbPreferences.forModule(StatisticsPanel.class).putInt(KEY_FILTER_MASK, filterMask);
}
示例8: itemStateChanged
@Override
public void itemStateChanged( ItemEvent e ) {
if( e.getStateChange() == ItemEvent.DESELECTED || !listen )
return;
updateData();
fireChanged();
}
示例9: itemStateChanged
@Override
public void itemStateChanged( ItemEvent e ) {
if( e.getStateChange() == ItemEvent.DESELECTED )
return;
if (!listen) return;
updateData ();
fireChanged();
}
示例10: itemStateChanged
@Override
public void itemStateChanged(ItemEvent arg0) {
if (arg0.getItemSelectable() instanceof JCheckBox) {
JCheckBox box = (JCheckBox) arg0.getItemSelectable();
if (arg0.getStateChange() == ItemEvent.SELECTED) {
if (box.getText().contains("React")) {
this.controller.setReactAsBot(true);
} else if (box.getText().contains("GeniusMatti")) {
this.controller.setTrollMatti(true);
} else if (box.getText().contains("Swaul")) {
this.controller.setTrollPaul(true);
} else if (box.getText().contains("Log")) {
this.controller.setLogToFile(true);
}
} else if (arg0.getStateChange() == ItemEvent.DESELECTED) {
if (box.getText().contains("React")) {
this.controller.setReactAsBot(false);
} else if (box.getText().contains("GeniusMatti")) {
this.controller.setTrollMatti(false);
} else if (box.getText().contains("Swaul")) {
this.controller.setTrollPaul(false);
} else if (box.getText().contains("Log")) {
this.controller.setLogToFile(false);
}
}
}
}
示例11: itemStateChanged
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.DESELECTED) {
return;
}
if (e.getSource() == mComboBoxStreams) {
selectedStreamChanged();
} else if (e.getSource() == mComboBoxVideoModes) {
selectedVideoModeChanged();
}
}
示例12: handleAction
public void handleAction(final boolean state) {
final CheckboxMenuItem target = (CheckboxMenuItem)getTarget();
SunToolkit.executeOnEventHandlerThread(target, new Runnable() {
public void run() {
target.setState(state);
}
});
ItemEvent event = new ItemEvent(target, ItemEvent.ITEM_STATE_CHANGED, target.getLabel(), state ? ItemEvent.SELECTED : ItemEvent.DESELECTED);
SunToolkit.postEvent(SunToolkit.targetToAppContext(getTarget()), event);
}
示例13: itemStateChanged
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.DESELECTED) {
versionSelectComboBox.setEnabled(false);
localPdeLibraryBrowser.setEnabled(true);
return;
}
if (e.getStateChange() == ItemEvent.SELECTED) {
populateComboBox();
}
}
示例14: itemStateChanged
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.DESELECTED) {
localPdeLibraryBrowser.setEnabled(false);
}
if (e.getStateChange() == ItemEvent.SELECTED) {
localPdeLibraryBrowser.setEnabled(true);
}
}
示例15: ingress_RadioButtonItemStateChanged
private void ingress_RadioButtonItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_ingress_RadioButtonItemStateChanged
if(evt.getStateChange() == ItemEvent.SELECTED){
domain_LayeredPane.setVisible(true);
}else if(evt.getStateChange() == ItemEvent.DESELECTED){
domain_LayeredPane.setVisible(false);
}
}