use of javax.swing.border.Border in project jdk8u_jdk by JetBrains.
the class BasicOptionPaneUI method createButtonArea.
/**
* Creates and returns a Container containing the buttons. The buttons
* are created by calling <code>getButtons</code>.
*/
protected Container createButtonArea() {
JPanel bottom = new JPanel();
Border border = (Border) DefaultLookup.get(optionPane, this, "OptionPane.buttonAreaBorder");
bottom.setName("OptionPane.buttonArea");
if (border != null) {
bottom.setBorder(border);
}
bottom.setLayout(new ButtonAreaLayout(DefaultLookup.getBoolean(optionPane, this, "OptionPane.sameSizeButtons", true), DefaultLookup.getInt(optionPane, this, "OptionPane.buttonPadding", 6), DefaultLookup.getInt(optionPane, this, "OptionPane.buttonOrientation", SwingConstants.CENTER), DefaultLookup.getBoolean(optionPane, this, "OptionPane.isYesLast", false)));
addButtonComponents(bottom, getButtons(), getInitialValueIndex());
return bottom;
}
use of javax.swing.border.Border in project jdk8u_jdk by JetBrains.
the class BasicOptionPaneUI method createMessageArea.
/**
* Messaged from installComponents to create a Container containing the
* body of the message. The icon is the created by calling
* <code>addIcon</code>.
*/
protected Container createMessageArea() {
JPanel top = new JPanel();
Border topBorder = (Border) DefaultLookup.get(optionPane, this, "OptionPane.messageAreaBorder");
if (topBorder != null) {
top.setBorder(topBorder);
}
top.setLayout(new BorderLayout());
/* Fill the body. */
Container body = new JPanel(new GridBagLayout());
Container realBody = new JPanel(new BorderLayout());
body.setName("OptionPane.body");
realBody.setName("OptionPane.realBody");
if (getIcon() != null) {
JPanel sep = new JPanel();
sep.setName("OptionPane.separator");
sep.setPreferredSize(new Dimension(15, 1));
realBody.add(sep, BorderLayout.BEFORE_LINE_BEGINS);
}
realBody.add(body, BorderLayout.CENTER);
GridBagConstraints cons = new GridBagConstraints();
cons.gridx = cons.gridy = 0;
cons.gridwidth = GridBagConstraints.REMAINDER;
cons.gridheight = 1;
cons.anchor = DefaultLookup.getInt(optionPane, this, "OptionPane.messageAnchor", GridBagConstraints.CENTER);
cons.insets = new Insets(0, 0, 3, 0);
addMessageComponents(body, cons, getMessage(), getMaxCharactersPerLineCount(), false);
top.add(realBody, BorderLayout.CENTER);
addIcon(top);
return top;
}
use of javax.swing.border.Border in project jdk8u_jdk by JetBrains.
the class BasicSplitPaneUI method installDefaults.
/**
* Installs the UI defaults.
*/
protected void installDefaults() {
LookAndFeel.installBorder(splitPane, "SplitPane.border");
LookAndFeel.installColors(splitPane, "SplitPane.background", "SplitPane.foreground");
LookAndFeel.installProperty(splitPane, "opaque", Boolean.TRUE);
if (divider == null)
divider = createDefaultDivider();
divider.setBasicSplitPaneUI(this);
Border b = divider.getBorder();
if (b == null || !(b instanceof UIResource)) {
divider.setBorder(UIManager.getBorder("SplitPaneDivider.border"));
}
dividerDraggingColor = UIManager.getColor("SplitPaneDivider.draggingColor");
setOrientation(splitPane.getOrientation());
// note: don't rename this temp variable to dividerSize
// since it will conflict with "this.dividerSize" field
Integer temp = (Integer) UIManager.get("SplitPane.dividerSize");
LookAndFeel.installProperty(splitPane, "dividerSize", temp == null ? 10 : temp);
divider.setDividerSize(splitPane.getDividerSize());
dividerSize = divider.getDividerSize();
splitPane.add(divider, JSplitPane.DIVIDER);
setContinuousLayout(splitPane.isContinuousLayout());
resetLayoutManager();
/* Install the nonContinuousLayoutDivider here to avoid having to
add/remove everything later. */
if (nonContinuousLayoutDivider == null) {
setNonContinuousLayoutDivider(createDefaultNonContinuousLayoutDivider(), true);
} else {
setNonContinuousLayoutDivider(nonContinuousLayoutDivider, true);
}
// focus forward traversal key
if (managingFocusForwardTraversalKeys == null) {
managingFocusForwardTraversalKeys = new HashSet<KeyStroke>();
managingFocusForwardTraversalKeys.add(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0));
}
splitPane.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, managingFocusForwardTraversalKeys);
// focus backward traversal key
if (managingFocusBackwardTraversalKeys == null) {
managingFocusBackwardTraversalKeys = new HashSet<KeyStroke>();
managingFocusBackwardTraversalKeys.add(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, InputEvent.SHIFT_MASK));
}
splitPane.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, managingFocusBackwardTraversalKeys);
}
use of javax.swing.border.Border in project jdk8u_jdk by JetBrains.
the class BasicSplitPaneDivider method paint.
/**
* Paints the divider.
*/
public void paint(Graphics g) {
super.paint(g);
// Paint the border.
Border border = getBorder();
if (border != null) {
Dimension size = getSize();
border.paintBorder(this, g, 0, 0, size.width, size.height);
}
}
use of javax.swing.border.Border in project jdk8u_jdk by JetBrains.
the class SynthStyle method installDefaults.
void installDefaults(SynthContext context, SynthUI ui) {
// can have more control over this.
if (!context.isSubregion()) {
JComponent c = context.getComponent();
Border border = c.getBorder();
if (border == null || border instanceof UIResource) {
c.setBorder(new SynthBorder(ui, getInsets(context, null)));
}
}
installDefaults(context);
}
Aggregations