@@ -38,14 +38,25 @@ public class ServerTab
38
38
private JLabel lblOnline ;
39
39
private JLabel lblmsPing ;
40
40
41
- private JPanel TPS ;
42
- private Grapher GTPS ;
41
+ private Grapher TPS ;
43
42
private GList <Double > DTPS ;
44
43
44
+ private Grapher MEM ;
45
+ private GList <Double > DMEM ;
46
+
47
+ private Grapher GC ;
48
+ private GList <Double > DGC ;
49
+
50
+ private Grapher MAH ;
51
+ private GList <Double > DMAH ;
52
+
45
53
public ServerTab (JFrame frame , NetworkedServer server , JXTabbedPane tabbedPane )
46
54
{
47
55
this .ns = server ;
48
56
this .DTPS = new GList <Double >().qadd (20.0 );
57
+ this .DMEM = new GList <Double >().qadd (128.0 );
58
+ this .DGC = new GList <Double >().qadd (1.0 );
59
+ this .DMAH = new GList <Double >().qadd (9.0 );
49
60
50
61
JPanel panel = new JPanel ();
51
62
tabbedPane .addTab (ns .getName (), new ImageIcon (ReactClient .class .getResource ("/org/cyberpwn/react/ui/server-mini.png" )), panel , null );
@@ -137,12 +148,10 @@ public void mouseReleased(MouseEvent e)
137
148
lblTps .setFont (new Font ("Segoe UI Light" , Font .PLAIN , 18 ));
138
149
panel_7 .add (lblTps , "cell 1 0" );
139
150
140
- TPS = new JPanel ( );
151
+ TPS = new Grapher ( 20 , Color . CYAN , new GList < Double >(). qadd ( 1.0 ) );
141
152
TPS .setBorder (new SoftBevelBorder (BevelBorder .LOWERED , null , null , null , null ));
142
153
TPS .setBackground (Color .DARK_GRAY );
143
154
panel_7 .add (TPS , "cell 0 1 2 2,grow" );
144
- GTPS = new Grapher (TPS .getWidth (), TPS .getHeight (), 20 , Color .CYAN , new GList <Double >().qadd (1.0 ));
145
- TPS .add (GTPS );
146
155
147
156
JPanel panel_13 = new JPanel ();
148
157
tabbedPane_2 .addTab ("Memory" , null , panel_13 , null );
@@ -162,10 +171,10 @@ public void mouseReleased(MouseEvent e)
162
171
lblMbUsed .setFont (new Font ("Segoe UI Light" , Font .PLAIN , 18 ));
163
172
panel_14 .add (lblMbUsed , "cell 1 0" );
164
173
165
- JPanel panel_9 = new JPanel ( );
166
- panel_9 .setBorder (new SoftBevelBorder (BevelBorder .LOWERED , null , null , null , null ));
167
- panel_9 .setBackground (Color .DARK_GRAY );
168
- panel_14 .add (panel_9 , "cell 0 1 2 1,grow" );
174
+ MEM = new Grapher ( 400 , Color . CYAN , new GList < Double >(). qadd ( 1.0 ) );
175
+ MEM .setBorder (new SoftBevelBorder (BevelBorder .LOWERED , null , null , null , null ));
176
+ MEM .setBackground (Color .DARK_GRAY );
177
+ panel_14 .add (MEM , "cell 0 1 2 1,grow" );
169
178
170
179
JPanel panel_16 = new JPanel ();
171
180
panel_16 .setBorder (new SoftBevelBorder (BevelBorder .RAISED , null , null , null , null ));
@@ -181,10 +190,10 @@ public void mouseReleased(MouseEvent e)
181
190
lblGcminute .setFont (new Font ("Segoe UI Light" , Font .PLAIN , 18 ));
182
191
panel_16 .add (lblGcminute , "cell 1 0" );
183
192
184
- JPanel panel_11 = new JPanel ( );
185
- panel_11 .setBorder (new SoftBevelBorder (BevelBorder .LOWERED , null , null , null , null ));
186
- panel_11 .setBackground (Color .DARK_GRAY );
187
- panel_16 .add (panel_11 , "cell 0 1 2 1,grow" );
193
+ GC = new Grapher ( 1200 , Color . CYAN , new GList < Double >(). qadd ( 1.0 ) );
194
+ GC .setBorder (new SoftBevelBorder (BevelBorder .LOWERED , null , null , null , null ));
195
+ GC .setBackground (Color .DARK_GRAY );
196
+ panel_16 .add (GC , "cell 0 1 2 1,grow" );
188
197
189
198
JPanel panel_15 = new JPanel ();
190
199
panel_15 .setBorder (new SoftBevelBorder (BevelBorder .RAISED , null , null , null , null ));
@@ -200,10 +209,10 @@ public void mouseReleased(MouseEvent e)
200
209
lblMahs .setFont (new Font ("Segoe UI Light" , Font .PLAIN , 18 ));
201
210
panel_15 .add (lblMahs , "cell 1 0" );
202
211
203
- JPanel panel_17 = new JPanel ( );
204
- panel_17 .setBorder (new SoftBevelBorder (BevelBorder .LOWERED , null , null , null , null ));
205
- panel_17 .setBackground (Color .DARK_GRAY );
206
- panel_15 .add (panel_17 , "cell 0 1 2 1,grow" );
212
+ MAH = new Grapher ( 1 , Color . CYAN , new GList < Double >(). qadd ( 1.0 ) );
213
+ MAH .setBorder (new SoftBevelBorder (BevelBorder .LOWERED , null , null , null , null ));
214
+ MAH .setBackground (Color .DARK_GRAY );
215
+ panel_15 .add (MAH , "cell 0 1 2 1,grow" );
207
216
208
217
JPanel panel_4 = new JPanel ();
209
218
tabbedPane_1 .addTab ("Actions" , null , panel_4 , null );
@@ -251,43 +260,73 @@ public void mouseReleased(MouseEvent e)
251
260
lblNewLabel_1 .setFont (new Font ("Segoe UI Light" , Font .PLAIN , 18 ));
252
261
panel_18 .add (lblNewLabel_1 , "cell 0 1" );
253
262
}
254
-
263
+
255
264
public void push (GMap <String , Double > sample )
256
265
{
257
- lblUsingSpigot .setText ("Using " + ns .getVersionBukkit ());
266
+ lblUsingSpigot .setText ("Using " + ns .getVersion ());
258
267
lblTps .setText (F .f (sample .get ("tps" ), 2 ) + " TPS (" + F .pc (sample .get ("stability" ), 0 ) + " Stable)" );
259
268
lblGcminute .setText (F .f (sample .get ("spms" )) + " GC/Minute" );
260
269
lblMahs .setText (F .f (sample .get ("mah/s" )) + " MAH/s" );
261
270
lblMbUsed .setText (F .mem (sample .get ("mem" ).longValue ()) + " Used" );
262
271
lblOnline .setText (F .f (sample .get ("plr" )) + " Players Online" );
263
272
lblmsPing .setText (F .f (sample .get ("plg" )) + " Loaded Plugins" );
264
273
274
+ if (MAH .getMax () < sample .get ("mah/s" ))
275
+ {
276
+ MAH .setMax (sample .get ("mah/s" ).intValue ());
277
+ }
278
+
265
279
DTPS .add (sample .get ("tps" ));
266
280
267
- if (DTPS .size () > 64 )
281
+ if (DTPS .size () > TPS . getWidth () )
268
282
{
269
- DTPS .remove (0 );
283
+ while (DTPS .size () > TPS .getWidth ())
284
+ {
285
+ DTPS .remove (0 );
286
+ }
270
287
}
271
288
272
- GTPS .setWidth (TPS .getWidth ());
273
- GTPS .setHeight (TPS .getHeight ());
274
- GTPS .setData (DTPS );
275
- GTPS .repaint ();
289
+ TPS .setData (DTPS );
276
290
TPS .repaint ();
291
+
292
+ DMEM .add (sample .get ("mem" ));
293
+
294
+ if (DMEM .size () > MEM .getWidth ())
295
+ {
296
+ while (DMEM .size () > MEM .getWidth ())
297
+ {
298
+ DMEM .remove (0 );
299
+ }
300
+ }
301
+
302
+ MEM .setMax (sample .get ("memory-max" ).intValue ());
303
+ MEM .setData (DMEM );
304
+ MEM .repaint ();
305
+
306
+ DGC .add (sample .get ("spms" ));
307
+
308
+ if (DGC .size () > GC .getWidth ())
309
+ {
310
+ while (DGC .size () > GC .getWidth ())
311
+ {
312
+ DGC .remove (0 );
313
+ }
314
+ }
315
+
316
+ GC .setData (DGC );
317
+ GC .repaint ();
318
+
319
+ DMAH .add (sample .get ("mah/s" ));
320
+
321
+ if (DMAH .size () > MAH .getWidth ())
322
+ {
323
+ while (DMAH .size () > MAH .getWidth ())
324
+ {
325
+ DMAH .remove (0 );
326
+ }
327
+ }
328
+
329
+ MAH .setData (DMAH );
330
+ MAH .repaint ();
277
331
}
278
-
279
- /*
280
- >> liq/s : 0.0
281
- >> tnt/s : 0.0
282
- >> drops : 31.0
283
- >> hist : 1.0
284
- >> chk/s : 10.6
285
- >> rct : 501220.2773345846
286
- >> red/s : 0.0
287
- >> chunks : 0.0
288
- >> mb/p : 29.857142857142858
289
- >> ents : 190.0
290
- >> cgen/s : 2.0
291
- >> chunkmem : 0.0
292
- */
293
332
}
0 commit comments