From: Mark G. <mg...@us...> - 2004-04-22 17:20:16
|
Update of /cvsroot/gmod/apollo/src/java/apollo/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6205/src/java/apollo/config Modified Files: Style.java Log Message: Fixed bug where links were not showing up in synteny. The problem was synteny-game.style was importing game.style and getting its tiers and property scheme, it would override the tiers file but not the property scheme. Previously import of styles would not prompt property scheme creation - but now NameAdapterInstall has a getPropertyScheme in it which causes PropertyScheme creation causing the problem. So now style overrides property schemes when it gets new tiers file (eg from synteny-game.style) after importing game.style, as it should. Index: Style.java =================================================================== RCS file: /cvsroot/gmod/apollo/src/java/apollo/config/Style.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Style.java 19 Apr 2004 23:22:01 -0000 1.8 --- Style.java 22 Apr 2004 17:20:07 -0000 1.9 *************** *** 191,200 **** String value = (String)lineWords.get(1); if (key.equals("Types")) { ! tiersFile = new String(value); ! tiersFile = apollo.util.IOUtil.findFile(tiersFile); ! if (tiersFile == null) { complain("Types file " + value + " not found"); return; // Give up now? } } else if (key.equals("BlixemLocation")) { blixemLocation = new String(value); --- 191,207 ---- String value = (String)lineWords.get(1); if (key.equals("Types")) { ! String newTiersFile = new String(value); ! newTiersFile = apollo.util.IOUtil.findFile(newTiersFile); ! if (newTiersFile == null) { complain("Types file " + value + " not found"); return; // Give up now? } + else { + // If we have imported a style with a different tiers override it + if (tiersFile == null || !newTiersFile.equals(tiersFile)) { + setPropertyScheme(newTiersFile); + } + tiersFile = newTiersFile; + } } else if (key.equals("BlixemLocation")) { blixemLocation = new String(value); *************** *** 1177,1192 **** public PropertyScheme getPropertyScheme() { if (properties == null) { ! try { ! properties = new PropertyScheme(getTiersFile()); ! } ! catch (Exception e) { ! String msg = ("Failed to parse tiers file " + tiersFile); ! JOptionPane.showMessageDialog(null,msg,"Warning", ! JOptionPane.WARNING_MESSAGE); ! } } return properties; } /** This overlaps with Config.createStyle, but i dont see a good way to generalize/combine the 2 --- 1184,1204 ---- public PropertyScheme getPropertyScheme() { if (properties == null) { ! setPropertyScheme(getTiersFile()); } return properties; } + /** Makes new PropertyScheme from tiers file, sets properties */ + private void setPropertyScheme(String tiersFile) { + try { + properties = new PropertyScheme(tiersFile); + } + catch (Exception e) { + String msg = ("Failed to parse tiers file " + tiersFile); + JOptionPane.showMessageDialog(null,msg,"Warning", + JOptionPane.WARNING_MESSAGE); + } + } + /** This overlaps with Config.createStyle, but i dont see a good way to generalize/combine the 2 |