Revision 38512 branches/v2_0_0_prep/frameworks/_fwAndami/src/org/gvsig/andami/ui/mdiFrame/NewStatusBar.java
NewStatusBar.java | ||
---|---|---|
353 | 353 |
for (int i = 0; i < labels.length; i++) { |
354 | 354 |
// Set an initial text so the getPreferredSize works as expected |
355 | 355 |
JLabel lbl = new JLabel(); |
356 |
// lbl.setPreferredSize(new Dimension(labels[i].getSize(), lbl |
|
357 |
// .getPreferredSize().height + 2)); |
|
358 |
// Remove the initial text |
|
359 |
// lbl.setText(" "); |
|
360 | 356 |
lbl.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED)); |
361 | 357 |
lbl.setName(labels[i].getId()); |
362 | 358 |
controlContainer.add(lbl); |
... | ... | |
440 | 436 |
JLabel lbl = (JLabel) idLabel.get(id); |
441 | 437 |
|
442 | 438 |
if (lbl != null) { |
439 |
Dimension originalPreferredSize = lbl.getPreferredSize(); |
|
443 | 440 |
lbl.setText(msg); |
441 |
// Set preferred size to null just in case it has been set |
|
442 |
// previously, as we want it to be calculated from the text size. |
|
443 |
lbl.setPreferredSize(null); |
|
444 |
// Allow only to increase label width, to avoid too much ugly |
|
445 |
// width changes in the status bar components. |
|
446 |
if (lbl.getPreferredSize().width < originalPreferredSize.width) { |
|
447 |
lbl.setPreferredSize(originalPreferredSize); |
|
448 |
} |
|
444 | 449 |
} else { |
445 | 450 |
// try with controls |
446 | 451 |
try { |
Also available in: Unified diff