Skip to content

Commit 9ef1506

Browse files
committed
Server tab
1 parent 5bda58f commit 9ef1506

File tree

1 file changed

+240
-0
lines changed

1 file changed

+240
-0
lines changed
Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
package org.cyberpwn.react;
2+
3+
import java.awt.BorderLayout;
4+
import java.awt.Color;
5+
import java.awt.Font;
6+
import java.awt.event.MouseAdapter;
7+
import java.awt.event.MouseEvent;
8+
9+
import javax.swing.ImageIcon;
10+
import javax.swing.JButton;
11+
import javax.swing.JFrame;
12+
import javax.swing.JLabel;
13+
import javax.swing.JList;
14+
import javax.swing.JPanel;
15+
import javax.swing.JTabbedPane;
16+
import javax.swing.ListSelectionModel;
17+
import javax.swing.border.BevelBorder;
18+
import javax.swing.border.SoftBevelBorder;
19+
20+
import org.cyberpwn.react.network.NetworkedServer;
21+
import org.cyberpwn.react.ui.JXTabbedPane;
22+
23+
import net.miginfocom.swing.MigLayout;
24+
25+
public class ServerTab
26+
{
27+
private NetworkedServer ns;
28+
29+
public ServerTab(JFrame frame, NetworkedServer server, JXTabbedPane tabbedPane)
30+
{
31+
this.ns = server;
32+
33+
JPanel panel = new JPanel();
34+
tabbedPane.addTab(ns.getName(), new ImageIcon(ReactClient.class.getResource("/org/cyberpwn/react/ui/server-mini.png")), panel, null);
35+
panel.setLayout(new BorderLayout(0, 0));
36+
37+
JTabbedPane tabbedPane_1 = new JTabbedPane(JTabbedPane.TOP);
38+
tabbedPane_1.setFont(new Font("Segoe UI Light", Font.PLAIN, 20));
39+
panel.add(tabbedPane_1, BorderLayout.CENTER);
40+
41+
JPanel panel_1 = new JPanel();
42+
tabbedPane_1.addTab("General", null, panel_1, null);
43+
panel_1.setLayout(new MigLayout("", "[grow][][][grow][][][][][][][][][][grow]", "[grow][][][][grow][grow][][][]"));
44+
45+
JPanel panel_5 = new JPanel();
46+
panel_5.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
47+
panel_5.setBackground(Color.WHITE);
48+
panel_1.add(panel_5, "cell 0 0 13 4,grow");
49+
panel_5.setLayout(new MigLayout("", "[][][][]", "[][][][][][][]"));
50+
51+
JLabel lblServerName = new JLabel("Server Name");
52+
lblServerName.setFont(new Font("Segoe UI Light", Font.PLAIN, 35));
53+
panel_5.add(lblServerName, "cell 0 0");
54+
55+
JLabel lblUsingSpigot = new JLabel("Using Spigot 1.8.8");
56+
lblUsingSpigot.setFont(new Font("Segoe UI Light", Font.PLAIN, 18));
57+
panel_5.add(lblUsingSpigot, "cell 0 1");
58+
59+
JLabel lblOnline = new JLabel("146 Players Online");
60+
lblOnline.setFont(new Font("Segoe UI Light", Font.PLAIN, 18));
61+
panel_5.add(lblOnline, "cell 0 2");
62+
63+
JLabel lblHours = new JLabel("7 Hours Uptime");
64+
lblHours.setFont(new Font("Segoe UI Light", Font.PLAIN, 18));
65+
panel_5.add(lblHours, "cell 0 3");
66+
67+
JLabel lblmsPing = new JLabel("43 Plugins");
68+
lblmsPing.setFont(new Font("Segoe UI Light", Font.PLAIN, 18));
69+
panel_5.add(lblmsPing, "cell 0 4");
70+
71+
JPanel panel_8 = new JPanel();
72+
panel_8.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
73+
panel_8.setBackground(Color.WHITE);
74+
panel_1.add(panel_8, "cell 13 0 1 4,grow");
75+
panel_8.setLayout(new MigLayout("", "[]", "[][][][][][]"));
76+
77+
JLabel lblConnection = new JLabel("Connection");
78+
lblConnection.setFont(new Font("Segoe UI Light", Font.PLAIN, 35));
79+
panel_8.add(lblConnection, "cell 0 0");
80+
81+
JLabel lblPacketLoss = new JLabel("Packet Loss 0% (0 Failures)");
82+
lblPacketLoss.setFont(new Font("Segoe UI Light", Font.PLAIN, 18));
83+
panel_8.add(lblPacketLoss, "cell 0 1");
84+
85+
JLabel lblmsPing_1 = new JLabel("21ms Ping");
86+
lblmsPing_1.setFont(new Font("Segoe UI Light", Font.PLAIN, 18));
87+
panel_8.add(lblmsPing_1, "cell 0 2");
88+
89+
JButton btnNewButton_1 = new JButton("Delete Connection");
90+
btnNewButton_1.addMouseListener(new MouseAdapter()
91+
{
92+
@Override
93+
public void mouseReleased(MouseEvent e)
94+
{
95+
ReactClient.getInstance().deleteConnection(ns);
96+
}
97+
});
98+
btnNewButton_1.setFont(new Font("Segoe UI Light", Font.PLAIN, 18));
99+
panel_8.add(btnNewButton_1, "cell 0 5");
100+
101+
JPanel panel_2 = new JPanel();
102+
tabbedPane_1.addTab("Performance", null, panel_2, null);
103+
panel_2.setLayout(new MigLayout("", "[grow]", "[grow]"));
104+
105+
JTabbedPane tabbedPane_2 = new JTabbedPane(JTabbedPane.BOTTOM);
106+
tabbedPane_2.setFont(new Font("Segoe UI Light", Font.PLAIN, 20));
107+
panel_2.add(tabbedPane_2, "cell 0 0,grow");
108+
109+
JPanel panel_6 = new JPanel();
110+
tabbedPane_2.addTab("CPU", null, panel_6, null);
111+
panel_6.setLayout(new MigLayout("", "[grow][grow]", "[grow][grow][grow]"));
112+
113+
JPanel panel_7 = new JPanel();
114+
panel_7.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
115+
panel_7.setBackground(Color.WHITE);
116+
panel_6.add(panel_7, "cell 0 0 2 3,grow");
117+
panel_7.setLayout(new MigLayout("", "[grow][]", "[][][grow]"));
118+
119+
JLabel lblCpuLoad = new JLabel("Server Load");
120+
lblCpuLoad.setFont(new Font("Segoe UI Light", Font.PLAIN, 35));
121+
panel_7.add(lblCpuLoad, "flowx,cell 0 0");
122+
123+
JLabel lblTps = new JLabel("20 TPS (99% Stable)");
124+
lblTps.setFont(new Font("Segoe UI Light", Font.PLAIN, 18));
125+
panel_7.add(lblTps, "cell 1 0");
126+
127+
JPanel panel_10 = new JPanel();
128+
panel_10.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
129+
panel_10.setBackground(Color.DARK_GRAY);
130+
panel_7.add(panel_10, "cell 0 1 2 2,grow");
131+
132+
JPanel panel_13 = new JPanel();
133+
tabbedPane_2.addTab("Memory", null, panel_13, null);
134+
panel_13.setLayout(new MigLayout("", "[grow][grow]", "[grow][grow]"));
135+
136+
JPanel panel_14 = new JPanel();
137+
panel_14.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
138+
panel_14.setBackground(Color.WHITE);
139+
panel_13.add(panel_14, "cell 0 0 2 1,grow");
140+
panel_14.setLayout(new MigLayout("", "[grow][]", "[][grow]"));
141+
142+
JLabel lblMemory = new JLabel("Memory");
143+
lblMemory.setFont(new Font("Segoe UI Light", Font.PLAIN, 35));
144+
panel_14.add(lblMemory, "cell 0 0");
145+
146+
JLabel lblMbUsed = new JLabel("683 MB Used");
147+
lblMbUsed.setFont(new Font("Segoe UI Light", Font.PLAIN, 18));
148+
panel_14.add(lblMbUsed, "cell 1 0");
149+
150+
JPanel panel_9 = new JPanel();
151+
panel_9.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
152+
panel_9.setBackground(Color.DARK_GRAY);
153+
panel_14.add(panel_9, "cell 0 1 2 1,grow");
154+
155+
JPanel panel_16 = new JPanel();
156+
panel_16.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
157+
panel_16.setBackground(Color.WHITE);
158+
panel_13.add(panel_16, "cell 0 1,grow");
159+
panel_16.setLayout(new MigLayout("", "[grow][]", "[][grow]"));
160+
161+
JLabel lblGarbage = new JLabel("Garbage");
162+
lblGarbage.setFont(new Font("Segoe UI Light", Font.PLAIN, 35));
163+
panel_16.add(lblGarbage, "cell 0 0");
164+
165+
JLabel lblGcminute = new JLabel("9 GC/Minute");
166+
lblGcminute.setFont(new Font("Segoe UI Light", Font.PLAIN, 18));
167+
panel_16.add(lblGcminute, "cell 1 0");
168+
169+
JPanel panel_11 = new JPanel();
170+
panel_11.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
171+
panel_11.setBackground(Color.DARK_GRAY);
172+
panel_16.add(panel_11, "cell 0 1 2 1,grow");
173+
174+
JPanel panel_15 = new JPanel();
175+
panel_15.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
176+
panel_15.setBackground(Color.WHITE);
177+
panel_13.add(panel_15, "cell 1 1,grow");
178+
panel_15.setLayout(new MigLayout("", "[grow][]", "[][grow]"));
179+
180+
JLabel lblState = new JLabel("Volatility");
181+
lblState.setFont(new Font("Segoe UI Light", Font.PLAIN, 35));
182+
panel_15.add(lblState, "cell 0 0");
183+
184+
JLabel lblMahs = new JLabel("264 MAH/s");
185+
lblMahs.setFont(new Font("Segoe UI Light", Font.PLAIN, 18));
186+
panel_15.add(lblMahs, "cell 1 0");
187+
188+
JPanel panel_17 = new JPanel();
189+
panel_17.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
190+
panel_17.setBackground(Color.DARK_GRAY);
191+
panel_15.add(panel_17, "cell 0 1 2 1,grow");
192+
193+
JPanel panel_4 = new JPanel();
194+
tabbedPane_1.addTab("Actions", null, panel_4, null);
195+
panel_4.setLayout(new MigLayout("", "[grow]", "[grow][grow]"));
196+
197+
JPanel panel_12 = new JPanel();
198+
panel_12.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
199+
panel_12.setBackground(Color.WHITE);
200+
panel_4.add(panel_12, "cell 0 0 1 2,grow");
201+
panel_12.setLayout(new MigLayout("", "[grow][]", "[][grow][]"));
202+
203+
JLabel lblSelectAnAction = new JLabel("Actions");
204+
lblSelectAnAction.setFont(new Font("Segoe UI Light", Font.PLAIN, 35));
205+
panel_12.add(lblSelectAnAction, "cell 0 0");
206+
207+
JList<String> list = new JList<String>();
208+
list.setBackground(Color.LIGHT_GRAY);
209+
list.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
210+
list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
211+
panel_12.add(list, "cell 0 1 2 1,grow");
212+
213+
JLabel lblNewLabel = new JLabel("Executing \"Purge Chunks\" (33%)");
214+
lblNewLabel.setFont(new Font("Segoe UI Light", Font.PLAIN, 18));
215+
panel_12.add(lblNewLabel, "cell 0 2");
216+
217+
JButton btnNewButton = new JButton("Perform Action");
218+
btnNewButton.setFont(new Font("Segoe UI Light", Font.PLAIN, 20));
219+
panel_12.add(btnNewButton, "cell 1 2");
220+
221+
JPanel panel_3 = new JPanel();
222+
tabbedPane_1.addTab("Problems", null, panel_3, null);
223+
panel_3.setLayout(new MigLayout("", "[grow][grow]", "[grow][grow]"));
224+
225+
JPanel panel_18 = new JPanel();
226+
panel_18.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
227+
panel_18.setBackground(Color.WHITE);
228+
panel_3.add(panel_18, "cell 0 0 2 2,grow");
229+
panel_18.setLayout(new MigLayout("", "[]", "[][]"));
230+
231+
JLabel lblNoIssuesFound = new JLabel("No Issues Found");
232+
lblNoIssuesFound.setFont(new Font("Segoe UI Light", Font.PLAIN, 35));
233+
panel_18.add(lblNoIssuesFound, "cell 0 0");
234+
235+
JLabel lblNewLabel_1 = new JLabel("Looks Like this server is doing fine for the moment!");
236+
lblNewLabel_1.setFont(new Font("Segoe UI Light", Font.PLAIN, 18));
237+
panel_18.add(lblNewLabel_1, "cell 0 1");
238+
239+
}
240+
}

0 commit comments

Comments
 (0)