Revision 6996
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/thememanager/legendmanager/panels/FPanelLegendLabels.java | ||
---|---|---|
76 | 76 |
* |
77 | 77 |
*/ |
78 | 78 |
public class FPanelLegendLabels extends JPanel implements ILegendPanel { |
79 |
private static final double FONT_SCALE_FACTOR = 1.4; |
|
80 |
|
|
81 |
|
|
79 | 82 |
private static final Font DEFAULT_FONT = |
80 | 83 |
new Font("SansSerif", Font.PLAIN, 9); |
81 | 84 |
|
... | ... | |
195 | 198 |
|
196 | 199 |
getJRadioButton1().setSelected(!m_FSymbol.isFontSizeInPixels()); |
197 | 200 |
getJCheckBoxTextOnly().setSelected(!m_FSymbol.isShapeVisible()); |
198 |
getJTextField().setText("" + |
|
199 |
m_FSymbol.getFontSize()); |
|
201 |
double size = m_FSymbol.getFontSize(); |
|
202 |
if (!m_FSymbol.isFontSizeInPixels()) |
|
203 |
// Scale the value of the font size to the value of the height |
|
204 |
// and avoid too much decimal numbers |
|
205 |
size = ((int) (100*size / FONT_SCALE_FACTOR))/100; // avoid too much decimals |
|
206 |
getJTextField().setText(String.valueOf(size)); |
|
200 | 207 |
|
201 | 208 |
|
202 | 209 |
} |
... | ... | |
230 | 237 |
{ |
231 | 238 |
// meters |
232 | 239 |
float sizeUnits = Float.parseFloat(getJTextField().getText()); |
240 |
/* |
|
241 |
* Java scales font size by defining the cell diagonal. |
|
242 |
* To obtain the right height value we need to apply a |
|
243 |
* factor to the diagonal to get a right value for the |
|
244 |
* height. |
|
245 |
*/ |
|
246 |
sizeUnits *= FONT_SCALE_FACTOR; |
|
233 | 247 |
m_FSymbol.setFontSize(sizeUnits); // Para que se pueda crear correctamente al recuperar del proyecto |
234 | 248 |
m_FSymbol.setFontSizeInPixels(false); |
235 | 249 |
} |
Also available in: Unified diff