Search in sources :

Example 6 with SetRadiusForArrangement

use of au.gov.asd.tac.constellation.plugins.arrangements.SetRadiusForArrangement 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);
}
Also used : GridChoiceParameters(au.gov.asd.tac.constellation.plugins.arrangements.grid.GridChoiceParameters) GridArranger(au.gov.asd.tac.constellation.plugins.arrangements.grid.GridArranger) SetRadiusForArrangement(au.gov.asd.tac.constellation.plugins.arrangements.SetRadiusForArrangement) GridArranger(au.gov.asd.tac.constellation.plugins.arrangements.grid.GridArranger) Arranger(au.gov.asd.tac.constellation.plugins.arrangements.Arranger) GraphComponentArranger(au.gov.asd.tac.constellation.plugins.arrangements.GraphComponentArranger) GraphTaxonomyArranger(au.gov.asd.tac.constellation.plugins.arrangements.GraphTaxonomyArranger) GraphComponentArranger(au.gov.asd.tac.constellation.plugins.arrangements.GraphComponentArranger) UncollideArrangement(au.gov.asd.tac.constellation.plugins.arrangements.uncollide.UncollideArrangement) GraphTaxonomyArranger(au.gov.asd.tac.constellation.plugins.arrangements.GraphTaxonomyArranger) SelectedInclusionGraph(au.gov.asd.tac.constellation.plugins.arrangements.SelectedInclusionGraph)

Example 7 with SetRadiusForArrangement

use of au.gov.asd.tac.constellation.plugins.arrangements.SetRadiusForArrangement in project constellation by constellation-app.

the class HighDimensionEmbeddingPlugin method edit.

@Override
public void edit(final GraphWriteMethods wg, final PluginInteraction interaction, final PluginParameters parameters) throws InterruptedException, PluginException {
    final int dimensions = parameters.getParameters().get(DIMENSIONS_PARAMETER_ID).getIntegerValue();
    if (wg.getVertexCount() > 0) {
        final SetRadiusForArrangement radiusSetter = new SetRadiusForArrangement(wg);
        radiusSetter.setRadii();
        final GridChoiceParameters innerGcParams = GridChoiceParameters.getDefaultParameters();
        final Arranger inner = new HighDimensionEmbeddingArranger(dimensions);
        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(wg, Connections.LINKS);
        arranger.arrange(selectedGraph.getInclusionGraph());
        selectedGraph.retrieveCoords();
        PluginExecution.withPlugin(InteractiveGraphPluginRegistry.RESET_VIEW).executeNow(wg);
    }
}
Also used : GridChoiceParameters(au.gov.asd.tac.constellation.plugins.arrangements.grid.GridChoiceParameters) GridArranger(au.gov.asd.tac.constellation.plugins.arrangements.grid.GridArranger) SetRadiusForArrangement(au.gov.asd.tac.constellation.plugins.arrangements.SetRadiusForArrangement) GridArranger(au.gov.asd.tac.constellation.plugins.arrangements.grid.GridArranger) Arranger(au.gov.asd.tac.constellation.plugins.arrangements.Arranger) GraphComponentArranger(au.gov.asd.tac.constellation.plugins.arrangements.GraphComponentArranger) GraphTaxonomyArranger(au.gov.asd.tac.constellation.plugins.arrangements.GraphTaxonomyArranger) GraphComponentArranger(au.gov.asd.tac.constellation.plugins.arrangements.GraphComponentArranger) GraphTaxonomyArranger(au.gov.asd.tac.constellation.plugins.arrangements.GraphTaxonomyArranger) SelectedInclusionGraph(au.gov.asd.tac.constellation.plugins.arrangements.SelectedInclusionGraph)

Example 8 with SetRadiusForArrangement

use of au.gov.asd.tac.constellation.plugins.arrangements.SetRadiusForArrangement in project constellation by constellation-app.

the class ArrangeInGridGeneralPlugin method edit.

@Override
public void edit(final GraphWriteMethods graph, final PluginInteraction interaction, final PluginParameters parameters) throws InterruptedException {
    final SetRadiusForArrangement radiusSetter = new SetRadiusForArrangement(graph);
    radiusSetter.setRadii();
    final Map<String, PluginParameter<?>> pp = parameters.getParameters();
    final GridChoiceParameters gridParams = GridChoiceParameters.getDefaultParameters();
    gridParams.setGridChoice(GridChoice.getValue(pp.get(GRID_CHOICE_PARAMETER_ID).getStringValue()));
    gridParams.setSizeGain(pp.get(SIZE_GAIN_PARAMETER_ID).getFloatValue());
    gridParams.setHorizontalGap(pp.get(HORIZONTAL_GAP_PARAMETER_ID).getIntegerValue());
    gridParams.setVerticalGap(pp.get(VERTICAL_GAP_PARAMETER_ID).getIntegerValue());
    gridParams.setRowOffsets(pp.get(OFFSET_ROWS_PARAMETER_ID).getBooleanValue());
    final GridArranger arranger = new GridArranger(gridParams);
    final Boolean maintainMean = pp.get(MAINTAIN_MEAN_PARAMETER_ID).getBooleanValue();
    arranger.setMaintainMean(maintainMean);
    final SelectedInclusionGraph selectedGraph = new SelectedInclusionGraph(graph, SelectedInclusionGraph.Connections.NONE);
    arranger.arrange(selectedGraph.getInclusionGraph());
    selectedGraph.retrieveCoords();
}
Also used : SetRadiusForArrangement(au.gov.asd.tac.constellation.plugins.arrangements.SetRadiusForArrangement) PluginParameter(au.gov.asd.tac.constellation.plugins.parameters.PluginParameter) SelectedInclusionGraph(au.gov.asd.tac.constellation.plugins.arrangements.SelectedInclusionGraph)

Example 9 with SetRadiusForArrangement

use of au.gov.asd.tac.constellation.plugins.arrangements.SetRadiusForArrangement in project constellation by constellation-app.

the class ArrangeInGridComponentsPlugin 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 GridChoiceParameters innerGcParams = GridChoiceParameters.getDefaultParameters();
        final Arranger inner = new GridArranger(innerGcParams);
        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 dicover the components.
        final SelectedInclusionGraph selectedGraph = new SelectedInclusionGraph(graph, Connections.LINKS);
        arranger.arrange(selectedGraph.getInclusionGraph());
        selectedGraph.retrieveCoords();
    }
    interaction.setProgress(1, 0, "Finished", true);
}
Also used : SetRadiusForArrangement(au.gov.asd.tac.constellation.plugins.arrangements.SetRadiusForArrangement) Arranger(au.gov.asd.tac.constellation.plugins.arrangements.Arranger) GraphComponentArranger(au.gov.asd.tac.constellation.plugins.arrangements.GraphComponentArranger) GraphTaxonomyArranger(au.gov.asd.tac.constellation.plugins.arrangements.GraphTaxonomyArranger) GraphComponentArranger(au.gov.asd.tac.constellation.plugins.arrangements.GraphComponentArranger) GraphTaxonomyArranger(au.gov.asd.tac.constellation.plugins.arrangements.GraphTaxonomyArranger) SelectedInclusionGraph(au.gov.asd.tac.constellation.plugins.arrangements.SelectedInclusionGraph)

Example 10 with SetRadiusForArrangement

use of au.gov.asd.tac.constellation.plugins.arrangements.SetRadiusForArrangement in project constellation by constellation-app.

the class ArrangeInHierarchyPlugin method edit.

@Override
protected void edit(final GraphWriteMethods graph, final PluginInteraction interaction, final PluginParameters parameters) throws InterruptedException, PluginException {
    // 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();
    if (graph.getVertexCount() > 0) {
        final SetRadiusForArrangement radiusSetter = new SetRadiusForArrangement(graph);
        radiusSetter.setRadii();
        final GridChoiceParameters innerGcParams = GridChoiceParameters.getDefaultParameters();
        final Arranger inner = new HierarchicalArranger(roots);
        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);
        final SelectedInclusionGraph selectedGraph = new SelectedInclusionGraph(graph, Connections.LINKS);
        arranger.arrange(selectedGraph.getInclusionGraph());
        selectedGraph.retrieveCoords();
    }
}
Also used : GridChoiceParameters(au.gov.asd.tac.constellation.plugins.arrangements.grid.GridChoiceParameters) GridArranger(au.gov.asd.tac.constellation.plugins.arrangements.grid.GridArranger) SetRadiusForArrangement(au.gov.asd.tac.constellation.plugins.arrangements.SetRadiusForArrangement) Set(java.util.Set) GridArranger(au.gov.asd.tac.constellation.plugins.arrangements.grid.GridArranger) Arranger(au.gov.asd.tac.constellation.plugins.arrangements.Arranger) GraphComponentArranger(au.gov.asd.tac.constellation.plugins.arrangements.GraphComponentArranger) GraphTaxonomyArranger(au.gov.asd.tac.constellation.plugins.arrangements.GraphTaxonomyArranger) GraphComponentArranger(au.gov.asd.tac.constellation.plugins.arrangements.GraphComponentArranger) GraphTaxonomyArranger(au.gov.asd.tac.constellation.plugins.arrangements.GraphTaxonomyArranger) SelectedInclusionGraph(au.gov.asd.tac.constellation.plugins.arrangements.SelectedInclusionGraph)

Aggregations

SetRadiusForArrangement (au.gov.asd.tac.constellation.plugins.arrangements.SetRadiusForArrangement)12 SelectedInclusionGraph (au.gov.asd.tac.constellation.plugins.arrangements.SelectedInclusionGraph)11 Arranger (au.gov.asd.tac.constellation.plugins.arrangements.Arranger)9 GraphComponentArranger (au.gov.asd.tac.constellation.plugins.arrangements.GraphComponentArranger)7 GraphTaxonomyArranger (au.gov.asd.tac.constellation.plugins.arrangements.GraphTaxonomyArranger)7 GridArranger (au.gov.asd.tac.constellation.plugins.arrangements.grid.GridArranger)5 GridChoiceParameters (au.gov.asd.tac.constellation.plugins.arrangements.grid.GridChoiceParameters)4 PluginParameter (au.gov.asd.tac.constellation.plugins.parameters.PluginParameter)2 Set (java.util.Set)2 GraphAttribute (au.gov.asd.tac.constellation.graph.GraphAttribute)1 UncollideArrangement (au.gov.asd.tac.constellation.plugins.arrangements.uncollide.UncollideArrangement)1