Search in sources :

Example 11 with Bounds

use of org.uberfire.ext.wires.core.grids.client.model.Bounds in project drools-wb by kiegroup.

the class GuidedDecisionTableModellerBoundsHelperTest method multipleDecisionTablesCheckLeftBounds.

@Test
public void multipleDecisionTablesCheckLeftBounds() {
    final Bounds b = helper.getBounds(new HashSet<GuidedDecisionTableView.Presenter>() {

        {
            add(makeTable(0, 0, 400, 400));
            add(makeTable(-2200, 0, 400, 400));
        }
    });
    final double expectedMinX = -2200 - BOUNDS_PADDING;
    assertEquals(expectedMinX, b.getX(), 0.0);
    assertEquals(BOUNDS_MIN_Y, b.getY(), 0.0);
    assertEquals(BOUNDS_MAX_X - expectedMinX, b.getWidth(), 0.0);
    assertEquals(BOUNDS_MAX_Y - BOUNDS_MIN_Y, b.getHeight(), 0.0);
}
Also used : Bounds(org.uberfire.ext.wires.core.grids.client.model.Bounds) Test(org.junit.Test)

Example 12 with Bounds

use of org.uberfire.ext.wires.core.grids.client.model.Bounds in project drools-wb by kiegroup.

the class GuidedDecisionTableModellerBoundsHelperTest method multipleDecisionTablesCheckRightBounds.

@Test
public void multipleDecisionTablesCheckRightBounds() {
    final Bounds b = helper.getBounds(new HashSet<GuidedDecisionTableView.Presenter>() {

        {
            add(makeTable(0, 0, 400, 400));
            add(makeTable(1800, 0, 400, 400));
        }
    });
    final double expectedMaxX = 1800 + 400 + BOUNDS_PADDING;
    assertEquals(BOUNDS_MIN_X, b.getX(), 0.0);
    assertEquals(BOUNDS_MIN_Y, b.getY(), 0.0);
    assertEquals(expectedMaxX - BOUNDS_MIN_X, b.getWidth(), 0.0);
    assertEquals(BOUNDS_MAX_Y - BOUNDS_MIN_Y, b.getHeight(), 0.0);
}
Also used : Bounds(org.uberfire.ext.wires.core.grids.client.model.Bounds) Test(org.junit.Test)

Example 13 with Bounds

use of org.uberfire.ext.wires.core.grids.client.model.Bounds in project drools-wb by kiegroup.

the class GuidedDecisionTableModellerBoundsHelperTest method emptyOneDecisionTableWithinMinimumBounds.

@Test
public void emptyOneDecisionTableWithinMinimumBounds() {
    final Bounds b = helper.getBounds(new HashSet<GuidedDecisionTableView.Presenter>() {

        {
            add(makeTable(0, 0, 400, 400));
        }
    });
    assertEquals(BOUNDS_MIN_X, b.getX(), 0.0);
    assertEquals(BOUNDS_MIN_Y, b.getY(), 0.0);
    assertEquals(BOUNDS_MAX_X - BOUNDS_MIN_X, b.getWidth(), 0.0);
    assertEquals(BOUNDS_MAX_Y - BOUNDS_MIN_Y, b.getHeight(), 0.0);
}
Also used : Bounds(org.uberfire.ext.wires.core.grids.client.model.Bounds) Test(org.junit.Test)

Example 14 with Bounds

use of org.uberfire.ext.wires.core.grids.client.model.Bounds in project drools-wb by kiegroup.

the class GuidedDecisionTableModellerBoundsHelperTest method multipleDecisionTablesCheckTopBounds.

@Test
public void multipleDecisionTablesCheckTopBounds() {
    final Bounds b = helper.getBounds(new HashSet<GuidedDecisionTableView.Presenter>() {

        {
            add(makeTable(0, 0, 400, 400));
            add(makeTable(0, -2200, 400, 400));
        }
    });
    final double expectedMinY = -2200 - BOUNDS_PADDING;
    assertEquals(BOUNDS_MIN_X, b.getX(), 0.0);
    assertEquals(expectedMinY, b.getY(), 0.0);
    assertEquals(BOUNDS_MAX_X - BOUNDS_MIN_X, b.getWidth(), 0.0);
    assertEquals(BOUNDS_MAX_Y - expectedMinY, b.getHeight(), 0.0);
}
Also used : Bounds(org.uberfire.ext.wires.core.grids.client.model.Bounds) Test(org.junit.Test)

Aggregations

Bounds (org.uberfire.ext.wires.core.grids.client.model.Bounds)14 Test (org.junit.Test)10 BaseBounds (org.uberfire.ext.wires.core.grids.client.model.impl.BaseBounds)5 Transform (com.ait.lienzo.client.core.types.Transform)4 MultiPath (com.ait.lienzo.client.core.shape.MultiPath)1