📄 userinfoshell.java
字号:
}
// 真实姓名
textName.setText(info.infos[info.name]);
// 毕业学校
textCollege.setText(info.infos[info.college]);
// 职业
comboOccupation.setText(info.infos[info.occupation]);
// 生肖
int i = Utils.getInt(info.infos[info.zodiac], 0);
if(i <= 12 && i >=0)
comboZodiac.setText(comboZodiac.getItem(i));
// 血型
i = Utils.getInt(info.infos[info.blood], 0);
if(i <= 5 && i >= 0)
comboBlood.setText(comboBlood.getItem(i));
// 星座
i = Utils.getInt(info.infos[info.horoscope], 0);
if(i <= 12 && i >= 0 )
comboHoroscope.setText(comboHoroscope.getItem(i));
// 主页
textHomePage.setText(info.infos[info.homepage]);
// 个人说明
textIntro.setText(info.infos[info.intro]);
// 好友认证设置
int openHp = Utils.getInt(info.infos[info.authType], 0);
if(openHp == QQ.QQ_AUTH_NO_AUTH) {
radioAnyOne.setSelection(true);
radioAuth.setSelection(false);
radioNever.setSelection(false);
} else if(openHp == QQ.QQ_AUTH_NEED_AUTH) {
radioAnyOne.setSelection(false);
radioAuth.setSelection(true);
radioNever.setSelection(false);
} else {
radioAnyOne.setSelection(false);
radioAuth.setSelection(false);
radioNever.setSelection(true);
}
// QQ秀
if(main.sm.isCached(qqNum))
qqShowImage = main.sm.getQQShowImage(qqNum);
else
qqShowImage = icons.getResource(IconHolder.bmpDefaultQQShow);
qqShow.redraw();
// 设置更新QQ Show按钮的使能状态
btnUpdateQQShow.setEnabled(hasQQShow());
}
/**
* 得到shell
* @return
*/
public Shell getShell() {
return shell;
}
// 初始化基本资料面板
private void initBasicPanel() {
Composite basic = createPanel();
prevComposite = basic;
composites[BASIC] = basic;
// banner
basicBanner = new Label(basic, SWT.NONE);
basicBanner.setBackground(bannerBackground);
basicBanner.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
FormData fd = new FormData();
fd.left = fd.top = new FormAttachment(0, 0);
fd.right = new FormAttachment(100, 0);
fd.bottom = new FormAttachment(0, 24);
basicBanner.setLayoutData(fd);
basicBanner.addPaintListener(new BannerPaintListener(LumaQQ.getResourceString("user.info.banner.basic")));
// 用户号码标签
Label lblQQ = new Label(basic, SWT.NONE);
lblQQ.setBackground(panelBackground);
lblQQ.setText(LumaQQ.getResourceString("user.info.basic.qq"));
fd = new FormData();
fd.left = new FormAttachment(0, 5);
fd.right = new FormAttachment(20, 0);
fd.top = new FormAttachment(basicBanner, 5, SWT.BOTTOM);
lblQQ.setLayoutData(fd);
// 用户号码文本框
textQQ = new Text(basic, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY);
textQQ.setBackground(panelBackground);
fd = new FormData();
fd.left = new FormAttachment(lblQQ, 3, SWT.RIGHT);
fd.right = new FormAttachment(60, 0);
fd.top = new FormAttachment(basicBanner, 5, SWT.BOTTOM);
textQQ.setLayoutData(fd);
// 用户昵称标签
Label lblNick = new Label(basic, SWT.NONE);
lblNick.setBackground(panelBackground);
lblNick.setText(LumaQQ.getResourceString("user.info.basic.nick"));
fd = new FormData();
fd.left = new FormAttachment(0, 5);
fd.right = new FormAttachment(20, 0);
fd.top = new FormAttachment(basicBanner, 30, SWT.BOTTOM);
lblNick.setLayoutData(fd);
// 用户昵称文本框
textNick = new Text(basic, SWT.SINGLE | SWT.BORDER);
textNick.setTextLimit(12);
textNick.setBackground(controlBackground);
fd = new FormData();
fd.left = new FormAttachment(lblNick, 3, SWT.RIGHT);
fd.right = new FormAttachment(60, 0);
fd.top = new FormAttachment(basicBanner, 30, SWT.BOTTOM);
textNick.setLayoutData(fd);
// 年龄标签
Label lblAge = new Label(basic, SWT.NONE);
lblAge.setBackground(panelBackground);
lblAge.setText(LumaQQ.getResourceString("user.info.basic.age"));
fd = new FormData();
fd.left = new FormAttachment(0, 5);
fd.right = new FormAttachment(20, 0);
fd.top = new FormAttachment(basicBanner, 55, SWT.BOTTOM);
lblAge.setLayoutData(fd);
// 年龄文本框
textAge = new Text(basic, SWT.SINGLE | SWT.BORDER);
textAge.setTextLimit(3);
textAge.setBackground(controlBackground);
fd = new FormData();
fd.left = new FormAttachment(lblAge, 3, SWT.RIGHT);
fd.right = new FormAttachment(60, 0);
fd.top = new FormAttachment(basicBanner, 55, SWT.BOTTOM);
textAge.setLayoutData(fd);
// 性别标签
Label lblGender = new Label(basic, SWT.NONE);
lblGender.setBackground(panelBackground);
lblGender.setText(LumaQQ.getResourceString("user.info.basic.gender"));
fd = new FormData();
fd.left = new FormAttachment(0, 5);
fd.right = new FormAttachment(20, 0);
fd.top = new FormAttachment(basicBanner, 80, SWT.BOTTOM);
lblGender.setLayoutData(fd);
// 性别下拉框
comboGender = new CCombo(basic, SWT.DROP_DOWN | SWT.BORDER);
comboGender.setBackground(controlBackground);
comboGender.setTextLimit(6);
comboGender.add(LumaQQ.getResourceString("user.info.basic.gender.male"));
comboGender.add(LumaQQ.getResourceString("user.info.basic.gender.female"));
comboGender.add(LumaQQ.getResourceString("user.info.basic.gender.both"));
comboGender.add(LumaQQ.getResourceString("user.info.basic.gender.null"));
fd = new FormData();
fd.left = new FormAttachment(lblGender, 3, SWT.RIGHT);
fd.right = new FormAttachment(60, 0);
fd.top = new FormAttachment(basicBanner, 80, SWT.BOTTOM);
comboGender.setLayoutData(fd);
// 国家/地区标签
Label lblCountry = new Label(basic, SWT.NONE);
lblCountry.setBackground(panelBackground);
lblCountry.setText(LumaQQ.getResourceString("user.info.basic.country"));
fd = new FormData();
fd.left = new FormAttachment(0, 5);
fd.right = new FormAttachment(20, 0);
fd.top = new FormAttachment(basicBanner, 105, SWT.BOTTOM);
lblCountry.setLayoutData(fd);
// 国家/地区下拉框
comboCountry = new CCombo(basic, SWT.DROP_DOWN | SWT.BORDER);
comboCountry.setBackground(controlBackground);
comboCountry.setTextLimit(17);
comboCountry.add(LumaQQ.getResourceString("user.info.basic.country.prc"));
fd = new FormData();
fd.left = new FormAttachment(lblCountry, 3, SWT.RIGHT);
fd.right = new FormAttachment(60, 0);
fd.top = new FormAttachment(basicBanner, 105, SWT.BOTTOM);
comboCountry.setLayoutData(fd);
// 省份标签
Label lblProvince = new Label(basic, SWT.NONE);
lblProvince.setBackground(panelBackground);
lblProvince.setText(LumaQQ.getResourceString("user.info.basic.province"));
fd = new FormData();
fd.left = new FormAttachment(0, 5);
fd.right = new FormAttachment(20, 0);
fd.top = new FormAttachment(basicBanner, 130, SWT.BOTTOM);
lblProvince.setLayoutData(fd);
// 省份下拉框
comboProvince = new CCombo(basic, SWT.DROP_DOWN | SWT.BORDER);
comboProvince.setBackground(controlBackground);
comboProvince.setTextLimit(18);
fd = new FormData();
fd.left = new FormAttachment(lblProvince, 3, SWT.RIGHT);
fd.right = new FormAttachment(60, 0);
fd.top = new FormAttachment(basicBanner, 130, SWT.BOTTOM);
comboProvince.setLayoutData(fd);
// 城市标签
Label lblCity = new Label(basic, SWT.NONE);
lblCity.setBackground(panelBackground);
lblCity.setText(LumaQQ.getResourceString("user.info.basic.city"));
fd = new FormData();
fd.left = new FormAttachment(0, 5);
fd.right = new FormAttachment(20, 0);
fd.top = new FormAttachment(basicBanner, 155, SWT.BOTTOM);
lblCity.setLayoutData(fd);
// 城市文本框
textCity = new Text(basic, SWT.SINGLE | SWT.BORDER);
textCity.setTextLimit(3);
textCity.setBackground(controlBackground);
fd = new FormData();
fd.left = new FormAttachment(lblCity, 3, SWT.RIGHT);
fd.right = new FormAttachment(60, 0);
fd.top = new FormAttachment(basicBanner, 155, SWT.BOTTOM);
textCity.setLayoutData(fd);
// 头像选择按钮
btnFace = new ShutterLabel(basic, MySWT.FLAT | MySWT.HOVER | SWT.CENTER, null, null);
btnFace.setShowSmallImage(false);
btnFace.setVerticalSpacing(5);
btnFace.setHorizontalSpacing(5);
btnFace.setBackground(panelBackground);
fd = new FormData();
fd.left = new FormAttachment(65, 0);
fd.top = new FormAttachment(basicBanner, 5, SWT.BOTTOM);
btnFace.setLayoutData(fd);
btnFace.addMouseListener(
new MouseAdapter() {
public void mouseUp(MouseEvent e) {
if(canModified) {
if(iss == null || iss.isDisposed()) {
iss = new ImageSelectShell(shell);
iss.addShellListener(new FacePanelListener());
iss.setImageSize(32, 32);
iss.setMarginWidth(5);
iss.setMarginHeight(5);
iss.setHorizontalSpacing(5);
iss.setVerticalSpacing(5);
iss.setDimension(6, 6);
iss.addAllFace();
iss.refresh();
Rectangle bound = btnFace.getBounds();
iss.setLocation(composites[BASIC].toDisplay(bound.x, bound.y + bound.height));
iss.open();
}
}
}
}
);
// QQ秀
qqShow = new Label(basic, SWT.NONE);
qqShow.setBackground(panelBackground);
fd = new FormData();
fd.left = new FormAttachment(btnFace, 0, SWT.LEFT);
fd.right = fd.bottom = new FormAttachment(100, -5);
fd.top = new FormAttachment(btnFace, 5, SWT.BOTTOM);
qqShow.setLayoutData(fd);
qqShow.addPaintListener(
new PaintListener() {
public void paintControl(PaintEvent e) {
Rectangle ca = qqShow.getBounds();
e.gc.fillRectangle(ca);
if(qqShowImage != null) {
Rectangle bound = qqShowImage.getBounds();
int x = (bound.width - ca.width) / 2;
int y = (bound.height - ca.height) / 2;
if(x >= 0 && y >= 0)
e.gc.drawImage(qqShowImage, x, y, ca.width, ca.height, 0, 0, ca.width, ca.height);
else if(x >= 0 && y < 0)
e.gc.drawImage(qqShowImage, x, 0, ca.width, bound.height, 0, -y, ca.width, bound.height);
else if(x < 0 && y >= 0)
e.gc.drawImage(qqShowImage, 0, y, bound.width, ca.height, -x, 0, bound.width, ca.height);
else
e.gc.drawImage(qqShowImage, 0, 0, bound.width, bound.height, -x, -y, bound.width, bound.height);
}
e.gc.drawRectangle(0, 0, ca.width - 1, ca.height - 1);
}
}
);
// 更新QQ秀按钮
btnUpdateQQShow = new ShutterLabel(basic, MySWT.HOVER | SWT.CENTER, LumaQQ.getResourceString("user.info.button.update.qqshow"), null);
btnUpdateQQShow.setEnabled(false);
fd = new FormData();
fd.bottom = new FormAttachment(qqShow, 0, SWT.BOTTOM);
fd.right = new FormAttachment(qqShow, -5, SWT.LEFT);
btnUpdateQQShow.setLayoutData(fd);
btnUpdateQQShow.addMouseListener(
new MouseAdapter() {
public void mouseUp(MouseEvent e) {
qqShowImage = icons.getResource(IconHolder.bmpDownloading);
qqShow.redraw();
main.sm.downloadQQShowImage(qqNum);
}
}
);
}
// 初始化联系方法面板
private void initContactPanel() {
Composite contact = createPanel();
contact.setVisible(false);
composites[CONTACT] = contact;
// banner
contactBanner = new Label(contact, SWT.NONE);
contactBanner.setBackground(bannerBackground);
contactBanner.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
FormData fd = new FormData();
fd.left = fd.top = new FormAttachment(0, 0);
fd.right = new FormAttachment(100, 0);
fd.bottom = new FormAttachment(0, 24);
contactBanner.setLayoutData(fd);
contactBanner.addPaintListener(new BannerPaintListener(LumaQQ.getResourceString("user.info.banner.contact")));
// 电子邮件标签
Label lblEmail = new Label(contact, SWT.NONE);
lblEmail.setBackground(panelBackground);
lblEmail.setText(LumaQQ.getResourceString("user.info.contact.email"));
fd = new FormData();
fd.left = new FormAttachment(0, 5);
fd.right = new FormAttachment(20, 0);
fd.top = new FormAttachment(contactBanner, 5, SWT.BOTTOM);
lblEmail.setLayoutData(fd);
// 电子邮件文本框
textEmail = new Text(contact, SWT.SINGLE | SWT.BORDER);
textEmail.setBackground(controlBackground);
fd = new FormData();
fd.left = new FormAttachment(lblEmail, 3, SWT.RIGHT);
fd.right = new FormAttachment(100, -5);
fd.top = new FormAttachment(contactBanner, 5, SWT.BOTTOM);
textEmail.setLayoutData(fd);
// 联系地址标签
Label lblAddress = new Label(contact, SWT.NONE);
lblAddress.setBackground(panelBackground);
lblAddress.setText(LumaQQ.getResourceString("user.info.contact.address"));
fd = new FormData();
fd.left = new FormAttachment(0, 5);
fd.right = new FormAttachment(20, 0);
fd.top = new FormAttachment(contactBanner, 30, SWT.BOTTOM);
lblAddress.setLayoutData(fd);
// 联系地址文本框
textAddress = new Text(contact, SWT.SINGLE | SWT.BORDER);
textAddress.setBackground(controlBackground);
fd = new FormData();
fd.left = new FormAttachment(lblAddress, 3, SWT.RIGHT);
fd.right = new FormAttachment(100, -5);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -