List of usage examples for com.google.gwt.json.client JSONNumber JSONNumber
public JSONNumber(double value)
From source file:com.rednels.ofcgwt.client.model.elements.LineChart.java
License:Open Source License
public JSONValue buildJSON() { JSONObject json = (JSONObject) super.buildJSON(); if (width != null) json.put("width", new JSONNumber(width)); if (text != null) json.put("text", new JSONString(text)); if (colour != null) json.put("colour", new JSONString(colour)); if (this.rightAxis) json.put("axis", new JSONString("right")); if (this.dotStyle != null) json.put("dot-style", dotStyle.buildJSON()); if (this.lineStyle != null) json.put("line-style", lineStyle.buildJSON()); return json;//from w w w .j a v a 2s. c om }
From source file:com.rednels.ofcgwt.client.model.elements.PieChart.java
License:Open Source License
public JSONValue buildJSON() { JSONObject json = (JSONObject) super.buildJSON(); if (startAngle != null) json.put("start-angle", new JSONNumber(startAngle.intValue())); if (radius != null) json.put("radius", new JSONNumber(radius.intValue())); if (gradientFill != null) json.put("gradient-fill", JSONBoolean.getInstance(gradientFill)); if (alpha != null) json.put("alpha", new JSONNumber(alpha)); if (nolabels != null) json.put("no-labels", JSONBoolean.getInstance(nolabels)); if (labelColour != null) json.put("label-colour", new JSONString(labelColour)); if (border != null) json.put("border", new JSONNumber(border.doubleValue())); JSONArray ary = new JSONArray(); int index = 0; if (animate != null) ary.set(index++, animate.buildJSON()); if (index != 0) json.put("animate", ary); return json;/*w w w. ja va2 s .c o m*/ }
From source file:com.rednels.ofcgwt.client.model.elements.ScatterChart.java
License:Open Source License
public JSONValue buildJSON() { JSONObject json = (JSONObject) super.buildJSON(); if (dotSize != null) json.put("dot-size", new JSONNumber(dotSize.doubleValue())); if (this.dotStyle != null) json.put("dot-style", dotStyle.buildJSON()); if (colour != null) json.put("colour", new JSONString(colour)); return json;// w w w.j a v a 2s . c om }
From source file:com.rednels.ofcgwt.client.model.elements.Shape.java
License:Open Source License
public JSONValue buildJSON() { JSONObject json = (JSONObject) super.buildJSON(); if (alpha != null) json.put("alpha", new JSONNumber(alpha)); if (colour != null) json.put("colour", new JSONString(colour)); return json;/*from w w w . j a v a 2 s. co m*/ }
From source file:com.rednels.ofcgwt.client.model.elements.SketchBarChart.java
License:Open Source License
public JSONValue buildJSON() { JSONObject json = (JSONObject) super.buildJSON(); if (offset != null) json.put("offset", new JSONNumber(offset.doubleValue())); return json;// w w w .j a v a 2 s .c o m }
From source file:com.rednels.ofcgwt.client.model.Legend.java
License:Open Source License
public JSONValue buildJSON() { JSONObject json = new JSONObject(); json.put("visible", JSONBoolean.getInstance(true)); json.put("bg_colour", new JSONString("#fefefe")); if (position != null) json.put("position", new JSONString(position.getString())); json.put("border", JSONBoolean.getInstance(border)); json.put("shadow", JSONBoolean.getInstance(shadow)); if (alpha != null) json.put("alpha", new JSONNumber(alpha)); if (stroke != null) json.put("stroke", new JSONNumber(stroke)); if (margin != null) json.put("margin", new JSONNumber(margin)); if (padding != null) json.put("padding", new JSONNumber(padding)); if (borderColour != null) json.put("border_colour", new JSONString(borderColour)); if (bgColour != null) json.put("bg_colour", new JSONString(bgColour)); return json;/*from w w w .j a v a2s . c om*/ }
From source file:com.rednels.ofcgwt.client.model.ToolTip.java
License:Open Source License
public JSONValue buildJSON() { JSONObject json = new JSONObject(); if (titlestyle != null) json.put("title", new JSONString(titlestyle)); if (bodystyle != null) json.put("body", new JSONString(bodystyle)); if (colour != null) json.put("colour", new JSONString(colour)); if (backgroundcolour != null) json.put("background", new JSONString(backgroundcolour)); if (mouse != null) json.put("mouse", new JSONNumber(mouse.getStyle())); if (stroke != null) json.put("stroke", new JSONNumber(stroke)); if (shadow != null) json.put("shadow", JSONBoolean.getInstance(shadow)); return json;/*from w ww. j a va 2s .c o m*/ }
From source file:com.rhizospherejs.gwt.showcase.client.orgchart.OrgChartTab.java
License:Open Source License
@UiHandler("salaryFilter") void applySalaryFilter(ClickEvent event) { JSONObject salaryRange = new JSONObject(); salaryRange.put("min", new JSONNumber(50000)); salaryRange.put("max", new JSONNumber(250000)); rhizosphere.doFilter("salary", salaryRange, logCallback); }
From source file:com.rhizospherejs.gwt.showcase.client.orgchart.OrgChartTab.java
License:Open Source License
@UiHandler("salaryGenderFilter") void applySalaryAgeFilter(ClickEvent event) { Map<String, JSONValue> filters = new HashMap<String, JSONValue>(); JSONObject salaryRange = new JSONObject(); salaryRange.put("min", new JSONNumber(50000)); salaryRange.put("max", new JSONNumber(250000)); filters.put("salary", salaryRange); JSONBoolean gender = JSONBoolean.getInstance(true); filters.put("male", gender); rhizosphere.doFilter(filters, logCallback); }
From source file:com.stoyanr.todo.client.presenter.JsonSerializer.java
License:Open Source License
public JSONObject toJson(Item item) { JSONObject result = new JSONObject(); result.put(KEY, new JSONString(toNullableValue(item.getKey()))); result.put(ID, new JSONNumber(item.getId())); result.put(TEXT, new JSONString(item.getText())); result.put(PRIORITY, new JSONString(item.getPriority().toString())); result.put(STATUS, new JSONString(item.getStatus().toString())); result.put(CREATED, new JSONNumber(item.getCreated().getTime())); result.put(UPDATED, new JSONNumber(item.getUpdated().getTime())); return result; }