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


Java JCheckBox.doClick方法代码示例

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


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

示例1: setAlgorithms

import javax.swing.JCheckBox; //导入方法依赖的package包/类
private void setAlgorithms() {
	if ((data.isWhatifAlgorithms() && !compMultiAlg.isSelected()) || (!data.isWhatifAlgorithms() && compMultiAlg.isSelected())) {
		algPanel.setVisible(true);
		compMultiAlg.setSelected(true);
	}
	if (!data.isClosed()) {
		compMultiAlg.setEnabled(false);
	}
	for (Entry<SolverAlgorithm, JCheckBox> e : this.algCheckBoxes.entrySet()) {
		SolverAlgorithm algo = e.getKey();
		boolean selected = (data.getWhatifAlgorithms().contains(algo));
		JCheckBox checkbox = e.getValue();
		if ((selected && !checkbox.isSelected()) || (!selected && checkbox.isSelected())) {
			checkbox.doClick();
		}
		if (!data.isClosed()) {
			checkbox.setEnabled(false);
		}
		if (!algo.isExact()) {
			algTolerances.get(algo).setText(numFormat.format(data.getWhatifAlgorithmTolerance(algo)));
			if (!data.isClosed()) {
				algToleranceLabels.get(algo).setEnabled(false);
				algTolerances.get(algo).setEnabled(false);
			}
		}
	}
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:28,代码来源:WhatIfPanel.java

示例2: testNewJavaProject

import javax.swing.JCheckBox; //导入方法依赖的package包/类
/** Test creation of java project. 
 * - open New Project wizard from main menu (File|New Project)
 * - select Java Application project from Standard category
 * - in the next panel type project name and project location in
 * - finish the wizard
 * - wait until project appears in projects view
 * - wait classpath scanning finished
 */
public void testNewJavaProject() {
    NewProjectWizardOperator.invoke().cancel();
    NewProjectWizardOperator npwo = NewProjectWizardOperator.invoke();
    // "Standard"
    String standardLabel = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.wizards.Bundle", "Templates/Project/Standard");
    npwo.selectCategory(standardLabel);
    // "Java Application"
    String javaApplicationLabel = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.wizards.Bundle", "template_app");
    npwo.selectProject(javaApplicationLabel);
    npwo.next();
    NewJavaProjectNameLocationStepOperator npnlso = new NewJavaProjectNameLocationStepOperator();
    npnlso.txtProjectName().setText(SAMPLE_PROJECT_NAME);
    npnlso.txtProjectLocation().setText(System.getProperty("netbeans.user")); // NOI18N
    npnlso.btFinish().pushNoBlock();
    npnlso.getTimeouts().setTimeout("ComponentOperator.WaitStateTimeout", 120000);
    npnlso.waitClosed();
    // wait project appear in projects view
    new ProjectsTabOperator().getProjectRootNode(SAMPLE_PROJECT_NAME);

    //disable the compile on save:
    ProjectsTabOperator.invoke().getProjectRootNode(SAMPLE_PROJECT_NAME).properties();
    // "Project Properties"
    String projectPropertiesTitle = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.customizer.Bundle", "LBL_Customizer_Title");
    NbDialogOperator propertiesDialogOper = new NbDialogOperator(projectPropertiesTitle);
    // select "Compile" category
    String buildCategoryTitle = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.customizer.Bundle", "LBL_Config_BuildCategory");
    String compileCategoryTitle = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.customizer.Bundle", "LBL_Config_Build");
    new Node(new Node(new JTreeOperator(propertiesDialogOper), buildCategoryTitle), compileCategoryTitle).select();
    // actually disable the quick run:
    String compileOnSaveLabel = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.customizer.Bundle", "CustomizerCompile.CompileOnSave");
    JCheckBox cb = JCheckBoxOperator.waitJCheckBox((Container) propertiesDialogOper.getSource(), compileOnSaveLabel, true, true);
    if (cb.isSelected()) {
        cb.doClick();
    }
    // confirm properties dialog
    propertiesDialogOper.ok();

    // wait classpath scanning finished
    PerfWatchProjects.waitScanFinished();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:49,代码来源:PerfIDEValidation.java

示例3: testNewProject

import javax.swing.JCheckBox; //导入方法依赖的package包/类
/** Test creation of java project. 
 * - open New Project wizard from main menu (File|New Project)
 * - select Java Application project from Standard category
 * - in the next panel type project name and project location in
 * - finish the wizard
 * - wait until project appears in projects view
 * - wait classpath scanning finished
 */
public void testNewProject() {
    NewProjectWizardOperator.invoke().cancel();
    NewProjectWizardOperator npwo = NewProjectWizardOperator.invoke();
    // "Standard"
    String standardLabel = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.wizards.Bundle", "Templates/Project/Standard");
    npwo.selectCategory(standardLabel);
    // "Java Application"
    String javaApplicationLabel = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.wizards.Bundle", "template_app");
    npwo.selectProject(javaApplicationLabel);
    npwo.next();
    NewJavaProjectNameLocationStepOperator npnlso = new NewJavaProjectNameLocationStepOperator();
    npnlso.txtProjectName().setText(SAMPLE_PROJECT_NAME);
    npnlso.txtProjectLocation().setText(System.getProperty("netbeans.user")); // NOI18N
    npnlso.btFinish().pushNoBlock();
    npnlso.getTimeouts().setTimeout("ComponentOperator.WaitStateTimeout", 120000);
    npnlso.waitClosed();
    // wait project appear in projects view
    new ProjectsTabOperator().getProjectRootNode(SAMPLE_PROJECT_NAME);

    //disable the compile on save:
    ProjectsTabOperator.invoke().getProjectRootNode(SAMPLE_PROJECT_NAME).properties();
    // "Project Properties"
    String projectPropertiesTitle = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.customizer.Bundle", "LBL_Customizer_Title");
    NbDialogOperator propertiesDialogOper = new NbDialogOperator(projectPropertiesTitle);
    // select "Compile" category
    String buildCategoryTitle = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.customizer.Bundle", "LBL_Config_BuildCategory");
    String compileCategoryTitle = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.customizer.Bundle", "LBL_Config_Build");
    new Node(new Node(new JTreeOperator(propertiesDialogOper), buildCategoryTitle), compileCategoryTitle).select();
    // actually disable the quick run:
    String compileOnSaveLabel = Bundle.getStringTrimmed("org.netbeans.modules.java.j2seproject.ui.customizer.Bundle", "CustomizerCompile.CompileOnSave");
    JCheckBox cb = JCheckBoxOperator.waitJCheckBox((Container) propertiesDialogOper.getSource(), compileOnSaveLabel, true, true);
    if (cb.isSelected()) {
        cb.doClick();
    }
    // confirm properties dialog
    propertiesDialogOper.ok();

    // wait classpath scanning finished
    WatchProjects.waitScanFinished();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:49,代码来源:IDEValidation.java


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