亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sugiyamalayoutalgorithm.java

?? 一個很好實用的工作流OSWORKFLOW開發例子.有著非常優秀的靈活性.
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
// This file is part of the Echidna project// (C) 2002 Forschungszentrum Informatik (FZI) Karlsruhe// Please visit our website at http://echidna.sf.netpackage com.opensymphony.workflow.designer.layout;import javax.swing.*;import org.jgraph.JGraph;import org.jgraph.graph.*;import java.awt.Point;import java.awt.Rectangle;import java.text.NumberFormat;import java.util.*;/** * Arranges the nodes with the Sugiyama Layout Algorithm.<br> * * <a href="http://plg.uwaterloo.ca/~itbowman/CS746G/Notes/Sugiyama1981_MVU/"> *  Link to the algorithm</a> * *<br> *<br> * @author Sven Luzar<br> * @version 1.0 init */public class SugiyamaLayoutAlgorithm implements LayoutAlgorithm{  /** Field for debug output   */  protected final boolean verbose = false;  /** Const to add Attributes at the Nodes   *   */  public static final String SUGIYAMA_VISITED = "SugiyamaVisited"/*#Frozen*/;  /** Const to add the Cell Wrapper to the Nodes   */  public static final String SUGIYAMA_CELL_WRAPPER = "SugiyamaCellWrapper"/*#Frozen*/;  /** represents the size of the grid in horizontal grid elements   *   */  protected int gridAreaSize = Integer.MIN_VALUE;  /** A List with Integer Objects. The List contains the   *  history of movements per loop   *  It was needed for the progress dialog   */  List movements = null;  /** Represents the movements in the current loop.   *  It was needed for the progress dialog   */  int movementsCurrentLoop = -1;  /** Represents the maximum of movements in the current loop.   *  It was needed for the progress dialog   */  int movementsMax = Integer.MIN_VALUE;  /** Represents the current loop number   *  It was needed for the progress dialog   */  int iteration = 0;  public static final String KEY_HORIZONTAL_SPACING = "HorizontalSpacing";  public static final String KEY_VERTICAL_SPACING = "VerticalSpacing";  /**   * Implementation.   *   * First of all the Algorithm searches the roots from the   * Graph. Starting from this roots the Algorithm creates   * levels and stores them in the member <code>levels</code>.   * The Member levels contains List Objects and the List per level   * contains Cell Wrapper Objects. After that the Algorithm   * tries to solve the edge crosses from level to level and   * goes top down and bottom up. After minimization of the   * edge crosses the algorithm moves each node to its   * bary center. Last but not Least the method draws the Graph.   *   * @see LayoutAlgorithm   *   */  public void perform(JGraph jgraph, boolean applyToAll, Properties configuration)  {    Object[] selectedCells = (applyToAll ? jgraph.getRoots() : jgraph.getSelectionCells());    CellView[] selectedCellViews = jgraph.getGraphLayoutCache().getMapping(selectedCells);    Point spacing = new Point();    /*  The Algorithm distributes the nodes on a grid.     *  For this grid you can configure the horizontal spacing.     *  This field specifies the configured value     *     */    spacing.x = Integer.parseInt(configuration.getProperty(KEY_HORIZONTAL_SPACING));    /*  The Algorithm distributes the nodes on a grid.     *  For this grid you can configure the vertical spacing.     *  This field specifies the configured value     *     */    spacing.y = Integer.parseInt(configuration.getProperty(KEY_VERTICAL_SPACING));    // search all roots    List roots = searchRoots(jgraph, selectedCellViews);    // return if no root found    if(roots.size() == 0)      return;    // create levels    List levels = fillLevels(jgraph, selectedCellViews, roots);    // solves the edge crosses    solveEdgeCrosses(jgraph, levels);    // move all nodes into the barycenter    moveToBarycenter(jgraph, selectedCellViews, levels);    Point min = findMinimumAndSpacing(selectedCellViews, spacing);    // draw the graph in the window    drawGraph(jgraph, levels, min, spacing);    // clean temp values from the nodes / cells    // the clean up was made in drawGraph    //cleanUp(selectedCellViews);  }  /** Debugdisplay for the edge crosses indicators on the System out   */  protected void displayEdgeCrossesValues(List levels)  {    System.out.println("----------------Edge Crosses Indicator Values"/*#Frozen*/);    for(int i = 0; i < levels.size() - 1; i++)    {      // Get the current level      List currentLevel = (List)levels.get(i);      System.out.print("Level (" + i + "):"/*#Frozen*/);      for(int j = 0; j < currentLevel.size(); j++)      {        CellWrapper sourceWrapper = (CellWrapper)currentLevel.get(j);        System.out.print(NumberFormat.getNumberInstance().format(sourceWrapper.getEdgeCrossesIndicator()) + " - "/*#Frozen*/);      }      System.out.println();    }  }  /** Debugdisplay for the grid positions on the System out   */  protected void displayGridPositions(List levels)  {    System.out.println("----------------GridPositions"/*#Frozen*/);    for(int i = 0; i < levels.size() - 1; i++)    {      // Get the current level      List currentLevel = (List)levels.get(i);      System.out.print("Level (" + i + "):"/*#Frozen*/);      for(int j = 0; j < currentLevel.size(); j++)      {        CellWrapper sourceWrapper = (CellWrapper)currentLevel.get(j);        System.out.print(NumberFormat.getNumberInstance().format(sourceWrapper.getGridPosition()) + " - "/*#Frozen*/);      }      System.out.println();    }  }  /** Debugdisplay for the priorities on the System out   */  protected void displayPriorities(List levels)  {    System.out.println("----------------down Priorities"/*#Frozen*/);    for(int i = 0; i < levels.size() - 1; i++)    {      // Get the current level      List currentLevel = (List)levels.get(i);      System.out.print("Level (" + i + "):"/*#Frozen*/);      for(int j = 0; j < currentLevel.size(); j++)      {        CellWrapper sourceWrapper = (CellWrapper)currentLevel.get(j);        System.out.print(sourceWrapper.getPriority() + /*" (" +                           sourceWrapper.nearestDownNeighborLevel + ") " +*/                         " - "/*#Frozen*/);      }      System.out.println();    }  }  /** Searches all Roots for the current Graph   *  First the method marks any Node as not visited.   *  Than calls searchRoots(MyGraphCell) for each   *  not visited Cell.   *  The Roots are stored in the List named roots   *   * 	@return returns a List with the roots   *  @see #searchRoots(JGraph, CellView[])   */  protected List searchRoots(JGraph jgraph, CellView[] selectedCellViews)  {    // get all cells and relations    List vertexViews = new ArrayList(selectedCellViews.length);    List roots = new ArrayList();    // first: mark all as not visited    // O(allCells&Edges)    for(int i = 0; i < selectedCellViews.length; i++)    {      if(selectedCellViews[i] instanceof VertexView)      {        VertexView vertexView = (VertexView)selectedCellViews[i];        vertexView.getAttributes().remove(SUGIYAMA_VISITED);        vertexViews.add(selectedCellViews[i]);      }    }    // O(graphCells)    for(int i = 0; i < vertexViews.size(); i++)    {      VertexView vertexView = (VertexView)vertexViews.get(i);      if(vertexView.getAttributes().get(SUGIYAMA_VISITED) == null)      {        searchRoots(jgraph, vertexView, roots);      }    }    // Error Msg if the graph has no roots    if(roots.size() == 0)    {      JOptionPane.showMessageDialog(null, "The Graph is not a DAG. Can't use Sugiyama Algorithm!"/*#Finished:Original="The Graph is not a DAG. Can't use Sugiyama Algorithm!"*/, null, JOptionPane.ERROR_MESSAGE);    }    return roots;  }  /** Searches Roots for the current Cell.   *   *  Therefore he looks at all Ports from the Cell.   *  At the Ports he looks for Edges.   *  At the Edges he looks for the Target.   *  If the Ports of the current Cell contains the target ReViewNodePort   *  he follows the edge to the source and looks at the   *  Cell for this source.   *   */  protected void searchRoots(JGraph jgraph, VertexView vertexViewToInspect, List roots)  {    // the node already visited    if(vertexViewToInspect.getAttributes().get(SUGIYAMA_VISITED) != null)    {      return;    }    // mark as visited for cycle tests    vertexViewToInspect.getAttributes().put(SUGIYAMA_VISITED, new Boolean(true));    GraphModel model = jgraph.getModel();    // get all Ports and search the relations at the ports    //List vertexPortViewList = new ArrayList() ;    Object vertex = vertexViewToInspect.getCell();    int portCount = model.getChildCount(vertex);    for(int j = 0; j < portCount; j++)    {      Object port = model.getChild(vertex, j);      // Test all relations for where      // the current node is a target node      // for roots      boolean isRoot = true;      Iterator itrEdges = model.edges(port);      while(itrEdges.hasNext())      {        Object edge = itrEdges.next();        // if the current node is a target node        // get the source node and test        // the source node for roots        if(model.getTarget(edge) == port)        {          Object sourcePort = model.getSource(edge);          Object sourceVertex = model.getParent(sourcePort);          CellView sourceVertexView = jgraph.getGraphLayoutCache().getMapping(sourceVertex, false);          if(sourceVertexView instanceof VertexView)          {            searchRoots(jgraph, (VertexView)sourceVertexView, roots);            isRoot = false;          }        }      }      // The current node is never a Target Node      // -> The current node is a root node      if(isRoot)      {        roots.add(vertexViewToInspect);      }    }  }  /** Method fills the levels and stores them in the member levels.   *  Each level was represended by a List with Cell Wrapper objects.   *  These Lists are the elements in the <code>levels</code> List.   *   */  protected List fillLevels(JGraph jgraph, CellView[] selectedCellViews, List rootVertexViews)  {    List levels = new ArrayList();    // mark as not visited    // O(allCells)    for(int i = 0; i < selectedCellViews.length; i++)    {      CellView cellView = selectedCellViews[i];      cellView.getAttributes().remove(SUGIYAMA_VISITED);    }    Iterator roots = rootVertexViews.iterator();    while(roots.hasNext())    {      VertexView vertexView = (VertexView)roots.next();      fillLevels(jgraph, levels, 0, vertexView);    }    return levels;  }  /** Fills the List for the specified level with a wrapper   *  for the MyGraphCell. After that the method called for   *  each neighbor graph cell.   *   *  @param level        The level for the graphCell   */  protected void fillLevels(JGraph jgraph, List levels, int level, VertexView vertexView)  {    // be sure that a List container exists for the current level    if(levels.size() == level)      levels.add(level, new ArrayList());    // if the cell already visited return    if(vertexView.getAttributes().get(SUGIYAMA_VISITED) != null)    {      return;    }    // mark as visited for cycle tests    vertexView.getAttributes().put(SUGIYAMA_VISITED, new Boolean(true));

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一二三在| 国产精品蜜臀在线观看| 亚洲主播在线播放| eeuss国产一区二区三区| 午夜视频一区二区| 99精品偷自拍| 成人欧美一区二区三区| 蓝色福利精品导航| 欧美区在线观看| 蜜臀精品久久久久久蜜臀| 777午夜精品视频在线播放| 亚洲国产一区二区三区| 色吊一区二区三区| 亚洲午夜激情av| 欧美日韩电影一区| 美女被吸乳得到大胸91| 日韩免费电影一区| 韩国三级在线一区| 欧美一级免费观看| 蜜桃av噜噜一区| 久久久美女艺术照精彩视频福利播放| 国产一区二区主播在线| 日韩欧美一二区| 国产一区久久久| 国产精品三级av| 成人丝袜视频网| 一区二区三区电影在线播| 欧美日韩一区二区在线观看| 喷水一区二区三区| 欧美激情综合网| 一本一道波多野结衣一区二区| 亚洲一区二区三区激情| 欧美tickle裸体挠脚心vk| 国产999精品久久久久久绿帽| 日韩毛片在线免费观看| 欧美久久久一区| 国产精品91xxx| 亚洲精品日产精品乱码不卡| 欧美精品在线观看一区二区| 久久99国产精品尤物| 自拍偷拍国产亚洲| 777奇米四色成人影色区| 国产一区二区视频在线| 国产精品乱码一区二区三区软件| 91精品91久久久中77777| 欧美96一区二区免费视频| 国产亚洲婷婷免费| 欧美日韩国产中文| 国产乱码精品一区二区三区五月婷| 亚洲视频你懂的| 精品国精品国产| 色婷婷av一区二区| 美女www一区二区| 亚洲日本免费电影| 555www色欧美视频| 91网站黄www| 麻豆一区二区三| 一区二区三区四区中文字幕| 精品av久久707| 欧美影片第一页| 成人精品小蝌蚪| 免费一级欧美片在线观看| 最新国产成人在线观看| 欧美一区二区三区喷汁尤物| 99久久国产免费看| 久久不见久久见免费视频1| 夜夜嗨av一区二区三区网页 | 懂色av一区二区三区蜜臀| 日韩精品久久久久久| 亚洲国产精品精华液网站| 亚洲精品高清在线| 亚洲欧美日韩国产综合| 自拍av一区二区三区| 亚洲手机成人高清视频| 亚洲精品福利视频网站| 亚洲欧美偷拍卡通变态| 一区二区三区精品视频| 亚洲一区av在线| 亚洲成国产人片在线观看| 亚洲6080在线| 久久精品999| 麻豆国产91在线播放| 国产主播一区二区| 成人自拍视频在线观看| www.av亚洲| 欧美影院精品一区| 欧美一区二区视频在线观看| 日韩午夜精品视频| 国产日产欧美精品一区二区三区| 中文文精品字幕一区二区| 国产精品理论片| 亚洲在线中文字幕| 免费看黄色91| 成人精品视频.| 91福利精品第一导航| 欧美精品一二三四| 久久综合久久综合久久| 欧美国产精品一区二区三区| 综合色天天鬼久久鬼色| 亚洲天堂免费看| 日韩av中文字幕一区二区三区| 国产综合色精品一区二区三区| 成人丝袜视频网| 欧美日韩精品一区二区| 亚洲精品一区二区三区99| 中文字幕在线观看一区| 日本欧美加勒比视频| 极品销魂美女一区二区三区| 丰满亚洲少妇av| 欧美日韩午夜影院| 国产亚洲午夜高清国产拍精品| 日韩毛片视频在线看| 日本va欧美va欧美va精品| 国产成人av电影在线播放| 欧美中文一区二区三区| 久久先锋资源网| 夜夜精品视频一区二区| 久草这里只有精品视频| 色综合久久久久综合| 亚洲精品在线网站| 亚洲激情六月丁香| 国产一区三区三区| 欧美在线看片a免费观看| 久久婷婷成人综合色| 亚洲在线成人精品| 国产成人在线视频播放| 欧美日韩国产另类不卡| 日本一区二区三区四区在线视频| 亚洲一区二区三区视频在线| 国产999精品久久| 精品少妇一区二区| 亚洲黄色小说网站| 成人综合婷婷国产精品久久蜜臀| 欧美老女人在线| 一区二区欧美国产| av成人老司机| 久久久久99精品国产片| 日韩专区欧美专区| 欧美在线啊v一区| 中文字幕一区二| 成人午夜视频福利| 欧美精品一区二区三| 日本美女一区二区三区| 欧美无乱码久久久免费午夜一区| 国产精品天干天干在观线| 狠狠色狠狠色综合日日91app| 久久久久九九视频| 看电影不卡的网站| 3d动漫精品啪啪1区2区免费| 亚洲精品中文字幕乱码三区| 波多野结衣亚洲| 欧美国产精品久久| 国产精品一线二线三线精华| 日韩欧美资源站| 天堂久久久久va久久久久| 欧美综合视频在线观看| 一区二区三区影院| 欧美视频中文字幕| 亚洲国产精品麻豆| 在线区一区二视频| 亚洲午夜久久久久久久久电影网| 91麻豆文化传媒在线观看| 国产精品久久久久久久久快鸭 | 日韩一区二区三区免费看| 亚洲国产精品一区二区久久恐怖片| 91网站在线播放| 亚洲精品菠萝久久久久久久| 色婷婷综合五月| 一区二区日韩av| 欧美日韩色一区| 日韩成人精品视频| 3d动漫精品啪啪一区二区竹菊| 日日摸夜夜添夜夜添国产精品| 欧美一区二区三区视频免费播放 | 久久久精品黄色| 国产成人在线视频免费播放| 国产喷白浆一区二区三区| 国产ts人妖一区二区| 亚洲色图视频网| 欧美私人免费视频| 日韩电影在线免费看| 精品国产乱码久久久久久闺蜜| 国产一区二区在线观看免费| 中文字幕国产一区二区| 91在线视频官网| 日韩福利电影在线| 久久色.com| 99re在线视频这里只有精品| 亚洲美女视频在线| 日韩一区二区三区在线观看| 国产伦精一区二区三区| 亚洲色欲色欲www| 欧美一二区视频| 成人一区二区三区中文字幕| 亚洲免费高清视频在线| 欧美日韩国产小视频在线观看| 开心九九激情九九欧美日韩精美视频电影 | 亚洲一区电影777| 精品播放一区二区| 日本韩国一区二区|