use of au.gov.asd.tac.constellation.plugins.arrangements.uncollide.UncollideArrangement in project constellation by constellation-app.
the class ArrangeInTreesPlugin method edit.
@Override
protected void edit(final GraphWriteMethods graph, final PluginInteraction interaction, final PluginParameters parameters) throws InterruptedException, PluginException {
interaction.setProgress(0, 0, "Arranging...", true);
if (graph.getVertexCount() > 0) {
final SetRadiusForArrangement radiusSetter = new SetRadiusForArrangement(graph);
radiusSetter.setRadii();
final Arranger inner = new CircTreeArranger(CircTreeChoiceParameters.getDefaultParameters());
final Arranger middle = new MdsArranger(MDSChoiceParameters.getDefaultParameters());
final GridChoiceParameters outerGcParams = GridChoiceParameters.getDefaultParameters();
outerGcParams.setRowOffsets(false);
final Arranger outer = new GridArranger(outerGcParams);
final GridChoiceParameters innerGcParams = GridChoiceParameters.getDefaultParameters();
final GraphTaxonomyArranger arranger2 = new TreeTaxonArranger(inner, middle);
arranger2.setInteraction(interaction);
// Push the MDS parts further away from each other.
final UncollideArrangement unc = new UncollideArrangement(2);
unc.setMinPadding(4);
arranger2.setUncollider(unc);
final GraphTaxonomyArranger arranger1 = new GraphComponentArranger(arranger2, outer, Connections.LINKS);
arranger1.setSingletonArranger(new GridArranger(innerGcParams));
arranger1.setDoubletArranger(new GridArranger(innerGcParams, true));
arranger1.setInteraction(interaction);
final SelectedInclusionGraph selectedGraph = new SelectedInclusionGraph(graph, SelectedInclusionGraph.Connections.LINKS);
final boolean maintainMean = !selectedGraph.isArrangingAll();
arranger1.setMaintainMean(maintainMean);
arranger1.arrange(selectedGraph.getInclusionGraph());
selectedGraph.retrieveCoords();
}
interaction.setProgress(1, 0, "Finished", true);
}
Aggregations