Revision 42439 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/fill/impl/PictureFillSymbol.java
PictureFillSymbol.java | ||
---|---|---|
46 | 46 |
import org.gvsig.fmap.geom.exception.CreateGeometryException; |
47 | 47 |
import org.gvsig.fmap.geom.primitive.GeneralPathX; |
48 | 48 |
import org.gvsig.fmap.geom.primitive.Surface; |
49 |
import org.gvsig.fmap.mapcontext.MapContext; |
|
49 | 50 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
50 | 51 |
import org.gvsig.fmap.mapcontext.ViewPort; |
51 | 52 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
... | ... | |
99 | 100 |
|
100 | 101 |
private void draw(Graphics2D g, AffineTransform affineTransform, Geometry geom, Cancellable cancel) { |
101 | 102 |
Color fillColor = getFillColor(); |
102 |
|
|
103 |
|
|
103 | 104 |
Shape transf_geom = geom.getShape(affineTransform); |
104 |
|
|
105 |
|
|
105 | 106 |
if (fillColor != null) { |
106 | 107 |
g.setColor(fillColor); |
107 | 108 |
g.fill(transf_geom); |
... | ... | |
150 | 151 |
|
151 | 152 |
g.setPaint(resulPatternFill); |
152 | 153 |
} |
153 |
|
|
154 |
|
|
154 | 155 |
if (angle == 0) { |
155 | 156 |
g.fill(transf_geom); |
156 | 157 |
} else { |
... | ... | |
161 | 162 |
Geometry pixels_geom = geom.cloneGeometry(); |
162 | 163 |
pixels_geom.transform(affineTransform); |
163 | 164 |
pixels_geom.transform(at); |
164 |
|
|
165 |
|
|
165 | 166 |
g.rotate(-angle); |
166 | 167 |
g.fill(pixels_geom.getShape()); |
167 | 168 |
g.rotate(angle); |
... | ... | |
240 | 241 |
selectionSym = (PictureFillSymbol) cloneForSelection(); |
241 | 242 |
selectionSym.selected=true; |
242 | 243 |
selectionSym.selectionSym = selectionSym; // avoid too much lazy creations |
244 |
}else { |
|
245 |
selectionSym.setFillColor(MapContext.getSelectionColor()); |
|
243 | 246 |
} |
244 | 247 |
return selectionSym; |
245 | 248 |
|
... | ... | |
349 | 352 |
return null; |
350 | 353 |
} |
351 | 354 |
|
352 |
|
|
353 | 355 |
|
356 |
|
|
354 | 357 |
@Override |
355 | 358 |
public double toCartographicSize(ViewPort viewPort, double dpi, Geometry geom) { |
356 | 359 |
return super.toCartographicSize(viewPort, dpi, geom); |
... | ... | |
360 | 363 |
public void draw(Graphics2D g, AffineTransform affineTransform, |
361 | 364 |
Geometry geom, Feature f, Cancellable cancel) { |
362 | 365 |
draw(g, affineTransform, geom, cancel); |
363 |
|
|
366 |
|
|
364 | 367 |
} |
365 |
|
|
368 |
|
|
366 | 369 |
public Object clone() throws CloneNotSupportedException { |
367 | 370 |
PictureFillSymbol copy = (PictureFillSymbol) super.clone(); |
368 | 371 |
|
... | ... | |
387 | 390 |
} |
388 | 391 |
|
389 | 392 |
// FIXME: clone properties |
390 |
|
|
393 |
|
|
391 | 394 |
return copy; |
392 | 395 |
} |
393 | 396 |
|
... | ... | |
401 | 404 |
this.bgSelImage = |
402 | 405 |
(BackgroundFileStyle) state.get(BACKGROUND_SELECTION_IMAGE); |
403 | 406 |
|
404 |
|
|
407 |
|
|
405 | 408 |
this.angle = (Double) state.get(ANGLE); |
406 | 409 |
this.xScale = (Double) state.get(X_SCALE); |
407 | 410 |
this.yScale = (Double) state.get(Y_SCALE); |
408 | 411 |
this.markerFillProperties = (IMarkerFillPropertiesStyle) state.get(MARKER_FILL_PROPERTIES); |
409 | 412 |
|
410 |
|
|
413 |
|
|
411 | 414 |
} |
412 | 415 |
|
413 | 416 |
public void saveToState(PersistentState state) throws PersistenceException { |
... | ... | |
462 | 465 |
|
463 | 466 |
public Object call() throws Exception { |
464 | 467 |
SymbolManager manager = MapContextLocator.getSymbolManager(); |
465 |
|
|
468 |
|
|
466 | 469 |
manager.registerSymbol(PICTURE_FILL_SYMBOL_PERSISTENCE_DEFINITION_NAME, |
467 | 470 |
PictureFillSymbol.class); |
468 | 471 |
|
469 | 472 |
return Boolean.TRUE; |
470 | 473 |
} |
471 |
|
|
474 |
|
|
472 | 475 |
} |
473 | 476 |
|
474 | 477 |
public IBackgroundFileStyle getBackgroundFileStyle() { |
Also available in: Unified diff