(int stopColor)
| 620 | |
| 621 | //public void placeFullScreen(boolean hideStop) { |
| 622 | @Override |
| 623 | public void placePresent(int stopColor) { |
| 624 | setFullFrame(); |
| 625 | |
| 626 | // After the pack(), the screen bounds are gonna be 0s |
| 627 | // frame.setBounds(screenRect); // already called in setFullFrame() |
| 628 | canvas.setBounds((screenRect.width - sketchWidth) / 2, |
| 629 | (screenRect.height - sketchHeight) / 2, |
| 630 | sketchWidth, sketchHeight); |
| 631 | |
| 632 | // if (PApplet.platform == PConstants.MACOSX) { |
| 633 | // macosxFullScreenEnable(frame); |
| 634 | // macosxFullScreenToggle(frame); |
| 635 | // } |
| 636 | |
| 637 | if (stopColor != 0) { |
| 638 | Label label = new Label("stop"); |
| 639 | label.setForeground(new Color(stopColor, false)); |
| 640 | label.addMouseListener(new MouseAdapter() { |
| 641 | @Override |
| 642 | public void mousePressed(java.awt.event.MouseEvent e) { |
| 643 | sketch.exit(); |
| 644 | } |
| 645 | }); |
| 646 | frame.add(label); |
| 647 | |
| 648 | Dimension labelSize = label.getPreferredSize(); |
| 649 | // sometimes shows up truncated on mac |
| 650 | //System.out.println("label width is " + labelSize.width); |
| 651 | labelSize = new Dimension(100, labelSize.height); |
| 652 | label.setSize(labelSize); |
| 653 | label.setLocation(20, screenRect.height - labelSize.height - 20); |
| 654 | } |
| 655 | } |
| 656 | |
| 657 | |
| 658 | private void setCanvasSize() { |
nothing calls this directly
no test coverage detected