use of java.awt.Checkbox in project voltdb by VoltDB.
the class ZaurusEditor method initGUI.
private void initGUI() {
// without connection there are no tables
// vAllTables is a local variable with all table names in the database
// vHoldTableNames holds the table names which have a ZaurusTableForm
Vector vAllTables = getAllTables();
if (vAllTables == null) {
return;
}
// initialize a new list for the table names which have a form in pForm
vHoldTableNames = new Vector(20);
vHoldForms = new Vector(20);
// this holds the card panel pForm for the forms in the top
// a card panel pButton below
// the both card panels form a panel which is centered in this
// and a status line in the south
this.setLayout(new BorderLayout(3, 3));
// >>> the top of this: the entry forms in pForm
// pFormButs holds in the center the forms card panel pForm and
// in the south the button card panel pButton
Panel pFormButs = new Panel();
pFormButs.setLayout(new BorderLayout(3, 3));
pForm = new Panel();
lForm = new CardLayout(2, 2);
pForm.setLayout(lForm);
// the search panel containing the list of all tables and
// the entry fields for search words in the Center
Panel pEntry = new Panel();
pEntry.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.HORIZONTAL;
c.insets = new Insets(3, 3, 3, 3);
c.gridwidth = 1;
c.gridheight = 1;
c.weightx = c.weighty = 1;
c.anchor = GridBagConstraints.WEST;
c.gridy = 0;
c.gridx = 0;
pEntry.add(new Label("Search table"), c);
c.gridx = 1;
// get all table names and show a drop down list of them in cTables
cTables = new Choice();
for (Enumeration e = vAllTables.elements(); e.hasMoreElements(); ) {
cTables.addItem((String) e.nextElement());
}
c.gridwidth = 2;
pEntry.add(cTables, c);
c.gridy = 1;
c.gridx = 0;
c.gridwidth = 1;
pEntry.add(new Label("Search words"), c);
c.gridx = 1;
c.gridwidth = 2;
fSearchWords = new TextField(8);
pEntry.add(fSearchWords, c);
// use search words
c.gridwidth = 1;
c.gridy = 2;
c.gridx = 0;
pEntry.add(new Label("Use search words"), c);
gAllWords = new CheckboxGroup();
Checkbox[] checkboxes = new Checkbox[2];
checkboxes[0] = new Checkbox("all", gAllWords, true);
c.gridx = 1;
pEntry.add(checkboxes[0], c);
checkboxes[1] = new Checkbox("any ", gAllWords, false);
c.gridx = 2;
pEntry.add(checkboxes[1], c);
// ignore case
c.gridy = 3;
c.gridx = 0;
pEntry.add(new Label("Ignore case"), c);
gIgnoreCase = new CheckboxGroup();
Checkbox[] checkboxes1 = new Checkbox[2];
checkboxes1[0] = new Checkbox("yes", gIgnoreCase, true);
c.gridx = 1;
pEntry.add(checkboxes1[0], c);
checkboxes1[1] = new Checkbox("no", gIgnoreCase, false);
c.gridx = 2;
pEntry.add(checkboxes1[1], c);
// Match column exactly
c.gridy = 4;
c.gridx = 0;
pEntry.add(new Label("Match whole col"), c);
gNoMatchWhole = new CheckboxGroup();
Checkbox[] checkboxes2 = new Checkbox[2];
checkboxes2[0] = new Checkbox("no", gNoMatchWhole, true);
c.gridx = 1;
pEntry.add(checkboxes2[0], c);
checkboxes2[1] = new Checkbox("yes ", gNoMatchWhole, false);
c.gridx = 2;
pEntry.add(checkboxes2[1], c);
pForm.add("search", pEntry);
pFormButs.add("Center", pForm);
// the buttons
this.initButtons();
pButton = new Panel();
lButton = new CardLayout(2, 2);
pButton.setLayout(lButton);
pButton.add("search", pSearchButs);
pButton.add("edit", pEditButs);
pButton.add("insert", pInsertButs);
pFormButs.add("South", pButton);
this.add("Center", pFormButs);
// >>> the South: status line at the bottom
Font fFont = new Font("Dialog", Font.PLAIN, 10);
ZaurusEditor.tStatus = new TextField("");
ZaurusEditor.tStatus.setEditable(false);
this.add("South", ZaurusEditor.tStatus);
}
use of java.awt.Checkbox in project jdk8u_jdk by JetBrains.
the class DimensionEncapsulation method run.
@Override
public void run() {
runTest(new Panel());
runTest(new Button());
runTest(new Checkbox());
runTest(new Canvas());
runTest(new Choice());
runTest(new Label());
runTest(new Scrollbar());
runTest(new TextArea());
runTest(new TextField());
runTest(new Dialog(new JFrame()));
runTest(new Frame());
runTest(new Window(new JFrame()));
runTest(new FileDialog(new JFrame()));
runTest(new List());
runTest(new ScrollPane());
runTest(new JFrame());
runTest(new JDialog(new JFrame()));
runTest(new JWindow(new JFrame()));
runTest(new JLabel("hi"));
runTest(new JMenu());
runTest(new JTree());
runTest(new JTable());
runTest(new JMenuItem());
runTest(new JCheckBoxMenuItem());
runTest(new JToggleButton());
runTest(new JSpinner());
runTest(new JSlider());
runTest(Box.createVerticalBox());
runTest(Box.createHorizontalBox());
runTest(new JTextField());
runTest(new JTextArea());
runTest(new JTextPane());
runTest(new JPasswordField());
runTest(new JFormattedTextField());
runTest(new JEditorPane());
runTest(new JButton());
runTest(new JColorChooser());
runTest(new JFileChooser());
runTest(new JCheckBox());
runTest(new JInternalFrame());
runTest(new JDesktopPane());
runTest(new JTableHeader());
runTest(new JLayeredPane());
runTest(new JRootPane());
runTest(new JMenuBar());
runTest(new JOptionPane());
runTest(new JRadioButton());
runTest(new JRadioButtonMenuItem());
runTest(new JPopupMenu());
//runTest(new JScrollBar()); --> don't test defines max and min in
// terms of preferred
runTest(new JScrollPane());
runTest(new JViewport());
runTest(new JSplitPane());
runTest(new JTabbedPane());
runTest(new JToolBar());
runTest(new JSeparator());
runTest(new JProgressBar());
if (!failures.isEmpty()) {
System.out.println("These classes failed");
for (final Component failure : failures) {
System.out.println(failure.getClass());
}
throw new RuntimeException("Test failed");
}
}
use of java.awt.Checkbox in project GDSC-SMLM by aherbert.
the class DoubletAnalysis method itemStateChanged.
/*
* (non-Javadoc)
*
* @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
*/
public void itemStateChanged(ItemEvent e) {
if (e.getSource() instanceof Choice) {
// Update the settings from the template
Choice choice = (Choice) e.getSource();
String templateName = choice.getSelectedItem();
// Get the configuration template
GlobalSettings template = ConfigurationTemplate.getTemplate(templateName);
if (textCoordinateShiftFactor != null) {
if (template != null) {
if (template.isFitEngineConfiguration()) {
FitConfiguration fitConfig = template.getFitEngineConfiguration().getFitConfiguration();
cbSmartFilter.setState(fitConfig.isSmartFilter());
textCoordinateShiftFactor.setText("" + fitConfig.getCoordinateShiftFactor());
textSignalStrength.setText("" + fitConfig.getSignalStrength());
textMinPhotons.setText("" + fitConfig.getMinPhotons());
textMinWidthFactor.setText("" + fitConfig.getMinWidthFactor());
textWidthFactor.setText("" + fitConfig.getWidthFactor());
textPrecisionThreshold.setText("" + fitConfig.getPrecisionThreshold());
cbLocalBackground.setState(fitConfig.isPrecisionUsingBackground());
}
} else {
// Reset
cbSmartFilter.setState(false);
textCoordinateShiftFactor.setText("0");
textSignalStrength.setText("0");
textMinPhotons.setText("0");
textMinWidthFactor.setText("0");
textWidthFactor.setText("0");
textPrecisionThreshold.setText("0");
cbLocalBackground.setState(false);
}
} else {
if (template != null) {
if (template.isFitEngineConfiguration()) {
boolean custom = ConfigurationTemplate.isCustomTemplate(templateName);
FitEngineConfiguration config2 = template.getFitEngineConfiguration();
FitConfiguration fitConfig2 = config2.getFitConfiguration();
if (custom && fitConfig2.getInitialPeakStdDev0() > 0)
textInitialPeakStdDev0.setText("" + fitConfig2.getInitialPeakStdDev0());
textDataFilterType.select(config2.getDataFilterType().ordinal());
textDataFilter.select(config2.getDataFilter(0).ordinal());
textSmooth.setText("" + config2.getSmooth(0));
textSearch.setText("" + config2.getSearch());
textBorder.setText("" + config2.getBorder());
textFitting.setText("" + config2.getFitting());
textFitSolver.select(fitConfig2.getFitSolver().ordinal());
textFitFunction.select(fitConfig2.getFitFunction().ordinal());
// Copy settings not in the dialog for the fit solver
fitConfig.setMaxIterations(fitConfig2.getMaxIterations());
fitConfig.setMaxFunctionEvaluations(fitConfig2.getMaxFunctionEvaluations());
// MLE settings
fitConfig.setModelCamera(fitConfig2.isModelCamera());
fitConfig.setSearchMethod(fitConfig2.getSearchMethod());
fitConfig.setRelativeThreshold(fitConfig2.getRelativeThreshold());
fitConfig.setAbsoluteThreshold(fitConfig2.getAbsoluteThreshold());
fitConfig.setGradientLineMinimisation(fitConfig2.isGradientLineMinimisation());
// LSE settings
fitConfig.setFitCriteria(fitConfig2.getFitCriteria());
fitConfig.setSignificantDigits(fitConfig2.getSignificantDigits());
fitConfig.setDelta(fitConfig2.getDelta());
fitConfig.setLambda(fitConfig2.getLambda());
}
} else {
// Ignore
}
}
} else if (e.getSource() instanceof Checkbox) {
Checkbox checkbox = (Checkbox) e.getSource();
if (!checkbox.getState())
return;
if (textCoordinateShiftFactor != null) {
if (!updateFilterConfiguration(filterFitConfig))
return;
cbSmartFilter.setState(filterFitConfig.isSmartFilter());
textCoordinateShiftFactor.setText("" + filterFitConfig.getCoordinateShiftFactor());
textSignalStrength.setText("" + filterFitConfig.getSignalStrength());
textMinPhotons.setText("" + filterFitConfig.getMinPhotons());
textMinWidthFactor.setText("" + filterFitConfig.getMinWidthFactor());
textWidthFactor.setText("" + filterFitConfig.getWidthFactor());
textPrecisionThreshold.setText("" + filterFitConfig.getPrecisionThreshold());
cbLocalBackground.setState(filterFitConfig.isPrecisionUsingBackground());
} else {
if (!updateFitConfiguration(config))
return;
textInitialPeakStdDev0.setText("" + fitConfig.getInitialPeakStdDev0());
textDataFilterType.select(config.getDataFilterType().ordinal());
textDataFilter.select(config.getDataFilter(0).ordinal());
textSmooth.setText("" + config.getSmooth(0));
textSearch.setText("" + config.getSearch());
textBorder.setText("" + config.getBorder());
textFitting.setText("" + config.getFitting());
textFitSolver.select(fitConfig.getFitSolver().ordinal());
textFitFunction.select(fitConfig.getFitFunction().ordinal());
textMatchDistance.setText("" + matchDistance);
textLowerDistance.setText("" + lowerDistance);
textSignalFactor.setText("" + signalFactor);
textLowerFactor.setText("" + lowerSignalFactor);
}
}
}
use of java.awt.Checkbox in project GDSC-SMLM by aherbert.
the class CreateData method itemStateChanged.
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();
}
}
use of java.awt.Checkbox in project GDSC-SMLM by aherbert.
the class CreateFilters method itemStateChanged.
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();
}
}
Aggregations