當前位置: 首頁>>代碼示例>>Java>>正文


Java Checkbox.setState方法代碼示例

本文整理匯總了Java中java.awt.Checkbox.setState方法的典型用法代碼示例。如果您正苦於以下問題:Java Checkbox.setState方法的具體用法?Java Checkbox.setState怎麽用?Java Checkbox.setState使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.awt.Checkbox的用法示例。


在下文中一共展示了Checkbox.setState方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addCheckBoxes

import java.awt.Checkbox; //導入方法依賴的package包/類
private void addCheckBoxes() {

activeFeedbackCheckbox = new Checkbox("");
activeFeedbackCheckbox.setFocusable(false);
activeFeedbackCheckbox.setState(cfg.getIsActiveFeedbackEnabled());
activeFeedbackCheckbox.setBackground(COLOR_UI_BACKGROUND);
activeFeedbackCheckbox.setBounds(BOUNDS_ACTIVE_FEEDBACK_CHECKBOX);
getContentPane().add(activeFeedbackCheckbox);


defaultCollatedCheckbox = new Checkbox("");
defaultCollatedCheckbox.setFocusable(false);
defaultCollatedCheckbox.setState(cfg.getIsDefaultCollated());
defaultCollatedCheckbox.setBackground(COLOR_UI_BACKGROUND);
defaultCollatedCheckbox.setBounds(new Rectangle(846, 40, 25, 25));
getContentPane().add(defaultCollatedCheckbox);
   }
 
開發者ID:MohitShridhar,項目名稱:TASCA,代碼行數:18,代碼來源:SettingsPane.java

示例2: configurationSwitchesCreate

import java.awt.Checkbox; //導入方法依賴的package包/類
void configurationSwitchesCreate() {
    switchesLowerPanel.removeAll();
    switchesUpperPanel.removeAll();
    for (Iterator i = config.getSwitches().entrySet().iterator(); i.hasNext(); ) {
        Entry e = (Entry) i.next();
        final String name    = (String) e.getKey();
        final String setting = (String) e.getValue();
        final Checkbox check = new Checkbox(name);
        //check.setFont(new Font("Monospaced", Font.PLAIN, 11));
        check.setFont(new Font("Dialog", Font.PLAIN, 14));
        check.setState(setting.equals("on") ? true : false);
        if (name.length() < 4) {
            switchesUpperPanel.add(check);
        } else {
            switchesLowerPanel.add(check);
        }
    }
}
 
開發者ID:silverslade,項目名稱:jif,代碼行數:19,代碼來源:jFrame.java

示例3: dialogItemChanged

import java.awt.Checkbox; //導入方法依賴的package包/類
@Override
public boolean dialogItemChanged(final GenericDialog gd, final AWTEvent e) {
	if (!DialogModifier.allNumbersValid(gd.getNumericFields()))
		return false;
	final Vector<?> checkboxes = gd.getCheckboxes();
	final Vector<?> nFields = gd.getNumericFields();
	final Checkbox calibration = (Checkbox) checkboxes.get(10);
	final boolean isHUCalibrated = calibration.getState();
	final TextField minT = (TextField) nFields.get(0);
	final TextField maxT = (TextField) nFields.get(1);

	final double min = Double.parseDouble(minT.getText());
	final double max = Double.parseDouble(maxT.getText());
	if (isHUCalibrated && !fieldUpdated) {
		minT.setText("" + cal.getCValue(min));
		maxT.setText("" + cal.getCValue(max));
		fieldUpdated = true;
	}
	if (!isHUCalibrated && fieldUpdated) {
		minT.setText("" + cal.getRawValue(min));
		maxT.setText("" + cal.getRawValue(max));
		fieldUpdated = false;
	}
	if (isHUCalibrated)
		DialogModifier.replaceUnitString(gd, "grey", "HU");
	else
		DialogModifier.replaceUnitString(gd, "HU", "grey");

	final Checkbox oriented = (Checkbox) checkboxes.get(9);
	if (orienteer == null) {
		oriented.setState(false);
		oriented.setEnabled(false);
	} else
		oriented.setEnabled(true);

	DialogModifier.registerMacroValues(gd, gd.getComponents());
	return true;
}
 
開發者ID:bonej-org,項目名稱:BoneJ2,代碼行數:39,代碼來源:SliceGeometry.java

示例4: dialogItemChanged

import java.awt.Checkbox; //導入方法依賴的package包/類
/** Disables dialog components that are irrelevant to GUI-based analysis. */
public boolean dialogItemChanged(GenericDialog gd, AWTEvent e)
{
	if ( this.imRef.getRoi() == null && null != gd
			&& null != gd.getCheckboxes() )
	{
		Checkbox roiOption = (Checkbox)gd.getCheckboxes().elementAt(1);
		roiOption.setEnabled(false);
		if (Recorder.record) roiOption.setState(false);
	}
	return true;
}
 
開發者ID:fiji,項目名稱:AnalyzeSkeleton,代碼行數:13,代碼來源:AnalyzeSkeleton_.java

示例5: itemStateChanged

import java.awt.Checkbox; //導入方法依賴的package包/類
public void itemStateChanged(ItemEvent e)
{
	// When the checkbox is clicked, output the list of available filters to the ImageJ log

	Checkbox cb = (Checkbox) e.getSource();
	if (cb.getState())
	{
		cb.setState(false);

		logDemoFilters(TITLE);
	}
}
 
開發者ID:aherbert,項目名稱:GDSC-SMLM,代碼行數:13,代碼來源:FreeFilterResults.java

示例6: itemStateChanged

import java.awt.Checkbox; //導入方法依賴的package包/類
public void itemStateChanged(ItemEvent e)
{
	// When the checkbox is clicked, output the list of available filters to the ImageJ log

	Checkbox cb = (Checkbox) e.getSource();
	if (cb.getState())
	{
		cb.setState(false);

		logDemoFilters();
	}
}
 
開發者ID:aherbert,項目名稱:GDSC-SMLM,代碼行數:13,代碼來源:CreateFilters.java

示例7: itemStateChanged

import java.awt.Checkbox; //導入方法依賴的package包/類
public void itemStateChanged(ItemEvent e)
{
	// When the checkbox is clicked, output example compounds to the ImageJ log
	Checkbox cb = (Checkbox) e.getSource();
	if (cb.getState())
	{
		cb.setState(false);

		logExampleCompounds();
	}
}
 
開發者ID:aherbert,項目名稱:GDSC-SMLM,代碼行數:12,代碼來源:CreateData.java

示例8: projectSwitchesCreate

import java.awt.Checkbox; //導入方法依賴的package包/類
void projectSwitchesCreate() {
    projectSwitchesPanel.removeAll();
    for (Iterator i = project.getSwitches().entrySet().iterator(); i.hasNext(); ) {
        Entry e = (Entry) i.next();
        String name = (String) e.getKey();
        String setting = (String) e.getValue();
        Checkbox check = new Checkbox(name);
        //check.setFont(new Font("Monospaced", Font.PLAIN, 11));
        check.setFont(new Font("Dialog", Font.PLAIN, 12));
        check.setState(setting.equals("on") ? true : false);
        projectSwitchesPanel.add(check);
    }
}
 
開發者ID:silverslade,項目名稱:jif,代碼行數:14,代碼來源:jFrame.java

示例9: createCheckboxPanel

import java.awt.Checkbox; //導入方法依賴的package包/類
private Panel createCheckboxPanel(Checkbox checkbox, String label, boolean state)
{
	Panel panel = new Panel();
	panel.setLayout(new BorderLayout());
	Label listLabel = new Label(label, 0);
	listLabel.setFont(monoFont);
	checkbox.setState(state);
	panel.add(listLabel, BorderLayout.WEST);
	panel.add(checkbox, BorderLayout.EAST);
	return panel;
}
 
開發者ID:aherbert,項目名稱:GDSC,代碼行數:12,代碼來源:CDA_Plugin.java

示例10: activateRadioCheckbox

import java.awt.Checkbox; //導入方法依賴的package包/類
/**
 * Activates the Checkbox of a RadioButtonGroup() in a GenericDialog
 *
 * @param panel
 *            the {@link Panel} to which the RadioButtonGroup
 *            ({@link java.awt.CheckboxGroup}) was added as per
 *            {@link GenericDialog#addRadioButtonGroup}.
 * @param label
 *            the label of the Checkbox to be activated
 */
private void activateRadioCheckbox(final Panel panel, final String label) {
	final Component[] components = panel.getComponents();
	for (int i = 0; i < components.length; i++) {
		final Component c = components[i];
		if (c instanceof Checkbox) {
			final Checkbox cb = (Checkbox) c;
			if (cb.getLabel().equals(label)) {
				cb.setState(true);
				return;
			}
		}
	}
}
 
開發者ID:tferr,項目名稱:Scripts,代碼行數:24,代碼來源:InteractivePlotter.java

示例11: itemStateChanged

import java.awt.Checkbox; //導入方法依賴的package包/類
public void itemStateChanged(ItemEvent e)
{
	if (e.getSource() instanceof Checkbox)
	{
		Checkbox checkbox = (Checkbox) e.getSource();

		int failLimit;
		boolean includeNeighbours;
		double neighbourHeightThrehsold;
		boolean computeDoublets;
		MultiPathFilter myMultiFilter;

		if (checkbox.getState())
		{
			FitEngineConfiguration tmp = new FitEngineConfiguration();
			FitConfiguration tmpFitConfig = tmp.getFitConfiguration();
			tmpFitConfig.setComputeResiduals(true); // Collect residuals threshold
			if (BenchmarkFilterAnalysis.updateConfiguration(tmp, false))
			{
				failLimit = tmp.getFailuresLimit();
				includeNeighbours = tmp.isIncludeNeighbours();
				neighbourHeightThrehsold = tmp.getNeighbourHeightThreshold();
				computeDoublets = tmp.getResidualsThreshold() < 1;

				final DirectFilter primaryFilter = tmpFitConfig.getSmartFilter();
				final double residualsThreshold = tmp.getResidualsThreshold();
				myMultiFilter = new MultiPathFilter(primaryFilter, minimalFilter, residualsThreshold);
			}
			else
			{
				IJ.log("Failed to update settings using the filter analysis");
				checkbox.setState(false);
				return;
			}
		}
		else
		{
			failLimit = config.getFailuresLimit();
			includeNeighbours = config.isIncludeNeighbours();
			neighbourHeightThrehsold = config.getNeighbourHeightThreshold();
			computeDoublets = BenchmarkSpotFit.computeDoublets;
			myMultiFilter = multiFilter;
		}

		// Update the dialog
		taFilterXml.setText(myMultiFilter.toXML());
		textFailLimit.setText("" + failLimit);
		cbIncludeNeighbours.setState(includeNeighbours);
		textNeighbourHeight.setText(Utils.rounded(neighbourHeightThrehsold));
		cbComputeDoublets.setState(computeDoublets);
	}
}
 
開發者ID:aherbert,項目名稱:GDSC-SMLM,代碼行數:53,代碼來源:BenchmarkSpotFit.java

示例12: SingleFilterEdit

import java.awt.Checkbox; //導入方法依賴的package包/類
public SingleFilterEdit (MessageFilterEdit fr, ListClass f,
	SingleMessageFilter mf)
{
	super(fr, Global.resourceString("Edit_Filter"), false);
	F = f;
	MF = mf;
	MFE = fr;
	if (MF == null)
	{
		isnew = true;
		MF = new SingleMessageFilter(Global.resourceString("Name"), Global
			.resourceString("Starts_with"), Global
			.resourceString("Ends_With"),
			Global.resourceString("Contains"), false, false);
	}
	else isnew = false;
	CB = new Checkbox(Global.resourceString("Positive_Filter"));
	CB.setState(MF.Positive);
	CB.setFont(Global.SansSerif);
	add("North", CB);
	JPanel p = new MyPanel();
	p.setLayout(new GridLayout(0, 2));
	p.add(new MyLabel(Global.resourceString("Name")));
	p.add(N = new FormTextField(MF.Name));
	p.add(new MyLabel(Global.resourceString("Starts_with")));
	p.add(S = new FormTextField(MF.Start));
	p.add(new MyLabel(Global.resourceString("Ends_With")));
	p.add(E = new FormTextField(MF.End));
	p.add(new MyLabel(Global.resourceString("Contains")));
	p.add(C = new FormTextField(MF.Contains));
	p.add(new MyLabel(Global.resourceString("Block_completely")));
	p.add(BC = new Checkbox());
	BC.setState(MF.BlockComplete);
	add("Center", p);
	JPanel bp = new MyPanel();
	bp.add(new ButtonAction(this, Global.resourceString("OK")));
	bp.add(new ButtonAction(this, Global.resourceString("Cancel")));
	add("South", bp);
	Global.setpacked(this, "singlefilteredit", 300, 300);
	validate();
	show();
}
 
開發者ID:Zenigata,項目名稱:jago,代碼行數:43,代碼來源:MessageFilter.java


注:本文中的java.awt.Checkbox.setState方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。