LineStyle implements ReadonlyLineStyle { @Override public boolean isAnimating() { return mainColor.isAnimating() || (secondaryColor != null && secondaryColor.isAnimating()); } LineStyle(Color color, float width, boolean hasSecondaryColor);  LineStyle(Color mainColor, float mainWidth, Color secondaryColor, float secondaryWidth);  LineStyle(ReadonlyLineStyle other); @Override LineStyle copy(); @Override ReadonlyColor getMainReadonlyColor(); @Override ReadonlyColor getSecondaryReadonlyColor(); @Override float getMainWidth(); @Override float getSecondaryWidth(); @Override boolean hasSecondaryColor(); @Override boolean glApply(boolean useSecondary); @Override boolean isAnimating(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString(); Color getMainColor(); Color getSecondaryColor(); LineStyle set(Color color, float width, boolean hasSecondaryColor); LineStyle set(Color mainColor, float mainWidth, Color secondaryColor, float secondaryWidth); LineStyle setMainColor(Color mainColor); LineStyle setMainWidth(float mainWidth); LineStyle setSecondaryColor(Color secondaryColor); LineStyle setSecondaryColorFromMain(); LineStyle setSecondaryWidth(float secondaryWidth); static final ReadonlyLineStyle DEFAULT; }
@Test public void testIsAnimating() { LineStyle s = new LineStyle(Color.GREEN.copy(), 2.0F, true); assertFalse(s.isAnimating()); s.getMainColor().animateStart(Color.PURPLE, 5000); assertTrue(s.isAnimating()); s.getSecondaryColor().animateStart(Color.PURPLE.copy().setAlpha(0.5), 5000); assertTrue(s.isAnimating()); s.getMainColor().animateStop(); assertTrue(s.isAnimating()); s.getSecondaryColor().animateStop(); assertFalse(s.isAnimating()); s.getMainColor().animateStart(Color.PURPLE, 5000); assertTrue(s.isAnimating()); s.setMainColor(Color.BROWN.copy()); assertFalse(s.isAnimating()); s.setSecondaryColor(null); assertFalse(s.isAnimating()); s.getMainColor().animateStart(Color.BLUE, 5000); assertTrue(s.isAnimating()); assertFalse(s.copy().isAnimating()); assertTrue(s.isAnimating()); s.getMainColor().animateStop(); }