Revision 11073 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/rendering/styling/LabelClass.java
LabelClass.java | ||
---|---|---|
43 | 43 |
* |
44 | 44 |
* $Id$ |
45 | 45 |
* $Log$ |
46 |
* Revision 1.3 2007-04-02 16:34:56 jaume |
|
46 |
* Revision 1.4 2007-04-05 16:07:14 jaume |
|
47 |
* Styled labeling stuff |
|
48 |
* |
|
49 |
* Revision 1.3 2007/04/02 16:34:56 jaume |
|
47 | 50 |
* Styled labeling (start commiting) |
48 | 51 |
* |
49 | 52 |
* Revision 1.2 2007/03/09 08:33:43 jaume |
... | ... | |
71 | 74 |
*/ |
72 | 75 |
package com.iver.cit.gvsig.fmap.rendering.styling; |
73 | 76 |
|
74 |
import java.awt.Graphics; |
|
75 | 77 |
import java.awt.Graphics2D; |
76 | 78 |
import java.awt.Point; |
77 | 79 |
import java.awt.Rectangle; |
78 |
import java.awt.geom.AffineTransform;
|
|
80 |
import java.awt.geom.Rectangle2D;
|
|
79 | 81 |
|
80 | 82 |
import com.iver.cit.gvsig.fmap.core.FPoint2D; |
81 | 83 |
import com.iver.cit.gvsig.fmap.core.FPolygon2D; |
... | ... | |
153 | 155 |
labelStyle.drawInsideRectangle(graphics, bounds); |
154 | 156 |
for (int i = 0; i < texts.length; i++) { |
155 | 157 |
getLabelSymbol().setText(texts[i]); |
156 |
getLabelSymbol().drawInsideRectangle(graphics, null, labelStyle.getTextBounds()[i]); |
|
158 |
Rectangle2D textArea = labelStyle.getTextBounds()[i]; |
|
159 |
Rectangle textRect = new Rectangle( |
|
160 |
(int) (bounds.x * textArea.getX()), |
|
161 |
(int) (bounds.y * textArea.getY()), |
|
162 |
(int) (bounds.width * textArea.getWidth()), |
|
163 |
(int) (bounds.height * textArea.getHeight()) |
|
164 |
); |
|
165 |
|
|
166 |
getLabelSymbol().drawInsideRectangle(graphics, null, textRect); |
|
157 | 167 |
} |
158 | 168 |
} else { |
159 | 169 |
getLabelSymbol().setText(texts[0]); |
Also available in: Unified diff