(JSpinner)TestUtilities.getField(panel, "observerHeightSpinner");
ColorButton groundColorButton =
(ColorButton)TestUtilities.getField(panel, "groundColorButton");
ColorButton skyColorButton =
(ColorButton)TestUtilities.getField(panel, "skyColorButton");
JSlider brightnessSlider =
(JSlider)TestUtilities.getField(panel, "brightnessSlider");
JSlider wallsTransparencySlider =
(JSlider)TestUtilities.getField(panel, "wallsTransparencySlider");
// Check edited values
float oldCameraFieldOfView = observerCamera.getFieldOfView();
float oldCameraHeight = observerCamera.getHeight();
int oldGroundColor = home.getEnvironment().getGroundColor();
TextureImage oldGroundTexture = home.getEnvironment().getGroundTexture();
int oldSkyColor = home.getEnvironment().getSkyColor();
int oldLightColor = home.getEnvironment().getLightColor();
float oldWallsAlpha = home.getEnvironment().getWallsAlpha();
assertEquals("Wrong field of view", (int)Math.round(Math.toDegrees(oldCameraFieldOfView)),
observerFieldOfViewSpinner.getValue());
assertEquals("Wrong height", (float)Math.round(oldCameraHeight * 100) / 100,
observerHeightSpinner.getValue());
assertEquals("Wrong ground color", oldGroundColor,
groundColorButton.getColor().intValue());
assertEquals("Wrong ground texture", oldGroundTexture,
panelController.getGroundTextureController().getTexture());
assertEquals("Wrong sky color", oldSkyColor,
skyColorButton.getColor().intValue());
assertEquals("Wrong brightness", oldLightColor & 0xFF,
brightnessSlider.getValue());
assertEquals("Wrong transparency", (int)(oldWallsAlpha * 255),
wallsTransparencySlider.getValue());
// 12. Change dialog box values
observerFieldOfViewSpinner.setValue(90);
observerHeightSpinner.setValue(300f);
groundColorButton.setColor(0xFFFFFF);
skyColorButton.setColor(0x000000);
brightnessSlider.setValue(128);
wallsTransparencySlider.setValue(128);
// Click on Ok in dialog box
doClickOnOkInDialog(attributesDialog, tester);
// Check home attributes are modified accordingly
assert3DAttributesEqualHomeAttributes((float)Math.toRadians(90), 300f,
0xFFFFFF, null, 0x000000, 0x808080, 1 / 255f * 128f, home);