use of au.gov.asd.tac.constellation.plugins.parameters.types.IntegerParameterType.IntegerParameterValue in project constellation by constellation-app.
the class AddBlazePlugin method createParameters.
@Override
public PluginParameters createParameters() {
final PluginParameters parameters = new PluginParameters();
final PluginParameter<IntegerParameterValue> vertexIdParam = IntegerParameterType.build(VERTEX_ID_PARAMETER_ID);
vertexIdParam.setName("Vertex Id");
vertexIdParam.setDescription("The vertex id of the node to set a blaze");
vertexIdParam.setObjectValue(Graph.NOT_FOUND);
parameters.addParameter(vertexIdParam);
final PluginParameter<ObjectParameterValue> vertexIdsParam = ObjectParameterType.build(VERTEX_IDS_PARAMETER_ID);
vertexIdsParam.setObjectValue(null);
vertexIdsParam.setName("Vertex Ids");
vertexIdsParam.setDescription("The list of vertex ids to set a blaze for in bulk");
parameters.addParameter(vertexIdsParam);
return parameters;
}
use of au.gov.asd.tac.constellation.plugins.parameters.types.IntegerParameterType.IntegerParameterValue in project constellation by constellation-app.
the class HopOutPlugin method createParameters.
@Override
public PluginParameters createParameters() {
final PluginParameters parameters = new PluginParameters();
final PluginParameter<IntegerParameterValue> hopsParam = IntegerParameterType.build(HOPS_PARAMETER_ID);
hopsParam.setName("Hops");
hopsParam.setDescription("The number of hops. 0 is hop out half, 1 is hop out 1 and 2 to hop out full.");
hopsParam.setIntegerValue(HopUtilities.HOP_OUT_HALF);
parameters.addParameter(hopsParam);
final PluginParameter<BooleanParameterValue> outgoingParam = BooleanParameterType.build(OUTGOING_PARAMETER_ID);
outgoingParam.setName("Outgoing");
outgoingParam.setDescription("True if outgoing transactions should be included, default is True");
outgoingParam.setBooleanValue(true);
parameters.addParameter(outgoingParam);
final PluginParameter<BooleanParameterValue> incomingParam = BooleanParameterType.build(INCOMING_PARAMETER_ID);
incomingParam.setName("Incoming");
incomingParam.setDescription("True is incoming transactions should be included, default is True");
incomingParam.setBooleanValue(true);
parameters.addParameter(incomingParam);
final PluginParameter<BooleanParameterValue> undirectedParam = BooleanParameterType.build(UNDIRECTED_PARAMETER_ID);
undirectedParam.setName("Undirected");
undirectedParam.setDescription("True is undirected transactions should be included, default is True");
undirectedParam.setBooleanValue(true);
parameters.addParameter(undirectedParam);
return parameters;
}
use of au.gov.asd.tac.constellation.plugins.parameters.types.IntegerParameterType.IntegerParameterValue in project constellation by constellation-app.
the class IntegerParameterTypeNGTest method testSetStep.
/**
* Test of setStep method, of class IntegerParameterType.
*/
@Test
public void testSetStep() {
System.out.println("setStep");
// Step shouldnt be allowed to be 0
// unsure if it could be negative and go backwards?
// step shouldn't be able to be greater than maximum value
String id = "Step";
PluginParameter<IntegerParameterType.IntegerParameterValue> parameter = new PluginParameter<>(new IntegerParameterValue(), INSTANCE, id);
// step shouldn't be allowed to be 0
int step = 0;
IntegerParameterType.setStep(parameter, step);
assertEquals(parameter.getParameterValue().getStepValue(), step);
// step should be allowed to be positive
step = 6;
IntegerParameterType.setStep(parameter, step);
assertEquals(parameter.getParameterValue().getStepValue(), step);
// step shouldn't be allowed to be negative
step = -4;
IntegerParameterType.setStep(parameter, step);
assertEquals(parameter.getParameterValue().getStepValue(), step);
}
use of au.gov.asd.tac.constellation.plugins.parameters.types.IntegerParameterType.IntegerParameterValue in project constellation by constellation-app.
the class IntegerParameterTypeNGTest method testSetMinimum.
/**
* Test of setMinimum method, of class IntegerParameterType.
*/
@Test
public void testSetMinimum() {
System.out.println("setMinimum");
String id = "Minimum";
PluginParameter<IntegerParameterType.IntegerParameterValue> parameter = new PluginParameter<>(new IntegerParameterValue(), INSTANCE, id);
int min = 0;
IntegerParameterType.setMinimum(parameter, min);
assertEquals(parameter.getParameterValue().getMinimumValue(), min);
min = -5;
IntegerParameterType.setMinimum(parameter, min);
assertEquals(parameter.getParameterValue().getMinimumValue(), min);
min = 64;
IntegerParameterType.setMinimum(parameter, min);
assertEquals(parameter.getParameterValue().getMinimumValue(), min);
}
use of au.gov.asd.tac.constellation.plugins.parameters.types.IntegerParameterType.IntegerParameterValue in project constellation by constellation-app.
the class IntegerParameterTypeNGTest method testBuild_String.
/**
* Test of build method, of class IntegerParameterType.
*/
@Test
public void testBuild_String() {
System.out.println("build");
String id = "integerParameter";
PluginParameter result = IntegerParameterType.build(id);
IntegerParameterValue expResult = new IntegerParameterValue();
assertEquals(result.getId(), id);
assertTrue(result.getType() instanceof IntegerParameterType);
assertEquals(result.getParameterValue(), expResult);
}
Aggregations