use of au.gov.asd.tac.constellation.plugins.parameters.types.BooleanParameterType.BooleanParameterValue in project constellation by constellation-app.
the class RotateCameraPlugin method createParameters.
@Override
public PluginParameters createParameters() {
final PluginParameters parameters = new PluginParameters();
final PluginParameter<FloatParameterValue> xaxisParam = FloatParameterType.build(X_PARAMETER_ID);
xaxisParam.setName("xAxis");
xaxisParam.setDescription("Rotation in degrees around the x axis");
xaxisParam.setFloatValue(0F);
parameters.addParameter(xaxisParam);
final PluginParameter<FloatParameterValue> yaxisParam = FloatParameterType.build(Y_PARAMETER_ID);
yaxisParam.setName("yAxis");
yaxisParam.setDescription("Rotation in degrees around the y axis");
yaxisParam.setFloatValue(0F);
parameters.addParameter(yaxisParam);
final PluginParameter<FloatParameterValue> zaxisParam = FloatParameterType.build(Z_PARAMETER_ID);
zaxisParam.setName("zAxis");
zaxisParam.setDescription("Rotation in degrees around the z axis");
zaxisParam.setFloatValue(0F);
parameters.addParameter(zaxisParam);
final PluginParameter<BooleanParameterValue> animateParam = BooleanParameterType.build(ANIMATE_PARAMETER_ID);
animateParam.setName("animate");
animateParam.setDescription("Animate the rotation asynchronously");
animateParam.setBooleanValue(false);
parameters.addParameter(animateParam);
return parameters;
}
use of au.gov.asd.tac.constellation.plugins.parameters.types.BooleanParameterType.BooleanParameterValue in project constellation by constellation-app.
the class BooleanParameterTypeNGTest method testConstruction.
// Start of testing BooleanParameterValue
@Test
public void testConstruction() {
BooleanParameterValue result = new BooleanParameterValue();
assertNotNull(result);
assertFalse(result.get());
}
use of au.gov.asd.tac.constellation.plugins.parameters.types.BooleanParameterType.BooleanParameterValue in project constellation by constellation-app.
the class BooleanParameterTypeNGTest method testGetSetObjectValue.
@Test
public void testGetSetObjectValue() {
BooleanParameterValue instance = new BooleanParameterValue();
// get current value as object and verify that it is correct.
Object expected = instance.getObjectValue();
assertEquals(instance.getObjectValue(), expected);
// change object value
expected = Boolean.TRUE;
instance.setObjectValue(expected);
assertEquals(instance.getObjectValue(), expected);
// Return true when value is different
expected = Boolean.FALSE;
assertTrue(instance.setObjectValue(expected));
assertEquals(instance.getObjectValue(), expected);
// Return false when value is set the same
expected = Boolean.FALSE;
assertFalse(instance.setObjectValue(expected));
assertEquals(instance.getObjectValue(), expected);
// Return false when value is set the same
expected = false;
assertFalse(instance.setObjectValue(null));
assertEquals(instance.getObjectValue(), expected);
// Return false when value is set the same
expected = Boolean.FALSE;
assertFalse(instance.setObjectValue(expected));
assertEquals(instance.getObjectValue(), expected);
// Return true when value is set from a boolean primitive correctly
expected = true;
assertTrue(instance.setObjectValue(expected));
}
use of au.gov.asd.tac.constellation.plugins.parameters.types.BooleanParameterType.BooleanParameterValue in project constellation by constellation-app.
the class BooleanParameterTypeNGTest method testCreateCopy.
@Test
public void testCreateCopy() {
// Ensure initial setup is correct
BooleanParameterValue instance = new BooleanParameterValue();
instance.set(true);
assertTrue(instance.get());
// Copy and verify correct value in copy
BooleanParameterValue instanceCopy = instance.createCopy();
assertTrue(instanceCopy.get());
// Ensure deep copy and not shallow
assertTrue(instance.set(false));
assertTrue(instanceCopy.get());
}
use of au.gov.asd.tac.constellation.plugins.parameters.types.BooleanParameterType.BooleanParameterValue in project constellation by constellation-app.
the class BooleanParameterTypeNGTest method testBuild_String.
/**
* Test of build method, of class BooleanParameterType.
*/
@Test
public void testBuild_String() {
System.out.println("build_string");
String id = "booleanParameter";
PluginParameter result = BooleanParameterType.build(id);
BooleanParameterValue expectedValue = new BooleanParameterValue();
assertEquals(result.getId(), id);
assertTrue(result.getType() instanceof BooleanParameterType);
assertEquals(result.getParameterValue(), expectedValue);
}
Aggregations