@Test @SuppressWarnings("unchecked") public void testUpdateControlPoint() { Point2D p = new Point2D(0.1, 0.2); Point2DArray cps = new Point2DArray(new Point2D(0, 0), p, new Point2D(1, 2)); when(line.getPoint2DArray()).thenReturn(cps); IControlHandleList pointHandles = mock(IControlHandleList.class); when(pointHandles.isEmpty()).thenReturn(false); when(pointHandles.size()).thenReturn(1); tested.setPointHandles(pointHandles); tested.updateControlPoints(new ControlPoint[]{ControlPoint.build(0.5, 0.5)}); assertEquals(0.5, p.getX(), 0d); assertEquals(0.5, p.getY(), 0d); }
@Override public T updateControlPoints(final ControlPoint[] controlPoints) { for (int i = 0; i < controlPoints.length; i++) { final Point2D location = controlPoints[i].getLocation(); final com.ait.lienzo.client.core.types.Point2D lienzoPoint = new com.ait.lienzo.client.core.types.Point2D(location.getX(), location.getY()); moveControlPoint(i + 1, lienzoPoint); } refreshControlPoints(); return cast(); }
WiresConnectorView extends WiresConnector implements
        LienzoShapeView<T>,
        IsConnector<T>,
        HasManageableControlPoints<T> { @Override public T updateControlPoints(final ControlPoint[] controlPoints) { for (int i = 0; i < controlPoints.length; i++) { final Point2D location = controlPoints[i].getLocation(); final com.ait.lienzo.client.core.types.Point2D lienzoPoint = new com.ait.lienzo.client.core.types.Point2D(location.getX(), location.getY()); moveControlPoint(i + 1, lienzoPoint); } refreshControlPoints(); return cast(); } }
WiresConnectorView extends WiresConnector implements
        LienzoShapeView<T>,
        IsConnector<T>,
        HasManageableControlPoints<T> { @Override public T updateControlPoints(final ControlPoint[] controlPoints) { for (int i = 0; i < controlPoints.length; i++) { final Point2D location = controlPoints[i].getLocation(); final com.ait.lienzo.client.core.types.Point2D lienzoPoint = new com.ait.lienzo.client.core.types.Point2D(location.getX(), location.getY()); moveControlPoint(i + 1, lienzoPoint); } refreshControlPoints(); return cast(); } WiresConnectorView(final AbstractDirectionalMultiPointShape<?> line,
                              final MultiPathDecorator headDecorator,
                              final MultiPathDecorator tailDecorator);  WiresConnectorView(final WiresMagnet headMagnet,
                              final WiresMagnet tailMagnet,
                              final AbstractDirectionalMultiPointShape<?> line,
                              final MultiPathDecorator headDecorator,
                              final MultiPathDecorator tailDecorator); }
WiresConnectorView extends WiresConnector implements
        LienzoShapeView<T>,
        IsConnector<T>,
        HasManageableControlPoints<T> { @Override public T updateControlPoints(final ControlPoint[] controlPoints) { for (int i = 0; i < controlPoints.length; i++) { final Point2D location = controlPoints[i].getLocation(); final com.ait.lienzo.client.core.types.Point2D lienzoPoint = new com.ait.lienzo.client.core.types.Point2D(location.getX(), location.getY()); moveControlPoint(i + 1, lienzoPoint); } refreshControlPoints(); return cast(); } WiresConnectorView(final AbstractDirectionalMultiPointShape<?> line,
                              final MultiPathDecorator headDecorator,
                              final MultiPathDecorator tailDecorator);  WiresConnectorView(final WiresMagnet headMagnet,
                              final WiresMagnet tailMagnet,
                              final AbstractDirectionalMultiPointShape<?> line,
                              final MultiPathDecorator headDecorator,
                              final MultiPathDecorator tailDecorator); @Override @SuppressWarnings("unchecked") T setUUID(final String uuid); @Override String getUUID(); T setListening(final boolean listening); @Override ControlPoint[] getManageableControlPoints(); @Override T addControlPoint(final ControlPoint controlPoint,
                             final int index); @Override T updateControlPoints(final ControlPoint[] controlPoints); @Override T deleteControlPoint(final int index); @SuppressWarnings("unchecked") T connect(final ShapeView headShapeView,
                     final Connection headConnection,
                     final ShapeView tailShapeView,
                     final Connection tailConnection); @Override double getShapeX(); @Override double getShapeY(); @Override T setShapeLocation(final Point2D location); @Override double getAlpha(); @Override @SuppressWarnings("unchecked") T setAlpha(final double alpha); @Override Point2D getShapeAbsoluteLocation(); @Override String getFillColor(); @Override @SuppressWarnings("unchecked") T setFillColor(final String color); @Override double getFillAlpha(); @Override @SuppressWarnings("unchecked") T setFillAlpha(final double alpha); @Override String getStrokeColor(); @Override @SuppressWarnings("unchecked") T setStrokeColor(final String color); @Override double getStrokeAlpha(); @Override @SuppressWarnings("unchecked") T setStrokeAlpha(final double alpha); @Override double getStrokeWidth(); @Override @SuppressWarnings("unchecked") T setStrokeWidth(final double width); @Override T setDragEnabled(boolean draggable); @Override @SuppressWarnings("unchecked") T moveToTop(); @Override @SuppressWarnings("unchecked") T moveToBottom(); @Override @SuppressWarnings("unchecked") T moveUp(); @Override @SuppressWarnings("unchecked") T moveDown(); @Override @SuppressWarnings("unchecked") T showControlPoints(final ControlPointType type); @Override @SuppressWarnings("unchecked") T hideControlPoints(); @Override boolean areControlsVisible(); @Override List<Shape<?>> getDecorators(); @Override BoundingBox getBoundingBox(); @Override void removeFromParent(); @Override T setShadow(final String color,
                       final int blur,
                       final double offx,
                       final double offy); @Override T removeShadow(); T setDashArray(DashArray dashArray); @Override Object getUserData(); @Override void setUserData(Object userData); }
WiresConnectorView extends WiresConnector implements
        LienzoShapeView<T>,
        IsConnector<T>,
        HasManageableControlPoints<T> { @Override public T updateControlPoints(final ControlPoint[] controlPoints) { for (int i = 0; i < controlPoints.length; i++) { final Point2D location = controlPoints[i].getLocation(); final com.ait.lienzo.client.core.types.Point2D lienzoPoint = new com.ait.lienzo.client.core.types.Point2D(location.getX(), location.getY()); moveControlPoint(i + 1, lienzoPoint); } refreshControlPoints(); return cast(); } WiresConnectorView(final AbstractDirectionalMultiPointShape<?> line,
                              final MultiPathDecorator headDecorator,
                              final MultiPathDecorator tailDecorator);  WiresConnectorView(final WiresMagnet headMagnet,
                              final WiresMagnet tailMagnet,
                              final AbstractDirectionalMultiPointShape<?> line,
                              final MultiPathDecorator headDecorator,
                              final MultiPathDecorator tailDecorator); @Override @SuppressWarnings("unchecked") T setUUID(final String uuid); @Override String getUUID(); T setListening(final boolean listening); @Override ControlPoint[] getManageableControlPoints(); @Override T addControlPoint(final ControlPoint controlPoint,
                             final int index); @Override T updateControlPoints(final ControlPoint[] controlPoints); @Override T deleteControlPoint(final int index); @SuppressWarnings("unchecked") T connect(final ShapeView headShapeView,
                     final Connection headConnection,
                     final ShapeView tailShapeView,
                     final Connection tailConnection); @Override double getShapeX(); @Override double getShapeY(); @Override T setShapeLocation(final Point2D location); @Override double getAlpha(); @Override @SuppressWarnings("unchecked") T setAlpha(final double alpha); @Override Point2D getShapeAbsoluteLocation(); @Override String getFillColor(); @Override @SuppressWarnings("unchecked") T setFillColor(final String color); @Override double getFillAlpha(); @Override @SuppressWarnings("unchecked") T setFillAlpha(final double alpha); @Override String getStrokeColor(); @Override @SuppressWarnings("unchecked") T setStrokeColor(final String color); @Override double getStrokeAlpha(); @Override @SuppressWarnings("unchecked") T setStrokeAlpha(final double alpha); @Override double getStrokeWidth(); @Override @SuppressWarnings("unchecked") T setStrokeWidth(final double width); @Override T setDragEnabled(boolean draggable); @Override @SuppressWarnings("unchecked") T moveToTop(); @Override @SuppressWarnings("unchecked") T moveToBottom(); @Override @SuppressWarnings("unchecked") T moveUp(); @Override @SuppressWarnings("unchecked") T moveDown(); @Override @SuppressWarnings("unchecked") T showControlPoints(final ControlPointType type); @Override @SuppressWarnings("unchecked") T hideControlPoints(); @Override boolean areControlsVisible(); @Override List<Shape<?>> getDecorators(); @Override BoundingBox getBoundingBox(); @Override void removeFromParent(); @Override T setShadow(final String color,
                       final int blur,
                       final double offx,
                       final double offy); @Override T removeShadow(); T setDashArray(DashArray dashArray); @Override Object getUserData(); @Override void setUserData(Object userData);  }