use of com.ait.lienzo.client.core.shape.wires.WiresContainer in project lienzo-core by ahome-it.
the class WiresCompositeShapeHandler method doAdjust.
@Override
protected boolean doAdjust(final Point2D dxy) {
final boolean adjusted = shapeControl.onMove(dxy.getX(), dxy.getY());
if (adjusted) {
dxy.set(shapeControl.getAdjust());
return true;
}
boolean shouldRestore = true;
if (shapeControl.isAllowed()) {
final WiresContainer parent = shapeControl.getSharedParent();
if ((null != parent) && (parent instanceof WiresShape)) {
highlight.highlight((WiresShape) parent, PickerPart.ShapePart.BODY);
shouldRestore = false;
}
}
if (shouldRestore) {
highlight.restore();
}
return false;
}
use of com.ait.lienzo.client.core.shape.wires.WiresContainer 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);
}
}
use of com.ait.lienzo.client.core.shape.wires.WiresContainer in project lienzo-core by ahome-it.
the class WiresParentPickerControlImpl method onMove.
@Override
public boolean onMove(final double dx, final double dy) {
if (!shapeLocationControl.onMove(dx, dy)) {
final Point2D currentLocation = getCurrentLocation();
final double x = currentLocation.getX();
final double y = currentLocation.getY();
WiresContainer parent = null;
PickerPart parentPart = findShapeAt(x, y);
if (parentPart != null) {
parent = parentPart.getShape();
}
if ((parent != m_parent) || (parentPart != m_parentPart)) {
parentPart = findShapeAt(x, y);
parent = null != parentPart ? parentPart.getShape() : null;
}
m_parent = parent;
m_parentPart = parentPart;
}
return false;
}
Aggregations