LineStyle implements ReadonlyLineStyle { @Override public LineStyle copy() { return new LineStyle(this); } 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(expected=IllegalArgumentException.class) public void testConstructorInvalidWidth() { new LineStyle(Color.WHITE.copy(), -32.5F, false); }
@Test public void testCopy() { ReadonlyLineStyle orig = new LineStyle(Color.RED.copy().setAlpha(0.5), 12.0F, true); ReadonlyLineStyle copy0 = orig.copy(); assertNotSame(orig, copy0); assertEquals(orig.toString(), copy0.toString()); assertNotSame(orig.getMainReadonlyColor(), copy0.getMainReadonlyColor()); assertEquals(orig.getMainReadonlyColor().toString(), copy0.getMainReadonlyColor().toString()); assertNotSame(orig.getSecondaryReadonlyColor(), copy0.getSecondaryReadonlyColor()); assertEquals(orig.getSecondaryReadonlyColor().toString(), copy0.getSecondaryReadonlyColor().toString()); LineStyle copy1 = orig.copy(); assertNotSame(orig, copy1); assertEquals(orig.toString(), copy1.toString()); copy1.setMainColor(Color.GREEN.copy()); assertFalse(orig.toString().equals(copy1.toString())); }
@Test public void testSerializable() { new TestSerializable<ReadonlyLineStyle>().assertSerializable( new LineStyle(Color.GREEN.copy(), 2.0F, false)); }