(int[] location, int[] editorLocation)
| 543 | |
| 544 | |
| 545 | @Override |
| 546 | public void placeWindow(int[] location, int[] editorLocation) { |
| 547 | if (sketch.sketchFullScreen()) { |
| 548 | PApplet.hideMenuBar(); |
| 549 | return; |
| 550 | } |
| 551 | |
| 552 | int wide = sketch.width; // stage.getWidth() is NaN here |
| 553 | //int high = sketch.height; // stage.getHeight() |
| 554 | |
| 555 | if (location != null) { |
| 556 | // a specific location was received from the Runner |
| 557 | // (applet has been run more than once, user placed window) |
| 558 | stage.setX(location[0]); |
| 559 | stage.setY(location[1]); |
| 560 | |
| 561 | } else if (editorLocation != null) { |
| 562 | int locationX = editorLocation[0] - 20; |
| 563 | int locationY = editorLocation[1]; |
| 564 | |
| 565 | if (locationX - wide > 10) { |
| 566 | // if it fits to the left of the window |
| 567 | stage.setX(locationX - wide); |
| 568 | stage.setY(locationY); |
| 569 | |
| 570 | } else { // doesn't fit |
| 571 | stage.centerOnScreen(); |
| 572 | } |
| 573 | } else { // just center on screen |
| 574 | stage.centerOnScreen(); |
| 575 | } |
| 576 | } |
| 577 | |
| 578 | |
| 579 | // http://download.java.net/jdk8/jfxdocs/javafx/stage/Stage.html#setFullScreenExitHint-java.lang.String- |
nothing calls this directly
no test coverage detected