本文整理汇总了Java中java.awt.event.ItemEvent.getItem方法的典型用法代码示例。如果您正苦于以下问题:Java ItemEvent.getItem方法的具体用法?Java ItemEvent.getItem怎么用?Java ItemEvent.getItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.event.ItemEvent
的用法示例。
在下文中一共展示了ItemEvent.getItem方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getItem() == mouseToolbarCheckbox) {
toolbars.getMouseToolbar().setVisible(mouseToolbarCheckbox.getState() );
} else if (e.getItem() == zoomToolbarCheckbox) {
toolbars.getZoomToolbar().setVisible(zoomToolbarCheckbox.getState() );
} else if (e.getItem() == simulationToolbarCheckbox) {
toolbars.getSimulationToolbar().setVisible(simulationToolbarCheckbox.getState() );
} else if (e.getItem() == dbToolbarCheckbox) {
toolbars.getDBToolbar().setVisible(dbToolbarCheckbox.getState() );
} else if (e.getItem() == undoToolbarCheckbox) {
toolbars.getUndoToolbar().setVisible(undoToolbarCheckbox.getState());
} else {
System.err.println("Unknown event");
}
}
示例2: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getItem() == mouseToolbarCheckbox) {
toolbars.getMouseToolbar().setVisible(
mouseToolbarCheckbox.getState());
} else if (e.getItem() == zoomToolbarCheckbox) {
toolbars.getZoomToolbar()
.setVisible(zoomToolbarCheckbox.getState());
} else if (e.getItem() == simulationToolbarCheckbox) {
toolbars.getSimulationToolbar().setVisible(
simulationToolbarCheckbox.getState());
} else if (e.getItem() == dbToolbarCheckbox) {
toolbars.getDBToolbar().setVisible(dbToolbarCheckbox.getState());
} else if (e.getItem() == undoToolbarCheckbox) {
toolbars.getUndoToolbar()
.setVisible(undoToolbarCheckbox.getState());
} else {
Cuttlefish.err("Unknown event");
}
}
示例3: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@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();
}
}
示例4: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@Override
public void itemStateChanged(ItemEvent e) {
if(e.getItem() instanceof CompletionPopup.OptionCheckbox) {
CompletionPopup.OptionCheckbox checkbox = (CompletionPopup.OptionCheckbox) e.getItem();
InstantOption option = checkbox.option;
boolean oldValue = option.selected();
boolean newValue = checkbox.isSelected();
option.setSelected(newValue);
listener.propertyChange(new PropertyChangeEvent(option, option.displayName(), oldValue, newValue));
}
}
示例5: runSetJarArtifact
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
private void runSetJarArtifact(ConnectorPresenter presenter, ItemEvent e) {
if(e.getStateChange() != ItemEvent.SELECTED)
return;
ArtifactEntry entry = (ArtifactEntry) e.getItem();
if(entry == null)
return;
runOperation(() -> presenter.setJarArtifact(entry), "Select JAR-artifact: " + entry.toString());
}
示例6: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@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);
}
}
}
示例7: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
public void itemStateChanged(ItemEvent e) {
String s = (String) e.getItem();
for (int i = 0; i < connTypes.length; i++) {
if (s.equals(connTypes[i][0])) {
mDriver.setText(connTypes[i][1]);
mURL.setText(connTypes[i][2]);
}
}
}
示例8: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
public void itemStateChanged(ItemEvent e)
{
if ( e.getStateChange() == ItemEvent.SELECTED )
{
MonthInfo v_NewMonth = ((MonthInfo)e.getItem());
if ( isAllowEvent )
{
setMonth(v_NewMonth.getMonth());
}
}
}
示例9: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
/**
* Method declaration
*
*
* @param e
*/
public void itemStateChanged(ItemEvent e) {
String s = (String) e.getItem();
for (int i = 0; i < sJDBCTypes.length; i++) {
if (s.equals(sJDBCTypes[i][0])) {
mDriver.setText(sJDBCTypes[i][1]);
mURL.setText(sJDBCTypes[i][2]);
}
}
}
示例10: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@Override
public void itemStateChanged(ItemEvent event) {
if (event.getStateChange() == ItemEvent.SELECTED) {
ComboModel item = (ComboModel) event.getItem();
foodIds.add(item.getId());
}
}
示例11: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getSource() instanceof Checkbox) {
target.setForeground(((Component) e.getSource()).getForeground());
} else if (e.getSource() instanceof Choice) {
String choice = (String) e.getItem();
if (choice.equals("Lines")) {
target.setDrawMode(DrawPanel.LINES);
} else if (choice.equals("Points")) {
target.setDrawMode(DrawPanel.POINTS);
}
}
}