jdk/src/macosx/classes/sun/awt/CGraphicsEnvironment.java
changeset 13138 9a70fa2cc59c
parent 12816 b4cabffcb0de
child 17151 9bfcf2a592fc
equal deleted inserted replaced
12997:7ad469d89bed 13138:9a70fa2cc59c
   198     @Override
   198     @Override
   199     public boolean isDisplayLocal() {
   199     public boolean isDisplayLocal() {
   200        return true;
   200        return true;
   201     }
   201     }
   202 
   202 
   203     private Font[] allFontsWithLogical;
       
   204     static String[] sLogicalFonts = { "Serif", "SansSerif", "Monospaced", "Dialog", "DialogInput" };
   203     static String[] sLogicalFonts = { "Serif", "SansSerif", "Monospaced", "Dialog", "DialogInput" };
   205 
   204 
   206     @Override
   205     @Override
   207     public Font[] getAllFonts() {
   206     public Font[] getAllFonts() {
   208         if (allFontsWithLogical == null)
   207 
       
   208         Font[] newFonts;
       
   209         Font[] superFonts = super.getAllFonts();
       
   210 
       
   211         int numLogical = sLogicalFonts.length;
       
   212         int numOtherFonts = superFonts.length;
       
   213 
       
   214         newFonts = new Font[numOtherFonts + numLogical];
       
   215         System.arraycopy(superFonts,0,newFonts,numLogical,numOtherFonts);
       
   216 
       
   217         for (int i = 0; i < numLogical; i++)
   209         {
   218         {
   210             Font[] newFonts;
   219             newFonts[i] = new Font(sLogicalFonts[i], Font.PLAIN, 1);
   211             Font[] superFonts = super.getAllFonts();
   220         }
   212 
   221         return newFonts;
   213             int numLogical = sLogicalFonts.length;
       
   214             int numOtherFonts = superFonts.length;
       
   215 
       
   216             newFonts = new Font[numOtherFonts + numLogical];
       
   217             System.arraycopy(superFonts,0,newFonts,numLogical,numOtherFonts);
       
   218 
       
   219             for (int i = 0; i < numLogical; i++)
       
   220             {
       
   221                 newFonts[i] = new Font(sLogicalFonts[i], Font.PLAIN, 1);
       
   222             }
       
   223             allFontsWithLogical = newFonts;
       
   224         }
       
   225         return java.util.Arrays.copyOf(allFontsWithLogical, allFontsWithLogical.length);
       
   226     }
   222     }
   227 
   223 
   228 }
   224 }