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.AreaChart.java
License:Open Source License
public JSONValue buildJSON() { JSONObject json = (JSONObject) super.buildJSON(); if (fillAlpha != null) json.put("fill-alpha", new JSONNumber(fillAlpha)); if (fillColour != null) json.put("fill", new JSONString(fillColour)); if (loop != null) json.put("loop", JSONBoolean.getInstance(loop)); return json;//from ww w . j a v a2 s . co m }
From source file:com.rednels.ofcgwt.client.model.elements.BarChart.java
License:Open Source License
public JSONValue buildJSON() { JSONObject json = (JSONObject) super.buildJSON(); if (barwidth != null) json.put("barwidth", new JSONNumber(barwidth.doubleValue())); if (colour != null) json.put("colour", new JSONString(colour)); return json;/*from ww w .j av a2 s . c o m*/ }
From source file:com.rednels.ofcgwt.client.model.elements.CylinderBarChart.java
License:Open Source License
public JSONValue buildJSON() { JSONObject json = (JSONObject) super.buildJSON(); if (alpha != null) json.put("alpha", new JSONNumber(alpha)); if (outlineColour != null) json.put("outline-colour", new JSONString(outlineColour)); return json;/* ww w . ja v a 2 s .c om*/ }
From source file:com.rednels.ofcgwt.client.model.elements.dot.Anchor.java
License:Open Source License
public JSONValue buildJSON() { JSONObject json = (JSONObject) super.buildJSON(); if (rotation != null) json.put("rotation", new JSONNumber(rotation.intValue())); if (sides != null) json.put("sides", new JSONNumber(sides.intValue())); return json;// www.j a va 2 s . co m }
From source file:com.rednels.ofcgwt.client.model.elements.dot.BaseDot.java
License:Open Source License
public JSONValue buildJSON() { JSONObject json = new JSONObject(); if (haloSize != null) json.put("halo-size", new JSONNumber(haloSize.doubleValue())); if (size != null) json.put("dot-size", new JSONNumber(size.doubleValue())); if (value != null) json.put("value", new JSONNumber(value.doubleValue())); if (colour != null) json.put("colour", new JSONString(colour)); if (type != null) json.put("type", new JSONString(type)); if (tooltip != null) json.put("tip", new JSONString(tooltip)); if (x != null) json.put("x", new JSONNumber(x.doubleValue())); if (y != null) json.put("y", new JSONNumber(y.doubleValue())); if (onClick != null) json.put("on-click", new JSONString(onClick)); return json;/*from ww w.j a va 2 s.co m*/ }
From source file:com.rednels.ofcgwt.client.model.elements.dot.Bow.java
License:Open Source License
public JSONValue buildJSON() { JSONObject json = (JSONObject) super.buildJSON(); if (rotation != null) json.put("rotation", new JSONNumber(rotation.intValue())); return json;//from w ww .java 2 s . c o m }
From source file:com.rednels.ofcgwt.client.model.elements.dot.Star.java
License:Open Source License
public JSONValue buildJSON() { JSONObject json = (JSONObject) super.buildJSON(); if (rotation != null) json.put("rotation", new JSONNumber(rotation.intValue())); if (hollow != null) json.put("hollow", JSONBoolean.getInstance(hollow)); return json;/* ww w . j a v a2 s.co m*/ }
From source file:com.rednels.ofcgwt.client.model.elements.Element.java
License:Open Source License
public JSONValue buildJSON() { JSONObject json = new JSONObject(); if (type != null) json.put("type", new JSONString(type)); if (text != null) json.put("text", new JSONString(text)); if (fontSize != null) json.put("font-size", new JSONNumber(fontSize)); if (tooltip != null) json.put("tip", new JSONString(tooltip)); if (onClick != null) json.put("on-click", new JSONString(onClick)); if (keyOnClick != null) json.put("key-on-click", new JSONString(keyOnClick)); JSONArray ary = new JSONArray(); int index = 0; for (String s : colours) { ary.set(index++, new JSONString(s)); }//from w w w. jav a 2 s. co m if (index != 0) json.put("colours", ary); ary = new JSONArray(); index = 0; for (Keys k : keys) { ary.set(index++, k.buildJSON()); } if (index != 0) json.put("keys", ary); ary = new JSONArray(); index = 0; for (Object o : values) { if (o == null) ary.set(index++, null); if (o instanceof Number) ary.set(index++, new JSONNumber(((Number) o).doubleValue())); if (o instanceof String) ary.set(index++, new JSONString((String) o)); if (o instanceof JSONizable) ary.set(index++, ((JSONizable) o).buildJSON()); } if (index != 0) json.put("values", ary); json.put("on-show", onShowType); return json; }
From source file:com.rednels.ofcgwt.client.model.elements.HorizontalBarChart.java
License:Open Source License
public JSONValue buildJSON() { JSONObject json = (JSONObject) super.buildJSON(); if (colour != null) json.put("colour", new JSONString(colour)); if (barwidth != null) json.put("barwidth", new JSONNumber(barwidth.doubleValue())); if (barwidth != null) json.put("barwidth", new JSONNumber(barwidth.doubleValue())); return json;//from w w w . j a v a2s . c om }
From source file:com.rednels.ofcgwt.client.model.elements.HorizontalStackedBarChart.java
License:Open Source License
public JSONValue buildJSON() { JSONObject json = (JSONObject) super.buildJSON(); if (barwidth != null) json.put("barwidth", new JSONNumber(barwidth.doubleValue())); return json;//from ww w .j a v a2s . c om }