use of javax.swing.JCheckBox in project gephi by gephi.
the class ImportCSVUIVisualPanel2 method loadNodesTableSettings.
private void loadNodesTableSettings(JPanel settingsPanel) {
//Create assignNewNodeIds checkbox and set its selection with saved preferences or true by default:
assignNewNodeIds = new JCheckBox(getMessage("ImportCSVUIVisualPanel2.nodes.assign-ids-checkbox"), NbPreferences.forModule(ImportCSVUIVisualPanel1.class).getBoolean(ASSIGN_NEW_NODES_IDS_SAVED_PREFERENCES, //False => by default update nodes instead of creating new ones
false));
settingsPanel.add(assignNewNodeIds, "wrap");
}
use of javax.swing.JCheckBox in project gephi by gephi.
the class ColumnSelectionPanel method init.
public void init(ColumnSelectionModel[] columns) {
int i = 0;
int j = 0;
int width = 1;
int rows = columns.length / width;
for (int col = 0; col < columns.length; col++) {
if (i >= rows) {
i = 0;
j++;
}
ColumnSelectionModel column = columns[col];
JCheckBox checkBox = new JCheckBox();
checkBox.setText(column.getName());
checkBox.setSelected(column.isSelected());
checkBox.setEnabled(column.isEnabled());
GridBagConstraints gridBagConstraints = new GridBagConstraints();
gridBagConstraints.gridx = j;
gridBagConstraints.gridy = i + i;
gridBagConstraints.insets = new java.awt.Insets(0, 12, 0, 12);
gridBagConstraints.anchor = GridBagConstraints.NORTHWEST;
gridBagConstraints.weightx = 1;
add(checkBox, gridBagConstraints);
checkBoxes.put(column, checkBox);
i++;
}
}
use of javax.swing.JCheckBox in project binnavi by google.
the class AtomicTypePanel method createControls.
private void createControls() {
setLayout(new BorderLayout());
final JPanel contentPanel = new JPanel();
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
add(contentPanel, BorderLayout.CENTER);
final GridBagLayout gbl_m_contentPanel = new GridBagLayout();
gbl_m_contentPanel.columnWidths = new int[] { 0, 0, 0 };
gbl_m_contentPanel.rowHeights = new int[] { 0, 0, 0, 0, 0, 0 };
gbl_m_contentPanel.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE };
gbl_m_contentPanel.rowWeights = new double[] { 0.0, 0.0, 0.0, 1.0, 0.0, Double.MIN_VALUE };
contentPanel.setLayout(gbl_m_contentPanel);
final JLabel lblNewLabel = new JLabel("Name:");
final GridBagConstraints gbc_lblNewLabel = new GridBagConstraints();
gbc_lblNewLabel.anchor = GridBagConstraints.WEST;
gbc_lblNewLabel.insets = new Insets(0, 0, 5, 5);
gbc_lblNewLabel.gridx = 0;
gbc_lblNewLabel.gridy = 0;
contentPanel.add(lblNewLabel, gbc_lblNewLabel);
name = new JTextField();
name.addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(final KeyEvent e) {
updatePreview();
}
});
final GridBagConstraints gbc_m_name = new GridBagConstraints();
gbc_m_name.insets = new Insets(0, 0, 5, 0);
gbc_m_name.fill = GridBagConstraints.HORIZONTAL;
gbc_m_name.gridx = 1;
gbc_m_name.gridy = 0;
contentPanel.add(name, gbc_m_name);
name.setColumns(10);
final JLabel lblSize = new JLabel("Size (bits):");
final GridBagConstraints gbc_lblSize = new GridBagConstraints();
gbc_lblSize.anchor = GridBagConstraints.WEST;
gbc_lblSize.insets = new Insets(0, 0, 5, 5);
gbc_lblSize.gridx = 0;
gbc_lblSize.gridy = 1;
contentPanel.add(lblSize, gbc_lblSize);
size = new JTextField();
final GridBagConstraints gbc_m_size = new GridBagConstraints();
gbc_m_size.insets = new Insets(0, 0, 5, 0);
gbc_m_size.fill = GridBagConstraints.HORIZONTAL;
gbc_m_size.gridx = 1;
gbc_m_size.gridy = 1;
contentPanel.add(size, gbc_m_size);
size.setColumns(10);
signed = new JCheckBox("Signed");
final GridBagConstraints gbc_m_signed = new GridBagConstraints();
gbc_m_signed.anchor = GridBagConstraints.WEST;
gbc_m_signed.insets = new Insets(0, 0, 5, 5);
gbc_m_signed.gridx = 0;
gbc_m_signed.gridy = 2;
contentPanel.add(signed, gbc_m_signed);
lblPreview = new JLabel("Preview:");
final GridBagConstraints gbc_lblPreview = new GridBagConstraints();
gbc_lblPreview.insets = new Insets(0, 0, 5, 5);
gbc_lblPreview.gridx = 0;
gbc_lblPreview.gridy = 3;
contentPanel.add(lblPreview, gbc_lblPreview);
preview = new JTextArea();
preview.setEditable(false);
final GridBagConstraints gbc_preview = new GridBagConstraints();
gbc_preview.insets = new Insets(0, 0, 5, 0);
gbc_preview.fill = GridBagConstraints.BOTH;
gbc_preview.gridx = 1;
gbc_preview.gridy = 3;
contentPanel.add(preview, gbc_preview);
}
use of javax.swing.JCheckBox in project binnavi by google.
the class COptionsPanel method buildRow.
/**
* Builds a single row of components in the panel.
*
* @param <T> Type of the editing component.
*
* @param panel Panel the editing component is added to.
* @param description Type description to be configured in that row.
* @param hint Hint shown as a tooltip.
* @param component The component to add to the panel.
* @param isLast True, if the component is the last component to be added to the panel.
*
* @return The panel passed to the function.
*/
private <T extends Component> T buildRow(final JPanel panel, final ITypeDescription description, final String hint, final T component, final boolean isLast) {
component.setPreferredSize(new Dimension(COLORPANEL_WIDTH, COLORPANEL_HEIGHT));
final JPanel rowPanel = new JPanel(new BorderLayout());
rowPanel.setBorder(new EmptyBorder(0, 2, isLast ? 2 : 0, 2));
final JPanel innerPanel = new JPanel(new GridLayout(1, 2));
innerPanel.add(new JCheckBox(new CheckboxAction(description, description.getDescription() + ":")), BorderLayout.CENTER);
innerPanel.add(CHintCreator.createHintPanel(component, hint), BorderLayout.EAST);
rowPanel.add(innerPanel, BorderLayout.WEST);
panel.add(rowPanel);
return component;
}
use of javax.swing.JCheckBox in project zaproxy by zaproxy.
the class OptionsApiPanel method getEnableJSONP.
private JCheckBox getEnableJSONP() {
if (enableJSONP == null) {
enableJSONP = new JCheckBox();
enableJSONP.setText(Constant.messages.getString("api.options.enableJSONP"));
enableJSONP.setVerticalAlignment(javax.swing.SwingConstants.TOP);
enableJSONP.setVerticalTextPosition(javax.swing.SwingConstants.TOP);
}
return enableJSONP;
}
Aggregations