Search in sources :

Example 6 with WiresLayer

use of com.ait.lienzo.client.core.shape.wires.WiresLayer in project lienzo-core by ahome-it.

the class WiresContainmentControlImpl method calculateCandidateLocation.

public static Point2D calculateCandidateLocation(final WiresParentPickerControlImpl parentPickerControl) {
    final WiresLayer layer = parentPickerControl.getShape().getWiresManager().getLayer();
    final WiresContainer parent = parentPickerControl.getParent();
    final Point2D current = parentPickerControl.getShapeLocation();
    if ((parent == null) || (parent == layer)) {
        return current;
    } else {
        final Point2D trgAbsOffset = parent.getComputedLocation();
        return current.minus(trgAbsOffset);
    }
}
Also used : Point2D(com.ait.lienzo.client.core.types.Point2D) WiresContainer(com.ait.lienzo.client.core.shape.wires.WiresContainer) WiresLayer(com.ait.lienzo.client.core.shape.wires.WiresLayer)

Example 7 with WiresLayer

use of com.ait.lienzo.client.core.shape.wires.WiresLayer in project lienzo-core by ahome-it.

the class WiresDockingControlImpl method _isAccept.

private boolean _isAccept() {
    final WiresLayer layer = getParentPickerControl().getWiresLayer();
    final WiresManager wiresManager = layer.getWiresManager();
    final IDockingAcceptor dockingAcceptor = wiresManager.getDockingAcceptor();
    return (null != getParent()) && (null != getParentShapePart()) && (getParentShapePart() == PickerPart.ShapePart.BORDER) && dockingAcceptor.acceptDocking(getParent(), getShape());
}
Also used : IDockingAcceptor(com.ait.lienzo.client.core.shape.wires.IDockingAcceptor) WiresManager(com.ait.lienzo.client.core.shape.wires.WiresManager) WiresLayer(com.ait.lienzo.client.core.shape.wires.WiresLayer)

Aggregations

WiresLayer (com.ait.lienzo.client.core.shape.wires.WiresLayer)7 WiresManager (com.ait.lienzo.client.core.shape.wires.WiresManager)3 Layer (com.ait.lienzo.client.core.shape.Layer)2 IDockingAcceptor (com.ait.lienzo.client.core.shape.wires.IDockingAcceptor)2 WiresContainer (com.ait.lienzo.client.core.shape.wires.WiresContainer)2 WiresShape (com.ait.lienzo.client.core.shape.wires.WiresShape)2 Test (org.junit.Test)2 IContainmentAcceptor (com.ait.lienzo.client.core.shape.wires.IContainmentAcceptor)1 Point2D (com.ait.lienzo.client.core.types.Point2D)1