LineStyle implements ReadonlyLineStyle { public LineStyle set(Color color, float width, boolean hasSecondaryColor) { setMainColor(color); setMainWidth(width); if (hasSecondaryColor) { setSecondaryColorFromMain(); } else { setSecondaryColor(null); } setSecondaryWidth(width); return 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 public void testSet() { LineStyle s = new LineStyle(Color.WHITE.copy(), 2.5F, false); assertEquals("(0xffffffff,2.5)", s.toString()); s.set(Color.RED.copy().setAlpha(0.5), 12.0F, false); assertEquals("(0xff00007f,12.0)", s.toString()); s.set(Color.RED.copy().setAlpha(0.5), 12.0F, true); assertEquals("(0xff00007f,12.0|0xff00001f,12.0)", s.toString()); }