GridLienzoPanel extends FocusPanel implements RequiresResize,
                                                           ProvidesResize,
                                                           GridLienzoScrollable { @Override public void updatePanelSize() { final Element parentElement = getElement().getParentElement(); final Integer width = parentElement.getOffsetWidth(); final Integer height = parentElement.getOffsetHeight(); if (width > 0 && height > 0) { updatePanelSize(width, height); } } GridLienzoPanel();  GridLienzoPanel(final int width,
                           final int height);  GridLienzoPanel(final DefaultGridLayer defaultGridLayer);  GridLienzoPanel(final int width,
                           final int height,
                           final DefaultGridLayer defaultGridLayer); protected  GridLienzoPanel(final LienzoPanel lienzoPanel); protected  GridLienzoPanel(final LienzoPanel lienzoPanel,
                              final DefaultGridLayer defaultGridLayer); @Override void onResize(); @Override void updatePanelSize(); @Override void updatePanelSize(final Integer width,
                                final Integer height); @Override void refreshScrollPosition(); @Override void setBounds(final Bounds bounds); LienzoPanel add(final DefaultGridLayer layer); final Viewport getViewport(); LienzoPanel getLienzoPanel(); AbsolutePanel getScrollPanel(); AbsolutePanel getDomElementContainer(); AbsolutePanel getInternalScrollPanel(); DefaultGridLayer getDefaultGridLayer();  }
@Test public void testUpdatePanelSizeWhenWidthAndHeightAreGreaterThanZero() { final Element element = mock(Element.class); final Element parentElement = mock(Element.class); final Integer scrollWidth = 14; final Integer scrollHeight = 14; final Integer width = 800; final Integer height = 600; doReturn(element).when(gridLienzoPanel).getElement(); doReturn(parentElement).when(element).getParentElement(); doReturn(width).when(parentElement).getOffsetWidth(); doReturn(height).when(parentElement).getOffsetHeight(); doReturn(scrollWidth).when(gridLienzoScrollHandler).scrollbarWidth(); doReturn(scrollHeight).when(gridLienzoScrollHandler).scrollbarHeight(); gridLienzoPanel.updatePanelSize(); verify(domElementContainer).setPixelSize(width - scrollWidth, height - scrollHeight); verify(lienzoPanel).setPixelSize(width - scrollWidth, height - scrollHeight); verify(scrollPanel).setPixelSize(width, height); }
@Test public void testUpdatePanelSizeWhenWidthAndHeightAreNotGreaterThanZero() { final Element element = mock(Element.class); final Element parentElement = mock(Element.class); final Integer width = 0; final Integer height = 0; doReturn(element).when(gridLienzoPanel).getElement(); doReturn(parentElement).when(element).getParentElement(); doReturn(width).when(parentElement).getOffsetWidth(); doReturn(height).when(parentElement).getOffsetHeight(); gridLienzoPanel.updatePanelSize(); verify(domElementContainer, never()).setPixelSize(anyInt(), anyInt()); verify(lienzoPanel, never()).setPixelSize(anyInt(), anyInt()); verify(scrollPanel, never()).setPixelSize(anyInt(), anyInt()); }