public final MetaDataArray set(int index, MetaData value) { m_jso.set(index, value.getJSO()); return this; }
public final MetaDataArray push(MetaData value) { m_jso.push(value.getJSO()); return this; }
public final MetaData put(String name, MetaData value) { if (null != value) { m_jso.put(name, value.getJSO()); } else { m_jso.delete(name); } return this; }
@Override public JSONObject toJSONObject() { JSONObject object = new JSONObject(); object.put("type", new JSONString(getType())); if (false == getMetaData().isEmpty()) { object.put("meta", new JSONObject(getMetaData().getJSO())); } object.put("attributes", new JSONObject(getAttributes().getJSO())); return object; }
@Override public JSONObject toJSONObject() { JSONObject object = new JSONObject(); object.put("type", new JSONString(getNodeType().getValue())); if (!getMetaData().isEmpty()) { object.put("meta", new JSONObject(getMetaData().getJSO())); } object.put("attributes", new JSONObject(getAttributes().getJSO())); return object; }
@Override public JSONObject toJSONObject() { JSONObject object = new JSONObject(); object.put("type", new JSONString(getNodeType().getValue())); if (false == getMetaData().isEmpty()) { object.put("meta", new JSONObject(getMetaData().getJSO())); } object.put("attributes", new JSONObject(getAttributes().getJSO())); return object; }
/** * Serializes this shape as a {@link JSONObject} * * @return JSONObject */ @Override public JSONObject toJSONObject() { final JSONObject object = new JSONObject(); object.put("type", new JSONString(getShapeType().getValue())); if (false == getMetaData().isEmpty()) { object.put("meta", new JSONObject(getMetaData().getJSO())); } object.put("attributes", new JSONObject(getAttributes().getJSO())); return object; }
@Override public JSONObject toJSONObject() { JSONObject attr = new JSONObject(getAttributes().getJSO()); ImageSerializationMode mode = getSerializationMode(); if (mode == ImageSerializationMode.DATA_URL) { String url = getURL(); if (false == url.startsWith("data:")) { ScratchCanvas temp = new ScratchCanvas(m_sprite.getWidth(), m_sprite.getHeight()); temp.getContext().drawImage(m_sprite, 0, 0); attr.put("url", new JSONString(temp.toDataURL(DataURLType.PNG))); } } JSONObject object = new JSONObject(); object.put("type", new JSONString(getShapeType().getValue())); if (false == getMetaData().isEmpty()) { object.put("meta", new JSONObject(getMetaData().getJSO())); } object.put("attributes", attr); return object; }
/** * Returns a {@link JSONObject} representation of the {@link Viewport} with its {@link Attributes} as well as its children. * * @return {@link JSONObject} */ @Override public final JSONObject toJSONObject() { final JSONObject object = new JSONObject(); object.put("type", new JSONString(getNodeType().getValue())); if (false == getMetaData().isEmpty()) { object.put("meta", new JSONObject(getMetaData().getJSO())); } object.put("attributes", new JSONObject(getAttributes().getJSO())); final JSONArray children = new JSONArray(); children.set(0, getScene().toJSONObject()); object.put("children", children); return object; }
object.put("meta", new JSONObject(getMetaData().getJSO()));
object.put("meta", new JSONObject(getMetaData().getJSO()));
object.put("meta", new JSONObject(getMetaData().getJSO()));
object.put("meta", new JSONObject(getMetaData().getJSO()));