public final MetaDataArray push(MetaData value) { m_jso.push(value.getJSO()); return this; }
protected Node(final NodeType type) { m_type = type; m_attr = new Attributes(this); m_meta = new MetaData(); }
@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 String toString() { return toJSONString(); }
@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 boolean equals(Object other) { if ((other == null) || (false == (other instanceof MetaData))) { return false; } if (this == other) { return true; } return ((MetaData) other).toJSONString().equals(toJSONString()); }
@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; }
public final MetaDataArray set(int index, MetaData value) { m_jso.set(index, value.getJSO()); return this; }
protected AbstractImageDataFilter() { m_attr = new Attributes(this); m_meta = new MetaData(); m_type = ClassUtils.getSimpleName(getClass()); setActive(true); }
@Override public int hashCode() { return toJSONString().hashCode(); } }
public BarChart(DataReloadedEventHandler reloadedEventHandler) { setNodeType(ChartNodeType.BAR_CHART); if (reloadedEventHandler != null) addDataReloadedHandler(reloadedEventHandler); getMetaData().put("creator", "Roger Martinez"); }
/** * 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; }
public final MetaData put(String name, MetaData value) { if (null != value) { m_jso.put(name, value.getJSO()); } else { m_jso.delete(name); } return this; }
public final MetaData getMetaData(int index) { if (m_jso.getNativeTypeOf(index) == NativeInternalType.OBJECT) { NFastStringMapMixedJSO jso = m_jso.getObject(index).cast(); return new MetaData(jso); } return null; }
/** * 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; }
public final MetaData getMetaData(String name) { if (m_jso.typeOf(name) == NativeInternalType.OBJECT) { NFastStringMapMixedJSO jso = m_jso.getObject(name).cast(); return new MetaData(jso); } return null; }
@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; }