本文整理汇总了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);
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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();
}
}
示例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();
}
}
示例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);
}
}
示例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;
}
示例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;
}
}
}
}
示例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);
}
}
示例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();
}