Browse Source

Merge pull request #3858 in DESIGN/design from final/10.0 to bugfix/10.0

* commit '5bf0d5d0ed78bfedbae43b12ed32820f80c3acef':
  REPORT-50204 未保存点击预览,提示保存模板的弹窗,点击取消后再弹窗
  REPORT-50191 设计器-服务器数据集-左下角图标变化失效 【问题原因】REPORT-49782任务中补充图标的时候,图标名称写错了,导致没识别出来 【改动思路】修改图标名称
  CHART-18080 变量名更换
  CHART-18619 gis国际化默认值修改
  REPORT-50030 单元格外边框设置其他颜色设计器内显示与黑色不一样
  CHART-18348 调整富文本组件尺寸
  无JIRA任务 上传下因代码冲突被删除的svg图标
  REPORT-48965 使用批量添加 减少容器复制次数
  REPORT-48965 出现concurrentModification异常
  CHART-18080 修复数字输入框输入中文时自动删除数字问题
  REPORT-45944  ui调整
bugfix/10.0
superman 4 years ago
parent
commit
8d55f79fa2
  1. 16
      designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java
  2. 2
      designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java
  3. 42
      designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java
  4. 30
      designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java
  5. 8
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  6. 0
      designer-base/src/main/resources/com/fr/design/images/control/edit_disabled.svg
  7. 0
      designer-base/src/main/resources/com/fr/design/images/control/remove_disabled.svg
  8. 0
      designer-base/src/main/resources/com/fr/design/images/m_file/preview_disabled.svg
  9. 9
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java
  10. 4
      designer-chart/src/main/resources/com/fr/design/editor/script/editor.js
  11. 4
      designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js
  12. 5
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java
  13. 4
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java
  14. 5
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java
  15. 23
      designer-realize/src/main/java/com/fr/design/style/BorderUtils.java

16
designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java

@ -13,12 +13,14 @@ import javax.swing.KeyStroke;
import java.awt.event.KeyEvent;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CopyOnWriteArraySet;
/**
* 插入单元格元素和插入悬浮元素的一些集合方法
@ -27,8 +29,8 @@ import java.util.concurrent.ConcurrentMap;
* @version 2017年11月17日14点39分
*/
public class ActionFactory {
private static LinkedHashSet<Class<?>> actionClasses = new LinkedHashSet<>();
private static LinkedHashSet<Class<?>> floatActionClasses = new LinkedHashSet<>();
private static Set<Class<?>> actionClasses = new CopyOnWriteArraySet<>();
private static Set<Class<?>> floatActionClasses = new CopyOnWriteArraySet<>();
private static Class chartCollectionClass = null;
/**
* 无需每次实例化的悬浮元素编辑器
@ -256,14 +258,14 @@ public class ActionFactory {
*/
public static void registerCellInsertActionClass(Class<?>[] cls) {
if (cls != null) {
Collections.addAll(actionClasses, cls);
actionClasses.addAll(Arrays.asList(cls));
}
}
public static void referCellInsertActionClass(Class<?>[] cls) {
if (cls != null) {
actionClasses.clear();
Collections.addAll(actionClasses, cls);
actionClasses.addAll(Arrays.asList(cls));
}
}
@ -321,14 +323,14 @@ public class ActionFactory {
*/
public static void registerFloatInsertActionClass(Class<?>[] cls) {
if (cls != null) {
Collections.addAll(floatActionClasses, cls);
floatActionClasses.addAll(Arrays.asList(cls));
}
}
public static void referFloatInsertActionClass(Class<?>[] cls) {
if (cls != null) {
floatActionClasses.clear();
Collections.addAll(floatActionClasses, cls);
floatActionClasses.addAll(Arrays.asList(cls));
}
}

2
designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java

@ -86,6 +86,8 @@ public final class WebPreviewUtils {
if (!jt.saveAsTemplate()) {
return;
}
} else {
return;
}
currentTemplate = jt.getEditingFILE();
}

42
designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java

@ -5,11 +5,15 @@ import com.fr.general.ComparatorUtils;
import com.fr.stable.CoreConstants;
import com.fr.stable.StringUtils;
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.PlainDocument;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.InputMethodEvent;
import java.awt.event.InputMethodListener;
/**
* Number Field.
@ -35,6 +39,11 @@ public class UINumberField extends UITextField {
private boolean isContentChanged = false;
private boolean fillNegativeNumber = true;
/**
* 输入法输入完成一个字符输入过程的标记开始输入的时候是true输入完矫正光标后为false
*/
private boolean isInputMethodOnceInserting = false;
private int insertOffset = 0;
public UINumberField() {
this(MAX_INTEGERLENGTH_32, MAX_DECIMALLENGTH);
@ -55,6 +64,7 @@ public class UINumberField extends UITextField {
this.minValue = minValue;
this.maxValue = maxValue;
setFieldDocument();
initFieldListener();
}
public void setFieldDocument() {
@ -62,6 +72,31 @@ public class UINumberField extends UITextField {
initListener();
}
private void initFieldListener() {
addInputMethodListener(new InputMethodListener() {
@Override
public void inputMethodTextChanged(InputMethodEvent event) {
isInputMethodOnceInserting = true;
}
@Override
public void caretPositionChanged(InputMethodEvent event) {
}
});
addCaretListener(new CaretListener() {
@Override
public void caretUpdate(CaretEvent e) {
if (isInputMethodOnceInserting) {
isInputMethodOnceInserting = false;
setCaretPosition(insertOffset);
} else {
insertOffset = e.getDot();
}
}
});
}
public void canFillNegativeNumber(boolean fillNegativeNumber) {
this.fillNegativeNumber = fillNegativeNumber;
}
@ -186,6 +221,13 @@ public class UINumberField extends UITextField {
super.insertString(offset, s, a);
}
public void remove(int offs, int len) throws BadLocationException {
if (isInputMethodOnceInserting) {
return;
}
super.remove(offs, len);
}
// kunsnat: 这种限制输入 有个不好的地方, 比如删除时: 10.1 最大值限定100, 那么就删除中间的小数点之后变为101, 超出了100.
// 但是直接限制不能删除中间类似小数点, 那么也可能遇到: 最小值10 , 从100变化到其中的19, 就很难..
private boolean notChange(String strNew) {

30
designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java

@ -217,18 +217,36 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse
int lineStyle = currentLineCombo.getSelectedLineStyle();
Color lineColor = currentLineColorPane.getSelectObject();
CellBorderStyle cellBorderStyle = new CellBorderStyle();
cellBorderStyle.setTopColor(lineColor);
if (topToggleButton.isSelected()) {
cellBorderStyle.setTopColor(lineColor);
}
cellBorderStyle.setTopStyle(topToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
cellBorderStyle.setBottomColor(lineColor);
if (bottomToggleButton.isSelected()) {
cellBorderStyle.setBottomColor(lineColor);
}
cellBorderStyle.setBottomStyle(bottomToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
cellBorderStyle.setLeftColor(lineColor);
if (leftToggleButton.isSelected()) {
cellBorderStyle.setLeftColor(lineColor);
}
cellBorderStyle.setLeftStyle(leftToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
cellBorderStyle.setRightColor(lineColor);
if (rightToggleButton.isSelected()) {
cellBorderStyle.setRightColor(lineColor);
}
cellBorderStyle.setRightStyle(rightToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
cellBorderStyle.setVerticalColor(lineColor);
if (verticalToggleButton.isSelected()) {
cellBorderStyle.setVerticalColor(lineColor);
}
cellBorderStyle.setVerticalStyle(verticalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
cellBorderStyle.setHorizontalColor(lineColor);
if (horizontalToggleButton.isSelected()) {
cellBorderStyle.setHorizontalColor(lineColor);
}
cellBorderStyle.setHorizontalStyle(horizontalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
if (leftToggleButton.isSelected() && bottomToggleButton.isSelected() && rightToggleButton.isSelected() && topToggleButton.isSelected()) {
outerToggleButton.setSelected(true);
} else {

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

@ -598,7 +598,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
});
// 重名提示
warnLabel = new UILabel();
warnLabel.setPreferredSize(new Dimension(300, 30));
warnLabel.setPreferredSize(new Dimension(300, 50));
warnLabel.setHorizontalAlignment(SwingConstants.LEFT);
warnLabel.setVerticalAlignment(SwingConstants.TOP);
warnLabel.setForeground(Color.RED);
@ -641,7 +641,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
new Component[]{midPanel},
new Component[]{buttonsPane}
},
new double[]{TableLayout.FILL, TableLayout.FILL, TableLayout.PREFERRED},
new double[]{TableLayout.FILL, TableLayout.PREFERRED, TableLayout.PREFERRED},
new double[]{TableLayout.FILL}
),
BorderLayout.CENTER);
@ -803,7 +803,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
});
// 重名提示
warnLabel = new UILabel();
warnLabel.setPreferredSize(new Dimension(300, 30));
warnLabel.setPreferredSize(new Dimension(300, 50));
warnLabel.setHorizontalAlignment(SwingConstants.LEFT);
warnLabel.setVerticalAlignment(SwingConstants.TOP);
warnLabel.setForeground(Color.RED);
@ -848,7 +848,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
new Component[]{midPanel},
new Component[]{bottomPanel}
},
new double[]{TableLayout.FILL, TableLayout.FILL, TableLayout.PREFERRED},
new double[]{TableLayout.FILL, TableLayout.PREFERRED, TableLayout.PREFERRED},
new double[]{TableLayout.FILL}
),
BorderLayout.CENTER);

0
designer-base/src/main/resources/com/fr/design/images/control/edit_disable.svg → designer-base/src/main/resources/com/fr/design/images/control/edit_disabled.svg

Before

Width:  |  Height:  |  Size: 864 B

After

Width:  |  Height:  |  Size: 864 B

0
designer-base/src/main/resources/com/fr/design/images/control/remove_disable.svg → designer-base/src/main/resources/com/fr/design/images/control/remove_disabled.svg

Before

Width:  |  Height:  |  Size: 804 B

After

Width:  |  Height:  |  Size: 804 B

0
designer-base/src/main/resources/com/fr/design/images/m_file/preview_disable.svg → designer-base/src/main/resources/com/fr/design/images/m_file/preview_disabled.svg

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

9
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java

@ -221,12 +221,9 @@ public class GisLayerPane extends JPanel implements UIObserver {
/* mapPlot.getGisLayer().setGisLayerType(GISLayerType.AUTO);
mapPlot.getGisLayer().setLayerName(GISLayerType.getLocString(GISLayerType.AUTO));*/
GaoDeGisType gaoDeGisType= mapPlot.getDefaultGisLayerType();
mapPlot.getGisLayer().setGisLayerType(GISLayerType.GAO_DE_API);
mapPlot.getGisLayer().setLayerName(gaoDeGisType.getTypeName());
mapPlot.getGisLayer().setGaoDeGisType(gaoDeGisType);
populate(mapPlot.getGisLayer());
GisLayer defaultGisLayer = mapPlot.getDefaultGisLayer();
mapPlot.setGisLayer(defaultGisLayer);
populate(defaultGisLayer);
}
public void populate(GisLayer layer) {

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

@ -74,10 +74,10 @@
}],
layouts: [{
type: "bi.left",
rgap: 5
rgap: 2
}],
value: this.model.mode,
width: 125
width: 170
}, this._getToolBar()],
height: 24
}, {

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

@ -18,7 +18,7 @@
return [{
type: "bi.single_select_radio_item",
text: BI.i18nText("BI-Basic_Auto"),
width: 50,
width: 70,
logic: {
dynamic: true
},
@ -27,7 +27,7 @@
}, {
type: "bi.single_select_radio_item",
text: BI.i18nText("BI-Basic_Custom"),
width: 60,
width: 80,
logic: {
dynamic: true
},

5
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java

@ -3,6 +3,7 @@ package com.fr.design.mainframe.cell.settingpane;
import com.fr.base.Style;
import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.cell.settingpane.style.StylePane;
import com.fr.design.style.BorderUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.report.cell.DefaultTemplateCellElement;
@ -67,6 +68,7 @@ public class CellStylePane extends AbstractCellAttrPane {
@Override
public void updateBeans() {
Object[] selectionCellBorderObjects = BorderUtils.createCellBorderObject(elementCasePane);
if (stylePane.getSelectedIndex() == 1) {
Style s = stylePane.updateBean();
TemplateElementCase elementCase = elementCasePane.getEditingElementCase();
@ -110,7 +112,8 @@ public class CellStylePane extends AbstractCellAttrPane {
}
}
}
stylePane.updateBorder();// border必须特别处理
// border必须特别处理
stylePane.updateBorder(selectionCellBorderObjects);
}
}

4
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java

@ -136,8 +136,8 @@ public class CustomStylePane extends MultiTabPane<Style> {
/**
*
*/
public void updateBorder() {
BorderUtils.update(reportPane, ((BorderPane) paneList.get(ONE_INDEX)).update());
public void updateBorder(Object[] selectionCellBorderObjects) {
BorderUtils.update(reportPane, selectionCellBorderObjects, ((BorderPane) paneList.get(ONE_INDEX)).update());
}
/**

5
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java

@ -38,10 +38,9 @@ public class StylePane extends UIComboBoxPane<Style> {
customStylePane.addTabChangeListener(changeListener);
}
public void updateBorder() {
public void updateBorder(Object[] selectionCellBorderObjects) {
if (getSelectedIndex() == 0 && customStylePane.isBorderPaneSelected()) {
customStylePane.updateBorder();
customStylePane.updateBorder(selectionCellBorderObjects);
}
}

23
designer-realize/src/main/java/com/fr/design/style/BorderUtils.java

@ -464,8 +464,13 @@ public abstract class BorderUtils {
* changed, need to support undo/redo
*/
public static boolean update(ElementCasePane reportPane, CellBorderStyle newCellBorderStyle) {
Object[] selectionCellBorderObjects = createCellBorderObject(reportPane);
return update(reportPane, selectionCellBorderObjects, newCellBorderStyle);
}
public static boolean update(ElementCasePane reportPane, Object[] selectionCellBorderObjects, CellBorderStyle newCellBorderStyle) {
boolean isBorderColorStyleChanged = false;
Object[] fourObjectArray = createCellBorderObject(reportPane);
Object[] fourObjectArray = selectionCellBorderObjects;
if (fourObjectArray == null || fourObjectArray.length < NUMBER) {
return false;
}
@ -526,44 +531,60 @@ public abstract class BorderUtils {
if (cellBorderStyle.getLeftStyle() != newCellBorderStyle.getLeftStyle()
|| !ComparatorUtils.equals(cellBorderStyle.getLeftColor(), newCellBorderStyle.getLeftColor())) {
style = style.deriveBorderLeft(newCellBorderStyle.getLeftStyle(), newCellBorderStyle.getLeftColor());
} else {
style = style.deriveBorderLeft(cellBorderStyle.getLeftStyle(), cellBorderStyle.getLeftColor());
}
} else {
if (cellBorderStyle.getVerticalStyle() != newCellBorderStyle.getVerticalStyle()
|| !ComparatorUtils.equals(cellBorderStyle.getVerticalColor(), newCellBorderStyle.getVerticalColor())) {
style = style.deriveBorderLeft(newCellBorderStyle.getVerticalStyle(), newCellBorderStyle.getVerticalColor());
} else {
style = style.deriveBorderLeft(cellBorderStyle.getVerticalStyle(), cellBorderStyle.getVerticalColor());
}
}
if (tmpCellElement.getColumn() + tmpCellElement.getColumnSpan() == column + columnSpan) {
if (cellBorderStyle.getRightStyle() != newCellBorderStyle.getRightStyle()
|| !ComparatorUtils.equals(cellBorderStyle.getRightColor(), newCellBorderStyle.getRightColor())) {
style = style.deriveBorderRight(newCellBorderStyle.getRightStyle(), newCellBorderStyle.getRightColor());
} else {
style = style.deriveBorderRight(cellBorderStyle.getRightStyle(), cellBorderStyle.getRightColor());
}
} else {
if (cellBorderStyle.getVerticalStyle() != newCellBorderStyle.getVerticalStyle()
|| !ComparatorUtils.equals(cellBorderStyle.getVerticalColor(), newCellBorderStyle.getVerticalColor())) {
style = style.deriveBorderRight(newCellBorderStyle.getVerticalStyle(), newCellBorderStyle.getVerticalColor());
} else {
style = style.deriveBorderRight(cellBorderStyle.getVerticalStyle(), cellBorderStyle.getVerticalColor());
}
}
if (tmpCellElement.getRow() == row) {
if (cellBorderStyle.getTopStyle() != newCellBorderStyle.getTopStyle()
|| !ComparatorUtils.equals(cellBorderStyle.getTopColor(), newCellBorderStyle.getTopColor())) {
style = style.deriveBorderTop(newCellBorderStyle.getTopStyle(), newCellBorderStyle.getTopColor());
} else {
style = style.deriveBorderTop(cellBorderStyle.getTopStyle(), cellBorderStyle.getTopColor());
}
} else {
if (cellBorderStyle.getHorizontalStyle() != newCellBorderStyle.getHorizontalStyle()
|| !ComparatorUtils.equals(cellBorderStyle.getHorizontalColor(), newCellBorderStyle.getHorizontalColor())) {
style = style.deriveBorderTop(newCellBorderStyle.getHorizontalStyle(), newCellBorderStyle.getHorizontalColor());
} else {
style = style.deriveBorderTop(cellBorderStyle.getHorizontalStyle(), cellBorderStyle.getHorizontalColor());
}
}
if (tmpCellElement.getRow() + tmpCellElement.getRowSpan() == row + rowSpan) {
if (cellBorderStyle.getBottomStyle() != newCellBorderStyle.getBottomStyle()
|| !ComparatorUtils.equals(cellBorderStyle.getBottomColor(), newCellBorderStyle.getBottomColor())) {
style = style.deriveBorderBottom(newCellBorderStyle.getBottomStyle(), newCellBorderStyle.getBottomColor());
} else {
style = style.deriveBorderBottom(cellBorderStyle.getBottomStyle(), cellBorderStyle.getBottomColor());
}
} else {
if (cellBorderStyle.getHorizontalStyle() != newCellBorderStyle.getHorizontalStyle()
|| !ComparatorUtils.equals(cellBorderStyle.getHorizontalColor(), newCellBorderStyle.getHorizontalColor())) {
style = style.deriveBorderBottom(newCellBorderStyle.getHorizontalStyle(), newCellBorderStyle.getHorizontalColor());
} else {
style = style.deriveBorderBottom(cellBorderStyle.getHorizontalStyle(), cellBorderStyle.getHorizontalColor());
}
}
return style;

Loading…
Cancel
Save