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


Java ItemEvent.getSource方法代码示例

本文整理汇总了Java中java.awt.event.ItemEvent.getSource方法的典型用法代码示例。如果您正苦于以下问题:Java ItemEvent.getSource方法的具体用法?Java ItemEvent.getSource怎么用?Java ItemEvent.getSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.event.ItemEvent的用法示例。


在下文中一共展示了ItemEvent.getSource方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: itemStateChanged

import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@Override
public void itemStateChanged(ItemEvent event) {
	if ( event.getSource() == jComboBoxMtpProtocol){
		if (this.getJcomboBoxMtpProtocol().getSelectedProtocol()==MtpProtocol.HTTP) {
			// ---- switch to HTTP ----------------------------------
			this.setHttpsComponentsEnabledState(false);
			this.currProject.getJadeConfiguration().setMtpProtocol(MtpProtocol.HTTP);
			this.getJTextFieldKeyStoreFile().setText(null);
			this.getJTextFieldTrustStoreFile().setText(null);
		} else if (this.getJcomboBoxMtpProtocol().getSelectedProtocol()==MtpProtocol.HTTPS) {
			// ---- switch to HTTPS ------------------------------
			this.setHttpsComponentsEnabledState(true);
			this.editHTTPSsettings(event.getSource(), MtpProtocol.HTTPS);
		} else if(this.getJcomboBoxMtpProtocol().getSelectedProtocol()==MtpProtocol.PROXIEDHTTPS){
			this.setHttpsComponentsEnabledState(true);
			this.editHTTPSsettings(event.getSource(), MtpProtocol.PROXIEDHTTPS);
		}
	}
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:20,代码来源:JadeSetupMTP.java

示例2: handleRadioButtonItemStateChanged

import java.awt.event.ItemEvent; //导入方法依赖的package包/类
protected void handleRadioButtonItemStateChanged(ItemEvent e) {
	
	if(e.getStateChange() == ItemEvent.SELECTED) {
		
		RadioButton button = (RadioButton) e.getSource();
		System.out.println(button.getActionCommand().split("/")[0]);
		this.inputExtension = button.getActionCommand().split("/")[0];
		
		textField.setToOriginalText();
		textOutputDir.setToOriginalText();
		btnConvert.setEnabled(false);
		
		String buttonName = button.getName();
		if(buttonName.equals("SVY")||buttonName.equals("XYZ")||buttonName.equals("LAZ")||buttonName.equals("PTX")) {
			exportDxfColorCheckBox.setSelected(false);
			exportDxfColorCheckBox.setEnabled(false);
		} else if(buttonName.equals("PTS")) {
			exportDxfColorCheckBox.setEnabled(true);
		}	
	}
}
 
开发者ID:enocholumide,项目名称:Laserscan-to-dxf,代码行数:22,代码来源:Converter.java

示例3: itemStateChanged

import java.awt.event.ItemEvent; //导入方法依赖的package包/类
public void itemStateChanged( ItemEvent e ) {
    Object source = e.getSource();

    if ( source instanceof JCheckBoxMenuItem ) {
        JCheckBoxMenuItem cbmi = (JCheckBoxMenuItem) source;
        if ( cbmi == displayGridCBMI )
          fp.setGridDisplay( displayGridCBMI.getState() );
        else if ( cbmi == force16ColsCBMI )
          fp.setForce16Columns( force16ColsCBMI.getState() );
        else if ( cbmi == showFontInfoCBMI ) {
            if ( showFontInfoCBMI.getState() ) {
                fireUpdateFontInfo();
                fontInfoDialog.show();
            }
            else
              fontInfoDialog.hide();
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:Font2DTest.java

示例4: itemStateChanged

import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@Override
public void itemStateChanged(ItemEvent e) {
	Object source = e.getSource();
	
	if (source==projectBox) {
		populateTagComboBox((Project)projectBox.getSelectedItem());
	} else if (source==tagSelectBox) {
		changeEditTagTxtField((String)tagSelectBox.getSelectedItem());
	}
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:11,代码来源:EditProjectTagController.java

示例5: itemStateChanged

import java.awt.event.ItemEvent; //导入方法依赖的package包/类
public void itemStateChanged(ItemEvent e){
	if(e.getSource() == comboBoxLeague){
		for(int i = 0; i < comboBoxContent.length; i++){
			if(e.getSource() == comboBoxLeague){
				if(comboBoxLeague.getSelectedItem().equals(comboBoxContent[i])){
					selectedLeagueID = leagueID[i];
					prefs.put("LeagueNameListIndex", Integer.toString(i));
					
					loadPreferences();
					updateDates();
					updateStartButton();
					break;
				}
			}
		}
	}
	else if(e.getSource() == comboBoxMode){
		if(comboBoxMode.getSelectedItem().equals("CSV")){
			prefs.put("LadderTrackerMode", Integer.toString(0));
		}
		else{
			prefs.put("LadderTrackerMode", Integer.toString(1));
		}
		
		loadPreferences();
	}
}
 
开发者ID:jkjoschua,项目名称:poe-ladder-tracker-java,代码行数:28,代码来源:GUIStartup.java

示例6: itemStateChanged

import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@Override
public void itemStateChanged(ItemEvent event) {
	if ( event.getSource() == this.getJComboBoxMtpProtocol()){
		MtpProtocol currentMTP = this.getJComboBoxMtpProtocol().getSelectedProtocol();
		this.action = "COMBO";
		if (currentMTP == MtpProtocol.HTTP) {
			// ---- switch from HTTPS to HTTP ----------------------------------
			this.hideCertificateSettings();
		} else if (currentMTP == MtpProtocol.HTTPS) {
			// ---- switch between HTTP and HTTPS ------------------------------
			if (event.getStateChange() == ItemEvent.SELECTED) {
				Object item = event.getItem();
				if (item.equals(MtpProtocol.HTTPS)) {
					// ---- If the user choose HTTPS ---------------------------
					this.showCertificateSettings();
					
					// --- If the stores are not defined or do not exist, open the configuration dialog ----------
					if(this.keyStore == null || this.trustStore == null || this.keyStore.exists() == false || this.trustStore.exists() == false){
						this.editHTTPSsettings();
					}
				} else {
					// ---- If the user choose HTTP ----------------------------
					this.hideCertificateSettings();
				}
			}
		} else if (currentMTP == MtpProtocol.PROXIEDHTTPS){
			System.err.println("NOT YET IMPLEMENTED");
		}
	}
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:31,代码来源:JPanelMTPConfig.java

示例7: itemStateChanged

import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@Override

public void itemStateChanged (ItemEvent evt){
            
              

if(evt.getSource()== jRadioButtonPaciente){
    jLabel4.setVisible(false);
    CRM.setVisible(false);
    LabelFarmacia.setVisible(false);
    NomeFarmacia.setVisible(false);     
    vlogin.type = 0;
    
}else if(evt.getSource()== jRadioButtonMedico){
    jLabel4.setVisible(true);
    CRM.setVisible(true);
    LabelFarmacia.setVisible(false);
    NomeFarmacia.setVisible(false);  
    vlogin.type = 1;
}else if(evt.getSource() == jRadioButtonFarmaceutico){
    jLabel4.setVisible(false);
    CRM.setVisible(false);
    LabelFarmacia.setVisible(true);
    NomeFarmacia.setVisible(true);
    vlogin.type = 2;
    
   
} 

}
 
开发者ID:knowrafa,项目名称:lembredio,代码行数:31,代码来源:CadastroInterface.java

示例8: itemStateChanged

import java.awt.event.ItemEvent; //导入方法依赖的package包/类
public void itemStateChanged(ItemEvent e) {

        for (int i = 0; i < columns.length; i++) {
            if (komponente[i] == e.getSource()) {
                komponente[i].setChanged();

                break;
            }
        }
    }
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:11,代码来源:ZaurusTableForm.java

示例9: 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,项目名称:sstore-soft,代码行数:12,代码来源:AbstractMenuHandler.java

示例10: itemStateChanged

import java.awt.event.ItemEvent; //导入方法依赖的package包/类
public void itemStateChanged(ItemEvent e)
{
   if (e.getSource() == shapeChoices) // choosing a shape
      drawPanel.setShapeType(shapeChoices.getSelectedIndex());
   else if (e.getSource() == colorChoices) // choosing a color
      drawPanel.setDrawingColor(
         colors[colorChoices.getSelectedIndex()]);
   else if (e.getSource() == filledCheckBox) // filled/unfilled
      drawPanel.setFilledShape(filledCheckBox.isSelected());
}
 
开发者ID:cleitonferreira,项目名称:LivroJavaComoProgramar10Edicao,代码行数:11,代码来源:DrawFrame.java

示例11: 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:FreeCol,项目名称:freecol,代码行数:15,代码来源:FreeColMenuTest.java

示例12: itemStateChanged

import java.awt.event.ItemEvent; //导入方法依赖的package包/类
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,代码行数:11,代码来源:DesignerVisualization.java

示例13: itemStateChanged

import java.awt.event.ItemEvent; //导入方法依赖的package包/类
public void itemStateChanged(ItemEvent evt) {
    if (evt.getStateChange() == ItemEvent.SELECTED) {
        if (evt.getSource() == onlyDoublyConnectedCB) {
            onlySinglyConnectedCB.setState(false);
        }
        else {
            onlyDoublyConnectedCB.setState(false);
        }
    }
}
 
开发者ID:etomica,项目名称:etomica,代码行数:11,代码来源:MyApplet.java

示例14: itemStateChanged

import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@Override
public void itemStateChanged(ItemEvent e) {
    if(e.getSource() == panel.filterComboBox) {
        onFilterChange((Filter)e.getItem());
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:QueryController.java

示例15: itemStateChanged

import java.awt.event.ItemEvent; //导入方法依赖的package包/类
@Override
public void itemStateChanged(ItemEvent e) {
    if(e.getSource() == comboCountry) comboCountry_Change(e);
}
 
开发者ID:hulang1024,项目名称:PTEAssistant,代码行数:5,代码来源:UserSettingFrame.java


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