MCPcopy Create free account
hub / github.com/benfry/processing4 / placePresent

Method placePresent

core/src/processing/awt/PSurfaceAWT.java:622–655  ·  view source on GitHub ↗
(int stopColor)

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 5

setFullFrameMethod · 0.95
setSizeMethod · 0.65
setLocationMethod · 0.65
addMethod · 0.45
getPreferredSizeMethod · 0.45

Tested by

no test coverage detected