Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
WindowUtilities.java
Package: security.rar [view]
Upload User: lior1029
Upload Date: 2013-05-07
Package Size: 209k
Code Size: 1k
Category:
CA program
Development Platform:
Java
- package org.infosecurity.cryptography;
- /**
- * <p>Title: 中国信息安全组织--窗口管理工具 </p>
- * <p>Description: 中国信息安全组织--窗口管理工具 </p>
- * <p>Copyright: Copyright (c) 2003</p>
- * <p>Company: 中信信息安全组织(CISO)</p>
- * @author 张荣华
- * @version 1.0.2003.0615
- */
- import java.awt.Dimension;
- import java.awt.Window;
- public final class WindowUtilities {
- static public final int TOP = 0;
- static public final int BOTTOM = 1;
- static public final int CENTER = 2;
- static public final int LEFT = 3;
- static public final int RIGHT = 4;
- /**
- * 定位窗口
- * @param w 容器实例
- * @param x 水平位置
- * @param y 垂直位置
- */
- static public void positionWindowOnScreen(Window w, int x, int y) {
- Dimension scrn = w.getToolkit().getScreenSize();
- Dimension win = w.getSize();
- int nx = 0;
- int ny = 0;
- switch(x) {
- case LEFT: nx = 0; break;
- case CENTER: nx = (int)((scrn.width-win.width)/2); break;
- case RIGHT: nx = (int)(scrn.width-win.width); break;
- }
- switch(y) {
- case TOP: ny = 0; break;
- case CENTER: ny = (int)((scrn.height-win.height)/2); break;
- case BOTTOM: ny = (int)(scrn.height-win.height); break;
- }
- w.setLocation(nx,ny);
- }
- /**
- * 居中窗口
- * @param w 窗口实例
- */
- static public final void centerWindowOnScreen(Window w)
- {
- positionWindowOnScreen(w, CENTER, CENTER);
- }
- }