use of com.ait.lienzo.client.core.shape.Layer in project kie-wb-common by kiegroup.
the class DMNGridPanelContextMenuHandlerTest method mockGridWidget.
private GridWidget mockGridWidget() {
final GridWidget gridWidget = spy(new BaseGridWidget(new BaseGridData(false), selectionManager, pinnedModeManager, renderer) {
@Override
public Layer getLayer() {
return gridLayer;
}
});
final GridColumn gridColumn = mock(GridColumn.class);
when(gridColumn.getWidth()).thenReturn(100.0);
when(gridColumn.isVisible()).thenReturn(true);
gridWidget.getModel().appendColumn(new RowNumberColumn());
gridWidget.getModel().appendColumn(gridColumn);
gridWidget.getModel().appendRow(new BaseGridRow());
gridWidget.getModel().appendRow(new BaseGridRow());
return gridWidget;
}
use of com.ait.lienzo.client.core.shape.Layer in project kie-wb-common by kiegroup.
the class CaseManagementContainmentControlTest method setup.
@Before
public void setup() {
layer = spy(new Layer());
shape = spy(new MockCaseManagementShape());
final Group shapeGroup = mock(Group.class);
when(shapeGroup.getLayer()).thenReturn(layer);
when(shape.getGroup()).thenReturn(shapeGroup);
when(shape.getWiresManager()).thenReturn(wiresManager);
when(shape.getGhost()).thenReturn(ghost);
when(wiresManager.getContainmentAcceptor()).thenReturn(containmentAcceptor);
when(parentPickerControl.getPickerOptions()).thenReturn(PICKER_OPTIONS);
when(parentPickerControl.getShapeLocationControl()).thenReturn(shapeLocationControl);
when(containmentControl.getParentPickerControl()).thenReturn(parentPickerControl);
when(containmentControl.getShape()).thenReturn(shape);
when(containmentControl.getParent()).thenReturn(parent);
final NFastArrayList<WiresShape> children = new NFastArrayList<>();
children.add(shape);
children.add(ghost);
when(parent.getChildShapes()).thenReturn(children);
when(parent.getLayoutHandler()).thenReturn(parentLayoutHandler);
when(parent.getIndex(eq(shape))).thenReturn(0);
when(parent.getGroup()).thenReturn(new Group());
when(state.getGhost()).thenReturn(Optional.of(ghost));
when(state.getOriginalParent()).thenReturn(Optional.of(parent));
when(state.getOriginalIndex()).thenReturn(Optional.of(0));
control = new CaseManagementContainmentControl(containmentControl, state);
}
use of com.ait.lienzo.client.core.shape.Layer in project kie-wb-common by kiegroup.
the class WiresShapeToolboxTest method testGetLayer.
@Test
public void testGetLayer() {
Layer layer = mock(Layer.class);
when(group.getLayer()).thenReturn(layer);
assertEquals(layer, tested.getLayer());
}
use of com.ait.lienzo.client.core.shape.Layer in project kie-wb-common by kiegroup.
the class PrimitivePopup method reset.
protected void reset() {
this.clear();
canvasLayer = new Layer();
lienzoPanel = null;
}
use of com.ait.lienzo.client.core.shape.Layer in project kie-wb-common by kiegroup.
the class ShapeGlyphDragHandlerImpl method show.
@Override
public DragProxy<AbstractCanvas, Item, DragProxyCallback> show(Item item, int x, int y, DragProxyCallback dragProxyCallback) {
int width = item.getWidth();
int height = item.getHeight();
final Group dragShape = glyphLienzoGlyphRenderer.render(item.getShape(), width, height);
dragShape.setX(0);
dragShape.setY(0);
this.dragProxyPanel = new LienzoPanel((width * 2), (height * 2));
dragProxyPanel.getElement().getStyle().setCursor(Style.Cursor.AUTO);
final Layer dragProxyLayer = new Layer();
dragProxyLayer.add(dragShape);
dragProxyPanel.add(dragProxyLayer);
dragProxyLayer.batch();
setDragProxyPosition(dragProxyPanel, width, height, x, y);
attachDragProxyHandlers(dragProxyPanel, dragProxyCallback);
addKeyboardEscHandler();
RootPanel.get().add(dragProxyPanel);
return this;
}
Aggregations