@Test public void testReadAnimationV2() throws Exception { File inputFile = new File(getClass().getResource("v2AnimationFile.xml").toURI()); Animation result = classToBeTested.readAnimation(inputFile, new WorldWindowTestImpl()); assertNotNull(result); assertNotNull(result.getCamera()); assertEquals("Render Camera", result.getCamera().getName()); assertParameterCorrect(result.getCamera().getEyeLat(), "Render Camera - Eye Lat", 3, true); assertParameterCorrect(result.getCamera().getEyeLon(), "Render Camera - Eye Lon", 2, true); assertParameterCorrect(result.getCamera().getEyeElevation(), "Render Camera - Eye Elevation", 1, true); assertParameterCorrect(result.getCamera().getLookAtLat(), "Render Camera - Lookat Lat", 0, true); assertParameterCorrect(result.getCamera().getLookAtLon(), "Render Camera - Lookat Lon", 0, true); assertParameterCorrect(result.getCamera().getLookAtElevation(), "Render Camera - Lookat Elevation", 0, true); assertEquals(3, result.getLayers().size()); assertContainsAnimatableLayer(result, "Layer1"); assertContainsAnimatableLayer(result, "Layer2"); assertContainsAnimatableLayer(result, "Layer3"); AnimatableLayer layer2 = getAnimatableLayer(result, "Layer2"); assertAnimatableLayerCorrect(layer2); AnimatableLayer layer3 = getAnimatableLayer(result, "Layer3"); assertAnimatableLayerCorrect(layer3); assertEquals(10, result.getKeyFrameCount()); KeyFrame frame = result.getFirstKeyFrame(); assertEquals(0, frame.getFrame()); assertEquals(4, frame.getParameterValues().size()); ParameterValue eyeLatValue = frame.getValueForParameter(result.getCamera().getEyeLat()); assertBezierParameterValueCorrect(eyeLatValue, 1.0, 1.1, 1.2, 1.3, 1.4, false); ParameterValue eyeLonValue = frame.getValueForParameter(result.getCamera().getEyeLon()); assertBezierParameterValueCorrect(eyeLonValue, 11.0, 11.1, 11.2, 11.3, 11.4, true); ParameterValue layer2OpacityValue = frame.getValueForParameter(layer2.getParameterOfType(Type.OPACITY)); assertBezierParameterValueCorrect(layer2OpacityValue, 1.0, 1.0, 0.4, 1.0, 0.4, true); ParameterValue layer3OpacityValue = frame.getValueForParameter(layer3.getParameterOfType(Type.OPACITY)); assertLinearParameterValueCorrect(layer3OpacityValue, 0.5); }
@Override public Animation readAnimation(String fileName, WorldWindow worldWindow) { Validate.notBlank(fileName, "A file name must be provided"); Validate.notNull(worldWindow, "A world window must be provided"); File fileToRead = new File(fileName); return readAnimation(fileToRead, worldWindow); }
XmlAnimationReader implements AnimationReader { @Override public Animation readAnimation(String fileName, WorldWindow worldWindow) { Validate.notBlank(fileName, "A file name must be provided"); Validate.notNull(worldWindow, "A world window must be provided"); File fileToRead = new File(fileName); return readAnimation(fileToRead, worldWindow); } }
XmlAnimationReader implements AnimationReader { @Override public Animation readAnimation(String fileName, WorldWindow worldWindow) { Validate.notBlank(fileName, "A file name must be provided"); Validate.notNull(worldWindow, "A world window must be provided"); File fileToRead = new File(fileName); return readAnimation(fileToRead, worldWindow); }  }
XmlAnimationReader implements AnimationReader { @Override public Animation readAnimation(String fileName, WorldWindow worldWindow) { Validate.notBlank(fileName, "A file name must be provided"); Validate.notNull(worldWindow, "A world window must be provided"); File fileToRead = new File(fileName); return readAnimation(fileToRead, worldWindow); }  @Override Animation readAnimation(String fileName, WorldWindow worldWindow); @Override Animation readAnimation(File file, WorldWindow worldWindow); @Override AnimationFileVersion getFileVersion(String fileName); @Override AnimationFileVersion getFileVersion(File file); }
XmlAnimationReader implements AnimationReader { @Override public Animation readAnimation(String fileName, WorldWindow worldWindow) { Validate.notBlank(fileName, "A file name must be provided"); Validate.notNull(worldWindow, "A world window must be provided"); File fileToRead = new File(fileName); return readAnimation(fileToRead, worldWindow); }  @Override Animation readAnimation(String fileName, WorldWindow worldWindow); @Override Animation readAnimation(File file, WorldWindow worldWindow); @Override AnimationFileVersion getFileVersion(String fileName); @Override AnimationFileVersion getFileVersion(File file);  }