本文整理汇总了Java中javax.swing.plaf.BorderUIResource.CompoundBorderUIResource方法的典型用法代码示例。如果您正苦于以下问题:Java BorderUIResource.CompoundBorderUIResource方法的具体用法?Java BorderUIResource.CompoundBorderUIResource怎么用?Java BorderUIResource.CompoundBorderUIResource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.plaf.BorderUIResource
的用法示例。
在下文中一共展示了BorderUIResource.CompoundBorderUIResource方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getInternalFrameBorder
import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
/**
* Returns a border that is composed of a raised bevel border and a
* one-pixel thick line border.
*
* <p><img src="doc-files/BasicBorders-2.png" width="300" height="200"
* alt="[A screen shot of a border returned by this method]" />
*
* <p>The colors of the border are retrieved from the
* <code>UIDefaults</code> of the currently active look and feel
* using the keys <code>“InternalFrame.borderShadow”</code>,
* <code>“InternalFrame.borderDarkShadow”</code>,
* <code>“InternalFrame.borderLight”</code>,
* <code>“InternalFrame.borderHighlight”</code>, and
* (for the inner one-pixel thick line)
* <code>“InternalFrame.borderColor”</code>.
*/
public static Border getInternalFrameBorder()
{
Color shadow, darkShadow, highlight, lightHighlight, line;
/* See comment in methods above for why this border is not shared. */
shadow = UIManager.getColor("InternalFrame.borderShadow");
darkShadow = UIManager.getColor("InternalFrame.borderDarkShadow");
highlight = UIManager.getColor("InternalFrame.borderLight");
lightHighlight = UIManager.getColor("InternalFrame.borderHighlight");
line = UIManager.getColor("InternalFrame.borderColor");
return new BorderUIResource.CompoundBorderUIResource(
/* outer border */
new BorderUIResource.BevelBorderUIResource(
BevelBorder.RAISED,
(highlight != null) ? highlight : Color.lightGray,
(lightHighlight != null) ? lightHighlight : Color.white,
(darkShadow != null) ? darkShadow : Color.black,
(shadow != null) ? shadow : Color.gray),
/* inner border */
new BorderUIResource.LineBorderUIResource(
(line != null) ? line : Color.lightGray));
}
示例2: addMetalDefaults
import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
@Override
protected void addMetalDefaults(LookAndFeelAddons addon,
DefaultsList defaults) {
super.addMetalDefaults(addon, defaults);
String key = "TableHeader.cellBorder";
Border border = UIManager.getBorder(key);
if (border instanceof MetalBorders.TableHeaderBorder) {
border = new BorderUIResource.CompoundBorderUIResource(border,
BorderFactory.createEmptyBorder());
// PENDING JW: this is fishy ... adding to lookAndFeelDefaults is taken
UIManager.getLookAndFeelDefaults().put(key, border);
// adding to defaults is not
// defaults.add(key, border);
}
}
示例3: setupUI
import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
/**
* Set up the user interface.
*/
public static void setupUI() {
try {
final String classname = UIManager.getSystemLookAndFeelClassName();
UIManager.setLookAndFeel(classname);
}
catch (Exception e) {
e.printStackTrace();
}
final UIDefaults defaults = UIManager.getDefaults();
defaults.put(
"PopupMenu.border",
new BorderUIResource.EtchedBorderUIResource(
EtchedBorder.RAISED, defaults.getColor("controlShadow"),
defaults.getColor("controlLtHighlight")
)
);
final MatteBorder matteborder = new MatteBorder(1, 1, 1, 1, Color.black);
final EmptyBorder emptyborder = new MatteBorder(2, 2, 2, 2, defaults.getColor("control"));
final BorderUIResource.CompoundBorderUIResource compBorder
= new BorderUIResource.CompoundBorderUIResource(emptyborder, matteborder);
final BorderUIResource.EmptyBorderUIResource emptyBorderUI
= new BorderUIResource.EmptyBorderUIResource(0, 0, 0, 0);
defaults.put("SplitPane.border", emptyBorderUI);
defaults.put("Table.scrollPaneBorder", emptyBorderUI);
defaults.put("ComboBox.border", compBorder);
defaults.put("TextField.border", compBorder);
defaults.put("TextArea.border", compBorder);
defaults.put("CheckBox.border", compBorder);
defaults.put("ScrollPane.border", emptyBorderUI);
}
示例4: getButtonBorder
import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
/**
* Returns a border for Swing buttons in the Metal Look & Feel.
*
* @return a border for Swing buttons in the Metal Look & Feel
*/
public static Border getButtonBorder()
{
if (buttonBorder == null)
{
Border outer = new ButtonBorder();
Border inner = getMarginBorder();
buttonBorder = new BorderUIResource.CompoundBorderUIResource(outer,
inner);
}
return buttonBorder;
}
示例5: getToggleButtonBorder
import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
/**
* Returns a border for use with {@link JToggleButton} components.
*
* @return A border.
*
* @since 1.3
*/
public static Border getToggleButtonBorder()
{
if (toggleButtonBorder == null)
{
Border outer = new ToggleButtonBorder();
Border inner = getMarginBorder();
toggleButtonBorder = new BorderUIResource.CompoundBorderUIResource(
outer, inner);
}
return toggleButtonBorder;
}
示例6: getTextFieldBorder
import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
/**
* Returns a border for use by the {@link JTextField} component.
*
* @return A border.
*
* @since 1.3
*/
public static Border getTextFieldBorder()
{
if (textFieldBorder == null)
{
Border inner = getMarginBorder();
Border outer = new TextFieldBorder();
textFieldBorder =
new BorderUIResource.CompoundBorderUIResource(outer, inner);
}
return textFieldBorder;
}
示例7: getTextBorder
import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
/**
* Returns the border that is used for text components (except text fields,
* which use {@link #getTextFieldBorder}.
*
* @return the border that is used for text components
*
* @since 1.3
*/
public static Border getTextBorder()
{
if (textBorder == null)
{
Border inner = getMarginBorder();
Border outer = new Flush3DBorder();
textBorder =
new BorderUIResource.CompoundBorderUIResource(outer, inner);
}
return textBorder;
}
示例8: getRolloverBorder
import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
/**
* Returns a shared instance of a compound border for rollover buttons.
*
* @return A shared border instance.
*/
static Border getRolloverBorder()
{
if (rolloverBorder == null)
{
Border outer = new MetalBorders.RolloverButtonBorder();
Border inner = MetalBorders.getMarginBorder();
rolloverBorder = new BorderUIResource.CompoundBorderUIResource(outer,
inner);
}
return rolloverBorder;
}
示例9: getButtonBorder
import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
/**
* Returns a border for drawing push buttons.
*
* <p>The colors of the border are retrieved from the
* <code>UIDefaults</code> of the currently active look and feel
* using the keys <code>“Button.shadow”</code>,
* <code>“Button.darkShadow”</code>,
* <code>“Button.light”</code>, and
* <code>“Button.highlight”</code>.
*
* <p><img src="doc-files/BasicBorders.ButtonBorder-1.png" width="300"
* height="170" alt="[A screen shot of the returned border]" />
*
* @return a {@link
* javax.swing.plaf.BorderUIResource.CompoundBorderUIResource}
* whose outer border is a {@link ButtonBorder} and whose
* inner border is a {@link MarginBorder}.
*/
public static Border getButtonBorder()
{
Border outer;
/* The keys for UIDefaults have been determined by writing a
* test program that dumps the UIDefaults to stdout; that program
* was run on a JDK 1.4.1_01 for GNU/Linux. Note that in the API,
* the key "light" is usually called "highlight", and "highlight"
* is usually called "lightHighlight".
*/
outer = new ButtonBorder(UIManager.getColor("Button.shadow"),
UIManager.getColor("Button.darkShadow"),
UIManager.getColor("Button.light"),
UIManager.getColor("Button.highlight"));
/* While the inner border is shared between multiple buttons,
* we do not share the outer border because ButtonBorders store
* their border colors. We cannot guarantee that the colors
* (which come from UIDefaults) are unchanged between invocations
* of getButtonBorder. We could store the last colors, and share
* the button border if the colors are the same as in the last
* invocation, but it probably is not worth the effort.
*/
return new BorderUIResource.CompoundBorderUIResource(
outer,
/* inner */ getMarginBorder());
}
示例10: getRadioButtonBorder
import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
/**
* Returns a border for drawing radio buttons.
*
* <p>The colors of the border are retrieved from the
* <code>UIDefaults</code> of the currently active look and feel
* using the keys <code>“RadioButton.shadow”</code>,
* <code>“RadioButton.darkShadow”</code>,
* <code>“RadioButton.light”</code>, and
* <code>“RadioButton.highlight”</code>.
*
* <p><img src="doc-files/BasicBorders.RadioButtonBorder-1.png" width="300"
* height="135" alt="[A screen shot of the returned border]" />
*
* @return a {@link
* javax.swing.plaf.BorderUIResource.CompoundBorderUIResource}
* whose outer border is a {@link RadioButtonBorder} and whose
* inner border is a {@link MarginBorder}.
*/
public static Border getRadioButtonBorder()
{
Border outer;
/* The keys for UIDefaults have been determined by writing a
* test program that dumps the UIDefaults to stdout; that program
* was run on a JDK 1.4.1_01 for GNU/Linux. Note that in the API,
* the key "light" is usually called "highlight", and "highlight"
* is usually called "lightHighlight".
*/
outer = new RadioButtonBorder(
UIManager.getColor("RadioButton.shadow"),
UIManager.getColor("RadioButton.darkShadow"),
UIManager.getColor("RadioButton.light"),
UIManager.getColor("RadioButton.highlight"));
/* While the inner border is shared between multiple buttons, we
* do not share the outer border because RadioButtonBorders, being
* ButtonBorders, store their border colors. We cannot guarantee
* that the colors (which come from UIDefaults) are unchanged
* between invocations of getButtonBorder. We could store the last
* colors, and share the button border if the colors are the same
* as in the last invocation, but it probably is not worth the
* effort.
*/
return new BorderUIResource.CompoundBorderUIResource(
outer,
/* inner */ getMarginBorder());
}
示例11: getToggleButtonBorder
import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
/**
* Returns a border for drawing toggle buttons.
*
* <p>The colors of the border are retrieved from the
* <code>UIDefaults</code> of the currently active look and feel
* using the keys <code>“ToggleButton.shadow”</code>,
* <code>“ToggleButton.darkShadow”</code>,
* <code>“ToggleButton.light”</code>, and
* <code>“ToggleButton.highlight”</code>.
*
* <p><img src="doc-files/BasicBorders.ToggleButtonBorder-1.png" width="270"
* height="135" alt="[A screen shot of the returned border]" />
*
* @return a {@link
* javax.swing.plaf.BorderUIResource.CompoundBorderUIResource}
* whose outer border is a {@link ToggleButtonBorder} and whose
* inner border is a {@link MarginBorder}.
*/
public static Border getToggleButtonBorder()
{
Border outer;
/* The keys for UIDefaults have been determined by writing a
* test program that dumps the UIDefaults to stdout; that program
* was run on a JDK 1.4.1_01 for GNU/Linux. Note that in the API,
* the key "light" is usually called "highlight", and "highlight"
* is usually called "lightHighlight".
*/
outer = new ToggleButtonBorder(
UIManager.getColor("ToggleButton.shadow"),
UIManager.getColor("ToggleButton.darkShadow"),
UIManager.getColor("ToggleButton.light"),
UIManager.getColor("ToggleButton.highlight"));
/* While the inner border is shared between multiple buttons, we
* do not share the outer border because ToggleButtonBorders, being
* ButtonBorders, store their border colors. We cannot guarantee
* that the colors (which come from UIDefaults) are unchanged
* between invocations of getButtonBorder. We could store the last
* colors, and share the button border if the colors are the same
* as in the last invocation, but it probably is not worth the
* effort.
*/
return new BorderUIResource.CompoundBorderUIResource(
outer,
/* inner */ getMarginBorder());
}
示例12: getButtonBorder
import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
public static Border getButtonBorder() {
if (ourButtonBorder == null) {
ourButtonBorder = new BorderUIResource.CompoundBorderUIResource(
new ButtonBorder(),
new BasicBorders.MarginBorder());
}
return ourButtonBorder;
}
示例13: getTextFieldBorder
import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
public static Border getTextFieldBorder() {
if (ourTextFieldBorder == null) {
ourTextFieldBorder = new BorderUIResource.CompoundBorderUIResource(
new TextFieldBorder(),
//new FlatLineBorder(),
BorderFactory.createEmptyBorder(2, 2, 2, 2));
}
return ourTextFieldBorder;
}
示例14: getEtchedBorder
import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
static Border getEtchedBorder()
/* 65: */ {
/* 66:130 */ if (etchedBorder == null) {
/* 67:131 */ etchedBorder = new BorderUIResource.CompoundBorderUIResource(new EtchedBorder(null), new BasicBorders.MarginBorder());
/* 68: */ }
/* 69:135 */ return etchedBorder;
/* 70: */ }
示例15: getMenuBarHeaderBorder
import javax.swing.plaf.BorderUIResource; //导入方法依赖的package包/类
static Border getMenuBarHeaderBorder()
/* 86: */ {
/* 87:166 */ if (menuBarHeaderBorder == null) {
/* 88:167 */ menuBarHeaderBorder = new BorderUIResource.CompoundBorderUIResource(new MenuBarHeaderBorder(null), new BasicBorders.MarginBorder());
/* 89: */ }
/* 90:171 */ return menuBarHeaderBorder;
/* 91: */ }