aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java/at/ac/tuwien/sepm/assignment/groupphase/HighDpiAwareApplicationTest.java
blob: b9b0605e81cfc8edf7c15cba1bbbce15f0efaf27 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package at.ac.tuwien.sepm.assignment.groupphase;


import javafx.geometry.Bounds;
import javafx.scene.Node;
import org.testfx.api.FxRobotContext;
import org.testfx.framework.junit.ApplicationTest;
import org.testfx.service.locator.impl.BoundsLocatorImpl;
import org.testfx.service.locator.impl.PointLocatorImpl;

public class HighDpiAwareApplicationTest extends ApplicationTest {
    public HighDpiAwareApplicationTest() {
        FxRobotContext context = robotContext();
        context.setBoundsLocator(
                new BoundsLocatorImpl() {
                    @Override
                    public Bounds boundsOnScreenFor(Node node) {
                        Bounds bounds = super.boundsOnScreenFor(node);
                        return ScaledBounds.wrap(bounds);
                    }
                });
        robotContext().setPointLocator(new PointLocatorImpl(context.getBoundsLocator()));
    }
}