org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper Java Examples

The following examples show how to use org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ReflectHelper.java    From beautyeye with Apache License 2.0 6 votes vote down vote up
/**
	 * 通过反射调用指定Class对象的指定方法(包括静态方法和实例方法).
	 * 
	 * @param theClass 类
	 * @param theObject 要调用方法所对应的类对象,如果要调用的是静态方法则本参数与theClass是同一个Class对象哦
	 * @param methodName 要调用的方法名
	 * @param paramsType 要调用的方法参数类型,无参数则传null
	 * @param paramsValue 要调用的方法参数值,无参数值则传null
	 * @return 如果该方法有返回值且正常调用则返回该值,否则返回null
	 */
	public static Object invokeMethod(Class theClass, Object theObject, String methodName
			, Class[] paramsType, Object[] paramsValue)
	{
		Object ret = null;
		if(theClass != null)
		{
			try
			{
				Method m = theClass.getMethod(methodName, paramsType);
				ret = m.invoke(theObject, paramsValue);
//				 System.out.println("@通过反射调用方法"+theClass.getName()+"."+methodName
//										   +"("+Arrays.toString(paramsType)+")成功.");
			}
			catch (Exception e)
			{
				if(BeautyEyeLNFHelper.debug)
					e.printStackTrace();
				
				LogHelper.error("通过反射调用方法"+theClass.getName()+"."+methodName
						+"("+Arrays.toString(paramsType)+")失败,您的JRE版本可能需要更新,"+e.getMessage());
			}
		}
		return ret;
	}
 
Example #2
Source File: __UI__.java    From beautyeye with Apache License 2.0 6 votes vote down vote up
/**
 * 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());
}
 
Example #3
Source File: Init.java    From MooTool with MIT License 6 votes vote down vote up
/**
 * 初始化look and feel
 */
public static void initTheme() {

    try {
        switch (App.config.getTheme()) {
            case "BeautyEye":
                BeautyEyeLNFHelper.launchBeautyEyeLNF();
                UIManager.put("RootPane.setupButtonVisible", false);
                break;
            case "系统默认":
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                break;
            case "weblaf":
            case "Darcula(推荐)":
            default:
                if (SystemUtil.isLinuxOs()) {
                    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                } else {
                    UIManager.setLookAndFeel("com.bulenkov.darcula.DarculaLaf");
                }
        }
    } catch (Exception e) {
        logger.error(e);
    }
}
 
Example #4
Source File: __UI__.java    From beautyeye with Apache License 2.0 6 votes vote down vote up
/**
	 * Ui impl.
	 */
	public static void uiImpl()
	{
//		UIManager.put("CheckBox.border",new BorderUIResource(new BERoundBorder().setArcWidth(0)));
		
		UIManager.put("CheckBox.margin",new InsetsUIResource(4,3,4,3));
		UIManager.put("RadioButton.margin",new InsetsUIResource(4,3,4,3));//2, 2, 2, 2));
		
		UIManager.put("RadioButton.background",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		UIManager.put("CheckBox.background",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		
		UIManager.put("CheckBox.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
		UIManager.put("RadioButton.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
		
		UIManager.put("RadioButton.icon", new RadioButtonIcon());
		UIManager.put("CheckBox.icon", new CheckBoxIcon());

		//衬距设定
		UIManager.put("RadioButton.margin", new InsetsUIResource(1,1,1,1));//默认是2,2,2,2
		UIManager.put("CheckBox.margin", new InsetsUIResource(1,1,1,1));//默认是2,2,2,2
	}
 
Example #5
Source File: __UI__.java    From beautyeye with Apache License 2.0 6 votes vote down vote up
/**
	 * 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);
	}
 
Example #6
Source File: SwingSet2.java    From beautyeye with Apache License 2.0 6 votes vote down vote up
/**
	 * SwingSet2 Main. Called only if we're an application, not an applet.
	 *
	 * @param args the arguments
	 * @throws Exception the exception
	 */
	public static void main(String[] args) throws Exception {
		// Create SwingSet on the default monitor
//		BeautyEyeLNFHelper.frameBorderStyle = 
//			BeautyEyeLNFHelper.FrameBorderStyle.osLookAndFeelDecorated;
////		UIManager.setLookAndFeel(BeautyEyeLNFHelper.getBeautyEyeLNFCrossPlatform());//new WindowsLookAndFeel());
//		UIManager.put("RootPane.setupButtonVisible", false);
		BeautyEyeLNFHelper.debug = true;
//		BeautyEyeLNFHelper.translucencyAtFrameInactive = false;
		BeautyEyeLNFHelper.launchBeautyEyeLNF();
//		UIManager.put("ToolBar.border",new BorderUIResource(
//				new org.jb2011.lnf.beautyeye.ch8_toolbar.BEToolBarUI.ToolBarBorder(UIManager.getColor("ToolBar.shadow"),
//						UIManager.getColor("ToolBar.highlight"), new Insets(6, 0, 0, 0))));
		
//		JFrame.setDefaultLookAndFeelDecorated(true);
//		JDialog.setDefaultLookAndFeelDecorated(true);
//		UIManager.setLookAndFeel(new MetalLookAndFeel());
//		UIManager.setLookAndFeel(new WindowsLookAndFeel());
		
		SwingSet2 swingset = new SwingSet2(null, GraphicsEnvironment.
				getLocalGraphicsEnvironment().
				getDefaultScreenDevice().
				getDefaultConfiguration());
	}
 
Example #7
Source File: SwingSet3.java    From beautyeye with Apache License 2.0 6 votes vote down vote up
@Override
    protected void initialize(String args[]) {        
        try {
        	// TODO Use nimbus L&F by Oracle
//          UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
        	
        	// TODO Use Beauty L&F by Jack Jiang
        	BeautyEyeLNFHelper.launchBeautyEyeLNF();
        	UIManager.put("RootPane.setupButtonVisible", false);
        	
        } catch (Exception ex) {
            // not catestrophic
        }
        resourceMap = getContext().getResourceMap();
        
        title = resourceMap.getString("mainFrame.title");
        runningDemoCache = new HashMap<String, DemoPanel>();
        setDemoList(resourceMap.getString("demos.title"), getDemoClassNames(args));

        IntroPanel intro = new IntroPanel();
        setDemoPlaceholder(intro);

    }
 
Example #8
Source File: Init.java    From WePush with MIT License 6 votes vote down vote up
/**
 * 初始化look and feel
 */
public static void initTheme() {

    try {
        switch (App.config.getTheme()) {
            case "BeautyEye":
                BeautyEyeLNFHelper.launchBeautyEyeLNF();
                UIManager.put("RootPane.setupButtonVisible", false);
                break;
            case "系统默认":
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                break;
            case "weblaf":
            case "Darcula(推荐)":
            default:
                UIManager.setLookAndFeel("com.bulenkov.darcula.DarculaLaf");
        }
    } catch (Exception e) {
        logger.error(e);
    }
}
 
Example #9
Source File: __UI__.java    From beautyeye with Apache License 2.0 5 votes vote down vote up
/**
	 * Ui impl.
	 */
	public static void uiImpl()
	{
		UIManager.put("Tree.background",new ColorUIResource(Color.white));
		UIManager.put("Tree.textBackground",new ColorUIResource(Color.white));
//		UIManager.put("Tree.drawsFocusBorderAroundIcon",new Boolean(false));
		UIManager.put("Tree.selectionForeground",new ColorUIResource(BeautyEyeLNFHelper.commonSelectionForegroundColor));
		UIManager.put("Tree.selectionBackground",new ColorUIResource(BeautyEyeLNFHelper.commonSelectionBackgroundColor));
		UIManager.put("Tree.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
		UIManager.put("Tree.selectionBorderColor",new ColorUIResource(BeautyEyeLNFHelper.commonFocusedBorderColor));//windows父类中默认是0,0,0
		
		UIManager.put("Tree.openIcon",__IconFactory__.getInstance().getTreeDefaultOpenIcon_16_16());
		UIManager.put("Tree.closedIcon",__IconFactory__.getInstance().getTreeDefaultClosedIcon_16_16());
		UIManager.put("Tree.leafIcon",__IconFactory__.getInstance().getTreeDefaultLeafIcon_16_16());
		UIManager.put("Tree.expandedIcon",__IconFactory__.getInstance().getTreeA());
//				,new org.jb2011.lnf.windows2.ch16.BETreeUI.ExpandedIcon());
		UIManager.put("Tree.collapsedIcon",__IconFactory__.getInstance().getTreeB());
//				,new org.jb2011.lnf.windows2.ch16.BETreeUI.CollapsedIcon());
		
		//不绘制层次线
		UIManager.put("Tree.paintLines", false);//default is true
		//行高
		UIManager.put("Tree.rowHeight", 18);//default is 16
		//未选中时单元前景色(备选MacOSX黑 (35,35,35))
		UIManager.put("Tree.textForeground", new ColorUIResource(70,70,70));
		//处于编辑状态时的文本框边框,因BE LNF中文本框无边框(事实上它是用N9图实现的背景
		//边框视觉效果),所以此处要去掉,但加多点空白,与背景配合起来好看点
		UIManager.put("Tree.editorBorder"
				, new BorderUIResource(BorderFactory.createEmptyBorder(1,5,1,5)));//Windows LNF中默认是LineBorderUIResource
		
		UIManager.put("TreeUI",org.jb2011.lnf.beautyeye.ch16_tree.BETreeUI.class.getName());
	}
 
Example #10
Source File: __UI__.java    From beautyeye with Apache License 2.0 5 votes vote down vote up
/**
	 * Ui impl.
	 */
	public static void uiImpl()
	{
		UIManager.put("TabbedPane.background",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		UIManager.put("TabbedPane.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
//		UIManager.put("TabbedPane.tabRunOverlay", 2);//本属性无效果
		//false表示tab在边框虑线之上而不是重叠效果
		UIManager.put("TabbedPane.tabsOverlapBorder",true);
		UIManager.put("TabbedPaneUI",org.jb2011.lnf.beautyeye.ch2_tab.BETabbedPaneUI.class.getName());
		//此属性决定了整个JTabbedPane区域的内衬
		UIManager.put("TabbedPane.tabAreaInsets"
				,new javax.swing.plaf.InsetsUIResource(3,20,2,20));//默认是3,2,2,2
		//此属性决定了tab与内容面板间的空白
		UIManager.put("TabbedPane.contentBorderInsets"
				,new javax.swing.plaf.InsetsUIResource(2,0,3,0));//默认是2,2,3,3
		//此参数将决定选中时的tab与左右相邻tab的重合度,正值表示重合、负值表示间隔(空白)
		UIManager.put("TabbedPane.selectedTabPadInsets"//* 注意与NP图的边缘留白配合使用能达到更灵活的效果
				,new javax.swing.plaf.InsetsUIResource(0,1,0,2));//默认是 2,2,2,1
		//此属性决定了JTabbedPane的tab标签的内衬
		UIManager.put("TabbedPane.tabInsets",new javax.swing.plaf.InsetsUIResource(7,15,9,15));//默认是1,4,1,4
		//获得焦点时的虚线框颜色
		UIManager.put("TabbedPane.focus",new ColorUIResource(130,130,130));
		ColorUIResource highlight = new ColorUIResource(BeautyEyeLNFHelper.commonFocusedBorderColor);//192,192,192);
		//在BE LNF中,此颜色将决定TabPlacement=TOP和LEFT二种类型TabbedPane的内容面板那条虚线的颜色
		UIManager.put("TabbedPane.highlight",highlight);//new Color(200,200,200)));
		//在BE LNF中,此颜色将决定TabPlacement=RIGHT和BOTTOM二种类型TabbedPane的内容面板那条虚线的颜色
		UIManager.put("TabbedPane.shadow",highlight);
		//在BE LNF中,因TabPlacement=RIGHT和BOTTOM二种类型时,父类方法会默认再多画一条深色立体线而使得在BE LNF中
		//不好看,此颜色设置的目的就是让此立体阴影线与背景色一致从而看不出它的效果,进而不影响内容面板那条虚线在BE LNF中的视觉效果
		UIManager.put("TabbedPane.darkShadow"
				,new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
	}
 
Example #11
Source File: BERootPaneUI.java    From beautyeye with Apache License 2.0 5 votes vote down vote up
/**
	 * Installs the necessary state onto the JRootPane to render client
	 * decorations. This is ONLY invoked if the <code>JRootPane</code>
	 * has a decoration style other than <code>JRootPane.NONE</code>.
	 *
	 * @param root the root
	 */
	private void installClientDecorations(JRootPane root)
	{
		installBorder(root);

		JComponent titlePane = createTitlePane(root);

		setTitlePane(root, titlePane);
		installWindowListeners(root, root.getParent());
		installLayout(root);
		
		//只有在窗口边框是半透明的情况下,以下才需要设置窗口透明
		//* 注意:本类中的此处代码的目的就是为了实现半透明边框窗口的
		//* 正常显示,而且仅针对此目的。如果该边框不为透明,则此处也就不需要设置
		//* 窗口透明了,那么如果你的程序其它地方需要窗口透明的话,自行.setWindowOpaque(..)
		//* 就行了,由开发者自先决定,此处就不承载过多的要求了
		if (!BeautyEyeLNFHelper.__isFrameBorderOpaque() 
				&& window != null)
		{
			//** 20111222 by jb2011,让窗口全透明(用以实现窗口的透明边框效果)
//			AWTUtilities.setWindowOpaque(window, false);
			// TODO BUG:1)目前可知,在jdk1.7.0_u6下,JDialog的半透明边框的透明度比原设计深一倍
			// TODO BUG:2)目前可知,在jdk1.6.0_u33下+win7平台下,JFrame窗口被调置成透明后,
			//				该窗口内所在文本都会被反走样(不管你要没有要求反走样),真悲具,这应该
			//				是官方AWTUtilities.setWindowOpaque(..)bug导致的,1.7.0_u6同样存在该问题,
			//				使用BeautyEye时,遇到这样的问题只能自行使用__isFrameBorderOpaque中指定的
			//				不透明边框才行(这样此类的以下代码就不用执行,也就不用触发该bug了),但
			//				JDialog不受此bug影响,诡异!
			WindowTranslucencyHelper.setWindowOpaque(window, false);
			root.revalidate();
			root.repaint();
		}
	}
 
Example #12
Source File: __UI__.java    From beautyeye with Apache License 2.0 5 votes vote down vote up
/**
	 * Ui impl.
	 */
	public static void uiImpl()
	{
		UIManager.put("control",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		UIManager.put("Separator.foreground",new ColorUIResource(new Color(180,180,180)));
		UIManager.put("ToolTip.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
		
		UIManager.put("Separator.background",new ColorUIResource(Color.white));
		UIManager.put("Panel.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
		UIManager.put("Panel.background",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		
		UIManager.put("Label.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
		UIManager.put("Label.background",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));

		UIManager.put("ColorChooser.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
		UIManager.put("ColorChooser.background",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		UIManager.put("ColorChooser.swatchesDefaultRecentColor",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		
		UIManager.put("TitledBorder.titleColor",new ColorUIResource(new Color(58,135,173)));//TitleBorder的标题颜色
		//TitledBorder的默认border实现(windows LNF中默认是圆色灰色实线距形)
		UIManager.put("TitledBorder.border",new BorderUIResource(new BEDashedRoundRecBorder(BeautyEyeLNFHelper.commonFocusedBorderColor)));
		
//		UIManager.put("OptionPaneUI",org.jb2011.lnf.windows2.ch3.NLOptionPaneUI.class.getName());
		//** Ui里的实现逻辑:此属性为true时将导致JOptionPane里的各按钮按BasicOptionPaneUI里设定的Insets进行
		//** UI展现:当按钮数<=2时使用的Insets=new Instes(2,8,2,8),否则使用new Instes(2,4,2,4),
		//** 这样的逻辑下,BeautyEye L&F实现里会使得按钮高度缩小而不好看,所以要关闭此属性
		UIManager.put("OptionPane.setButtonMargin",false);
		UIManager.put("OptionPane.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
		UIManager.put("OptionPane.background",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		UIManager.put("OptionPane.questionIcon",__IconFactory__.getInstance().getOptionPaneQUESTIONIcon());
		UIManager.put("OptionPane.warningIcon",__IconFactory__.getInstance().getOptionPaneWARNIcon());
		UIManager.put("OptionPane.informationIcon",__IconFactory__.getInstance().getOptionPaneINFOIcon());
		UIManager.put("OptionPane.errorIcon",__IconFactory__.getInstance().getOptionPaneERRORIcon());
		
		UIManager.put("SeparatorUI",org.jb2011.lnf.beautyeye.ch_x.BESeparatorUI.class.getName());
	}
 
Example #13
Source File: __UI__.java    From beautyeye with Apache License 2.0 5 votes vote down vote up
/**
	 * Ui impl.
	 */
	public static void uiImpl()
	{
		UIManager.put("Slider.background",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		//JSlider的刻度线绘制颜色
		UIManager.put("Slider.tickColor",new ColorUIResource(new Color(154,154,154)));
		UIManager.put("Slider.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
		//获得焦点时的insets
//		UIManager.put("Slider.focusInsets",new InsetsUIResource(2,2,7,7));//父类中默认是2,2,2,2
		//获得焦点时的焦点边框颜色
		UIManager.put("Slider.focus",new ColorUIResource(BeautyEyeLNFHelper.commonFocusedBorderColor));//windows父类中默认是[r=113,g=111,b=100]
		UIManager.put("SliderUI",org.jb2011.lnf.beautyeye.ch15_slider.BESliderUI.class.getName());
	}
 
Example #14
Source File: __UI__.java    From beautyeye with Apache License 2.0 5 votes vote down vote up
/**
 * Ui impl.
 */
public static void uiImpl()
{
	UIManager.put("Spinner.background",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
	UIManager.put("Spinner.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
	UIManager.put("SpinnerUI", org.jb2011.lnf.beautyeye.ch18_spinner.BESpinnerUI.class.getName());
	
	//Spinner组件的边框
	UIManager.put("Spinner.border", new BorderUIResource(new EmptyBorder(5, 5, 10, 5)));//windows lnf中默认是3, 3, 3, 3
	//Spinner组件的2个箭头按钮的内衬距
	UIManager.put("Spinner.arrowButtonInsets", new InsetsUIResource(1,0,2,2));//windows lnf中默认是1,1,1,1
	//Spinner组件的2个箭头按钮的默认大小
	UIManager.put("Spinner.arrowButtonSize",new Dimension(17,9));//windows lnf中默认是17,9
}
 
Example #15
Source File: __UI__.java    From beautyeye with Apache License 2.0 5 votes vote down vote up
/**
 * Ui impl.
 */
public static void uiImpl()
{
	UIManager.put("ProgressBar.background",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
	UIManager.put("ProgressBar.selectionForeground",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
	//* 此属性决定水平进度条的默认最小大小:15是相关于.9.png图片的最小填充
	//* 高度或长度的(小于此高度则NinePatch算法无法解决而很难看)
	UIManager.put("ProgressBar.horizontalSize",new DimensionUIResource(146,15));//默认是146,12
	//* 此属性决定垂直进度条的默认最小大小:15是相关于.9.png图片的最小填充
	//* 高度或长度的(小于此高度则NinePatch算法无法解决而很难看)
	UIManager.put("ProgressBar.verticalSize",new DimensionUIResource(15,146));//默认是12,146
	UIManager.put("ProgressBar.border",new BorderUIResource(BorderFactory.createEmptyBorder(0,0,0,0)));
	UIManager.put("ProgressBarUI",org.jb2011.lnf.beautyeye.ch12_progress.BEProgressBarUI.class.getName());
}
 
Example #16
Source File: __UI__.java    From beautyeye with Apache License 2.0 5 votes vote down vote up
/**
	 * Ui impl.
	 */
	public static void uiImpl()
	{
		//内部窗体的边框颜色(BueaytyEye中无意义,原因是BeautyEye LNF中的border是使用NP图实现)
		UIManager.put("InternalFrame.borderColor",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		UIManager.put("InternalFrame.minimizeIconBackground", new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
//		UIManager.put("InternalFrame.paletteCloseIcon"//本属性在beautyEye中不会起效的
//				,org.jb2011.lnf.windows2.ch1.__IconFactory__.getInstance().getInternalFrameCloseIcon());
		UIManager.put("InternalFrame.icon"
				,__IconFactory__.getInstance().getInternalFrameIcon());
		UIManager.put("InternalFrame.iconifyIcon"
				,__IconFactory__.getInstance().getInternalIconfiedIcon());
		UIManager.put("InternalFrame.minimizeIcon"
				,__IconFactory__.getInstance().getInternalFrameMinIcon());
		UIManager.put("InternalFrame.maximizeIcon"
				,__IconFactory__.getInstance().getInternalFrameMaxIcon());
		UIManager.put("InternalFrame.closeIcon"
				,__IconFactory__.getInstance().getInternalFrameCloseIcon());
		UIManager.put("InternalFrameUI",org.jb2011.lnf.beautyeye.ch10_internalframe.BEInternalFrameUI.class.getName());
//		UIManager.put("InternalFrame.paletteTitleHeight",40);//本属性在beautyEye中不会起效的
//		UIManager.put("InternalFrame.titlePaneHeight",38);//default is 25
//		UIManager.put("InternalFrame.borderWidth",10);
		Object internalFrameBorder = new BorderUIResource(new BEShadowBorder());
		UIManager.put("InternalFrame.border", internalFrameBorder);
		UIManager.put("InternalFrame.paletteBorder", internalFrameBorder);
		UIManager.put("InternalFrame.optionDialogBorder", internalFrameBorder);
		
		//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> JDesktopPane相关ui属性设定
		//JDesktopPane的背景色
		UIManager.put("Desktop.background",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		//此属性暂无意义
//		UIManager.put("Desktop.minOnScreenInsets",new InsetsUIResource(10,10,10,10));//default is 3,3,3,3
		//JDesktopPane中内部窗体最小化时的窗体组件宽度
		UIManager.put("DesktopIcon.width",180);//默认是160
		//BeautyEye LNF中内部窗体标题栏实现
		UIManager.put("DesktopIconUI",org.jb2011.lnf.beautyeye.ch10_internalframe.BEDesktopIconUI.class.getName());
	}
 
Example #17
Source File: __UI__.java    From beautyeye with Apache License 2.0 5 votes vote down vote up
/**
	 * Ui impl.
	 */
	public static void uiImpl()
	{
		/* ~~注:这个属性是Jack Jiang仿照JTabel里的实现自已加的属性,目的是控制选择框的弹出列表的边框空白 */
		UIManager.put("ComboBox.scrollPaneBorder",new BorderUIResource(BorderFactory.createEmptyBorder(2,0,4,0)));
		
		// 不能设置alpha通道小于255的透明颜色,否则会出现无法重paint的问题
		UIManager.put("ComboBox.background",new ColorUIResource(Color.white));
		UIManager.put("ComboBox.disabledBackground",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
//		UIManager.put("ComboBox.buttonBackground",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		UIManager.put("ComboBox.buttonBackground",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		UIManager.put("ComboBox.selectionForeground",new ColorUIResource(BeautyEyeLNFHelper.commonSelectionForegroundColor));
		UIManager.put("ComboBox.selectionBackground",new ColorUIResource(BeautyEyeLNFHelper.commonSelectionBackgroundColor));
		UIManager.put("ComboBox.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
		
		//render之外的衬距,此设置将改变下拉框的整体占位大小
		UIManager.put("ComboBox.padding",new javax.swing.plaf.InsetsUIResource(1,0,1,0));//5,8,5,8));
		//true表示下拉箭头按钮的宽度无条件=高度,否则宽度不与高度保持等长(使用自身长度)
		UIManager.put("ComboBox.squareButton",true);
		
		BorderUIResource border = new BorderUIResource(BorderFactory.createEmptyBorder(0, 4, 0, 0));
		//此border将决定ArrowButton的外衬大小(即框内衬空白大小),此大小决定conbox的高度和宽度,另一种方法
		//是通过设置render的border也能达到调整combox的高度和宽度,而且对lnf来说通过设置render的border是最佳方案
		UIManager.put("ComboBox.border", border);//new BERoundBorder(0).setThickness(10)));//.setArcWidth(10).setLineColor(new Color(0,0,0,0))));//使用全透明色绘边框,目的就是要让它的背景显现出来(NipePatch图实现)
		UIManager.put("ComboBox.editorBorder", border);//windows 外观下认是1,2,1,1)));
		
		UIManager.put("ComboBoxUI",org.jb2011.lnf.beautyeye.ch14_combox.BEComboBoxUI.class.getName());
		/* ~~注:这个属性是Jack Jiang为了更好的ui效果和方便未来的设定自已加的属性 */
		//用于修正下拉框的弹出窗的X坐标
		UIManager.put("ComboBox.popupOffsetX", -3);
		/* ~~注:这个属性是Jack Jiang为了更好的ui效果和方便未来的设定自已加的属性 */
		//用于修正下拉框的弹出窗的Y坐标
		UIManager.put("ComboBox.popupOffsetY", 2);
	}
 
Example #18
Source File: __UI__.java    From beautyeye with Apache License 2.0 5 votes vote down vote up
/**
	 * Ui impl.
	 */
	public static void uiImpl()
	{
		//~* @since 3.4, add by Jack Jiang 2012-11-05
		//~* 【BeautyEye外观的特有定制属性】:true表示BEToolBarUI里,将使用其它典型外观
		//~*  一样的默认纯色填充背景(颜色由ToolBar.background属性指定), 否则将使用BeautyEye
		//~*  默认的渐变NinePatch图实现背景的填充。另外,还可以使用
		//~*  JToolBar.putClientProperty("ToolBar.isPaintPlainBackground", Boolean.TRUE);来进行
		//~*  独立控制背景的填充方法,ClientProperty相比UIManager中的本方法拥有最高优先级
		UIManager.put("ToolBar.isPaintPlainBackground", Boolean.FALSE);
		//此属性目前用于ToolBar.border中表示触点的颜色
		UIManager.put("ToolBar.shadow", new ColorUIResource(new Color(180,183,187)));
		//此属性目前用于ToolBar.border中表示触点的立体阴影效果颜色
		UIManager.put("ToolBar.highlight", new ColorUIResource(Color.white));
		UIManager.put("ToolBar.dockingBackground",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		UIManager.put("ToolBar.floatingBackground",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		UIManager.put("ToolBar.background",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		UIManager.put("ToolBar.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
		//工具栏的border实现
		UIManager.put("ToolBar.border",new BorderUIResource(
//				com.sun.java.swing.plaf.windows.WindowsBorders.getToolBarBorder()));
				new org.jb2011.lnf.beautyeye.ch8_toolbar.BEToolBarUI.ToolBarBorder(UIManager.getColor("ToolBar.shadow"),
						UIManager.getColor("ToolBar.highlight"), new Insets(6, 0, 11, 0))));
//				BorderFactory.createEmptyBorder(5, 0, 8, 0)));//5, 5, 8, 5)));
		//分隔条ui实现
		UIManager.put("ToolBarSeparatorUI"
				, org.jb2011.lnf.beautyeye.ch8_toolbar.BEToolBarSeparatorUI.class.getName());
		UIManager.put("ToolBarUI",org.jb2011.lnf.beautyeye.ch8_toolbar.BEToolBarUI.class.getName());
	}
 
Example #19
Source File: Launch.java    From DBMetadata with MIT License 5 votes vote down vote up
private static void initUserInterface() {
    try {
        if (Platform.isWindows()) {
            UIManager.put("RootPane.setupButtonVisible", false);
            BeautyEyeLNFHelper.translucencyAtFrameInactive = false;
            BeautyEyeLNFHelper.launchBeautyEyeLNF();
        } else {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
Example #20
Source File: BETitlePane.java    From beautyeye with Apache License 2.0 5 votes vote down vote up
public void addNotify()
{
	try{
		super.addNotify();
	}
	catch (Exception e){
	}
	uninstallListeners();

	window = SwingUtilities.getWindowAncestor(this);
	if (window != null)
	{
		if (window instanceof Frame)
		{
			setState(((Frame) window).getExtendedState());
			
			//* 说明请见:BeautyEyeLNFHelper.setMaximizedBoundForFrame
			if(BeautyEyeLNFHelper.setMaximizedBoundForFrame)
			{
				//* 此处设置窗口的最大边界是为了解决窗口最大化时覆盖
				//* 操作系统的task bar 的问题,它是sun一直没有解决的问题
				//* ,目前没有其它好方法,只能如此解决了
				setFrameMaxBound((Frame) window);
			}
		}
		else
		{
			setState(0);
		}
		setActive(window.isActive());
		installListeners();
	}
}
 
Example #21
Source File: SwingSet2Applet.java    From beautyeye with Apache License 2.0 5 votes vote down vote up
public void init() {
  	try
{
  		BeautyEyeLNFHelper.launchBeautyEyeLNF();
}
catch (Exception e)
{
	System.err.println("BeautyEyeLNF运行失败,原因是:"+e.getMessage());
}
  	
      getContentPane().setLayout(new BorderLayout());
      getContentPane().add(new SwingSet2(this), BorderLayout.CENTER);
  }
 
Example #22
Source File: T.java    From beautyeye with Apache License 2.0 5 votes vote down vote up
/**
	 * The main method.
	 *
	 * @param args the arguments
	 * @throws Exception the exception
	 */
	public static void main(String[] args)throws Exception
	{
//		JFrame.setDefaultLookAndFeelDecorated(true);
//		JDialog.setDefaultLookAndFeelDecorated(true);
		
//		BeautyEyeLNFHelper.frameBorderStyle = FrameBorderStyle.generalNoTranslucencyShadow;
		BeautyEyeLNFHelper.launchBeautyEyeLNF();
		
//		UIManager.setLookAndFeel(new MetalLookAndFeel());
		
		JFrame f = new JFrame();
//		f.setDefaultLookAndFeelDecorated(false);
		
//		com.sun.awt.AWTUtilities.setWindowOpacity(f, 0.5f);
//		com.sun.awt.AWTUtilities.setWindowOpaque(f, true);
//		f.pack();
		f.setBounds(100,100,300,300);
		
		
		JToolBar tb = new JToolBar();
		tb.add(new JTextField("111111111111111111"));
		
		f.getContentPane().setLayout(new BorderLayout());
		f.getContentPane().add(tb, BorderLayout.NORTH);
		f.getContentPane().add(new JButton("1111111111111111111111"), BorderLayout.CENTER);
		
		
//		((JComponent)f.getContentPane())
//			.setBorder(BorderFactory.createEmptyBorder(30, 30, 30, 30));
		
		f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//		f.getRootPane().setWindowDecorationStyle(JRootPane.NONE);
//		f.setUndecorated(false);
		f.setVisible(true);
		
//		f.setExtendedState(JFrame.MAXIMIZED_BOTH);
	}
 
Example #23
Source File: Main.java    From FCMFrame with Apache License 2.0 5 votes vote down vote up
public static void resetStyle() throws Exception {
    BeautyEyeLNFHelper.frameBorderStyle = BeautyEyeLNFHelper.FrameBorderStyle.osLookAndFeelDecorated;
    BeautyEyeLNFHelper.launchBeautyEyeLNF();
    UIManager.put("RootPane.setupButtonVisible", false);
    UIManager.put("ToolBar.isPaintPlainBackground", Boolean.TRUE);
    initGlobalFontSetting(new Font("微软雅黑", Font.PLAIN, 14));
}
 
Example #24
Source File: Initialize.java    From AlipayOrdersSupervisor-GUI with MIT License 5 votes vote down vote up
/**
 * 初始化主题配置
 */
public static void InitTheme() {
    try {
        switch (settings.getTheme()) {
            case "BeautyEye":
                BeautyEyeLNFHelper.launchBeautyEyeLNF();
                UIManager.put("RootPane.setupButtonVisible", false);
                break;
            default:
                UIManager.setLookAndFeel("com.bulenkov.darcula.DarculaLaf");
        }
    } catch (Exception e) {
        logger.error(e.toString());
    }
}
 
Example #25
Source File: __UI__.java    From beautyeye with Apache License 2.0 4 votes vote down vote up
/**
	 * Ui impl.
	 */
	public static void uiImpl()
	{
		final InsetsUIResource iuir = new InsetsUIResource(4,3,4,3);
		
		UIManager.put("TextField.margin",iuir);
		UIManager.put("TextField.border",new BorderUIResource(new BERoundBorder().setLineColor(new Color(0,0,0,0))));//使用全透明色绘边框(用什么边框无所谓,关键是读取它的margin并透明),目的就是要让它的背景显现出来(NipePatch图实现)
		UIManager.put("TextField.selectionForeground",new ColorUIResource(BeautyEyeLNFHelper.commonSelectionForegroundColor));
		UIManager.put("TextField.selectionBackground",new ColorUIResource(BeautyEyeLNFHelper.commonSelectionBackgroundColor));
		UIManager.put("TextField.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
		UIManager.put("TextFieldUI",org.jb2011.lnf.beautyeye.ch6_textcoms.BETextFieldUI.class.getName());
		
		UIManager.put("FormattedTextField.margin",iuir);
		UIManager.put("FormattedTextField.border",new BorderUIResource(new BERoundBorder(1).setArcWidth(10).setLineColor(new Color(0,0,0,0))));//使用全透明色绘边框(用什么边框无所谓,关键是读取它的margin并透明),目的就是要让它的背景显现出来(NipePatch图实现)
		UIManager.put("FormattedTextField.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
		UIManager.put("FormattedTextField.inactiveBackground",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		UIManager.put("FormattedTextField.selectionForeground",new ColorUIResource(BeautyEyeLNFHelper.commonSelectionForegroundColor));
		UIManager.put("FormattedTextField.selectionBackground",new ColorUIResource(BeautyEyeLNFHelper.commonSelectionBackgroundColor));
		UIManager.put("FormattedTextFieldUI",org.jb2011.lnf.beautyeye.ch6_textcoms.BEFormattedTextFieldUI.class.getName());
		
		UIManager.put("PasswordField.margin",iuir);
		UIManager.put("PasswordField.border",new BorderUIResource(new BERoundBorder().setLineColor(new Color(0,0,0,0))));//使用全透明色绘边框(用什么边框无所谓,关键是读取它的margin并透明),目的就是要让它的背景显现出来(NipePatch图实现)
		UIManager.put("PasswordField.selectionForeground",new ColorUIResource(BeautyEyeLNFHelper.commonSelectionForegroundColor));
		UIManager.put("PasswordField.selectionBackground",new ColorUIResource(BeautyEyeLNFHelper.commonSelectionBackgroundColor));
		UIManager.put("PasswordField.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
		UIManager.put("PasswordFieldUI",org.jb2011.lnf.beautyeye.ch6_textcoms.BEPasswordFieldUI.class.getName());
		
		UIManager.put("TextArea.margin",iuir);
		UIManager.put("TextArea.border",new BorderUIResource(new BERoundBorder().setLineColor(new Color(0,0,0,0))));//使用全透明色绘边框(用什么边框无所谓,关键是读取它的margin并透明),目的就是要让它的背景显现出来(NipePatch图实现)
		UIManager.put("TextArea.selectionForeground",new ColorUIResource(BeautyEyeLNFHelper.commonSelectionForegroundColor));
		UIManager.put("TextArea.selectionBackground",new ColorUIResource(BeautyEyeLNFHelper.commonSelectionBackgroundColor));
		UIManager.put("TextArea.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
		UIManager.put("TextAreaUI",org.jb2011.lnf.beautyeye.ch6_textcoms.BETextAreaUI.class.getName());
		
//		UIManager.put("TextPane.margin",new InsetsUIResource(3,3,3,3));
		UIManager.put("TextPane.border",new BorderUIResource(new BERoundBorder().setLineColor(new Color(0,0,0,0))));//使用全透明色绘边框(用什么边框无所谓,关键是读取它的margin并透明),目的就是要让它的背景显现出来(NipePatch图实现)
		UIManager.put("TextPane.selectionBackground",new ColorUIResource(BeautyEyeLNFHelper.commonSelectionBackgroundColor));
		UIManager.put("TextPane.selectionForeground",new ColorUIResource(BeautyEyeLNFHelper.commonSelectionForegroundColor));
		UIManager.put("TextPane.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
		UIManager.put("TextPaneUI",org.jb2011.lnf.beautyeye.ch6_textcoms.BETextPaneUI.class.getName());
		
//		UIManager.put("EditorPane.margin",new InsetsUIResource(3,3,3,3));
		UIManager.put("EditorPane.border",new BorderUIResource(new BERoundBorder().setLineColor(new Color(0,0,0,0))));//使用全透明色绘边框(用什么边框无所谓,关键是读取它的margin并透明),目的就是要让它的背景显现出来(NipePatch图实现)
		UIManager.put("EditorPane.selectionForeground",new ColorUIResource(BeautyEyeLNFHelper.commonSelectionForegroundColor));
		UIManager.put("EditorPane.selectionBackground",new ColorUIResource(BeautyEyeLNFHelper.commonSelectionBackgroundColor));
		UIManager.put("EditorPane.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
		UIManager.put("EditorPaneUI",org.jb2011.lnf.beautyeye.ch6_textcoms.BEEditorPaneUI.class.getName());
	}
 
Example #26
Source File: BERootPaneUI.java    From beautyeye with Apache License 2.0 4 votes vote down vote up
/**
 * Installs the necessary Listeners on the parent <code>Window</code>,
 * if there is one.
 * <p>
 * This takes the parent so that cleanup can be done from
 * <code>removeNotify</code>, at which point the parent hasn't been
 * reset yet.
 *
 * @param root the root
 * @param parent The parent of the JRootPane
 */
private void installWindowListeners(JRootPane root, Component parent) 
{
	if (parent instanceof Window)
	{
		window = (Window)parent;
	}
	else 
	{
		window = SwingUtilities.getWindowAncestor(parent);
	}
	if (window != null) 
	{
		if (mouseInputListener == null) 
		{
			mouseInputListener = createWindowMouseInputListener(root);
		}
		
		window.addMouseListener(mouseInputListener);
		window.addMouseMotionListener(mouseInputListener);
		
		//* add by JS 2011-12-27,给窗口增加监听器:在不活动时设置窗口半透明,活动时还原
		if(BeautyEyeLNFHelper.translucencyAtFrameInactive)
		{
			if(windowsListener == null)
			{
				windowsListener = new WindowAdapter(){
					public void windowActivated(WindowEvent e) {
						if(window != null)
							//AWTUtilities.setWindowOpacity(window, 1.0f);
							WindowTranslucencyHelper.setOpacity(window, 1.0f);
					}
					public void windowDeactivated(WindowEvent e) {
						if(window != null)
							//AWTUtilities.setWindowOpacity(window, 0.94f);
							WindowTranslucencyHelper.setOpacity(window, 0.94f);
					}
				};
			}
			window.addWindowListener(windowsListener);
		}
	}
}
 
Example #27
Source File: __UI__.java    From beautyeye with Apache License 2.0 4 votes vote down vote up
/**
	 * Ui impl.
	 */
	public static void uiImpl()
	{
		//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 窗体ui的各项属性设定
		//*~ 本属性是Jack Jiang自已设定的,Java的Metal主题默认对非Frame对象的窗口图标取的是InternalFrame.icon,这是不对的
		UIManager.put("Frame.icon",__IconFactory__.getInstance().getFrameIcon_16_16());
		
		UIManager.put("Frame.iconifyIcon",__IconFactory__.getInstance().getIconfiedIcon());
		UIManager.put("Frame.iconifyIcon_rover",__IconFactory__.getInstance().getIconfiedIcon_rover());
		UIManager.put("Frame.iconifyIcon_pressed",__IconFactory__.getInstance().getIconfiedIcon_pressed());
		
		UIManager.put("Frame.minimizeIcon",__IconFactory__.getInstance().getFrameMinIcon());
		UIManager.put("Frame.minimizeIcon_rover",__IconFactory__.getInstance().getFrameMinIcon_rover());
		UIManager.put("Frame.minimizeIcon_pressed",__IconFactory__.getInstance().getFrameMinIcon_pressed());
		
		UIManager.put("Frame.maximizeIcon",__IconFactory__.getInstance().getFrameMaxIcon());
		UIManager.put("Frame.maximizeIcon_rover",__IconFactory__.getInstance().getFrameMaxIcon_rover());
		UIManager.put("Frame.maximizeIcon_pressed",__IconFactory__.getInstance().getFrameMaxIcon_pressed());
		
		UIManager.put("Frame.closeIcon",__IconFactory__.getInstance().getFrameCloseIcon());
		UIManager.put("Frame.closeIcon_rover",__IconFactory__.getInstance().getFrameCloseIcon_rover());
		UIManager.put("Frame.closeIcon_pressed",__IconFactory__.getInstance().getFrameCloseIcon_pressed());
		
		//设定用于演示之用的“设置”按钮图标
		UIManager.put("Frame.setupIcon",__IconFactory__.getInstance().getFrameSetupIcon());
		
//		UIManager.put("activeCaption",new ColorUIResource(Windows2LookAndFeel.activeCaption));
		UIManager.put("activeCaptionText",new ColorUIResource(BeautyEyeLNFHelper.activeCaptionTextColor));
//		UIManager.put("activeCaptionBorder",new ColorUIResource(Windows2LookAndFeel.activeCaptionBorder));
//		UIManager.put("inactiveCaption",new ColorUIResource(GraphicHandler.getColor(activeCaption,64,42,22)));
		UIManager.put("inactiveCaptionText",new ColorUIResource(BEUtils.getColor(BeautyEyeLNFHelper.activeCaptionTextColor,-49,-27,-7)));
//		UIManager.put("inactiveCaptionBorder",new ColorUIResource(GraphicHandler.getColor(activeCaptionBorder,64,42,22)));
		//此属性即是BeautyEye LNF的窗口标题栏实现
		UIManager.put("RootPaneUI", BERootPaneUI.class.getName());
		
		// These bindings are only enabled when there is a default
		// button set on the rootpane.
		UIManager.put("RootPane.defaultButtonWindowKeyBindings", new Object[] {
				"ENTER", "press",
				"released ENTER", "release",
				"ctrl ENTER", "press",
				"ctrl released ENTER", "release"
		});
		
		//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> OptionPane的各项ui属性设定
		Object dialogBorder = new BorderUIResource(BeautyEyeLNFHelper.__getFrameBorder());//BorderFactory.createLineBorder(new Color(181,181,181)));
		UIManager.put("RootPane.frameBorder", dialogBorder);
		UIManager.put("RootPane.plainDialogBorder", dialogBorder);
		UIManager.put("RootPane.informationDialogBorder", dialogBorder);
		UIManager.put("RootPane.errorDialogBorder", dialogBorder);
		UIManager.put("RootPane.colorChooserDialogBorder", dialogBorder);
		UIManager.put("RootPane.fileChooserDialogBorder", dialogBorder);
		UIManager.put("RootPane.questionDialogBorder", dialogBorder);
		UIManager.put("RootPane.warningDialogBorder", dialogBorder);
	}
 
Example #28
Source File: LogHelper.java    From beautyeye with Apache License 2.0 4 votes vote down vote up
/**
 * Debug.
 *
 * @param msg the msg
 */
public static void debug(String msg)
{
	if(BeautyEyeLNFHelper.debug)
		System.err.println("[BE-DEBUG] - "+msg);
}
 
Example #29
Source File: LogHelper.java    From beautyeye with Apache License 2.0 4 votes vote down vote up
/**
 * Error.
 *
 * @param msg the msg
 */
public static void error(String msg)
{
	if(BeautyEyeLNFHelper.debug)
		System.err.println("[BE-ERROR] - "+msg);
}
 
Example #30
Source File: __UI__.java    From beautyeye with Apache License 2.0 4 votes vote down vote up
/**
	 * Ui impl.
	 */
	public static void uiImpl()
	{
		//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> JButton相关ui属性设定
		UIManager.put("Button.background",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		//Button.foreground的设定不起效,这可能是LNF里的bug,因NLLookAndFeel
		//是继承自它们所以暂时无能为力,就这么的吧,以后再说
		UIManager.put("Button.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
		
		//以下属性将决定按钮获得焦点时的焦点虚线框的绘制偏移量哦
		UIManager.put("Button.dashedRectGapX",3);//windows LNF中默认是3
		UIManager.put("Button.dashedRectGapY",3);//windows LNF中默认是3
		UIManager.put("Button.dashedRectGapWidth",6);//windows LNF中默认是6
		UIManager.put("Button.dashedRectGapHeight",6);//windows LNF中默认是6
		
		UIManager.put("ButtonUI",org.jb2011.lnf.beautyeye.ch3_button.BEButtonUI.class.getName());
		UIManager.put("Button.margin",new InsetsUIResource(6, 8, 6, 8));//new InsetsUIResource(6, 8, 6, 8));
		//此border可以与Button.margin连合使用,而者之和即查整个Button的内衬哦
		UIManager.put("Button.border" ,new org.jb2011.lnf.beautyeye.ch3_button.BEButtonUI
					.XPEmptyBorder(new Insets(3,3,3,3)));//default is 3,3,3,3
		//获得焦点时的虚线框颜色
		UIManager.put("Button.focus",new ColorUIResource(130,130,130));

		//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> JToggleButton相关ui属性设定
		//注意:本属性不要与ToggleButton.border混用,因为没有它的优先级高,
		//另本参数如用InsetsUIResource则不会有效果,具体原因待查(本属性也将决定toolbar的整体高度和宽度哦)
		UIManager.put("ToggleButton.margin",new Insets(3, 11, 3, 11));//4, 8, 4, 8));////4, 12, 4, 12));
		UIManager.put("ToggleButton.background",new ColorUIResource(BeautyEyeLNFHelper.commonBackgroundColor));
		UIManager.put("ToggleButton.foreground",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));
		//用于ToggleButon被选中时的前景色
		//注:在原WindowsLookAndFeel中,本属性存在(值是Color(0,0,0,))但在UI里没有用到
		//,此处被jb2011定义为“选中时的前景色”,当然也可以自已定名称,参见 NLWindowsToggleButtonUI2.paintText(..)
		UIManager.put("ToggleButton.focus",new ColorUIResource(BeautyEyeLNFHelper.commonForegroundColor));//new ColorUIResource(Color.white)));//
		UIManager.put("ToggleButtonUI",org.jb2011.lnf.beautyeye.ch3_button.BEToggleButtonUI.class.getName());
		//以下设置对ToggleButton在不加入到JToolBar时是有效果的哦!!!!!!!!!!!
		Border toggleButtonBorder = new BorderUIResource(new MarginBorder());
//		UIManager.put("ToggleButton.margin",new InsetsUIResource(2, 30, 2, 30));
		UIManager.put("ToggleButton.border",toggleButtonBorder);
		/* ~~注:这个属性是Jack Jiang为了更好的ui效果自已加的属性:焦点虚线的颜色 */
		UIManager.put("ToggleButton.focusLine"
				,new ColorUIResource(BeautyEyeLNFHelper.commonFocusedBorderColor.darker()));
		/* ~~注:这个属性是Jack Jiang为了更好的ui效果自已加的属性:焦点虚线的高亮立体阴影颜色 */
		UIManager.put("ToggleButton.focusLineHilight",new ColorUIResource(new Color(240,240,240)));
	}