当前位置: 首页>>代码示例>>Java>>正文


Java ItemEvent.getStateChange方法代码示例

本文整理汇总了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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:JExtendedComboBox.java

示例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);
     }
	}
}
 
开发者ID:etomica,项目名称:etomica,代码行数:18,代码来源:MyApplet.java

示例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();

	}
}
 
开发者ID:Tosbert,项目名称:FizeauExperimentSimulation,代码行数:18,代码来源:DistanceListener.java

示例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);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:StateChangeAction.java

示例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();

	}
}
 
开发者ID:Tosbert,项目名称:FizeauExperimentSimulation,代码行数:15,代码来源:ToothListener.java

示例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());
		}
	}
}
 
开发者ID:HY-ZhengWei,项目名称:hy.common.ui,代码行数:13,代码来源:JDatePanel.java

示例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();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:AnnotationsPanel.java

示例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());
}
 
开发者ID:wintertime,项目名称:FreeCol,代码行数:15,代码来源:FreeColMenuTest.java

示例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);
	}
}
 
开发者ID:jugglemaster,项目名称:JuggleMasterPro,代码行数:14,代码来源:LanguageJRadioButtonMenuItem.java

示例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);
 }
 
开发者ID:s-store,项目名称:s-store,代码行数:12,代码来源:AbstractMenuHandler.java

示例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);
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:9,代码来源:RendersDialog.java

示例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();
    }
}
 
开发者ID:tteguayco,项目名称:JITRAX,代码行数:11,代码来源:DatabaseViewer.java

示例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());
}
 
开发者ID:satr,项目名称:intellij-idea-plugin-connector-for-aws-lambda,代码行数:9,代码来源:ConnectorViewFactory.java


注:本文中的java.awt.event.ItemEvent.getStateChange方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。