}
/** adds a theme mapping, retemplatizing as needed */
- public static void retheme(String from, String to) {
- if (Log.on) Log.log(Template.class, "retheming from " + from + " to " + to);
+ public static void retheme(Function callback) {
XWF.flushXWFs();
- Resources.mapFrom.addElement(from);
- Resources.mapTo.addElement(to);
// clear changed marker and relink
Template[] t = new Template[cache.size()];
Box b = ((Surface)Surface.allSurfaces.elementAt(i)).root;
if (b != null) reapply(b);
}
+
+ if (callback != null)
+ try {
+ callback.call(Context.enter(), null, null, new Object[] { new Double(1.0), new Double(1.0) });
+ } catch (EcmaError ex) {
+ if (Log.on) Log.log(Template.class, "WARNING: uncaught interpreter exception: " + ex.getMessage());
+ if (Log.on) Log.log(Template.class, " thrown from within progress callback at " + ex.getSourceName() + ":" + ex.getLineNumber());
+ } catch (JavaScriptException ex) {
+ if (Log.on) Log.log(Template.class, "WARNING: uncaught ecmascript exception: " + ex.getMessage());
+ if (Log.on) Log.log(Template.class, " thrown from within progress callback at " + ex.sourceFile + ":" + ex.line);
+ }
}
/** template reapplication procedure */