Revision 23303 branches/v2_0_0_prep/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/rendering/symbols/SimpleTextSymbol.java
SimpleTextSymbol.java | ||
---|---|---|
50 | 50 |
import java.awt.font.FontRenderContext; |
51 | 51 |
import java.awt.font.GlyphVector; |
52 | 52 |
import java.awt.geom.AffineTransform; |
53 |
import java.awt.geom.Point2D; |
|
54 | 53 |
import java.awt.geom.Rectangle2D; |
55 | 54 |
|
56 | 55 |
import javax.print.attribute.PrintRequestAttributeSet; |
57 | 56 |
import javax.print.attribute.standard.PrintQuality; |
58 | 57 |
|
59 |
import org.gvsig.fmap.data.ReadException;
|
|
58 |
import org.apache.log4j.Logger;
|
|
60 | 59 |
import org.gvsig.fmap.geom.Geometry; |
61 | 60 |
import org.gvsig.fmap.geom.primitive.GeneralPathX; |
62 | 61 |
import org.gvsig.fmap.geom.primitive.Surface2D; |
... | ... | |
82 | 81 |
new AffineTransform(), false, true); |
83 | 82 |
private boolean autoresize; |
84 | 83 |
public void draw(Graphics2D g, AffineTransform affineTransform, Geometry geom, Cancellable cancel) { |
85 |
if (!isShapeVisible()) return; |
|
84 |
if (!isShapeVisible()) { |
|
85 |
return; |
|
86 |
} |
|
86 | 87 |
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
87 | 88 |
g.setColor(textColor); |
88 | 89 |
g.setFont(font); |
... | ... | |
218 | 219 |
} |
219 | 220 |
|
220 | 221 |
public void setFont(Font font) { |
222 |
if (font == null) { |
|
223 |
Logger.getLogger(this.getClass()).warn("font <-- null"); |
|
224 |
|
|
225 |
return; |
|
226 |
} |
|
221 | 227 |
this.font = font; |
222 | 228 |
} |
223 | 229 |
|
... | ... | |
226 | 232 |
} |
227 | 233 |
|
228 | 234 |
public void setFontSize(double size) { |
229 |
this.font = new Font(font.getName(), font.getStyle(), (int) size); |
|
235 |
Font newFont = new Font(font.getName(), font.getStyle(), (int) size); |
|
236 |
if (newFont == null) { |
|
237 |
Logger.getLogger(this.getClass()).warn( |
|
238 |
"Font(" + font.getName() + ", " |
|
239 |
+ font.getStyle() + ", " + (int) size + " --> null"); |
|
240 |
} else { |
|
241 |
this.font = newFont; |
|
242 |
} |
|
230 | 243 |
} |
231 | 244 |
|
232 | 245 |
/** |
Also available in: Unified diff