summaryrefslogtreecommitdiff
path: root/NET/worlds/console/StatisticsWindow.java
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-02-12 22:33:32 -0800
committerFuwn <[email protected]>2026-02-12 22:33:32 -0800
commitc7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9 (patch)
treedf9f48bf128a6c0186a8e91857d6ff30fe0e9f18 /NET/worlds/console/StatisticsWindow.java
downloadworldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.tar.xz
worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.zip
Initial commit
Diffstat (limited to 'NET/worlds/console/StatisticsWindow.java')
-rw-r--r--NET/worlds/console/StatisticsWindow.java91
1 files changed, 91 insertions, 0 deletions
diff --git a/NET/worlds/console/StatisticsWindow.java b/NET/worlds/console/StatisticsWindow.java
new file mode 100644
index 0000000..a206d6c
--- /dev/null
+++ b/NET/worlds/console/StatisticsWindow.java
@@ -0,0 +1,91 @@
+package NET.worlds.console;
+
+import java.awt.Dimension;
+import java.awt.Event;
+import java.awt.Frame;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.List;
+import java.awt.Point;
+
+public class StatisticsWindow extends Frame implements MainCallback, MainTerminalCallback, TreeCallback {
+ private static final long serialVersionUID = 2184104724858956037L;
+ Tree _tree = new Tree(this);
+ List _list = new List(10, false);
+ StatMan _lastStat;
+
+ public StatisticsWindow(java.awt.Window parent) {
+ super("Statistics Manager");
+ GridBagLayout gbag = new GridBagLayout();
+ this.setLayout(gbag);
+ GridBagConstraints c = new GridBagConstraints();
+ c.fill = 1;
+ c.weightx = 0.4;
+ c.weighty = 1.0;
+ c.gridwidth = 1;
+ c.gridheight = 0;
+ gbag.setConstraints(this._tree, c);
+ this.add(this._tree);
+ c.weightx = 0.6;
+ c.gridwidth = 0;
+ gbag.setConstraints(this._list, c);
+ this.add(this._list);
+ this.pack();
+ Point loc = parent.location();
+ Dimension size = parent.getSize();
+ this.reshape(loc.x + (size.width - 512) / 2, loc.y + (size.height - 240) / 2, 512, 240);
+ this.show();
+ StatisticsRoot root = StatisticsRoot.getNode();
+ root.setTree(this._tree);
+ StatTreeNode rootNode = new StatTreeNode(root, null);
+ this._tree.change(rootNode, rootNode.getObject());
+ StatMemNode.getNode();
+ StatNetRefNode.getNode();
+ this._tree.change(rootNode, StatRateNode.getNode());
+ Main.register(this);
+ }
+
+ @Override
+ public boolean handleEvent(Event ev) {
+ switch (ev.id) {
+ case 201:
+ if (this._lastStat != null) {
+ this._lastStat.releaseList(false);
+ }
+
+ this._lastStat = null;
+ this.dispose();
+ return true;
+ default:
+ return super.handleEvent(ev);
+ }
+ }
+
+ @Override
+ public void treeChange(Object obj) {
+ if (this._lastStat != null) {
+ this._lastStat.releaseList(false);
+ }
+
+ this._lastStat = (StatMan)obj;
+ this._lastStat.grabList(this._list);
+ }
+
+ @Override
+ public void treeFocusChanged(boolean hasFocus) {
+ }
+
+ @Override
+ public void mainCallback() {
+ }
+
+ @Override
+ public void terminalCallback() {
+ if (this._lastStat != null) {
+ this._lastStat.releaseList(true);
+ }
+
+ this._lastStat = null;
+ Main.unregister(this);
+ }
+}