Example #1
0
  void storeLatestWorkbenchGraph() {
    Graph latestWorkbenchGraph = workbench.getGraph();

    if (latestWorkbenchGraph.getNumNodes() == 0) {
      return;
    }

    SearchParams searchParams = algorithmRunner.getParams();

    try {
      Graph graph = new MarshalledObject<Graph>(latestWorkbenchGraph).get();

      if (graph == null) {
        throw new NullPointerException("Null graph");
      }

      if (searchParams != null) {
        searchParams.setSourceGraph(graph);
      }
    } catch (IOException e) {
      e.printStackTrace();

      if (searchParams != null) {
        searchParams.setSourceGraph(null);
      }
    } catch (ClassNotFoundException e) {
      if (searchParams != null) {
        searchParams.setSourceGraph(null);
      }

      e.printStackTrace();
    }
  }
Example #2
0
  JScrollPane workbenchScroll(String resultLabel) {
    Graph resultGraph = resultGraph();

    Graph sourceGraph = algorithmRunner.getSourceGraph();
    SearchParams searchParams = algorithmRunner.getParams();
    Graph latestWorkbenchGraph = null;

    if (searchParams != null) {
      latestWorkbenchGraph = searchParams.getSourceGraph();
    }

    if (latestWorkbenchGraph == null) {
      GraphUtils.arrangeBySourceGraph(resultGraph, sourceGraph);
    } else {
      GraphUtils.arrangeBySourceGraph(resultGraph, latestWorkbenchGraph);
    }

    //        boolean arrangedAll = DataGraphUtils.arrangeBySourceGraph(resultGraph,
    //                latestWorkbenchGraph);
    //
    //        if (!arrangedAll) {
    //            arrangedAll =
    //                    DataGraphUtils.arrangeBySourceGraph(resultGraph, sourceGraph);
    //        }

    //        if (!arrangedAll) {
    //            DataGraphUtils.circleLayout(resultGraph, 200, 200, 150);
    //        }

    this.workbench = new GraphWorkbench(resultGraph);

    graphHistory.clear();
    graphHistory.add(resultGraph);

    this.workbench.setAllowDoubleClickActions(false);
    this.workbench.setAllowNodeEdgeSelection(true);
    this.workbenchScroll = new JScrollPane(workbench);
    //        workbenchScroll.setPreferredSize(new Dimension(450, 450));
    //        workbenchScroll.setBorder(new TitledBorder(resultLabel));

    this.workbench.addMouseListener(
        new MouseAdapter() {
          public void mouseExited(MouseEvent e) {
            storeLatestWorkbenchGraph();
          }
        });

    return workbenchScroll;
  }
Example #3
0
 private JComponent getIndTestParamBox() {
   SearchParams params = getAlgorithmRunner().getParams();
   IndTestParams indTestParams = params.getIndTestParams();
   return getIndTestParamBox(indTestParams);
 }
Example #4
0
 public List<String> getVarNames() {
   SearchParams params = getAlgorithmRunner().getParams();
   return params.getVarNames();
 }