use of au.gov.asd.tac.constellation.plugins.parameters.types.BooleanParameterType.BooleanParameterValue 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.BooleanParameterType.BooleanParameterValue in project constellation by constellation-app.
the class BooleanParameterTypeNGTest method testGetSet.
@Test
public void testGetSet() {
BooleanParameterValue instance = new BooleanParameterValue();
boolean expected = instance.get();
assertEquals(instance.get(), expected);
expected = true;
instance.set(expected);
assertEquals(instance.get(), expected);
// Return true when value is different
expected = false;
assertTrue(instance.set(expected));
assertEquals(instance.get(), expected);
// Return false when value is set the same
expected = false;
assertFalse(instance.set(expected));
assertEquals(instance.get(), expected);
}
use of au.gov.asd.tac.constellation.plugins.parameters.types.BooleanParameterType.BooleanParameterValue in project constellation by constellation-app.
the class BooleanParameterTypeNGTest method testSetObjectValueException.
/**
* Test that parsing a wrong type throws an exception
*/
@Test(expectedExceptions = { IllegalArgumentException.class })
public void testSetObjectValueException() {
// Ensure initial setup is correct
BooleanParameterValue instance = new BooleanParameterValue();
instance.set(true);
assertTrue(instance.get());
assertFalse(instance.setObjectValue(1));
}
use of au.gov.asd.tac.constellation.plugins.parameters.types.BooleanParameterType.BooleanParameterValue 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;
}
use of au.gov.asd.tac.constellation.plugins.parameters.types.BooleanParameterType.BooleanParameterValue 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;
}
Aggregations