use of javax.swing.border.CompoundBorder in project JMRI by JMRI.
the class PositionablePopupUtil method setBorder.
public void setBorder(boolean set) {
_showBorder = set;
if (set) {
if (borderColor != null && _showBorder) {
outlineBorder = new LineBorder(borderColor, borderSize);
_parent.setBorder(new CompoundBorder(outlineBorder, borderMargin));
}
} else {
_parent.setBorder(null);
}
}
use of javax.swing.border.CompoundBorder in project JMRI by JMRI.
the class PositionablePopupUtil method setBorderColor.
public void setBorderColor(Color border) {
borderColor = border;
if (borderColor != null && _showBorder) {
outlineBorder = new LineBorder(borderColor, borderSize);
_parent.setBorder(new CompoundBorder(outlineBorder, borderMargin));
}
}
use of javax.swing.border.CompoundBorder in project enclojure by EricThorsen.
the class AddClojureWatchAction method performAction.
public void performAction() {
ResourceBundle bundle = NbBundle.getBundle(AddClojureWatchAction.class);
JPanel panel = new JPanel();
// NOI18N
panel.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_WatchPanel"));
JTextField textField;
// NOI18N
JLabel textLabel = new JLabel(bundle.getString("CTL_Watch_Name"));
textLabel.setBorder(new EmptyBorder(0, 0, 0, 10));
panel.setLayout(new BorderLayout());
panel.setBorder(new EmptyBorder(11, 12, 1, 11));
// NOI18N
panel.add("West", textLabel);
// NOI18N
panel.add("Center", textField = new JTextField(25));
// NOI18N
textField.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_CTL_Watch_Name"));
textField.setBorder(new CompoundBorder(textField.getBorder(), new EmptyBorder(2, 0, 2, 0)));
textLabel.setDisplayedMnemonic(// NOI18N
bundle.getString("CTL_Watch_Name_Mnemonic").charAt(0));
// Utils.getELIdentifier();
String t = null;
// Utils.log("Watch: ELIdentifier = " + t);
boolean isScriptlet = Utils.isScriptlet();
LOG.log(Level.FINEST, "Watch: isScriptlet: " + isScriptlet);
if ((t == null) && (isScriptlet)) {
t = Utils.getJavaIdentifier();
LOG.log(Level.FINEST, "Watch: javaIdentifier = " + t);
}
if (t != null) {
textField.setText(t);
} else {
textField.setText(watchHistory);
}
textField.selectAll();
textLabel.setLabelFor(textField);
textField.requestFocus();
org.openide.DialogDescriptor dd = new org.openide.DialogDescriptor(panel, // NOI18N
bundle.getString("CTL_Watch_Title"));
dd.setHelpCtx(new HelpCtx("debug.add.watch"));
Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
dialog.setVisible(true);
dialog.dispose();
if (dd.getValue() != org.openide.DialogDescriptor.OK_OPTION)
return;
String watch = textField.getText();
if ((watch == null) || (watch.trim().length() == 0)) {
return;
}
String s = watch;
int i = s.indexOf(';');
while (i > 0) {
String ss = s.substring(0, i).trim();
if (ss.length() > 0)
DebuggerManager.getDebuggerManager().createWatch(ss);
s = s.substring(i + 1);
i = s.indexOf(';');
}
s = s.trim();
if (s.length() > 0)
DebuggerManager.getDebuggerManager().createWatch(s);
watchHistory = watch;
// open watches view
// new WatchesAction ().actionPerformed (null); TODO
}
use of javax.swing.border.CompoundBorder in project vcell by virtualcell.
the class BioNetGenConfigurationPanel method initialize.
private void initialize() {
setLayout(new BorderLayout());
Border margin = new EmptyBorder(5, 3, 1, 1);
Border loweredEtchedBorder = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
TitledBorder panelBorder = BorderFactory.createTitledBorder(loweredEtchedBorder, " General Properties ");
panelBorder.setTitleJustification(TitledBorder.LEFT);
panelBorder.setTitlePosition(TitledBorder.TOP);
panelBorder.setTitleFont(getFont().deriveFont(Font.BOLD));
JPanel jpanel = new JPanel();
jpanel.setBorder(new CompoundBorder(margin, panelBorder));
add(jpanel, BorderLayout.CENTER);
jpanel.setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.weighty = 0;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.anchor = GridBagConstraints.NORTHWEST;
gbc.gridheight = 1;
int gridy = 0;
String title = "<b>Max Number of Species</b> ";
JLabel l1 = new JLabel("<html>" + title + "</html>");
gbc.gridx = 0;
gbc.gridy = gridy;
// top, left bottom, right
gbc.insets = new Insets(4, 4, 2, 4);
jpanel.add(l1, gbc);
String location = NetworkTransformer.speciesLimit + "";
JLabel l2 = new JLabel("<html>" + location + "</html>");
gbc.gridx = 1;
gbc.gridy = gridy;
gbc.insets = new Insets(4, 4, 2, 4);
jpanel.add(l2, gbc);
gridy++;
title = "<b>Max Number of Reactions</b> ";
JLabel l3 = new JLabel("<html>" + title + "</html>");
gbc.gridx = 0;
gbc.gridy = gridy;
gbc.insets = new Insets(4, 4, 2, 4);
jpanel.add(l3, gbc);
location = NetworkTransformer.reactionsLimit + "";
JLabel l4 = new JLabel("<html>" + location + "</html>");
gbc.gridx = 1;
gbc.gridy = gridy;
gbc.insets = new Insets(4, 4, 2, 4);
jpanel.add(l4, gbc);
gridy++;
gbc.gridx = 0;
gbc.gridy = gridy;
gbc.gridwidth = 3;
gbc.weightx = 1;
// fake cell used for filling all the vertical empty space
gbc.weighty = 1;
gbc.anchor = GridBagConstraints.WEST;
jpanel.add(new JLabel(""), gbc);
}
use of javax.swing.border.CompoundBorder in project vcell by virtualcell.
the class GeneralConfigurationPanel method initialize.
private void initialize() {
setLayout(new BorderLayout());
Border margin = new EmptyBorder(5, 3, 1, 1);
Border loweredEtchedBorder = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
TitledBorder panelBorder = BorderFactory.createTitledBorder(loweredEtchedBorder, " General Properties ");
panelBorder.setTitleJustification(TitledBorder.LEFT);
panelBorder.setTitlePosition(TitledBorder.TOP);
panelBorder.setTitleFont(getFont().deriveFont(Font.BOLD));
// EIGHT
String s = ResourceUtil.getJavaVersion().toString();
// C:\Users\vasilescu
String s6 = ResourceUtil.getUserHomeDir().getAbsolutePath();
// other
String sn = ResourceUtil.getSiteName();
JPanel jpanel = new JPanel();
jpanel.setBorder(new CompoundBorder(margin, panelBorder));
add(jpanel, BorderLayout.CENTER);
String redhome = " <font color=\"#880000\">(home)</font>";
jpanel.setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.weighty = 0;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.anchor = GridBagConstraints.NORTHWEST;
gbc.gridheight = 1;
int gridy = 0;
String title = "<b>Installation Directory</b> ";
JLabel l1 = new JLabel("<html>" + title + "</html>");
gbc.gridx = 0;
gbc.gridy = gridy;
// top, left bottom, right
gbc.insets = new Insets(4, 4, 2, 4);
jpanel.add(l1, gbc);
// C:\dan\projects\VCell_trunk2
String location = ResourceUtil.getVCellInstall().getAbsolutePath();
JLabel l2 = new JLabel("<html>" + location + "</html>");
gbc.gridx = 1;
gbc.gridy = gridy;
gbc.insets = new Insets(4, 4, 2, 4);
jpanel.add(l2, gbc);
// ---------------------------------------------------------
gridy++;
title = "<b>VCell Home Directory</b> ";
JLabel l3 = new JLabel("<html>" + title + "</html>");
gbc.gridx = 0;
gbc.gridy = gridy;
gbc.insets = new Insets(4, 4, 2, 4);
jpanel.add(l3, gbc);
// C:\Users\vasilescu\.vcell
location = ResourceUtil.getVcellHome().getAbsolutePath() + redhome;
JLabel l4 = new JLabel("<html>" + location + "</html>");
gbc.gridx = 1;
gbc.gridy = gridy;
gbc.insets = new Insets(4, 4, 2, 4);
jpanel.add(l4, gbc);
// -----------------------------------------------------
// C:\Users\vasilescu\.vcell\download
String ddap = ResourceUtil.getDownloadDirectory().getAbsolutePath();
// C:\Users\vasilescu\.vcell\visdata
String s2 = ResourceUtil.getLocalVisDataDir().getAbsolutePath();
// C:\Program Files\VCell_Alpha\localsolvers\win64
String s4 = ResourceUtil.getLocalSolversDirectory().getAbsolutePath();
gridy++;
title = " Simulation Data ";
JLabel l5 = new JLabel("<html>" + title + "</html>");
gbc.gridx = 0;
gbc.gridy = gridy;
gbc.insets = new Insets(4, 4, 2, 4);
jpanel.add(l5, gbc);
// C:\Users\vasilescu\.vcell\simdata
String lrdap = ResourceUtil.getLocalRootDir().getAbsolutePath();
int where = lrdap.lastIndexOf(ResourceUtil.VCELL_HOME_DIR_NAME);
if (where > 0) {
lrdap = lrdap.substring(where + ResourceUtil.VCELL_HOME_DIR_NAME.length());
lrdap = redhome + lrdap;
}
JLabel l6 = new JLabel("<html>" + lrdap + "</html>");
gbc.gridx = 1;
gbc.gridy = gridy;
gbc.insets = new Insets(4, 4, 2, 4);
jpanel.add(l6, gbc);
gridy++;
title = " Log Data ";
JLabel l7 = new JLabel("<html>" + title + "</html>");
gbc.gridx = 0;
gbc.gridy = gridy;
gbc.insets = new Insets(4, 4, 2, 4);
jpanel.add(l7, gbc);
// C:\Users\vasilescu\.vcell\logs
String ldap = ResourceUtil.getLogDir().getAbsolutePath();
where = ldap.lastIndexOf(ResourceUtil.VCELL_HOME_DIR_NAME);
if (where > 0) {
ldap = ldap.substring(where + ResourceUtil.VCELL_HOME_DIR_NAME.length());
ldap = redhome + ldap;
}
JLabel l8 = new JLabel("<html>" + ldap + "</html>");
gbc.gridx = 1;
gbc.gridy = gridy;
gbc.insets = new Insets(4, 4, 2, 4);
jpanel.add(l8, gbc);
// ---------------------------------------------------------
gridy++;
gbc.gridx = 0;
gbc.gridy = gridy;
gbc.gridwidth = 3;
gbc.weightx = 1;
// fake cell used for filling all the vertical empty space
gbc.weighty = 1;
gbc.anchor = GridBagConstraints.WEST;
jpanel.add(new JLabel(""), gbc);
}
Aggregations