// Path: api/src/test/java/de/tesis/dynaware/grapheditor/utils/FXTestUtils.java
// public static void dragBy(final Node node, final double dx, final double dy) {
//     dragTo(node, node.getLayoutX() + dx, node.getLayoutY() + dy);
// }
// 
// Path: api/src/test/java/de/tesis/dynaware/grapheditor/utils/FXTestUtils.java
// public static void forceLayoutUpdate(final Parent parent) {
//     parent.autosize();
//     parent.snapshot(null, null);
//     parent.layout();
// }
// 
// Path: api/src/main/java/de/tesis/dynaware/grapheditor/EditorElement.java
// public enum EditorElement
// {
//     CONNECTOR,
//     NODE,
//     JOINT;
// }


import static de.tesis.dynaware.grapheditor.utils.FXTestUtils.dragBy;
import static de.tesis.dynaware.grapheditor.utils.FXTestUtils.forceLayoutUpdate;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
import de.tesis.dynaware.grapheditor.EditorElement;
import javafx.scene.layout.Pane;

package de.tesis.dynaware.grapheditor.utils;




public class ResizableBoxTest {

    @ClassRule
    public static JavaFXThreadingRule javaFXThreadingRule = new JavaFXThreadingRule();

    private final static double BOX_WIDTH = 240;
    private final static double BOX_HEIGHT = 100;
    private final static double BOX_INITIAL_X = 60;
    private final static double BOX_INITIAL_Y = 60;
    private final static double BOX_RESIZE_BORDER_TOLERANCE = 1;

    private final ResizableBox box = new ResizableBox(EditorElement.NODE);
    private final Pane container = new Pane();

    private final GraphEditorProperties properties = new GraphEditorProperties();

    @Before
    public void setUp() throws Exception {

        box.setEditorProperties(properties);
        box.resize(BOX_WIDTH, BOX_HEIGHT);

        box.setLayoutX(BOX_INITIAL_X);
        box.setLayoutY(BOX_INITIAL_Y);

        container.setPrefSize(360, 300);
        container.autosize();
        container.getChildren().add(box);


// Path: api/src/test/java/de/tesis/dynaware/grapheditor/utils/FXTestUtils.java
// public static void dragBy(final Node node, final double dx, final double dy) {
//     dragTo(node, node.getLayoutX() + dx, node.getLayoutY() + dy);
// }
// 
// Path: api/src/test/java/de/tesis/dynaware/grapheditor/utils/FXTestUtils.java
// public static void forceLayoutUpdate(final Parent parent) {
//     parent.autosize();
//     parent.snapshot(null, null);
//     parent.layout();
// }
// 
// Path: api/src/main/java/de/tesis/dynaware/grapheditor/EditorElement.java
// public enum EditorElement
// {
//     CONNECTOR,
//     NODE,
//     JOINT;
// }


// Path: api/src/test/java/de/tesis/dynaware/grapheditor/utils/ResizableBoxTest.java
import static de.tesis.dynaware.grapheditor.utils.FXTestUtils.dragBy;
import static de.tesis.dynaware.grapheditor.utils.FXTestUtils.forceLayoutUpdate;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
import de.tesis.dynaware.grapheditor.EditorElement;
import javafx.scene.layout.Pane;

package de.tesis.dynaware.grapheditor.utils;




public class ResizableBoxTest {

    @ClassRule
    public static JavaFXThreadingRule javaFXThreadingRule = new JavaFXThreadingRule();

    private final static double BOX_WIDTH = 240;
    private final static double BOX_HEIGHT = 100;
    private final static double BOX_INITIAL_X = 60;
    private final static double BOX_INITIAL_Y = 60;
    private final static double BOX_RESIZE_BORDER_TOLERANCE = 1;

    private final ResizableBox box = new ResizableBox(EditorElement.NODE);
    private final Pane container = new Pane();

    private final GraphEditorProperties properties = new GraphEditorProperties();

    @Before
    public void setUp() throws Exception {

        box.setEditorProperties(properties);
        box.resize(BOX_WIDTH, BOX_HEIGHT);

        box.setLayoutX(BOX_INITIAL_X);
        box.setLayoutY(BOX_INITIAL_Y);

        container.setPrefSize(360, 300);
        container.autosize();
        container.getChildren().add(box);


        forceLayoutUpdate(container);
