Package com.google.devtools.depan.view

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


      implements NodeTreeProvider<NodeDisplayProperty> {

    @Override
    // TODO(leeca): consolidate with ViewEditor.getNodeProperty()
    public NodeDisplayProperty getObject(GraphNode node) {
      NodeDisplayProperty result = getNodeProperty(node);
      if (null != result) {
        return result;
      }
      return new NodeDisplayProperty();
    }
View Full Code Here


   * Provide a {@code NodeDisplayProperty} for any {@code GraphNode}.
   * If there is no persistent value, synthesize one, but it won't be saved
   * until some process (e.g. NodeEditor) modifies it's properties.
   */
  public NodeDisplayProperty getNodeProperty(GraphNode node) {
    NodeDisplayProperty result = viewInfo.getNodeProperty(node);
    if (null != result) {
      return result;
    }
    return new NodeDisplayProperty();
  }
View Full Code Here

      }
      if (property.equals(COL_SELECTED)) {
        return getEditor().isSelected(wrapper.getNode());
      }

      NodeDisplayProperty p = getProp(wrapper);
      if (property.equals(COL_VISIBLE)) {
        return p.isVisible();
      }
      if (property.equals(COL_SIZE)) {
        return p.getSize().ordinal();
      }
      if (property.equals(COL_COLOR)) {
        return p.getColor() == null ? "" : p.getColor().toString();
      }
    }
    return null;
  }
View Full Code Here

    if (!(o instanceof NodeWrapper)) {
      return;
    }
    NodeWrapper<NodeDisplayProperty> prop =
        (NodeWrapper<NodeDisplayProperty>) o;
    NodeDisplayProperty p = prop.getContent();
    GraphNode node = prop.getNode();

//    System.out.println("" + p + " " + property + " - " + value);
    if (property.equals(COL_VISIBLE) && (value instanceof Boolean)) {
      p.setVisible((Boolean) value);
    } else if (property.equals(COL_SELECTED) && (value instanceof Boolean)) {
      selectNode(node, (Boolean) value);
    } else if (property.equals(COL_SIZE) && (value instanceof Integer)) {
      p.setSize(Size.values()[(Integer) value]);
    } else if (property.equals(COL_COLOR) && (value instanceof String)) {
      Color newColor = StringUtils.stringToColor((String) value);
      p.setColor(newColor);
    }
    // notify the listeners about this change
    getEditor().setNodeProperty(node, p);
    // update the column / line we just modified
    nodeTreeView.getTreeViewer().update(o, new String[] {property});
View Full Code Here

   * of nodes properties.
   * @param node the node to change.
   * @param value the selection value.
   */
  private void setSelectedState(GraphNode node, boolean value) {
    NodeDisplayProperty prop = getEditor().getNodeProperty(node);
    if (null == prop) {
      return;
    }

    NodeWrapper<NodeDisplayProperty> nodeWrapper =
View Full Code Here

    if (!(element instanceof NodeWrapper)) {
      return null;
    }
    NodeWrapper<NodeDisplayProperty> wrapper =
        (NodeWrapper<NodeDisplayProperty>) element;
    NodeDisplayProperty property = wrapper.getContent();
    GraphNode node = wrapper.getNode();

    switch (columnIndex) {
    case NodeEditorTool.INDEX_NAME:
      return Tools.getIcon(node);
    case NodeEditorTool.INDEX_VISIBLE:
      return Resources.getOnOff(property.isVisible());
    case NodeEditorTool.INDEX_SELECTED:
      return Resources.getOnOff(isNodeSelected(wrapper.getNode()));
    default:
      break;
    }
View Full Code Here

TOP

Related Classes of com.google.devtools.depan.view.NodeDisplayProperty

Copyright © 2018 www.massapicom. 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.