當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。