Revision 843 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/v02/FGraphicUtilities.java
FGraphicUtilities.java | ||
---|---|---|
48 | 48 |
|
49 | 49 |
AffineTransform mT = new AffineTransform(); |
50 | 50 |
mT.setToIdentity(); |
51 |
Rectangle r2 = new Rectangle(r.x + 2 + r.width/2, r.y, r.width/2, r.height); |
|
51 |
Rectangle r2 = new Rectangle(r.x + 2 + r.width/3, r.y, r.width/3, r.height); |
|
52 |
Rectangle r3 = new Rectangle(r.x + 2 + 2*r.width/3, r.y, r.width/3, r.height); |
|
52 | 53 |
|
53 | 54 |
// g2.clearRect(r.x, r.y, r.width, r.height); |
54 | 55 |
// System.out.println("r = " + r.toString() + " Color preview:" + symbol.m_Color.toString()); |
... | ... | |
62 | 63 |
boolean bAux2 = symbol.isSizeInPixels(); |
63 | 64 |
int alturaMetros = symbol.getSize(); // Nota: Cambiar m_Size a float |
64 | 65 |
|
65 |
if (symbol.isSizeInPixels()) { |
|
66 |
if (!bAux2) { |
|
67 |
symbol.setSizeInPixels(true); |
|
66 | 68 |
symbol.setSize(8); // tama?o fijo |
67 |
symbol.setSizeInPixels(false); |
|
68 | 69 |
} |
69 | 70 |
|
70 | 71 |
FGraphicUtilities.DrawShape(g2, mT, shp, symbol); |
71 | 72 |
|
72 |
if (bAux2) { |
|
73 |
if (!bAux2) {
|
|
73 | 74 |
symbol.setSize(alturaMetros); |
74 | 75 |
symbol.setSizeInPixels(bAux2); |
75 | 76 |
} |
... | ... | |
77 | 78 |
if (symbol.getFont() != null) { |
78 | 79 |
// Para no tener que clonarlo si viene en unidades de mapa |
79 | 80 |
boolean bAux = symbol.isFontSizeInPixels(); |
80 |
symbol.setFontSizeInPixels(false);
|
|
81 |
symbol.setFontSizeInPixels(true);
|
|
81 | 82 |
FGraphicUtilities.DrawLabel(g2, mT, shp, symbol, |
82 | 83 |
new FLabel("Abcd")); |
83 | 84 |
symbol.setFontSizeInPixels(bAux); |
... | ... | |
113 | 114 |
|
114 | 115 |
break; |
115 | 116 |
case FShape.MULTI: |
116 |
r.resize(r.width/2, r.height); |
|
117 |
// Pol?gono |
|
118 |
r.resize(r.width/3, r.height); |
|
117 | 119 |
GeneralPathX rectAux2 = new GeneralPathX(r); |
118 | 120 |
rectAux2.transform(mT2); |
119 | 121 |
shp = new FPolygon2D( rectAux2); |
120 | 122 |
FGraphicUtilities.DrawShape(g2, mT, shp, symbol); |
123 |
// L?nea |
|
121 | 124 |
rect = mT2.createTransformedShape(r2).getBounds(); |
122 | 125 |
line = new GeneralPathX(); |
123 | 126 |
line.moveTo(rect.x, rect.y + (rect.height / 2)); |
... | ... | |
129 | 132 |
|
130 | 133 |
shp = new FPolyline2D(line); |
131 | 134 |
FGraphicUtilities.DrawShape(g2, mT, shp, symbol); |
135 |
// Punto: |
|
136 |
shp = new FPoint2D(r3.x + (r3.width / 2), |
|
137 |
r3.y + (r3.height / 2)); |
|
132 | 138 |
|
139 |
// Para no tener que clonarlo si viene en unidades de mapa |
|
140 |
bAux2 = symbol.isSizeInPixels(); |
|
141 |
alturaMetros = symbol.getSize(); // Nota: Cambiar m_Size a float |
|
142 |
|
|
143 |
if (!bAux2) { |
|
144 |
symbol.setSizeInPixels(true); |
|
145 |
symbol.setSize(8); // tama?o fijo |
|
146 |
} |
|
147 |
|
|
148 |
FGraphicUtilities.DrawShape(g2, mT, shp, symbol); |
|
149 |
|
|
150 |
if (!bAux2) { |
|
151 |
symbol.setSize(alturaMetros); |
|
152 |
symbol.setSizeInPixels(bAux2); |
|
153 |
} |
|
154 |
|
|
155 |
if (symbol.getFont() != null) { |
|
156 |
// Para no tener que clonarlo si viene en unidades de mapa |
|
157 |
boolean bAux = symbol.isFontSizeInPixels(); |
|
158 |
symbol.setFontSizeInPixels(true); |
|
159 |
FGraphicUtilities.DrawLabel(g2, mT, shp, symbol, |
|
160 |
new FLabel("Abcd")); |
|
161 |
symbol.setFontSizeInPixels(bAux); |
|
162 |
} |
|
163 |
|
|
164 |
|
|
165 |
|
|
133 | 166 |
break; |
134 | 167 |
|
135 | 168 |
} |
... | ... | |
400 | 433 |
float radio_simbolo; |
401 | 434 |
radio_simbolo = theSymbol.getSize() / 2; |
402 | 435 |
|
403 |
if (theSymbol.isSizeInPixels()) { |
|
436 |
if (!theSymbol.isSizeInPixels()) {
|
|
404 | 437 |
// Suponemos que m_Size viene en coordenadas de mundo real |
405 | 438 |
radio_simbolo = (float) (theSymbol.getSize() * mT.getScaleX()); |
406 | 439 |
|
Also available in: Unified diff