01: /*
02: * (C) Copyright SimulacraMedia 2003. All rights reserved.
03: *
04: * Created on 03-Dec-2004
05: *
06: */
07: package org.openharmonise.swing;
08:
09: import java.awt.Font;
10: import java.util.HashMap;
11:
12: /**
13: * FIXME - Matthew Large DIDN'T GIVE ME A DESCRIPTION!!
14: * @author Matthew Large
15: * @version $Revision: 1.1 $
16: *
17: */
18: public class FontManager {
19:
20: private static FontManager m_instance = null;
21:
22: private static HashMap m_fontMap = new HashMap();
23:
24: public static final String FONT_RESOURCE_TITLE = "FONT_RESOURCE_TITLE";
25: public static final String FONT_RESOURCE_TITLE_BOLD = "FONT_RESOURCE_TITLE_BOLD";
26: public static final String FONT_STANDARD = "FONT_STANDARD";
27: public static final String FONT_STANDARD_BOLD = "FONT_STANDARD_BOLD";
28:
29: static {
30: String fontName = "Arial Unicode MS";
31: int fontSize = 12;
32: Font font = new Font(fontName, Font.PLAIN, fontSize);
33: m_fontMap.put(FontManager.FONT_RESOURCE_TITLE, font);
34:
35: font = new Font(fontName, Font.BOLD, fontSize);
36: m_fontMap.put(FontManager.FONT_RESOURCE_TITLE_BOLD, font);
37:
38: fontName = "dialog";
39: fontSize = 11;
40:
41: font = new Font(fontName, Font.PLAIN, fontSize);
42: m_fontMap.put(FontManager.FONT_STANDARD, font);
43:
44: font = new Font(fontName, Font.BOLD, fontSize);
45: m_fontMap.put(FontManager.FONT_STANDARD_BOLD, font);
46: }
47:
48: /**
49: *
50: */
51: private FontManager() {
52: super ();
53: }
54:
55: public static FontManager getInstance() {
56: if (m_instance == null) {
57: m_instance = new FontManager();
58: }
59:
60: return m_instance;
61: }
62:
63: public Font getFont(String sFontName) {
64: return (Font) FontManager.m_fontMap.get(sFontName);
65: }
66:
67: public static void main(String[] args) {
68: FontManager.getInstance();
69: }
70:
71: }
|