- Timestamp:
- 07/09/07 00:42:55 (5 years ago)
- Location:
- mymrc/trunk/Java-client/src/org/myMRC
- Files:
-
- 3 modified
-
Util.java (modified) (2 diffs)
-
myMRC.java (modified) (1 diff)
-
settings/ConfigParserException.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mymrc/trunk/Java-client/src/org/myMRC/Util.java
r10 r22 4 4 * 5 5 * Created on April 2, 2007, 11:22 AM 6 *7 * To change this template, choose Tools | Template Manager8 * and open the template in the editor.9 6 */ 10 import java.io.DataInputStream;11 import java.io.IOException;12 import javax.microedition.io.Connector;13 import javax.microedition.io.file.FileConnection;14 import javax.microedition.lcdui.Image;15 //import org.myMRC.settings.Configuration;16 7 17 8 18 9 /** 10 * Helper class for some commonly used util functions. 11 * However, so far there is only a C-style atoi() function here. 19 12 * 20 13 * @author Sven Gregori … … 50 43 return ret; 51 44 } 52 53 54 /**55 * Creates an Image object from the file at the given Path.56 * The path is relative to the configuration path.57 * @param path Path to the image file58 * @return Image object on success, null otherwise59 */60 public static Image createImage(String path) {61 Image img = null;62 String fullPath = "file:///myMRC/" + path; // FIXME: make path dynamic63 // String fullPath = "file://";// + Configuration.getInstance().getPath()64 // //+ "/" + path;65 try {66 FileConnection fcon = (FileConnection) Connector.open(fullPath);67 DataInputStream istream = fcon.openDataInputStream();68 img = Image.createImage(istream);69 istream.close();70 fcon.close();71 } catch (IOException e) {72 e.printStackTrace();73 }74 75 return img;76 }77 78 79 /**80 * Creates an Image object for a Theme from the given image name.81 * The given name must be in <path>/themes/<current theme>/<name>.png82 * @param name Name of the image for the theme.83 * @return Image object on success, null otherwise84 */85 public static Image createThemeImage(String name) {86 //Configuration config = Configuration.getInstance();87 //String path = config.getThemesDir() + "/" + config.getTheme()88 //+ "/" + name + ".png";89 90 return null;//Util.createImage(path);91 }92 45 } -
mymrc/trunk/Java-client/src/org/myMRC/myMRC.java
r20 r22 37 37 } catch (IOException ioe) { 38 38 ioe.printStackTrace(); 39 } catch (ConfigParserException cpe) {39 } catch (ConfigParserException cpe) { 40 40 cpe.printStackTrace(); 41 41 } -
mymrc/trunk/Java-client/src/org/myMRC/settings/ConfigParserException.java
r10 r22 8 8 9 9 /** 10 * Exception that will be thrown in case of configuration file parsing errors. 10 11 * 11 12 * @author Sven Gregori
