uidesigner/com.nokia.sdt.test.componentlibrary/components/testing/container_visual.js
author ssobek
Mon, 20 Apr 2009 10:47:45 -0500
branchRCL_2_0
changeset 101 508f2f2592b2
parent 2 d760517a8095
permissions -rw-r--r--
fixed Bug 8850 "Errors in the .pkg file are not marked in the editor."
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
cawthron
parents:
diff changeset
     1
/*
cawthron
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
cawthron
parents:
diff changeset
     3
* All rights reserved.
cawthron
parents:
diff changeset
     4
* This component and the accompanying materials are made available
cawthron
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
cawthron
parents:
diff changeset
     6
* which accompanies this distribution, and is available
cawthron
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
cawthron
parents:
diff changeset
     8
*
cawthron
parents:
diff changeset
     9
* Initial Contributors:
cawthron
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
cawthron
parents:
diff changeset
    11
*
cawthron
parents:
diff changeset
    12
* Contributors:
cawthron
parents:
diff changeset
    13
*
cawthron
parents:
diff changeset
    14
* Description: 
cawthron
parents:
diff changeset
    15
*
cawthron
parents:
diff changeset
    16
*/
cawthron
parents:
diff changeset
    17
cawthron
parents:
diff changeset
    18
/*
cawthron
parents:
diff changeset
    19
 * Visual static
cawthron
parents:
diff changeset
    20
 *
cawthron
parents:
diff changeset
    21
 * globals available are:
cawthron
parents:
diff changeset
    22
 *
cawthron
parents:
diff changeset
    23
 *		instance (WrappedInstance)
cawthron
parents:
diff changeset
    24
 *		properties (WrappedProperties) 
cawthron
parents:
diff changeset
    25
 *			properties["name"] or properties.name retrieves values
cawthron
parents:
diff changeset
    26
 *		parent (WrappedInstance)
cawthron
parents:
diff changeset
    27
 *		children (WrappedInstance[])
cawthron
parents:
diff changeset
    28
 *		
cawthron
parents:
diff changeset
    29
 * Rendering globals:
cawthron
parents:
diff changeset
    30
 *		graphics (wrapped SWT GC)
cawthron
parents:
diff changeset
    31
 *		Colors (object from which getColor(r,g,b) is available)
cawthron
parents:
diff changeset
    32
 *		Fonts (object from which getFont("path") is available)
cawthron
parents:
diff changeset
    33
 *		Images (object from which newImage(device,w,h) is available)
cawthron
parents:
diff changeset
    34
 */
cawthron
parents:
diff changeset
    35
cawthron
parents:
diff changeset
    36
function Visual() {
cawthron
parents:
diff changeset
    37
}
cawthron
parents:
diff changeset
    38
cawthron
parents:
diff changeset
    39
Visual.prototype.draw = function(instance, laf, gc) {
cawthron
parents:
diff changeset
    40
cawthron
parents:
diff changeset
    41
	var width = instance.properties["size"].width;
cawthron
parents:
diff changeset
    42
	var height = instance.properties.size["height"]
cawthron
parents:
diff changeset
    43
	var r = new Rectangle(0, 0, width/2, height/2)
cawthron
parents:
diff changeset
    44
	
cawthron
parents:
diff changeset
    45
//	gc.setForeground(Colors.getColor(48, 64, 64))
cawthron
parents:
diff changeset
    46
//	gc.setLineWidth(2)
cawthron
parents:
diff changeset
    47
//	gc.drawRectangle(r)			
cawthron
parents:
diff changeset
    48
}
cawthron
parents:
diff changeset
    49
cawthron
parents:
diff changeset
    50
Visual.prototype.getPreferredSize = function(wHint, hHint) {
cawthron
parents:
diff changeset
    51
	return null; // needs implementation	
cawthron
parents:
diff changeset
    52
}
cawthron
parents:
diff changeset
    53