|
|
|
@ -5,6 +5,7 @@ import com.fr.design.beans.BasicBeanPane;
|
|
|
|
|
import com.fr.design.constants.LayoutConstants; |
|
|
|
|
import com.fr.design.designer.IntervalConstants; |
|
|
|
|
import com.fr.design.gui.icombobox.LineComboBox; |
|
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
import com.fr.design.gui.ispinner.UISpinner; |
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
@ -21,14 +22,14 @@ import com.fr.stable.Constants;
|
|
|
|
|
|
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import javax.swing.border.TitledBorder; |
|
|
|
|
import javax.swing.event.ChangeEvent; |
|
|
|
|
import javax.swing.event.ChangeListener; |
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
import java.awt.Color; |
|
|
|
|
import java.awt.Component; |
|
|
|
|
import java.awt.Dimension; |
|
|
|
|
import java.awt.FlowLayout; |
|
|
|
|
import java.awt.Font; |
|
|
|
|
import java.awt.event.ItemEvent; |
|
|
|
|
import java.awt.event.ItemListener; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class MobileStyleDefinePane extends BasicBeanPane<MobileStyle> { |
|
|
|
@ -42,6 +43,8 @@ public class MobileStyleDefinePane extends BasicBeanPane<MobileStyle> {
|
|
|
|
|
private Widget widget; |
|
|
|
|
private MobileStyleCustomDefinePane customBeanPane; |
|
|
|
|
private Class<? extends MobileStyle> mobileStyleClazz; |
|
|
|
|
private UIComboBox customCombo; |
|
|
|
|
private JPanel settingPane; |
|
|
|
|
private ColorSelectBox colorSelectBox; |
|
|
|
|
private Color titleColor = new Color(47, 142, 241); |
|
|
|
|
private JPanel commomPane; |
|
|
|
@ -62,6 +65,8 @@ public class MobileStyleDefinePane extends BasicBeanPane<MobileStyle> {
|
|
|
|
|
@Override |
|
|
|
|
public void populateBean(MobileStyle ob) { |
|
|
|
|
this.customBeanPane.populateBean(ob); |
|
|
|
|
|
|
|
|
|
customCombo.setSelectedIndex(ob.isCommonCustom() ? 1 : 0); |
|
|
|
|
if(ob.getBackground() != null) { |
|
|
|
|
colorSelectBox.setSelectObject(((ColorBackground)ob.getBackground()).getColor()); |
|
|
|
|
} |
|
|
|
@ -83,6 +88,7 @@ public class MobileStyleDefinePane extends BasicBeanPane<MobileStyle> {
|
|
|
|
|
MobileStyle mobileStyle = Reflect.on(mobileStyleClazz).create().get(); |
|
|
|
|
this.widget.setMobileStyle(mobileStyle); |
|
|
|
|
this.customBeanPane.updateBean(); |
|
|
|
|
mobileStyle.setCommonCustom(customCombo.getSelectedIndex() == 1); |
|
|
|
|
mobileStyle.setBackground(ColorBackground.getInstance(colorSelectBox.getSelectObject())); |
|
|
|
|
mobileStyle.setBorderType(borderType.getSelectedLineStyle()); |
|
|
|
|
mobileStyle.setBorderColor(borderColor.getSelectObject()); |
|
|
|
@ -126,6 +132,23 @@ public class MobileStyleDefinePane extends BasicBeanPane<MobileStyle> {
|
|
|
|
|
commomPane.setBorder(titledBorder); |
|
|
|
|
this.add(commomPane, BorderLayout.NORTH); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
customCombo = new UIComboBox(new String[]{Toolkit.i18nText("Fine-Design_Mobile_Default"), Toolkit.i18nText("Fine-Design_Mobile_Custom")}); |
|
|
|
|
customCombo.setSelectedIndex(0); |
|
|
|
|
customCombo.setPreferredSize(new Dimension(NORMAL_COMBO_WIDTH + 15, 20)); |
|
|
|
|
customCombo.addItemListener(new ItemListener() { |
|
|
|
|
@Override |
|
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
|
boolean custom = customCombo.getSelectedIndex() == 1; |
|
|
|
|
settingPane.setVisible(custom); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Attribute_Settings")), customCombo)); |
|
|
|
|
|
|
|
|
|
settingPane = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 10); |
|
|
|
|
settingPane.setVisible(false); |
|
|
|
|
commomPane.add(settingPane); |
|
|
|
|
|
|
|
|
|
createBackgroundPane(); |
|
|
|
|
createBorderPane(); |
|
|
|
|
createIconSettingPane(); |
|
|
|
@ -136,7 +159,7 @@ public class MobileStyleDefinePane extends BasicBeanPane<MobileStyle> {
|
|
|
|
|
colorSelectBox = new ColorSelectBox(NORMAL_COMBO_WIDTH); |
|
|
|
|
|
|
|
|
|
JPanel backgroundPane = createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Background")), colorSelectBox); |
|
|
|
|
commomPane.add(backgroundPane); |
|
|
|
|
settingPane.add(backgroundPane); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void createBorderPane() { |
|
|
|
@ -146,19 +169,20 @@ public class MobileStyleDefinePane extends BasicBeanPane<MobileStyle> {
|
|
|
|
|
borderColor = new NewColorSelectBox(NORMAL_COMBO_WIDTH); |
|
|
|
|
borderRadius = new UISpinner(0, Integer.MAX_VALUE, 1, 2); |
|
|
|
|
borderRadius.setPreferredSize(new Dimension(NORMAL_COMBO_WIDTH + 20, 20)); |
|
|
|
|
commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_BorderType")), borderType)); |
|
|
|
|
commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_BorderColor")), borderColor)); |
|
|
|
|
commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_BorderRadius")), borderRadius)); |
|
|
|
|
settingPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_BorderType")), borderType)); |
|
|
|
|
settingPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_BorderColor")), borderColor)); |
|
|
|
|
settingPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_BorderRadius")), borderRadius)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void createIconSettingPane() { |
|
|
|
|
iconColor = new NewColorSelectBox(NORMAL_COMBO_WIDTH); |
|
|
|
|
commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Icon_Color")), iconColor)); |
|
|
|
|
iconColor.setSelectObject(new Color(31,173,229)); |
|
|
|
|
settingPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Icon_Color")), iconColor)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void createFontPane() { |
|
|
|
|
fontConfigPane = new MobileStyleFontConfigPane(); |
|
|
|
|
commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Font")), fontConfigPane)); |
|
|
|
|
settingPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Font")), fontConfigPane)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void createCustomPane() { |
|
|
|
|