Search in sources :

Example 6 with Bounds

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

the class GuidedDecisionTableModellerBoundsHelperTest method emptyCollection.

@Test
public void emptyCollection() {
    final Bounds b = helper.getBounds(Collections.<GuidedDecisionTableView.Presenter>emptySet());
    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 7 with Bounds

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

the class GuidedDecisionTableModellerPresenter method getDecisionTableY.

@SuppressWarnings("unused")
private double getDecisionTableY(final GuidedDecisionTableView.Presenter dtPresenter) {
    final Bounds bounds = getView().getBounds();
    double y = bounds.getY() + (bounds.getHeight() * 0.25);
    for (GuidedDecisionTableView.Presenter p : availableDecisionTables) {
        y = y + p.getView().getHeight() + 200;
    }
    return y;
}
Also used : Bounds(org.uberfire.ext.wires.core.grids.client.model.Bounds)

Example 8 with Bounds

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

the class GuidedDecisionTableModellerPresenter method getDecisionTableX.

private double getDecisionTableX(final GuidedDecisionTableView.Presenter dtPresenter) {
    final Bounds bounds = getView().getBounds();
    final double x = bounds.getX() + (bounds.getWidth() - dtPresenter.getView().getWidth()) / 2;
    return x;
}
Also used : Bounds(org.uberfire.ext.wires.core.grids.client.model.Bounds)

Example 9 with Bounds

use of org.uberfire.ext.wires.core.grids.client.model.Bounds 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 10 with Bounds

use of org.uberfire.ext.wires.core.grids.client.model.Bounds 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

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