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;
}
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));
}
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();
}
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();
}
}
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;
}
Aggregations