use of javax.swing.border.CompoundBorder in project nhin-d by DirectProject.
the class EditorPanel method initUI.
protected void initUI() {
setLayout(new BorderLayout());
setBorder(new CompoundBorder(new SoftBevelBorder(BevelBorder.LOWERED), new EmptyBorder(5, 5, 5, 5)));
policyText = new JTextArea();
policyText.setLineWrap(true);
policyText.setWrapStyleWord(true);
policyText.setEditable(true);
final JScrollPane scrollPane = new JScrollPane(policyText);
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
scrollPane.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
fileNameLabel = new JLabel("*New File*");
final JPanel reportPanel = new JPanel(new BorderLayout());
reportPanel.add(fileNameLabel, BorderLayout.NORTH);
reportPanel.add(scrollPane, BorderLayout.CENTER);
//this.add(reportPanel, BorderLayout.CENTER);
validatePanel = new ValidatePanel();
validatePanel.setFeedMode(PolicyLexicon.SIMPLE_TEXT_V1, policyText.getDocument());
final JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, reportPanel, validatePanel);
splitPane.setDividerLocation(400);
this.add(splitPane, BorderLayout.CENTER);
}
use of javax.swing.border.CompoundBorder in project jdk8u_jdk by JetBrains.
the class Test8039750 method test.
private static void test(Object value, String one, String two) {
if (value instanceof CompoundBorder) {
CompoundBorder border = (CompoundBorder) value;
test(border.getOutsideBorder(), one);
test(border.getInsideBorder(), two);
} else {
throw new Error("CompoundBorder");
}
}
use of javax.swing.border.CompoundBorder in project intellij-community by JetBrains.
the class TestResultsPanel method createOutputTab.
private static JComponent createOutputTab(JComponent console, AnAction[] consoleActions) {
JPanel outputTab = new JPanel(new BorderLayout());
console.setFocusable(true);
final Color editorBackground = EditorColorsManager.getInstance().getGlobalScheme().getDefaultBackground();
console.setBorder(new CompoundBorder(IdeBorderFactory.createBorder(SideBorder.RIGHT | SideBorder.TOP), new SideBorder(editorBackground, SideBorder.LEFT)));
outputTab.add(console, BorderLayout.CENTER);
final ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, new DefaultActionGroup(consoleActions), false);
outputTab.add(toolbar.getComponent(), BorderLayout.EAST);
return outputTab;
}
use of javax.swing.border.CompoundBorder in project intellij-community by JetBrains.
the class DarculaSpinnerUI method createArrow.
private JButton createArrow(@MagicConstant(intValues = { SwingConstants.NORTH, SwingConstants.SOUTH }) int direction) {
final Color shadow = UIUtil.getPanelBackground();
final Color enabledColor = new JBColor(Gray._255, UIUtil.getLabelForeground());
final Color disabledColor = new JBColor(Gray._200, UIUtil.getLabelForeground().darker());
BasicArrowButton b = new BasicArrowButton(direction, shadow, shadow, enabledColor, shadow) {
@Override
public void paint(Graphics g) {
paintArrowButton(g, this, direction);
}
@Override
public boolean isOpaque() {
return false;
}
@Override
public void paintTriangle(Graphics g, int x, int y, int size, int direction, boolean isEnabled) {
final GraphicsConfig config = GraphicsUtil.setupAAPainting(g);
int mid;
final int w = 8;
final int h = 6;
mid = w / 2;
g.setColor(isEnabled ? enabledColor : disabledColor);
g.translate(x, y);
switch(direction) {
case SOUTH:
g.fillPolygon(new int[] { 0, w, mid }, new int[] { 1, 1, h }, 3);
break;
case NORTH:
g.fillPolygon(new int[] { 0, w, mid }, new int[] { h - 1, h - 1, 0 }, 3);
break;
case WEST:
case EAST:
}
g.translate(-x, -y);
config.restore();
}
};
Border buttonBorder = UIManager.getBorder("Spinner.arrowButtonBorder");
if (buttonBorder instanceof UIResource) {
// Wrap the border to avoid having the UIResource be replaced by
// the ButtonUI. This is the opposite of using BorderUIResource.
b.setBorder(new CompoundBorder(buttonBorder, null));
} else {
b.setBorder(buttonBorder);
}
b.setInheritsPopupMenu(true);
return b;
}
use of javax.swing.border.CompoundBorder in project intellij-community by JetBrains.
the class TextFieldAction method createCustomComponent.
@Override
public JComponent createCustomComponent(Presentation presentation) {
// honestly borrowed from SearchTextField
final JPanel panel = new JPanel(new BorderLayout());
final JLabel label = new JLabel(myIcon);
label.setOpaque(true);
label.setBackground(myField.getBackground());
myField.setOpaque(true);
panel.add(myField, BorderLayout.WEST);
panel.add(label, BorderLayout.EAST);
myField.setToolTipText(myDescription);
label.setToolTipText(myDescription);
final Border originalBorder;
if (SystemInfo.isMac) {
originalBorder = BorderFactory.createLoweredBevelBorder();
} else {
originalBorder = myField.getBorder();
}
panel.setBorder(new CompoundBorder(IdeBorderFactory.createEmptyBorder(4, 0, 4, 0), originalBorder));
myField.setOpaque(true);
myField.setBorder(IdeBorderFactory.createEmptyBorder(0, 5, 0, 5));
new ClickListener() {
@Override
public boolean onClick(@NotNull MouseEvent e, int clickCount) {
actionPerformed(null);
return true;
}
}.installOn(label);
return panel;
}
Aggregations