Java Code Examples for org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper#debug()

The following examples show how to use org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper#debug() . 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: 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 2
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 3
Source File: WindowTranslucencyHelper.java    From beautyeye with Apache License 2.0 4 votes vote down vote up
/**
	 * Sets the opacity.
	 *
	 * @param w the w
	 * @param opacity the opacity
	 */
	public static void setOpacity(Window w, float opacity)
	{
//		//## Fix for: Issue BELNF-5, 目前因Jack Jiang手头没有Linux等测试环境,目前就暂时先让这
//		//## 些平台不支持窗口透明吧,起码先把BE LNF跑起来再说,此问题以后再彻底解决
//		if(!Platform.isWindows())
//		{
//			System.out.println(UN_WINDOWS_SORRY);
//			return;
//		}
		
		try
		{
//			com.sun.awt.AWTUtilities.setWindowOpacity(w, opacity);
			//1.6.0_u12及以后版本
			if(JVM.current().isOneDotSixUpdate12OrAfter())//JDK1_6_U10//为什么要到u12才支持?因u10里的窗口透明存在BUG 6750920
			{
				if(!isTranslucencySupported())
				{
					LogHelper.debug("Your OS can't supported translucency.");
					return;
				}
				
				//1.7.0及以后版本
				if(JVM.current().isOrLater(JVM.JDK1_7))
					ReflectHelper.invokeMethod(Window.class, w, "setOpacity"
							, new Class[]{float.class}, new Object[]{opacity});
				else
					ReflectHelper.invokeStaticMethod("com.sun.awt.AWTUtilities", "setWindowOpacity"
							, new Class[]{Window.class, float.class}, new Object[]{w, opacity});
			}
			else
				LogHelper.debug("您的JRE版本不支持每像素半透明(需jre1.6_u12及以上版本),BeautyEye外观将不能达到最佳视觉效果哦.");
		}
		catch (Exception e)
		{
			if(BeautyEyeLNFHelper.debug)
				e.printStackTrace();
			LogHelper.debug("您的JRE版本不支持每像素半透明(需jre1.6_u12及以上版本),BeautyEye外观将不能达到最佳视觉效果哦."+e.getMessage());
		}
	}
 
Example 4
Source File: WindowTranslucencyHelper.java    From beautyeye with Apache License 2.0 4 votes vote down vote up
/**
	 * Sets the window opaque.
	 *
	 * @param w the w
	 * @param opaque the opaque
	 */
	public static void setWindowOpaque(Window w, boolean opaque)
	{
//		//## Fix for: Issue BELNF-5, 目前因Jack Jiang手头没有Linux等测试环境,目前就暂时先让这
//		//## 些平台不支持窗口透明吧,起码先把BE LNF跑起来再说,此问题以后再彻底解决
//		if(!Platform.isWindows())
//		{
//			System.out.println(UN_WINDOWS_SORRY);
//			return;
//		}
		
		try
		{
//			com.sun.awt.AWTUtilities.setWindowOpaque(w, opaque);
			//1.6.0_u12及以后版本
			if(JVM.current().isOneDotSixUpdate12OrAfter())//JDK1_6_U10//为什么要到u12才支持?因u10里的窗口透明存在BUG 6750920
			{
				if(!isTranslucencySupported())
				{
					LogHelper.debug("Your OS can't supported translucency.");
					return;
				}
				
				//1.7.0及以后版本
				if(JVM.current().isOrLater(JVM.JDK1_7))
				{
//					if(isWindowTranslucencySupported())
					Color bgc = w.getBackground();
					//* 2012-09-22 由Jack Jiang注释:在群友机器上(win7+java1.7.0.1)的生产系统下
					//* 下使用BeautyEye有时w.getBackground()返回值是null,但为什么返回是null,Jack 没
					//* 有测出来(Jack测试都是正常的),暂且认为是其系统代码有问题吧,在此容错一下
					if(bgc == null)
						bgc = Color.black;//暂不知道用此黑色作为容错值合不合适
					Color newBgn = new Color(bgc.getRed(),bgc.getGreen(), bgc.getBlue(), opaque?255:0);
					w.setBackground(newBgn);
				}
				else
					ReflectHelper.invokeStaticMethod("com.sun.awt.AWTUtilities", "setWindowOpaque"
							, new Class[]{Window.class, boolean.class}, new Object[]{w, opaque});
			}
			else
				LogHelper.debug("您的JRE版本不支持窗口透明(需jre1.6_u12及以上版本),BeautyEye外观将不能达到最佳视觉效果哦.");
		}
		catch (Exception e)
		{
			if(BeautyEyeLNFHelper.debug)
				e.printStackTrace();
			LogHelper.debug("您的JRE版本不支持窗口透明(需jre1.6_u12及以上版本),BeautyEye外观将不能达到最佳视觉效果哦."+e.getMessage());
//			e.printStackTrace();
		}
	}
 
Example 5
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 6
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);
}