@@ -88,7 +88,9 @@ public static void main (String [] args) {
8888// shell2.open();
8989
9090 while (!shell .isDisposed ()) {
91- if (!display .readAndDispatch ()) display .sleep ();
91+ if (!display .readAndDispatch ()) {
92+ display .sleep ();
93+ }
9294 }
9395 display .dispose ();
9496}
@@ -107,7 +109,7 @@ public void create (Composite parent) {
107109 Composite right = new Composite (sash , 0 );
108110 right .setLayout (new GridLayout ());
109111
110- sash .setWeights (new int [] { 40 ,60 } );
112+ sash .setWeights (40 , 60 );
111113
112114 // Right side
113115 canvas = new Canvas (right , SWT .BORDER );
@@ -393,29 +395,39 @@ void toggleStackTrace () {
393395void paintCanvas (Event event ) {
394396 canvas .setCursor (null );
395397 int index = list .getSelectionIndex ();
396- if (index == -1 ) return ;
398+ if (index == -1 ) {
399+ return ;
400+ }
397401 GC gc = event .gc ;
398402 Object object = objects .get (index ).object ;
399403 draw (gc , object );
400404}
401405
402406void draw (GC gc , Object object ) {
403407 if (object instanceof Cursor ) {
404- if (((Cursor )object ).isDisposed ()) return ;
408+ if (((Cursor )object ).isDisposed ()) {
409+ return ;
410+ }
405411 canvas .setCursor ((Cursor ) object );
406412 return ;
407413 }
408414 if (object instanceof Font ) {
409- if (((Font )object ).isDisposed ()) return ;
415+ if (((Font )object ).isDisposed ()) {
416+ return ;
417+ }
410418 gc .setFont ((Font ) object );
411419 String string = "" ;
412420 String lf = text .getLineDelimiter ();
413421 for (FontData data : gc .getFont ().getFontData ()) {
414422 String style = "NORMAL" ;
415423 int bits = data .getStyle ();
416424 if (bits != 0 ) {
417- if ((bits & SWT .BOLD ) != 0 ) style = "BOLD " ;
418- if ((bits & SWT .ITALIC ) != 0 ) style += "ITALIC" ;
425+ if ((bits & SWT .BOLD ) != 0 ) {
426+ style = "BOLD " ;
427+ }
428+ if ((bits & SWT .ITALIC ) != 0 ) {
429+ style += "ITALIC" ;
430+ }
419431 }
420432 string += data .getName () + " " + data .getHeight () + " " + style + lf ;
421433 }
@@ -427,35 +439,47 @@ void draw(GC gc, Object object) {
427439// return;
428440// }
429441 if (object instanceof Image ) {
430- if (((Image )object ).isDisposed ()) return ;
442+ if (((Image )object ).isDisposed ()) {
443+ return ;
444+ }
431445 gc .drawImage ((Image ) object , 0 , 0 );
432446 return ;
433447 }
434448 if (object instanceof Path ) {
435- if (((Path )object ).isDisposed ()) return ;
449+ if (((Path )object ).isDisposed ()) {
450+ return ;
451+ }
436452 gc .drawPath ((Path ) object );
437453 return ;
438454 }
439455 if (object instanceof Pattern ) {
440- if (((Pattern )object ).isDisposed ()) return ;
456+ if (((Pattern )object ).isDisposed ()) {
457+ return ;
458+ }
441459 gc .setBackgroundPattern ((Pattern )object );
442460 gc .fillRectangle (canvas .getClientArea ());
443461 gc .setBackgroundPattern (null );
444462 return ;
445463 }
446464 if (object instanceof Region ) {
447- if (((Region )object ).isDisposed ()) return ;
465+ if (((Region )object ).isDisposed ()) {
466+ return ;
467+ }
448468 String string = ((Region )object ).getBounds ().toString ();
449469 gc .drawString (string , 0 , 0 );
450470 return ;
451471 }
452472 if (object instanceof TextLayout ) {
453- if (((TextLayout )object ).isDisposed ()) return ;
473+ if (((TextLayout )object ).isDisposed ()) {
474+ return ;
475+ }
454476 ((TextLayout )object ).draw (gc , 0 , 0 );
455477 return ;
456478 }
457479 if (object instanceof Transform ) {
458- if (((Transform )object ).isDisposed ()) return ;
480+ if (((Transform )object ).isDisposed ()) {
481+ return ;
482+ }
459483 String string = ((Transform )object ).toString ();
460484 gc .drawString (string , 0 , 0 );
461485 return ;
@@ -464,7 +488,9 @@ void draw(GC gc, Object object) {
464488
465489void refreshObject () {
466490 int index = list .getSelectionIndex ();
467- if (index == -1 ) return ;
491+ if (index == -1 ) {
492+ return ;
493+ }
468494 if (stackTrace .getSelection ()) {
469495 text .setText (objects .get (index ).getStack ());
470496 setVisible (text , true );
0 commit comments