本文整理汇总了Java中java.awt.event.ItemEvent.getStateChange方法的典型用法代码示例。如果您正苦于以下问题:Java ItemEvent.getStateChange方法的具体用法?Java ItemEvent.getStateChange怎么用?Java ItemEvent.getStateChange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.event.ItemEvent
的用法示例。
在下文中一共展示了ItemEvent.getStateChange方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fireItemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
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: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
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: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
int d = (Integer)e.getItemSelectable().getSelectedObjects()[0];
this.frame.animation.setD(d);
this.frame.animation.fullMirror.x=(int)(this.frame.animation.wheel.getX() +
(this.frame.animation.getWidth()-this.frame.animation.wheel.getX())*(d/15000.0) );
this.frame.animation.makeLightBeam();
this.frame.bottom.graph.clearData();
this.frame.bottom.graph.updateChart(this.frame.bottom.graph.data);
this.frame.updateAnimation();
this.frame.animation.repaint();
}
}
示例4: runSetRegion
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
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());
}
开发者ID:satr,项目名称:intellij-idea-plugin-connector-for-aws-lambda,代码行数:10,代码来源:ConnectorViewFactory.java
示例5: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
public void itemStateChanged(ItemEvent evt)
{
if(evt.getStateChange() == 1)
setSelected(true);
else
setSelected(false);
if(listener != null)
listener.itemStateChanged(evt);
}
示例6: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@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();
}
}
示例7: 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());
}
}
}
示例8: runSetFunction
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
private void runSetFunction(ConnectorPresenter presenter, ItemEvent e) {
if(operationInProgress || setRegionOperationInProgress
|| e.getStateChange() != ItemEvent.SELECTED)
return;
FunctionEntry entry = (FunctionEntry)e.getItem();
if(entry == null)
return;
runOperation(() -> presenter.setFunction(entry), "Select function: " + entry.toString());
}
开发者ID:satr,项目名称:intellij-idea-plugin-connector-for-aws-lambda,代码行数:10,代码来源:ConnectorViewFactory.java
示例9: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@Override
public void itemStateChanged( ItemEvent e ) {
if( e.getStateChange() == ItemEvent.DESELECTED )
return;
if (!listen) return;
updateData ();
fireChanged();
}
示例10: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@Override
public void itemStateChanged(ItemEvent e) {
JMenuItem source = (JMenuItem)(e.getSource());
String s = "Item event detected."
+ newline
+ " Event source: " + source.getText()
+ " (an instance of " + getClassName(source) + ")"
+ newline
+ " New state: "
+ ((e.getStateChange() == ItemEvent.SELECTED) ?
"selected":"unselected");
output.append(s + newline);
output.setCaretPosition(output.getDocument().getLength());
}
示例11: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
/**
* Method description
*
* @see
* @param objPitemEvent
*/
final public void itemStateChanged(ItemEvent objPitemEvent) {
Tools.debug("LanguageJRadioButtonMenuItem.itemStateChanged()");
if (objPitemEvent.getStateChange() == ItemEvent.SELECTED) {
this.objGcontrolJFrame.setLanguage(this.intGlanguageIndex, true);
}
}
示例12: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@Override
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);
}
示例13: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
removeFromBlackList(renderableObjectName, renderName);
} else {
addToBlackList(renderableObjectName, renderName);
}
}
示例14: itemStateChanged
import java.awt.event.ItemEvent; //导入方法依赖的package包/类
public void itemStateChanged(ItemEvent e) {
// If the values changes
if (e.getStateChange() == ItemEvent.SELECTED) {
Database selectedDatabase =
(Database) getSelectedDatabaseViewer().getCombo().getSelectedItem();
getSelectedDatabaseViewer().getCombo().setSelectedItem(selectedDatabase);
updateSelectedDatabase();
}
}
示例15: 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());
}