@Test @SuppressWarnings("unchecked") public void testGetEmptyControlPoints2() { Point2DArray linePoints = new Point2DArray(new Point2D(0, 0)); when(line.getPoint2DArray()).thenReturn(linePoints); ControlPoint[] controlPoints = tested.getManageableControlPoints(); assertNotNull(controlPoints); assertEquals(0, controlPoints.length); }
@Override public ControlPoint[] getManageableControlPoints() { final Point2DArray controlPoints = getControlPoints(); if (null != controlPoints && controlPoints.size() > 2) { return StreamSupport.stream(controlPoints.spliterator(), false) .limit(controlPoints.size() - 1) .skip(1) .map(controlPoint -> ControlPoint.build(controlPoint.getX(), controlPoint.getY())) .toArray(ControlPoint[]::new); } return new ControlPoint[0]; }
WiresConnectorView extends WiresConnector implements
        LienzoShapeView<T>,
        IsConnector<T>,
        HasManageableControlPoints<T> { @Override public ControlPoint[] getManageableControlPoints() { final Point2DArray controlPoints = getControlPoints(); if (null != controlPoints && controlPoints.size() > 2) { return StreamSupport.stream(controlPoints.spliterator(), false) .limit(controlPoints.size() - 1) .skip(1) .map(controlPoint -> ControlPoint.build(controlPoint.getX(), controlPoint.getY())) .toArray(ControlPoint[]::new); } return new ControlPoint[0]; } }
WiresConnectorView extends WiresConnector implements
        LienzoShapeView<T>,
        IsConnector<T>,
        HasManageableControlPoints<T> { @Override public ControlPoint[] getManageableControlPoints() { final Point2DArray controlPoints = getControlPoints(); if (null != controlPoints && controlPoints.size() > 2) { return StreamSupport.stream(controlPoints.spliterator(), false) .limit(controlPoints.size() - 1) .skip(1) .map(controlPoint -> ControlPoint.build(controlPoint.getX(), controlPoint.getY())) .toArray(ControlPoint[]::new); } return new ControlPoint[0]; } 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 ControlPoint[] getManageableControlPoints() { final Point2DArray controlPoints = getControlPoints(); if (null != controlPoints && controlPoints.size() > 2) { return StreamSupport.stream(controlPoints.spliterator(), false) .limit(controlPoints.size() - 1) .skip(1) .map(controlPoint -> ControlPoint.build(controlPoint.getX(), controlPoint.getY())) .toArray(ControlPoint[]::new); } return new ControlPoint[0]; } 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 ControlPoint[] getManageableControlPoints() { final Point2DArray controlPoints = getControlPoints(); if (null != controlPoints && controlPoints.size() > 2) { return StreamSupport.stream(controlPoints.spliterator(), false) .limit(controlPoints.size() - 1) .skip(1) .map(controlPoint -> ControlPoint.build(controlPoint.getX(), controlPoint.getY())) .toArray(ControlPoint[]::new); } return new ControlPoint[0]; } 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);  }