本文整理匯總了Java中javax.swing.plaf.BorderUIResource類的典型用法代碼示例。如果您正苦於以下問題:Java BorderUIResource類的具體用法?Java BorderUIResource怎麽用?Java BorderUIResource使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
BorderUIResource類屬於javax.swing.plaf包,在下文中一共展示了BorderUIResource類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addCustomEntriesToTable
import javax.swing.plaf.BorderUIResource; //導入依賴的package包/類
@Override
public void addCustomEntriesToTable(UIDefaults table) {
Border blackLineBorder =
new BorderUIResource(new LineBorder(getBlack()));
Border whiteLineBorder =
new BorderUIResource(new LineBorder(getWhite()));
Object textBorder = new BorderUIResource(new CompoundBorder(
blackLineBorder,
new BasicBorders.MarginBorder()));
table.put("ToolTip.border", blackLineBorder);
table.put("TitledBorder.border", blackLineBorder);
table.put("Table.focusCellHighlightBorder", whiteLineBorder);
table.put("Table.focusCellForeground", getWhite());
table.put("TextField.border", textBorder);
table.put("PasswordField.border", textBorder);
table.put("TextArea.border", textBorder);
table.put("TextPane.font", textBorder);
}
示例2: addCustomEntriesToTable
import javax.swing.plaf.BorderUIResource; //導入依賴的package包/類
@Override
public void addCustomEntriesToTable(final UIDefaults table) {
final Border blackLineBorder = new BorderUIResource(new LineBorder(getBlack()));
final Object textBorder = new BorderUIResource(new CompoundBorder(blackLineBorder, new BasicBorders.MarginBorder()));
table.put("ToolTip.border", blackLineBorder);
table.put("TitledBorder.border", blackLineBorder);
table.put("TextField.border", textBorder);
table.put("PasswordField.border", textBorder);
table.put("TextArea.border", textBorder);
table.put("TextPane.border", textBorder);
table.put("EditorPane.border", textBorder);
}
示例3: addBasicDefaults
import javax.swing.plaf.BorderUIResource; //導入依賴的package包/類
protected void addBasicDefaults(LookAndFeelAddons addon, List defaults) {
defaults.add(JTipOfTheDay.uiClassID);
defaults.add(BasicTipOfTheDayUI.class.getName());
defaults.add("TipOfTheDay.font");
defaults.add(UIManager.getFont("TextPane.font"));
defaults.add("TipOfTheDay.tipFont");
defaults.add(UIManager.getFont("Label.font").deriveFont(Font.BOLD, 13f));
defaults.add("TipOfTheDay.background");
defaults.add(new ColorUIResource(Color.white));
defaults.add("TipOfTheDay.icon");
defaults.add(LookAndFeel.makeIcon(BasicTipOfTheDayUI.class,
"TipOfTheDay24.gif"));
defaults.add("TipOfTheDay.border");
defaults.add(new BorderUIResource(BorderFactory.createLineBorder(new Color(
117, 117, 117))));
addResource(defaults,
"com.l2fprod.common.swing.plaf.basic.resources.TipOfTheDay");
}
示例4: addWindowsDefaults
import javax.swing.plaf.BorderUIResource; //導入依賴的package包/類
protected void addWindowsDefaults(LookAndFeelAddons addon, List defaults) {
super.addWindowsDefaults(addon, defaults);
defaults.add(JTipOfTheDay.uiClassID);
defaults.add(WindowsTipOfTheDayUI.class.getName());
defaults.add("TipOfTheDay.background");
defaults.add(new ColorUIResource(128, 128, 128));
defaults.add("TipOfTheDay.font");
defaults.add(UIManager.getFont("Label.font").deriveFont(13f));
defaults.add("TipOfTheDay.icon");
defaults.add(LookAndFeel.makeIcon(WindowsTipOfTheDayUI.class,
"tipoftheday.png"));
defaults.add("TipOfTheDay.border");
defaults
.add(new BorderUIResource(new WindowsTipOfTheDayUI.TipAreaBorder()));
addResource(defaults,
"com.l2fprod.common.swing.plaf.windows.resources.TipOfTheDay");
}
示例5: installDefaults
import javax.swing.plaf.BorderUIResource; //導入依賴的package包/類
protected void installDefaults() {
Border b = bar.getBorder();
if (b == null || b instanceof UIResource) {
bar.setBorder(
new BorderUIResource(
new CompoundBorder(
BorderFactory.createLineBorder(
UIManager.getColor("controlDkShadow")),
BorderFactory.createEmptyBorder(1, 1, 1, 1))));
}
Color color = bar.getBackground();
if (color == null || color instanceof ColorUIResource) {
bar.setOpaque(true);
bar.setBackground(new ColorUIResource(Color.white));
}
}
示例6: installDefaults
import javax.swing.plaf.BorderUIResource; //導入依賴的package包/類
protected void installDefaults() {
Border b = bar.getBorder();
if (b == null || b instanceof UIResource) {
bar.setBorder(
new BorderUIResource(
new CompoundBorder(
BorderFactory.createEtchedBorder(),
BorderFactory.createEmptyBorder(2, 2, 2, 2))));
}
if (bar.getBackground() == null
|| bar.getBackground() instanceof UIResource) {
bar.setBackground(new ColorUIResource(128, 128, 128));
bar.setOpaque(true);
}
}
示例7: addBasicDefaults
import javax.swing.plaf.BorderUIResource; //導入依賴的package包/類
@Override
protected void addBasicDefaults(LookAndFeelAddons addon, DefaultsList defaults) {
super.addBasicDefaults(addon, defaults);
Font font = UIManagerExt.getSafeFont("Label.font", new Font("Dialog", Font.PLAIN, 12));
font = font.deriveFont(Font.BOLD, 13f);
defaults.add(JXCategory.uiClassID, BasicCategoryUI.class.getName());
defaults.add("Category.font", UIManagerExt.getSafeFont("TextPane.font",
new FontUIResource("Serif", Font.PLAIN, 12)));
defaults.add("Category.tipFont", new FontUIResource(font));
defaults.add("Category.background", new ColorUIResource(Color.WHITE));
defaults.add("Category.icon",
LookAndFeel.makeIcon(BasicCategoryUI.class, "resources/dictionary_categories.png"));
defaults.add("Category.border", new BorderUIResource(
BorderFactory.createLineBorder(new Color(117, 117, 117))));
UIManagerExt.addResourceBundle(
"org.jdesktop.swingx.plaf.basic.resources.Category");
}
示例8: addWindowsDefaults
import javax.swing.plaf.BorderUIResource; //導入依賴的package包/類
/**
* {@inheritDoc}
*/
@Override
protected void addWindowsDefaults(LookAndFeelAddons addon, DefaultsList defaults) {
super.addWindowsDefaults(addon, defaults);
Font font = UIManagerExt.getSafeFont("Label.font",
new Font("Dialog", Font.PLAIN, 12));
font = font.deriveFont(13f);
defaults.add(JXCategory.uiClassID, WindowsTipOfTheDayUI.class.getName());
defaults.add("Category.background", new ColorUIResource(Color.GRAY));
defaults.add("Category.font", new FontUIResource(font));
defaults.add("Category.icon",
LookAndFeel.makeIcon(WindowsTipOfTheDayUI.class, "resources/tipoftheday.png"));
defaults.add("Category.border" ,new BorderUIResource(new WindowsTipOfTheDayUI.TipAreaBorder()));
UIManagerExt.addResourceBundle(
"org.jdesktop.swingx.plaf.windows.resources.TipOfTheDay");
}
示例9: addBasicDefaults
import javax.swing.plaf.BorderUIResource; //導入依賴的package包/類
@Override
protected void addBasicDefaults(LookAndFeelAddons addon, DefaultsList defaults) {
super.addBasicDefaults(addon, defaults);
Font font = UIManagerExt.getSafeFont("Label.font", new Font("Dialog", Font.PLAIN, 12));
font = font.deriveFont(Font.BOLD, 13f);
defaults.add(JXTipOfTheDay.uiClassID, BasicTipOfTheDayUI.class.getName());
defaults.add("TipOfTheDay.font", UIManagerExt.getSafeFont("TextPane.font",
new FontUIResource("Serif", Font.PLAIN, 12)));
defaults.add("TipOfTheDay.tipFont", new FontUIResource(font));
defaults.add("TipOfTheDay.background", new ColorUIResource(Color.WHITE));
defaults.add("TipOfTheDay.icon",
LookAndFeel.makeIcon(BasicTipOfTheDayUI.class, "resources/TipOfTheDay24.gif"));
defaults.add("TipOfTheDay.border", new BorderUIResource(
BorderFactory.createLineBorder(new Color(117, 117, 117))));
UIManagerExt.addResourceBundle(
"org.jdesktop.swingx.plaf.basic.resources.TipOfTheDay");
}
示例10: addWindowsDefaults
import javax.swing.plaf.BorderUIResource; //導入依賴的package包/類
/**
* {@inheritDoc}
*/
@Override
protected void addWindowsDefaults(LookAndFeelAddons addon, DefaultsList defaults) {
super.addWindowsDefaults(addon, defaults);
Font font = UIManagerExt.getSafeFont("Label.font",
new Font("Dialog", Font.PLAIN, 12));
font = font.deriveFont(13f);
defaults.add(JXTipOfTheDay.uiClassID, WindowsTipOfTheDayUI.class.getName());
defaults.add("TipOfTheDay.background", new ColorUIResource(Color.GRAY));
defaults.add("TipOfTheDay.font", new FontUIResource(font));
defaults.add("TipOfTheDay.icon",
LookAndFeel.makeIcon(WindowsTipOfTheDayUI.class, "resources/tipoftheday.png"));
defaults.add("TipOfTheDay.border" ,new BorderUIResource(new WindowsTipOfTheDayUI.TipAreaBorder()));
UIManagerExt.addResourceBundle(
"org.jdesktop.swingx.plaf.windows.resources.TipOfTheDay");
}
示例11: 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));
}
示例12: uiImpl
import javax.swing.plaf.BorderUIResource; //導入依賴的package包/類
/**
* Ui impl.
*/
public static void uiImpl()
{
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 視口的相關ui值設定
UIManager.put("Viewport.background",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
UIManager.put("Viewport.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> JScrollPane的相關ui值設定
UIManager.put("ScrollPane.border",new BorderUIResource(new org.jb2011.lnf.beautyeye.ch4_scroll.ScrollPaneBorder()));//BorderFactory.createEmptyBorder(0, 0, 0, 0)));
// 不能設置alpha通道小於255的透明顏色,否則會出現無法重paint的問題
UIManager.put("ScrollPane.background",new ColorUIResource(Color.white));//cc));
UIManager.put("ScrollPane.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
UIManager.put("ScrollPaneUI",org.jb2011.lnf.beautyeye.ch4_scroll.BEScrollPaneUI.class.getName());
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> JScrollPane的滾動條相關ui值設定
UIManager.put("ScrollBar.thumb",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
UIManager.put("ScrollBar.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
UIManager.put("ScrollBar.background",new ColorUIResource(new Color(250,250,250)));
UIManager.put("ScrollBar.trackForeground",new ColorUIResource(new Color(250,250,250)));
UIManager.put("scrollbar",new ColorUIResource(new Color(250,250,250)));
UIManager.put("ScrollBarUI",org.jb2011.lnf.beautyeye.ch4_scroll.BEScrollBarUI.class.getName());
// /* ~~注:這個屬性是jb2011自已加的,目的是控製滾動麵板及其Viewport的透明性 */
// //設置成透明是為了讓BE LNF中它的N9圖實現的border能展現出圖片背景來,好看一點
// UIManager.put("ScrollPane.opaque", false);
}
示例13: initForVista
import javax.swing.plaf.BorderUIResource; //導入依賴的package包/類
/**
* 因Windos LNF會在Vista及更新的操作係統(如win7)上對Windows LNF作附加設置,
* 以保證與Vista及更新平台的外觀的一致性(如讓菜單菜項高度更大等),請參見
* WindowsLookAndFeel.initVistaComponentDefaults(..)。
* <p>
* BeautyEye中因需要保證審美一致性(在所有win平台上)而不需要這些額外的設置,
* 但因該方法是private私有方法,無法進行覆蓋屏蔽,所以隻能在此單列方法,以便針對Vista
* 及更新的平台進行補救性重新設置以便與BeautyEye LNF的審核進行適配.
*
* @see WindowsLookAndFeel.initVistaComponentDefaults(..)
*/
protected void initForVista()
{
if(WinUtils.isOnVista())
{
UIManager.put("CheckBoxMenuItem.margin",new InsetsUIResource(0,0,0,0));
UIManager.put("RadioButtonMenuItem.margin",new InsetsUIResource(0,0,0,0));
UIManager.put("Menu.margin",new InsetsUIResource(0,0,0,0));//windows lnf xp中默認是2,2,2,2
UIManager.put("MenuItem.margin",new InsetsUIResource(0,0,0,0));//windows lnf中 xp默認是2,2,2,2
UIManager.put("Menu.border",new BorderUIResource(BorderFactory.createEmptyBorder(1,3,2,3)));//javax.swing.plaf.basic.BasicBorders.MarginBorder;
UIManager.put("MenuItem.border",new BorderUIResource(BorderFactory.createEmptyBorder(1,0,2,0)));//javax.swing.plaf.basic.BasicBorders.MarginBorder;
UIManager.put("CheckBoxMenuItem.border",new BorderUIResource(BorderFactory.createEmptyBorder(4,2,4,2)));//javax.swing.plaf.basic.BasicBorders.MarginBorder;
UIManager.put("RadioButtonMenuItem.border",new BorderUIResource(BorderFactory.createEmptyBorder(4,0,4,0)));//javax.swing.plaf.basic.BasicBorders.MarginBorder;
// UIManager.put("PopupMenu.border",new BorderUIResource(BorderFactory.createEmptyBorder(20,10,20,10)));//
UIManager.put("CheckBoxMenuItem.checkIcon"
,new org.jb2011.lnf.beautyeye.ch9_menu.BECheckBoxMenuItemUI.CheckBoxMenuItemIcon().setUsedForVista(true));//javax.swing.plaf.basic.BasicIconFactory.CheckBoxMenuItemIcon);
UIManager.put("RadioButtonMenuItem.checkIcon"
,new org.jb2011.lnf.beautyeye.ch9_menu.BERadioButtonMenuItemUI.RadioButtonMenuItemIcon().setUsedForVista(true));
}
}
示例14: uiImpl
import javax.swing.plaf.BorderUIResource; //導入依賴的package包/類
/**
* Ui impl.
*/
public static void uiImpl()
{
//通過此border可以調整整個列表的上下左右的空白
UIManager.put("List.border",new BorderUIResource(BorderFactory.createEmptyBorder(0,0,0,0)));
//本屬性將決定已被選中的列表單元顯示文本的上下左右空白哦
UIManager.put("List.focusCellHighlightBorder",new BorderUIResource(BorderFactory.createEmptyBorder(1, 8, 5, 3)));//new BorderUIResource(new BEDashedBorder(Color.red,true,false,true,false)));
/* ~~注:這個屬性是jb2011為了更好的ui效果自已加的屬性 */
UIManager.put("List.focusSelectedCellHighlightBorderColor", new ColorUIResource(new Color(252,87,84)));//220,0,0,255)));//Color.red
/* ~~注:這個屬性是jb2011為了更好的ui效果自已加的屬性,目的是使List.focusSelectedCellHighlightBorderColor有點立體效果哦 */
UIManager.put("List.focusSelectedCellHighlightBorderHighlightColor"
, new ColorUIResource(new Color(255,255,255,70)));//注意:這個顏色是半透明的哦
//列表單元獲得焦點時的邊框(windows主題下是一個距形虛線框)——之前老也想不通的與左邊隔一個像素的白邊問題就是沒設置它造成的
UIManager.put("List.focusSelectedCellHighlightBorder"
,new BorderUIResource(new org.jb2011.lnf.beautyeye.ch19_list.__UI__.FocusSelectedCellHighlightBorder()));
//將決定正狀態下的列表單元顯示文本的上下左右空白哦
UIManager.put("List.cellNoFocusBorder",new BorderUIResource(BorderFactory.createEmptyBorder(1, 8, 5, 3)));
UIManager.put("List.background",new ColorUIResource(Color.white));
UIManager.put("List.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
UIManager.put("List.selectionForeground",Color.white);//fgColor);
UIManager.put("List.selectionBackground",new ColorUIResource(BeautyEyeLNFHelper.commonSelectionBackgroundColor));
UIManager.put("List.cellRenderer", new MyDefaultListCellRenderer.UIResource());
UIManager.put("ListUI", org.jb2011.lnf.beautyeye.ch19_list.BEListUI.class.getName());
}
示例15: uiImpl
import javax.swing.plaf.BorderUIResource; //導入依賴的package包/類
/**
* Ui impl.
*/
public static void uiImpl()
{
UIManager.put("SplitPane.shadow",new ColorUIResource(new Color(200,200,200)));// 本屬性在BE LNF中暫時沒用到
//JSplitePane的默認背景色
UIManager.put("SplitPane.background",new ColorUIResource(new Color(250,250,250)));//238,241,243)));
//JSplitePane的邊框實現
UIManager.put("SplitPane.border",new BorderUIResource(new org.jb2011.lnf.beautyeye.ch4_scroll.ScrollPaneBorder()));//BorderFactory.createEmptyBorder(0, 0, 0, 0)));
UIManager.put("SplitPaneUI",org.jb2011.lnf.beautyeye.ch17_split.BESplitPaneUI.class.getName());
//分隔條拖動時的顏色(說明:此值可以設置alpha通道以便達到半透明效果哦)
UIManager.put("SplitPaneDivider.draggingColor",new ColorUIResource(new Color(0,0,0,50)));
//觸碰按鈕的默認大小
UIManager.put("SplitPane.oneTouchButtonSize",4);//drfault is 5
//分隔條的默認大小
UIManager.put("SplitPane.dividerSize",7);//drfault is 5
//分隔條的邊框實現
UIManager.put("SplitPaneDivider.border",new SplitPaneDividerBorder());
}