Changeset 996 for trunk/src/org/expeditee
- Timestamp:
- 02/05/16 09:31:23 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/actions/Misc.java
r978 r996 30 30 import java.io.InputStreamReader; 31 31 import java.lang.reflect.Method; 32 import java.net.URI; 33 import java.net.URISyntaxException; 32 34 import java.net.URL; 33 35 import java.net.URLClassLoader; … … 36 38 import java.util.LinkedList; 37 39 import java.util.List; 40 import java.util.Map; 41 import java.util.Map.Entry; 42 import java.util.Set; 38 43 import java.util.jar.Attributes; 39 44 import java.util.jar.JarFile; … … 75 80 import org.nfunk.jep.ParseException; 76 81 82 import com.lowagie.text.Font; 83 77 84 78 85 … … 138 145 } 139 146 147 public static void openURL(Item item){ 148 149 if(item.getData() != null && item.getData().size() > 0){ 150 151 String url = item.getData().get(0); 152 openURL(url); 153 } 154 155 //openURL("http://www.google.com"); 156 } 157 /** 158 * Treats a string as a URL and attempts to open it 159 */ 160 public static void openURL(String siteURL){ 161 162 try { 163 URL check = new URL(siteURL); 164 Desktop.getDesktop().browse(new URI(siteURL)); 165 166 } catch (IOException| URISyntaxException e) { 167 168 MessageBay.displayMessage("'" + siteURL + "' is not a valid URL"); 169 } 170 } 171 /** 172 * Backs up the current frame as a default and saves it to the file 173 */ 174 public static void setRestorePoint() 175 { 176 Frame current = DisplayIO.getCurrentFrame(); 177 current.change(); 178 FrameIO.SaveFrameAsRestore(current, true, true); 179 } 140 180 /** 141 181 * Forces a repaint of the current Frame … … 437 477 fontsList.deleteCharAt(fontsList.length() - 1); 438 478 479 return fontsList.toString(); 480 } 481 /** 482 * Creates a new Text Object containing the available fonts already loaded into Expeditee. 483 */ 484 public static String getExpediteeFontNames(){ 485 486 StringBuilder fontsList = new StringBuilder(); 487 488 for (String s: Text.FONT_WHEEL){ 489 490 fontsList.append(s).append(Text.LINE_SEPARATOR); 491 } 492 493 for (Entry<String, java.awt.Font> entry: Text.FONT_WHEEL_ADDITIONAL_LOOKUP.entrySet()){ 494 495 String fontName = entry.getKey(); 496 fontsList.append(fontName).append(Text.LINE_SEPARATOR); 497 } 498 //add the default soon too 499 fontsList.deleteCharAt(fontsList.length() - 1); 439 500 return fontsList.toString(); 440 501 }
Note:
See TracChangeset
for help on using the changeset viewer.