/** * Write the options of cartesian category axes * * @return options as JSON object * @throws java.io.IOException If an I/O error occurs */ @Override public String encode() throws IOException { FastStringWriter fsw = new FastStringWriter(); try { fsw.write(super.encode()); if (this.type != null) { fsw.write(",\"type\":\"" + this.type + "\""); } if (this.ticks != null) { fsw.write(",\"ticks\":{"); fsw.write(this.ticks.encode()); fsw.write("}"); } } finally { fsw.close(); } return fsw.toString(); } }
/** * Write the arc options of Elements * * @return options as JSON object * @throws java.io.IOException If an I/O error occurs */ public String encode() throws IOException { FastStringWriter fsw = new FastStringWriter(); try { ChartUtils.writeDataValue(fsw, "borderWidth", this.borderWidth, false); ChartUtils.writeDataValue(fsw, "backgroundColor", this.backgroundColor, true); ChartUtils.writeDataValue(fsw, "borderColor", this.borderColor, true); } finally { fsw.close(); } return fsw.toString(); } }
fsw.write("{\"start\":" + encodeDate(browserTZ, targetTZ, event.getStartDate())); fsw.write(",\"end\":" + encodeDate(browserTZ, targetTZ, event.getEndDate())); fsw.write(",\"end\":null"); fsw.write(",\"editable\":" + event.isEditable()); fsw.write(",\"editable\":null"); fsw.write(",\"group\":\"" + groupContent + "\""); groupsContent.put(foundGroup.getId(), prefix + EscapeUtils.forJavaScript(fswHtml.toString())); fsw.write(",\"group\":\"" + groupsContent.get(foundGroup.getId()) + "\""); fswHtml.reset(); fsw.write(",\"group\":\"" + prefix + foundGroup.getData().toString() + "\""); fsw.write(",\"group\":null"); fsw.write(",\"group\":\"" + event.getGroup() + "\""); fsw.write(",\"group\":null"); fsw.write(",\"className\":\"" + event.getStyleClass() + "\""); fsw.write(",\"className\":null"); fsw.write(",\"content\":\"");
final FastStringWriter fsw = new FastStringWriter(); final ResponseWriter clonedWriter = writer.cloneWithWriter(fsw); fc.setResponseWriter(clonedWriter); menuItem.setValue(StringEscapeUtils.unescapeHtml4(fsw.toString()));
TimeZone browserTZ = ComponentUtils.resolveTimeZone(timeline.getBrowserTimeZone()); try (FastStringWriter fsw = new FastStringWriter(); FastStringWriter fswHtml = new FastStringWriter()) {
/** * Write the rectangle options of Elements * * @return options as JSON object * @throws java.io.IOException If an I/O error occurs */ public String encode() throws IOException { FastStringWriter fsw = new FastStringWriter(); try { ChartUtils.writeDataValue(fsw, "borderSkipped", this.borderSkipped, false); ChartUtils.writeDataValue(fsw, "backgroundColor", this.backgroundColor, true); ChartUtils.writeDataValue(fsw, "borderWidth", this.borderWidth, true); ChartUtils.writeDataValue(fsw, "borderColor", this.borderColor, true); } finally { fsw.close(); } return fsw.toString(); } }
fsw.write("{\"start\":" + encodeDate(browserTZ, targetTZ, event.getStartDate())); fsw.write(",\"end\":" + encodeDate(browserTZ, targetTZ, event.getEndDate())); fsw.write(",\"end\":null"); fsw.write(",\"editable\":" + event.isEditable()); fsw.write(",\"editable\":null"); fsw.write(",\"group\":\"" + groupContent + "\""); groupsContent.put(foundGroup.getId(), prefix + escapeText(fswHtml.toString())); fsw.write(",\"group\":\"" + groupsContent.get(foundGroup.getId()) + "\""); fswHtml.reset(); fsw.write(",\"group\":\"" + prefix + foundGroup.getData().toString() + "\""); fsw.write(",\"group\":null"); fsw.write(",\"group\":\"" + event.getGroup() + "\""); fsw.write(",\"group\":null"); fsw.write(",\"className\":\"" + event.getStyleClass() + "\""); fsw.write(",\"className\":null"); fsw.write(",\"content\":\"");
String text = null; if (tooltip.getChildCount() > 0) { final FastStringWriter fsw = new FastStringWriter(); final ResponseWriter clonedWriter = writer.cloneWithWriter(fsw); context.setResponseWriter(clonedWriter); renderChildren(context, tooltip); context.setResponseWriter(writer); text = fsw.toString();
TimeZone browserTZ = ComponentUtils.resolveTimeZone(timeline.getBrowserTimeZone()); FastStringWriter fsw = new FastStringWriter(); FastStringWriter fswHtml = new FastStringWriter();
/** * Write the common ticks options of axes * * @return options as JSON object * @throws java.io.IOException If an I/O error occurs */ public String encode() throws IOException { FastStringWriter fsw = new FastStringWriter(); try { ChartUtils.writeDataValue(fsw, "display", this.display, false); ChartUtils.writeDataValue(fsw, "fontColor", this.fontColor, true); ChartUtils.writeDataValue(fsw, "fontFamily", this.fontFamily, true); ChartUtils.writeDataValue(fsw, "fontSize", this.fontSize, true); ChartUtils.writeDataValue(fsw, "fontStyle", this.fontStyle, true); ChartUtils.writeDataValue(fsw, "reverse", this.reverse, true); } finally { fsw.close(); } return fsw.toString(); } }
FastStringWriter fsw = new FastStringWriter(); FastStringWriter fswHtml = new FastStringWriter();
/** * Write the options of angled lines on radial linear type * * @return options as JSON object * @throws java.io.IOException If an I/O error occurs */ public String encode() throws IOException { FastStringWriter fsw = new FastStringWriter(); try { fsw.write("{"); ChartUtils.writeDataValue(fsw, "display", this.display, false); ChartUtils.writeDataValue(fsw, "color", this.color, true); ChartUtils.writeDataValue(fsw, "lineWidth", this.lineWidth, true); fsw.write("}"); } finally { fsw.close(); } return fsw.toString(); } }
/** * Write the common ticks options * * @return options as JSON object * @throws java.io.IOException If an I/O error occurs */ public String encode() throws IOException { FastStringWriter fsw = new FastStringWriter(); try { ChartUtils.writeDataValue(fsw, "autoSkip", this.autoSkip, false); ChartUtils.writeDataValue(fsw, "autoSkipPadding", this.autoSkipPadding, true); ChartUtils.writeDataValue(fsw, "labelOffset", this.labelOffset, true); ChartUtils.writeDataValue(fsw, "maxRotation", this.maxRotation, true); ChartUtils.writeDataValue(fsw, "minRotation", this.minRotation, true); ChartUtils.writeDataValue(fsw, "mirror", this.mirror, true); ChartUtils.writeDataValue(fsw, "padding", this.padding, true); } finally { fsw.close(); } return fsw.toString(); } }
TimeZone browserTZ = ComponentUtils.resolveTimeZone(timeline.getBrowserTimeZone()); FastStringWriter fsw = new FastStringWriter(); FastStringWriter fswHtml = new FastStringWriter();
FastStringWriter fsw = new FastStringWriter(); boolean hasComma = false; String preString; fsw.write("\"point\":{"); fsw.write(this.point.encode()); fsw.write("}"); fsw.write(preString + "\"line\":{"); fsw.write(this.line.encode()); fsw.write("}"); fsw.write(preString + "\"rectangle\":{"); fsw.write(this.rectangle.encode()); fsw.write("}"); fsw.write(preString + "\"arc\":{"); fsw.write(this.arc.encode()); fsw.write("}"); fsw.close(); return fsw.toString();
/** * Write the point options of Elements * * @return options as JSON object * @throws java.io.IOException If an I/O error occurs */ public String encode() throws IOException { FastStringWriter fsw = new FastStringWriter(); try { ChartUtils.writeDataValue(fsw, "radius", this.radius, false); ChartUtils.writeDataValue(fsw, "pointStyle", this.pointStyle, true); ChartUtils.writeDataValue(fsw, "backgroundColor", this.backgroundColor, true); ChartUtils.writeDataValue(fsw, "borderWidth", this.borderWidth, true); ChartUtils.writeDataValue(fsw, "borderColor", this.borderColor, true); ChartUtils.writeDataValue(fsw, "hitRadius", this.hitRadius, true); ChartUtils.writeDataValue(fsw, "hoverRadius", this.hoverRadius, true); ChartUtils.writeDataValue(fsw, "hoverBorderWidth", this.hoverBorderWidth, true); } finally { fsw.close(); } return fsw.toString(); } }
/** * Write the options of point labels on radial linear type * * @return options as JSON object * @throws java.io.IOException If an I/O error occurs */ public String encode() throws IOException { FastStringWriter fsw = new FastStringWriter(); try { fsw.write("{"); ChartUtils.writeDataValue(fsw, "fontSize", this.fontSize, false); ChartUtils.writeDataValue(fsw, "fontColor", this.fontColor, true); ChartUtils.writeDataValue(fsw, "fontFamily", this.fontFamily, true); ChartUtils.writeDataValue(fsw, "fontStyle", this.fontStyle, true); fsw.write("}"); } finally { fsw.close(); } return fsw.toString(); } }
/** * Write the options of Title * * @return options as JSON object * @throws java.io.IOException If an I/O error occurs */ public String encode() throws IOException { FastStringWriter fsw = new FastStringWriter(); try { ChartUtils.writeDataValue(fsw, "display", this.display, false); ChartUtils.writeDataValue(fsw, "position", this.position, true); ChartUtils.writeDataValue(fsw, "fontSize", this.fontSize, true); ChartUtils.writeDataValue(fsw, "fontFamily", this.fontFamily, true); ChartUtils.writeDataValue(fsw, "fontColor", this.fontColor, true); ChartUtils.writeDataValue(fsw, "fontStyle", this.fontStyle, true); ChartUtils.writeDataValue(fsw, "padding", this.padding, true); ChartUtils.writeDataValue(fsw, "lineHeight", this.lineHeight, true); ChartUtils.writeDataValue(fsw, "text", this.text, true); } finally { fsw.close(); } return fsw.toString(); } }
/** * Write the options of cartesian category ticks * * @return options as JSON object * @throws java.io.IOException If an I/O error occurs */ @Override public String encode() throws IOException { FastStringWriter fsw = new FastStringWriter(); try { fsw.write(super.encode()); ChartUtils.writeDataValue(fsw, "labels", this.labels, true); ChartUtils.writeDataValue(fsw, "min", this.min, true); ChartUtils.writeDataValue(fsw, "max", this.max, true); } finally { fsw.close(); } return fsw.toString(); } }