2525package processing .core ;
2626
2727// used for setting bg colors and whatnot
28- import java .awt .Color ;
28+ // import java.awt.Color;
2929// Component is further up the chain than Canvas
30- import java .awt .Component ;
30+ // import java.awt.Component;
3131// use for the link() command (and maybe open()?)
32+
33+ // these are used for various methods (url opening, file selection, etc)
34+ // how many more can we remove?
3235import java .awt .Desktop ;
3336import java .awt .EventQueue ;
3437import java .awt .FileDialog ;
3841import java .awt .Toolkit ;
3942import java .awt .color .ColorSpace ;
4043import java .awt .image .BufferedImage ;
41- import java .io .*;
42- import java .lang .reflect .*;
43- import java .net .*;
44- import java .text .*;
45- import java .util .*;
46- import java .util .regex .*;
47- import java .util .zip .*;
4844
4945// used by loadImage() functions
5046import javax .imageio .ImageIO ;
5450// used by desktopFile() method
5551import javax .swing .filechooser .FileSystemView ;
5652
53+ import java .io .*;
54+ import java .lang .reflect .*;
55+ import java .net .*;
56+ import java .text .*;
57+ import java .util .*;
58+ import java .util .regex .*;
59+ import java .util .zip .*;
60+
5761import processing .data .*;
5862import processing .event .*;
5963import processing .opengl .*;
@@ -9409,8 +9413,9 @@ static protected void runSketchEDT(final String[] args,
94099413 int [] editorLocation = null ;
94109414
94119415 String name = null ;
9412- Color backgroundColor = null ;
9413- Color stopColor = Color .GRAY ;
9416+ int backgroundColor = 0 ;
9417+ //int stopColor = java.awt.Color.GRAY.getRGB();
9418+ int stopColor = 0xff808080 ;
94149419 boolean hideStop = false ;
94159420
94169421 int displayIndex = -1 ; // -1 means use default, b/c numbered from 0
@@ -9436,11 +9441,11 @@ static protected void runSketchEDT(final String[] args,
94369441
94379442 } else if (param .equals (ARGS_BGCOLOR )) {
94389443 if (value .charAt (0 ) == '#' ) value = value .substring (1 );
9439- backgroundColor = new Color ( Integer .parseInt (value , 16 ) );
9444+ backgroundColor = 0xff000000 | Integer .parseInt (value , 16 );
94409445
94419446 } else if (param .equals (ARGS_STOP_COLOR )) {
94429447 if (value .charAt (0 ) == '#' ) value = value .substring (1 );
9443- stopColor = new Color ( Integer .parseInt (value , 16 ) );
9448+ stopColor = 0xff000000 | Integer .parseInt (value , 16 );
94449449
94459450 } else if (param .equals (ARGS_SKETCH_FOLDER )) {
94469451 folder = value ;
@@ -9558,7 +9563,7 @@ static protected void runSketchEDT(final String[] args,
95589563 if (fullScreen ) {
95599564 //surface.placeFullScreen(hideStop);
95609565 if (hideStop ) {
9561- stopColor = null ; // they'll get the hint
9566+ stopColor = 0 ; // they'll get the hint
95629567 }
95639568 surface .placePresent (stopColor );
95649569 } else {
@@ -9571,7 +9576,7 @@ static protected void runSketchEDT(final String[] args,
95719576 }
95729577
95739578
9574- protected PSurface initSurface (Color backgroundColor , int displayIndex ,
9579+ protected PSurface initSurface (int backgroundColor , int displayIndex ,
95759580 boolean present , boolean spanDisplays ) {
95769581// try {
95779582// String renderer = applet.sketchRenderer();
@@ -9662,21 +9667,21 @@ private void deprecationWarning(String method) {
96629667// }
96639668
96649669
9665- /**
9666- * Return a Canvas object that can be embedded into other Java GUIs.
9667- * This is necessary because PApplet no longer subclasses Component.
9668- *
9669- * <pre>
9670- * PApplet sketch = new EmbedSketch();
9671- * Canvas canvas = sketch.getCanvas();
9672- * // add the canvas object to your project and validate() it
9673- * sketch.init() // start the animation thread
9674- */
9675- public Component getComponent () {
9676- g = createPrimaryGraphics ();
9677- surface = g .createSurface ();
9678- return surface .initComponent (this );
9679- }
9670+ // /**
9671+ // * Return a Canvas object that can be embedded into other Java GUIs.
9672+ // * This is necessary because PApplet no longer subclasses Component.
9673+ // *
9674+ // * <pre>
9675+ // * PApplet sketch = new EmbedSketch();
9676+ // * Canvas canvas = sketch.getCanvas();
9677+ // * // add the canvas object to your project and validate() it
9678+ // * sketch.init() // start the animation thread
9679+ // */
9680+ // public Component getComponent() {
9681+ // g = createPrimaryGraphics();
9682+ // surface = g.createSurface();
9683+ // return surface.initComponent(this);
9684+ // }
96809685
96819686
96829687 /** Convenience method, should only be called by PSurface subclasses. */
0 commit comments