use of com.ait.lienzo.client.core.shape.MultiPath in project kie-wb-common by kiegroup.
the class CaseManagementColorMapBackedPickerTest method checkDropZonesAreAddedForCaseManagementShapesWithDropZone.
@Test
public void checkDropZonesAreAddedForCaseManagementShapesWithDropZone() {
final MultiPath dropZone = mock(MultiPath.class);
when(dropZone.getAttributes()).thenReturn(mock(Attributes.class));
when(dropZone.getPathPartListArray()).thenReturn(new NFastArrayList<>());
final AbstractCaseManagementShape shape = mock(AbstractCaseManagementShape.class);
when(shape.getDropZone()).thenReturn(Optional.of(dropZone));
when(dropZone.getActualPathPartListArray()).thenReturn(new NFastArrayList<PathPartList>());
picker.addSupplementaryPaths(shape);
verify(picker, times(1)).addDropZone(eq(shape));
verify(picker, times(1)).drawShape(anyString(), anyDouble(), eq(dropZone), any(PickerPart.class), eq(true));
}
use of com.ait.lienzo.client.core.shape.MultiPath in project lienzo-core by ahome-it.
the class WiresShapeHighlightImpl method highlightBorder.
private void highlightBorder(final WiresShape parent) {
if (null == m_path) {
final MultiPath path = parent.getPath();
m_path = path.copy();
m_path.setStrokeWidth(borderSize);
final Point2D absLoc = path.getComputedLocation();
m_path.setX(absLoc.getX());
m_path.setY(absLoc.getY());
m_path.setStrokeColor("#CC1100");
m_path.setStrokeAlpha(0.8);
parent.getGroup().getOverLayer().add(m_path);
this.parent = parent;
drawOverLayer();
}
}
use of com.ait.lienzo.client.core.shape.MultiPath in project lienzo-core by ahome-it.
the class WiresConnector method updateForCenterConnection.
public static void updateForCenterConnection(final WiresConnector connector, final WiresConnection connection, final int pointIndex) {
if ((connection.getMagnet() != null) && (connection.getMagnet().getIndex() == 0)) {
final MultiPath path = connection.getMagnet().getMagnets().getWiresShape().getPath();
final BoundingBox box = path.getBoundingBox();
final Point2D c = Geometry.findCenter(box);
Point2D intersectPoint = Geometry.getPathIntersect(connection, path, c, pointIndex);
if (null == intersectPoint) {
intersectPoint = new Point2D();
}
final Direction d = MagnetManager.getDirection(intersectPoint, box);
final Point2D loc = path.getComputedLocation().copy();
connection.setXOffset(intersectPoint.getX() - c.getX());
connection.setYOffset(intersectPoint.getY() - c.getY());
if (connector.getHeadConnection() == connection) {
connector.getLine().setHeadDirection(d);
} else {
connector.getLine().setTailDirection(d);
}
connection.move(loc.getX() + c.getX(), loc.getY() + c.getY());
}
}
use of com.ait.lienzo.client.core.shape.MultiPath in project lienzo-core by ahome-it.
the class ColorMapBackedPicker method addShapes.
protected void addShapes(final NFastArrayList<WiresShape> shapes) {
for (int j = 0; j < shapes.size(); j++) {
final WiresShape prim = shapes.get(j);
if (m_options.shapesToSkip.contains(prim)) {
continue;
}
final MultiPath multiPath = prim.getPath();
drawShape(m_colorKeyRotor.next(), multiPath.getStrokeWidth(), new PickerPart(prim, PickerPart.ShapePart.BODY), true);
addSupplementaryPaths(prim);
if (m_options.hotspotsEnabled) {
drawShape(m_colorKeyRotor.next(), m_options.hotspotWidth, new PickerPart(prim, PickerPart.ShapePart.BORDER_HOTSPOT), false);
// need to be able to detect the difference between the actual border selection and the border hotspot
drawShape(m_colorKeyRotor.next(), multiPath.getStrokeWidth(), new PickerPart(prim, PickerPart.ShapePart.BORDER), false);
}
if ((prim.getChildShapes() != null) && !prim.getChildShapes().isEmpty()) {
addShapes(prim.getChildShapes());
}
}
}
use of com.ait.lienzo.client.core.shape.MultiPath in project lienzo-core by ahome-it.
the class BackingColorMapUtils method drawShapeToBacking.
public static void drawShapeToBacking(final Context2D ctx, final WiresShape shape, final String color) {
final MultiPath multiPath = shape.getPath();
drawShapeToBacking(ctx, shape, color, multiPath.getStrokeWidth(), true);
}
Aggregations