Revision 6998
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/gui/thememanager/legendmanager/panels/FPanelLegendLabels.java | ||
---|---|---|
199 | 199 |
getJRadioButton1().setSelected(!m_FSymbol.isFontSizeInPixels()); |
200 | 200 |
getJCheckBoxTextOnly().setSelected(!m_FSymbol.isShapeVisible()); |
201 | 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 |
|
202 |
// Scale the value of the font size to the value of the height |
|
203 |
// and avoid too much decimal numbers |
|
204 |
size = ((int) (100*size / FONT_SCALE_FACTOR))/100; |
|
206 | 205 |
getJTextField().setText(String.valueOf(size)); |
207 | 206 |
|
208 | 207 |
|
... | ... | |
233 | 232 |
l.setLabelRotationField((String) getJComboBoxRotationField().getSelectedItem()); |
234 | 233 |
m_FSymbol.setFontColor(m_colorChooser.getColor()); |
235 | 234 |
//m_FSymbol.setSymbolType(m_Renderer.getShapeType()); |
235 |
float fontSize = Float.parseFloat(getJTextField().getText()); |
|
236 |
fontSize *= FONT_SCALE_FACTOR; |
|
236 | 237 |
if (!getJRadioButton().isSelected()) |
237 | 238 |
{ |
238 | 239 |
// meters |
239 |
float sizeUnits = Float.parseFloat(getJTextField().getText()); |
|
240 | 240 |
/* |
241 | 241 |
* Java scales font size by defining the cell diagonal. |
242 | 242 |
* To obtain the right height value we need to apply a |
243 | 243 |
* factor to the diagonal to get a right value for the |
244 | 244 |
* height. |
245 | 245 |
*/ |
246 |
sizeUnits *= FONT_SCALE_FACTOR; |
|
247 |
m_FSymbol.setFontSize(sizeUnits); // Para que se pueda crear correctamente al recuperar del proyecto |
|
246 |
m_FSymbol.setFontSize(fontSize); // Para que se pueda crear correctamente al recuperar del proyecto |
|
248 | 247 |
m_FSymbol.setFontSizeInPixels(false); |
249 | 248 |
} |
250 | 249 |
else |
251 | 250 |
{ |
252 | 251 |
// pixels |
253 |
float sizePoints = Float.parseFloat(getJTextField().getText()); |
|
254 | 252 |
m_FSymbol.setFont(labelFont); |
255 |
m_FSymbol.setFont(labelFont.deriveFont(sizePoints));
|
|
256 |
m_FSymbol.setFontSize(sizePoints);
|
|
253 |
m_FSymbol.setFont(labelFont.deriveFont(fontSize));
|
|
254 |
m_FSymbol.setFontSize(fontSize);
|
|
257 | 255 |
m_FSymbol.setFontSizeInPixels(true); |
258 | 256 |
} |
259 | 257 |
m_FSymbol.setShapeVisible(true); |
Also available in: Unified diff