From 7997b8f973c0f31d18b3fef8c3d475e980e8008f Mon Sep 17 00:00:00 2001 From: Harrison Date: Mon, 6 Jul 2020 16:46:28 +0800 Subject: [PATCH 001/267] =?UTF-8?q?KERNEL-3999=2010.0.7=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=8F=AF=E4=BD=BF=E7=94=A8JDK11=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/data/comp/MapDataTree.java | 16 +++---- .../mainframe/widget/UITreeComboBox.java | 48 ++++++++++++------- .../java/com/fr/poly/PolyComponentsBar.java | 28 ----------- 3 files changed, 39 insertions(+), 53 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/MapDataTree.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/MapDataTree.java index 825634547f..5a223cbf0c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/MapDataTree.java +++ b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/MapDataTree.java @@ -45,9 +45,9 @@ public class MapDataTree extends JTree { public void selectDefaultTreeNode() { DefaultTreeModel m_model = (DefaultTreeModel) this.getModel(); DefaultMutableTreeNode root = (DefaultMutableTreeNode) m_model.getRoot(); - Enumeration children = root.children(); + Enumeration children = root.children(); if (children.hasMoreElements()) { - DefaultMutableTreeNode child = children.nextElement(); + DefaultMutableTreeNode child = (DefaultMutableTreeNode) children.nextElement(); if(GEOJSONTreeHelper.getInstance().isSelectableTreeNode(child)){ selectTreeNode(child, m_model); @@ -59,9 +59,9 @@ public class MapDataTree extends JTree { } private void setFirstChildTreeNode(DefaultMutableTreeNode parent, DefaultTreeModel m_model){ - Enumeration children = parent.children(); + Enumeration children = parent.children(); if (children.hasMoreElements()){ - DefaultMutableTreeNode node = children.nextElement(); + DefaultMutableTreeNode node = (DefaultMutableTreeNode) children.nextElement(); selectTreeNode(node, m_model); } } @@ -89,9 +89,9 @@ public class MapDataTree extends JTree { DefaultTreeModel m_model = (DefaultTreeModel) this.getModel(); DefaultMutableTreeNode root = (DefaultMutableTreeNode) m_model.getRoot(); - Enumeration els = root.postorderEnumeration(); + Enumeration els = root.postorderEnumeration(); while(els.hasMoreElements()){ - DefaultMutableTreeNode el = els.nextElement(); + DefaultMutableTreeNode el = (DefaultMutableTreeNode) els.nextElement(); if(el == null || el.getUserObject() == null){ return null; } @@ -145,10 +145,10 @@ public class MapDataTree extends JTree { DefaultTreeModel m_model = (DefaultTreeModel) this.getModel(); DefaultMutableTreeNode root = (DefaultMutableTreeNode) m_model.getRoot(); - Enumeration els = root.postorderEnumeration(); + Enumeration els = root.postorderEnumeration(); while(els.hasMoreElements()){ - DefaultMutableTreeNode el = els.nextElement(); + DefaultMutableTreeNode el = (DefaultMutableTreeNode) els.nextElement(); String path = el.getUserObject().toString(); String fileName = ChartGEOJSONHelper.getPresentNameWithPath(path); if (StringUtils.contains(fileName, text) && GEOJSONTreeHelper.isValidDirPath(path)) { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/UITreeComboBox.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/UITreeComboBox.java index 4a59484e1d..aab50fbcc3 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/UITreeComboBox.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/UITreeComboBox.java @@ -3,16 +3,8 @@ package com.fr.design.mainframe.widget; /** * Created by xiaxiang on 2016/9/30. */ -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; -import javax.swing.plaf.*; -import javax.swing.plaf.basic.*; -import javax.swing.plaf.metal.*; -import javax.swing.tree.*; - import com.fr.design.constants.UIConstants; -import com.fr.design.designer.beans.*; +import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.events.DesignerEditListener; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.XCreator; @@ -20,8 +12,36 @@ import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBoxUI; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.mainframe.ComponentTree; -import com.sun.java.swing.plaf.motif.*; -import com.sun.java.swing.plaf.windows.*; +import com.sun.java.swing.plaf.motif.MotifComboBoxUI; + +import javax.swing.DefaultListCellRenderer; +import javax.swing.JComboBox; +import javax.swing.JComponent; +import javax.swing.JLabel; +import javax.swing.JList; +import javax.swing.JPopupMenu; +import javax.swing.JScrollPane; +import javax.swing.JTree; +import javax.swing.ListCellRenderer; +import javax.swing.MenuSelectionManager; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.plaf.ComboBoxUI; +import javax.swing.plaf.basic.ComboPopup; +import javax.swing.plaf.metal.MetalComboBoxUI; +import javax.swing.tree.TreeCellRenderer; +import javax.swing.tree.TreePath; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Rectangle; +import java.awt.event.KeyListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionAdapter; +import java.awt.event.MouseMotionListener; /** * 控件树下拉列表框 @@ -111,12 +131,6 @@ public class UITreeComboBox extends UIComboBox { } } - class WindowsJTreeComboBoxUI extends WindowsComboBoxUI{ - protected ComboPopup createPopup() { - return new TreePopup(comboBox); - } - } - class UIJTreeComboBoxUI extends UIComboBoxUI { protected ComboPopup createPopup() { return new TreePopup(comboBox); diff --git a/designer-realize/src/main/java/com/fr/poly/PolyComponentsBar.java b/designer-realize/src/main/java/com/fr/poly/PolyComponentsBar.java index d1c7ddd406..e443909f20 100644 --- a/designer-realize/src/main/java/com/fr/poly/PolyComponentsBar.java +++ b/designer-realize/src/main/java/com/fr/poly/PolyComponentsBar.java @@ -12,19 +12,12 @@ import com.fr.design.gui.itooltip.MultiLineToolTip; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.dnd.SerializableTransferable; -import com.fr.log.FineLoggerFactory; import com.fr.report.poly.PolyECBlock; -import com.sun.java.swing.plaf.windows.WindowsLookAndFeel; import javax.swing.BorderFactory; -import javax.swing.JFrame; -import javax.swing.JPanel; import javax.swing.JToolBar; import javax.swing.JToolTip; import javax.swing.SwingConstants; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.datatransfer.Transferable; import java.awt.dnd.DnDConstants; @@ -147,25 +140,4 @@ public class PolyComponentsBar extends JToolBar { } } - /** - * 测试下 - * - * @param args 参数 - */ - public static void main(String... args) { - try { - UIManager.setLookAndFeel(new WindowsLookAndFeel()); - } catch (UnsupportedLookAndFeelException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - JFrame f = new JFrame(); - JPanel p = (JPanel) f.getContentPane(); - p.setLayout(FRGUIPaneFactory.createBorderLayout()); - PolyComponentsBar pbp = new PolyComponentsBar(); - p.add(pbp, BorderLayout.CENTER); - - f.setSize(400, 300); - f.setVisible(true); - - } } From 0eb1ea021172a38e93d4af145b95c7ed358369c2 Mon Sep 17 00:00:00 2001 From: Yyming Date: Tue, 4 Aug 2020 18:11:27 +0800 Subject: [PATCH 002/267] =?UTF-8?q?REPORT-36624=20=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=8E=A7=E4=BB=B6=E5=9C=A8=E5=8F=82=E6=95=B0=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E7=9A=84=E5=8F=AF=E8=A7=81=E5=8F=AF=E7=94=A8=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=BF=9D=E5=AD=98=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/start/BaseDesigner.java | 18 +++++------------- .../design/designer/creator/XNameWidget.java | 8 +++++--- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/designer-base/src/main/java/com/fr/start/BaseDesigner.java b/designer-base/src/main/java/com/fr/start/BaseDesigner.java index 1469dd32ec..4671e66b4b 100644 --- a/designer-base/src/main/java/com/fr/start/BaseDesigner.java +++ b/designer-base/src/main/java/com/fr/start/BaseDesigner.java @@ -64,14 +64,11 @@ public abstract class BaseDesigner extends ToolBarMenuDock { @Override public void on(Event event, Null param) { EventDispatcher.stopListen(this); - UIUtil.invokeLaterIfNeeded(new Runnable() { - @Override - public void run() { + UIUtil.invokeLaterIfNeeded(() -> { - // 打开上次的文件 - showDesignerFrame(false); - DesignerLaunchStatus.setStatus(DesignerLaunchStatus.OPEN_LAST_FILE_COMPLETE); - } + // 打开上次的文件 + showDesignerFrame(false); + DesignerLaunchStatus.setStatus(DesignerLaunchStatus.OPEN_LAST_FILE_COMPLETE); }); } }); @@ -90,12 +87,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock { } public void show() { - UIUtil.invokeLaterIfNeeded(new Runnable() { - @Override - public void run() { - refreshTemplateTree(); - } - }); + UIUtil.invokeLaterIfNeeded(() -> refreshTemplateTree()); } private void refreshTemplateTree() { diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XNameWidget.java b/designer-form/src/main/java/com/fr/design/designer/creator/XNameWidget.java index 2671017878..e669eab6c3 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XNameWidget.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XNameWidget.java @@ -68,9 +68,11 @@ public class XNameWidget extends XWidgetCreator { Widget widget; if (wc != null && (widget= wc.toWidget()) != null) { editor = XCreatorUtils.createXCreator(widget); - Widget currentWidget = toData(); - currentWidget.setVisible(widget.isVisible()); - currentWidget.setEnabled(widget.isEnabled()); + NameWidget currentWidget = toData(); + if (currentWidget.isNeedDefaultAttr()) { + currentWidget.setVisible(widget.isVisible()); + currentWidget.setEnabled(widget.isEnabled()); + } this.setBorder(null); } else { this.setBorder(DEFALUTBORDER); From 49c2630bfb9a251cbf4722b1e900cb7b8aa9bcfc Mon Sep 17 00:00:00 2001 From: Yyming Date: Wed, 5 Aug 2020 14:09:29 +0800 Subject: [PATCH 003/267] =?UTF-8?q?REPORT-36624=20=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-base/src/main/java/com/fr/start/BaseDesigner.java | 2 +- .../java/com/fr/design/designer/creator/XNameWidget.java | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/start/BaseDesigner.java b/designer-base/src/main/java/com/fr/start/BaseDesigner.java index 4671e66b4b..7808bd7ecd 100644 --- a/designer-base/src/main/java/com/fr/start/BaseDesigner.java +++ b/designer-base/src/main/java/com/fr/start/BaseDesigner.java @@ -87,7 +87,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock { } public void show() { - UIUtil.invokeLaterIfNeeded(() -> refreshTemplateTree()); + UIUtil.invokeLaterIfNeeded(this::refreshTemplateTree); } private void refreshTemplateTree() { diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XNameWidget.java b/designer-form/src/main/java/com/fr/design/designer/creator/XNameWidget.java index e669eab6c3..0f78c5739d 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XNameWidget.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XNameWidget.java @@ -68,11 +68,6 @@ public class XNameWidget extends XWidgetCreator { Widget widget; if (wc != null && (widget= wc.toWidget()) != null) { editor = XCreatorUtils.createXCreator(widget); - NameWidget currentWidget = toData(); - if (currentWidget.isNeedDefaultAttr()) { - currentWidget.setVisible(widget.isVisible()); - currentWidget.setEnabled(widget.isEnabled()); - } this.setBorder(null); } else { this.setBorder(DEFALUTBORDER); From cc5e5d9587c362d851d7f8a074fe58800838ddbf Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 7 Aug 2020 14:25:56 +0800 Subject: [PATCH 004/267] =?UTF-8?q?REPORT-32317=20cpt=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E6=9D=A1=E7=BC=A9=E6=94=BE=E9=97=AE=E9=A2=98=20=E5=9C=A8?= =?UTF-8?q?=E6=9B=B4=E6=94=B9=E4=BA=86=E7=95=8C=E9=9D=A2=E7=9A=84=E6=AF=94?= =?UTF-8?q?=E4=BE=8B=E5=90=8E=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=9D=A1=E7=9A=84=E5=AE=BD=E5=BA=A6=E7=9A=84?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/mainframe/JWorkBook.java | 11 +++++++++++ .../fr/design/mainframe/ReportComponentComposite.java | 2 ++ 2 files changed, 13 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index b68833f83f..a43623bd72 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -1206,4 +1206,15 @@ public class JWorkBook extends JTemplate { super.whenClose(); reportComposite.doRemoveAction(); } + + /** + * 更新滚动条的值(主要是为了重置滚动条里的BoundedRangeModel的extent值),使滚动条的宽度随着界面缩放而变化 + */ + protected void updateScrollValue() { + ElementCasePane elementCasePane = reportComposite.centerCardPane.editingComponet.elementCasePane; + DynamicScrollBar verticalScrollBar = (DynamicScrollBar) elementCasePane.getVerticalScrollBar(); + DynamicScrollBar horizontalScrollBar = (DynamicScrollBar) elementCasePane.getHorizontalScrollBar(); + verticalScrollBar.setValue(verticalScrollBar.getValue()); + horizontalScrollBar.setValue(horizontalScrollBar.getValue()); + } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java index 0299899a06..6c527e0f86 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java @@ -88,6 +88,8 @@ public class ReportComponentComposite extends JComponent implements RemoveListen value = value < MIN ? MIN : value; int resolution = (int) (ScreenResolution.getScreenResolution() * value / HUND); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setScale(resolution); + //更新滚动条值,使之随着界面缩放 + parent.updateScrollValue(); } }; From 7520a6edefc2ded2145dc754c45ff4b872fa9baa Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 7 Aug 2020 16:38:08 +0800 Subject: [PATCH 005/267] =?UTF-8?q?REPORT-32317=20cpt=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E6=9D=A1=E7=BC=A9=E6=94=BE=E9=97=AE=E9=A2=98=20=E5=9C=A8?= =?UTF-8?q?=E6=9B=B4=E6=94=B9=E4=BA=86=E7=95=8C=E9=9D=A2=E7=9A=84=E6=AF=94?= =?UTF-8?q?=E4=BE=8B=E6=96=B9=E6=B3=95=E4=B8=AD=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=BB=9A=E5=8A=A8=E6=9D=A1=E7=9A=84=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JWorkBook.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index b68833f83f..80c8b2d0b3 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -456,12 +456,17 @@ public class JWorkBook extends JTemplate { grid.setHorizontalExtent(GridUtils.getExtentValue(0, columnWidthList, grid.getWidth(), resolution)); elementCasePane.getGrid().updateUI(); //更新Column和Row - ((DynamicScrollBar) elementCasePane.getVerticalScrollBar()).setDpi(resolution); - ((DynamicScrollBar) elementCasePane.getHorizontalScrollBar()).setDpi(resolution); + DynamicScrollBar verticalScrollBar = (DynamicScrollBar) elementCasePane.getVerticalScrollBar(); + DynamicScrollBar horizontalScrollBar = (DynamicScrollBar) elementCasePane.getHorizontalScrollBar(); + verticalScrollBar.setDpi(resolution); + horizontalScrollBar.setDpi(resolution); elementCasePane.getGridColumn().setResolution(resolution); elementCasePane.getGridColumn().updateUI(); elementCasePane.getGridRow().setResolution(resolution); elementCasePane.getGridRow().updateUI(); + //Yvan:更新滚动条值(主要是为了重置滚动条里的BoundedRangeModel的extent值),使之随着界面缩放 + verticalScrollBar.setValue(verticalScrollBar.getValue()); + horizontalScrollBar.setValue(horizontalScrollBar.getValue()); } if (polyDezi != null) { polyDezi.setResolution(resolution); From 52175cdf485c5f1e961e862c020a5c31a7f6f163 Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 13 Aug 2020 19:29:04 +0800 Subject: [PATCH 006/267] =?UTF-8?q?REPORT-37398=20=E9=9D=9E=E4=B8=AD?= =?UTF-8?q?=E6=96=87=E8=AE=BE=E8=AE=A1=E5=99=A8-=E8=8B=B1=E6=96=87?= =?UTF-8?q?=E4=B8=8B=EF=BC=8C=E6=8A=A5=E8=A1=A8=E5=88=86=E6=A0=8F=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E5=85=A8=20=E4=B8=BB=E8=A6=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=9A=201.=20bug=E5=8E=9F=E5=9B=A0=E6=98=AF?= =?UTF-8?q?=E8=8B=B1=E6=96=87=E7=8E=AF=E5=A2=83=E4=B8=8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86=EF=BC=8C=E6=89=80=E4=BB=A5=E5=85=B6=E4=BB=96=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E7=8E=AF=E5=A2=83=E4=B8=8B=EF=BC=8C=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E7=9A=84=E9=AB=98=E5=BA=A6=E4=B9=9F=E9=9C=80=E8=A6=81=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E5=BE=AE=E8=B0=83=203.=20=E4=BF=AE=E6=94=B9=E4=BA=86?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/JWorkBook.java | 11 --- .../mainframe/ReportComponentComposite.java | 2 - .../fr/design/report/ReportColumnsPane.java | 79 +++++++++++-------- 3 files changed, 47 insertions(+), 45 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index a43623bd72..b68833f83f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -1206,15 +1206,4 @@ public class JWorkBook extends JTemplate { super.whenClose(); reportComposite.doRemoveAction(); } - - /** - * 更新滚动条的值(主要是为了重置滚动条里的BoundedRangeModel的extent值),使滚动条的宽度随着界面缩放而变化 - */ - protected void updateScrollValue() { - ElementCasePane elementCasePane = reportComposite.centerCardPane.editingComponet.elementCasePane; - DynamicScrollBar verticalScrollBar = (DynamicScrollBar) elementCasePane.getVerticalScrollBar(); - DynamicScrollBar horizontalScrollBar = (DynamicScrollBar) elementCasePane.getHorizontalScrollBar(); - verticalScrollBar.setValue(verticalScrollBar.getValue()); - horizontalScrollBar.setValue(horizontalScrollBar.getValue()); - } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java index 6c527e0f86..0299899a06 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java @@ -88,8 +88,6 @@ public class ReportComponentComposite extends JComponent implements RemoveListen value = value < MIN ? MIN : value; int resolution = (int) (ScreenResolution.getScreenResolution() * value / HUND); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setScale(resolution); - //更新滚动条值,使之随着界面缩放 - parent.updateScrollValue(); } }; diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java b/designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java index 4062e0dbe5..3d36ecd06d 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java @@ -14,6 +14,7 @@ import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; +import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.report.stable.WorkSheetAttr; import com.fr.report.worksheet.WorkSheet; @@ -41,6 +42,7 @@ import java.awt.event.ActionListener; public class ReportColumnsPane extends BasicPane{ public static final int ROW = 0; public static final int COLUMN = 1; + private static final String LOCALE_LANGUAGE_EN = "en"; private int rowOrColumn; private boolean isRepeate; @@ -58,7 +60,7 @@ public class ReportColumnsPane extends BasicPane{ com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Columns_Repeat_Row"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Columns_Repeat_Column") }; - + private static final String FONT_NAME = "simsun"; private static final int FONT_SIZE = 14; @@ -87,6 +89,7 @@ public class ReportColumnsPane extends BasicPane{ this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel north = new JPanel(new BorderLayout()) { + @Override public void paint(Graphics g) { super.paint(g); super.paintBorder(g); @@ -122,7 +125,7 @@ public class ReportColumnsPane extends BasicPane{ this.add(north, BorderLayout.NORTH); this.add(createRowColumnPane(), BorderLayout.CENTER); } - + private ActionListener onOffListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -220,7 +223,7 @@ public class ReportColumnsPane extends BasicPane{ sampleLablePane.add(cPane); return sampleLablePane; } - + private ActionListener rowChangeListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -233,7 +236,7 @@ public class ReportColumnsPane extends BasicPane{ } } }; - + private ActionListener colChangeListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -275,7 +278,7 @@ public class ReportColumnsPane extends BasicPane{ RowMaxOrSetPane.add(setRowRadioPane); return RowMaxOrSetPane; } - + private ActionListener toXBtnListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -288,7 +291,7 @@ public class ReportColumnsPane extends BasicPane{ } } }; - + private ActionListener maxBtnListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -310,27 +313,39 @@ public class ReportColumnsPane extends BasicPane{ UITitledBorder explainBorder = UITitledBorder.createBorderWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column_Area")); rowPane.setBorder(explainBorder); rowPane.setLayout(new FlowLayout(FlowLayout.LEFT, 5,13)); - rowPane.setPreferredSize(new Dimension(500,80)); - rowPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column_Data") + ":")); + // Yvan: REPORT-37398 判断设计器语言是否为英文 + if (StringUtils.equals(GeneralContext.getLocale().getLanguage(), LOCALE_LANGUAGE_EN)) { + // 如果是英文,需要为这个panel设置更大的height,否则显示不全 + rowPane.setPreferredSize(new Dimension(500,135)); + } else { + // 其它语言环境下也需要将height调高一点点,因为后面将组件分块了,如果不调整height会造成上下间距不等 + rowPane.setPreferredSize(new Dimension(500,90)); + } + // 将组件分成两块,分别装在各自的JPanel中,然后把两个JPanel添加到rowPane中,第二个JPanel放不下时会自动换行 + // 左边的JPanel:分栏数据 + JPanel multiData = new JPanel(); + multiData.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column_Data") + ":")); repeatColDataTextField = new UITextField(); repeatColDataTextField.setPreferredSize(new Dimension(107,24)); - rowPane.add(repeatColDataTextField); - rowPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format") + ": A2:D5 ")); + multiData.add(repeatColDataTextField); + multiData.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format") + ": A2:D5 ")); + // 右边的JPanel:复制行序列 + JPanel copyRowSequence = new JPanel(); copyLabel = new UILabel(REPORT_COLUMN_RAPEAT[rowOrColumn] + ":"); - rowPane.add(copyLabel); - + copyRowSequence.add(copyLabel); copyTitleTextField = new UITextField(); copyTitleTextField.setPreferredSize(new Dimension(107,24)); - rowPane.add(copyTitleTextField); - rowPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format") + ": 1,2-3,5,18")); - - + copyRowSequence.add(copyTitleTextField); + copyRowSequence.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format") + ": 1,2-3,5,18")); + // 添加JPanel + rowPane.add(multiData); + rowPane.add(copyRowSequence); return rowPane; } /** * 从worksheetAttr中populate数据给界面 - * + * * @param attr 当前ElementCase的worksheet属性 * @param rowCount 总行数 * @param colCount 总列数 @@ -355,7 +370,7 @@ public class ReportColumnsPane extends BasicPane{ colOrRowConvert(); checkEnable(); } - + /** * populate列分栏数据 */ @@ -376,7 +391,7 @@ public class ReportColumnsPane extends BasicPane{ this.maxNumberSpinner.setEnabled(true); } } - + /** * populate行分栏 */ @@ -400,7 +415,7 @@ public class ReportColumnsPane extends BasicPane{ /** * 从worksheet中populate数据 - * + * * @param worksheet 当前worksheet */ public void populate(WorkSheet worksheet) { @@ -422,11 +437,11 @@ public class ReportColumnsPane extends BasicPane{ private void setValueText(WorkSheetAttr attr, int rowCount, int colCount, UITextField repeatColDataTextField, UITextField copyTitleTextField, UICheckBox showBlankCheckBox) { int startRow,endRow = -1,startColumn,endColumn = -1; - + if(attr.getStartIndex() == -1 && attr.getEndIndex() == -1){ return; } - + if (attr.getDirection() == ROW) { startRow = attr.getStartIndex(); endRow = attr.getEndIndex() == -1 ? rowCount - 1 : attr.getEndIndex(); @@ -438,13 +453,13 @@ public class ReportColumnsPane extends BasicPane{ startColumn = attr.getStartIndex(); endColumn = attr.getEndIndex() == -1 ? colCount - 1 : attr.getEndIndex(); } - + repeatColDataTextField.setText(ColumnRow.valueOf(startColumn, startRow).toString() +":" + ColumnRow.valueOf(endColumn, endRow).toString()); copyTitleTextField.setText(attr.getIndexsToCopy()); showBlankCheckBox.setSelected(attr.isShowBlank()); } - + /** * update行数据 */ @@ -463,7 +478,7 @@ public class ReportColumnsPane extends BasicPane{ } } } - + /** * update列数据 */ @@ -482,7 +497,7 @@ public class ReportColumnsPane extends BasicPane{ } } } - + /** * update数据给WorksheetAttr * @@ -491,8 +506,8 @@ public class ReportColumnsPane extends BasicPane{ if (!isRepeate) { attr.setDirection(Constants.NONE); return; - } - + } + switch (rowOrColumn) { case ROW: updateRow(attr); @@ -510,7 +525,7 @@ public class ReportColumnsPane extends BasicPane{ /** * update数据给worksheet - * + * * @param worksheet 当前worksheet */ public void update(WorkSheet worksheet) { @@ -527,7 +542,7 @@ public class ReportColumnsPane extends BasicPane{ /** * 从界面中赋值给WorkSheetAttr - * + * * @param attr 报表分栏属性 * @param repeatColDataTextField 从哪行开始复制 * @param copyTitleTextField 复制列序列 @@ -560,7 +575,7 @@ public class ReportColumnsPane extends BasicPane{ attr.setIndexsToCopy(copyTitleTextField.getText()); attr.setShowBlank(showBlankCheckBox.isSelected()); } - + /** * 判断输入是否合法 @@ -571,7 +586,7 @@ public class ReportColumnsPane extends BasicPane{ if(StringUtils.isEmpty(repeatText)){ return; } - + boolean valid = true; if(!repeatText.matches("[a-zA-Z]+[0-9]+[:][a-zA-Z]+[0-9]+")){ valid = false; From 1c728c920e078041a53f794920527749dc4a55ad Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 13 Aug 2020 19:54:31 +0800 Subject: [PATCH 007/267] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=B8=8B?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=9D=A1=E4=BB=B6=EF=BC=8C=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E4=BB=A5=E5=90=8E=E9=87=8D=E5=A4=8D=E5=86=99=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E5=88=86=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/report/ReportColumnsPane.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java b/designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java index 3d36ecd06d..108b61e651 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java @@ -18,6 +18,7 @@ import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.report.stable.WorkSheetAttr; import com.fr.report.worksheet.WorkSheet; +import com.fr.stable.ArrayUtils; import com.fr.stable.ColumnRow; import com.fr.stable.Constants; import com.fr.stable.StringUtils; @@ -38,11 +39,12 @@ import java.awt.Graphics; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.util.List; public class ReportColumnsPane extends BasicPane{ public static final int ROW = 0; public static final int COLUMN = 1; - private static final String LOCALE_LANGUAGE_EN = "en"; + private static final List LOCALE_LANGUAGE = ArrayUtils.toList(new String[]{"en"}); private int rowOrColumn; private boolean isRepeate; @@ -314,7 +316,7 @@ public class ReportColumnsPane extends BasicPane{ rowPane.setBorder(explainBorder); rowPane.setLayout(new FlowLayout(FlowLayout.LEFT, 5,13)); // Yvan: REPORT-37398 判断设计器语言是否为英文 - if (StringUtils.equals(GeneralContext.getLocale().getLanguage(), LOCALE_LANGUAGE_EN)) { + if (LOCALE_LANGUAGE.contains(GeneralContext.getLocale().getLanguage())) { // 如果是英文,需要为这个panel设置更大的height,否则显示不全 rowPane.setPreferredSize(new Dimension(500,135)); } else { From ba3da486cbdc3578c2e22233569c1e814302593c Mon Sep 17 00:00:00 2001 From: pengda Date: Mon, 17 Aug 2020 14:03:05 +0800 Subject: [PATCH 008/267] =?UTF-8?q?REPORT-37473=20=E5=A4=9A=E5=B1=82?= =?UTF-8?q?=E5=B5=8C=E5=A5=97=E7=9A=84tab=E6=A8=A1=E6=9D=BF=EF=BC=8C?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E8=BF=9B=E8=A1=8C=E5=A2=9E=E5=8A=A0=E5=88=A0?= =?UTF-8?q?=E9=99=A4tab=EF=BC=8C=E6=97=A0=E6=B3=95=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../creator/cardlayout/XCardSwitchButton.java | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java index f0e23b977f..97ab022291 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java @@ -258,10 +258,24 @@ public class XCardSwitchButton extends XButton { int ey = e.getY(); //获取tab布局的位置,鼠标相对于tab按钮的位置 - XLayoutContainer mainLayout = cardLayout.getBackupParent(); + Container mainLayout = cardLayout.getBackupParent(); Point point = mainLayout.getLocation(); - double mainX = point.getX(); - double mainY = point.getY(); + int y = 0; + int x = 0; + //遍历一下,不然是相对位置,嵌套后位置不对 + while (mainLayout.getParent() != null){ + if(mainLayout instanceof XWCardLayout){ + y += mainLayout.getY(); + } + + mainLayout = mainLayout.getParent(); + + if(mainLayout instanceof XWCardMainBorderLayout){ + x += mainLayout.getX(); + } + } + double mainX = point.getX() + x; + double mainY = point.getY() + y; // 参数界面对坐标的影响 JForm jform = (JForm) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); From 89dd8f64626b85cb637cfc7a91f6b5a2eb5068e5 Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 17 Aug 2020 14:17:13 +0800 Subject: [PATCH 009/267] =?UTF-8?q?REPORT-37588=E3=80=90frm=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E7=95=8C=E9=9D=A2=E6=94=AF=E6=8C=81=E7=BC=A9=E6=94=BE?= =?UTF-8?q?=E3=80=91=E5=A4=9Atab=E6=A8=A1=E7=89=88=EF=BC=8C=E5=8F=B3?= =?UTF-8?q?=E5=87=BBtab=E6=98=BE=E7=A4=BA=E6=8F=90=E7=A4=BA=EF=BC=8C?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E4=B8=8D=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/creator/cardlayout/XCardSwitchButton.java | 5 +++-- .../com/fr/design/mainframe/EditingMouseListener.java | 2 +- .../main/java/com/fr/design/mainframe/FormDesigner.java | 8 ++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java index f0e23b977f..bce26eb3f3 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java @@ -202,7 +202,8 @@ public class XCardSwitchButton extends XButton { jPopupMenu.add(prev); jPopupMenu.add(next); jPopupMenu.add(end); - GUICoreUtils.showPopupMenu(jPopupMenu, editingMouseListener.getDesigner(), e.getX(), e.getY()); + FormDesigner designer = editingMouseListener.getDesigner(); + GUICoreUtils.showPopupMenu(jPopupMenu, editingMouseListener.getDesigner(), designer.getOriginX(e.getX()), designer.getOriginY(e.getY())); } @Override @@ -251,7 +252,7 @@ public class XCardSwitchButton extends XButton { //是否进入点击关闭按钮区域 private boolean isSelectedClose(MouseEvent e, FormDesigner designer){ - int diff = designer.getArea().getHorScrollBar().getValue(); + int diff = designer.getHorizontalScaleValue(); // mouse position int ex = e.getX() + diff; diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index d8234c2b1d..3754e5109e 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -607,7 +607,7 @@ public class EditingMouseListener extends MouseInputAdapter { if (e.getButton() == MouseEvent.BUTTON3) { UIPopupMenu cellPopupMenu = creator.createPopupMenu(designer); if (cellPopupMenu != UIPopupMenu.EMPTY) { - GUICoreUtils.showPopupMenu(cellPopupMenu, designer, e.getX(), e.getY()); + GUICoreUtils.showPopupMenu(cellPopupMenu, designer, oldX, oldY); } } creator.doLayout(); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index f9141ca997..e5ce0f726f 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -1611,6 +1611,14 @@ public class FormDesigner extends TargetComponent
implements TreeSelection return (int) ((y - this.getPaintY()) / this.getScale()); } + public int getOriginX(int x) { + return (int) (x * this.getScale() + this.getPaintX()); + } + + public int getOriginY(int y) { + return (int) (y * this.getScale() + this.getPaintY()); + } + public int getHorizontalScaleValue() { return (int) (this.getArea().getHorizontalValue() / this.scale); From 3b5adce5d32ba28f537e2a2259011f40d70075ea Mon Sep 17 00:00:00 2001 From: Harrison Date: Mon, 17 Aug 2020 14:21:23 +0800 Subject: [PATCH 010/267] =?UTF-8?q?REPORT-37487=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=88=97=E5=8F=B3=E4=BE=A7=E5=B1=9E=E6=80=A7=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E9=AB=98=E7=BA=A7=E9=83=A8=E5=88=86=E5=8A=9F=E8=83=BD=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E9=97=AE=E9=A2=98=20=E5=8F=B3=E4=BE=A7=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=EF=BC=8C=E6=98=BE=E7=A4=BA=E5=80=BC=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E9=87=8D=E7=BD=AE=E4=B8=BA=20=3D$$$=20?= =?UTF-8?q?=E5=8F=8C=E5=87=BB=E6=95=B0=E6=8D=AE=E6=BA=90=E9=AB=98=E7=BA=A7?= =?UTF-8?q?=E4=B8=AD=EF=BC=8C=E4=B8=8D=E4=BC=9A=E9=87=8D=E7=BD=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/formula/FormulaTextField.java | 11 +++++----- .../design/dscolumn/DSColumnAdvancedPane.java | 6 ++++-- .../cellquick/CellDSColumnEditor.java | 20 ++++++++++--------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaTextField.java b/designer-base/src/main/java/com/fr/design/formula/FormulaTextField.java index 6294a7a3bd..36cabec6bb 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaTextField.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaTextField.java @@ -18,8 +18,6 @@ public class FormulaTextField extends DictionaryTextField { private static final String EMPTY_STRING = "="; - private static final BaseFormula EMPTY_FORMULA = BaseFormula.createFormulaBuilder().build(EMPTY_STRING); - public FormulaTextField() { } @@ -64,10 +62,10 @@ public class FormulaTextField extends DictionaryTextField { @Override public void setValue(BaseFormula value) { - this.value = value; - if (this.value == null) { - this.value = createDefault(); + if (value == null) { + value = createDefault(); } + this.value = value; } /** @@ -94,7 +92,8 @@ public class FormulaTextField extends DictionaryTextField { if (StringUtils.isNotEmpty(text)) { return BaseFormula.createFormulaBuilder().build(text); } else { - return EMPTY_FORMULA; + //防止默认值被修改, 每一次创建都是不一样的。 + return BaseFormula.createFormulaBuilder().build(EMPTY_STRING); } } } diff --git a/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java b/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java index 58636917cd..b1273ce58d 100644 --- a/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java +++ b/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java @@ -410,10 +410,10 @@ public class DSColumnAdvancedPane extends BasicPane { private static class JFormulaField extends JPanel { private CellElement cellElement; private FormulaTextField formulaTextField; - private BaseFormula defaultFormula; + private String defaultValue; public JFormulaField(String defaultValue) { - this.defaultFormula = BaseFormula.createFormulaBuilder().build(defaultValue); + this.defaultValue = defaultValue; this.setLayout(FRGUIPaneFactory.createBoxFlowLayout()); UILabel bottomLabel = new UILabel("="); @@ -421,6 +421,7 @@ public class DSColumnAdvancedPane extends BasicPane { this.add(bottomLabel); formulaTextField = new FormulaTextField(24); this.add(formulaTextField); + BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(this.defaultValue); formulaTextField.setValueAndText(defaultFormula, true); UIButton bottomFrmulaButton = new UIButton("..."); @@ -480,6 +481,7 @@ public class DSColumnAdvancedPane extends BasicPane { public void doOk() { BaseFormula valueFormula = formulaPane.update(); if (valueFormula.getContent().length() <= 1) { + BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(defaultValue); formulaTextField.setValueAndText(defaultFormula, true); } else { formulaTextField.setValueAndText(valueFormula, true); diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java index d9b8f1e7a0..248a274f57 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java @@ -646,7 +646,6 @@ public class CellDSColumnEditor extends CellQuickEditor { */ public class ResultSetSortConfigPane extends JPanel { private static final String DEFAULT_VALUE = "="; - private final BaseFormula DEFAULT_FORMULA = BaseFormula.createFormulaBuilder().build(); private JPanel contentPane; private UIButtonGroup sortTypePane; private JFormulaField formulaField; @@ -723,7 +722,8 @@ public class CellDSColumnEditor extends CellQuickEditor { } BaseFormula baseFormula = dSColumn.getSortFormulaObject(); if (baseFormula == null) { - this.formulaField.populateFormula(DEFAULT_FORMULA); + BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(); + this.formulaField.populateFormula(defaultFormula); } else { this.formulaField.populateFormula(baseFormula); } @@ -1064,11 +1064,12 @@ public class CellDSColumnEditor extends CellQuickEditor { public class JFormulaField extends JPanel { private CellElement cellElement; private FormulaTextField formulaTextField; - private BaseFormula defaultFormula; + private String defaultValue; public JFormulaField(String defaultValue) { - - this.defaultFormula = BaseFormula.createFormulaBuilder().build(defaultValue); + + this.defaultValue = defaultValue; + BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(this.defaultValue); formulaTextField = new FormulaTextField(); formulaTextField.setValueAndText(defaultFormula, false); @@ -1145,6 +1146,7 @@ public class CellDSColumnEditor extends CellQuickEditor { public void doOk() { BaseFormula valueFormula = formulaPane.update(); if (valueFormula.getContent().length() <= 1) { + BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(defaultValue); formulaTextField.setValueAndText(defaultFormula, false); } else { formulaTextField.setValueAndText(valueFormula, false); @@ -1164,8 +1166,7 @@ public class CellDSColumnEditor extends CellQuickEditor { */ public class CustomValuePane extends JPanel { private static final String DEFAULT_VALUE = "=$$$"; - private final BaseFormula DEFAULT_FORMULA = BaseFormula.createFormulaBuilder().build(DEFAULT_VALUE); - + private JFormulaField formulaField; public CustomValuePane() { @@ -1188,7 +1189,8 @@ public class CellDSColumnEditor extends CellQuickEditor { if (valueFormula != null) { formulaField.populateFormula(valueFormula); } else { - formulaField.populateFormula(DEFAULT_FORMULA); + BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(DEFAULT_VALUE); + formulaField.populateFormula(defaultFormula); } formulaField.populateElement(cellElement); @@ -1201,7 +1203,7 @@ public class CellDSColumnEditor extends CellQuickEditor { Object value = cellElement.getValue(); if (value instanceof DSColumn) { DSColumn dSColumn = (DSColumn) (cellElement.getValue()); - dSColumn.setResultObject(this.formulaField.getFormula()); + dSColumn.setResultObject(StringUtils.isEmpty(this.formulaField.getFormulaText()) ? null : this.formulaField.getFormula()); } } } From c5a6e714482f2a395c891d542bf0aeddad6b77db Mon Sep 17 00:00:00 2001 From: pengda Date: Mon, 17 Aug 2020 15:06:21 +0800 Subject: [PATCH 011/267] =?UTF-8?q?REPORT-37473=20=E5=A4=9A=E5=B1=82?= =?UTF-8?q?=E5=B5=8C=E5=A5=97=E7=9A=84tab=E6=A8=A1=E6=9D=BF=EF=BC=8C?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E8=BF=9B=E8=A1=8C=E5=A2=9E=E5=8A=A0=E5=88=A0?= =?UTF-8?q?=E9=99=A4tab=EF=BC=8C=E6=97=A0=E6=B3=95=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/designer/creator/cardlayout/XCardSwitchButton.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java index 97ab022291..335c05b97a 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java @@ -272,6 +272,7 @@ public class XCardSwitchButton extends XButton { if(mainLayout instanceof XWCardMainBorderLayout){ x += mainLayout.getX(); + y += mainLayout.getY(); } } double mainX = point.getX() + x; From f68f094bca159bb7ba31ce2d474c28f415903b62 Mon Sep 17 00:00:00 2001 From: Lanlan Date: Mon, 17 Aug 2020 16:12:03 +0800 Subject: [PATCH 012/267] =?UTF-8?q?REPORT-36306=20linux=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=94=B9=E6=88=90=E8=B7=B3=E8=BD=AC=E5=88=B0=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E7=9A=84=E6=8F=92=E4=BB=B6=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/os/impl/PMDialogAction.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/os/impl/PMDialogAction.java b/designer-base/src/main/java/com/fr/design/os/impl/PMDialogAction.java index 3f2f097283..541e39601b 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/PMDialogAction.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/PMDialogAction.java @@ -17,11 +17,11 @@ public class PMDialogAction implements OSBasedAction { private static String PLUGIN_MANAGER_ROUTE = "#management/plugin"; @Override public void execute(Object... objects) { - if(Arch.getArch() == Arch.ARM){ + if(Arch.getArch() == Arch.ARM || OperatingSystem.isLinux()){ DesignUtils.visitEnvServerByParameters( PLUGIN_MANAGER_ROUTE,null,null); return; } - if (ServerPreferenceConfig.getInstance().isUseOptimizedUPM() && !OperatingSystem.isLinux()) { + if (ServerPreferenceConfig.getInstance().isUseOptimizedUPM()) { UpmFinder.showUPMDialog(); } else { WebViewDlgHelper.createPluginDialog(); From 4f06b426c09a5f6f4e666800f39b8a5f5f34f88a Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 17 Aug 2020 16:23:36 +0800 Subject: [PATCH 013/267] =?UTF-8?q?REPORT-37020=20=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=EF=BC=8C=E4=B8=80=E4=B8=AA=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8F=82=E6=95=B0=EF=BC=8C=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E9=95=BF=E5=BA=A6=E4=B8=8D=E4=BC=9A=E8=87=AA=E9=80=82=E5=BA=94?= =?UTF-8?q?=EF=BC=8C=E6=92=A4=E9=94=80=E5=B0=B1=E4=BC=9A=E8=87=AA=E9=80=82?= =?UTF-8?q?=E5=BA=94=E6=98=BE=E7=A4=BA=E4=BA=86=201.=20=E4=B8=BA=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=8D=95=E4=B8=AA=E5=8F=82=E6=95=B0=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=92=8C=E6=B7=BB=E5=8A=A0=E5=8D=95=E4=B8=AA=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E7=BB=84=E4=BB=B6+=E6=B7=BB=E5=8A=A0=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E7=9A=84=E6=96=B9=E6=B3=95=E9=83=BD=E5=8A=A0?= =?UTF-8?q?=E4=B8=8A=E4=BA=86=E8=AE=BE=E7=BD=AE=E4=B8=AD=E5=BF=83Panel?= =?UTF-8?q?=E9=AB=98=E5=BA=A6=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/parameter/ParameterDefinitePane.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java b/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java index 11ae412ece..66611d9a18 100644 --- a/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java +++ b/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java @@ -425,6 +425,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus if (propertyChangeListener != null) { propertyChangeListener.propertyChange(); } + workBook.setAutoHeightForCenterPane(); } /** @@ -445,6 +446,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus if (propertyChangeListener != null) { propertyChangeListener.propertyChange(); } + workBook.setAutoHeightForCenterPane(); } /** From 6dc4651462bedc9e93f4a35681250aaa45641538 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 17 Aug 2020 16:29:02 +0800 Subject: [PATCH 014/267] =?UTF-8?q?REPORT-37020=20=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=EF=BC=8C=E4=B8=80=E4=B8=AA=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8F=82=E6=95=B0=EF=BC=8C=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E9=95=BF=E5=BA=A6=E4=B8=8D=E4=BC=9A=E8=87=AA=E9=80=82=E5=BA=94?= =?UTF-8?q?=EF=BC=8C=E6=92=A4=E9=94=80=E5=B0=B1=E4=BC=9A=E8=87=AA=E9=80=82?= =?UTF-8?q?=E5=BA=94=E6=98=BE=E7=A4=BA=E4=BA=86=201.=20=E4=B8=BA=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=8D=95=E4=B8=AA=E5=8F=82=E6=95=B0=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=92=8C=E6=B7=BB=E5=8A=A0=E5=8D=95=E4=B8=AA=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E7=BB=84=E4=BB=B6+=E6=B7=BB=E5=8A=A0=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E7=9A=84=E6=96=B9=E6=B3=95=E9=83=BD=E5=8A=A0?= =?UTF-8?q?=E4=B8=8A=E4=BA=86=E8=AE=BE=E7=BD=AE=E4=B8=AD=E5=BF=83Panel?= =?UTF-8?q?=E9=AB=98=E5=BA=A6=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/report/ReportColumnsPane.java | 81 ++++++++----------- 1 file changed, 32 insertions(+), 49 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java b/designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java index 108b61e651..4062e0dbe5 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java @@ -14,11 +14,9 @@ import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; -import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.report.stable.WorkSheetAttr; import com.fr.report.worksheet.WorkSheet; -import com.fr.stable.ArrayUtils; import com.fr.stable.ColumnRow; import com.fr.stable.Constants; import com.fr.stable.StringUtils; @@ -39,12 +37,10 @@ import java.awt.Graphics; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.List; public class ReportColumnsPane extends BasicPane{ public static final int ROW = 0; public static final int COLUMN = 1; - private static final List LOCALE_LANGUAGE = ArrayUtils.toList(new String[]{"en"}); private int rowOrColumn; private boolean isRepeate; @@ -62,7 +58,7 @@ public class ReportColumnsPane extends BasicPane{ com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Columns_Repeat_Row"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Columns_Repeat_Column") }; - + private static final String FONT_NAME = "simsun"; private static final int FONT_SIZE = 14; @@ -91,7 +87,6 @@ public class ReportColumnsPane extends BasicPane{ this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel north = new JPanel(new BorderLayout()) { - @Override public void paint(Graphics g) { super.paint(g); super.paintBorder(g); @@ -127,7 +122,7 @@ public class ReportColumnsPane extends BasicPane{ this.add(north, BorderLayout.NORTH); this.add(createRowColumnPane(), BorderLayout.CENTER); } - + private ActionListener onOffListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -225,7 +220,7 @@ public class ReportColumnsPane extends BasicPane{ sampleLablePane.add(cPane); return sampleLablePane; } - + private ActionListener rowChangeListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -238,7 +233,7 @@ public class ReportColumnsPane extends BasicPane{ } } }; - + private ActionListener colChangeListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -280,7 +275,7 @@ public class ReportColumnsPane extends BasicPane{ RowMaxOrSetPane.add(setRowRadioPane); return RowMaxOrSetPane; } - + private ActionListener toXBtnListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -293,7 +288,7 @@ public class ReportColumnsPane extends BasicPane{ } } }; - + private ActionListener maxBtnListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -315,39 +310,27 @@ public class ReportColumnsPane extends BasicPane{ UITitledBorder explainBorder = UITitledBorder.createBorderWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column_Area")); rowPane.setBorder(explainBorder); rowPane.setLayout(new FlowLayout(FlowLayout.LEFT, 5,13)); - // Yvan: REPORT-37398 判断设计器语言是否为英文 - if (LOCALE_LANGUAGE.contains(GeneralContext.getLocale().getLanguage())) { - // 如果是英文,需要为这个panel设置更大的height,否则显示不全 - rowPane.setPreferredSize(new Dimension(500,135)); - } else { - // 其它语言环境下也需要将height调高一点点,因为后面将组件分块了,如果不调整height会造成上下间距不等 - rowPane.setPreferredSize(new Dimension(500,90)); - } - // 将组件分成两块,分别装在各自的JPanel中,然后把两个JPanel添加到rowPane中,第二个JPanel放不下时会自动换行 - // 左边的JPanel:分栏数据 - JPanel multiData = new JPanel(); - multiData.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column_Data") + ":")); + rowPane.setPreferredSize(new Dimension(500,80)); + rowPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column_Data") + ":")); repeatColDataTextField = new UITextField(); repeatColDataTextField.setPreferredSize(new Dimension(107,24)); - multiData.add(repeatColDataTextField); - multiData.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format") + ": A2:D5 ")); - // 右边的JPanel:复制行序列 - JPanel copyRowSequence = new JPanel(); + rowPane.add(repeatColDataTextField); + rowPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format") + ": A2:D5 ")); copyLabel = new UILabel(REPORT_COLUMN_RAPEAT[rowOrColumn] + ":"); - copyRowSequence.add(copyLabel); + rowPane.add(copyLabel); + copyTitleTextField = new UITextField(); copyTitleTextField.setPreferredSize(new Dimension(107,24)); - copyRowSequence.add(copyTitleTextField); - copyRowSequence.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format") + ": 1,2-3,5,18")); - // 添加JPanel - rowPane.add(multiData); - rowPane.add(copyRowSequence); + rowPane.add(copyTitleTextField); + rowPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format") + ": 1,2-3,5,18")); + + return rowPane; } /** * 从worksheetAttr中populate数据给界面 - * + * * @param attr 当前ElementCase的worksheet属性 * @param rowCount 总行数 * @param colCount 总列数 @@ -372,7 +355,7 @@ public class ReportColumnsPane extends BasicPane{ colOrRowConvert(); checkEnable(); } - + /** * populate列分栏数据 */ @@ -393,7 +376,7 @@ public class ReportColumnsPane extends BasicPane{ this.maxNumberSpinner.setEnabled(true); } } - + /** * populate行分栏 */ @@ -417,7 +400,7 @@ public class ReportColumnsPane extends BasicPane{ /** * 从worksheet中populate数据 - * + * * @param worksheet 当前worksheet */ public void populate(WorkSheet worksheet) { @@ -439,11 +422,11 @@ public class ReportColumnsPane extends BasicPane{ private void setValueText(WorkSheetAttr attr, int rowCount, int colCount, UITextField repeatColDataTextField, UITextField copyTitleTextField, UICheckBox showBlankCheckBox) { int startRow,endRow = -1,startColumn,endColumn = -1; - + if(attr.getStartIndex() == -1 && attr.getEndIndex() == -1){ return; } - + if (attr.getDirection() == ROW) { startRow = attr.getStartIndex(); endRow = attr.getEndIndex() == -1 ? rowCount - 1 : attr.getEndIndex(); @@ -455,13 +438,13 @@ public class ReportColumnsPane extends BasicPane{ startColumn = attr.getStartIndex(); endColumn = attr.getEndIndex() == -1 ? colCount - 1 : attr.getEndIndex(); } - + repeatColDataTextField.setText(ColumnRow.valueOf(startColumn, startRow).toString() +":" + ColumnRow.valueOf(endColumn, endRow).toString()); copyTitleTextField.setText(attr.getIndexsToCopy()); showBlankCheckBox.setSelected(attr.isShowBlank()); } - + /** * update行数据 */ @@ -480,7 +463,7 @@ public class ReportColumnsPane extends BasicPane{ } } } - + /** * update列数据 */ @@ -499,7 +482,7 @@ public class ReportColumnsPane extends BasicPane{ } } } - + /** * update数据给WorksheetAttr * @@ -508,8 +491,8 @@ public class ReportColumnsPane extends BasicPane{ if (!isRepeate) { attr.setDirection(Constants.NONE); return; - } - + } + switch (rowOrColumn) { case ROW: updateRow(attr); @@ -527,7 +510,7 @@ public class ReportColumnsPane extends BasicPane{ /** * update数据给worksheet - * + * * @param worksheet 当前worksheet */ public void update(WorkSheet worksheet) { @@ -544,7 +527,7 @@ public class ReportColumnsPane extends BasicPane{ /** * 从界面中赋值给WorkSheetAttr - * + * * @param attr 报表分栏属性 * @param repeatColDataTextField 从哪行开始复制 * @param copyTitleTextField 复制列序列 @@ -577,7 +560,7 @@ public class ReportColumnsPane extends BasicPane{ attr.setIndexsToCopy(copyTitleTextField.getText()); attr.setShowBlank(showBlankCheckBox.isSelected()); } - + /** * 判断输入是否合法 @@ -588,7 +571,7 @@ public class ReportColumnsPane extends BasicPane{ if(StringUtils.isEmpty(repeatText)){ return; } - + boolean valid = true; if(!repeatText.matches("[a-zA-Z]+[0-9]+[:][a-zA-Z]+[0-9]+")){ valid = false; From 5b880961ad652c957f27ac6d696b1f8d10466060 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 17 Aug 2020 17:04:42 +0800 Subject: [PATCH 015/267] =?UTF-8?q?=E5=AD=98=E5=9C=A8=E7=A9=BA=E6=8C=87?= =?UTF-8?q?=E9=92=88=E5=BC=82=E5=B8=B8=E7=9A=84=E5=8F=AF=E8=83=BD=E6=80=A7?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AA=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/parameter/ParameterDefinitePane.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java b/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java index 66611d9a18..e62a5772cd 100644 --- a/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java +++ b/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java @@ -425,7 +425,9 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus if (propertyChangeListener != null) { propertyChangeListener.propertyChange(); } - workBook.setAutoHeightForCenterPane(); + if (workBook != null) { + workBook.setAutoHeightForCenterPane(); + } } /** @@ -446,7 +448,9 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus if (propertyChangeListener != null) { propertyChangeListener.propertyChange(); } - workBook.setAutoHeightForCenterPane(); + if (workBook != null) { + workBook.setAutoHeightForCenterPane(); + } } /** @@ -469,7 +473,9 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus if (propertyChangeListener != null) { propertyChangeListener.propertyChange(); } - workBook.setAutoHeightForCenterPane(); + if (workBook != null) { + workBook.setAutoHeightForCenterPane(); + } } /** From c853e778a331f1d4095639d13bd5387ff9dbfe7f Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 17 Aug 2020 17:35:17 +0800 Subject: [PATCH 016/267] =?UTF-8?q?=E7=BB=8F=E8=BF=87Hugh=E8=80=81?= =?UTF-8?q?=E5=93=A5=E6=8F=90=E9=86=92=EF=BC=8C=E4=BD=BF=E7=94=A8=E6=B3=A8?= =?UTF-8?q?=E8=A7=A3=E7=9A=84=E6=96=B9=E5=BC=8F=E9=81=BF=E5=85=8D=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E7=9A=84=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/parameter/ParameterDefinitePane.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java b/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java index e62a5772cd..d1d5f5a961 100644 --- a/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java +++ b/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java @@ -41,6 +41,7 @@ import com.fr.main.parameter.TemplateParameterAttr; import com.fr.stable.ArrayUtils; import com.fr.stable.bridge.StableFactory; import com.fr.stable.core.PropertyChangeAdapter; +import org.jetbrains.annotations.NotNull; import javax.swing.JCheckBoxMenuItem; import javax.swing.JComponent; @@ -236,7 +237,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus * * @param workBook */ - public void populate(final JWorkBook workBook) { + public void populate(@NotNull final JWorkBook workBook) { isEditing = false; this.workBook = workBook; ReportParameterAttr reportParameterAttr = workBook.getTarget().getReportParameterAttr(); @@ -425,9 +426,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus if (propertyChangeListener != null) { propertyChangeListener.propertyChange(); } - if (workBook != null) { - workBook.setAutoHeightForCenterPane(); - } + workBook.setAutoHeightForCenterPane(); } /** @@ -448,9 +447,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus if (propertyChangeListener != null) { propertyChangeListener.propertyChange(); } - if (workBook != null) { - workBook.setAutoHeightForCenterPane(); - } + workBook.setAutoHeightForCenterPane(); } /** @@ -473,9 +470,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus if (propertyChangeListener != null) { propertyChangeListener.propertyChange(); } - if (workBook != null) { - workBook.setAutoHeightForCenterPane(); - } + workBook.setAutoHeightForCenterPane(); } /** From f23efebce31930931d7f58b96c0f1ba3ba84cc77 Mon Sep 17 00:00:00 2001 From: Harrison Date: Mon, 17 Aug 2020 20:45:42 +0800 Subject: [PATCH 017/267] =?UTF-8?q?=E5=9B=9E=E6=BB=9A=E4=BB=A3=E7=A0=81,?= =?UTF-8?q?=20=E7=8E=B0=E6=9C=89=E9=80=BB=E8=BE=91=E4=B8=8D=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/formula/FormulaTextField.java | 99 ------------------- .../fr/design/formula/SortFormulaPane.java | 25 ++--- .../gui/itextfield/DictionaryTextField.java | 45 --------- .../design/formula/FormulaTextFieldTest.java | 28 ------ .../design/dscolumn/DSColumnAdvancedPane.java | 84 +++++++--------- .../cellquick/CellDSColumnEditor.java | 74 ++++++-------- 6 files changed, 79 insertions(+), 276 deletions(-) delete mode 100644 designer-base/src/main/java/com/fr/design/formula/FormulaTextField.java delete mode 100644 designer-base/src/main/java/com/fr/design/gui/itextfield/DictionaryTextField.java delete mode 100644 designer-base/src/test/java/com/fr/design/formula/FormulaTextFieldTest.java diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaTextField.java b/designer-base/src/main/java/com/fr/design/formula/FormulaTextField.java deleted file mode 100644 index 36cabec6bb..0000000000 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaTextField.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.fr.design.formula; - -import com.fr.base.BaseFormula; -import com.fr.design.gui.itextfield.DictionaryTextField; -import com.fr.stable.StringUtils; - -import javax.swing.text.Document; - -/** - * 公式展示时使用。 - * 展示 String. - * 但实际保存的是 BaseFormula。 - * 从而保留公式的形态。 - * - * created by Harrison on 2020/08/03 - **/ -public class FormulaTextField extends DictionaryTextField { - - private static final String EMPTY_STRING = "="; - - public FormulaTextField() { - } - - public FormulaTextField(int columns) { - super(columns); - } - - public FormulaTextField(String text, int columns, BaseFormula value) { - super(text, columns, value); - } - - public FormulaTextField(String text, BaseFormula value) { - super(text, value); - } - - public FormulaTextField(Document doc, String text, int columns, BaseFormula value) { - super(doc, text, columns, value); - } - - @Override - public BaseFormula getValue() { - - if (this.value == null) { - this.value = createDefault(); - } - //保持联动 - linkValueByText(); - return value; - } - - private void linkValueByText() { - - String content = getText(); - this.value.setContent(content); - } - - /** - * 设置值时,会将展示的公式值一同设置进去 - * - * @param value 公式值 - */ - @Override - public void setValue(BaseFormula value) { - - if (value == null) { - value = createDefault(); - } - this.value = value; - } - - /** - * 是需要设置不带 = 号,还是带 = 号。 - * - * @param value 值 - * @param isPure 带不带 = 号, 是 = 不带, 否 = 带。 - */ - public void setValueAndText(BaseFormula value, boolean isPure) { - - setValue(value); - String content = null; - if (isPure) { - content = this.value.getPureContent(); - } else { - content = this.value.getContent(); - } - setText(content); - } - - private BaseFormula createDefault() { - - String text = getText(); - if (StringUtils.isNotEmpty(text)) { - return BaseFormula.createFormulaBuilder().build(text); - } else { - //防止默认值被修改, 每一次创建都是不一样的。 - return BaseFormula.createFormulaBuilder().build(EMPTY_STRING); - } - } -} diff --git a/designer-base/src/main/java/com/fr/design/formula/SortFormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/SortFormulaPane.java index 7b6e536fc2..222aa90fec 100644 --- a/designer-base/src/main/java/com/fr/design/formula/SortFormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/SortFormulaPane.java @@ -7,13 +7,12 @@ import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.SortOrderComboBox; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextfield.UITextField; import com.fr.design.utils.gui.GUICoreUtils; -import javax.swing.JComponent; -import javax.swing.JPanel; -import javax.swing.SwingUtilities; -import java.awt.Dimension; -import java.awt.FlowLayout; + +import javax.swing.*; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -21,7 +20,7 @@ public abstract class SortFormulaPane extends JPanel { protected static final String InsetText = " "; protected SortOrderComboBox sortOrderComboBox; - protected FormulaTextField sortFormulaTextField; + protected UITextField sortFormulaTextField; // 屏蔽掉“自定义比较规则”和“选择”按钮,只显示公式输入文本和公式按钮 protected UIButton sortFormulaTextFieldButton; @@ -36,7 +35,7 @@ public abstract class SortFormulaPane extends JPanel { } }); - sortFormulaTextField = new FormulaTextField(16); + sortFormulaTextField = new UITextField(16); //Lance:添加一公式编辑器按钮 sortFormulaTextFieldButton = new UIButton("..."); sortFormulaTextFieldButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula") + "..."); @@ -56,15 +55,17 @@ public abstract class SortFormulaPane extends JPanel { public abstract void formulaAction(); public void showFormulaDialog(String[] displayNames) { - BaseFormula value = sortFormulaTextField.getValue(); - final UIFormula formulaPane = FormulaFactory.createFormulaPaneWhenReserveFormula(); - formulaPane.populate(value, new CustomVariableResolver(displayNames, true)); + String text = sortFormulaTextField.getText(); + final UIFormula formulaPane = FormulaFactory.createFormulaPaneWhenReserveFormula(); + formulaPane.populate(BaseFormula.createFormulaBuilder().build(text), new CustomVariableResolver(displayNames, true)); formulaPane.showLargeWindow(SwingUtilities.getWindowAncestor(SortFormulaPane.this), new DialogActionAdapter() { public void doOk() { BaseFormula fm = formulaPane.update(); - if (fm != null) { - sortFormulaTextField.setValueAndText(fm, true); + if (fm.getContent().length() <= 1) { + sortFormulaTextField.setText(""); + } else { + sortFormulaTextField.setText(fm.getContent().substring(1)); } } }).setVisible(true); diff --git a/designer-base/src/main/java/com/fr/design/gui/itextfield/DictionaryTextField.java b/designer-base/src/main/java/com/fr/design/gui/itextfield/DictionaryTextField.java deleted file mode 100644 index b8805b61dd..0000000000 --- a/designer-base/src/main/java/com/fr/design/gui/itextfield/DictionaryTextField.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.fr.design.gui.itextfield; - -import javax.swing.text.Document; - -/** - * 文字 ui. - * 保存实际值,展示值。 - * 允许实际值和展示值不同。 - * - * created by Harrison on 2020/08/03 - **/ -public class DictionaryTextField extends UITextField { - - protected T value; - - public DictionaryTextField() { - } - - public DictionaryTextField(int columns) { - super(columns); - } - - public DictionaryTextField(String text, int columns, T value) { - super(text, columns); - this.value = value; - } - - public DictionaryTextField(String text, T value) { - super(text); - this.value = value; - } - - public DictionaryTextField(Document doc, String text, int columns, T value) { - super(doc, text, columns); - this.value = value; - } - - public T getValue() { - return value; - } - - public void setValue(T value) { - this.value = value; - } -} diff --git a/designer-base/src/test/java/com/fr/design/formula/FormulaTextFieldTest.java b/designer-base/src/test/java/com/fr/design/formula/FormulaTextFieldTest.java deleted file mode 100644 index 8c58f6023d..0000000000 --- a/designer-base/src/test/java/com/fr/design/formula/FormulaTextFieldTest.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.fr.design.formula; - -import com.fr.base.BaseFormula; -import org.junit.Assert; -import org.junit.Test; - -import static org.junit.Assert.*; - -public class FormulaTextFieldTest { - - @Test - public void testSet() { - - FormulaTextField field = new FormulaTextField(); - BaseFormula aaaa = BaseFormula.createFormulaBuilder().build("aaaa"); - field.setValueAndText(aaaa, true); - - Assert.assertEquals("aaaa", field.getText()); - - field.setValueAndText(aaaa, false); - Assert.assertEquals("=aaaa", field.getText()); - - field.setText("bbbb"); - BaseFormula formula = field.getValue(); - Assert.assertEquals("bbbb", formula.getPureContent()); - } - -} \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java b/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java index b1273ce58d..0941b4b220 100644 --- a/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java +++ b/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java @@ -7,7 +7,6 @@ import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.formula.CustomVariableResolver; import com.fr.design.formula.FormulaFactory; -import com.fr.design.formula.FormulaTextField; import com.fr.design.formula.SortFormulaPane; import com.fr.design.formula.UIFormula; import com.fr.design.gui.ibutton.UIButton; @@ -26,17 +25,8 @@ import com.fr.report.cell.cellattr.CellExpandAttr; import com.fr.report.cell.cellattr.core.group.DSColumn; import com.fr.report.cell.cellattr.core.group.SelectCount; -import javax.swing.BorderFactory; -import javax.swing.Box; -import javax.swing.JComponent; -import javax.swing.JPanel; -import javax.swing.SwingUtilities; -import java.awt.BorderLayout; -import java.awt.CardLayout; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Font; +import javax.swing.*; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -231,7 +221,7 @@ public class DSColumnAdvancedPane extends BasicPane { return; } Object value = cellElement.getValue(); - if (!(value instanceof DSColumn)) { + if (value == null || !(value instanceof DSColumn)) { return; } @@ -248,7 +238,7 @@ public class DSColumnAdvancedPane extends BasicPane { this.cellElement = cellElement; Object value = cellElement.getValue(); - if (!(value instanceof DSColumn)) { + if (value == null || !(value instanceof DSColumn)) { return; } DSColumn dSColumn = (DSColumn) value; @@ -256,8 +246,8 @@ public class DSColumnAdvancedPane extends BasicPane { int sort = dSColumn.getOrder(); this.sortOrderComboBox.setSortOrder(new SortOrder(sort)); - BaseFormula sortFormulaObject = dSColumn.getSortFormulaObject(); - sortFormulaTextField.setValueAndText(sortFormulaObject, true); + String sortFormula = dSColumn.getSortFormula(); + sortFormulaTextField.setText(sortFormula); } public void update(CellElement cellElement) { @@ -273,7 +263,15 @@ public class DSColumnAdvancedPane extends BasicPane { dSColumn.setOrder(this.sortOrderComboBox.getSortOrder().getOrder()); //lance:sort formula - dSColumn.setSortFormulaObject(sortFormulaTextField.getValue()); + String sText = null; + if (!(sortFormulaTextField.getText() == null || sortFormulaTextField.getText().trim().equals("") || sortFormulaTextField.getText().trim().equals("$$$"))) { + sText = new String(sortFormulaTextField.getText()); + } + if (!(sText == null || sText.length() < 1)) { + dSColumn.setSortFormula(sText); + } else { + dSColumn.setSortFormula(null); + } } } @@ -369,9 +367,9 @@ public class DSColumnAdvancedPane extends BasicPane { int selectCountType = selectCount.getType(); this.selectCountComboBox.setSelectedIndex(selectCountType); if (selectCountType == TOP.getValue()) { - this.topFormulaPane.populateFormula(selectCount.getFormulaObject()); + this.topFormulaPane.populate(selectCount.getFormulaCount()); } else if (selectCountType == BOTTOM.getValue()) { - this.bottomFormulaPane.populateFormula(selectCount.getFormulaObject()); + this.bottomFormulaPane.populate(selectCount.getFormulaCount()); } else if (selectCountType == SPECIFY.getValue()) { this.serialTextField.setText(selectCount.getSerial()); } @@ -397,9 +395,9 @@ public class DSColumnAdvancedPane extends BasicPane { dSColumn.setSelectCount(selectCount); selectCount.setType(selectCountSelectIndex); if (selectCountSelectIndex == TOP.getValue()) { - selectCount.setFormulaObject(this.topFormulaPane.getFormula()); + selectCount.setFormulaCount(this.topFormulaPane.getFormulaText()); } else if (selectCountSelectIndex == BOTTOM.getValue()) { - selectCount.setFormulaObject(this.bottomFormulaPane.getFormula()); + selectCount.setFormulaCount(this.bottomFormulaPane.getFormulaText()); } else if (selectCountSelectIndex == SPECIFY.getValue()) { selectCount.setSerial(this.serialTextField.getText()); } @@ -409,7 +407,7 @@ public class DSColumnAdvancedPane extends BasicPane { private static class JFormulaField extends JPanel { private CellElement cellElement; - private FormulaTextField formulaTextField; + private UITextField formulaTextField; private String defaultValue; public JFormulaField(String defaultValue) { @@ -419,10 +417,9 @@ public class DSColumnAdvancedPane extends BasicPane { UILabel bottomLabel = new UILabel("="); bottomLabel.setFont(new Font("Dialog", Font.BOLD, 12)); this.add(bottomLabel); - formulaTextField = new FormulaTextField(24); + formulaTextField = new UITextField(24); this.add(formulaTextField); - BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(this.defaultValue); - formulaTextField.setValueAndText(defaultFormula, true); + formulaTextField.setText(defaultValue); UIButton bottomFrmulaButton = new UIButton("..."); this.add(bottomFrmulaButton); @@ -442,24 +439,16 @@ public class DSColumnAdvancedPane extends BasicPane { public String getFormulaText() { return this.formulaTextField.getText(); } - - public void populateFormula(BaseFormula baseFormula) { - - this.formulaTextField.setValueAndText(baseFormula, true); - } - - public BaseFormula getFormula() { - - return this.formulaTextField.getValue(); - } private ActionListener formulaButtonActionListener = new ActionListener() { public void actionPerformed(ActionEvent evt) { - - BaseFormula valueFormula = formulaTextField.getValue(); - if (valueFormula == null) { - valueFormula = BaseFormula.createFormulaBuilder().build(); + BaseFormula valueFormula = BaseFormula.createFormulaBuilder().build(); + String text = formulaTextField.getText(); + if (text == null || text.length() <= 0) { + valueFormula.setContent(defaultValue); + } else { + valueFormula.setContent(text); } final UIFormula formulaPane = FormulaFactory.createFormulaPaneWhenReserveFormula(); @@ -468,7 +457,7 @@ public class DSColumnAdvancedPane extends BasicPane { return; } Object value = cellElement.getValue(); - if (!(value instanceof DSColumn)) { + if (value == null || !(value instanceof DSColumn)) { return; } DSColumn dsColumn = (DSColumn) value; @@ -481,10 +470,9 @@ public class DSColumnAdvancedPane extends BasicPane { public void doOk() { BaseFormula valueFormula = formulaPane.update(); if (valueFormula.getContent().length() <= 1) { - BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(defaultValue); - formulaTextField.setValueAndText(defaultFormula, true); + formulaTextField.setText(defaultValue); } else { - formulaTextField.setValueAndText(valueFormula, true); + formulaTextField.setText(valueFormula.getContent().substring(1)); } } }).setVisible(true); @@ -515,12 +503,12 @@ public class DSColumnAdvancedPane extends BasicPane { DSColumn dSColumn = (DSColumn) value; //formula - BaseFormula valueFormula = dSColumn.getResultObject(); + String valueFormula = dSColumn.getResult(); if (valueFormula == null) { - valueFormula = BaseFormula.createFormulaBuilder().build("$$$"); + valueFormula = "$$$"; } formulaField.populateElement(cellElement); - formulaField.populateFormula(valueFormula); + formulaField.populate(valueFormula); } public void update(CellElement cellElement) { @@ -528,13 +516,13 @@ public class DSColumnAdvancedPane extends BasicPane { return; } Object value = cellElement.getValue(); - if (!(value instanceof DSColumn)) { + if (value == null || !(value instanceof DSColumn)) { return; } DSColumn dSColumn = (DSColumn) (cellElement.getValue()); //formula - dSColumn.setResultObject(this.formulaField.getFormula()); + dSColumn.setResult(this.formulaField.getFormulaText()); } } diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java index 248a274f57..fb80e8891d 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java @@ -12,7 +12,6 @@ import com.fr.design.dscolumn.SelectedDataColumnPane; import com.fr.design.event.UIObserverListener; import com.fr.design.formula.CustomVariableResolver; import com.fr.design.formula.FormulaFactory; -import com.fr.design.formula.FormulaTextField; import com.fr.design.formula.UIFormula; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButtonGroup; @@ -720,12 +719,11 @@ public class CellDSColumnEditor extends CellQuickEditor { centerPane.setPreferredSize(new Dimension(156, 20)); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP); } - BaseFormula baseFormula = dSColumn.getSortFormulaObject(); - if (baseFormula == null) { - BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(); - this.formulaField.populateFormula(defaultFormula); + String sortFormula = dSColumn.getSortFormula(); + if (sortFormula != null && sortFormula.length() >= 1) { + this.formulaField.populate(sortFormula); } else { - this.formulaField.populateFormula(baseFormula); + this.formulaField.populate(DEFAULT_VALUE); } } } @@ -742,7 +740,7 @@ public class CellDSColumnEditor extends CellQuickEditor { if (value instanceof DSColumn) { DSColumn dSColumn = (DSColumn) value; dSColumn.setOrder(this.sortTypePane.getSelectedIndex()); - dSColumn.setSortFormulaObject(this.formulaField.getFormula()); + dSColumn.setSortFormula(this.formulaField.getFormulaText()); } } } @@ -776,7 +774,6 @@ public class CellDSColumnEditor extends CellQuickEditor { */ public class ResultSetFilterConfigPane extends JPanel { private static final String DEFAULT_VALUE = "="; - private final BaseFormula DEFAULT_FORMULA = BaseFormula.createFormulaBuilder().build(DEFAULT_VALUE); private JPanel contentPane; private UIComboBox rsComboBox; @@ -921,8 +918,8 @@ public class CellDSColumnEditor extends CellQuickEditor { CardLayout setCardPaneLayout = (CardLayout) setCardPane.getLayout(); CardLayout tipCardPaneLayout = (CardLayout) tipCardPane.getLayout(); // 重置默认值 - this.topFormulaPane.populateFormula(DEFAULT_FORMULA); - this.bottomFormulaPane.populateFormula(DEFAULT_FORMULA); + this.topFormulaPane.populate(DEFAULT_VALUE); + this.bottomFormulaPane.populate(DEFAULT_VALUE); this.serialTextField.setText(StringUtils.EMPTY); if (selectCount != null) { @@ -930,7 +927,7 @@ public class CellDSColumnEditor extends CellQuickEditor { this.rsComboBox.setSelectedIndex(selectCountType); switch (FilterTypeEnum.getFilterByValue(selectCountType)) { case TOP: - this.topFormulaPane.populateFormula(selectCount.getFormulaObject()); + this.topFormulaPane.populate(selectCount.getFormulaCount()); //前N个 setCardPaneLayout.show(setCardPane, TOP.name()); tipCardPaneLayout.show(tipCardPane, TOP.name()); @@ -941,7 +938,7 @@ public class CellDSColumnEditor extends CellQuickEditor { TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0); break; case BOTTOM: - this.bottomFormulaPane.populateFormula(selectCount.getFormulaObject()); + this.bottomFormulaPane.populate(selectCount.getFormulaCount()); //后N个 setCardPaneLayout.show(setCardPane, BOTTOM.name()); tipCardPaneLayout.show(tipCardPane, BOTTOM.name()); @@ -1022,9 +1019,9 @@ public class CellDSColumnEditor extends CellQuickEditor { dSColumn.setSelectCount(selectCount); //noinspection Duplicates if (selectedFilterIndex == TOP.getValue()) { - selectCount.setFormulaObject(this.topFormulaPane.getFormula()); + selectCount.setFormulaCount(this.topFormulaPane.getFormulaText()); } else if (selectedFilterIndex == BOTTOM.getValue()) { - selectCount.setFormulaObject(this.bottomFormulaPane.getFormula()); + selectCount.setFormulaCount(this.bottomFormulaPane.getFormulaText()); } else if (selectedFilterIndex == SPECIFY.getValue()) { selectCount.setSerial(this.serialTextField.getText()); } @@ -1063,16 +1060,14 @@ public class CellDSColumnEditor extends CellQuickEditor { */ public class JFormulaField extends JPanel { private CellElement cellElement; - private FormulaTextField formulaTextField; + private UITextField formulaTextField; private String defaultValue; public JFormulaField(String defaultValue) { - + this.defaultValue = defaultValue; - BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(this.defaultValue); - formulaTextField = new FormulaTextField(); - formulaTextField.setValueAndText(defaultFormula, false); - + formulaTextField = new UITextField(); + formulaTextField.setText(defaultValue); JPanel textFieldPane = new JPanel(new BorderLayout()); textFieldPane.add(formulaTextField, BorderLayout.CENTER); textFieldPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5)); @@ -1099,16 +1094,6 @@ public class CellDSColumnEditor extends CellQuickEditor { public String getFormulaText() { return this.formulaTextField.getText().trim(); } - - public void populateFormula(BaseFormula baseFormula) { - - this.formulaTextField.setValueAndText(baseFormula, false); - } - - public BaseFormula getFormula() { - - return this.formulaTextField.getValue(); - } /** * 添加事件监听器 @@ -1129,14 +1114,16 @@ public class CellDSColumnEditor extends CellQuickEditor { private ActionListener formulaButtonActionListener = new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { - - BaseFormula valueFormula = formulaTextField.getValue(); - if (valueFormula == null) { - valueFormula = BaseFormula.createFormulaBuilder().build(); + BaseFormula valueFormula = BaseFormula.createFormulaBuilder().build(); + String text = formulaTextField.getText(); + if (text == null || text.length() <= 0) { + valueFormula.setContent(defaultValue); + } else { + valueFormula.setContent(text); } final UIFormula formulaPane = FormulaFactory.createFormulaPaneWhenReserveFormula(); if (cellElement != null) { - final Object value = cellElement.getValue(); + Object value = cellElement.getValue(); if (value instanceof DSColumn) { DSColumn dsColumn = (DSColumn) value; String[] displayNames = DesignTableDataManager.getSelectedColumnNames(DesignTableDataManager.getEditingTableDataSource(), dsColumn.getDSName()); @@ -1146,10 +1133,9 @@ public class CellDSColumnEditor extends CellQuickEditor { public void doOk() { BaseFormula valueFormula = formulaPane.update(); if (valueFormula.getContent().length() <= 1) { - BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(defaultValue); - formulaTextField.setValueAndText(defaultFormula, false); + formulaTextField.setText(defaultValue); } else { - formulaTextField.setValueAndText(valueFormula, false); + formulaTextField.setText(valueFormula.getContent()); } } }).setVisible(true); @@ -1166,7 +1152,7 @@ public class CellDSColumnEditor extends CellQuickEditor { */ public class CustomValuePane extends JPanel { private static final String DEFAULT_VALUE = "=$$$"; - + private JFormulaField formulaField; public CustomValuePane() { @@ -1185,12 +1171,11 @@ public class CellDSColumnEditor extends CellQuickEditor { if (value instanceof DSColumn) { DSColumn dSColumn = (DSColumn) value; //formula - BaseFormula valueFormula = dSColumn.getResultObject(); + String valueFormula = dSColumn.getResult(); if (valueFormula != null) { - formulaField.populateFormula(valueFormula); + formulaField.populate(valueFormula); } else { - BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(DEFAULT_VALUE); - formulaField.populateFormula(defaultFormula); + formulaField.populate(DEFAULT_VALUE); } formulaField.populateElement(cellElement); @@ -1203,7 +1188,8 @@ public class CellDSColumnEditor extends CellQuickEditor { Object value = cellElement.getValue(); if (value instanceof DSColumn) { DSColumn dSColumn = (DSColumn) (cellElement.getValue()); - dSColumn.setResultObject(StringUtils.isEmpty(this.formulaField.getFormulaText()) ? null : this.formulaField.getFormula()); + dSColumn.setResult(StringUtils.isEmpty(this.formulaField.getFormulaText()) ? + null : this.formulaField.getFormulaText()); } } } From f8dd77b91b52af28c73f1d72a6a7f129b1545c19 Mon Sep 17 00:00:00 2001 From: Yvan Date: Tue, 18 Aug 2020 08:58:12 +0800 Subject: [PATCH 018/267] =?UTF-8?q?=E5=88=A4=E6=96=AD=E8=BF=98=E6=98=AF?= =?UTF-8?q?=E8=A6=81=E5=8A=A0=E4=B8=8A=EF=BC=8C=E5=8F=AF=E8=83=BD=E5=9C=A8?= =?UTF-8?q?JWorkBook=E5=AF=B9=E8=B1=A1=E5=88=9D=E5=A7=8B=E5=8C=96=E4=B9=8B?= =?UTF-8?q?=E5=89=8D=EF=BC=8C=E8=BF=99=E8=BE=B9=E7=9A=84=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E5=B0=B1=E5=85=88=E5=BC=80=E5=A7=8B=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/parameter/ParameterDefinitePane.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java b/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java index d1d5f5a961..3262129ca9 100644 --- a/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java +++ b/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java @@ -237,7 +237,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus * * @param workBook */ - public void populate(@NotNull final JWorkBook workBook) { + public void populate(final JWorkBook workBook) { isEditing = false; this.workBook = workBook; ReportParameterAttr reportParameterAttr = workBook.getTarget().getReportParameterAttr(); @@ -426,7 +426,9 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus if (propertyChangeListener != null) { propertyChangeListener.propertyChange(); } - workBook.setAutoHeightForCenterPane(); + if (workBook != null) { + workBook.setAutoHeightForCenterPane(); + } } /** @@ -447,7 +449,9 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus if (propertyChangeListener != null) { propertyChangeListener.propertyChange(); } - workBook.setAutoHeightForCenterPane(); + if (workBook != null) { + workBook.setAutoHeightForCenterPane(); + } } /** @@ -470,7 +474,9 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus if (propertyChangeListener != null) { propertyChangeListener.propertyChange(); } - workBook.setAutoHeightForCenterPane(); + if (workBook != null) { + workBook.setAutoHeightForCenterPane(); + } } /** From 0bb446f45fc50d10790e89a9070c9bc25c501c22 Mon Sep 17 00:00:00 2001 From: Yvan Date: Tue, 18 Aug 2020 11:28:09 +0800 Subject: [PATCH 019/267] =?UTF-8?q?=E5=88=A0=E5=8E=BB=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E7=9A=84=E5=AF=BC=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/parameter/ParameterDefinitePane.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java b/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java index 3262129ca9..e62a5772cd 100644 --- a/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java +++ b/designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java @@ -41,7 +41,6 @@ import com.fr.main.parameter.TemplateParameterAttr; import com.fr.stable.ArrayUtils; import com.fr.stable.bridge.StableFactory; import com.fr.stable.core.PropertyChangeAdapter; -import org.jetbrains.annotations.NotNull; import javax.swing.JCheckBoxMenuItem; import javax.swing.JComponent; From a6feb0d1ded3047189b8e2787eea880d28c593e8 Mon Sep 17 00:00:00 2001 From: shine Date: Wed, 19 Aug 2020 14:56:42 +0800 Subject: [PATCH 020/267] =?UTF-8?q?=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AbstractCustomFieldComboBoxPane.java | 121 +++++++++--------- .../SeriesValueFieldComboBoxPane.java | 12 +- .../design/chartx/data/DataLayoutHelper.java | 69 ++++++++++ .../data/map/AbstractAreaLngLatPane.java | 15 +-- .../chartx/data/map/MapChartDataPane.java | 8 +- .../fields/AbstractCellDataFieldsPane.java | 15 +-- .../fields/AbstractDataSetFieldsPane.java | 15 +-- .../fields/diff/MapDataSetFieldsPane.java | 7 +- .../fr/design/chartx/single/CellDataPane.java | 2 + .../fr/design/chartx/single/DataSetPane.java | 30 ++--- .../design/chartx/single/SingleDataPane.java | 22 +--- .../ExtendedCustomFieldComboBoxPane.java | 12 +- 12 files changed, 176 insertions(+), 152 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/data/DataLayoutHelper.java diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java index e93900ea6f..e4e27b7f49 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java @@ -1,19 +1,18 @@ package com.fr.design.chartx.component; import com.fr.data.util.function.AbstractDataFunction; +import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.chartx.component.correlation.AbstractCorrelationPane; import com.fr.design.chartx.component.correlation.CalculateComboBoxEditorComponent; import com.fr.design.chartx.component.correlation.FieldEditorComponentWrapper; import com.fr.design.chartx.component.correlation.UIComboBoxEditorComponent; import com.fr.design.chartx.component.correlation.UITextFieldEditorComponent; -import com.fr.design.gui.frpane.UIComboBoxPane; +import com.fr.design.chartx.data.DataLayoutHelper; +import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; import com.fr.design.mainframe.chart.gui.data.table.DataPaneHelper; import com.fr.extended.chart.UIComboBoxWithNone; @@ -22,19 +21,25 @@ import com.fr.stable.StringUtils; import javax.swing.JPanel; import javax.swing.SwingConstants; -import java.util.ArrayList; -import java.util.List; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; import java.awt.BorderLayout; +import java.awt.CardLayout; import java.awt.Component; -import java.awt.Dimension; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; +import java.util.ArrayList; +import java.util.List; /** * Created by shine on 2018/9/12. * 系列名使用字段名or字段值的抽象的pane 支持多种属性结构的存取 */ -public abstract class AbstractCustomFieldComboBoxPane extends UIComboBoxPane { +public abstract class AbstractCustomFieldComboBoxPane extends BasicBeanPane { + + private UIButtonGroup nameOrValue; + private JPanel cardPane; + private CardLayout cardLayout; private AbstractUseFieldValuePane useFieldValuePane; @@ -42,73 +47,43 @@ public abstract class AbstractCustomFieldComboBoxPane extends UIComboBoxPane< private List fieldList = new ArrayList(); - @Override - protected void initLayout() { - this.setLayout(new BorderLayout(0, 6)); - JPanel northPane = new JPanel(new BorderLayout()); - northPane.add(jcb, BorderLayout.CENTER); - UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name_From")); - label.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, 20)); - northPane.add(label, BorderLayout.WEST); - this.add(northPane, BorderLayout.NORTH); - this.add(cardPane, BorderLayout.CENTER); - } + public AbstractCustomFieldComboBoxPane() { - @Override - protected List> initPaneList() { useFieldValuePane = createUseFieldValuePane(); customFieldNamePane = createCustomFieldNamePane(); - List> list = new ArrayList>(); - list.add(useFieldValuePane); - list.add(paneWrapper()); - return list; - } - private FurtherBasicBeanPane paneWrapper() { - FurtherBasicBeanPane pane = new FurtherBasicBeanPane() { + nameOrValue = new UIButtonGroup( + new String[]{useFieldValuePane.title4PopupWindow(), customFieldNamePane.title4PopupWindow()}, + new Boolean[]{false, true}); + nameOrValue.setSelectedItem(false); + nameOrValue.addChangeListener(new ChangeListener() { @Override - public String title4PopupWindow() { - return Toolkit.i18nText("Fine-Design_Chart_Enable_Field_Name"); + public void stateChanged(ChangeEvent e) { + checkCardPane(); } + }); + JPanel northPane = DataLayoutHelper.createDataLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Series_Name_From"), nameOrValue); - @Override - public boolean accept(Object ob) { - return false; - } - - @Override - public void reset() { - } + cardLayout = new CardLayout(); + cardPane = new JPanel(cardLayout); + cardPane.add(useFieldValuePane, useFieldValuePane.title4PopupWindow()); + cardPane.add(customFieldNamePane, customFieldNamePane.title4PopupWindow()); - @Override - public void populateBean(Object ob) { - } - - @Override - public Object updateBean() { - return null; - } - }; - pane.setLayout(new BorderLayout(0, 6)); - pane.add(customFieldNamePane, BorderLayout.CENTER); - return pane; + this.setLayout(new BorderLayout(0, 6)); + this.add(northPane, BorderLayout.NORTH); + this.add(cardPane, BorderLayout.CENTER); } protected abstract AbstractUseFieldValuePane createUseFieldValuePane(); protected abstract AbstractCustomFieldNamePane createCustomFieldNamePane(); - @Override - protected String title4PopupWindow() { - return StringUtils.EMPTY; - } - protected boolean valueComboBoxHasNone() { return false; } public void checkBoxUse(boolean hasUse) { - jcb.setEnabled(hasUse); + nameOrValue.setEnabled(hasUse); useFieldValuePane.checkBoxUse(hasUse); } @@ -122,6 +97,19 @@ public abstract class AbstractCustomFieldComboBoxPane extends UIComboBoxPane< fieldList = columnNameList; } + private void checkCardPane() { + cardLayout.show(cardPane, nameOrValue.getSelectedItem() ? customFieldNamePane.title4PopupWindow() : useFieldValuePane.title4PopupWindow()); + } + + protected void populateNameOrValue(boolean b) { + nameOrValue.setSelectedItem(b); + checkCardPane(); + } + + protected boolean updateNameOrValue() { + return nameOrValue.getSelectedItem(); + } + protected void populateCustomFieldNamePane(T t) { customFieldNamePane.populateBean(t); } @@ -138,6 +126,16 @@ public abstract class AbstractCustomFieldComboBoxPane extends UIComboBoxPane< useFieldValuePane.updateBean(t); } + @Override + public T updateBean() { + return null; + } + + @Override + protected String title4PopupWindow() { + return null; + } + protected abstract class AbstractUseFieldValuePane extends FurtherBasicBeanPane { private UIComboBox series; private UIComboBox value; @@ -169,11 +167,7 @@ public abstract class AbstractCustomFieldComboBoxPane extends UIComboBoxPane< new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Summary_Method"), SwingConstants.LEFT), function}, }; - double p = TableLayout.PREFERRED; - double[] columnSize = {78, 122}; - double[] rowSize = {p, p, p}; - - JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + JPanel panel = DataLayoutHelper.createDataLayoutPane(components); this.setLayout(new BorderLayout(0, 6)); this.add(panel, BorderLayout.CENTER); @@ -258,5 +252,10 @@ public abstract class AbstractCustomFieldComboBoxPane extends UIComboBoxPane< protected Object[] createLine() { return new String[]{StringUtils.EMPTY, StringUtils.EMPTY, Toolkit.i18nText("Fine-Design_Chart_Use_None")}; } + + @Override + protected String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Chart_Enable_Field_Name"); + } } } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/SeriesValueFieldComboBoxPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/SeriesValueFieldComboBoxPane.java index 4372cf0db1..e38b3965d4 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/SeriesValueFieldComboBoxPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/SeriesValueFieldComboBoxPane.java @@ -27,23 +27,21 @@ public class SeriesValueFieldComboBoxPane extends AbstractCustomFieldComboBoxPan @Override public void populateBean(SeriesValueCorrelationDefinition ob) { + populateNameOrValue(ob.isCustomFieldValue()); if (ob.isCustomFieldValue()) { populateCustomFieldNamePane(ob); - jcb.setSelectedIndex(1); } else { populateUseFieldValuePane(ob); - jcb.setSelectedIndex(0); } } @Override public void updateBean(SeriesValueCorrelationDefinition ob) { - if (jcb.getSelectedIndex() == 0) { - ob.setCustomFieldValue(false); - updateUseFieldValuePane(ob); - } else { - ob.setCustomFieldValue(true); + ob.setCustomFieldValue(updateNameOrValue()); + if (ob.isCustomFieldValue()) { updateCustomFieldNamePane(ob); + } else { + updateUseFieldValuePane(ob); } } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/DataLayoutHelper.java b/designer-chart/src/main/java/com/fr/design/chartx/data/DataLayoutHelper.java new file mode 100644 index 0000000000..98ae28085c --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/DataLayoutHelper.java @@ -0,0 +1,69 @@ +package com.fr.design.chartx.data; + +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; + +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.awt.Component; +import java.util.Arrays; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2020/7/22 + */ +public class DataLayoutHelper { + + public static int WIDTH = 150; + public static int LABEL_HEIGHT = 20; + public static int LABEL_WIDTH = 65; + + public static int LEFT_GAP = 15; + public static int RIGHT_GAP = 10; + + public static void setWIDTH(int WIDTH) { + DataLayoutHelper.WIDTH = WIDTH; + } + + public static void setLabelHeight(int labelHeight) { + LABEL_HEIGHT = labelHeight; + } + + public static void setLabelWidth(int labelWidth) { + LABEL_WIDTH = labelWidth; + } + + public static void setLeftGap(int leftGap) { + LEFT_GAP = leftGap; + } + + public static void setRightGap(int rightGap) { + RIGHT_GAP = rightGap; + } + + public static JPanel createDataLayoutPane(Component[][] components) { + int len = components.length; + double p = TableLayout.PREFERRED; + double[] columnSize = {DataLayoutHelper.LABEL_WIDTH, DataLayoutHelper.WIDTH}; + double[] rowSize = new double[len]; + Arrays.fill(rowSize, p); + + return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + } + + public static JPanel createDataLayoutPane(String label, Component component) { + Component[][] components = new Component[][]{ + new Component[]{new UILabel(label, SwingConstants.LEFT), component} + }; + + return createDataLayoutPane(components); + } + + public static void addNormalBorder(JComponent component) { + component.setBorder(BorderFactory.createEmptyBorder(0, DataLayoutHelper.LEFT_GAP, 0, DataLayoutHelper.RIGHT_GAP)); + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/map/AbstractAreaLngLatPane.java b/designer-chart/src/main/java/com/fr/design/chartx/data/map/AbstractAreaLngLatPane.java index 09393918a5..53c1cde759 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/data/map/AbstractAreaLngLatPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/map/AbstractAreaLngLatPane.java @@ -1,18 +1,15 @@ package com.fr.design.chartx.data.map; +import com.fr.design.chartx.data.DataLayoutHelper; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.chart.gui.ChartDataPane; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.SwingConstants; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.util.Arrays; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Component; @@ -67,8 +64,10 @@ public abstract class AbstractAreaLngLatPane extends JPanel { locationType.setSelectedIndex(0); + JPanel northPane = DataLayoutHelper.createDataLayoutPane(Toolkit.i18nText("FR-Plugin_Design_Geographic_Location"), locationType); + this.setLayout(new BorderLayout(0, 6)); - this.add(locationType, BorderLayout.NORTH); + this.add(northPane, BorderLayout.NORTH); this.add(centerPane, BorderLayout.CENTER); } @@ -103,12 +102,8 @@ public abstract class AbstractAreaLngLatPane extends JPanel { for (int i = 0; i < len; i++) { components[i] = new Component[]{new UILabel(labels[i], SwingConstants.LEFT), fieldComponents[i]}; } - double p = TableLayout.PREFERRED; - double[] columnSize = {ChartDataPane.LABEL_WIDTH, 122}; - double[] rowSize = new double[len]; - Arrays.fill(rowSize, p); - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 6); + return DataLayoutHelper.createDataLayoutPane(components); } } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java index fd4790d57d..c6686dece9 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java @@ -10,7 +10,6 @@ import com.fr.design.chartx.fields.diff.PointMapCellDataFieldsPane; import com.fr.design.chartx.fields.diff.PointMapDataSetFieldsPane; import com.fr.design.chartx.single.SingleDataPane; import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.type.MapType; import com.fr.van.chart.map.designer.VanMapAreaPointAndLineGroupPane; @@ -33,11 +32,8 @@ public class MapChartDataPane extends AbstractChartDataPane { this.setLayout(new BorderLayout()); this.add(cellDataFieldsPane, BorderLayout.CENTER); + DataLayoutHelper.addNormalBorder(this); } @Override diff --git a/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java b/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java index cfb9a2c18a..3df0d3d6d5 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java @@ -3,25 +3,20 @@ package com.fr.design.chartx.single; import com.fr.chartx.data.DataSetDefinition; import com.fr.data.impl.NameTableData; import com.fr.design.beans.FurtherBasicBeanPane; +import com.fr.design.chartx.data.DataLayoutHelper; import com.fr.design.chartx.fields.AbstractDataSetFieldsPane; import com.fr.design.data.tabledata.wrapper.TableDataWrapper; -import com.fr.design.gui.ilable.BoldFontTextLabel; -import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.DatabaseTableDataPane; -import com.fr.design.utils.gui.UIComponentUtils; -import java.util.List; +import javax.swing.JPanel; import java.awt.BorderLayout; -import java.awt.Dimension; +import java.util.List; /** * Created by shine on 2019/5/21. */ public class DataSetPane extends FurtherBasicBeanPane { - private static final int TABLE_DATA_LABEL_LINE_WRAP_WIDTH = 65; - private static final int TABLE_DATA_PANE_WIDTH = 246; private DatabaseTableDataPane tableDataPane; @@ -32,24 +27,27 @@ public class DataSetPane extends FurtherBasicBeanPane { } private void initComps(AbstractDataSetFieldsPane dataSetFieldsPane) { - UILabel label = new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Table_Data")); - UIComponentUtils.setLineWrap(label, TABLE_DATA_LABEL_LINE_WRAP_WIDTH); - UIComponentUtils.setPreferedWidth(label, ChartDataPane.LABEL_WIDTH); - - tableDataPane = new DatabaseTableDataPane(label) { + tableDataPane = new DatabaseTableDataPane(null) { @Override protected void userEvent() { refreshBoxListAndTableName(); checkBoxUse(); } + + @Override + protected void setBorder() { + } + }; - tableDataPane.setPreferredSize(new Dimension(TABLE_DATA_PANE_WIDTH, tableDataPane.getPreferredSize().height)); + this.dataSetFieldsPane = dataSetFieldsPane; - this.setLayout(new BorderLayout()); - this.add(tableDataPane, BorderLayout.NORTH); + JPanel northPane = DataLayoutHelper.createDataLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Table_Data"), tableDataPane); + this.setLayout(new BorderLayout(0, 6)); + this.add(northPane, BorderLayout.NORTH); this.add(dataSetFieldsPane, BorderLayout.CENTER); + DataLayoutHelper.addNormalBorder(this); checkBoxUse(); } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/single/SingleDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/single/SingleDataPane.java index dc4dfc65ad..06ed06649b 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/single/SingleDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/single/SingleDataPane.java @@ -3,28 +3,22 @@ package com.fr.design.chartx.single; import com.fr.chartx.data.AbstractDataDefinition; import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane; +import com.fr.design.chartx.data.DataLayoutHelper; import com.fr.design.chartx.fields.AbstractCellDataFieldsPane; import com.fr.design.chartx.fields.AbstractDataSetFieldsPane; -import com.fr.design.constants.LayoutConstants; import com.fr.design.gui.frpane.UIComboBoxPane; -import com.fr.design.gui.ilable.BoldFontTextLabel; -import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.utils.gui.UIComponentUtils; -import javax.swing.BorderFactory; import javax.swing.JPanel; +import java.awt.BorderLayout; import java.util.ArrayList; import java.util.List; -import java.awt.BorderLayout; /** * Created by shine on 2019/5/21. */ public class SingleDataPane extends BasicBeanPane { - private static final int TABLE_DATA_LABEL_LINE_WIDTH = 81; - private UIComboBoxPane comboBoxPane; private DataSetPane dataSetPane; @@ -50,18 +44,12 @@ public class SingleDataPane extends BasicBeanPane { } protected void initLayout() { - this.setLayout(new BorderLayout(LayoutConstants.HGAP_LARGE, 6)); - JPanel northPane = new JPanel(new BorderLayout(LayoutConstants.HGAP_LARGE, 0)); + this.setLayout(new BorderLayout(0, 6)); + JPanel northPane = DataLayoutHelper.createDataLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Data_Source"), jcb); + DataLayoutHelper.addNormalBorder(northPane); - UILabel label = new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Data_Source")); - UIComponentUtils.setPreferedWidth(label, TABLE_DATA_LABEL_LINE_WIDTH); - northPane.add(label,BorderLayout.WEST); - northPane.add(jcb, BorderLayout.CENTER); - - northPane.setBorder(BorderFactory.createEmptyBorder(5,24,0,15)); this.add(northPane, BorderLayout.NORTH); this.add(cardPane, BorderLayout.CENTER); - } @Override diff --git a/designer-chart/src/main/java/com/fr/extended/chart/ExtendedCustomFieldComboBoxPane.java b/designer-chart/src/main/java/com/fr/extended/chart/ExtendedCustomFieldComboBoxPane.java index 108d4b605e..119d73bda6 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/ExtendedCustomFieldComboBoxPane.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/ExtendedCustomFieldComboBoxPane.java @@ -27,21 +27,19 @@ public class ExtendedCustomFieldComboBoxPane extends AbstractCustomFieldComboBox public void populateBean(AbstractDataConfig ob) { if (ob.isCustomName()) { populateCustomFieldNamePane(ob); - jcb.setSelectedIndex(1); } else { populateUseFieldValuePane(ob); - jcb.setSelectedIndex(0); } + populateNameOrValue(ob.isCustomName()); } @Override public void updateBean(AbstractDataConfig ob) { - if (jcb.getSelectedIndex() == 0) { - ob.setCustomName(false); - updateUseFieldValuePane(ob); - } else { - ob.setCustomName(true); + ob.setCustomName(updateNameOrValue()); + if (ob.isCustomName()) { updateCustomFieldNamePane(ob); + } else { + updateUseFieldValuePane(ob); } } From 2b32641bae3c12e3260aa124ec350c5ebad499e8 Mon Sep 17 00:00:00 2001 From: shine Date: Wed, 19 Aug 2020 15:01:17 +0800 Subject: [PATCH 021/267] =?UTF-8?q?=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/chartx/data/map/MapChartDataPane.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java index c6686dece9..148bcd7ca2 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java @@ -10,6 +10,7 @@ import com.fr.design.chartx.fields.diff.PointMapCellDataFieldsPane; import com.fr.design.chartx.fields.diff.PointMapDataSetFieldsPane; import com.fr.design.chartx.single.SingleDataPane; import com.fr.design.gui.frpane.AttributeChangeListener; +import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.type.MapType; import com.fr.van.chart.map.designer.VanMapAreaPointAndLineGroupPane; @@ -32,7 +33,11 @@ public class MapChartDataPane extends AbstractChartDataPane Date: Wed, 19 Aug 2020 17:44:17 +0800 Subject: [PATCH 022/267] =?UTF-8?q?REPORT-37769=20=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E5=A4=9Atab=EF=BC=8C=E8=AE=BE=E7=BD=AE=E9=80=89=E4=B8=AD?= =?UTF-8?q?=E8=83=8C=E6=99=AF=EF=BC=8C=E5=A6=82=E6=9E=9C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=B8=80=E4=B8=AAtab=EF=BC=8C=E7=AC=AC=E4=B8=80=E4=B8=AAtab0?= =?UTF-8?q?=E7=9A=84=E9=80=89=E4=B8=AD=E8=83=8C=E6=99=AF=E5=B0=B1=E4=BC=9A?= =?UTF-8?q?=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/designer/creator/cardlayout/XWCardTagLayout.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java index dc8bb90801..49f246256c 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java @@ -143,7 +143,7 @@ public class XWCardTagLayout extends XWHorizontalBoxLayout { fitLayout.setInitialBackground(layout.getTemplateStyle().getTabDefaultBackground()); fitLayout.setCustomStyle(true); } - tabFitLayout.setxCardSwitchButton((XCardSwitchButton)this.getComponent(0)); + tabFitLayout.setxCardSwitchButton((XCardSwitchButton)this.getComponent(index)); tabFitLayout.checkButonType(); tabFitLayout.setBackupParent(cardLayout); cardLayout.add(tabFitLayout, widgetName); From 48ee4a25a76e98065a3793d3e7dd304701444888 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 19 Aug 2020 17:48:12 +0800 Subject: [PATCH 023/267] =?UTF-8?q?CHART-15175=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E6=95=B0=E6=8D=AE=E7=9A=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=82=B9=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/van/chart/box/VanChartBoxPlotTooltipPane.java | 4 ---- .../com/fr/van/chart/box/VanChartBoxTooltipContentPane.java | 6 +++++- .../java/com/fr/van/chart/box/VanChartBoxTooltipPane.java | 6 ------ .../chart/box/data/report/BoxPlotReportDataContentPane.java | 2 +- .../chart/box/data/table/BoxPlotTableDataContentPane.java | 2 +- 5 files changed, 7 insertions(+), 13 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotTooltipPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotTooltipPane.java index a68eb55964..f1cae6e3bf 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotTooltipPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotTooltipPane.java @@ -25,8 +25,4 @@ public class VanChartBoxPlotTooltipPane extends VanChartPlotTooltipPane { protected boolean hasTooltipSeriesType() { return false; } - - public void checkContentVisible(boolean isDetailed) { - ((VanChartBoxTooltipContentPane) tooltipContentPane).checkFormatVisible(isDetailed); - } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java index 8831b50491..b2271cc337 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java @@ -178,7 +178,7 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { } protected AttrTooltipContent createAttrTooltip() { - return new AttrBoxTooltipContent(); + return new AttrBoxTooltipContent(detailed); } protected void populateFormatPane(AttrTooltipContent attrTooltipContent) { @@ -195,6 +195,8 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { q1.populate(boxTooltipContent.getQ1()); min.populate(boxTooltipContent.getMin()); outlier.populate(boxTooltipContent.getOutlier()); + + checkFormatVisible(boxTooltipContent.isDetailed()); } } @@ -212,6 +214,8 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { q1.update(boxTooltipContent.getQ1()); min.update(boxTooltipContent.getMin()); outlier.update(boxTooltipContent.getOutlier()); + + boxTooltipContent.setDetailed(this.detailed); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipPane.java index 955f974534..ad5840267a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipPane.java @@ -4,7 +4,6 @@ import com.fr.chart.base.DataSeriesCondition; import com.fr.chart.chartattr.Plot; import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.base.AttrTooltip; -import com.fr.plugin.chart.box.VanChartBoxPlot; import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.tooltip.VanChartPlotTooltipPane; import com.fr.van.chart.designer.style.tooltip.VanChartTooltipPane; @@ -25,11 +24,6 @@ public class VanChartBoxTooltipPane extends VanChartTooltipPane { if (tooltipPane instanceof VanChartBoxPlotTooltipPane) { tooltipPane.populate((AttrTooltip) attr); - - VanChartBoxPlotTooltipPane boxPlotTooltipPane = (VanChartBoxPlotTooltipPane) tooltipPane; - VanChartBoxPlot boxPlot = (VanChartBoxPlot) plot; - - boxPlotTooltipPane.checkContentVisible(boxPlot.isDetailed()); } } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/data/report/BoxPlotReportDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/data/report/BoxPlotReportDataContentPane.java index f6d6090356..037c0aa70b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/data/report/BoxPlotReportDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/data/report/BoxPlotReportDataContentPane.java @@ -101,7 +101,7 @@ public class BoxPlotReportDataContentPane extends AbstractReportDataContentPane boolean isDetailed = dataType.getSelectedIndex() == 0; report.setDetailed(isDetailed); - ((VanChartBoxPlot) initplot).setDetailed(isDetailed); + ((VanChartBoxPlot) initplot).updateDetailedAttr(isDetailed); } if (detailedDataSeriesPane != null) { detailedDataSeriesPane.updateBean(collection); diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java index 92b554d0d2..4fa2296aa0 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java @@ -154,7 +154,7 @@ public class BoxPlotTableDataContentPane extends AbstractTableDataContentPane { boolean isDetailed = dataType.getSelectedIndex() == 0; table.setDetailed(isDetailed); - ((VanChartBoxPlot) initplot).setDetailed(isDetailed); + ((VanChartBoxPlot) initplot).updateDetailedAttr(isDetailed); } if (seriesTypeComboxPane != null) { seriesTypeComboxPane.updateBean(collection); From e0f7bf6ac3b2132b7b2db6c8a102b73c6ed462b9 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 19 Aug 2020 18:20:06 +0800 Subject: [PATCH 024/267] =?UTF-8?q?=E8=B0=83=E6=95=B4check=E7=9A=84?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/van/chart/box/VanChartBoxTooltipContentPane.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java index b2271cc337..77b16b4993 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java @@ -32,7 +32,7 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { public VanChartBoxTooltipContentPane(VanChartStylePane parent, JPanel showOnPane, boolean isDetailed) { super(parent, showOnPane); - this.detailed = isDetailed; + checkFormatVisible(isDetailed); } protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { @@ -83,8 +83,6 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { commonPanel.add(createDataNumberPane(), BorderLayout.CENTER); commonPanel.add(createDataDetailPane(), BorderLayout.SOUTH); - checkFormatVisible(detailed); - return commonPanel; } From 55e1b7288f6dd45bb41fd4e99d8844cf34796d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Thu, 20 Aug 2020 10:15:18 +0800 Subject: [PATCH 025/267] =?UTF-8?q?CHART-15216=20=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E4=B8=AD=E4=B8=8D=E5=BA=94=E8=AF=A5=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E5=8B=BE=E9=80=89=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VanChartLineMapTooltipConditionPane.java | 4 +-- ...VanChartLineMapPlotTooltipNoCheckPane.java | 36 +++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapPlotTooltipNoCheckPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLineMapTooltipConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLineMapTooltipConditionPane.java index 408480a791..d3ed1ab7a5 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLineMapTooltipConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLineMapTooltipConditionPane.java @@ -4,7 +4,7 @@ package com.fr.van.chart.designer.other.condition.item; import com.fr.chart.chartattr.Plot; import com.fr.design.condition.ConditionAttributesPane; import com.fr.van.chart.designer.style.tooltip.VanChartPlotTooltipPane; -import com.fr.van.chart.map.line.VanChartLineMapPlotTooltipPane; +import com.fr.van.chart.map.line.VanChartLineMapPlotTooltipNoCheckPane; /** * Created by hufan on 2016/12/23. @@ -16,6 +16,6 @@ public class VanChartLineMapTooltipConditionPane extends VanChartTooltipConditio } protected VanChartPlotTooltipPane createTooltipContentsPane() { - return new VanChartLineMapPlotTooltipPane(getPlot(), null); + return new VanChartLineMapPlotTooltipNoCheckPane(getPlot(), null); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapPlotTooltipNoCheckPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapPlotTooltipNoCheckPane.java new file mode 100644 index 0000000000..88b72c5709 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapPlotTooltipNoCheckPane.java @@ -0,0 +1,36 @@ +package com.fr.van.chart.map.line; + +import com.fr.chart.chartattr.Plot; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.i18n.Toolkit; +import com.fr.plugin.chart.base.AttrTooltip; +import com.fr.van.chart.designer.style.VanChartStylePane; + +import java.awt.BorderLayout; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-08-20 + */ +public class VanChartLineMapPlotTooltipNoCheckPane extends VanChartLineMapPlotTooltipPane { + + public VanChartLineMapPlotTooltipNoCheckPane(Plot plot, VanChartStylePane parent) { + super(plot, parent); + } + + protected void addComponents(Plot plot) { + isTooltipShow = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Use_Tooltip")); + tooltipPane = createTooltipPane(plot); + + this.setLayout(new BorderLayout()); + this.add(tooltipPane, BorderLayout.CENTER); + } + + @Override + public void populate(AttrTooltip attr) { + super.populate(attr); + isTooltipShow.setSelected(true); + tooltipPane.setEnabled(isTooltipShow.isSelected()); + } +} From 6251d571522ef136311fee0492e0b6234247319c Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 20 Aug 2020 11:34:39 +0800 Subject: [PATCH 026/267] =?UTF-8?q?REPORT-29547=20=E3=80=90=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E3=80=91=E8=AE=BE=E8=AE=A1=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7=E4=B8=8B=E6=8B=89=E6=8C=89=E9=92=AE=E4=B8=AD?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E5=85=B6=E5=AE=83=E6=A8=A1=E6=9D=BF=E6=96=87?= =?UTF-8?q?=E5=AD=97=E5=B1=95=E7=A4=BA=E4=B8=8D=E5=85=A8=201.=20=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE"=E5=85=B3=E9=97=AD=E5=85=B6=E5=AE=83=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF"=E8=BF=99=E4=B8=AA=E7=BB=84=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E6=B0=B4=E5=B9=B3=E5=B1=85=E4=B8=AD=202.=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9B=E5=AF=BC=E5=8C=85=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/file/MutilTempalteTabPane.java | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java index e4ab990337..69aee1b50e 100644 --- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java @@ -17,14 +17,31 @@ import com.fr.file.FILE; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.Constants; -import com.fr.stable.ProductConstants; import com.fr.third.javax.annotation.Nonnull; import com.fr.workspace.WorkContext; import com.fr.workspace.server.lock.TplOperator; -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.ButtonModel; +import javax.swing.Icon; +import javax.swing.JComponent; +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JSeparator; +import javax.swing.SwingConstants; import javax.swing.plaf.basic.BasicMenuItemUI; -import java.awt.*; +import java.awt.AWTEvent; +import java.awt.AlphaComposite; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.GradientPaint; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.RenderingHints; import java.awt.event.AWTEventListener; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -171,6 +188,8 @@ public class MutilTempalteTabPane extends JComponent { private UIMenuItem initCloseOther() { UIMenuItem closeOther = new UIMenuItem(Toolkit.i18nText("Fine-Design_Basic_FS_Close_Other_Templates")); + // Yvan: 英文下文本显示不全,后续发现如果将模板名设置的比较短,其它语言也会出现显示不全的问题,所以设置一下文本水平居中 + closeOther.setHorizontalAlignment(SwingConstants.CENTER); setListDownItemPreferredSize(closeOther); closeOther.addActionListener(new ActionListener() { @Override From de38c12ddbbfa0235b7f9d4d2929fe580c67fce4 Mon Sep 17 00:00:00 2001 From: Hans Date: Fri, 21 Aug 2020 14:38:55 +0800 Subject: [PATCH 027/267] =?UTF-8?q?MOBILE-28888=20Tab=E6=89=8B=E5=8A=BF?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=AE=BE=E8=AE=A1=E5=99=A8=E7=AB=AF=E5=BC=80?= =?UTF-8?q?=E5=8F=91=201.=20=E7=A7=BB=E5=8A=A8=E7=AB=AFTab=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E9=9D=A2=E6=9D=BF=E6=96=B0=E5=A2=9E=E4=B8=89=E4=B8=AA?= =?UTF-8?q?tab=E9=80=9A=E7=94=A8=E5=B1=9E=E6=80=A7=EF=BC=8C=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=A0=87=E9=A2=98=EF=BC=8C=E6=BB=91=E5=8A=A8=E5=88=87?= =?UTF-8?q?=E6=8D=A2=EF=BC=8C=E6=98=BE=E7=A4=BA=E5=9C=86=E7=82=B9=E6=8C=87?= =?UTF-8?q?=E7=A4=BA=E5=99=A8=EF=BC=88=E9=80=9A=E7=94=A8=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=EF=BC=89=202.=20=E5=85=BC=E5=AE=B9=E6=97=A7?= =?UTF-8?q?=E6=A8=A1=E7=89=88=EF=BC=8C=E8=BD=AC=E6=8D=A2Tab=E5=B0=B1?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E5=88=86=E6=95=A3=E7=9A=84=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E5=88=B0Tab=E5=B1=9E=E6=80=A7=E9=9D=A2=E6=9D=BF=E7=9A=84?= =?UTF-8?q?=E9=80=9A=E7=94=A8=E5=B1=9E=E6=80=A7=203.=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=B8=AD=E8=8B=B1=E6=96=87=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/style/color/NewColorSelectBox.java | 20 +- .../mobile/TabMobileWidgetDefinePane.java | 13 +- .../component/MobileTabCommonSettingPane.java | 198 ++++++++++++++++++ 3 files changed, 222 insertions(+), 9 deletions(-) create mode 100644 designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java diff --git a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectBox.java b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectBox.java index 6e3e688c8b..4f291c6398 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectBox.java +++ b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectBox.java @@ -30,23 +30,27 @@ public class NewColorSelectBox extends AbstractSelectBox implements UIObs iniListener(); } - private void iniListener(){ + protected void iniListener(){ if(shouldResponseChangeListener()){ this.addSelectChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { - if(uiObserverListener == null){ - return; - } - if (globalNameListener != null && shouldResponseNameListener()){ - globalNameListener.setGlobalName(newColorSelectBoxName); - } - uiObserverListener.doChange(); + attributeChange(); } }); } } + protected void attributeChange() { + if(uiObserverListener == null){ + return; + } + if (globalNameListener != null && shouldResponseNameListener()){ + globalNameListener.setGlobalName(newColorSelectBoxName); + } + uiObserverListener.doChange(); + } + /** * 初始化下拉面板 * @param preferredWidth 面板大小 diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java index 5919985d59..9b0bc18b3b 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java @@ -19,6 +19,7 @@ import com.fr.design.widget.ui.designer.mobile.component.MobileAdvanceInnerPane; import com.fr.design.widget.ui.designer.mobile.component.MobileBookMarkUsePane; import com.fr.design.widget.ui.designer.mobile.component.MobileComponentMarginPane; import com.fr.design.widget.ui.designer.mobile.component.MobileComponentLayoutIntervalPane; +import com.fr.design.widget.ui.designer.mobile.component.MobileTabCommonSettingPane; import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.general.cardtag.mobile.MobileTemplateStyle; @@ -34,6 +35,7 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { private MobileComponentMarginPane marginPane; private MobileComponentLayoutIntervalPane intervalPane; private MobileBookMarkUsePane mobileBookMarkUsePane; + private MobileTabCommonSettingPane mobileTabCommonSettingPane; public TabMobileWidgetDefinePane(XCreator xCreator) { this.xCreator = xCreator; @@ -73,6 +75,8 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { mobileBookMarkUsePane = new MobileBookMarkUsePane(); innerAdvancePane.add(mobileBookMarkUsePane, BorderLayout.CENTER); } + mobileTabCommonSettingPane = new MobileTabCommonSettingPane(); + innerAdvancePane.add(mobileTabCommonSettingPane, BorderLayout.SOUTH); innerAdvancePane.add(marginPane, BorderLayout.NORTH); UIExpandablePane advancePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, innerAdvancePane); UIExpandablePane layoutPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout"), 280, 20, intervalPane); @@ -88,7 +92,8 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { @Override public void populate(FormDesigner designer) { WCardTagLayout wCardTagLayout = (WCardTagLayout) xCreator.toData(); - templateStyleEditor.setValue((wCardTagLayout).getMobileTemplateStyle()); + MobileTemplateStyle mobileTemplateStyle = wCardTagLayout.getMobileTemplateStyle(); + templateStyleEditor.setValue(mobileTemplateStyle); // 数据 populate 完成后,再设置监听 this.bindListeners2Widgets(); this.addAttributeChangeListener(changeListener); @@ -101,6 +106,9 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { if (mobileBookMarkUsePane != null) { mobileBookMarkUsePane.populate(xCreator); } + if (mobileTabCommonSettingPane != null) { + mobileTabCommonSettingPane.populate(mobileTemplateStyle); + } } @Override @@ -117,5 +125,8 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane { if (mobileBookMarkUsePane != null) { mobileBookMarkUsePane.update(xCreator); } + if (mobileTabCommonSettingPane != null) { + mobileTabCommonSettingPane.update(wCardTagLayout.getMobileTemplateStyle()); + } } } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java new file mode 100644 index 0000000000..e1142117ae --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java @@ -0,0 +1,198 @@ +package com.fr.design.widget.ui.designer.mobile.component; + +import com.fr.design.constants.LayoutConstants; +import com.fr.design.designer.IntervalConstants; +import com.fr.design.designer.beans.events.DesignerEvent; +import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.ibutton.ModeButtonGroup; +import com.fr.design.gui.ibutton.UIRadioButton; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.WidgetPropertyPane; +import com.fr.design.style.color.NewColorSelectBox; +import com.fr.general.cardtag.mobile.MobileTemplateStyle; + +import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.*; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +public class MobileTabCommonSettingPane extends BasicPane { + + private UICheckBox showTabTitleCheck; + private UICheckBox tabSlideCheck; + private UICheckBox showTabDotIndicatorCheck; + private ModeButtonGroup buttonGroup; + private NewColorSelectBox initDotColorBox; + private NewColorSelectBox selectDotColorBox; + + public MobileTabCommonSettingPane() { + initComponent(); + } + + private void initComponent() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + + this.showTabTitleCheck = new UICheckBox( + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Show_Title"), true) { + @Override + protected void initListener() { + this.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + attributeChange(); + } + }); + } + }; + this.tabSlideCheck = new UICheckBox( + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Slide"), true) { + @Override + protected void initListener() { + this.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + attributeChange(); + } + }); + } + }; + this.showTabDotIndicatorCheck = new UICheckBox( + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Show_Indicator"), true) { + @Override + protected void initListener() { + this.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + attributeChange(); + } + }); + } + }; + + UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Show_Indicator_type")); + JPanel dotIndicatorShowTypePane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); + addIndicatorShowTypeButton(dotIndicatorShowTypePane); + + UILabel initColorLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Init_Fill")); + UILabel selectColor = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Select_Fill")); + initDotColorBox = new NewColorSelectBox(0){ + @Override + protected void iniListener() { + } + @Override + public void mouseEntered(MouseEvent e) { + super.mousePressed(e); + this.attributeChange(); + } + }; + selectDotColorBox = new NewColorSelectBox(0){ + @Override + protected void iniListener() { + } + + @Override + public void mouseEntered(MouseEvent e) { + super.mousePressed(e); + this.attributeChange(); + } + }; + JPanel initDotColorPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{initColorLabel, initDotColorBox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); + JPanel selectDotColorPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{selectColor, selectDotColorBox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); + + double[] rowSize = {TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED}; + double[] columnSize = {TableLayout.FILL}; + int[][] rowCount = {{1}, {1}, {1}}; + double[] verticalGaps = {10, 10, 10}; + double[] dotSettingColumnSize = {TableLayout.PREFERRED, TableLayout.FILL}; + + Component[][] components = new Component[][]{ + new Component[]{this.showTabTitleCheck}, + new Component[]{this.tabSlideCheck}, + new Component[]{this.showTabDotIndicatorCheck} + }; + + JPanel tabBaseConfigPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, + IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1); + tabBaseConfigPane.setBorder(BorderFactory.createEmptyBorder(0, 0, IntervalConstants.INTERVAL_L1, 0)); + + JPanel dotIndicatorSettingPanel = TableLayoutHelper.createDiffVGapTableLayoutPane(new JComponent[][]{ + {label, dotIndicatorShowTypePane}, + {initColorLabel, initDotColorPane}, + {selectColor, selectDotColorPane}}, rowSize, dotSettingColumnSize, 0, verticalGaps); + dotIndicatorSettingPanel.setBorder( + BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1, 0) + ); + + final JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + jPanel.add(tabBaseConfigPane, BorderLayout.NORTH); + jPanel.add(dotIndicatorSettingPanel, BorderLayout.CENTER); + + this.add(jPanel, BorderLayout.CENTER); + + showTabDotIndicatorCheck.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + dotIndicatorSettingPanel.setVisible(showTabDotIndicatorCheck.isSelected()); + } + }); + } + + public void populate(MobileTemplateStyle mobileTemplateStyle) { + this.showTabTitleCheck.setSelected(mobileTemplateStyle.isShowTabTitle()); + this.showTabDotIndicatorCheck.setSelected(mobileTemplateStyle.isShowDotIndicator()); + this.tabSlideCheck.setSelected(mobileTemplateStyle.canSlide()); + Color initDotColor = mobileTemplateStyle.getIndicatorInitialColor(); + Color selectDotColor = mobileTemplateStyle.getIndicatorSelectColor(); + int dotIndicatorShowType = mobileTemplateStyle.getDotIndicatorShowType(); + this.populateColorBox(initDotColorBox, initDotColor, MobileTemplateStyle.DEFAULT_INITIAL_DOT_COLOR); + this.populateColorBox(selectDotColorBox, selectDotColor, MobileTemplateStyle.DEFAULT_SELECT_DOT_COLOR); + if (dotIndicatorShowType != buttonGroup.getCurrentSelected()) { + this.buttonGroup.setSelectButton(dotIndicatorShowType); + } + } + + public void update(MobileTemplateStyle mobileTemplateStyle) { + mobileTemplateStyle.setShowTabTitle(showTabTitleCheck.isSelected()); + mobileTemplateStyle.setShowDotIndicator(showTabDotIndicatorCheck.isSelected()); + mobileTemplateStyle.setCanSlide(tabSlideCheck.isSelected()); + mobileTemplateStyle.setIndicatorInitialColor(initDotColorBox.getSelectObject()); + mobileTemplateStyle.setIndicatorSelectColor(selectDotColorBox.getSelectObject()); + mobileTemplateStyle.setDotIndicatorShowType(buttonGroup.getCurrentSelected()); + WidgetPropertyPane.getInstance().getEditingFormDesigner().getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_EDITED); + } + + @Override + protected String title4PopupWindow() { + return "MobileTabExSettingPane"; + } + + private void addIndicatorShowTypeButton(JPanel dotIndicatorShowTypePane) { + UIRadioButton holderPlaceButton = new UIRadioButton(Toolkit.i18nText("Fine-Design_Mobile_Tab_Holder_Place")); + holderPlaceButton.setSelected(true); + UIRadioButton floatButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Tab_Float")); + dotIndicatorShowTypePane.add(holderPlaceButton); + dotIndicatorShowTypePane.add(floatButton); + dotIndicatorShowTypePane.setBorder( + BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L1, 0, 0) + ); + buttonGroup = new ModeButtonGroup<>(); + buttonGroup.put(MobileTemplateStyle.TYPE_PLACEHOLDER_DOT_INDICATOR, holderPlaceButton); + buttonGroup.put(MobileTemplateStyle.TYPE_FLOAT_DOT_INDICATOR, floatButton); + } + + private void populateColorBox(NewColorSelectBox colorBox, Color color, Color defaultColor) { + if (color == null) { + color = defaultColor; + } + if (color != colorBox.getSelectObject()) { + colorBox.setSelectObject(color); + } + } +} From e84561a25484eb9b15213559c1e833874ca38cbd Mon Sep 17 00:00:00 2001 From: Hans Date: Fri, 21 Aug 2020 15:07:48 +0800 Subject: [PATCH 028/267] =?UTF-8?q?MOBILE-28888=20Tab=E6=89=8B=E5=8A=BF?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=AE=BE=E8=AE=A1=E5=99=A8=E7=AB=AF=E5=BC=80?= =?UTF-8?q?=E5=8F=91=201.=20=E7=A7=BB=E5=8A=A8=E7=AB=AFTab=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E9=9D=A2=E6=9D=BF=E6=96=B0=E5=A2=9E=E4=B8=89=E4=B8=AA?= =?UTF-8?q?tab=E9=80=9A=E7=94=A8=E5=B1=9E=E6=80=A7=EF=BC=8C=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=A0=87=E9=A2=98=EF=BC=8C=E6=BB=91=E5=8A=A8=E5=88=87?= =?UTF-8?q?=E6=8D=A2=EF=BC=8C=E6=98=BE=E7=A4=BA=E5=9C=86=E7=82=B9=E6=8C=87?= =?UTF-8?q?=E7=A4=BA=E5=99=A8=EF=BC=88=E9=80=9A=E7=94=A8=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=EF=BC=89=202.=20=E5=85=BC=E5=AE=B9=E6=97=A7?= =?UTF-8?q?=E6=A8=A1=E7=89=88=EF=BC=8C=E8=BD=AC=E6=8D=A2Tab=E6=97=A7?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E5=88=86=E6=95=A3=E7=9A=84=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E5=88=B0Tab=E5=B1=9E=E6=80=A7=E9=9D=A2=E6=9D=BF=E7=9A=84?= =?UTF-8?q?=E9=80=9A=E7=94=A8=E5=B1=9E=E6=80=A7=203.=20=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E5=85=B1=E7=94=A8pc=E7=AB=AF=E8=BD=AE=E6=92=AD?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=204.=20=E6=96=B0=E5=A2=9E=E4=B8=AD=E8=8B=B1?= =?UTF-8?q?=E6=96=87=E7=BF=BB=E8=AF=91=20(amend=E4=BF=AE=E6=94=B9=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E4=BF=AE=E9=A5=B0=E7=AC=A6=EF=BC=8C=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E8=AF=AF=E4=BF=AE=E6=94=B9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/mobile/component/MobileTabCommonSettingPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java index e1142117ae..38718d2dd7 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java @@ -170,7 +170,7 @@ public class MobileTabCommonSettingPane extends BasicPane { @Override protected String title4PopupWindow() { - return "MobileTabExSettingPane"; + return "MobileTabCommonSettingPane"; } private void addIndicatorShowTypeButton(JPanel dotIndicatorShowTypePane) { From e5d4a52c1d93e7f78b8e06851a156afd94981549 Mon Sep 17 00:00:00 2001 From: Hans Date: Fri, 21 Aug 2020 15:07:48 +0800 Subject: [PATCH 029/267] =?UTF-8?q?=E5=90=88=E7=90=86import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mobile/component/MobileTabCommonSettingPane.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java index 38718d2dd7..ad9d856cd0 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java @@ -16,10 +16,14 @@ import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.style.color.NewColorSelectBox; import com.fr.general.cardtag.mobile.MobileTemplateStyle; -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.JComponent; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; From 3f79248f989069c81744b86bd1247bc7f27e0fa4 Mon Sep 17 00:00:00 2001 From: Hans Date: Fri, 21 Aug 2020 16:23:21 +0800 Subject: [PATCH 030/267] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mobile/component/MobileTabCommonSettingPane.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java index ad9d856cd0..5b07966bb1 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java @@ -90,8 +90,9 @@ public class MobileTabCommonSettingPane extends BasicPane { @Override protected void iniListener() { } + @Override - public void mouseEntered(MouseEvent e) { + public void mouseClicked(MouseEvent e) { super.mousePressed(e); this.attributeChange(); } @@ -102,7 +103,7 @@ public class MobileTabCommonSettingPane extends BasicPane { } @Override - public void mouseEntered(MouseEvent e) { + public void mouseClicked(MouseEvent e) { super.mousePressed(e); this.attributeChange(); } From 8798ac45205dcba229dc6c75c57a4f969525d0f8 Mon Sep 17 00:00:00 2001 From: Hans Date: Fri, 21 Aug 2020 17:05:40 +0800 Subject: [PATCH 031/267] =?UTF-8?q?DefaultMobileTemplateStyle=20=E7=8E=B0?= =?UTF-8?q?=E5=9C=A8=E4=B9=9F=E6=9C=89=E4=BA=86=E9=80=9A=E7=94=A8=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E5=B1=9E=E6=80=A7=20=E9=9C=80=E8=A6=81=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E7=88=B6=E7=B1=BBcreateJson=E6=96=B9=E6=B3=95=20?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E7=AC=94=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/mobile/component/MobileTabCommonSettingPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java index 5b07966bb1..cf4923aed3 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java @@ -93,7 +93,7 @@ public class MobileTabCommonSettingPane extends BasicPane { @Override public void mouseClicked(MouseEvent e) { - super.mousePressed(e); + super.mouseClicked(e); this.attributeChange(); } }; @@ -104,7 +104,7 @@ public class MobileTabCommonSettingPane extends BasicPane { @Override public void mouseClicked(MouseEvent e) { - super.mousePressed(e); + super.mouseClicked(e); this.attributeChange(); } }; From ea120a784d8f74a612d7bbfa59701c22f12f5bbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 24 Aug 2020 10:44:50 +0800 Subject: [PATCH 032/267] =?UTF-8?q?CHART-15259=20=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=E8=8E=B7=E5=8F=96=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E7=9A=84=E5=88=86=E8=BE=A8=E7=8E=87=E7=A9=BA?= =?UTF-8?q?=E6=8C=87=E9=92=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/chart/ChartIcon.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartIcon.java b/designer-chart/src/main/java/com/fr/design/chart/ChartIcon.java index 16e13db70b..3ae8f0b848 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartIcon.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartIcon.java @@ -1,12 +1,12 @@ package com.fr.design.chart; +import com.fr.base.ScreenResolution; import com.fr.base.chart.BaseChartPainter; import com.fr.base.chart.chartdata.CallbackEvent; import com.fr.base.chart.result.WebChartIDInfo; import com.fr.chart.chartattr.ChartCollection; import com.fr.chartx.attr.ChartProvider; import com.fr.design.ChartTypeInterfaceManager; -import com.fr.design.file.HistoryTemplateListCache; import com.fr.script.Calculator; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLable; @@ -79,7 +79,8 @@ public class ChartIcon implements Icon, XMLable { BaseChartPainter chartPainter = getChartPainter(); - int resolution = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getJTemplateResolution(); + //插入图表的宽度是固定的,resolution直接获取屏幕分辨率,resolution现在只会影响到老图表 + int resolution = ScreenResolution.getScreenResolution(); Graphics2D g2d = (Graphics2D) g; Paint oldPaint = g2d.getPaint(); From fd87fbf370e7f76e018b7d8f2c1b201f1ea359a2 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 24 Aug 2020 14:06:20 +0800 Subject: [PATCH 033/267] =?UTF-8?q?REPORT-37168=20FineQuality=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E7=AB=AF-designer.bat=E5=90=AF=E5=8A=A8=EF=BC=8C?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E5=BD=95=E5=88=B6=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/start/DesignerJavaRuntime.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java index b99f648aed..f65ae11f85 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java @@ -44,6 +44,7 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime { private static final String DOCK_NAME_OPTIONS = "-Xdock:name=" + FineDesigner.class.getSimpleName(); private static final String WIN_VM_OPTIONS_PATH = StableUtils.pathJoin(BIN_HOME, "designer.vmoptions"); private static final String[] DEBUG_OPTIONS = new String[]{"-Dfile.encoding=UTF-8", "-Xmx2048m"}; + private static final String WIN_SERVER_PATH = "../server/lib"; static { try { @@ -110,7 +111,7 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime { if (isInstallVersion()) { String[] options = super.getJvmOptions(); // win下环境变量 存在错误的设置会导致问题 直接读vmoptions - if (SupportOSImpl.VM_OPTIONS_ADAPTER.support()) { + if (SupportOSImpl.VM_OPTIONS_ADAPTER.support() && !getClassPath().contains(WIN_SERVER_PATH)) { List optionList = new ArrayList<>(); try (BufferedReader reader = new BufferedReader(new FileReader(new File(WIN_VM_OPTIONS_PATH)))) { String option = null; From b3fbc68bb254579551965f097e783c45c1579d40 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 24 Aug 2020 15:47:32 +0800 Subject: [PATCH 034/267] =?UTF-8?q?REPORT-37924=E3=80=90=E5=85=B1=E5=88=9B?= =?UTF-8?q?=E3=80=91=E8=BF=9C=E7=A8=8B=E6=97=B6=EF=BC=8C=E5=90=8C=E6=97=B6?= =?UTF-8?q?=E6=8B=96=E5=85=A5=E5=A4=9A=E4=B8=AA=E6=A8=A1=E6=9D=BF=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/data/DesignTableDataManager.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java index f2b1e8e5b3..bce63d6429 100644 --- a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java +++ b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java @@ -50,6 +50,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -74,7 +75,7 @@ public abstract class DesignTableDataManager { private static java.util.Map dsNameChangedMap = new HashMap(); private static List globalDsListeners = new ArrayList<>(); - private static Map> dsListenersMap = new HashMap>(); + private static Map> dsListenersMap = new ConcurrentHashMap<>(); public static String NO_PARAMETER = "no_paramater_pane"; @@ -96,8 +97,8 @@ public abstract class DesignTableDataManager { */ private static void fireDsChanged() { fireDsChanged(globalDsListeners); - for (Entry> listenerEntry : dsListenersMap.entrySet()) { - List dsListeners = listenerEntry.getValue(); + for (Iterator>> entryIterator = dsListenersMap.entrySet().iterator(); entryIterator.hasNext();) { + List dsListeners = entryIterator.next().getValue(); fireDsChanged(dsListeners); } } From cf4fb7cd2632587147baa4b5ce713070f2011f99 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 25 Aug 2020 17:25:46 +0800 Subject: [PATCH 035/267] =?UTF-8?q?REPORT-37968=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E4=BF=AE=E6=94=B9=E5=8D=95=E5=85=83=E6=A0=BC=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E6=97=B6=E4=BC=9A=E9=A1=BA=E5=B8=A6=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=8B=E4=B8=80=E4=B8=AA=E7=82=B9=E5=87=BB=E7=9A=84=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/gui/columnrow/ColumnRowPane.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java b/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java index e94b182695..10ea21a9ae 100644 --- a/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java @@ -200,13 +200,17 @@ public class ColumnRowPane extends JPanel implements UIObserver { column = 0; } removeDocumentListener(d); - columnSpinner.setValue(StableUtils.convertIntToABC(column + 1)); + String colValue = StableUtils.convertIntToABC(column + 1); + columnSpinner.setValue(colValue); + ((DefaultEditor) columnSpinner.getEditor()).getTextField().setText(colValue); int row = columnRow.getRow(); // shoc 小于0就蹦了 if (row < 0) { row = 0; } - rowSpinner.setValue("" + (row + 1)); + String rowValue = Integer.toString(row + 1); + rowSpinner.setValue(rowValue); + ((DefaultEditor) rowSpinner.getEditor()).getTextField().setText(rowValue); addDocumentListener(d); fireChanged(); } From 86413db4701601e71b87f4294dd90f4c5c7ec123 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 26 Aug 2020 14:56:07 +0700 Subject: [PATCH 036/267] =?UTF-8?q?REPORT-37872=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1-=E6=89=93=E4=B8=8D=E5=BC=80=E8=A1=A8?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/designer/creator/XWAbsoluteLayout.java | 6 +++++- .../java/com/fr/design/form/util/FormDesignerUtils.java | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java index 7c852f2820..b98c2a952d 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -433,7 +433,11 @@ public class XWAbsoluteLayout extends XLayoutContainer { @Override public XLayoutContainer getTopLayout() { - XLayoutContainer xTopLayout = XCreatorUtils.getParentXLayoutContainer(this).getTopLayout(); + XLayoutContainer parentXLayoutContainer = XCreatorUtils.getParentXLayoutContainer(this); + if (parentXLayoutContainer == null) { + return this; + } + XLayoutContainer xTopLayout = parentXLayoutContainer.getTopLayout(); if (xTopLayout != null && !xTopLayout.isEditable()) { return xTopLayout; } else { diff --git a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java index 85ec9474db..46377b1adf 100644 --- a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java +++ b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java @@ -17,6 +17,9 @@ public class FormDesignerUtils { * @return */ public static boolean isAppRelayout(FormDesigner designer) { + if (!designer.getRootComponent().acceptType(WFitLayout.class)) { + return false; + } return ((WFitLayout) designer.getRootComponent().toData()).isAppRelayout(); } From c2708d7684a8df627a8de75d27b20a891c0b7dba Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 26 Aug 2020 16:16:39 +0800 Subject: [PATCH 037/267] =?UTF-8?q?REPORT-37950=20=E6=99=AE=E9=80=9A?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8-=E5=A4=9Asheet-=E6=8A=A5=E8=A1=A8=E5=9D=97?= =?UTF-8?q?=E7=BC=A9=E6=94=BE=E5=A4=B1=E6=95=88=201.=20bug=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=EF=BC=9A=E5=BD=93=E6=96=B0=E5=BB=BA=E4=B8=80=E4=B8=AA?= =?UTF-8?q?Sheet=E5=90=8E=EF=BC=8C=E4=BB=A3=E7=A0=81=E4=BC=9A=E8=B5=B0?= =?UTF-8?q?=E5=88=B0=E8=BF=99=E4=B8=80=E6=AD=A5=EF=BC=8C=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E4=B8=80=E4=B8=AAJFormSliderPane=EF=BC=8C=E7=84=B6=E5=90=8E?= =?UTF-8?q?=E5=9C=A8=E8=BF=9B=E8=A1=8C=E7=BC=A9=E6=94=BE=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9A=84=E6=98=AF=E6=97=A7=E7=9A=84JFormSlid?= =?UTF-8?q?erPane=E4=B8=AD=E7=9A=84showValue=EF=BC=8C=E8=80=8CReportCompon?= =?UTF-8?q?entComposite=E4=B8=ADgetShowValue=E5=8F=96=E5=88=B0=E7=9A=84?= =?UTF-8?q?=E9=83=BD=E6=98=AF=E6=96=B0=E7=9A=84JFormSliderPane=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E5=80=BC=EF=BC=8C=E6=89=80=E4=BB=A5=E4=BC=9A=E5=8F=91?= =?UTF-8?q?=E7=8E=B0=E6=96=B0=E7=9A=84JFormSliderPane=E4=B8=ADshowValue?= =?UTF-8?q?=E4=B8=80=E7=9B=B4=E4=B8=8D=E5=8F=98=EF=BC=8C=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E6=9D=A1=E5=A4=B1=E6=95=88=202.=20=E4=BF=AE=E6=94=B9=E6=80=9D?= =?UTF-8?q?=E8=B7=AF=E4=B8=BA=EF=BC=8C=E6=96=B0=E5=BB=BAsheet=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E4=BB=8D=E7=84=B6=E4=BD=BF=E7=94=A8=E5=8E=9F=E6=9D=A5?= =?UTF-8?q?=E7=9A=84JFormSliderPane=EF=BC=8C=E8=80=8C=E5=9B=A0=E4=B8=BA?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E7=9A=84=E7=BC=A9=E6=94=BE=E5=90=8E=E7=9A=84?= =?UTF-8?q?=E7=BB=98=E5=88=B6=E6=98=AF=E8=B7=9Fresolution=E5=88=86?= =?UTF-8?q?=E8=BE=A8=E7=8E=87=E6=9C=89=E5=85=B3=EF=BC=8C=E6=89=80=E4=BB=A5?= =?UTF-8?q?=E5=85=B1=E7=94=A8JFormSliderPane=E4=B9=8B=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=90=8Csheet=E4=B8=AD=E7=9A=84=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E7=BC=A9=E6=94=BE=E8=BF=98=E6=98=AF=E5=8F=AF=E4=BB=A5=E5=88=86?= =?UTF-8?q?=E5=BC=80=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/ReportComponentComposite.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java index 84ae83838b..66fed7afe2 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java @@ -119,7 +119,8 @@ public class ReportComponentComposite extends JComponent implements RemoveListen templateStateList.add(null); } centerCardPane.editingComponet.setSelection(centerCardPane.editingComponet.getDefaultSelectElement()); - jSliderContainer = JFormSliderPane.getInstance(); + // Yvan: REPORT-37950 普通报表-多sheet-报表块缩放失效 + //jSliderContainer = JFormSliderPane.getInstance(); } if (centerCardPane.editingComponet.elementCasePane == null) { From 4551e17f2e1267aa2f624484b5eef32a270af19f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 26 Aug 2020 18:20:40 +0800 Subject: [PATCH 038/267] =?UTF-8?q?CHART-15419=20=E7=94=98=E7=89=B9?= =?UTF-8?q?=E5=9B=BE=E5=A2=9E=E5=8A=A0=E5=A4=A7=E6=95=B0=E6=8D=AE=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/other/VanChartInteractivePane.java | 2 ++ .../designer/other/VanChartGanttConditionPane.java | 14 +++++++++----- .../style/series/VanChartGanttSeriesPane.java | 7 ++++++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java index 49ed070239..885931cb93 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java @@ -29,6 +29,7 @@ import com.fr.plugin.chart.base.VanChartAttrMarker; import com.fr.plugin.chart.base.VanChartConstants; import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.base.VanChartZoom; +import com.fr.plugin.chart.gantt.attr.AttrGanttLabel; import com.fr.plugin.chart.map.line.condition.AttrLineEffect; import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel; import com.fr.plugin.chart.vanchart.VanChart; @@ -436,6 +437,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { conditionAttr.remove(AttrEffect.class); conditionAttr.remove(AttrLineEffect.class); conditionAttr.remove(AttrFloatColor.class); + conditionAttr.remove(AttrGanttLabel.class); VanChartAttrMarker attrMarker = conditionAttr.getExisted(VanChartAttrMarker.class); if (attrMarker != null && !attrMarker.isCommon()) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/other/VanChartGanttConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/other/VanChartGanttConditionPane.java index 42428c6317..24a5d45fe9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/other/VanChartGanttConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/other/VanChartGanttConditionPane.java @@ -12,6 +12,7 @@ import com.fr.plugin.chart.gantt.attr.AttrGanttLabel; import com.fr.plugin.chart.gantt.attr.AttrGanttTooltip; import com.fr.plugin.chart.gantt.attr.AttrGanttTooltipContent; import com.fr.plugin.chart.type.ConditionKeyType; +import com.fr.van.chart.designer.PlotFactory; import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartSeriesColorConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartTooltipConditionPane; @@ -40,16 +41,18 @@ public class VanChartGanttConditionPane extends DataSeriesConditionPane { protected void addBasicAction() { classPaneMap.put(AttrBackground.class, new VanChartSeriesColorConditionPane(this)); classPaneMap.put(AttrAlpha.class, new LabelAlphaPane(this)); - classPaneMap.put(AttrGanttLabel.class, new VanChartLabelConditionPane(this, plot)); - classPaneMap.put(AttrGanttTooltip.class, new VanChartTooltipConditionPane(this, plot){ + if (!PlotFactory.largeDataModel(plot)) { + classPaneMap.put(AttrGanttLabel.class, new VanChartLabelConditionPane(this, plot)); + } + classPaneMap.put(AttrGanttTooltip.class, new VanChartTooltipConditionPane(this, plot) { @Override protected VanChartPlotTooltipPane createTooltipContentsPane() { - return new VanChartPlotTooltipNoCheckPane(getPlot(), null){ + return new VanChartPlotTooltipNoCheckPane(getPlot(), null) { @Override protected AttrTooltip getAttrTooltip() { AttrGanttTooltip attrGanttTooltip = new AttrGanttTooltip(); - ((AttrGanttTooltipContent)attrGanttTooltip.getContent()).getDurationFormat().setEnable(true); + ((AttrGanttTooltipContent) attrGanttTooltip.getContent()).getDurationFormat().setEnable(true); return attrGanttTooltip; } }; @@ -65,7 +68,7 @@ public class VanChartGanttConditionPane extends DataSeriesConditionPane { @Override protected ChartConditionPane createListConditionPane() { - return new ChartConditionPane(){ + return new ChartConditionPane() { @Override protected ConditionKeyType[] conditionKeyTypes() { return ConditionKeyType.Gantt_CONDITION_KEY_TYPES; @@ -75,6 +78,7 @@ public class VanChartGanttConditionPane extends DataSeriesConditionPane { /** * 返回图表class对象 + * * @return class对象 */ public Class class4Correspond() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java index c17d97692c..c89dff0392 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java @@ -44,7 +44,8 @@ public class VanChartGanttSeriesPane extends VanChartAbstractPlotSeriesPane { Component[][] components = new Component[][]{ new Component[]{createGanntStylePane()}, new Component[]{createLinkLinePane()}, - new Component[]{createMarkerPane()} + new Component[]{createMarkerPane()}, + new Component[]{createLargeDataModelPane()} }; contentPane = TableLayoutHelper.createTableLayoutPane(components, row, col); @@ -58,6 +59,10 @@ public class VanChartGanttSeriesPane extends VanChartAbstractPlotSeriesPane { return ganntStylePane; } + protected void checkCompsEnabledWithLarge(Plot plot) { + + } + private JPanel createLinkLinePane(){ lineWidth = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART); colorSelect = new ColorSelectBoxWithOutTransparent(100); From 6f4d11c2878c7642af769de022d1060cea04eec9 Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 27 Aug 2020 16:08:20 +0800 Subject: [PATCH 039/267] =?UTF-8?q?REPORT-37262=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E8=B4=A6=E5=8F=B7=E5=AF=86=E7=A0=81=E5=AE=89?= =?UTF-8?q?=E5=85=A8=E5=A2=9E=E5=BC=BA=201.=20=E5=81=9A=E7=9A=84=E6=98=AF?= =?UTF-8?q?=E8=BF=99=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86=E4=B8=8A=E8=BF=B0=E5=8A=9F=E8=83=BD=203.=20=E5=B0=86?= =?UTF-8?q?=E7=9B=AE=E6=A0=87=E5=9C=BA=E6=99=AF=E4=B8=AD=E7=9A=84=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E6=A1=86=E6=9B=BF=E6=8D=A2=E4=B8=BA=E6=96=B0=E7=9A=84?= =?UTF-8?q?UIPasswordFieldWithFixedLength=204.=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E5=AF=BC=E5=8C=85=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/connect/JDBCDefPane.java | 18 ++- .../UIPasswordFieldWithFixedLength.java | 106 ++++++++++++++++++ .../main/java/com/fr/env/RemoteEnvPane.java | 17 ++- 3 files changed, 134 insertions(+), 7 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index 5e8199d953..683b38e016 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -8,7 +8,7 @@ import com.fr.design.border.UITitledBorder; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.ipasswordfield.UIPassWordField; +import com.fr.design.gui.ipasswordfield.UIPasswordFieldWithFixedLength; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.layout.FRGUIPaneFactory; @@ -24,8 +24,18 @@ import com.fr.general.ComparatorUtils; import com.fr.stable.StringUtils; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.JDialog; +import javax.swing.JFileChooser; +import javax.swing.JPanel; +import javax.swing.JPasswordField; +import javax.swing.SwingConstants; +import javax.swing.SwingUtilities; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Graphics; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; @@ -108,7 +118,7 @@ public class JDBCDefPane extends JPanel { urlTextField = new UITextField(15); userNameTextField = new UITextField(15); userNameTextField.setName(USER_NAME); - passwordTextField = new UIPassWordField(15); + passwordTextField = new UIPasswordFieldWithFixedLength(15); dbtypeButton = new UIButton("."); dbtypeButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Click_Get_Default_URL")); dbtypeButton.addActionListener(dbtypeButtonActionListener); diff --git a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java new file mode 100644 index 0000000000..c1cb98ca3d --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java @@ -0,0 +1,106 @@ +package com.fr.design.gui.ipasswordfield; + +import com.fr.stable.StringUtils; +import org.jetbrains.annotations.NotNull; + +import javax.swing.text.Document; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +/** + * @author Yvan + * @version 10.0 + * Created by Yvan on 2020-08-11 + * 有固定长度的"*"回显的密码框,避免泄露密码长度 + */ +public class UIPasswordFieldWithFixedLength extends UIPassWordField { + /** + * 展示密码,为固定8位长度的特殊字符"*"组成 + */ + private static final String DISPLAY_PASSWORD = "********"; + + /** + * 实际密码 + */ + private String realPassword; + + /** + * 用于判断是否清空密码 + */ + private boolean clearPassword; + + public UIPasswordFieldWithFixedLength() { + this(null, null, 0); + } + + public UIPasswordFieldWithFixedLength(String text) { + this(null, text, 0); + } + + public UIPasswordFieldWithFixedLength(int columns) { + this(null, null, columns); + } + + public UIPasswordFieldWithFixedLength(String text, int columns) { + this(null, text, columns); + } + + public UIPasswordFieldWithFixedLength(Document doc, String txt, int columns) { + super(doc, txt, columns); + initRealPassword(txt); + } + + /** + * 为realPassword赋初值并添加一个鼠标单击事件 + */ + public void initRealPassword(String text) { + this.realPassword = text == null ? StringUtils.EMPTY : text; + this.clearPassword = true; + addShowFixedLengthPasswordListener(); + } + + /** + * 当鼠标点击密码框,第一次做出键入动作时,清空显示密码与实际密码,用户需要重新输入密码 + */ + private void addShowFixedLengthPasswordListener() { + this.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + UIPasswordFieldWithFixedLength.this.clearPassword = true; + } + }); + this.addKeyListener(new KeyAdapter() { + @Override + public void keyPressed(KeyEvent e) { + if (clearPassword) { + UIPasswordFieldWithFixedLength.this.setText(StringUtils.EMPTY); + UIPasswordFieldWithFixedLength.this.clearPassword = false; + UIPasswordFieldWithFixedLength.this.updateUI(); + } + } + }); + } + + @Override + public void setText(@NotNull String t) { + this.realPassword = t; + // 看到代码中有些场景是将密码置为空字符串的,所以在这里加个判断 + if (StringUtils.isEmpty(t)) { + super.setText(t); + } else { + super.setText(DISPLAY_PASSWORD); + } + } + + @Override + public char[] getPassword() { + //如果用户刚清空密码框,并输入了新密码,则返回输入内容,否则返回realPassword + String text = new String(super.getPassword()); + if (!StringUtils.isEmpty(text) && StringUtils.isEmpty(realPassword)) { + return text.toCharArray(); + } + return realPassword.toCharArray(); + } +} diff --git a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java index bc32385b7c..54cfddc8d3 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java @@ -13,6 +13,7 @@ import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ipasswordfield.UIPassWordField; +import com.fr.design.gui.ipasswordfield.UIPasswordFieldWithFixedLength; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; @@ -26,7 +27,17 @@ import com.fr.workspace.WorkContext; import com.fr.workspace.connect.WorkspaceConnectionInfo; import com.fr.workspace.engine.exception.WorkspaceAuthException; -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.BoxLayout; +import javax.swing.JDialog; +import javax.swing.JFileChooser; +import javax.swing.JPanel; +import javax.swing.JTextPane; +import javax.swing.SwingConstants; +import javax.swing.SwingUtilities; +import javax.swing.SwingWorker; +import javax.swing.ToolTipManager; +import javax.swing.UIManager; import javax.swing.border.EmptyBorder; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; @@ -96,7 +107,7 @@ public class RemoteEnvPane extends BasicBeanPane { /** * 密码 */ - private UIPassWordField passwordInput = new UIPassWordField(); + private UIPassWordField passwordInput = new UIPasswordFieldWithFixedLength(); /** * 是否记住密码 */ @@ -108,7 +119,7 @@ public class RemoteEnvPane extends BasicBeanPane { /** * https密钥 */ - private UIPassWordField certSecretKeyInput = new UIPassWordField(); + private UIPassWordField certSecretKeyInput = new UIPasswordFieldWithFixedLength(); /** * 选择证书文件按钮 */ From f6f6a11eaed640add7d171cf4e40d65d7c550304 Mon Sep 17 00:00:00 2001 From: pengda Date: Fri, 28 Aug 2020 09:52:20 +0800 Subject: [PATCH 040/267] =?UTF-8?q?REPORT-35386=20=E5=A4=9A=E4=B8=AAtab?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E6=92=A4=E9=94=80=EF=BC=8C=E4=BC=9A=E6=92=A4?= =?UTF-8?q?=E9=94=80=E4=B8=A4=E4=B8=AAtab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/designer/creator/cardlayout/XCardAddButton.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardAddButton.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardAddButton.java index 6909207c35..7718e266f2 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardAddButton.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardAddButton.java @@ -86,7 +86,6 @@ public class XCardAddButton extends XButton { @Override public void respondClick(EditingMouseListener editingMouseListener, MouseEvent e){ FormDesigner designer = editingMouseListener.getDesigner(); - designer.fireTargetModified(); // addbutton对应的XWCardLayout和XWCardTagLayout暂未存入到xml中,重新打开之后先根据父子层获取 if(cardLayout == null && tagLayout ==null ){ @@ -112,6 +111,8 @@ public class XCardAddButton extends XButton { showNewTab(editingMouseListener,index); tagLayout.setTabsAndAdjust(); LayoutUtils.layoutRootContainer(designer.getRootComponent()); + + designer.fireTargetModified(); } @Override From ef6fc5872c77be15e199e36adad83b68b3971a05 Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 28 Aug 2020 11:38:48 +0800 Subject: [PATCH 041/267] =?UTF-8?q?REPORT-37915=20=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E5=88=86=E6=A0=8F=E5=BC=B9=E7=AA=97=E6=98=BE=E7=A4=BA=E6=9C=AA?= =?UTF-8?q?=E9=80=82=E9=85=8D=E5=9B=BD=E9=99=85=E5=8C=96=201.=20=E4=B8=BA?= =?UTF-8?q?=E6=AF=8F=E7=A7=8D=E8=AF=AD=E8=A8=80=E9=83=BD=E9=80=82=E9=85=8D?= =?UTF-8?q?=E4=BA=86=E6=8A=A5=E8=A1=A8=E5=88=86=E6=A0=8F=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E7=A4=BA=E4=BE=8B=E5=9B=BE=E7=89=87=202.=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=B9=E5=BA=94=E5=9B=BD=E9=99=85=E5=8C=96?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=AD=E4=BB=A3=E8=A1=A8=E6=AD=A4=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B=E5=9B=BE=E7=89=87=E7=9A=84=E6=96=87=E4=BB=B6=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/images/reportcolumns/col_ja_JP.png | Bin 0 -> 2507 bytes .../fr/design/images/reportcolumns/col_ko_KR.png | Bin 0 -> 2356 bytes .../images/reportcolumns/{col.png => col_zh.png} | Bin .../fr/design/images/reportcolumns/col_zh_TW.png | Bin 0 -> 2587 bytes .../fr/design/images/reportcolumns/row_ja_JP.png | Bin 0 -> 2748 bytes .../fr/design/images/reportcolumns/row_ko_KR.png | Bin 0 -> 2537 bytes .../images/reportcolumns/{row.png => row_zh.png} | Bin .../fr/design/images/reportcolumns/row_zh_TW.png | Bin 0 -> 2793 bytes 8 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_ja_JP.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_ko_KR.png rename designer-base/src/main/resources/com/fr/design/images/reportcolumns/{col.png => col_zh.png} (100%) create mode 100644 designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_zh_TW.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_ja_JP.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_ko_KR.png rename designer-base/src/main/resources/com/fr/design/images/reportcolumns/{row.png => row_zh.png} (100%) create mode 100644 designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_zh_TW.png diff --git a/designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_ja_JP.png b/designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_ja_JP.png new file mode 100644 index 0000000000000000000000000000000000000000..3a22b64a6076dc831d577a52d79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p%(cQ$v zMDqq>pk!QJoSKv4c`^i?F-P~G`Zx_iJF<%8r8T!hqJ7w~Vb&_gP_6FWyH`qYMe?#z z+-`59p8sG_BrokHlvw-!9?(7w`2S|bf_T7w4+vT9_o-NP$OA%Fha4+r?e~C?)qbCf zMTa~fWOc}~V%B~S2wCm-saSN#1434Z94lt+_kfVqexHg(hddzqtPVL=%-ZjPe*p6y VxgM1vNUZ<>002ovPDHLkV1l12zQF(h literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_ko_KR.png b/designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_ko_KR.png new file mode 100644 index 0000000000000000000000000000000000000000..3041f446bb15b75eaf555d08dae30abe7ea1ddf8 GIT binary patch literal 2356 zcmai$c{J4BAIA|xA|!>82xX~;v6E#O%kWsHVKlY~!qZ`xIcfePK2*4vxz7V+Wo*92|UX1RUmYlXK1OcA|~j$?K61HuxCo z>&2b|p8i(yCVm2>t0$FY6@Gji&ajY1TV|Z{*sGg68rfnScM< z3F|OmZcXh^h41J_PF4G}zJ>N0-d^8!X=zv=U!2_6f9~=&z>(xp>hkvTuiXvP*Z1K` zvtH1G&vakA%J+?b{ciUAEnExVP(xg_9#ISCQ^d3%sNPv% zm*9M*{}MVWUgcgFk}%yIWo?lzUC1jW-D&0;;|pck@=Z1(&f>Jse zAt52Ngk6!;$isuZt<^Dg|9(nr(ok!{F&o{2hhDS~=A+-H8irmumM+aR9%_Uw*<0C` z`~O@Wqic9~3R@u%YNqY@xsKH3j#RJ%5(#U&C-{Q6z0$s9u4>DRV1KHxlPQBY+}VRx z2hQZ9%UyAk6Ah7&Gx`w^I?~Suw!776$S5f>xL>_~ozWb%kL{AdMn^X*&FRokFKzEp za5&s>4Z#IvYhzPAON%%G<_er{3>KjW&NO2OlgdUq`>=AQLq6TvmzIGmV@1_3@L?V{ z-Ps$Y9_e)S?R|zDS>u0!nyn7Q7 zxvLd|Tok{0m&yF&lRa!@w9KVpr+pJt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|e+lruT(e3RWaCh?Y(uGuj2vh;(^TZ>q~6w26H(@M zb;!w6o#1EWqWDa4kVWZ;`*6%EKrS8(h4zFamOYeeo03xtXn-{u3EG|Oh@2#Q*-m@K_X{j} zm(rOfTXlk0K!?g3qGwsTB=qmtJu^y(4~R_-W6(om>w{|1&7||TuRH~!rzzXIxFvS5 zuv%QDq2$-K0;5xo?y=!KrE`|KRFQI=C)^BPqRD?1>nQgZY?QAuhUjk+ne#)*I}c!? z^eGAd4AXp4*%(?EJO0Yp6JE=yX-XW#A8ol^oh^-EQF6h4I?Hx`JdT6U^3k2uT%523 zoz$0Q)E^UD=5=%|wn}-8h0GMHVpxZB+(m=A3elcJ`3`%i)HQ97A%1j|H;)1V!{AvT z2go`+xkfP*g@a{6;}>2j*#jTItlXtUz;Ld?e-?_|4VbLr0l=M%Zn?YGwYa3-Sp>D# zA>;oLh(<1W=oRMo_sqTYaz3i}DI4?U^EdH_4_jwZ)qsJCxR+XHKOSur?>^u zVnOBe=exx1=~|~aQ|w3L=FxP=%Pu^80vI(Be9>4_Eo&w%>nU*6oi_l^dm&`I?FnI)tT77e mYyOvj2`^3dy0+=mcYzZ_IlLp-(W}6=$7BJwF|9Mc6Z;RMl+d>T literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_ja_JP.png b/designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_ja_JP.png new file mode 100644 index 0000000000000000000000000000000000000000..83480d429516acd8aade8b920c0c7d48b525280c GIT binary patch literal 2748 zcmV;t3PbgYP) zZ|1U%Yrh?#`F^BA@sz0`4$W8C#*V{HnrCCnwYN>C>rs^X6{vb3Xa) z+c$dj=#fK*%*@QBXV0F|h!G>4zoyNxow5C&0TPEREiH|1-MUqRl=#*D`0=B}d2`hu zSX^8j6%`dxe0;nMQO)1|)925hKT~32qL72{e){x@UcGwtr`wdhZf9(zlNE%_$jG3i zq$H|RrHad-@7uSJ>esLDa?bqW`Sa%#6B9$Bp`kQx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3FY*tKL<>%)s_bMqVi7?u77OTh_85zkLODk=Qii#rq*&ys^18e|MZ1fHS zLRRnKEO*g>fRI%Kh@!$f2uNCscW{=wXh7f}bw-|KUrtWU00000NkvXXu0mjfL+-*C literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/reportcolumns/row.png b/designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_zh.png similarity index 100% rename from designer-base/src/main/resources/com/fr/design/images/reportcolumns/row.png rename to designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_zh.png diff --git a/designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_zh_TW.png b/designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_zh_TW.png new file mode 100644 index 0000000000000000000000000000000000000000..935d1059d5ec5efd77171405fd8b19de37ec13dc GIT binary patch literal 2793 zcmV3hf6kat{4Ml5=p`ykbT0uh1p%JA)sRS`ckcJ=Tp&~?# zK}4t&QG&KwF$GNxtwcz~5J^d?D5G5vW?VDis$OE7d8=h^hdDPMtal777u#ckiBHst`}8x_$dL zRZ^@|)CmIG5D>CzgH{x)M!@A{eemD`<>lq6u9xWhfq=VV%QmYkTlW0<^VGF#S9#J$}OTbGgb>({SLI1mi`!NI{yx~ET{QdU+L zldgaN{^aN9NA23Ro{Hgr0!uU@^Pl#~?uF?B|7-@YY(e}CG(eLIu$*|TR%R`i$&2?-Pt z5y9oVe*HR|4Eg!_bocIEYSye7B_$=%qeqXZsHli8Uc5**Zrq^I&`_t>r~D1k>({Se zzx*Mm?zL4$bs1UFOUB2?)8N5_DKIdQ zAL|%Q!T$8|@nJ&3_VV`j<^k5XZ{O(S$B*3m9yxM^qN1XBKm|@FCMNRvpFVveygl-C zaaU|zW(H(rWKf?zeVCZAnK62Q`0yc*^g%WN4$^|Ksi~>dq)8Jt3376B_%R3a!p_AO zy)8bN5kPP3>Ef=~x{R!Y1`XoJzC|odLya6clG?Uy%O*j~mMxi}6DLlj@bGXx4ZSXU zVF>J5*tWxl4dX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&c588QF%JSHBDP~>NKH*85OmU{NvsHNL-1~e z2eGO78jL0@Y^X(x7L~OM+*y2meal?4%YKlZ3L}6SfP#X8vg Date: Fri, 28 Aug 2020 12:57:37 +0700 Subject: [PATCH 042/267] =?UTF-8?q?REPORT-36619=20=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E7=95=8C=E9=9D=A2=E6=8B=96=E9=80=89=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E9=80=89=E4=B8=AD=E6=8B=96=E9=80=89=E5=8C=BA=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/designer/beans/models/StateModel.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java index 1e7badb8a3..01c324a54b 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java @@ -300,6 +300,13 @@ public class StateModel { int y = getMouseXY(e).y; Rectangle bounds = createCurrentBounds(x, y); + // 有参数面板时 要考虑下参数面板的高度影响 + int yOffset = 0; + XLayoutContainer paramComponent = designer.getParaComponent(); + if (paramComponent != null) { + yOffset = paramComponent.getHeight(); + } + bounds.y = bounds.y - yOffset; if ((x != currentX) || (y != currentY)) { ArrayList creators = getHotspotCreators(bounds, designer.getRootComponent()); From 4516b03301cd334c01c0612bbee245e2be43d044 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 28 Aug 2020 13:02:08 +0700 Subject: [PATCH 043/267] REPORT-36619 fix --- .../java/com/fr/design/designer/beans/models/StateModel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java index 01c324a54b..c5150baa56 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java @@ -306,7 +306,7 @@ public class StateModel { if (paramComponent != null) { yOffset = paramComponent.getHeight(); } - bounds.y = bounds.y - yOffset; + bounds.y = Math.max(bounds.y - yOffset, 0); if ((x != currentX) || (y != currentY)) { ArrayList creators = getHotspotCreators(bounds, designer.getRootComponent()); From e93ef2b31d4441b785a2c1cc4ee2187923d61ad3 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 31 Aug 2020 09:32:14 +0700 Subject: [PATCH 044/267] =?UTF-8?q?REPORT-37821=20frm=E7=BB=9D=E5=AF=B9?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E6=A1=86=E9=80=89=E5=A4=9A=E4=B8=AA=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=9C=89=E9=97=AE=E9=A2=98=20=E5=90=88=E4=B8=A2?= =?UTF-8?q?=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/EditingMouseListener.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index 183c0b08c6..01de4a1dac 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -210,6 +210,7 @@ public class EditingMouseListener extends MouseInputAdapter { */ public void mouseReleased(MouseEvent e) { MouseEvent transEvent = new MouseEvent(e.getComponent(), MouseEvent.MOUSE_CLICKED, e.getWhen(), e.getModifiers(), e.getX(), e.getY(), e.getXOnScreen(), e.getYOnScreen(), e.getClickCount(), e.isPopupTrigger(), e.getButton()); + MouseEvent clickEvent = new MouseEvent(e.getComponent(), MouseEvent.MOUSE_CLICKED, e.getWhen(), e.getModifiers(), e.getX(), e.getY(), e.getXOnScreen(), e.getYOnScreen(), e.getClickCount(), e.isPopupTrigger(), e.getButton()); int oldX = e.getX(); int oldY = e.getY(); offsetEventPoint(e); @@ -234,14 +235,21 @@ public class EditingMouseListener extends MouseInputAdapter { lastPressEvent = null; lastXCreator = null; e.translatePoint(oldX - e.getX(), oldY - e.getY()); - if (pressX != oldX || pressY != oldY) { + if (isAutoFire(transEvent, clickEvent)) { // click只有在mouseReleased和mousePressed前后x/y坐标相等时才会被触发在mouseReleased之后 // 但是当使用者来回点击切换时 存在mouseReleased和mousePressed前后x/y坐标不相等的情况 即鼠标按下去的位置和鼠标释放的位置不相等 存在偏移 // 当这种偏移很小时 看起来就好像是点击了 实际上是手抖了或者鼠标轻微滑动了 所以这里对这种情况要有容错处理 - mouseClicked(transEvent); + mouseClicked(clickEvent); } } + private boolean isAutoFire(MouseEvent transEvent, MouseEvent clickEvent ) { + offsetEventPoint(transEvent); + XCreator xCreator = designer.getComponentAt(transEvent); + return (pressX != clickEvent.getX() || pressY != clickEvent.getY()) + && xCreator != null && xCreator.acceptType(XCardSwitchButton.class); + } + private void mouseDraggingRelease(MouseEvent e) { // 当前鼠标所在的组件 XCreator hoveredComponent = designer.getComponentAt(e.getX(), e.getY()); From cc64c95701134ca43aa667a577036960ce147c79 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Mon, 31 Aug 2020 11:20:27 +0800 Subject: [PATCH 045/267] =?UTF-8?q?REPORT-36985=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=20=E7=BB=84=E4=BB=B6=E6=A0=91=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E4=BC=98=E5=8C=96=E5=92=8C=E9=80=89=E6=8B=A9=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=97=B6=E8=AE=A9=E5=85=B6=E6=B5=AE=E4=BA=8E=E9=A1=B6?= =?UTF-8?q?=E5=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/beans/models/SelectionModel.java | 8 +- .../fr/design/designer/creator/XButton.java | 15 +++ .../design/designer/creator/XChartEditor.java | 34 +++++++ .../fr/design/designer/creator/XCreator.java | 9 +- .../design/designer/creator/XElementCase.java | 22 +++++ .../creator/XWAbsoluteBodyLayout.java | 6 ++ .../designer/creator/XWAbsoluteLayout.java | 8 ++ .../designer/creator/XWParameterLayout.java | 7 ++ .../designer/creator/XWTitleLayout.java | 6 ++ .../cardlayout/XWCardMainBorderLayout.java | 11 ++- .../creator/cardlayout/XWCardTagLayout.java | 1 + .../creator/cardlayout/XWCardTitleLayout.java | 1 + .../fr/design/mainframe/ComponentTree.java | 66 +++++++++++++ .../com/fr/design/mainframe/CoverPane.java | 5 +- .../mainframe/EditingMouseListener.java | 17 ++++ .../com/fr/design/mainframe/FormDesigner.java | 59 +++++++++++- .../fr/design/mainframe/FormDesignerUI.java | 5 + .../mainframe/FormHierarchyTreePane.java | 7 ++ .../widget/topxcreator/BasicTopXCreator.java | 72 ++++++++++++++ .../widget/topxcreator/TopXCreator.java | 54 +++++++++++ .../widget/topxcreator/TopXCreators.java | 95 +++++++++++++++++++ 21 files changed, 499 insertions(+), 9 deletions(-) create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/BasicTopXCreator.java create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreator.java create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreators.java 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 ff89f059ba..49e0f94d29 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 @@ -77,12 +77,14 @@ public class SelectionModel { * @param e 鼠标事件 */ public void selectACreatorAtMouseEvent(MouseEvent e) { + //单选因为要先从已选择的组件中筛选一遍,所以先选择再reset + XCreator comp = designer.getComponentAt(e); if (e.getButton() == MouseEvent.BUTTON3 || (!InputEventBaseOnOS.isControlDown(e) && !e.isShiftDown())) { // 如果Ctrl或者Shift键盘没有按下,则清除已经选择的组件 selection.reset(); } else { //按下Ctrl或者shift键时鼠标可以进行多选,两次点击同一控件就取消选中 - XCreator comp = designer.getComponentAt(e); + //XCreator comp = designer.getComponentAt(e); XLayoutContainer topLayout = XCreatorUtils.getHotspotContainer(comp).getTopLayout(); if (topLayout != null && !topLayout.isEditable()) { comp = topLayout; @@ -93,9 +95,10 @@ public class SelectionModel { selection.removeCreator(selected); } } + comp = designer.getComponentAt(e); } // 获取e所在的组件 - XCreator comp = designer.getComponentAt(e); + //XCreator comp = designer.getComponentAt(e); selectACreator(comp); } @@ -309,6 +312,7 @@ public class SelectionModel { designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_DELETED); setSelectedCreator(isInPara ? designer.getParaComponent() : designer.getRootComponent()); + designer.getTopXCreators().refresh(); // 触发事件 diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java b/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java index 44996df8cd..5f5bb73b22 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java @@ -14,6 +14,7 @@ import com.fr.design.mainframe.widget.editors.ImgBackgroundEditor; import com.fr.design.mainframe.widget.editors.ShortCutTextEditor; import com.fr.design.mainframe.widget.renderer.FontCellRenderer; import com.fr.design.mainframe.widget.renderer.IconCellRenderer; +import com.fr.design.mainframe.widget.topxcreator.BasicTopXCreator; import com.fr.form.parameter.FormSubmitButton; import com.fr.form.ui.Button; import com.fr.form.ui.FreeButton; @@ -309,4 +310,18 @@ public class XButton extends XWidgetCreator { } +/* @Override + public BasicTopCreator getTopXCreator(){ + return new BasicTopXCreator(this) { + @Override + protected void initEditor() { + XButton(XButton.this.toData(),this.getSize() + + } + } + + //return new XButton((Button)this.toData(),this.getSize()); + + }*/ + } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java index b0f6e11589..0ca125e930 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java @@ -17,6 +17,8 @@ import com.fr.design.mainframe.CoverReportPane; import com.fr.design.mainframe.EditingMouseListener; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.HelpDialogManager; +import com.fr.design.mainframe.widget.topxcreator.BasicTopXCreator; +import com.fr.design.mainframe.widget.topxcreator.TopXCreator; import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor; import com.fr.design.module.DesignModuleFactory; import com.fr.form.ui.BaseChartEditor; @@ -258,6 +260,7 @@ public class XChartEditor extends XBorderStyleWidgetCreator { (e.getClickCount() == 2 || designer.getCursor().getType() == Cursor.HAND_CURSOR); displayCoverPane(!isEditing); selectionModel.selectACreatorAtMouseEvent(e); + editingMouseListener.refreshTopXCreator(isEditing); if (editingMouseListener.stopEditing()) { if (this != (XCreator) designer.getRootComponent()) { @@ -357,4 +360,35 @@ public class XChartEditor extends XBorderStyleWidgetCreator { public boolean supportMobileStyle() { return false; } + + @Override + public BasicTopXCreator getTopXCreator() { + return new TopXChart(this); + } + + private class TopXChart extends TopXCreator{ + private final DesignerEditor designerEditor; + + public TopXChart(XCreator creator) { + super(creator); + designerEditor = creator.getDesignerEditor(); + Rectangle bounds=getBounds(); + designerEditor.getEditorTarget().setBounds(bounds.x + 1, bounds.y + 1, bounds.width - 2, bounds.height - 2); + } + + /** + * 更新designerEditor的大小 + * */ + protected void resetSize(Rectangle bounds){ + super.resetSize(bounds); + designerEditor.getEditorTarget().setBounds(bounds.x + 1, bounds.y + 1, bounds.width - 2, bounds.height - 2); + } + + @Override + public void paint(Graphics g) { + designerEditor.paintEditor(g, this.getSize()); + super.paint(g); + } + } + } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java index dcb6938836..0496d74787 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java @@ -19,6 +19,7 @@ import com.fr.design.mainframe.CoverReportPane; import com.fr.design.mainframe.EditingMouseListener; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.NoSupportAuthorityEdit; +import com.fr.design.mainframe.widget.topxcreator.BasicTopXCreator; import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.Widget; @@ -798,10 +799,16 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo /** * 是否支持共享-现只支持报表块、图表、tab块、绝对布局 - * @return */ public boolean isSupportShared() { return false; } + /** + * 获得该组件的顶层显示组件 + */ + public BasicTopXCreator getTopXCreator() { + return null; + } + } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java index ec06a1597d..a9fd877168 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java @@ -13,6 +13,8 @@ import com.fr.design.mainframe.widget.editors.ElementCaseToolBarEditor; import com.fr.design.mainframe.widget.editors.PaddingMarginEditor; import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor; import com.fr.design.mainframe.widget.propertypane.BrowserFitPropertyEditor; +import com.fr.design.mainframe.widget.topxcreator.BasicTopXCreator; +import com.fr.design.mainframe.widget.topxcreator.TopXCreator; import com.fr.form.FormElementCaseContainerProvider; import com.fr.form.FormElementCaseProvider; import com.fr.form.FormProvider; @@ -319,6 +321,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme public void respondClick(EditingMouseListener editingMouseListener,MouseEvent e){ HelpDialogManager.getInstance().setPane(coverPanel); super.respondClick(editingMouseListener, e); + editingMouseListener.refreshTopXCreator(); if (this.isHelpBtnOnFocus()) { coverPanel.setMsgDisplay(e); } else { @@ -370,4 +373,23 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme public boolean isSupportShared() { return true; } + + @Override + public BasicTopXCreator getTopXCreator() { + return new TopXElementCase(this); + } + + private class TopXElementCase extends TopXCreator { + private UILabel imageLabel; + + public TopXElementCase(XCreator creator) { + super(creator); + if (creator instanceof XElementCase) { + XElementCase elementCase = (XElementCase) creator; + imageLabel = elementCase.initImageBackground(); + add(imageLabel); + } + } + } + } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java index 6190ffaebb..5db000e189 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java @@ -7,6 +7,7 @@ import com.fr.design.form.util.XCreatorConstants; import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor; +import com.fr.design.mainframe.widget.topxcreator.BasicTopXCreator; import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.stable.core.PropertyChangeAdapter; @@ -130,4 +131,9 @@ public class XWAbsoluteBodyLayout extends XWAbsoluteLayout { public boolean isSupportShared() { return false; } + + @Override + public BasicTopXCreator getTopXCreator() { + return null; + } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java index b98c2a952d..98143a7ea0 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -25,6 +25,8 @@ import com.fr.design.mainframe.FormArea; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.WidgetHelpDialog; import com.fr.design.mainframe.WidgetPropertyPane; +import com.fr.design.mainframe.widget.topxcreator.BasicTopXCreator; +import com.fr.design.mainframe.widget.topxcreator.TopXCreator; import com.fr.form.ui.Connector; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteLayout; @@ -542,6 +544,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { selectionModel.selectACreatorAtMouseEvent(e); designer.repaint(); + editingMouseListener.refreshTopXCreator(isEditing); if (editingMouseListener.stopEditing()) { if (this != designer.getRootComponent()) { @@ -606,4 +609,9 @@ public class XWAbsoluteLayout extends XLayoutContainer { return super.getWidgetPropertyUIProviders(); } } + + @Override + public BasicTopXCreator getTopXCreator() { + return new TopXCreator(this); + } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java index cb288c98cc..384ee07b64 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java @@ -15,6 +15,7 @@ import com.fr.design.mainframe.widget.editors.BooleanEditor; import com.fr.design.mainframe.widget.editors.WidgetDisplayPosition; import com.fr.design.mainframe.widget.renderer.BackgroundRenderer; import com.fr.design.mainframe.widget.renderer.WidgetDisplayPositionRender; +import com.fr.design.mainframe.widget.topxcreator.BasicTopXCreator; import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.WFitLayout; import com.fr.form.ui.container.WParameterLayout; @@ -251,4 +252,10 @@ public class XWParameterLayout extends XWAbsoluteLayout { return false; } + @Override + public BasicTopXCreator getTopXCreator() { + return null; + } + + } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java index 2cc56ee9ba..b8fe8f0049 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java @@ -7,6 +7,7 @@ import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.adapters.layout.FRTitleLayoutAdapter; import com.fr.design.form.layout.FRTitleLayout; import com.fr.design.fun.WidgetPropertyUIProvider; +import com.fr.design.mainframe.widget.topxcreator.BasicTopXCreator; import com.fr.form.ui.Label; import com.fr.form.ui.Widget; import com.fr.form.ui.WidgetTitle; @@ -189,4 +190,9 @@ public class XWTitleLayout extends DedicateLayoutContainer { XCreator creator = getPropertyDescriptorCreator(); return creator.getWidgetPropertyUIProviders(); } + + @Override + public BasicTopXCreator getTopXCreator() { + return getEditingChildCreator().getTopXCreator(); + } } \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java index 25da3e7754..3ad1463b97 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java @@ -16,16 +16,15 @@ import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWBorderLayout; import com.fr.design.designer.creator.XWidgetCreator; -import com.fr.design.designer.properties.mobile.MobileBooKMarkUsePropertyUI; -import com.fr.design.form.util.FormDesignerUtils; import com.fr.design.form.util.XCreatorConstants; -import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.icon.IconPathConstants; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.EditingMouseListener; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.WidgetHelpDialog; import com.fr.design.mainframe.WidgetPropertyPane; +import com.fr.design.mainframe.widget.topxcreator.BasicTopXCreator; +import com.fr.design.mainframe.widget.topxcreator.TopXCreator; import com.fr.form.event.Listener; import com.fr.form.ui.CardSwitchButton; import com.fr.form.ui.LayoutBorderStyle; @@ -438,6 +437,7 @@ public class XWCardMainBorderLayout extends XWBorderLayout { setEditable(isEditing); selectionModel.selectACreatorAtMouseEvent(e); + editingMouseListener.refreshTopXCreator(isEditing); designer.repaint(); if (editingMouseListener.stopEditing()) { @@ -514,4 +514,9 @@ public class XWCardMainBorderLayout extends XWBorderLayout { public boolean isSupportShared() { return true; } + + @Override + public BasicTopXCreator getTopXCreator() { + return new TopXCreator(this); + } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java index 49f246256c..010a382178 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java @@ -248,6 +248,7 @@ public class XWCardTagLayout extends XWHorizontalBoxLayout { if (e.getClickCount() <= 1) { selectionModel.selectACreatorAtMouseEvent(e); } + editingMouseListener.refreshTopXCreator(); if (editingMouseListener.stopEditing()) { if (this != designer.getRootComponent()) { ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, this); diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTitleLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTitleLayout.java index babc54b316..f6f6b2b411 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTitleLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTitleLayout.java @@ -204,6 +204,7 @@ public class XWCardTitleLayout extends XWBorderLayout { if (e.getClickCount() <= 1) { selectionModel.selectACreatorAtMouseEvent(e); } + editingMouseListener.refreshTopXCreator(); if (editingMouseListener.stopEditing()) { if (this != designer.getRootComponent()) { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java b/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java index a2f295f87d..cbf6852558 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe; import com.fr.design.constants.UIConstants; import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.treeview.ComponentTreeCellRenderer; import com.fr.design.designer.treeview.ComponentTreeModel; @@ -15,7 +16,9 @@ import javax.swing.JPanel; import javax.swing.JPopupMenu; import javax.swing.JTree; import javax.swing.SwingUtilities; +import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.TreeCellRenderer; +import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; import javax.swing.tree.TreeSelectionModel; import java.awt.BorderLayout; @@ -30,6 +33,9 @@ import java.awt.event.MouseEvent; import java.awt.image.BufferedImage; import java.io.IOException; import java.util.ArrayList; +import java.util.Enumeration; +import java.util.List; +import java.util.Vector; public class ComponentTree extends JTree { @@ -81,6 +87,7 @@ public class ComponentTree extends JTree { public void setSelectionPath(TreePath path) { // 不管点击哪一项,都要先退出编辑状态(图表、报表块、绝对布局、tab块) designer.stopEditing(path); + designer.getTopXCreators().refresh(); super.setSelectionPath(path); } @@ -129,6 +136,7 @@ public class ComponentTree extends JTree { setSelectionPaths(treepath); if (treepath.length > 0) { scrollPathToVisible(treepath[0]); + //expandPath(treepath[0]); } } @@ -228,6 +236,64 @@ public class ComponentTree extends JTree { repaint(); } + public void expandTree() { + TreePath[] paths = getSelectedTreePath(); + if (paths.length > 0) { + expandPath(getSelectedTreePath()[0]); + } + } + public void getExpandNodes(List searchList) { + getExpandNodes((XLayoutContainer)designer.getTopContainer(),searchList); + } + + public void getExpandNodes(XLayoutContainer container, List searchList) { + for (int i = 0, size = container.getXCreatorCount(); i < size; i++) { + XCreator creator = container.getXCreator(i); + TreePath treePath=buildTreePath(creator); + if(isExpanded(treePath)) searchList.add(treePath); + if (creator instanceof XLayoutContainer) { + getExpandNodes((XLayoutContainer) creator, searchList); + } + } + } + public void expandNodes(List list){ + for(TreePath treePath:list) { + if (treePath.getLastPathComponent() instanceof XLayoutContainer) { + XLayoutContainer creator= (XLayoutContainer) treePath.getLastPathComponent(); + if (XCreatorUtils.getParentXLayoutContainer(creator) == null) { + continue; + } + expandPath(treePath); + } + } + } +/* private void expandNode(JTree myTree, DefaultMutableTreeNode currNode, List list){ + if(currNode.getParent()==null){ + list.remove(0); + } + if(list.size()<=0) return; + + int childCount = currNode.getChildCount(); + String strNode = vNode.elementAt(0).toString(); + DefaultMutableTreeNode child = null; + boolean flag=false; + for(int i=0; i0){ + expandNode(myTree,child, vNode); + }else{ + myTree.expandPath(new TreePath(child.getPath())); + } + } + }*/ + private TreePath buildTreePath(Component comp) { ArrayList path = new ArrayList(); Component parent = comp; diff --git a/designer-form/src/main/java/com/fr/design/mainframe/CoverPane.java b/designer-form/src/main/java/com/fr/design/mainframe/CoverPane.java index d692eaa5ea..5aa4f93ad5 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/CoverPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/CoverPane.java @@ -8,7 +8,7 @@ import com.fr.general.IOUtils; import com.fr.stable.Constants; -import javax.swing.JPanel; +import javax.swing.JComponent; import java.awt.AlphaComposite; import java.awt.Color; import java.awt.Component; @@ -28,7 +28,7 @@ import java.awt.Rectangle; * Date: 14-7-24 * Time: 上午9:09 */ -public class CoverPane extends JPanel { +public class CoverPane extends JComponent { private UIButton editButton; private AlphaComposite composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f); @@ -94,6 +94,7 @@ public class CoverPane extends JPanel { int preferWidth = editButton.getPreferredSize().width; int preferHeight = editButton.getPreferredSize().height; editButton.setBounds((width - preferWidth) / 2, (height - preferHeight) / 2, preferWidth, preferHeight); + System.out.println(width+"---"+height); } @Override diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index 183c0b08c6..c59d37eaab 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -308,6 +308,7 @@ public class EditingMouseListener extends MouseInputAdapter { XCreator component = designer.getComponentAt(e); setCoverPaneNotDisplay(component, e, false); + designer.getTopXCreators().displayCoverPane(e); if (processTopLayoutMouseMove(component, e)) { return; @@ -692,6 +693,7 @@ public class EditingMouseListener extends MouseInputAdapter { currentXCreator.stopEditing(); currentXCreator = null; currentEditor = null; + refreshTopXCreator(); return true; } return true; @@ -719,4 +721,19 @@ public class EditingMouseListener extends MouseInputAdapter { } currentEditor.getEditorTarget().setBounds(bounds); } + + /** + * 刷新顶层组件 + * */ + public void refreshTopXCreator(boolean isEditing){ + designer.refreshTopXCreator(isEditing); + } + + /** + * 刷新顶层组件 + * */ + public void refreshTopXCreator(){ + refreshTopXCreator(false); + } + } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index e5ce0f726f..191425df22 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -35,7 +35,9 @@ import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWAbsoluteBodyLayout; import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.design.designer.creator.XWBorderLayout; +import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWParameterLayout; +import com.fr.design.designer.creator.XWTitleLayout; import com.fr.design.designer.properties.FormWidgetAuthorityEditPane; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.event.DesignerOpenedListener; @@ -43,6 +45,7 @@ import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.form.util.XCreatorConstants; import com.fr.design.fun.RightSelectionHandlerProvider; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; +import com.fr.design.mainframe.widget.topxcreator.TopXCreators; import com.fr.design.menu.MenuDef; import com.fr.design.menu.ShortCut; import com.fr.design.menu.ToolBarDef; @@ -121,6 +124,7 @@ public class FormDesigner extends TargetComponent implements TreeSelection private FormArea formArea; private ConnectorHelper connectorHelper; private boolean isReportBlockEditing = false; + private TopXCreators topXCreators; //组件重叠 private boolean isWidgetsIntersect = false; @@ -184,6 +188,8 @@ public class FormDesigner extends TargetComponent implements TreeSelection new FormDesignerDropTarget(this);// 添加Drag and Drop. this.switchAction = switchAction; + topXCreators=new TopXCreators(this); + add(topXCreators); // 必须刷新"参数/控件树"面板,否则,若最近一次打开模版为 cpt,重启设计器,打开 frm,控件树消失 populateParameterPropertyPane(); @@ -825,6 +831,39 @@ public class FormDesigner extends TargetComponent implements TreeSelection return null; } + /** + * 从已选择的组件中找x,y所在的组件 + */ + private XCreator xCreatorAt(int x, int y, XCreator[] xCreators) { + for (XCreator creator : xCreators) { + if (creator == null || !creator.isVisible()) { + continue; + } + if (creator instanceof XWAbsoluteBodyLayout || creator instanceof XWFitLayout || creator instanceof XWParameterLayout) { + continue; + } + x -= creator.getX(); + y -= creator.getY(); + Rectangle rect = ComponentUtils.computeVisibleRect(creator); + // 判断是否处于交叉区域 + if (isIntersectArea(x, y, rect)) { + if (creator instanceof XWTitleLayout) { + return creator.getEditingChildCreator(); + } + return creator; + } + } + return null; + } + + /** + * 刷新顶层组件 + * */ + public void refreshTopXCreator(boolean isEditing){ + topXCreators.refresh(); + topXCreators.setVisible(!isEditing); + } + private boolean isIntersectArea(int x, int y, Rectangle rect) { return x >= rect.getX() && (x <= (rect.getX() + rect.getWidth())) && (y >= rect.getY()) && (y <= (rect.getY() + rect.getHeight())); @@ -984,6 +1023,10 @@ public class FormDesigner extends TargetComponent implements TreeSelection invalidateLayout(); } + public TopXCreators getTopXCreators() { + return topXCreators; + } + public StateModel getStateModel() { return stateModel; } @@ -1001,9 +1044,19 @@ public class FormDesigner extends TargetComponent implements TreeSelection return getComponentAt(p.x, p.y); } + /** + * 先从已选择则的组件中去找,再遍历root去找 + * */ @Override public XCreator getComponentAt(int x, int y) { - return getComponentAt(x, y, null); + XLayoutContainer container = y < paraHeight - formArea.getVerticalValue() ? paraComponent : rootComponent; + if (container == null) { + container = rootComponent; + } + int relativeX = x + (int) (formArea.getHorizontalValue() / scale) - container.getX(); + int relativeY = y + (int) (formArea.getVerticalValue() / scale) - container.getY(); + XCreator result = xCreatorAt(relativeX, relativeY, selectionModel.getSelection().getSelectedCreators()); + return result == null ? getComponentAt(x, y, null) : result; } @Nullable @@ -1311,6 +1364,10 @@ public class FormDesigner extends TargetComponent implements TreeSelection } } + public void paintTopCreators(Graphics clipg){ + topXCreators.paint(clipg); + } + /** * 重置组件边界 */ diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java index 26547229bb..2a8e255e83 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java @@ -84,6 +84,7 @@ public class FormDesignerUI extends ComponentUI { // 设计参数面板 repaintPara(g, paraComponent, c); } + repaintTopXCreators(g); if (designer.isDrawLineMode() && designer.getDrawLineHelper().drawLining()) { designer.getDrawLineHelper().drawAuxiliaryLine(g); @@ -445,4 +446,8 @@ public class FormDesignerUI extends ComponentUI { ComponentUtils.resetBuffer(dbcomponents); } + private void repaintTopXCreators(Graphics g){ + designer.paintTopCreators(g); + } + } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormHierarchyTreePane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormHierarchyTreePane.java index 6822422b29..0695813eb4 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormHierarchyTreePane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormHierarchyTreePane.java @@ -24,12 +24,14 @@ import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.SwingUtilities; +import javax.swing.tree.TreePath; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.util.ArrayList; +import java.util.List; /** @@ -89,10 +91,13 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree /** * 刷新 */ + //TODO 太乱了,需要重写,监听器里加了监听器是什么意思,每次调用该方法都会添加一个新的监听器 public void refreshDockingView() { FormDesigner formDesigner = this.getEditingFormDesigner(); + Listlist=new ArrayList<>(); removeAll(); if (this.componentTree != null) { + componentTree.getExpandNodes(list); this.componentTree.removeAll(); } if (formDesigner == null) { @@ -100,6 +105,8 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree return; } componentTree = new ComponentTree(formDesigner); + //保证删除组件后组件树不收起 + componentTree.expandNodes(list); formDesigner.addDesignerEditListener(new DesignerEditListener() { @Override public void fireCreatorModified(DesignerEvent evt) { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/BasicTopXCreator.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/BasicTopXCreator.java new file mode 100644 index 0000000000..1b248a9d1b --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/BasicTopXCreator.java @@ -0,0 +1,72 @@ +package com.fr.design.mainframe.widget.topxcreator; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.mainframe.CoverReportPane; +import com.fr.design.mainframe.FormDesigner; +import com.fr.design.mainframe.WidgetPropertyPane; +import com.fr.design.utils.ComponentUtils; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.MouseEvent; + +/** + * @Author: Yuan.Wang + * @Date: 2020/8/31 + */ +public class BasicTopXCreator extends JComponent { + private FormDesigner designer; + private XCreator creator; + + private JComponent editor; + + public BasicTopXCreator(XCreator creator) { + this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); + this.creator = creator; + init(); + } + + private void init() { + setOpaque(false); + setBackground(null); + setLayout(null); + setBounds(calculateBounds(creator)); + initEditor(); + if(editor!=null) { + add(editor); + } + } + + + //子类可能会重写该方法 + protected void resetSize(Rectangle bounds) { + //do nothing + } + + protected void initEditor() { + + } + + /** + * 重新设置组件大小 + * */ + public void resizeTopXCreator() { + Rectangle bounds=calculateBounds(creator); + setBounds(bounds); + resetSize(bounds); + } + + public void displayCoverPane(MouseEvent e, boolean visible) {} + + /** + * 计算显示大小 + * */ + private Rectangle calculateBounds(XCreator xCreator) { + Rectangle rect = ComponentUtils.getRelativeBounds(creator); + Rectangle bounds = new Rectangle(0, 0, creator.getWidth(), creator.getHeight()); + bounds.x += (rect.x - designer.getHorizontalScaleValue()); + bounds.y += (rect.y - designer.getVerticalScaleValue()); + return bounds; + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreator.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreator.java new file mode 100644 index 0000000000..6218fe83f7 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreator.java @@ -0,0 +1,54 @@ +package com.fr.design.mainframe.widget.topxcreator; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.mainframe.CoverReportPane; +import com.fr.design.mainframe.FormDesigner; +import com.fr.design.mainframe.WidgetPropertyPane; +import com.fr.design.utils.ComponentUtils; + +import java.awt.*; +import java.awt.event.MouseEvent; + +/** + * @Author: Yuan.Wang + * @Date: 2020/8/26 + */ +public class TopXCreator extends BasicTopXCreator { + + private final CoverReportPane coverPanel; + + public TopXCreator(XCreator creator) { + super(creator); + coverPanel = new CoverReportPane(); + init(); + } + + private void init() { + coverPanel.setSize(getSize()); + coverPanel.setVisible(false); + add(coverPanel); + } + + + protected void resetSize(Rectangle bounds) { + coverPanel.setSize(getSize()); + } + + public void setCoverPaneVisible(boolean visible) { + coverPanel.setVisible(visible); + } + + public void displayCoverPane(MouseEvent event, boolean visible) { + if (!visible) { + setVisible(false); + return; + } + Rectangle rect = getBounds(); + if (rect.contains(event.getX(), event.getY())) { + coverPanel.setVisible(true); + } else { + coverPanel.setVisible(false); + } + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreators.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreators.java new file mode 100644 index 0000000000..2f8ae3b406 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreators.java @@ -0,0 +1,95 @@ +package com.fr.design.mainframe.widget.topxcreator; + +import com.fr.design.designer.beans.models.SelectionModel; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.mainframe.FormDesigner; + +import java.awt.event.MouseEvent; + +import javax.swing.*; +import java.awt.*; + + +/** + * 需要显示顶层的组件层 + * + * @Author: Yuan.Wang + * @Date: 2020/8/25 + */ +public class TopXCreators extends JComponent { + final private FormDesigner designer; + + public TopXCreators(FormDesigner designer) { + this.designer = designer; + init(); + } + + private void init() { + setLayout(null); + setVisible(false); + setBackground(null); + setOpaque(false); + } + + /** + * 选中的组件有变化时刷新 + */ + public void refresh() { + removeAll(); + addXCreators(); + } + + @Override + public void paint(Graphics g) { + setSize(designer.getSize()); + resizeTopXCreators(); + super.paint(g); + } + + @Override + public void setVisible(boolean aFlag) { + super.setVisible(aFlag); + for (int i = 0, count = getComponentCount(); i < count; i++) { + if (getComponent(i) instanceof TopXCreator) { + TopXCreator xCreator = (TopXCreator) getComponent(i); + xCreator.setCoverPaneVisible(aFlag); + } + } + repaint(); + } + + /** + * 依据MouseEvent坐标来设置是否显示蒙层 + */ + public void displayCoverPane(MouseEvent e) { + for (int i = 0, count = getComponentCount(); i < count; i++) { + BasicTopXCreator xCreator = (BasicTopXCreator) getComponent(i); + xCreator.displayCoverPane(e, isVisible()); + } + } + + /** + * 加入被选择的组件 + */ + private void addXCreators() { + SelectionModel selectionModel = designer.getSelectionModel(); + XCreator[] xCreators = selectionModel.getSelection().getSelectedCreators(); + for (XCreator creator : xCreators) { + BasicTopXCreator topXCreator = creator.getTopXCreator(); + if (topXCreator != null) { + add(topXCreator); + } + } + } + + /** + * 更新顶层组件的位置和大小 + */ + private void resizeTopXCreators() { + for (int i = 0, count = getComponentCount(); i < count; i++) { + BasicTopXCreator topXCreator = (BasicTopXCreator) getComponent(i); + topXCreator.resizeTopXCreator(); + } + repaint(); + } +} From 72f8c306b78ac950b30fb6530d3692c4f1746a02 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Mon, 31 Aug 2020 16:36:01 +0800 Subject: [PATCH 046/267] =?UTF-8?q?REPORT-36985=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=20=E7=BB=84=E4=BB=B6=E6=A0=91=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E4=BC=98=E5=8C=96=E5=92=8C=E9=80=89=E6=8B=A9=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=97=B6=E8=AE=A9=E5=85=B6=E6=B5=AE=E4=BA=8E=E9=A1=B6?= =?UTF-8?q?=E5=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/beans/models/SelectionModel.java | 2 - .../fr/design/designer/creator/XButton.java | 15 ------- .../design/designer/creator/XChartEditor.java | 8 ++-- .../fr/design/designer/creator/XCreator.java | 33 ++++++++++++++-- .../design/designer/creator/XElementCase.java | 7 +--- .../fr/design/mainframe/ComponentTree.java | 39 ++++--------------- .../com/fr/design/mainframe/CoverPane.java | 1 - .../com/fr/design/mainframe/FormDesigner.java | 11 +++--- .../widget/topxcreator/BasicTopXCreator.java | 21 +++++----- .../widget/topxcreator/TopXCreator.java | 8 +++- .../widget/topxcreator/TopXCreators.java | 9 ++++- 11 files changed, 74 insertions(+), 80 deletions(-) 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 49e0f94d29..42db0d8503 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 @@ -84,7 +84,6 @@ public class SelectionModel { selection.reset(); } else { //按下Ctrl或者shift键时鼠标可以进行多选,两次点击同一控件就取消选中 - //XCreator comp = designer.getComponentAt(e); XLayoutContainer topLayout = XCreatorUtils.getHotspotContainer(comp).getTopLayout(); if (topLayout != null && !topLayout.isEditable()) { comp = topLayout; @@ -98,7 +97,6 @@ public class SelectionModel { comp = designer.getComponentAt(e); } // 获取e所在的组件 - //XCreator comp = designer.getComponentAt(e); selectACreator(comp); } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java b/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java index 5f5bb73b22..d4e9758316 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java @@ -309,19 +309,4 @@ public class XButton extends XWidgetCreator { } } - -/* @Override - public BasicTopCreator getTopXCreator(){ - return new BasicTopXCreator(this) { - @Override - protected void initEditor() { - XButton(XButton.this.toData(),this.getSize() - - } - } - - //return new XButton((Button)this.toData(),this.getSize()); - - }*/ - } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java index 0ca125e930..f846f29bd2 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java @@ -366,20 +366,20 @@ public class XChartEditor extends XBorderStyleWidgetCreator { return new TopXChart(this); } - private class TopXChart extends TopXCreator{ + private class TopXChart extends TopXCreator { private final DesignerEditor designerEditor; public TopXChart(XCreator creator) { super(creator); designerEditor = creator.getDesignerEditor(); - Rectangle bounds=getBounds(); + Rectangle bounds = getBounds(); designerEditor.getEditorTarget().setBounds(bounds.x + 1, bounds.y + 1, bounds.width - 2, bounds.height - 2); } /** * 更新designerEditor的大小 - * */ - protected void resetSize(Rectangle bounds){ + */ + protected void resetSize(Rectangle bounds) { super.resetSize(bounds); designerEditor.getEditorTarget().setBounds(bounds.x + 1, bounds.y + 1, bounds.width - 2, bounds.height - 2); } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java index 0496d74787..82e7da5b2d 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java @@ -25,12 +25,12 @@ import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WTitleLayout; import com.fr.stable.Constants; +import com.fr.stable.CoreGraphHelper; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; +import com.fr.third.javax.annotation.Nullable; -import javax.swing.BorderFactory; -import javax.swing.JComponent; -import javax.swing.JPanel; +import javax.swing.*; import javax.swing.border.Border; import java.awt.BorderLayout; import java.awt.Color; @@ -39,6 +39,7 @@ import java.awt.Dimension; import java.awt.Graphics; import java.awt.Rectangle; import java.awt.event.MouseEvent; +import java.awt.image.BufferedImage; import java.beans.IntrospectionException; import java.util.ArrayList; import java.util.List; @@ -540,6 +541,8 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo selectionModel.selectACreatorAtMouseEvent(e); } + editingMouseListener.refreshTopXCreator(); + if (editingMouseListener.stopEditing() && this != designer.getRootComponent()) { ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, this); editingMouseListener.startEditing(this, adapter.getDesignerEditor(), adapter); @@ -807,8 +810,30 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo /** * 获得该组件的顶层显示组件 */ + @Nullable public BasicTopXCreator getTopXCreator() { - return null; + return new BasicTopXCreator(this){ + @Override + protected void addComponent() { + BufferedImage image=getImage(); + Icon icon = new ImageIcon(image); + JLabel jLabel = new JLabel(icon,JLabel.CENTER); + jLabel.setSize(getSize()); + this.add(jLabel); + } + }; + } + + /** + * 获得组件的图像 + * */ + public BufferedImage getImage() { + BufferedImage image = CoreGraphHelper.createBufferedImage(getWidth(), getHeight()); + Graphics g = image.createGraphics(); + this.paint(g); + return image; } + + } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java index a9fd877168..d84fd2e0cd 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java @@ -384,11 +384,8 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme public TopXElementCase(XCreator creator) { super(creator); - if (creator instanceof XElementCase) { - XElementCase elementCase = (XElementCase) creator; - imageLabel = elementCase.initImageBackground(); - add(imageLabel); - } + imageLabel = initImageBackground(); + add(imageLabel); } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java b/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java index cbf6852558..2fdd1f8f1e 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java @@ -236,12 +236,9 @@ public class ComponentTree extends JTree { repaint(); } - public void expandTree() { - TreePath[] paths = getSelectedTreePath(); - if (paths.length > 0) { - expandPath(getSelectedTreePath()[0]); - } - } + /** + * 获得树的展开路径 + * */ public void getExpandNodes(List searchList) { getExpandNodes((XLayoutContainer)designer.getTopContainer(),searchList); } @@ -256,6 +253,10 @@ public class ComponentTree extends JTree { } } } + + /** + * 将树按照展开路径进行展开 + * */ public void expandNodes(List list){ for(TreePath treePath:list) { if (treePath.getLastPathComponent() instanceof XLayoutContainer) { @@ -267,32 +268,6 @@ public class ComponentTree extends JTree { } } } -/* private void expandNode(JTree myTree, DefaultMutableTreeNode currNode, List list){ - if(currNode.getParent()==null){ - list.remove(0); - } - if(list.size()<=0) return; - - int childCount = currNode.getChildCount(); - String strNode = vNode.elementAt(0).toString(); - DefaultMutableTreeNode child = null; - boolean flag=false; - for(int i=0; i0){ - expandNode(myTree,child, vNode); - }else{ - myTree.expandPath(new TreePath(child.getPath())); - } - } - }*/ private TreePath buildTreePath(Component comp) { ArrayList path = new ArrayList(); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/CoverPane.java b/designer-form/src/main/java/com/fr/design/mainframe/CoverPane.java index 5aa4f93ad5..a4c4014408 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/CoverPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/CoverPane.java @@ -94,7 +94,6 @@ public class CoverPane extends JComponent { int preferWidth = editButton.getPreferredSize().width; int preferHeight = editButton.getPreferredSize().height; editButton.setBounds((width - preferWidth) / 2, (height - preferHeight) / 2, preferWidth, preferHeight); - System.out.println(width+"---"+height); } @Override diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index 191425df22..5cb0157f9e 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -846,12 +846,13 @@ public class FormDesigner extends TargetComponent implements TreeSelection y -= creator.getY(); Rectangle rect = ComponentUtils.computeVisibleRect(creator); // 判断是否处于交叉区域 - if (isIntersectArea(x, y, rect)) { - if (creator instanceof XWTitleLayout) { - return creator.getEditingChildCreator(); - } - return creator; + if (!isIntersectArea(x, y, rect)) { + continue; + } + if (creator instanceof XWTitleLayout) { + return creator.getEditingChildCreator(); } + return creator; } return null; } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/BasicTopXCreator.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/BasicTopXCreator.java index 1b248a9d1b..d70b07abb7 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/BasicTopXCreator.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/BasicTopXCreator.java @@ -5,10 +5,12 @@ import com.fr.design.mainframe.CoverReportPane; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.utils.ComponentUtils; +import com.fr.stable.CoreGraphHelper; import javax.swing.*; import java.awt.*; import java.awt.event.MouseEvent; +import java.awt.image.BufferedImage; /** * @Author: Yuan.Wang @@ -18,8 +20,6 @@ public class BasicTopXCreator extends JComponent { private FormDesigner designer; private XCreator creator; - private JComponent editor; - public BasicTopXCreator(XCreator creator) { this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); this.creator = creator; @@ -30,11 +30,8 @@ public class BasicTopXCreator extends JComponent { setOpaque(false); setBackground(null); setLayout(null); - setBounds(calculateBounds(creator)); - initEditor(); - if(editor!=null) { - add(editor); - } + setBounds(calculateBounds()); + addComponent(); } @@ -43,7 +40,7 @@ public class BasicTopXCreator extends JComponent { //do nothing } - protected void initEditor() { + protected void addComponent() { } @@ -51,7 +48,7 @@ public class BasicTopXCreator extends JComponent { * 重新设置组件大小 * */ public void resizeTopXCreator() { - Rectangle bounds=calculateBounds(creator); + Rectangle bounds=calculateBounds(); setBounds(bounds); resetSize(bounds); } @@ -61,7 +58,7 @@ public class BasicTopXCreator extends JComponent { /** * 计算显示大小 * */ - private Rectangle calculateBounds(XCreator xCreator) { + private Rectangle calculateBounds() { Rectangle rect = ComponentUtils.getRelativeBounds(creator); Rectangle bounds = new Rectangle(0, 0, creator.getWidth(), creator.getHeight()); bounds.x += (rect.x - designer.getHorizontalScaleValue()); @@ -69,4 +66,8 @@ public class BasicTopXCreator extends JComponent { return bounds; } + @Override + public void paint(Graphics g) { + super.paint(g); + } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreator.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreator.java index 6218fe83f7..6ad9e1843d 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreator.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreator.java @@ -34,10 +34,16 @@ public class TopXCreator extends BasicTopXCreator { coverPanel.setSize(getSize()); } - public void setCoverPaneVisible(boolean visible) { + /** + * 设置是否显示蒙层 + * */ + public void displayCoverPane(boolean visible) { coverPanel.setVisible(visible); } + /** + * 依据鼠标事件和visible设置是否显示蒙层 + * */ public void displayCoverPane(MouseEvent event, boolean visible) { if (!visible) { setVisible(false); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreators.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreators.java index 2f8ae3b406..417ec80e80 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreators.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreators.java @@ -1,5 +1,7 @@ package com.fr.design.mainframe.widget.topxcreator; +import com.fr.design.designer.beans.events.DesignerEditListener; +import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.models.SelectionModel; import com.fr.design.designer.creator.XCreator; import com.fr.design.mainframe.FormDesigner; @@ -29,6 +31,11 @@ public class TopXCreators extends JComponent { setVisible(false); setBackground(null); setOpaque(false); + designer.addDesignerEditListener(e -> { + if (e.getCreatorEventID() == DesignerEvent.CREATOR_EDITED) { + refresh(); + } + }); } /** @@ -52,7 +59,7 @@ public class TopXCreators extends JComponent { for (int i = 0, count = getComponentCount(); i < count; i++) { if (getComponent(i) instanceof TopXCreator) { TopXCreator xCreator = (TopXCreator) getComponent(i); - xCreator.setCoverPaneVisible(aFlag); + xCreator.displayCoverPane(aFlag); } } repaint(); From 140dd5151536210b0cff7a2dc94ab7c7067adf78 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Mon, 31 Aug 2020 16:41:29 +0800 Subject: [PATCH 047/267] =?UTF-8?q?REPORT-36985=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=97=A0=E7=94=A8=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/widget/topxcreator/BasicTopXCreator.java | 3 --- .../fr/design/mainframe/widget/topxcreator/TopXCreator.java | 3 --- .../fr/design/mainframe/widget/topxcreator/TopXCreators.java | 1 - 3 files changed, 7 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/BasicTopXCreator.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/BasicTopXCreator.java index d70b07abb7..e49aaf6e85 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/BasicTopXCreator.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/BasicTopXCreator.java @@ -1,16 +1,13 @@ package com.fr.design.mainframe.widget.topxcreator; import com.fr.design.designer.creator.XCreator; -import com.fr.design.mainframe.CoverReportPane; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.utils.ComponentUtils; -import com.fr.stable.CoreGraphHelper; import javax.swing.*; import java.awt.*; import java.awt.event.MouseEvent; -import java.awt.image.BufferedImage; /** * @Author: Yuan.Wang diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreator.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreator.java index 6ad9e1843d..52bae99f17 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreator.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreator.java @@ -2,9 +2,6 @@ package com.fr.design.mainframe.widget.topxcreator; import com.fr.design.designer.creator.XCreator; import com.fr.design.mainframe.CoverReportPane; -import com.fr.design.mainframe.FormDesigner; -import com.fr.design.mainframe.WidgetPropertyPane; -import com.fr.design.utils.ComponentUtils; import java.awt.*; import java.awt.event.MouseEvent; diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreators.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreators.java index 417ec80e80..f271c3cc10 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreators.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreators.java @@ -1,6 +1,5 @@ package com.fr.design.mainframe.widget.topxcreator; -import com.fr.design.designer.beans.events.DesignerEditListener; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.models.SelectionModel; import com.fr.design.designer.creator.XCreator; From 017db0e76fe60cab7dec17b623cd49f2f4d491c3 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 31 Aug 2020 16:56:16 +0700 Subject: [PATCH 048/267] =?UTF-8?q?KERNEL-4069=20jdk11=20macos=E7=9A=84jdk?= =?UTF-8?q?=E9=87=8C=E9=9D=A2=E7=A7=BB=E9=99=A4=E4=BA=86windows=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E7=9A=84LAF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/gui/icombobox/LazyComboBoxTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/icombobox/LazyComboBoxTest.java b/designer-base/src/main/java/com/fr/design/gui/icombobox/LazyComboBoxTest.java index 37e9db1546..9906749b7b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombobox/LazyComboBoxTest.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombobox/LazyComboBoxTest.java @@ -3,10 +3,10 @@ */ package com.fr.design.gui.icombobox; +import com.fr.design.gui.UILookAndFeel; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.log.FineLoggerFactory; -import com.sun.java.swing.plaf.windows.WindowsLookAndFeel; import javax.swing.JFrame; import javax.swing.JPanel; @@ -23,7 +23,7 @@ import java.awt.event.ItemListener; public class LazyComboBoxTest { public static void main(String[] args) { try { - UIManager.setLookAndFeel(new WindowsLookAndFeel()); + UIManager.setLookAndFeel(new UILookAndFeel()); } catch (UnsupportedLookAndFeelException e1) { FineLoggerFactory.getLogger().error(e1.getMessage(), e1); } From 292a5bc71eddaf35c8f9109eda61e591b7f04f1a Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Mon, 31 Aug 2020 19:05:36 +0800 Subject: [PATCH 049/267] =?UTF-8?q?REPORT-36985=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=97=A0=E7=94=A8=E4=BE=9D=E8=B5=96=EF=BC=8C=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/designer/creator/XButton.java | 1 - .../java/com/fr/design/designer/creator/XCreator.java | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java b/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java index d4e9758316..9a627ab2c0 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java @@ -14,7 +14,6 @@ import com.fr.design.mainframe.widget.editors.ImgBackgroundEditor; import com.fr.design.mainframe.widget.editors.ShortCutTextEditor; import com.fr.design.mainframe.widget.renderer.FontCellRenderer; import com.fr.design.mainframe.widget.renderer.IconCellRenderer; -import com.fr.design.mainframe.widget.topxcreator.BasicTopXCreator; import com.fr.form.parameter.FormSubmitButton; import com.fr.form.ui.Button; import com.fr.form.ui.FreeButton; diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java index 82e7da5b2d..2eecf817c1 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java @@ -812,12 +812,12 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo */ @Nullable public BasicTopXCreator getTopXCreator() { - return new BasicTopXCreator(this){ + return new BasicTopXCreator(this) { @Override protected void addComponent() { - BufferedImage image=getImage(); + BufferedImage image = getImage(); Icon icon = new ImageIcon(image); - JLabel jLabel = new JLabel(icon,JLabel.CENTER); + JLabel jLabel = new JLabel(icon, JLabel.CENTER); jLabel.setSize(getSize()); this.add(jLabel); } @@ -826,7 +826,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo /** * 获得组件的图像 - * */ + */ public BufferedImage getImage() { BufferedImage image = CoreGraphHelper.createBufferedImage(getWidth(), getHeight()); Graphics g = image.createGraphics(); From add68778954f89a4d837e2dcbee83317d9cc7b0a Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Tue, 1 Sep 2020 09:23:20 +0800 Subject: [PATCH 050/267] =?UTF-8?q?REPORT-36985=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=97=A0=E7=94=A8=E4=BE=9D=E8=B5=96=EF=BC=8C=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/designer/creator/XCreator.java | 10 +++++++--- .../com/fr/design/mainframe/FormHierarchyTreePane.java | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java index 2eecf817c1..20f2788117 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java @@ -30,7 +30,12 @@ import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.third.javax.annotation.Nullable; -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.ImageIcon; +import javax.swing.JComponent; +import javax.swing.JLabel; +import javax.swing.JPanel; import javax.swing.border.Border; import java.awt.BorderLayout; import java.awt.Color; @@ -815,8 +820,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo return new BasicTopXCreator(this) { @Override protected void addComponent() { - BufferedImage image = getImage(); - Icon icon = new ImageIcon(image); + Icon icon = new ImageIcon(getImage()); JLabel jLabel = new JLabel(icon, JLabel.CENTER); jLabel.setSize(getSize()); this.add(jLabel); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormHierarchyTreePane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormHierarchyTreePane.java index 0695813eb4..f94475a768 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormHierarchyTreePane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormHierarchyTreePane.java @@ -94,7 +94,7 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree //TODO 太乱了,需要重写,监听器里加了监听器是什么意思,每次调用该方法都会添加一个新的监听器 public void refreshDockingView() { FormDesigner formDesigner = this.getEditingFormDesigner(); - Listlist=new ArrayList<>(); + List list = new ArrayList<>(); removeAll(); if (this.componentTree != null) { componentTree.getExpandNodes(list); From f01534c8c611621905b7ea7d46f6e258cbcd640e Mon Sep 17 00:00:00 2001 From: vito Date: Tue, 1 Sep 2020 12:00:09 +0800 Subject: [PATCH 051/267] =?UTF-8?q?REPORT-38632=E3=80=90=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=88=A0=E9=99=A4=E3=80=91=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=90=AF=E5=8A=A8=E9=A1=B5=20=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E7=94=BB=E9=9D=A2=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/start/fx/FastGifImage.java | 208 ------------------ .../com/fr/start/fx/PrismImageLoader2.java | 208 ------------------ .../main/java/com/fr/start/fx/SplashFx.java | 59 ----- .../java/com/fr/start/fx/SplashFxWindow.java | 194 ---------------- .../main/java/com/fr/start/jni/SplashJNI.java | 69 ------ .../main/java/com/fr/start/jni/SplashMac.java | 100 --------- .../resources/com/fr/start/jni/splash.dylib | Bin 57200 -> 0 bytes 7 files changed, 838 deletions(-) delete mode 100644 designer-realize/src/main/java/com/fr/start/fx/FastGifImage.java delete mode 100644 designer-realize/src/main/java/com/fr/start/fx/PrismImageLoader2.java delete mode 100644 designer-realize/src/main/java/com/fr/start/fx/SplashFx.java delete mode 100644 designer-realize/src/main/java/com/fr/start/fx/SplashFxWindow.java delete mode 100644 designer-realize/src/main/java/com/fr/start/jni/SplashJNI.java delete mode 100644 designer-realize/src/main/java/com/fr/start/jni/SplashMac.java delete mode 100755 designer-realize/src/main/resources/com/fr/start/jni/splash.dylib diff --git a/designer-realize/src/main/java/com/fr/start/fx/FastGifImage.java b/designer-realize/src/main/java/com/fr/start/fx/FastGifImage.java deleted file mode 100644 index 9eb3ecef27..0000000000 --- a/designer-realize/src/main/java/com/fr/start/fx/FastGifImage.java +++ /dev/null @@ -1,208 +0,0 @@ -package com.fr.start.fx; - -import com.sun.imageio.plugins.gif.GIFImageReader; -import com.sun.imageio.plugins.gif.GIFImageReaderSpi; -import com.sun.javafx.tk.ImageLoader; -import com.sun.javafx.tk.PlatformImage; -import javafx.animation.KeyFrame; -import javafx.animation.Timeline; -import javafx.event.Event; -import javafx.event.EventHandler; -import javafx.scene.image.WritableImage; -import javafx.util.Duration; - -import javax.imageio.stream.FileImageInputStream; -import java.io.File; -import java.lang.ref.WeakReference; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URL; -import java.util.regex.Pattern; - -/** - * 边加载边播放的gif加载器 - * - * @author daniel - */ -public class FastGifImage extends WritableImage { - private String url; - private int gifCount; - - public FastGifImage(String url, int w, int h) { - super(w, h); - this.url = validateUrl(url); - seekCount(); - initialize(); - } - - /** - * 给出gif帧数,加快加载速度 - * - * @param url gif url - * @param gifCount gif帧数 - * @param w 宽 - * @param h 高 - */ - public FastGifImage(String url, int gifCount, int w, int h) { - super(w, h); - this.url = validateUrl(url); - this.gifCount = gifCount; - initialize(); - } - - private void seekCount() { - try { - GIFImageReaderSpi spi = new GIFImageReaderSpi(); - GIFImageReader gifReader = (GIFImageReader) spi.createReaderInstance(); - gifReader.setInput(new FileImageInputStream(new File(new URI(url)))); - gifCount = gifReader.getNumImages(true); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private static final Pattern URL_QUICKMATCH = Pattern.compile("^\\p{Alpha}[\\p{Alnum}+.-]*:.*$"); - - private static String validateUrl(final String url) { - if (url == null) { - throw new NullPointerException("URL must not be null"); - } - - if (url.trim().isEmpty()) { - throw new IllegalArgumentException("URL must not be empty"); - } - - try { - if (!URL_QUICKMATCH.matcher(url).matches()) { - final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); - URL resource; - if (url.charAt(0) == '/') { - resource = contextClassLoader.getResource(url.substring(1)); - } else { - resource = contextClassLoader.getResource(url); - } - if (resource == null) { - throw new IllegalArgumentException("Invalid URL or resource not found"); - } - return resource.toString(); - } - // Use URL constructor for validation - return new URL(url).toString(); - } catch (final IllegalArgumentException e) { - throw new IllegalArgumentException("Invalid URL" + e.getMessage()); - } catch (final MalformedURLException e) { - throw new IllegalArgumentException("Invalid URL" + e.getMessage()); - } - } - - private void finishImage(ImageLoader loader) { - initializeAnimatedImage(loader); - } - - // Generates the animation Timeline for multiframe images. - private void initializeAnimatedImage(ImageLoader loader) { - - animation = new Animation(this, loader); - animation.start(); - } - - // Support for animated images. - private Animation animation; - - private static final class Animation { - final WeakReference imageRef; - final Timeline timeline; - private ImageLoader loader; - - public Animation(final FastGifImage image, final ImageLoader loader) { - this.loader = loader; - imageRef = new WeakReference(image); - timeline = new Timeline(); - timeline.setCycleCount(Timeline.INDEFINITE); - - final int frameCount = loader.getFrameCount(); - int duration = 0; - - for (int i = 0; i < frameCount; ++i) { - addKeyFrame(i, duration); - duration = duration + loader.getFrameDelay(i); - } - - // Note: we need one extra frame in the timeline to define how long - // the last frame is shown, the wrap around is "instantaneous" - addKeyFrame(0, duration); - } - - public void start() { - timeline.play(); - } - - public void stop() { - timeline.stop(); - loader = null; - } - - private void updateImage(final int frameIndex) { - final FastGifImage image = imageRef.get(); - if (image != null) { - image.setPlatformImagePropertyImpl( - loader.getFrame(frameIndex)); - } else { - timeline.stop(); - } - } - - private void addKeyFrame(final int index, final double duration) { - timeline.getKeyFrames().add( - new KeyFrame(Duration.millis(duration), - new EventHandler() { - @Override - public void handle(Event event) { - updateImage(index); - } - } - )); - } - } - - private static Method method; - - static { - try { - method = FastGifImage.class.getSuperclass().getSuperclass().getDeclaredMethod("platformImagePropertyImpl"); - method.setAccessible(true); - } catch (Exception e) { - - } - } - - private void setPlatformImagePropertyImpl(PlatformImage image) { - try { - Object o = method.invoke(this); - Method method = o.getClass().getDeclaredMethod("set", Object.class); - method.setAccessible(true); - method.invoke(o, image); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } catch (InvocationTargetException e) { - e.printStackTrace(); - } catch (NoSuchMethodException e) { - e.printStackTrace(); - } - } - - - private void initialize() { - finishImage(new PrismImageLoader2(url, gifCount, (int) getRequestedWidth(), (int) getRequestedHeight(), isPreserveRatio(), isSmooth())); - } - - /** - * 销毁gif动画 - */ - public void destroy() { - animation.stop(); - } - -} diff --git a/designer-realize/src/main/java/com/fr/start/fx/PrismImageLoader2.java b/designer-realize/src/main/java/com/fr/start/fx/PrismImageLoader2.java deleted file mode 100644 index 4529465c7a..0000000000 --- a/designer-realize/src/main/java/com/fr/start/fx/PrismImageLoader2.java +++ /dev/null @@ -1,208 +0,0 @@ -package com.fr.start.fx; - -import com.fr.concurrent.NamedThreadFactory; -import com.fr.log.FineLoggerFactory; -import com.sun.javafx.iio.ImageFrame; -import com.sun.javafx.iio.ImageLoadListener; -import com.sun.javafx.iio.ImageLoader; -import com.sun.javafx.iio.ImageMetadata; -import com.sun.javafx.iio.ImageStorageException; -import com.sun.javafx.iio.common.ImageTools; -import com.sun.javafx.iio.gif.GIFImageLoaderFactory; -import com.sun.javafx.tk.PlatformImage; -import com.sun.prism.Image; -import com.sun.prism.impl.PrismSettings; - - -import java.io.IOException; -import java.io.InputStream; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -/** - * 边加载边播放的gif加载器 - * - * @author daniel - */ -class PrismImageLoader2 implements com.sun.javafx.tk.ImageLoader { - - private Image[] images; - private int[] delayTimes; - private int width; - private int height; - private int gifCount = 1; - private Exception exception; - - public PrismImageLoader2(final String url, int gifCount, final int width, final int height, - final boolean preserveRatio, final boolean smooth) { - this.gifCount = gifCount; - images = new Image[gifCount]; - delayTimes = new int[gifCount]; - this.width = width; - this.height = height; - ExecutorService es = Executors.newSingleThreadExecutor(new NamedThreadFactory("PrismImageLoader2")); - es.execute(new Runnable() { - @Override - public void run() { - InputStream inputStream = null; - try { - inputStream = ImageTools.createInputStream(url); - loadAll(inputStream, width, height, preserveRatio, smooth); - } catch (IOException e) { - e.printStackTrace(); - } finally { - try { - if (inputStream != null) { - inputStream.close(); - } - } catch (IOException e) { - e.printStackTrace(); - } - } - } - }); - es.shutdown(); - } - - @Override - public int getWidth() { - return width; - } - - @Override - public int getHeight() { - return height; - } - - @Override - public int getFrameCount() { - return gifCount; - } - - @Override - @SuppressWarnings("squid:S2142") - public PlatformImage getFrame(int index) { - while (images[index] == null) { - synchronized (this) { - if (images[index] == null) { - try { - this.wait(); - } catch (InterruptedException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - } - } - return images[index]; - } - - - @Override - public int getFrameDelay(int index) { -// while (images[0] == null) { -// synchronized (this) { -// if(images[0] == null) { -// try { -// this.wait(); -// } catch (InterruptedException e) { -// e.printStackTrace(); -// } -// } -// } -// return 0; -// } -// return delayTimes[0]; - // 直接使用第一帧的时间 - return 40; - } - - @Override - public int getLoopCount() { - return 0; - } - - @Override - public Exception getException() { - return exception; - } - - - @SuppressWarnings("squid:S244") - private void loadAll(InputStream stream, int w, int h, - boolean preserveRatio, boolean smooth) { - ImageLoadListener listener = new PrismLoadListener(); - - try { - ImageLoader loader = null; - loader = GIFImageLoaderFactory.getInstance().createImageLoader(stream); - loader.addListener(listener); - - for (int i = 0; i < gifCount; i++) { - ImageFrame imageFrame = loader.load(i, w, h, preserveRatio, smooth); - images[i] = convert(imageFrame); - synchronized (this) { - notifyAll(); - } - } - } catch (ImageStorageException e) { - handleException(e); - } catch (Exception e) { - handleException(e); - } - } - - private void handleException(final ImageStorageException isException) { - // unwrap ImageStorageException if possible - final Throwable exceptionCause = isException.getCause(); - if (exceptionCause instanceof Exception) { - handleException((Exception) exceptionCause); - } else { - handleException((Exception) isException); - } - } - - private void handleException(final Exception exception) { - if (PrismSettings.verbose) { - exception.printStackTrace(System.err); - } - this.exception = exception; - } - - private Image convert(ImageFrame imgFrames) { - ImageFrame frame = imgFrames; - Image image = Image.convertImageFrame(frame); - ImageMetadata metadata = frame.getMetadata(); - if (metadata != null) { - Integer delay = metadata.delayTime; - if (delay != null) { - delayTimes[0] = delay.intValue(); - } - } - return image; - } - - - private class PrismLoadListener implements ImageLoadListener { - @Override - public void imageLoadWarning(ImageLoader loader, String message) { - - } - - @Override - public void imageLoadProgress(ImageLoader loader, - float percentageComplete) { - // progress only matters when backgroundLoading=true, but - // currently we are relying on AbstractRemoteResource for tracking - // progress of the InputStream, so there's no need to implement - // this for now; eventually though we might want to consider - // moving away from AbstractRemoteResource and instead use - // the built-in support for progress in the javafx-iio library... - } - - @Override - public void imageLoadMetaData(ImageLoader loader, ImageMetadata metadata) { - // We currently have no need to listen for ImageMetadata ready. - } - } - -} diff --git a/designer-realize/src/main/java/com/fr/start/fx/SplashFx.java b/designer-realize/src/main/java/com/fr/start/fx/SplashFx.java deleted file mode 100644 index f5c64bf792..0000000000 --- a/designer-realize/src/main/java/com/fr/start/fx/SplashFx.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.fr.start.fx; - -import com.fr.concurrent.NamedThreadFactory; -import com.fr.design.mainframe.DesignerContext; -import com.fr.start.SplashFxActionListener; -import com.fr.start.SplashStrategy; -import javafx.application.Application; -import javafx.application.Platform; - -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -/** - * JavaFx方式启动启动动画。这种方式在mac下与 - * swing一起启动会会出现线程死锁,jvm等问题, - * 所以这个方式仅用于windows上。 - * - * @author vito - * @date 2018/6/4 - * @see com.fr.start.jni.SplashMac - */ -public class SplashFx implements SplashStrategy { - - private SplashFxWindow fxWindow; - private static final ExecutorService SERVICE = Executors.newSingleThreadExecutor(new NamedThreadFactory("SplashFx")); - - @Override - public void show() { - Platform.setImplicitExit(false); - SERVICE.execute(new Runnable() { - @Override - public void run() { - Application.launch(SplashFxWindow.class); - } - }); - fxWindow = SplashFxWindow.waitForStartUpTest(); - fxWindow.addSplashActionListener(new SplashFxActionListener() { - @Override - public void splashClose() { - DesignerContext.getDesignerFrame().setVisible(true); - } - }); - } - - @Override - public void hide() { - fxWindow.close(); - } - - @Override - public void updateModuleLog(final String text) { - fxWindow.updateModuleInfo(text); - } - - @Override - public void updateThanksLog(final String text) { - fxWindow.updateThanks(text); - } -} diff --git a/designer-realize/src/main/java/com/fr/start/fx/SplashFxWindow.java b/designer-realize/src/main/java/com/fr/start/fx/SplashFxWindow.java deleted file mode 100644 index 00ad512939..0000000000 --- a/designer-realize/src/main/java/com/fr/start/fx/SplashFxWindow.java +++ /dev/null @@ -1,194 +0,0 @@ -package com.fr.start.fx; - -import com.fr.log.FineLoggerFactory; -import com.fr.stable.OperatingSystem; -import com.fr.start.SplashContext; -import com.fr.start.SplashFxActionListener; -import javafx.application.Application; -import javafx.application.Platform; -import javafx.geometry.Rectangle2D; -import javafx.scene.Scene; -import javafx.scene.image.ImageView; -import javafx.scene.layout.AnchorPane; -import javafx.scene.paint.Color; -import javafx.scene.text.Font; -import javafx.scene.text.Text; -import javafx.stage.Screen; -import javafx.stage.Stage; -import javafx.stage.StageStyle; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.CountDownLatch; - - -/** - * JavaFx启动动画窗口 - * - * @author vito - */ -public class SplashFxWindow extends Application { - - private static final String ARIAL_FONT_NAME = "Arial"; - private static final String PF_FONT_NAME = "PingFang"; - private static final String YAHEI_FONT_NAME = "Microsoft YaHei"; - private static final int MODULE_INFO_LEFT_MARGIN = 36; - private static final int MODULE_INFO_BOTTOM_MARGIN = 28; - private static final int THINKS_BOTTOM_RIGHT = 35; - private static final int THINKS_BOTTOM_MARGIN = 27; - private static final int WINDOW_WIDTH = 640; - private static final int WINDOW_HEIGHT = 360; - private static final int FONT = 12; - private static final int FRAME_COUNT = 315; - private static final String THINKS_COLOR = "#82b1ce"; - - private static final CountDownLatch LATCH = new CountDownLatch(1); - private static SplashFxWindow app = null; - - private Text moduleInfo; - private Text thanks; - private FastGifImage image; - private List listeners = new ArrayList(); - - /** - * 获取当前运行实例。黑科技 - * - * @return 运行实例 - */ - @SuppressWarnings("squid:S2142") - public static SplashFxWindow waitForStartUpTest() { - try { - LATCH.await(); - } catch (InterruptedException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - return app; - } - - private static void setApp(SplashFxWindow window) { - app = window; - LATCH.countDown(); - } - - public SplashFxWindow() { - setApp(this); - } - - @Override - public void start(Stage primaryStage) { - AnchorPane root = new AnchorPane(); - primaryStage.initStyle(StageStyle.TRANSPARENT); - image = new FastGifImage(SplashContext.SPLASH_PATH, FRAME_COUNT, WINDOW_WIDTH, WINDOW_HEIGHT); - - ImageView gif = new ImageView(image); - - AnchorPane.setBottomAnchor(gif, 0d); - AnchorPane.setTopAnchor(gif, 0d); - AnchorPane.setLeftAnchor(gif, 0d); - AnchorPane.setRightAnchor(gif, 0d); - Font font; - if (OperatingSystem.isWindows()) { - font = new Font(YAHEI_FONT_NAME, FONT); - } else if (OperatingSystem.isMacOS()) { - font = new Font(PF_FONT_NAME, FONT); - } else { - font = new Font(ARIAL_FONT_NAME, FONT); - } - - moduleInfo = new Text(); - moduleInfo.setFont(font); - moduleInfo.setFill(Color.WHITE); - AnchorPane.setLeftAnchor(moduleInfo,(double) MODULE_INFO_LEFT_MARGIN); - AnchorPane.setBottomAnchor(moduleInfo,(double) MODULE_INFO_BOTTOM_MARGIN); - thanks = new Text(); - thanks.setFont(font); - thanks.setFill(Color.valueOf(THINKS_COLOR)); - AnchorPane.setRightAnchor(thanks, (double) THINKS_BOTTOM_RIGHT); - AnchorPane.setBottomAnchor(thanks, (double) THINKS_BOTTOM_MARGIN); - - root.getChildren().add(gif); - root.getChildren().add(moduleInfo); - root.getChildren().add(thanks); - - primaryStage.setWidth(WINDOW_WIDTH); - primaryStage.setHeight(WINDOW_HEIGHT); - primaryStage.setScene(new Scene(root, WINDOW_WIDTH, WINDOW_HEIGHT, null)); - setWindowCenter(primaryStage); - primaryStage.show(); - } - - public void close() { - Platform.runLater(new Runnable() { - @Override - public void run() { - try { - ((Stage) moduleInfo.getScene().getWindow()).close(); - image.destroy(); - fireSplashClose(); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - }); - } - - /** - * 设置窗口居中 - * - * @param stage 窗口 - */ - private void setWindowCenter(Stage stage) { - Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds(); - stage.setX(primaryScreenBounds.getMinX() + (primaryScreenBounds.getWidth() - stage.getWidth()) / 2.0); - stage.setY(primaryScreenBounds.getMinY() + (primaryScreenBounds.getHeight() - stage.getHeight()) / 2.0); - } - - /** - * 更新模块信息 - * - * @param s 文字 - */ - public void updateModuleInfo(final String s) { - Platform.runLater(new Runnable() { - @Override - public void run() { - if (moduleInfo != null) { - moduleInfo.setText(s); - } - } - }); - - } - - /** - * 更新欢迎信息 - * - * @param s 文字 - */ - public void updateThanks(final String s) { - Platform.runLater(new Runnable() { - @Override - public void run() { - if (thanks != null) { - thanks.setText(s); - } - } - }); - - } - - /** - * 添加一个动画状态监听 - * - * @param listener - */ - public void addSplashActionListener(SplashFxActionListener listener) { - listeners.add(listener); - } - - public void fireSplashClose() { - for (SplashFxActionListener listener : listeners) { - listener.splashClose(); - } - } -} diff --git a/designer-realize/src/main/java/com/fr/start/jni/SplashJNI.java b/designer-realize/src/main/java/com/fr/start/jni/SplashJNI.java deleted file mode 100644 index e71a44ca21..0000000000 --- a/designer-realize/src/main/java/com/fr/start/jni/SplashJNI.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.fr.start.jni; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.InputStream; - -/** - * Splash JNI调用。jni类改名或者移包之后 - * 必须重新编译动态库 - * - * @author vito - * @date 2018/6/4 - */ -public class SplashJNI { - - static { - try { - System.setProperty("java.library.path", "."); - System.loadLibrary("splash"); - } catch (UnsatisfiedLinkError e) { - loadLibraryFromJar("/com/fr/start/jni/splash.dylib"); - } - } - - /** - * 显示启动动画窗口 - */ - public native void show(String path); - - /** - * 隐藏启动动画窗口 - */ - public native void hide(); - - /** - * 设置模块加载信息 - */ - public native void updateModuleLog(String text); - - /** - * 设置感谢文字 - */ - public native void updateThanksLog(String text); - - /** - * 从jar中加载动态库 - * - * @param path 路径,如/com/a/b - * @throws UnsatisfiedLinkError 没有找到合适的动态库 - */ - private static void loadLibraryFromJar(String path) throws UnsatisfiedLinkError { - try (InputStream inputStream = SplashJNI.class.getResourceAsStream(path)) { - File tempLib = File.createTempFile(path, ""); - - byte[] buffer = new byte[1024]; - int read = -1; - - try (FileOutputStream fileOutputStream = new FileOutputStream(tempLib)) { - while ((read = inputStream.read(buffer)) != -1) { - fileOutputStream.write(buffer, 0, read); - } - } - - System.load(tempLib.getAbsolutePath()); - } catch (Exception e) { - throw new UnsatisfiedLinkError("Unable to open " + path + " from jar file."); - } - } -} diff --git a/designer-realize/src/main/java/com/fr/start/jni/SplashMac.java b/designer-realize/src/main/java/com/fr/start/jni/SplashMac.java deleted file mode 100644 index 6d2a47a2e8..0000000000 --- a/designer-realize/src/main/java/com/fr/start/jni/SplashMac.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.fr.start.jni; - -import com.fr.log.FineLoggerFactory; -import com.fr.stable.ProductConstants; -import com.fr.stable.StableUtils; -import com.fr.stable.StringUtils; -import com.fr.start.SplashContext; -import com.fr.start.SplashStrategy; - -import javax.swing.JFrame; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; - -/** - * mac上使用jni方式绘制gif。不使用javafx有两个原因: - * 1.mac上javafx和swing同时启动会导致卡死; - * 2.platform.exit会导致设计器崩溃 - * - * @author vito - * @see com.fr.start.fx.SplashFx - */ -public class SplashMac implements SplashStrategy { - - - private SplashJNI jni; - private static final int EXILE = 10000; - - public SplashMac() { - jni = new SplashJNI(); - } - - /** - * 将jar中的资源拷贝到缓存文件夹 - * - * @return 路径 - */ - private static String loadResFromJar() { - File tempLib = null; - try (InputStream inputStream = SplashContext.class.getResourceAsStream(SplashContext.SPLASH_PATH)) { - if (inputStream == null) { - FineLoggerFactory.getLogger().error("Unable to copy " + SplashContext.SPLASH_PATH + " from jar file."); - return StringUtils.EMPTY; - } - tempLib = new File(StableUtils.pathJoin(ProductConstants.getEnvHome(), SplashContext.SPLASH_CACHE_NAME)); - byte[] buffer = new byte[1024]; - int read = -1; - try (FileOutputStream fileOutputStream = new FileOutputStream(tempLib)) { - while ((read = inputStream.read(buffer)) != -1) { - fileOutputStream.write(buffer, 0, read); - } - } - return tempLib.getAbsolutePath(); - } catch (IOException e) { - if (tempLib != null) { - tempLib.deleteOnExit(); - } - // 直接抛异常 - throw new RuntimeException("Unable to copy " + SplashContext.SPLASH_PATH + " from jar file."); - } - } - - @Override - public void show() { - if (jni != null) { - // mac下安装版模糊的hack - JFrame jFrame = new JFrame(); - jFrame.setLocation(EXILE, EXILE); - jFrame.setVisible(true); - jFrame.setVisible(false); - File splash = new File(StableUtils.pathJoin(ProductConstants.getEnvHome(), SplashContext.SPLASH_CACHE_NAME)); - String path = splash.exists() ? splash.getAbsolutePath() : loadResFromJar(); - jni.show(path); - } - } - - @Override - public void hide() { - if (jni != null) { - jni.hide(); - jni = null; - } - } - - @Override - public void updateModuleLog(String text) { - if (jni != null) { - jni.updateModuleLog(text); - } - - } - - @Override - public void updateThanksLog(String text) { - if (jni != null) { - jni.updateThanksLog(text); - } - } -} diff --git a/designer-realize/src/main/resources/com/fr/start/jni/splash.dylib b/designer-realize/src/main/resources/com/fr/start/jni/splash.dylib deleted file mode 100755 index 6ae677da37199ce7ebe825dbb5590452bdb081dd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 57200 zcmeHwd3+Q_`gc!~fdImUBP=3l5D-v~Odybekqk+&Mc6UrxT9-y??x)&+naq z?yBdgr>dTM>UyfX^V#X|&vuj~L#!l89dPx;)p&^{)k_J8Nz$dbN!us;f%jU_J z^FSgvPQ=>_?DmR++Y9aGPH&0JQSNNh9w&vozY8HMtjdZgE0987VVT3@A%XhxeQf0^ zZxjMl_yY2%eBSEHw&lC>2A*=B5TL^6mRIQUx=UU21%tkP_Xv3(lHuZ~!W`1I4Ul&G z{K7)Jv#QWp>9u$o1ncB!i--1Q<4S3{W4@D2Szq53y7CcxK08+Rrw)F4c`JpyOi?I; zFQR-NXPMhsjNx7{FEEQ&CruQJV68lKDODAWQIwDAk0k2lCC%aT)Iu6Wrav^VpNJa4Z<%LAGD=+OPAxMk|1fO4CVMTd)g-fJrV=rkpbBd}zg0%8P zHfnODFYts{8Ex$^Q^>2)bPDY}u9rvSyo}3kw^^r7$;r0P6j{v^VNE1l`8y8NxTlrX z6>u7^J|R3&4bmu|$33d7qR>$`s;sntE~j&3Q8hx4@w-xzYLY23kC#J6s9ku-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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/widget/topxcreator/TopXCreator.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreator.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreator.java index 52bae99f17..42371a44f9 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreator.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreator.java @@ -42,16 +42,8 @@ public class TopXCreator extends BasicTopXCreator { * 依据鼠标事件和visible设置是否显示蒙层 * */ public void displayCoverPane(MouseEvent event, boolean visible) { - if (!visible) { - setVisible(false); - return; - } - Rectangle rect = getBounds(); - if (rect.contains(event.getX(), event.getY())) { - coverPanel.setVisible(true); - } else { - coverPanel.setVisible(false); - } + boolean isVisible = visible && getBounds().contains(event.getX(), event.getY()); + coverPanel.setVisible(isVisible); } } From 21d0422f021e4b5e7c3bf6044ab173b22dedd00e Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 2 Sep 2020 10:15:55 +0800 Subject: [PATCH 053/267] =?UTF-8?q?CHART-15510=20=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E5=92=8C=E6=8F=90=E7=A4=BA=E4=B8=AD=E6=8F=92=E5=85=A5BI?= =?UTF-8?q?=E7=9A=84=E5=AF=8C=E6=96=87=E6=9C=AC=E7=BC=96=E8=BE=91=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartRichEditorPane.java | 78 +++++++ .../component/VanChartTooltipContentPane.java | 194 ++++++++++++++++-- .../VanChartFormatPaneWithCheckBox.java | 13 +- 3 files changed, 264 insertions(+), 21 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java new file mode 100644 index 0000000000..c4588ce1cb --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java @@ -0,0 +1,78 @@ +package com.fr.van.chart.designer.component; + +import com.fr.design.ui.ModernUIPane; +import com.fr.plugin.chart.base.AttrTooltipRichEditor; +import com.fr.stable.StringUtils; + +import java.util.Map; + +public class VanChartRichEditorPane { + + private static ModernUIPane richEditorPane; + + public static ModernUIPane getInstance() { + if (richEditorPane == null) { + richEditorPane = new ModernUIPane.Builder() + .withEMB("/com/fr/design/editor/rich_editor.html") + .namespace("Pool").build(); + } + + return richEditorPane; + } + + public static RichEditorModel getRichEditorModel(AttrTooltipRichEditor richEditor) { + Map paramsMap = richEditor.getParams(); + StringBuilder paramsStr = new StringBuilder(StringUtils.EMPTY); + + if (paramsMap != null) { + for (Map.Entry entry : paramsMap.entrySet()) { + paramsStr.append(entry.getKey()).append(":").append(entry.getValue()); + paramsStr.append("-"); + } + } + + int len = paramsStr.length(); + + if (len > 0) { + paramsStr.deleteCharAt(len - 1); + } + + return new RichEditorModel(richEditor.getContent(), richEditor.isAuto(), paramsStr.toString()); + } + + public static class RichEditorModel { + private String content; + private boolean auto; + private String params; + + public RichEditorModel(String content, boolean auto, String params) { + this.content = content; + this.auto = auto; + this.params = params; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public boolean isAuto() { + return auto; + } + + public void setAuto(boolean auto) { + this.auto = auto; + } + + public String getParams() { + return params; + } + + public void setParams(String params) { + this.params = params; + } + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index 5920dd969f..b52e4fda49 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -1,12 +1,23 @@ package com.fr.van.chart.designer.component; +import com.fr.design.DesignerEnvManager; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.gui.autocomplete.AutoCompletion; +import com.fr.design.gui.autocomplete.DefaultCompletionProvider; import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.syntax.ui.rtextarea.RTextArea; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; - +import com.fr.design.ui.ModernUIPane; +import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.base.AttrTooltipContent; +import com.fr.plugin.chart.base.AttrTooltipRichEditor; +import com.fr.plugin.chart.base.format.AttrTooltipFormat; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox; @@ -14,15 +25,23 @@ import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithChec import com.fr.van.chart.designer.component.format.PercentFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; +import javax.swing.JComponent; +import javax.swing.JFrame; import javax.swing.JPanel; +import javax.swing.KeyStroke; +import javax.swing.SwingUtilities; +import javax.swing.text.Document; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Component; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; /** * 内容界面 。数据点提示 @@ -43,22 +62,29 @@ public class VanChartTooltipContentPane extends BasicBeanPane(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Common"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")}); + content = new UIButtonGroup<>(new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Common"), + Toolkit.i18nText("Fine-Design_Chart_Custom") + }); initFormatPane(parent, showOnPane); @@ -80,8 +106,8 @@ public class VanChartTooltipContentPane extends BasicBeanPane pane = VanChartRichEditorPane.getInstance(); + BasicDialog dialog = pane.showWindow(new JFrame()); + + pane.populate(VanChartRichEditorPane.getRichEditorModel(richEditor)); + + dialog.addDialogActionListener(new DialogActionAdapter() { + + public void doOk() { + VanChartRichEditorPane.RichEditorModel model = pane.update(); + + String content = model.getContent(); + + populateContentTextArea(content); + + richEditor.setContent(content); + richEditor.setAuto(model.isAuto()); + + SwingUtilities.getWindowAncestor(pane).setVisible(false); + } + + public void doCancel() { + SwingUtilities.getWindowAncestor(pane).setVisible(false); + } + }); + + dialog.setVisible(true); + + if (parent != null) { + parent.attributeChanged(); + } + } + protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane){ categoryNameFormatPane = new CategoryNameFormatPaneWithCheckBox(parent, showOnPane); seriesNameFormatPane = new SeriesNameFormatPaneWithCheckBox(parent, showOnPane); @@ -154,13 +267,17 @@ public class VanChartTooltipContentPane extends BasicBeanPane paramMap, String value) { + String key = this.getCheckBoxText(); + + if (paramMap != null && !paramMap.containsKey(key)) { + paramMap.put(key, value); + } + } } From f1b091ce26c9a09f508a43a992131f47a1d6197b Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 2 Sep 2020 11:33:04 +0700 Subject: [PATCH 054/267] REPORT-38647 && REPORT-38357 --- .../fr/design/mainframe/DesignerFrameFileDealerPane.java | 2 +- .../designer/treeview/ComponentTreeCellRenderer.java | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index bcac7f946c..a9d9281e99 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -856,7 +856,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt BorderLayout.CENTER); - this.setSize(340, 180); + this.setSize(380, 180); this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Mkdir")); this.setResizable(false); this.setAlwaysOnTop(true); diff --git a/designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java b/designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java index 16ec4405df..78b606a7fc 100644 --- a/designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java +++ b/designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java @@ -4,6 +4,7 @@ import com.fr.design.constants.UIConstants; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.gui.ilable.UILabel; +import com.fr.log.FineLoggerFactory; import javax.swing.Icon; import javax.swing.JTree; @@ -23,7 +24,12 @@ public class ComponentTreeCellRenderer extends DefaultTreeCellRenderer { if (value instanceof XCreator) { String name = ((XCreator) value).toData().getWidgetName(); setText(name); - Icon icon = XCreatorUtils.getCreatorIcon((XCreator) value); + Icon icon = null; + try { + icon = XCreatorUtils.getCreatorIcon((XCreator) value); + } catch (Exception e) { + FineLoggerFactory.getLogger().info("{} has not icon or has been deleted", name); + } if (icon != null) { setIcon(icon); } From d8b670866f04c0ddea0285ae01fffb44ad45c16d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 2 Sep 2020 14:04:45 +0800 Subject: [PATCH 055/267] =?UTF-8?q?CHART-15362=20=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E4=BF=9D=E7=95=99=E5=8A=9F=E8=83=BD=E5=BC=80?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../van/chart/area/VanChartAreaPlotPane.java | 4 +- .../fr/van/chart/bar/VanChartBarPlotPane.java | 4 +- .../chart/bubble/VanChartBubblePlotPane.java | 35 +++++++- .../chart/column/VanChartColumnPlotPane.java | 4 +- .../chart/custom/VanChartCustomPlotPane.java | 10 +-- .../type/AbstractRectanglePlotPane.java | 88 +++++++++++++++++++ .../type/AbstractVanChartTypePane.java | 44 ++++++---- .../chart/gauge/VanChartGaugePlotPane.java | 85 +++++++++++++++--- .../type/VanChartHeatMapTypePane.java | 3 +- .../van/chart/line/VanChartLinePlotPane.java | 4 +- .../designer/type/VanChartMapPlotPane.java | 23 ++++- .../multilayer/VanChartMultiPiePlotPane.java | 4 +- .../fr/van/chart/pie/VanChartPiePlotPane.java | 36 ++++++++ .../scatter/VanChartScatterPlotPane.java | 24 +++++ 14 files changed, 316 insertions(+), 52 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractRectanglePlotPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaPlotPane.java index 5cec0753a7..5d254ebb6a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaPlotPane.java @@ -5,12 +5,12 @@ import com.fr.chart.chartattr.Plot; import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.area.AreaIndependentVanChart; import com.fr.plugin.chart.area.VanChartAreaPlot; -import com.fr.van.chart.designer.type.AbstractVanChartTypePane; +import com.fr.van.chart.designer.type.AbstractRectanglePlotPane; /** * Created by Mitisky on 15/11/18. */ -public class VanChartAreaPlotPane extends AbstractVanChartTypePane { +public class VanChartAreaPlotPane extends AbstractRectanglePlotPane { @Override protected String[] getTypeIconPath() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/bar/VanChartBarPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/bar/VanChartBarPlotPane.java index 83d1db2e96..811dde312c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/bar/VanChartBarPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/bar/VanChartBarPlotPane.java @@ -5,12 +5,12 @@ import com.fr.chart.chartattr.Plot; import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.bar.BarIndependentVanChart; import com.fr.plugin.chart.column.VanChartColumnPlot; -import com.fr.van.chart.designer.type.AbstractVanChartTypePane; +import com.fr.van.chart.designer.type.AbstractRectanglePlotPane; /** * Created by Mitisky on 15/10/20. */ -public class VanChartBarPlotPane extends AbstractVanChartTypePane { +public class VanChartBarPlotPane extends AbstractRectanglePlotPane { @Override protected String[] getTypeIconPath() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubblePlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubblePlotPane.java index 407c7758ba..ef90c8a017 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubblePlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubblePlotPane.java @@ -12,15 +12,22 @@ import com.fr.chartx.data.field.AbstractColumnFieldCollection; import com.fr.chartx.data.field.diff.BubbleColumnFieldCollection; import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection; import com.fr.log.FineLoggerFactory; +import com.fr.plugin.chart.area.VanChartAreaPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.base.VanChartZoom; import com.fr.plugin.chart.bubble.BubbleIndependentVanChart; import com.fr.plugin.chart.bubble.VanChartBubblePlot; +import com.fr.plugin.chart.column.VanChartColumnPlot; +import com.fr.plugin.chart.line.VanChartLinePlot; +import com.fr.plugin.chart.scatter.VanChartScatterPlot; import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel; import com.fr.plugin.chart.vanchart.VanChart; import com.fr.van.chart.designer.type.AbstractVanChartTypePane; +import java.util.HashSet; +import java.util.Set; + /** * Created by Mitisky on 16/3/31. */ @@ -32,6 +39,20 @@ public class VanChartBubblePlotPane extends AbstractVanChartTypePane { private static final float ALPHA = 0.7f; + private static Set forceExtendPlotIds = new HashSet<>(); + + private static Set extendPlotIds = new HashSet<>(); + + static { + extendPlotIds.add(VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID); + extendPlotIds.add(VanChartColumnPlot.VAN_CHART_BAR_PLOT_ID); + extendPlotIds.add(VanChartLinePlot.VAN_CHART_LINE_PLOT); + extendPlotIds.add(VanChartAreaPlot.VAN_CHART_AREA_PLOT_ID); + extendPlotIds.add(VanChartScatterPlot.VAN_CHART_SCATTER_PLOT_ID); + + forceExtendPlotIds.add(VanChartScatterPlot.VAN_CHART_SCATTER_PLOT_ID); + } + @Override protected String[] getTypeIconPath() { return new String[]{"/com/fr/van/chart/bubble/images/bubble.png", @@ -122,16 +143,16 @@ public class VanChartBubblePlotPane extends AbstractVanChartTypePane { * @param chart */ @Override - protected void resetChartAttr4SamePlot(Chart chart) { + protected void resetChartAttr4SamePlot(VanChart chart) { //图表缩放新设计 恢复用注释。下面2行删除。 VanChartZoom vanChartZoom = new VanChartZoom(); - ((VanChart) chart).setVanChartZoom(vanChartZoom); + chart.setVanChartZoom(vanChartZoom); //图表缩放新设计 恢复用注释。下面一行取消注释。 //((VanChart) chart).setZoomAttribute(new ZoomAttribute()); //重置监控刷新选项 - resetRefreshMoreLabelAttr((VanChart) chart); + resetRefreshMoreLabelAttr(chart); } @Override @@ -147,4 +168,12 @@ public class VanChartBubblePlotPane extends AbstractVanChartTypePane { } return false; } + + //是否支持属性的继承 + @Override + protected boolean supportExtendAttr(VanChart chart) { + VanChartBubblePlot selectedClonedPlot = (VanChartBubblePlot) getSelectedClonedPlot(); + return selectedClonedPlot.isForceBubble() ? forceExtendPlotIds.contains(chart.getID()) : + extendPlotIds.contains(chart.getID()); + } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotPane.java index 40269cc15c..8b37e952c1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotPane.java @@ -5,12 +5,12 @@ import com.fr.chart.chartattr.Plot; import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.column.ColumnIndependentVanChart; import com.fr.plugin.chart.column.VanChartColumnPlot; -import com.fr.van.chart.designer.type.AbstractVanChartTypePane; +import com.fr.van.chart.designer.type.AbstractRectanglePlotPane; /** * Created by Mitisky on 15/9/24. */ -public class VanChartColumnPlotPane extends AbstractVanChartTypePane { +public class VanChartColumnPlotPane extends AbstractRectanglePlotPane { @Override protected String[] getTypeIconPath() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java index 6bace5ef90..ff0147652a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java @@ -119,7 +119,7 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane { } @Override - public void updateBean(Chart chart) { + public void updateBean(VanChart chart) { //保存上次选中的值,其会在super中更新 int lastState = chart.getPlot().getDetailType(); @@ -129,7 +129,7 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane { //如果上次的状态和这次的装填不在同一个页面,说明同一个图表內切换了,需要情況数据配置 if (lastState != chart.getPlot().getDetailType()) { chart.setFilterDefinition(null); - ((VanChart) chart).setChartDataDefinition(null); + chart.setChartDataDefinition(null); } Chart[] customChart = CustomIndependentVanChart.CustomVanChartTypes; @@ -214,12 +214,12 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane { * @param newPlot */ @Override - protected void resetChartAttr(Chart chart, Plot newPlot) { + protected void resetChartAttr(VanChart chart, VanChartPlot newPlot) { super.resetChartAttr(chart, newPlot); //切换图表清空数据配置 chart.setFilterDefinition(null); //设置默认不排序 - VanChartTools tools = ((VanChart) chart).getVanChartTools(); + VanChartTools tools = chart.getVanChartTools(); if (tools != null) { tools.setSort(false); } @@ -228,7 +228,7 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane { /** * 更新界面内容 */ - public void populateBean(Chart chart) { + public void populateBean(VanChart chart) { for (ChartImagePane imagePane : typeDemo) { imagePane.isPressing = false; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractRectanglePlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractRectanglePlotPane.java new file mode 100644 index 0000000000..6712fba900 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractRectanglePlotPane.java @@ -0,0 +1,88 @@ +package com.fr.van.chart.designer.type; + +import com.fr.chart.chartglyph.ConditionCollection; +import com.fr.log.FineLoggerFactory; +import com.fr.plugin.chart.PiePlot4VanChart; +import com.fr.plugin.chart.area.VanChartAreaPlot; +import com.fr.plugin.chart.attr.axis.VanChartAxis; +import com.fr.plugin.chart.attr.plot.VanChartPlot; +import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; +import com.fr.plugin.chart.bubble.VanChartBubblePlot; +import com.fr.plugin.chart.column.VanChartColumnPlot; +import com.fr.plugin.chart.line.VanChartLinePlot; +import com.fr.plugin.chart.scatter.VanChartScatterPlot; +import com.fr.plugin.chart.type.VanChartPlotType; +import com.fr.plugin.chart.vanchart.VanChart; +import com.fr.stable.StringUtils; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-08-24 + */ +public abstract class AbstractRectanglePlotPane extends AbstractVanChartTypePane { + + private static Set extendPlotIds = new HashSet<>(); + + static { + extendPlotIds.add(VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID); + extendPlotIds.add(VanChartColumnPlot.VAN_CHART_BAR_PLOT_ID); + extendPlotIds.add(VanChartLinePlot.VAN_CHART_LINE_PLOT); + extendPlotIds.add(VanChartAreaPlot.VAN_CHART_AREA_PLOT_ID); + extendPlotIds.add(VanChartScatterPlot.VAN_CHART_SCATTER_PLOT_ID); + extendPlotIds.add(PiePlot4VanChart.VAN_CHART_PIE_PLOT); + } + + @Override + protected VanChartPlot cloneOldPlot2New(VanChartPlot oldPlot, VanChartPlot newPlot) { + try { + VanChartRectanglePlot vanChartRectanglePlot = (VanChartRectanglePlot) newPlot; + VanChartRectanglePlot clonePlot = (VanChartRectanglePlot) oldPlot.clone(); + clonePlot.setVanChartPlotType(vanChartRectanglePlot.getVanChartPlotType()); + //自定义类型的图形要增加一个y2轴,并且增加系列中的堆积条件,反之则要去掉y2轴和条件 + if (clonePlot.isCustomChart()) { + List valueAxisList = clonePlot.getValueAxisList(); + valueAxisList.add(vanChartRectanglePlot.getValueAxisList().get(1)); + clonePlot.setStackAndAxisCondition(vanChartRectanglePlot.getStackAndAxisCondition()); + } else { + List xAxisList = clonePlot.getXAxisList(); + List yAxisList = clonePlot.getYAxisList(); + List newXAxisList = new ArrayList<>(); + List newYAxisList = new ArrayList<>(); + newXAxisList.add(xAxisList.get(0)); + newYAxisList.add(yAxisList.get(0)); + clonePlot.setXAxisList(newXAxisList); + clonePlot.setYAxisList(newYAxisList); + clonePlot.setStackAndAxisCondition(new ConditionCollection()); + } + + //百分比堆积图值轴的格式不保留 + if (clonePlot.getVanChartPlotType() == VanChartPlotType.STACK_BY_PERCENT || + ((VanChartRectanglePlot) oldPlot).getVanChartPlotType() == VanChartPlotType.STACK_BY_PERCENT) { + VanChartAxis cloneAxis = clonePlot.getValueAxisList().get(0); + VanChartAxis vanChartAxis = vanChartRectanglePlot.getValueAxisList().get(0); + cloneAxis.setFormat(vanChartAxis.getFormat()); + cloneAxis.setPercentage(vanChartAxis.isPercentage()); + } + return clonePlot; + } catch (CloneNotSupportedException ex) { + FineLoggerFactory.getLogger().error("Error in change plot"); + return newPlot; + } + } + + //是否支持属性的继承 + @Override + protected boolean supportExtendAttr(VanChart chart) { + if (StringUtils.equals(VanChartBubblePlot.VAN_CHART_BUBBLE_PLOT_ID, chart.getID())) { + VanChartBubblePlot vanChartBubblePlot = chart.getPlot(); + return !vanChartBubblePlot.isForceBubble(); + } + return extendPlotIds.contains(chart.getID()); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java index 6189c347b4..a4b53796fd 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java @@ -37,7 +37,7 @@ import java.awt.Component; import java.awt.Dimension; import java.awt.event.ActionListener; -public abstract class AbstractVanChartTypePane extends AbstractChartTypePane { +public abstract class AbstractVanChartTypePane extends AbstractChartTypePane { private static final long serialVersionUID = 7743244512351499265L; private UICheckBox largeModelCheckBox; @@ -119,7 +119,7 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane extendPlotIds = new HashSet<>(); + + static { + extendPlotIds.add(VanChartMapPlot.VAN_CHART_MAP_ID); + extendPlotIds.add(VanChartDrillMapPlot.VAN_CHART_DRILL_MAP_ID); + extendPlotIds.add(VanChartHeatMapPlot.VAN_CHART_HEAT_MAP_ID); + } + @Override protected String[] getTypeIconPath() { return new String[]{"/com/fr/van/chart/map/images/area-map.png", @@ -54,7 +67,7 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane { /** * 更新界面内容 */ - public void populateBean(Chart chart) { + public void populateBean(VanChart chart) { for (ChartImagePane imagePane : typeDemo) { imagePane.isPressing = false; } @@ -80,7 +93,7 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane { } } - public void updateBean(Chart chart) { + public void updateBean(VanChart chart) { super.updateBean(chart); Plot plot = chart.getPlot(); if (plot instanceof VanChartMapPlot) { @@ -154,4 +167,10 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane { protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) { return definition instanceof MapChartDataDefinition; } + + //是否支持属性的继承 + @Override + protected boolean supportExtendAttr(VanChart chart) { + return extendPlotIds.contains(chart.getID()); + } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java index 555cca468d..7854ecd170 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java @@ -55,10 +55,10 @@ public class VanChartMultiPiePlotPane extends AbstractVanChartTypePane { return MultiPieIndependentVanChart.MultilayerVanChartTypes[0]; } - protected void resetChartAttr(Chart chart, Plot newPlot) { + protected void resetChartAttr(VanChart chart, VanChartPlot newPlot) { super.resetChartAttr(chart, newPlot); //重置工具栏选项 - VanChartTools tools = ((VanChart) chart).getVanChartTools(); + VanChartTools tools = chart.getVanChartTools(); if (tools != null) { tools.setSort(false); tools.setFullScreen(false); diff --git a/designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPiePlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPiePlotPane.java index 9bbddbb039..9e6e08a0ad 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPiePlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPiePlotPane.java @@ -5,9 +5,17 @@ import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.PiePlot4VanChart; +import com.fr.plugin.chart.area.VanChartAreaPlot; +import com.fr.plugin.chart.attr.plot.VanChartPlot; +import com.fr.plugin.chart.column.VanChartColumnPlot; +import com.fr.plugin.chart.line.VanChartLinePlot; import com.fr.plugin.chart.pie.PieIndependentVanChart; +import com.fr.plugin.chart.vanchart.VanChart; import com.fr.van.chart.designer.type.AbstractVanChartTypePane; +import java.util.HashSet; +import java.util.Set; + /** * 饼图(新特性) 属性表 选择类型 布局界面. */ @@ -15,6 +23,15 @@ public class VanChartPiePlotPane extends AbstractVanChartTypePane { private static final long serialVersionUID = 6163246902689597259L; + private static Set extendPlotIds = new HashSet<>(); + + static { + extendPlotIds.add(VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID); + extendPlotIds.add(VanChartColumnPlot.VAN_CHART_BAR_PLOT_ID); + extendPlotIds.add(VanChartLinePlot.VAN_CHART_LINE_PLOT); + extendPlotIds.add(VanChartAreaPlot.VAN_CHART_AREA_PLOT_ID); + } + @Override protected String[] getTypeIconPath() { return new String[]{"/com/fr/van/chart/pie/images/pie.png", @@ -44,6 +61,25 @@ public class VanChartPiePlotPane extends AbstractVanChartTypePane { return cloned; } + @Override + protected VanChartPlot cloneOldPlot2New(VanChartPlot oldPlot, VanChartPlot newPlot) { + try { + PiePlot4VanChart piePlot4VanChart = (PiePlot4VanChart) newPlot; + PiePlot4VanChart clonePlot = (PiePlot4VanChart) oldPlot.clone(); + clonePlot.setRoseType(piePlot4VanChart.getRoseType()); + return clonePlot; + } catch (CloneNotSupportedException e) { + FineLoggerFactory.getLogger().error("Error in change plot"); + return newPlot; + } + } + + //是否支持属性的继承 + @Override + protected boolean supportExtendAttr(VanChart chart) { + return extendPlotIds.contains(chart.getID()); + } + public Chart getDefaultChart() { return PieIndependentVanChart.newPieChartTypes[0]; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterPlotPane.java index f93051a747..9ef5155a77 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterPlotPane.java @@ -10,13 +10,21 @@ import com.fr.chartx.data.ChartDataDefinitionProvider; import com.fr.chartx.data.field.AbstractColumnFieldCollection; import com.fr.chartx.data.field.diff.BubbleColumnFieldCollection; import com.fr.log.FineLoggerFactory; +import com.fr.plugin.chart.area.VanChartAreaPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.base.VanChartAttrLine; import com.fr.plugin.chart.base.VanChartTools; +import com.fr.plugin.chart.bubble.VanChartBubblePlot; +import com.fr.plugin.chart.column.VanChartColumnPlot; +import com.fr.plugin.chart.line.VanChartLinePlot; import com.fr.plugin.chart.scatter.ScatterIndependentVanChart; import com.fr.plugin.chart.scatter.VanChartScatterPlot; +import com.fr.plugin.chart.vanchart.VanChart; import com.fr.van.chart.designer.type.AbstractVanChartTypePane; +import java.util.HashSet; +import java.util.Set; + /** * Created by Mitisky on 16/2/16. */ @@ -29,6 +37,16 @@ public class VanChartScatterPlotPane extends AbstractVanChartTypePane { }; } + private static Set extendPlotIds = new HashSet<>(); + + static { + extendPlotIds.add(VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID); + extendPlotIds.add(VanChartColumnPlot.VAN_CHART_BAR_PLOT_ID); + extendPlotIds.add(VanChartLinePlot.VAN_CHART_LINE_PLOT); + extendPlotIds.add(VanChartAreaPlot.VAN_CHART_AREA_PLOT_ID); + extendPlotIds.add(VanChartBubblePlot.VAN_CHART_BUBBLE_PLOT_ID); + } + protected Plot getSelectedClonedPlot(){ VanChartScatterPlot newPlot = null; Chart[] scatterChart = ScatterIndependentVanChart.ScatterVanChartTypes; @@ -95,4 +113,10 @@ public class VanChartScatterPlotPane extends AbstractVanChartTypePane { } return false; } + + //是否支持属性的继承 + @Override + protected boolean supportExtendAttr(VanChart chart) { + return extendPlotIds.contains(chart.getID()); + } } \ No newline at end of file From 133381c91481f375cb309e1bc32c7206da489d5b Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 3 Sep 2020 16:35:19 +0700 Subject: [PATCH 056/267] =?UTF-8?q?REPORT-38645=20=E3=80=90JDK11=E3=80=91?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=8F=B3=E4=B8=8A=E8=A7=92=EF=BC=8C?= =?UTF-8?q?fs=E6=8F=92=E4=BB=B6=E7=AE=A1=E7=90=86=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=97=A0=E5=8F=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/extra/WebViewDlgHelper.java | 4 ++-- .../main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java b/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java index d7f858b65f..628adfec64 100644 --- a/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java +++ b/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java @@ -159,7 +159,7 @@ public class WebViewDlgHelper { } public static void createLoginDialog() { - if (StableUtils.getMajorJavaVersion() == VERSION_8) { + if (StableUtils.getMajorJavaVersion() >= VERSION_8) { File file = new File(StableUtils.pathJoin(installHome, "scripts")); if (!file.exists()) { confirmDownLoadShopJS(); @@ -172,7 +172,7 @@ public class WebViewDlgHelper { public static void createLoginDialog(Window parent) { - if (StableUtils.getMajorJavaVersion() == VERSION_8) { + if (StableUtils.getMajorJavaVersion() >= VERSION_8) { File file = new File(StableUtils.pathJoin(installHome, "scripts")); if (!file.exists()) { confirmDownLoadShopJS(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java index 6e423e1729..4d168557f6 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java @@ -199,7 +199,7 @@ public class UserInfoLabel extends UILabel { this.addMouseListener(userInfoAdapter); this.setHorizontalAlignment(SwingConstants.CENTER); - if (StableUtils.getMajorJavaVersion() == VERSION_8) { + if (StableUtils.getMajorJavaVersion() >= VERSION_8) { LoginWebBridge.getHelper().setUILabel(UserInfoLabel.this); PluginWebBridge.getHelper().setUILabel(UserInfoLabel.this); } From 61624fb8558a26cb2c0a82c53f9516b0774dad06 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Sat, 5 Sep 2020 17:09:04 +0800 Subject: [PATCH 057/267] =?UTF-8?q?REPORT-38821=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=8E=B7=E5=BE=97=E6=89=A9=E5=B1=95=E8=B7=AF=E5=BE=84=E7=9A=84?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/ComponentTree.java | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java b/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java index 2fdd1f8f1e..4dd84f528b 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java @@ -4,6 +4,9 @@ import com.fr.design.constants.UIConstants; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XLayoutContainer; +import com.fr.design.designer.creator.XWAbsoluteBodyLayout; +import com.fr.design.designer.creator.XWFitLayout; +import com.fr.design.designer.creator.cardlayout.XCardSwitchButton; import com.fr.design.designer.treeview.ComponentTreeCellRenderer; import com.fr.design.designer.treeview.ComponentTreeModel; import com.fr.design.gui.itree.UITreeUI; @@ -244,12 +247,25 @@ public class ComponentTree extends JTree { } public void getExpandNodes(XLayoutContainer container, List searchList) { - for (int i = 0, size = container.getXCreatorCount(); i < size; i++) { - XCreator creator = container.getXCreator(i); - TreePath treePath=buildTreePath(creator); - if(isExpanded(treePath)) searchList.add(treePath); - if (creator instanceof XLayoutContainer) { - getExpandNodes((XLayoutContainer) creator, searchList); + TreePath treePath = buildTreePath(container); + if (isExpanded(treePath)) { + searchList.add(treePath); + for (int i = 0, size = container.getXCreatorCount(); i < size; i++) { + XCreator creator = container.getXCreator(i); + if (creator.acceptType(XLayoutContainer.class) || creator.acceptType(XCardSwitchButton.class)) { + getExpandNodes((XLayoutContainer) creator.getXCreator(), searchList); + } + } + } + //对绝对布局做特殊处理 + if (container.acceptType(XWFitLayout.class)) { + XWFitLayout bodyFitLayout = (XWFitLayout) container; + for (int j = 0; j < bodyFitLayout.getXCreatorCount(); j++) { + //类型是绝对布局并且还是body + if (bodyFitLayout.getXCreator(j).acceptType(XWAbsoluteBodyLayout.class)) { + container = (XLayoutContainer) bodyFitLayout.getXCreator(j); + getExpandNodes(container, searchList); + } } } } From d15fad9502003b15d2ada766c8c0a4c854bc7075 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 7 Sep 2020 14:29:14 +0800 Subject: [PATCH 058/267] =?UTF-8?q?REPORT-38534=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E7=95=8C=E9=9D=A2=E4=B8=AD=E7=9A=84=E5=89=AA=E5=88=87?= =?UTF-8?q?=E5=92=8C=E5=A4=8D=E5=88=B6=E6=8C=89=E9=92=AE=E7=81=B0=E5=8C=96?= =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E7=94=A8=201.=20bug=E5=8E=9F=E5=9B=A0?= =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=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/mainframe/DesignerFrame.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 42365dcc57..8de3d89f32 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 @@ -748,9 +748,11 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta * @param al 组件名称 */ public void checkCombineUp(boolean flag, ArrayList al) { - + //Yvan: 检查当前是否为WORK_SHEET状态,因为只有WORK_SHEET中含有格式刷组件,此时是不需要进行checkComponentsByNames的 + if (HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getMenuState() == DesignState.WORK_SHEET) { + return; + } combineUp.checkComponentsByNames(flag, al); - } /** From 452e0bf30093c7a7dd1d93d49afdcc121db047c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 7 Sep 2020 15:31:26 +0800 Subject: [PATCH 059/267] =?UTF-8?q?CHART-15610=20=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=A0=87=E7=AD=BE=E6=A0=BC=E5=BC=8F=E4=B8=8D=E4=BF=9D?= =?UTF-8?q?=E7=95=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/van/chart/designer/type/AbstractRectanglePlotPane.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractRectanglePlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractRectanglePlotPane.java index 6712fba900..6babd6a2f2 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractRectanglePlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractRectanglePlotPane.java @@ -68,6 +68,8 @@ public abstract class AbstractRectanglePlotPane extends AbstractVanChartTypePane VanChartAxis vanChartAxis = vanChartRectanglePlot.getValueAxisList().get(0); cloneAxis.setFormat(vanChartAxis.getFormat()); cloneAxis.setPercentage(vanChartAxis.isPercentage()); + cloneAxis.setCommonValueFormat(vanChartAxis.isCommonValueFormat()); + cloneAxis.setHtmlLabel(vanChartAxis.getHtmlLabel()); } return clonePlot; } catch (CloneNotSupportedException ex) { From d91768f8ffe489be57754ea3cb23b7ea16c853a8 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 7 Sep 2020 16:21:20 +0800 Subject: [PATCH 060/267] REPORT-38529 && REPORT-38527 --- .../main/java/com/fr/design/form/util/FormDesignerUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java index 46377b1adf..352aa80e54 100644 --- a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java +++ b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java @@ -1,5 +1,6 @@ package com.fr.design.form.util; +import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.JTemplate; @@ -17,7 +18,7 @@ public class FormDesignerUtils { * @return */ public static boolean isAppRelayout(FormDesigner designer) { - if (!designer.getRootComponent().acceptType(WFitLayout.class)) { + if (!designer.getRootComponent().acceptType(XWFitLayout.class)) { return false; } return ((WFitLayout) designer.getRootComponent().toData()).isAppRelayout(); From ef88a3f1e198c176f607f53f118c4007b2923d38 Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 7 Sep 2020 17:22:24 +0800 Subject: [PATCH 061/267] =?UTF-8?q?REPORT-35149=20=E9=A2=84=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96=E5=8F=8A=E4=B8=8E?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/style/AlignmentPane.java | 2 +- .../fr/design/gui/style/BackgroundPane.java | 4 +- .../fr/design/layout/FRGUIPaneFactory.java | 46 ++++ .../com/fr/design/mainframe/JTemplate.java | 52 +++- .../burying/point/AbstractPointCollector.java | 40 +-- .../point/AbstractTemplateInfoCollector.java | 56 ++++ .../burying/point/BasePointCollector.java | 5 - .../chart/info/ChartInfoCollector.java | 4 +- .../mainframe/predefined/PatternStyle.java | 36 +++ .../info/PredefinedStyleInfoCollector.java | 118 ++++++++ .../predefined/ui/PredefinedStyleBlock.java | 141 ++++++++++ .../ui/PredefinedStyleEditPane.java | 219 +++++++++++++++ .../ui/PredefinedStyleSelectPane.java | 102 +++++++ .../ui/PredefinedStyleSettingPane.java | 152 +++++++++++ .../ui/ReportPredefinedStylePane.java | 53 ++++ .../ui/ServerPredefinedStylePane.java | 201 ++++++++++++++ .../ui/detail/CellStyleSettingPane.java | 234 ++++++++++++++++ .../ui/detail/ComponentStyleSettingPane.java | 69 +++++ .../PredefinedBackgroundSettingPane.java | 84 ++++++ .../background/BackgroundSettingPane.java | 167 ++++++++++++ .../ui/detail/background/BackgroundType.java | 99 +++++++ .../BackgroundWithAlphaSettingPane.java | 78 ++++++ .../ui/detail/background/ColorDetailPane.java | 102 +++++++ .../background/EmptyBackgroundPane.java | 27 ++ .../detail/background/GradientDetailPane.java | 147 ++++++++++ .../ui/detail/background/ImageDetailPane.java | 190 +++++++++++++ .../detail/background/PatternDetailPane.java | 93 +++++++ .../background/TextureDetailObservePane.java | 60 +++++ .../cell/CustomPredefinedStylePane.java | 129 +++++++++ .../component/ComponentFrameStylePane.java | 147 ++++++++++ .../component/ComponentMarginStylePane.java | 93 +++++++ .../detail/component/ComponentStylePane.java | 15 ++ .../component/ComponentTitleStylePane.java | 252 ++++++++++++++++++ .../ui/dialog/PredefinedStyleEditDialog.java | 190 +++++++++++++ .../dialog/ReportPredefinedStyleDialog.java | 93 +++++++ .../dialog/ServerPredefinedStyleDialog.java | 69 +++++ .../ui/preview/ComponentPreviewPane.java | 146 ++++++++++ .../ui/preview/ElementCasePreview.java | 98 +++++++ .../preview/PredefinedStylePreviewPane.java | 76 ++++++ .../ui/preview/StyleSettingPreviewPane.java | 17 ++ .../mainframe/template/info/SendHelper.java | 2 +- .../template/info/TemplateInfoCollector.java | 4 +- .../design/style/background/impl/BPane.java | 2 +- .../impl/TextureBackgroundPane.java | 192 ++----------- .../background/texture/TextureDetailPane.java | 208 +++++++++++++++ .../design/style/color/ColorSelectPane.java | 29 +- .../com/fr/design/icon/icon_edit.png | Bin 0 -> 333 bytes .../fr/design/icon/icon_predefined_style.png | Bin 0 -> 269 bytes .../design/mainframe/predefined/previewData | 11 + .../PredefinedStyleInfoCollectorTest.java | 97 +++++++ .../predefined/info/predefinedStyle.info | 2 + .../xpane/FormPredefinedBackgroundPane.java | 101 +++++++ .../PredefinedComponentStyleSettingPane.java | 179 +++++++++++++ .../AccessibleBodyBackgroundEditor.java | 98 +++++++ .../AccessibleBorderStyleEditor.java | 99 +++++++ .../AccessibleWLayoutBorderStyleEditor.java | 83 ++++-- .../layout/BorderStyleWidgetDefinePane.java | 14 +- .../ui/designer/layout/ComponentStyle.java | 35 +++ .../layout/ElementEditorDefinePane.java | 11 - .../FRAbsoluteBodyLayoutDefinePane.java | 23 +- .../layout/FRFitLayoutDefinePane.java | 22 +- .../layout/WTitleLayoutDefinePane.java | 19 +- .../report/ReportBackgroundAction.java | 11 +- .../ServerPredefinedStyleAction.java | 52 ++++ .../mainframe/InformationCollector.java | 4 +- .../com/fr/design/mainframe/JWorkBook.java | 4 + .../cell/settingpane/CellStylePane.java | 87 ++---- .../style/CellPredefinedStyleSettingPane.java | 243 +++++++++++++++++ .../ReportPredefinedBackgroundPane.java | 128 +++++++++ .../src/main/java/com/fr/grid/GridUI.java | 7 + .../main/java/com/fr/start/MainDesigner.java | 4 +- 71 files changed, 5325 insertions(+), 352 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractTemplateInfoCollector.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/PatternStyle.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollector.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleBlock.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleSelectPane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleSettingPane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ReportPredefinedStylePane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/CellStyleSettingPane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/ComponentStyleSettingPane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/PredefinedBackgroundSettingPane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/BackgroundSettingPane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/BackgroundType.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/BackgroundWithAlphaSettingPane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/ColorDetailPane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/EmptyBackgroundPane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/GradientDetailPane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/ImageDetailPane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/PatternDetailPane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/TextureDetailObservePane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/cell/CustomPredefinedStylePane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/component/ComponentFrameStylePane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/component/ComponentMarginStylePane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/component/ComponentStylePane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/component/ComponentTitleStylePane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/dialog/PredefinedStyleEditDialog.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/dialog/ReportPredefinedStyleDialog.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/dialog/ServerPredefinedStyleDialog.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/ComponentPreviewPane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/ElementCasePreview.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/PredefinedStylePreviewPane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/StyleSettingPreviewPane.java create mode 100644 designer-base/src/main/java/com/fr/design/style/background/texture/TextureDetailPane.java create mode 100644 designer-base/src/main/resources/com/fr/design/icon/icon_edit.png create mode 100644 designer-base/src/main/resources/com/fr/design/icon/icon_predefined_style.png create mode 100644 designer-base/src/main/resources/com/fr/design/mainframe/predefined/previewData create mode 100644 designer-base/src/test/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollectorTest.java create mode 100644 designer-base/src/test/resources/com/fr/design/mainframe/predefined/info/predefinedStyle.info create mode 100644 designer-form/src/main/java/com/fr/design/gui/xpane/FormPredefinedBackgroundPane.java create mode 100644 designer-form/src/main/java/com/fr/design/gui/xpane/PredefinedComponentStyleSettingPane.java create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyBackgroundEditor.java create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBorderStyleEditor.java create mode 100644 designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/ComponentStyle.java create mode 100644 designer-realize/src/main/java/com/fr/design/actions/server/predefined/ServerPredefinedStyleAction.java create mode 100644 designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CellPredefinedStyleSettingPane.java create mode 100644 designer-realize/src/main/java/com/fr/design/report/ReportPredefinedBackgroundPane.java diff --git a/designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java b/designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java index b188cb5aa8..50d6448b8d 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java @@ -55,7 +55,7 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO private static final int ANGEL = 90; private static final int GAP = 23; private static final int VERGAP = 3; - private static final Dimension SPINNER_DIMENSION = new Dimension(75, 20); + private static final Dimension SPINNER_DIMENSION = new Dimension(70, 20); private static final String[] TEXT = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Wrap_Text"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Single_Line"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Single_Line(Adjust_Font)"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Multi_Line(Adjust_Font)")}; diff --git a/designer-base/src/main/java/com/fr/design/gui/style/BackgroundPane.java b/designer-base/src/main/java/com/fr/design/gui/style/BackgroundPane.java index 88ee482cb8..22e883c1e9 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/BackgroundPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/BackgroundPane.java @@ -71,7 +71,7 @@ public class BackgroundPane extends AbstractBasicStylePane { double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ new Component[]{null, null}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fill") + " ", SwingConstants.LEFT),typeComboBox}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fill"), SwingConstants.LEFT),typeComboBox}, new Component[]{null, centerPane} }; double[] rowSize = {p, p, p}; @@ -172,4 +172,4 @@ public class BackgroundPane extends AbstractBasicStylePane { return style.deriveBackground(this.update()); } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java b/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java index f63d8f576c..da0a2131c6 100644 --- a/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java +++ b/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java @@ -152,6 +152,20 @@ public class FRGUIPaneFactory { return jp; } + /** + * 创建一个无间隔带标题边框面板 + * + * @param string 边框标题 + * @return JPanel对象 + */ + public static JPanel createTitledBorderNoGapPane(String string) { + JPanel jp = new JPanel(); + UITitledBorder explainBorder = UITitledBorder.createBorderWithTitle(string); + jp.setBorder(explainBorder); + jp.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); + return jp; + } + /** * 创建一个带标题边框面板,垂直居左布局 * @@ -304,6 +318,21 @@ public class FRGUIPaneFactory { return jp; } + /** + * 创建一个靠左的水平流式布局 + * @param firstGap 首元素和边框间距 + * @param hgap 水平间距 + * @param vgap 竖直间距 + * @return JPanel对象 + */ + public static JPanel createBoxFlowInnerContainer_S_Pane(int firstGap, int hgap, int vgap) { + JPanel jp = new JPanel(); + jp.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + jp.setLayout(new FRLeftFlowLayout(firstGap, hgap, vgap)); + return jp; + } + + /** * 创建一个靠左流式布局,流式内嵌,首元素距离左边0 * @@ -315,6 +344,21 @@ public class FRGUIPaneFactory { return jp; } + /** + * 创建一个靠左的水平流式布局 + * @param hgap 水平间距 + * @param vgap 竖直间距 + * @return JPanel对象 + */ + public static JPanel createBoxFlowInnerContainer_S_Pane(int hgap, int vgap) { + JPanel jp = new JPanel(); + jp.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + jp.setLayout(new FlowLayout(FlowLayout.LEFT, hgap, vgap)); + return jp; + } + + + /** * 创建一个靠右面板 * @@ -469,6 +513,8 @@ public class FRGUIPaneFactory { return jp; } + + /** * 创建垂直流布局面板 * diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index f29e22698c..b898dda3a1 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -6,6 +6,7 @@ import com.fr.base.Parameter; import com.fr.base.ScreenResolution; import com.fr.base.io.BaseBook; import com.fr.base.iofile.attr.DesignBanCopyAttrMark; +import com.fr.base.iofile.attr.PredefinedStyleAttrMark; import com.fr.base.iofile.attr.TemplateIdAttrMark; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignModelAdapter; @@ -38,6 +39,9 @@ import com.fr.design.gui.itree.filetree.TemplateFileTree; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.chart.info.ChartInfoCollector; +import com.fr.design.mainframe.predefined.info.PredefinedStyleInfoCollector; +import com.fr.design.mainframe.predefined.ui.ReportPredefinedStylePane; +import com.fr.design.mainframe.predefined.ui.dialog.ReportPredefinedStyleDialog; import com.fr.design.mainframe.template.info.TemplateInfoCollector; import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.design.mainframe.template.info.TimeConsumeTimer; @@ -80,6 +84,8 @@ import javax.swing.JComponent; import javax.swing.JOptionPane; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.undo.UndoManager; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.Arrays; import java.util.Set; @@ -142,8 +148,14 @@ public abstract class JTemplate> consumeTimer.setEnabled(shouldInitForCollectInfo(isNewFile)); initAndStartPlugin(); + + if (this.template.getAttrMark(PredefinedStyleAttrMark.XML_TAG) == null) { + this.template.addAttrMark(new PredefinedStyleAttrMark()); + } } + + private void initAndStartPlugin() { initPluginPane(); startListenPlugin(); @@ -1296,10 +1308,48 @@ public abstract class JTemplate> for (DesignerFrameUpButtonProvider provider : providers) { uiButtons = ArrayUtils.addAll(uiButtons, provider.getUpButtons(getMenuState())); } - + UIButton predefinedBtn = createPreferenceButton(); + if (predefinedBtn != null) { + uiButtons = ArrayUtils.addAll(uiButtons, new UIButton[]{predefinedBtn}); + } return uiButtons; } + protected UIButton createPreferenceButton(){ + UIButton preferenceButton = new UIButton(BaseUtils.readIcon("/com/fr/design/icon/icon_predefined_style.png")); + preferenceButton.setToolTipText("预定义样式按钮"); + preferenceButton.setText(getTemplatePredefinedStyle()); + preferenceButton.set4ToolbarButton(); + preferenceButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); + ReportPredefinedStylePane stylePane = new ReportPredefinedStylePane(JTemplate.this, preferenceButton); + ReportPredefinedStyleDialog dialog = new ReportPredefinedStyleDialog(designerFrame, stylePane); + PredefinedStyleInfoCollector.getInstance().collectClickNumber(); + dialog.setVisible(true); + + } + }); + return preferenceButton; + } + + public void resetPredefinedStyle(String styleName, UIButton predefinedBtn){ + this.getTarget().resetPreferenceStyle(styleName); + predefinedBtn.setText(getTemplatePredefinedStyle()); + this.fireTargetModified(); + this.repaint(); + } + + public String getTemplatePredefinedStyle(){ + PredefinedStyleAttrMark attrMark = this.getTarget().getAttrMark(PredefinedStyleAttrMark.XML_TAG); + if (attrMark == null){ + attrMark = new PredefinedStyleAttrMark(); + } + return attrMark.getPreferenceStyleName(); + } + + /** * 由于老版本的模板没有模板ID,当勾选使用参数模板时候,就加一个模板ID attr * diff --git a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointCollector.java index 15291211cb..6ac14505a6 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointCollector.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointCollector.java @@ -3,7 +3,6 @@ package com.fr.design.mainframe.burying.point; import com.fr.base.FRContext; import com.fr.base.io.XMLReadHelper; import com.fr.design.DesignerEnvManager; -import com.fr.design.mainframe.template.info.SendHelper; import com.fr.log.FineLoggerFactory; import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; @@ -20,25 +19,20 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; /** * @author Bjorn * @version 10.0 * Created by Bjorn on 2020-02-21 */ -public abstract class AbstractPointCollector implements BasePointCollector { +public abstract class AbstractPointCollector implements BasePointCollector { + - protected Map pointInfoMap; private static final int MAX_SIZE = 512 * 1024 * 1024; public AbstractPointCollector() { - pointInfoMap = new ConcurrentHashMap<>(); - loadFromFile(); + } /** @@ -48,34 +42,6 @@ public abstract class AbstractPointCollector implem return FileUtils.sizeOf(getInfoFile()) <= MAX_SIZE && DesignerEnvManager.getEnvManager().isJoinProductImprove() && FRContext.isChineseEnv(); } - @Override - public void sendPointInfo() { - - addIdleDayCount(); - - List removeList = new ArrayList<>(); - List sendList = new ArrayList<>(); - - for (String key : pointInfoMap.keySet()) { - AbstractPointInfo pointInfo = pointInfoMap.get(key); - pointInfo.selectPoint(removeList, sendList); - } - - // 发送记录 - for (String key : sendList) { - if(SendHelper.sendPointInfo(pointInfoMap.get(key))){ - removeList.add(key); - } - } - - // 清空记录 - for (String key : removeList) { - pointInfoMap.remove(key); - } - - saveInfo(); - } - /** * 从文件中读取埋点信息 */ diff --git a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractTemplateInfoCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractTemplateInfoCollector.java new file mode 100644 index 0000000000..34dc5ea2a4 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractTemplateInfoCollector.java @@ -0,0 +1,56 @@ +package com.fr.design.mainframe.burying.point; + +import com.fr.design.mainframe.template.info.SendHelper; +import com.fr.design.mainframe.template.info.TemplateProcessInfo; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * Created by kerry on 2020-09-04 + */ +public abstract class AbstractTemplateInfoCollector extends AbstractPointCollector { + protected Map pointInfoMap; + + public AbstractTemplateInfoCollector() { + pointInfoMap = new ConcurrentHashMap<>(); + loadFromFile(); + + } + + + /** + * 保存埋点的信息到本地 + */ + public abstract void collectInfo(String templateID, String originID, TemplateProcessInfo processInfo, int timeConsume); + + @Override + public void sendPointInfo() { + + addIdleDayCount(); + + List removeList = new ArrayList<>(); + List sendList = new ArrayList<>(); + + for (String key : pointInfoMap.keySet()) { + BasePointInfo pointInfo = pointInfoMap.get(key); + pointInfo.selectPoint(removeList, sendList); + } + + // 发送记录 + for (String key : sendList) { + if(SendHelper.sendPointInfo(pointInfoMap.get(key))){ + removeList.add(key); + } + } + + // 清空记录 + for (String key : removeList) { + pointInfoMap.remove(key); + } + + saveInfo(); + } + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointCollector.java index f10f1682e0..e2a3c778c9 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointCollector.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointCollector.java @@ -1,6 +1,5 @@ package com.fr.design.mainframe.burying.point; -import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.stable.xml.XMLReadable; import com.fr.stable.xml.XMLWriter; @@ -16,8 +15,4 @@ public interface BasePointCollector extends XMLReadable, XMLWriter { */ public void sendPointInfo(); - /** - * 保存埋点的信息到本地 - */ - public void collectInfo(String templateID, String originID, TemplateProcessInfo processInfo, int timeConsume); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java index cd651fc6b3..428e5625c6 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java @@ -4,7 +4,7 @@ import com.fr.base.io.BaseBook; import com.fr.chartx.attr.ChartProvider; import com.fr.chartx.config.info.AbstractConfig; import com.fr.chartx.config.info.constant.ConfigType; -import com.fr.design.mainframe.burying.point.AbstractPointCollector; +import com.fr.design.mainframe.burying.point.AbstractTemplateInfoCollector; import com.fr.design.mainframe.template.info.TemplateInfo; import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.general.ComparatorUtils; @@ -21,7 +21,7 @@ import java.util.Map; * @version 10.0 * Created by Bjorn on 2020-02-18 */ -public class ChartInfoCollector extends AbstractPointCollector { +public class ChartInfoCollector extends AbstractTemplateInfoCollector { private static final String XML_TAG = "ChartInfoCollector"; private static final String XML_LAST_EDIT_DAY = "lastEditDay"; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/PatternStyle.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/PatternStyle.java new file mode 100644 index 0000000000..372ad10c70 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/PatternStyle.java @@ -0,0 +1,36 @@ +package com.fr.design.mainframe.predefined; + +import com.fr.config.predefined.PredefinedStyle; + + +/** + * Created by kerry on 2020-08-31 + */ +public enum PatternStyle { + DARK_STYLE(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Dark_Pattern")) { + @Override + public PredefinedStyle getPredefinedStyle() { + return new PredefinedStyle(); + } + }, + LIGHT_STYLE(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Light_Pattern")) { + @Override + public PredefinedStyle getPredefinedStyle() { + return new PredefinedStyle(); + } + }; + + + private String name; + + PatternStyle(String name) { + this.name = name; + } + + public String getName() { + return this.name; + } + + public abstract PredefinedStyle getPredefinedStyle(); + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollector.java new file mode 100644 index 0000000000..2827cbee0b --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/info/PredefinedStyleInfoCollector.java @@ -0,0 +1,118 @@ +package com.fr.design.mainframe.predefined.info; + +import com.fr.config.MarketConfig; +import com.fr.design.DesignerEnvManager; +import com.fr.design.mainframe.burying.point.AbstractPointCollector; +import com.fr.design.mainframe.template.info.SendHelper; +import com.fr.general.CloudCenter; +import com.fr.general.GeneralUtils; +import com.fr.json.JSONObject; +import com.fr.stable.xml.XMLPrintWriter; +import com.fr.stable.xml.XMLableReader; +import com.fr.third.joda.time.DateTime; + +/** + * Created by kerry on 2020-09-04 + */ +public class PredefinedStyleInfoCollector extends AbstractPointCollector { + private static final String SIMPLE_DATE_PATTERN = "yyyy-MM-dd"; + private static final String XML_TAG = "PredefinedStyleInfo"; + private static final String XML_FILE_NAME = "predefinedStyle.info"; + private static final String CLOUD_URL = CloudCenter.getInstance().acquireUrlByKind("predefinedInfo.collector") + "/single"; + + private static final String FUNCTION_NAME = "predefinedStyle"; + private static final String FUNCTION_ID = "FR-F7003"; + + private static final String ATTR_FUNCTION_NAME = "functionName"; + private static final String ATTR_FUNCTION_ID = "functionId"; + private static final String ATTR_UUID = "uuid"; + private static final String ATTR_UID = "uid"; + private static final String ATTR_JAR_TIME = "jatTime"; + private static final String ATTR_CLICK_NUMBER = "clickNumber"; + private static final String ATTR_USE_NUMBER = "useNumber"; + private static final String ATTR_TIME = "time"; + + private int clickNumber = 0; + + private int useNumber = 0; + + public int getClickNumber() { + return clickNumber; + } + + public int getUseNumber() { + return useNumber; + } + + private static class Holder { + private static PredefinedStyleInfoCollector collector = new PredefinedStyleInfoCollector(); + } + + private PredefinedStyleInfoCollector() { + loadFromFile(); + } + + public static PredefinedStyleInfoCollector getInstance() { + return Holder.collector; + } + + public void collectClickNumber() { + clickNumber++; + saveInfo(); + } + + public void collectUseNumber() { + useNumber++; + saveInfo(); + } + + @Override + protected String getInfoFilePath() { + return XML_FILE_NAME; + } + + @Override + protected void addIdleDayCount() { + + } + + @Override + public void sendPointInfo() { + String content = generateTotalInfo(); + + SendHelper.sendSinglePointInfo(CLOUD_URL, content); + } + + public String generateTotalInfo() { + + JSONObject jo = JSONObject.create(); + jo.put(ATTR_FUNCTION_NAME, FUNCTION_NAME); + jo.put(ATTR_FUNCTION_ID, FUNCTION_ID); + jo.put(ATTR_UUID, DesignerEnvManager.getEnvManager().getUUID()); + jo.put(ATTR_UID, MarketConfig.getInstance().getBBSAttr().getBbsUid()); + jo.put(ATTR_JAR_TIME, GeneralUtils.readFullVersionNO()); + jo.put(ATTR_CLICK_NUMBER, this.clickNumber); + jo.put(ATTR_USE_NUMBER, this.useNumber); + jo.put(ATTR_TIME, DateTime.now().toString(SIMPLE_DATE_PATTERN)); + return jo.toString(); + } + + + @Override + public void readXML(XMLableReader reader) { + if (reader.isAttr()) { + String name = reader.getTagName(); + if (XML_TAG.equals(name)) { + this.clickNumber = reader.getAttrAsInt(ATTR_CLICK_NUMBER, 0); + this.useNumber = reader.getAttrAsInt(ATTR_USE_NUMBER, 0); + } + } + } + + @Override + public void writeXML(XMLPrintWriter writer) { + writer.startTAG(XML_TAG); + writer.attr(ATTR_CLICK_NUMBER, this.clickNumber).attr(ATTR_USE_NUMBER, this.useNumber); + writer.end(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleBlock.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleBlock.java new file mode 100644 index 0000000000..5fb8f35320 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleBlock.java @@ -0,0 +1,141 @@ +package com.fr.design.mainframe.predefined.ui; + +import com.fr.base.BaseUtils; +import com.fr.base.GraphHelper; +import com.fr.config.predefined.PredefinedStyle; +import com.fr.design.mainframe.predefined.ui.dialog.PredefinedStyleEditDialog; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.predefined.ui.preview.PredefinedStylePreviewPane; +import com.fr.general.ComparatorUtils; +import com.fr.general.IOUtils; +import com.fr.stable.Constants; + +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Rectangle; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; + +/** + * Created by kerry on 2020-08-25 + */ +public class PredefinedStyleBlock extends JPanel { + private PredefinedStyle previewObject; + private PredefinedStyleSelectPane parentPane; + private Icon markedMode = IOUtils.readIcon("/com/fr/design/form/images/marked.png"); + private static final Color BORDER_COLOR = new Color(141, 194, 249); + + private boolean mouseOver = false; + + private MouseListener mouseListener = new MouseListener() { + @Override + public void mouseClicked(MouseEvent e) { + setSelect(); + } + + @Override + public void mousePressed(MouseEvent e) { + + } + + @Override + public void mouseReleased(MouseEvent e) { + + } + + @Override + public void mouseEntered(MouseEvent e) { + mouseOver = true; + PredefinedStyleBlock.this.repaint(); + } + + @Override + public void mouseExited(MouseEvent e) { + mouseOver = false; + PredefinedStyleBlock.this.repaint(); + } + }; + + + public PredefinedStyleBlock(PredefinedStyle previewObject, PredefinedStyleSelectPane selectPane, boolean supportEdit) { + this.previewObject = previewObject; + this.parentPane = selectPane; + initPane(supportEdit); + this.addMouseListener(mouseListener); + } + + private void setSelect() { + this.parentPane.setSelectedPreviewPane(this); + } + + @Override + public void paint(Graphics g) { + super.paint(g); + boolean isSelected = ComparatorUtils.equals(this, this.parentPane.getSelectedPreviewPane()); + if (ComparatorUtils.equals(this.parentPane.getCurrentApplicateStyle(), this.previewObject.getStyleName())) { + markedMode.paintIcon(this, g, 176, 0); + } + if (isSelected || this.mouseOver) { + g.setColor(BORDER_COLOR); + Rectangle rectangle = new Rectangle(1, 1, this.getWidth() - 2, this.getHeight() - 2); + GraphHelper.draw(g, rectangle, Constants.LINE_LARGE); + } + } + + + private void initPane(boolean supportEdit) { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + PredefinedStylePreviewPane content = new PredefinedStylePreviewPane(0.387, 0.384); + content.setPreferredSize(new Dimension(200, 125)); + UILabel label = new UILabel(previewObject.getStyleName()); + label.setPreferredSize(new Dimension(167, 25)); + + + JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + panel.setBorder(BorderFactory.createEmptyBorder(0,0,2,2)); + panel.add(label, BorderLayout.WEST); + if (supportEdit) { + addEditButton(panel); + } + + this.add(content, BorderLayout.CENTER); + this.add(panel, BorderLayout.SOUTH); + this.setPreferredSize(new Dimension(200, 150)); + panel.setBackground(Color.WHITE); + this.setBackground(Color.WHITE); + content.refresh(this.previewObject); + + } + + private void addEditButton(JPanel panel) { + UIButton editButton = new UIButton(BaseUtils.readIcon("/com/fr/design/icon/icon_edit.png")); + editButton.setPreferredSize(new Dimension(24, 24)); + editButton.setBorderPainted(false); + editButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + PredefinedStyleEditPane editPane = PredefinedStyleEditPane.createEditPane(parentPane); + PredefinedStyleEditDialog editDialog = new PredefinedStyleEditDialog( + SwingUtilities.getWindowAncestor(PredefinedStyleBlock.this), editPane, previewObject.isBuiltIn()); + editPane.populate(PredefinedStyleBlock.this.previewObject); + editDialog.setVisible(true); + } + }); + panel.add(editButton, BorderLayout.EAST); + + } + + public PredefinedStyle update() { + return this.previewObject; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java new file mode 100644 index 0000000000..78cb3f8e79 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java @@ -0,0 +1,219 @@ +package com.fr.design.mainframe.predefined.ui; + +import com.fr.config.predefined.PredefinedStyle; +import com.fr.config.predefined.PredefinedStyleConfig; +import com.fr.config.ServerPreferenceConfig; +import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; +import com.fr.design.gui.frpane.AttributeChangeListener; +import com.fr.design.gui.frpane.UITabbedPane; +import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.predefined.ui.detail.PredefinedBackgroundSettingPane; +import com.fr.design.mainframe.predefined.ui.detail.CellStyleSettingPane; +import com.fr.design.mainframe.predefined.ui.detail.ComponentStyleSettingPane; +import com.fr.design.mainframe.predefined.ui.preview.PredefinedStylePreviewPane; +import com.fr.log.FineLoggerFactory; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.Label; + +/** + * Created by kerry on 2020-08-26 + */ +public class PredefinedStyleEditPane extends AbstractAttrNoScrollPane { + private PredefinedStylePreviewPane previewPane; + private UITextField styleNameField; + private PredefinedBackgroundSettingPane backgroundSettingPane; + private CellStyleSettingPane cellStyleSettingPane; + private ComponentStyleSettingPane componentStyleSettingPane; + private PredefinedStyleSelectPane selectPane; + private boolean isPopulating = false; + + @Override + protected JPanel createContentPane() { + JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + jPanel.add(createLeftPane(), BorderLayout.WEST); + jPanel.add(createRightPane(), BorderLayout.CENTER); + + this.addAttributeChangeListener(new AttributeChangeListener() { + @Override + public void attributeChange() { + if (!isPopulating) { + valueChangeAction(); + } + } + }); + return jPanel; + } + + public void valueChangeAction() { + previewPane.refresh(this.update()); + } + + @Override + public String title4PopupWindow() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Style_Edit"); + } + + private PredefinedStyleEditPane(PredefinedStyleSelectPane selectPane, boolean newEditPane) { + this.selectPane = selectPane; + this.styleNameField.setEnabled(newEditPane); + } + + public static PredefinedStyleEditPane createEditPane(PredefinedStyleSelectPane selectPane) { + return new PredefinedStyleEditPane(selectPane, false); + } + + public static PredefinedStyleEditPane createNewEditPane(PredefinedStyleSelectPane selectPane) { + return new PredefinedStyleEditPane(selectPane, true); + } + + + private JPanel createLeftPane() { + JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + JPanel titlePane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Overall_Preview")); + previewPane = new PredefinedStylePreviewPane(); + previewPane.setPreferredSize(new Dimension(517, 320)); + + titlePane.add(previewPane); + jPanel.add(titlePane, BorderLayout.CENTER); + return jPanel; + } + + private JPanel createRightPane() { + JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + JPanel styleNamePane = createStyleNamePane(); + jPanel.add(styleNamePane, BorderLayout.NORTH); + + JPanel basicSettingPane = createBasicSettingPane(); + jPanel.add(basicSettingPane, BorderLayout.CENTER); + + JPanel customDetailPane = createCustomDetailPane(); + jPanel.add(customDetailPane, BorderLayout.SOUTH); + return jPanel; + } + + private JPanel createStyleNamePane() { + JPanel jPanel = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(5, 26, 8); + jPanel.add(new Label(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Style_Name"))); + this.styleNameField = new UITextField(); + this.styleNameField.setPreferredSize(new Dimension(160, 20)); + jPanel.add(this.styleNameField); + return jPanel; + } + + private JPanel createBasicSettingPane() { + JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + JPanel titlePane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Basic_Setting")); + JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + titlePane.add(contentPane); + jPanel.add(titlePane, BorderLayout.CENTER); + titlePane.setSize(new Dimension(348, 157)); + return jPanel; + } + + private JPanel createCustomDetailPane() { + JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + JPanel titlePane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Custom_Detail")); + titlePane.setLayout(FRGUIPaneFactory.createLeftZeroLayout()); + jPanel.add(titlePane, BorderLayout.CENTER); + UITabbedPane uiTabbedPane = new UITabbedPane(); + uiTabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Template_Background"), createTemplateBackgroundSettingPane()); + uiTabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Cell_Style"), createCellStyleSettingPane()); + uiTabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Chart_Style"), createChartStyleSettingPane()); + uiTabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Component_Style"), createComponentStyleSettingPane()); + + titlePane.add(uiTabbedPane); + titlePane.setPreferredSize(new Dimension(333, 320)); + return jPanel; + } + + + private JPanel createTemplateBackgroundSettingPane() { + JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + jPanel.setBorder(BorderFactory.createEmptyBorder(10, 5, 10, 5)); + this.backgroundSettingPane = new PredefinedBackgroundSettingPane(); + this.backgroundSettingPane.setPreferredSize(new Dimension(313, 265)); + jPanel.add(new UIScrollPane(this.backgroundSettingPane)); + return jPanel; + } + + private JPanel createCellStyleSettingPane() { + JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + jPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); + this.cellStyleSettingPane = new CellStyleSettingPane(this); + jPanel.add(this.cellStyleSettingPane); + return jPanel; + } + + + private JPanel createChartStyleSettingPane() { + JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + jPanel.setBorder(BorderFactory.createEmptyBorder(10, 5, 10, 5)); + jPanel.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Chart_Style"))); + return jPanel; + } + + + private JPanel createComponentStyleSettingPane() { + JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + jPanel.setBorder(BorderFactory.createEmptyBorder(10, 5, 10, 5)); + this.componentStyleSettingPane = new ComponentStyleSettingPane(); + jPanel.add(this.componentStyleSettingPane); + return jPanel; + } + + + public void populate(PredefinedStyle previewObject) { + isPopulating = true; + styleNameField.setText(previewObject.getStyleName()); + this.backgroundSettingPane.populateBean(previewObject.getPredefinedBackground()); + this.cellStyleSettingPane.populateBean(previewObject.getCellStyleMap()); + this.componentStyleSettingPane.populateBean(previewObject.getComponentStyle()); + isPopulating = false; + } + + public PredefinedStyle update() { + PredefinedStyle predefinedStyle = new PredefinedStyle(); + predefinedStyle.setStyleName(this.styleNameField.getText()); + predefinedStyle.setCellStyleMap(this.cellStyleSettingPane.updateBean()); + predefinedStyle.setPredefinedBackground(this.backgroundSettingPane.updateBean()); + predefinedStyle.setComponentStyle(this.componentStyleSettingPane.updateBean()); + return predefinedStyle; + } + + public void saveStyle() { + PredefinedStyle previewObject = null; + try { + previewObject = update(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + saveStyle(previewObject); + } + + public void saveStyle(PredefinedStyle previewObject) { + PredefinedStyleConfig config = ServerPreferenceConfig.getInstance().getPreferenceStyleConfig(); + config.put(previewObject.getStyleName(), previewObject); + ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(config); + selectPane.refreshPane(); + } + + public void saveAsNewStyle(String styleName) { + PredefinedStyle previewObject = null; + try { + previewObject = update(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + previewObject.setStyleName(styleName); + saveStyle(previewObject); + } + + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleSelectPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleSelectPane.java new file mode 100644 index 0000000000..26b92907a9 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleSelectPane.java @@ -0,0 +1,102 @@ +package com.fr.design.mainframe.predefined.ui; + +import com.fr.config.predefined.PredefinedStyle; +import com.fr.config.ServerPreferenceConfig; +import com.fr.design.dialog.BasicPane; +import com.fr.design.event.ChangeListener; +import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.layout.FRGUIPaneFactory; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.util.Iterator; + +/** + * Created by kerry on 2020-08-26 + */ +public class PredefinedStyleSelectPane extends BasicPane { + private PredefinedStyleBlock selectedBlock; + private boolean editable; + private JPanel contentPane; + private String currentApplicateStyle; + private ChangeListener changeListener; + + + public PredefinedStyleSelectPane(String currentApplicateStyle, boolean editable) { + this.editable = editable; + this.currentApplicateStyle = currentApplicateStyle; + initPane(); + } + + public void registerChangeListener(ChangeListener changeListener) { + this.changeListener = changeListener; + + } + + + private void initPane() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + contentPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(5, 8); + createContentPane(); + UIScrollPane scrollPane = new UIScrollPane(contentPane); + scrollPane.setPreferredSize(new Dimension(630, 480)); + scrollPane.setBorder(BorderFactory.createEmptyBorder()); + this.add(scrollPane, BorderLayout.CENTER); + } + + + public void createContentPane() { + contentPane.removeAll(); + Iterator iterator = ServerPreferenceConfig.getInstance().getPreferenceStyleConfig().getPredefinedStyleIterator(); + int rowCount = (ServerPreferenceConfig.getInstance().getPreferenceStyleConfig().getPredefinedSize() +2)/ 3; + contentPane.setPreferredSize(new Dimension(618, 157 * rowCount)); + while (iterator.hasNext()) { + PredefinedStyle tmpStyle = iterator.next(); + + if (tmpStyle != null) { + PredefinedStyleBlock tmpPanel = + new PredefinedStyleBlock(tmpStyle, this, this.editable); + contentPane.add(tmpPanel); + } + } + } + + + public String getCurrentApplicateStyle() { + return currentApplicateStyle; + } + + public void refreshPane() { + createContentPane(); + this.validate(); + this.repaint(); + } + + @Override + protected String title4PopupWindow() { + return null; + } + + public void setSelectedPreviewPane(PredefinedStyleBlock selectedPreviewPane) { + this.selectedBlock = selectedPreviewPane; + if (changeListener != null) { + changeListener.fireChanged(null); + } + this.repaint(); + } + + public PredefinedStyleBlock getSelectedPreviewPane() { + return selectedBlock; + } + + public PredefinedStyle update() { + if (this.selectedBlock == null){ + return null; + } + return this.selectedBlock.update(); + } + + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleSettingPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleSettingPane.java new file mode 100644 index 0000000000..758f8e0131 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleSettingPane.java @@ -0,0 +1,152 @@ +package com.fr.design.mainframe.predefined.ui; + +import com.fr.config.predefined.PredefinedNameStyleProvider; +import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; +import com.fr.design.gui.frpane.AttributeChangeListener; +import com.fr.design.gui.ibutton.UIRadioButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.JTemplate; +import com.fr.design.mainframe.predefined.ui.preview.StyleSettingPreviewPane; + +import javax.swing.ButtonGroup; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Dimension; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/** + * Created by kerry on 2020-09-02 + */ +public abstract class PredefinedStyleSettingPane extends AbstractAttrNoScrollPane { + protected StyleSettingPreviewPane previewPane; + protected UIRadioButton predefinedRadioBtn; + private UIRadioButton customRadioBtn; + private JPanel customDetailPane; + private JPanel predefinedSettingPane; + private CardLayout tabbedPane; + private JPanel center; + private boolean isPopulating = false; + + + public void setPopulating(boolean populating) { + isPopulating = populating; + } + + protected void initContentPane() { + leftContentPane = createContentPane(); + this.add(leftContentPane, BorderLayout.CENTER); + } + + @Override + protected JPanel createContentPane() { + JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + previewPane = createPreviewPane(); + JPanel previewTitlePane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview")); + if (previewPane != null) { + previewTitlePane.setPreferredSize(new Dimension(407, 527)); + previewTitlePane.add(previewPane); + contentPane.add(previewTitlePane, BorderLayout.WEST); + } + + customDetailPane = createCustomDetailPane(); + predefinedSettingPane = createPredefinedSettingPane(); + + JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + JPanel jPanel = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(10, 20, 10); + jPanel.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style"))); + predefinedRadioBtn = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Predefined")); + customRadioBtn = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom")); + + tabbedPane = new CardLayout(); + center = new JPanel(tabbedPane); + center.add(predefinedSettingPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Predefined")); + center.add(customDetailPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom")); + predefinedRadioBtn.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + tabbedPane.show(center, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Predefined")); + } + }); + customRadioBtn.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + tabbedPane.show(center, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom")); + } + }); + jPanel.add(predefinedRadioBtn); + jPanel.add(customRadioBtn); + + ButtonGroup layoutBG = new ButtonGroup(); + layoutBG.add(predefinedRadioBtn); + layoutBG.add(customRadioBtn); + centerPane.add(jPanel, BorderLayout.NORTH); + centerPane.add(center, BorderLayout.CENTER); + contentPane.add(centerPane, BorderLayout.CENTER); + this.addAttributeChangeListener(new AttributeChangeListener() { + @Override + public void attributeChange() { + if (isPopulating) { + return; + } + if (previewPane != null) { + previewPane.refresh(); + } + } + }); + return contentPane; + } + + + protected abstract StyleSettingPreviewPane createPreviewPane(); + + protected abstract JPanel createCustomDetailPane(); + + protected JPanel createPredefinedSettingPane() { + return new JPanel(); + } + + protected void populate(PredefinedNameStyleProvider nameStyle) { + this.predefinedRadioBtn.setSelected(nameStyle.usePredefinedStyle()); + this.customRadioBtn.setSelected(!nameStyle.usePredefinedStyle()); + if (nameStyle.usePredefinedStyle()) { + tabbedPane.show(center, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Predefined")); + } else { + tabbedPane.show(center, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom")); + } + + } + + protected String getPredefinedStyleName() { + JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + return template.getTemplatePredefinedStyle(); + } + + /** + * 展示数据 + * + * @param ob 待展示的对象 + */ + public abstract void populateBean(T ob); + + /** + * 保存数据 + * + * @return 待保存的对象 + */ + public abstract T updateBean(); + + /** + * 保存数据 + * + * @param ob 待保存的对象 + */ + public void updateBean(T ob) { + + } + + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ReportPredefinedStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ReportPredefinedStylePane.java new file mode 100644 index 0000000000..4f2c8b6035 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ReportPredefinedStylePane.java @@ -0,0 +1,53 @@ +package com.fr.design.mainframe.predefined.ui; + +import com.fr.config.predefined.PredefinedStyle; +import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.JTemplate; + +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.FlowLayout; + +/** + * Created by kerry on 2020-08-28 + */ +public class ReportPredefinedStylePane extends BasicPane { + private PredefinedStyleSelectPane selectPane; + private JTemplate currentTemplate; + private UIButton preferenceBtn; + + public ReportPredefinedStylePane(JTemplate jTemplate, UIButton preferenceButton) { + this.currentTemplate = jTemplate; + this.preferenceBtn = preferenceButton; + initPane(); + } + + private void initPane() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + JPanel jPanel = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Style_Select")); + jPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); + JPanel subPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + this.selectPane = new PredefinedStyleSelectPane(currentTemplate.getTemplatePredefinedStyle(), false); + subPanel.add(this.selectPane, BorderLayout.CENTER); + jPanel.add(subPanel, BorderLayout.CENTER); + this.add(jPanel, BorderLayout.CENTER); + } + + public void update() { + PredefinedStyle style = selectPane.update(); + if (style != null) { + currentTemplate.resetPredefinedStyle(style.getStyleName(), preferenceBtn); + } + } + + public void refresh() { + this.selectPane.refreshPane(); + } + + @Override + protected String title4PopupWindow() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Template_Style"); + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java new file mode 100644 index 0000000000..a8f37ace35 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/ServerPredefinedStylePane.java @@ -0,0 +1,201 @@ +package com.fr.design.mainframe.predefined.ui; + + +import com.fr.base.BaseUtils; +import com.fr.config.predefined.PredefinedStyle; +import com.fr.config.predefined.PredefinedStyleConfig; +import com.fr.config.ServerPreferenceConfig; +import com.fr.design.actions.UpdateAction; +import com.fr.design.event.ChangeEvent; +import com.fr.design.event.ChangeListener; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.mainframe.predefined.PatternStyle; +import com.fr.design.dialog.BasicPane; +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.gui.itoolbar.UIToolbar; +import com.fr.design.i18n.Toolkit; +import com.fr.design.icon.IconPathConstants; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.predefined.ui.dialog.PredefinedStyleEditDialog; +import com.fr.design.menu.MenuDef; +import com.fr.design.menu.ToolBarDef; + +import javax.swing.BorderFactory; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JSeparator; +import javax.swing.SwingUtilities; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.event.ActionEvent; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; + +/** + * Created by kerry on 2020-08-25 + */ +public class ServerPredefinedStylePane extends BasicPane { + + private static final Color TIP_COLOR = Color.decode("#8F8F92"); + private RemoveAction removeAction; + + private PredefinedStyleSelectPane selectPane; + + + public ServerPredefinedStylePane() { + initPane(); + } + + private void initPane() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + JPanel jPanel = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Style_Manager")); + jPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); + jPanel.setLayout(FRGUIPaneFactory.createLeftZeroLayout()); + JPanel subPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + subPanel.add(createControlPane(), BorderLayout.NORTH); + PredefinedStyle style = ServerPreferenceConfig.getInstance().getPreferenceStyleConfig().getDefaultPredefinedStyle(); + this.selectPane = new PredefinedStyleSelectPane(style.getStyleName(), true); + this.selectPane.registerChangeListener(new ChangeListener() { + @Override + public void fireChanged(ChangeEvent event) { + PredefinedStyle selectStyle = selectPane.getSelectedPreviewPane().update(); + removeAction.setEnabled(!selectStyle.isBuiltIn()); + } + }); + this.selectPane.addMouseListener(new MouseListener() { + @Override + public void mouseClicked(MouseEvent e) { + if (selectPane.getSelectedPreviewPane() != null) { + removeAction.setEnabled(true); + } + } + + @Override + public void mousePressed(MouseEvent e) { + + } + + @Override + public void mouseReleased(MouseEvent e) { + + } + + @Override + public void mouseEntered(MouseEvent e) { + + } + + @Override + public void mouseExited(MouseEvent e) { + + } + }); + JSeparator jSeparator = new JSeparator(); + subPanel.add(jSeparator, BorderLayout.CENTER); + subPanel.add(this.selectPane, BorderLayout.SOUTH); + jPanel.add(subPanel); + this.add(jPanel, BorderLayout.CENTER); + this.repaint(); + } + + + private JPanel createControlPane() { + MenuDef addMenuDef = new MenuDef(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Add")); + addMenuDef.setIconPath(IconPathConstants.ADD_POPMENU_ICON_PATH); + createAddMenuDef(addMenuDef); + ToolBarDef toolbarDef = new ToolBarDef(); + removeAction = new RemoveAction(); + removeAction.setEnabled(false); + toolbarDef.addShortCut(addMenuDef, removeAction); + UIToolbar toolBar = ToolBarDef.createJToolBar(); + toolBar.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); + toolbarDef.updateToolBar(toolBar); + JPanel toolbarPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + toolbarPane.add(toolBar, BorderLayout.CENTER); + UILabel tipLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Style_Manager_Tip")); + tipLabel.setForeground(TIP_COLOR); + tipLabel.setHorizontalTextPosition(UILabel.RIGHT); + toolbarPane.add(tipLabel, BorderLayout.EAST); + toolbarPane.setPreferredSize(new Dimension(620, 30)); + return toolbarPane; + } + + private void createAddMenuDef(MenuDef addMenuDef) { + addMenuDef.setRePaint(true); + addMenuDef.addShortCut(new CreateStyleAction(PatternStyle.DARK_STYLE)); + addMenuDef.addShortCut(new CreateStyleAction(PatternStyle.LIGHT_STYLE)); + + } + + + public void update() { + PredefinedStyle style = selectPane.update(); + if (style != null) { + PredefinedStyleConfig config = ServerPreferenceConfig.getInstance().getPreferenceStyleConfig(); + config.setDefaultPredefinedStyle(style.getStyleName()); + ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(config); + } + + } + + + @Override + protected String title4PopupWindow() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Server_Style"); + } + + private class RemoveAction extends UpdateAction { + + public RemoveAction() { + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove")); + this.setMnemonic('R'); + this.setSmallIcon(BaseUtils.readIcon(IconPathConstants.TD_REMOVE_ICON_PATH)); + } + + @Override + public void actionPerformed(ActionEvent e) { + PredefinedStyle previewObject = ServerPredefinedStylePane.this.selectPane.update(); + int selVal = FineJOptionPane.showConfirmDialog(SwingUtilities.getWindowAncestor(ServerPredefinedStylePane.this), + Toolkit.i18nText("Fine-Design_Predefined_Remove_Style_Confirm:" + previewObject.getStyleName()) + " ?", + Toolkit.i18nText("Fine-Design_Basic_Confirm"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); + if (selVal == JOptionPane.YES_OPTION) { + removeStyle(previewObject.getStyleName()); + ServerPredefinedStylePane.this.selectPane.refreshPane(); + } + } + } + + + private class CreateStyleAction extends UpdateAction { + private PatternStyle style; + + public CreateStyleAction(PatternStyle style) { + this.style = style; + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Create_Parttern_Style") + style.getName()); + this.setMnemonic('R'); + } + + @Override + public void actionPerformed(ActionEvent e) { + createNewPatternStylePane(); + } + + private void createNewPatternStylePane() { + PredefinedStyleEditPane editPane = PredefinedStyleEditPane.createNewEditPane(selectPane); + PredefinedStyleEditDialog editDialog = new PredefinedStyleEditDialog( + SwingUtilities.getWindowAncestor(ServerPredefinedStylePane.this), editPane); + editPane.populate(style.getPredefinedStyle()); + editDialog.setVisible(true); + } + } + + + private void removeStyle(String name) { + PredefinedStyleConfig config = ServerPreferenceConfig.getInstance().getPreferenceStyleConfig(); + config.removeStyle(name); + ServerPreferenceConfig.getInstance().setPreferenceStyleConfig(config); + } + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/CellStyleSettingPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/CellStyleSettingPane.java new file mode 100644 index 0000000000..c25390513c --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/CellStyleSettingPane.java @@ -0,0 +1,234 @@ +package com.fr.design.mainframe.predefined.ui.detail; + +import com.fr.base.BaseUtils; +import com.fr.base.Style; +import com.fr.config.StyleMap; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.dialog.AttrScrollPane; +import com.fr.design.dialog.BasicScrollPane; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.icon.IconPathConstants; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.predefined.ui.PredefinedStyleEditPane; +import com.fr.design.mainframe.predefined.ui.detail.cell.CustomPredefinedStylePane; +import com.fr.report.cell.DefaultTemplateCellElement; +import com.fr.report.cell.TemplateCellElement; +import com.fr.report.core.PaintUtils; +import com.fr.stable.Constants; + +import javax.swing.DefaultListModel; +import javax.swing.JList; +import javax.swing.JPanel; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * Created by kerry on 2020-09-01 + */ +public class CellStyleSettingPane extends BasicBeanPane { + + private StyleListPane styleListPane; + private List customStylePaneList = new ArrayList<>(); + private CardLayout cardLayout; + private JPanel centerPane; + private PredefinedStyleEditPane editPane; + private CellStylePreviewPane previewPane; + + public CellStyleSettingPane(PredefinedStyleEditPane editPane) { + this.editPane = editPane; + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.add(createLeftPane(), BorderLayout.WEST); + this.add(createCenterPane(), BorderLayout.CENTER); + } + + private JPanel createLeftPane() { + JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + panel.setPreferredSize(new Dimension(80, 267)); + panel.add(createToolPane(), BorderLayout.NORTH); + panel.add(createStyleListPane(), BorderLayout.CENTER); + return panel; + } + + private JPanel createToolPane() { + JPanel panel = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); + UIButton addBtn = new UIButton(BaseUtils.readIcon(IconPathConstants.ADD_POPMENU_ICON_PATH)); + addBtn.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + styleListPane.addNewStyle(); + } + }); + addBtn.setBorderPainted(false); + panel.add(addBtn); + UIButton removeBtn = new UIButton(BaseUtils.readIcon(IconPathConstants.TD_REMOVE_ICON_PATH)); + removeBtn.setBorderPainted(false); + removeBtn.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + styleListPane.removeStyle(); + } + }); + panel.add(removeBtn); + return panel; + } + + private JPanel createStyleListPane() { + JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + jPanel.setPreferredSize(new Dimension(80, 249)); + styleListPane = new StyleListPane(); + jPanel.add(styleListPane); + return jPanel; + } + + private JPanel createCenterPane() { + JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + panel.setPreferredSize(new Dimension(230, 267)); + JPanel titlePreviewPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview")); + titlePreviewPane.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0)); + previewPane = new CellStylePreviewPane(); + previewPane.setPreferredSize(new Dimension(100, 20)); + titlePreviewPane.setPreferredSize(new Dimension(230, 45)); + titlePreviewPane.add(previewPane); + panel.add(titlePreviewPane, BorderLayout.NORTH); + cardLayout = new CardLayout(); + centerPane = new JPanel(cardLayout); + centerPane.setPreferredSize(new Dimension(226, 500)); + BasicScrollPane basicScrollPane = new AttrScrollPane() { + @Override + protected JPanel createContentPane() { + return centerPane; + } + }; + basicScrollPane.setPreferredSize(new Dimension(230, 214)); + panel.add(basicScrollPane, BorderLayout.CENTER); + + return panel; + } + + + @Override + public void populateBean(StyleMap ob) { + styleListPane.populate(ob); + } + + @Override + public StyleMap updateBean() { + return styleListPane.update(); + } + + @Override + protected String title4PopupWindow() { + return null; + } + + class StyleListPane extends JPanel { + private DefaultListModel defaultListModel; + private JList styleList; + + public StyleListPane() { + defaultListModel = new DefaultListModel(); + styleList = new JList(defaultListModel); + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.add(styleList, BorderLayout.CENTER); + + styleList.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + int selectIndex = styleList.getSelectedIndex(); + cardLayout.show(centerPane, defaultListModel.get(selectIndex).toString()); + } + }); + } + + public void populate(StyleMap ob) { + Iterator> iterator = ob.getAllStyles().entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry entry = iterator.next(); + addStyle(entry.getKey(), entry.getValue()); + + } + reset(); + } + + private void reset() { + if (defaultListModel.getSize() > 0) { + styleList.setSelectedIndex(0); + cardLayout.show(centerPane, defaultListModel.get(0).toString()); + centerPane.validate(); + + } + } + + public StyleMap update() { + StyleMap styleMap = new StyleMap(); + for (int i = 0; i < defaultListModel.getSize(); i++) { + String name = defaultListModel.get(i).toString(); + Style style = customStylePaneList.get(i).updateBean(); + styleMap.put(name, style); + } + return styleMap; + } + + public void addNewStyle() { + addStyle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Cell_New_Style"), Style.getInstance()); + } + + public void addStyle(String name, Style style) { + defaultListModel.addElement(name); + CustomPredefinedStylePane customPredefinedStylePane = new CustomPredefinedStylePane(); + customPredefinedStylePane.populateBean(style); + customPredefinedStylePane.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + previewPane.refresh(customPredefinedStylePane.updateBean()); + editPane.valueChangeAction(); + } + }); + centerPane.add(customPredefinedStylePane, name); + customStylePaneList.add(customPredefinedStylePane); + } + + public void removeStyle() { + int selectIndex = styleList.getSelectedIndex(); + defaultListModel.remove(selectIndex); + centerPane.remove(customStylePaneList.get(selectIndex)); + customStylePaneList.remove(selectIndex); + reset(); + } + } + + class CellStylePreviewPane extends JPanel { + private TemplateCellElement ce; + + public CellStylePreviewPane() { + ce = new DefaultTemplateCellElement(); + ce.setValue(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Cell_Test_Word")); + } + + public void refresh(Style style) { + this.ce.setStyle(style); + this.repaint(); + } + + @Override + public void paint(Graphics g) { + Style.paintBackground((Graphics2D) g, ce.getStyle(), this.getWidth(), this.getHeight()); + Style.paintBorder((Graphics2D) g, ce.getStyle(), this.getWidth(), this.getHeight()); + PaintUtils.paintGridCellContent((Graphics2D) g, ce, this.getWidth(), this.getHeight(), Constants.FR_PAINT_RESOLUTION); + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/ComponentStyleSettingPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/ComponentStyleSettingPane.java new file mode 100644 index 0000000000..5a7ea8502d --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/ComponentStyleSettingPane.java @@ -0,0 +1,69 @@ +package com.fr.design.mainframe.predefined.ui.detail; + +import com.fr.config.predefined.PredefinedComponentStyle; +import com.fr.design.dialog.BasicPane; +import com.fr.design.dialog.MultiTabPane; +import com.fr.design.mainframe.predefined.ui.detail.component.ComponentFrameStylePane; +import com.fr.design.mainframe.predefined.ui.detail.component.ComponentMarginStylePane; +import com.fr.design.mainframe.predefined.ui.detail.component.ComponentTitleStylePane; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by kerry on 2020-09-01 + */ +public class ComponentStyleSettingPane extends MultiTabPane { + private ComponentFrameStylePane frameStylePane; + private ComponentTitleStylePane titleStylePane; + private ComponentMarginStylePane marginStylePane; + + public ComponentStyleSettingPane() { + } + + + @Override + protected List initPaneList() { + this.frameStylePane = new ComponentFrameStylePane(); + this.titleStylePane = ComponentTitleStylePane.createPredefinedSettingPane(); + this.marginStylePane = new ComponentMarginStylePane(); + paneList = new ArrayList(); + paneList.add(this.frameStylePane); + paneList.add(this.titleStylePane); + paneList.add(this.marginStylePane); + return paneList; + } + + @Override + public void populateBean(PredefinedComponentStyle ob) { + this.frameStylePane.populate(ob); + this.titleStylePane.populate(ob); + this.marginStylePane.populate(ob); + } + + @Override + public void updateBean(PredefinedComponentStyle ob) { + + } + + + @Override + public PredefinedComponentStyle updateBean() { + PredefinedComponentStyle componentStyle = new PredefinedComponentStyle(); + this.frameStylePane.update(componentStyle); + this.titleStylePane.update(componentStyle); + this.marginStylePane.update(componentStyle); + return componentStyle; + } + + + @Override + public boolean accept(Object ob) { + return false; + } + + @Override + public void reset() { + + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/PredefinedBackgroundSettingPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/PredefinedBackgroundSettingPane.java new file mode 100644 index 0000000000..c49f09a5e6 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/PredefinedBackgroundSettingPane.java @@ -0,0 +1,84 @@ +package com.fr.design.mainframe.predefined.ui.detail; + +import com.fr.config.predefined.PredefinedBackground; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.predefined.ui.detail.background.BackgroundSettingPane; +import com.fr.design.mainframe.predefined.ui.detail.background.BackgroundWithAlphaSettingPane; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Dimension; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/** + * Created by kerry on 2020-08-31 + */ +public class PredefinedBackgroundSettingPane extends BasicBeanPane { + private UIButtonGroup buttonGroup; + private BackgroundSettingPane reportBackgroundSettingPane; + private BackgroundWithAlphaSettingPane formBackgroundSettingPane; + + + public PredefinedBackgroundSettingPane() { + initPane(); + } + + private void initPane() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + reportBackgroundSettingPane = new BackgroundSettingPane(); + UIScrollPane scrollPane = new UIScrollPane(reportBackgroundSettingPane); + scrollPane.setBorder(BorderFactory.createEmptyBorder()); + formBackgroundSettingPane = new BackgroundWithAlphaSettingPane(); + CardLayout tabbedPane = new CardLayout(); + JPanel center = new JPanel(tabbedPane); + center.add(scrollPane, "普通报表"); + center.add(formBackgroundSettingPane, "决策报表"); + center.setPreferredSize(new Dimension(243, 243)); + this.buttonGroup = new UIButtonGroup(new String[]{"普通报表", "决策报表"}); + buttonGroup.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + if (buttonGroup.getSelectedIndex() == 0) { + tabbedPane.show(center, "普通报表"); + } else { + tabbedPane.show(center, "决策报表"); + } + } + }); + + + this.add(buttonGroup, BorderLayout.NORTH); + + this.add(center, BorderLayout.CENTER); + this.buttonGroup.setSelectedIndex(0); + } + + @Override + public void populateBean(PredefinedBackground predefinedBackground) { + reportBackgroundSettingPane.populateBean(predefinedBackground.getReportBackground()); + formBackgroundSettingPane.populateBean(predefinedBackground.getFormBackground()); + } + + @Override + public PredefinedBackground updateBean() { + PredefinedBackground predefinedBackground = new PredefinedBackground(); + predefinedBackground.setReportBackground(reportBackgroundSettingPane.updateBean()); + predefinedBackground.setFormBackground(formBackgroundSettingPane.updateBean()); + return predefinedBackground; + } + + @Override + protected String title4PopupWindow() { + return "预定义背景设置"; + } + + + + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/BackgroundSettingPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/BackgroundSettingPane.java new file mode 100644 index 0000000000..2a8ee64e6c --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/BackgroundSettingPane.java @@ -0,0 +1,167 @@ +package com.fr.design.mainframe.predefined.ui.detail.background; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.style.background.BackgroundDetailPane; +import com.fr.general.Background; +import com.fr.log.FineLoggerFactory; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.util.ArrayList; +import java.util.List; + +/** + * Created by kerry on 2020-09-02 + */ +public class BackgroundSettingPane extends BasicBeanPane { + private ChangeListener changeListener = null; + private UIComboBox headCombobox; + private List paneList = new ArrayList<>(); + + public BackgroundSettingPane() { + init(); + } + + private void init() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.add(createComboHeadPane(), BorderLayout.NORTH); + CardLayout tabbedPane = new CardLayout(); + JPanel center = createCenterPane(tabbedPane); + center.setPreferredSize(BackgroundType.EMPTY_BACKGROUND.getDisplayDimension()); + headCombobox.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + BackgroundType type = BackgroundType.parse(e.getItem().toString()); + center.setPreferredSize(type.getDisplayDimension()); + tabbedPane.show(center, type.getDisplayName()); + } + }); + this.add(center, BorderLayout.CENTER); + } + + public void addChangeListener(ChangeListener changeListener) { + this.changeListener = changeListener; + } + + + private JPanel createComboHeadPane() { + headCombobox = new UIComboBox(BackgroundType.allTypes()); + headCombobox.setPreferredSize(new Dimension(160, 20)); + JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane( + new Component[][]{new Component[]{new UILabel("填充"), headCombobox}}, TableLayoutHelper.FILL_LASTCOLUMN, 33, 5); + jPanel.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10)); + return jPanel; + } + + private JPanel createCenterPane(CardLayout tabbedPane) { + JPanel centerPane = new JPanel(tabbedPane); + centerPane.add(createEmptyPane(), BackgroundType.EMPTY_BACKGROUND.getDisplayName()); + centerPane.add(createColorSelectPane(), BackgroundType.COLOR_BACKGROUND.getDisplayName()); + centerPane.add(createTextureSelectPane(), BackgroundType.TEXTURE_BACKGROUND.getDisplayName()); + centerPane.add(createPatternSelectPane(), BackgroundType.PATTERN_BACKGROUND.getDisplayName()); + centerPane.add(createImageSelectPane(), BackgroundType.IMAGE_BACKGROUND.getDisplayName()); + centerPane.add(createGradientSelectPane(), BackgroundType.GRADIENT_BACKGROUND.getDisplayName()); + return centerPane; + } + + private JPanel createEmptyPane() { + EmptyBackgroundPane emptyBackgroundPane = new EmptyBackgroundPane(); + paneList.add(emptyBackgroundPane); + return emptyBackgroundPane; + } + + + private JPanel createColorSelectPane() { + JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + ColorDetailPane colorDetailPane = new ColorDetailPane(); + paneList.add(colorDetailPane); + jPanel.add(colorDetailPane, BorderLayout.CENTER); + return jPanel; + } + + private JPanel createTextureSelectPane() { + + + TextureDetailObservePane textureDetailPane = new TextureDetailObservePane(); + textureDetailPane.setPreferredSize(new Dimension(160, 108)); + UILabel label = new UILabel("纹理"); + label.setPreferredSize(new Dimension(24, 108)); + label.setVerticalAlignment(SwingConstants.TOP); + JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane( + new Component[][]{new Component[]{label, textureDetailPane}}, TableLayoutHelper.FILL_LASTCOLUMN, 33, 5); + jPanel.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10)); + + paneList.add(textureDetailPane); + return jPanel; + } + + private JPanel createPatternSelectPane() { + JPanel jPanel = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(10, 0, 0); + PatternDetailPane patternDetailPane = PatternDetailPane.createPatternDetailPane(6); + jPanel.add(patternDetailPane, BorderLayout.CENTER); + paneList.add(patternDetailPane); + return jPanel; + } + + private JPanel createImageSelectPane() { + JPanel jPanel = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(10, 0, 0); + ImageDetailPane imageDetailPane = new ImageDetailPane(); + imageDetailPane.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + if (changeListener != null) { + changeListener.stateChanged(e); + } + } + }); + jPanel.add(imageDetailPane); + paneList.add(imageDetailPane); + return jPanel; + } + + private JPanel createGradientSelectPane() { + JPanel jPanel = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(10, 0, 0); + GradientDetailPane gradientDetailPane = new GradientDetailPane(); + jPanel.add(gradientDetailPane); + paneList.add(gradientDetailPane); + return jPanel; + } + + + @Override + public void populateBean(Background background) { + String displayType = BackgroundType.parse(background).getDisplayName(); + this.headCombobox.setSelectedItem(displayType); + int index = this.headCombobox.getSelectedIndex(); + paneList.get(index).populate(background); + } + + @Override + public Background updateBean() { + int selectIndex = this.headCombobox.getSelectedIndex(); + try { + return paneList.get(selectIndex).update(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return null; + } + + @Override + protected String title4PopupWindow() { + return null; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/BackgroundType.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/BackgroundType.java new file mode 100644 index 0000000000..0efa9eb09c --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/BackgroundType.java @@ -0,0 +1,99 @@ +package com.fr.design.mainframe.predefined.ui.detail.background; + +import com.fr.general.Background; +import com.fr.general.ComparatorUtils; +import com.fr.stable.StringUtils; + +import java.awt.Dimension; + +/** + * Created by kerry on 2020-08-31 + */ +public enum BackgroundType { + EMPTY_BACKGROUND("NullBackground", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Background_Is_Null")) { + @Override + public Dimension getDisplayDimension() { + return new Dimension(0, 0); + } + }, + COLOR_BACKGROUND("ColorBackground", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Color")) { + @Override + public Dimension getDisplayDimension() { + return new Dimension(242, 187); + } + }, + TEXTURE_BACKGROUND("TextureBackground", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Texture")) { + @Override + public Dimension getDisplayDimension() { + return new Dimension(242, 155); + } + }, + PATTERN_BACKGROUND("PatternBackground", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Pattern")) { + @Override + public Dimension getDisplayDimension() { + return new Dimension(242, 266); + } + }, + IMAGE_BACKGROUND("ImageBackground", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Image")) { + @Override + public Dimension getDisplayDimension() { + return new Dimension(242, 160); + } + }, + GRADIENT_BACKGROUND("GradientBackground", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Gradient_Color")) { + @Override + public Dimension getDisplayDimension() { + return new Dimension(242, 155); + } + }; + + private String backgroundType; + + private String displayName; + + + BackgroundType(String backgroundType, String displayName) { + this.backgroundType = backgroundType; + this.displayName = displayName; + } + + + public String getDisplayName() { + return displayName; + } + + public abstract Dimension getDisplayDimension(); + + public static String[] allTypes() { + BackgroundType[] backgroundTypes = values(); + String[] backgrounds = new String[backgroundTypes.length]; + for (int i = 0; i < backgroundTypes.length; i++) { + backgrounds[i] = backgroundTypes[i].getDisplayName(); + } + return backgrounds; + } + + public static BackgroundType parse(Background background) { + if (background == null) { + return EMPTY_BACKGROUND; + } + for (BackgroundType type : values()) { + if (ComparatorUtils.equals(background.getBackgroundType(), type.backgroundType)) { + return type; + } + } + return EMPTY_BACKGROUND; + } + + public static BackgroundType parse(String displayName) { + if (StringUtils.isEmpty(displayName)) { + return EMPTY_BACKGROUND; + } + for (BackgroundType type : values()) { + if (ComparatorUtils.equals(displayName, type.displayName)) { + return type; + } + } + return EMPTY_BACKGROUND; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/BackgroundWithAlphaSettingPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/BackgroundWithAlphaSettingPane.java new file mode 100644 index 0000000000..6c25113540 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/BackgroundWithAlphaSettingPane.java @@ -0,0 +1,78 @@ +package com.fr.design.mainframe.predefined.ui.detail.background; + +import com.fr.config.predefined.BackgroundWithAlpha; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.designer.IntervalConstants; +import com.fr.design.gui.frpane.UINumberDragPane; +import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayoutHelper; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.event.ChangeListener; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; + +/** + * Created by kerry on 2020-09-04 + */ +public class BackgroundWithAlphaSettingPane extends BasicBeanPane { + private BackgroundSettingPane backgroundSettingPane; + //透明度 + private UINumberDragPane numberDragPane; + + private double maxNumber = 100; + + + public BackgroundWithAlphaSettingPane() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + backgroundSettingPane = new BackgroundSettingPane(); + + JPanel eastpane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(2, 0); + this.numberDragPane = new UINumberDragPane(0, 100); + this.numberDragPane.setPreferredSize(new Dimension(148, 20)); + eastpane.add(numberDragPane); + eastpane.add(new UILabel("%")); + JPanel transparencyPane = TableLayoutHelper.createGapTableLayoutPane( + new Component[][]{new Component[]{new UILabel("不透明度"), eastpane}}, TableLayoutHelper.FILL_LASTCOLUMN,18, 5); + transparencyPane.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10)); + + + Component[][] components = new Component[][]{ + new Component[]{backgroundSettingPane}, + new Component[]{transparencyPane}}; + + JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W2, IntervalConstants.INTERVAL_L1); + UIScrollPane scrollPane = new UIScrollPane(panel); + scrollPane.setBorder(BorderFactory.createEmptyBorder()); + this.add(scrollPane, BorderLayout.CENTER); + } + + + public void addChangeListener(ChangeListener changeListener) { + this.backgroundSettingPane.addChangeListener(changeListener); + } + + + @Override + public void populateBean(BackgroundWithAlpha ob) { + backgroundSettingPane.populateBean(ob.getBackground()); + numberDragPane.populateBean(ob.getAlpha() * maxNumber); + } + + @Override + public BackgroundWithAlpha updateBean() { + BackgroundWithAlpha backgroundWithAlpha = new BackgroundWithAlpha(); + backgroundWithAlpha.setBackground(backgroundSettingPane.updateBean()); + backgroundWithAlpha.setAlpha((float)(numberDragPane.updateBean()/maxNumber)); + return backgroundWithAlpha; + } + + @Override + protected String title4PopupWindow() { + return null; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/ColorDetailPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/ColorDetailPane.java new file mode 100644 index 0000000000..9d1fc69240 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/ColorDetailPane.java @@ -0,0 +1,102 @@ +package com.fr.design.mainframe.predefined.ui.detail.background; + +import com.fr.base.background.ColorBackground; +import com.fr.design.event.UIObserver; +import com.fr.design.event.UIObserverListener; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.style.background.BackgroundDetailPane; +import com.fr.design.style.color.ColorSelectPane; +import com.fr.general.Background; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; + +/** + * Created by kerry on 2020-08-31 + */ +public class ColorDetailPane extends BackgroundDetailPane { + private ColorBackgroundSelectPane selectPane; + + + public ColorDetailPane() { + this.selectPane = new ColorBackgroundSelectPane(); + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.add(this.selectPane, BorderLayout.CENTER); + } + + @Override + public void populate(Background background) { + if (background instanceof ColorBackground) { + this.selectPane.setColor(((ColorBackground) background).getColor()); + } + } + + @Override + public Background update() { + return ColorBackground.getInstance(selectPane.getColor()); + } + + @Override + public void addChangeListener(ChangeListener changeListener) { + + } + + + class ColorBackgroundSelectPane extends ColorSelectPane implements UIObserver { + protected UIObserverListener uiObserverListener; + + protected void initialCompents(boolean isSupportTransparent) { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.setBorder(BorderFactory.createEmptyBorder()); + if (isSupportTransparent) { + this.add(createNorthPane(), BorderLayout.NORTH); + } + JPanel centerPane = createCenterPane(); + this.add(centerPane, BorderLayout.CENTER); + this.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + if (uiObserverListener != null) { + uiObserverListener.doChange(); + } + } + }); + } + + private JPanel createNorthPane() { + UIButton transpanrentBtn = createTranspanrentButton(); + transpanrentBtn.setPreferredSize(new Dimension(160, 20)); + JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane( + new Component[][]{new Component[]{new UILabel("颜色"), transpanrentBtn}}, TableLayoutHelper.FILL_LASTCOLUMN, 33, 5); + jPanel.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10)); + return jPanel; + } + + protected JPanel createCenterPane() { + JPanel centerPane = super.createCenterPane(); + + JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane( + new Component[][]{new Component[]{new UILabel(" "), centerPane}}, TableLayoutHelper.FILL_LASTCOLUMN, 33, 5); + jPanel.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10)); + return jPanel; + } + + @Override + public void registerChangeListener(UIObserverListener listener) { + this.uiObserverListener = listener; + } + + @Override + public boolean shouldResponseChangeListener() { + return true; + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/EmptyBackgroundPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/EmptyBackgroundPane.java new file mode 100644 index 0000000000..300a1e6e51 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/EmptyBackgroundPane.java @@ -0,0 +1,27 @@ +package com.fr.design.mainframe.predefined.ui.detail.background; + +import com.fr.design.style.background.BackgroundDetailPane; +import com.fr.general.Background; + +import javax.swing.event.ChangeListener; + +/** + * Created by kerry on 2020-09-01 + */ +public class EmptyBackgroundPane extends BackgroundDetailPane { + + @Override + public void populate(Background background) { + + } + + @Override + public Background update() { + return null; + } + + @Override + public void addChangeListener(ChangeListener changeListener) { + + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/GradientDetailPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/GradientDetailPane.java new file mode 100644 index 0000000000..1a6b60b74a --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/GradientDetailPane.java @@ -0,0 +1,147 @@ +package com.fr.design.mainframe.predefined.ui.detail.background; + +import com.fr.base.background.GradientBackground; +import com.fr.design.designer.IntervalConstants; +import com.fr.design.event.UIObserver; +import com.fr.design.event.UIObserverListener; +import com.fr.design.gui.ibutton.UIRadioButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.style.background.BackgroundDetailPane; +import com.fr.design.style.background.gradient.GradientBar; +import com.fr.general.Background; +import javax.swing.ButtonGroup; +import javax.swing.JPanel; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/** + * 渐变色的面板,不是很pp,面板应用显得繁琐,有写可以写成控件类型,比如色彩选择的。。,可以做得花哨点 + * + * @author ben + */ +public class GradientDetailPane extends BackgroundDetailPane implements UIObserver { + private static final long serialVersionUID = -6854603990673031897L; + private UIObserverListener listener; + private UIRadioButton left2right, top2bottom; + private GradientBar gradientBar; + private ChangeListener changeListener = null; + + public GradientDetailPane() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + JPanel gradientPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + JPanel blankJp = new JPanel(); + gradientBar = new GradientBar(4, 141); + blankJp.add(gradientBar); + + gradientPanel.add(gradientBar, BorderLayout.SOUTH); + + JPanel jp = new JPanel(new GridLayout(2, 1, 15, 10)); + + + left2right = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Page_Setup_Horizontal")); + jp.add(left2right); + left2right.setSelected(true); + left2right.addActionListener(reviewListener); + + top2bottom = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Page_Setup_Vertical")); + jp.add(top2bottom); + top2bottom.addActionListener(reviewListener); + + ButtonGroup toggle = new ButtonGroup(); + toggle.add(left2right); + toggle.add(top2bottom); + + Component[][] components = new Component[][]{ + new Component[]{new UILabel("渐变色设置"), gradientPanel}, + new Component[]{new UILabel("渐变方向"), jp} + }; + JPanel contentPane = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W4, IntervalConstants.INTERVAL_L1); + this.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + if (listener != null) { + listener.doChange(); + } + } + }); + this.add(contentPane); + } + + + public void populate(Background background) { + if (!(background instanceof GradientBackground)) { + return; + } + GradientBackground bg = (GradientBackground) background; + this.gradientBar.getSelectColorPointBtnP1().setColorInner(bg.getStartColor()); + this.gradientBar.getSelectColorPointBtnP2().setColorInner(bg.getEndColor()); + if (bg.getDirection() == GradientBackground.LEFT2RIGHT) { + left2right.setSelected(true); + } else { + top2bottom.setSelected(true); + } + if (bg.isUseCell()) { + return; + } + double startValue = (double) bg.getBeginPlace(); + double endValue = (double) bg.getFinishPlace(); + gradientBar.setStartValue(startValue); + gradientBar.setEndValue(endValue); + this.gradientBar.repaint(); + } + + public GradientBackground update() { + GradientBackground gb = new GradientBackground( + gradientBar.getSelectColorPointBtnP1().getColorInner(), + gradientBar.getSelectColorPointBtnP2().getColorInner()); + if (left2right.isSelected()) { + gb.setDirection(GradientBackground.LEFT2RIGHT); + } else { + gb.setDirection(GradientBackground.TOP2BOTTOM); + } + if (gradientBar.isOriginalPlace()) { + gb.setUseCell(true); + } else { + gb.setUseCell(false); + gb.setBeginPlace((float) gradientBar.getStartValue()); + gb.setFinishPlace((float) gradientBar.getEndValue()); + } + return gb; + } + + + ActionListener reviewListener = new ActionListener() { + public void actionPerformed(ActionEvent e) { + fireChagneListener(); + } + }; + + public void addChangeListener(ChangeListener changeListener) { + this.changeListener = changeListener; + gradientBar.addChangeListener(changeListener); + } + + public void fireChagneListener() { + if (this.changeListener != null) { + ChangeEvent evt = new ChangeEvent(this); + this.changeListener.stateChanged(evt); + } + } + + @Override + public void registerChangeListener(UIObserverListener listener) { + this.listener = listener; + } + + @Override + public boolean shouldResponseChangeListener() { + return true; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/ImageDetailPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/ImageDetailPane.java new file mode 100644 index 0000000000..7c6f0458d7 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/ImageDetailPane.java @@ -0,0 +1,190 @@ +package com.fr.design.mainframe.predefined.ui.detail.background; + +import com.fr.base.Style; +import com.fr.base.background.ImageBackground; +import com.fr.base.background.ImageFileBackground; +import com.fr.design.designer.IntervalConstants; +import com.fr.design.gui.frpane.ImgChooseWrapper; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ibutton.UIRadioButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.style.background.BackgroundDetailPane; +import com.fr.design.style.background.image.ImageFileChooser; +import com.fr.design.style.background.image.ImagePreviewPane; +import com.fr.general.Background; +import com.fr.stable.Constants; + +import javax.swing.BorderFactory; +import javax.swing.ButtonGroup; +import javax.swing.JPanel; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/** + * Image background pane. + */ +public class ImageDetailPane extends BackgroundDetailPane { + + protected ImagePreviewPane previewPane = null; + private Style imageStyle = null; + private ChangeListener changeListener = null; + private ImageFileChooser imageFileChooser = null; + + private UIRadioButton defaultRadioButton = null; + private UIRadioButton tiledRadioButton = null; + private UIRadioButton extendRadioButton = null; + private UIRadioButton adjustRadioButton = null; + + + public ImageDetailPane() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.add(initSelectFilePane(), BorderLayout.CENTER); + imageFileChooser = new ImageFileChooser(); + imageFileChooser.setMultiSelectionEnabled(false); + previewPane = new ImagePreviewPane(); + } + + public JPanel initSelectFilePane() { + JPanel selectFilePane = FRGUIPaneFactory.createBorderLayout_L_Pane(); + selectFilePane.setBorder(BorderFactory.createEmptyBorder()); + UIButton selectPictureButton = new UIButton( + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Image_Select")); + selectPictureButton.setMnemonic('S'); + selectPictureButton.addActionListener(selectPictureActionListener); + selectPictureButton.setPreferredSize(new Dimension(160, 20)); + //布局 + defaultRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Layout_Default")); + tiledRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Layout_Image_Titled")); + extendRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Layout_Image_Extend")); + adjustRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Layout_Image_Adjust")); + + defaultRadioButton.addActionListener(layoutActionListener); + tiledRadioButton.addActionListener(layoutActionListener); + extendRadioButton.addActionListener(layoutActionListener); + adjustRadioButton.addActionListener(layoutActionListener); + + JPanel jp = new JPanel(new GridLayout(4, 1, 15, 10)); + for (UIRadioButton button : imageLayoutButtons()) { + jp.add(button); + } + + ButtonGroup layoutBG = new ButtonGroup(); + layoutBG.add(defaultRadioButton); + layoutBG.add(tiledRadioButton); + layoutBG.add(extendRadioButton); + layoutBG.add(adjustRadioButton); + + defaultRadioButton.setSelected(true); + + Component[][] components = new Component[][]{ + new Component[]{new UILabel("图片"), selectPictureButton}, + new Component[]{new UILabel("填充方式"), jp} + }; + JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W4, IntervalConstants.INTERVAL_L1); + selectFilePane.add(centerPane, BorderLayout.CENTER); + return selectFilePane; + } + + protected UIRadioButton[] imageLayoutButtons() { + return new UIRadioButton[]{ + defaultRadioButton, + tiledRadioButton, + extendRadioButton, + adjustRadioButton + }; + } + + /** + * Select picture. + */ + ActionListener selectPictureActionListener = new ActionListener() { + + public void actionPerformed(ActionEvent evt) { + int returnVal = imageFileChooser.showOpenDialog(ImageDetailPane.this); + setImageStyle(); + ImgChooseWrapper.getInstance(previewPane, imageFileChooser, imageStyle, changeListener).dealWithImageFile(returnVal); + } + }; + + protected void setImageStyle() { + if (tiledRadioButton.isSelected()) { + imageStyle = Style.DEFAULT_STYLE.deriveImageLayout(Constants.IMAGE_TILED); + } else if (adjustRadioButton.isSelected()) { + imageStyle = Style.DEFAULT_STYLE.deriveImageLayout(Constants.IMAGE_ADJUST); + } else if (extendRadioButton.isSelected()) { + imageStyle = Style.DEFAULT_STYLE.deriveImageLayout(Constants.IMAGE_EXTEND); + } else { + imageStyle = Style.DEFAULT_STYLE.deriveImageLayout(Constants.IMAGE_CENTER); + } + } + + ActionListener layoutActionListener = new ActionListener() { + + @Override + public void actionPerformed(ActionEvent evt) { + setImageStyle(); + changeImageStyle(); + } + + private void changeImageStyle() { + previewPane.setImageStyle(ImageDetailPane.this.imageStyle); + previewPane.repaint(); + } + }; + + @Override + public void populate(Background background) { + + if (background instanceof ImageBackground) { + ImageBackground imageBackground = (ImageBackground) background; + + if (imageBackground.getLayout() == Constants.IMAGE_CENTER) { + defaultRadioButton.setSelected(true); + imageStyle = Style.DEFAULT_STYLE.deriveImageLayout(Constants.IMAGE_CENTER); + } else if (imageBackground.getLayout() == Constants.IMAGE_EXTEND) { + extendRadioButton.setSelected(true); + imageStyle = Style.DEFAULT_STYLE.deriveImageLayout(Constants.IMAGE_EXTEND); + } else if (imageBackground.getLayout() == Constants.IMAGE_ADJUST) { + adjustRadioButton.setSelected(true); + imageStyle = Style.DEFAULT_STYLE.deriveImageLayout(Constants.IMAGE_ADJUST); + } else { + tiledRadioButton.setSelected(true); + imageStyle = Style.DEFAULT_STYLE.deriveImageLayout(Constants.IMAGE_TILED); + } + + } else { + tiledRadioButton.setSelected(true); + } + + fireChagneListener(); + } + + @Override + public Background update() { + ImageBackground imageBackground = new ImageFileBackground(previewPane.getImageWithSuffix()); + setImageStyle(); + imageBackground.setLayout(imageStyle.getImageLayout()); + return imageBackground; + } + + @Override + public void addChangeListener(ChangeListener changeListener) { + this.changeListener = changeListener; + } + + private void fireChagneListener() { + if (this.changeListener != null) { + ChangeEvent evt = new ChangeEvent(this); + this.changeListener.stateChanged(evt); + } + } + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/PatternDetailPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/PatternDetailPane.java new file mode 100644 index 0000000000..4b79fd4f40 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/PatternDetailPane.java @@ -0,0 +1,93 @@ +package com.fr.design.mainframe.predefined.ui.detail.background; + +import com.fr.design.designer.IntervalConstants; +import com.fr.design.dialog.AttrScrollPane; +import com.fr.design.dialog.BasicScrollPane; +import com.fr.design.event.UIObserver; +import com.fr.design.event.UIObserverListener; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.style.background.impl.PatternBackgroundPane; +import com.fr.design.style.color.ColorSelectBox; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +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.GridLayout; +import java.awt.LayoutManager; + +/** + * Created by kerry on 2020-08-31 + */ +public class PatternDetailPane extends PatternBackgroundPane implements UIObserver { + + private UIObserverListener listener; + + private PatternDetailPane(int nColumn) { + super(nColumn); + } + + public static PatternDetailPane createPatternDetailPane(int nColumn) { + return new PatternDetailPane(nColumn); + } + + protected LayoutManager layoutOfTypePane(int nColumn) { + return new GridLayout(0, nColumn, 2, 2); + } + + protected void initComponents(int nColumn) { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.setBorder(BorderFactory.createEmptyBorder()); + JPanel jPanel = new JPanel(); + jPanel.setLayout(layoutOfTypePane(nColumn)); + setChildrenOfTypePane(jPanel); + + foregroundColorPane = new ColorSelectBox(80); + backgroundColorPane = new ColorSelectBox(80); + foregroundColorPane.setSelectObject(Color.lightGray); + backgroundColorPane.setSelectObject(Color.black); + UILabel label = new UILabel("图案"); + label.setVerticalAlignment(SwingConstants.TOP); + Component[][] components = new Component[][]{ + new Component[]{label, jPanel}, + new Component[]{new UILabel("前景颜色"), foregroundColorPane}, + new Component[]{new UILabel("背景颜色"), backgroundColorPane} + }; + JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W4, IntervalConstants.INTERVAL_L1); + JPanel jPanel1 = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); + jPanel1.add(centerPane); + BasicScrollPane basicScrollPane = new AttrScrollPane() { + @Override + protected JPanel createContentPane() { + return jPanel1; + } + }; + jPanel1.setBorder(BorderFactory.createEmptyBorder()); + this.add(basicScrollPane, BorderLayout.NORTH); + this.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + if (listener != null) { + listener.doChange(); + } + } + }); + } + + + @Override + public void registerChangeListener(UIObserverListener listener) { + this.listener = listener; + } + + @Override + public boolean shouldResponseChangeListener() { + return true; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/TextureDetailObservePane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/TextureDetailObservePane.java new file mode 100644 index 0000000000..df2879ee62 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/background/TextureDetailObservePane.java @@ -0,0 +1,60 @@ +package com.fr.design.mainframe.predefined.ui.detail.background; + +import com.fr.design.event.UIObserver; +import com.fr.design.event.UIObserverListener; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.style.background.BackgroundDetailPane; +import com.fr.design.style.background.texture.TextureDetailPane; +import com.fr.general.Background; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.BorderLayout; + +/** + * Created by kerry on 2020-09-02 + */ +public class TextureDetailObservePane extends BackgroundDetailPane implements UIObserver { + private TextureDetailPane detailPane; + + private UIObserverListener listener; + + public TextureDetailObservePane() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + detailPane = TextureDetailPane.createMiniTextureDetailPane(6); + detailPane.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + if (listener != null) { + listener.doChange(); + } + } + }); + this.add(detailPane, BorderLayout.CENTER); + } + + @Override + public void registerChangeListener(UIObserverListener listener) { + this.listener = listener; + + } + + @Override + public boolean shouldResponseChangeListener() { + return true; + } + + @Override + public void populate(Background background) { + this.detailPane.populate(background); + } + + @Override + public Background update() throws Exception { + return this.detailPane.update(); + } + + @Override + public void addChangeListener(ChangeListener changeListener) { + + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/cell/CustomPredefinedStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/cell/CustomPredefinedStylePane.java new file mode 100644 index 0000000000..4e1ea31243 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/cell/CustomPredefinedStylePane.java @@ -0,0 +1,129 @@ +package com.fr.design.mainframe.predefined.ui.detail.cell; + +import com.fr.base.Style; +import com.fr.design.constants.UIConstants; +import com.fr.design.dialog.BasicPane; +import com.fr.design.dialog.MultiTabPane; +import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; +import com.fr.design.gui.frpane.AttributeChangeListener; +import com.fr.design.gui.style.AbstractBasicStylePane; +import com.fr.design.gui.style.AlignmentPane; +import com.fr.design.gui.style.BorderPane; +import com.fr.design.gui.style.FormatPane; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.event.ChangeListener; +import java.awt.BorderLayout; +import java.awt.GridLayout; +import java.util.ArrayList; +import java.util.List; + + +/** + * 哎,复杂的原型图导致复杂的画法。非我所愿也 + * + * @author zhou + * @since 2012-5-24上午10:36:10 + */ +public class CustomPredefinedStylePane extends MultiTabPane