ColumnHeaderPopOverImpl implements ColumnHeaderPopOver { @Override public void show(final GuidedDecisionTableModellerView modellerView, final GuidedDecisionTableView.Presenter dtPresenter, final int uiColumnIndex) { PortablePreconditions.checkNotNull("modellerView", modellerView); PortablePreconditions.checkNotNull("dtPresenter", dtPresenter); showSource(modellerView, dtPresenter, uiColumnIndex); } @Inject  ColumnHeaderPopOverImpl(final PopOverView view,
                                   final ColumnDefinitionFactory columnDefinitionFactory); @Override void show(final GuidedDecisionTableModellerView modellerView,
                     final GuidedDecisionTableView.Presenter dtPresenter,
                     final int uiColumnIndex); @Override void hide();  }
@Test public void showColumnHeaderPositioningFloatingBlockColumns_Scale100pct() { when( transform.getScaleX() ).thenReturn( 1.0 ); when( transform.getScaleY() ).thenReturn( 1.0 ); popOver.show( modellerView, dtPresenter, 0 ); verify( view, times( 1 ) ).show( contentProviderArgumentCaptor.capture() ); final PopOverView.ContentProvider contentProvider = contentProviderArgumentCaptor.getValue(); contentProvider.getContent( ( PopOverView.Content content ) -> { assertEquals( 350, content.getX() ); assertEquals( 148, content.getY() ); assertEquals( "#", content.getContent() ); } ); }
@Test public void showColumnHeaderPositioningBodyBlockColumns_Scale100pct() { when( transform.getScaleX() ).thenReturn( 1.0 ); when( transform.getScaleY() ).thenReturn( 1.0 ); popOver.show( modellerView, dtPresenter, 1 ); verify( view, times( 1 ) ).show( contentProviderArgumentCaptor.capture() ); final PopOverView.ContentProvider contentProvider = contentProviderArgumentCaptor.getValue(); contentProvider.getContent( ( PopOverView.Content content ) -> { assertEquals( 400, content.getX() ); assertEquals( 148, content.getY() ); assertEquals( "description", content.getContent() ); } ); }
@Test public void showColumnHeaderPositioningFloatingBlockColumns_Scale75pct() { when( transform.getScaleX() ).thenReturn( 0.75 ); when( transform.getScaleY() ).thenReturn( 0.75 ); popOver.show( modellerView, dtPresenter, 0 ); verify( view, times( 1 ) ).show( contentProviderArgumentCaptor.capture() ); final PopOverView.ContentProvider contentProvider = contentProviderArgumentCaptor.getValue(); contentProvider.getContent( ( PopOverView.Content content ) -> { assertEquals( 312, content.getX() ); assertEquals( 111, content.getY() ); assertEquals( "#", content.getContent() ); } ); }
@Test public void showColumnHeaderPositioningBodyBlockColumns_Scale75pct() { when( transform.getScaleX() ).thenReturn( 0.75 ); when( transform.getScaleY() ).thenReturn( 0.75 ); popOver.show( modellerView, dtPresenter, 1 ); verify( view, times( 1 ) ).show( contentProviderArgumentCaptor.capture() ); final PopOverView.ContentProvider contentProvider = contentProviderArgumentCaptor.getValue(); contentProvider.getContent( ( PopOverView.Content content ) -> { assertEquals( 350, content.getX() ); assertEquals( 111, content.getY() ); assertEquals( "description", content.getContent() ); } ); }
@Test public void showColumnServiceInvocation() { final Pattern52 p = new Pattern52(); p.getChildColumns().add( new ConditionCol52() ); this.model.getConditions().add( p ); final BaseGridColumn<String> uiColumn3 = new BaseGridColumn<>( new BaseHeaderMetaData( "condition" ), columnRenderer, 100.0 ); uiModel.appendColumn( uiColumn3 ); when( transform.getScaleX() ).thenReturn( 1.0 ); when( transform.getScaleY() ).thenReturn( 1.0 ); popOver.show( modellerView, dtPresenter, 3 ); verify( view, times( 1 ) ).show( contentProviderArgumentCaptor.capture() ); popOver.show( modellerView, dtPresenter, 3 ); verify( view, times( 2 ) ).show( contentProviderArgumentCaptor.capture() ); final PopOverView.ContentProvider contentProvider = contentProviderArgumentCaptor.getValue(); contentProvider.getContent( ( PopOverView.Content content ) -> { assertEquals( "source", content.getContent() ); } ); verify( service, times( 1 ) ).toSource( any( Path.class ), any( GuidedDecisionTable52.class ) ); }