2
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 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 the License "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:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
/*
|
|
19 |
* Render static
|
|
20 |
*
|
|
21 |
* globals available are:
|
|
22 |
*
|
|
23 |
* instance (WrappedInstance)
|
|
24 |
* properties (WrappedProperties)
|
|
25 |
* properties["name"] or properties.name retrieves values
|
|
26 |
* parent (WrappedInstance)
|
|
27 |
* children (WrappedInstance[])
|
|
28 |
*
|
|
29 |
* rendering globals:
|
|
30 |
* graphics (wrapped SWT GC)
|
|
31 |
* Colors (object from which getColor(r,g,b) is available)
|
|
32 |
* Fonts (object from which getFont("path") is available)
|
|
33 |
* Images (object from which newImage(device,w,h) is available)
|
|
34 |
*/
|
|
35 |
|
|
36 |
function Visual() {
|
|
37 |
}
|
|
38 |
|
|
39 |
Visual.prototype.draw = function() {
|
|
40 |
|
|
41 |
var width = properties.size.width;
|
|
42 |
var height = properties.size.height
|
|
43 |
|
|
44 |
var base = "data/s60"
|
|
45 |
|
|
46 |
graphics.setBackground(Colors.getColor(160, 64, 64))
|
|
47 |
graphics.fillRectangle(0, 0, width, height);
|
|
48 |
|
|
49 |
graphics.setForeground(Colors.getColor(255, 255, 255))
|
|
50 |
graphics.setFont(Fonts.getGlobalFont(base + "/fonts/Alb12.9.ttf"))
|
|
51 |
graphics.drawFormattedString("(static)", new Rectangle(0, height/2, width, height/2),
|
|
52 |
Font.ALIGN_CENTER + Font.DRAW_TRANSPARENT);
|
|
53 |
}
|
|
54 |
|
|
55 |
Visual.prototype.getPreferredSize = function(wHint, hHint) {
|
|
56 |
return null; // needs implementation
|
|
57 |
}
|
|
58 |
|