Revision 2616 org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.arc/src/main/java/org/gvsig/vectorediting/lib/prov/arc/ArcByCenterEditingProvider.java

View differences:

ArcByCenterEditingProvider.java
30 30
import java.util.Map;
31 31
import org.gvsig.euclidean.EuclideanLine2D;
32 32
import org.gvsig.euclidean.EuclideanManager;
33

  
34 33
import org.gvsig.fmap.dal.feature.FeatureStore;
35 34
import org.gvsig.fmap.geom.Geometry;
36 35
import org.gvsig.fmap.geom.GeometryLocator;
......
174 173
        
175 174
        DefaultDrawingStatus geometries = new DefaultDrawingStatus();
176 175

  
176
        ISymbol previewSymbol = this.getPreviewSymbol();
177
        geometries.setPreviewSymbol(previewSymbol);
178
        
177 179
        EditingProviderManager editingProviderManager
178 180
                = EditingProviderLocator.getProviderManager();
179 181
        ISymbol auxiliaryLineSymbolEditing = editingProviderManager.getSymbol("auxiliary-line-symbol-editing");
......
316 318
                        }
317 319

  
318 320

  
319
                        double coefDirection = getCoefDirection(centerPointValue, startPointValue, mousePosition);
321
                        double coefDirection = GeometryUtils.getCoefDirection(centerPointValue, startPointValue, mousePosition);
320 322
                        if (sweepAngleValue != null) {
321 323
                            if (directionValue == null) {
322 324

  
......
337 339
                                        GEOM2D);
338 340

  
339 341
                                geometries.addStatus(auxArc, lineSymbolEditing, "");
342
                                geometries.addStatus(auxArc, previewSymbol, "");
340 343
                                return geometries;
341 344
                            } 
342 345
                        } else {  //sweepAngleValue == null
......
370 373
                                        GEOM2D);
371 374

  
372 375
                                geometries.addStatus(auxArc, lineSymbolEditing, "");
376
                                geometries.addStatus(auxArc, previewSymbol, "");
373 377
                            }
374 378
                            return geometries;
375 379

  
......
400 404

  
401 405
            geometries.addStatus(auxEndPoint, auxiliaryPointSymbolEditing, "");
402 406

  
403
            double coefDirection = getCoefDirection(centerValue, startPointValue, auxEndPoint);
407
            double coefDirection = GeometryUtils.getCoefDirection(centerValue, startPointValue, auxEndPoint);
404 408

  
405 409
            if (Math.signum(coefDirection) != Math.signum(sweepAngleValue)) {
406 410
                sweepAngleValue = -(2 * Math.PI - sweepAngleValue);
......
417 421
                    GEOM2D);
418 422

  
419 423
            geometries.addStatus(auxArc, lineSymbolEditing, "");
424
            geometries.addStatus(auxArc, geometries.getPreviewSymbol(), "");
420 425
        }
421 426
    }
422 427
    
423
    private double getCoefDirection(Point a, Point b, Point c){
424
     return Math.signum((b.getX() - a.getX())*(c.getY() - a.getY()) - (b.getY() - a.getY())*(c.getX() - a.getX()));
425
}
426

  
427

  
428 428
    @Override
429 429
    public void stop() throws StopServiceException {
430 430
        values.clear();
......
628 628

  
629 629
                        if (directionValue == null) {
630 630
                            
631
                            double coefDirection = getCoefDirection(centerPointValue, startPointValue, pointValue);
631
                            double coefDirection = GeometryUtils.getCoefDirection(centerPointValue, startPointValue, pointValue);
632 632
                            if(coefDirection>=0){
633 633
                                values.put(direction, CCW);
634 634
                            } else {
......
761 761
            }
762 762

  
763 763
            Curve arc = null;
764
            double coefDirection = getCoefDirection(centerPointValue, startPointValue, endPointValue);
764
            double coefDirection = GeometryUtils.getCoefDirection(centerPointValue, startPointValue, endPointValue);
765 765
            if (sweepAngleValue != null) {
766 766
                if (directionValue != null) {
767 767
                    if(directionValue.equalsIgnoreCase(CCW)){
......
836 836
        }
837 837
    }
838 838
    
839
    @Override
839 840
    public void finishAndStore() throws FinishServiceException {
840 841
        Geometry geometry = finish();
841 842
        EditingProviderServices editingProviderServices
......
844 845
                featureStore);
845 846
    }
846 847

  
848
    @Override
847 849
    public void start() throws StartServiceException {
848
        values = new HashMap<EditingServiceParameter, Object>();
850
        values = new HashMap<>();
849 851
    }
850 852

  
853
    @Override
851 854
    public String getName() {
852 855
        return ArcByCenterEditingProviderFactory.PROVIDER_NAME;
853 856
    }

Also available in: Unified diff