Search in sources :

Example 6 with ElementTypeParameterValue

use of au.gov.asd.tac.constellation.plugins.parameters.types.ElementTypeParameterValue in project constellation by constellation-app.

the class HistogramClearFilterPlugin method createParameters.

@Override
public PluginParameters createParameters() {
    final PluginParameters parameters = new PluginParameters();
    final PluginParameter<SingleChoiceParameterType.SingleChoiceParameterValue> elementTypeParameter = SingleChoiceParameterType.build(ELEMENT_TYPE_PARAMETER_ID, ElementTypeParameterValue.class);
    elementTypeParameter.setName("Element Type");
    elementTypeParameter.setDescription("The graph element type");
    final List<ElementTypeParameterValue> elementTypes = new ArrayList<>();
    elementTypes.add(new ElementTypeParameterValue(GraphElementType.TRANSACTION));
    elementTypes.add(new ElementTypeParameterValue(GraphElementType.VERTEX));
    elementTypes.add(new ElementTypeParameterValue(GraphElementType.EDGE));
    elementTypes.add(new ElementTypeParameterValue(GraphElementType.LINK));
    SingleChoiceParameterType.setOptionsData(elementTypeParameter, elementTypes);
    parameters.addParameter(elementTypeParameter);
    return parameters;
}
Also used : ElementTypeParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.ElementTypeParameterValue) ArrayList(java.util.ArrayList) PluginParameters(au.gov.asd.tac.constellation.plugins.parameters.PluginParameters)

Example 7 with ElementTypeParameterValue

use of au.gov.asd.tac.constellation.plugins.parameters.types.ElementTypeParameterValue in project constellation by constellation-app.

the class ScatterChartPane method selectElementsOnGraph.

/**
 * Update the current selection on the active graph.
 *
 * @param selectedData
 * @param selectionMode
 * @throws InterruptedException
 */
private void selectElementsOnGraph(final Set<ScatterData> selectedData, final SelectionMode selectionMode) throws InterruptedException {
    if (scatterPlot.getScatterPlot().getCurrentGraph() == null) {
        return;
    }
    final ScatterPlotState state = scatterPlot.getScatterPlot().getState();
    final BitSet elementIds = new BitSet();
    if (selectedData != null) {
        for (final ScatterData data : selectedData) {
            elementIds.set(data.getElementId());
        }
    }
    PluginExecution.withPlugin(VisualGraphPluginRegistry.CHANGE_SELECTION).withParameter(ChangeSelectionPlugin.ELEMENT_BIT_SET_PARAMETER_ID, elementIds).withParameter(ChangeSelectionPlugin.ELEMENT_TYPE_PARAMETER_ID, new ElementTypeParameterValue(state.getElementType())).withParameter(ChangeSelectionPlugin.SELECTION_MODE_PARAMETER_ID, selectionMode).executeLater(scatterPlot.getScatterPlot().getCurrentGraph());
}
Also used : ElementTypeParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.ElementTypeParameterValue) ScatterPlotState(au.gov.asd.tac.constellation.views.scatterplot.state.ScatterPlotState) BitSet(java.util.BitSet)

Example 8 with ElementTypeParameterValue

use of au.gov.asd.tac.constellation.plugins.parameters.types.ElementTypeParameterValue in project constellation by constellation-app.

the class HistogramFilterOnSelectionPlugin method createParameters.

@Override
public PluginParameters createParameters() {
    final PluginParameters parameters = new PluginParameters();
    final PluginParameter<SingleChoiceParameterType.SingleChoiceParameterValue> elementTypeParameter = SingleChoiceParameterType.build(ELEMENT_TYPE_PARAMETER_ID, ElementTypeParameterValue.class);
    elementTypeParameter.setName("Element Type");
    elementTypeParameter.setDescription("The graph element type");
    final List<ElementTypeParameterValue> elementTypes = new ArrayList<>();
    elementTypes.add(new ElementTypeParameterValue(GraphElementType.TRANSACTION));
    elementTypes.add(new ElementTypeParameterValue(GraphElementType.VERTEX));
    elementTypes.add(new ElementTypeParameterValue(GraphElementType.EDGE));
    elementTypes.add(new ElementTypeParameterValue(GraphElementType.LINK));
    SingleChoiceParameterType.setOptionsData(elementTypeParameter, elementTypes);
    parameters.addParameter(elementTypeParameter);
    return parameters;
}
Also used : ElementTypeParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.ElementTypeParameterValue) ArrayList(java.util.ArrayList) PluginParameters(au.gov.asd.tac.constellation.plugins.parameters.PluginParameters)

Example 9 with ElementTypeParameterValue

use of au.gov.asd.tac.constellation.plugins.parameters.types.ElementTypeParameterValue in project constellation by constellation-app.

the class HistogramTopComponent method clearFilter.

void clearFilter() {
    if (currentGraph != null) {
        Plugin plugin = new HistogramClearFilterPlugin();
        PluginParameters params = plugin.createParameters();
        params.getParameters().get(HistogramClearFilterPlugin.ELEMENT_TYPE_PARAMETER_ID).setObjectValue(new ElementTypeParameterValue(currentHistogramState.getElementType()));
        PluginExecution.withPlugin(plugin).withParameters(params).executeLater(currentGraph);
    }
}
Also used : ElementTypeParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.ElementTypeParameterValue) PluginParameters(au.gov.asd.tac.constellation.plugins.parameters.PluginParameters) SimpleEditPlugin(au.gov.asd.tac.constellation.plugins.templates.SimpleEditPlugin) SimpleReadPlugin(au.gov.asd.tac.constellation.plugins.templates.SimpleReadPlugin) Plugin(au.gov.asd.tac.constellation.plugins.Plugin)

Aggregations

ElementTypeParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.ElementTypeParameterValue)9 PluginParameters (au.gov.asd.tac.constellation.plugins.parameters.PluginParameters)7 ArrayList (java.util.ArrayList)5 SimpleReadPlugin (au.gov.asd.tac.constellation.plugins.templates.SimpleReadPlugin)4 Graph (au.gov.asd.tac.constellation.graph.Graph)3 ReadableGraph (au.gov.asd.tac.constellation.graph.ReadableGraph)3 SingleChoiceParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.SingleChoiceParameterType.SingleChoiceParameterValue)3 GraphAttribute (au.gov.asd.tac.constellation.graph.GraphAttribute)2 GraphConstants (au.gov.asd.tac.constellation.graph.GraphConstants)2 GraphElementType (au.gov.asd.tac.constellation.graph.GraphElementType)2 GraphReadMethods (au.gov.asd.tac.constellation.graph.GraphReadMethods)2 GraphManager (au.gov.asd.tac.constellation.graph.manager.GraphManager)2 GraphNode (au.gov.asd.tac.constellation.graph.node.GraphNode)2 GraphRecordStoreUtilities (au.gov.asd.tac.constellation.graph.processing.GraphRecordStoreUtilities)2 SpatialConcept (au.gov.asd.tac.constellation.graph.schema.analytic.concept.SpatialConcept)2 VisualConcept (au.gov.asd.tac.constellation.graph.schema.visual.concept.VisualConcept)2 PluginException (au.gov.asd.tac.constellation.plugins.PluginException)2 PluginInteraction (au.gov.asd.tac.constellation.plugins.PluginInteraction)2 PluginNotificationLevel (au.gov.asd.tac.constellation.plugins.PluginNotificationLevel)2 ELEMENT_TYPE_PARAMETER_ID (au.gov.asd.tac.constellation.plugins.importexport.geospatial.AbstractGeoExportPlugin.ELEMENT_TYPE_PARAMETER_ID)2