Search in sources :

Example 1 with MagneticGridImpl

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

the class TestModifyMagneticGrid method setUp.

@Override
@Before
public void setUp() {
    super.setUp();
    grid = new MagneticGridImpl(new Canvas());
    // Cannot have two runners so cannot use mock to mock Canvas:
    CommandsRegistry.INSTANCE.removeAllHandlers();
    switch(property) {
        case STYLE:
            mementoCmd = () -> grid.getGridStyle();
            value = GridStyle.STANDARD;
            break;
        case MAGNETIC:
            mementoCmd = () -> grid.isMagnetic();
            value = true;
            break;
        case GRID_SPACING:
            mementoCmd = () -> grid.getGridSpacing();
            value = 11;
            break;
    }
    memento = mementoCmd.get();
}
Also used : Canvas(net.sf.latexdraw.view.jfx.Canvas) MagneticGridImpl(net.sf.latexdraw.view.jfx.MagneticGridImpl) Before(org.junit.Before)

Aggregations

Canvas (net.sf.latexdraw.view.jfx.Canvas)1 MagneticGridImpl (net.sf.latexdraw.view.jfx.MagneticGridImpl)1 Before (org.junit.Before)1