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;
}
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());
}
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;
}
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);
}
}
Aggregations