Changeset 108 for trunk/src/org/expeditee/actions/Actions.java
- Timestamp:
- 06/27/08 16:44:21 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/actions/Actions.java
r103 r108 1 1 package org.expeditee.actions; 2 2 3 import java.awt.GraphicsEnvironment; 3 4 import java.io.File; 4 5 import java.lang.reflect.Constructor; … … 54 55 private static HashMap<String, Method> _Actions = new HashMap<String, Method>(); 55 56 57 // map lower case fonts to capitalized fonts 58 protected static HashMap<String, String> _Fonts = new HashMap<String, String>(); 59 56 60 // maps lower case JAG class names to capitalized JAG names 57 61 private static HashMap<String, String> _JAGs = new HashMap<String, String>(); … … 179 183 */ 180 184 public static Collection<String> Init() { 185 181 186 Collection<String> warnings = new LinkedList<String>(); 182 187 Class[] classes; … … 489 494 public static void stopAgent() { 490 495 if (_Agent != null && _Agent.isRunning()) { 491 FrameGraphics. DisplayMessage("Stopping Agent...");496 FrameGraphics.ErrorMessage("Stopping Agent..."); 492 497 _Agent.stop(); 493 498 } … … 528 533 objects[0] = source; 529 534 ind = 1; 530 } else if ( paramTypes[0] == Item.class) {535 } else if (Item.class.isAssignableFrom(paramTypes[0])) { 531 536 objects[0] = launcher; 532 537 ind = 1; … … 539 544 objects[1] = source; 540 545 ind = 2; 541 } else if ( paramTypes[1] == Item.class) {546 } else if (Item.class.isAssignableFrom(paramTypes[1])) { 542 547 objects[1] = launcher; 543 548 ind = 2; … … 653 658 return command.substring(0, command.indexOf(" ")); 654 659 } 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 } 655 682 }
Note:
See TracChangeset
for help on using the changeset viewer.