|
17 | 17 | import java.awt.event.ComponentListener;
|
18 | 18 | import java.awt.event.KeyEvent;
|
19 | 19 | import java.awt.event.KeyListener;
|
20 |
| -import java.awt.event.WindowEvent; |
21 |
| -import java.awt.event.WindowListener; |
22 | 20 | import java.io.BufferedReader;
|
23 | 21 | import java.io.BufferedWriter;
|
24 | 22 | import java.io.File;
|
@@ -158,21 +156,37 @@ public void scriptExit(Process process, int exitCode, String errorMessage) {}
|
158 | 156 | @Override
|
159 | 157 | public Command[] createLib() {
|
160 | 158 | return new Command[] {
|
161 |
| - new Command("clearConsole", "", "Clears the console") { |
| 159 | + new Command("clearConsole", "", "Deprecated since 1.9.13 and removed in future releases. Please use 'gui.clear'") { |
162 | 160 | @Override
|
163 | 161 | public Object execute(Object[] args, Process application, Block block) throws Exception {
|
164 | 162 | console.consoleText.setText("");
|
165 | 163 | return null;
|
166 | 164 | }
|
167 | 165 | },
|
| 166 | + |
| 167 | + new Command("gui.clear", "", "Clears the console") { |
| 168 | + @Override |
| 169 | + public Object execute(Object[] args, Process application, Block block) throws Exception { |
| 170 | + console.consoleText.setText(""); |
| 171 | + return null; |
| 172 | + } |
| 173 | + }, |
| 174 | + |
| 175 | + new Command("gui.size", "string string", "Sets the console window size in pixels") { |
| 176 | + @Override |
| 177 | + public Object execute(Object[] args, Process application, Block block) throws Exception { |
| 178 | + if(isInteger(args[0].toString()) && isInteger(args[1].toString())) { |
| 179 | + console.setSize(Integer.valueOf(args[0].toString()), Integer.valueOf(args[1].toString())); |
| 180 | + } else application.kill(block, "Argument 1 and 2 need to be positive integers"); |
| 181 | + return null; |
| 182 | + } |
| 183 | + } |
168 | 184 | };
|
169 | 185 | }
|
170 | 186 | });
|
171 | 187 | p.setApplicationListener(new ApplicationListener() {
|
172 | 188 | public void done(int exitCode) {
|
173 | 189 | console.consoleStatus.setText("Finished with Exit Code " + exitCode);
|
174 |
| - //window.setEnabled(true); |
175 |
| - //console.setEnabled(false); |
176 | 190 | }
|
177 | 191 | });
|
178 | 192 |
|
@@ -326,7 +340,7 @@ public void actionPerformed(ActionEvent e) {
|
326 | 340 | console.consoleText.setText("");
|
327 | 341 | console.toFront();
|
328 | 342 | console.setVisible(true);
|
329 |
| - p.execute("help", false); |
| 343 | + p.execute("gui.size 1000 400;help", false); |
330 | 344 | }});
|
331 | 345 | m4.add(commandCC);
|
332 | 346 | m4.addSeparator();
|
|
0 commit comments