Search in sources :

Example 1 with MagneticGrid

use of net.sf.latexdraw.view.jfx.MagneticGrid in project latexdraw by arnobl.

the class TestMagneticGrid method setUp.

@BeforeEach
void setUp() {
    prefW = new SimpleDoubleProperty(100d);
    prefH = new SimpleDoubleProperty(50d);
    zoom = new SimpleDoubleProperty(1d);
    canvas = Mockito.mock(Canvas.class);
    Mockito.when(canvas.prefHeightProperty()).thenReturn(prefH);
    Mockito.when(canvas.prefWidthProperty()).thenReturn(prefW);
    Mockito.when(canvas.getPrefHeight()).thenReturn(50d);
    Mockito.when(canvas.getPrefWidth()).thenReturn(100d);
    Mockito.when(canvas.getPPCDrawing()).thenReturn(50);
    Mockito.when(canvas.zoomProperty()).thenReturn(zoom);
    Mockito.when(canvas.getZoom()).thenAnswer(inv -> zoom.get());
    prefs = new PreferencesService();
    grid = new MagneticGrid(canvas, prefs);
    prefs.gridStyleProperty().set(GridStyle.STANDARD);
}
Also used : SimpleDoubleProperty(javafx.beans.property.SimpleDoubleProperty) Canvas(net.sf.latexdraw.view.jfx.Canvas) MagneticGrid(net.sf.latexdraw.view.jfx.MagneticGrid) PreferencesService(net.sf.latexdraw.service.PreferencesService) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

SimpleDoubleProperty (javafx.beans.property.SimpleDoubleProperty)1 PreferencesService (net.sf.latexdraw.service.PreferencesService)1 Canvas (net.sf.latexdraw.view.jfx.Canvas)1 MagneticGrid (net.sf.latexdraw.view.jfx.MagneticGrid)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1