use of org.uberfire.ext.wires.core.grids.client.model.Bounds in project kie-wb-common by kiegroup.
the class BoundaryTransformMediator method updateBounds.
private void updateBounds() {
final Bounds bounds = getBounds();
this.minX = bounds.getX();
this.minY = bounds.getY();
this.maxX = this.minX + bounds.getWidth();
this.maxY = this.minY + bounds.getHeight();
}
use of org.uberfire.ext.wires.core.grids.client.model.Bounds in project drools-wb by kiegroup.
the class BoundaryTransformMediator method updateBounds.
private void updateBounds() {
final Bounds bounds = view.getBounds();
this.minX = bounds.getX();
this.minY = bounds.getY();
this.maxX = this.minX + bounds.getWidth();
this.maxY = this.minY + bounds.getHeight();
}
use of org.uberfire.ext.wires.core.grids.client.model.Bounds 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();
}
use of org.uberfire.ext.wires.core.grids.client.model.Bounds 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();
}
use of org.uberfire.ext.wires.core.grids.client.model.Bounds in project drools-wb by kiegroup.
the class GuidedDecisionTableModellerBoundsHelperTest method multipleDecisionTablesCheckBottomBounds.
@Test
public void multipleDecisionTablesCheckBottomBounds() {
final Bounds b = helper.getBounds(new HashSet<GuidedDecisionTableView.Presenter>() {
{
add(makeTable(0, 0, 400, 400));
add(makeTable(0, 1800, 400, 400));
}
});
final double expectedMaxY = 1800 + 400 + BOUNDS_PADDING;
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(expectedMaxY - BOUNDS_MIN_Y, b.getHeight(), 0.0);
}
Aggregations