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
ef45bd2084
  1. 5
      designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java
  2. 4
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java
  3. 64
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java
  4. 66
      designer-base/src/main/java/com/fr/design/gui/frpane/UIBubbleFloatPane.java
  5. 7
      designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableModelAdapter.java
  6. 7
      designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java
  7. 8
      designer-base/src/main/java/com/fr/design/update/push/DesignerUpdateInfo.java
  8. 61
      designer-base/src/main/java/com/fr/design/utils/ParameterUtils.java
  9. 2
      designer-base/src/main/resources/com/fr/design/ui/update/push/pushUpdate.css
  10. 38
      designer-base/src/test/java/com/fr/design/utils/ParameterUtilsTest.java
  11. 9
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java
  12. 9
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java
  13. 4
      designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java
  14. 16
      designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java
  15. 5
      designer-form/src/main/java/com/fr/design/mainframe/FormSelectionUtils.java
  16. 8
      designer-realize/src/main/java/com/fr/grid/Grid.java
  17. 5
      designer-realize/src/main/java/com/fr/grid/GridKeyListener.java
  18. 31
      designer-realize/src/main/java/com/fr/grid/action/GridInputAction.java
  19. 53
      designer-realize/src/main/java/com/fr/grid/help/GridHelper.java
  20. 5
      designer-realize/src/main/java/com/fr/poly/PolyDesigner.java
  21. 2
      designer-realize/src/main/java/com/fr/start/MainDesigner.java
  22. 47
      designer-realize/src/test/java/com/fr/grid/help/GridHelperTest.java

5
designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java

@ -303,12 +303,13 @@ public class AboutPane extends JPanel {
public BoxCenterAlignmentCopyablePane(String title, String copyText, final String[] descriptions) {
setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel centerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
if (StringUtils.isNotEmpty(title)) {
this.label = new UILabel(title);
centerPane.add(label);
}
this.textField = new UILabel(copyText);
textField.setBackground(null);
textField.setBorder(null);
centerPane.add(label);
centerPane.add(textField);
textField.addMouseListener(new MouseAdapter() {
@Override

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

@ -32,6 +32,7 @@ import com.fr.design.gui.syntax.ui.rtextarea.RTextScrollPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.menu.SeparatorDef;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.utils.ParameterUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.general.sql.SqlUtils;
@ -218,8 +219,7 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
paramTexts[1] = SqlUtils.tryPureSqlText(pageQuery);
List<ParameterProvider> existParameterList = editorPane.update();
Parameter[] ps = existParameterList == null ? new Parameter[0] : existParameterList.toArray(new Parameter[existParameterList.size()]);
editorPane.populate(ParameterHelper.analyzeAndUnionSameParameters(paramTexts, ps));
editorPane.populate(ParameterUtils.analyzeAndUnionParameters(paramTexts, ps));
}
private JToolBar createToolBar() {

64
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java

@ -19,6 +19,7 @@ import com.fr.design.gui.itableeditorpane.UITableEditorPane;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.script.Calculator;
import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils;
@ -95,9 +96,8 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
centerPanel.setLayout(new GridLayout(len < MIN_BAR_NUMBER ? MIN_BAR_NUMBER : len + 1, 1));
centerPanel.add(headLabel);
Iterator<Entry<String, TableDataWrapper>> entryIt = resMap.entrySet().iterator();
while (entryIt.hasNext()) {
TableDataWrapper tableDataWrappe = entryIt.next().getValue();
for (Entry<String, TableDataWrapper> stringTableDataWrapperEntry : resMap.entrySet()) {
TableDataWrapper tableDataWrappe = stringTableDataWrapperEntry.getValue();
String tmp = tableDataWrappe.getTableDataName();
if (!ComparatorUtils.equals(tableDataWrappe.getTableDataName(), multiName)) {
centerPanel.add(new BarPanel(tmp, tableDataWrappe.getIcon()));
@ -111,13 +111,10 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
}
private ActionListener getPreviewActionListener() {
return new ActionListener() {
public void actionPerformed(ActionEvent e) {
return e -> {
MultiTDTableData td = MultiTDTableDataPane.this.updateBean();
td.setTableDataSource(DesignTableDataManager.getEditingTableDataSource());
new TemplateTableDataWrapper(td).previewData();
}
};
}
@ -126,12 +123,12 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
jpanel.setPreferredSize(new Dimension(-1, 150));
jpanel.setLayout(new BorderLayout());
editorPane = new UITableEditorPane<ParameterProvider>(new ParameterTableModel() {
editorPane = new UITableEditorPane<>(new ParameterTableModel() {
@Override
public UITableEditAction[] createAction() {
return new UITableEditAction[]{new RefreshAction()};
}
}, " " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Default_Parameter"));
}, StringUtils.BLANK + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Default_Parameter"));
jpanel.add(editorPane, BorderLayout.CENTER);
@ -162,29 +159,32 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
for (int i = 0; i < size; i++) {
paramTexts[i] = (String) object[i];
}
List<ParameterProvider> existParameterList = new ArrayList<ParameterProvider>();
Iterator<Entry<String, String>> dataItera = choosenTableData.entrySet().iterator();
List<String> parameterName = new ArrayList<String>();
while (dataItera.hasNext()) {
Entry<String, String> entry = dataItera.next();
List<ParameterProvider> existParameterList = new ArrayList<>();
List<String> parameterName = new ArrayList<>();
for (Entry<String, String> entry : choosenTableData.entrySet()) {
TableData td = resMap.get(entry.getKey()).getTableData();
ParameterProvider[] currentparameters = td.getParameters(Calculator.createCalculator());
for (int i=0; i<currentparameters.length; i++){
if (parameterName.contains(currentparameters[i].getName())){
ParameterProvider[] currentParameters = td.getParameters(Calculator.createCalculator());
for (ParameterProvider currentParameter : currentParameters) {
if (parameterName.contains(currentParameter.getName())) {
continue;
}
parameterName.add(currentparameters[i].getName());
existParameterList.add(currentparameters[i]);
parameterName.add(currentParameter.getName());
try {
//采用给新的界面刷新参数时,clone一个值过去,不然会出现联动修改
existParameterList.add((ParameterProvider) currentParameter.clone());
} catch (CloneNotSupportedException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}
ParameterProvider[] texts = ParameterHelper.analyze4Parameters(paramTexts, true);
for (int i=0; i<texts.length; i++) {
if (parameterName.contains(texts[i].getName())){
for (ParameterProvider text : texts) {
if (parameterName.contains(text.getName())) {
continue;
}
existParameterList.add(texts[i]);
existParameterList.add(text);
}
Parameter[] ps = existParameterList.toArray(new Parameter[existParameterList.size()]);
ParameterProvider[] ps = existParameterList.toArray(new ParameterProvider[0]);
editorPane.populate(ps);
existParameterList.clear();
parameterName.clear();
@ -217,7 +217,7 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
String name;
for (int i = 0; i < ob.getTableDataCount(); i++) {
name = ob.getTableDataName(i);
choosenTableData.put(name, "");
choosenTableData.put(name, StringUtils.EMPTY);
}
}
}
@ -236,15 +236,13 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
@Override
public MultiTDTableData updateBean() {
ConditionTableData td = new ConditionTableData();
Iterator<Entry<String, String>> it = choosenTableData.entrySet().iterator();
while (it.hasNext()) {
Entry<String, String> entry = it.next();
for (Entry<String, String> entry : choosenTableData.entrySet()) {
td.addTableData(entry.getKey(), entry.getValue());
}
List<ParameterProvider> paramList = editorPane.update();
if (paramList != null) {
td.setDefineParameters(paramList.toArray(new Parameter[paramList.size()]));
td.setDefineParameters(paramList.toArray(new Parameter[0]));
}
return td;
@ -348,9 +346,7 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
chekbox.setSelected(false);
formulaContentTextField.setEnabled(false);
formulaButton.setEnabled(false);
if (choosenTableData.containsKey(name)) {
choosenTableData.remove(name);
}
} else {
formulaButton.setEnabled(true);
formulaContentTextField.setEnabled(true);
@ -372,10 +368,8 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
} else {
formulaButton.setEnabled(false);
formulaContentTextField.setEnabled(false);
if (choosenTableData.containsKey(name)) {
choosenTableData.remove(name);
}
}
}
};
@ -388,22 +382,20 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
}
private ActionListener getFormulaActionListener() {
return new ActionListener() {
public void actionPerformed(ActionEvent e) {
return e -> {
final UIFormula formulaPane = FormulaFactory.createFormulaPane();
formulaPane.populate(BaseFormula.createFormulaBuilder().build(formulaContentTextField.getText()));
formulaPane.showLargeWindow(SwingUtilities.getWindowAncestor(MultiTDTableDataPane.this), new DialogActionAdapter() {
public void doOk() {
BaseFormula formula = formulaPane.update();
if (formula == null) {
formulaContentTextField.setText("");
formulaContentTextField.setText(StringUtils.EMPTY);
} else {
formulaContentTextField.setText(formula.getContent().substring(1));
}
MultiTDTableDataPane.this.refresh();
}
}).setVisible(true);
}
};
}
}

66
designer-base/src/main/java/com/fr/design/gui/frpane/UIBubbleFloatPane.java

@ -9,14 +9,17 @@ import com.fr.stable.Constants;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.border.Border;
import java.awt.AWTEvent;
import java.awt.BasicStroke;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dialog;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Polygon;
import java.awt.Rectangle;
@ -82,15 +85,17 @@ public abstract class UIBubbleFloatPane<T> extends BasicBeanPane<T> {
/**
* show对话框
*
* @param fatherPane 上一层界面 parentPane
* @param ob 传入的内容在show之前populate
*/
public void show(JComponent fatherPane, T ob) {
populateBean(ob);
UIDialog dialog = showUnsizedWindow(SwingUtilities.getWindowAncestor(fatherPane));
showDialog = dialog;
if (showDialog == null) {
showDialog = showUnsizedWindow(SwingUtilities.getWindowAncestor(fatherPane));
}
Toolkit.getDefaultToolkit().addAWTEventListener(awt, AWTEvent.MOUSE_EVENT_MASK);
dialog.setVisible(true);
showDialog.setVisible(true);
}
/**
@ -240,14 +245,14 @@ public abstract class UIBubbleFloatPane<T> extends BasicBeanPane<T> {
polygon.addPoint(GAP_SMALL, (int) ((bounds.height + GAP) * time - GAP_BIG));
polygon.addPoint(GAP_SMALL, 0);
} else if (arrowPosition == Constants.TOP) {
polygon.addPoint(0, GAP_SMALL);
polygon.addPoint((int) (bounds.width * time + GAP_SMALL), GAP_SMALL);
polygon.addPoint(0, GAP_SMALL - 2);
polygon.addPoint((int) (bounds.width * time + GAP_SMALL), GAP_SMALL - 2);
polygon.addPoint((int) (bounds.width * time + GAP), 0);
polygon.addPoint((int) (bounds.getWidth() * time + GAP_BIG), GAP_SMALL);
polygon.addPoint(bounds.width + GAP, GAP_SMALL);
polygon.addPoint((int) (bounds.getWidth() * time + GAP_BIG), GAP_SMALL - 2);
polygon.addPoint(bounds.width + GAP, GAP_SMALL - 2);
polygon.addPoint(bounds.width + GAP, bounds.height + GAP_BIG);
polygon.addPoint(0, bounds.height + GAP_BIG);
polygon.addPoint(0, GAP_SMALL);
polygon.addPoint(0, GAP_SMALL - 2);
} else if (arrowPosition == Constants.RIGHT) {
polygon.addPoint(0, 0);
polygon.addPoint(bounds.width + GAP, 0);
@ -274,14 +279,14 @@ public abstract class UIBubbleFloatPane<T> extends BasicBeanPane<T> {
polygon.addPoint(GAP_SMALL + 1, (int) ((bounds.height + GAP) * time - GAP_BIG));
polygon.addPoint(GAP_SMALL + 1, 1);
} else if (arrowPosition == Constants.TOP) {
polygon.addPoint(1, GAP_SMALL + 1);
polygon.addPoint((int) (bounds.width * time + GAP_SMALL), GAP_SMALL + 1);
polygon.addPoint(1, GAP_SMALL - 1);
polygon.addPoint((int) (bounds.width * time + GAP_SMALL), GAP_SMALL - 1);
polygon.addPoint((int) (bounds.width * time + GAP), 1);
polygon.addPoint((int) (bounds.getWidth() * time + GAP_BIG), GAP_SMALL + 1);
polygon.addPoint(bounds.width + GAP - 1, GAP_SMALL + 1);
polygon.addPoint((int) (bounds.getWidth() * time + GAP_BIG), GAP_SMALL - 1);
polygon.addPoint(bounds.width + GAP - 1, GAP_SMALL - 1);
polygon.addPoint(bounds.width + GAP - 1, bounds.height + GAP_BIG - 1);
polygon.addPoint(1, bounds.height + GAP_BIG - 1);
polygon.addPoint(1, GAP_SMALL + 1);
polygon.addPoint(1, GAP_SMALL - 1);
} else if (arrowPosition == Constants.RIGHT) {
polygon.addPoint(1, 1);
polygon.addPoint(bounds.width + GAP - 1, 1);
@ -295,19 +300,6 @@ public abstract class UIBubbleFloatPane<T> extends BasicBeanPane<T> {
return polygon;
}
/**
* 画出界面的样式, 边框等.
*/
public void paint(Graphics g) {
super.paint(g);
Graphics2D g2d = (Graphics2D) g;
Stroke oldStroke = g2d.getStroke();
g2d.setStroke(new BasicStroke(2, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_ROUND));
g2d.setColor(new Color(51, 51, 51));
g2d.drawPolygon((Polygon) getShape4Board());
g2d.setStroke(oldStroke);
}
protected void initComponents() {
setUndecorated(true);
try {
@ -318,7 +310,27 @@ public abstract class UIBubbleFloatPane<T> extends BasicBeanPane<T> {
final JPanel contentPane = (JPanel) this.getContentPane();
this.setLayout(null);
contentPane.add(UIBubbleFloatPane.this);
setVisible(true);
contentPane.setBorder(new Border() {
@Override
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
Graphics2D g2d = (Graphics2D) g;
Stroke oldStroke = g2d.getStroke();
g2d.setStroke(new BasicStroke(2, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_ROUND));
g2d.setColor(new Color(51, 51, 51));
g2d.drawPolygon((Polygon) getShape4Board());
g2d.setStroke(oldStroke);
}
@Override
public Insets getBorderInsets(Component c) {
return null;
}
@Override
public boolean isBorderOpaque() {
return false;
}
});
}
/**

7
designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableModelAdapter.java

@ -23,7 +23,7 @@ import java.util.List;
* @editor zhou
* @since 2012-3-28下午3:07:44
*/
public abstract class UITableModelAdapter<T extends Object> extends AbstractTableModel implements UITableEditorLoader {
public abstract class UITableModelAdapter<T> extends AbstractTableModel implements UITableEditorLoader {
/**
*
@ -37,7 +37,6 @@ public abstract class UITableModelAdapter<T extends Object> extends AbstractTabl
// list里放的是一行数据
private List<T> list = new ArrayList<T>();
@SuppressWarnings({ "unchecked", "rawtypes" })
protected UITableModelAdapter(String[] columnNames) {
this.columnNames = columnNames;
table = new JTable(this);
@ -101,8 +100,8 @@ public abstract class UITableModelAdapter<T extends Object> extends AbstractTabl
}
}
public void setRowAt(T value, int rowIndwx) {
this.list.set(rowIndwx, value);
public void setRowAt(T value, int rowIndex) {
this.list.set(rowIndex, value);
}
/**

7
designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java

@ -117,6 +117,13 @@ public enum SupportOSImpl implements SupportOS {
public boolean support() {
return OperatingSystem.isWindows();
}
},
KOREAN_INPUT {
@Override
public boolean support() {
return OperatingSystem.isWindows();
}
}
}

8
designer-base/src/main/java/com/fr/design/update/push/DesignerUpdateInfo.java

@ -24,6 +24,7 @@ class DesignerUpdateInfo {
private final String currentVersion; // 当前版本
private final String latestVersion; // 最新版本
private final String latestFullVersion; // 最新版本的完整信息
private final String lastIgnoredVersion; // 最近一次跳过的版本
private final String pushVersion; // 推送版本
@ -34,6 +35,7 @@ class DesignerUpdateInfo {
DesignerUpdateInfo(String currentVersion, String latestVersion, String lastIgnoredVersion, JSONObject pushData) {
this.currentVersion = currentVersion;
this.latestVersion = latestVersion;
this.latestFullVersion = initLatestFullVersion();
this.lastIgnoredVersion = lastIgnoredVersion;
this.pushVersion = pushData.optString(KEY_VERSION);
@ -65,7 +67,7 @@ class DesignerUpdateInfo {
return latestVersion;
}
String getLatestFullVersion() {
String initLatestFullVersion() {
try {
String url = CloudCenter.getInstance().acquireUrlByKind("jar10.new.update");
if (StringUtils.isBlank(url)) {
@ -85,6 +87,10 @@ class DesignerUpdateInfo {
return StringUtils.EMPTY;
}
String getLatestFullVersion() {
return latestFullVersion;
}
String getLastIgnoredVersion() {
return lastIgnoredVersion;
}

61
designer-base/src/main/java/com/fr/design/utils/ParameterUtils.java

@ -0,0 +1,61 @@
package com.fr.design.utils;
import com.fr.base.Parameter;
import com.fr.base.ParameterHelper;
import com.fr.general.ComparatorUtils;
import com.fr.stable.ArrayUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
/**
* @Author: Yuan.Wang
* @Date: 2020/8/11
*/
public class ParameterUtils {
/**
* 获得新的参数集合,返回的集合中的参数的顺序为新增参数全部放在后面以保证原有参数的相对顺序
*
* @param paramTexts sql语句
* @param oldParameters 旧的参数集合
* @return 新参数集合
*/
public static Parameter[] analyzeAndUnionParameters(String[] paramTexts, Parameter[] oldParameters) {
Parameter[] newParameters = ParameterHelper.analyze4Parameters(paramTexts, false);
return unionParametersInRelativeOrder(oldParameters, newParameters);
}
/**
* 合并新旧参数集合新增参数全部放在后面以保证原有参数的相对顺序
*
* @param oldParameters 旧的参数集合
* @param newParameters 新的参数集合
* @return 新参数集合
*/
private static Parameter[] unionParametersInRelativeOrder(Parameter[] oldParameters, Parameter[] newParameters) {
if (ArrayUtils.isEmpty(newParameters) || ArrayUtils.isEmpty(oldParameters)) {
return newParameters;
}
Parameter[] result = new Parameter[newParameters.length];
List<Parameter> newParameterList = new ArrayList<>(Arrays.asList(newParameters));
int i = 0;
//遍历旧参数数组中的参数,如果新参数list中存在同名参数,将该参数加入到result里,同时删除list中的同名参数
for (Parameter oldParameter : oldParameters) {
Iterator<Parameter> iterator = newParameterList.listIterator();
while (iterator.hasNext()) {
Parameter newParameter = iterator.next();
if (ComparatorUtils.equals(oldParameter.getName(), newParameter.getName())) {
result[i++] = oldParameter;
iterator.remove();
break;
}
}
}
//将新参数list中的剩余参数添加到result中
System.arraycopy(newParameterList.toArray(new Parameter[0]), 0, result, i, newParameterList.size());
return result;
}
}

2
designer-base/src/main/resources/com/fr/design/ui/update/push/pushUpdate.css

@ -1,6 +1,6 @@
body {
padding-left: 30px;
padding-top: 30px;
padding-top: 25px;
color: white;
background-size: 100% 100% !important;
-moz-background-size: 100% 100% !important;

38
designer-base/src/test/java/com/fr/design/utils/ParameterUtilsTest.java

@ -0,0 +1,38 @@
package com.fr.design.utils;
import com.fr.base.Parameter;
import junit.framework.TestCase;
/**
* @Author: Yuan.Wang
* @Date: 2020/8/11
*/
public class ParameterUtilsTest extends TestCase {
public void testAnalyzeAndUnionParameters() {
String[] paramTexts = {"${a}${b}${d}", ""};
Parameter[] oldParameters = new Parameter[]{new Parameter("c"), new Parameter("b"), new Parameter("a")};
Parameter[] rightResult = new Parameter[]{new Parameter("b"), new Parameter("a"), new Parameter("d")};
Parameter[] result = ParameterUtils.analyzeAndUnionParameters(paramTexts, oldParameters);
assertEquals(result.length, rightResult.length);
for (int i = 0; i < rightResult.length; i++) {
assertEquals(rightResult[i].getName(), result[i].getName());
}
paramTexts = new String[]{"${a}${b}${d}", ""};
oldParameters = new Parameter[]{};
rightResult = new Parameter[]{new Parameter("a"), new Parameter("b"), new Parameter("d")};
result = ParameterUtils.analyzeAndUnionParameters(paramTexts, oldParameters);
assertEquals(result.length,rightResult.length);
paramTexts = new String[]{"${b}", ""};
oldParameters = new Parameter[]{new Parameter("b"), new Parameter("a"), new Parameter("d")};
rightResult = new Parameter[]{new Parameter("b")};
result = ParameterUtils.analyzeAndUnionParameters(paramTexts, oldParameters);
assertEquals(result.length,rightResult.length);
assertEquals(result.length, rightResult.length);
for (int i = 0; i < rightResult.length; i++) {
assertEquals(rightResult[i].getName(), result[i].getName());
}
}
}

9
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java

@ -1,7 +1,6 @@
package com.fr.van.chart.designer.style;
import com.fr.base.BaseUtils;
import com.fr.base.Style;
import com.fr.chart.chartattr.Plot;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.UIBubbleFloatPane;
@ -61,6 +60,7 @@ public class VanChartPlotLegendPane extends BasicPane {
private UIButtonGroup<LayoutType> layoutButton;
private JPanel layoutPane;
private VanChartFloatPositionPane customFloatPositionPane;
private UIBubbleFloatPane uiBubbleFloatPane;
//区域显示策略 恢复用注释。下面4行删除。
private UIButtonGroup<Integer> customSize;
@ -265,15 +265,17 @@ public class VanChartPlotLegendPane extends BasicPane {
if (customFloatPositionPane == null) {
customFloatPositionPane = new VanChartFloatPositionPane();
}
if (uiBubbleFloatPane == null) {
Point comPoint = customFloatPositionButton.getLocationOnScreen();
Point arrowPoint = new Point(comPoint.x + customFloatPositionButton.getWidth() / 2 - GAP, comPoint.y + customFloatPositionButton.getHeight());
UIBubbleFloatPane<Style> pane = new UIBubbleFloatPane(Constants.TOP, arrowPoint, customFloatPositionPane, WIDTH, HEIGHT) {
uiBubbleFloatPane = new UIBubbleFloatPane(Constants.TOP, arrowPoint, customFloatPositionPane, WIDTH, HEIGHT) {
@Override
public void updateContentPane() {
parent.attributeChanged();
}
};
pane.show(VanChartPlotLegendPane.this, null);
}
uiBubbleFloatPane.show(VanChartPlotLegendPane.this, null);
}
});
}
@ -368,6 +370,7 @@ public class VanChartPlotLegendPane extends BasicPane {
/**
* 标题
*
* @return 标题
*/
public String title4PopupWindow() {

9
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java

@ -2,7 +2,6 @@ package com.fr.van.chart.designer.style;
import com.fr.base.BaseFormula;
import com.fr.base.BaseUtils;
import com.fr.base.Style;
import com.fr.base.Utils;
import com.fr.chart.base.TextAttr;
import com.fr.chartx.config.info.constant.ConfigType;
@ -61,6 +60,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
private UIToggleButton useHtml;
private UIToggleButton customFloatPositionButton;
private VanChartFloatPositionPane customFloatPositionPane;
private UIBubbleFloatPane uiBubbleFloatPane;
//区域显示策略 恢复用注释。下面3行删除。
private UIButtonGroup<Integer> limitSize;
@ -225,15 +225,17 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
if (customFloatPositionPane == null) {
customFloatPositionPane = new VanChartFloatPositionPane();
}
if (uiBubbleFloatPane == null) {
Point comPoint = customFloatPositionButton.getLocationOnScreen();
Point arrowPoint = new Point(comPoint.x + customFloatPositionButton.getWidth() / 2 - GAP, comPoint.y + customFloatPositionButton.getHeight());
UIBubbleFloatPane<Style> pane = new UIBubbleFloatPane(Constants.TOP, arrowPoint, customFloatPositionPane, WIDTH, HEIGHT) {
uiBubbleFloatPane = new UIBubbleFloatPane(Constants.TOP, arrowPoint, customFloatPositionPane, WIDTH, HEIGHT) {
@Override
public void updateContentPane() {
parent.attributeChanged();
}
};
pane.show(VanChartTitlePane.this, null);
}
uiBubbleFloatPane.show(VanChartTitlePane.this, null);
}
});
}
@ -270,6 +272,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
/**
* 弹出框的界面标题
*
* @return 界面标题
*/
public String title4PopupWindow() {

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

@ -685,8 +685,8 @@ public class EditingMouseListener extends MouseInputAdapter {
Rectangle rect = ComponentUtils.getRelativeBounds(currentXCreator);
Rectangle bounds = new Rectangle(1, 1, currentXCreator.getWidth() - 2, currentXCreator.getHeight() - 2);
bounds.x += (rect.x - designer.getArea().getHorizontalValue());
bounds.y += (rect.y - designer.getArea().getVerticalValue());
bounds.x += (rect.x - designer.getHorizontalScaleValue());
bounds.y += (rect.y - designer.getVerticalScaleValue());
if (currentXCreator instanceof XEditorHolder) {
ToolTipEditor.getInstance().resetBounds((XEditorHolder) currentXCreator, bounds, currentEditor.getEditorTarget().getBounds());
}

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

@ -177,13 +177,13 @@ public class FormDesignerUI extends ComponentUI {
if (k == 1 || k == 2) {
x1 = 0;
x2 = 6;
y2 = y1 = bounds.y - designer.getArea().getVerticalValue() + (k == 1 ? 0 : bounds.height);
text = Utils.objectToString(y1 + designer.getArea().getVerticalValue());
y2 = y1 = bounds.y - designer.getVerticalScaleValue() + (k == 1 ? 0 : bounds.height);
text = Utils.objectToString(bounds.y);
} else {
y1 = 0;
y2 = 6;
x1 = x2 = bounds.x - designer.getArea().getHorizontalValue() + (k == 3 ? 0 : bounds.width);
text = Utils.objectToString(x1 + designer.getArea().getHorizontalValue());
x1 = x2 = bounds.x - designer.getHorizontalScaleValue()+ (k == 3 ? 0 : bounds.width);
text = Utils.objectToString(bounds.x);
}
text += com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Indent_Pixel");
g2d.setColor(XCreatorConstants.RESIZE_BOX_BORDER_COLOR);
@ -409,8 +409,8 @@ public class FormDesignerUI extends ComponentUI {
clipg = g.create(
-designer.getHorizontalScaleValue(),
-designer.getVerticalScaleValue() + designer.getParaHeight(),
parent.getSize().width + designer.getArea().getHorizontalValue(),
parent.getSize().height + designer.getArea().getVerticalValue());
(int) ((parent.getSize().width + designer.getArea().getHorizontalValue()) / designer.getScale()),
(int) ((parent.getSize().height + designer.getArea().getVerticalValue()) / designer.getScale()));
designer.paintContent(clipg);
paintWatermark((Graphics2D) clipg);
@ -435,8 +435,8 @@ public class FormDesignerUI extends ComponentUI {
Graphics clipg1;
clipg1 = g.create(-designer.getHorizontalScaleValue(),
-designer.getVerticalScaleValue(),
parent.getSize().width + designer.getArea().getHorizontalValue(),
designer.getParaHeight() + designer.getArea().getVerticalValue());
(int) ((parent.getSize().width + designer.getArea().getHorizontalValue()) / designer.getScale()),
(int) ((designer.getParaHeight() + designer.getArea().getVerticalValue()) / designer.getScale()));
designer.paintPara(clipg1);
clipg1.dispose();

5
designer-form/src/main/java/com/fr/design/mainframe/FormSelectionUtils.java

@ -94,6 +94,7 @@ public class FormSelectionUtils {
designer.getSelectionModel().getSelection().reset();
Rectangle rec = clipboard.getSelctionBounds();
boolean addSuccess = false;
for (XCreator creator : clipboard.getSelectedCreators()) {
try {
XCreator copiedCreator = copyXcreator(designer.getTarget(), creator);
@ -107,7 +108,7 @@ public class FormSelectionUtils {
return;
}
resetTabSub2RealSize(copiedCreator);
boolean addSuccess = adapter.addBean(copiedCreator, point.x, point.y);
addSuccess = adapter.addBean(copiedCreator, point.x, point.y);
if (addSuccess) {
designer.getSelectionModel().getSelection().addSelectedCreator(copiedCreator);
}
@ -115,7 +116,9 @@ public class FormSelectionUtils {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
if (!addSuccess) {
rebuildSelection(designer);
}
designer.getEditListenerTable().fireCreatorModified(
designer.getSelectionModel().getSelection().getSelectedCreator(), DesignerEvent.CREATOR_PASTED);

8
designer-realize/src/main/java/com/fr/grid/Grid.java

@ -130,6 +130,8 @@ public class Grid extends BaseGridComponent {
private boolean notShowingTableSelectPane = true;
private GridMouseAdapter gridMouseAdapter;
private boolean needRequestFocus = true;
public Grid(int resolution) {
this.resolution = resolution;
// 能触发processEvent,不管是否给component增加listener
@ -259,6 +261,10 @@ public class Grid extends BaseGridComponent {
this.getElementCasePane().repaint();
}
public void setNeedRequestFocus(boolean needRequestFocus) {
this.needRequestFocus = needRequestFocus;
}
/**
* Gets vertical frozen line color.
*/
@ -908,8 +914,10 @@ public class Grid extends BaseGridComponent {
this.validate();
// 需要重新绘制界面
this.repaint(10);
if (this.needRequestFocus) {
this.editorComponent.requestFocus();
}
}
/**
* 停止编辑状态

5
designer-realize/src/main/java/com/fr/grid/GridKeyListener.java

@ -2,10 +2,12 @@ package com.fr.grid;
import com.fr.common.inputevent.InputEventBaseOnOS;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.action.GridInputAction;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.report.elementcase.ElementCase;
import com.fr.stable.os.support.OSSupportCenter;
import java.awt.*;
import java.awt.event.KeyEvent;
@ -177,6 +179,9 @@ public class GridKeyListener implements KeyListener {
return;
}
if (!grid.isCellEditing()) {
GridInputAction action = OSSupportCenter.getAction(GridInputAction.class);
action.register(grid, ch);
action.execute();
grid.startEditing(true);
}

31
designer-realize/src/main/java/com/fr/grid/action/GridInputAction.java

@ -0,0 +1,31 @@
package com.fr.grid.action;
import com.fr.design.os.impl.SupportOSImpl;
import com.fr.grid.Grid;
import com.fr.grid.help.GridHelper;
import com.fr.stable.os.support.OSBasedAction;
/**
* @author hades
* @version 10.0
* Created by hades on 2020/8/12
*/
public class GridInputAction implements OSBasedAction {
private Grid grid;
private char ch;
@Override
public void execute(Object... objects) {
// win下韩语输入法与其他输入法不一样 在输入第二个字符时 就开始触发keyType 而其中grid的焦点转移会导致输入失效
boolean accept = SupportOSImpl.KOREAN_INPUT.support() && grid != null;
if (accept) {
grid.setNeedRequestFocus(!GridHelper.isKoreanCharacter(ch));
}
}
public void register(Grid grid, char ch) {
this.grid = grid;
this.ch = ch;
}
}

53
designer-realize/src/main/java/com/fr/grid/help/GridHelper.java

@ -0,0 +1,53 @@
package com.fr.grid.help;
/**
* 韩文unicode编码范围
* http://www.ch2ko.com/hanguoyu/hanwen-unicode/
*
* 韩文音节AC00-D7AF
* Character.UnicodeBlock.HANGUL_SYLLABLES
* https://www.unicode.org/charts/PDF/UAC00.pdf
*
*
* 韩文兼容字母3130-318F
* Character.UnicodeBlock.HANGUL_COMPATIBILITY_JAMO
* https://www.unicode.org/charts/PDF/U3130.pdf
*
*
* 韩文字母1100-11FF
* Character.UnicodeBlock.HANGUL_JAMO
* https://www.unicode.org/charts/PDF/U1100.pdf
*
*
* 韩文字母扩展A
* Character.UnicodeBlock.HANGUL_JAMO_EXTENDED_A
* https://www.unicode.org/charts/PDF/UA960.pdf
*
*
* 韩文字母扩展B
* haracter.UnicodeBlock.HANGUL_JAMO_EXTENDED_B
* https://www.unicode.org/charts/PDF/UD7B0.pdf
*
*
* 使用java内部的韩文unicode集判断
*
* @author hades
* @version 10.0
* Created by hades on 2020/8/7
*/
public class GridHelper {
/**
* 韩国货币符号
*/
private static final char HEX_20A9 = 0x20A9;
public static boolean isKoreanCharacter(char value) {
Character.UnicodeBlock unicodeBlock = Character.UnicodeBlock.of(value);
return unicodeBlock == Character.UnicodeBlock.HANGUL_JAMO
|| unicodeBlock == Character.UnicodeBlock.HANGUL_COMPATIBILITY_JAMO
|| unicodeBlock == Character.UnicodeBlock.HANGUL_SYLLABLES
|| unicodeBlock == Character.UnicodeBlock.HANGUL_JAMO_EXTENDED_A
|| unicodeBlock == Character.UnicodeBlock.HANGUL_JAMO_EXTENDED_B
|| value == HEX_20A9;
}
}

5
designer-realize/src/main/java/com/fr/poly/PolyDesigner.java

@ -390,6 +390,11 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
setChooseType(SelectionType.NONE);
return;
}
if (this.selection == null && this.selectedtype != SelectionType.NONE) {
this.selectedtype = SelectionType.NONE;
}
if (this.selection != selectElement) {
this.selection = selectElement;
fireSelectionChanged();

2
designer-realize/src/main/java/com/fr/start/MainDesigner.java

@ -144,7 +144,7 @@ public class MainDesigner extends BaseDesigner {
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return shortCuts.toArray(new ShortCut[shortCuts.size()]);
return shortCuts.toArray(new ShortCut[0]);
}
@Override

47
designer-realize/src/test/java/com/fr/grid/help/GridHelperTest.java

@ -0,0 +1,47 @@
package com.fr.grid.help;
import junit.framework.TestCase;
import org.junit.Assert;
/**
* @author hades
* @version 10.0
* Created by hades on 2020/8/7
*/
public class GridHelperTest extends TestCase {
/**
* 为空
*/
private char ch;
public void testIsKoreanCharacter() {
Assert.assertFalse(GridHelper.isKoreanCharacter('1'));
Assert.assertFalse(GridHelper.isKoreanCharacter('A'));
Assert.assertFalse(GridHelper.isKoreanCharacter('z'));
Assert.assertFalse(GridHelper.isKoreanCharacter('测'));
Assert.assertFalse(GridHelper.isKoreanCharacter('測'));
Assert.assertFalse(GridHelper.isKoreanCharacter('鐪'));
Assert.assertFalse(GridHelper.isKoreanCharacter('&'));
Assert.assertFalse(GridHelper.isKoreanCharacter(' '));
Assert.assertFalse(GridHelper.isKoreanCharacter(ch));
Assert.assertFalse(GridHelper.isKoreanCharacter('は'));
Assert.assertTrue(GridHelper.isKoreanCharacter('먀'));
Assert.assertTrue(GridHelper.isKoreanCharacter('이'));
Assert.assertTrue(GridHelper.isKoreanCharacter('한'));
// 韩文音节
Assert.assertTrue(GridHelper.isKoreanCharacter('휖'));
// 韩文兼容字母
Assert.assertTrue(GridHelper.isKoreanCharacter('ㆋ'));
// 韩文字母
Assert.assertTrue(GridHelper.isKoreanCharacter('ᇪ'));
// 韩文字母扩展A
Assert.assertTrue(GridHelper.isKoreanCharacter('ꥵ'));
// 韩文字母扩展B
Assert.assertTrue(GridHelper.isKoreanCharacter('ퟂ'));
// 韩文货币符号
Assert.assertTrue(GridHelper.isKoreanCharacter('₩'));
}
}
Loading…
Cancel
Save