use of net.sf.latexdraw.model.api.shape.Dot in project latexdraw by arnobl.
the class TestPlot method testCopyFromDot.
@Test
public void testCopyFromDot() {
final Dot dot = ShapeFactory.INST.createDot(ShapeFactory.INST.createPoint());
dot.setDotStyle(DotStyle.DIAMOND);
dot.setDotFillingCol(DviPsColors.BLUE);
dot.setDiametre(3.0);
shape.copy(dot);
assertEquals(DviPsColors.BLUE, shape.getDotFillingCol());
assertEquals(3.0, shape.getDiametre(), 0.0001);
assertEquals(DotStyle.DIAMOND, shape.getDotStyle());
}
use of net.sf.latexdraw.model.api.shape.Dot in project latexdraw by arnobl.
the class PolymorphDotTest method testDotParams.
@ParameterizedTest
@MethodSource("net.sf.latexdraw.data.ShapeSupplier#createDiversifiedDot")
default void testDotParams(final Dot sh) {
final Dot s2 = produceOutputShapeFrom(sh);
CompareShapeMatcher.INST.assertEqualsDot(sh, s2);
}
use of net.sf.latexdraw.model.api.shape.Dot in project latexdraw by arnobl.
the class TestHandDotStyle method testPickLineColourSelection.
@Test
public void testPickLineColourSelection() {
Cmds.of(activateHand, selectionAddDot, selectionAddBezier, selectionAddDot, setDotStyleFillable, updateIns).execute();
final Color col = fillingB.getValue();
Cmds.of(pickFillingColour).execute();
assertEquals(fillingB.getValue(), ((Dot) drawing.getSelection().getShapeAt(0).orElseThrow()).getDotFillingCol().toJFX());
assertEquals(fillingB.getValue(), ((Dot) drawing.getSelection().getShapeAt(2).orElseThrow()).getDotFillingCol().toJFX());
assertNotEquals(col, fillingB.getValue());
}
use of net.sf.latexdraw.model.api.shape.Dot in project latexdraw by arnobl.
the class TestCanvasCreation method testDrawDot.
@Test
public void testDrawDot() {
final Point2D pos = point(canvas).query();
Cmds.of(CmdFXVoid.of(() -> editing.setCurrentChoice(EditionChoice.DOT)), () -> moveTo(pos).clickOn(MouseButton.PRIMARY)).execute();
assertEquals(1, drawing.size());
assertTrue(drawing.getShapeAt(0).orElseThrow() instanceof Dot);
final Dot sh = (Dot) drawing.getShapeAt(0).orElseThrow();
assertEquals(-Canvas.getMargins() + canvas.screenToLocal(pos).getX(), sh.getPosition().getX(), 1d);
assertEquals(-Canvas.getMargins() + canvas.screenToLocal(pos).getY(), sh.getPosition().getY(), 1d);
}
use of net.sf.latexdraw.model.api.shape.Dot in project latexdraw by arnobl.
the class TestPencilDotStyle method testPickLineColourPencil.
@Test
public void testPickLineColourPencil() {
Cmds.of(activatePencil, pencilCreatesDot, setDotStyleFillable, updateIns).execute();
final Color col = fillingB.getValue();
Cmds.of(pickFillingColour).execute();
assertEquals(fillingB.getValue(), ((Dot) editing.createShapeInstance()).getDotFillingCol().toJFX());
assertNotEquals(col, fillingB.getValue());
}
Aggregations