Revision 45527 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/marker/impl/PictureMarkerSymbol.java
PictureMarkerSymbol.java | ||
---|---|---|
111 | 111 |
@Override |
112 | 112 |
public void setImage(URL imageUrl) throws IOException { |
113 | 113 |
bgImage = BackgroundFileStyle.createStyleByURL(imageUrl); |
114 |
bgImage.setSymbolTable(this.getSymbolTable(this.getFeature())); |
|
114 | 115 |
} |
115 | 116 |
|
116 | 117 |
/** |
... | ... | |
123 | 124 |
@Override |
124 | 125 |
public void setSelImage(URL imageFileUrl) throws IOException { |
125 | 126 |
bgSelImage = BackgroundFileStyle.createStyleByURL(imageFileUrl); |
127 |
bgSelImage.setSymbolTable(this.getSymbolTable(this.getFeature())); |
|
126 | 128 |
} |
127 | 129 |
|
128 | 130 |
@Override |
... | ... | |
157 | 159 |
p.transform(affineTransform); |
158 | 160 |
} |
159 | 161 |
double x, y; |
160 |
int size = (int) Math.round(getSize());
|
|
161 |
double halfSize = getSize() / 2;
|
|
162 |
int size = (int) Math.round(getEfectiveSize(f));
|
|
163 |
double halfSize = getEfectiveSize(f) / 2;
|
|
162 | 164 |
x = p.getX() - halfSize; |
163 | 165 |
y = p.getY() - halfSize; |
164 | 166 |
Point2D theOffset = this.getEfectiveOffset(f); |
... | ... | |
169 | 171 |
BackgroundFileStyle bg = (!selected) ? bgImage : bgSelImage; |
170 | 172 |
Rectangle rect = new Rectangle(size, size); |
171 | 173 |
g.translate(x + xOffset, y + yOffset); |
172 |
double auxRotation = getEfectiveRotation(f); |
|
174 |
double auxRotation = getEfectiveRotationInRadians(f);
|
|
173 | 175 |
g.rotate(auxRotation, halfSize, halfSize); |
174 | 176 |
if (bg != null) { |
175 | 177 |
try { |
178 |
bg.setSymbolTable(this.getSymbolTable(f)); |
|
176 | 179 |
bg.drawInsideRectangle(g, rect); |
177 | 180 |
} catch (SymbolDrawingException e) { |
178 | 181 |
LOG.warn(Messages.getText("label_style_could_not_be_painted") |
... | ... | |
187 | 190 |
g.translate(-(x + xOffset), -(y + yOffset)); |
188 | 191 |
|
189 | 192 |
if( isDrawLineToOffset() ) { |
190 |
g.setColor(this.getLineToOffsetColor());
|
|
193 |
g.setColor(this.getEfectiveLineToOffsetColor(f));
|
|
191 | 194 |
g.drawLine((int)p.getX(), (int)p.getY(), (int)p.getX() + xOffset, (int)p.getY() + yOffset); |
192 | 195 |
} |
193 | 196 |
} |
... | ... | |
338 | 341 |
return res; |
339 | 342 |
} |
340 | 343 |
|
344 |
@Override |
|
345 |
public void setFeature(Feature feature) { |
|
346 |
super.setFeature(feature); |
|
347 |
if( this.bgImage!=null ) { |
|
348 |
this.bgImage.setSymbolTable(this.getSymbolTable(this.getFeature())); |
|
349 |
} |
|
350 |
if( this.bgSelImage!=null ) { |
|
351 |
this.bgSelImage.setSymbolTable(this.getSymbolTable(this.getFeature())); |
|
352 |
} |
|
353 |
} |
|
354 |
|
|
355 |
|
|
341 | 356 |
|
357 |
|
|
342 | 358 |
} |
Also available in: Unified diff