From 458e4397df1a642ceae7e29e110c3dcec421a87d Mon Sep 17 00:00:00 2001 From: Tommy Date: Fri, 17 Dec 2021 14:09:09 +0800 Subject: [PATCH 01/10] =?UTF-8?q?REPORT-64172=20=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E7=BB=84=E4=BB=B6=E5=B0=81=E9=9D=A2=E5=9B=BE?= =?UTF-8?q?=E7=BB=98=E5=88=B6=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/share/action/CreateComponentAction.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java b/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java index d1923c1dfe..486eb2d18e 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java @@ -273,9 +273,9 @@ public class CreateComponentAction extends UpdateAction { XChartEditor chartEditor = (XChartEditor) body; Dimension size = chartEditor.getSize(); BufferedImage chartImage = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_ARGB); - Insets margin = chartEditor.getInsets();; + Insets margin = chartEditor.getInsets(); chartEditor.getDesignerEditor().paintEditor(chartImage.getGraphics(), size, margin); - im.getGraphics().drawImage(chartImage, 0, chartEditor.getY(), null); + im.getGraphics().drawImage(chartImage, chartEditor.getX(), chartEditor.getY(), null); } } return im; From 552dfaa581657706697f17e8fb636e1dac0de726 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Fri, 17 Dec 2021 15:17:36 +0800 Subject: [PATCH 02/10] =?UTF-8?q?REPORT-62834=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E6=94=AF=E6=8C=81=E6=8E=A7=E4=BB=B6=E4=B8=8D?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E8=87=AA=E5=AE=9A=E4=B9=89=E5=80=BC=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/frpane/TreeSettingPane.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/TreeSettingPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/TreeSettingPane.java index ba75cce9df..db453c99f4 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/TreeSettingPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/TreeSettingPane.java @@ -127,7 +127,7 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI { buildBox.setSelectedIndex(1); TableDataDictionary dictionary = treeEditor.getDictionary(); autoBuildPane.populate(dictionary); - } else if (treeEditor.isLayerBuild()) { + } else if (treeEditor.isFastLayerBuild()) { buildBox.setSelectedIndex(0); java.util.List layerConfigList = treeEditor.getLayerConfigs(); LayerConfig[] layerConfigs = new LayerConfig[layerConfigList.size()]; @@ -156,12 +156,12 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI { if (buildBox.getSelectedIndex() == 1) { TableDataDictionary dictionary = this.autoBuildPane.update(); te.setAutoBuild(true); - te.setLayerBuild(false); + te.setFastLayerBuild(false); te.setDictionary(dictionary); te.setNodeOrDict(dictionary); } else if (buildBox.getSelectedIndex() == 2) { te.setAutoBuild(false); - te.setLayerBuild(false); + te.setFastLayerBuild(false); NameObject no = this.controlPane.update(); if (no != null) { TreeEditor editor = (TreeEditor) no.getObject(); @@ -181,7 +181,7 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI { } else { LayerConfig[] configs = (LayerConfig[]) layerDataControlPane.update().getObject(); te.setAutoBuild(false); - te.setLayerBuild(true); + te.setFastLayerBuild(true); te.setLayerConfigs(Arrays.asList(configs)); } return te; @@ -215,12 +215,12 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI { if (buildBox.getSelectedIndex() == 1) { TableDataDictionary dictionary = this.autoBuildPane.update(); tcb.setAutoBuild(true); - tcb.setLayerBuild(false); + tcb.setFastLayerBuild(false); tcb.setDictionary(dictionary); tcb.setNodeOrDict(dictionary); } else if (buildBox.getSelectedIndex() == 2) { tcb.setAutoBuild(false); - tcb.setLayerBuild(false); + tcb.setFastLayerBuild(false); NameObject no = this.controlPane.update(); if (no != null) { if (no.getObject() instanceof TreeComboBoxEditor) { @@ -244,7 +244,7 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI { }else { LayerConfig[] configs = (LayerConfig[]) layerDataControlPane.update().getObject(); tcb.setAutoBuild(false); - tcb.setLayerBuild(true); + tcb.setFastLayerBuild(true); tcb.setLayerConfigs(Arrays.asList(configs)); } return tcb; From 2c9290863a4df9a49ee4d6823a7b12e991d6f117 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 21 Dec 2021 10:17:11 +0800 Subject: [PATCH 03/10] =?UTF-8?q?REPORT-64486=20=E8=A7=86=E8=A7=89?= =?UTF-8?q?=E9=AA=8C=E6=94=B6-=E8=BF=9C=E7=A8=8B=E6=A8=A1=E7=89=88?= =?UTF-8?q?=E9=94=81=E5=AE=9A=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/lock/LockInfoDialog.java | 32 ++++++++++++------- .../DesignerFrameFileDealerPane.java | 7 ++-- .../fr/design/mainframe/ForbiddenPane.java | 22 +++++++++---- .../worker/save/SaveFailureHandler.java | 7 ++-- 4 files changed, 44 insertions(+), 24 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/lock/LockInfoDialog.java b/designer-base/src/main/java/com/fr/design/lock/LockInfoDialog.java index 21e4db5aaf..71c9549248 100644 --- a/designer-base/src/main/java/com/fr/design/lock/LockInfoDialog.java +++ b/designer-base/src/main/java/com/fr/design/lock/LockInfoDialog.java @@ -6,10 +6,12 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.design.utils.TemplateUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.file.FileNodeFILE; import com.fr.file.filetree.FileNode; +import com.fr.general.IOUtils; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.project.ProjectConstants; @@ -24,7 +26,6 @@ import java.time.format.DateTimeFormatter; import javax.swing.BorderFactory; import javax.swing.JDialog; import javax.swing.JPanel; -import javax.swing.UIManager; /** * @author hades @@ -39,13 +40,11 @@ public class LockInfoDialog extends JDialog { super(DesignerContext.getDesignerFrame()); JPanel panel = new JPanel(new BorderLayout()); panel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); - UILabel iconLabel = new UILabel(UIManager.getIcon("OptionPane.warningIcon")); - panel.add(iconLabel, BorderLayout.WEST); panel.add(createContentPane(userInfo), BorderLayout.CENTER); panel.add(createControlPane(), BorderLayout.SOUTH); this.getContentPane().add(panel); - this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Alert")); - this.setSize(400, 180); + this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Title_Hint")); + this.setSize(400, 160); this.setResizable(false); this.setModal(true); GUICoreUtils.centerWindow(this); @@ -54,12 +53,21 @@ public class LockInfoDialog extends JDialog { private JPanel createContentPane(UserInfo userInfo) { JPanel contentPanel = new JPanel(new BorderLayout()); - contentPanel.setBorder(BorderFactory.createEmptyBorder(15, 0, 0, 0)); - contentPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_Template_Lock_And_SaveAs_Tip")), BorderLayout.NORTH); + contentPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); + JPanel messagePane = new JPanel(new BorderLayout(13, 0)); + UILabel iconLabel = new UILabel(IOUtils.readIcon("/com/fr/design/images/warnings/warning32.png")); + iconLabel.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); + messagePane.add(iconLabel, BorderLayout.WEST); + UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine-Design_Template_Lock_And_SaveAs_Tip")); + tipLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + messagePane.add(tipLabel, BorderLayout.CENTER); + contentPanel.add(messagePane, BorderLayout.NORTH); JPanel detailInfoPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); - detailInfoPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 0,0)); + detailInfoPane.setBorder(BorderFactory.createEmptyBorder(0, 45, 0,0)); if (userInfo != null && StringUtils.isNotEmpty(userInfo.getUserName())) { - detailInfoPane.add(createLabel(Toolkit.i18nText("Fine-Design_Template_Lock_Holder", userInfo.getUserName()))); + UILabel label = createLabel(Toolkit.i18nText("Fine-Design_Template_Lock_Holder", userInfo.getUserName())); + label .setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + detailInfoPane.add(label); } if (userInfo != null && StringUtils.isNotEmpty(userInfo.getIp())) { detailInfoPane.add(createLabel(Toolkit.i18nText("Fine-Design_Template_Lock_Holder_Ip", userInfo.getIp()) )); @@ -72,12 +80,13 @@ public class LockInfoDialog extends JDialog { private UILabel createLabel(String text) { UILabel label = new UILabel(text); label.setForeground(Color.GRAY); - label.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); + label.setBorder(BorderFactory.createEmptyBorder(8, 0, 0, 0)); return label; } private JPanel createControlPane() { - JPanel controlPane = new JPanel(new FlowLayout(FlowLayout.RIGHT)); + JPanel controlPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, 10, 5)); + controlPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0,5)); UIButton saveAsButton = new UIButton(Toolkit.i18nText("Fine_Design_Template_Lock_Save_As")); UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Button_Cancel")); saveAsButton.addActionListener(new ActionListener() { @@ -105,6 +114,7 @@ public class LockInfoDialog extends JDialog { public static void show(UserInfo userInfo) { + DesignerFrameFileDealerPane.getInstance().refreshRightToolBarBy(TemplateTreePane.getInstance().getFileNode()); new LockInfoDialog(userInfo); } 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 bcda18bb68..2b7a321a82 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 @@ -63,7 +63,6 @@ import javax.swing.JDialog; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.SwingConstants; -import javax.swing.UIManager; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import java.awt.BorderLayout; @@ -198,7 +197,9 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt rightToolBar = new UIToolbar(FlowLayout.RIGHT); rightToolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.TOOLBAR_BORDER_COLOR)); rightToolBar.setBorderPainted(true); - rightToolBar.add(new UILabel(Toolkit.i18nText("Fine_Design_Template_Lock_Status"))); + UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine_Design_Template_Lock_Status")); + tipLabel.setForeground(Color.GRAY); + rightToolBar.add(tipLabel); UIButton button = new UIButton(IOUtils.readIcon("/com/fr/design/images/toolbarbtn/lock.png")); button.setRolloverIcon(IOUtils.readIcon("/com/fr/design/images/toolbarbtn/unlock.png")); button.setBorderPainted(false); @@ -213,7 +214,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt Toolkit.i18nText("Fine-Design_Basic_Alert"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, - UIManager.getIcon("OptionPane.warningIcon"), + IOUtils.readIcon("/com/fr/design/images/warnings/warning32.png"), new Object[] {Toolkit.i18nText("Fine_Design_Template_UnLock_I_Known"), Toolkit.i18nText("Fine-Design_Basic_Button_Cancel")}, null); if (option == JOptionPane.YES_OPTION) { String path = StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, TemplateTreePane.getInstance().getTemplateFileTree().getSelectedTemplatePath()); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/ForbiddenPane.java b/designer-base/src/main/java/com/fr/design/mainframe/ForbiddenPane.java index 37f0745030..f903912115 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/ForbiddenPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/ForbiddenPane.java @@ -14,8 +14,11 @@ import java.awt.Color; import java.awt.Component; import java.awt.Container; import java.awt.Dimension; +import java.awt.Font; import java.awt.Graphics; +import java.awt.Graphics2D; import java.awt.LayoutManager; +import java.awt.RenderingHints; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.ImageIcon; @@ -37,6 +40,7 @@ public class ForbiddenPane extends JPanel { private static final Color BUTTON_COLOR = new Color(63, 155, 249); private static final int Y_GAP = 10; private static final int X_GAP = 10; + private static final int ARC = 4; private final UILabel lockLabel; private final UILabel tipLabel; @@ -71,11 +75,11 @@ public class ForbiddenPane extends JPanel { int tipLabelWidth = tipLabel.getPreferredSize().width; int tipLabelHeight = tipLabel.getPreferredSize().height; int tipLabelX = (width - tipLabelWidth) / 2 + X_GAP; - int tipLabelY = lockLabelY + lockLabelHeight - Y_GAP; + int tipLabelY = lockLabelY + lockLabelHeight; int refreshButtonWidth = refreshButton.getPreferredSize().width; int refreshButtonHeight = refreshButton.getPreferredSize().height; int refreshButtonX = (width - refreshButtonWidth) / 2 + X_GAP; - int refreshButtonY = tipLabelY + refreshButtonHeight; + int refreshButtonY = tipLabelY + refreshButtonHeight + Y_GAP; lockLabel.setBounds(lockLabelX, lockLabelY, lockLabelWidth, lockLabelHeight); tipLabel.setBounds(tipLabelX, tipLabelY, tipLabelWidth, tipLabelHeight); refreshButton.setBounds(refreshButtonX, refreshButtonY, refreshButtonWidth, refreshButtonHeight); @@ -88,16 +92,20 @@ public class ForbiddenPane extends JPanel { setBackground(Color.WHITE); lockLabel = new UILabel(LOCK_ICON); tipLabel = new UILabel(Toolkit.i18nText("Fine_Design_Template_Has_Been_Locked_Tip")); + Font labelFont = tipLabel.getFont(); + tipLabel.setFont(new Font(labelFont.getName(), labelFont.getStyle(), 14)); tipLabel.setForeground(TIP_COLOR); refreshButton = new JButton(Toolkit.i18nText("Fine-Design_Basic_Refresh")) { @Override - public void paintComponent(Graphics g) - { - g.setColor(BUTTON_COLOR); - g.fillRect(0, 0, getSize().width, getSize().height); - super.paintComponent(g); + public void paintComponent(Graphics g) { + Graphics2D g2d = (Graphics2D) g; + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + g2d.setColor(BUTTON_COLOR); + g2d.fillRoundRect(0, 0, getWidth(), getHeight(), ARC, ARC); + super.paintComponent(g2d); } }; + refreshButton.setPreferredSize(new Dimension(68, 24)); refreshButton.setForeground(Color.WHITE); refreshButton.setBorderPainted(false); refreshButton.setContentAreaFilled(false); diff --git a/designer-base/src/main/java/com/fr/design/worker/save/SaveFailureHandler.java b/designer-base/src/main/java/com/fr/design/worker/save/SaveFailureHandler.java index 9eb4833b58..4cf2af431a 100644 --- a/designer-base/src/main/java/com/fr/design/worker/save/SaveFailureHandler.java +++ b/designer-base/src/main/java/com/fr/design/worker/save/SaveFailureHandler.java @@ -9,12 +9,12 @@ import com.fr.design.mainframe.JTemplate; import com.fr.design.utils.TemplateUtils; import com.fr.file.FileNodeFILE; import com.fr.file.filetree.FileNode; +import com.fr.general.IOUtils; import com.fr.report.UnLockedException; import com.fr.workspace.exception.DiskSpaceFullException; import com.fr.report.InconsistentLockException; import java.awt.Frame; import javax.swing.JOptionPane; -import javax.swing.UIManager; /** * @author hades @@ -50,7 +50,8 @@ public class SaveFailureHandler implements ThrowableHandler { FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine_Design_Template_Save_Failed_By_Full_Disk"), Toolkit.i18nText("Fine-Design_Basic_Alert"), - JOptionPane.WARNING_MESSAGE); + JOptionPane.WARNING_MESSAGE, + IOUtils.readIcon("/com/fr/design/images/warnings/warning32.png")); return true; } return false; @@ -98,7 +99,7 @@ public class SaveFailureHandler implements ThrowableHandler { Toolkit.i18nText("Fine-Design_Basic_Alert"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, - UIManager.getIcon("OptionPane.warningIcon"), + IOUtils.readIcon("/com/fr/design/images/warnings/warning32.png"), new Object[] {Toolkit.i18nText("Fine_Design_Template_SaveAs_Backup"), Toolkit.i18nText("Fine-Design_Basic_Button_Cancel")}, null); if (option == JOptionPane.YES_OPTION) { JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); From ab1247612d8282e5588abfc7f5f0613bbcd3dc4f Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 21 Dec 2021 10:31:15 +0800 Subject: [PATCH 04/10] =?UTF-8?q?REPORT-64581=20=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E4=B8=8B=E5=86=85=E7=BD=AE=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E6=9C=AA=E5=90=AF=E5=8A=A8=E6=97=B6=20=E5=8F=8C?= =?UTF-8?q?=E5=87=BB=E6=89=93=E4=B8=8D=E5=BC=80=E7=9B=AE=E5=BD=95=E6=A0=91?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/file/TemplateTreePane.java | 3 ++- .../src/main/java/com/fr/design/lock/LockInfoUtils.java | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java index ddf806f026..707309a481 100644 --- a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java +++ b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java @@ -231,7 +231,8 @@ public class TemplateTreePane extends JPanel implements FileOperations { return; } String lock = node.getLock(); - boolean showLockInfo = LockInfoUtils.isCompatibleOperator() ? (lock != null && !lock.equals(node.getUserID())) + boolean showLockInfo = LockInfoUtils.isCompatibleOperator() || LockInfoUtils.unableGetLockInfo() + ? (lock != null && !lock.equals(node.getUserID())) : WorkContext.getCurrent().get(LockInfoOperator.class).isTplLocked(selectedFilePath); if (showLockInfo) { UserInfo userInfo = WorkContext.getCurrent().get(LockInfoOperator.class).getUserInfo(selectedFilePath); diff --git a/designer-base/src/main/java/com/fr/design/lock/LockInfoUtils.java b/designer-base/src/main/java/com/fr/design/lock/LockInfoUtils.java index ce8c493e9e..52a2c526c7 100644 --- a/designer-base/src/main/java/com/fr/design/lock/LockInfoUtils.java +++ b/designer-base/src/main/java/com/fr/design/lock/LockInfoUtils.java @@ -2,6 +2,7 @@ package com.fr.design.lock; import com.fr.report.lock.DefaultLockInfoOperator; import com.fr.report.lock.LockInfoOperator; +import com.fr.start.server.FineEmbedServer; import com.fr.workspace.WorkContext; /** @@ -15,4 +16,8 @@ public class LockInfoUtils { LockInfoOperator lockInfoOperator = WorkContext.getCurrent().get(LockInfoOperator.class); return lockInfoOperator instanceof DefaultLockInfoOperator; } + + public static boolean unableGetLockInfo() { + return WorkContext.getCurrent().isLocal() && !FineEmbedServer.isRunning(); + } } From 5188dfc04e0b0ff6ed46fbf8f40509701baa00e5 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 21 Dec 2021 16:15:10 +0800 Subject: [PATCH 05/10] =?UTF-8?q?REPORT-64656=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=93=8D=E4=BD=9C=EF=BC=8C=E5=8F=8C=E5=87=BB=E5=B7=B2?= =?UTF-8?q?=E6=89=93=E5=BC=80=E7=9A=84=E6=A8=A1=E6=9D=BF=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E4=BC=9A=E5=AE=9A=E4=BD=8D=E5=88=B0=E5=AF=B9=E5=BA=94=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/file/HistoryTemplateListCache.java | 6 ++++- .../com/fr/design/file/TemplateTreePane.java | 25 +++++++++++++------ 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index 6675925526..920ecb78c8 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -253,7 +253,11 @@ public class HistoryTemplateListCache implements CallbackEvent { for (int i = 0; i < vCount; i++) { JTemplate overTemplate = historyList.get(i); - if (overTemplate.getEditingFILE().exists() && overTemplate.isALLSaved() && overTemplate != editingTemplate) { + boolean replaceWithJVirtualTemplate = overTemplate.getEditingFILE().exists() + && overTemplate.isALLSaved() + && overTemplate != editingTemplate + && overTemplate.checkEnable(); + if (replaceWithJVirtualTemplate) { closeVirtualSelectedReport(overTemplate); historyList.set(i, new JVirtualTemplate(overTemplate.getEditingFILE())); } diff --git a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java index 707309a481..bc5e0da6bd 100644 --- a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java +++ b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java @@ -57,6 +57,8 @@ import java.util.Enumeration; import java.util.Objects; import java.util.Observable; import java.util.Observer; +import org.jetbrains.annotations.Nullable; + import static javax.swing.JOptionPane.WARNING_MESSAGE; import static javax.swing.JOptionPane.YES_NO_OPTION; @@ -226,17 +228,17 @@ public class TemplateTreePane extends JPanel implements FileOperations { } String reportPath = reportletsTree.getSelectedTemplatePath(); final String selectedFilePath = StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, reportPath); - if (hasOpenedTemplate(selectedFilePath)) { - FineLoggerFactory.getLogger().info("{} has been opened in designer tab", selectedFilePath); - return; - } String lock = node.getLock(); - boolean showLockInfo = LockInfoUtils.isCompatibleOperator() || LockInfoUtils.unableGetLockInfo() + boolean showLockInfo = LockInfoUtils.isCompatibleOperator() + || LockInfoUtils.unableGetLockInfo() + || WorkContext.getCurrent().get(LockInfoOperator.class).isTplUnLocked(selectedFilePath) ? (lock != null && !lock.equals(node.getUserID())) : WorkContext.getCurrent().get(LockInfoOperator.class).isTplLocked(selectedFilePath); if (showLockInfo) { UserInfo userInfo = WorkContext.getCurrent().get(LockInfoOperator.class).getUserInfo(selectedFilePath); node.setLock(UUID.randomUUID().toString()); + // 对于开发者预览占位锁定 定位到tab中 + checkDevelopForBiddenTemplate(selectedFilePath); LockInfoDialog.show(userInfo); return; } else { @@ -245,14 +247,21 @@ public class TemplateTreePane extends JPanel implements FileOperations { DesignerContext.getDesignerFrame().openTemplate(new FileNodeFILE(new FileNode(selectedFilePath, false))); } + private void checkDevelopForBiddenTemplate(String selectedFilePath) { + JTemplate template = getOpenedTemplate(selectedFilePath); + if (template != null && template.isForbidden()) { + DesignerContext.getDesignerFrame().openTemplate(new FileNodeFILE(new FileNode(selectedFilePath, false))); + } + } - private boolean hasOpenedTemplate(String path) { + @Nullable + private JTemplate getOpenedTemplate(String path) { for (JTemplate template : HistoryTemplateListCache.getInstance().getHistoryList()) { if (ComparatorUtils.equals(template.getEditingFILE().getPath(), path)) { - return true; + return template; } } - return false; + return null; } /** From 49784e833d4b0cf68b3df00b646b438dfcbd7ece Mon Sep 17 00:00:00 2001 From: "fly.li" Date: Tue, 21 Dec 2021 17:01:06 +0800 Subject: [PATCH 06/10] =?UTF-8?q?REPORT-55241:=E6=B7=BB=E5=8A=A0=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=BC=95=E6=93=8E=E5=B1=9E=E6=80=A7=E5=9F=8B=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/ReportEngineAttrAction.java | 42 ++++++++++++++++++- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/report/ReportEngineAttrAction.java b/designer-realize/src/main/java/com/fr/design/actions/report/ReportEngineAttrAction.java index 4c7feab061..19ce479c3f 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/report/ReportEngineAttrAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/report/ReportEngineAttrAction.java @@ -5,9 +5,15 @@ import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.WorkSheetDesigner; import com.fr.design.menu.KeySetUtils; import com.fr.design.report.ReportEnginePane; +import com.fr.intelli.record.FocusPoint; +import com.fr.intelli.record.MetricRegistry; +import com.fr.intelli.record.Original; +import com.fr.json.JSONObject; +import com.fr.report.stable.LayerReportAttr; import com.fr.report.worksheet.WorkSheet; public class ReportEngineAttrAction extends ReportComponentAction { @@ -19,7 +25,6 @@ public class ReportEngineAttrAction extends ReportComponentAction currentEditingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + return currentEditingTemplate.getPath(); + } + } + } From 9e3d2a3e4e3046b3695a0b0b0da7da85d27e1b44 Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 21 Dec 2021 15:54:40 +0800 Subject: [PATCH 07/10] =?UTF-8?q?REPORT-63808=20=E3=80=90=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E4=BC=98=E5=8C=96=E3=80=91=E6=A0=BC=E5=BC=8F=E5=8D=95?= =?UTF-8?q?=E7=8B=AC=E6=8B=BF=E5=87=BA=E6=9D=A5=E4=BB=A5=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E5=8F=91=E7=8E=B0=E6=95=B0=E6=8D=AE=E5=88=97=E7=9A=84=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E9=85=8D=E7=BD=AE=E4=B8=AD=E6=B2=A1=E6=9C=89=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 默认的配置项宽度过窄,遮挡了配置项内容 【改动思路】 修改布局加大配置项宽度 --- .../com/fr/design/dscolumn/DSColumnAdvancedPane.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 de223b511e..016281bc0d 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 @@ -3,6 +3,7 @@ package com.fr.design.dscolumn; import com.fr.base.BaseFormula; import com.fr.data.util.SortOrder; import com.fr.design.border.UITitledBorder; +import com.fr.design.constants.LayoutConstants; import com.fr.design.data.DesignTableDataManager; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; @@ -33,6 +34,7 @@ import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.util.Arrays; import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.BOTTOM; import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.SPECIFY; @@ -513,10 +515,11 @@ public class DSColumnAdvancedPane extends BasicPane { public static class FormatAttrPane extends TextFormatPane { protected void initLayout() { - JPanel settingPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(0, 4, 0); - settingPane.add(typeComboBox); - settingPane.add(textField); - settingPane.add(roundingBox); + JComponent[][] components = new JComponent[][] { {typeComboBox, textField, roundingBox} }; + double[] rowSize = new double[] { TableLayout.FILL }; + double[] columnSize = {TableLayout.PREFERRED, 200, TableLayout.PREFERRED}; + + JPanel settingPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 4, 0); addComponents(4, new JComponent[]{settingPane, previewLabel}); } From d116628a5678a2a3276e1441dd1482ccdccc2fab Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 21 Dec 2021 16:50:56 +0800 Subject: [PATCH 08/10] =?UTF-8?q?REPORT-64642=20=E3=80=90=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E8=BE=B9=E6=A1=86=E3=80=91=E5=B7=A6=E4=BE=A7=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E5=9B=BE=E4=B8=AD=E5=8D=95=E5=85=83=E6=A0=BC=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=80=BB=E8=BE=91=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 主题预览界面支持预览内边框配置 【改动思路】 同上 --- .../ecpreview/AbstractECPreviewPane.java | 38 +++----- .../preview/ecpreview/ECPreviewPane.java | 47 ++++++++-- .../ecpreview/ECReportPreviewPane.java | 88 ++++++++++++++----- .../ecpreview/cell/AbstractPreviewCell.java | 10 ++- 4 files changed, 126 insertions(+), 57 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/AbstractECPreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/AbstractECPreviewPane.java index 959c6e279f..da818cb7af 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/AbstractECPreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/AbstractECPreviewPane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.theme.preview.ecpreview; +import com.fr.base.CellBorderStyle; import com.fr.base.Style; import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.settings.ThemedCellStyle; @@ -11,29 +12,6 @@ import com.fr.design.mainframe.theme.preview.ecpreview.cell.AbstractPreviewCell; import java.util.List; public abstract class AbstractECPreviewPane extends UINoOpaquePanel implements ThemePreviewed { - protected Style getReportBigTitleStyle(ThemedCellStyleList cellStyleList) { - return getCellStyle(cellStyleList.getUse4BigTitle()); - } - protected Style getReportHeaderStyle(ThemedCellStyleList cellStyleList) { - return getCellStyle(cellStyleList.getUse4Header()); - } - - protected Style getMainContentStyle(ThemedCellStyleList cellStyleList) { - return getCellStyle(cellStyleList.getUse4MainText()); - } - - protected Style getHighLightStyle(ThemedCellStyleList cellStyleList) { - return getCellStyle(cellStyleList.getUse4HighlightText()); - } - - protected Style getSmallTitleStyle(ThemedCellStyleList cellStyleList) { - return getCellStyle(cellStyleList.getUse4SmallTitle()); - } - - protected Style getAssistMsgStyle(ThemedCellStyleList cellStyleList) { - return getCellStyle(cellStyleList.getUse4SupportInfo()); - } - private Style getCellStyle(ThemedCellStyle themedCellStyle) { if (themedCellStyle == null) { return Style.DEFAULT_STYLE; @@ -42,9 +20,19 @@ public abstract class AbstractECPreviewPane extends UINoOpaquePanel implements T return style != null ? style : Style.DEFAULT_STYLE; } - protected void refresh(List list, Style style) { + private CellBorderStyle getCellBorderStyle(ThemedCellStyle themedCellStyle) { + if (themedCellStyle == null) { + return null; + } + return themedCellStyle.getCellBorderStyle(); + } + + protected void refresh(List list, ThemedCellStyle themedCellStyle) { + Style style = getCellStyle(themedCellStyle); + CellBorderStyle borderStyle = getCellBorderStyle(themedCellStyle); + for (AbstractPreviewCell cell : list) { - cell.refresh(style); + cell.refresh(style, borderStyle); } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECPreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECPreviewPane.java index aeb4fbef2f..2ac59af941 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECPreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECPreviewPane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.theme.preview.ecpreview; +import com.fr.base.CellBorderSourceFlag; import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.settings.ThemedCellStyleList; import com.fr.design.i18n.Toolkit; @@ -36,8 +37,16 @@ public class ECPreviewPane extends AbstractECPreviewPane { JPanel extCenterPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane(); this.add(extCenterPane, BorderLayout.CENTER); extCenterPane.add(titlePane, BorderLayout.NORTH); - for (int i = 0; i < COL_COUNT; i++) { + for (int c = 0; c < COL_COUNT; c++) { PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Header")); + int flag = CellBorderSourceFlag.ALL_BORDER_SOURCE_OUTER; + if (c > 0) { + flag |= CellBorderSourceFlag.LEFT_BORDER_SOURCE_INNER; + } + if (c < COL_COUNT - 1) { + flag |= CellBorderSourceFlag.RIGHT_BORDER_SOURCE_INNER; + } + cell.setBorderSourceFlag(flag); cell.setPreferredSize(new Dimension(103, 36)); titlePane.add(cell); headerCellList.add(cell); @@ -46,6 +55,22 @@ public class ECPreviewPane extends AbstractECPreviewPane { extCenterPane.add(contentPane, BorderLayout.CENTER); for (int i = 0; i < COL_COUNT * CONTENT_ROW_COUNT; i++) { PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Main_Text")); + int r = i / COL_COUNT; + int c = i % COL_COUNT; + int flag = CellBorderSourceFlag.ALL_BORDER_SOURCE_OUTER; + if (r > 0) { + flag |= CellBorderSourceFlag.TOP_BORDER_SOURCE_INNER; + } + if (r < CONTENT_ROW_COUNT - 1) { + flag |= CellBorderSourceFlag.BOTTOM_BORDER_SOURCE_INNER; + } + if (c > 0) { + flag |= CellBorderSourceFlag.LEFT_BORDER_SOURCE_INNER; + } + if (c < COL_COUNT - 1) { + flag |= CellBorderSourceFlag.RIGHT_BORDER_SOURCE_INNER; + } + cell.setBorderSourceFlag(flag); cell.setPreferredSize(new Dimension(103, 30)); contentPane.add(cell); contentCellList.add(cell); @@ -53,8 +78,16 @@ public class ECPreviewPane extends AbstractECPreviewPane { JPanel endPane = new UINoOpaquePanel(new GridLayout()); extCenterPane.add(endPane, BorderLayout.SOUTH); - for (int i = 0; i < COL_COUNT; i++) { + for (int c = 0; c < COL_COUNT; c++) { PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Highlight_Text")); + int flag = CellBorderSourceFlag.ALL_BORDER_SOURCE_OUTER; + if (c > 0) { + flag |= CellBorderSourceFlag.LEFT_BORDER_SOURCE_INNER; + } + if (c < COL_COUNT - 1) { + flag |= CellBorderSourceFlag.RIGHT_BORDER_SOURCE_INNER; + } + cell.setBorderSourceFlag(flag); cell.setPreferredSize(new Dimension(103, 30)); endPane.add(cell); highLightCellList.add(cell); @@ -62,6 +95,7 @@ public class ECPreviewPane extends AbstractECPreviewPane { JPanel extSouthPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane(); PreviewCell assistCell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Assist_Text")); + assistCell.setBorderSourceFlag(CellBorderSourceFlag.ALL_BORDER_SOURCE_OUTER); assistCell.setPreferredSize(new Dimension(123, 30)); assistCellList.add(assistCell); extSouthPane.add(assistCell); @@ -71,11 +105,10 @@ public class ECPreviewPane extends AbstractECPreviewPane { @Override public void refresh(TemplateTheme theme) { ThemedCellStyleList cellStyleConfig = theme.getCellStyleList(); - refresh(headerCellList, getReportHeaderStyle(cellStyleConfig)); - refresh(contentCellList, getMainContentStyle(cellStyleConfig)); - refresh(highLightCellList, getHighLightStyle(cellStyleConfig)); - refresh(highLightCellList, getHighLightStyle(cellStyleConfig)); - refresh(assistCellList, getAssistMsgStyle(cellStyleConfig)); + refresh(headerCellList, cellStyleConfig.getUse4Header()); + refresh(contentCellList, cellStyleConfig.getUse4MainText()); + refresh(highLightCellList, cellStyleConfig.getUse4HighlightText()); + refresh(assistCellList, cellStyleConfig.getUse4SupportInfo()); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java index 432c8b49c9..98f75538f1 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/ECReportPreviewPane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.theme.preview.ecpreview; +import com.fr.base.CellBorderSourceFlag; import com.fr.base.theme.ReportTheme; import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.settings.ThemedCellStyleList; @@ -22,12 +23,12 @@ import java.util.ArrayList; import java.util.List; public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreviewed { - private final List headerTitleCellList = new ArrayList<>(); - private final List headerCellList = new ArrayList<>(); - private final List titleCellList = new ArrayList<>(); - private final List contentCellList = new ArrayList<>(); - private final List highLightCellList = new ArrayList<>(); - private final List assistCellList = new ArrayList<>(); + private final List headerTitleCellList = new ArrayList<>(); // 大标题样式单元格 + private final List headerCellList = new ArrayList<>(); // 表头样式单元格 + private final List titleCellList = new ArrayList<>(); // 小标题样式单元格 + private final List contentCellList = new ArrayList<>(); // 正文样式单元格 + private final List highLightCellList = new ArrayList<>(); // 高亮文本样式单元格 + private final List assistCellList = new ArrayList<>(); // 辅助信息样式单元格 private static final int CONTENT_ROW_COUNT = 3; private static final int COL_COUNT = 5; @@ -64,31 +65,38 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview private JPanel createNorthPane() { JPanel northPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane(); AbstractPreviewCell bigTitleCell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_Cell_Style_Big_Title")); + bigTitleCell.setBorderSourceFlag(CellBorderSourceFlag.ALL_BORDER_SOURCE_OUTER); bigTitleCell.setPreferredSize(new Dimension(615, 46)); headerTitleCellList.add(bigTitleCell); northPane.add(bigTitleCell, BorderLayout.NORTH); CornerPreviewCell cornerCell = new CornerPreviewCell(new String[]{Toolkit.i18nText("Fine-Design_Basic_Column_Name"), Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_EC_Data"), Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_Row_Name")}, new Point2D[]{new Point(159, 71), new Point(225, 49)}); + cornerCell.setBorderSourceFlag(CellBorderSourceFlag.INVALID_BORDER_SOURCE); cornerCell.setPreferredSize(new Dimension(225, 71)); titleCellList.add(cornerCell); northPane.add(cornerCell, BorderLayout.WEST); JPanel centerPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane(); northPane.add(centerPane, BorderLayout.CENTER); PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Small_Title")); + cell.setBorderSourceFlag(CellBorderSourceFlag.ALL_BORDER_SOURCE_OUTER); titleCellList.add(cell); cell.setPreferredSize(new Dimension(308, 38)); centerPane.add(cell, BorderLayout.NORTH); JPanel eastSouthPane = new UINoOpaquePanel(new GridLayout()); - PreviewCell cell1 = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Header")); - PreviewCell cell2 = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Header")); - PreviewCell cell3 = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Header")); - headerCellList.add(cell1); - headerCellList.add(cell2); - headerCellList.add(cell3); - eastSouthPane.add(cell1); - eastSouthPane.add(cell2); - eastSouthPane.add(cell3); + for (int c = 0; c < CONTENT_ROW_COUNT; c++) { + PreviewCell headerCell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Header")); + int flag = CellBorderSourceFlag.ALL_BORDER_SOURCE_OUTER; + if (c > 0) { + flag |= CellBorderSourceFlag.LEFT_BORDER_SOURCE_INNER; + } + if (c < CONTENT_ROW_COUNT - 1) { + flag |= CellBorderSourceFlag.RIGHT_BORDER_SOURCE_INNER; + } + headerCell.setBorderSourceFlag(flag); + headerCellList.add(headerCell); + eastSouthPane.add(headerCell); + } centerPane.add(eastSouthPane, BorderLayout.CENTER); return northPane; } @@ -102,8 +110,16 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview cell1.setPreferredSize(new Dimension(112, 153)); westPane.add(cell1, BorderLayout.WEST); JPanel gridPane = new UINoOpaquePanel(new GridLayout(5, 1)); - for (int i = 0; i < COL_COUNT; i++) { + for (int r = 0; r < COL_COUNT; r++) { PreviewCell cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Header")); + int flag = CellBorderSourceFlag.ALL_BORDER_SOURCE_OUTER; + if (r > 0) { + flag |= CellBorderSourceFlag.TOP_BORDER_SOURCE_INNER; + } + if (r < COL_COUNT - 1) { + flag |= CellBorderSourceFlag.BOTTOM_BORDER_SOURCE_INNER; + } + cell.setBorderSourceFlag(flag); cell.setPreferredSize(new Dimension(113, 31)); headerCellList.add(cell); gridPane.add(cell); @@ -114,11 +130,36 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview centerPane.add(innerCenterPane, BorderLayout.CENTER); for (int i = 0; i < COL_COUNT * CONTENT_ROW_COUNT; i++) { PreviewCell cell ; - if ((i + 1) % CONTENT_ROW_COUNT == 0) { + int r = i / CONTENT_ROW_COUNT; + int c = i % CONTENT_ROW_COUNT; + if (c == CONTENT_ROW_COUNT - 1) { cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Highlight_Text")); + int flag = CellBorderSourceFlag.ALL_BORDER_SOURCE_OUTER; + if (r != 0) { + flag |= CellBorderSourceFlag.TOP_BORDER_SOURCE_INNER; + } + if (r != COL_COUNT - 1) { + flag |= CellBorderSourceFlag.BOTTOM_BORDER_SOURCE_INNER; + } + cell.setBorderSourceFlag(flag); highLightCellList.add(cell); } else { cell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Main_Text")); + int flag = CellBorderSourceFlag.ALL_BORDER_SOURCE_OUTER; + if (r > 0) { + flag |= CellBorderSourceFlag.TOP_BORDER_SOURCE_INNER; + } + if (r < COL_COUNT - 1) { + flag |= CellBorderSourceFlag.BOTTOM_BORDER_SOURCE_INNER; + } + if (c > 0) { + flag |= CellBorderSourceFlag.LEFT_BORDER_SOURCE_INNER; + } + if (c < CONTENT_ROW_COUNT - 2) { + flag |= CellBorderSourceFlag.RIGHT_BORDER_SOURCE_INNER; + } + cell.setBorderSourceFlag(flag); + contentCellList.add(cell); } cell.setPreferredSize(new Dimension(123, 31)); @@ -132,6 +173,7 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview private JPanel createSouthPane(){ JPanel southPane = FRGUIPaneFactory.createBorderLayout_NO_Opaque_Pane(); PreviewCell assistCell = new PreviewCell(Toolkit.i18nText("Fine-Design_Basic_Predefined_Style_Assist_Text")); + assistCell.setBorderSourceFlag(CellBorderSourceFlag.ALL_BORDER_SOURCE_OUTER); assistCell.setPreferredSize(new Dimension(123, 30)); assistCellList.add(assistCell); southPane.add(assistCell, BorderLayout.CENTER); @@ -141,12 +183,12 @@ public class ECReportPreviewPane extends UINoOpaquePanel implements ThemePreview @Override public void refresh(TemplateTheme theme) { ThemedCellStyleList cellStyleConfig = theme.getCellStyleList(); - refresh(headerTitleCellList, getReportBigTitleStyle(cellStyleConfig)); - refresh(headerCellList, getReportHeaderStyle(cellStyleConfig)); - refresh(contentCellList, getMainContentStyle(cellStyleConfig)); - refresh(titleCellList, getSmallTitleStyle(cellStyleConfig)); - refresh(highLightCellList, getHighLightStyle(cellStyleConfig)); - refresh(assistCellList, getAssistMsgStyle(cellStyleConfig)); + refresh(headerTitleCellList, cellStyleConfig.getUse4BigTitle()); + refresh(headerCellList, cellStyleConfig.getUse4Header()); + refresh(contentCellList, cellStyleConfig.getUse4MainText()); + refresh(titleCellList, cellStyleConfig.getUse4SmallTitle()); + refresh(highLightCellList, cellStyleConfig.getUse4HighlightText()); + refresh(assistCellList, cellStyleConfig.getUse4SupportInfo()); } } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/cell/AbstractPreviewCell.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/cell/AbstractPreviewCell.java index 4dd7d76520..fdd4dd3ca2 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/cell/AbstractPreviewCell.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ecpreview/cell/AbstractPreviewCell.java @@ -1,5 +1,7 @@ package com.fr.design.mainframe.theme.preview.ecpreview.cell; +import com.fr.base.CellBorderSourceFlag; +import com.fr.base.CellBorderStyle; import com.fr.base.Style; import com.fr.stable.Constants; @@ -12,10 +14,14 @@ public abstract class AbstractPreviewCell extends JComponent { private static final double BORDER_INSET = 0.5D; protected Style style = Style.DEFAULT_STYLE; private static final int NO_SCALE_RESOLUTION = 100; + private int borderSourceFlag = CellBorderSourceFlag.INVALID_BORDER_SOURCE; + public void setBorderSourceFlag(int borderSourceFlag) { + this.borderSourceFlag = borderSourceFlag; + } - public void refresh(Style style) { - this.style = style; + public void refresh(Style style, CellBorderStyle borderStyle) { + this.style = CellBorderSourceFlag.deriveBorderedStyle(style, borderStyle, borderSourceFlag); } public void paint(Graphics g) { From 4e9a12fc73b4982818ebf9b6f92734e57612d5e9 Mon Sep 17 00:00:00 2001 From: "fly.li" Date: Tue, 21 Dec 2021 17:14:26 +0800 Subject: [PATCH 09/10] =?UTF-8?q?REPORT-55241:=E4=BF=AE=E6=94=B9=E4=B8=80?= =?UTF-8?q?=E4=B8=8B=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/report/ReportEngineAttrAction.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/report/ReportEngineAttrAction.java b/designer-realize/src/main/java/com/fr/design/actions/report/ReportEngineAttrAction.java index 19ce479c3f..cf10117ba6 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/report/ReportEngineAttrAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/report/ReportEngineAttrAction.java @@ -50,15 +50,13 @@ public class ReportEngineAttrAction extends ReportComponentAction Date: Tue, 21 Dec 2021 17:17:06 +0800 Subject: [PATCH 10/10] =?UTF-8?q?REPORT-55241:=E4=BF=AE=E6=94=B9=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=BC=80=E5=90=AF=E5=9B=BA=E5=AE=9A=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E6=97=B6=E5=9B=BA=E5=AE=9A=E5=88=86=E9=A1=B5=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/report/ReportEngineAttrAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/report/ReportEngineAttrAction.java b/designer-realize/src/main/java/com/fr/design/actions/report/ReportEngineAttrAction.java index cf10117ba6..d80622b56f 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/report/ReportEngineAttrAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/report/ReportEngineAttrAction.java @@ -72,7 +72,7 @@ public class ReportEngineAttrAction extends ReportComponentAction