Search in sources :

Example 51 with IntegerParameterValue

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

the class TestParameterBuildingPlugin method createParameters.

@Override
public PluginParameters createParameters() {
    final PluginParameters params = new PluginParameters();
    final PluginParameter<SingleChoiceParameterValue> fupChoiceParam = SingleChoiceParameterType.build(CHOICE_PARAMETER_ID);
    fupChoiceParam.setName(SOME_CHOICE_NAME);
    fupChoiceParam.setDescription(SOME_CHOICE_DESCRIPTION);
    SingleChoiceParameterType.setOptions(fupChoiceParam, Arrays.asList("Choice 1", "Choice 2", "Choice 3"));
    SingleChoiceParameterType.setChoice(fupChoiceParam, "Choice 1");
    params.addParameter(fupChoiceParam);
    final PluginParameter<LocalDateParameterValue> ldParam = LocalDateParameterType.build(LOCALDATE_PARAMETER_ID);
    ldParam.setName("Date");
    ldParam.setDescription("Pick a day");
    params.addParameter(ldParam);
    final PluginParameter<IntegerParameterValue> lenParam = IntegerParameterType.build(INT_PARAMETER_ID);
    lenParam.setName(SOME_INT_NAME);
    lenParam.setDescription(SOME_INT_DESCRIPTION);
    lenParam.setIntegerValue(5);
    params.addParameter(lenParam);
    final PluginParameter<FloatParameterValue> thresholdParam = FloatParameterType.build(FLOAT_PARAMETER_ID);
    thresholdParam.setName(FLOAT_NAME);
    thresholdParam.setDescription(FLOAT_DESCRIPTION);
    thresholdParam.setFloatValue(0F);
    FloatParameterType.setMinimum(thresholdParam, 0);
    FloatParameterType.setMaximum(thresholdParam, 1);
    FloatParameterType.setStep(thresholdParam, 0.1F);
    params.addParameter(thresholdParam);
    final PluginParameter<BooleanParameterValue> caseParam = BooleanParameterType.build(BOOLEAN_PARAMETER_ID);
    caseParam.setName(SOME_BOOLEAN_NAME);
    caseParam.setDescription(SOME_BOOLEAN_DESCRIPTION);
    params.addParameter(caseParam);
    for (int i = 0; i < 2; i++) {
        final PluginParameter<StringParameterValue> text = StringParameterType.build("text" + i);
        text.setName("Some text " + i);
        text.setDescription("Type some text into this thing");
        text.setStringValue("Value " + i);
        params.addParameter(text);
    }
    return params;
}
Also used : LocalDateParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.LocalDateParameterType.LocalDateParameterValue) FloatParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.FloatParameterType.FloatParameterValue) StringParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.StringParameterValue) BooleanParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.BooleanParameterType.BooleanParameterValue) IntegerParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.IntegerParameterType.IntegerParameterValue) PluginParameters(au.gov.asd.tac.constellation.plugins.parameters.PluginParameters) SingleChoiceParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.SingleChoiceParameterType.SingleChoiceParameterValue)

Aggregations

IntegerParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.IntegerParameterType.IntegerParameterValue)51 PluginParameters (au.gov.asd.tac.constellation.plugins.parameters.PluginParameters)44 BooleanParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.BooleanParameterType.BooleanParameterValue)27 SingleChoiceParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.SingleChoiceParameterType.SingleChoiceParameterValue)13 PluginParameter (au.gov.asd.tac.constellation.plugins.parameters.PluginParameter)11 FloatParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.FloatParameterType.FloatParameterValue)8 ArrayList (java.util.ArrayList)8 Test (org.testng.annotations.Test)8 MultiChoiceParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.MultiChoiceParameterType.MultiChoiceParameterValue)5 ObjectParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.ObjectParameterType.ObjectParameterValue)5 ParameterChange (au.gov.asd.tac.constellation.plugins.parameters.ParameterChange)4 Map (java.util.Map)4 StringParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.StringParameterValue)3 LinkedHashMap (java.util.LinkedHashMap)3 ColorParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.ColorParameterType.ColorParameterValue)2 LocalDateParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.LocalDateParameterType.LocalDateParameterValue)2 GraphElementType (au.gov.asd.tac.constellation.graph.GraphElementType)1 SchemaTransactionType (au.gov.asd.tac.constellation.graph.schema.type.SchemaTransactionType)1 SchemaVertexType (au.gov.asd.tac.constellation.graph.schema.type.SchemaVertexType)1 PluginParametersPane (au.gov.asd.tac.constellation.plugins.gui.PluginParametersPane)1