use of net.sf.latexdraw.model.api.shape.Shape in project latexdraw by arnobl.
the class TestParsingShape method testParamFillingStyle.
@ParameterizedTest
@MethodSource(value = "cmdFillStyleProvider")
void testParamFillingStyle(final Tuple<String, String> cmd, final FillingStyle style) {
parser(cmd.a + "[fillstyle=" + style.getLatexToken() + "]" + cmd.b);
final Shape sh = getShapeAt(0);
assumeTrue(sh.isFillable());
assertEquals(style, sh.getFillingStyle());
}
use of net.sf.latexdraw.model.api.shape.Shape in project latexdraw by arnobl.
the class TestParsingShape method testParamLineStyle.
@ParameterizedTest
@MethodSource(value = "cmdLineStyleProvider")
void testParamLineStyle(final Tuple<String, String> cmd, final LineStyle style) {
parser(cmd.a + "[linestyle=" + style.getLatexToken() + "]" + cmd.b);
final Shape sh = getShapeAt(0);
assumeTrue(sh.isLineStylable());
assertEquals(style, sh.getLineStyle());
}
use of net.sf.latexdraw.model.api.shape.Shape in project latexdraw by arnobl.
the class TestParsingShape method testParamGradangle.
@ParameterizedTest
@MethodSource(value = "cmds")
void testParamGradangle(final Tuple<String, String> cmd) {
parser(cmd.a + "[fillstyle=gradient, gradangle=2.34]" + cmd.b);
final Shape sh = getShapeAt(0);
assumeTrue(sh.isInteriorStylable());
assertEquals(Math.toRadians(2.34), sh.getGradAngle(), 0.00001);
}
use of net.sf.latexdraw.model.api.shape.Shape in project latexdraw by arnobl.
the class TestParsingShape method testParamDimen.
@ParameterizedTest
@MethodSource(value = "cmdBorderPosProvider")
void testParamDimen(final Tuple<String, String> cmd, final BorderPos pos) {
parser(cmd.a + "[dimen=" + pos.getLatexToken() + "]" + cmd.b);
final Shape sh = getShapeAt(0);
assumeTrue(sh.isBordersMovable());
assertEquals(pos, sh.getBordersPosition());
}
use of net.sf.latexdraw.model.api.shape.Shape in project latexdraw by arnobl.
the class TestParsingShape method testParamHatchangle.
@ParameterizedTest
@MethodSource(value = "cmds")
void testParamHatchangle(final Tuple<String, String> cmd) {
parser(cmd.a + "[fillstyle=clines, hatchangle=-23]" + cmd.b);
final Shape sh = getShapeAt(0);
assumeTrue(sh.isInteriorStylable());
assertThat(sh.getHatchingsAngle()).isCloseTo(Math.toRadians(-23), within(0.00001));
}
Aggregations