From 330343be85654a2249760d4667b08f197985d9c6 Mon Sep 17 00:00:00 2001 From: Starryi Date: Thu, 16 Dec 2021 14:14:18 +0800 Subject: [PATCH 01/12] =?UTF-8?q?REPORT-64262=20=E3=80=90=E8=A7=86?= =?UTF-8?q?=E8=A7=89=E9=AA=8C=E6=94=B6=E3=80=91=E4=B8=BB=E9=A2=98=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E7=9A=84=E8=BE=B9=E6=A1=86=E9=85=8D=E7=BD=AE=E5=AE=8C?= =?UTF-8?q?=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 单元格样式预览区域四周要留有外边距 【改动思路】 同上 --- .../main/java/com/fr/design/cell/CellStylePreviewPane.java | 4 +++- .../design/mainframe/theme/edit/cell/CellStyleEditPane.java | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java b/designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java index 8495aa6ecb..fb039fa4ab 100644 --- a/designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java @@ -123,7 +123,9 @@ public class CellStylePreviewPane extends JPanel { Style.paintContent(g2d, paintText, style, width, height, resolution); - Style.paintBorder(g2d, style, width, height); + Style.paintBorder(g2d, style, + width - GraphHelper.getLineStyleSize(style.getBorderRight()) / 2F, + height - GraphHelper.getLineStyleSize(style.getBorderBottom()) / 2F); } @Override diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java index 172ac3c3fd..822a4c4e7a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java @@ -142,11 +142,11 @@ public class CellStyleEditPane extends MultiTabPane { JPanel previewPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); previewArea = new CellRectangleStylePreviewPane(true); - previewArea.setPreferredSize(new Dimension(215, 52)); + previewArea.setPreferredSize(new Dimension(215, 48)); previewPane.setBorder(BorderFactory.createCompoundBorder( BorderUtils.createTitleBorder(i18nText("Fine-Design_Basic_Preview")), BorderFactory.createEmptyBorder(4, 4, 4, 4))); - previewPane.add(previewArea, BorderLayout.CENTER); + previewPane.add(previewArea, BorderLayout.NORTH); this.add(previewPane, BorderLayout.NORTH); From 33e1ac2dde3ffbf1e9de84286b76cde412e8b3a5 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 16 Dec 2021 17:26:57 +0800 Subject: [PATCH 02/12] =?UTF-8?q?REPORT-64300=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E6=97=B6=E6=97=A5=E5=BF=97=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../loghandler/LogEventConverter.java | 27 ------------------- .../mainframe/socketio/DesignerSocketIO.java | 2 +- 2 files changed, 1 insertion(+), 28 deletions(-) delete mode 100644 designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogEventConverter.java diff --git a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogEventConverter.java b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogEventConverter.java deleted file mode 100644 index 92995add54..0000000000 --- a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogEventConverter.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.fr.design.mainframe.loghandler; - -import com.fr.third.apache.log4j.spi.LoggingEvent; -import com.fr.third.apache.logging.log4j.Level; -import com.fr.third.apache.logging.log4j.core.LogEvent; -import com.fr.third.apache.logging.log4j.core.impl.Log4jLogEvent; -import com.fr.third.apache.logging.log4j.message.SimpleMessage; - -/** - * 兼容log4j1和2之间logEvent之间的转换 - * - * @author hades - * @version 11.0 - * Created by hades on 2021/12/9 - */ -public class LogEventConverter { - - public static LogEvent convert(LoggingEvent loggingEvent) { - SimpleMessage message = new SimpleMessage(loggingEvent.getRenderedMessage()); - return Log4jLogEvent.newBuilder(). - setMessage(message). - setLevel(Level.getLevel(loggingEvent.getLevel().toString())). - build(); - } - - -} diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index 1742e3c3dc..092c7b30f1 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -11,7 +11,6 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.loghandler.DesignerLogger; -import com.fr.design.mainframe.loghandler.LogEventConverter; import com.fr.design.mainframe.share.ui.base.MouseClickListener; import com.fr.design.mainframe.toast.DesignerToastMsgUtil; import com.fr.design.mainframe.toast.ToastMsgDialog; @@ -34,6 +33,7 @@ import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; import com.fr.workspace.base.WorkspaceConstants; import com.fr.workspace.connect.WorkspaceConnectionInfo; +import com.fr.workspace.server.socket.LogEventConverter; import io.socket.client.IO; import io.socket.client.Socket; import io.socket.emitter.Emitter; From 3df380266de8907397a3b8549d524ee0fadc3448 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 17 Dec 2021 10:52:54 +0800 Subject: [PATCH 03/12] =?UTF-8?q?REPORT-64207=20=E5=8D=95=E5=87=BB?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E6=9D=A5=E5=9B=9E=E5=88=87=E6=8D=A2=20?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E6=A0=91=E5=8F=B3=E4=B8=8A=E8=A7=92=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=98=BE=E7=A4=BA=E9=94=81=E5=AE=9A=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=8F=8Aicon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/file/TemplateTreePane.java | 2 +- 1 file changed, 1 insertion(+), 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 a5826462e2..ddf806f026 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 @@ -103,7 +103,6 @@ public class TemplateTreePane extends JPanel implements FileOperations { if (reportletsTree.getPathForLocation(evt.getX(), evt.getY()) != null && evt.getClickCount() == 2) { openFile(); } - DesignerFrameFileDealerPane.getInstance().refreshRightToolBarBy(reportletsTree.getSelectedFileNode()); } @Override @@ -121,6 +120,7 @@ public class TemplateTreePane extends JPanel implements FileOperations { if (toolBarStateChangeListener != null) { toolBarStateChangeListener.stateChange(); } + DesignerFrameFileDealerPane.getInstance().refreshRightToolBarBy(reportletsTree.getSelectedFileNode()); } }; // lx: add mouse listener From ed44b067ccaee6a7f863604d4206d08c1a306cdd Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 17 Dec 2021 13:43:43 +0800 Subject: [PATCH 04/12] =?UTF-8?q?REPORT-62533=E3=80=90=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E5=9B=BE=E3=80=91=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E5=8F=AA=E8=AE=BE=E7=BD=AE=E4=B8=8B=E8=BE=B9?= =?UTF-8?q?=E6=A1=86=E7=BA=BF=E6=97=B6=EF=BC=8C=E5=B7=A6=E4=BE=A7=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E5=9B=BE=E4=B8=AD=E7=9C=8B=E4=B8=8D=E5=88=B0=E6=95=88?= =?UTF-8?q?=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ecpreview/cell/AbstractPreviewCell.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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 a8a5f18924..4dd7d76520 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,12 +1,15 @@ package com.fr.design.mainframe.theme.preview.ecpreview.cell; import com.fr.base.Style; +import com.fr.stable.Constants; + import javax.swing.JComponent; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; 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; @@ -19,7 +22,19 @@ public abstract class AbstractPreviewCell extends JComponent { Graphics2D g2d = (Graphics2D) g; Style.paintBackground(g2d, style, getWidth(), getHeight()); paintContent(g2d, NO_SCALE_RESOLUTION); - Style.paintBorder(g2d, style, getWidth(), getHeight()); + paintBorder(g2d); + } + + private void paintBorder(Graphics2D g2d) { + double width = getWidth(); + double height = getHeight(); + if (style.getBorderLeft() == Constants.LINE_SLIM || style.getBorderRight() == Constants.LINE_SLIM) { + width -= BORDER_INSET; + } + if (style.getBorderBottom() == Constants.LINE_SLIM || style.getBorderTop() == Constants.LINE_SLIM) { + height -= BORDER_INSET; + } + Style.paintBorder(g2d, style, width, height); } protected abstract void paintContent(Graphics2D g2d, int resolution); From 458e4397df1a642ceae7e29e110c3dcec421a87d Mon Sep 17 00:00:00 2001 From: Tommy Date: Fri, 17 Dec 2021 14:09:09 +0800 Subject: [PATCH 05/12] =?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 5546bda83a1295c311ea36550e865b7bef6032c6 Mon Sep 17 00:00:00 2001 From: lucian Date: Fri, 17 Dec 2021 14:46:21 +0800 Subject: [PATCH 06/12] =?UTF-8?q?REPORT-64434=E3=80=9011.0.2=E8=BF=AD?= =?UTF-8?q?=E4=BB=A3=E9=AA=8C=E6=94=B6=E3=80=91=E5=B8=A6=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E5=BA=93=E9=80=89=E4=B8=AD=E8=A1=A8?= =?UTF-8?q?=E5=86=8D=E4=B8=8B=E6=8B=89=E6=97=A0=E5=8C=B9=E9=85=8D=E5=86=85?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/icombobox/SearchFRTreeComboBox.java | 69 ++++++++++--------- 1 file changed, 38 insertions(+), 31 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/icombobox/SearchFRTreeComboBox.java b/designer-base/src/main/java/com/fr/design/gui/icombobox/SearchFRTreeComboBox.java index 06f50e211c..ff6ebba020 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombobox/SearchFRTreeComboBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombobox/SearchFRTreeComboBox.java @@ -10,6 +10,7 @@ import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.mainframe.DesignerContext; import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; +import com.fr.stable.Filter; import com.fr.stable.StringUtils; import javax.swing.JOptionPane; @@ -34,6 +35,7 @@ import java.util.Enumeration; */ public class SearchFRTreeComboBox extends FRTreeComboBox { + private static final String DOT = "."; // 持有父容器,需要实时获取其他组件值 private final ChoosePane parent; @@ -59,7 +61,7 @@ public class SearchFRTreeComboBox extends FRTreeComboBox { parent.getDSName(), parent.getConnection(), parent.getSchema(), - createFilter((String) searchEditor.getItem())); + createFilter((String) searchEditor.getItem(), parent.getSchema())); return null; } @@ -72,8 +74,8 @@ public class SearchFRTreeComboBox extends FRTreeComboBox { }.execute(); } - private TableNameFilter createFilter(String text) { - return StringUtils.isEmpty(text) ? EMPTY_FILTER : new TableNameFilter(text); + private TableNameFilter createFilter(String text, String schema) { + return StringUtils.isEmpty(text) ? EMPTY_FILTER : new TableNameFilter(text, schema); } /** @@ -142,27 +144,7 @@ public class SearchFRTreeComboBox extends FRTreeComboBox { } } - /** - * 重写输入框编辑器,实现输入框模糊搜索逻辑 - */ - private class SearchFRComboBoxEditor extends FrTreeSearchComboBoxEditor { - - public SearchFRComboBoxEditor(FRTreeComboBox comboBox) { - super(comboBox); - } - - @Override - protected void changeHandler() { - if (isSetting()) { - return; - } - setPopupVisible(true); - this.item = textField.getText(); - searchExecute(); - } - } - - private static final TableNameFilter EMPTY_FILTER = new TableNameFilter(StringUtils.EMPTY) { + private static final TableNameFilter EMPTY_FILTER = new TableNameFilter() { public boolean accept(TableProcedure procedure) { return true; } @@ -171,17 +153,22 @@ public class SearchFRTreeComboBox extends FRTreeComboBox { /** * 表名模糊搜索实现 */ - private static class TableNameFilter { - private final String searchFilter; + private static class TableNameFilter implements Filter { + private String searchFilter; + + public TableNameFilter() { + } - public TableNameFilter(String searchFilter) { - if (StringUtils.isNotEmpty(searchFilter)) { - searchFilter = searchFilter.toLowerCase().trim(); + public TableNameFilter(String searchFilter, String schema) { + // 有模式的截掉,不参与模糊搜索 + if (StringUtils.isNotEmpty(schema) && searchFilter.startsWith(schema + DOT)) { + searchFilter = searchFilter.substring(schema.length() + 1); } - this.searchFilter = searchFilter; + this.searchFilter = searchFilter.toLowerCase().trim(); } - // 字符串匹配 + // 表名匹配 + @Override public boolean accept(TableProcedure procedure) { return procedure.getName().toLowerCase().contains(searchFilter); } @@ -197,4 +184,24 @@ public class SearchFRTreeComboBox extends FRTreeComboBox { searchExecute(); } } + + /** + * 重写输入框编辑器,实现输入框模糊搜索逻辑 + */ + private class SearchFRComboBoxEditor extends FrTreeSearchComboBoxEditor { + + public SearchFRComboBoxEditor(FRTreeComboBox comboBox) { + super(comboBox); + } + + @Override + protected void changeHandler() { + if (isSetting()) { + return; + } + setPopupVisible(true); + this.item = textField.getText(); + searchExecute(); + } + } } 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 07/12] =?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 b24c9ebf6e24b8f24246e3d89fbc04074046fcd5 Mon Sep 17 00:00:00 2001 From: Starryi Date: Fri, 17 Dec 2021 16:45:05 +0800 Subject: [PATCH 08/12] =?UTF-8?q?REPORT-64262=20=E3=80=90=E8=A7=86?= =?UTF-8?q?=E8=A7=89=E9=AA=8C=E6=94=B6=E3=80=91=E4=B8=BB=E9=A2=98=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E7=9A=84=E8=BE=B9=E6=A1=86=E9=85=8D=E7=BD=AE=E5=AE=8C?= =?UTF-8?q?=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 单元格样式预览区域四周要留有外边距 【改动思路】 同上 --- .../fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java index 172ac3c3fd..d9436848f8 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java @@ -135,7 +135,7 @@ public class CellStyleEditPane extends MultiTabPane { @Override protected void initLayout() { - this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.setLayout(new BorderLayout(0, 10)); JPanel jPanel = new JPanel(); jPanel.setLayout(new BorderLayout(0, 4)); From 2eaf3b057cdd81e7844fb4f565f19998538ffeeb Mon Sep 17 00:00:00 2001 From: lucian Date: Mon, 20 Dec 2021 15:54:07 +0800 Subject: [PATCH 09/12] =?UTF-8?q?REPORT-62876=20=E8=A1=A8=E5=90=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=97=B6=E4=B8=8D=E7=94=A8toString=EF=BC=8C?= =?UTF-8?q?=E4=BC=9A=E4=B8=8E=E5=88=9D=E5=A7=8B=E5=8C=96=E6=97=B6=E4=B8=8D?= =?UTF-8?q?=E4=B8=80=E8=87=B4=EF=BC=8C=E7=BB=9F=E4=B8=80=E4=B8=BAname?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/data/datapane/ChoosePane.java | 6 +-- ...oBox.java => TableSearchTreeComboBox.java} | 39 ++++++++++--------- 2 files changed, 24 insertions(+), 21 deletions(-) rename designer-base/src/main/java/com/fr/design/gui/icombobox/{SearchFRTreeComboBox.java => TableSearchTreeComboBox.java} (87%) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java index 38d287a208..55ff90abbd 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java @@ -19,7 +19,7 @@ import com.fr.design.data.datapane.preview.PreviewTablePane; import com.fr.design.data.tabledata.Prepare4DataSourceChange; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.icombobox.FilterableComboBoxModel; -import com.fr.design.gui.icombobox.SearchFRTreeComboBox; +import com.fr.design.gui.icombobox.TableSearchTreeComboBox; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBoxEditor; import com.fr.design.gui.icombobox.UIComboBoxRenderer; @@ -91,7 +91,7 @@ public class ChoosePane extends BasicBeanPane implements Refresha /** * 表名 */ - protected SearchFRTreeComboBox tableNameComboBox; + protected TableSearchTreeComboBox tableNameComboBox; private SwingWorker populateWorker; @@ -146,7 +146,7 @@ public class ChoosePane extends BasicBeanPane implements Refresha schemaBox = new StringUIComboBox(); schemaBox.setEditor(new ComboBoxEditor()); - tableNameComboBox = new SearchFRTreeComboBox(this, new JTree(new DefaultMutableTreeNode()), tableNameTreeRenderer); + tableNameComboBox = new TableSearchTreeComboBox(this, new JTree(new DefaultMutableTreeNode()), tableNameTreeRenderer); tableNameComboBox.setEditable(true); tableNameComboBox.setRenderer(listCellRenderer); registerDSChangeListener(); diff --git a/designer-base/src/main/java/com/fr/design/gui/icombobox/SearchFRTreeComboBox.java b/designer-base/src/main/java/com/fr/design/gui/icombobox/TableSearchTreeComboBox.java similarity index 87% rename from designer-base/src/main/java/com/fr/design/gui/icombobox/SearchFRTreeComboBox.java rename to designer-base/src/main/java/com/fr/design/gui/icombobox/TableSearchTreeComboBox.java index ff6ebba020..dc64ab3c0b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombobox/SearchFRTreeComboBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombobox/TableSearchTreeComboBox.java @@ -25,7 +25,7 @@ import java.awt.event.MouseEvent; import java.util.Enumeration; /** - * 实现模糊搜索的FRTreeComboBox + * 实现模糊搜索表名的FRTreeComboBox * FRTreeComboBox:搜索后滚动到首个匹配节点 * SearchFRTreeComboBox:显示所有匹配的节点 * @@ -33,20 +33,27 @@ import java.util.Enumeration; * @version 10.0 * Created by Lucian.Chen on 2021/4/14 */ -public class SearchFRTreeComboBox extends FRTreeComboBox { - - private static final String DOT = "."; +public class TableSearchTreeComboBox extends FRTreeComboBox { // 持有父容器,需要实时获取其他组件值 private final ChoosePane parent; - public SearchFRTreeComboBox(ChoosePane parent, JTree tree, TreeCellRenderer renderer) { + public TableSearchTreeComboBox(ChoosePane parent, JTree tree, TreeCellRenderer renderer) { super(tree, renderer); this.parent = parent; - setUI(new SearchFRTreeComboBoxUI()); + setUI(new TableSearchTreeComboBoxUI()); } protected UIComboBoxEditor createEditor() { - return new SearchFRComboBoxEditor(this); + return new TableSearchComboBoxEditor(this); + } + + @Override + protected String pathToString(TreePath path) { + Object obj = ((DefaultMutableTreeNode) path.getLastPathComponent()).getUserObject(); + if (obj instanceof TableProcedure) { + return ((TableProcedure) obj).getName(); + } + return super.pathToString(path); } /** @@ -61,7 +68,7 @@ public class SearchFRTreeComboBox extends FRTreeComboBox { parent.getDSName(), parent.getConnection(), parent.getSchema(), - createFilter((String) searchEditor.getItem(), parent.getSchema())); + createFilter((String) searchEditor.getItem())); return null; } @@ -74,8 +81,8 @@ public class SearchFRTreeComboBox extends FRTreeComboBox { }.execute(); } - private TableNameFilter createFilter(String text, String schema) { - return StringUtils.isEmpty(text) ? EMPTY_FILTER : new TableNameFilter(text, schema); + private TableNameFilter createFilter(String text) { + return StringUtils.isEmpty(text) ? EMPTY_FILTER : new TableNameFilter(text); } /** @@ -159,11 +166,7 @@ public class SearchFRTreeComboBox extends FRTreeComboBox { public TableNameFilter() { } - public TableNameFilter(String searchFilter, String schema) { - // 有模式的截掉,不参与模糊搜索 - if (StringUtils.isNotEmpty(schema) && searchFilter.startsWith(schema + DOT)) { - searchFilter = searchFilter.substring(schema.length() + 1); - } + public TableNameFilter(String searchFilter) { this.searchFilter = searchFilter.toLowerCase().trim(); } @@ -177,7 +180,7 @@ public class SearchFRTreeComboBox extends FRTreeComboBox { /** * 重写FRTreeComboBoxUI,实现点击下拉时触发模糊搜索 */ - private class SearchFRTreeComboBoxUI extends FRTreeComboBoxUI { + private class TableSearchTreeComboBoxUI extends FRTreeComboBoxUI { @Override public void mouseClicked(MouseEvent e) { @@ -188,9 +191,9 @@ public class SearchFRTreeComboBox extends FRTreeComboBox { /** * 重写输入框编辑器,实现输入框模糊搜索逻辑 */ - private class SearchFRComboBoxEditor extends FrTreeSearchComboBoxEditor { + private class TableSearchComboBoxEditor extends FrTreeSearchComboBoxEditor { - public SearchFRComboBoxEditor(FRTreeComboBox comboBox) { + public TableSearchComboBoxEditor(FRTreeComboBox comboBox) { super(comboBox); } From 3bab59843af0182ffbfbc7fd2b7970f8d48ff43e Mon Sep 17 00:00:00 2001 From: lucian Date: Mon, 20 Dec 2021 15:57:19 +0800 Subject: [PATCH 10/12] =?UTF-8?q?REPORT-64412=20=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E8=A1=A8=E5=90=8D=E4=BD=BF=E7=94=A8=E6=96=87=E6=9C=AC=E6=A1=86?= =?UTF-8?q?=E5=86=85=E5=AE=B9=EF=BC=8C=E8=80=8C=E9=9D=9E=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E7=9A=84=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/data/datapane/ChoosePane.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java index 55ff90abbd..99a294fdde 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java @@ -486,12 +486,9 @@ public class ChoosePane extends BasicBeanPane implements Refresha protected String getTableName() { String tableName = ""; - Object obj = this.tableNameComboBox.getSelectedItemObject(); + Object obj = this.tableNameComboBox.getSelectedItem(); if (obj == null) { - obj = this.tableNameComboBox.getSelectedItem(); - if (obj == null) { - obj = this.tableNameComboBox.getEditor().getItem(); - } + obj = this.tableNameComboBox.getEditor().getItem(); } if (obj instanceof TreePath) { Object tp = ((ExpandMutableTreeNode) ((TreePath) obj).getLastPathComponent()).getUserObject(); From 2c9290863a4df9a49ee4d6823a7b12e991d6f117 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 21 Dec 2021 10:17:11 +0800 Subject: [PATCH 11/12] =?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 12/12] =?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(); + } }