package pkgJICQ.client.frame;
import pkgJICQ.client.data.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.tree.*;
import snoozesoft.systray4j.*;
public class MyListFrame extends JFrame implements ActionListener,
MouseMotionListener, SysTrayMenuListener {
/**
*
*/
private static final long serialVersionUID = 4142575358653071688L;
JComboBox combox;//下拉列表
JPanel panel, buttomPanel, panel1, panel2, panel3, panel6, panel7, panel8;
JButton mainButton, findButton;
JLabel msgLabel;
CardLayout cardlayout;//布局显示
JButton panel1Button1, panel1Button2, panel1Button3, panel2Button1,
panel2Button2, panel2Button3, panel3Button1, panel3Button2,
panel3Button3;
JPopupMenu popMenu;
JPopupMenu statMenu;
JPopupMenu mainMenu;
JMenuItem numMenu, myDetailMenu, helpMenu, pwdMenu;//菜单MENU screenMenu, audioMenu暂时去掉中两个
JMenu GroupManager;
JMenuItem showPerson;
JMenuItem addGroup, delGroup;
JMenuItem delFriend;
// JMenuItem breshMenu, coldMenu, loveMenu, liMenu;
JMenuItem onlineMenu, leftMenu, hideToMenu, optionMenu;
JTree jtr;//定义一个树
MyPersonTree pTree;
int hide = 0; // 窗体隐藏变量
public static java.util.Vector GroupVector = new java.util.Vector(10);//存放打开的群聊天窗口的相关信息
private static String toolTip = "";// 提示文字
static String path = System.getProperty("user.dir");
static final SysTrayMenuIcon icon = new SysTrayMenuIcon(path
+ "\\rocket.gif");// 托盘的图片信息
SysTrayMenu menu;// 系统托盘的菜单信息
public MyListFrame() {
System.out.println("into MyListFrame构造函数");
// 系统托盘
icon.addSysTrayMenuListener(this);//添加菜单的事件处理
// 创建系统的托盘信息
this.createMenu();
panel = new JPanel();
panel1 = new JPanel();
panel2 = new JPanel();
panel3 = new JPanel();
panel6 = new JPanel();
panel7 = new JPanel();
panel8 = new JPanel();
buttomPanel = new JPanel();//???
combox = new JComboBox();//??
// 主要菜单====================================================
mainMenu = new JPopupMenu();
numMenu = new JMenuItem("新号码申请");
myDetailMenu = new JMenuItem("个人设置");
//screenMenu = new JMenuItem("屏幕切图");
// audioMenu = new JMenuItem("语音聊天");
helpMenu = new JMenuItem("系统帮助");
pwdMenu = new JMenuItem("用户中心");
numMenu
.setIcon(new ImageIcon(MyCursor.path
+ "\\picture\\pMenu\\1.jpg"));
myDetailMenu.setIcon(new ImageIcon(MyCursor.path
+ "\\picture\\pMenu\\2.jpg"));
//screenMenu.setIcon(new ImageIcon(MyCursor.path+ "\\picture\\pMenu\\3.jpg"));
helpMenu.setIcon(new ImageIcon(MyCursor.path
+ "\\picture\\pMenu\\4.jpg"));
//audioMenu.setIcon(new ImageIcon(MyCursor.path+ "\\picture\\pMenu\\5.jpg"));
pwdMenu.setIcon(new ImageIcon(MyCursor.path
+ "\\picture\\pMenu\\bresh.PNG"));
mainMenu.add(numMenu);
mainMenu.add(pwdMenu);
//mainMenu.add(screenMenu);
//mainMenu.add(audioMenu);
mainMenu.add(myDetailMenu);
mainMenu.add(helpMenu);
MyMenuListener menuLst = new MyMenuListener(this);//菜单事件处理
numMenu.addActionListener(menuLst);
myDetailMenu.addActionListener(menuLst);
//screenMenu.addActionListener(menuLst);
helpMenu.addActionListener(menuLst);
// audioMenu.addActionListener(menuLst);
pwdMenu.addActionListener(menuLst);
// 右键菜单======================================================
popMenu = new JPopupMenu();
showPerson = new JMenuItem("显示我的资料");
JMenuItem sortMenu = new JMenuItem("排序显示用户");
JMenuItem hideMenu = new JMenuItem("隐藏我的头像");
GroupManager = new JMenu("好友组管理");
addGroup = new JMenuItem("添加好友组(不能重复)");
delGroup = new JMenuItem("删除好友组(空组)");
GroupManager.add(addGroup);
GroupManager.add(delGroup);
JMenuItem showOnline = new JMenuItem("只显示在线用户");
//JMenu cursorSet = new JMenu("指针类型设置");
delFriend = new JMenuItem("删除好友");
showPerson.setIcon(new ImageIcon(MyCursor.path
+ "\\picture\\pMenu\\1.jpg"));
sortMenu.setIcon(new ImageIcon(MyCursor.path
+ "\\picture\\pMenu\\2.jpg"));
hideMenu.setIcon(new ImageIcon(MyCursor.path
+ "\\picture\\pMenu\\3.jpg"));
GroupManager.setIcon(new ImageIcon(MyCursor.path
+ "\\picture\\pMenu\\4.jpg"));
showOnline.setIcon(new ImageIcon(MyCursor.path
+ "\\picture\\pMenu\\5.jpg"));
//cursorSet.setIcon(new ImageIcon(MyCursor.path+ "\\picture\\pMenu\\bresh.PNG"));
delFriend.setIcon(new ImageIcon(MyCursor.path
+ "\\picture\\pMenu\\7.jpg"));
/*breshMenu = new JMenuItem("清凉型");
coldMenu = new JMenuItem("冷酷型");
loveMenu = new JMenuItem("可爱型");
liMenu = new JMenuItem("战略型");
breshMenu.setIcon(new ImageIcon(MyCursor.path
+ "\\picture\\pMenu\\bresh.png"));
coldMenu.setIcon(new ImageIcon(MyCursor.path
+ "\\picture\\pMenu\\cold.png"));
loveMenu.setIcon(new ImageIcon(MyCursor.path
+ "\\picture\\pMenu\\love.png"));
liMenu
.setIcon(new ImageIcon(MyCursor.path
+ "\\picture\\pMenu\\li.png"));
breshMenu.addActionListener(menuLst);
coldMenu.addActionListener(menuLst);
loveMenu.addActionListener(menuLst);
liMenu.addActionListener(menuLst);*/
addGroup.addActionListener(menuLst);
delGroup.addActionListener(menuLst);
showPerson.addActionListener(menuLst);
delFriend.addActionListener(menuLst);
/* cursorSet.add(breshMenu);
cursorSet.add(coldMenu);
cursorSet.add(loveMenu);
cursorSet.add(liMenu);*/
popMenu.add(showPerson);
// popMenu.add(sortMenu);
popMenu.add(hideMenu);
popMenu.add(GroupManager);
popMenu.add(showOnline);
// popMenu.add(cursorSet);
popMenu.add(delFriend);
statMenu = new JPopupMenu();
onlineMenu = new JMenuItem("上线");
leftMenu = new JMenuItem("离开");
hideToMenu = new JMenuItem("隐身");
optionMenu = new JMenuItem("个人设置");
onlineMenu.addActionListener(menuLst);
leftMenu.addActionListener(menuLst);
hideToMenu.addActionListener(menuLst);
optionMenu.addActionListener(menuLst);
statMenu.add(onlineMenu);
statMenu.add(leftMenu);
statMenu.add(hideToMenu);
statMenu.add(optionMenu);
System.out.println("生成我的好友树");
pTree = new MyPersonTree(this);//生成MyPersonTree一个对象
jtr = pTree.createPersonTree();//调用MyPersonTree的方法
//三个面板都有以下的内容
panel1Button1 = new JButton("我的好友");
panel1Button2 = new JButton("我的JICQ群");
panel1Button3 = new JButton("最近联系人");
panel2Button1 = new JButton("我的好友");
panel2Button2 = new JButton("我的JICQ群");
panel2Button3 = new JButton("最近联系人");
panel3Button1 = new JButton("我的好友");
panel3Button2 = new JButton("我的JICQ群");
panel3Button3 = new JButton("最近联系人");
panel1Button1.setIcon(new ImageIcon(MyCursor.path
+ "\\picture\\pButton\\menu1.gif"));
panel1Button2.setIcon(new ImageIcon(MyCursor.path
+ "\\picture\\pButton\\menu5.gif"));
panel1Button3.setIcon(new ImageIcon(MyCursor.path
+ "\\picture\\pButton\\menu6.gif"));
panel2Button1.setIcon(new ImageIcon(MyCursor.path
+ "\\picture\\pButton\\menu1.gif"));
panel2Button2.setIcon(new ImageIcon(MyCursor.path
+ "\\picture\\pButton\\menu2.gif"));
panel2Button3.setIcon(new ImageIcon(MyCursor.path
+ "\\picture\\pButton\\menu6.gif"));
panel3Button1.setIcon(new ImageIcon(MyCursor.path
+ "\\picture\\pButton\\menu1.gif"));
panel3Button2.setIcon(new ImageIcon(MyCursor.path
+ "\\picture\\pButton\\menu2.gif"));
panel3Button3.setIcon(new ImageIcon(MyCursor.path
+ "\\picture\\pButton\\menu3.gif"));
panel1Button1.setFont(new java.awt.Font("Dialog", 0, 14));
panel1Button2.setFont(new java.awt.Font("Dialog", 0, 14));
panel1Button3.setFont(new java.awt.Font("Dialog", 0, 14));
panel2Button1.setFont(new java.awt.Font("Dialog", 0, 14));
评论0