Revision 43156 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/impl/FLabel.java
FLabel.java | ||
---|---|---|
21 | 21 |
* For any additional information, do not hesitate to contact us |
22 | 22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
23 | 23 |
*/ |
24 |
/* |
|
25 |
* Created on 13-jul-2004 |
|
26 |
* |
|
27 |
* TODO To change the template for this generated file go to |
|
28 |
* Window - Preferences - Java - Code Generation - Code and Comments |
|
29 |
*/ |
|
30 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
31 |
* |
|
32 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
33 |
* |
|
34 |
* This program is free software; you can redistribute it and/or |
|
35 |
* modify it under the terms of the GNU General Public License |
|
36 |
* as published by the Free Software Foundation; either version 2 |
|
37 |
* of the License, or (at your option) any later version. |
|
38 |
* |
|
39 |
* This program is distributed in the hope that it will be useful, |
|
40 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
41 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
42 |
* GNU General Public License for more details. |
|
43 |
* |
|
44 |
* You should have received a copy of the GNU General Public License |
|
45 |
* along with this program; if not, write to the Free Software |
|
46 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
47 |
* |
|
48 |
* For more information, contact: |
|
49 |
* |
|
50 |
* Generalitat Valenciana |
|
51 |
* Conselleria d'Infraestructures i Transport |
|
52 |
* Av. Blasco Ib??ez, 50 |
|
53 |
* 46010 VALENCIA |
|
54 |
* SPAIN |
|
55 |
* |
|
56 |
* +34 963862235 |
|
57 |
* gvsig@gva.es |
|
58 |
* www.gvsig.gva.es |
|
59 |
* |
|
60 |
* or |
|
61 |
* |
|
62 |
* IVER T.I. S.A |
|
63 |
* Salamanca 50 |
|
64 |
* 46005 Valencia |
|
65 |
* Spain |
|
66 |
* |
|
67 |
* +34 963163400 |
|
68 |
* dac@iver.es |
|
69 |
*/ |
|
70 | 24 |
package org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl; |
71 | 25 |
|
72 | 26 |
import java.awt.Color; |
... | ... | |
77 | 31 |
import java.awt.geom.Point2D; |
78 | 32 |
import java.awt.geom.Rectangle2D; |
79 | 33 |
|
80 |
import org.apache.batik.ext.awt.geom.PathLength; |
|
34 |
import org.apache.batik.ext.awt.geom.DefaultPathLength;
|
|
81 | 35 |
import org.slf4j.Logger; |
82 | 36 |
import org.slf4j.LoggerFactory; |
83 | 37 |
|
... | ... | |
86 | 40 |
import org.gvsig.fmap.geom.primitive.Point; |
87 | 41 |
import org.gvsig.fmap.mapcontext.ViewPort; |
88 | 42 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
43 |
import org.gvsig.symbology.PathLength; |
|
89 | 44 |
import org.gvsig.utils.XMLEntity; |
90 | 45 |
|
91 | 46 |
/** |
92 | 47 |
* Se utiliza para etiquetar. Las capas vectoriales tienen un arrayList |
93 | 48 |
* (m_labels) de FLabel, un FLabel por cada registro. |
94 |
* |
|
95 |
* @author FJP |
|
96 | 49 |
* @deprecated |
97 | 50 |
*/ |
98 | 51 |
public class FLabel implements Cloneable { |
... | ... | |
334 | 287 |
label.setOrig(pAux); |
335 | 288 |
switch (geom.getType()) { |
336 | 289 |
case org.gvsig.fmap.geom.Geometry.TYPES.CURVE: |
337 |
PathLength pathLen = new PathLength(geom.getShape());
|
|
290 |
PathLength pathLen = new DefaultPathLength(geom.getShape());
|
|
338 | 291 |
float midDistance = pathLen.lengthOfPath() / 2; |
339 | 292 |
angle = pathLen.angleAtLength(midDistance); |
340 | 293 |
|
... | ... | |
359 | 312 |
return pAux; |
360 | 313 |
|
361 | 314 |
case org.gvsig.fmap.geom.Geometry.TYPES.CURVE: |
362 |
PathLength pathLen = new PathLength(geom.getShape());
|
|
315 |
DefaultPathLength pathLen = new DefaultPathLength(geom.getShape());
|
|
363 | 316 |
|
364 | 317 |
// if (pathLen.lengthOfPath() < width / mT.getScaleX()) return; |
365 | 318 |
float midDistance = pathLen.lengthOfPath() / 2; |
Also available in: Unified diff