📄 userinfoshell.java
字号:
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);
fd.top = new FormAttachment(contactBanner, 30, SWT.BOTTOM);
textAddress.setLayoutData(fd);
// 邮政编码标签
Label lblZipcode = new Label(contact, SWT.NONE);
lblZipcode.setBackground(panelBackground);
lblZipcode.setText(LumaQQ.getResourceString("user.info.contact.zipcode"));
fd = new FormData();
fd.left = new FormAttachment(0, 5);
fd.right = new FormAttachment(20, 0);
fd.top = new FormAttachment(contactBanner, 55, SWT.BOTTOM);
lblZipcode.setLayoutData(fd);
// 邮政编码文本框
textZipcode = new Text(contact, SWT.SINGLE | SWT.BORDER);
textZipcode.setBackground(controlBackground);
fd = new FormData();
fd.left = new FormAttachment(lblZipcode, 3, SWT.RIGHT);
fd.right = new FormAttachment(100, -5);
fd.top = new FormAttachment(contactBanner, 55, SWT.BOTTOM);
textZipcode.setLayoutData(fd);
// 电话号码标签
Label lblTelephone = new Label(contact, SWT.NONE);
lblTelephone.setBackground(panelBackground);
lblTelephone.setText(LumaQQ.getResourceString("user.info.contact.telephone"));
fd = new FormData();
fd.left = new FormAttachment(0, 5);
fd.right = new FormAttachment(20, 0);
fd.top = new FormAttachment(contactBanner, 80, SWT.BOTTOM);
lblTelephone.setLayoutData(fd);
// 电话号码文本框
textTelephone = new Text(contact, SWT.SINGLE | SWT.BORDER);
textTelephone.setBackground(controlBackground);
fd = new FormData();
fd.left = new FormAttachment(lblTelephone, 3, SWT.RIGHT);
fd.right = new FormAttachment(100, -5);
fd.top = new FormAttachment(contactBanner, 80, SWT.BOTTOM);
textTelephone.setLayoutData(fd);
// 手机号码标签
Label lblMobile = new Label(contact, SWT.NONE);
lblMobile.setBackground(panelBackground);
lblMobile.setText(LumaQQ.getResourceString("user.info.contact.mobile"));
fd = new FormData();
fd.left = new FormAttachment(0, 5);
fd.right = new FormAttachment(20, 0);
fd.top = new FormAttachment(contactBanner, 105, SWT.BOTTOM);
lblMobile.setLayoutData(fd);
// 手机号码文本框
textMobile = new Text(contact, SWT.SINGLE | SWT.BORDER);
textMobile.setBackground(controlBackground);
fd = new FormData();
fd.left = new FormAttachment(lblMobile, 3, SWT.RIGHT);
fd.right = new FormAttachment(100, -5);
fd.top = new FormAttachment(contactBanner, 105, SWT.BOTTOM);
textMobile.setLayoutData(fd);
// open contact 标签
Label lblOpenContact = new Label(contact, SWT.NONE);
lblOpenContact.setBackground(panelBackground);
lblOpenContact.setText(LumaQQ.getResourceString("user.info.contact.opencontact.label"));
fd = new FormData();
fd.left = new FormAttachment(0, 5);
fd.top = new FormAttachment(contactBanner, 140, SWT.BOTTOM);
lblOpenContact.setLayoutData(fd);
Label lblSeparator = new Label(contact, SWT.SEPARATOR | SWT.HORIZONTAL);
lblSeparator.setBackground(panelBackground);
fd = new FormData();
fd.left = new FormAttachment(lblOpenContact, 0, SWT.RIGHT);
fd.right = new FormAttachment(100, -5);
fd.top = new FormAttachment(lblOpenContact, 0, SWT.TOP);
fd.bottom = new FormAttachment(lblOpenContact, 0, SWT.BOTTOM);
lblSeparator.setLayoutData(fd);
// open contact选项
// 完全公开
radioOpen = new Button(contact, SWT.RADIO);
radioOpen.setText(LumaQQ.getResourceString("user.info.contact.opencontact.open"));
radioOpen.setBackground(panelBackground);
fd = new FormData();
fd.left = new FormAttachment(10, 0);
fd.right = new FormAttachment(35, 0);
fd.top = new FormAttachment(lblOpenContact, 5, SWT.BOTTOM);
radioOpen.setLayoutData(fd);
// 仅好友可见
radioOnlyFriend = new Button(contact, SWT.RADIO);
radioOnlyFriend.setText(LumaQQ.getResourceString("user.info.contact.opencontact.onlyfriend"));
radioOnlyFriend.setBackground(panelBackground);
fd = new FormData();
fd.left = new FormAttachment(40, 0);
fd.right = new FormAttachment(65, 0);
fd.top = new FormAttachment(lblOpenContact, 5, SWT.BOTTOM);
radioOnlyFriend.setLayoutData(fd);
// 完全保密
radioClose = new Button(contact, SWT.RADIO);
radioClose.setText(LumaQQ.getResourceString("user.info.contact.opencontact.close"));
radioClose.setBackground(panelBackground);
fd = new FormData();
fd.left = new FormAttachment(70, 0);
fd.right = new FormAttachment(95, 0);
fd.top = new FormAttachment(lblOpenContact, 5, SWT.BOTTOM);
radioClose.setLayoutData(fd);
}
// 初始化详细资料面板
private void initDetailPanel() {
Composite detail = createPanel();
detail.setVisible(false);
composites[DETAIL] = detail;
// banner
detailBanner = new Label(detail, SWT.NONE);
detailBanner.setBackground(bannerBackground);
detailBanner.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);
detailBanner.setLayoutData(fd);
detailBanner.addPaintListener(new BannerPaintListener(LumaQQ.getResourceString("user.info.banner.detail")));
// 真实姓名标签
Label lblName = new Label(detail, SWT.NONE);
lblName.setBackground(panelBackground);
lblName.setText(LumaQQ.getResourceString("user.info.detail.name"));
fd = new FormData();
fd.left = new FormAttachment(0, 5);
fd.right = new FormAttachment(20, 0);
fd.top = new FormAttachment(detailBanner, 5, SWT.BOTTOM);
lblName.setLayoutData(fd);
// 真实姓名文本框
textName = new Text(detail, SWT.SINGLE | SWT.BORDER);
textName.setBackground(controlBackground);
fd = new FormData();
fd.left = new FormAttachment(lblName, 3, SWT.RIGHT);
fd.right = new FormAttachment(60, 0);
fd.top = new FormAttachment(detailBanner, 5, SWT.BOTTOM);
textName.setLayoutData(fd);
// 生肖标签
Label lblZodiac = new Label(detail, SWT.NONE);
lblZodiac.setBackground(panelBackground);
lblZodiac.setText(LumaQQ.getResourceString("user.info.detail.zodiac"));
fd = new FormData();
fd.left = new FormAttachment(60, 5);
fd.top = new FormAttachment(detailBanner, 5, SWT.BOTTOM);
lblZodiac.setLayoutData(fd);
// 生肖下拉框
comboZodiac = new CCombo(detail, SWT.DROP_DOWN | SWT.BORDER | SWT.READ_ONLY);
comboZodiac.setBackground(controlBackground);
for(int i = 0; i <= 12; i++)
comboZodiac.add(LumaQQ.getResourceString("user.info.detail.zodiac." + i));
fd = new FormData();
fd.left = new FormAttachment(lblZodiac, 3, SWT.RIGHT);
fd.right = new FormAttachment(100, -5);
fd.top = new FormAttachment(detailBanner, 5, SWT.BOTTOM);
comboZodiac.setLayoutData(fd);
// 学校标签
Label lblCollege = new Label(detail, SWT.NONE);
lblCollege.setBackground(panelBackground);
lblCollege.setText(LumaQQ.getResourceString("user.info.detail.college"));
fd = new FormData();
fd.left = new FormAttachment(0, 5);
fd.right = new FormAttachment(20, 0);
fd.top = new FormAttachment(detailBanner, 30, SWT.BOTTOM);
lblCollege.setLayoutData(fd);
// 学校文本框
textCollege = new Text(detail, SWT.SINGLE | SWT.BORDER);
textCollege.setBackground(controlBackground);
fd = new FormData();
fd.left = new FormAttachment(lblCollege, 3, SWT.RIGHT);
fd.right = new FormAttachment(60, 0);
fd.top = new FormAttachment(detailBanner, 30, SWT.BOTTOM);
textCollege.setLayoutData(fd);
// 血型标签
Label lblBlood = new Label(detail, SWT.NONE);
lblBlood.setBackground(panelBackground);
lblBlood.setText(LumaQQ.getResourceString("user.info.detail.blood"));
fd = new FormData();
fd.left = new FormAttachment(60, 5);
fd.top = new FormAttachment(detailBanner, 30, SWT.BOTTOM);
lblBlood.setLayoutData(fd);
// 血型下拉框
comboBlood = new CCombo(detail, SWT.DROP_DOWN | SWT.BORDER | SWT.READ_ONLY);
comboBlood.setBackground(controlBackground);
for(int i = 0; i <= 5; i++)
comboBlood.add(LumaQQ.getResourceString("user.info.detail.blood." + i));
fd = new FormData();
fd.left = new FormAttachment(lblBlood, 3, SWT.RIGHT);
fd.right = new FormAttachment(100, -5);
fd.top = new FormAttachment(detailBanner, 30, SWT.BOTTOM);
comboBlood.setLayoutData(fd);
// 职业标签
Label lblOccupation = new Label(detail, SWT.NONE);
lblOccupation.setBackground(panelBackground);
lblOccupation.setText(LumaQQ.getResourceString("user.info.detail.occupation"));
fd = new FormData();
fd.left = new FormAttachment(0, 5);
fd.right = new FormAttachment(20, 0);
fd.top = new FormAttachment(detailBanner, 55, SWT.BOTTOM);
lblOccupation.setLayoutData(fd);
// 职业下拉框
comboOccupation = new CCombo(detail, SWT.DROP_DOWN | SWT.BORDER);
comboOccupation.setBackground(controlBackground);
int n = Utils.getInt(LumaQQ.getResourceString("user.info.detail.occupation.number"), 0);
for(int i = 1; i <= n; i++)
comboOccupation.add(LumaQQ.getResourceString("user.info.detail.occupation." + i));
fd = new FormData();
fd.left = new FormAttachment(lblOccupation, 3, SWT.RIGHT);
fd.right = new FormAttachment(60, 0);
fd.top = new FormAttachment(detailBanner, 55, SWT.BOTTOM);
comboOccupation.setLayoutData(fd);
// 星座标签
Label lblHoroscope = new Label(detail, SWT.NONE);
lblHoroscope.setBackground(panelBackground);
lblHoroscope.setText(LumaQQ.getResourceString("user.info.detail.horoscope"));
fd = new FormData();
fd.left = new FormAttachment(60, 5);
fd.top = new FormAttachment(detailBanner, 55, SWT.BOTTOM);
lblHoroscope.setLayoutData(fd);
// 星座下拉框
comboHoroscope = new CCombo(detail, SWT.DROP_DOWN | SWT.BORDER | SWT.READ_ONLY);
comboHoroscope.setBackground(controlBackground);
for(int i = 0; i <= 12; i++)
comboHoroscope.add(LumaQQ.getResourceString("user.info.detail.horoscope." + i));
fd = new FormData();
fd.left = new FormAttachment(lblHoroscope, 3, SWT.RIGHT);
fd.right = new FormAttachment(100, -5);
fd.top = new FormAttachment(detailBanner, 55, SWT.BOTTOM);
comboHoroscope.setLayoutData(fd);
// 个人主页标签
Label lblHomePage = new Label(detail, SWT.NONE);
lblHomePage.setBackground(panelBackground);
lblHomePage.setText(LumaQQ.getResourceString("user.info.detail.homepage"));
fd = new FormData();
fd.left = new FormAttachment(0, 5);
fd.right = new FormAttachment(20, 0);
fd.top = new FormAttachment(detailBanner, 80, SWT.BOTTOM);
lblHomePage.setLayoutData(fd);
// 个人主页文本框
textHomePage = new Text(detail, SWT.SINGLE | SWT.BORDER);
textHomePage.setBackground(controlBackground);
fd = new FormData();
fd.left = new FormAttachment(lblHomePage, 3, SWT.RIGHT);
fd.right = new FormAttachment(100, -5);
fd.top = new FormAttachment(detailBanner, 80, SWT.BOTTOM);
textHomePage.setLayoutData(fd);
// 个人说明标签
Label lblIntro = new Label(detail, SWT.NONE);
lblIntro.setBackground(panelBackground);
lblIntro.setText(LumaQQ.getResourceString("user.info.detail.intro"));
fd = new FormData();
fd.left = new FormAttachment(0, 5);
fd.right = new FormAttachment(20, 0);
fd.top = new FormAttachment(detailBanner, 105, SWT.BOTTOM);
lblIntro.setLayoutData(fd);
// 个人说明文本框
textIntro = new Text(detail, SWT.MULTI | SWT.BORDER | SWT.WRAP);
textIntro.setBackground(controlBackground);
textIntro.setTextLimit(131);
fd = new FormData();
fd.left = new FormAttachment(lblIntro, 3, SWT.RIGHT);
fd.right = new FormAttachment(100, -5);
fd.top = new FormAttachment(detailBanner, 105, SWT.BOTTOM);
fd.bottom = new FormAttachment(100, -5);
textIntro.setLayoutData(fd);
}
// 初始化控件布局
private void initLayout() {
// 左边的信息分类选择按钮列
// 基本资料按钮
ShutterLabel btnBasic = new ShutterLabel(shell, MySWT.FLAT | MySWT.HOVER | SWT.CENTER, LumaQQ.getResourceString("user.info.button.basic"), icons.getResource(IconHolder.icoArrow));
btnBasic.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
btnBasic.setBackground(switchButtonColor);
FormData fd = new FormData();
fd.left = fd.top = new FormAttachment(0, 5);
fd.right = new FormAttachment(0, 105);
btnBasic.setLayoutData(fd);
prevPanel = BASIC;
prevButton = btnBasic;
btnBasic.addMouseListener(
new MouseAdapter() {
public void mouseDown(MouseEvent e) {
showPanel(BASIC);
btnUpdate.setText(LumaQQ.getResourceString("user.info.button.update"));
btnUpdate.setEnabled(true);
}
}
);
// 联系方法按钮
ShutterLabel btnContact = new ShutterLabel(shell, MySWT.FLAT | MySWT.HOVER | SWT.CENTER, LumaQQ.getResourceString("user.info.button.contact"), null);
btnContact.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
btnContact.setBackground(switchButtonColor);
fd = new FormData();
fd.left = new FormAttachment(0, 5);
fd.top = new FormAttachment(btnBasic, 0, SWT.BOTTOM);
fd.right = new FormAttachment(0, 105);
btnContact.setLayoutData(fd);
btnContact.addMouseListener(
new MouseAdapter() {
public void mouseDown(MouseEvent e) {
showPanel(CONTACT);
btnUpdate.setText(LumaQQ.getResourceString("user.info.button.update"));
btnUpdate.setEnabled(true);
}
}
);
// 详细资料按钮
ShutterLabel btnDetail = new ShutterLabel(shell, MySWT.FLAT | MySWT.HOVER | SWT.CENTER, LumaQQ.getResourceString("user.info.button.detail"), null);
btnDetail.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
btnDetail.setBackground(switchButtonColor);
fd = new FormData();
fd.left = new FormAttachment(0, 5);
fd.top = new FormAttachment(btnContact, 0, SWT.BOTTOM);
fd.right = new FormAttachment(0, 105);
btnDetail.setLayoutData(fd);
btnDetail.addMouseListener(
new MouseAdapter() {
public void mouseDown(MouseEvent e) {
showPanel(DETAIL);
btnUpdate.setText(LumaQQ.getResourceString("user.info.button.update"));
btnUpdate.setEnabled(true);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -