1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
|
/* */ package NET.worlds.console;
/* */
/* */ import java.awt.Button;
/* */ import java.awt.Checkbox;
/* */ import java.awt.Color;
/* */ import java.awt.Dimension;
/* */ import java.awt.Event;
/* */ import java.awt.Frame;
/* */ import java.awt.GridBagConstraints;
/* */ import java.awt.GridBagLayout;
/* */ import java.awt.Label;
/* */ import java.awt.Point;
/* */ import java.awt.TextField;
/* */ import java.awt.Window;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class SnapToolPanel
/* */ extends Frame
/* */ implements MainCallback, MainTerminalCallback
/* */ {
/* */ private static final long serialVersionUID = 1673536928568480266L;
/* */ private Label xLabel;
/* */ private Label yLabel;
/* */ private Label zLabel;
/* */ private TextField xValue;
/* */ private TextField yValue;
/* */ private TextField zValue;
/* */ private Checkbox useSnapBox;
/* */ private Button okButton;
/* */ private Button cancelButton;
/* */ private int snapX;
/* */ private int snapY;
/* */ private int snapZ;
/* */ private boolean useSnap;
/* */
/* */ public SnapToolPanel(Window parent)
/* */ {
/* 47 */ super("Snap Tool Settings");
/* */
/* 49 */ this.okButton = new Button("Ok");
/* 50 */ this.cancelButton = new Button("Cancel");
/* 51 */ this.xLabel = new Label("X Snap Value");
/* 52 */ this.yLabel = new Label("Y Snap Value");
/* 53 */ this.zLabel = new Label("Z Snap Value");
/* */
/* 55 */ this.snapX = SnapTool.snapTool().getSnapX();
/* 56 */ this.snapY = SnapTool.snapTool().getSnapY();
/* 57 */ this.snapZ = SnapTool.snapTool().getSnapZ();
/* 58 */ this.useSnap = SnapTool.snapTool().useSnap();
/* */
/* 60 */ this.useSnapBox = new Checkbox("Use Snap Tool", this.useSnap);
/* 61 */ this.xValue = new TextField(this.snapX);
/* 62 */ this.yValue = new TextField(this.snapY);
/* 63 */ this.zValue = new TextField(this.snapZ);
/* */
/* 65 */ GridBagLayout gbag = new GridBagLayout();
/* 66 */ GridBagConstraints c = new GridBagConstraints();
/* 67 */ setLayout(gbag);
/* 68 */ setBackground(Color.gray);
/* */
/* 70 */ c.gridx = 1;
/* 71 */ c.gridy = 1;
/* 72 */ c.gridheight = 1;
/* 73 */ c.gridwidth = 1;
/* 74 */ c.anchor = 18;
/* 75 */ gbag.setConstraints(this.xLabel, c);
/* 76 */ add(this.xLabel);
/* */
/* 78 */ c.gridx = 2;
/* 79 */ c.gridy = 1;
/* 80 */ gbag.setConstraints(this.xValue, c);
/* 81 */ add(this.xValue);
/* */
/* 83 */ c.gridx = 1;
/* 84 */ c.gridy = 2;
/* 85 */ gbag.setConstraints(this.yLabel, c);
/* 86 */ add(this.yLabel);
/* */
/* 88 */ c.gridx = 2;
/* 89 */ c.gridy = 2;
/* 90 */ gbag.setConstraints(this.yValue, c);
/* 91 */ add(this.yValue);
/* */
/* 93 */ c.gridx = 1;
/* 94 */ c.gridy = 3;
/* 95 */ gbag.setConstraints(this.zLabel, c);
/* 96 */ add(this.zLabel);
/* */
/* 98 */ c.gridx = 2;
/* 99 */ c.gridy = 3;
/* 100 */ gbag.setConstraints(this.zValue, c);
/* 101 */ add(this.zValue);
/* */
/* 103 */ c.gridx = 2;
/* 104 */ c.gridy = 5;
/* 105 */ gbag.setConstraints(this.useSnapBox, c);
/* 106 */ add(this.useSnapBox);
/* */
/* 108 */ c.gridx = 5;
/* 109 */ c.gridy = 1;
/* 110 */ gbag.setConstraints(this.okButton, c);
/* 111 */ add(this.okButton);
/* */
/* 113 */ c.gridx = 5;
/* 114 */ c.gridy = 2;
/* 115 */ gbag.setConstraints(this.cancelButton, c);
/* 116 */ add(this.cancelButton);
/* */
/* */
/* 119 */ pack();
/* 120 */ Point loc = parent.getLocation();
/* 121 */ Dimension size = parent.getSize();
/* 122 */ setBounds(loc.x + (size.width - 320) / 2,
/* 123 */ loc.y + (size.height - 240) / 2, 320, 240);
/* */
/* 125 */ setVisible(true);
/* */
/* 127 */ Main.register(this);
/* */ }
/* */
/* */ @Deprecated
/* */ public boolean handleEvent(Event ev)
/* */ {
/* 133 */ switch (ev.id) {
/* */ case 201:
/* 135 */ dispose();
/* 136 */ return true;
/* */ }
/* 138 */ return super.handleEvent(ev);
/* */ }
/* */
/* */
/* */ @Deprecated
/* */ public boolean action(Event e, Object o)
/* */ {
/* 145 */ if (e.target == this.cancelButton) {
/* 146 */ dispose();
/* 147 */ return true; }
/* 148 */ if (e.target == this.okButton) {
/* 149 */ this.snapX = Integer.parseInt(this.xValue.getText());
/* 150 */ this.snapY = Integer.parseInt(this.yValue.getText());
/* 151 */ this.snapZ = Integer.parseInt(this.zValue.getText());
/* 152 */ this.useSnap = this.useSnapBox.getState();
/* */
/* 154 */ SnapTool.snapTool().setSnap(this.useSnap);
/* 155 */ SnapTool.snapTool().setSnapX(this.snapX);
/* 156 */ SnapTool.snapTool().setSnapY(this.snapY);
/* 157 */ SnapTool.snapTool().setSnapZ(this.snapZ);
/* */
/* 159 */ dispose();
/* 160 */ return true;
/* */ }
/* 162 */ return false;
/* */ }
/* */
/* */
/* */
/* */ public void mainCallback() {}
/* */
/* */
/* */
/* */ public void terminalCallback()
/* */ {
/* 173 */ Main.unregister(this);
/* */ }
/* */ }
/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\SnapToolPanel.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|