Revision 5143 org.gvsig.legend.urbanhorizontalsignage/trunk/org.gvsig.legend.urbanhorizontalsignage/org.gvsig.legend.urbanhorizontalsignage.lib/org.gvsig.legend.urbanhorizontalsignage.lib.impl/src/main/java/org/gvsig/legend/urbanhorizontalsignage/lib/impl/DefaultUrbanHorizontalSignageManager.java
DefaultUrbanHorizontalSignageManager.java | ||
---|---|---|
23 | 23 |
package org.gvsig.legend.urbanhorizontalsignage.lib.impl; |
24 | 24 |
|
25 | 25 |
import java.io.File; |
26 |
import java.util.ArrayList; |
|
27 | 26 |
import java.util.Iterator; |
28 | 27 |
import java.util.List; |
29 | 28 |
import java.util.UUID; |
... | ... | |
67 | 66 |
import org.gvsig.legend.urbanhorizontalsignage.lib.api.UrbanHorizontalSignageLegend; |
68 | 67 |
import org.gvsig.legend.urbanhorizontalsignage.lib.api.UrbanHorizontalSignageLocator; |
69 | 68 |
import org.gvsig.legend.urbanhorizontalsignage.lib.api.UrbanHorizontalSignageManager; |
69 |
import org.gvsig.legend.urbanverticalsignage.lib.api.PictureMarkerSymbolTableLegend; |
|
70 |
import org.gvsig.legend.urbanverticalsignage.lib.impl.DefaultPictureMarkerSymbolTableLegend; |
|
70 | 71 |
import org.gvsig.tools.ToolsLocator; |
71 | 72 |
import org.gvsig.tools.folders.FoldersManager; |
72 | 73 |
import org.gvsig.tools.task.SimpleTaskStatus; |
73 | 74 |
import org.gvsig.tools.util.HasAFile; |
74 | 75 |
import org.slf4j.LoggerFactory; |
75 | 76 |
|
77 |
@SuppressWarnings("UseSpecificCatch") |
|
76 | 78 |
public class DefaultUrbanHorizontalSignageManager implements UrbanHorizontalSignageManager { |
77 | 79 |
|
78 | 80 |
private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(DefaultUrbanHorizontalSignageManager.class); |
79 | 81 |
|
80 | 82 |
@Override |
81 |
public UrbanHorizontalSignageLegend create() { |
|
83 |
public UrbanHorizontalSignageLegend createUrbanHorizontalSignageLegend() {
|
|
82 | 84 |
return new DefaultUrbanHorizontalSignageLegend(); |
83 | 85 |
} |
84 | 86 |
|
85 | 87 |
@Override |
86 |
public Class<? extends UrbanHorizontalSignageLegend> getLegendClass() { |
|
88 |
public Class<? extends UrbanHorizontalSignageLegend> getUrbanHorizontalSignageLegendClass() {
|
|
87 | 89 |
return DefaultUrbanHorizontalSignageLegend.class; |
88 | 90 |
} |
89 | 91 |
|
... | ... | |
221 | 223 |
Geometry buffer; |
222 | 224 |
final int joinStyle = roundVertex ? JOIN_STYLE_ROUND : JOIN_STYLE_MITRE; |
223 | 225 |
|
224 |
Geometry segmentOffset = null;
|
|
226 |
Geometry segmentOffset; |
|
225 | 227 |
if (segment.isClosed() && segment.getNumVertices() > 2 && segment.isCCW()) { |
226 | 228 |
Line cloned = segment.cloneGeometry(); |
227 | 229 |
cloned.flip(); |
... | ... | |
280 | 282 |
} |
281 | 283 |
previousPoint = currentPoint.cloneGeometry(); |
282 | 284 |
advanceToNext = true; |
283 |
continue; |
|
285 |
// continue;
|
|
284 | 286 |
} else { |
285 | 287 |
//buscar punto dentro del segmento a una distancia = segmentLengthMeters-previousLength |
286 | 288 |
Point point = calculateIntermediatePoint(previousPoint, currentPoint, (segmentLength - previousLength) / distance); |
... | ... | |
296 | 298 |
previousPoint = point.clone(); |
297 | 299 |
previousLength = 0; |
298 | 300 |
advanceToNext = false; |
299 |
continue; |
|
301 |
// continue;
|
|
300 | 302 |
} |
301 | 303 |
} else { |
302 | 304 |
if (previousLength + distance < holesLength) { |
... | ... | |
306 | 308 |
} |
307 | 309 |
previousPoint = currentPoint.cloneGeometry(); |
308 | 310 |
advanceToNext = true; |
309 |
continue; |
|
311 |
// continue;
|
|
310 | 312 |
} else { |
311 | 313 |
//buscar punto dentro del segmento a una distancia = segmentLengthMeters-previousLength |
312 | 314 |
Point point = calculateIntermediatePoint(previousPoint, currentPoint, (holesLength - previousLength) / distance); |
... | ... | |
322 | 324 |
previousPoint = point.clone(); |
323 | 325 |
previousLength = 0; |
324 | 326 |
advanceToNext = false; |
325 |
continue; |
|
327 |
// continue;
|
|
326 | 328 |
} |
327 | 329 |
} |
328 | 330 |
} |
... | ... | |
355 | 357 |
return p; |
356 | 358 |
} |
357 | 359 |
|
358 |
/*friend*/ static class SplittedLine { |
|
359 |
|
|
360 |
List<Line> segments; |
|
361 |
List<Line> holes; |
|
362 |
|
|
363 |
public SplittedLine() { |
|
364 |
segments = new ArrayList<>(); |
|
365 |
holes = new ArrayList<>(); |
|
366 |
} |
|
367 |
|
|
368 |
public List<Line> getSegments() { |
|
369 |
return this.segments; |
|
370 |
} |
|
371 |
|
|
372 |
public List<Line> getHoles() { |
|
373 |
return this.holes; |
|
374 |
} |
|
375 |
|
|
376 |
public void addSegment(Line segment) { |
|
377 |
this.segments.add(segment); |
|
378 |
} |
|
379 |
|
|
380 |
public void addHole(Line hole) { |
|
381 |
this.holes.add(hole); |
|
382 |
} |
|
383 |
|
|
384 |
} |
|
385 |
|
|
360 |
@Override |
|
386 | 361 |
public FeatureStore convertLinesToPolygons(FeatureSet sourceFeatureSet, UrbanHorizontalSignageConfig config, SimpleTaskStatus status) { |
387 | 362 |
|
388 | 363 |
//TODO: el status.... |
... | ... | |
508 | 483 |
} |
509 | 484 |
} |
510 | 485 |
|
486 |
@Override |
|
487 |
public PictureMarkerSymbolTableLegend createPictureMarkerSymbolTableLegend() { |
|
488 |
return new DefaultPictureMarkerSymbolTableLegend(); |
|
489 |
} |
|
511 | 490 |
|
491 |
@Override |
|
492 |
public Class<? extends PictureMarkerSymbolTableLegend> getPictureMarkerSymbolTableLegendClass() { |
|
493 |
return DefaultPictureMarkerSymbolTableLegend.class; |
|
494 |
} |
|
495 |
|
|
496 |
|
|
512 | 497 |
|
513 | 498 |
} |
Also available in: Unified diff