1 22 23 24 package net.sourceforge.chart2d; 25 26 27 import java.awt.Font ; 28 import java.util.Vector ; 29 import java.awt.GraphicsEnvironment ; 30 31 32 36 abstract class Properties { 37 38 39 private static String [] fontNames; 40 private static boolean gotFontNames = false; 41 42 43 48 public synchronized final boolean isFontNameExists (String name) { 49 50 if (!gotFontNames) getFontNames(); 51 for (int i = 0; i < fontNames.length; ++i) if (name.equals (fontNames[i])) return true; 52 return false; 53 } 54 55 56 private void getFontNames() { 57 58 fontNames = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames(); 59 gotFontNames = true; 60 } 61 } | Popular Tags |