use of javax.swing.border.EtchedBorder in project keystore-explorer by kaikramer.
the class DSubjectKeyIdentifier method initComponents.
private void initComponents() {
jlKeyIdentifier = new JLabel(res.getString("DSubjectKeyIdentifier.jlKeyIdentifer.text"));
jkiKeyIdentifier = new JKeyIdentifier(res.getString("DSubjectKeyIdentifier.KeyIdentifier.Title"), subjectPublicKey);
jpSubjectKeyIdentifier = new JPanel(new BorderLayout(5, 5));
jpSubjectKeyIdentifier.setBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new CompoundBorder(new EtchedBorder(), new EmptyBorder(5, 5, 5, 5))));
jpSubjectKeyIdentifier.add(jlKeyIdentifier, BorderLayout.WEST);
jpSubjectKeyIdentifier.add(jkiKeyIdentifier, BorderLayout.CENTER);
jbOK = new JButton(res.getString("DSubjectKeyIdentifier.jbOK.text"));
jbOK.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
okPressed();
}
});
jbCancel = new JButton(res.getString("DSubjectKeyIdentifier.jbCancel.text"));
jbCancel.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
cancelPressed();
}
});
jbCancel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), CANCEL_KEY);
jbCancel.getActionMap().put(CANCEL_KEY, new AbstractAction() {
private static final long serialVersionUID = 1L;
@Override
public void actionPerformed(ActionEvent evt) {
cancelPressed();
}
});
jpButtons = PlatformUtil.createDialogButtonPanel(jbOK, jbCancel, false);
getContentPane().setLayout(new BorderLayout());
getContentPane().add(jpSubjectKeyIdentifier, BorderLayout.CENTER);
getContentPane().add(jpButtons, BorderLayout.SOUTH);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent evt) {
closeDialog();
}
});
setResizable(false);
getRootPane().setDefaultButton(jbOK);
pack();
}
use of javax.swing.border.EtchedBorder in project keystore-explorer by kaikramer.
the class DViewExtensions method initComponents.
private void initComponents() {
ExtensionsTableModel extensionsTableModel = new ExtensionsTableModel();
jtExtensions = new JKseTable(extensionsTableModel);
TableRowSorter<TableModel> sorter = new TableRowSorter<TableModel>(extensionsTableModel);
sorter.setComparator(2, new ObjectIdComparator());
jtExtensions.setRowSorter(sorter);
jtExtensions.setShowGrid(false);
jtExtensions.setRowMargin(0);
jtExtensions.getColumnModel().setColumnMargin(0);
jtExtensions.getTableHeader().setReorderingAllowed(false);
jtExtensions.setAutoResizeMode(JKseTable.AUTO_RESIZE_ALL_COLUMNS);
jtExtensions.setRowHeight(Math.max(18, jtExtensions.getRowHeight()));
for (int i = 0; i < jtExtensions.getColumnCount(); i++) {
TableColumn column = jtExtensions.getColumnModel().getColumn(i);
column.setHeaderRenderer(new ExtensionsTableHeadRend(jtExtensions.getTableHeader().getDefaultRenderer()));
column.setCellRenderer(new ExtensionsTableCellRend());
}
TableColumn criticalCol = jtExtensions.getColumnModel().getColumn(0);
criticalCol.setResizable(false);
criticalCol.setMinWidth(28);
criticalCol.setMaxWidth(28);
criticalCol.setPreferredWidth(28);
ListSelectionModel selectionModel = jtExtensions.getSelectionModel();
selectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
selectionModel.addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent evt) {
if (!evt.getValueIsAdjusting()) {
try {
CursorUtil.setCursorBusy(DViewExtensions.this);
updateExtensionValue();
} finally {
CursorUtil.setCursorFree(DViewExtensions.this);
}
}
}
});
jspExtensionsTable = PlatformUtil.createScrollPane(jtExtensions, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
jspExtensionsTable.getViewport().setBackground(jtExtensions.getBackground());
jpExtensionsTable = new JPanel(new BorderLayout(5, 5));
jpExtensionsTable.setPreferredSize(new Dimension(500, 200));
jpExtensionsTable.add(jspExtensionsTable, BorderLayout.CENTER);
jpExtensionValue = new JPanel(new BorderLayout(5, 5));
jlExtensionValue = new JLabel(res.getString("DViewExtensions.jlExtensionValue.text"));
jpExtensionValue.add(jlExtensionValue, BorderLayout.NORTH);
jepExtensionValue = new JEditorPane();
jepExtensionValue.setFont(new Font(Font.MONOSPACED, Font.PLAIN, LnfUtil.getDefaultFontSize()));
jepExtensionValue.setEditable(false);
jepExtensionValue.setToolTipText(res.getString("DViewExtensions.jtaExtensionValue.tooltip"));
// JGoodies - keep uneditable color same as editable
jepExtensionValue.putClientProperty("JTextArea.infoBackground", Boolean.TRUE);
// for displaying URLs in extensions as clickable links
jepExtensionValue.setContentType("text/html");
jepExtensionValue.addHyperlinkListener(this);
// use default font and foreground color from the component
jepExtensionValue.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE);
jspExtensionValue = PlatformUtil.createScrollPane(jepExtensionValue, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
jpExtensionValueTextArea = new JPanel(new BorderLayout(5, 5));
jpExtensionValueTextArea.setPreferredSize(new Dimension(500, 200));
jpExtensionValueTextArea.add(jspExtensionValue, BorderLayout.CENTER);
jpExtensionValue.add(jpExtensionValueTextArea, BorderLayout.CENTER);
jbAsn1 = new JButton(res.getString("DViewExtensions.jbAsn1.text"));
PlatformUtil.setMnemonic(jbAsn1, res.getString("DViewExtensions.jbAsn1.mnemonic").charAt(0));
jbAsn1.setToolTipText(res.getString("DViewExtensions.jbAsn1.tooltip"));
jbAsn1.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
try {
CursorUtil.setCursorBusy(DViewExtensions.this);
asn1DumpPressed();
} finally {
CursorUtil.setCursorFree(DViewExtensions.this);
}
}
});
jpExtensionValueAsn1 = new JPanel(new FlowLayout(FlowLayout.RIGHT));
jpExtensionValueAsn1.add(jbAsn1);
jpExtensionValue.add(jpExtensionValueAsn1, BorderLayout.SOUTH);
jpExtensions = new JPanel(new GridLayout(2, 1, 5, 5));
jpExtensions.setBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new CompoundBorder(new EtchedBorder(), new EmptyBorder(5, 5, 5, 5))));
jpExtensions.add(jpExtensionsTable);
jpExtensions.add(jpExtensionValue);
jbOK = new JButton(res.getString("DViewExtensions.jbOK.text"));
jbOK.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
okPressed();
}
});
jpOK = PlatformUtil.createDialogButtonPanel(jbOK, false);
extensionsTableModel.load(extensions);
if (extensionsTableModel.getRowCount() > 0) {
jtExtensions.changeSelection(0, 0, false, false);
}
getContentPane().add(jpExtensions, BorderLayout.CENTER);
getContentPane().add(jpOK, BorderLayout.SOUTH);
setResizable(false);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent evt) {
closeDialog();
}
});
getRootPane().setDefaultButton(jbOK);
pack();
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
jbOK.requestFocus();
}
});
}
use of javax.swing.border.EtchedBorder in project keystore-explorer by kaikramer.
the class DExportKeyPair method initComponents.
private void initComponents() {
GridBagConstraints gbcLbl = new GridBagConstraints();
gbcLbl.gridx = 0;
gbcLbl.gridwidth = 3;
gbcLbl.gridheight = 1;
gbcLbl.insets = new Insets(5, 5, 5, 5);
gbcLbl.anchor = GridBagConstraints.EAST;
GridBagConstraints gbcEdCtrl = new GridBagConstraints();
gbcEdCtrl.gridx = 3;
gbcEdCtrl.gridwidth = 3;
gbcEdCtrl.gridheight = 1;
gbcEdCtrl.insets = new Insets(5, 5, 5, 5);
gbcEdCtrl.anchor = GridBagConstraints.WEST;
jlPassword = new JLabel(res.getString("DExportKeyPair.jlPassword.text"));
GridBagConstraints gbc_jlPassword = (GridBagConstraints) gbcLbl.clone();
gbc_jlPassword.gridy = 0;
if (passwordQualityConfig.getEnabled()) {
if (passwordQualityConfig.getEnforced()) {
jpfPassword = new JPasswordQualityField(15, passwordQualityConfig.getMinimumQuality());
} else {
jpfPassword = new JPasswordQualityField(15);
}
} else {
jpfPassword = new JPasswordField(15);
}
jpfPassword.setToolTipText(res.getString("DExportKeyPair.jpqfPassword.tooltip"));
GridBagConstraints gbc_jpfPassword = (GridBagConstraints) gbcEdCtrl.clone();
gbc_jpfPassword.gridy = 0;
jlConfirmPassword = new JLabel(res.getString("DExportKeyPair.jlConfirmPassword.text"));
GridBagConstraints gbc_jlConfirmPassword = (GridBagConstraints) gbcLbl.clone();
gbc_jlConfirmPassword.gridy = 1;
jpfConfirmPassword = new JPasswordField(15);
jpfConfirmPassword.setToolTipText(res.getString("DExportKeyPair.jpfConfirmPassword.tooltip"));
GridBagConstraints gbc_jpfConfirmPassword = (GridBagConstraints) gbcEdCtrl.clone();
gbc_jpfConfirmPassword.gridy = 1;
jlExportFile = new JLabel(res.getString("DExportKeyPair.jlExportFile.text"));
GridBagConstraints gbc_jlExportFile = (GridBagConstraints) gbcLbl.clone();
gbc_jlExportFile.gridy = 2;
jtfExportFile = new JTextField(30);
jtfExportFile.setToolTipText(res.getString("DExportKeyPair.jtfExportFile.tooltip"));
GridBagConstraints gbc_jtfExportFile = (GridBagConstraints) gbcEdCtrl.clone();
gbc_jtfExportFile.gridy = 2;
gbc_jtfExportFile.gridwidth = 6;
jbBrowse = new JButton(res.getString("DExportKeyPair.jbBrowse.text"));
jbBrowse.setToolTipText(res.getString("DExportKeyPair.jbBrowse.tooltip"));
PlatformUtil.setMnemonic(jbBrowse, res.getString("DExportKeyPair.jbBrowse.mnemonic").charAt(0));
GridBagConstraints gbc_jbBrowse = (GridBagConstraints) gbcEdCtrl.clone();
gbc_jbBrowse.gridy = 2;
gbc_jbBrowse.gridx = 9;
jbBrowse.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
try {
CursorUtil.setCursorBusy(DExportKeyPair.this);
browsePressed();
} finally {
CursorUtil.setCursorFree(DExportKeyPair.this);
}
}
});
jpOptions = new JPanel(new GridBagLayout());
jpOptions.setBorder(new CompoundBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new EtchedBorder()), new EmptyBorder(5, 5, 5, 5)));
jpOptions.add(jlPassword, gbc_jlPassword);
jpOptions.add(jpfPassword, gbc_jpfPassword);
jpOptions.add(jlConfirmPassword, gbc_jlConfirmPassword);
jpOptions.add(jpfConfirmPassword, gbc_jpfConfirmPassword);
jpOptions.add(jlExportFile, gbc_jlExportFile);
jpOptions.add(jtfExportFile, gbc_jtfExportFile);
jpOptions.add(jbBrowse, gbc_jbBrowse);
jbExport = new JButton(res.getString("DExportKeyPair.jbExport.text"));
PlatformUtil.setMnemonic(jbExport, res.getString("DExportKeyPair.jbExport.mnemonic").charAt(0));
jbExport.setToolTipText(res.getString("DExportKeyPair.jbExport.tooltip"));
jbExport.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
try {
CursorUtil.setCursorBusy(DExportKeyPair.this);
exportPressed();
} finally {
CursorUtil.setCursorFree(DExportKeyPair.this);
}
}
});
jbCancel = new JButton(res.getString("DExportKeyPair.jbCancel.text"));
jbCancel.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
cancelPressed();
}
});
jbCancel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), CANCEL_KEY);
jbCancel.getActionMap().put(CANCEL_KEY, new AbstractAction() {
private static final long serialVersionUID = 1L;
@Override
public void actionPerformed(ActionEvent evt) {
cancelPressed();
}
});
jpButtons = PlatformUtil.createDialogButtonPanel(jbExport, jbCancel, false);
getContentPane().setLayout(new BorderLayout());
getContentPane().add(jpOptions, BorderLayout.CENTER);
getContentPane().add(jpButtons, BorderLayout.SOUTH);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent evt) {
closeDialog();
}
});
setTitle(MessageFormat.format(res.getString("DExportKeyPair.Title"), entryAlias));
setResizable(false);
getRootPane().setDefaultButton(jbExport);
populateExportFileName();
pack();
}
use of javax.swing.border.EtchedBorder in project keystore-explorer by kaikramer.
the class DNetscapeBaseUrl method initComponents.
private void initComponents() {
jlNetscapeBaseUrl = new JLabel(res.getString("DNetscapeBaseUrl.jlNetscapeBaseUrl.text"));
jtfNetscapeBaseUrl = new JTextField(40);
jpNetscapeBaseUrl = new JPanel(new BorderLayout(5, 5));
jpNetscapeBaseUrl.setBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new CompoundBorder(new EtchedBorder(), new EmptyBorder(5, 5, 5, 5))));
jpNetscapeBaseUrl.add(jlNetscapeBaseUrl, BorderLayout.NORTH);
jpNetscapeBaseUrl.add(jtfNetscapeBaseUrl, BorderLayout.CENTER);
jbOK = new JButton(res.getString("DNetscapeBaseUrl.jbOK.text"));
jbOK.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
okPressed();
}
});
jbCancel = new JButton(res.getString("DNetscapeBaseUrl.jbCancel.text"));
jbCancel.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
cancelPressed();
}
});
jbCancel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), CANCEL_KEY);
jbCancel.getActionMap().put(CANCEL_KEY, new AbstractAction() {
private static final long serialVersionUID = 1L;
@Override
public void actionPerformed(ActionEvent evt) {
cancelPressed();
}
});
jpButtons = PlatformUtil.createDialogButtonPanel(jbOK, jbCancel, false);
getContentPane().setLayout(new BorderLayout());
getContentPane().add(jpNetscapeBaseUrl, BorderLayout.CENTER);
getContentPane().add(jpButtons, BorderLayout.SOUTH);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent evt) {
closeDialog();
}
});
setResizable(false);
getRootPane().setDefaultButton(jbOK);
pack();
}
use of javax.swing.border.EtchedBorder in project vcell by virtualcell.
the class StochSimOptionsPanel method initialize.
private void initialize() {
try {
getContentPanel().setLayout(new java.awt.GridBagLayout());
// 1
// JPanel trialPanel = new JPanel(new GridLayout(0,1));
// trialPanel.add(getTrajectoryButton());
// trialPanel.add(getMultiRunButton());
// trialPanel.add(getHistogramButton());
// JPanel panela = new JPanel(new FlowLayout(FlowLayout.LEFT));
// panela.add(getNumOfTrialsLabel());
// panela.add(getJTextFieldNumOfTrials());
// trialPanel.add(panela);
// trialPanel.setBorder(new EtchedBorder());
JPanel trialPanel = new JPanel(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 0;
gbc.anchor = GridBagConstraints.WEST;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.insets = new Insets(2, 1, 1, 1);
trialPanel.add(getTrajectoryButton(), gbc);
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 1;
gbc.anchor = GridBagConstraints.WEST;
gbc.weightx = 1.0;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.insets = new Insets(1, 1, 1, 1);
trialPanel.add(getMultiRunButton(), gbc);
gbc = new GridBagConstraints();
gbc.gridx = 1;
gbc.gridy = 1;
gbc.anchor = GridBagConstraints.EAST;
gbc.insets = new Insets(1, 1, 1, 3);
// ===============================================
trialPanel.add(getMultiRunHelpButton(), gbc);
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 2;
gbc.anchor = GridBagConstraints.WEST;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.insets = new Insets(1, 1, 1, 1);
trialPanel.add(getHistogramButton(), gbc);
JPanel panela = new JPanel(new FlowLayout(FlowLayout.LEFT));
panela.add(getNumOfTrialsLabel());
panela.add(getJTextFieldNumOfTrials());
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 3;
gbc.anchor = GridBagConstraints.WEST;
gbc.weightx = 1.0;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.insets = new Insets(1, 1, 2, 1);
trialPanel.add(panela, gbc);
trialPanel.setBorder(new EtchedBorder());
// 2
JPanel seedPanel = new JPanel(new GridLayout(0, 1));
JPanel panelb = new JPanel(new FlowLayout(FlowLayout.LEFT));
panelb.add(getRandomSeedRadioButton());
seedPanel.add(panelb);
panelb = new JPanel(new FlowLayout(FlowLayout.LEFT));
panelb.add(getCustomizedSeedRadioButton());
panelb.add(getJTextFieldCustomSeed());
seedPanel.add(panelb);
seedPanel.setBorder(new EtchedBorder());
CollapsiblePanel advancedPanel = new CollapsiblePanel("Advanced", false);
advancedPanel.getContentPanel().setLayout(new GridBagLayout());
// 0
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 0;
gbc.anchor = GridBagConstraints.LINE_END;
gbc.insets = new Insets(4, 4, 4, 4);
// gbc.weightx = 1.0;
advancedPanel.getContentPanel().add(getEpsilonLabel(), gbc);
gbc = new GridBagConstraints();
gbc.gridx = 1;
gbc.gridy = 0;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.weightx = 1.0;
gbc.insets = new Insets(4, 4, 4, 4);
advancedPanel.getContentPanel().add(getEpsilonTextField(), gbc);
gbc = new GridBagConstraints();
gbc.gridx = 2;
gbc.gridy = 0;
// gbc.weightx = 1.0;
gbc.insets = new Insets(4, 4, 4, 4);
gbc.anchor = GridBagConstraints.LINE_END;
advancedPanel.getContentPanel().add(getLambdaLabel(), gbc);
gbc = new GridBagConstraints();
gbc.gridx = 3;
gbc.gridy = 0;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.weightx = 1.0;
gbc.insets = new Insets(4, 4, 4, 4);
advancedPanel.getContentPanel().add(getLambdaTextField(), gbc);
// 1
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 1;
// gbc.weightx = 1.0;
gbc.insets = new Insets(4, 4, 4, 4);
gbc.anchor = GridBagConstraints.LINE_END;
advancedPanel.getContentPanel().add(getMSRToleranceLabel(), gbc);
gbc = new GridBagConstraints();
gbc.gridx = 1;
gbc.gridy = 1;
gbc.insets = new Insets(4, 4, 4, 4);
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.weightx = 1.0;
advancedPanel.getContentPanel().add(getMSRToleranceTextField(), gbc);
gbc = new GridBagConstraints();
gbc.gridx = 2;
gbc.gridy = 1;
gbc.insets = new Insets(4, 4, 4, 4);
// gbc.weightx = 1.0;
gbc.anchor = GridBagConstraints.LINE_END;
advancedPanel.getContentPanel().add(getSDEToleranceLabel(), gbc);
gbc = new GridBagConstraints();
gbc.gridx = 3;
gbc.gridy = 1;
gbc.insets = new Insets(4, 4, 4, 4);
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.weightx = 1.0;
advancedPanel.getContentPanel().add(getSDEToleranceTextField(), gbc);
//
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 0;
gbc.fill = GridBagConstraints.BOTH;
gbc.weightx = 1.0;
gbc.insets = new Insets(4, 4, 4, 4);
getContentPanel().add(trialPanel, gbc);
gbc = new GridBagConstraints();
gbc.gridx = 1;
gbc.gridy = 0;
gbc.fill = GridBagConstraints.BOTH;
gbc.weightx = 1.0;
gbc.weighty = 1.0;
gbc.insets = new Insets(4, 4, 4, 4);
getContentPanel().add(seedPanel, gbc);
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 1;
gbc.gridwidth = 2;
gbc.fill = GridBagConstraints.BOTH;
gbc.weightx = 1.0;
gbc.weighty = 1.0;
gbc.insets = new Insets(10, 4, 10, 4);
getContentPanel().add(advancedPanel, gbc);
getButtonGroupSeed().add(getRandomSeedRadioButton());
getButtonGroupSeed().add(getCustomizedSeedRadioButton());
// trial radio button group
getButtonGroupTrials().add(getTrajectoryButton());
getButtonGroupTrials().add(getMultiRunButton());
getButtonGroupTrials().add(getHistogramButton());
} catch (java.lang.Throwable ivjExc) {
handleException(ivjExc);
}
}
Aggregations