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


Java ItemEvent.getItem方法代码示例

本文整理汇总了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");
	}
}
 
开发者ID:dev-cuttlefish,项目名称:cuttlefish,代码行数:17,代码来源:ViewMenu.java

示例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");
	}
}
 
开发者ID:dev-cuttlefish,项目名称:cuttlefish,代码行数:21,代码来源:ViewMenu.java

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

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

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

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

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

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

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

示例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());
    }
}
 
开发者ID:seyidkanan,项目名称:my-diploma-work,代码行数:8,代码来源:KnowledgeBaseFrame.java

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


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