- Box redir = null;
- if (redirect != null && !"self".equals(redirect))
- redir = (Box)b.getPrivately("$" + redirect, nodeName);
-
- if (script != null) try {
- Context cx = Context.enter();
- script.exec(cx, b);
- } catch (EcmaError e) {
- if (Log.on) Log.log(this, "WARNING: uncaught interpreter exception: " + e.getMessage());
- if (Log.on) Log.log(this, " thrown while instantiating " + nodeName + " at " + e.getSourceName() + ":" + e.getLineNumber());
- } catch (JavaScriptException e) {
- if (Log.on) Log.log(this, "WARNING: uncaught ecmascript exception: " + e.getMessage());
- if (Log.on) Log.log(this, " thrown while instantiating " + nodeName + " at " + e.sourceFile + ":" + e.line);
- }
-
- for(int i=0; keys != null && i<keys.length; i++) {
- Context.enter().interpreterSourceFile = nodeName;
- Context.enter().interpreterLine = startLine;
- if (keys[i] == null) { }
- else if (keys[i].equals("border") || keys[i].equals("image") &&
- !vals[i].toString().startsWith("http://") && !vals[i].toString().startsWith("https://")) {
- String s = Resources.resolve(vals[i].toString() + ".png", importlist);
- if (s != null) b.put(keys[i], null, s.substring(0, s.length() - 4));
- else if (Log.on) Log.log(this, "unable to resolve image " + vals[i].toString() + " referenced in attributes of " + nodeName);
- }
- else b.put(keys[i], null, vals[i]);
- }
-
- if (redirect != null && !"self".equals(redirect)) b.redirect = redir;
-
- for(int i=0; _postapply != null && i<_postapply.length; i++)
- if (_postapply[i] != null) {
- _postapply[i].apply(b, null, null, callback, numerator, denominator);
- numerator += _postapply[i].numUnits();
- }
-
- pboxes.setSize(numids);
- ptemplates.setSize(numids);
-
- numerator = original_numerator + numUnits();
-
- if (callback != null)
- try {
- callback.call(Context.enter(), null, null, new Object[] { new Double(numerator), new Double(denominator) });
- } catch (EcmaError e) {
- if (Log.on) Log.log(this, "WARNING: uncaught interpreter exception: " + e.getMessage());
- if (Log.on) Log.log(this, " thrown from within progress callback at " + e.getSourceName() + ":" + e.getLineNumber());
- } catch (JavaScriptException e) {
- if (Log.on) Log.log(this, "WARNING: uncaught ecmascript exception: " + e.getMessage());
- if (Log.on) Log.log(this, " thrown from within progress callback at " + e.sourceFile + ":" + e.line);
- }