use of javax.swing.ButtonGroup in project voltdb by VoltDB.
the class DatabaseManagerSwing method updateSchemaList.
private void updateSchemaList() {
ButtonGroup group = new ButtonGroup();
ArrayList list = new ArrayList();
ResultSet result = null;
try {
result = dMeta.getSchemas();
if (result == null) {
throw new SQLException("Failed to get metadata from database");
}
while (result.next()) {
list.add(result.getString(1));
}
} catch (SQLException se) {
CommonSwing.errorMessage(se);
} finally {
if (result != null) {
try {
result.close();
} catch (SQLException se) {
}
}
}
mnuSchemas.removeAll();
rbAllSchemas.setSelected(schemaFilter == null);
group.add(rbAllSchemas);
mnuSchemas.add(rbAllSchemas);
String s;
JRadioButtonMenuItem radioButton;
for (int i = 0; i < list.size(); i++) {
s = (String) list.get(i);
radioButton = new JRadioButtonMenuItem(s);
group.add(radioButton);
mnuSchemas.add(radioButton);
radioButton.setSelected(schemaFilter != null && schemaFilter.equals(s));
radioButton.addActionListener(schemaListListener);
radioButton.setEnabled(list.size() > 1);
}
mnuSchemas.addSeparator();
mnuSchemas.add(mitemUpdateSchemas);
}
use of javax.swing.ButtonGroup in project EnrichmentMapApp by BaderLab.
the class PostAnalysisWeightPanel method createHypergeomPanel.
private JPanel createHypergeomPanel() {
ActionListener universeSelectActionListener = e -> {
boolean enable = e.getActionCommand().equals("User Defined");
universeSelectionTextField.setEnabled(enable);
};
gmtRadioButton = new JRadioButton();
gmtRadioButton.setActionCommand("GMT");
gmtRadioButton.addActionListener(universeSelectActionListener);
gmtRadioButton.setSelected(true);
expressionSetRadioButton = new JRadioButton();
expressionSetRadioButton.setActionCommand("Expression Set");
expressionSetRadioButton.addActionListener(universeSelectActionListener);
intersectionRadioButton = new JRadioButton();
intersectionRadioButton.setActionCommand("Intersection");
intersectionRadioButton.addActionListener(universeSelectActionListener);
userDefinedRadioButton = new JRadioButton("User Defined:");
userDefinedRadioButton.setActionCommand("User Defined");
userDefinedRadioButton.addActionListener(universeSelectActionListener);
ButtonGroup buttonGroup = new ButtonGroup();
buttonGroup.add(gmtRadioButton);
buttonGroup.add(expressionSetRadioButton);
buttonGroup.add(intersectionRadioButton);
buttonGroup.add(userDefinedRadioButton);
DecimalFormat intFormat = new DecimalFormat();
intFormat.setParseIntegerOnly(true);
universeSelectionTextField = new JFormattedTextField(intFormat);
universeSelectionTextField.addPropertyChangeListener("value", e -> {
Number val = (Number) universeSelectionTextField.getValue();
if (val == null || val.intValue() < 0) {
universeSelectionTextField.setValue(1);
CySwingApplication application = serviceRegistrar.getService(CySwingApplication.class);
JOptionPane.showMessageDialog(application.getJFrame(), "Universe value must be greater than zero", "Parameter out of bounds", JOptionPane.WARNING_MESSAGE);
}
});
universeSelectionTextField.setEnabled(false);
gmtRadioButton.setText("GMT");
expressionSetRadioButton.setText("Expression Set");
intersectionRadioButton.setText("Intersection");
universeSelectionTextField.setValue(0);
makeSmall(gmtRadioButton, expressionSetRadioButton, intersectionRadioButton, userDefinedRadioButton, universeSelectionTextField);
JPanel panel = new JPanel();
panel.setBorder(LookAndFeelUtil.createTitledBorder("Advanced Hypergeometric Universe"));
final GroupLayout layout = new GroupLayout(panel);
panel.setLayout(layout);
layout.setAutoCreateContainerGaps(true);
layout.setAutoCreateGaps(!LookAndFeelUtil.isAquaLAF());
layout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING, true).addComponent(gmtRadioButton).addComponent(expressionSetRadioButton).addComponent(intersectionRadioButton).addGroup(layout.createSequentialGroup().addComponent(userDefinedRadioButton, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addPreferredGap(ComponentPlacement.RELATED).addComponent(universeSelectionTextField, DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE)));
layout.setVerticalGroup(layout.createSequentialGroup().addComponent(gmtRadioButton, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addComponent(expressionSetRadioButton, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addComponent(intersectionRadioButton, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addGroup(layout.createParallelGroup(Alignment.CENTER, false).addComponent(userDefinedRadioButton, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addComponent(universeSelectionTextField, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE)));
if (LookAndFeelUtil.isAquaLAF())
panel.setOpaque(false);
return panel;
}
use of javax.swing.ButtonGroup in project EnrichmentMapApp by BaderLab.
the class PostAnalysisInputPanel method createAnalysisTypePanel.
/**
* Creates a JPanel containing scope radio buttons
*/
private JPanel createAnalysisTypePanel() {
makeSmall(getKnownSignatureRadio(), getSignatureDiscoveryRadio());
ButtonGroup analysisOptions = new ButtonGroup();
analysisOptions.add(getKnownSignatureRadio());
analysisOptions.add(getSignatureDiscoveryRadio());
JPanel panel = new JPanel();
panel.setBorder(LookAndFeelUtil.createTitledBorder("Post Analysis Type"));
final GroupLayout layout = new GroupLayout(panel);
panel.setLayout(layout);
layout.setAutoCreateContainerGaps(true);
layout.setAutoCreateGaps(true);
layout.setHorizontalGroup(layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE).addComponent(getKnownSignatureRadio()).addComponent(getSignatureDiscoveryRadio()).addGap(0, 0, Short.MAX_VALUE));
layout.setVerticalGroup(layout.createParallelGroup(Alignment.CENTER, true).addComponent(getKnownSignatureRadio(), PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addComponent(getSignatureDiscoveryRadio(), PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE));
if (LookAndFeelUtil.isAquaLAF())
panel.setOpaque(false);
return panel;
}
use of javax.swing.ButtonGroup in project ACS by ACS-Community.
the class LogMenuBar method setupMenuBar.
/**
* Builds the menu bar
*/
private void setupMenuBar() {
// Add the File menu
fileMenu = new javax.swing.JMenu();
fileMenu.setName("FileMenu");
fileMenu.setText("File");
fileMenu.add(getConnectMenuItem());
fileMenu.add(getAutoReconnectMenuItem());
fileMenu.addSeparator();
fileMenu.add(getLoadMenuItem());
fileMenu.add(getLoadURLMenuItem());
fileMenu.add(getLoadDBMenuItem());
fileMenu.add(getSaveFileMenuItem());
fileMenu.add(getClearLogsMenuItem());
//fileMenu.addSeparator();
fileMenu.add(exitSeparator);
fileMenu.add(getExitMenuItem());
add(fileMenu);
// Add the View Menu
viewMenu = new javax.swing.JMenu();
viewMenu.setName("ViewMenu");
viewMenu.setText("View");
viewMenu.add(getViewToolbarMenuItem());
viewMenu.add(getViewDetailedInfoMenuItem());
viewMenu.add(getViewStatusAreaMenuItem());
viewMenu.addSeparator();
viewMenu.add(getFieldsMenuItem());
viewMenu.add(getShortDateViewMenuItem());
viewMenu.add(getLogTypeDescriptionViewMenuItem());
viewMenu.addSeparator();
viewMenu.add(getFiltersMenuItem());
viewMenu.add(getViewErrorBrowserMenuItem());
viewMenu.addSeparator();
viewMenu.add(getStatisticsMenuItem());
viewMenu.add(getViewErrorLogMenuItem());
add(viewMenu);
// Add the Search Menu
add(getSearchMenu());
// Add the zoom menu
add(getZoomMenu());
// Add the expert menu
expertMenu = new JMenu();
expertMenu.setName("ExpertMenu");
expertMenu.setText("Expert");
JMenu modeMenu = new JMenu("Mode");
expertMenu.add(modeMenu);
modeMenu.add(getOperatorMode());
modeMenu.add(getEngineeringMode());
modeMenu.add(getSciLogMode());
ButtonGroup group = new ButtonGroup();
group.add(getOperatorMode());
group.add(getEngineeringMode());
group.add(getSciLogMode());
expertMenu.addSeparator();
expertMenu.add(getSuspendMenuItem());
expertMenu.add(getPrefsMenuItem());
expertMenu.add(getEngineFiltersMenuItem());
add(expertMenu);
}
use of javax.swing.ButtonGroup in project nhin-d by DirectProject.
the class ViewTrustBundle method addComponentsToPane.
/**
* Set the orientation of the components inside the pane.
* @param pane Accept the container pane and set its orientation.
* @return void
*/
public static void addComponentsToPane(Container pane) {
if (RIGHT_TO_LEFT) {
pane.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
}
pane.setLayout(new GridBagLayout());
ComponentCreation creation = new ComponentCreation();
/**
* Below block create the screen by using the ComponentCreation class and its method to create components.
* The componentCreation class has various methods exposed which will take the pane and type of component with its position.
* Radio, label, File, Directory etc are different type of pane can be created using the class.
*/
GridBagConstraints c = new GridBagConstraints();
c.anchor = (c.gridx == 0) ? GridBagConstraints.EAST : GridBagConstraints.WEST;
c.weighty = 1.5;
c.weightx = 0.5;
ButtonGroup myButtonGroup = new ButtonGroup();
creation.createComponent("RADIO", " Create Unsigned Trust Bundle", false, c, pane, myButtonGroup, 0, 0);
creation.createComponent("RADIO", " Create Signed Trust Bundle", false, c, pane, myButtonGroup, 1, 0);
creation.createComponent("RADIO", " View Trust Bundle", true, c, pane, myButtonGroup, 2, 0);
creation.createComponent("LABEL", " Trust Bundle", false, c, pane, null, 0, 1);
creation.createBrowseFile("FILE", "Select Trust Bundle File", c, pane, 1, 1);
creation.createComponent("BUTTON", "View Bundle", false, c, pane, null, 1, 5);
c.fill = GridBagConstraints.NONE;
creation.createComponent("LABEL", " Feedback:", false, c, pane, null, 0, 6);
creation.createComponent("TEXTPANE", "", false, c, pane, null, 1, 6);
}
Aggregations