uidesigner/com.nokia.sdt.uimodel.tests/data/nodepath/CBA_visual.js
changeset 0 fb279309251b
equal deleted inserted replaced
-1:000000000000 0:fb279309251b
       
     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  *		graphics (wrapped SWT GC)
       
    19  *		Colors (object from which getColor(r,g,b) is available)
       
    20  *		Fonts (object from which getFont("path") is available)
       
    21  *		Images (object from which newImage(device,w,h) is available)
       
    22  */
       
    23 function CBAVisual() {
       
    24 }
       
    25 
       
    26 CBAVisual.prototype.draw = function() {
       
    27 	fontFile = "Alb17.14.ttf";
       
    28 
       
    29 	graphics.setFont(Fonts.getGlobalFont("data/s60/fonts/"+fontFile));
       
    30 	graphics.setBackground(Colors.getColor(0, 0, 0))
       
    31 
       
    32 	// get bounding rect
       
    33 	var rect = new Rectangle(5, 0,
       
    34 		properties.size.width - 10, properties.size.height)
       
    35 		
       
    36 	graphics.drawFormattedString(properties.CBA.leftText, rect, Font.ALIGN_LEFT, 0);
       
    37 	
       
    38 	graphics.drawFormattedString(properties.CBA.rightText, rect, Font.ALIGN_RIGHT, 0);
       
    39 }
       
    40 
       
    41 CBAVisual.prototype.getPreferredSize = function(wHint, hHint) {
       
    42 	return null; // needs implementation	
       
    43 }
       
    44