}
}
}
}
RefreshAttributes refreshAttributes = ((TickerTapeAttributes) attributes)
.getRefreshAttributes();
// Read ticker-tape properties out of style attributes.
StylesExtractor styles = createStylesExtractor(protocol, attributes.getStyles());
// Prepare Javascript content.
StringWriter scriptWriter = new StringWriter();
scriptWriter.write(createJavaScriptWidgetRegistrationOpening(attributes.getId()));
addCreatedWidgetId(attributes.getId());
scriptWriter.write("new Widget.TickerTape(" + createJavaScriptString(attributes.getId()) + ", {");
// Render scroll type: scroll, slide or alternating.
scriptWriter.write("style:" + createJavaScriptString(styles.getMarqueeStyle()) + ",");
scriptWriter.write("focusable:" + createJavaScriptString(styles.getFocusStyle()) + ",");
// Render scroll attributes: direction, FPS & CPS.
scriptWriter.write("scroll:{");
scriptWriter.write("direction:" + createJavaScriptString(styles.getMarqueeDirection()) + ",");
scriptWriter.write("framesPerSecond:" + styles.getFrameRate() + ",");
scriptWriter.write("charsPerSecond:" + styles.getMarqueeSpeed());
scriptWriter.write("}");
// Render refresh attributes: URL & interval.
if (refreshAttributes != null) {
scriptWriter.write(",refresh:{");
scriptWriter.write("url:" + createJavaScriptString(refreshAttributes.getSrc()) + ",");
scriptWriter.write("interval:" + createJavaScriptString(refreshAttributes.getInterval()));
scriptWriter.write("}");
}
int repetitions = styles.getMarqueeRepetitions();
scriptWriter.write(",repetitions:" + ((repetitions != Integer.MAX_VALUE) ?