|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Invoker for DirectGraphics. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 package com.nokia.mid.ui; |
|
21 |
|
22 import javax.microedition.lcdui.Graphics; |
|
23 import javax.microedition.lcdui.Image; |
|
24 |
|
25 public abstract class DirectGraphicsInvoker |
|
26 { |
|
27 private static com.nokia.mid.ui.DirectGraphicsInvoker sInvoker; |
|
28 |
|
29 public static void setInvoker(com.nokia.mid.ui.DirectGraphicsInvoker aInvoker) |
|
30 { |
|
31 sInvoker = aInvoker; |
|
32 } |
|
33 |
|
34 public static com.nokia.mid.ui.DirectGraphics getDirectGraphics(Graphics aGraphics) |
|
35 { |
|
36 return sInvoker.directGraphics(aGraphics); |
|
37 } |
|
38 |
|
39 protected abstract com.nokia.mid.ui.DirectGraphics directGraphics(Graphics aGraphics); |
|
40 |
|
41 protected abstract void setColor(DirectGraphics aDirectGraphics, |
|
42 int aColor, Image aImage); |
|
43 |
|
44 static void setColorValues(DirectGraphics aDirectGraphics, int aColor, |
|
45 Image aImage) |
|
46 { |
|
47 sInvoker.setColor(aDirectGraphics, aColor, aImage); |
|
48 } |
|
49 |
|
50 protected abstract javax.microedition.lcdui.Display display(); |
|
51 |
|
52 static javax.microedition.lcdui.Display getDisplay() |
|
53 { |
|
54 return sInvoker.display(); |
|
55 } |
|
56 |
|
57 } |