From 512cd4b120d75829e8d3fbf008d7deb63bd1344f Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Tue, 26 May 2020 23:30:32 +0800 Subject: [PATCH 01/21] =?UTF-8?q?MOBILE-27220=20=E5=9C=A8=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E7=A7=BB=E5=8A=A8=E7=AB=AF=E5=B1=9E=E6=80=A7=E5=8A=A0?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E2=80=9C=E9=BB=98=E8=AE=A4=E2=80=9D=E5=92=8C?= =?UTF-8?q?=E2=80=9C=E8=87=AA=E5=AE=9A=E4=B9=89=E6=A0=B7=E5=BC=8F=E2=80=9D?= =?UTF-8?q?=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mobile/ui/MobileStyleDefinePane.java | 39 +++++++++++++++---- .../mobile/ui/MobileStyleFontConfigPane.java | 21 +++++----- 2 files changed, 41 insertions(+), 19 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java index 5f11e46db..3ae82f926 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java @@ -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 { @@ -42,6 +43,8 @@ public class MobileStyleDefinePane extends BasicBeanPane { private Widget widget; private MobileStyleCustomDefinePane customBeanPane; private Class 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 { @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 = 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,22 @@ public class MobileStyleDefinePane extends BasicBeanPane { 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 +158,7 @@ public class MobileStyleDefinePane extends BasicBeanPane { 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 +168,20 @@ public class MobileStyleDefinePane extends BasicBeanPane { 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() { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java index f765e2584..3c756db09 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java @@ -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; @@ -31,7 +31,6 @@ public class MobileStyleFontConfigPane extends JPanel { public static Vector getFontSizes() { Vector FONT_SIZES = new Vector(); - FONT_SIZES.add(FONT_NONE); for (int i = MIN_FONT_SIZE; i <= MAX_FONT_SIZE; i++) { FONT_SIZES.add(i); } @@ -39,7 +38,7 @@ public class MobileStyleFontConfigPane extends JPanel { } private UIComboBox fontSizeComboBox; - private UIToggleButton underline; + private UIColorButton color; private UIToggleButton italic; private UIToggleButton bold; @@ -51,10 +50,10 @@ public class MobileStyleFontConfigPane extends JPanel { fontSizeComboBox = new UIComboBox(); fontSizeComboBox.setModel(new DefaultComboBoxModel(getFontSizes())); - fontSizeComboBox.setSelectedItem(0); + 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")); @@ -62,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()); @@ -73,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); } @@ -87,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() { @@ -100,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 ); } From 66fd4cc702d7ee72beb0b0d2e909d7b1237924f8 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Tue, 26 May 2020 23:38:11 +0800 Subject: [PATCH 02/21] =?UTF-8?q?=E6=8B=BC=E5=86=99=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java index 3ae82f926..9d08a4d4e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java @@ -132,7 +132,7 @@ public class MobileStyleDefinePane extends BasicBeanPane { 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 = 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() { From 9018c51a45ac44d0d2fb795875f205d9dd400a11 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 3 Jun 2020 22:30:42 +0800 Subject: [PATCH 03/21] =?UTF-8?q?REPORT-32939=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=AD=A3=E5=B8=B82g=E7=9B=AE=E5=89=8D=E7=BB=8F?= =?UTF-8?q?=E5=B8=B8=E5=87=BA=E7=8E=B0=E6=8E=92=E9=98=9F=E7=8E=B0=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/file/HistoryTemplateListCache.java | 36 +++++++++++++++++++ .../fr/design/mainframe/DesignerFrame.java | 16 ++++++++- 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index cb68bb6e4..437569348 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -42,6 +42,14 @@ public class HistoryTemplateListCache implements CallbackEvent { private List> historyList; private JTemplate editingTemplate; + /** + * 当设计器打开的模板数大于模板缓存对象个数时,会产生JVirtualTemplate(个数=打开的总模板数 - 缓存模板数) + * 每次点击切换模板时,当切换到JVirtualTemplate,会创建真实的JTemplate,但是该JTemplate创建后不会释放掉,需要调用whenClose主动释放 + * 该变量对JVirtualTemplate创建真实的JTemplate管理 + */ + private JTemplate currentVirtualReplaceTemplate; + + public static HistoryTemplateListCache getInstance() { return Holder.INSTANCE; } @@ -112,6 +120,14 @@ public class HistoryTemplateListCache implements CallbackEvent { * @see DesignerFrameFileDealerPane#setCurrentEditingTemplate(JTemplate) */ public void setCurrentEditingTemplate(JTemplate jt) { + + // 模板之间切换 如果存在上次JVirtualTemplate创建的真实模板 需要在此关闭,并释放掉 + boolean canReleaseVirtualReplaceTemplate = this.currentVirtualReplaceTemplate != null && jt != null + && !ComparatorUtils.equals(this.currentVirtualReplaceTemplate.getEditingFILE(), jt.getEditingFILE()); + if (canReleaseVirtualReplaceTemplate) { + HistoryTemplateListCache.getInstance().releaseVirtualReplaceTemplate(); + } + this.editingTemplate = jt; //如果当前历史面板中没有 @@ -423,4 +439,24 @@ public class HistoryTemplateListCache implements CallbackEvent { } } + + public void setCurrentVirtualReplaceTemplate(JTemplate currentVirtualReplaceTemplate) { + // 保证先释放 + releaseVirtualReplaceTemplate(); + this.currentVirtualReplaceTemplate = currentVirtualReplaceTemplate; + } + + public JTemplate getCurrentVirtualReplaceTemplate() { + return currentVirtualReplaceTemplate; + } + + /** + * 释放JVirtualTemplate创建的真实模板JTemplate + */ + private void releaseVirtualReplaceTemplate() { + if (this.currentVirtualReplaceTemplate != null) { + this.currentVirtualReplaceTemplate.whenClose(); + this.currentVirtualReplaceTemplate = null; + } + } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 2cf8d8c35..e5b8e8b7e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -1101,11 +1101,19 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta */ private void openFile(FILE tplFile) { + boolean virtualTemplate = false; if (tplFile != null) { int index = HistoryTemplateListCache.getInstance().contains(tplFile); if (index != -1) { JTemplate jt = HistoryTemplateListCache.getInstance().getHistoryList().get(index); - if (!(jt instanceof JVirtualTemplate)) { + if (jt instanceof JVirtualTemplate) { + JTemplate currentVirtualReplaceTemplate = HistoryTemplateListCache.getInstance().getCurrentVirtualReplaceTemplate(); + if (currentVirtualReplaceTemplate != null && ComparatorUtils.equals(currentVirtualReplaceTemplate.getEditingFILE(), jt.getEditingFILE())) { + currentVirtualReplaceTemplate.activeOldJTemplate(); + return; + } + virtualTemplate = true; + } else { jt.activeOldJTemplate(); return; } @@ -1116,6 +1124,12 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta if (jt == null) { return; } + + // 将JVirtualTemplate创建的真实模板管理起来 + if (virtualTemplate) { + HistoryTemplateListCache.getInstance().setCurrentVirtualReplaceTemplate(jt); + } + // 新的form不往前兼容 if (inValidDesigner(jt)) { this.addAndActivateJTemplate(); From 838183e165e8c864ef7a66c30cdee5cf635d6ac2 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 3 Jun 2020 22:37:06 +0800 Subject: [PATCH 04/21] REPORT-32939 add comment --- .../src/main/java/com/fr/design/mainframe/DesignerFrame.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index e5b8e8b7e..2cfd36687 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -1109,6 +1109,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta if (jt instanceof JVirtualTemplate) { JTemplate currentVirtualReplaceTemplate = HistoryTemplateListCache.getInstance().getCurrentVirtualReplaceTemplate(); if (currentVirtualReplaceTemplate != null && ComparatorUtils.equals(currentVirtualReplaceTemplate.getEditingFILE(), jt.getEditingFILE())) { + // 防止在打开了模板的情况下 去双击目录树对应的模板重复创建JTemplate currentVirtualReplaceTemplate.activeOldJTemplate(); return; } From 0b3aac756a2d086bd96c00a7d21d7fc337cffa48 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 4 Jun 2020 11:26:59 +0800 Subject: [PATCH 05/21] =?UTF-8?q?REPORT-33018=20=20fix=20=E6=B2=BF?= =?UTF-8?q?=E7=94=A8=E4=B9=8B=E5=89=8D=E7=9A=84=E6=96=B9=E6=A1=88=E9=80=BB?= =?UTF-8?q?=E8=BE=91=20=E9=98=B2=E6=AD=A2=E4=BA=A7=E7=94=9F=E5=81=87?= =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/file/HistoryTemplateListCache.java | 37 ------------------- .../fr/design/mainframe/DesignerFrame.java | 19 ++++------ 2 files changed, 7 insertions(+), 49 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index 437569348..466e919b7 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -42,14 +42,6 @@ public class HistoryTemplateListCache implements CallbackEvent { private List> historyList; private JTemplate editingTemplate; - /** - * 当设计器打开的模板数大于模板缓存对象个数时,会产生JVirtualTemplate(个数=打开的总模板数 - 缓存模板数) - * 每次点击切换模板时,当切换到JVirtualTemplate,会创建真实的JTemplate,但是该JTemplate创建后不会释放掉,需要调用whenClose主动释放 - * 该变量对JVirtualTemplate创建真实的JTemplate管理 - */ - private JTemplate currentVirtualReplaceTemplate; - - public static HistoryTemplateListCache getInstance() { return Holder.INSTANCE; } @@ -120,14 +112,6 @@ public class HistoryTemplateListCache implements CallbackEvent { * @see DesignerFrameFileDealerPane#setCurrentEditingTemplate(JTemplate) */ public void setCurrentEditingTemplate(JTemplate jt) { - - // 模板之间切换 如果存在上次JVirtualTemplate创建的真实模板 需要在此关闭,并释放掉 - boolean canReleaseVirtualReplaceTemplate = this.currentVirtualReplaceTemplate != null && jt != null - && !ComparatorUtils.equals(this.currentVirtualReplaceTemplate.getEditingFILE(), jt.getEditingFILE()); - if (canReleaseVirtualReplaceTemplate) { - HistoryTemplateListCache.getInstance().releaseVirtualReplaceTemplate(); - } - this.editingTemplate = jt; //如果当前历史面板中没有 @@ -438,25 +422,4 @@ public class HistoryTemplateListCache implements CallbackEvent { jt.refreshResource(); } } - - - public void setCurrentVirtualReplaceTemplate(JTemplate currentVirtualReplaceTemplate) { - // 保证先释放 - releaseVirtualReplaceTemplate(); - this.currentVirtualReplaceTemplate = currentVirtualReplaceTemplate; - } - - public JTemplate getCurrentVirtualReplaceTemplate() { - return currentVirtualReplaceTemplate; - } - - /** - * 释放JVirtualTemplate创建的真实模板JTemplate - */ - private void releaseVirtualReplaceTemplate() { - if (this.currentVirtualReplaceTemplate != null) { - this.currentVirtualReplaceTemplate.whenClose(); - this.currentVirtualReplaceTemplate = null; - } - } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 2cfd36687..e52d4333f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -1101,19 +1101,20 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta */ private void openFile(FILE tplFile) { - boolean virtualTemplate = false; if (tplFile != null) { int index = HistoryTemplateListCache.getInstance().contains(tplFile); if (index != -1) { JTemplate jt = HistoryTemplateListCache.getInstance().getHistoryList().get(index); if (jt instanceof JVirtualTemplate) { - JTemplate currentVirtualReplaceTemplate = HistoryTemplateListCache.getInstance().getCurrentVirtualReplaceTemplate(); - if (currentVirtualReplaceTemplate != null && ComparatorUtils.equals(currentVirtualReplaceTemplate.getEditingFILE(), jt.getEditingFILE())) { - // 防止在打开了模板的情况下 去双击目录树对应的模板重复创建JTemplate - currentVirtualReplaceTemplate.activeOldJTemplate(); + // 如果是JVirtualTemplate 创建真实JTemplate + JTemplate realJTemplate = JTemplateFactory.createJTemplate(tplFile); + if (realJTemplate == null) { return; } - virtualTemplate = true; + // 由JVirtualTemplate激活真实JTemplate 本质在historyList中进行替换 + // 同时 realJTemplate被管理起来 不需要主动释放 关闭时会自动释放 + jt.activeJTemplate(index, realJTemplate); + return; } else { jt.activeOldJTemplate(); return; @@ -1125,12 +1126,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta if (jt == null) { return; } - - // 将JVirtualTemplate创建的真实模板管理起来 - if (virtualTemplate) { - HistoryTemplateListCache.getInstance().setCurrentVirtualReplaceTemplate(jt); - } - // 新的form不往前兼容 if (inValidDesigner(jt)) { this.addAndActivateJTemplate(); From e811e5846f888d2081ec5d1bc38b337fa0d31c39 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Wed, 24 Jun 2020 15:04:58 +0800 Subject: [PATCH 06/21] =?UTF-8?q?REPORT-34127=20=E7=AD=9B=E9=80=89?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=EF=BC=8C=E6=94=B9=E4=BA=86=E5=90=8E=E9=9D=A2?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E6=9D=A1=E4=BB=B6=E4=B9=8B=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E5=89=8D=E9=9D=A2=E5=8D=95=E5=85=83=E6=A0=BC=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E8=B7=9F=E7=9D=80=E4=BF=AE=E6=94=B9=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/grid/IntelliElements.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/grid/IntelliElements.java b/designer-realize/src/main/java/com/fr/grid/IntelliElements.java index 7c15b8629..ca1ed55d8 100644 --- a/designer-realize/src/main/java/com/fr/grid/IntelliElements.java +++ b/designer-realize/src/main/java/com/fr/grid/IntelliElements.java @@ -194,8 +194,12 @@ public class IntelliElements { TemplateCellElement newCellElement = new DefaultTemplateCellElement(colIndex, rowIndex); applyStyle(newCellElement, sourceCellElement);//style if (sourceCellElement.getValue() instanceof DSColumn) { - DSColumn dsColumn = (DSColumn) sourceCellElement.getValue(); - newCellElement.setValue(dsColumn); + try{ + DSColumn dsColumn = (DSColumn)((DSColumn) sourceCellElement.getValue()).clone(); + newCellElement.setValue(dsColumn); + }catch (CloneNotSupportedException e){ + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } newCellElement.setCellExpandAttr(sourceCellElement.getCellExpandAttr()); } else if (sourceCellElement.getValue() instanceof Number) { newCellElement.setValue(processNumber((Number) sourceCellElement.getValue())); From 151a8bb5ca78c66a0894f76223ba64458b5a38ce Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 24 Jun 2020 15:34:13 +0800 Subject: [PATCH 07/21] =?UTF-8?q?REPORT-34222=20=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E7=BB=99=E5=AE=B9=E5=99=A8=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E5=BC=80=E4=B8=AA=E5=A4=8D=E5=88=B6=E7=B2=98=E8=B4=B4?= =?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3=20=E5=90=8C=E6=AD=A5=E5=88=B0final?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/fun/FormWidgetOptionProvider.java | 7 +++++ .../AbstractFormWidgetOptionProvider.java | 5 ++++ .../designer/beans/models/SelectionModel.java | 26 +++++++++++++++++++ 3 files changed, 38 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/fun/FormWidgetOptionProvider.java b/designer-base/src/main/java/com/fr/design/fun/FormWidgetOptionProvider.java index bfc32f4e9..9f033d6dc 100644 --- a/designer-base/src/main/java/com/fr/design/fun/FormWidgetOptionProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/FormWidgetOptionProvider.java @@ -16,4 +16,11 @@ public interface FormWidgetOptionProvider extends ParameterWidgetOptionProvider */ boolean isContainer(); + /** + * 如果是布局容器要实现粘贴到容器中的操作 + * @param t + * @param 泛型参数 表示选中的组件 一般为FormSelection + */ + void paste2Container(T t); + } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormWidgetOptionProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormWidgetOptionProvider.java index 43cab9514..537a49d01 100644 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormWidgetOptionProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormWidgetOptionProvider.java @@ -25,4 +25,9 @@ public abstract class AbstractFormWidgetOptionProvider extends AbstractProvider public boolean isContainer() { return false; } + + @Override + public void paste2Container(T t) { + // do nothing + } } \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java index dd964e4ab..9f5f36f66 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java @@ -1,6 +1,7 @@ package com.fr.design.designer.beans.models; import com.fr.common.inputevent.InputEventBaseOnOS; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.base.clipboard.ClipboardFilter; import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.LayoutAdapter; @@ -19,11 +20,13 @@ import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; import com.fr.design.form.util.FormDesignerUtils; import com.fr.design.form.util.XCreatorConstants; +import com.fr.design.fun.FormWidgetOptionProvider; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormSelection; import com.fr.design.mainframe.FormSelectionUtils; import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.gui.LayoutUtils; +import com.fr.general.ComparatorUtils; import com.fr.stable.ArrayUtils; import java.awt.LayoutManager; @@ -31,6 +34,7 @@ import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.event.MouseEvent; import java.util.ArrayList; +import java.util.Set; /** * 该model保存当前选择的组件和剪切版信息 @@ -43,6 +47,7 @@ public class SelectionModel { private FormDesigner designer; private FormSelection selection; private Rectangle hotspotBounds; + private FormWidgetOptionProvider provider; public SelectionModel(FormDesigner designer) { this.designer = designer; @@ -256,9 +261,30 @@ public class SelectionModel { //绝对布局 Rectangle rec = selection.getSelctionBounds(); FormSelectionUtils.paste2Container(designer, container, clipboard, rec.x + DELTA_X_Y, rec.y + DELTA_X_Y); + } else if (isExtraContainer(container)) { + provider.paste2Container(selection); } } + + /** + * 扩展的容器布局 + * @param container + * @return + */ + private boolean isExtraContainer(XLayoutContainer container) { + if (container != null) { + Set set = ExtraDesignClassManager.getInstance().getArray(FormWidgetOptionProvider.XML_TAG); + for (FormWidgetOptionProvider provider : set) { + if (provider.isContainer() && ComparatorUtils.equals(provider.appearanceForWidget(), selection.getSelectedCreator().getParent().getClass())) { + this.provider = provider; + return true; + } + } + } + return false; + } + /** * 删除当前所有选择的组件 */ From 56c61a0c16bb17d1c6fd117014a5475614116b67 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 25 Jun 2020 14:32:57 +0800 Subject: [PATCH 08/21] =?UTF-8?q?CHART-14399=20=E5=9D=90=E6=A0=87=E8=BD=B4?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E7=B1=BB=E5=9E=8B=E6=97=B6=EF=BC=8C=E4=BF=9D?= =?UTF-8?q?=E7=95=99=E7=BD=91=E6=A0=BC=E7=BA=BF=E7=B1=BB=E5=9E=8B=E5=92=8C?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=09=E5=90=8C=E6=AD=A5=E5=88=B0final?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/axis/VanChartAxisScrollPaneWithTypeSelect.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java index 830bebf64..ef042e0f2 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java @@ -102,21 +102,21 @@ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScroll if(ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_CATEGORY)){ textAxisPane.updateBean(axis); } else { - axis = new VanChartAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType()); + axis = new VanChartAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType(), axis.getMainGridColor()); textAxisPane.updateBean(axis); } } else if(ComparatorUtils.equals(index, AxisType.AXIS_TIME.ordinal())){ if(ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_TIME)){ timeAxisPane.updateBean(axis); } else { - axis = new VanChartTimeAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType()); + axis = new VanChartTimeAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType(), axis.getMainGridColor()); timeAxisPane.updateBean(axis); } } else if(ComparatorUtils.equals(index, AxisType.AXIS_VALUE.ordinal())){ if(ComparatorUtils.equals(axis.getAxisType(), AxisType.AXIS_VALUE)){ valueAxisPane.updateBean(axis); } else { - axis = new VanChartValueAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType()); + axis = new VanChartValueAxis(axis.getAxisName(), axis.getPosition(), axis.getGridLineType(), axis.getMainGridColor()); valueAxisPane.updateBean(axis); } } From ed82eca8c98c75ba507514b96385c2a9bd0b4a8b Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Sun, 28 Jun 2020 19:56:31 +0800 Subject: [PATCH 09/21] =?UTF-8?q?REPORT-33944=20=E9=A1=B5=E8=BE=B9?= =?UTF-8?q?=E8=B7=9D=E4=B8=BA0=EF=BC=8C=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E8=99=9A=E7=BA=BF=E5=92=8C=E5=AE=9E=E9=99=85=E6=9C=891?= =?UTF-8?q?=E7=9A=84=E8=AF=AF=E5=B7=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/grid/GridUI.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/grid/GridUI.java b/designer-realize/src/main/java/com/fr/grid/GridUI.java index ff027af08..36b81ea68 100644 --- a/designer-realize/src/main/java/com/fr/grid/GridUI.java +++ b/designer-realize/src/main/java/com/fr/grid/GridUI.java @@ -315,7 +315,7 @@ public class GridUI extends ComponentUI { } protected void iterateStart2End(Graphics2D g2d) { - float tmpSize = 0, paperSumSize = 0, sumSize = 0; + double tmpSize = 0, paperSumSize = 0, sumSize = 0; for (int i = 0; i <= endIndex; i++) { // denny: 开始 if (i == 0) { @@ -323,7 +323,7 @@ public class GridUI extends ComponentUI { // denny: 增加从0到Grid左边被hide的列宽 for (int k = 0; k < startIndex; k++) { - tmpSize = sizeList.get(k).toPixF(resolution); + tmpSize = sizeList.get(k).toPixD(resolution); paperSumSize += tmpSize; if (paperSumSize >= paperPaintSize) { @@ -333,7 +333,7 @@ public class GridUI extends ComponentUI { } // adjust height. - tmpSize = sizeList.get(i).toPixF(resolution); + tmpSize = sizeList.get(i).toPixD(resolution); paperSumSize += tmpSize; if (showGridLine) {// paint line. @@ -342,7 +342,7 @@ public class GridUI extends ComponentUI { } // paint paper margin line. - if (showPaginateLine && paperSumSize >= paperPaintSize) { + if (showPaginateLine && (float)paperSumSize > (float) paperPaintSize) { paginateLineList.add(getPaginateLine2D((int) sumSize)); paperSumSize = tmpSize; } @@ -497,8 +497,8 @@ public class GridUI extends ComponentUI { paintCellElementRectangleList.add(this.tmpRectangle.clone()); - double cellWidth = this.tmpRectangle.getWidth(); - double cellHeight = this.tmpRectangle.getHeight(); + double cellWidth = this.tmpRectangle.getWidth(); + double cellHeight = this.tmpRectangle.getHeight(); // denny_Grid: 画Grid中单元格的内容(包括单元格的背景Content + Background), 不包括边框 painter.paintBackground(g2d, report, tmpCellElement, cellWidth - 1, cellHeight - 1); @@ -625,10 +625,10 @@ public class GridUI extends ComponentUI { tmpLine2D = (Line2D) paginateLineList.get(j);// 直接强制转换,因为List中肯定都是Line2D型的 for (int k = j + 1; k < paginateLineList.size(); k++) { tmpLine2D2 = (Line2D) paginateLineList.get(k); - if (AssistUtils.equals(tmpLine2D2.getX1() ,tmpLine2D.getX1()) - && AssistUtils.equals(tmpLine2D2.getX2() , tmpLine2D.getX2()) - && AssistUtils.equals(tmpLine2D2.getY1() , tmpLine2D.getY1()) - && AssistUtils.equals(tmpLine2D2.getY2() , tmpLine2D.getY2())) { + if (AssistUtils.equals(tmpLine2D2.getX1(), tmpLine2D.getX1()) + && AssistUtils.equals(tmpLine2D2.getX2(), tmpLine2D.getX2()) + && AssistUtils.equals(tmpLine2D2.getY1(), tmpLine2D.getY1()) + && AssistUtils.equals(tmpLine2D2.getY2(), tmpLine2D.getY2())) { paginateLineList.remove(k); } } From a6648211e945261b7273b109d1dc479efa7777a5 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 29 Jun 2020 14:41:13 +0800 Subject: [PATCH 10/21] =?UTF-8?q?REPORT-33944=20=E5=A4=A7=E4=BA=8E?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E7=9A=84=E7=B2=BE=E5=BA=A6=E4=B9=8B=E5=A4=96?= =?UTF-8?q?=E6=89=8D=E6=98=AF=E5=A4=A7=E4=BA=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-realize/src/main/java/com/fr/grid/GridUI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/grid/GridUI.java b/designer-realize/src/main/java/com/fr/grid/GridUI.java index 36b81ea68..3ca89fc01 100644 --- a/designer-realize/src/main/java/com/fr/grid/GridUI.java +++ b/designer-realize/src/main/java/com/fr/grid/GridUI.java @@ -342,7 +342,7 @@ public class GridUI extends ComponentUI { } // paint paper margin line. - if (showPaginateLine && (float)paperSumSize > (float) paperPaintSize) { + if (showPaginateLine && paperSumSize - paperPaintSize > 1.0E-7D) { paginateLineList.add(getPaginateLine2D((int) sumSize)); paperSumSize = tmpSize; } From c1d29e61697a5997eaadeb53751620158efe06be Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 29 Jun 2020 17:28:01 +0800 Subject: [PATCH 11/21] =?UTF-8?q?REPORT-33944=20=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E5=B8=B8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-realize/src/main/java/com/fr/grid/GridUI.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/grid/GridUI.java b/designer-realize/src/main/java/com/fr/grid/GridUI.java index 3ca89fc01..62927647a 100644 --- a/designer-realize/src/main/java/com/fr/grid/GridUI.java +++ b/designer-realize/src/main/java/com/fr/grid/GridUI.java @@ -300,6 +300,8 @@ public class GridUI extends ComponentUI { private int resolution; + private static final double THRESHOLD = 1.0E-4D; + DrawLineHelper(int startIndex, int endIndex, boolean showGridLine, boolean showPaginateLine, DynamicUnitList sizeList, double paperPaintSize, List paginateLineList, int resolution) { @@ -315,7 +317,7 @@ public class GridUI extends ComponentUI { } protected void iterateStart2End(Graphics2D g2d) { - double tmpSize = 0, paperSumSize = 0, sumSize = 0; + float tmpSize = 0, paperSumSize = 0, sumSize = 0; for (int i = 0; i <= endIndex; i++) { // denny: 开始 if (i == 0) { @@ -323,7 +325,7 @@ public class GridUI extends ComponentUI { // denny: 增加从0到Grid左边被hide的列宽 for (int k = 0; k < startIndex; k++) { - tmpSize = sizeList.get(k).toPixD(resolution); + tmpSize = sizeList.get(k).toPixF(resolution); paperSumSize += tmpSize; if (paperSumSize >= paperPaintSize) { @@ -333,7 +335,7 @@ public class GridUI extends ComponentUI { } // adjust height. - tmpSize = sizeList.get(i).toPixD(resolution); + tmpSize = sizeList.get(i).toPixF(resolution); paperSumSize += tmpSize; if (showGridLine) {// paint line. @@ -342,7 +344,7 @@ public class GridUI extends ComponentUI { } // paint paper margin line. - if (showPaginateLine && paperSumSize - paperPaintSize > 1.0E-7D) { + if (showPaginateLine && paperSumSize - paperPaintSize > THRESHOLD) { paginateLineList.add(getPaginateLine2D((int) sumSize)); paperSumSize = tmpSize; } From 322f01e340a7c96b8a0667dfca75110fd2868d00 Mon Sep 17 00:00:00 2001 From: assassion <1536296691@qq.com> Date: Tue, 30 Jun 2020 14:26:13 +0800 Subject: [PATCH 12/21] =?UTF-8?q?REPORT-32520=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E8=AE=BE=E7=BD=AE=E8=B6=85=E8=BF=872000?= =?UTF-8?q?=E5=90=8E=E9=A2=84=E8=A7=88=E4=B8=8D=E8=83=BD=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=AE=BD=E5=92=8C=E9=AB=98=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/report/PageSetupPane.java | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java b/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java index 20beaa564..591cd461a 100644 --- a/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java @@ -19,25 +19,20 @@ import java.awt.event.FocusEvent; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; -import javax.swing.BorderFactory; -import javax.swing.Box; -import javax.swing.ButtonGroup; -import javax.swing.Icon; +import javax.swing.*; +import com.fr.design.gui.ispinner.ColumnRowSpinner; import com.fr.page.PaperSettingProvider; import com.fr.page.ReportSettingsProvider; import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ilable.UILabel; -import javax.swing.JList; -import javax.swing.JPanel; -import javax.swing.JSpinner; -import javax.swing.SpinnerNumberModel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; +import javax.swing.text.NumberFormatter; import com.fr.base.BaseUtils; import com.fr.base.Margin; @@ -212,6 +207,13 @@ public class PageSetupPane extends BasicPane { ((JSpinner.DefaultEditor) paperWidthSpinner.getEditor()).getTextField().setColumns(7); paperHeightSpinner = new UIBasicSpinner(new SpinnerNumberModel(0.0, 0.0, Double.MAX_VALUE, 1.0)); ((JSpinner.DefaultEditor) paperHeightSpinner.getEditor()).getTextField().setColumns(7); + + JFormattedTextField txt = ((JSpinner.NumberEditor) paperWidthSpinner.getEditor()).getTextField(); + ((NumberFormatter) txt.getFormatter()).setAllowsInvalid(false); + txt = ((JSpinner.NumberEditor) paperHeightSpinner.getEditor()).getTextField(); + ((NumberFormatter) txt.getFormatter()).setAllowsInvalid(false); + + unitLabel = new UnitFieldPane.UnitLabel(Constants.UNIT_MM, paperHeightSpinner.getPreferredSize().height); String[] inch = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_MM"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_INCH")}; @@ -738,8 +740,8 @@ public class PageSetupPane extends BasicPane { return; } // 最大2000,以免画的时候超边 - this.paper_width = Math.min(paper_width, 2000); - this.paper_height = Math.min(paper_height, 2000); + this.paper_width = Math.min(paper_width, Double.MAX_VALUE); + this.paper_height = Math.min(paper_height, Double.MAX_VALUE); this.paper_orientation = paper_orientation; length_scale = !useLocale ? NUM_3 : NUM_POINT_3; } @@ -766,18 +768,24 @@ public class PageSetupPane extends BasicPane { FontMetrics fm = g2d.getFontMetrics(); // 横向的长度 String w_str = "" + paper_width; - if (w_str.indexOf(CoreConstants.DOT) > 0) { + if (!w_str.contains("E")&&w_str.indexOf(CoreConstants.DOT) > 0) { w_str = w_str.substring(0, w_str.indexOf(CoreConstants.DOT) + 2); } int w_length = fm.stringWidth(w_str); paint_width = Math.max(paint_width, w_length + 26); // 纵向的长度 String h_str = "" + paper_height; - if (h_str.indexOf(".") > 0) { + //使用科学计数法显示长度的时候,限制纵向显示长度为9位 + if (h_str.contains("E")){ + String str1=h_str.substring(h_str.indexOf("E")); + String str2=h_str.substring(0,9-str1.length()); + h_str = str2+str1; + }else if(h_str.indexOf(".") > 0) { h_str = h_str.substring(0, h_str.indexOf(".") + 2); } int h_length = fm.stringWidth(h_str); paint_height = Math.max(paint_height, h_length + 26); + paint_height = Math.min(paint_height, 75); double startX = (pane_width - paint_width) / 2; double startY = (pane_height - paint_height) / 2; g2d.translate(startX, startY); From 900d1f688382b3aaabfae034b44f250517136b66 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Tue, 30 Jun 2020 15:19:47 +0800 Subject: [PATCH 13/21] =?UTF-8?q?REPORT-32520=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/report/PageSetupPane.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java b/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java index 591cd461a..8dadbe7cc 100644 --- a/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java @@ -67,6 +67,7 @@ public class PageSetupPane extends BasicPane { private PagePane pagePane; private OtherPane otherPane; private UILabel zeroMarginWarn; + private static final String E = "E"; public PageSetupPane() { this.initComponents(); @@ -768,7 +769,7 @@ public class PageSetupPane extends BasicPane { FontMetrics fm = g2d.getFontMetrics(); // 横向的长度 String w_str = "" + paper_width; - if (!w_str.contains("E")&&w_str.indexOf(CoreConstants.DOT) > 0) { + if (!w_str.contains(E) && w_str.indexOf(CoreConstants.DOT) > 0) { w_str = w_str.substring(0, w_str.indexOf(CoreConstants.DOT) + 2); } int w_length = fm.stringWidth(w_str); @@ -776,16 +777,16 @@ public class PageSetupPane extends BasicPane { // 纵向的长度 String h_str = "" + paper_height; //使用科学计数法显示长度的时候,限制纵向显示长度为9位 - if (h_str.contains("E")){ - String str1=h_str.substring(h_str.indexOf("E")); + if (h_str.contains(E)){ + String str1=h_str.substring(h_str.indexOf(E)); String str2=h_str.substring(0,9-str1.length()); h_str = str2+str1; - }else if(h_str.indexOf(".") > 0) { - h_str = h_str.substring(0, h_str.indexOf(".") + 2); + }else if(h_str.indexOf(CoreConstants.DOT) > 0) { + h_str = h_str.substring(0, h_str.indexOf(CoreConstants.DOT) + 2); } int h_length = fm.stringWidth(h_str); paint_height = Math.max(paint_height, h_length + 26); - paint_height = Math.min(paint_height, 75); + paint_height = Math.min(paint_height, 74); double startX = (pane_width - paint_width) / 2; double startY = (pane_height - paint_height) / 2; g2d.translate(startX, startY); From 1f3781c3442bbc773acaa88f8fd7630ac98853e5 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Tue, 30 Jun 2020 15:34:20 +0800 Subject: [PATCH 14/21] =?UTF-8?q?REPORT-32520=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/report/PageSetupPane.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java b/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java index 8dadbe7cc..668700a95 100644 --- a/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java @@ -777,11 +777,11 @@ public class PageSetupPane extends BasicPane { // 纵向的长度 String h_str = "" + paper_height; //使用科学计数法显示长度的时候,限制纵向显示长度为9位 - if (h_str.contains(E)){ - String str1=h_str.substring(h_str.indexOf(E)); - String str2=h_str.substring(0,9-str1.length()); - h_str = str2+str1; - }else if(h_str.indexOf(CoreConstants.DOT) > 0) { + if (h_str.contains(E)) { + String str1 = h_str.substring(h_str.indexOf(E)); + String str2 = h_str.substring(0, 9 - str1.length()); + h_str = str2 + str1; + } else if (h_str.indexOf(CoreConstants.DOT) > 0) { h_str = h_str.substring(0, h_str.indexOf(CoreConstants.DOT) + 2); } int h_length = fm.stringWidth(h_str); @@ -790,7 +790,7 @@ public class PageSetupPane extends BasicPane { double startX = (pane_width - paint_width) / 2; double startY = (pane_height - paint_height) / 2; g2d.translate(startX, startY); - g2d = getG2d(paint_width, paint_height,g2d,w_str,h_str,w_length,h_length); + g2d = getG2d(paint_width, paint_height, g2d, w_str, h_str, w_length, h_length); if (paper_orientation == ReportConstants.PORTRAIT) { g2d.drawImage(img, (int) ((paint_width - img.getWidth(null)) / 2), (int) ((paint_height - img.getHeight(null)) / 2), null); From 7946d9ddfbe510883e2d75fdd750dfdc8cf7d360 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 2 Jul 2020 17:38:14 +0800 Subject: [PATCH 15/21] =?UTF-8?q?REPORT-32997=20=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=88=97=E5=AE=BD=E4=BF=AE=E6=94=B9=E4=BD=86=E6=98=AF=E5=80=BC?= =?UTF-8?q?=E4=B8=8D=E5=8F=98=E5=87=BA=E7=8E=B0=E4=BA=86=E7=BC=A9=E8=BF=9B?= =?UTF-8?q?=20=E8=BD=AC=E4=B8=93=E4=BA=BA=E6=9C=8D=E5=8A=A1-Cafu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/columnrow/ColumnRowSizingAction.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnRowSizingAction.java b/designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnRowSizingAction.java index f7e86d2c0..0903323b8 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnRowSizingAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/columnrow/ColumnRowSizingAction.java @@ -13,6 +13,7 @@ import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.fun.ReportLengthUNITProvider; import com.fr.design.unit.UnitConvertUtil; +import com.fr.general.ComparatorUtils; import com.fr.grid.selection.CellSelection; import com.fr.report.elementcase.ElementCase; import com.fr.stable.ArrayUtils; @@ -39,8 +40,8 @@ public abstract class ColumnRowSizingAction extends AbstractColumnRowIndexAction return ColumnRowSizingAction.this.title4UnitInputPane(); } }; - UNIT len = getShowLen(report, cs); - populateNumberDialog(uPane, len); + final UNIT oldLen = getShowLen(report, cs); + populateNumberDialog(uPane, oldLen); final CellSelection finalCS = cs; uPane.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { @@ -51,8 +52,10 @@ public abstract class ColumnRowSizingAction extends AbstractColumnRowIndexAction float newHeight = (float) uPane.update(); int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit(); ReportLengthUNITProvider lengthUNIT = UnitConvertUtil.parseLengthUNIT(unitType); - UNIT len = lengthUNIT.float2UNIT(newHeight); - updateAction(report, len, finalCS); + UNIT newLen = lengthUNIT.float2UNIT(newHeight); + if (!ComparatorUtils.equals(oldLen, newLen)) { + updateAction(report, newLen, finalCS); + } } catch (ValueNotChangeException e) { // nothing } From f026765d25ed46b04bd5ab205ab54af435c33aab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 7 Jul 2020 17:05:26 +0800 Subject: [PATCH 16/21] =?UTF-8?q?CHART-14346=20&&=20CHART-14180=20=20?= =?UTF-8?q?=E6=82=AC=E6=B5=AE=E5=9B=BE=E8=A1=A8=E9=85=8D=E7=BD=AE=E7=BB=84?= =?UTF-8?q?=E5=90=88=E5=9B=BE=E4=B8=8D=E8=83=BD=E9=80=89=E6=8B=A9=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=A0=BC=E6=95=B0=E6=8D=AE=E6=BA=90=20&&=20=E8=BD=B4?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E9=9A=90=E8=97=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/custom/VanChartCustomDataPane.java | 1 + ...VanChartCustomPlotDataContentsTabPane.java | 12 + .../style/axis/VanChartBaseAxisPane.java | 260 ++++++++++-------- 3 files changed, 162 insertions(+), 111 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomDataPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomDataPane.java index 6c5f714bf..ec15e4cf9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomDataPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomDataPane.java @@ -27,6 +27,7 @@ public class VanChartCustomDataPane extends ChartDataPane { } contentsTabPane = new VanChartCustomPlotDataContentsTabPane((VanChartCustomPlot)chart.getPlot(), VanChartCustomDataPane.this, listener); + contentsTabPane.setSupportCellData(isSupportCellData()); content.add(contentsTabPane, BorderLayout.CENTER); return content; diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java index e8f6f3a0a..6dbe9577c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java @@ -22,10 +22,21 @@ import java.util.Map; * Created by Fangjie on 2016/4/29. */ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTabPane { + + private boolean supportCellData = true; + public VanChartCustomPlotDataContentsTabPane(VanChartCustomPlot plot, VanChartCustomDataPane parent, AttributeChangeListener listener) { super(plot, parent, listener); } + public boolean isSupportCellData() { + return supportCellData; + } + + public void setSupportCellData(boolean supportCellData) { + this.supportCellData = supportCellData; + } + @Override protected void initTabTitle() { @@ -60,6 +71,7 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab for (int i = 0; i < customPlotList.size(); i++){ //根据不同的plot创建不同的数据配置界面 ChartDataPane contentPane = new VanChartDataPane(listener); + contentPane.setSupportCellData(supportCellData); paneList.add(contentPane); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java index 064a7156b..d96b1e40f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java @@ -54,11 +54,13 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { private static final long serialVersionUID = -5717246802333308973L; private static final double ROTATION_MAX = 90.0; + protected UIButtonGroup showTitle; protected TinyFormulaPane titleContent; protected UIButtonGroup titleAlignPane; protected UIToggleButton titleUseHtml; protected ChartTextAttrPane titleTextAttrPane; protected UINumberDragPane titleTextRotation; + protected JPanel titlePane; protected UIButtonGroup showLabel; protected ChartTextAttrPane labelTextAttrPane; @@ -96,11 +98,11 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { protected JPanel centerPane; private VanChartHtmlLabelPane htmlLabelPane; - public VanChartBaseAxisPane(){ + public VanChartBaseAxisPane() { this(true); } - public VanChartBaseAxisPane(boolean isXAxis){ + public VanChartBaseAxisPane(boolean isXAxis) { this.setLayout(new BorderLayout()); this.add(createContentPane(isXAxis), BorderLayout.CENTER); } @@ -108,12 +110,13 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { public void setParentPane(VanChartStylePane parent) { htmlLabelPane.setParent(parent); } - protected void reLayoutPane(boolean isXAxis){ + + protected void reLayoutPane(boolean isXAxis) { this.removeAll(); this.add(createContentPane(isXAxis), BorderLayout.CENTER); } - protected JPanel createContentPane(boolean isXAxis){ + protected JPanel createContentPane(boolean isXAxis) { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; @@ -121,7 +124,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; double[] columnSize = {f, e}; double[] column = {f, s}; - double[] rowSize = {p, p, p, p, p, p, p,p}; + double[] rowSize = {p, p, p, p, p, p, p, p}; Component[][] components = new Component[][]{ new Component[]{createTitlePane(new double[]{p, p, p, p, p, p}, columnSize, isXAxis), null}, new Component[]{createLabelPane(new double[]{p, p}, column), null}, @@ -131,39 +134,52 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { new Component[]{createValueStylePane(), null}, }; - return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); + return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); } - protected JPanel createTitlePane(double[] row, double[] col, boolean isXAxis){ + protected JPanel createTitlePane(double[] row, double[] col, boolean isXAxis) { + showTitle = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Use_Show"), Toolkit.i18nText("Fine-Design_Chart_Hidden")}); titleAlignPane = isXAxis ? getXAxisTitleAlignPane() : getYAxisTitleAlignPane(); titleAlignPane.setSelectedItem(Constants.CENTER); titleContent = new TinyFormulaPane(); titleUseHtml = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Html")); UIComponentUtils.setLineWrap(titleUseHtml); titleTextAttrPane = new ChartTextAttrPane(); - titleTextRotation = new UINumberDragPane(-ROTATION_MAX,ROTATION_MAX); - if(isXAxis){ + titleTextRotation = new UINumberDragPane(-ROTATION_MAX, ROTATION_MAX); + if (isXAxis) { titleTextRotation.populateBean(0.0); } else { titleTextRotation.populateBean(-ROTATION_MAX); } Component[][] components = new Component[][]{ - new Component[]{null,null}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content")),titleContent}, - new Component[]{null,titleUseHtml}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout_Position")),titleAlignPane}, - new Component[]{titleTextAttrPane,null}, + new Component[]{null, null}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content")), titleContent}, + new Component[]{null, titleUseHtml}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout_Position")), titleAlignPane}, + new Component[]{titleTextAttrPane, null}, new Component[]{ FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TextRotation")), UIComponentUtils.wrapWithBorderLayoutPane(titleTextRotation) }, }; + titlePane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_TITLE_TITLE, panel); + JPanel showTitlePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Title"), showTitle); + showTitle.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + checkTitlePane(); + } + }); + + JPanel jPanel = new JPanel(new BorderLayout()); + jPanel.add(showTitlePane, BorderLayout.NORTH); + jPanel.add(titlePane, BorderLayout.CENTER); + + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_TITLE_TITLE, jPanel); } - private UIButtonGroup getXAxisTitleAlignPane(){ + private UIButtonGroup getXAxisTitleAlignPane() { Icon[] alignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png")}; @@ -171,7 +187,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { return new UIButtonGroup(alignmentIconArray, alignment); } - private UIButtonGroup getYAxisTitleAlignPane(){ + + private UIButtonGroup getYAxisTitleAlignPane() { Icon[] alignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_top_normal.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_center_normal.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_down_normal.png")}; @@ -180,7 +197,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { return new UIButtonGroup(alignmentIconArray, alignment); } - protected JPanel createLabelPane(double[] row, double[] col){ + protected JPanel createLabelPane(double[] row, double[] col) { showLabel = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Show"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hidden")}); labelTextAttrPane = getChartTextAttrPane(); @@ -205,9 +222,9 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { new Component[]{gapPanel, null}, }; - JPanel showLabelPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Label"),showLabel); + JPanel showLabelPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Label"), showLabel); labelPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); - labelPanel.setBorder(BorderFactory.createEmptyBorder(0,10,0,0)); + labelPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); showLabel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -308,11 +325,11 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } - protected ChartTextAttrPane getChartTextAttrPane(){ - return new ChartTextAttrPane(){ + protected ChartTextAttrPane getChartTextAttrPane() { + return new ChartTextAttrPane() { @Override - protected JPanel getContentPane (JPanel buttonPane) { + protected JPanel getContentPane(JPanel buttonPane) { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; @@ -324,10 +341,10 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { }; } - protected JPanel createLineStylePane(double[] row, double[] col){ + protected JPanel createLineStylePane(double[] row, double[] col) { axisLineStyle = createLineComboBox(); axisLineColor = new ColorSelectBox(100); - String[] strings = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")}; + String[] strings = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")}; AxisTickLineType[] values = new AxisTickLineType[]{AxisTickLineType.TICK_LINE_OUTSIDE, AxisTickLineType.TICK_LINE_NONE}; mainTick = new UIButtonGroup(strings, values); secondTick = new UIButtonGroup(strings, values); @@ -342,15 +359,15 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { protected Component[][] getLineStylePaneComponents() { return new Component[][]{ - new Component[]{null,null} , - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Type")),axisLineStyle} , - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")),axisLineColor}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Main_Graduation_Line")),mainTick}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Second_Graduation_Line")),secondTick}, + new Component[]{null, null}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Type")), axisLineStyle}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")), axisLineColor}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Main_Graduation_Line")), mainTick}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Second_Graduation_Line")), secondTick}, }; } - protected JPanel createAxisPositionPane(double[] row, double[] col, boolean isXAxis){ + protected JPanel createAxisPositionPane(double[] row, double[] col, boolean isXAxis) { position = new UIButtonGroup(getAxisPositionNameArray(isXAxis), getAxisPositionValueArray(isXAxis)); reversed = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_On"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false}); Component[][] components = new Component[][]{ @@ -359,30 +376,30 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Position")), UIComponentUtils.wrapWithBorderLayoutPane(position) }, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_AxisReversed")),reversed}, - } ; + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_AxisReversed")), reversed}, + }; JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), panel); } - private String[] getAxisPositionNameArray(boolean isXAxis){ - if(isXAxis){ + private String[] getAxisPositionNameArray(boolean isXAxis) { + if (isXAxis) { return new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Top"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Bottom"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Vertical_Zero")}; } else { return new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout_Left"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout_Right"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Vertical_Zero")}; } } - private Integer[] getAxisPositionValueArray(boolean isXAxis){ - if(isXAxis){ + private Integer[] getAxisPositionValueArray(boolean isXAxis) { + if (isXAxis) { return new Integer[]{VanChartConstants.AXIS_TOP, VanChartConstants.AXIS_BOTTOM, VanChartConstants.AXIS_VERTICAL_ZERO}; } else { return new Integer[]{VanChartConstants.AXIS_LEFT, VanChartConstants.AXIS_RIGHT, VanChartConstants.AXIS_VERTICAL_ZERO}; } } - protected JPanel createDisplayStrategy(){ + protected JPanel createDisplayStrategy() { //区域显示策略 恢复用注释。删除到return,即除了注释的代码都删除。 maxProportion = new UISpinner(0, 100, 1, 30); axisLimitSize = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Limit"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Not_Limit")}); @@ -408,7 +425,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { // return limitPane; } - protected JPanel createValueStylePane(){ + protected JPanel createValueStylePane() { valueFormatStyle = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Common"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")}); @@ -418,19 +435,19 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { htmlLabelPane = new VanChartHtmlLabelPane(); centerPane = new JPanel(new CardLayout()); - centerPane.add(valueFormat,com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Common")); + centerPane.add(valueFormat, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Common")); centerPane.add(htmlLabelPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] columnSize = {p,f}; - double[] rowSize = {p,p,p}; + double[] columnSize = {p, f}; + double[] rowSize = {p, p, p}; Component[][] components = new Component[][]{ - new Component[]{null,null}, + new Component[]{null, null}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Format"), SwingConstants.LEFT), valueFormatStyle}, new Component[]{null, centerPane}, }; - JPanel contentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize); + JPanel contentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); valueFormatStyle.addActionListener(new ActionListener() { @@ -443,12 +460,12 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Format"), contentPane); } - protected FormatPane createFormatPane(){ - return new FormatPane(){ - protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane) { + protected FormatPane createFormatPane() { + return new FormatPane() { + protected Component[][] getComponent(JPanel fontPane, JPanel centerPane, JPanel typePane) { typePane.setBorder(BorderFactory.createEmptyBorder()); return new Component[][]{ - new Component[]{typePane,null}, + new Component[]{typePane, null}, new Component[]{centerPane, null}, }; } @@ -462,6 +479,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { protected void checkAllUse() { checkCardPane(); checkLabelPane(); + checkTitlePane(); //区域显示策略 恢复用注释。删除下面一行。 checkMaxProPortionUse(); @@ -480,10 +498,10 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } protected void checkCardPane() { - if(centerPane != null && valueFormatStyle != null){ + if (centerPane != null && valueFormatStyle != null) { CardLayout cardLayout = (CardLayout) centerPane.getLayout(); if (valueFormatStyle.getSelectedIndex() == 1) { - cardLayout.show(centerPane,com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")); + cardLayout.show(centerPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")); } else { cardLayout.show(centerPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Common")); } @@ -491,12 +509,12 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } protected void checkLabelPane() { - if(showLabel != null){ + if (showLabel != null) { boolean enabled = showLabel.getSelectedIndex() == 0; - if(labelPanel != null){ + if (labelPanel != null) { labelPanel.setVisible(enabled); } - if(enabled){ + if (enabled) { //轴标签缩略间隔显示 恢复用注释。下面1行删除。 checkLabelGapValuePane(); //轴标签缩略间隔显示 恢复用注释。取消注释。 @@ -505,6 +523,15 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } } + protected void checkTitlePane() { + if (showTitle != null) { + boolean enabled = showTitle.getSelectedIndex() == 0; + if (titlePane != null) { + titlePane.setVisible(enabled); + } + } + } + private void checkLabelGapAndStylePane() { if (overlapHandleTypeGroup != null && labelGapStylePane != null) { boolean visible = overlapHandleTypeGroup.getSelectedItem() == OverlapHandleType.INTERVAL; @@ -528,28 +555,31 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { /** * 是否是指定类型 + * * @param ob 对象 * @return 是否是指定类型 */ - public boolean accept(Object ob){ + public boolean accept(Object ob) { return false; } /** * title应该是一个属性,不只是对话框的标题时用到,与其他组件结合时,也会用得到 + * * @return 绥化狂标题 */ @Override - public String title4PopupWindow(){ + public String title4PopupWindow() { return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Category_Axis"); } /** * 重置 */ - public void reset(){ + public void reset() { } + @Override public void populateBean(VanChartAxis axis) { populateTitle(axis); @@ -568,50 +598,53 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } //标题 - private void populateTitle(VanChartAxis axis){ + private void populateTitle(VanChartAxis axis) { + if (showTitle != null) { + showTitle.setSelectedIndex(axis.isShowAxisTitle() ? 0 : 1); + } Title axisTitle = axis.getTitle(); - if(axisTitle != null){ + if (axisTitle != null) { if (axisTitle.getTextObject() instanceof BaseFormula && titleContent != null) { titleContent.populateBean(((BaseFormula) axisTitle.getTextObject()).getContent()); - } else if(titleContent != null){ + } else if (titleContent != null) { titleContent.populateBean(Utils.objectToString(axisTitle.getTextObject())); } - if(titleAlignPane != null){ + if (titleAlignPane != null) { titleAlignPane.setSelectedItem(axisTitle.getPosition()); } - if(titleTextAttrPane != null){ + if (titleTextAttrPane != null) { titleTextAttrPane.populate(axisTitle.getTextAttr()); } - if(titleUseHtml != null){ + if (titleUseHtml != null) { titleUseHtml.setSelected(axis.isTitleUseHtml()); } - if(titleTextRotation != null){ - titleTextRotation.populateBean((double)axisTitle.getTextAttr().getRotation()); + if (titleTextRotation != null) { + titleTextRotation.populateBean((double) axisTitle.getTextAttr().getRotation()); } } } //标签 - private void populateLabel(VanChartAxis axis){ - if(showLabel != null){ + private void populateLabel(VanChartAxis axis) { + if (showLabel != null) { showLabel.setSelectedIndex(axis.isShowAxisLabel() ? 0 : 1); } TextAttr labelTextAttr = axis.getTextAttr(); - if(labelTextAttrPane != null){ + if (labelTextAttrPane != null) { labelTextAttrPane.populate(labelTextAttr); } - if(labelTextRotation != null){ - labelTextRotation.populateBean((double)labelTextAttr.getRotation()); + if (labelTextRotation != null) { + labelTextRotation.populateBean((double) labelTextAttr.getRotation()); } //轴标签缩略间隔显示 恢复用注释。取消注释。 // if (overlapHandleTypeGroup != null) { // overlapHandleTypeGroup.setSelectedItem(axis.getOverlapHandleType()); // } - if(labelGapStyle != null){ + if (labelGapStyle != null) { labelGapStyle.setSelectedIndex(axis.isAutoLabelGap() ? 0 : 1); } - if(labelGapValue != null){ + if (labelGapValue != null) { //轴标签缩略间隔显示 恢复用注释。下面1行删除。 labelGapValue.setText(axis.getLabelNumber().getContent()); //轴标签缩略间隔显示 恢复用注释。取消注释。 @@ -620,30 +653,30 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } //轴线样式 - private void populateLineStyle(VanChartAxis axis){ - if(axisLineStyle != null){ + private void populateLineStyle(VanChartAxis axis) { + if (axisLineStyle != null) { axisLineStyle.setSelectedLineStyle(axis.getAxisStyle()); } - if(axisLineColor != null){ + if (axisLineColor != null) { axisLineColor.setSelectObject(axis.getAxisColor()); } - if(mainTick != null){ + if (mainTick != null) { mainTick.setSelectedItem(axis.getMainTickLine()); } - if(secondTick != null){ + if (secondTick != null) { secondTick.setSelectedItem(axis.getSecTickLine()); } } //位置 - private void populatePosition(VanChartAxis axis){ - if(position != null){ + private void populatePosition(VanChartAxis axis) { + if (position != null) { position.setSelectedItem(axis.getPosition()); - if(position.getSelectedItem() == null){ + if (position.getSelectedItem() == null) { position.setSelectedIndex(1); } } - if(reversed != null){ + if (reversed != null) { reversed.setSelectedIndex(axis.hasAxisReversed() == true ? 0 : 1); } } @@ -666,13 +699,13 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { //格式 protected void populateFormat(VanChartAxis axis) { - if(valueFormatStyle != null){ + if (valueFormatStyle != null) { valueFormatStyle.setSelectedIndex(axis.isCommonValueFormat() ? 0 : 1); } - if(valueFormat != null){ + if (valueFormat != null) { valueFormat.populateBean(axis.getFormat()); } - if(htmlLabelPane != null){ + if (htmlLabelPane != null) { htmlLabelPane.populate(axis.getHtmlLabel()); } } @@ -690,15 +723,19 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { updateFormat(axis); } + //标题 - private void updateTitle(VanChartAxis axis){ + private void updateTitle(VanChartAxis axis) { + if (showTitle != null) { + axis.setShowAxisTitle(showTitle.getSelectedIndex() == 0); + } Title axisTitle = axis.getTitle(); - if(axisTitle == null){ + if (axisTitle == null) { axisTitle = new Title(); axis.setTitle(axisTitle); } - if(titleContent != null){ + if (titleContent != null) { String titleString = titleContent.updateBean(); Object titleObj; if (StableUtils.maybeFormula(titleString)) { @@ -708,42 +745,42 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } axisTitle.setTextObject(titleObj); } - if(titleAlignPane != null){ + if (titleAlignPane != null) { axisTitle.setPosition(titleAlignPane.getSelectedItem()); } TextAttr textAttr = axisTitle.getTextAttr(); - if(titleTextAttrPane != null){ + if (titleTextAttrPane != null) { titleTextAttrPane.update(textAttr); } - if(titleUseHtml != null){ + if (titleUseHtml != null) { axis.setTitleUseHtml(titleUseHtml.isSelected()); } - if(titleTextRotation != null){ + if (titleTextRotation != null) { textAttr.setRotation(titleTextRotation.updateBean().intValue()); } } //标签 - private void updateLabel(VanChartAxis axis){ - if(showLabel != null){ + private void updateLabel(VanChartAxis axis) { + if (showLabel != null) { axis.setShowAxisLabel(showLabel.getSelectedIndex() == 0); } TextAttr labelTextAttr = axis.getTextAttr(); - if(labelTextAttrPane != null){ + if (labelTextAttrPane != null) { labelTextAttrPane.update(labelTextAttr); } - if(labelTextRotation != null){ + if (labelTextRotation != null) { labelTextAttr.setRotation(labelTextRotation.updateBean().intValue()); } //轴标签缩略间隔显示 恢复用注释。取消注释。 // if (overlapHandleTypeGroup != null) { // axis.setOverlapHandleType(overlapHandleTypeGroup.getSelectedItem()); // } - if(labelGapStyle != null){ + if (labelGapStyle != null) { axis.setAutoLabelGap(labelGapStyle.getSelectedIndex() == 0); } - if(labelGapValue != null){ + if (labelGapValue != null) { //轴标签缩略间隔显示 恢复用注释。下面5行删除。 if (axis.isAutoLabelGap()) { axis.setLabelIntervalNumber(BaseFormula.createFormulaBuilder().build("1")); @@ -756,33 +793,33 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } //轴线样式 - private void updateLineStyle(VanChartAxis axis){ - if(axisLineStyle != null){ + private void updateLineStyle(VanChartAxis axis) { + if (axisLineStyle != null) { axis.setAxisStyle(axisLineStyle.getSelectedLineStyle()); } - if(axisLineColor != null){ + if (axisLineColor != null) { axis.setAxisColor(axisLineColor.getSelectObject()); } - if(mainTick != null){ + if (mainTick != null) { axis.setMainTickLine(mainTick.getSelectedItem()); } - if(secondTick != null){ + if (secondTick != null) { axis.setSecTickLine(secondTick.getSelectedItem()); } } //位置 - private void updatePosition(VanChartAxis axis){ - if(position != null){ + private void updatePosition(VanChartAxis axis) { + if (position != null) { axis.setPosition(position.getSelectedItem()); } - if(reversed != null){ + if (reversed != null) { axis.setAxisReversed(reversed.getSelectedItem()); } } //显示策略 - private void updateDisplayStrategy(VanChartAxis axis){ + private void updateDisplayStrategy(VanChartAxis axis) { //区域显示策略 恢复用注释。下面6行删除。 if (axisLimitSize != null) { axis.setLimitSize(axisLimitSize.getSelectedIndex() == 0); @@ -797,29 +834,30 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } protected void updateFormat(VanChartAxis axis) { - if(valueFormatStyle != null){ + if (valueFormatStyle != null) { axis.setCommonValueFormat(valueFormatStyle.getSelectedIndex() == 0); } - if(valueFormat != null){ + if (valueFormat != null) { axis.setFormat(valueFormat.update()); } - if(htmlLabelPane != null){ + if (htmlLabelPane != null) { htmlLabelPane.update(axis.getHtmlLabel()); } } /** * X坐标轴不同类型切换,new一个新的 + * * @param axisName 坐标轴名称 * @return 新的axis */ - public VanChartAxis updateBean(String axisName, int position){ + public VanChartAxis updateBean(String axisName, int position) { VanChartAxis axis = new VanChartAxis(axisName, position); this.updateBean(axis); return axis; } - public VanChartAxis updateBean(){ + public VanChartAxis updateBean() { return null; } } From 7b66e7b244cb2484e222bafc7a6f0e6842993e7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 7 Jul 2020 17:10:23 +0800 Subject: [PATCH 17/21] =?UTF-8?q?CHART-14180=20=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/designer/style/axis/VanChartBaseAxisPane.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java index d96b1e40f..fcc34958e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java @@ -524,11 +524,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } protected void checkTitlePane() { - if (showTitle != null) { - boolean enabled = showTitle.getSelectedIndex() == 0; - if (titlePane != null) { - titlePane.setVisible(enabled); - } + if (showTitle != null && titlePane != null) { + titlePane.setVisible(showTitle.getSelectedIndex() == 0); } } From b90617919fe53e3ad11e2b5d9593ce33cbade421 Mon Sep 17 00:00:00 2001 From: "Hugh.C" Date: Tue, 7 Jul 2020 17:59:26 +0800 Subject: [PATCH 18/21] =?UTF-8?q?REPORT-34954=20=E5=AF=8C=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E4=B8=8A=E6=A0=87=E4=B8=8B=E6=A0=87=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E5=90=8C=E6=97=B6=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/cell/editor/RichTextToolBar.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java index 52a33ff12..4541ac3ba 100644 --- a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java +++ b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java @@ -256,8 +256,11 @@ public class RichTextToolBar extends BasicPane{ @Override public void actionPerformed(ActionEvent e) { boolean isSub = RichTextToolBar.this.subPane.isSelected(); - // 调用setCharacterAttributes函数设置文本区选择文本的字体 MutableAttributeSet attr = new SimpleAttributeSet(); + if (!isSub && RichTextToolBar.this.superPane.isSelected()) { + StyleConstants.setSuperscript(attr, false); + } + // 调用setCharacterAttributes函数设置文本区选择文本的字体 StyleConstants.setSubscript(attr, !isSub); setCharacterAttributes(RichTextToolBar.this.textPane, attr, false); } @@ -269,6 +272,9 @@ public class RichTextToolBar extends BasicPane{ boolean isSuper = RichTextToolBar.this.superPane.isSelected(); // 调用setCharacterAttributes函数设置文本区选择文本的字体 MutableAttributeSet attr = new SimpleAttributeSet(); + if (!isSuper && RichTextToolBar.this.subPane.isSelected()) { + StyleConstants.setSubscript(attr, false); + } StyleConstants.setSuperscript(attr, !isSuper); setCharacterAttributes(RichTextToolBar.this.textPane, attr, false); } From b4bb3235df0fa7eb37c4284d0575b26e188ca83f Mon Sep 17 00:00:00 2001 From: "Hugh.C" Date: Wed, 8 Jul 2020 09:30:41 +0800 Subject: [PATCH 19/21] =?UTF-8?q?REPORT-34954=20=E5=AF=8C=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E4=B8=8A=E6=A0=87=E4=B8=8B=E6=A0=87=E4=B8=8D=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E5=8F=AF=E4=BB=A5=E5=90=8C=E6=97=B6=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/cell/editor/RichTextToolBar.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java index 4541ac3ba..b3a78d34d 100644 --- a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java +++ b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java @@ -408,7 +408,7 @@ public class RichTextToolBar extends BasicPane{ bold.setSelected(isBold); italic.setSelected(isItalic); underline.setSelected(isUnderline); - subPane.setSelected(isSubscript); + subPane.setSelected(isSuperscript ? false : isSubscript); superPane.setSelected(isSuperscript); //为什么字体名称, 大小, 颜色, 不需要去判断是否全相同呢 //因为如果全相同, 则设置为第一个字符的样式, 如果不全相同, 那么默认也设置成第一个字符的样式. From b44b3b3585b74b9dc808362fc36def3e686eea5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 8 Jul 2020 10:02:56 +0800 Subject: [PATCH 20/21] =?UTF-8?q?CHART-14346=20=E6=82=AC=E6=B5=AE=E7=AA=97?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E7=BB=84=E5=90=88=E5=9B=BE=E4=B8=8D=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E9=80=89=E6=8B=A9=E5=8D=95=E5=85=83=E6=A0=BC=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...VanChartCustomPlotDataContentsTabPane.java | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java index 6dbe9577c..184bc2b11 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java @@ -34,13 +34,15 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab } public void setSupportCellData(boolean supportCellData) { - this.supportCellData = supportCellData; + for (JPanel jPanel : paneList) { + ((VanChartDataPane) jPanel).setSupportCellData(supportCellData); + } } @Override protected void initTabTitle() { - if (plot == null){ + if (plot == null) { return; } @@ -60,7 +62,7 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab @Override protected List initPaneList() { - if (plot == null){ + if (plot == null) { return null; } @@ -68,10 +70,9 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab List customPlotList = plot.getCustomPlotList(); - for (int i = 0; i < customPlotList.size(); i++){ + for (int i = 0; i < customPlotList.size(); i++) { //根据不同的plot创建不同的数据配置界面 ChartDataPane contentPane = new VanChartDataPane(listener); - contentPane.setSupportCellData(supportCellData); paneList.add(contentPane); } @@ -79,15 +80,15 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab } @Override - public void populateBean(ChartCollection chartCollection){ + public void populateBean(ChartCollection chartCollection) { plot = (VanChartCustomPlot) chartCollection.getSelectedChart().getPlot(); - if (paneList == null){ + if (paneList == null) { paneList = initPaneList(); } - if (paneList != null){ + if (paneList != null) { try { @@ -105,14 +106,14 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab TopDefinitionProvider definition = chartCollection.getSelectedChart().getFilterDefinition(); TopDefinitionProvider dataDefinition = null; if (definition != null && definition instanceof CustomDefinition) { - Map definitionProviderMap = ((CustomDefinition)definition).getDefinitionProviderMap(); + Map definitionProviderMap = ((CustomDefinition) definition).getDefinitionProviderMap(); dataDefinition = definitionProviderMap.get(CustomPlotFactory.getCustomType(customPlotList.get(i))); } cloneCollection.getSelectedChart().setFilterDefinition(dataDefinition); ((ChartDataPane) paneList.get(i)).populate(cloneCollection); } - }catch (Exception e){ + } catch (Exception e) { return; } } @@ -124,8 +125,8 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab } @Override - public void updateBean(ChartCollection collection){ - if (paneList == null || plot == null){ + public void updateBean(ChartCollection collection) { + if (paneList == null || plot == null) { return; } try { @@ -158,7 +159,7 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab customDefinition.setDefinitionProviderMap(definitionMap); collection.getSelectedChart().setFilterDefinition(customDefinition); - }catch (Exception e){ + } catch (Exception e) { return; } } @@ -180,10 +181,11 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab /** * 返回绑定的属性事件. - * @param listener 增加监听 + * + * @param listener 增加监听 */ public void addAttributeChangeListener(AttributeChangeListener listener) { - for (int i = 0; i < paneList.size(); i++){ + for (int i = 0; i < paneList.size(); i++) { ((ChartDataPane) paneList.get(i)).addAttributeChangeListener(listener); } } From 40fb79cbf4d81faa9b93ed53b8a623571264d303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 8 Jul 2020 11:43:06 +0800 Subject: [PATCH 21/21] CHART-14346 --- ...VanChartCustomPlotDataContentsTabPane.java | 51 +++++++++---------- 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java index 184bc2b11..6d7d24bf9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java @@ -23,7 +23,7 @@ import java.util.Map; */ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTabPane { - private boolean supportCellData = true; + private boolean supportCellData; public VanChartCustomPlotDataContentsTabPane(VanChartCustomPlot plot, VanChartCustomDataPane parent, AttributeChangeListener listener) { super(plot, parent, listener); @@ -34,9 +34,7 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab } public void setSupportCellData(boolean supportCellData) { - for (JPanel jPanel : paneList) { - ((VanChartDataPane) jPanel).setSupportCellData(supportCellData); - } + this.supportCellData = supportCellData; } @Override @@ -73,6 +71,7 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab for (int i = 0; i < customPlotList.size(); i++) { //根据不同的plot创建不同的数据配置界面 ChartDataPane contentPane = new VanChartDataPane(listener); + contentPane.setSupportCellData(supportCellData); paneList.add(contentPane); } @@ -84,38 +83,34 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab plot = (VanChartCustomPlot) chartCollection.getSelectedChart().getPlot(); - if (paneList == null) { - paneList = initPaneList(); - } - - if (paneList != null) { - - try { + paneList = initPaneList(); - List customPlotList = plot.getCustomPlotList(); + relayoutWhenListChange(); + try { + List customPlotList = plot.getCustomPlotList(); - for (int i = 0; i < paneList.size() && i < customPlotList.size(); i++) { - //將plot包裝起来,主要是为了获取dataDefinition - ChartCollection cloneCollection = (ChartCollection) chartCollection.clone(); - //设置collection的plot - cloneCollection.getSelectedChart().setPlot(customPlotList.get(i)); + for (int i = 0; i < paneList.size() && i < customPlotList.size(); i++) { + //將plot包裝起来,主要是为了获取dataDefinition + ChartCollection cloneCollection = (ChartCollection) chartCollection.clone(); - //获取definitionMap中的dataDefinition - TopDefinitionProvider definition = chartCollection.getSelectedChart().getFilterDefinition(); - TopDefinitionProvider dataDefinition = null; - if (definition != null && definition instanceof CustomDefinition) { - Map definitionProviderMap = ((CustomDefinition) definition).getDefinitionProviderMap(); - dataDefinition = definitionProviderMap.get(CustomPlotFactory.getCustomType(customPlotList.get(i))); - } - cloneCollection.getSelectedChart().setFilterDefinition(dataDefinition); + //设置collection的plot + cloneCollection.getSelectedChart().setPlot(customPlotList.get(i)); - ((ChartDataPane) paneList.get(i)).populate(cloneCollection); + //获取definitionMap中的dataDefinition + TopDefinitionProvider definition = chartCollection.getSelectedChart().getFilterDefinition(); + TopDefinitionProvider dataDefinition = null; + if (definition != null && definition instanceof CustomDefinition) { + Map definitionProviderMap = ((CustomDefinition) definition).getDefinitionProviderMap(); + dataDefinition = definitionProviderMap.get(CustomPlotFactory.getCustomType(customPlotList.get(i))); } - } catch (Exception e) { - return; + cloneCollection.getSelectedChart().setFilterDefinition(dataDefinition); + + ((ChartDataPane) paneList.get(i)).populate(cloneCollection); } + } catch (Exception e) { + return; } }