Revision 23499 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/symbols/SimpleTextSymbol.java
SimpleTextSymbol.java | ||
---|---|---|
53 | 53 |
import java.awt.geom.Rectangle2D; |
54 | 54 |
|
55 | 55 |
import javax.print.attribute.PrintRequestAttributeSet; |
56 |
import javax.print.attribute.standard.PrintQuality; |
|
57 | 56 |
|
57 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
|
58 | 58 |
import com.iver.cit.gvsig.fmap.ViewPort; |
59 | 59 |
import com.iver.cit.gvsig.fmap.core.CartographicSupportToolkit; |
60 | 60 |
import com.iver.cit.gvsig.fmap.core.FPoint2D; |
... | ... | |
185 | 185 |
return getClass().getName(); |
186 | 186 |
} |
187 | 187 |
|
188 |
public void print(Graphics2D g, AffineTransform at, FShape shape, PrintRequestAttributeSet properties){ |
|
189 |
float originalSize = getFont().getSize2D(); |
|
190 |
float size=originalSize; |
|
191 |
// scale it to size |
|
192 |
PrintQuality pq = (PrintQuality) properties.get(PrintQuality.class); |
|
193 |
if (pq.equals(PrintQuality.NORMAL)){ |
|
194 |
size *= (double) 300/72; |
|
195 |
}else if (pq.equals(PrintQuality.HIGH)){ |
|
196 |
size *= (double) 600/72; |
|
197 |
}else if (pq.equals(PrintQuality.DRAFT)){ |
|
198 |
// unitFactor *= 72; (which is the same than doing nothing) |
|
199 |
} |
|
200 |
setFont(getFont().deriveFont(size)); |
|
201 |
draw(g,at,shape,null); |
|
202 |
setFont(getFont().deriveFont(originalSize)); |
|
188 |
public void print(Graphics2D g, AffineTransform at, FShape shape, PrintRequestAttributeSet properties) |
|
189 |
throws ReadDriverException { |
|
190 |
// TODO Implement it |
|
191 |
throw new Error("Not yet implemented!"); |
|
192 |
|
|
203 | 193 |
} |
204 | 194 |
|
205 | 195 |
public String getText() { |
... | ... | |
239 | 229 |
this.rotation = rotation; |
240 | 230 |
} |
241 | 231 |
|
232 |
public double getRotation() { |
|
233 |
return rotation; |
|
234 |
} |
|
235 |
|
|
242 | 236 |
/** |
243 | 237 |
* Returns an FShape which represents a rectangle containing the text in |
244 | 238 |
* <b>screen</b> units. |
Also available in: Unified diff