Beispiel #1
0
  /**
   * Directly update view object.
   *
   * @param view
   * @param rootNode
   * @param lexicon
   */
  public Response updateView(
      final View<? extends CyIdentifiable> view,
      final JsonNode rootNode,
      final VisualLexicon lexicon) {
    for (final JsonNode vpNode : rootNode) {
      String vpName = vpNode.get(MAPPING_VP).textValue();
      final VisualProperty<?> vp = getVisualProperty(vpName, lexicon);
      final JsonNode value = vpNode.get(MAPPING_DISCRETE_VALUE);
      if (vp == null || value == null) {
        continue;
      }

      Object parsedValue = null;
      if (value.isTextual()) {
        parsedValue = vp.parseSerializableString(value.asText());
      } else {
        parsedValue = vp.parseSerializableString(value.toString());
      }

      view.setVisualProperty(vp, parsedValue);
    }
    return Response.ok().build();
  }
 void restoreLocations(final View<CyNode> nodeView) {
   nodeView.setVisualProperty(NODE_X_LOCATION, xLocation);
   nodeView.setVisualProperty(NODE_Y_LOCATION, yLocation);
   nodeView.setVisualProperty(NODE_Z_LOCATION, zLocation);
 }