use of au.gov.asd.tac.constellation.plugins.parameters.types.IntegerParameterType.IntegerParameterValue in project constellation by constellation-app.
the class IntegerParameterTypeNGTest method testSetShrinkInputWidth.
/**
* Test of setShrinkInputWidth method, of class IntegerParameterType.
*/
@Test
public void testSetShrinkInputWidth() {
System.out.println("setShrinkInputWidth");
String id = "Shrink";
PluginParameter<IntegerParameterType.IntegerParameterValue> parameter = new PluginParameter<>(new IntegerParameterValue(), INSTANCE, id);
// Check setting shrink to false
boolean expected = false;
IntegerParameterType.setShrinkInputWidth(parameter, false);
assertEquals(parameter.getProperty(SHRINK_VAL), expected);
// Check setting shrink to the same value that it already is
expected = false;
IntegerParameterType.setShrinkInputWidth(parameter, expected);
assertEquals(parameter.getProperty(SHRINK_VAL), expected);
// Check setting shrink to true
expected = true;
IntegerParameterType.setShrinkInputWidth(parameter, expected);
assertEquals(parameter.getProperty(SHRINK_VAL), expected);
}
use of au.gov.asd.tac.constellation.plugins.parameters.types.IntegerParameterType.IntegerParameterValue in project constellation by constellation-app.
the class IntegerParameterTypeNGTest method testBuild_String_IntegerParameterTypeIntegerParameterValue.
/**
* Test of build method, of class IntegerParameterType.
*/
@Test
public void testBuild_String_IntegerParameterTypeIntegerParameterValue() {
System.out.println("build");
IntegerParameterValue instance = new IntegerParameterValue(2);
int instanceValue = instance.get();
int expResult = 2;
assertEquals(instanceValue, expResult);
instance = new IntegerParameterValue(-5);
instanceValue = instance.get();
expResult = -5;
assertEquals(instanceValue, expResult);
instance = new IntegerParameterValue();
instanceValue = instance.get();
expResult = 0;
assertEquals(instanceValue, expResult);
}
use of au.gov.asd.tac.constellation.plugins.parameters.types.IntegerParameterType.IntegerParameterValue in project constellation by constellation-app.
the class IntegerParameterTypeNGTest method testSetMaximum.
/**
* Test of setMaximum method, of class IntegerParameterType.
*/
@Test
public void testSetMaximum() {
System.out.println("setMaximum");
String id = "Maxiumum";
PluginParameter<IntegerParameterType.IntegerParameterValue> parameter = new PluginParameter<>(new IntegerParameterValue(), INSTANCE, id);
int max = 0;
IntegerParameterType.setMaximum(parameter, max);
assertEquals(parameter.getParameterValue().getMaximumValue(), max);
max = -5;
IntegerParameterType.setMaximum(parameter, max);
assertEquals(parameter.getParameterValue().getMaximumValue(), max);
max = 64;
IntegerParameterType.setMaximum(parameter, max);
assertEquals(parameter.getParameterValue().getMaximumValue(), max);
}
use of au.gov.asd.tac.constellation.plugins.parameters.types.IntegerParameterType.IntegerParameterValue in project constellation by constellation-app.
the class SleepReadPlugin method createParameters.
@Override
public PluginParameters createParameters() {
final PluginParameters params = new PluginParameters();
final PluginParameter<IntegerParameterValue> secondsParam = IntegerParameterType.build(SECONDS_PARAMETER_ID);
secondsParam.setName("Seconds to sleep");
secondsParam.setDescription("The number of seconds to sleep on the graph");
secondsParam.setIntegerValue(10);
IntegerParameterType.setMinimum(secondsParam, 0);
params.addParameter(secondsParam);
return params;
}
use of au.gov.asd.tac.constellation.plugins.parameters.types.IntegerParameterType.IntegerParameterValue in project constellation by constellation-app.
the class PreferentialAttachmentGraphBuilderPlugin method createParameters.
@Override
public PluginParameters createParameters() {
final PluginParameters params = new PluginParameters();
final PluginParameter<IntegerParameterValue> n = IntegerParameterType.build(N_PARAMETER_ID);
n.setName("Number of nodes");
n.setDescription("The number of nodes on the graph");
n.setIntegerValue(10);
IntegerParameterType.setMinimum(n, 0);
params.addParameter(n);
final PluginParameter<IntegerParameterValue> m = IntegerParameterType.build(M_PARAMETER_ID);
m.setName("Number of edges to attach");
m.setDescription("The number of edges to attach to each node");
m.setIntegerValue(1);
IntegerParameterType.setMinimum(m, 0);
params.addParameter(m);
final PluginParameter<BooleanParameterValue> randomWeights = BooleanParameterType.build(RANDOM_WEIGHTS_PARAMETER_ID);
randomWeights.setName("Random edge weight/direction");
randomWeights.setDescription("Edges have a random number of transactions going in random directions");
randomWeights.setBooleanValue(true);
params.addParameter(randomWeights);
final PluginParameter<MultiChoiceParameterValue> nodeTypes = MultiChoiceParameterType.build(NODE_TYPES_PARAMETER_ID);
nodeTypes.setName("Node Types");
nodeTypes.setDescription("Node types to add to the graph");
params.addParameter(nodeTypes);
final PluginParameter<MultiChoiceParameterValue> transactionTypes = MultiChoiceParameterType.build(TRANSACTION_TYPES_PARAMETER_ID);
transactionTypes.setName("Transaction Types");
transactionTypes.setDescription("Transaction types to add to the graph");
params.addParameter(transactionTypes);
return params;
}
Aggregations