Revision 7659 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/toc/TocItemLeaf.java
TocItemLeaf.java | ||
---|---|---|
59 | 59 |
import javax.swing.ImageIcon; |
60 | 60 |
|
61 | 61 |
import com.iver.cit.gvsig.fmap.core.FShape; |
62 |
import com.iver.cit.gvsig.fmap.core.ISymbol; |
|
62 | 63 |
import com.iver.cit.gvsig.fmap.core.v02.FGraphicUtilities; |
63 | 64 |
import com.iver.cit.gvsig.fmap.core.v02.FSymbol; |
64 |
import com.iver.cit.gvsig.fmap.rendering.styling.FStyle2D; |
|
65 | 65 |
import com.iver.cit.gvsig.fmap.rendering.styling.SymbolPreviewDrawer; |
66 | 66 |
|
67 | 67 |
/** |
... | ... | |
72 | 72 |
*/ |
73 | 73 |
public class TocItemLeaf implements ITocItem { |
74 | 74 |
|
75 |
private FSymbol symbol;
|
|
75 |
private ISymbol symbol;
|
|
76 | 76 |
private String description; |
77 | 77 |
private int layerType; |
78 | 78 |
private static int w_1symbol = 20; |
... | ... | |
88 | 88 |
static DataFlavor flavors[] = {INFO_FLAVOR }; |
89 | 89 |
|
90 | 90 |
|
91 |
public TocItemLeaf(FSymbol symbol, String description, int layerType)
|
|
91 |
public TocItemLeaf(ISymbol symbol, String description, int layerType)
|
|
92 | 92 |
{ |
93 | 93 |
this.symbol = symbol; |
94 | 94 |
this.description = description; |
... | ... | |
116 | 116 |
case FShape.MULTIPOINT: |
117 | 117 |
img = new BufferedImage(w_1symbol, h_1symbol, BufferedImage.TYPE_INT_ARGB); |
118 | 118 |
Graphics2D g2 = img.createGraphics(); |
119 |
Rectangle r = new Rectangle(w_1symbol, h_1symbol); |
|
120 |
FGraphicUtilities.DrawSymbol(g2, AffineTransform.getScaleInstance(0.8,0.8), r, symbol); |
|
119 |
Rectangle r = new Rectangle(w_1symbol, h_1symbol); |
|
120 |
// symbol.draw(g2, AffineTransform.getScaleInstance(0.8,0.8), r); |
|
121 |
// TODO: CAMBIAR PARA QUE NO DEPENDA DE FSYMBOL |
|
122 |
if (symbol instanceof FSymbol) |
|
123 |
FGraphicUtilities.DrawSymbol(g2, AffineTransform.getScaleInstance(0.8,0.8), r, (FSymbol) symbol); |
|
124 |
// Por ahora, los que no sean FSymbol no se renderizan en el TOC. |
|
121 | 125 |
break; |
122 | 126 |
case FShape.MULTI: |
123 | 127 |
img = new BufferedImage(3*w_1symbol, h_1symbol, BufferedImage.TYPE_INT_ARGB); |
124 | 128 |
g2 = img.createGraphics(); |
125 | 129 |
r = new Rectangle(3*w_1symbol, h_1symbol); |
126 |
|
|
127 |
FGraphicUtilities.DrawSymbol(g2, AffineTransform.getScaleInstance(0.8,0.8), r, symbol);
|
|
130 |
if (symbol instanceof FSymbol) |
|
131 |
FGraphicUtilities.DrawSymbol(g2, AffineTransform.getScaleInstance(0.8,0.8), r, (FSymbol) symbol);
|
|
128 | 132 |
break; |
129 | 133 |
|
130 | 134 |
} |
... | ... | |
173 | 177 |
/** |
174 | 178 |
* @return Returns the symbol. |
175 | 179 |
*/ |
176 |
public FSymbol getSymbol() {
|
|
180 |
public ISymbol getSymbol() {
|
|
177 | 181 |
return symbol; |
178 | 182 |
} |
179 | 183 |
} |
Also available in: Unified diff