2929import javax .swing .JFrame ;
3030import javax .swing .JOptionPane ;
3131
32- import processing .app .ui .Editor ;
33-
3432public class Messages {
3533 /**
3634 * "No cookie for you" type messages. Nothing fatal or all that
@@ -190,26 +188,14 @@ static public void showTrace(String title, String message,
190188
191189
192190
191+ /*
193192 // incomplete
194193 static public int showYesNoCancelQuestion(Editor editor, String title,
195194 String primary, String secondary) {
196195 if (!Platform.isMacOS()) {
197- int result =
198- JOptionPane .showConfirmDialog (null , primary + "\n " + secondary , title ,
199- JOptionPane .YES_NO_CANCEL_OPTION ,
200- JOptionPane .QUESTION_MESSAGE );
201- return result ;
202- // if (result == JOptionPane.YES_OPTION) {
203- //
204- // } else if (result == JOptionPane.NO_OPTION) {
205- // return true; // ok to continue
206- //
207- // } else if (result == JOptionPane.CANCEL_OPTION) {
208- // return false;
209- //
210- // } else {
211- // throw new IllegalStateException();
212- // }
196+ return JOptionPane.showConfirmDialog(null, primary + "\n" + secondary, title,
197+ JOptionPane.YES_NO_CANCEL_OPTION,
198+ JOptionPane.QUESTION_MESSAGE);
213199
214200 } else {
215201 // Pane formatting adapted from the Quaqua guide
@@ -236,8 +222,7 @@ static public int showYesNoCancelQuestion(Editor editor, String title,
236222
237223 // on macosx, setting the destructive property places this option
238224 // away from the others at the lefthand side
239- pane .putClientProperty ("Quaqua.OptionPane.destructiveOption" ,
240- Integer .valueOf (2 ));
225+ pane.putClientProperty("Quaqua.OptionPane.destructiveOption", 2);
241226
242227 JDialog dialog = pane.createDialog(editor, null);
243228 dialog.setVisible(true);
@@ -254,6 +239,7 @@ static public int showYesNoCancelQuestion(Editor editor, String title,
254239 }
255240 }
256241 }
242+ */
257243
258244
259245 static public int showYesNoQuestion (Frame editor , String title ,
@@ -347,19 +333,19 @@ static public void logf(String message, Object... args) {
347333 }
348334
349335
350- static public void loge (String message , Throwable e ) {
351- if (Base .DEBUG ) {
352- if (message != null ) {
353- System .err .println (message );
354- }
355- e .printStackTrace ();
356- }
336+ static public void err (String message ) {
337+ err (message , null );
357338 }
358339
359340
360- static public void loge (String message ) {
341+ static public void err (String message , Throwable e ) {
361342 if (Base .DEBUG ) {
362- System .err .println (message );
343+ if (message != null ) {
344+ System .err .println (message );
345+ }
346+ if (e != null ) {
347+ e .printStackTrace ();
348+ }
363349 }
364350 }
365351}
0 commit comments