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);
}
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;
}
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;
}
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();
}
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();
}
Aggregations