@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 ); }
public Bounds getBounds( final Set<GuidedDecisionTableView.Presenter> dtPresenters ) { double minX = BOUNDS_MIN_X; double minY = BOUNDS_MIN_Y; double maxX = BOUNDS_MAX_X; double maxY = BOUNDS_MAX_Y; for ( GuidedDecisionTableView.Presenter dtPresenter : dtPresenters ) { final GuidedDecisionTableView dtView = dtPresenter.getView(); minX = Math.min( dtView.getX() - BOUNDS_PADDING, minX ); minY = Math.min( dtView.getY() - BOUNDS_PADDING, minY ); maxX = Math.max( dtView.getX() + dtView.getWidth() + BOUNDS_PADDING, maxX ); maxY = Math.max( dtView.getY() + dtView.getHeight() + BOUNDS_PADDING, maxY ); } bounds.setX( minX ); bounds.setY( minY ); bounds.setWidth( maxX - minX ); bounds.setHeight( maxY - minY ); return bounds; }
GuidedDecisionTableModellerBoundsHelper { public Bounds getBounds( final Set<GuidedDecisionTableView.Presenter> dtPresenters ) { double minX = BOUNDS_MIN_X; double minY = BOUNDS_MIN_Y; double maxX = BOUNDS_MAX_X; double maxY = BOUNDS_MAX_Y; for ( GuidedDecisionTableView.Presenter dtPresenter : dtPresenters ) { final GuidedDecisionTableView dtView = dtPresenter.getView(); minX = Math.min( dtView.getX() - BOUNDS_PADDING, minX ); minY = Math.min( dtView.getY() - BOUNDS_PADDING, minY ); maxX = Math.max( dtView.getX() + dtView.getWidth() + BOUNDS_PADDING, maxX ); maxY = Math.max( dtView.getY() + dtView.getHeight() + BOUNDS_PADDING, maxY ); } bounds.setX( minX ); bounds.setY( minY ); bounds.setWidth( maxX - minX ); bounds.setHeight( maxY - minY ); return bounds; } }
GuidedDecisionTableModellerBoundsHelper { public Bounds getBounds( final Set<GuidedDecisionTableView.Presenter> dtPresenters ) { double minX = BOUNDS_MIN_X; double minY = BOUNDS_MIN_Y; double maxX = BOUNDS_MAX_X; double maxY = BOUNDS_MAX_Y; for ( GuidedDecisionTableView.Presenter dtPresenter : dtPresenters ) { final GuidedDecisionTableView dtView = dtPresenter.getView(); minX = Math.min( dtView.getX() - BOUNDS_PADDING, minX ); minY = Math.min( dtView.getY() - BOUNDS_PADDING, minY ); maxX = Math.max( dtView.getX() + dtView.getWidth() + BOUNDS_PADDING, maxX ); maxY = Math.max( dtView.getY() + dtView.getHeight() + BOUNDS_PADDING, maxY ); } bounds.setX( minX ); bounds.setY( minY ); bounds.setWidth( maxX - minX ); bounds.setHeight( maxY - minY ); return bounds; }  }
GuidedDecisionTableModellerBoundsHelper { public Bounds getBounds( final Set<GuidedDecisionTableView.Presenter> dtPresenters ) { double minX = BOUNDS_MIN_X; double minY = BOUNDS_MIN_Y; double maxX = BOUNDS_MAX_X; double maxY = BOUNDS_MAX_Y; for ( GuidedDecisionTableView.Presenter dtPresenter : dtPresenters ) { final GuidedDecisionTableView dtView = dtPresenter.getView(); minX = Math.min( dtView.getX() - BOUNDS_PADDING, minX ); minY = Math.min( dtView.getY() - BOUNDS_PADDING, minY ); maxX = Math.max( dtView.getX() + dtView.getWidth() + BOUNDS_PADDING, maxX ); maxY = Math.max( dtView.getY() + dtView.getHeight() + BOUNDS_PADDING, maxY ); } bounds.setX( minX ); bounds.setY( minY ); bounds.setWidth( maxX - minX ); bounds.setHeight( maxY - minY ); return bounds; }  Bounds getBounds( final Set<GuidedDecisionTableView.Presenter> dtPresenters ); }
GuidedDecisionTableModellerBoundsHelper { public Bounds getBounds( final Set<GuidedDecisionTableView.Presenter> dtPresenters ) { double minX = BOUNDS_MIN_X; double minY = BOUNDS_MIN_Y; double maxX = BOUNDS_MAX_X; double maxY = BOUNDS_MAX_Y; for ( GuidedDecisionTableView.Presenter dtPresenter : dtPresenters ) { final GuidedDecisionTableView dtView = dtPresenter.getView(); minX = Math.min( dtView.getX() - BOUNDS_PADDING, minX ); minY = Math.min( dtView.getY() - BOUNDS_PADDING, minY ); maxX = Math.max( dtView.getX() + dtView.getWidth() + BOUNDS_PADDING, maxX ); maxY = Math.max( dtView.getY() + dtView.getHeight() + BOUNDS_PADDING, maxY ); } bounds.setX( minX ); bounds.setY( minY ); bounds.setWidth( maxX - minX ); bounds.setHeight( maxY - minY ); return bounds; }  Bounds getBounds( final Set<GuidedDecisionTableView.Presenter> dtPresenters ); static final double BOUNDS_MIN_X; static final double BOUNDS_MAX_X; static final double BOUNDS_MIN_Y; static final double BOUNDS_MAX_Y; static final double BOUNDS_PADDING; }