Ignore:
Timestamp:
06/27/08 16:44:21 (16 years ago)
Author:
ra33
Message:

Heaps of changes!!!!
Added circles...
Better drawing of lines etc etc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/actions/Actions.java

    r103 r108  
    11package org.expeditee.actions;
    22
     3import java.awt.GraphicsEnvironment;
    34import java.io.File;
    45import java.lang.reflect.Constructor;
     
    5455        private static HashMap<String, Method> _Actions = new HashMap<String, Method>();
    5556
     57        // map lower case fonts to capitalized fonts
     58        protected static HashMap<String, String> _Fonts = new HashMap<String, String>();
     59
    5660        // maps lower case JAG class names to capitalized JAG names
    5761        private static HashMap<String, String> _JAGs = new HashMap<String, String>();
     
    179183         */
    180184        public static Collection<String> Init() {
     185
    181186                Collection<String> warnings = new LinkedList<String>();
    182187                Class[] classes;
     
    489494        public static void stopAgent() {
    490495                if (_Agent != null && _Agent.isRunning()) {
    491                         FrameGraphics.DisplayMessage("Stopping Agent...");
     496                        FrameGraphics.ErrorMessage("Stopping Agent...");
    492497                        _Agent.stop();
    493498                }
     
    528533                        objects[0] = source;
    529534                        ind = 1;
    530                 } else if (paramTypes[0] == Item.class) {
     535                } else if (Item.class.isAssignableFrom(paramTypes[0])) {
    531536                        objects[0] = launcher;
    532537                        ind = 1;
     
    539544                                objects[1] = source;
    540545                                ind = 2;
    541                         } else if (paramTypes[1] == Item.class) {
     546                        } else if (Item.class.isAssignableFrom(paramTypes[1])) {
    542547                                objects[1] = launcher;
    543548                                ind = 2;
     
    653658                return command.substring(0, command.indexOf(" "));
    654659        }
     660
     661        /**
     662         * Gets an uncapitalized font name and returns the capitalized font name.
     663         * The capitalized form can be used with the Font.decoded method to get a
     664         * corresponding Font object.
     665         *
     666         * @param fontName
     667         *            a font name in mixed case
     668         * @return the correct capitalized form of the font name
     669         */
     670        public static String getCapitalizedFontName(String fontName) {
     671                //Initialize the fonts if they have not already been loaded
     672                if (_Fonts.size() == 0) {
     673                        String[] availableFonts = GraphicsEnvironment
     674                                        .getLocalGraphicsEnvironment()
     675                                        .getAvailableFontFamilyNames();
     676                        for (String s : availableFonts) {
     677                                _Fonts.put(s.toLowerCase(), s);
     678                        }
     679                }
     680                return _Fonts.get(fontName.toLowerCase());
     681        }
    655682}
Note: See TracChangeset for help on using the changeset viewer.