use of com.ait.lienzo.client.core.shape.wires.WiresShape in project kie-wb-common by kiegroup.
the class StageView method createGhost.
@Override
protected AbstractCaseManagementShape createGhost() {
final StageView ghost = new StageView(getWidth(), getHeight(), voffset);
for (WiresShape ws : getChildShapes()) {
final AbstractCaseManagementShape wsg = ((AbstractCaseManagementShape) ws).getGhost();
ghost.add(wsg);
}
return ghost;
}
use of com.ait.lienzo.client.core.shape.wires.WiresShape in project kie-wb-common by kiegroup.
the class AbstractCaseManagementShape method getIndex.
public int getIndex(final WiresShape shape) {
final NFastArrayList<WiresShape> children = getChildShapes();
int i = 0;
for (WiresShape child : children) {
if (child == shape || (child instanceof AbstractCaseManagementShape && shape instanceof AbstractCaseManagementShape && ((AbstractCaseManagementShape) child).getUUID().equals(((AbstractCaseManagementShape) shape).getUUID()))) {
return i;
}
i++;
}
return i;
}
use of com.ait.lienzo.client.core.shape.wires.WiresShape in project kie-wb-common by kiegroup.
the class HorizontalStackLayoutManager method layout.
@Override
public void layout(final WiresContainer container) {
double x = PADDING_X;
for (WiresShape ws : container.getChildShapes()) {
ws.setLocation(new Point2D(x, PADDING_Y));
x = x + ws.getPath().getBoundingBox().getWidth() + PADDING_X;
}
}
use of com.ait.lienzo.client.core.shape.wires.WiresShape in project kie-wb-common by kiegroup.
the class VerticalStackLayoutManager method orderChildren.
@Override
protected void orderChildren(final WiresShape shape, final WiresContainer container, final Point2D mouseRelativeLoc) {
if (container == null) {
return;
}
final double my = mouseRelativeLoc.getY();
final NFastArrayList<WiresShape> nChildren = container.getChildShapes().copy();
final List<WiresShape> children = nChildren.remove(shape).toList();
int targetIndex = children.size();
for (int idx = 0; idx < children.size(); idx++) {
final WiresShape child = children.get(idx);
if (my < child.getY()) {
targetIndex = idx;
break;
}
}
if (container instanceof AbstractCaseManagementShape) {
final int currentIndex = ((AbstractCaseManagementShape) container).getIndex(shape);
if (currentIndex != targetIndex) {
((AbstractCaseManagementShape) container).addShape(shape, targetIndex);
}
}
}
use of com.ait.lienzo.client.core.shape.wires.WiresShape in project kie-wb-common by kiegroup.
the class VerticalStackLayoutManager method layout.
@Override
public void layout(final WiresContainer container) {
double y = PADDING_Y;
if (container instanceof WiresShape) {
y = y + ((WiresShape) container).getPath().getBoundingBox().getHeight();
}
for (WiresShape ws : container.getChildShapes()) {
ws.setLocation(new Point2D(PADDING_X, y));
y = y + ws.getPath().getBoundingBox().getHeight() + PADDING_Y;
}
}
Aggregations