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 |
* Visual 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(instance, laf, gc) {
|
|
40 |
|
|
41 |
var width = instance.properties["size"].width;
|
|
42 |
var height = instance.properties.size["height"]
|
|
43 |
var r = new Rectangle(0, 0, width/2, height/2)
|
|
44 |
|
|
45 |
// gc.setForeground(Colors.getColor(48, 64, 64))
|
|
46 |
// gc.setLineWidth(2)
|
|
47 |
// gc.drawRectangle(r)
|
|
48 |
}
|
|
49 |
|
|
50 |
Visual.prototype.getPreferredSize = function(wHint, hHint) {
|
|
51 |
return null; // needs implementation
|
|
52 |
}
|
|
53 |
|