|
|
|
@ -2,6 +2,7 @@ package com.fr.design.mainframe.mobile.ui;
|
|
|
|
|
|
|
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
|
import com.fr.design.constants.LayoutConstants; |
|
|
|
|
import com.fr.design.gui.ibutton.UIColorButton; |
|
|
|
|
import com.fr.design.gui.ibutton.UIToggleButton; |
|
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
|
import com.fr.design.gui.icombobox.UIComboBoxRenderer; |
|
|
|
@ -16,7 +17,6 @@ import javax.swing.JLabel;
|
|
|
|
|
import javax.swing.JList; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
import java.awt.Color; |
|
|
|
|
import java.awt.Component; |
|
|
|
|
import java.awt.Dimension; |
|
|
|
|
import java.awt.FlowLayout; |
|
|
|
@ -38,7 +38,7 @@ public class MobileStyleFontConfigPane extends JPanel {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private UIComboBox fontSizeComboBox; |
|
|
|
|
private UIToggleButton underline; |
|
|
|
|
private UIColorButton color; |
|
|
|
|
private UIToggleButton italic; |
|
|
|
|
private UIToggleButton bold; |
|
|
|
|
|
|
|
|
@ -53,7 +53,7 @@ public class MobileStyleFontConfigPane extends JPanel {
|
|
|
|
|
fontSizeComboBox.setSelectedItem(16); |
|
|
|
|
fontSizeComboBox.setPreferredSize(new Dimension(60, 20)); |
|
|
|
|
fontSizeComboBox.setRenderer(new LineCellRenderer()); |
|
|
|
|
underline = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline.png")); |
|
|
|
|
color = new UIColorButton(); |
|
|
|
|
italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png")); |
|
|
|
|
bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png")); |
|
|
|
|
|
|
|
|
@ -61,7 +61,7 @@ public class MobileStyleFontConfigPane extends JPanel {
|
|
|
|
|
this.setButtonsSize(BUTTON_SIZE); |
|
|
|
|
|
|
|
|
|
Component[] components_font = new Component[]{ |
|
|
|
|
fontSizeComboBox, underline, italic, bold |
|
|
|
|
fontSizeComboBox, color, italic, bold |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
JPanel buttonPane = new JPanel(new BorderLayout()); |
|
|
|
@ -72,13 +72,13 @@ public class MobileStyleFontConfigPane extends JPanel {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void setButtonsTips() { |
|
|
|
|
underline.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Underline")); |
|
|
|
|
color.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Foreground")); |
|
|
|
|
italic.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Italic")); |
|
|
|
|
bold.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bold")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void setButtonsSize(Dimension size) { |
|
|
|
|
underline.setPreferredSize(size); |
|
|
|
|
color.setPreferredSize(size); |
|
|
|
|
italic.setPreferredSize(size); |
|
|
|
|
bold.setPreferredSize(size); |
|
|
|
|
} |
|
|
|
@ -86,9 +86,9 @@ public class MobileStyleFontConfigPane extends JPanel {
|
|
|
|
|
|
|
|
|
|
public void populateBean(FRFont frFont) { |
|
|
|
|
fontSizeComboBox.setSelectedItem(frFont.getSize()); |
|
|
|
|
color.setColor(frFont.getForeground()); |
|
|
|
|
bold.setSelected(frFont.isBold()); |
|
|
|
|
italic.setSelected(frFont.isItalic()); |
|
|
|
|
underline.setSelected(frFont.getUnderline() != Constants.LINE_NONE); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public FRFont updateBean() { |
|
|
|
@ -99,8 +99,8 @@ public class MobileStyleFontConfigPane extends JPanel {
|
|
|
|
|
FRFont.DEFAULT_FONTNAME, |
|
|
|
|
style, |
|
|
|
|
Float.parseFloat(fontSizeComboBox.getSelectedItem().toString()), |
|
|
|
|
Color.BLACK, |
|
|
|
|
underline.isSelected() ? Constants.LINE_THIN : Constants.LINE_NONE |
|
|
|
|
color.getColor(), |
|
|
|
|
Constants.LINE_NONE |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|