| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -267,10 +267,6 @@ public void paintComponent(Graphics g) { | |||
| 267 | 267 | ||
| 268 | 268 | upper.add(textarea); | |
| 269 | 269 | ||
| 270 | - // alternate spot for status, but ugly | ||
| 271 | - // status = new EditorStatus(this); | ||
| 272 | - // upper.add(status); | ||
| 273 | - | ||
| 274 | 270 | splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, upper, footer); | |
| 275 | 271 | ||
| 276 | 272 | // disable this because it hides the message area, which is essential (issue #745) | |
@@ -285,48 +281,20 @@ public void paintComponent(Graphics g) { | |||
| 285 | 281 | // remove an ugly border around anything in a SplitPane !$*&!% | |
| 286 | 282 | UIManager.getDefaults().put("SplitPane.border", BorderFactory.createEmptyBorder()); | |
| 287 | 283 | // set the height per our gui design | |
| 288 | - //splitPane.setDividerSize(mode.getInteger("divider.height")); | ||
| 289 | 284 | splitPane.setDividerSize(EditorStatus.HIGH); | |
| 290 | 285 | ||
| 291 | 286 | // override the look of the SplitPane so that it's identical across OSes | |
| 292 | 287 | splitPane.setUI(new BasicSplitPaneUI() { | |
| 293 | 288 | public BasicSplitPaneDivider createDefaultDivider() { | |
| 294 | 289 | status = new EditorStatus(this, Editor.this); | |
| 295 | 290 | return status; | |
| 296 | - /* | ||
| 297 | - return new BasicSplitPaneDivider(this) { | ||
| 298 | - final Color dividerColor = mode.getColor("divider.color"); //new Color(204, 204, 204); | ||
| 299 | - final Color dotColor = mode.getColor("divider.dot.color"); //new Color(80, 80, 80); | ||
| 300 | - int dotSize = mode.getInteger("divider.dot.diameter"); //3; | ||
| 301 | - | ||
| 302 | - @Override | ||
| 303 | - public void paint(Graphics g) { | ||
| 304 | - Graphics2D g2 = (Graphics2D) g; | ||
| 305 | - g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, | ||
| 306 | - RenderingHints.VALUE_ANTIALIAS_ON); | ||
| 307 | - | ||
| 308 | - final int w = getSize().width; | ||
| 309 | - final int h = getSize().height; | ||
| 310 | - g.setColor(dividerColor); | ||
| 311 | - g.fillRect(0, 0, w, h); | ||
| 312 | - | ||
| 313 | - g.setColor(dotColor); | ||
| 314 | - int x = w/2 - dotSize/2; | ||
| 315 | - int y = h/2 - dotSize/2; | ||
| 316 | - g.fillOval(x, y, dotSize, dotSize); | ||
| 317 | - } | ||
| 318 | - }; | ||
| 319 | - */ | ||
| 320 | 291 | } | |
| 321 | 292 | }); | |
| 322 | 293 | ||
| 323 | 294 | box.add(splitPane); | |
| 324 | 295 | ||
| 325 | 296 | contentPain.add(box); | |
| 326 | 297 | ||
| 327 | - // get shift down/up events so we can show the alt version of toolbar buttons | ||
| 328 | - //textarea.addKeyListener(toolbar); | ||
| 329 | - | ||
| 330 | 298 | // end an undo-chunk any time the caret moves unless it's when text is edited | |
| 331 | 299 | textarea.addCaretListener(new CaretListener() { | |
| 332 | 300 | String lastText = textarea.getText(); | |
@@ -348,8 +316,9 @@ public void caretUpdate(CaretEvent e) { | |||
| 348 | 316 | state.apply(this); | |
| 349 | 317 | ||
| 350 | 318 | // Set the minimum size for the editor window | |
| 351 | - setMinimumSize(new Dimension(Preferences.getInteger("editor.window.width.min"), | ||
| 352 | - Preferences.getInteger("editor.window.height.min"))); | ||
| 319 | + int minWidth = Preferences.getInteger("editor.window.width.min"); | ||
| 320 | + int minHeight = Preferences.getInteger("editor.window.height.min"); | ||
| 321 | + setMinimumSize(new Dimension(minWidth, minHeight)); | ||
| 353 | 322 | ||
| 354 | 323 | // Bring back the general options for the editor | |
| 355 | 324 | applyPreferences(); | |
@@ -362,10 +331,6 @@ public void caretUpdate(CaretEvent e) { | |||
| 362 | 331 | public void windowGainedFocus(WindowEvent e) { | |
| 363 | 332 | textarea.requestFocusInWindow(); | |
| 364 | 333 | } | |
| 365 | - | ||
| 366 | - // public void windowLostFocus(WindowEvent e) { | ||
| 367 | - // System.out.println("lost focus, should we tell the text area?"); | ||
| 368 | - // } | ||
| 369 | 334 | }); | |
| 370 | 335 | ||
| 371 | 336 | // Open the document that was passed in | |
@@ -391,43 +356,9 @@ public void removeToolContrib(ToolContribution tc) { | |||
| 391 | 356 | } | |
| 392 | 357 | ||
| 393 | 358 | ||
| 394 | - /** | ||
| 395 | - * Broken out to get modes working for GSOC, but this needs a longer-term | ||
| 396 | - * solution where the listeners are handled properly. | ||
| 397 | - */ | ||
| 398 | 359 | protected JEditTextArea createTextArea() { | |
| 399 | 360 | return new JEditTextArea(new PdeTextAreaDefaults(mode), | |
| 400 | 361 | new PdeInputHandler()); | |
| 401 | - /* | ||
| 402 | - return new JEditTextArea(new PdeTextAreaDefaults(mode), new PdeInputHandler()) { | ||
| 403 | - // this is a kludge that needs to be removed [fry 150120] | ||
| 404 | - public void processKeyEvent(KeyEvent evt) { | ||
| 405 | - // this had to be added in Processing 007X, because the menu key | ||
| 406 | - // events weren't making it up to the frame. | ||
| 407 | - super.processKeyEvent(evt); | ||
| 408 | - | ||
| 409 | - if (inputHandler != null) { | ||
| 410 | - // Prevent sketch being marked modified cia ctrl-, on Windows/Linux | ||
| 411 | - if ((evt.getModifiers() & InputEvent.CTRL_MASK) != 0 && | ||
| 412 | - evt.getKeyChar() == ',') { | ||
| 413 | - System.out.println("skipping " + evt); | ||
| 414 | - return; | ||
| 415 | - } | ||
| 416 | - switch (evt.getID()) { | ||
| 417 | - case KeyEvent.KEY_TYPED: | ||
| 418 | - inputHandler.keyTyped(evt); | ||
| 419 | - break; | ||
| 420 | - case KeyEvent.KEY_PRESSED: | ||
| 421 | - inputHandler.keyPressed(evt); | ||
| 422 | - break; | ||
| 423 | - case KeyEvent.KEY_RELEASED: | ||
| 424 | - inputHandler.keyReleased(evt); | ||
| 425 | - break; | ||
| 426 | - } | ||
| 427 | - } | ||
| 428 | - } | ||
| 429 | - }; | ||
| 430 | - */ | ||
| 431 | 362 | } | |
| 432 | 363 | ||
| 433 | 364 | ||
@@ -453,16 +384,6 @@ public EditorState getEditorState() { | |||
| 453 | 384 | } | |
| 454 | 385 | ||
| 455 | 386 | ||
| 456 | - // public void removeRecent() { | ||
| 457 | - // Recent.remove(this); | ||
| 458 | - // } | ||
| 459 | - // | ||
| 460 | - // | ||
| 461 | - // public void addRecent() { | ||
| 462 | - // Recent.handle(this); | ||
| 463 | - // } | ||
| 464 | - | ||
| 465 | - | ||
| 466 | 387 | /** | |
| 467 | 388 | * Handles files dragged & dropped from the desktop and into the editor | |
| 468 | 389 | * window. Dragging files into the editor window is the same as using | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -81,7 +81,6 @@ public class EditorStatus extends BasicSplitPaneDivider { //JPanel { | |||
| 81 | 81 | Thread thread; | |
| 82 | 82 | ||
| 83 | 83 | ||
| 84 | - //public EditorStatus(Editor editor) { | ||
| 85 | 84 | public EditorStatus(BasicSplitPaneUI ui, Editor editor) { | |
| 86 | 85 | super(ui); | |
| 87 | 86 | this.editor = editor; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments