Mercurial > projects > dwt-addons
comparison dwtx/draw2d/geometry/Dimension.d @ 101:1082a0fc2bb8
First Draw2D example running
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 03 Aug 2008 02:17:46 +0200 |
parents | 95307ad235d9 |
children |
comparison
equal
deleted
inserted
replaced
100:86617aa6b5dd | 101:1082a0fc2bb8 |
---|---|
29 public class Dimension | 29 public class Dimension |
30 : Cloneable/+, java.io.Serializable+/, Translatable | 30 : Cloneable/+, java.io.Serializable+/, Translatable |
31 { | 31 { |
32 | 32 |
33 /**A singleton for use in short calculations. Use to avoid newing unnecessary objects.*/ | 33 /**A singleton for use in short calculations. Use to avoid newing unnecessary objects.*/ |
34 public static const Dimension SINGLETON; | 34 private static Dimension SINGLETON_; |
35 | 35 public static Dimension SINGLETON(){ |
36 static this(){ | 36 if( SINGLETON_ is null ){ |
37 SINGLETON = new Dimension(); | 37 synchronized( Dimension.classinfo ){ |
38 if( SINGLETON_ is null ){ | |
39 SINGLETON_ = new Dimension(); | |
40 } | |
41 } | |
42 } | |
43 return SINGLETON_; | |
38 } | 44 } |
39 | 45 |
40 /**The width.*/ | 46 /**The width.*/ |
41 public int width; | 47 public int width; |
42 /**The height. */ | 48 /**The height. */ |