Beispiel #1
0
  // TODO Fix this.
  private List<ScoredGraph> arrangeGraphs() {
    IGesRunner runner = (IGesRunner) getAlgorithmRunner();
    Graph resultGraph = runner.getResultGraph();

    List<ScoredGraph> topGraphs = runner.getTopGraphs();

    if (topGraphs == null) topGraphs = new ArrayList<ScoredGraph>();

    Graph latestWorkbenchGraph = runner.getParams().getSourceGraph();
    Graph sourceGraph = runner.getSourceGraph();

    boolean arrangedAll = false;

    for (ScoredGraph topGraph1 : topGraphs) {
      arrangedAll = GraphUtils.arrangeBySourceGraph(topGraph1.getGraph(), latestWorkbenchGraph);
    }

    if (!arrangedAll) {
      arrangedAll = GraphUtils.arrangeBySourceGraph(resultGraph, sourceGraph);
    }

    if (!arrangedAll) {
      for (ScoredGraph topGraph : topGraphs) {
        GraphUtils.circleLayout(topGraph.getGraph(), 200, 200, 150);
        GraphUtils.circleLayout(resultGraph, 200, 200, 150);
      }
    }

    return topGraphs;
  }
Beispiel #2
0
 protected void doDefaultArrangement(Graph resultGraph) {
   if (getLatestWorkbenchGraph() != null) { // (alreadyLaidOut) {
     GraphUtils.arrangeBySourceGraph(resultGraph, getLatestWorkbenchGraph());
   } else if (getKnowledge().isDefaultToKnowledgeLayout()) {
     SearchGraphUtils.arrangeByKnowledgeTiers(resultGraph, getKnowledge());
     //            alreadyLaidOut = true;
   } else {
     GraphUtils.circleLayout(resultGraph, 200, 200, 150);
     //            alreadyLaidOut = true;
   }
 }