📄 accreditpanel.java
字号:
/*
* ====================================================================
* The Class Description
* Version: 1.0.0
* Date: 11/08/2005
* Author: Xing.zhou
* Function: 帐号授权界面的建立
*
* ====================================================================
*
*/
package vocal.ui;
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import vocal.comm.VPPTransactionWrapper;
import vocal.userEditor.AccreditEditor;
import vocal.ui.AdministrativeLoginPanel;
/*
* ====================================================================
* The Class Description
* Version: 1.0.0
* Date: 11/08/2005
* Author: Xing.zhou
* Function: 这个类中定义了帐号授权的界面和已授权的帐号信息
*
* ====================================================================
*
*/
public class AccreditPanel extends JDialog
{
private JPanel jpanel;
private JButton add;
private JButton edit;
private JButton help;
private Container parent;
protected VPPTransactionWrapper connect;
private AdministrativeLoginPanel accountDialog;
private ConfigureServers techDialog;
private AccreditPanel accreditDialog;
private AccreditEditor accrediteditor = null;
/**
* @return
*/
private Container getTopLevelAncestor() {
// TODO Auto-generated method stub
return null;
}
/*
protected void account_dialog()
{
if (accountDialog == null)
{
accountDialog = new AdministrativeLoginPanel(isStandalone, connection,
getRootPane());
accountDialog.setModal(true);
}
Container parent = AccreditPanel.this.getTopLevelAncestor();
parent.setVisible(false);
techDialog.setVisible(true);
parent.setVisible(true);
if (JFrame.class.isInstance(parent))
{
((JFrame) parent).toFront();
((JFrame) parent).setState(JFrame.NORMAL);
}
}
*/
//用户进入技术管理
protected void tech_dialog()
{
if (techDialog == null)
{
techDialog = new ConfigureServers(this);
techDialog.setModal(true);
}
//Container parent = AccreditPanel.this.getTopLevelAncestor();
AccreditPanel.this.setVisible(false);
//parent.setVisible(false);
techDialog.setVisible(true);
//AccreditPanel.this.setVisible(true);
//parent.setVisible(true);
if (JFrame.class.isInstance(parent))
{
((JFrame) parent).toFront();
((JFrame) parent).setState(JFrame.NORMAL);
}
}
// 用户进入帐号授权中心
protected void accredit_dialog()
{
if (accreditDialog == null)
{
accreditDialog = new AccreditPanel(this,connect);
accreditDialog.setModal(true);
}
Container parent = AccreditPanel.this.getTopLevelAncestor();
parent.setVisible(false);
accreditDialog.setVisible(true);
parent.setVisible(true);
if (JFrame.class.isInstance(parent))
{
((JFrame) parent).toFront();
((JFrame) parent).setState(JFrame.NORMAL);
}
}
public AccreditPanel(Container aParent,VPPTransactionWrapper con)
{
parent = aParent;
setTitle("Account accredit");
//外层JPanel
JPanel temp = new JPanel();
temp.setLayout(new BorderLayout());
//上部按钮JPanel
jpanel = new JPanel();
jpanel.setLayout(new BoxLayout(jpanel, BoxLayout.X_AXIS));
JButton back = new JButton("back");
back.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
AccreditPanel.this.setVisible(false);
}
});
jpanel.add(back);
JButton acc_manage = new JButton("帐号管理");
acc_manage.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
}
});
jpanel.add(acc_manage);
JButton tech_manage = new JButton("技术管理");
tech_manage.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
//adminDialog.setVisible(false);
tech_dialog();
}
});
jpanel.add(tech_manage);
JButton accredit = new JButton("帐号授权中心");
accredit.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
//adminDialog.setVisible(false);
//accredit_dialog();
}
});
jpanel.add(accredit);
jpanel.setBorder(new EmptyBorder(8, 8, 8, 8));
//jpanel.add(Box.createHorizontalGlue());
temp.add(jpanel, BorderLayout.NORTH);
//数据表显示JPanel
JPanel temp2 = new JPanel();
temp2.setLayout(new BoxLayout(jpanel, BoxLayout.X_AXIS));
//用户数据显示表格区
accrediteditor = new AccreditEditor(con);
temp.add(accrediteditor, BorderLayout.CENTER);
//accrediteditor.init();
//editor.init();
this.setModal(true);
temp.setVisible(true);
this.getContentPane().add(temp, BorderLayout.CENTER);
pack();
accrediteditor.init();
accrediteditor.loadGroupNames();
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
setLocation((d.width - this.getSize().width) / 2,
(d.height - this.getSize().height) / 2);
//System.out.println("accreditdialog come");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -