use of com.ait.lienzo.client.core.shape.Attributes in project kie-wb-common by kiegroup.
the class DirectionalLineTest method testStkipParse.
@Test
public void testStkipParse() throws Exception {
final Attributes attr = mock(Attributes.class);
final Point2DArray points = new Point2DArray();
when(attr.getControlPoints()).thenReturn(points);
final boolean parsed = tested.parse(attr);
assertFalse(parsed);
}
use of com.ait.lienzo.client.core.shape.Attributes in project lienzo-core by ahome-it.
the class DefaultDragConstraintEnforcer method startDrag.
@Override
public final void startDrag(final DragContext dragContext) {
final Attributes attr = dragContext.getNode().asNode().getAttributes();
m_constraint = attr.getDragConstraint();
m_bounds = attr.getDragBounds();
if (null != m_bounds) {
final double x = attr.getX();
final double y = attr.getY();
if (m_bounds.isX1()) {
m_dx1 = m_bounds.getX1() - x;
}
if (m_bounds.isX2()) {
m_dx2 = m_bounds.getX2() - x;
}
if (m_bounds.isY1()) {
m_dy1 = m_bounds.getY1() - y;
}
if (m_bounds.isY2()) {
m_dy2 = m_bounds.getY2() - y;
}
}
}
use of com.ait.lienzo.client.core.shape.Attributes in project kie-wb-common by kiegroup.
the class DirectionalLineTest method testParsePoints.
@Test
public void testParsePoints() throws Exception {
final Attributes attr = mock(Attributes.class);
final Point2DArray points = new Point2DArray(0d, 0d).push(20d, 30d);
when(attr.getControlPoints()).thenReturn(points);
final boolean parsed = tested.parse(attr);
assertTrue(parsed);
}
use of com.ait.lienzo.client.core.shape.Attributes in project lienzo-core by ahome-it.
the class AlignAndDistributeControlImpl method hasComplexTransformAttributes.
private final boolean hasComplexTransformAttributes() {
final Attributes attr = AlignAndDistribute.getAttributes(m_group);
if (attr.hasComplexTransformAttributes()) {
final double r = attr.getRotation();
if (r != 0) {
return true;
}
final Point2D scale = attr.getScale();
if (null != scale) {
if ((scale.getX() != 1) || (scale.getY() != 1)) {
return true;
}
}
final Point2D shear = attr.getShear();
if (null != shear) {
if ((shear.getX() != 0) || (shear.getY() != 0)) {
return true;
}
}
}
return false;
}
use of com.ait.lienzo.client.core.shape.Attributes in project kie-wb-common by kiegroup.
the class DirectionalLineTest method testSkipParse.
@Test
public void testSkipParse() throws Exception {
final Attributes attr = mock(Attributes.class);
final Point2DArray points = new Point2DArray();
when(attr.getControlPoints()).thenReturn(points);
final boolean parsed = tested.parse(attr);
assertFalse(parsed);
}
Aggregations