Search in sources :

Example 1 with EditingService

use of net.sf.latexdraw.service.EditingService in project latexdraw by arnobl.

the class TestTextSetter method setUp.

@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    final EditingService editing = injector.getInstance(EditingService.class);
    editing.getGroupParams().setPlotMinX(0d);
    editing.getGroupParams().setPlotMaxX(10d);
    editing.getGroupParams().setNbPlottedPoints(10);
    setter = injector.getInstance(TextSetter.class);
    pencil.setActivated(true);
    injector.getInstance(PreferencesService.class).magneticGridProperty().set(false);
    Platform.runLater(() -> setter.initialize(null, null));
    WaitForAsyncUtils.waitForFxEvents(100);
    Cmds.of(CmdFXVoid.of(() -> canvas.toFront())).execute();
    pos = point(canvas).query();
}
Also used : EditingService(net.sf.latexdraw.service.EditingService) Before(org.junit.Before)

Example 2 with EditingService

use of net.sf.latexdraw.service.EditingService in project latexdraw by arnobl.

the class TestTextSetterReEdit method setUp.

@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    setter = injector.getInstance(TextSetter.class);
    final EditingService editing = injector.getInstance(EditingService.class);
    Cmds.of(CmdFXVoid.of(() -> {
        editing.getGroupParams().setPlotMinX(0d);
        editing.getGroupParams().setPlotMaxX(10d);
        editing.getGroupParams().setNbPlottedPoints(10);
        editing.setCurrentChoice(EditionChoice.HAND);
        hand.setActivated(true);
        setter.initialize(null, null);
        canvas.toFront();
    })).execute();
    plot = ShapeFactory.INST.createPlot(ShapeFactory.INST.createPoint(-Canvas.ORIGIN.getX() + 100, -Canvas.ORIGIN.getY() + 300), 0, 3, "x 2.5 div", false);
}
Also used : EditingService(net.sf.latexdraw.service.EditingService) Before(org.junit.Before)

Aggregations

EditingService (net.sf.latexdraw.service.EditingService)2 Before (org.junit.Before)2