Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 曼哈顿布局算法_Java_Algorithm_Layout_Graph Theory_Prefuse - Fatal编程技术网

Java 曼哈顿布局算法

Java 曼哈顿布局算法,java,algorithm,layout,graph-theory,prefuse,Java,Algorithm,Layout,Graph Theory,Prefuse,我正在寻找以下任何一项(按优先顺序): 曼哈顿的布局 曼哈顿预售 一种生成分层有向无环图的算法 实现 示例实现包括: (用于预使用)接近,但边样式不是正交的 您知道在哪里可以找到这些内容吗?使用prefuse创建EdgerEnder子类: /** * Responsible for drawing orthogonal edges between two nodes. */ public class OrthogonalEdgeRenderer extends EdgeRen

我正在寻找以下任何一项(按优先顺序):

  • 曼哈顿的布局
  • 曼哈顿预售
  • 一种生成分层有向无环图的算法
  • 实现
示例实现包括:

  • (用于预使用)接近,但边样式不是正交的

您知道在哪里可以找到这些内容吗?

使用prefuse创建EdgerEnder子类:

/**
 * Responsible for drawing orthogonal edges between two nodes.
 */
public class OrthogonalEdgeRenderer
  extends EdgeRenderer {
  /**
   * Creates a new edge renderer with a given arrowType. The edgeType is
   * ignored -- the edges are drawn orthogonally, as per the responsibility
   * of this class. The arrowType is one of the Constants.EDGE_ARROW_* values.
   *
   * @param edgeType Ignored.
   * @param arrowType One of Constants.EDGE_ARROW_*.
   * @see prefuse.Constants
   */
  public OrthogonalEdgeRenderer( int edgeType, int arrowType ) {
    super( edgeType, arrowType );
  }

  /**
   * Creates a new instance with no arrow head.
   */
  public OrthogonalEdgeRenderer() {
    this( Constants.EDGE_TYPE_LINE, Constants.EDGE_ARROW_NONE );
  }

  /**
   * Creates an orthogonal shape (an edge) to draw between two nodes.
   *
   * @param vi The visual item with start and end points.
   * @return The shape to draw between the nodes for this edge.
   */
  protected Shape getRawShape( VisualItem vi ) {
    Path2D.Double result = new Path2D.Double();

    if( vi instanceof EdgeItem ) {
      EdgeItem ei = ( EdgeItem )vi;

      double sx = ei.getSourceItem().getX();
      double sy = ei.getSourceItem().getY();
      double tx = ei.getTargetItem().getX();
      double ty = ei.getTargetItem().getY();

      double midy = ( sy + ty ) / 2;

      if( midy != sy && midy != ty ) {
        result.moveTo( sx, sy );
        result.lineTo( sx, midy );
        result.lineTo( tx, midy );
        result.lineTo( tx, ty );
      }
    }

    return result;
  }
}