Search in sources :

Example 6 with IntegerParameterValue

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

the class LevenshteinDistancePlugin method createParameters.

@Override
public PluginParameters createParameters() {
    final PluginParameters parameters = new PluginParameters();
    final PluginParameter<SingleChoiceParameterType.SingleChoiceParameterValue> attributeType = SingleChoiceParameterType.build(ATTRIBUTE_PARAMETER_ID);
    attributeType.setName("Compare Attribute");
    attributeType.setDescription("The node attribute to compare");
    parameters.addParameter(attributeType);
    final PluginParameter<IntegerParameterValue> maxDistance = IntegerParameterType.build(MAXIMUM_DISTANCE_PARAMETER_ID);
    maxDistance.setName("Maximum Distance");
    maxDistance.setDescription("Only draws links between nodes whose attributes are at most this far apart");
    maxDistance.setIntegerValue(1);
    IntegerParameterType.setMinimum(maxDistance, 0);
    parameters.addParameter(maxDistance);
    final PluginParameter<BooleanParameterValue> caseInsensitiveParameter = BooleanParameterType.build(CASE_INSENSITIVE_PARAMETER_ID);
    caseInsensitiveParameter.setName("Case Insensitive");
    caseInsensitiveParameter.setDescription("Ignore case when comparing attribute");
    caseInsensitiveParameter.setBooleanValue(false);
    parameters.addParameter(caseInsensitiveParameter);
    final PluginParameter<BooleanParameterValue> selectedOnlyParameter = BooleanParameterType.build(SELECTED_ONLY_PARAMETER_ID);
    selectedOnlyParameter.setName("Selected Only");
    selectedOnlyParameter.setDescription("Compare selected nodes only");
    selectedOnlyParameter.setBooleanValue(false);
    parameters.addParameter(selectedOnlyParameter);
    return parameters;
}
Also used : 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)

Example 7 with IntegerParameterValue

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

the class GatherNodesPlugin method createParameters.

@Override
public PluginParameters createParameters() {
    final PluginParameters parameters = new PluginParameters();
    final PluginParameter<IntegerParameterValue> vxIdParam = IntegerParameterType.build(VXID_PARAMETER_ID);
    vxIdParam.setName("Vertex Id");
    vxIdParam.setDescription("The vertex id to gather around");
    parameters.addParameter(vxIdParam);
    final PluginParameter<ObjectParameterValue> gathersParam = ObjectParameterType.build(GATHERS_PARAMETER_ID);
    gathersParam.setName("Gather Vertex Ids");
    gathersParam.setDescription("A set of vertex ids to gather");
    parameters.addParameter(gathersParam);
    return parameters;
}
Also used : IntegerParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.IntegerParameterType.IntegerParameterValue) PluginParameters(au.gov.asd.tac.constellation.plugins.parameters.PluginParameters) ObjectParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.ObjectParameterType.ObjectParameterValue)

Example 8 with IntegerParameterValue

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

the class ArrangeInGridGeneralPlugin method createParameters.

@Override
public PluginParameters createParameters() {
    final PluginParameters parameters = new PluginParameters();
    // Use the GridChoiceParameters defaults to set the plugin defaults.
    final GridChoiceParameters defaults = GridChoiceParameters.getDefaultParameters();
    final PluginParameter<SingleChoiceParameterValue> gridChoiceParam = SingleChoiceParameterType.build(GRID_CHOICE_PARAMETER_ID);
    gridChoiceParam.setName("Grid choice");
    gridChoiceParam.setDescription("The type of grid arrangement");
    SingleChoiceParameterType.setOptions(gridChoiceParam, GridChoice.getChoices());
    SingleChoiceParameterType.setChoice(gridChoiceParam, defaults.getGridChoice().toString());
    parameters.addParameter(gridChoiceParam);
    final PluginParameter<FloatParameterValue> sizeGainParam = FloatParameterType.build(SIZE_GAIN_PARAMETER_ID);
    sizeGainParam.setName("Size gain");
    sizeGainParam.setDescription("The size gain, the default is " + defaults.getSizeGain());
    sizeGainParam.setFloatValue(defaults.getSizeGain());
    parameters.addParameter(sizeGainParam);
    final PluginParameter<IntegerParameterValue> horizontalGapParam = IntegerParameterType.build(HORIZONTAL_GAP_PARAMETER_ID);
    horizontalGapParam.setName("Horizontal gap");
    horizontalGapParam.setDescription("The horizontal gap, the default is " + defaults.getHorizontalGap());
    horizontalGapParam.setIntegerValue(defaults.getHorizontalGap());
    parameters.addParameter(horizontalGapParam);
    final PluginParameter<IntegerParameterValue> verticalGapParam = IntegerParameterType.build(VERTICAL_GAP_PARAMETER_ID);
    verticalGapParam.setName("Vertical gap");
    verticalGapParam.setDescription("The verticle gap, the default is " + defaults.getVerticalGap());
    verticalGapParam.setIntegerValue(defaults.getVerticalGap());
    parameters.addParameter(verticalGapParam);
    final PluginParameter<BooleanParameterValue> offsetRowsParam = BooleanParameterType.build(OFFSET_ROWS_PARAMETER_ID);
    offsetRowsParam.setName("Offset even numbered rows");
    offsetRowsParam.setDescription("Offset even numbered rows, the default is " + defaults.hasRowOffsets());
    offsetRowsParam.setBooleanValue(defaults.hasRowOffsets());
    parameters.addParameter(offsetRowsParam);
    final PluginParameter<BooleanParameterValue> maintainMeanParam = BooleanParameterType.build(MAINTAIN_MEAN_PARAMETER_ID);
    maintainMeanParam.setName("Maintain Mean");
    maintainMeanParam.setDescription("Maintain Mean, default is True");
    maintainMeanParam.setBooleanValue(true);
    parameters.addParameter(maintainMeanParam);
    return parameters;
}
Also used : FloatParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.FloatParameterType.FloatParameterValue) 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)

Example 9 with IntegerParameterValue

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

the class LayerByTimePlugin method createParameters.

@Override
public PluginParameters createParameters() {
    final PluginParameters parameters = new PluginParameters();
    dtAttrParam = SingleChoiceParameterType.build(DATETIME_ATTRIBUTE_PARAMETER_ID);
    dtAttrParam.setName(DATETIME_PARAMETER_ID_NAME);
    dtAttrParam.setDescription(DATETIME_ATTRIBUTE_PARAMETER_ID_DESCRIPTION);
    parameters.addParameter(dtAttrParam);
    dateRangeParam = DateTimeRangeParameterType.build(DATE_RANGE_PARAMETER_ID);
    dateRangeParam.setName(DATE_RANGE_PARAMETER_ID_NAME);
    dateRangeParam.setDescription(DATE_RANGE_PARAM_DESCRIPTION);
    dateRangeParam.setDateTimeRangeValue(DATE_RANGE_PARAMETER_ID_DEFAULT);
    parameters.addParameter(dateRangeParam);
    final PluginParameter<SingleChoiceParameterValue> layerByParam = SingleChoiceParameterType.build(LAYER_BY_PARAMETER_ID);
    layerByParam.setName(LAYER_BY_PARAMETER_ID_NAME);
    layerByParam.setDescription(LAYER_BY_PARAMETER_ID_DESCRIPTION);
    SingleChoiceParameterType.setOptions(layerByParam, LAYER_BY_PARAM_VALUES);
    SingleChoiceParameterType.setChoice(layerByParam, LAYER_BY_PARAMETER_ID_DEFAULT);
    parameters.addParameter(layerByParam);
    final PluginParameter<IntegerParameterValue> amountParam = IntegerParameterType.build(AMOUNT_PARAMETER_ID);
    amountParam.setName(AMOUNT_PARAMETER_ID_NAME);
    amountParam.setDescription(AMOUNT_PARAMETER_ID_DESCRIPTION);
    amountParam.setIntegerValue(AMOUNT_PARAMETER_ID_DEFAULT);
    parameters.addParameter(amountParam);
    final PluginParameter<SingleChoiceParameterValue> unitParam = SingleChoiceParameterType.build(UNIT_PARAMETER_ID);
    unitParam.setName(UNIT_PARAMETER_ID_NAME);
    unitParam.setDescription(UNIT_PARAMETER_ID_DESCRIPTION);
    SingleChoiceParameterType.setOptions(unitParam, new ArrayList<>(LAYER_INTERVALS.keySet()));
    SingleChoiceParameterType.setChoice(unitParam, UNIT_PARAMETER_ID_DEFAULT);
    parameters.addParameter(unitParam);
    final PluginParameter<BooleanParameterValue> transactionParam = BooleanParameterType.build(TRANSACTION_AS_LAYER_PARAMETER_ID);
    transactionParam.setName(TRANSACTION_AS_LAYER_NAME);
    transactionParam.setDescription(TRANSACTION_AS_LAYER_DESCRIPTION);
    transactionParam.setBooleanValue(TRANSACTION_AS_LAYER_DEFAULT);
    parameters.addParameter(transactionParam);
    final PluginParameter<BooleanParameterValue> keepTxColorsParam = BooleanParameterType.build(KEEP_TX_COLORS_PARAMETER_ID);
    keepTxColorsParam.setName(KEEP_TX_COLORS_NAME);
    keepTxColorsParam.setDescription(KEEP_TX_COLORS_DESCRIPTION);
    keepTxColorsParam.setBooleanValue(KEEP_TX_COLORS_DEFAULT);
    parameters.addParameter(keepTxColorsParam);
    final PluginParameter<BooleanParameterValue> drawTxGuidesParam = BooleanParameterType.build(DRAW_TX_GUIDES_PARAMETER_ID);
    drawTxGuidesParam.setName(DRAW_TX_GUIDES_NAME);
    drawTxGuidesParam.setDescription(DRAW_TX_GUIDES_DESCRIPTION);
    drawTxGuidesParam.setBooleanValue(DRAW_TX_GUIDES_DEFAULT);
    parameters.addParameter(drawTxGuidesParam);
    parameters.addController(LAYER_BY_PARAMETER_ID, (masterId, paramMap, change) -> {
        if (change == ParameterChange.VALUE) {
            if (paramMap.get(LAYER_BY_PARAMETER_ID).getStringValue().equals(INTERVAL_METHOD)) {
                SingleChoiceParameterType.setOptions(unitParam, new ArrayList<>(LAYER_INTERVALS.keySet()));
                SingleChoiceParameterType.setChoice(unitParam, UNIT_PARAMETER_ID_INTERVAL_DEFAULT);
                parameters.getParameters().get(AMOUNT_PARAMETER_ID).setEnabled(true);
            } else if (paramMap.get(LAYER_BY_PARAMETER_ID).getStringValue().equals(BIN_METHOD)) {
                SingleChoiceParameterType.setOptions(unitParam, new ArrayList<>(BIN_CALENDAR_UNITS.keySet()));
                SingleChoiceParameterType.setChoice(unitParam, UNIT_PARAMETER_ID_BIN_DEFAULT);
                parameters.getParameters().get(AMOUNT_PARAMETER_ID).setEnabled(false);
            } else {
            // Do nothing
            }
        }
    });
    return parameters;
}
Also used : BooleanParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.BooleanParameterType.BooleanParameterValue) IntegerParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.IntegerParameterType.IntegerParameterValue) ArrayList(java.util.ArrayList) PluginParameters(au.gov.asd.tac.constellation.plugins.parameters.PluginParameters) SingleChoiceParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.SingleChoiceParameterType.SingleChoiceParameterValue)

Example 10 with IntegerParameterValue

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

the class RandomArrangementPlugin method createParameters.

@Override
public PluginParameters createParameters() {
    final PluginParameters parameters = new PluginParameters();
    final PluginParameter<IntegerParameterValue> dimensionsParam = IntegerParameterType.build(DIMENSIONS_PARAMETER_ID);
    dimensionsParam.setName(DIMENSIONS_PARAMETER_ID);
    dimensionsParam.setDescription("The dimension being 2D or 3D. The default is 2 for 2D.");
    dimensionsParam.setIntegerValue(2);
    parameters.addParameter(dimensionsParam);
    return parameters;
}
Also used : IntegerParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.IntegerParameterType.IntegerParameterValue) PluginParameters(au.gov.asd.tac.constellation.plugins.parameters.PluginParameters)

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