(int stopColor)
| 713 | |
| 714 | //public void placeFullScreen(boolean hideStop) { |
| 715 | @Override |
| 716 | public void placePresent(int stopColor) { |
| 717 | setFullFrame(); |
| 718 | |
| 719 | // After the pack(), the screen bounds are gonna be 0s |
| 720 | // frame.setBounds(screenRect); // already called in setFullFrame() |
| 721 | canvas.setBounds((screenRect.width - sketchWidth) / 2, |
| 722 | (screenRect.height - sketchHeight) / 2, |
| 723 | sketchWidth, sketchHeight); |
| 724 | |
| 725 | // if (PApplet.platform == PConstants.MACOSX) { |
| 726 | // macosxFullScreenEnable(frame); |
| 727 | // macosxFullScreenToggle(frame); |
| 728 | // } |
| 729 | |
| 730 | if (stopColor != 0) { |
| 731 | Label label = new Label("stop"); |
| 732 | label.setForeground(new Color(stopColor, false)); |
| 733 | label.addMouseListener(new MouseAdapter() { |
| 734 | @Override |
| 735 | public void mousePressed(java.awt.event.MouseEvent e) { |
| 736 | sketch.exit(); |
| 737 | } |
| 738 | }); |
| 739 | frame.add(label); |
| 740 | |
| 741 | Dimension labelSize = label.getPreferredSize(); |
| 742 | // sometimes shows up truncated on mac |
| 743 | //System.out.println("label width is " + labelSize.width); |
| 744 | labelSize = new Dimension(100, labelSize.height); |
| 745 | label.setSize(labelSize); |
| 746 | label.setLocation(20, screenRect.height - labelSize.height - 20); |
| 747 | } |
| 748 | |
| 749 | // if (sketch.getGraphics().displayable()) { |
| 750 | // setVisible(true); |
| 751 | // } |
| 752 | } |
| 753 | |
| 754 | |
| 755 | /* |
nothing calls this directly
no test coverage detected