⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 common.java

📁 原创
💻 JAVA
字号:
package clientServer;

import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Rectangle;

/**
 * 定义整个系统用到的参数
 */
public class Common {
	public static boolean sDebug = true;

	public static boolean sContinue = true;// 控制全局线程是否继续运行

	public static Rectangle sScreenBound;// 被服务端的屏幕大小
	public static int sScreenWidth;// 桌面图像宽度
	public static int sScreenHeight;// 桌面图像高度
	public static int sLength;// 桌面图像数组的长度

	public static String sIp;// 服务端的ip
	public static int sIPort = 58787;// 服务端图像监听端口
	public static int sEPort = 58484;// 服务端事件服务监听端口

	public static boolean sInit = true;// 系统是否处于初始化状态

	public static void init() {
		sScreenBound = getDefaultScreenBound();
		sScreenWidth = sScreenBound.width;
		sScreenHeight = sScreenBound.height;
		sLength = sScreenWidth * sScreenHeight;
	}

	/**
	 * 取得默认的桌面范围
	 * 
	 * @return 桌面的矩形区域
	 */
	public static Rectangle getDefaultScreenBound() {
		// get screen bound
		GraphicsEnvironment ge = GraphicsEnvironment
				.getLocalGraphicsEnvironment();
		GraphicsDevice gd = ge.getDefaultScreenDevice();

		return gd.getDefaultConfiguration().getBounds();
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -