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

📄 accountpanel.java

📁 这是一个用java和xml编写的流媒体服务器管理软件
💻 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.Box;
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.userEditor.Editor;
import vocal.ui.AdministrativeLoginPanel;

/*
 * ====================================================================
 * The Class Description 
 * Version:  1.0.0
 * Date:     11/08/2005
 * Author:   Xing.zhou
 * Function: 这个类中定义了帐号授权的界面和已授权的帐号信息
 * 
 * ====================================================================
 * 
 */
public class AccountPanel extends JDialog
{	
	  public static JDialog adminDialog;
	  private ConfigureServers techDialog;
	  private AccreditPanel accreditDialog;
	  private Container parent;
	  private Editor editor = null;
	  private AccreditEditor accrediteditor = null;
	  protected VPPTransactionWrapper connect;
	/**
	 * @return
	 */
	private Container getTopLevelAncestor() {
		// TODO Auto-generated method stub
		return null;
	}

	
	  
	public AccountPanel(Container aParent)
	{
		 parent = aParent;

		 setTitle("Account Manage");
	  
	  	 if (editor == null)
	     {
	     	
	     	//用户数据显示表格区
	       editor = new Editor(connect);

	       // The user editor goes in the center panel of a border layout
	       JPanel temp = new JPanel();

	       temp.setLayout(new BorderLayout());
	       temp.add(editor, BorderLayout.CENTER);

	       
	       // add another panel at the bottom which has the back button
	       JPanel temp2 = new JPanel();

	       temp2.setLayout(new BoxLayout(temp2, BoxLayout.X_AXIS));
	/*
	       JButton back = new JButton("Back");

	       back.addActionListener(new ActionListener()
	       {
	         public void actionPerformed(ActionEvent e)
	         {
	         	return_login();
	           //adminDialog.setVisible(false);
	         }

	       });
	       temp2.add(back);
	*/       
	       JButton acc_manage = new JButton("帐号管理");

	       acc_manage.addActionListener(new ActionListener()
	       {
	         public void actionPerformed(ActionEvent e)
	         {
	           
	         }

	       });
	       temp2.add(acc_manage);
	       
	       JButton tech_manage = new JButton("技术管理");

	       tech_manage.addActionListener(new ActionListener()
	       {
	         public void actionPerformed(ActionEvent e)
	         {
	        	 //this.setVisible(false);
	           tech_dialog();
	         }
	       });
	       temp2.add(tech_manage);
	       
	       JButton accredit = new JButton("帐号授权中心");

	       accredit.addActionListener(new ActionListener()
	       {
	         public void actionPerformed(ActionEvent e)
	         {
	         	//adminDialog.setVisible(false);
	         	accredit_dialog();
	         }

	       });
	       temp2.add(accredit);
	       temp2.add(Box.createHorizontalGlue());
	       temp2.setBorder(new EmptyBorder(5, 5, 5, 5));
	      
	       temp.add(temp2, BorderLayout.NORTH); 
	       
	       this.getContentPane().add(temp);
	       this.pack();
	       this.setSize(700, 500);

	       temp2 = new JPanel();

	       temp2.setLayout(new BoxLayout(temp2, BoxLayout.X_AXIS));
	       temp2.setBorder(new EmptyBorder(2, 4, 2, 4));
	       temp2.add(vocal.util.Logger.getLogLabel());

	       temp.add(temp2, BorderLayout.SOUTH);
	       
	       temp2 = new JPanel();

	       temp2.setLayout(new BoxLayout(temp2, BoxLayout.X_AXIS));
	       /*
	       JButton back = new JButton("Back");
	       back.addActionListener(new ActionListener()
	       {
	              public void actionPerformed(ActionEvent e)
	              {
	              	return_login();
	                //adminDialog.setVisible(false);
	              }
	       });
	       temp2.add(back); 
	       JButton help = new JButton("help");
	       help.addActionListener(new ActionListener()
	       {
	            public void actionPerformed(ActionEvent e)
	            {
	            	JOptionPane.showMessageDialog(AdministrativeLoginPanel.this.getTopLevelAncestor(), 
	   	  	                "Extend Multimedia Server\n\n" 
	   	  	                + "帐号管理可以用于用户帐号添加、编辑、删除\n" +
	   	  	                "并且可以查询用户", "Login Help", JOptionPane.INFORMATION_MESSAGE);
	                //adminDialog.setVisible(false);
	            }
	       });
	       temp2.add(help); 
	       */
	       temp2.add(Box.createHorizontalGlue());
	       temp2.setBorder(new EmptyBorder(5, 5, 5, 5));
	      
	       temp.add(temp2, BorderLayout.SOUTH);  
	     }

	     //Container parent = AccountPanel.this.getTopLevelAncestor();

	     //editor.init();
	     /*
	     parent.setVisible(false);

	     //editor.loadUserNames();     
	     
	     adminDialog.setVisible(true);     // modal
	     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);
	    }

	    AccountPanel.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 accredit_dialog()
	  {
	  	  	if (accreditDialog == null)
	  	    {  	  		
	  	  	 accreditDialog = new AccreditPanel(this,connect);

	  	  	accreditDialog.setModal(true);
	  	    }

	  	    AccountPanel.this.getTopLevelAncestor();
	        
	  	    //accrediteditor.init();   
	  	    //editor.loadUserNames();    	    
	  	    
	  	    parent.setVisible(false);	  	    
	  	    accreditDialog.setVisible(true);
	  	    parent.setVisible(true);

	  	    if (JFrame.class.isInstance(parent))
	  	    {
	  	      ((JFrame) parent).toFront();
	  	      ((JFrame) parent).setState(JFrame.NORMAL);
	  	    }
	  	
	 }
}	  

⌨️ 快捷键说明

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