Skip to content

Commit dd1150b

Browse files
committed
增加成员控制
1 parent 673bb99 commit dd1150b

File tree

9 files changed

+31
-10
lines changed

9 files changed

+31
-10
lines changed

conf/nbs.db

0 Bytes
Binary file not shown.

src/main/java/io/nbs/client/adapter/ReceiverMessageAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void notifyRecvMessage(MessageItem item) {
5858
listView.setAutoScrollToBottom();
5959
//
6060
saveWorldMessage(item);
61-
//autoRepaly(item.getSenderUsername());
61+
autoRepaly(item.getSenderUsername());
6262
}
6363
}
6464

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ public class MainFrame extends JFrame {
4444

4545
private static MainFrame context;
4646
private PeerInfo currentPeer;
47-
public static final int W_SIZE = 900;
47+
public static final int W_SIZE = 920;
4848
public static final int H_SIZE = 650;
4949
public int currentWindowWidth = W_SIZE;
5050
public int currentWindowHeight = H_SIZE;
5151
public static int RIGHT_EIDTH = 540;
5252
private static boolean heartMonitor = true;
5353

54-
public static final int TOOLBAR_WIDTH = 52;
54+
public static final int TOOLBAR_WIDTH = 80;
5555

5656

5757
private ToolbarPanel toolbarPanel;
@@ -130,9 +130,11 @@ private void initComponents(){
130130
* 功能按钮
131131
*/
132132
leftMenuPanle = new JPanel();
133-
leftMenuPanle.setBackground(ColorCnst.DARKER);
133+
134+
leftMenuPanle.setOpaque(false);
135+
// leftMenuPanle.setBackground(ColorCnst.DARKER);
134136
toolbarPanel = new ToolbarPanel(context);
135-
toolbarPanel.setBackground(ColorCnst.DARKER);
137+
//toolbarPanel.setBackground(ColorCnst.DARKER);
136138
toolbarPanel.setPreferredSize(new Dimension(MainFrame.TOOLBAR_WIDTH,MainFrame.H_SIZE));
137139
leftMenuPanle.add(toolbarPanel);
138140

@@ -161,7 +163,8 @@ private void initView(){
161163

162164
//mainJPanel.setLayout(new FlowLayout(FlowLayout.LEFT,0,0));
163165
mainJPanel.setLayout(new BorderLayout());
164-
mainJPanel.add(leftMenuPanle,BorderLayout.WEST);
166+
mainJPanel.add(toolbarPanel,BorderLayout.WEST);
167+
// mainJPanel.add(leftMenuPanle,BorderLayout.WEST);
165168
mainJPanel.add(mainCentetPanel,BorderLayout.CENTER);
166169

167170
/**

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

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,18 @@ public ToolbarPanel(MainFrame mainFrameCtx) {
6464
}
6565

6666

67+
@Override
68+
protected void paintComponent(Graphics g) {
69+
super.paintComponent(g);
70+
if(!isOpaque())return;
71+
int width = getWidth();
72+
int height = getHeight();
73+
Graphics2D g2 = (Graphics2D)g;
74+
GradientPaint gradientPaint = new GradientPaint(0,0,new Color(37,32,72),width,height,new Color(59,54,98));
75+
g2.setPaint(gradientPaint);
76+
g2.fillRect(0,0,width,height);
77+
}
78+
6779
private void initComponents(){
6880

6981
upButtonPanel = new JPanel();
@@ -80,7 +92,8 @@ private void initComponents(){
8092
*
8193
*/
8294
bottomPanel = new JPanel();
83-
bottomPanel.setBackground(ColorCnst.DARKER);
95+
bottomPanel.setOpaque(false);
96+
//bottomPanel.setBackground(ColorCnst.DARKER);
8497
bottomPanel.setLayout(new BorderLayout());
8598

8699
//new VerticalFlowLayout(VerticalFlowLayout.BOTTOM,0,10,false,false)
@@ -114,7 +127,8 @@ private ImageIcon getAvatarIcon(PeerInfo peer){
114127
private void initView(){
115128
//setPreferredSize(new Dimension(MainFrame.TOOLBAR_WIDTH,MainFrame.HEIGHT));
116129
setLayout(new GridBagLayout());
117-
upButtonPanel.setBackground(ColorCnst.DARKER);
130+
upButtonPanel.setOpaque(false);
131+
//upButtonPanel.setBackground(ColorCnst.DARKER);
118132
upButtonPanel.add(avatarLabel);
119133
avatarLabel.setBackground(ColorCnst.DARK);
120134

@@ -193,4 +207,8 @@ private void initialButton(){
193207
musicBTN = ButtonIconUtil.musicBTN;
194208
aboutBTN = ButtonIconUtil.aboutBTN;
195209
}
210+
211+
public static ToolbarPanel getContext() {
212+
return context;
213+
}
196214
}

src/main/java/io/nbs/commons/utils/ButtonIconUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ public class ButtonIconUtil {
5959
public static NBSIconButton confBTN;
6060
public static NBSIconButton aboutBTN =
6161
new NBSIconButton(
62-
new ImageIcon(LamButtonIcon.class.getResource("/icons/tools/nbs40.png")),
63-
new ImageIcon(LamButtonIcon.class.getResource("/icons/tools/nbs40_normal.png")),
62+
new ImageIcon(LamButtonIcon.class.getResource("/icons/tools/NBS_ic_dis.png")),
63+
new ImageIcon(LamButtonIcon.class.getResource("/icons/tools/NBS_ic_pre.png")),
6464
"关于NBS"
6565
);
6666

1.61 KB
Loading
1.45 KB
Loading
4.16 KB
Loading

wiki/dist/nbs-client4j-main.png

45.1 KB
Loading

0 commit comments

Comments
 (0)