Search in sources :

Example 1 with TransactionTypeParameterValue

use of au.gov.asd.tac.constellation.views.analyticview.analytics.ScoreAnalyticPlugin.TransactionTypeParameterValue in project constellation by constellation-app.

the class MostLikelyCorrelatedQuestion method initialiseParameters.

@Override
public void initialiseParameters(final AnalyticPlugin<ScoreResult> plugin, final PluginParameters parameters) {
    // TRANSACTION_TYPES_PARAMETER always of type MultiChoiceParameter
    @SuppressWarnings("unchecked") final PluginParameter<MultiChoiceParameterValue> transactionTypeParameter = (PluginParameter<MultiChoiceParameterValue>) parameters.getParameters().get(ScoreAnalyticPlugin.TRANSACTION_TYPES_PARAMETER_ID);
    final List<TransactionTypeParameterValue> newChecked = new ArrayList<>();
    final List<ParameterValue> checked = transactionTypeParameter.getMultiChoiceValue().getChoicesData();
    checked.forEach(parameterValue -> {
        final TransactionTypeParameterValue transactionTypeParameterValue = (TransactionTypeParameterValue) parameterValue;
        final SchemaTransactionType transactionType = (SchemaTransactionType) transactionTypeParameterValue.getObjectValue();
        if (transactionType == null || !transactionType.isSubTypeOf(AnalyticConcept.TransactionType.SIMILARITY)) {
            newChecked.add(transactionTypeParameterValue);
        }
    });
    MultiChoiceParameterType.setChoicesData(transactionTypeParameter, newChecked);
    parameters.setBooleanValue(CosineSimilarityPlugin.INCLUDE_CONNECTIONS_IN_PARAMETER_ID, true);
    parameters.setBooleanValue(CosineSimilarityPlugin.INCLUDE_CONNECTIONS_OUT_PARAMETER_ID, true);
    parameters.setBooleanValue(CosineSimilarityPlugin.TREAT_UNDIRECTED_BIDIRECTIONAL_PARAMETER_ID, true);
}
Also used : SchemaTransactionType(au.gov.asd.tac.constellation.graph.schema.type.SchemaTransactionType) MultiChoiceParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.MultiChoiceParameterType.MultiChoiceParameterValue) TransactionTypeParameterValue(au.gov.asd.tac.constellation.views.analyticview.analytics.ScoreAnalyticPlugin.TransactionTypeParameterValue) ParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.ParameterValue) MultiChoiceParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.MultiChoiceParameterType.MultiChoiceParameterValue) ArrayList(java.util.ArrayList) TransactionTypeParameterValue(au.gov.asd.tac.constellation.views.analyticview.analytics.ScoreAnalyticPlugin.TransactionTypeParameterValue) PluginParameter(au.gov.asd.tac.constellation.plugins.parameters.PluginParameter)

Aggregations

SchemaTransactionType (au.gov.asd.tac.constellation.graph.schema.type.SchemaTransactionType)1 PluginParameter (au.gov.asd.tac.constellation.plugins.parameters.PluginParameter)1 MultiChoiceParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.MultiChoiceParameterType.MultiChoiceParameterValue)1 ParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.ParameterValue)1 TransactionTypeParameterValue (au.gov.asd.tac.constellation.views.analyticview.analytics.ScoreAnalyticPlugin.TransactionTypeParameterValue)1 ArrayList (java.util.ArrayList)1