# HG changeset patch # User Frank Benoit # Date 1218122605 -7200 # Node ID 7dca96709d297ac6d4ea66c85dca708a6f3caad5 # Parent c311768f1afa33fb09b66aaf69e46864cb907943 Fix: remove trigger of Display creation in static ctors diff -r c311768f1afa -r 7dca96709d29 draw2d/UmlExample.d --- a/draw2d/UmlExample.d Thu Aug 07 17:22:14 2008 +0200 +++ b/draw2d/UmlExample.d Thu Aug 07 17:23:25 2008 +0200 @@ -59,9 +59,12 @@ } public class UMLClassFigure : Figure { - public static Color classColor; - static this(){ - classColor = new Color(null,255,255,206); + private static Color classColor_; + public static Color classColor(){ + if( classColor_ is null ){ + classColor_ = new Color(null,255,255,206); + } + return classColor_; } private CompartmentFigure attributeFigure; @@ -103,7 +106,7 @@ * A test class to display a UMLFigure */ public static void main(){ - Display d = Display.getCurrent(); + Display d = new Display(); final Shell shell = new Shell(d); shell.setSize(400, 400); shell.setText("UMLClassFigure Test");