Search in sources :

Example 36 with CompoundBorder

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);
    }
}
Also used : LineBorder(javax.swing.border.LineBorder) CompoundBorder(javax.swing.border.CompoundBorder)

Example 37 with CompoundBorder

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));
    }
}
Also used : LineBorder(javax.swing.border.LineBorder) CompoundBorder(javax.swing.border.CompoundBorder)

Example 38 with CompoundBorder

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
}
Also used : JPanel(javax.swing.JPanel) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField) BorderLayout(java.awt.BorderLayout) Dialog(java.awt.Dialog) HelpCtx(org.openide.util.HelpCtx) ResourceBundle(java.util.ResourceBundle) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder)

Example 39 with CompoundBorder

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>&nbsp;&nbsp;&nbsp;";
    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>&nbsp;&nbsp;&nbsp;";
    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);
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) BorderLayout(java.awt.BorderLayout) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder) TitledBorder(javax.swing.border.TitledBorder) Border(javax.swing.border.Border) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder) TitledBorder(javax.swing.border.TitledBorder) EtchedBorder(javax.swing.border.EtchedBorder)

Example 40 with CompoundBorder

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 = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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>&nbsp;&nbsp;&nbsp;";
    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>&nbsp;&nbsp;&nbsp;";
    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 = "&nbsp;&nbsp;&nbsp;Simulation Data&nbsp;&nbsp;&nbsp;";
    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 = "&nbsp;&nbsp;&nbsp;Log Data&nbsp;&nbsp;&nbsp;";
    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);
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) BorderLayout(java.awt.BorderLayout) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder) TitledBorder(javax.swing.border.TitledBorder) Border(javax.swing.border.Border) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder) TitledBorder(javax.swing.border.TitledBorder) EtchedBorder(javax.swing.border.EtchedBorder)

Aggregations

CompoundBorder (javax.swing.border.CompoundBorder)43 EmptyBorder (javax.swing.border.EmptyBorder)23 Border (javax.swing.border.Border)20 BorderLayout (java.awt.BorderLayout)14 JLabel (javax.swing.JLabel)13 JPanel (javax.swing.JPanel)13 Insets (java.awt.Insets)10 LineBorder (javax.swing.border.LineBorder)9 GridBagConstraints (java.awt.GridBagConstraints)8 GridBagLayout (java.awt.GridBagLayout)8 JButton (javax.swing.JButton)8 TitledBorder (javax.swing.border.TitledBorder)8 ActionEvent (java.awt.event.ActionEvent)7 EtchedBorder (javax.swing.border.EtchedBorder)7 CustomLineBorder (com.intellij.ui.border.CustomLineBorder)5 ActionListener (java.awt.event.ActionListener)5 File (java.io.File)5 JTextField (javax.swing.JTextField)5 NotNull (org.jetbrains.annotations.NotNull)5 Color (java.awt.Color)4