From ac1a14dbec338fafde33da86d2549a244874bcb8 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 18 Oct 2022 18:22:16 +0800 Subject: [PATCH 1/7] =?UTF-8?q?REPORT-75998=20=E4=BF=AE=E6=94=B9UI?= =?UTF-8?q?=E4=B8=8E=E9=80=82=E9=85=8D=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/images/replace/change_normal.svg | 3 + .../com/fr/design/images/replace/replace.png | Bin 418 -> 437 bytes .../design/images/replace/replace_normal.svg | 5 +- .../replace/ui/ITReplaceMainDialog.java | 8 +- .../replace/ui/ITReplaceNorthPanel.java | 152 ++++++++++-------- .../replace/ui/ITReplaceSouthPanel.java | 8 + .../replace/ui/ITReplaceWestPanel.java | 24 ++- 7 files changed, 129 insertions(+), 71 deletions(-) create mode 100644 designer-base/src/main/resources/com/fr/design/images/replace/change_normal.svg diff --git a/designer-base/src/main/resources/com/fr/design/images/replace/change_normal.svg b/designer-base/src/main/resources/com/fr/design/images/replace/change_normal.svg new file mode 100644 index 0000000000..88d9e7772b --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/replace/change_normal.svg @@ -0,0 +1,3 @@ + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/replace/replace.png b/designer-base/src/main/resources/com/fr/design/images/replace/replace.png index e736042724c17a037500b250aaeb5802acdb5366..b9a41125c56b58c9d71f27677bf6f951f453466a 100644 GIT binary patch delta 395 zcmV;60d)SN1GNJoiBL{Q4GJ0x0000DNk~Le0000E0000E2nGNE03S##(UBoFe@aP2 zK~#7Fl~PMm!axx184_16@C3#aFd<4=uHp^2fp`Mu2I39m26}^V0<&@c*INWAsQVwQOp9 z&ER)9Z!H+35c%x7&W%l+9~t9>e_qz@-o9)xg2_We;rce8C$GD*EC2&WHAK#4({afN z5E?w%2eR_53LN7qO<2M$TdU@Zqznj({3w*DzM2yae+7AWrz_EoOxEo@@vUx#kCet*T>;my~VLX8|Pm<}R zTt`u?KJ1bq*+V1R2dZ}|wRXc&@><3{WE7uZw$~V}QN=<6mJIA*)cQ(&|7-!92!bBu p=spY(l^HBE#tyn1r)m7}{vUt!e|(l%aLoV!002ovPDHLkV1gCat@{7~ delta 376 zcmV-;0f+vz1EK>ViBL{Q4GJ0x0000DNk~Le0000G0000G2nGNE03Y-JVUZyX`) zK~#7Fty0@j0x=ZL%~AjzKnEmbmk)p34xj_D0x7`~umYt6I&k^%Lv~3z04mUbXE&a^ z=s50UP~^^JlAPq8`#M7W)2Ip5I=c40P~``b&f3lTR|M=xR6G*V9?LQ2y_kRudl6e} z4{bz3sc>vevJZ{05Q?~ZGHN`C3 z+ - + + + + diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index 9a2f5c8de7..6ea30d9896 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -20,6 +20,7 @@ import com.fr.general.GeneralUtils; import com.fr.stable.StringUtils; +import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import java.awt.BorderLayout; @@ -55,6 +56,7 @@ public class ITReplaceMainDialog extends UIDialog { private String searchStr; private static final int FIRST_ROW = 0; public static int selectCount = 0; + public static int MAIN_PANEL_WIDTH = 929 ; public ITReplaceMainDialog() { super(DesignerContext.getDesignerFrame()); @@ -97,8 +99,8 @@ public class ITReplaceMainDialog extends UIDialog { int width = jTemplate.getWidth(); Point point = jTemplate.getLocationOnScreen(); setModal(false); - setMaximumSize(new Dimension(jTemplate.getWidth(), jTemplate.getHeight())); - setMinimumSize(new Dimension(jTemplate.getWidth(), 240)); + setMaximumSize(new Dimension(width, jTemplate.getHeight())); + setMinimumSize(new Dimension(width, 240)); setSize(width, height); setLocation(new Point(point.x, point.y + jTemplate.getHeight() / 2 + jTemplate.getHeight() / 2 - 385)); @@ -124,7 +126,7 @@ public class ITReplaceMainDialog extends UIDialog { replaceComboBox.setEnabled(false); replaceComboBox.setEditable(true); northPane.getReplaceButton().setEnabled(false); - + westPanel.getLeftPanel().setPreferredSize(new Dimension(ITReplaceWestPanel.LEFT_WIDTH,this.getHeight())); ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Search_Input")); ((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Input")); ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).addActionListener(new ActionListener() { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java index a4fe1fef0f..909ce7112a 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java @@ -1,5 +1,6 @@ package com.fr.design.actions.replace.ui; +import com.fr.base.svg.IconUtils; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icontainer.UIScrollPane; @@ -9,7 +10,9 @@ import com.fr.design.i18n.Toolkit; import com.fr.stable.StringUtils; +import javax.swing.BorderFactory; import javax.swing.ComboBoxEditor; +import javax.swing.Icon; import javax.swing.JCheckBox; import javax.swing.JPanel; import javax.swing.ScrollPaneConstants; @@ -34,20 +37,28 @@ public class ITReplaceNorthPanel { private UIComboBox findCombobox; private UIComboBox rangeCombobox; private JCheckBox matchRadioButton; + private UILabel iconLabel; private UIComboBox findInputCombobox; private UIComboBox replaceInputCombobox; private UIScrollPane scrollPane; private UIButton replaceButton; private UIButton searchButton; + private static double rate = 1.00; //存储的5次最近输入 private int maxItemCount = 5; - private static final int LIMIT_WIDTH = 1250; + private static int limit_width = 800; private static final int HEIGHT = 161; - private static final int BUTTON_WIDTH = 60; - private static final int BUTTON_GAP = 20; + private static final int BUTTON_WIDTH = 44; + private static final int GAP = 20; + private static final int BUTTON_GAP = 10; private static final int MATCH_WIDTH = 70; + private static final int COMPONENT_HEIGHT = 25; + private static final int FIRST_Y = 15, SECOND_Y = 50, THIRD_Y = 85, FOURTH_Y = 120; + private static final int FIRST_X = 20, SECOND_X = 80; + private static final int LABEL_WIDTH = 60; + private static final Icon CHANGE_ICON = IconUtils.readIcon("/com/fr/design/images/replace/change_normal.svg"); private int findLabelX, findLabelY, findLabelWidth, findLabelHeight; @@ -60,7 +71,8 @@ public class ITReplaceNorthPanel { private int replaceInputComboBoxX, replaceInputComboBoxY, replaceInputComboBoxWidth, replaceInputComboBoxHeight; private int replaceButtonX, replaceButtonY, replaceButtonHeight; private int searchButtonX, searchButtonY, searchButtonHeight; - + private int iconX, iconY, iconWidth, iconHeight; + private int inputLength; public static ArrayList findItems = new ArrayList<>(); public static ArrayList findInputItems = new ArrayList<>(); @@ -81,6 +93,7 @@ public class ITReplaceNorthPanel { findLabel = new UILabel(Toolkit.i18nText("Fine-Design_Replace_Search_Element")); rangeLabel = new UILabel(Toolkit.i18nText("Fine-Design_Replace_Search_Range")); + iconLabel = new UILabel(CHANGE_ICON); resultLabel = new UILabel(); String[] rangeItems = new String[]{Toolkit.i18nText("Fine-Design_Basic_Export_JS_Template_Current")}; @@ -109,7 +122,7 @@ public class ITReplaceNorthPanel { replaceButton = new UIButton(Toolkit.i18nText("Fine-Design_Replace_Button")); searchButton = new UIButton(Toolkit.i18nText("Fine-Design_Search_Button")); - upPanel.setPreferredSize(new Dimension(LIMIT_WIDTH, HEIGHT)); + upPanel.setPreferredSize(new Dimension(limit_width, HEIGHT)); scrollPane = new UIScrollPane(upPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); upPanel.add(findLabel); upPanel.add(rangeLabel); @@ -121,6 +134,8 @@ public class ITReplaceNorthPanel { upPanel.add(matchRadioButton); upPanel.add(replaceButton); upPanel.add(searchButton); + upPanel.add(iconLabel); + scrollPane.setBorder(BorderFactory.createEmptyBorder()); } /** @@ -129,9 +144,8 @@ public class ITReplaceNorthPanel { * @param width */ public void setLimitSize(int width) { - width = Math.max(LIMIT_WIDTH, width); - upPanel.setMaximumSize(new Dimension(width, 161)); - upPanel.setPreferredSize(new Dimension(width, 161)); + upPanel.setMaximumSize(new Dimension(limit_width, 161)); + upPanel.setPreferredSize(new Dimension(limit_width, 161)); } @@ -144,21 +158,22 @@ public class ITReplaceNorthPanel { */ public void fitScreen(int x, int y, int templateWidth) { - templateWidth = Math.max(templateWidth, LIMIT_WIDTH); - - setFindLabelBounds(x, y, templateWidth); - setRangeLabelBounds(x, y, templateWidth); - setResultLabelBounds(x, y, templateWidth); + templateWidth = Math.max(ITReplaceMainDialog.MAIN_PANEL_WIDTH, templateWidth); + templateWidth = templateWidth - ITReplaceWestPanel.LEFT_WIDTH; + inputLength = (templateWidth - GAP * 5) / 2; - setFindComboboxBounds(x, y, templateWidth); - setRangeComboboxBounds(x, y, templateWidth); - setFindInputComboboxBounds(x, y, templateWidth); - setReplaceInputComboboxBounds(x, y, templateWidth); - - setUIRadioButtonBounds(x, y, templateWidth); - setReplaceButtonBounds(x, y, templateWidth); - setSearchButtonBounds(x, y, templateWidth); + setFindLabelBounds(); + setResultLabelBounds(templateWidth); + setFindComboboxBounds(); + setFindInputComboboxBounds(); + setReplaceInputComboboxBounds(templateWidth); + setRangeLabelBounds(); + setRangeComboboxBounds(); + setUIRadioButtonBounds(); + setReplaceButtonBounds(); + setSearchButtonBounds(); + setIconLabelBounds(); } @@ -214,87 +229,94 @@ public class ITReplaceNorthPanel { this.scrollPane = scrollPane; } + private void setIconLabelBounds() { + iconX = inputLength + GAP; + iconY = SECOND_Y; + iconWidth = GAP; + iconHeight = COMPONENT_HEIGHT; + iconLabel.setBounds(iconX, iconY, iconWidth, iconHeight); + } - private void setSearchButtonBounds(int x, int y, int templateWidth) { - searchButtonHeight = 25; - searchButtonY = resultLabelY; + private void setSearchButtonBounds() { + searchButtonHeight = COMPONENT_HEIGHT; + searchButtonY = FOURTH_Y; searchButtonX = replaceInputComboBoxX + replaceInputComboBoxWidth - BUTTON_WIDTH * 2 - BUTTON_GAP; searchButton.setBounds(searchButtonX, searchButtonY, BUTTON_WIDTH, searchButtonHeight); } - private void setReplaceButtonBounds(int x, int y, int templateWidth) { - replaceButtonHeight = 25; - replaceButtonY = resultLabelY; + private void setReplaceButtonBounds() { + replaceButtonHeight = COMPONENT_HEIGHT; + replaceButtonY = FOURTH_Y; replaceButtonX = replaceInputComboBoxX + replaceInputComboBoxWidth - BUTTON_WIDTH; replaceButton.setBounds(replaceButtonX, replaceButtonY, BUTTON_WIDTH, replaceButtonHeight); } - private void setReplaceInputComboboxBounds(int x, int y, int templateWidth) { - replaceInputComboBoxX = x + templateWidth / 2 + templateWidth / 60; - replaceInputComboBoxY = y + 55; - replaceInputComboBoxWidth = templateWidth / 3 + templateWidth / 30 * 2; - replaceInputComboBoxHeight = 25; + private void setReplaceInputComboboxBounds(int templateWidth) { + replaceInputComboBoxX = templateWidth - inputLength - GAP * 2; + replaceInputComboBoxY = SECOND_Y; + replaceInputComboBoxWidth = inputLength; + replaceInputComboBoxHeight = COMPONENT_HEIGHT; replaceInputCombobox.setBounds(replaceInputComboBoxX, replaceInputComboBoxY, replaceInputComboBoxWidth, replaceInputComboBoxHeight); } - private void setFindInputComboboxBounds(int x, int y, int templateWidth) { - findInputComboBoxX = x + templateWidth / 60; - findInputComboBoxY = y + 55; - findInputComboBoxWidth = templateWidth / 3 + templateWidth / 30 * 2; - findInputComboBoxHeight = 25; + private void setFindInputComboboxBounds() { + findInputComboBoxX = FIRST_X; + findInputComboBoxY = SECOND_Y; + findInputComboBoxWidth = inputLength - GAP; + findInputComboBoxHeight = COMPONENT_HEIGHT; findInputCombobox.setBounds(findInputComboBoxX, findInputComboBoxY, findInputComboBoxWidth, findInputComboBoxHeight); } - private void setUIRadioButtonBounds(int x, int y, int templateWidth) { - matchX = x + templateWidth / 60; - matchY = y + 90; + private void setUIRadioButtonBounds() { + matchX = FIRST_X; + matchY = THIRD_Y; matchWidth = MATCH_WIDTH; - matchHeight = 25; + matchHeight = COMPONENT_HEIGHT; matchRadioButton.setBounds(matchX, matchY, matchWidth, matchHeight); } - private void setRangeComboboxBounds(int x, int y, int templateWidth) { - rangeComboBoxX = x + templateWidth / 2 + templateWidth / 15; - rangeComboBoxY = y + 20; - rangeComboBoxWidth = templateWidth / 3 + templateWidth / 60; - rangeComboBoxHeight = 25; + private void setRangeComboboxBounds() { + rangeComboBoxX = rangeLabelX + rangeLabelWidth; + rangeComboBoxY = FIRST_Y; + rangeComboBoxWidth = inputLength - 3 * GAP; + rangeComboBoxHeight = COMPONENT_HEIGHT; rangeCombobox.setBounds(rangeComboBoxX, rangeComboBoxY, rangeComboBoxWidth, rangeComboBoxHeight); } - private void setFindComboboxBounds(int x, int y, int templateWidth) { - findComboBoxX = x + templateWidth / 30 * 2; - findComboBoxY = y + 20; - findComboBoxWidth = templateWidth / 3 + templateWidth / 60; - findComboBoxHeight = 25; + private void setFindComboboxBounds() { + findComboBoxX = SECOND_X; + findComboBoxY = FIRST_Y; + findComboBoxWidth = inputLength - 4 * GAP; + findComboBoxHeight = COMPONENT_HEIGHT; findCombobox.setBounds(findComboBoxX, findComboBoxY, findComboBoxWidth, findComboBoxHeight); } - private void setResultLabelBounds(int x, int y, int templateWidth) { - resultLabelX = findLabelX; - resultLabelY = y + 125; + private void setResultLabelBounds(int templateWidth) { + resultLabelX = FIRST_X; + resultLabelY = FOURTH_Y; resultLabelWidth = templateWidth; - resultLabelHeight = 25; + resultLabelHeight = COMPONENT_HEIGHT; resultLabel.setBounds(resultLabelX, resultLabelY, resultLabelWidth, resultLabelHeight); } - private void setRangeLabelBounds(int x, int y, int templateWidth) { - rangeLabelX = x + templateWidth / 2 + templateWidth / 60; - rangeLabelY = y + 20; - rangeLabelWidth = findLabelWidth; - rangeLabelHeight = 25; + private void setRangeLabelBounds() { + rangeLabelX = replaceInputComboBoxX; + rangeLabelY = FIRST_Y; + rangeLabelWidth = LABEL_WIDTH; + rangeLabelHeight = COMPONENT_HEIGHT; rangeLabel.setBounds(rangeLabelX, rangeLabelY, rangeLabelWidth, rangeLabelHeight); } - private void setFindLabelBounds(int x, int y, int templateWidth) { - findLabelX = x + templateWidth / 60; - findLabelY = y + 20; - findLabelWidth = templateWidth / 20; - findLabelHeight = 25; + private void setFindLabelBounds() { + findLabelX = FIRST_X; + findLabelY = FIRST_Y; + findLabelWidth = LABEL_WIDTH; + findLabelHeight = COMPONENT_HEIGHT; findLabel.setBounds(findLabelX, findLabelY, findLabelWidth, findLabelHeight); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java index a240eba967..ef27f7e47e 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java @@ -1,8 +1,12 @@ package com.fr.design.actions.replace.ui; +import javax.swing.BorderFactory; +import javax.swing.JPanel; import javax.swing.RowSorter; +import javax.swing.border.EmptyBorder; import javax.swing.table.TableRowSorter; import java.awt.Color; +import java.awt.Label; /** * 下面板 @@ -18,10 +22,13 @@ public class ITReplaceSouthPanel { public static final int CHECKBOX_INDEX = 0; //ITContent在表格的列索引 public static final int CONTENT_INDEX = 6; + public static final int TABLE_GAP = 20; public ITReplaceSouthPanel() { itTableEditor = new ITTableEditor(); tableEditorPane = new ITTableEditorPane<>(itTableEditor); + //左右两边间距20 + tableEditorPane.setBorder(BorderFactory.createEmptyBorder(0,TABLE_GAP,0,TABLE_GAP)); RowSorter sorter = new TableRowSorter(itTableEditor){ @Override public boolean isSortable(int column) { @@ -29,6 +36,7 @@ public class ITReplaceSouthPanel { } }; tableEditorPane.getEditTable().setRowSorter(sorter); + tableEditorPane.getEditTable().setBorder(BorderFactory.createEmptyBorder()); tableEditorPane.getEditTable().setSelectionBackground(new Color(217, 235, 254)); tableEditorPane.getEditTable().setRowHeight(tableEditorPane.getEditTable().getRowHeight() / 2 + tableEditorPane.getEditTable().getRowHeight()); tableEditorPane.makeFace(tableEditorPane.getEditTable()); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java index a58091a06a..d64cd4efd4 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java @@ -7,14 +7,20 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.share.ui.base.MouseClickListener; import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; +import com.fr.general.FRFont; import com.fr.stable.StringUtils; +import com.fr.third.com.lowagie.text.FontFactory; import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JPanel; +import javax.swing.SwingConstants; import java.awt.Color; import java.awt.Cursor; +import java.awt.Font; import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import java.awt.event.MouseEvent; /** @@ -29,7 +35,8 @@ public class ITReplaceWestPanel { private UILabel iconLabel; private static final Icon HELP_ICON = IconUtils.readIcon("com/fr/design/images/buttonicon/replace_help.svg"); private static final String HELP_URL = CloudCenter.getInstance().acquireUrlByKind("design.replace.help", "https://help.fanruan.com/finereport/doc-view-4954.html?source=3"); - private static final int FILL_COUNT = 13; + private static final int FILL_COUNT = 12; + public static final int LEFT_WIDTH = 100; public ITReplaceWestPanel() { @@ -37,6 +44,18 @@ public class ITReplaceWestPanel { iconLabel = new UILabel("" + Toolkit.i18nText("Fine-Design_Report_Community_Help") + ""); UIToggleButton contentButton = new UIToggleButton(Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); + contentButton.setText(""+Toolkit.i18nText("Fine-Design_Basic_Templates_Content")+ ""); + contentButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + if (!contentButton.isSelected()) { + contentButton.setText(""+Toolkit.i18nText("Fine-Design_Basic_Templates_Content")+ ""); + } else { + contentButton.setText(Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); + } + } + }); + leftPanel.setBackground(Color.WHITE); contentButton.setSelected(true); contentButton.setBorderPainted(false); leftPanel.add(contentButton); @@ -47,8 +66,8 @@ public class ITReplaceWestPanel { } //添加帮助文档按钮及超链 - iconLabel.setIcon(HELP_ICON); iconLabel.setToolTipText(Toolkit.i18nText("Fine-Design_Replace_Tooltip")); + iconLabel.setHorizontalAlignment(SwingConstants.CENTER); //设置游标 iconLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); iconLabel.addMouseListener(new MouseClickListener() { @@ -58,6 +77,7 @@ public class ITReplaceWestPanel { } }); leftPanel.add(iconLabel); + leftPanel.add(new UILabel(StringUtils.EMPTY)); } public JPanel getLeftPanel() { From 8b4065e774318c10ff85c7de65a1f7fcd8ffda01 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 18 Oct 2022 18:27:31 +0800 Subject: [PATCH 2/7] =?UTF-8?q?REPORT-75998=20=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/replace/ui/ITReplaceMainDialog.java | 4 ++-- .../com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java | 4 ++-- .../com/fr/design/actions/replace/ui/ITReplaceWestPanel.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index 6ea30d9896..d0ae2d13cc 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -56,7 +56,7 @@ public class ITReplaceMainDialog extends UIDialog { private String searchStr; private static final int FIRST_ROW = 0; public static int selectCount = 0; - public static int MAIN_PANEL_WIDTH = 929 ; + public static int MAIN_PANEL_WIDTH = 929; public ITReplaceMainDialog() { super(DesignerContext.getDesignerFrame()); @@ -126,7 +126,7 @@ public class ITReplaceMainDialog extends UIDialog { replaceComboBox.setEnabled(false); replaceComboBox.setEditable(true); northPane.getReplaceButton().setEnabled(false); - westPanel.getLeftPanel().setPreferredSize(new Dimension(ITReplaceWestPanel.LEFT_WIDTH,this.getHeight())); + westPanel.getLeftPanel().setPreferredSize(new Dimension(ITReplaceWestPanel.LEFT_WIDTH, this.getHeight())); ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Search_Input")); ((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Input")); ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).addActionListener(new ActionListener() { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java index ef27f7e47e..f3dc6296ec 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java @@ -28,8 +28,8 @@ public class ITReplaceSouthPanel { itTableEditor = new ITTableEditor(); tableEditorPane = new ITTableEditorPane<>(itTableEditor); //左右两边间距20 - tableEditorPane.setBorder(BorderFactory.createEmptyBorder(0,TABLE_GAP,0,TABLE_GAP)); - RowSorter sorter = new TableRowSorter(itTableEditor){ + tableEditorPane.setBorder(BorderFactory.createEmptyBorder(0, TABLE_GAP, 0, TABLE_GAP)); + RowSorter sorter = new TableRowSorter(itTableEditor) { @Override public boolean isSortable(int column) { return column != CHECKBOX_INDEX || column != CONTENT_INDEX; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java index d64cd4efd4..344a37f9b0 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java @@ -44,12 +44,12 @@ public class ITReplaceWestPanel { iconLabel = new UILabel("" + Toolkit.i18nText("Fine-Design_Report_Community_Help") + ""); UIToggleButton contentButton = new UIToggleButton(Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); - contentButton.setText(""+Toolkit.i18nText("Fine-Design_Basic_Templates_Content")+ ""); + contentButton.setText("" + Toolkit.i18nText("Fine-Design_Basic_Templates_Content") + ""); contentButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (!contentButton.isSelected()) { - contentButton.setText(""+Toolkit.i18nText("Fine-Design_Basic_Templates_Content")+ ""); + contentButton.setText("" + Toolkit.i18nText("Fine-Design_Basic_Templates_Content") + ""); } else { contentButton.setText(Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); } From 8f657a3d85d13a78f2e9309979508cb2021acb89 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 18 Oct 2022 18:29:32 +0800 Subject: [PATCH 3/7] =?UTF-8?q?REPORT-75998=20=E4=BC=98=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/replace/ui/ITReplaceWestPanel.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java index 344a37f9b0..5497169e90 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java @@ -37,6 +37,7 @@ public class ITReplaceWestPanel { private static final String HELP_URL = CloudCenter.getInstance().acquireUrlByKind("design.replace.help", "https://help.fanruan.com/finereport/doc-view-4954.html?source=3"); private static final int FILL_COUNT = 12; public static final int LEFT_WIDTH = 100; + public static final String CONTENT_TEXT = "" + Toolkit.i18nText("Fine-Design_Basic_Templates_Content") + ""; public ITReplaceWestPanel() { @@ -44,12 +45,12 @@ public class ITReplaceWestPanel { iconLabel = new UILabel("" + Toolkit.i18nText("Fine-Design_Report_Community_Help") + ""); UIToggleButton contentButton = new UIToggleButton(Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); - contentButton.setText("" + Toolkit.i18nText("Fine-Design_Basic_Templates_Content") + ""); + contentButton.setText(CONTENT_TEXT); contentButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (!contentButton.isSelected()) { - contentButton.setText("" + Toolkit.i18nText("Fine-Design_Basic_Templates_Content") + ""); + contentButton.setText(CONTENT_TEXT); } else { contentButton.setText(Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); } From 79cfbaee26ac9b29a61b8a621e9b2d3d4f661520 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 19 Oct 2022 09:14:02 +0800 Subject: [PATCH 4/7] =?UTF-8?q?REPORT-75998=20=E5=8E=BB=E9=99=A4=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E7=9A=84=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/replace/ui/ITReplaceMainDialog.java | 1 - .../com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java | 3 --- .../com/fr/design/actions/replace/ui/ITReplaceWestPanel.java | 3 --- 3 files changed, 7 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index d0ae2d13cc..4e31314e4e 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -20,7 +20,6 @@ import com.fr.general.GeneralUtils; import com.fr.stable.StringUtils; -import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import java.awt.BorderLayout; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java index f3dc6296ec..997013592d 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java @@ -1,12 +1,9 @@ package com.fr.design.actions.replace.ui; import javax.swing.BorderFactory; -import javax.swing.JPanel; import javax.swing.RowSorter; -import javax.swing.border.EmptyBorder; import javax.swing.table.TableRowSorter; import java.awt.Color; -import java.awt.Label; /** * 下面板 diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java index 5497169e90..0804efa23b 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java @@ -7,9 +7,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.share.ui.base.MouseClickListener; import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; -import com.fr.general.FRFont; import com.fr.stable.StringUtils; -import com.fr.third.com.lowagie.text.FontFactory; import javax.swing.BorderFactory; import javax.swing.Icon; @@ -17,7 +15,6 @@ import javax.swing.JPanel; import javax.swing.SwingConstants; import java.awt.Color; import java.awt.Cursor; -import java.awt.Font; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; From bfd6b9d984c80e713198575feadf048cf6d43be2 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 20 Oct 2022 10:30:05 +0800 Subject: [PATCH 5/7] =?UTF-8?q?REPORT-75998=20=E4=BF=AE=E6=94=B9UI?= =?UTF-8?q?=E4=B8=8E=E9=80=82=E9=85=8D=E9=80=BB=E8=BE=91(=E5=90=8C?= =?UTF-8?q?=E6=AD=A5final)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/images/replace/change_normal.svg | 3 + .../com/fr/design/images/replace/replace.png | Bin 418 -> 437 bytes .../design/images/replace/replace_normal.svg | 5 +- .../replace/ui/ITReplaceMainDialog.java | 7 +- .../replace/ui/ITReplaceNorthPanel.java | 152 ++++++++++-------- .../replace/ui/ITReplaceSouthPanel.java | 7 +- .../replace/ui/ITReplaceWestPanel.java | 22 ++- 7 files changed, 124 insertions(+), 72 deletions(-) create mode 100644 designer-base/src/main/resources/com/fr/design/images/replace/change_normal.svg diff --git a/designer-base/src/main/resources/com/fr/design/images/replace/change_normal.svg b/designer-base/src/main/resources/com/fr/design/images/replace/change_normal.svg new file mode 100644 index 0000000000..88d9e7772b --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/replace/change_normal.svg @@ -0,0 +1,3 @@ + + + diff --git a/designer-base/src/main/resources/com/fr/design/images/replace/replace.png b/designer-base/src/main/resources/com/fr/design/images/replace/replace.png index e736042724c17a037500b250aaeb5802acdb5366..b9a41125c56b58c9d71f27677bf6f951f453466a 100644 GIT binary patch delta 395 zcmV;60d)SN1GNJoiBL{Q4GJ0x0000DNk~Le0000E0000E2nGNE03S##(UBoFe@aP2 zK~#7Fl~PMm!axx184_16@C3#aFd<4=uHp^2fp`Mu2I39m26}^V0<&@c*INWAsQVwQOp9 z&ER)9Z!H+35c%x7&W%l+9~t9>e_qz@-o9)xg2_We;rce8C$GD*EC2&WHAK#4({afN z5E?w%2eR_53LN7qO<2M$TdU@Zqznj({3w*DzM2yae+7AWrz_EoOxEo@@vUx#kCet*T>;my~VLX8|Pm<}R zTt`u?KJ1bq*+V1R2dZ}|wRXc&@><3{WE7uZw$~V}QN=<6mJIA*)cQ(&|7-!92!bBu p=spY(l^HBE#tyn1r)m7}{vUt!e|(l%aLoV!002ovPDHLkV1gCat@{7~ delta 376 zcmV-;0f+vz1EK>ViBL{Q4GJ0x0000DNk~Le0000G0000G2nGNE03Y-JVUZyX`) zK~#7Fty0@j0x=ZL%~AjzKnEmbmk)p34xj_D0x7`~umYt6I&k^%Lv~3z04mUbXE&a^ z=s50UP~^^JlAPq8`#M7W)2Ip5I=c40P~``b&f3lTR|M=xR6G*V9?LQ2y_kRudl6e} z4{bz3sc>vevJZ{05Q?~ZGHN`C3 z+ - + + + + diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java index 9a2f5c8de7..4e31314e4e 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java @@ -55,6 +55,7 @@ public class ITReplaceMainDialog extends UIDialog { private String searchStr; private static final int FIRST_ROW = 0; public static int selectCount = 0; + public static int MAIN_PANEL_WIDTH = 929; public ITReplaceMainDialog() { super(DesignerContext.getDesignerFrame()); @@ -97,8 +98,8 @@ public class ITReplaceMainDialog extends UIDialog { int width = jTemplate.getWidth(); Point point = jTemplate.getLocationOnScreen(); setModal(false); - setMaximumSize(new Dimension(jTemplate.getWidth(), jTemplate.getHeight())); - setMinimumSize(new Dimension(jTemplate.getWidth(), 240)); + setMaximumSize(new Dimension(width, jTemplate.getHeight())); + setMinimumSize(new Dimension(width, 240)); setSize(width, height); setLocation(new Point(point.x, point.y + jTemplate.getHeight() / 2 + jTemplate.getHeight() / 2 - 385)); @@ -124,7 +125,7 @@ public class ITReplaceMainDialog extends UIDialog { replaceComboBox.setEnabled(false); replaceComboBox.setEditable(true); northPane.getReplaceButton().setEnabled(false); - + westPanel.getLeftPanel().setPreferredSize(new Dimension(ITReplaceWestPanel.LEFT_WIDTH, this.getHeight())); ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Search_Input")); ((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Input")); ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).addActionListener(new ActionListener() { diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java index a4fe1fef0f..909ce7112a 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java @@ -1,5 +1,6 @@ package com.fr.design.actions.replace.ui; +import com.fr.base.svg.IconUtils; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icontainer.UIScrollPane; @@ -9,7 +10,9 @@ import com.fr.design.i18n.Toolkit; import com.fr.stable.StringUtils; +import javax.swing.BorderFactory; import javax.swing.ComboBoxEditor; +import javax.swing.Icon; import javax.swing.JCheckBox; import javax.swing.JPanel; import javax.swing.ScrollPaneConstants; @@ -34,20 +37,28 @@ public class ITReplaceNorthPanel { private UIComboBox findCombobox; private UIComboBox rangeCombobox; private JCheckBox matchRadioButton; + private UILabel iconLabel; private UIComboBox findInputCombobox; private UIComboBox replaceInputCombobox; private UIScrollPane scrollPane; private UIButton replaceButton; private UIButton searchButton; + private static double rate = 1.00; //存储的5次最近输入 private int maxItemCount = 5; - private static final int LIMIT_WIDTH = 1250; + private static int limit_width = 800; private static final int HEIGHT = 161; - private static final int BUTTON_WIDTH = 60; - private static final int BUTTON_GAP = 20; + private static final int BUTTON_WIDTH = 44; + private static final int GAP = 20; + private static final int BUTTON_GAP = 10; private static final int MATCH_WIDTH = 70; + private static final int COMPONENT_HEIGHT = 25; + private static final int FIRST_Y = 15, SECOND_Y = 50, THIRD_Y = 85, FOURTH_Y = 120; + private static final int FIRST_X = 20, SECOND_X = 80; + private static final int LABEL_WIDTH = 60; + private static final Icon CHANGE_ICON = IconUtils.readIcon("/com/fr/design/images/replace/change_normal.svg"); private int findLabelX, findLabelY, findLabelWidth, findLabelHeight; @@ -60,7 +71,8 @@ public class ITReplaceNorthPanel { private int replaceInputComboBoxX, replaceInputComboBoxY, replaceInputComboBoxWidth, replaceInputComboBoxHeight; private int replaceButtonX, replaceButtonY, replaceButtonHeight; private int searchButtonX, searchButtonY, searchButtonHeight; - + private int iconX, iconY, iconWidth, iconHeight; + private int inputLength; public static ArrayList findItems = new ArrayList<>(); public static ArrayList findInputItems = new ArrayList<>(); @@ -81,6 +93,7 @@ public class ITReplaceNorthPanel { findLabel = new UILabel(Toolkit.i18nText("Fine-Design_Replace_Search_Element")); rangeLabel = new UILabel(Toolkit.i18nText("Fine-Design_Replace_Search_Range")); + iconLabel = new UILabel(CHANGE_ICON); resultLabel = new UILabel(); String[] rangeItems = new String[]{Toolkit.i18nText("Fine-Design_Basic_Export_JS_Template_Current")}; @@ -109,7 +122,7 @@ public class ITReplaceNorthPanel { replaceButton = new UIButton(Toolkit.i18nText("Fine-Design_Replace_Button")); searchButton = new UIButton(Toolkit.i18nText("Fine-Design_Search_Button")); - upPanel.setPreferredSize(new Dimension(LIMIT_WIDTH, HEIGHT)); + upPanel.setPreferredSize(new Dimension(limit_width, HEIGHT)); scrollPane = new UIScrollPane(upPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); upPanel.add(findLabel); upPanel.add(rangeLabel); @@ -121,6 +134,8 @@ public class ITReplaceNorthPanel { upPanel.add(matchRadioButton); upPanel.add(replaceButton); upPanel.add(searchButton); + upPanel.add(iconLabel); + scrollPane.setBorder(BorderFactory.createEmptyBorder()); } /** @@ -129,9 +144,8 @@ public class ITReplaceNorthPanel { * @param width */ public void setLimitSize(int width) { - width = Math.max(LIMIT_WIDTH, width); - upPanel.setMaximumSize(new Dimension(width, 161)); - upPanel.setPreferredSize(new Dimension(width, 161)); + upPanel.setMaximumSize(new Dimension(limit_width, 161)); + upPanel.setPreferredSize(new Dimension(limit_width, 161)); } @@ -144,21 +158,22 @@ public class ITReplaceNorthPanel { */ public void fitScreen(int x, int y, int templateWidth) { - templateWidth = Math.max(templateWidth, LIMIT_WIDTH); - - setFindLabelBounds(x, y, templateWidth); - setRangeLabelBounds(x, y, templateWidth); - setResultLabelBounds(x, y, templateWidth); + templateWidth = Math.max(ITReplaceMainDialog.MAIN_PANEL_WIDTH, templateWidth); + templateWidth = templateWidth - ITReplaceWestPanel.LEFT_WIDTH; + inputLength = (templateWidth - GAP * 5) / 2; - setFindComboboxBounds(x, y, templateWidth); - setRangeComboboxBounds(x, y, templateWidth); - setFindInputComboboxBounds(x, y, templateWidth); - setReplaceInputComboboxBounds(x, y, templateWidth); - - setUIRadioButtonBounds(x, y, templateWidth); - setReplaceButtonBounds(x, y, templateWidth); - setSearchButtonBounds(x, y, templateWidth); + setFindLabelBounds(); + setResultLabelBounds(templateWidth); + setFindComboboxBounds(); + setFindInputComboboxBounds(); + setReplaceInputComboboxBounds(templateWidth); + setRangeLabelBounds(); + setRangeComboboxBounds(); + setUIRadioButtonBounds(); + setReplaceButtonBounds(); + setSearchButtonBounds(); + setIconLabelBounds(); } @@ -214,87 +229,94 @@ public class ITReplaceNorthPanel { this.scrollPane = scrollPane; } + private void setIconLabelBounds() { + iconX = inputLength + GAP; + iconY = SECOND_Y; + iconWidth = GAP; + iconHeight = COMPONENT_HEIGHT; + iconLabel.setBounds(iconX, iconY, iconWidth, iconHeight); + } - private void setSearchButtonBounds(int x, int y, int templateWidth) { - searchButtonHeight = 25; - searchButtonY = resultLabelY; + private void setSearchButtonBounds() { + searchButtonHeight = COMPONENT_HEIGHT; + searchButtonY = FOURTH_Y; searchButtonX = replaceInputComboBoxX + replaceInputComboBoxWidth - BUTTON_WIDTH * 2 - BUTTON_GAP; searchButton.setBounds(searchButtonX, searchButtonY, BUTTON_WIDTH, searchButtonHeight); } - private void setReplaceButtonBounds(int x, int y, int templateWidth) { - replaceButtonHeight = 25; - replaceButtonY = resultLabelY; + private void setReplaceButtonBounds() { + replaceButtonHeight = COMPONENT_HEIGHT; + replaceButtonY = FOURTH_Y; replaceButtonX = replaceInputComboBoxX + replaceInputComboBoxWidth - BUTTON_WIDTH; replaceButton.setBounds(replaceButtonX, replaceButtonY, BUTTON_WIDTH, replaceButtonHeight); } - private void setReplaceInputComboboxBounds(int x, int y, int templateWidth) { - replaceInputComboBoxX = x + templateWidth / 2 + templateWidth / 60; - replaceInputComboBoxY = y + 55; - replaceInputComboBoxWidth = templateWidth / 3 + templateWidth / 30 * 2; - replaceInputComboBoxHeight = 25; + private void setReplaceInputComboboxBounds(int templateWidth) { + replaceInputComboBoxX = templateWidth - inputLength - GAP * 2; + replaceInputComboBoxY = SECOND_Y; + replaceInputComboBoxWidth = inputLength; + replaceInputComboBoxHeight = COMPONENT_HEIGHT; replaceInputCombobox.setBounds(replaceInputComboBoxX, replaceInputComboBoxY, replaceInputComboBoxWidth, replaceInputComboBoxHeight); } - private void setFindInputComboboxBounds(int x, int y, int templateWidth) { - findInputComboBoxX = x + templateWidth / 60; - findInputComboBoxY = y + 55; - findInputComboBoxWidth = templateWidth / 3 + templateWidth / 30 * 2; - findInputComboBoxHeight = 25; + private void setFindInputComboboxBounds() { + findInputComboBoxX = FIRST_X; + findInputComboBoxY = SECOND_Y; + findInputComboBoxWidth = inputLength - GAP; + findInputComboBoxHeight = COMPONENT_HEIGHT; findInputCombobox.setBounds(findInputComboBoxX, findInputComboBoxY, findInputComboBoxWidth, findInputComboBoxHeight); } - private void setUIRadioButtonBounds(int x, int y, int templateWidth) { - matchX = x + templateWidth / 60; - matchY = y + 90; + private void setUIRadioButtonBounds() { + matchX = FIRST_X; + matchY = THIRD_Y; matchWidth = MATCH_WIDTH; - matchHeight = 25; + matchHeight = COMPONENT_HEIGHT; matchRadioButton.setBounds(matchX, matchY, matchWidth, matchHeight); } - private void setRangeComboboxBounds(int x, int y, int templateWidth) { - rangeComboBoxX = x + templateWidth / 2 + templateWidth / 15; - rangeComboBoxY = y + 20; - rangeComboBoxWidth = templateWidth / 3 + templateWidth / 60; - rangeComboBoxHeight = 25; + private void setRangeComboboxBounds() { + rangeComboBoxX = rangeLabelX + rangeLabelWidth; + rangeComboBoxY = FIRST_Y; + rangeComboBoxWidth = inputLength - 3 * GAP; + rangeComboBoxHeight = COMPONENT_HEIGHT; rangeCombobox.setBounds(rangeComboBoxX, rangeComboBoxY, rangeComboBoxWidth, rangeComboBoxHeight); } - private void setFindComboboxBounds(int x, int y, int templateWidth) { - findComboBoxX = x + templateWidth / 30 * 2; - findComboBoxY = y + 20; - findComboBoxWidth = templateWidth / 3 + templateWidth / 60; - findComboBoxHeight = 25; + private void setFindComboboxBounds() { + findComboBoxX = SECOND_X; + findComboBoxY = FIRST_Y; + findComboBoxWidth = inputLength - 4 * GAP; + findComboBoxHeight = COMPONENT_HEIGHT; findCombobox.setBounds(findComboBoxX, findComboBoxY, findComboBoxWidth, findComboBoxHeight); } - private void setResultLabelBounds(int x, int y, int templateWidth) { - resultLabelX = findLabelX; - resultLabelY = y + 125; + private void setResultLabelBounds(int templateWidth) { + resultLabelX = FIRST_X; + resultLabelY = FOURTH_Y; resultLabelWidth = templateWidth; - resultLabelHeight = 25; + resultLabelHeight = COMPONENT_HEIGHT; resultLabel.setBounds(resultLabelX, resultLabelY, resultLabelWidth, resultLabelHeight); } - private void setRangeLabelBounds(int x, int y, int templateWidth) { - rangeLabelX = x + templateWidth / 2 + templateWidth / 60; - rangeLabelY = y + 20; - rangeLabelWidth = findLabelWidth; - rangeLabelHeight = 25; + private void setRangeLabelBounds() { + rangeLabelX = replaceInputComboBoxX; + rangeLabelY = FIRST_Y; + rangeLabelWidth = LABEL_WIDTH; + rangeLabelHeight = COMPONENT_HEIGHT; rangeLabel.setBounds(rangeLabelX, rangeLabelY, rangeLabelWidth, rangeLabelHeight); } - private void setFindLabelBounds(int x, int y, int templateWidth) { - findLabelX = x + templateWidth / 60; - findLabelY = y + 20; - findLabelWidth = templateWidth / 20; - findLabelHeight = 25; + private void setFindLabelBounds() { + findLabelX = FIRST_X; + findLabelY = FIRST_Y; + findLabelWidth = LABEL_WIDTH; + findLabelHeight = COMPONENT_HEIGHT; findLabel.setBounds(findLabelX, findLabelY, findLabelWidth, findLabelHeight); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java index a240eba967..997013592d 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceSouthPanel.java @@ -1,5 +1,6 @@ package com.fr.design.actions.replace.ui; +import javax.swing.BorderFactory; import javax.swing.RowSorter; import javax.swing.table.TableRowSorter; import java.awt.Color; @@ -18,17 +19,21 @@ public class ITReplaceSouthPanel { public static final int CHECKBOX_INDEX = 0; //ITContent在表格的列索引 public static final int CONTENT_INDEX = 6; + public static final int TABLE_GAP = 20; public ITReplaceSouthPanel() { itTableEditor = new ITTableEditor(); tableEditorPane = new ITTableEditorPane<>(itTableEditor); - RowSorter sorter = new TableRowSorter(itTableEditor){ + //左右两边间距20 + tableEditorPane.setBorder(BorderFactory.createEmptyBorder(0, TABLE_GAP, 0, TABLE_GAP)); + RowSorter sorter = new TableRowSorter(itTableEditor) { @Override public boolean isSortable(int column) { return column != CHECKBOX_INDEX || column != CONTENT_INDEX; } }; tableEditorPane.getEditTable().setRowSorter(sorter); + tableEditorPane.getEditTable().setBorder(BorderFactory.createEmptyBorder()); tableEditorPane.getEditTable().setSelectionBackground(new Color(217, 235, 254)); tableEditorPane.getEditTable().setRowHeight(tableEditorPane.getEditTable().getRowHeight() / 2 + tableEditorPane.getEditTable().getRowHeight()); tableEditorPane.makeFace(tableEditorPane.getEditTable()); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java index a58091a06a..0804efa23b 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceWestPanel.java @@ -12,9 +12,12 @@ import com.fr.stable.StringUtils; import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JPanel; +import javax.swing.SwingConstants; import java.awt.Color; import java.awt.Cursor; import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import java.awt.event.MouseEvent; /** @@ -29,7 +32,9 @@ public class ITReplaceWestPanel { private UILabel iconLabel; private static final Icon HELP_ICON = IconUtils.readIcon("com/fr/design/images/buttonicon/replace_help.svg"); private static final String HELP_URL = CloudCenter.getInstance().acquireUrlByKind("design.replace.help", "https://help.fanruan.com/finereport/doc-view-4954.html?source=3"); - private static final int FILL_COUNT = 13; + private static final int FILL_COUNT = 12; + public static final int LEFT_WIDTH = 100; + public static final String CONTENT_TEXT = "" + Toolkit.i18nText("Fine-Design_Basic_Templates_Content") + ""; public ITReplaceWestPanel() { @@ -37,6 +42,18 @@ public class ITReplaceWestPanel { iconLabel = new UILabel("" + Toolkit.i18nText("Fine-Design_Report_Community_Help") + ""); UIToggleButton contentButton = new UIToggleButton(Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); + contentButton.setText(CONTENT_TEXT); + contentButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + if (!contentButton.isSelected()) { + contentButton.setText(CONTENT_TEXT); + } else { + contentButton.setText(Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); + } + } + }); + leftPanel.setBackground(Color.WHITE); contentButton.setSelected(true); contentButton.setBorderPainted(false); leftPanel.add(contentButton); @@ -47,8 +64,8 @@ public class ITReplaceWestPanel { } //添加帮助文档按钮及超链 - iconLabel.setIcon(HELP_ICON); iconLabel.setToolTipText(Toolkit.i18nText("Fine-Design_Replace_Tooltip")); + iconLabel.setHorizontalAlignment(SwingConstants.CENTER); //设置游标 iconLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); iconLabel.addMouseListener(new MouseClickListener() { @@ -58,6 +75,7 @@ public class ITReplaceWestPanel { } }); leftPanel.add(iconLabel); + leftPanel.add(new UILabel(StringUtils.EMPTY)); } public JPanel getLeftPanel() { From bbd4658c0a6e6403c26c122d2e277505e701c2a3 Mon Sep 17 00:00:00 2001 From: Carlson Date: Thu, 20 Oct 2022 20:09:21 +0800 Subject: [PATCH 6/7] =?UTF-8?q?REPORT-79287=20fix:=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E7=BC=96=E8=BE=91=E7=95=8C=E9=9D=A2=E6=9B=B4?= =?UTF-8?q?=E6=8D=A2=E6=95=B0=E6=8D=AE=E9=9B=86=E5=90=8E=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E7=9A=84=E5=8C=B9=E9=85=8D=E6=B8=85=E7=A9=BA=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=B8=85=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/chart/gui/data/TableDataPane.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java index 8863977740..55745cd1d2 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java @@ -15,10 +15,10 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.utils.gui.UIComponentUtils; +import com.fr.stable.StringUtils; -import javax.swing.BorderFactory; -import java.awt.BorderLayout; -import java.awt.Dimension; +import javax.swing.*; +import java.awt.*; public class TableDataPane extends FurtherBasicBeanPane{ private static final long serialVersionUID = 4740461028440155147L; @@ -74,6 +74,10 @@ public class TableDataPane extends FurtherBasicBeanPane{ return; } if(dataContentPane != null) { + // 如果属性编辑画板中选中的数据集发生改变,则清空之前的匹配项 + if (!StringUtils.equals(dataContentPane.getTableName(), dataWrap.getTableDataName())) { + dataContentPane.clearAllBoxList(); + } dataContentPane.onSelectTableData(dataWrap); dataContentPane.setTableName(dataWrap.getTableDataName()); } From 1128719f38515e29c583ce82b68b3fff81d0f49e Mon Sep 17 00:00:00 2001 From: Carlson Date: Fri, 21 Oct 2022 14:37:12 +0800 Subject: [PATCH 7/7] =?UTF-8?q?REPORT-79287=20import=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/chart/gui/data/TableDataPane.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java index 55745cd1d2..82240bc6d2 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java @@ -17,8 +17,9 @@ import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane import com.fr.design.utils.gui.UIComponentUtils; import com.fr.stable.StringUtils; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import java.awt.BorderLayout; +import java.awt.Dimension; public class TableDataPane extends FurtherBasicBeanPane{ private static final long serialVersionUID = 4740461028440155147L;