コード例 #1
0
  public void setColors(VisualConnection connectionNode) {

    // The top level categorical axis determines the color scheme.
    if (connectionNode.getChildren().isEmpty()) return;

    if (connectionNode == root) {
      for (VisualConnection childNode : connectionNode.getChildren()) {
        childNode.setColorBrewerIndex(childNode.getNode().getToCategory().getCategoryNum() - 1);
        setColors(childNode);
      }
    } else {
      for (VisualConnection childNode : connectionNode.getChildren()) {
        childNode.setColorBrewerIndex(connectionNode.getColorBrewerIndex());
        setColors(childNode);
      }
    }
  }