use of au.gov.asd.tac.constellation.plugins.arrangements.GraphComponentArranger in project constellation by constellation-app.
the class ArrangeInScatter3dComponentsPlugin 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 Scatter3dChoiceParameters innerGcParams = Scatter3dChoiceParameters.getDefaultParameters();
final Arranger inner = new Scatter3dArranger(innerGcParams);
final Scatter3dChoiceParameters outerGcParams = Scatter3dChoiceParameters.getDefaultParameters();
final Arranger outer = new Scatter3dArranger(outerGcParams);
final GraphTaxonomyArranger arranger = new GraphComponentArranger(inner, outer, Connections.LINKS);
arranger.setSingletonArranger(new Scatter3dArranger(innerGcParams));
arranger.setInteraction(interaction);
// We need to include links to dicover the components.
final SelectedInclusionGraph selectedGraph = new SelectedInclusionGraph(graph, Connections.LINKS);
arranger.arrange(selectedGraph.getInclusionGraph());
selectedGraph.retrieveCoords();
}
interaction.setProgress(1, 0, "Finished", true);
}
use of au.gov.asd.tac.constellation.plugins.arrangements.GraphComponentArranger in project constellation by constellation-app.
the class ArrangeInBubbleTreePlugin method edit.
@Override
protected void edit(final GraphWriteMethods graph, final PluginInteraction interaction, final PluginParameters parameters) throws InterruptedException, PluginException {
// Get the prospective root vertex ids.
// roots will be a set of integers which extends object type
@SuppressWarnings("unchecked") final Set<Integer> roots = (Set<Integer>) parameters.getParameters().get(ROOTS_PARAMETER_ID).getObjectValue();
final boolean isMinimal = parameters.getParameters().get(IS_MINIMAL_PARAMETER_ID).getBooleanValue();
if (graph.getVertexCount() > 0) {
final SetRadiusForArrangement radiusSetter = new SetRadiusForArrangement(graph);
radiusSetter.setRadii();
final GridChoiceParameters innerGcParams = GridChoiceParameters.getDefaultParameters();
final Arranger inner = new BubbleTreeArranger(roots, isMinimal);
final GridChoiceParameters outerGcParams = GridChoiceParameters.getDefaultParameters();
outerGcParams.setRowOffsets(false);
final Arranger outer = new GridArranger(outerGcParams);
final GraphTaxonomyArranger arranger = new GraphComponentArranger(inner, outer, Connections.LINKS);
arranger.setSingletonArranger(new GridArranger(innerGcParams));
arranger.setDoubletArranger(new GridArranger(innerGcParams, true));
arranger.setInteraction(interaction);
arranger.setMaintainMean(true);
// We need to include links to discover the components.
final SelectedInclusionGraph selectedGraph = new SelectedInclusionGraph(graph, Connections.LINKS);
arranger.arrange(selectedGraph.getInclusionGraph());
selectedGraph.retrieveCoords();
}
}
Aggregations