@Test @SuppressWarnings("unchecked") public void testInit() { tested.init(); ArgumentCaptor<BiFunction> builderCaptor = ArgumentCaptor.forClass(BiFunction.class); verify(panel, times(1)).setPanelBuilder(builderCaptor.capture()); BiFunction<OptionalInt, OptionalInt, LienzoBoundsPanel> builder = builderCaptor.getValue(); LienzoBoundsPanel result = builder.apply(OptionalInt.of(300), OptionalInt.of(450)); assertTrue(result instanceof ScrollableLienzoPanelView); assertEquals(300, result.getWidthPx()); assertEquals(450, result.getHeightPx()); }
@PostConstruct public void init() { panel.setPanelBuilder((width, height) -> { if (width.isPresent() && height.isPresent()) { return new ScrollableLienzoPanelView(width.getAsInt(), height.getAsInt()); } return new ScrollableLienzoPanelView(); }); }
ScrollableLienzoPanel extends DelegateLienzoPanel<StunnerLienzoBoundsPanel> { @PostConstruct public void init() { panel.setPanelBuilder((width, height) -> { if (width.isPresent() && height.isPresent()) { return new ScrollableLienzoPanelView(width.getAsInt(), height.getAsInt()); } return new ScrollableLienzoPanelView(); }); } }
ScrollableLienzoPanel extends DelegateLienzoPanel<StunnerLienzoBoundsPanel> { @PostConstruct public void init() { panel.setPanelBuilder((width, height) -> { if (width.isPresent() && height.isPresent()) { return new ScrollableLienzoPanelView(width.getAsInt(), height.getAsInt()); } return new ScrollableLienzoPanelView(); }); } @Inject  ScrollableLienzoPanel(final StunnerLienzoBoundsPanel panel); }
ScrollableLienzoPanel extends DelegateLienzoPanel<StunnerLienzoBoundsPanel> { @PostConstruct public void init() { panel.setPanelBuilder((width, height) -> { if (width.isPresent() && height.isPresent()) { return new ScrollableLienzoPanelView(width.getAsInt(), height.getAsInt()); } return new ScrollableLienzoPanelView(); }); } @Inject  ScrollableLienzoPanel(final StunnerLienzoBoundsPanel panel); @PostConstruct void init(); ScrollableLienzoPanel refresh(); }
ScrollableLienzoPanel extends DelegateLienzoPanel<StunnerLienzoBoundsPanel> { @PostConstruct public void init() { panel.setPanelBuilder((width, height) -> { if (width.isPresent() && height.isPresent()) { return new ScrollableLienzoPanelView(width.getAsInt(), height.getAsInt()); } return new ScrollableLienzoPanelView(); }); } @Inject  ScrollableLienzoPanel(final StunnerLienzoBoundsPanel panel); @PostConstruct void init(); ScrollableLienzoPanel refresh();  }