Revision 11139 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/styles/SimpleLabelStyle.java
SimpleLabelStyle.java | ||
---|---|---|
43 | 43 |
* |
44 | 44 |
* $Id$ |
45 | 45 |
* $Log$ |
46 |
* Revision 1.9 2007-04-10 16:34:01 jaume |
|
46 |
* Revision 1.10 2007-04-11 16:01:34 jaume |
|
47 |
* try to fit the text in the correct place |
|
48 |
* |
|
49 |
* Revision 1.9 2007/04/10 16:34:01 jaume |
|
47 | 50 |
* towards a styled labeling |
48 | 51 |
* |
49 | 52 |
* Revision 1.8 2007/04/05 16:07:14 jaume |
... | ... | |
207 | 210 |
super.drawOutline(g, r); |
208 | 211 |
Rectangle labelSz = getBounds(); |
209 | 212 |
|
210 |
double ratioLabel = labelSz.getWidth()/labelSz.getHeight(); |
|
211 |
double ratioViewPort = r.getWidth() / r.getWidth(); |
|
213 |
final double ratioLabel = labelSz.getWidth()/labelSz.getHeight();
|
|
214 |
final double ratioViewPort = r.getWidth() / r.getWidth();
|
|
212 | 215 |
|
213 | 216 |
// draw the pointer |
214 | 217 |
{ |
... | ... | |
248 | 251 |
for (int i = 0; i < textFieldAreas.size(); i++) { |
249 | 252 |
Rectangle2D textFieldArea = (Rectangle2D) textFieldAreas.get(i); |
250 | 253 |
|
251 |
int x = (int) (r.width * textFieldArea.getX()); |
|
252 |
int y = (int) (r.height * textFieldArea.getY()); |
|
253 |
int width = (int) (r.width * textFieldArea.getWidth()); |
|
254 |
int height = (int) (r.width * textFieldArea.getHeight()); |
|
254 |
int x= (int) (r.width * textFieldArea.getX()); |
|
255 |
int y= (int) (r.height * textFieldArea.getY()); |
|
256 |
int width= (int) (r.width * textFieldArea.getWidth()); |
|
257 |
int height= (int) (r.width * textFieldArea.getHeight()); |
|
258 |
|
|
255 | 259 |
Rectangle aux = new Rectangle(x, y, width, height); |
256 | 260 |
FShape shp = new FPolygon2D(new GeneralPathX(aux)); |
257 | 261 |
sym.draw(g, null, shp); |
Also available in: Unified diff