use of com.ait.lienzo.client.widget.panel.impl.LienzoPanelImpl in project kie-wb-common by kiegroup.
the class ShapeGlyphDragHandlerTest method setUp.
@Before
public void setUp() throws Exception {
proxyPanel = spy(new LienzoPanelImpl(DRAG_PROXY_WIDTH, DRAG_PROXY_HEIGHT));
when(proxyPanel.getElement()).thenReturn(proxyElement);
when(proxyElement.getStyle()).thenReturn(proxyStyle);
handlerRegistrations = new ArrayList<>();
glyphGroup = new Group();
when(glyphLienzoGlyphRenderer.render(eq(glyph), anyDouble(), anyDouble())).thenReturn(glyphGroup);
when(glyphDragItem.getHeight()).thenReturn(DRAG_PROXY_WIDTH);
when(glyphDragItem.getWidth()).thenReturn(DRAG_PROXY_HEIGHT);
when(glyphDragItem.getShape()).thenReturn(glyph);
when(rootPanel.addDomHandler(any(MouseMoveHandler.class), eq(MouseMoveEvent.getType()))).thenReturn(moveHandlerReg);
when(rootPanel.addDomHandler(any(MouseUpHandler.class), eq(MouseUpEvent.getType()))).thenReturn(upHandlerReg);
when(rootPanel.addDomHandler(any(KeyDownHandler.class), eq(KeyDownEvent.getType()))).thenReturn(keyHandlerReg);
tested = new ShapeGlyphDragHandler(glyphLienzoGlyphRenderer, handlerRegistrations, () -> rootPanel, item -> proxyPanel, (task, timeout) -> task.execute());
}
Aggregations