Examples of EdgeDisplayProperty


Examples of com.google.devtools.depan.view.EdgeDisplayProperty

    result.setLayoutFinder(layoutChoices.getRelationSet());

    SourcePlugin toolkit = graph.getDefaultAnalysis();
    result.setDisplayRelationSet(toolkit.getDefaultRelationshipSet());
    for (Relation relation : toolkit.getRelations()) {
      EdgeDisplayProperty edgeProp = new EdgeDisplayProperty();
      result.setRelationProperty(relation, edgeProp);
    }
    return result;
  }
View Full Code Here

Examples of com.google.devtools.depan.view.EdgeDisplayProperty

      }
    }

    Map<Relation, EdgeDisplayProperty> newRelationProps = Maps.newHashMap();
    for (Relation relation : newRelations) {
      EdgeDisplayProperty edgeProp = source.getRelationProperty(relation);
      if (null != edgeProp) {
        newRelationProps.put(relation, new EdgeDisplayProperty(edgeProp));
      }
    }

    Collection<GraphNode> newSelectedNodes = Lists.newArrayList();
    for (GraphNode node : source.selectedNodes) {
View Full Code Here

Examples of com.google.devtools.depan.view.EdgeDisplayProperty

   * Provide an {@code EdgeDisplayProperty} for any {@code GraphEdge}.
   * If there is no persistent value, synthesize one, but it won't be save
   * until some process (e.g. EdgeEditor) modifies it's properties.
   */
  public EdgeDisplayProperty getEdgeProperty(GraphEdge edge) {
    EdgeDisplayProperty result = viewInfo.getEdgeProperty(edge);
    if (null != result) {
      return result;
    }
    return new EdgeDisplayProperty();
  }
View Full Code Here

Examples of com.google.devtools.depan.view.EdgeDisplayProperty

      GraphEdge edge, EdgeDisplayProperty newProperty) {
    viewInfo.setEdgeProperty(edge, newProperty);
  }

  public void setRelationVisible(Relation relation, boolean isVisible) {
    EdgeDisplayProperty edgeProp = getRelationProperty(relation);
    if (null == edgeProp) {
      edgeProp = new EdgeDisplayProperty();
      edgeProp.setVisible(isVisible);
      viewInfo.setRelationProperty(relation, edgeProp);
      return;
    }

    // Don't change a relation that is already visible
    if (edgeProp.isVisible() == isVisible) {
      return;
    }
    edgeProp.setVisible(isVisible);
    viewInfo.setRelationProperty(relation, edgeProp);
  }
View Full Code Here

Examples of com.google.devtools.depan.view.EdgeDisplayProperty

  private void initEdgeRendering() {
    for (GraphEdge edge : viewGraph.getEdges()) {

      // If the edge has explicit display properties, use those.
      EdgeDisplayProperty edgeProp = viewInfo.getEdgeProperty(edge);
      if (null != edgeProp) {
        renderer.updateEdgeProperty(edge, edgeProp);
        continue;
      }

      EdgeDisplayProperty relationProp =
          getRelationProperty(edge.getRelation());
      if (null == relationProp) {
        renderer.setEdgeVisible(edge, false);
        continue;
      }
View Full Code Here

Examples of com.google.devtools.depan.view.EdgeDisplayProperty

  }

  private void updateEdgesToRelations() {
    for (GraphEdge edge : viewGraph.getEdges()) {
      // If the edge has explicit display properties, leave those.
      EdgeDisplayProperty edgeProp = viewInfo.getEdgeProperty(edge);
      if (null != edgeProp) {
        continue;
      }

      EdgeDisplayProperty relationProp =
          getRelationProperty(edge.getRelation());
      if (null == relationProp) {
        renderer.setEdgeVisible(edge, false);
        continue;
      }
View Full Code Here

Examples of com.google.devtools.depan.view.EdgeDisplayProperty

   * cleared whenever we change editors.
   */
  private Map<GraphEdge, EdgeDisplayProperty> knownEdges = null;

  private EdgeDisplayProperty getDisplayProperty(GraphEdge edge) {
    EdgeDisplayProperty result = knownEdges.get(edge);
    if (null != result) {
      return result;
    }
    result = getEditor().getEdgeProperty(edge);
    if (null == result) {
      result = new EdgeDisplayProperty();
    }
    knownEdges.put(edge, result);
    return result;
  }
View Full Code Here

Examples of com.google.devtools.depan.view.EdgeDisplayProperty

    knownEdges.put(edge, result);
    return result;
  }

  private EdgeDisplayProperty getMutableDisplayProperty(GraphEdge edge) {
    EdgeDisplayProperty current = getDisplayProperty(edge);
    EdgeDisplayProperty result = new EdgeDisplayProperty(current);
    knownEdges.put(edge, result);
    return result;
  }
View Full Code Here

Examples of com.google.devtools.depan.view.EdgeDisplayProperty

      }
      if (property.equals(COL_TARGET)) {
        return edge.getTail().friendlyString();
      }

      EdgeDisplayProperty edgeProps = getDisplayProperty(edge);
      if (property.equals(COL_LINE_STYLE)) {
        return edgeProps.getLineStyle().ordinal();
      }
      if (property.equals(COL_ARROWHEAD)) {
        return edgeProps.getArrowhead().ordinal();
      }
      if (property.equals(COL_LINE_COLOR)) {
        Color edgeColor = edgeProps.getColor();
        if (edgeColor != null) {
          return edgeColor.toString();
        }
        return "";
      }
View Full Code Here

Examples of com.google.devtools.depan.view.EdgeDisplayProperty

    if (!(modifiedObject instanceof GraphEdge)) {
      return;
    }

    GraphEdge edge = (GraphEdge) modifiedObject;
    EdgeDisplayProperty edgeProps = getMutableDisplayProperty(edge);

    if (property.equals(COL_LINE_STYLE) && (value instanceof Integer)) {
      edgeProps.setLineStyle(LineStyle.values()[(Integer) value]);
    } else if (property.equals(COL_ARROWHEAD) && (value instanceof Integer)) {
      edgeProps.setArrowhead(ArrowheadStyle.values()[(Integer) value]);
    } else if (property.equals(COL_LINE_COLOR) && (value instanceof String)) {
      Color newColor = StringUtils.stringToColor((String) value);
      edgeProps.setColor(newColor);
    }

    // Update listeners and the table
    getEditor().setEdgeProperty(edge, edgeProps);
    edgeTable.update(element, new String[] {property});
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.