Search in sources :

Example 1 with CompoundBorder

use of javax.swing.border.CompoundBorder in project sonarqube by SonarSource.

the class TextLineNumber method setBorderGap.

/**
   *  The border gap is used in calculating the left and right insets of the
   *  border. Default value is 5.
   *
   *  @param borderGap  the gap in pixels
   */
public void setBorderGap(int borderGap) {
    this.borderGap = borderGap;
    Border inner = new EmptyBorder(0, borderGap, 0, borderGap);
    setBorder(new CompoundBorder(OUTER, inner));
    lastDigits = 0;
    setPreferredWidth();
}
Also used : CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder) MatteBorder(javax.swing.border.MatteBorder) Border(javax.swing.border.Border) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder)

Example 2 with CompoundBorder

use of javax.swing.border.CompoundBorder in project jadx by skylot.

the class LineNumbers method setBorderGap.

public void setBorderGap(int borderGap) {
    Border inner = new EmptyBorder(0, borderGap, 0, borderGap);
    setBorder(new CompoundBorder(OUTER, inner));
    lastDigits = 0;
}
Also used : CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder) MatteBorder(javax.swing.border.MatteBorder) Border(javax.swing.border.Border) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder)

Example 3 with CompoundBorder

use of javax.swing.border.CompoundBorder in project libgdx by libgdx.

the class ParticleEditor method initializeComponents.

private void initializeComponents() {
    // {
    // JMenuBar menuBar = new JMenuBar();
    // setJMenuBar(menuBar);
    // JPopupMenu.setDefaultLightWeightPopupEnabled(false);
    // JMenu fileMenu = new JMenu("File");
    // menuBar.add(fileMenu);
    // }
    splitPane = new JSplitPane();
    splitPane.setUI(new BasicSplitPaneUI() {

        public void paint(Graphics g, JComponent jc) {
        }
    });
    splitPane.setDividerSize(4);
    getContentPane().add(splitPane, BorderLayout.CENTER);
    {
        JSplitPane rightSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
        rightSplit.setUI(new BasicSplitPaneUI() {

            public void paint(Graphics g, JComponent jc) {
            }
        });
        rightSplit.setDividerSize(4);
        splitPane.add(rightSplit, JSplitPane.RIGHT);
        {
            JPanel propertiesPanel = new JPanel(new GridBagLayout());
            rightSplit.add(propertiesPanel, JSplitPane.TOP);
            propertiesPanel.setBorder(new CompoundBorder(BorderFactory.createEmptyBorder(3, 0, 6, 6), BorderFactory.createTitledBorder("Editor Properties")));
            {
                JScrollPane scroll = new JScrollPane();
                propertiesPanel.add(scroll, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTH, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
                scroll.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
                {
                    editRowsPanel = new JPanel(new GridBagLayout());
                    scroll.setViewportView(editRowsPanel);
                    scroll.getVerticalScrollBar().setUnitIncrement(70);
                }
            }
        }
        {
            JPanel propertiesPanel = new JPanel(new GridBagLayout());
            rightSplit.add(propertiesPanel, JSplitPane.BOTTOM);
            propertiesPanel.setBorder(new CompoundBorder(BorderFactory.createEmptyBorder(3, 0, 6, 6), BorderFactory.createTitledBorder("Emitter Properties")));
            {
                JScrollPane scroll = new JScrollPane();
                propertiesPanel.add(scroll, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTH, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
                scroll.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
                {
                    rowsPanel = new JPanel(new GridBagLayout());
                    scroll.setViewportView(rowsPanel);
                    scroll.getVerticalScrollBar().setUnitIncrement(70);
                }
            }
        }
        rightSplit.setDividerLocation(200);
    }
    {
        JSplitPane leftSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
        leftSplit.setUI(new BasicSplitPaneUI() {

            public void paint(Graphics g, JComponent jc) {
            }
        });
        leftSplit.setDividerSize(4);
        splitPane.add(leftSplit, JSplitPane.LEFT);
        {
            JPanel spacer = new JPanel(new BorderLayout());
            leftSplit.add(spacer, JSplitPane.BOTTOM);
            spacer.add(lwjglCanvas.getCanvas());
            spacer.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 4));
        }
        {
            JPanel emittersPanel = new JPanel(new BorderLayout());
            leftSplit.add(emittersPanel, JSplitPane.TOP);
            emittersPanel.setBorder(new CompoundBorder(BorderFactory.createEmptyBorder(0, 6, 6, 0), BorderFactory.createTitledBorder("Effect Emitters")));
            {
                effectPanel = new EffectPanel(this);
                emittersPanel.add(effectPanel);
            }
        }
        leftSplit.setDividerLocation(575);
    }
    splitPane.setDividerLocation(325);
}
Also used : CompoundBorder(javax.swing.border.CompoundBorder) BasicSplitPaneUI(javax.swing.plaf.basic.BasicSplitPaneUI)

Example 4 with CompoundBorder

use of javax.swing.border.CompoundBorder in project nhin-d by DirectProject.

the class CAPanel method initUI.

protected void initUI() {
    setLayout(new BorderLayout());
    //setBorder(new SoftBevelBorder(BevelBorder.LOWERED));
    setBorder(new CompoundBorder(new SoftBevelBorder(BevelBorder.LOWERED), new EmptyBorder(5, 5, 5, 5)));
    createCA = new JRadioButton("Create New CA");
    loadCA = new JRadioButton("Load CA");
    ButtonGroup group = new ButtonGroup();
    group.add(createCA);
    group.add(loadCA);
    createCA.setSelected(true);
    JPanel radioPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    radioPanel.add(createCA);
    radioPanel.add(loadCA);
    JPanel fieldsPanel = new JPanel();
    fieldsPanel.setLayout(new GridLayout(3, 3, 10, 10));
    cnField = new TextEntryField("CN:");
    fieldsPanel.add(cnField);
    countryField = new TextEntryField("Country:");
    fieldsPanel.add(countryField);
    stateField = new TextEntryField("State:");
    fieldsPanel.add(stateField);
    locField = new TextEntryField("Location:");
    fieldsPanel.add(locField);
    orgField = new TextEntryField("Org:");
    fieldsPanel.add(orgField);
    emailField = new TextEntryField("Email:");
    fieldsPanel.add(emailField);
    expField = new SpinEntryField("Experiation (Days):", 365);
    fieldsPanel.add(expField);
    keyStr = new DropDownEntry("Key Strength:", new Object[] { 1024, 2048, 4096 });
    fieldsPanel.add(keyStr);
    passField = new PasswordField("Password:");
    fieldsPanel.add(passField);
    JPanel topPanel = new JPanel(new BorderLayout());
    topPanel.add(radioPanel, BorderLayout.NORTH);
    topPanel.add(fieldsPanel, BorderLayout.CENTER);
    add(topPanel, BorderLayout.NORTH);
    new FlowLayout(FlowLayout.LEFT);
    certFileField = new FileField("Certificate Authority File:", "");
    keyFileField = new FileField("Private Key File:", "");
    JPanel filePanel = new JPanel(new GridLayout(1, 2));
    filePanel.add(certFileField);
    filePanel.add(keyFileField);
    loadCert = new JButton("Load");
    loadCert.setVisible(false);
    createCert = new JButton("Create");
    clear = new JButton("Clear");
    clear.setVisible(false);
    clear = new JButton("Clear");
    genCert = new JButton("Create Leaf Cert");
    genCert.setVisible(false);
    signCSR = new JButton("Sign CSR");
    signCSR.setVisible(false);
    addToAltSubjects = new JCheckBox("Add Email To Alt Subject Names");
    addToAltSubjects.setVisible(false);
    addToAltSubjects.setSelected(true);
    allowedToSign = new JCheckBox("Allowed To Sign Certificates");
    allowedToSign.setVisible(false);
    keyEnc = new JCheckBox("Key Encipherment Use");
    keyEnc.setVisible(false);
    keyEnc.setSelected(true);
    digitalSig = new JCheckBox("Digital Signature Use");
    digitalSig.setVisible(false);
    keyEnc.setSelected(true);
    JPanel addAltPanel = new JPanel(new GridLayout(2, 2));
    addAltPanel.setPreferredSize(new Dimension(450, addAltPanel.getPreferredSize().height));
    //addAltPanel.add(addToAltSubjects);
    addAltPanel.add(allowedToSign);
    addAltPanel.add(keyEnc);
    addAltPanel.add(digitalSig);
    JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    buttonPanel.add(addAltPanel);
    buttonPanel.add(loadCert);
    buttonPanel.add(createCert);
    buttonPanel.add(clear);
    buttonPanel.add(genCert);
    buttonPanel.add(signCSR);
    JPanel combineAltAndButtonPanel = new JPanel(new BorderLayout());
    //combineAltAndButtonPanel.add(addAltPanel, BorderLayout.WEST);
    combineAltAndButtonPanel.add(buttonPanel, BorderLayout.EAST);
    JPanel bottomPannel = new JPanel(new BorderLayout());
    bottomPannel.add(filePanel, BorderLayout.NORTH);
    bottomPannel.add(combineAltAndButtonPanel, BorderLayout.SOUTH);
    this.add(bottomPannel, BorderLayout.SOUTH);
}
Also used : JPanel(javax.swing.JPanel) JRadioButton(javax.swing.JRadioButton) FlowLayout(java.awt.FlowLayout) JButton(javax.swing.JButton) Dimension(java.awt.Dimension) JCheckBox(javax.swing.JCheckBox) GridLayout(java.awt.GridLayout) BorderLayout(java.awt.BorderLayout) ButtonGroup(javax.swing.ButtonGroup) SoftBevelBorder(javax.swing.border.SoftBevelBorder) CompoundBorder(javax.swing.border.CompoundBorder) JPasswordField(javax.swing.JPasswordField) EmptyBorder(javax.swing.border.EmptyBorder)

Example 5 with CompoundBorder

use of javax.swing.border.CompoundBorder in project nhin-d by DirectProject.

the class ValidatePanel method initUI.

protected void initUI() {
    setLayout(new BorderLayout());
    setBorder(new CompoundBorder(new SoftBevelBorder(BevelBorder.LOWERED), new EmptyBorder(5, 5, 5, 5)));
    // File Load Fields
    policyFileField = new FileField("Policy Definition File:", "");
    certFileField = new FileField("Certificate File: ", "");
    final JPanel filePanel = new JPanel(new GridLayout(1, 2));
    filePanel.add(certFileField);
    filePanel.add(policyFileField);
    this.add(filePanel, BorderLayout.NORTH);
    // Report panel
    final JLabel reportHeaderLabel = new JLabel("Validation Report");
    reportText = new JTextArea();
    reportText.setLineWrap(true);
    reportText.setWrapStyleWord(true);
    reportText.setEditable(false);
    final JScrollPane scrollPane = new JScrollPane(reportText);
    scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    final JPanel reportPanel = new JPanel(new BorderLayout());
    reportPanel.add(reportHeaderLabel, BorderLayout.NORTH);
    reportPanel.add(scrollPane, BorderLayout.CENTER);
    this.add(reportPanel, BorderLayout.CENTER);
    // Button Panel
    cmdValidate = new JButton("Validate");
    JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    buttonPanel.add(cmdValidate);
    this.add(buttonPanel, BorderLayout.SOUTH);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) GridLayout(java.awt.GridLayout) JTextArea(javax.swing.JTextArea) FlowLayout(java.awt.FlowLayout) BorderLayout(java.awt.BorderLayout) JButton(javax.swing.JButton) SoftBevelBorder(javax.swing.border.SoftBevelBorder) JLabel(javax.swing.JLabel) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder)

Aggregations

CompoundBorder (javax.swing.border.CompoundBorder)36 EmptyBorder (javax.swing.border.EmptyBorder)16 Border (javax.swing.border.Border)13 LineBorder (javax.swing.border.LineBorder)9 BorderLayout (java.awt.BorderLayout)7 JLabel (javax.swing.JLabel)6 JPanel (javax.swing.JPanel)6 CustomLineBorder (com.intellij.ui.border.CustomLineBorder)5 NotNull (org.jetbrains.annotations.NotNull)5 Color (java.awt.Color)4 JButton (javax.swing.JButton)4 JScrollPane (javax.swing.JScrollPane)4 MatteBorder (javax.swing.border.MatteBorder)4 Insets (java.awt.Insets)3 ActionEvent (java.awt.event.ActionEvent)3 ActionListener (java.awt.event.ActionListener)3 JSplitPane (javax.swing.JSplitPane)3 SoftBevelBorder (javax.swing.border.SoftBevelBorder)3 EditorEx (com.intellij.openapi.editor.ex.EditorEx)2 JBColor (com.intellij.ui.JBColor)2