Skip to content

Commit a523076

Browse files
committed
更新UI,增加数据管理界面
1 parent c0c56e0 commit a523076

File tree

16 files changed

+445
-11
lines changed

16 files changed

+445
-11
lines changed

conf/nbs.db

0 Bytes
Binary file not shown.

conf/zh-cn.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ nbs.ui.btn.about.title=\u5173\u4E8E
1515
### panel title
1616
nbs.ui.panel.info.label=PEER INFO :
1717
nbs.ui.panel.about.label=About NBS Chain
18+
#will @Deprecated
1819
nbs.ui.panel.file.label=NBS FILE DATA
20+
nbs.ui.panel.data.label=\u6570\u636E\u7BA1\u7406
1921
nbs.ui.panel.im.label=NBS World IM
2022
nbs.ui.panel.setting.label=\u914D\u7F6E
2123

src/main/java/io/nbs/client/cnsts/ColorCnst.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class ColorCnst {
4141
public static final Color CONTACTS_ITEM_GRAY_MAIN = new Color(221, 221, 221);
4242
public static final Color CONTACTS_ITEM_LINE_GRAY = new Color(207, 207, 207);
4343
public static final Color CONTACTS_ITEM_GRAY = new Color(191, 191, 191);
44-
public static final Color SEEARCH_ITEM_GRAY_LIGHT = new Color(211, 211, 211);
44+
public static final Color SEEARCH_ITEM_GRAY_LIGHT = new Color(247, 247, 247);
4545
public static final Color SEEARCHTEXT_ITEM_GRAYBG = new Color(175, 175, 175);
4646
public static final Color SEEARCH_ITEM_GRAY_DARKER = new Color(138, 138, 138);
4747
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package io.nbs.client.ui.components;
2+
3+
import io.nbs.client.cnsts.ColorCnst;
4+
import io.nbs.commons.utils.IconUtil;
5+
import org.apache.commons.lang3.StringUtils;
6+
7+
import javax.swing.*;
8+
import java.awt.*;
9+
10+
/**
11+
* @Package : io.nbs.client.ui.components
12+
* @Description : <p></p>
13+
* @Author : lambor.c
14+
* @Date : 2018/7/8-22:34
15+
* Copyright (c) 2018, NBS , lambor.c<[email protected]>.
16+
* All rights reserved.
17+
*/
18+
public class SearchButtonPanel extends JPanel {
19+
20+
private JLabel iconLabel;
21+
private JLabel titleLabel;
22+
23+
public SearchButtonPanel(String title) {
24+
if(StringUtils.isBlank(title))title = "SEARCH";
25+
iconLabel = new JLabel();
26+
titleLabel = new JLabel(title);
27+
titleLabel.setMinimumSize(new Dimension(80,26));
28+
iconLabel.setIcon(IconUtil.getIcon(this,"/icons/tools/search_ic.png"));
29+
30+
initVeiw();
31+
}
32+
33+
private void initVeiw(){
34+
setLayout(new FlowLayout(FlowLayout.CENTER,5,5));
35+
this.setBackground(ColorCnst.SEEARCH_ITEM_GRAY_LIGHT);
36+
add(iconLabel);
37+
add(titleLabel);
38+
}
39+
40+
public void setIcon(ImageIcon icon){
41+
this.iconLabel.setIcon(icon);
42+
}
43+
}

src/main/java/io/nbs/client/ui/components/SearchTextField.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class SearchTextField extends JTextField {
2222

2323
public SearchTextField() {
2424
setBorder(null);
25-
setBackground(ColorCnst.SEEARCHTEXT_ITEM_GRAYBG);
25+
// setBackground(ColorCnst.SEEARCH_ITEM_GRAY_LIGHT);
2626
setForeground(ColorCnst.FONT_WHITE);
2727
// setCaretColor(ColorCnst.CONTACTS_ITEM_GRAY);
2828
setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
@@ -57,15 +57,15 @@ protected void paintComponent(Graphics g) {
5757

5858
Graphics2D g2 = (Graphics2D)g;
5959
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
60-
g2.setColor(new Color(30, 30, 30, 100));
60+
g2.setColor(new Color(117, 117, 117, 85));
6161
g2.drawRoundRect(0, 0, getWidth()-1, getHeight()-1, 10, 10);
6262
g2.fillRoundRect(0, 0, getWidth()-1, getHeight()-1, 10, 10);
6363

6464
if (getText().isEmpty()/* && !(FocusManager.getCurrentKeyboardFocusManager().getFocusOwner() == this)*/)
6565
{
66-
g2.setBackground(Color.gray);
66+
g2.setBackground(ColorCnst.SEEARCH_ITEM_GRAY_LIGHT);
6767
g2.setFont(FontUtil.getDefaultFont());
68-
g2.setColor(Color.GRAY);
68+
g2.setColor(ColorCnst.SEEARCH_ITEM_GRAY_LIGHT);
6969
g2.drawString("搜索 ", 10, 20);
7070
g2.dispose();
7171
}

src/main/java/io/nbs/client/ui/frames/MainFrame.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import io.nbs.client.cnsts.OSUtil;
99
import io.nbs.client.services.IpfsMessageSender;
1010
import io.nbs.client.services.MessageSendService;
11+
import io.nbs.client.ui.panels.manage.ManageMasterPanel;
1112
import io.nbs.commons.helper.ConfigurationHelper;
1213
import io.nbs.sdk.beans.OnlineMessage;
1314
import io.nbs.sdk.beans.PeerInfo;
@@ -53,10 +54,13 @@ public class MainFrame extends JFrame {
5354

5455
public static final int TOOLBAR_WIDTH = 80;
5556

56-
57+
/**
58+
* 右侧窗口
59+
*/
5760
private ToolbarPanel toolbarPanel;
5861
private JPanel leftMenuPanle;
5962

63+
6064
private MainContentPanel mainCentetPanel;
6165
private CardLayout cardLayout;
6266

@@ -78,6 +82,11 @@ public class MainFrame extends JFrame {
7882
*/
7983
private IMMasterPanel imMasterPanel;
8084

85+
/**
86+
*
87+
*/
88+
private ManageMasterPanel manageMasterPanel;
89+
8190

8291
private AboutMasterPanel aboutMasterPanel;
8392

@@ -149,22 +158,22 @@ private void initComponents(){
149158
infoMasterPanel = new InfoMasterPanel();
150159
imMasterPanel = new IMMasterPanel();
151160
aboutMasterPanel = new AboutMasterPanel();
161+
manageMasterPanel = new ManageMasterPanel();
152162

153163
mainCentetPanel.add(infoMasterPanel,MainFrame.MainCardLayoutTypes.INFO.name());
154164
mainCentetPanel.add(imMasterPanel,MainCardLayoutTypes.IM.name());
155165
mainCentetPanel.add(aboutMasterPanel,MainCardLayoutTypes.ABOUT.name());
166+
mainCentetPanel.add(manageMasterPanel,MainCardLayoutTypes.DATD.name());
156167
}
157168

158169
private void initView(){
159170
Dimension winDimension = new Dimension(W_SIZE,H_SIZE);
160171
setSize(winDimension);
161172
setMinimumSize(winDimension);
162-
//mainJPanel.setLayout(new BorderLayout());
163173

164-
//mainJPanel.setLayout(new FlowLayout(FlowLayout.LEFT,0,0));
165174
mainJPanel.setLayout(new BorderLayout());
166175
mainJPanel.add(toolbarPanel,BorderLayout.WEST);
167-
// mainJPanel.add(leftMenuPanle,BorderLayout.WEST);
176+
168177
mainJPanel.add(mainCentetPanel,BorderLayout.CENTER);
169178

170179
/**

src/main/java/io/nbs/client/ui/panels/ToolbarPanel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ private void selectedBTN(NBSIconButton btn){
215215
}
216216

217217
public void setDefaultSelected(){
218-
selectedBTN(imBTN);
219-
mainCtx.mainWinShow(MainFrame.MainCardLayoutTypes.IM);
218+
selectedBTN(dataBTN);
219+
mainCtx.mainWinShow(MainFrame.MainCardLayoutTypes.DATD);
220220
}
221221
private void initialButton(){
222222
infoBTN = ButtonIconUtil.infoBTN;
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
package io.nbs.client.ui.panels.manage;
2+
3+
import io.nbs.client.ui.panels.ParentAvailablePanel;
4+
5+
import javax.swing.*;
6+
7+
/**
8+
* @Package : io.nbs.client.ui.panels.manage
9+
* @Description : <p></p>
10+
* @Author : lambor.c
11+
* @Date : 2018/7/8-20:52
12+
* Copyright (c) 2018, NBS , lambor.c<[email protected]>.
13+
* All rights reserved.
14+
*/
15+
public class MMBodyPanel extends ParentAvailablePanel {
16+
private static MMBodyPanel context;
17+
18+
19+
20+
/**
21+
* construction
22+
*/
23+
public MMBodyPanel(JPanel parent) {
24+
super(parent);
25+
initComponents();
26+
initView();
27+
setListeners();
28+
}
29+
30+
/**
31+
* [initComponents description]
32+
*
33+
* @return {[type]} [description]
34+
*/
35+
private void initComponents() {
36+
JPanel panel = new JPanel();
37+
JLabel label = new JLabel("HHHHHHHH");
38+
add(label);
39+
}
40+
41+
/**
42+
* [initView description]
43+
*
44+
* @return {[type]} [description]
45+
*/
46+
private void initView() {
47+
48+
}
49+
50+
private void setListeners() {
51+
52+
}
53+
54+
/**
55+
* [getContext description]
56+
*
57+
* @return {[type]} [description]
58+
*/
59+
public static MMBodyPanel getContext() {
60+
return context;
61+
}
62+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
package io.nbs.client.ui.panels.manage;
2+
3+
import io.nbs.client.ui.components.GBC;
4+
import io.nbs.client.ui.components.NBSIconButton;
5+
import io.nbs.client.ui.components.SearchTextField;
6+
import io.nbs.client.ui.panels.ParentAvailablePanel;
7+
8+
import javax.swing.*;
9+
import java.awt.*;
10+
11+
/**
12+
* @Package : io.nbs.client.ui.panels.manage
13+
* @Description : <p></p>
14+
* @Author : lambor.c
15+
* @Date : 2018/7/8-20:18
16+
* Copyright (c) 2018, NBS , lambor.c<[email protected]>.
17+
* All rights reserved.
18+
*/
19+
public class MMHeaderPanel extends ParentAvailablePanel {
20+
private static MMHeaderPanel context;
21+
22+
private MMSearcherPanel searcherPanel;
23+
private JPanel prevousPanel;
24+
private JPanel suffixPanel;
25+
26+
/**
27+
* construction
28+
*/
29+
public MMHeaderPanel(JPanel parent) {
30+
super(parent);
31+
initComponents();
32+
initView();
33+
setListeners();
34+
}
35+
36+
37+
38+
/**
39+
* [initComponents description]
40+
*
41+
* @return {[type]} [description]
42+
*/
43+
private void initComponents() {
44+
prevousPanel = new JPanel();
45+
suffixPanel = new JPanel();
46+
searcherPanel = new MMSearcherPanel(this);
47+
}
48+
49+
/**
50+
* [initView description]
51+
*
52+
* @return {[type]} [description]
53+
*/
54+
private void initView() {
55+
add(searcherPanel);
56+
}
57+
58+
private void setListeners() {
59+
60+
}
61+
62+
/**
63+
* [getContext description]
64+
*
65+
* @return {[type]} [description]
66+
*/
67+
public static MMHeaderPanel getContext() {
68+
return context;
69+
}
70+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package io.nbs.client.ui.panels.manage;
2+
3+
import io.nbs.client.ui.panels.ParentAvailablePanel;
4+
5+
import javax.swing.*;
6+
7+
/**
8+
* @Package : io.nbs.client.ui.panels.manage
9+
* @Description : <p></p>
10+
* @Author : lambor.c
11+
* @Date : 2018/7/8-20:52
12+
* Copyright (c) 2018, NBS , lambor.c<[email protected]>.
13+
* All rights reserved.
14+
*/
15+
public class MMSearchResultPanel extends ParentAvailablePanel {
16+
private static MMSearchResultPanel context;
17+
18+
/**
19+
* construction
20+
*/
21+
public MMSearchResultPanel(JPanel parent) {
22+
super(parent);
23+
initComponents();
24+
initView();
25+
setListeners();
26+
}
27+
28+
/**
29+
* [initComponents description]
30+
*
31+
* @return {[type]} [description]
32+
*/
33+
private void initComponents() {
34+
35+
}
36+
37+
/**
38+
* [initView description]
39+
*
40+
* @return {[type]} [description]
41+
*/
42+
private void initView() {
43+
44+
}
45+
46+
private void setListeners() {
47+
48+
}
49+
50+
/**
51+
* [getContext description]
52+
*
53+
* @return {[type]} [description]
54+
*/
55+
public static MMSearchResultPanel getContext() {
56+
return context;
57+
}
58+
}

0 commit comments

Comments
 (0)