@Test public void popOverWhenEventOverDecisionTableHeaderAndColumnWithMultipleTables() { when(modellerPresenter.getAvailableDecisionTables()).thenReturn(new HashSet<GuidedDecisionTableView.Presenter>() {{ add(dtPresenter1); add(dtPresenter2); }}); when(dtView1.getComputedLocation()).thenReturn(new Point2D(0, 0)); when(dtView2.getComputedLocation()).thenReturn(new Point2D(200, 200)); when(event.getX()).thenReturn(50); when(event.getY()).thenReturn(50); handler.onNodeMouseMove(event); verify(columnPopOverPresenter, times(1)).show(any(GuidedDecisionTableModellerView.class), eq(dtPresenter1), eq(0)); when(event.getX()).thenReturn(250); when(event.getY()).thenReturn(250); handler.onNodeMouseMove(event); verify(columnPopOverPresenter, times(1)).show(any(GuidedDecisionTableModellerView.class), eq(dtPresenter2), eq(0)); }
@Override public void onNodeMouseMove( final NodeMouseMoveEvent event ) { columnPopOverPresenter.hide(); for ( GuidedDecisionTableView.Presenter dtPresenter : modellerPresenter.getAvailableDecisionTables() ) { final GuidedDecisionTableView dtView = dtPresenter.getView(); if ( !dtView.isVisible() ) { continue; } final Point2D ap = CoordinateUtilities.convertDOMToGridCoordinate( dtView, new Point2D( event.getX(), event.getY() ) ); if ( !isMouseOverTableHeader( dtView, ap.getY() ) ) { continue; } final Integer uiColumnIndex = getUiColumn( dtView, ap.getX() ); if ( uiColumnIndex == null ) { continue; } columnPopOverPresenter.show( modellerPresenter.getView(), dtPresenter, uiColumnIndex ); } }
ColumnHeaderPopOverHandler implements NodeMouseMoveHandler { @Override public void onNodeMouseMove( final NodeMouseMoveEvent event ) { columnPopOverPresenter.hide(); for ( GuidedDecisionTableView.Presenter dtPresenter : modellerPresenter.getAvailableDecisionTables() ) { final GuidedDecisionTableView dtView = dtPresenter.getView(); if ( !dtView.isVisible() ) { continue; } final Point2D ap = CoordinateUtilities.convertDOMToGridCoordinate( dtView, new Point2D( event.getX(), event.getY() ) ); if ( !isMouseOverTableHeader( dtView, ap.getY() ) ) { continue; } final Integer uiColumnIndex = getUiColumn( dtView, ap.getX() ); if ( uiColumnIndex == null ) { continue; } columnPopOverPresenter.show( modellerPresenter.getView(), dtPresenter, uiColumnIndex ); } } }
ColumnHeaderPopOverHandler implements NodeMouseMoveHandler { @Override public void onNodeMouseMove( final NodeMouseMoveEvent event ) { columnPopOverPresenter.hide(); for ( GuidedDecisionTableView.Presenter dtPresenter : modellerPresenter.getAvailableDecisionTables() ) { final GuidedDecisionTableView dtView = dtPresenter.getView(); if ( !dtView.isVisible() ) { continue; } final Point2D ap = CoordinateUtilities.convertDOMToGridCoordinate( dtView, new Point2D( event.getX(), event.getY() ) ); if ( !isMouseOverTableHeader( dtView, ap.getY() ) ) { continue; } final Integer uiColumnIndex = getUiColumn( dtView, ap.getX() ); if ( uiColumnIndex == null ) { continue; } columnPopOverPresenter.show( modellerPresenter.getView(), dtPresenter, uiColumnIndex ); } } ColumnHeaderPopOverHandler( final GuidedDecisionTableModellerView.Presenter modellerPresenter,
                                       final ColumnHeaderPopOver columnPopOverPresenter ); }
ColumnHeaderPopOverHandler implements NodeMouseMoveHandler { @Override public void onNodeMouseMove( final NodeMouseMoveEvent event ) { columnPopOverPresenter.hide(); for ( GuidedDecisionTableView.Presenter dtPresenter : modellerPresenter.getAvailableDecisionTables() ) { final GuidedDecisionTableView dtView = dtPresenter.getView(); if ( !dtView.isVisible() ) { continue; } final Point2D ap = CoordinateUtilities.convertDOMToGridCoordinate( dtView, new Point2D( event.getX(), event.getY() ) ); if ( !isMouseOverTableHeader( dtView, ap.getY() ) ) { continue; } final Integer uiColumnIndex = getUiColumn( dtView, ap.getX() ); if ( uiColumnIndex == null ) { continue; } columnPopOverPresenter.show( modellerPresenter.getView(), dtPresenter, uiColumnIndex ); } } ColumnHeaderPopOverHandler( final GuidedDecisionTableModellerView.Presenter modellerPresenter,
                                       final ColumnHeaderPopOver columnPopOverPresenter ); @Override void onNodeMouseMove( final NodeMouseMoveEvent event ); }
ColumnHeaderPopOverHandler implements NodeMouseMoveHandler { @Override public void onNodeMouseMove( final NodeMouseMoveEvent event ) { columnPopOverPresenter.hide(); for ( GuidedDecisionTableView.Presenter dtPresenter : modellerPresenter.getAvailableDecisionTables() ) { final GuidedDecisionTableView dtView = dtPresenter.getView(); if ( !dtView.isVisible() ) { continue; } final Point2D ap = CoordinateUtilities.convertDOMToGridCoordinate( dtView, new Point2D( event.getX(), event.getY() ) ); if ( !isMouseOverTableHeader( dtView, ap.getY() ) ) { continue; } final Integer uiColumnIndex = getUiColumn( dtView, ap.getX() ); if ( uiColumnIndex == null ) { continue; } columnPopOverPresenter.show( modellerPresenter.getView(), dtPresenter, uiColumnIndex ); } } ColumnHeaderPopOverHandler( final GuidedDecisionTableModellerView.Presenter modellerPresenter,
                                       final ColumnHeaderPopOver columnPopOverPresenter ); @Override void onNodeMouseMove( final NodeMouseMoveEvent event );  }