Changeset 10013
- Timestamp:
- 2005-06-03T15:50:07+12:00 (19 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/Gatherer.java
r9875 r10013 47 47 import org.greenstone.gatherer.gui.URLField; 48 48 import org.greenstone.gatherer.gui.WarningDialog; 49 import org.greenstone.gatherer.util.JarTools; 49 50 import org.greenstone.gatherer.util.StaticStrings; 50 51 import org.greenstone.gatherer.util.Utility; … … 114 115 this.self = this; 115 116 116 Utility.initImages(this);117 JarTools.initialise(this); 117 118 } 118 119 -
trunk/gli/src/org/greenstone/gatherer/gems/GEMS.java
r10012 r10013 65 65 import org.greenstone.gatherer.gui.NonWhitespaceField; 66 66 import org.greenstone.gatherer.util.Codec; 67 import org.greenstone.gatherer.util.JarTools; 67 68 import org.greenstone.gatherer.util.Utility; 68 69 import org.greenstone.gatherer.util.XMLTools; … … 175 176 //Load configuration file 176 177 this.self = this; 177 Utility.initImages(this);178 JarTools.initialise(this); 178 179 config = new Configuration(gsdl_path, null, null); 179 180 -
trunk/gli/src/org/greenstone/gatherer/gui/HelpFrame.java
r10011 r10013 131 131 132 132 // Try in the JAR/classes directory first 133 URL help_folder_url = Utility.base.getResource("/" + help_folder); // !!133 URL help_folder_url = JarTools.getResource("/" + help_folder); 134 134 if (help_folder_url != null) { 135 135 return help_folder; … … 320 320 321 321 if (name != null && !name.equals(NULL_STRING)) { 322 url = Utility.base.getResource("/" + help_file);322 url = JarTools.getResource("/" + help_file); 323 323 if (url == null) { 324 324 File file = new File(Utility.BASE_DIR + help_file); -
trunk/gli/src/org/greenstone/gatherer/util/JarTools.java
r10012 r10013 30 30 import java.awt.*; 31 31 import java.io.*; 32 import java.net.*; 32 33 import javax.swing.*; 33 34 … … 35 36 public class JarTools 36 37 { 38 static private Class root_class = null; 37 39 static private ImageIcon ERROR_ICON = null; 38 // static public Class base = null;39 40 40 41 41 static public void initialise( )42 static public void initialise(Object root_object) 42 43 { 44 root_class = root_object.getClass(); 43 45 ERROR_ICON = getImage("error.gif"); 44 46 } … … 49 51 try { 50 52 // setup input stream for slurping out file 51 InputStream fis = Utility.base.getResourceAsStream("/"+filename);53 InputStream fis = root_class.getResourceAsStream("/"+filename); 52 54 BufferedInputStream fbis = new BufferedInputStream(fis); 53 55 DataInputStream fdbis = new DataInputStream(fbis); … … 86 88 static public ImageIcon getImage(String filename, boolean wait_until_complete) 87 89 { 88 ImageIcon image = new ImageIcon( Utility.base.getResource("/images/" + filename));90 ImageIcon image = new ImageIcon(root_class.getResource("/images/" + filename)); 89 91 if (image == null) { 90 92 image = ERROR_ICON; … … 103 105 104 106 107 static public URL getResource(String resource_name) 108 { 109 return root_class.getResource(resource_name); 110 } 111 112 113 static public InputStream getResourceAsStream(String resource_name) 114 { 115 return root_class.getResourceAsStream(resource_name); 116 } 117 118 105 119 static public boolean isInJar(String filename) 106 120 { 107 121 try { 108 InputStream fis = Utility.base.getResourceAsStream("/" + filename);122 InputStream fis = root_class.getResourceAsStream("/" + filename); 109 123 fis.close(); 110 124 } -
trunk/gli/src/org/greenstone/gatherer/util/Utility.java
r10012 r10013 123 123 124 124 static protected File gli_user_folder = null; 125 126 /** The default icon to produce a 'help-icon' sized blank space before a menu entry. */127 static public Class base = null;128 125 129 126 … … 847 844 848 845 849 static public void initImages(Object base_object)850 {851 base = base_object.getClass();852 }853 854 855 846 /** Method to determine if the host system is MacOS based. 856 847 * @return a boolean which is true if the platform is MacOS, false otherwise -
trunk/gli/src/org/greenstone/gatherer/util/XMLTools.java
r10006 r10013 103 103 { 104 104 if (use_class_loader == true) { 105 InputStream is = Utility.base.getResourceAsStream("/" + xml_file_path); // !!105 InputStream is = JarTools.getResourceAsStream("/" + xml_file_path); 106 106 if (is != null) { 107 107 return parseXML(is);
Note:
See TracChangeset
for help on using the changeset viewer.