📄 中心机房管理.txt
字号:
package ***.bank.center.control.centermain;
import java.net.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.border.*;
import javax.swing.*;
import java.util.*;
import java.io.*;
//添加自已定义的包路径 added by caiyong start;
import odig.bank.center.control.centerutil.*;
import odig.bank.center.control.centerpanel.*;
import odig.bank.util.*;
//添加自已定义的包路径 added by caiyong end;
public class CenterMainPanel extends JPanel
{
//布局全局变量 START
public static JFrame frame;
public static JDesktopPane desktop;
public static CenterMainPanel mainPanel;
public static java.applet.Applet applet;
public static JProgressBar progressBar;
public static int totalPanels=13;
public static JLabel progressLabel, progressWhichLabel;
public static int currentProgressValue; //当前进度值
public static boolean isLoginOn = false; //判断操作员是否已经登录
public static JLabel systemNoteLabel; //系统提示
public static JLabel operatorLabel; //操作员
public static JButton systemDateTimeButton; //系统时间
//当前一些数据库处理相关信息start
public static JButton addButton; //添加按钮
public static JButton modifyButton; //修改按钮
public static JButton deleteButton; //删除按钮
public static JButton pageButton; //翻页按钮
public static JButton cancelButton; //取消按钮
public static JButton refreshButton; //刷新按钮
public static ITable currentITable =null; //当前的动作接口
public static JPanel currentContainer =null ; //当前容器
public static int currentSelectRow = -1; //当前选中的数据表行
public static int currentSelectColumn = -1; //当前选中的数据表列
//当前一些数据库处理相关信息end
//....
private static final String GLOBAL_PATH = ".";
private static final String CONFIG_FILE = "Center.ini";
public static final String DATE_LONG_FORMAT = "yyyy.MM.dd hh:mm:ss";
// public static OperatorRecord operatorRecord;//系统全局用于纪录操作员资料
// public static Timer timer;
//布局全局变量 END;
public CenterMainPanel()
{
this(null);
};
//取得ip地址/*
public static InetAddress getaddress()
{
InetAddress ip=null;
try{
ip=InetAddress.getLocalHost();
}catch(UnknownHostException e){
System.out.print(e);
}
return ip;
}
//取得IP地址结束
/*
public boolean checkIp()
{
if (getaddress().equals("129.3.2.225")){
return false;
}
return true;
}
*/
public CenterMainPanel(java.applet.Applet anApplet)
{
super(true);
mainPanel=this;
setFont(CenterUtilClass.DEFAUT_FONT);
setLayout(new BorderLayout());
desktop=new JDesktopPane();
applet=anApplet;
systemNoteLabel=new JLabel(""); //系统提示
operatorLabel=new JLabel(""); //操作员
systemDateTimeButton=new JButton(""); //系统时间
// desktop.setName("中心机房管理系统主窗口");
desktop.setFont(CenterUtilClass.DEFAUT_FONT);
desktop.setLayout(new BorderLayout());
JPanel topPanel = new JPanel(true);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
topPanel.setPreferredSize(new Dimension(screenSize.width,70));
topPanel.setLayout(new GridLayout(2,1,2,2));
topPanel.add(createMenuBar());
topPanel.add(createToolBar());
add(topPanel,BorderLayout.NORTH);
add(createStatusBar(),BorderLayout.SOUTH);
currentProgressValue=0;
CenterUtilClass cc=new CenterUtilClass();
cc.initialize();
desktop.add(AllInternalFrame.registerInternalFrame);
add(desktop,BorderLayout.CENTER);
};
public static void main(String[] args)
{
String vers = System.getProperty("java.version");
if (vers.compareTo("1.1.2") < 0){
System.out.println("!!!WARNING: KeJian fareview client must be run with a " +
"1.1.2 or higher version VM!!!");
}
try {
String lookAndFeelPath = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
UIManager.setLookAndFeel(lookAndFeelPath);
// UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
}
catch (Exception e) {
e.printStackTrace();
}
//Center the window
applet=null;
frame = new JFrame("中心机房管理系统主窗口");
CenterMainPanel.frame=frame;
// if (CenterUtilClass.iconGlobal!=null)
// frame.setIconImage(CenterUtilClass.iconGlobal.getImage());
frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { CenterUtilClass.doExit(0); } });
ImageIcon icon=CenterUtilClass.loadImageIcon("../centerimage/odig.gif","东方迪格图标");
if (icon!=null)
frame.setIconImage(icon.getImage());
frame.getAccessibleContext().setAccessibleDescription("odigCenterMain application");
JOptionPane.setRootFrame(frame);
JPanel progressPanel = new JPanel()
{
public Insets getInsets()
{
return new Insets(40,30,20,30);
}
};
progressPanel.setLayout(new BoxLayout(progressPanel, BoxLayout.Y_AXIS));
frame.getContentPane().add(progressPanel, BorderLayout.CENTER);
Dimension d = new Dimension(400, 20);
progressLabel = new JLabel("中心机房管理系统正在引导过程中,请稍候...");
//取得ip地址/*
progressLabel.setAlignmentX(CENTER_ALIGNMENT);
progressLabel.setMaximumSize(d);
progressLabel.setPreferredSize(d);
progressPanel.add(progressLabel);
progressPanel.add(Box.createRigidArea(new Dimension(1,20)));
progressWhichLabel=new JLabel("");
d = new Dimension(400, 90);
progressWhichLabel.setAlignmentX(CENTER_ALIGNMENT);
progressWhichLabel.setMaximumSize(d);
progressWhichLabel.setIconTextGap(40);
progressWhichLabel.setHorizontalTextPosition(JLabel.RIGHT);
progressWhichLabel.setPreferredSize(d);
progressPanel.add(progressWhichLabel);
progressPanel.add(Box.createRigidArea(new Dimension(1,20)));
progressBar = new JProgressBar(0, totalPanels);
progressBar.setStringPainted(true);
progressLabel.setLabelFor(progressBar);
progressBar.setAlignmentX(CENTER_ALIGNMENT);
progressPanel.add(progressBar);
// show the frame
frame.setSize(CenterUtilClass.INITIAL_WIDTH,CenterUtilClass.INITIAL_HEIGHT);
//center of the window start
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameSize = frame.getSize();
if (frameSize.height > screenSize.height) {
frameSize.height = screenSize.height;
}
if (frameSize.width > screenSize.width) {
frameSize.width = screenSize.width;
}
frame.setLocation(screenSize.width/2 - CenterUtilClass.INITIAL_WIDTH/2,
screenSize.height/2 - CenterUtilClass.INITIAL_HEIGHT/2);
//center of the window end;
frame.show();
frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
CenterMainPanel mainPanel = new CenterMainPanel();
frame.getContentPane().removeAll();
frame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
frame.getContentPane().add(AllInternalFrame.G_RegisterPanel);
frame.setResizable(false);
//frame.show(true);
frame.validate();
}
JMenuBar createMenuBar()
{
// MenuBar
JMenuBar menuBar = new JMenuBar();//总菜单
menuBar.getAccessibleContext().setAccessibleName("Center main menus");
menuBar.add(createBasicDataMenu()); //柜员管理菜单
menuBar.add(createApplicationDataMenu()); //帐务管理资料
menuBar.add(createInterestMenu()); //利率管理
menuBar.add(createAccountMenu()); //平帐处理菜单
menuBar.add(createPosMenu()) ; //POS管理菜单
menuBar.add(createSystemMenu()); //系统菜单
return menuBar;
}
//有关我们的一些基本情况start
void doAboutUs()
{
// frame.setCursor(Cursor.WAIT_CURSOR);
if (!CenterUtilClass.checkRight()) return;//有否此权限
if (AllInternalFrame.aboutInternalFrame ==null || (!AllInternalFrame.aboutInternalFrame.isDisplayable()) )
{
if (AllInternalFrame.aboutInternalFrame!=null && AllInternalFrame.aboutInternalFrame.isVisible())
{
try{ AllInternalFrame.aboutInternalFrame.setSelected(true);
}catch(Exception e1) {};
return ;
}
AllInternalFrame.aboutInternalFrame=AllInternalFrame.createInternalFrame(AllInternalFrame.G_AboutPanel,CenterUtilClass.ICON_GLOBAL,"有关我们的一些信息");
CenterMainPanel.desktop.add(AllInternalFrame.aboutInternalFrame);
AllInternalFrame.aboutInternalFrame.show();
}
else
{
}
desktop.invalidate();
desktop.validate();
desktop.repaint();
frame.setCursor(Cursor.DEFAULT_CURSOR);
}
//柜员设置处理start
void doUUSet()
{
if (!CenterUtilClass.checkRight()) return;//有否此权限
frame.setCursor(Cursor.WAIT_CURSOR);
if (AllInternalFrame.G_UUPanel==null) AllInternalFrame.G_UUPanel = new UUPanel();//用户管理窗口
if (AllInternalFrame.uuInternalFrame ==null || (!AllInternalFrame.uuInternalFrame.isDisplayable()) )
{
if (AllInternalFrame.uuInternalFrame!=null && AllInternalFrame.uuInternalFrame.isVisible())
{
AllInternalFrame.uuInternalFrame.moveToFront();// .setSelected(true);
try{ AllInternalFrame.uuInternalFrame.setSelected(true);
}catch(Exception e1) {};
return ;
}
// centerLog(getCurrentDateTime(), "3****");
AllInternalFrame.uuInternalFrame=AllInternalFrame.createInternalFrame(AllInternalFrame.G_UUPanel,CenterUtilClass.ICON_GLOBAL,"用户管理窗口");
/// centerLog(getCurrentDateTime(), "4****");
CenterMainPanel.desktop.add(AllInternalFrame.uuInternalFrame);
AllInternalFrame.uuInternalFrame.show();
}
else
{
}
desktop.invalidate();
desktop.validate();
desktop.repaint();
frame.setCursor(Cursor.DEFAULT_CURSOR);
}
//用户设置处理end;
void doUUbyBRSet()
{
// if (!CenterUtilClass.checkRight()) return;//有否此权限
frame.setCursor(Cursor.WAIT_CURSOR);
if (AllInternalFrame.G_UBPanel==null) AllInternalFrame.G_UBPanel = new QuserbyBrPanel();//用户管理窗口
if (AllInternalFrame.uuInternalFrame ==null || (!AllInternalFrame.uuInternalFrame.isDisplayable()) )
{
if (AllInternalFrame.uuInternalFrame!=null && AllInternalFrame.uuInternalFrame.isVisible())
{
AllInternalFrame.uuInternalFrame.moveToFront();// .setSelected(true);
try{ AllInternalFrame.uuInternalFrame.setSelected(true);
}catch(Exception e1) {};
return ;
}
// centerLog(getCurrentDateTime(), "3****");
AllInternalFrame.uuInternalFrame=AllInternalFrame.createInternalFrame(AllInternalFrame.G_UBPanel,CenterUtilClass.ICON_GLOBAL,"用户管理窗口");
/// centerLog(getCurrentDateTime(), "4****");
CenterMainPanel.desktop.add(AllInternalFrame.uuInternalFrame);
AllInternalFrame.uuInternalFrame.show();
}
else
{
}
desktop.invalidate();
desktop.validate();
desktop.repaint();
frame.setCursor(Cursor.DEFAULT_CURSOR);
}
//用户设置处理end;
//queryby user name;
void doUUbynmSet()
{
// if (!CenterUtilClass.checkRight()) return;//有否此权限
frame.setCursor(Cursor.WAIT_CURSOR);
if (AllInternalFrame.G_UNPanel==null) AllInternalFrame.G_UNPanel = new QuserbynmPanel();//用户管理窗口
if (AllInternalFrame.uuInternalFrame ==null || (!AllInternalFrame.uuInternalFrame.isDisplayable()) )
{
if (AllInternalFrame.uuInternalFrame!=null && AllInternalFrame.uuInternalFrame.isVisible())
{
AllInternalFrame.uuInternalFrame.moveToFront();// .setSelected(true);
try{ AllInternalFrame.uuInternalFrame.setSelected(true);
}catch(Exception e1) {};
return ;
}
// centerLog(getCurrentDateTime(), "3****");
AllInternalFrame.uuInternalFrame=AllInternalFrame.createInternalFrame(AllInternalFrame.G_UNPanel,CenterUtilClass.ICON_GLOBAL,"用户管理窗口");
/// centerLog(getCurrentDateTime(), "4****");
CenterMainPanel.desktop.add(AllInternalFrame.uuInternalFrame);
AllInternalFrame.uuInternalFrame.show();
}
else
{
}
desktop.invalidate();
desktop.validate();
desktop.repaint();
frame.setCursor(Cursor.DEFAULT_CURSOR);
}
////queryby user name end;
//柜员终端设置处理start
void doConsoleSet()
{
if (!CenterUtilClass.checkRight()) return;//有否此权限
if (AllInternalFrame.G_MainPanel==null) AllInternalFrame.G_MainPanel = new UIPanel();//终端设置窗口
frame.setCursor(Cursor.WAIT_CURSOR);
if (AllInternalFrame.consoleSetInternalFrame ==null || (!AllInternalFrame.consoleSetInternalFrame.isDisplayable()) )
{
if (AllInternalFrame.consoleSetInternalFrame!=null && AllInternalFrame.consoleSetInternalFrame.isVisible())
{
try{
AllInternalFrame.consoleSetInternalFrame.setSelected(true);
}catch(Exception e1) {};
return ;
}
AllInternalFrame.consoleSetInternalFrame=AllInternalFrame.createInternalFrame(AllInternalFrame.G_MainPanel,CenterUtilClass.ICON_GLOBAL,"柜员终端设置窗口");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -