Search in sources :

Example 16 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 17 with CompoundBorder

use of javax.swing.border.CompoundBorder in project jgnash by ccavanaugh.

the class InvestmentTransactionPanel method layoutMainPanel.

private void layoutMainPanel() {
    initComponents();
    FormLayout layout = new FormLayout("d, 4dlu, m:g, 4dlu, m", "f:d, $ugap, f:d");
    CellConstraints cc = new CellConstraints();
    setBorder(new CompoundBorder(new ShadowBorder(), Borders.TABBED_DIALOG));
    setLayout(layout);
    add(cardPanel, cc.xyw(1, 1, 5));
    add(new JSeparator(), cc.xyw(1, 2, 5));
    add(new JLabel(rb.getString("Label.Action")), cc.xy(1, 3));
    add(actionCombo, cc.xy(3, 3));
    add(StaticUIMethods.buildOKCancelBar(enterButton, cancelButton), cc.xy(5, 3));
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) ShadowBorder(jgnash.ui.components.ShadowBorder) JLabel(javax.swing.JLabel) CompoundBorder(javax.swing.border.CompoundBorder) JSeparator(javax.swing.JSeparator) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Example 18 with CompoundBorder

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

the class PositionablePropertiesUtil method preview.

void preview() {
    int attrs = Font.PLAIN;
    if (bold.isSelected()) {
        attrs = Font.BOLD;
    }
    if (italic.isSelected()) {
        attrs |= Font.ITALIC;
    }
    Font newFont = new Font(_parent.getFont().getName(), attrs, Integer.parseInt(fontSizeField.getText()));
    Color desiredColor;
    desiredColor = colorFromComboBox(borderColorCombo, null);
    Border borderMargin = BorderFactory.createEmptyBorder(0, 0, 0, 0);
    int margin = ((Number) marginSizeTextSpin.getValue()).intValue();
    Border outlineBorder = BorderFactory.createEmptyBorder(0, 0, 0, 0);
    if (desiredColor != null) {
        outlineBorder = new LineBorder(desiredColor, ((Number) borderSizeTextSpin.getValue()).intValue());
    } else {
        outlineBorder = BorderFactory.createEmptyBorder(0, 0, 0, 0);
    }
    int hoz = 0;
    switch(_justificationCombo.getSelectedIndex()) {
        case 0:
            hoz = (0x02);
            break;
        case 1:
            hoz = (0x04);
            break;
        case 2:
            hoz = (0x00);
            break;
        default:
            log.warn("Unhandled combo index: {}", _justificationCombo.getSelectedIndex());
            break;
    }
    for (int i = 0; i < txtList.size(); i++) {
        JLabel tmp = txtList.get(i).getLabel();
        if (tmp.isOpaque()) {
            borderMargin = new LineBorder(tmp.getBackground(), margin);
        } else {
            borderMargin = BorderFactory.createEmptyBorder(margin, margin, margin, margin);
        }
        tmp.setFont(newFont);
        tmp.setHorizontalAlignment(hoz);
        tmp.setBorder(new CompoundBorder(outlineBorder, borderMargin));
        tmp.setSize(new Dimension(maxWidth(tmp), maxHeight(tmp)));
        tmp.setPreferredSize(new Dimension(maxWidth(tmp), maxHeight(tmp)));
    }
    mFrame.pack();
}
Also used : Color(java.awt.Color) LineBorder(javax.swing.border.LineBorder) JLabel(javax.swing.JLabel) CompoundBorder(javax.swing.border.CompoundBorder) Dimension(java.awt.Dimension) LineBorder(javax.swing.border.LineBorder) Border(javax.swing.border.Border) CompoundBorder(javax.swing.border.CompoundBorder) Font(java.awt.Font)

Example 19 with CompoundBorder

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

the class DecoratorPanel method updateSamples.

private void updateSamples() {
    if (_previewPanel == null) {
        return;
    }
    int mar = _util.getMargin();
    int bor = _util.getBorderSize();
    Border outlineBorder;
    if (bor == 0) {
        outlineBorder = BorderFactory.createEmptyBorder(0, 0, 0, 0);
    } else {
        outlineBorder = new LineBorder(_util.getBorderColor(), bor);
    }
    Font font = _util.getFont();
    int just = _util.getJustification();
    Iterator<PositionableLabel> it = _sample.values().iterator();
    while (it.hasNext()) {
        PositionableLabel sam = it.next();
        PositionablePopupUtil util = sam.getPopupUtility();
        sam.setFont(font);
        util.setFixedWidth(_util.getFixedWidth());
        util.setFixedHeight(_util.getFixedHeight());
        util.setMargin(mar);
        util.setBorderSize(bor);
        Border borderMargin;
        if (sam.isOpaque()) {
            borderMargin = new LineBorder(sam.getBackground(), mar);
        } else {
            borderMargin = BorderFactory.createEmptyBorder(mar, mar, mar, mar);
        }
        sam.setBorder(new CompoundBorder(outlineBorder, borderMargin));
        switch(just) {
            case PositionablePopupUtil.LEFT:
                sam.setHorizontalAlignment(JLabel.LEFT);
                break;
            case PositionablePopupUtil.RIGHT:
                sam.setHorizontalAlignment(JLabel.RIGHT);
                break;
            default:
                sam.setHorizontalAlignment(JLabel.CENTER);
        }
        sam.updateSize();
        sam.setPreferredSize(sam.getSize());
        sam.repaint();
    }
    if (_dialog != null) {
        _dialog.pack();
    }
}
Also used : PositionablePopupUtil(jmri.jmrit.display.PositionablePopupUtil) LineBorder(javax.swing.border.LineBorder) PositionableLabel(jmri.jmrit.display.PositionableLabel) CompoundBorder(javax.swing.border.CompoundBorder) LineBorder(javax.swing.border.LineBorder) Border(javax.swing.border.Border) CompoundBorder(javax.swing.border.CompoundBorder) Font(java.awt.Font)

Example 20 with CompoundBorder

use of javax.swing.border.CompoundBorder in project android by JetBrains.

the class GradleVersionRecommendedUpdateDialog method createSouthPanel.

@Override
@NotNull
protected JComponent createSouthPanel() {
    Action[] actions = createActions();
    List<JButton> buttons = Lists.newArrayList();
    JPanel panel = new JPanel(new BorderLayout());
    if (actions.length > 0) {
        JPanel buttonsPanel = createButtons(actions, buttons);
        panel.add(buttonsPanel, BorderLayout.CENTER);
        myButtons = buttons.toArray(new JButton[buttons.size()]);
    }
    if (getStyle() == DialogStyle.COMPACT) {
        Border line = new CustomLineBorder(OnePixelDivider.BACKGROUND, 1, 0, 0, 0);
        panel.setBorder(new CompoundBorder(line, empty(8, 12)));
    } else {
        panel.setBorder(emptyTop(8));
    }
    return panel;
}
Also used : CustomLineBorder(com.intellij.ui.border.CustomLineBorder) CompoundBorder(javax.swing.border.CompoundBorder) Border(javax.swing.border.Border) CompoundBorder(javax.swing.border.CompoundBorder) CustomLineBorder(com.intellij.ui.border.CustomLineBorder) NotNull(org.jetbrains.annotations.NotNull)

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