Browse Source

Merge branch 'release/10.0' of https://code.fineres.com/scm/~qinghui.liu/design into release/10.0

feature/big-screen
Qinghui.Liu 4 years ago
parent
commit
509b990a2d
  1. 56
      designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java
  2. 3
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java
  3. 4
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java
  4. 14
      designer-base/src/main/java/com/fr/design/extra/ShopDialog.java
  5. 17
      designer-base/src/main/java/com/fr/design/gui/frpane/UINumberDragPane.java
  6. 10
      designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java
  7. 3
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/ConfigurableCaret.java
  8. 1
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  9. 2
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  10. 67
      designer-base/src/main/java/com/fr/design/utils/DesignUtils.java
  11. 4
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/other/VanChartGanttConditionPane.java
  12. 17
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttLabelConditionPane.java
  13. 25
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelNoCheckPane.java
  14. 4
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/other/VanChartStructureConditionPane.java
  15. 17
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureLabelConditionPane.java
  16. 25
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelNoCheckPane.java
  17. 2
      designer-chart/src/main/resources/com/fr/design/editor/script/editor.js
  18. 4
      designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.js
  19. 24
      designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java
  20. 11
      designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java
  21. 9
      designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java
  22. 15
      designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java
  23. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java
  24. 38
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java
  25. 19
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java
  26. 31
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java
  27. 7
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java
  28. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java
  29. 11
      designer-realize/src/test/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRenderTest.java

56
designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java

@ -11,6 +11,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ipasswordfield.UIPasswordFieldWithFixedLength;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.ilable.ActionLabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -90,9 +91,9 @@ public class JDBCDefPane extends JPanel {
private IntegerEditor DBCP_MAX_WAIT = new IntegerEditor();
private UITextField DBCP_VALIDATION_QUERY = new UITextField();
private UIComboBox DBCP_TESTONBORROW = new UIComboBox(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Yes")});
private UIComboBox DBCP_TESTONRETURN = new UIComboBox(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Yes")});
private UIComboBox DBCP_TESTWHILEIDLE = new UIComboBox(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Yes")});
private UIComboBox DBCP_TESTONBORROW = new UIComboBox(new String[]{Toolkit.i18nText("Fine-Design_Basic_No"), Toolkit.i18nText("Fine-Design_Basic_Yes")});
private UIComboBox DBCP_TESTONRETURN = new UIComboBox(new String[]{Toolkit.i18nText("Fine-Design_Basic_No"), Toolkit.i18nText("Fine-Design_Basic_Yes")});
private UIComboBox DBCP_TESTWHILEIDLE = new UIComboBox(new String[]{Toolkit.i18nText("Fine-Design_Basic_No"), Toolkit.i18nText("Fine-Design_Basic_Yes")});
private IntegerEditor DBCP_TIMEBETWEENEVICTIONRUNSMILLS = new IntegerEditor();
private IntegerEditor DBCP_NUMTESTSPEREVICTIONRUN = new IntegerEditor();
@ -120,13 +121,13 @@ public class JDBCDefPane extends JPanel {
userNameTextField.setName(USER_NAME);
passwordTextField = new UIPasswordFieldWithFixedLength(15);
dbtypeButton = new UIButton(".");
dbtypeButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Click_Get_Default_URL"));
dbtypeButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Click_Get_Default_URL"));
dbtypeButton.addActionListener(dbtypeButtonActionListener);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
JPanel dbtypePane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane();
dbtypePane.add(new UILabel((com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database") + ":")));
dbtypePane.add(new UILabel((Toolkit.i18nText("Fine-Design_Basic_Database") + ":")));
JPanel dbtypeComPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
Component[][] dbtypeComComponents = {{dbtypeComboBox}};
double[] dbtypeRowSize = {p};
@ -134,10 +135,10 @@ public class JDBCDefPane extends JPanel {
dbtypeComPane = TableLayoutHelper.createTableLayoutPane(dbtypeComComponents, dbtypeRowSize, dbtypeColumnSize);
JPanel driverPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane();
driverPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Driver") + ":"));
driverPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Driver") + ":"));
// 选择ODBC数据源的时候的提示链接
JPanel odbcTipsPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane();
odbcTipsLink = new ActionLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Odbc_Tips")) {
odbcTipsLink = new ActionLabel(Toolkit.i18nText("Fine-Design_Basic_Odbc_Tips")) {
@Override
public void paintComponent(Graphics _gfx) {
super.paintComponent(_gfx);
@ -146,7 +147,7 @@ public class JDBCDefPane extends JPanel {
}
};
odbcTipsPane.add(odbcTipsLink);
odbcTipsLink.setPreferredSize(new Dimension(GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Odbc_Tips")), odbcTipsLink.getPreferredSize().height));
odbcTipsLink.setPreferredSize(new Dimension(GraphHelper.getWidth(Toolkit.i18nText("Fine-Design_Basic_Odbc_Tips")), odbcTipsLink.getPreferredSize().height));
odbcTipsLink.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
String url = CloudCenter.getInstance().acquireUrlByKind("odbc.help");
@ -167,26 +168,27 @@ public class JDBCDefPane extends JPanel {
urlComPane = TableLayoutHelper.createCommonTableLayoutPane(urlComComponents, urlRowSize, urlColumnSize, 4);
JPanel userPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane();
userPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_UserName") + ":"));
userPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Report_UserName") + ":"));
JPanel userComPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
Component[][] userComComponents = {{userNameTextField, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Password") + ":"), passwordTextField}};
Component[][] userComComponents = {{userNameTextField, new UILabel(Toolkit.i18nText("Fine-Design_Basic_Password") + ":"), passwordTextField}};
double[] userRowSize = {p};
double[] userColumnSize = {f, p, f};
userComPane = TableLayoutHelper.createCommonTableLayoutPane(userComComponents, userRowSize, userColumnSize, 4);
JPanel passwordPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane();
passwordPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Password") + ":"));
passwordPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Password") + ":"));
Component[][] components = {{dbtypePane, dbtypeComPane}, {driverPane, driverComboBoxAndTips}, {urlPane, urlComPane}, {userPane, userComPane},};
double[] rowSize = {p, p, p, p};
double[] columnSize = {p, f, 22};
JPanel centerPanel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 6);
// REPORT-41450 Windows环境的jdk11下dpi为125%时会因为缩放导致显示问题,因此加个水平gap值
JPanel centerPanel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 6, 6);
innerthis.add(centerPanel);
JPanel southPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
innerthis.add(southPanel);
southPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 4, 20));
ActionLabel actionLabel = new ActionLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ConnectionPool_Attr"));
ActionLabel actionLabel = new ActionLabel(Toolkit.i18nText("Fine-Design_Basic_ConnectionPool_Attr"));
southPanel.add(actionLabel, BorderLayout.EAST);
actionLabel.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
@ -331,7 +333,7 @@ public class JDBCDefPane extends JPanel {
if (ComparatorUtils.equals(dbtypeComboBox.getSelectedItem(), ("Access"))) {
// ben:这个能不能换种处理方案- -
JFileChooser filechooser = new JFileChooser();
filechooser.setDialogTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Open"));
filechooser.setDialogTitle(Toolkit.i18nText("Fine-Design_Basic_Open"));
filechooser.setMultiSelectionEnabled(false);
filechooser.addChoosableFileFilter(new ChooseFileFilter(new String[]{"accdb", "mdb"}, "Microsoft Office Access"));
int result = filechooser.showOpenDialog(DesignerContext.getDesignerFrame());
@ -373,19 +375,19 @@ public class JDBCDefPane extends JPanel {
double[] rowSize = {f, f, f, f, f, f, f, f, f, f, f, f};
double[] columnSize = {f, f};
Component[][] comps = {
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dbcp_Initial_Size") + ":", SwingConstants.RIGHT), DBCP_INITIAL_SIZE},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dbcp_Max_Active") + ":", SwingConstants.RIGHT), DBCP_MAX_ACTIVE},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dbcp_Max_Idle") + ":", SwingConstants.RIGHT), DBCP_MAX_IDLE},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dbcp_Min_Idle") + ":", SwingConstants.RIGHT), DBCP_MIN_IDLE},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Connection_Pool_Max_Wait_Time") + ":", SwingConstants.RIGHT), DBCP_MAX_WAIT},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dbcp_Validation_Query") + ":", SwingConstants.RIGHT), DBCP_VALIDATION_QUERY},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dbcp_Test_On_Borrow") + ":", SwingConstants.RIGHT), DBCP_TESTONBORROW},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dbcp_Test_On_Return") + ":", SwingConstants.RIGHT), DBCP_TESTONRETURN},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dbcp_Test_While_Idle") + ":", SwingConstants.RIGHT), DBCP_TESTWHILEIDLE},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Connection_Pool_Evictionruns_millis") + ":", SwingConstants.RIGHT),
{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Initial_Size") + ":", SwingConstants.RIGHT), DBCP_INITIAL_SIZE},
{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Max_Active") + ":", SwingConstants.RIGHT), DBCP_MAX_ACTIVE},
{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Max_Idle") + ":", SwingConstants.RIGHT), DBCP_MAX_IDLE},
{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Min_Idle") + ":", SwingConstants.RIGHT), DBCP_MIN_IDLE},
{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Connection_Pool_Max_Wait_Time") + ":", SwingConstants.RIGHT), DBCP_MAX_WAIT},
{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Validation_Query") + ":", SwingConstants.RIGHT), DBCP_VALIDATION_QUERY},
{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Test_On_Borrow") + ":", SwingConstants.RIGHT), DBCP_TESTONBORROW},
{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Test_On_Return") + ":", SwingConstants.RIGHT), DBCP_TESTONRETURN},
{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Test_While_Idle") + ":", SwingConstants.RIGHT), DBCP_TESTWHILEIDLE},
{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Connection_Pool_Evictionruns_millis") + ":", SwingConstants.RIGHT),
DBCP_TIMEBETWEENEVICTIONRUNSMILLS},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dbcp_Num_Test_Per_Evction_Run") + ":", SwingConstants.RIGHT), DBCP_NUMTESTSPEREVICTIONRUN},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Connection_Pool_Mix_Evictable_Idle_Time_Millis") + ":", SwingConstants.RIGHT),
{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Dbcp_Num_Test_Per_Evction_Run") + ":", SwingConstants.RIGHT), DBCP_NUMTESTSPEREVICTIONRUN},
{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Connection_Pool_Mix_Evictable_Idle_Time_Millis") + ":", SwingConstants.RIGHT),
DBCP_MINEVICTABLEIDLETIMEMILLIS}};
JPanel contextPane = TableLayoutHelper.createGapTableLayoutPane(comps, rowSize, columnSize, 10, 4);
@ -395,7 +397,7 @@ public class JDBCDefPane extends JPanel {
@Override
protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ConnectionPool_Attr");
return Toolkit.i18nText("Fine-Design_Basic_ConnectionPool_Attr");
}
}

3
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java

@ -185,7 +185,8 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
box.setMinimumSize(new Dimension(300, 400));
// 防止数据连接名过长时影响 split pane 分割效果
connectionTableProcedurePane.setMinimumSize(new Dimension(250, 400));
// 本界面中给MaxMemRowCountPanel留的空间太小,造成MaxMemRowCountPanel显示异常,这边减小一点最小宽度,拉长MaxMemRowCountPanel
connectionTableProcedurePane.setMinimumSize(new Dimension(230, 400));
connectionTableProcedurePane.setMaximumSize(new Dimension(500, 400));
// 使用SplitPane
JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, connectionTableProcedurePane, sqlSplitPane);

4
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java

@ -21,7 +21,7 @@ public class MaxMemRowCountPanel extends UIToolbar {
private static final int MAX_IN_MEMORY = 1;
private static final String[] CACHE_LIST = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Save_All_Records_In_Memory"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Max_Mem_Row_Count") };
private static final int MAX_WIDTH = getMaxComBoBoxWidth() > 200 ? 400 : 300;
private static final int MAX_WIDTH = getMaxComBoBoxWidth() > 200 ? 350 : 280;
private static final int MAX_COMPONENT_COUNT_OF_MAX_MEMORY = 4;
private static int getMaxComBoBoxWidth() {
int maxWidth = GraphHelper.getWidth(CACHE_LIST[0]);
@ -73,7 +73,7 @@ public class MaxMemRowCountPanel extends UIToolbar {
switchCache = new UIComboBox(CACHE_LIST);
switchCache.addActionListener(switchStateL);
numberSpinner = new UISpinner(0, Integer.MAX_VALUE, 1);
numberSpinner.setNumberFieldColumns(4);
numberSpinner.setNumberFieldColumns(3);
}
private void showAllPanel() {

14
designer-base/src/main/java/com/fr/design/extra/ShopDialog.java

@ -2,6 +2,7 @@ package com.fr.design.extra;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.UIDialog;
import com.fr.design.jdk.JdkVersion;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.StableUtils;
@ -12,7 +13,6 @@ import java.awt.*;
* Created by vito on 16/4/18.
*/
public class ShopDialog extends UIDialog {
private static final Dimension DEFAULT_SHOP = new Dimension(900, 700);
public ShopDialog(Frame frame, BasicPane pane) {
super(frame);
@ -22,11 +22,21 @@ public class ShopDialog extends UIDialog {
JPanel panel = (JPanel) getContentPane();
panel.setLayout(new BorderLayout());
add(pane, BorderLayout.CENTER);
setSize(DEFAULT_SHOP);
setSize(createDefaultDimension());
GUICoreUtils.centerWindow(this);
setResizable(false);
}
private Dimension createDefaultDimension() {
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
// jdk11 分辨率较低 缩放较大时 屏幕高度小于或接近设定的高度 需要调整下
if (JdkVersion.GE_9.support() && screenSize.height - 700 < 50) {
return new Dimension(900, screenSize.height - 100);
} else {
return new Dimension(900, 700);
}
}
@Override
public void checkValid() throws Exception {
// do nothing

17
designer-base/src/main/java/com/fr/design/gui/frpane/UINumberDragPane.java

@ -1,17 +1,16 @@
package com.fr.design.gui.frpane;
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.style.NumberDragBar;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Dimension;
public class UINumberDragPane extends BasicBeanPane<Double> implements GlobalNameObserver {
private static final long serialVersionUID = -8681716725163358249L;
@ -35,7 +34,7 @@ public class UINumberDragPane extends BasicBeanPane<Double> implements GlobalNam
public UINumberDragPane(double minValue, double maxValue, double dierta) {
dragBar = new NumberDragBar((int) minValue, (int) maxValue);
spinner = new UISpinner(minValue, maxValue, dierta, minValue);
spinner = createUISpinner(minValue, maxValue, dierta);
spinner.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation"));
this.setLayout(new BorderLayout(4, 0));
this.add(spinner, BorderLayout.EAST);
@ -66,6 +65,10 @@ public class UINumberDragPane extends BasicBeanPane<Double> implements GlobalNam
});
}
protected UISpinner createUISpinner(double minValue, double maxValue, double dierta) {
return new UISpinner(minValue, maxValue, dierta, minValue);
}
/**
* 添加事件
* @param l 事件

10
designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java

@ -3,11 +3,12 @@ package com.fr.design.gui.iprogressbar;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.UIDialog;
import com.fr.design.gui.ilable.UILabel;
import com.fr.stable.os.support.OSBasedAction;
import com.fr.stable.os.support.OSSupportCenter;
import com.fr.design.os.impl.SupportOSImpl;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRFont;
import com.fr.stable.os.support.OSBasedAction;
import com.fr.stable.os.support.OSSupportCenter;
import javax.swing.JDialog;
import javax.swing.JLabel;
@ -57,7 +58,10 @@ public class ProgressDialog extends UIDialog {
progressBar.setMaximum(1000);
panel.add(progressBar, BorderLayout.CENTER);
text = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Loading_Project"), JLabel.CENTER);
FRFont font = FRFont.getInstance().applySize(14).applyForeground(new ColorUIResource(333334));
FRFont font = DesignUtils
.getDefaultGUIFont()
.applySize(14)
.applyForeground(new ColorUIResource(333334));
text.setFont(font);
panel.add(text, BorderLayout.SOUTH);
panel.setVisible(true);

3
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/ConfigurableCaret.java

@ -458,7 +458,8 @@ public class ConfigurableCaret extends DefaultCaret {
Graphics2D g2 = (Graphics2D) g;
g2.setStroke(new BasicStroke(2));
// 向右再移动一个位置 避免光标太接近文字内容
g2.draw(new Line2D.Float(r.x + 1, r.y, r.x + 1, r.y + r.height));
// REPORT-41895 光标上方超出背景高亮的部分不会闪烁,会形成一个停留的小点,因此将光标的超出部分截去
g2.draw(new Line2D.Float(r.x + 1, r.y + 1, r.x + 1, r.y + r.height));
break;
} // End of switch (style).

1
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -551,6 +551,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
// 这个地方remove和add都是一个对象 完全没有必要remove再add 改变了窗口大小重新设置下 然后有repaint即可
basePane.setBounds(0, 0, contentWidth, contentHeight);
layeredPane.repaint();
layeredPane.revalidate();
}
/**

2
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java

@ -578,7 +578,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
}
});
nameField.selectAll();
nameField.setPreferredSize(new Dimension(180, 20));
nameField.setPreferredSize(new Dimension(170, 20));
JPanel topPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 5));
topPanel.setBorder(BorderFactory.createEmptyBorder(15, 15, 0, 15));

67
designer-base/src/main/java/com/fr/design/utils/DesignUtils.java

@ -8,6 +8,7 @@ import com.fr.design.ExtraDesignClassManager;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.fun.DesignerEnvProcessor;
import com.fr.design.gui.UILookAndFeel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.exit.DesignerExiter;
import com.fr.file.FileFILE;
@ -21,7 +22,9 @@ import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.os.OperatingSystem;
import com.fr.start.ServerStarter;
import com.fr.value.NotNullLazyValue;
import com.fr.workspace.WorkContext;
import org.jetbrains.annotations.NotNull;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
@ -248,6 +251,7 @@ public class DesignUtils {
// 刷新DesignerFrame里面的面板
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
if (DesignerContext.getDesignerFrame() == null) {
return;
@ -269,7 +273,7 @@ public class DesignUtils {
FineLoggerFactory.getLogger().error("Substance Raven Graphite failed to initialize");
}
//获取当前系统语言下设计器用的默认字体
FRFont guiFRFont = getCurrentLocaleFont();
FRFont guiFRFont = getDefaultGUIFont();
//指定UIManager中字体
Enumeration keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
@ -286,41 +290,50 @@ public class DesignUtils {
}
/**
* 获取当前系统语言下设计器用的默认字体
* 获取当前系统语言下设计器界面使用的默认字体
*
* @return 默认字体
*/
private static FRFont getCurrentLocaleFont() {
FRFont guiFRFont;
Locale defaultLocale = Locale.getDefault();
// JDK9 之后宋体在计算label中字母的空间上出现问题,暂时先用雅黑兼容,以后再统一字体
if (StableUtils.getMajorJavaVersion() >= 9 && OperatingSystem.isWindows()) {
guiFRFont = getNamedFont("Microsoft YaHei");
} else if (isDisplaySimSun(defaultLocale)) {
guiFRFont = getNamedFont("SimSun");
} else {
guiFRFont = getNamedFont("Dialog");
}
public static FRFont getDefaultGUIFont() {
return CURRENT_LOCALE_FONT.getValue();
}
//先初始化的设计器locale, 后初始化lookandfeel.如果顺序改了, 这边也要调整.
Locale designerLocale = GeneralContext.getLocale();
String file = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_File");
char displayChar = file.charAt(0);
if (!guiFRFont.canDisplay(displayChar)) {
//如果不能用默认的语言显示字体, 比如想在英文系统里用中文设计器
//默认语言(中文:宋体, 英文:Tahoma, 其他:Dialog)
guiFRFont = getNamedFont("SimSun");
if (!guiFRFont.canDisplay(displayChar)) {
//比如想在中文或英文系统里用韩文设计器
/**
* 获取当前系统语言下设计器用的默认字体
*/
private static final NotNullLazyValue<FRFont> CURRENT_LOCALE_FONT = new NotNullLazyValue<FRFont>() {
@NotNull
@Override
protected FRFont compute() {
FRFont guiFRFont;
Locale defaultLocale = Locale.getDefault();
// JDK9 之后宋体在计算label中字母的空间上出现问题,暂时先用雅黑兼容,以后再统一字体
if (StableUtils.getMajorJavaVersion() >= 9 && OperatingSystem.isWindows()) {
guiFRFont = getNamedFont("Microsoft YaHei");
} else if (isDisplaySimSun(defaultLocale)) {
guiFRFont = getNamedFont("SimSun");
} else {
guiFRFont = getNamedFont("Dialog");
}
String file = Toolkit.i18nText("Fine-Design_Basic_File");
char displayChar = file.charAt(0);
if (!guiFRFont.canDisplay(displayChar)) {
//如果不能用默认的语言显示字体, 比如想在英文系统里用中文设计器
//默认语言(中文:宋体, 英文:Tahoma, 其他:Dialog)
guiFRFont = getNamedFont("SimSun");
if (!guiFRFont.canDisplay(displayChar)) {
FineLoggerFactory.getLogger().error(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_SimSun_Not_Found"));
//比如想在中文或英文系统里用韩文设计器
guiFRFont = getNamedFont("Dialog");
if (!guiFRFont.canDisplay(displayChar)) {
FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Basic_Base_SimSun_Not_Found"));
}
}
}
}
return guiFRFont;
}
return guiFRFont;
}
};
private static FRFont getNamedFont(String name) {
return FRFont.getInstance(name, Font.PLAIN, 12);

4
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/other/VanChartGanttConditionPane.java

@ -13,11 +13,11 @@ import com.fr.plugin.chart.gantt.attr.AttrGanttTooltip;
import com.fr.plugin.chart.gantt.attr.AttrGanttTooltipContent;
import com.fr.plugin.chart.type.ConditionKeyType;
import com.fr.van.chart.designer.PlotFactory;
import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane;
import com.fr.van.chart.designer.other.condition.item.VanChartSeriesColorConditionPane;
import com.fr.van.chart.designer.other.condition.item.VanChartTooltipConditionPane;
import com.fr.van.chart.designer.style.tooltip.VanChartPlotTooltipNoCheckPane;
import com.fr.van.chart.designer.style.tooltip.VanChartPlotTooltipPane;
import com.fr.van.chart.gantt.designer.style.label.VanChartGanttLabelConditionPane;
import java.awt.Dimension;
@ -42,7 +42,7 @@ public class VanChartGanttConditionPane extends DataSeriesConditionPane {
classPaneMap.put(AttrBackground.class, new VanChartSeriesColorConditionPane(this));
classPaneMap.put(AttrAlpha.class, new LabelAlphaPane(this));
if (!PlotFactory.largeDataModel(plot)) {
classPaneMap.put(AttrGanttLabel.class, new VanChartLabelConditionPane(this, plot));
classPaneMap.put(AttrGanttLabel.class, new VanChartGanttLabelConditionPane(this, plot));
}
classPaneMap.put(AttrGanttTooltip.class, new VanChartTooltipConditionPane(this, plot) {

17
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttLabelConditionPane.java

@ -0,0 +1,17 @@
package com.fr.van.chart.gantt.designer.style.label;
import com.fr.chart.chartattr.Plot;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane;
import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane;
public class VanChartGanttLabelConditionPane extends VanChartLabelConditionPane {
public VanChartGanttLabelConditionPane(ConditionAttributesPane conditionAttributesPane, Plot plot) {
super(conditionAttributesPane, plot);
}
protected VanChartPlotLabelPane createLabelPane() {
return new VanChartGanttPlotLabelNoCheckPane(getPlot(), null);
}
}

25
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelNoCheckPane.java

@ -0,0 +1,25 @@
package com.fr.van.chart.gantt.designer.style.label;
import com.fr.chart.chartattr.Plot;
import com.fr.plugin.chart.base.AttrLabel;
import com.fr.van.chart.designer.style.VanChartStylePane;
import java.awt.BorderLayout;
public class VanChartGanttPlotLabelNoCheckPane extends VanChartGanttPlotLabelPane {
public VanChartGanttPlotLabelNoCheckPane(Plot plot, VanChartStylePane parent) {
super(plot, parent);
}
protected void addComponents() {
this.setLayout(new BorderLayout());
this.add(getLabelPane(), BorderLayout.CENTER);
}
public void populate(AttrLabel attr) {
super.populate(attr);
getLabelShowCheckBox().setSelected(true);
getLabelPane().setVisible(true);
}
}

4
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/other/VanChartStructureConditionPane.java

@ -11,10 +11,10 @@ import com.fr.plugin.chart.base.AttrTooltip;
import com.fr.plugin.chart.structure.VanChartStructurePlot;
import com.fr.plugin.chart.type.ConditionKeyType;
import com.fr.van.chart.designer.other.condition.item.VanChartFloatColorConditionPane;
import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane;
import com.fr.van.chart.designer.other.condition.item.VanChartSeriesColorConditionPane;
import com.fr.van.chart.designer.other.condition.item.VanChartStructureNodeConditionPane;
import com.fr.van.chart.designer.other.condition.item.VanChartTooltipConditionPane;
import com.fr.van.chart.structure.desinger.style.VanChartStructureLabelConditionPane;
import java.awt.Dimension;
@ -47,7 +47,7 @@ public class VanChartStructureConditionPane extends DataSeriesConditionPane {
protected void addBasicAction() {
classPaneMap.put(AttrBackground.class, new VanChartSeriesColorConditionPane(this));
classPaneMap.put(AttrTooltip.class, new VanChartTooltipConditionPane(this, plot));
classPaneMap.put(AttrLabel.class, new VanChartLabelConditionPane(this, plot));
classPaneMap.put(AttrLabel.class, new VanChartStructureLabelConditionPane(this, plot));
classPaneMap.put(AttrFloatColor.class, new VanChartFloatColorConditionPane(this));
classPaneMap.put(AttrNode.class, new VanChartStructureNodeConditionPane(this));
}

17
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureLabelConditionPane.java

@ -0,0 +1,17 @@
package com.fr.van.chart.structure.desinger.style;
import com.fr.chart.chartattr.Plot;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane;
import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane;
public class VanChartStructureLabelConditionPane extends VanChartLabelConditionPane {
public VanChartStructureLabelConditionPane(ConditionAttributesPane conditionAttributesPane, Plot plot) {
super(conditionAttributesPane, plot);
}
protected VanChartPlotLabelPane createLabelPane() {
return new VanChartStructurePlotLabelNoCheckPane(getPlot(), null);
}
}

25
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelNoCheckPane.java

@ -0,0 +1,25 @@
package com.fr.van.chart.structure.desinger.style;
import com.fr.chart.chartattr.Plot;
import com.fr.plugin.chart.base.AttrLabel;
import com.fr.van.chart.designer.style.VanChartStylePane;
import java.awt.BorderLayout;
public class VanChartStructurePlotLabelNoCheckPane extends VanChartStructurePlotLabelPane {
public VanChartStructurePlotLabelNoCheckPane(Plot plot, VanChartStylePane parent) {
super(plot, parent);
}
protected void addComponents() {
this.setLayout(new BorderLayout());
this.add(getLabelPane(), BorderLayout.CENTER);
}
public void populate(AttrLabel attr) {
super.populate(attr);
getLabelShowCheckBox().setSelected(true);
getLabelPane().setVisible(true);
}
}

2
designer-chart/src/main/resources/com/fr/design/editor/script/editor.js

@ -156,7 +156,7 @@
return {
isAuto: this.model.isAuto,
content: BI.NicEditor.htmlDecode(value)
content: value
};
},

4
designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.js

@ -30,7 +30,6 @@
items: this.model.items,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
behaviors: {},
width: 200,
layouts: [{
type: "bi.vertical"
}],
@ -68,7 +67,8 @@
}]
},
popup: {
el: searchPopup
el: searchPopup,
minWidth: 150
},
ref: function (_ref) {
self.combo = _ref;

24
designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java

@ -30,6 +30,7 @@ import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.FormArea;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormDesignerModeForSpecial;
import com.fr.design.mainframe.FormDesignerUI;
import com.fr.design.mainframe.FormParaPane;
import com.fr.design.mainframe.FormWidgetDetailPane;
import com.fr.design.mainframe.JTemplate;
@ -58,6 +59,7 @@ import java.awt.Graphics;
import java.awt.Image;
import java.awt.Insets;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -467,6 +469,21 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
return ((FormParameterUI) getTarget()).getDesignSize();
}
/**
* 设置其UI类为DesignerUI负责渲染
*/
@Override
public void updateUI() {
setUI(new FormDesignerUI(){
@Override
protected Rectangle getFitPaintBounds(Component component, Component parent) {
return new Rectangle(0, 0, parent.getSize().width, parent.getSize().height);
}
});
}
/**
* 设置高度
*
@ -722,4 +739,11 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
return new JComponent[]{new CutAction(this).createToolBarComponent(), new CopyAction(this).createToolBarComponent(), new PasteAction(this).createToolBarComponent(),
new FormDeleteAction(this).createToolBarComponent()};
}
@Override
public boolean checkIfBeyondValidArea(MouseEvent e){
return false;
}
}

11
designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java

@ -166,7 +166,7 @@ public class EditingMouseListener extends MouseInputAdapter {
// 获取焦点,以便获取热键
designer.requestFocus();
}
if (e.getButton() == MouseEvent.BUTTON1 && !beyondValidArea(e)) {
if (e.getButton() == MouseEvent.BUTTON1 && !designer.checkIfBeyondValidArea(e)) {
Direction dir = selectionModel.getDirectionAt(e);
if (!DesignerMode.isAuthorityEditing()) {
@ -194,15 +194,6 @@ public class EditingMouseListener extends MouseInputAdapter {
e.translatePoint(oldX - e.getX(), oldY - e.getY());
}
private boolean beyondValidArea(MouseEvent e) {
if (e.getX() < 0 || e.getY() < 0 ||
e.getX() > designer.getRootComponent().getWidth() ||
e.getY() > (designer.getRootComponent().getHeight() + designer.getParaHeight())) {
return true;
}
return false;
}
private void offsetEventPoint(MouseEvent e){
int x = designer.getRelativeX(e.getX());
int y = designer.getRelativeY(e.getY());

9
designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java

@ -1733,4 +1733,13 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
return (int) (this.getArea().getVerticalValue() / this.scale);
}
public boolean checkIfBeyondValidArea(MouseEvent e){
if (e.getX() < 0 || e.getY() < 0 ||
e.getX() > this.getRootComponent().getWidth() ||
e.getY() > (this.getRootComponent().getHeight() + this.getParaHeight())) {
return true;
}
return false;
}
}

15
designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java

@ -424,12 +424,8 @@ public class FormDesignerUI extends ComponentUI {
// 禁止双缓冲
ComponentUtils.disableBuffer(component, dbcomponents);
Graphics clipg;
clipg = g.create(
-designer.getHorizontalScaleValue(),
-designer.getVerticalScaleValue() + designer.getParaHeight(),
component.getSize().width + designer.getHorizontalScaleValue(),
component.getSize().height + designer.getVerticalScaleValue());
Rectangle clipgBounds = getFitPaintBounds(component, parent);
clipg = g.create(clipgBounds.x, clipgBounds.y, clipgBounds.width, clipgBounds.height);
designer.paintContent(clipg);
paintWatermark((Graphics2D) clipg);
clipg.dispose();
@ -439,6 +435,13 @@ public class FormDesignerUI extends ComponentUI {
designer.resetEditorComponentBounds();
}
protected Rectangle getFitPaintBounds(Component component, Component parent) {
return new Rectangle(-designer.getHorizontalScaleValue(),
-designer.getVerticalScaleValue() + designer.getParaHeight(),
component.getSize().width + designer.getHorizontalScaleValue(),
component.getSize().height + designer.getVerticalScaleValue());
}
/**
* 画参数面板
*/

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java

@ -118,8 +118,8 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane {
Component[][] components = new Component[][]{
new Component[] {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Zoom_In_Logic"), SwingConstants.LEFT), new UILabel(ChartMobileFitAttrState.PROPORTION.description())},
new Component[] {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Zoom_Out_Logic"), SwingConstants.LEFT), zoomOutComboBox},
new Component[] {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Collapse_Expand")), mobileCollapsedStyleEditor},
new Component[] {tipLabel, null},
new Component[] {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Collapse_Expand")), mobileCollapsedStyleEditor},
new Component[] {allowFullCheckBox, null},
new Component[] {functionalWhenUnactivatedCheckBox, null}
};

38
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java

@ -4,6 +4,8 @@ import com.fr.base.iofile.attr.FormTabPaddingAttrMark;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.dialog.AttrScrollPane;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.form.util.FormDesignerUtils;
import com.fr.design.gui.frpane.AttributeChangeListener;
@ -15,7 +17,6 @@ import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.accessibles.AccessibleTemplateStyleEditor;
import com.fr.design.mainframe.widget.accessibles.MobileTemplateStylePane;
import com.fr.design.widget.ui.designer.mobile.component.MobileAdvanceInnerPane;
import com.fr.design.widget.ui.designer.mobile.component.MobileBookMarkUsePane;
import com.fr.design.widget.ui.designer.mobile.component.MobileComponentMarginPane;
import com.fr.design.widget.ui.designer.mobile.component.MobileComponentLayoutIntervalPane;
@ -23,7 +24,9 @@ import com.fr.design.widget.ui.designer.mobile.component.MobileTabCommonSettingP
import com.fr.form.ui.container.cardlayout.WCardTagLayout;
import com.fr.general.cardtag.mobile.MobileTemplateStyle;
import java.awt.Dimension;
import javax.swing.JPanel;
import javax.swing.BorderFactory;
import java.awt.BorderLayout;
import java.awt.Component;
@ -36,9 +39,22 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane {
private MobileComponentLayoutIntervalPane intervalPane;
private MobileBookMarkUsePane mobileBookMarkUsePane;
private MobileTabCommonSettingPane mobileTabCommonSettingPane;
private JPanel contentJPanel;
private BasicScrollPane scrollPane;
private JPanel holder;
private Dimension dimension;
public TabMobileWidgetDefinePane(XCreator xCreator) {
this.xCreator = xCreator;
contentJPanel = FRGUIPaneFactory.createCenterFlowZeroGapBorderPane();
scrollPane = new AttrScrollPane() {
@Override
protected JPanel createContentPane() {
return contentJPanel;
}
};
scrollPane.setBorder(null);
}
private void bindListeners2Widgets() {
@ -61,11 +77,23 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane {
@Override
public void initPropertyGroups(Object source) {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner();
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Tab_Style_Template"));
templateStyleEditor = new AccessibleTemplateStyleEditor(new MobileTemplateStylePane((WCardTagLayout) xCreator.toData()));
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{label, templateStyleEditor}, {new UILabel()}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_LARGE);
JPanel holder = FRGUIPaneFactory.createBorderLayout_S_Pane();
holder = new JPanel(new BorderLayout()) {
@Override
public Dimension getPreferredSize() {
if (dimension == null) {
return super.getPreferredSize();
} else {
Dimension defaultDimension = super.getPreferredSize();
defaultDimension.width = dimension.width;
return defaultDimension;
}
}
};
holder.add(jPanel, BorderLayout.NORTH);
JPanel innerAdvancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
if (!shouldHidePadding(designer)) {
@ -89,13 +117,17 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane {
//高级
holder.add(advancePane, BorderLayout.CENTER);
this.add(holder, BorderLayout.NORTH);
contentJPanel.add(holder, BorderLayout.CENTER);
this.add(scrollPane, BorderLayout.CENTER);
}
@Override
public void populate(FormDesigner designer) {
WCardTagLayout wCardTagLayout = (WCardTagLayout) xCreator.toData();
MobileTemplateStyle mobileTemplateStyle = wCardTagLayout.getMobileTemplateStyle();
if (dimension == null) {
dimension = holder.getPreferredSize();
}
templateStyleEditor.setValue(mobileTemplateStyle);
// 数据 populate 完成后,再设置监听
this.bindListeners2Widgets();

19
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java

@ -92,6 +92,7 @@ public class MobileComponentFrozenPane extends BasicPane {
WSortLayout wSortLayout = ((WSortLayout) xCreator.toData());
List<String> all = wSortLayout.getNonContainerWidgetList();
List<String> selected = wSortLayout.getFrozenWidgets();
selected = fixRename(all, selected, wSortLayout);
Map<Object, Boolean> map = new LinkedHashMap<>();
for (String value : selected) {
map.put(value, true);
@ -103,6 +104,24 @@ public class MobileComponentFrozenPane extends BasicPane {
uiComboCheckBox.setSelectedValues(map);
}
private List<String> fixRename(List<String> all, List<String> selected, WSortLayout wSortLayout) {
// 存在重命名
if (!selected.isEmpty() && !all.containsAll(selected)) {
// 清空原选中的 selected是Unmodifiable的
selected = new ArrayList<>();
for (String name : all) {
Widget widget = FormWidgetHelper.findWidgetWithBound(wSortLayout, name);
if (widget != null && widget.getMobileBookMark().isFrozen()) {
// 重新添加
selected.add(name);
}
}
// 同时更新下
wSortLayout.updateFrozenWidgets(selected);
}
return selected;
}
private List<String> frozenWidgets() {
Form form = WidgetPropertyPane.getInstance().getEditingFormDesigner().getTarget();
WLayout container = form.getContainer();

31
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java

@ -35,6 +35,7 @@ public class MobileTabCommonSettingPane extends BasicPane {
private ModeButtonGroup<Integer> buttonGroup;
private NewColorSelectBox initDotColorBox;
private NewColorSelectBox selectDotColorBox;
private boolean isPopulate;
public MobileTabCommonSettingPane(boolean isTopComponent) {
initComponent(isTopComponent);
@ -89,23 +90,27 @@ public class MobileTabCommonSettingPane extends BasicPane {
initDotColorBox = new NewColorSelectBox(0){
@Override
protected void iniListener() {
}
@Override
public void mouseClicked(MouseEvent e) {
super.mouseClicked(e);
this.attributeChange();
this.addSelectChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (!isPopulate) {
attributeChange();
}
}
});
}
};
selectDotColorBox = new NewColorSelectBox(0){
@Override
protected void iniListener() {
}
@Override
public void mouseClicked(MouseEvent e) {
super.mouseClicked(e);
this.attributeChange();
this.addSelectChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (!isPopulate) {
attributeChange();
}
}
});
}
};
JPanel initDotColorPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{initColorLabel, initDotColorBox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM);
@ -189,7 +194,9 @@ public class MobileTabCommonSettingPane extends BasicPane {
color = defaultColor;
}
if (color != colorBox.getSelectObject()) {
isPopulate = true;
colorBox.setSelectObject(color);
isPopulate = false;
}
}

7
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java

@ -124,7 +124,10 @@ public class ContentCellRender implements ListCellRenderer<Object> {
private String getReplacedString(String modelName, String string) {
//需要考虑modelName有空格的情况
//比如现在是work boo k 搜索词是workb,应该要替换的部分是work b
//先去掉空格进行匹配
//先去掉已经匹配替换过的部分,因为考虑到分词的情况,可能会进行多次替换
final String regex = "\\|<font.*?</font>\\|";
modelName = modelName.replaceAll(regex, StringUtils.EMPTY);
//再去掉空格进行匹配
String noBlackName = modelName.replaceAll(StringUtils.BLANK, StringUtils.EMPTY).toLowerCase();
int index = noBlackName.indexOf(string.toLowerCase());
if (index == -1) {
@ -139,6 +142,4 @@ public class ContentCellRender implements ListCellRenderer<Object> {
}
return result.toString();
}
}

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java

@ -112,7 +112,7 @@ public class FileSearchManager implements AlphaFineSearchProvider {
name = name.replaceAll(StringUtils.BLANK, StringUtils.EMPTY);
if (name.contains(searchText)) {
FileModel model = new FileModel(node.getName(), node.getEnvPath());
if (!AlphaFineHelper.getFilterResult().contains(model)) {
if (!AlphaFineHelper.getFilterResult().contains(model) && !filterModelList.contains(model)) {
AlphaFineHelper.checkCancel();
filterModelList.add(model);
}

11
designer-realize/src/test/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRenderTest.java

@ -1,7 +1,9 @@
package com.fr.design.mainframe.alphafine.cell.render;
import com.fr.stable.StringUtils;
import org.junit.Test;
import static org.junit.Assert.*;
/**
@ -13,11 +15,20 @@ public class ContentCellRenderTest {
@Test
public void highLightModelName() {
final String regex = "<font.*?</font>";
String searchText = "workb";
ContentCellRender contentCellRender = new ContentCellRender(searchText,new String[]{searchText});
String workbook = contentCellRender.highLightModelName("workbook", new String[]{searchText});
assertTrue(workbook.endsWith("workb</font>ook</body></HTML>"));
workbook = contentCellRender.highLightModelName("work book", new String[]{searchText});
assertTrue(workbook.endsWith("work b</font>ook</body></HTML>"));
searchText = "我是空格";
contentCellRender = new ContentCellRender(searchText, new String[]{"我是空格", "我是", "空格"});
workbook = contentCellRender.highLightModelName("我是 空格", new String[]{searchText});
assertEquals(workbook.replaceFirst(regex, StringUtils.EMPTY), workbook.replaceAll(regex, StringUtils.EMPTY));
workbook = contentCellRender.highLightModelName("我是是 空格", new String[]{"我是空格", "我是", "空格"});
assertNotEquals(workbook.replaceFirst(regex, StringUtils.EMPTY), workbook.replaceAll(regex, StringUtils.EMPTY));
}
}
Loading…
Cancel
Save