fix for mac keywords bug

This commit is contained in:
benfry
2003-09-24 13:52:10 +00:00
parent 01ac6b3c4c
commit 470a180630

View File

@@ -294,14 +294,26 @@ public class PdeBase extends Frame
final String KEYWORDS = "pde_keywords.properties";
keywords = new Properties();
try {
// this probably won't work on macos9
// seems to work on macosx java 1.4, though i don't think
// it worked on java 1.3 for macosx (see implementation above)
keywords.load(getClass().getResource(KEYWORDS).openStream());
if ((PdeBase.platform == PdeBase.MACOSX) ||
(PdeBase.platform == PdeBase.MACOS9)) {
// macos doesn't seem to think that files in the lib folder
// are part of the resources, unlike windows or linux.
// actually, this is only the case when running as a .app,
// since it works fine from run.sh, but not Processing.app
keywords.load(new FileInputStream("lib/" + KEYWORDS));
} else { // other, more reasonable operating systems
keywords.load(getClass().getResource(KEYWORDS).openStream());
}
} catch (Exception e) {
System.err.println("Error loading keywords, " +
"reference lookup will be unavailable");
String message =
"An error occurred while loading the keywords,\n" +
"\"Find in reference\" will not be available.";
JOptionPane.showMessageDialog(this, message,
"Problem loading keywords",
JOptionPane.WARNING_MESSAGE);
System.err.println(e.toString());
e.printStackTrace();
}
@@ -1005,7 +1017,6 @@ public class PdeBase extends Frame
}
}
// interfaces for MRJ Handlers, but naming is fine
// so used internally for everything else