13 |
13 |
14 import org.eclipse.swt.graphics.Point; |
14 import org.eclipse.swt.graphics.Point; |
15 import org.eclipse.swt.internal.symbian.OS; |
15 import org.eclipse.swt.internal.symbian.OS; |
16 import org.eclipse.swt.widgets.Display; |
16 import org.eclipse.swt.widgets.Display; |
17 |
17 |
18 public final class DisplayExtension extends Display |
18 public final class DisplayExtension extends Display |
19 { |
19 { |
20 |
|
21 /* Image types, same values as MIDP */ |
20 /* Image types, same values as MIDP */ |
22 public static final int LIST_ELEMENT = 1; |
21 public static final int LIST_ELEMENT = 1; |
23 public static final int CHOICE_GROUP_ELEMENT = 2; |
22 public static final int CHOICE_GROUP_ELEMENT = 2; |
24 public static final int ALERT = 3; |
23 public static final int ALERT = 3; |
25 |
24 |
26 public DisplayExtension() |
25 public DisplayExtension() |
27 { |
26 { |
28 super(); |
27 super(); |
29 } |
28 } |
30 |
29 |
31 /** |
30 /** |
32 * Determine the best width for the given image type. |
31 * Determine the best width for the given image type. |
|
32 * |
33 * @param imageType |
33 * @param imageType |
34 * @return Best height or -1 if invalid image type given. |
34 * @return Best height or -1 if invalid image type given. |
35 */ |
35 */ |
36 public int getBestImageWidth(int imageType) |
36 public static int getBestImageWidth(int imageType) |
37 { |
37 { |
38 checkDevice(); |
|
39 return getBestImageSize(imageType).x; |
38 return getBestImageSize(imageType).x; |
40 } |
39 } |
41 |
40 |
42 /** |
41 /** |
43 * Determine the best height for the given image type. |
42 * Determine the best height for the given image type. |
|
43 * |
44 * @param imageType |
44 * @param imageType |
45 * @return Best height or -1 if invalid image type given. |
45 * @return Best height or -1 if invalid image type given. |
46 */ |
46 */ |
47 public int getBestImageHeight(int imageType) |
47 public static int getBestImageHeight(int imageType) |
48 { |
48 { |
49 checkDevice(); |
|
50 return getBestImageSize(imageType).y; |
49 return getBestImageSize(imageType).y; |
51 } |
50 } |
52 |
51 |
53 private Point getBestImageSize(int imageType) |
52 private static Point getBestImageSize(int imageType) |
54 { |
53 { |
55 return OS.DisplayExtension_getBestImageSize(imageType); |
54 return OS.DisplayExtension_getBestImageSize(imageType); |
56 } |
55 } |
57 |
56 |
58 } |
57 } |