Search in sources :

Example 1 with SelectedInclusionGraph

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

the class ArrangeInSpherePlugin method edit.

@Override
public void edit(final GraphWriteMethods wg, final PluginInteraction interaction, final PluginParameters parameters) throws InterruptedException {
    final SetRadiusForArrangement radiusSetter = new SetRadiusForArrangement(wg);
    radiusSetter.setRadii();
    final Arranger arranger = new SphereArranger();
    final SelectedInclusionGraph selectedGraph = new SelectedInclusionGraph(wg, SelectedInclusionGraph.Connections.NONE);
    arranger.setMaintainMean(!selectedGraph.isArrangingAll());
    arranger.arrange(selectedGraph.getInclusionGraph());
    selectedGraph.retrieveCoords();
}
Also used : SetRadiusForArrangement(au.gov.asd.tac.constellation.plugins.arrangements.SetRadiusForArrangement) Arranger(au.gov.asd.tac.constellation.plugins.arrangements.Arranger) SelectedInclusionGraph(au.gov.asd.tac.constellation.plugins.arrangements.SelectedInclusionGraph)

Example 2 with SelectedInclusionGraph

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

the class ArrangeByNodeAttributePlugin method edit.

@Override
public void edit(final GraphWriteMethods wg, final PluginInteraction interaction, final PluginParameters parameters) throws InterruptedException {
    final boolean threeD = parameters.getParameters().get(THREE_D_PARAMETER_ID).getBooleanValue();
    final String attribute = parameters.getParameters().get(ATTRIBUTE_PARAMETER_ID).getStringValue();
    if (threeD) {
        if (attribute != null) {
            final SelectedInclusionGraph selectedGraph = new SelectedInclusionGraph(wg, SelectedInclusionGraph.Connections.NONE);
            final Attribute attr = new GraphAttribute(wg, wg.getAttribute(GraphElementType.VERTEX, attribute));
            selectedGraph.addAttributeToCopy(attr);
            final GraphWriteMethods ig = selectedGraph.getInclusionGraph();
            final int iattrId = ig.getAttribute(GraphElementType.VERTEX, attribute);
            final LayerArranger arranger = new LayerArranger();
            arranger.setLevelAttr(iattrId);
            arranger.setMaintainMean(!selectedGraph.isArrangingAll());
            arranger.arrange(ig);
            selectedGraph.retrieveCoords();
        }
    } else {
        if (attribute != null) {
            final Arranger inner = new GridArranger();
            final Arranger outer = new GridArranger();
            final GraphTaxonomyArranger arranger = new ArrangeByGroupTaxonomy(inner, outer, Connections.NONE, attribute);
            arranger.setMaintainMean(true);
            final SelectedInclusionGraph selectedGraph = new SelectedInclusionGraph(wg, Connections.NONE);
            selectedGraph.addAttributeToCopy(new GraphAttribute(wg, wg.getAttribute(GraphElementType.VERTEX, attribute)));
            arranger.arrange(selectedGraph.getInclusionGraph());
            selectedGraph.retrieveCoords();
        }
    }
}
Also used : GridArranger(au.gov.asd.tac.constellation.plugins.arrangements.grid.GridArranger) GraphWriteMethods(au.gov.asd.tac.constellation.graph.GraphWriteMethods) GridArranger(au.gov.asd.tac.constellation.plugins.arrangements.grid.GridArranger) Arranger(au.gov.asd.tac.constellation.plugins.arrangements.Arranger) GraphTaxonomyArranger(au.gov.asd.tac.constellation.plugins.arrangements.GraphTaxonomyArranger) Attribute(au.gov.asd.tac.constellation.graph.Attribute) GraphAttribute(au.gov.asd.tac.constellation.graph.GraphAttribute) GraphAttribute(au.gov.asd.tac.constellation.graph.GraphAttribute) SelectedInclusionGraph(au.gov.asd.tac.constellation.plugins.arrangements.SelectedInclusionGraph) GraphTaxonomyArranger(au.gov.asd.tac.constellation.plugins.arrangements.GraphTaxonomyArranger)

Example 3 with SelectedInclusionGraph

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

the class ArrangeInCirclePlugin method edit.

@Override
public void edit(final GraphWriteMethods wg, final PluginInteraction interaction, final PluginParameters parameters) throws InterruptedException {
    final SetRadiusForArrangement radiusSetter = new SetRadiusForArrangement(wg);
    radiusSetter.setRadii();
    final Arranger arranger = new CircleArranger();
    final SelectedInclusionGraph selectedGraph = new SelectedInclusionGraph(wg, SelectedInclusionGraph.Connections.NONE);
    arranger.setMaintainMean(!selectedGraph.isArrangingAll());
    arranger.arrange(selectedGraph.getInclusionGraph());
    selectedGraph.retrieveCoords();
}
Also used : SetRadiusForArrangement(au.gov.asd.tac.constellation.plugins.arrangements.SetRadiusForArrangement) Arranger(au.gov.asd.tac.constellation.plugins.arrangements.Arranger) SelectedInclusionGraph(au.gov.asd.tac.constellation.plugins.arrangements.SelectedInclusionGraph)

Example 4 with SelectedInclusionGraph

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

the class ArrangeInScatter3dGeneralPlugin 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 Scatter3dChoiceParameters scatter3dParams = Scatter3dChoiceParameters.getDefaultParameters();
    final String xDimensionName = pp.get(SCATTER_3D_X_ATTRIBUTE).getStringValue();
    final String yDimensionName = pp.get(SCATTER_3D_Y_ATTRIBUTE).getStringValue();
    final String zDimensionName = pp.get(SCATTER_3D_Z_ATTRIBUTE).getStringValue();
    if (StringUtils.isAnyBlank(new String[] { xDimensionName, yDimensionName, zDimensionName })) {
        interaction.notify(PluginNotificationLevel.FATAL, "You must supply all 3 attribute names for Scatter 3D");
        return;
    }
    scatter3dParams.setXDimension(xDimensionName);
    scatter3dParams.setYDimension(yDimensionName);
    scatter3dParams.setZDimension(zDimensionName);
    scatter3dParams.setLogarithmicX(pp.get(SCATTER_3D_X_LOGARITHMIC).getBooleanValue());
    scatter3dParams.setLogarithmicY(pp.get(SCATTER_3D_Y_LOGARITHMIC).getBooleanValue());
    scatter3dParams.setLogarithmicZ(pp.get(SCATTER_3D_Z_LOGARITHMIC).getBooleanValue());
    scatter3dParams.setDoNotScale(pp.get(SCATTER_3D_DO_NOT_SCALE).getBooleanValue());
    final SelectedInclusionGraph selectedGraph = new SelectedInclusionGraph(graph, SelectedInclusionGraph.Connections.NONE);
    selectedGraph.addAttributeToCopy(new GraphAttribute(graph, graph.getAttribute(GraphElementType.VERTEX, xDimensionName)));
    selectedGraph.addAttributeToCopy(new GraphAttribute(graph, graph.getAttribute(GraphElementType.VERTEX, yDimensionName)));
    selectedGraph.addAttributeToCopy(new GraphAttribute(graph, graph.getAttribute(GraphElementType.VERTEX, zDimensionName)));
    final Scatter3dArranger arranger = new Scatter3dArranger(scatter3dParams);
    arranger.arrange(selectedGraph.getInclusionGraph());
    selectedGraph.retrieveCoords();
}
Also used : SetRadiusForArrangement(au.gov.asd.tac.constellation.plugins.arrangements.SetRadiusForArrangement) GraphAttribute(au.gov.asd.tac.constellation.graph.GraphAttribute) PluginParameter(au.gov.asd.tac.constellation.plugins.parameters.PluginParameter) SelectedInclusionGraph(au.gov.asd.tac.constellation.plugins.arrangements.SelectedInclusionGraph)

Example 5 with SelectedInclusionGraph

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

the class SpectralArrangementPlugin 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 SpectralArranger();
        final Arranger outer = new GridArranger();
        final GraphTaxonomyArranger arranger = new GraphComponentArranger(inner, outer, Connections.LINKS);
        arranger.setSingletonArranger(new GridArranger());
        arranger.setDoubletArranger(new GridArranger());
        arranger.setInteraction(interaction);
        arranger.setMaintainMean(true);
        final SelectedInclusionGraph selectedGraph = new SelectedInclusionGraph(graph, Connections.LINKS);
        arranger.arrange(selectedGraph.getInclusionGraph());
        selectedGraph.retrieveCoords();
    }
    interaction.setProgress(1, 0, "Finished", true);
}
Also used : 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)

Aggregations

SelectedInclusionGraph (au.gov.asd.tac.constellation.plugins.arrangements.SelectedInclusionGraph)18 Arranger (au.gov.asd.tac.constellation.plugins.arrangements.Arranger)16 SetRadiusForArrangement (au.gov.asd.tac.constellation.plugins.arrangements.SetRadiusForArrangement)11 GraphTaxonomyArranger (au.gov.asd.tac.constellation.plugins.arrangements.GraphTaxonomyArranger)8 GraphComponentArranger (au.gov.asd.tac.constellation.plugins.arrangements.GraphComponentArranger)7 GridArranger (au.gov.asd.tac.constellation.plugins.arrangements.grid.GridArranger)6 GridChoiceParameters (au.gov.asd.tac.constellation.plugins.arrangements.grid.GridChoiceParameters)4 PluginParameter (au.gov.asd.tac.constellation.plugins.parameters.PluginParameter)3 GraphAttribute (au.gov.asd.tac.constellation.graph.GraphAttribute)2 Set (java.util.Set)2 Attribute (au.gov.asd.tac.constellation.graph.Attribute)1 GraphWriteMethods (au.gov.asd.tac.constellation.graph.GraphWriteMethods)1 UncollideArrangement (au.gov.asd.tac.constellation.plugins.arrangements.uncollide.UncollideArrangement)1