Search in sources :

Example 1 with BaseBounds

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

the class BoundaryTransformMediatorTest method testLeftEdge.

@Test
public void testLeftEdge() {
    final Bounds visibleBounds = new BaseBounds(-500, -500, 1000, 1000);
    final Transform test = new Transform().translate(1200.0, 0.0);
    final Transform result = restriction.adjust(test, visibleBounds);
    assertNotNull(result);
    assertEquals(1000.0, result.getTranslateX(), 0.0);
    assertEquals(0.0, result.getTranslateY(), 0.0);
    // View.getBounds() is called once in BoundaryTransformMediator's constructor and once in it's adjust method.
    verify(view, times(2)).getBounds();
}
Also used : BaseBounds(org.uberfire.ext.wires.core.grids.client.model.impl.BaseBounds) Bounds(org.uberfire.ext.wires.core.grids.client.model.Bounds) BaseBounds(org.uberfire.ext.wires.core.grids.client.model.impl.BaseBounds) Transform(com.ait.lienzo.client.core.types.Transform) Test(org.junit.Test)

Example 2 with BaseBounds

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

the class BoundaryTransformMediatorTest method testBottomEdge.

@Test
public void testBottomEdge() {
    final Bounds visibleBounds = new BaseBounds(-500, -500, 1000, 1000);
    final Transform test = new Transform().translate(0.0, -200.0);
    final Transform result = restriction.adjust(test, visibleBounds);
    assertNotNull(result);
    assertEquals(0.0, result.getTranslateX(), 0.0);
    assertEquals(0.0, result.getTranslateY(), 0.0);
    // View.getBounds() is called once in BoundaryTransformMediator's constructor and once in it's adjust method.
    verify(view, times(2)).getBounds();
}
Also used : BaseBounds(org.uberfire.ext.wires.core.grids.client.model.impl.BaseBounds) Bounds(org.uberfire.ext.wires.core.grids.client.model.Bounds) BaseBounds(org.uberfire.ext.wires.core.grids.client.model.impl.BaseBounds) Transform(com.ait.lienzo.client.core.types.Transform) Test(org.junit.Test)

Example 3 with BaseBounds

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

the class GuidedDecisionTableViewImplTest method makeRenderingInformation.

private BaseGridRendererHelper.RenderingInformation makeRenderingInformation(final List<GridColumn<?>> bodyColumns, final List<GridColumn<?>> floatingColumns) {
    view.setAllColumns(allColumns);
    view.setBodyColumns(bodyColumns);
    view.setFloatingColumns(floatingColumns);
    return new BaseGridRendererHelper.RenderingInformation(new BaseBounds(0, 0, 1000, 2000), allColumns, makeRenderingBlockInformation(bodyColumns), makeRenderingBlockInformation(floatingColumns), 0, 1, Collections.singletonList(0.0), false, false, HEADER_ROW_HEIGHT, 1, 0.0);
}
Also used : BaseBounds(org.uberfire.ext.wires.core.grids.client.model.impl.BaseBounds)

Example 4 with BaseBounds

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

the class BoundaryTransformMediatorTest method testTopEdge.

@Test
public void testTopEdge() {
    final Bounds visibleBounds = new BaseBounds(-500, -500, 1000, 1000);
    final Transform test = new Transform().translate(0.0, 1200.0);
    final Transform result = restriction.adjust(test, visibleBounds);
    assertNotNull(result);
    assertEquals(0.0, result.getTranslateX(), 0.0);
    assertEquals(1000.0, result.getTranslateY(), 0.0);
    // View.getBounds() is called once in BoundaryTransformMediator's constructor and once in it's adjust method.
    verify(view, times(2)).getBounds();
}
Also used : BaseBounds(org.uberfire.ext.wires.core.grids.client.model.impl.BaseBounds) Bounds(org.uberfire.ext.wires.core.grids.client.model.Bounds) BaseBounds(org.uberfire.ext.wires.core.grids.client.model.impl.BaseBounds) Transform(com.ait.lienzo.client.core.types.Transform) Test(org.junit.Test)

Example 5 with BaseBounds

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

the class BoundaryTransformMediatorTest method testRightEdge.

@Test
public void testRightEdge() {
    final Bounds visibleBounds = new BaseBounds(-500, -500, 1000, 1000);
    final Transform test = new Transform().translate(-200.0, 0.0);
    final Transform result = restriction.adjust(test, visibleBounds);
    assertNotNull(result);
    assertEquals(0.0, result.getTranslateX(), 0.0);
    assertEquals(0.0, result.getTranslateY(), 0.0);
    // View.getBounds() is called once in BoundaryTransformMediator's constructor and once in it's adjust method.
    verify(view, times(2)).getBounds();
}
Also used : BaseBounds(org.uberfire.ext.wires.core.grids.client.model.impl.BaseBounds) Bounds(org.uberfire.ext.wires.core.grids.client.model.Bounds) BaseBounds(org.uberfire.ext.wires.core.grids.client.model.impl.BaseBounds) Transform(com.ait.lienzo.client.core.types.Transform) Test(org.junit.Test)

Aggregations

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