Revision 43510 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.labeling.app/org.gvsig.labeling.app.mainplugin/src/main/java/org/gvsig/labeling/placements/CompoundLabelPlacement.java
CompoundLabelPlacement.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
2 | 3 |
* |
3 |
* Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
|
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
|
4 | 5 |
* |
5 | 6 |
* This program is free software; you can redistribute it and/or |
6 | 7 |
* modify it under the terms of the GNU General Public License |
7 |
* as published by the Free Software Foundation; either version 2
|
|
8 |
* as published by the Free Software Foundation; either version 3
|
|
8 | 9 |
* of the License, or (at your option) any later version. |
9 | 10 |
* |
10 | 11 |
* This program is distributed in the hope that it will be useful, |
... | ... | |
14 | 15 |
* |
15 | 16 |
* You should have received a copy of the GNU General Public License |
16 | 17 |
* along with this program; if not, write to the Free Software |
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
18 | 20 |
* |
19 |
* For more information, contact: |
|
20 |
* |
|
21 |
* Generalitat Valenciana |
|
22 |
* Conselleria d'Infraestructures i Transport |
|
23 |
* Av. Blasco Ib??ez, 50 |
|
24 |
* 46010 VALENCIA |
|
25 |
* SPAIN |
|
26 |
* |
|
27 |
* +34 963862235 |
|
28 |
* gvsig@gva.es |
|
29 |
* www.gvsig.gva.es |
|
30 |
* |
|
31 |
* or |
|
32 |
* |
|
33 |
* IVER T.I. S.A |
|
34 |
* Salamanca 50 |
|
35 |
* 46005 Valencia |
|
36 |
* Spain |
|
37 |
* |
|
38 |
* +34 963163400 |
|
39 |
* dac@iver.es |
|
21 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
40 | 23 |
*/ |
41 | 24 |
package org.gvsig.labeling.placements; |
42 | 25 |
|
... | ... | |
49 | 32 |
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling.LabelLocationMetrics; |
50 | 33 |
import org.gvsig.tools.task.Cancellable; |
51 | 34 |
|
52 |
/** |
|
53 |
* |
|
54 |
* CompoundLabelPlacement.java |
|
55 |
* |
|
56 |
* |
|
57 |
* @author jaume dominguez faus - jaume.dominguez@iver.es Dec 17, 2007 |
|
58 |
* |
|
59 |
*/ |
|
60 | 35 |
public class CompoundLabelPlacement implements ILabelPlacement { |
61 |
private ILabelPlacement[] placements; |
|
36 |
private final ILabelPlacement[] placements;
|
|
62 | 37 |
|
63 | 38 |
public CompoundLabelPlacement(ILabelPlacement[] suitablePlacements) { |
64 | 39 |
this.placements = suitablePlacements; |
65 | 40 |
} |
66 | 41 |
|
42 |
@Override |
|
67 | 43 |
public boolean isSuitableFor(IPlacementConstraints placementConstraints, |
68 | 44 |
int shapeType) { |
69 | 45 |
return true; |
70 | 46 |
} |
71 | 47 |
|
72 | 48 |
|
49 |
@Override |
|
73 | 50 |
public ArrayList<LabelLocationMetrics> guess( |
74 | 51 |
ILabelClass lc, |
75 | 52 |
Geometry geom, |
... | ... | |
78 | 55 |
Cancellable cancel, |
79 | 56 |
ViewPort vp) { |
80 | 57 |
|
81 |
ArrayList<LabelLocationMetrics> guessed = new ArrayList<LabelLocationMetrics>();
|
|
58 |
ArrayList<LabelLocationMetrics> guessed = new ArrayList<>(); |
|
82 | 59 |
for (int i = 0; cancel != null && !cancel.isCanceled() && i < placements.length; i++) { |
83 | 60 |
guessed.addAll(placements[i].guess(lc, geom, constraints, cartographicSymbolSize, cancel,vp)); |
84 | 61 |
} |
Also available in: Unified diff