public static Rectangle getSymbolBounds(String symbolID, int fontSize)
        {
            //var spsd:SPSymbolDef = SinglePointLookup.instance.getSPSymbolDef(symbolID);
            SinglePointLookupInfo spli = SinglePointLookup.getInstance().getSPLookupInfo(symbolID);

            Rectangle rect = new Rectangle(0, 0, spli.getWidth(), spli.getHeight());

            if (fontSize != 60)           //adjust boundaries ratio if font size is not at the default setting.
            {
                double ratio = fontSize / 60.0;

                rect = new Rectangle(0, 0, (int)((rect.Width * ratio) + 0.5), (int)((rect.Height * ratio) + 0.5));
            }

            return(rect);
        }
Beispiel #2
0
        //private var myXML:XML = new XML();
        //private var XML_URL:String = "xml/SinglePoint.xml";
        //private var myXMLURL:URLRequest;
        //private var myLoader:URLLoader;
        //  private Dictionary<String, SinglePointLookupInfo> _dictionary = new Dictionary<String, SinglePointLookupInfo>();

        public static SinglePointLookup getInstance()
        {
            if (_instance == null)
            {
                lock (syncLock)
                {
                    if (_instance == null)
                    {
                        _instance = new SinglePointLookup();
                    }
                    // _instance.init();
                }
            }

            return(_instance);
        }