本文整理汇总了Java中java.awt.event.ItemEvent.SELECTED属性的典型用法代码示例。如果您正苦于以下问题:Java ItemEvent.SELECTED属性的具体用法?Java ItemEvent.SELECTED怎么用?Java ItemEvent.SELECTED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.awt.event.ItemEvent
的用法示例。
在下文中一共展示了ItemEvent.SELECTED属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: templateComboBoxItemStateChanged
private void templateComboBoxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_templateComboBoxItemStateChanged
if (evt.getStateChange() == ItemEvent.SELECTED) {
Object item = evt.getItem();
if (item != null && !(item instanceof JdbcUrl)) {
// This is an item indicating "Create a New Driver", and if
// we futz with the fields, then the ComboBox wants to make the
// drop-down invisible and the dialog never gets a chance to
// get invoked.
return;
}
JdbcUrl jdbcurl = (JdbcUrl) item;
// Field entry mode doesn't make sense if this URL isn't parsed. change the mode
// now if appropriate
if (!jdbcurl.isParseUrl()) {
updateInputMode(false);
} else {
setUpFields();
}
updateUrlFromFields();
fireChange();
}
}
示例2: itemStateChanged
public void itemStateChanged(ItemEvent evt) {
if(evt.getSource().equals(checkBox1)){
if (evt.getStateChange() == ItemEvent.SELECTED) {
starter.setDrawNumbersOfWhite(true);
}
else {
starter.setDrawNumbersOfWhite(false);
}
} else if(evt.getSource().equals(checkBox2)){
if (evt.getStateChange() == ItemEvent.SELECTED) {
starter.setDrawNumbersOfBlack(true);
}
else {
starter.setDrawNumbersOfBlack(false);
}
}
}
示例3: runSetCredentialProfile
private void runSetCredentialProfile(ConnectorPresenter presenter, ItemEvent e) {
if(e.getStateChange() != ItemEvent.SELECTED)
return;
CredentialProfileEntry entry = (CredentialProfileEntry)e.getItem();
if(entry == null)
return;
runOperation(() -> presenter.setCredentialProfile(entry), "Select credential profile: " + entry.toString());
}
示例4: browserComboItemStateChanged
private void browserComboItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_browserComboItemStateChanged
if (evt.getStateChange() == ItemEvent.SELECTED) {
SwingUtilities.invokeLater(() -> {
checkAndLoadCapabilities();
});
}
}
示例5: itemStateChanged
@Override
public void itemStateChanged(final ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
this.mView.setStyle((EStyle) e.getItem());
this.mView.repaint();
}
}
示例6: itemStateChanged
@Override
public void itemStateChanged(ItemEvent e) {
boolean state = e.getStateChange() == ItemEvent.SELECTED;
setAutoSync(state);
if (syncListener != null) {
syncListener.updateAutoSyncState(state);
}
}
示例7: itemStateChanged
@Override
public void itemStateChanged(ItemEvent ie) {
if (ie.getStateChange() == ItemEvent.SELECTED) {
showImage();
} else {
hideImage();
}
}
示例8: runSetRegion
private void runSetRegion(ConnectorPresenter presenter, ItemEvent e) {
if(operationInProgress || setRegionOperationInProgress
|| e.getStateChange() != ItemEvent.SELECTED)
return;
RegionEntry entry = (RegionEntry)e.getItem();
if(entry == null)
return;
runOperation(() -> presenter.setRegion(entry), "Select region: " + entry.toString());
}
示例9: itemStateChanged
public void itemStateChanged(ItemEvent e) {
if(e.getItem() instanceof Vertex) {
Vertex v = (Vertex)e.getItem();
Icon icon = imager.getIcon(v);
if(icon instanceof LayeredIcon) {
if(e.getStateChange() == ItemEvent.SELECTED) {
((LayeredIcon)icon).add(checked);
} else {
((LayeredIcon)icon).remove(checked);
}
}
}
}
示例10: itemStateChanged
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
int n = (Integer)e.getItemSelectable().getSelectedObjects()[0];
this.frame.animation.setN(n);
this.frame.animation.makeWheelTeeth( n );
this.frame.bottom.graph.clearData();
this.frame.bottom.graph.updateChart(this.frame.bottom.graph.data);
this.frame.updateAnimation();
this.frame.animation.repaint();
}
}
示例11: itemStateChanged
public void itemStateChanged(ItemEvent e) {
JMenuItem source = (JMenuItem)(e.getSource());
String s = "Item event detected.\n"
+ " Event source: " + source.getText()
+ " (an instance of " + source.getClass().getName() + ")\n"
+ " New state: "
+ ((e.getStateChange() == ItemEvent.SELECTED) ?
"selected":"unselected") + "\n\n";
System.err.println(s);
}
示例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: 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);
}
}
示例14: itemStateChanged
@Override
public void itemStateChanged(ItemEvent e) {
if (repositoryComboBox.isEnabled()) {
enableFields();
}
if(e.getStateChange() == ItemEvent.SELECTED) {
Object item = e.getItem();
if(item instanceof Repository) {
Repository repo = (Repository) item;
qs.setRepository(repo);
}
}
}
示例15: btnGenerateItemStateChanged
private void btnGenerateItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_btnGenerateItemStateChanged
boolean b = evt.getStateChange() == ItemEvent.SELECTED ? true : false;
if(b) {
RefactoringModule.setOption(EQUALITY, IntroduceLocalExtensionRefactoring.Equality.GENERATE.ordinal());
parent.stateChanged(null);
}
}