Revision 1744

View differences:

trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/fframes/FFrameLegend.java
351 351
                                        try {
352 352
                                            toFFrameSymbol(layoutContext, re, xl, yl,
353 353
                                                fs2d, sizefont, h,
354
                                                cla_layer.getShapeType());
354
                                                cla_layer.getShapeType(), viewPort);
355 355
                                        } catch (ReadException ex) {
356 356
                                            ex.printStackTrace();
357 357
                                        }
......
390 390
                                        try {
391 391
                                            toFFrameSymbol(layoutContext, re, xl, yl,
392 392
                                                fs2d, sizefont, h,
393
                                                cla_layer.getShapeType());
393
                                                cla_layer.getShapeType(), viewPort);
394 394
                                        } catch (ReadException e) {
395 395
                                            e.printStackTrace();
396 396
                                        }
......
588 588
     *            tama?o de la fuente.
589 589
     */
590 590
    private void toFFrameSymbol(LayoutContext layoutContext, Rectangle2D re, double x,
591
        double y, ISymbol fs2d, float sizefont, double h, int shapeType) {
591
        double y, ISymbol fs2d, float sizefont, double h, int shapeType, ViewPort viewPort) {
592 592
        double pW = 5;
593 593
        double wl = (re.getWidth() / pW);
594 594
        double haux = (sizefont * 0.7);
......
609 609
        symbol.setBoundBox(FLayoutUtilities.toSheetRect(rAux3, layoutContext.getAT()));
610 610
        symbol.setSymbol(fs2d);
611 611
        symbol.setShapeType(shapeType);
612
        symbol.setViewPort(viewPort);
612 613
        layoutContext.addFFrame(symbol, false, true);
613 614
    }
614 615

  
trunk/org.gvsig.app.document.layout2.app/org.gvsig.app.document.layout2.app.mainplugin/src/main/java/org/gvsig/app/project/documents/layout/fframes/FFrameSymbol.java
32 32
import org.gvsig.fmap.geom.Geometry;
33 33
import org.gvsig.fmap.mapcontext.MapContextLocator;
34 34
import org.gvsig.fmap.mapcontext.MapContextManager;
35
import org.gvsig.fmap.mapcontext.ViewPort;
35 36
import org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport;
36 37
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
37 38
import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolDrawingException;
......
49 50
public class FFrameSymbol extends FFrameGraphics {
50 51

  
51 52
    public static final String PERSISTENCE_DEFINITION_NAME = "FFrameSymbol";
53
    private static final String VIEWPORT_FIELD = "viewport";
52 54

  
53 55
    private PrintAttributes properties;
56
    private ViewPort viewPort;
54 57

  
55 58
    private final MapContextManager mapContextManager = MapContextLocator
56 59
        .getMapContextManager();
......
94 97
            try {
95 98
                ISymbol sym = getFSymbol();
96 99
                if(sym instanceof CartographicSupport){
97
                    ((CartographicSupport)sym).setCartographicContext(properties);
100
                    ((CartographicSupport)sym).setCartographicContext(viewPort, properties, null);
98 101
                }
99 102

  
100 103
                sym.drawInsideRectangle(g, mT2, rec); //, properties);
......
181 184
    public void loadFromState(PersistentState state)
182 185
        throws PersistenceException {
183 186
        super.loadFromState(state);
187
        this.viewPort = (ViewPort) state.get(VIEWPORT_FIELD);
184 188
    }
185 189

  
186 190
    @Override
187 191
    public void saveToState(PersistentState state) throws PersistenceException {
188 192
        super.saveToState(state);
193
        state.set(VIEWPORT_FIELD, this.viewPort);
189 194
    }
190 195

  
196
    public void setViewPort(ViewPort viewPort) {
197
        this.viewPort = viewPort;
198
    }
199

  
191 200
}

Also available in: Unified diff