001    /*
002     * Copyright 2002 - 2007 JEuclid, http://jeuclid.sf.net
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     *      http://www.apache.org/licenses/LICENSE-2.0
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    
017    /* $Id: ListFonts.java,v 503f7e4f22db 2008/04/28 12:43:00 maxberger $ */
018    
019    package net.sourceforge.jeuclid.app;
020    
021    import java.util.Collections;
022    import java.util.List;
023    import java.util.Vector;
024    
025    import net.sourceforge.jeuclid.font.FontFactory;
026    
027    /**
028     * Lists all fonts available to JEuclid.
029     * 
030     * @version $Revision: 503f7e4f22db $
031     */
032    public final class ListFonts {
033        /**
034         * Default Constructor.
035         */
036        private ListFonts() {
037            // Empty on purpose
038        }
039    
040        /**
041         * Retrieves font list and prints it to the console.
042         * 
043         * @param args
044         *            not used.
045         */
046        public static void main(final String[] args) {
047            final FontFactory f = FontFactory.getInstance();
048            final List<String> allFonts = new Vector<String>(f.listFontNames());
049            Collections.sort(allFonts);
050            for (final String s : allFonts) {
051                System.out.println(s);
052            }
053        }
054    }