mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
add callbacks for subclassing init process, use class name not full package for title
This commit is contained in:
@@ -10152,30 +10152,40 @@ public class PApplet implements PConstants {
|
||||
surface.placeWindow(location, editorLocation);
|
||||
}
|
||||
|
||||
// EventQueue.invokeLater(new Runnable() {
|
||||
// public void run() {
|
||||
|
||||
// Helps avoid this code being duplicated 2x per surface class.
|
||||
// Andres is testing to make sure this doesn't cause trouble.
|
||||
if (sketch.getGraphics().displayable()) {
|
||||
surface.setVisible(true);
|
||||
}
|
||||
|
||||
// not always running externally when in present mode
|
||||
// moved above setVisible() in 3.0 alpha 11
|
||||
if (sketch.external) {
|
||||
surface.setupExternalMessages();
|
||||
}
|
||||
|
||||
sketch.showSurface();
|
||||
sketch.startSurface();
|
||||
/*
|
||||
if (sketch.getGraphics().displayable()) {
|
||||
surface.setVisible(true);
|
||||
}
|
||||
|
||||
//sketch.init();
|
||||
surface.startThread();
|
||||
|
||||
// }
|
||||
// });
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
protected PSurface initSurface() {/*int backgroundColor, int displayNum,
|
||||
boolean fullScreen, boolean spanDisplays) {*/
|
||||
/** Danger: available for advanced subclassing, but here be dragons. */
|
||||
protected void showSurface() {
|
||||
if (getGraphics().displayable()) {
|
||||
surface.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** See warning in showSurface() */
|
||||
protected void startSurface() {
|
||||
surface.startThread();
|
||||
}
|
||||
|
||||
|
||||
protected PSurface initSurface() {
|
||||
g = createPrimaryGraphics();
|
||||
surface = g.createSurface();
|
||||
|
||||
@@ -10229,7 +10239,7 @@ public class PApplet implements PConstants {
|
||||
};
|
||||
|
||||
surface.initFrame(this); //, backgroundColor, displayNum, fullScreen, spanDisplays);
|
||||
surface.setTitle(getClass().getName());
|
||||
surface.setTitle(getClass().getSimpleName());
|
||||
|
||||
} else {
|
||||
surface.initOffscreen(this); // for PDF/PSurfaceNone and friends
|
||||
|
||||
Reference in New Issue
Block a user