Search in sources :

Example 16 with StringParameterValue

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

the class CloseGraphPlugin method createParameters.

@Override
public PluginParameters createParameters() {
    final PluginParameters parameters = new PluginParameters();
    final PluginParameter<StringParameterValue> graphIdParameter = StringParameterType.build(GRAPH_PARAMETER_ID);
    graphIdParameter.setName("graphId");
    graphIdParameter.setDescription("The Id of the graph");
    parameters.addParameter(graphIdParameter);
    final PluginParameter<BooleanParameterValue> forcedParameter = BooleanParameterType.build(FORCED_PARAMETER_ID);
    forcedParameter.setName("forced");
    forcedParameter.setDescription("Whether the graph will be force closed or not");
    forcedParameter.setBooleanValue(false);
    parameters.addParameter(forcedParameter);
    return parameters;
}
Also used : BooleanParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.BooleanParameterType.BooleanParameterValue) StringParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.StringParameterValue) PluginParameters(au.gov.asd.tac.constellation.plugins.parameters.PluginParameters)

Example 17 with StringParameterValue

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

the class MapViewTopComponent method createParameters.

private PluginParameters createParameters() {
    final PluginParameters parameters = new PluginParameters();
    final PluginParameter<SingleChoiceParameterValue> geoTypeParameter = SingleChoiceParameterType.build(PARAMETER_TYPE);
    geoTypeParameter.setName("Geo Type");
    SingleChoiceParameterType.setOptions(geoTypeParameter, Arrays.asList(GEO_TYPE_COORDINATE, GEO_TYPE_GEOHASH, GEO_TYPE_MGRS));
    SingleChoiceParameterType.setChoice(geoTypeParameter, GEO_TYPE_COORDINATE);
    parameters.addParameter(geoTypeParameter);
    final PluginParameter<StringParameterValue> locationParameter = StringParameterType.build(PARAMETER_LOCATION);
    locationParameter.setName("Location");
    locationParameter.setDescription("Enter a coordinate in decimal degrees (and optionally " + "a radius in kilometers) with components separated by spaces or commas");
    locationParameter.setStringValue(null);
    parameters.addParameter(locationParameter);
    PluginParameterController controller = ((master, params, change) -> {
        // master will need to be of type SingleChoiceParameter
        @SuppressWarnings("unchecked") final PluginParameter<SingleChoiceParameterValue> typedMaster = (PluginParameter<SingleChoiceParameterValue>) master;
        switch(SingleChoiceParameterType.getChoice(typedMaster)) {
            case GEO_TYPE_COORDINATE:
                params.get(PARAMETER_LOCATION).setDescription("Enter a coordinate in decimal degrees (and optionally a radius " + "in kilometers) with components separated by spaces or commas");
                break;
            case GEO_TYPE_GEOHASH:
                params.get(PARAMETER_LOCATION).setDescription("Enter a base-16 geohash value");
                break;
            case GEO_TYPE_MGRS:
                params.get(PARAMETER_LOCATION).setDescription("Enter an MGRS value");
                break;
            default:
                break;
        }
    });
    parameters.addController(PARAMETER_TYPE, controller);
    return parameters;
}
Also used : StringParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.StringParameterValue) PluginParameters(au.gov.asd.tac.constellation.plugins.parameters.PluginParameters) PluginParameterController(au.gov.asd.tac.constellation.plugins.parameters.PluginParameterController) PluginParameter(au.gov.asd.tac.constellation.plugins.parameters.PluginParameter) SingleChoiceParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.SingleChoiceParameterType.SingleChoiceParameterValue)

Example 18 with StringParameterValue

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

the class SynchronizerPlugin method createParameters.

@Override
public PluginParameters createParameters() {
    final PluginParameters parameters = new PluginParameters();
    parameters.addParameter(StringParameterType.build(NAME_PARAMETER_ID));
    parameters.addParameter(StringParameterType.build(COPY_PARAMETER_ID));
    parameters.addController(NAME_PARAMETER_ID, (final PluginParameter<?> master, final Map<String, PluginParameter<?>> params, final ParameterChange change) -> {
        if (change == ParameterChange.VALUE) {
            // COPY_PARAMETER will be of type StringParameter
            @SuppressWarnings("unchecked") final PluginParameter<StringParameterValue> slave = (PluginParameter<StringParameterValue>) params.get(COPY_PARAMETER_ID);
            slave.setStringValue("COPY: " + master.getStringValue());
        }
    });
    return parameters;
}
Also used : ParameterChange(au.gov.asd.tac.constellation.plugins.parameters.ParameterChange) StringParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.StringParameterValue) PluginParameters(au.gov.asd.tac.constellation.plugins.parameters.PluginParameters) PluginParameter(au.gov.asd.tac.constellation.plugins.parameters.PluginParameter) Map(java.util.Map)

Example 19 with StringParameterValue

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

the class GetIcon method createParameters.

@Override
public PluginParameters createParameters() {
    final PluginParameters parameters = new PluginParameters();
    final PluginParameter<StringParameterValue> nameParam = StringParameterType.build(ICON_PARAMETER_ID);
    nameParam.setName("Icon Name");
    nameParam.setDescription("The name of the icon to return as a PNG file.");
    nameParam.setRequired(true);
    parameters.addParameter(nameParam);
    return parameters;
}
Also used : StringParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.StringParameterValue) PluginParameters(au.gov.asd.tac.constellation.plugins.parameters.PluginParameters)

Example 20 with StringParameterValue

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

the class GetPluginDescription method createParameters.

@Override
public PluginParameters createParameters() {
    final PluginParameters parameters = new PluginParameters();
    final PluginParameter<StringParameterValue> nameParam = StringParameterType.build(PLUGIN_NAME_PARAMETER_ID);
    nameParam.setName("Plugin name");
    nameParam.setDescription("Plugin name to get the description and parameters.");
    nameParam.setRequired(true);
    parameters.addParameter(nameParam);
    return parameters;
}
Also used : StringParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.StringParameterValue) PluginParameters(au.gov.asd.tac.constellation.plugins.parameters.PluginParameters)

Aggregations

PluginParameters (au.gov.asd.tac.constellation.plugins.parameters.PluginParameters)50 StringParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.StringParameterValue)50 BooleanParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.BooleanParameterType.BooleanParameterValue)13 SingleChoiceParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.SingleChoiceParameterType.SingleChoiceParameterValue)9 PluginParameter (au.gov.asd.tac.constellation.plugins.parameters.PluginParameter)6 ObjectParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.ObjectParameterType.ObjectParameterValue)5 ArrayList (java.util.ArrayList)5 Map (java.util.Map)5 ParameterChange (au.gov.asd.tac.constellation.plugins.parameters.ParameterChange)3 IntegerParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.IntegerParameterType.IntegerParameterValue)3 Graph (au.gov.asd.tac.constellation.graph.Graph)2 ColorParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.ColorParameterType.ColorParameterValue)2 NbPreferences (org.openide.util.NbPreferences)2 GraphElementType (au.gov.asd.tac.constellation.graph.GraphElementType)1 GraphReadMethods (au.gov.asd.tac.constellation.graph.GraphReadMethods)1 GraphWriteMethods (au.gov.asd.tac.constellation.graph.GraphWriteMethods)1 ReadableGraph (au.gov.asd.tac.constellation.graph.ReadableGraph)1 StoreGraph (au.gov.asd.tac.constellation.graph.StoreGraph)1 GraphDataObject (au.gov.asd.tac.constellation.graph.file.GraphDataObject)1 GraphObjectUtilities (au.gov.asd.tac.constellation.graph.file.GraphObjectUtilities)1