Browse Source

Merge pull request #2197 in DESIGN/design from bugfix/10.0 to feature/10.0

* commit 'b6175b0059d8e693f316e0fcbe34994c561862db':
  REPORT-36619 fix
  REPORT-36619 报表设计界面拖选无法选中拖选区域
  REPORT-37915 报表分栏弹窗显示未适配国际化 1. 为每种语言都适配了报表分栏弹窗中的示例图片 2. 修改对应国际化文件中代表此示例图片的文件名
  CHART-15451 国际化
  CHART-15451 增加无匹配的提示
  REPORT-35386 多个tab进行撤销,会撤销两个tab
  CHART-15451 日期判断需要是一种格式
  REPORT-38272 && REPORT-38287 && REPORT-37922【frm设计界面支持缩放】参数面板控件如果进行较大的缩放幅度,会遮挡部分
  REPORT-37262 远程设计账号密码安全增强 1. 做的是这个迭代任务中的子任务,功能为:密码输入时可显示长度,再次打开时隐藏密码长度,统一显示为8位的加密字符,点击密码输入框做输入或编辑密码动作时,先清空密码,再输入内容,保存后生效 2. 写了一个UIPasswordField的子类,相比UIPasswordField增加了上述功能 3. 将目标场景中的密码框替换为新的UIPasswordFieldWithFixedLength 4. 修改一些导包问题
research/11.0
superman 4 years ago
parent
commit
9b1e86fcda
  1. 18
      designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java
  2. 106
      designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java
  3. 17
      designer-base/src/main/java/com/fr/env/RemoteEnvPane.java
  4. BIN
      designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_ja_JP.png
  5. BIN
      designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_ko_KR.png
  6. 0
      designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_zh.png
  7. BIN
      designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_zh_TW.png
  8. BIN
      designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_ja_JP.png
  9. BIN
      designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_ko_KR.png
  10. 0
      designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_zh.png
  11. BIN
      designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_zh_TW.png
  12. 5
      designer-chart/src/main/java/com/fr/design/chart/AutoChartTypePane.java
  13. 18
      designer-chart/src/main/java/com/fr/design/chart/auto/AutoTypeCalculate.java
  14. 8
      designer-form/src/main/java/com/fr/design/designer/beans/models/AddingModel.java
  15. 7
      designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java
  16. 3
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardAddButton.java
  17. 29
      designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java
  18. 8
      designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java

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

@ -8,7 +8,7 @@ import com.fr.design.border.UITitledBorder;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ipasswordfield.UIPassWordField; import com.fr.design.gui.ipasswordfield.UIPasswordFieldWithFixedLength;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.gui.ilable.ActionLabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
@ -24,8 +24,18 @@ import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.BorderFactory;
import java.awt.*; import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.io.File; import java.io.File;
@ -108,7 +118,7 @@ public class JDBCDefPane extends JPanel {
urlTextField = new UITextField(15); urlTextField = new UITextField(15);
userNameTextField = new UITextField(15); userNameTextField = new UITextField(15);
userNameTextField.setName(USER_NAME); userNameTextField.setName(USER_NAME);
passwordTextField = new UIPassWordField(15); passwordTextField = new UIPasswordFieldWithFixedLength(15);
dbtypeButton = new UIButton("."); dbtypeButton = new UIButton(".");
dbtypeButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Click_Get_Default_URL")); dbtypeButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Click_Get_Default_URL"));
dbtypeButton.addActionListener(dbtypeButtonActionListener); dbtypeButton.addActionListener(dbtypeButtonActionListener);

106
designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPasswordFieldWithFixedLength.java

@ -0,0 +1,106 @@
package com.fr.design.gui.ipasswordfield;
import com.fr.stable.StringUtils;
import org.jetbrains.annotations.NotNull;
import javax.swing.text.Document;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
/**
* @author Yvan
* @version 10.0
* Created by Yvan on 2020-08-11
* 有固定长度的"*"回显的密码框避免泄露密码长度
*/
public class UIPasswordFieldWithFixedLength extends UIPassWordField {
/**
* 展示密码为固定8位长度的特殊字符"*"组成
*/
private static final String DISPLAY_PASSWORD = "********";
/**
* 实际密码
*/
private String realPassword;
/**
* 用于判断是否清空密码
*/
private boolean clearPassword;
public UIPasswordFieldWithFixedLength() {
this(null, null, 0);
}
public UIPasswordFieldWithFixedLength(String text) {
this(null, text, 0);
}
public UIPasswordFieldWithFixedLength(int columns) {
this(null, null, columns);
}
public UIPasswordFieldWithFixedLength(String text, int columns) {
this(null, text, columns);
}
public UIPasswordFieldWithFixedLength(Document doc, String txt, int columns) {
super(doc, txt, columns);
initRealPassword(txt);
}
/**
* 为realPassword赋初值并添加一个鼠标单击事件
*/
public void initRealPassword(String text) {
this.realPassword = text == null ? StringUtils.EMPTY : text;
this.clearPassword = true;
addShowFixedLengthPasswordListener();
}
/**
* 当鼠标点击密码框第一次做出键入动作时清空显示密码与实际密码用户需要重新输入密码
*/
private void addShowFixedLengthPasswordListener() {
this.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
UIPasswordFieldWithFixedLength.this.clearPassword = true;
}
});
this.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
if (clearPassword) {
UIPasswordFieldWithFixedLength.this.setText(StringUtils.EMPTY);
UIPasswordFieldWithFixedLength.this.clearPassword = false;
UIPasswordFieldWithFixedLength.this.updateUI();
}
}
});
}
@Override
public void setText(@NotNull String t) {
this.realPassword = t;
// 看到代码中有些场景是将密码置为空字符串的,所以在这里加个判断
if (StringUtils.isEmpty(t)) {
super.setText(t);
} else {
super.setText(DISPLAY_PASSWORD);
}
}
@Override
public char[] getPassword() {
//如果用户刚清空密码框,并输入了新密码,则返回输入内容,否则返回realPassword
String text = new String(super.getPassword());
if (!StringUtils.isEmpty(text) && StringUtils.isEmpty(realPassword)) {
return text.toCharArray();
}
return realPassword.toCharArray();
}
}

17
designer-base/src/main/java/com/fr/env/RemoteEnvPane.java vendored

@ -13,6 +13,7 @@ import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ipasswordfield.UIPassWordField; import com.fr.design.gui.ipasswordfield.UIPassWordField;
import com.fr.design.gui.ipasswordfield.UIPasswordFieldWithFixedLength;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
@ -26,7 +27,17 @@ import com.fr.workspace.WorkContext;
import com.fr.workspace.connect.WorkspaceConnectionInfo; import com.fr.workspace.connect.WorkspaceConnectionInfo;
import com.fr.workspace.engine.exception.WorkspaceAuthException; import com.fr.workspace.engine.exception.WorkspaceAuthException;
import javax.swing.*; import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JPanel;
import javax.swing.JTextPane;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import javax.swing.ToolTipManager;
import javax.swing.UIManager;
import javax.swing.border.EmptyBorder; import javax.swing.border.EmptyBorder;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
@ -96,7 +107,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
/** /**
* 密码 * 密码
*/ */
private UIPassWordField passwordInput = new UIPassWordField(); private UIPassWordField passwordInput = new UIPasswordFieldWithFixedLength();
/** /**
* 是否记住密码 * 是否记住密码
*/ */
@ -108,7 +119,7 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
/** /**
* https密钥 * https密钥
*/ */
private UIPassWordField certSecretKeyInput = new UIPassWordField(); private UIPassWordField certSecretKeyInput = new UIPasswordFieldWithFixedLength();
/** /**
* 选择证书文件按钮 * 选择证书文件按钮
*/ */

BIN
designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_ja_JP.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_ko_KR.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

0
designer-base/src/main/resources/com/fr/design/images/reportcolumns/col.png → designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_zh.png

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
designer-base/src/main/resources/com/fr/design/images/reportcolumns/col_zh_TW.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_ja_JP.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_ko_KR.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

0
designer-base/src/main/resources/com/fr/design/images/reportcolumns/row.png → designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_zh.png

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
designer-base/src/main/resources/com/fr/design/images/reportcolumns/row_zh_TW.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

5
designer-chart/src/main/java/com/fr/design/chart/AutoChartTypePane.java

@ -63,6 +63,8 @@ public class AutoChartTypePane extends ChartWizardPane implements CallbackEvent
private AutoProgressBar connectionBar; private AutoProgressBar connectionBar;
private SwingWorker worker; private SwingWorker worker;
private static final String MESSAGE = Toolkit.i18nText("Fine-Design_Chart_Auto_No_Match");
public AutoChartTypePane() { public AutoChartTypePane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
initButtonGroup(); initButtonGroup();
@ -226,6 +228,9 @@ public class AutoChartTypePane extends ChartWizardPane implements CallbackEvent
chartResultModel.addElement(autoChartIcon); chartResultModel.addElement(autoChartIcon);
} }
chartViewList.setSelectedIndex(0); chartViewList.setSelectedIndex(0);
} else {
FineJOptionPane.showMessageDialog(AutoChartTypePane.this, MESSAGE,
Toolkit.i18nText("Fine-Design_Basic_Message"), JOptionPane.INFORMATION_MESSAGE, UIManager.getIcon("OptionPane.informationIcon"));
} }
} catch (Exception e) { } catch (Exception e) {
if (!(e instanceof CancellationException)) { if (!(e instanceof CancellationException)) {

18
designer-chart/src/main/java/com/fr/design/chart/auto/AutoTypeCalculate.java

@ -102,22 +102,22 @@ public class AutoTypeCalculate {
} }
private static boolean isNumberData(List<String> values) { private static boolean isNumberData(List<String> values) {
for (String value : values) { for (Pattern pattern : dataPatterns) {
if (!isNumberData(value)) { if (isNumberData(values, pattern)) {
return false; return true;
} }
} }
return true; return false;
} }
private static boolean isNumberData(String value) { private static boolean isNumberData(List<String> values, Pattern pattern) {
for (Pattern pattern : dataPatterns) { for (String value : values) {
Matcher matcher = pattern.matcher(value); Matcher matcher = pattern.matcher(value);
if (matcher.matches()) { if (!matcher.matches()) {
return true; return false;
} }
} }
return false; return true;
} }
private static List<ColumnInfo> calculateField(String tableName, List<String> columns) { private static List<ColumnInfo> calculateField(String tableName, List<String> columns) {

8
designer-form/src/main/java/com/fr/design/designer/beans/models/AddingModel.java

@ -133,13 +133,13 @@ public class AddingModel {
Rectangle rect = ComponentUtils.getRelativeBounds(container); Rectangle rect = ComponentUtils.getRelativeBounds(container);
if (!ComparatorUtils.equals(container.getOuterLayout(), container.getBackupParent())) { if (!ComparatorUtils.equals(container.getOuterLayout(), container.getBackupParent())) {
added = container.getLayoutAdapter().addBean(creator, added = container.getLayoutAdapter().addBean(creator,
x + designer.getArea().getHorizontalValue(), x + designer.getHorizontalScaleValue(),
y + designer.getArea().getVerticalValue()); y + designer.getVerticalScaleValue() );
return added; return added;
} }
added = container.getLayoutAdapter().addBean(creator, added = container.getLayoutAdapter().addBean(creator,
x + designer.getArea().getHorizontalValue() - rect.x, x + designer.getHorizontalScaleValue() - rect.x,
y + designer.getArea().getVerticalValue() - rect.y); y + designer.getVerticalScaleValue() - rect.y);
return added; return added;
} }
} }

7
designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java

@ -300,6 +300,13 @@ public class StateModel {
int y = getMouseXY(e).y; int y = getMouseXY(e).y;
Rectangle bounds = createCurrentBounds(x, y); Rectangle bounds = createCurrentBounds(x, y);
// 有参数面板时 要考虑下参数面板的高度影响
int yOffset = 0;
XLayoutContainer paramComponent = designer.getParaComponent();
if (paramComponent != null) {
yOffset = paramComponent.getHeight();
}
bounds.y = Math.max(bounds.y - yOffset, 0);
if ((x != currentX) || (y != currentY)) { if ((x != currentX) || (y != currentY)) {
ArrayList<XCreator> creators = getHotspotCreators(bounds, designer.getRootComponent()); ArrayList<XCreator> creators = getHotspotCreators(bounds, designer.getRootComponent());

3
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardAddButton.java

@ -86,7 +86,6 @@ public class XCardAddButton extends XButton {
@Override @Override
public void respondClick(EditingMouseListener editingMouseListener, MouseEvent e){ public void respondClick(EditingMouseListener editingMouseListener, MouseEvent e){
FormDesigner designer = editingMouseListener.getDesigner(); FormDesigner designer = editingMouseListener.getDesigner();
designer.fireTargetModified();
// addbutton对应的XWCardLayout和XWCardTagLayout暂未存入到xml中,重新打开之后先根据父子层获取 // addbutton对应的XWCardLayout和XWCardTagLayout暂未存入到xml中,重新打开之后先根据父子层获取
if(cardLayout == null && tagLayout ==null ){ if(cardLayout == null && tagLayout ==null ){
@ -112,6 +111,8 @@ public class XCardAddButton extends XButton {
showNewTab(editingMouseListener,index); showNewTab(editingMouseListener,index);
tagLayout.setTabsAndAdjust(); tagLayout.setTabsAndAdjust();
LayoutUtils.layoutRootContainer(designer.getRootComponent()); LayoutUtils.layoutRootContainer(designer.getRootComponent());
designer.fireTargetModified();
} }
@Override @Override

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

@ -11,7 +11,13 @@ import com.fr.design.designer.beans.location.Direction;
import com.fr.design.designer.beans.location.Location; import com.fr.design.designer.beans.location.Location;
import com.fr.design.designer.beans.models.SelectionModel; import com.fr.design.designer.beans.models.SelectionModel;
import com.fr.design.designer.beans.models.StateModel; import com.fr.design.designer.beans.models.StateModel;
import com.fr.design.designer.creator.*; import com.fr.design.designer.creator.XChartEditor;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.designer.creator.XEditorHolder;
import com.fr.design.designer.creator.XElementCase;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.creator.cardlayout.XCardSwitchButton; import com.fr.design.designer.creator.cardlayout.XCardSwitchButton;
import com.fr.design.designer.creator.cardlayout.XWCardLayout; import com.fr.design.designer.creator.cardlayout.XWCardLayout;
import com.fr.design.form.util.XCreatorConstants; import com.fr.design.form.util.XCreatorConstants;
@ -22,14 +28,20 @@ import com.fr.design.icon.IconPathConstants;
import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.ComponentUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.LayoutUtils; import com.fr.design.utils.gui.LayoutUtils;
import com.fr.share.ShareConstants; import com.fr.share.ShareConstants;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPopupMenu;
import javax.swing.JWindow;
import javax.swing.SwingUtilities;
import javax.swing.event.MouseInputAdapter; import javax.swing.event.MouseInputAdapter;
import java.awt.*; import java.awt.Color;
import java.awt.Container;
import java.awt.Cursor;
import java.awt.Rectangle;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
/** /**
@ -165,10 +177,13 @@ public class EditingMouseListener extends MouseInputAdapter {
if (designer.isDrawLineMode()) { if (designer.isDrawLineMode()) {
designer.updateDrawLineMode(e); designer.updateDrawLineMode(e);
} else { } else {
int relativeX = Math.max(0, designer.getRelativeX(e.getX()));
int relativeY = Math.max(0, designer.getRelativeY(e.getY()));
if (selectionModel.hasSelectionComponent() if (selectionModel.hasSelectionComponent()
&& selectionModel.getSelection().getRelativeBounds().contains( && selectionModel.getSelection().getRelativeBounds().contains(
designer.getArea().getHorizontalValue() + e.getX(), designer.getHorizontalScaleValue() + relativeX,
designer.getArea().getVerticalValue() + e.getY())) { designer.getVerticalScaleValue() + relativeY)) {
lastPressEvent = e; lastPressEvent = e;
lastXCreator = selectionModel.getSelection().getSelectedCreator(); lastXCreator = selectionModel.getSelection().getSelectedCreator();
} else { } else {

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

@ -409,8 +409,8 @@ public class FormDesignerUI extends ComponentUI {
clipg = g.create( clipg = g.create(
-designer.getHorizontalScaleValue(), -designer.getHorizontalScaleValue(),
-designer.getVerticalScaleValue() + designer.getParaHeight(), -designer.getVerticalScaleValue() + designer.getParaHeight(),
(int) ((parent.getSize().width + designer.getArea().getHorizontalValue()) / designer.getScale()), parent.getSize().width + designer.getHorizontalScaleValue(),
(int) ((parent.getSize().height + designer.getArea().getVerticalValue()) / designer.getScale())); parent.getSize().height + designer.getVerticalScaleValue());
designer.paintContent(clipg); designer.paintContent(clipg);
paintWatermark((Graphics2D) clipg); paintWatermark((Graphics2D) clipg);
@ -435,8 +435,8 @@ public class FormDesignerUI extends ComponentUI {
Graphics clipg1; Graphics clipg1;
clipg1 = g.create(-designer.getHorizontalScaleValue(), clipg1 = g.create(-designer.getHorizontalScaleValue(),
-designer.getVerticalScaleValue(), -designer.getVerticalScaleValue(),
(int) ((parent.getSize().width + designer.getArea().getHorizontalValue()) / designer.getScale()), parent.getSize().width + designer.getHorizontalScaleValue(),
(int) ((designer.getParaHeight() + designer.getArea().getVerticalValue()) / designer.getScale())); designer.getParaHeight() + designer.getVerticalScaleValue());
designer.paintPara(clipg1); designer.paintPara(clipg1);
clipg1.dispose(); clipg1.dispose();

Loading…
Cancel
Save