PhysicalSpaceMonitor.java
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13: package xeij;
14:
15: import java.awt.*;
16: import java.awt.event.*;
17: import java.lang.*;
18: import javax.swing.*;
19:
20: public class PhysicalSpaceMonitor {
21:
22: public static JFrame paaFrame;
23: public static ScrollTextArea paaBoard;
24: public static JTextArea paaTextArea;
25:
26:
27:
28: public static void paaInit () {
29: paaFrame = null;
30: }
31:
32:
33: public static void paaStart () {
34: if (RestorableFrame.rfmGetOpened (Settings.SGS_PAA_FRAME_KEY)) {
35: paaOpen ();
36: }
37: }
38:
39:
40:
41:
42: public static void paaOpen () {
43: if (paaFrame == null) {
44: paaMake ();
45: }
46: paaUpdate ();
47: XEiJ.pnlExitFullScreen (false);
48: paaFrame.setVisible (true);
49: XEiJ.dbgVisibleMask |= XEiJ.DBG_PAA_VISIBLE_MASK;
50: }
51:
52:
53:
54: public static void paaMake () {
55:
56:
57: paaBoard = ComponentFactory.setPreferredSize (
58: ComponentFactory.setFont (new ScrollTextArea (), LnF.lnfMonospacedFont),
59: 550, 300);
60: paaBoard.setMargin (new Insets (2, 4, 2, 4));
61: paaBoard.setHighlightCursorOn (true);
62: paaTextArea = paaBoard.getTextArea ();
63: paaTextArea.setEditable (false);
64:
65:
66: ComponentFactory.addListener (
67: paaTextArea,
68: new MouseAdapter () {
69: @Override public void mousePressed (MouseEvent me) {
70: if (XEiJ.mpuTask == null && me.isPopupTrigger ()) {
71: XEiJ.dbgShowPopup (me, paaTextArea, false);
72: }
73: }
74: @Override public void mouseReleased (MouseEvent me) {
75: if (XEiJ.mpuTask == null && me.isPopupTrigger ()) {
76: XEiJ.dbgShowPopup (me, paaTextArea, false);
77: }
78: }
79: });
80:
81:
82: ActionListener listener = new ActionListener () {
83: @Override public void actionPerformed (ActionEvent ae) {
84: Object source = ae.getSource ();
85: switch (ae.getActionCommand ()) {
86: case "Update":
87: paaUpdate ();
88: break;
89: }
90: }
91: };
92:
93:
94: paaFrame = Multilingual.mlnTitle (
95: ComponentFactory.createRestorableSubFrame (
96: Settings.SGS_PAA_FRAME_KEY,
97: "Physical space monitor",
98: null,
99: ComponentFactory.createBorderPanel (
100: paaBoard,
101: ComponentFactory.createHorizontalBox (
102: Multilingual.mlnToolTipText (
103: ComponentFactory.createImageButton (
104: XEiJ.createImage (
105: 20, 14,
106: "11111111111111111111" +
107: "1..................1" +
108: "1.......1111.......1" +
109: "1......111111.1....1" +
110: "1.....11....111....1" +
111: "1....11.....111....1" +
112: "1....11....1111....1" +
113: "1....11............1" +
114: "1....11............1" +
115: "1.....11....11.....1" +
116: "1......111111......1" +
117: "1.......1111.......1" +
118: "1..................1" +
119: "11111111111111111111",
120: LnF.lnfRGB[0],
121: LnF.lnfRGB[12]),
122: "Update", listener),
123: "ja", "更新"),
124: Box.createHorizontalGlue ()
125: )
126: )
127: ),
128: "ja", "物理空間モニタ");
129: ComponentFactory.addListener (
130: paaFrame,
131: new WindowAdapter () {
132: @Override public void windowClosing (WindowEvent we) {
133: XEiJ.dbgVisibleMask &= ~XEiJ.DBG_PAA_VISIBLE_MASK;
134: }
135: });
136:
137: }
138:
139:
140:
141: public static void paaUpdate () {
142: StringBuilder sb = new StringBuilder ();
143: sb.append (Multilingual.mlnJapanese ?
144:
145: " 物理アドレス メモリマップトデバイス\n" :
146: "Physical address Memory mapped device\n");
147: int a0 = 0;
148: MemoryMappedDevice mmd0Super = MemoryMappedDevice.MMD_NUL;
149: MemoryMappedDevice mmd0User = MemoryMappedDevice.MMD_NUL;
150: int page = 0;
151: for (; page < XEiJ.BUS_PAGE_COUNT; page++) {
152: MemoryMappedDevice mmd1Super = XEiJ.busSuperMap[page];
153: MemoryMappedDevice mmd1User = XEiJ.busUserMap[page];
154: if (mmd0Super != mmd1Super || mmd0User != mmd1User) {
155: int a1 = page << XEiJ.BUS_PAGE_BITS;
156: if (mmd0Super != MemoryMappedDevice.MMD_NUL) {
157: XEiJ.fmtHex8 (XEiJ.fmtHex8 (sb, a0).append ('-'), a1 - 1).append (" ").append (mmd0Super.toString ());
158: if (mmd0User == MemoryMappedDevice.MMD_NUL) {
159: sb.append (Multilingual.mlnJapanese ? " [スーパーバイザ]" : " [Supervisor]");
160: }
161: sb.append ('\n');
162: }
163: a0 = a1;
164: mmd0Super = mmd1Super;
165: mmd0User = mmd1User;
166: }
167: }
168: if (mmd0Super != MemoryMappedDevice.MMD_NUL) {
169: XEiJ.fmtHex8 (XEiJ.fmtHex8 (sb, a0).append ('-'), 0 - 1).append (" ").append (mmd0Super.toString ());
170: if (mmd0User == MemoryMappedDevice.MMD_NUL) {
171: sb.append (Multilingual.mlnJapanese ? " [スーパーバイザ]" : " [Supervisor]");
172: }
173: sb.append ('\n');
174: }
175: paaTextArea.setText (sb.toString ());
176: paaTextArea.setCaretPosition (0);
177: }
178:
179: }
180:
181:
182: