Revision 458 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/layout/fframes/FFrameLegend.java

View differences:

FFrameLegend.java
12 12
import org.geotools.renderer.style.TextStyle2D;
13 13

  
14 14
import com.iver.cit.gvsig.fmap.FMap;
15
import com.iver.cit.gvsig.fmap.core.v02.FGraphicUtilities;
16
import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
15 17
import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
16 18
import com.iver.cit.gvsig.fmap.layers.CommonOperations;
17 19
import com.iver.cit.gvsig.fmap.layers.FLayer;
......
179 181
                        String s = cli.getDescriptions()[j];
180 182
                        drawNameLegend(g, s, re, sizefont, xl, yl,h);
181 183

  
182
                        FStyle2D fs2d = cli.getSymbols()[j];
184
                        FSymbol fs2d = cli.getSymbols()[j];
183 185
                        drawSymbolLegend(g, re, xl, yl, fs2d,sizefont,cO.getShapeType());
184 186

  
185 187
                        n++;
......
202 204

  
203 205
                    //FStyle2D fs2d = cO.getLegendInfo().getSymbol();
204 206
                    //drawSymbolLegend(g, re, xl, yl, fs2d,sizefont,cO.getShapeType());
205
                    FStyle2D fs2d = cO.getLegendInfo().getDefaultSymbol();
207
                    FSymbol fs2d = cO.getLegendInfo().getDefaultSymbol();
206 208
                    System.out.println("sizefont = "+sizefont);
207 209
                    drawSymbolLegend(g, re, xl, yl, fs2d,sizefont,cO.getShapeType());
208 210
                    System.out.println("cO.getShapeType()= "+cO.getShapeType());
......
257 259
        pSD.draw(g, new Rectangle(x, yaux, wl, haux), type);
258 260
       
259 261
    }
262
    private void drawSymbolLegend(Graphics2D g, Rectangle2D re, int x, int y,
263
            FSymbol fs2d,int sizefont,int type) {
264
            double pW = 1;
265
            double pH = m_numLayers;
266
            int wl = (int) (re.getWidth() / pW);
267
            int hl = (int) (re.getHeight() / pH);
268
            int haux=(int)(sizefont*1.8);
269
            int yaux=(int)(y+(hl-haux)/2);
270
            FGraphicUtilities.DrawSymbol(g, new AffineTransform(), new Rectangle(x, yaux, wl, haux), fs2d);
271
           
272
        }
260 273

  
261 274
    /**
262 275
     * DOCUMENT ME!

Also available in: Unified diff