@ -3,6 +3,7 @@
* /
* /
package com.fr.design.actions.cell.style ;
package com.fr.design.actions.cell.style ;
import com.fr.stable.os.OperatingSystem ;
import java.awt.Dimension ;
import java.awt.Dimension ;
import javax.swing.ComboBoxModel ;
import javax.swing.ComboBoxModel ;
@ -49,6 +50,7 @@ public class ReportFontNameAction extends AbstractStyleAction {
public void setFontName ( String fontName ) {
public void setFontName ( String fontName ) {
Object object = this . getValue ( UIComboBox . class . getName ( ) ) ;
Object object = this . getValue ( UIComboBox . class . getName ( ) ) ;
boolean find = false ;
if ( object ! = null & & object instanceof UIComboBox ) {
if ( object ! = null & & object instanceof UIComboBox ) {
UIComboBox comboBox = ( UIComboBox ) object ;
UIComboBox comboBox = ( UIComboBox ) object ;
ComboBoxModel comboBoxModel = comboBox . getModel ( ) ;
ComboBoxModel comboBoxModel = comboBox . getModel ( ) ;
@ -60,9 +62,17 @@ public class ReportFontNameAction extends AbstractStyleAction {
comboBox . removeActionListener ( this ) ;
comboBox . removeActionListener ( this ) ;
comboBox . setSelectedIndex ( i ) ;
comboBox . setSelectedIndex ( i ) ;
comboBox . addActionListener ( this ) ;
comboBox . addActionListener ( this ) ;
find = true ;
break ;
break ;
}
}
}
}
// linux设计器下面 找不到默认就是第一个字体
boolean access = OperatingSystem . isLinux ( ) & & ! find & & comboBoxModel . getSize ( ) > 0 ;
if ( access ) {
comboBox . removeActionListener ( this ) ;
comboBox . setSelectedIndex ( 0 ) ;
comboBox . addActionListener ( this ) ;
}
}
}
}
}