javauis/lcdui_akn/javalcdui/javasrc.nokialcdui/com/nokia/mid/ui/FreeSizeFontInvoker.java
branchRCL_3
changeset 14 04becd199f91
equal deleted inserted replaced
13:f5050f1da672 14:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2008 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 access to lcdui package.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 package com.nokia.mid.ui;
       
    21 
       
    22 import javax.microedition.lcdui.Font;
       
    23 
       
    24 // FreeSizeFontInvoker class allows to access package private members
       
    25 // of javax.microedition.lcdui package from com.nokia.mid.ui package.
       
    26 // This class is shared by these two packages.
       
    27 // Class from javax.microedition.lcdui package is extended by class from
       
    28 // com.nokia.mid.ui package.
       
    29 // Font class is accessed via getFreeSizeFont method.
       
    30 public abstract class FreeSizeFontInvoker
       
    31 {
       
    32     private static com.nokia.mid.ui.FreeSizeFontInvoker sInvoker;
       
    33 
       
    34     //stores instantiated invoker
       
    35     //called from javax.microedition.lcdui.FreeSizeFontInvoker createInvoker
       
    36     public static void setInvoker(com.nokia.mid.ui.FreeSizeFontInvoker invoker)
       
    37     {
       
    38         sInvoker = invoker;
       
    39     }
       
    40 
       
    41     public static javax.microedition.lcdui.Font getFont(
       
    42         int aFace, int aStyle, int aHeight)
       
    43     {
       
    44         //calls getFreeSizeFont from javax.microedition.lcdui.FreeSizeFontInvoker
       
    45         return sInvoker.getFreeSizeFont(aFace, aStyle, aHeight);
       
    46     }
       
    47 
       
    48     // method is defined in javax.microedition.lcdui.FreeSizeFontInvoker
       
    49     protected abstract javax.microedition.lcdui.Font getFreeSizeFont(
       
    50         int aFace, int aStyle, int aHeight);
       
    51 
       
    52 }