Browse Source

Merge pull request #9197 in DESIGN/design from release/11.0 to bugfix/11.0

* commit 'fefcdd7939787e4d1742e4b4523437b6a993ab51':
  REPORT-72468 决策报表-frm拖入tab块,tab内拖入两个图表块和两个文本域控件,重复随机拖拽调整组件位置,会突然出现组件重叠且错乱的现象
  REPORT-73475 FR11决策报表-附件客户模板,tablayout0的Tab0下拖入tab块,会添加一个重名为tablayout0的tab块
  import
  REPORT-72237 缓存配置面板显示在在所有应用最上方的问题
  REPORT-71901 安装/禁用图表插件,图表工具栏更新异常
  REPORT-71331 在选择表头区域时预览模板,预览效果异常
  REPORT-73256 文本超出后隐藏设置会影响单元格基本属性设置
  REPORT-73256 文本超出后隐藏设置会影响单元格基本属性设置
  REPORT-71957 组件复用-创建组件,确认后提示共享组件创建失败,且日志有报错
bugfix/11.0
superman 3 years ago
parent
commit
d8cbf96931
  1. 5
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java
  2. 19
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  3. 12
      designer-base/src/main/java/com/fr/design/mainframe/JTemplateActionListener.java
  4. 10
      designer-form/src/main/java/com/fr/design/designer/beans/models/ModelUtil.java
  5. 11
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardLayout.java
  6. 13
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java
  7. 21
      designer-form/src/main/java/com/fr/design/mainframe/FormArea.java
  8. 4
      designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java
  9. 10
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java
  10. 2
      designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareMainPane.java
  11. 39
      designer-realize/src/main/java/com/fr/design/sort/common/SortColumnRowPane.java

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

@ -66,6 +66,7 @@ import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JToolBar;
import javax.swing.SwingUtilities;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import java.awt.BorderLayout;
@ -303,7 +304,7 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
//显示对应的配置
strategyConfigPane.populateBean(populateStrategyConfig);
BasicDialog dlg = strategyConfigPane.showMediumWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
BasicDialog dlg = strategyConfigPane.showMediumWindow(SwingUtilities.getWindowAncestor(DBTableDataPane.this), new DialogActionAdapter() {
@Override
public void doOk() {
super.doOk();
@ -314,7 +315,7 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
}
}
});
dlg.setAlwaysOnTop(true);
//dlg.setAlwaysOnTop(true);
dlg.setVisible(true);
}
});

19
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -1045,7 +1045,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
// 过滤掉本地文件
boolean localFile = getEditingFILE() instanceof FileFILE;
boolean inconsistent = !localFile && getEditingFILE().exists()
&& !WorkContext.getCurrent().get(LockInfoOperator.class).isConsistentLock(getEditingFILE().getPath());
&& !WorkContext.getCurrent().get(LockInfoOperator.class).isConsistentLock(getEditingFILE().getPath());
if (inconsistent) {
throw new InconsistentLockException();
}
@ -1143,6 +1143,20 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
this.listenerList.remove(JTemplateActionListener.class, l);
}
/**
* 模板保存前触发
*/
public void fireJTemplateSaveBefore() {
Object[] listeners = listenerList.getListenerList();
for (int i = listeners.length - 2; i >= 0; i -= 2) {
if (listeners[i] == JTemplateActionListener.class) {
((JTemplateActionListener) listeners[i + 1]).templateSaveBefore(this);
}
}
this.repaint(30);
}
/**
* 触发模板关闭
*/
@ -1653,6 +1667,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
}
private CallbackSaveWorker save(boolean showLoc) {
fireJTemplateSaveBefore();
FILE editingFILE = this.getEditingFILE();
// carl:editingFILE没有,当然不存了,虽然不会有这种情况
if (editingFILE == null) {
@ -1949,7 +1964,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
}
public void setDesignerUIMode(){
public void setDesignerUIMode() {
DesignerUIModeConfig.getInstance().setAbsoluteMeasureUIMode();
}

12
designer-base/src/main/java/com/fr/design/mainframe/JTemplateActionListener.java

@ -4,9 +4,15 @@ import java.util.EventListener;
public interface JTemplateActionListener extends EventListener {
public void templateOpened(JTemplate<?, ?> jt);
default void templateOpened(JTemplate<?, ?> jt) {
}
public void templateSaved(JTemplate<?, ?> jt);
default void templateSaved(JTemplate<?, ?> jt) {
}
public void templateClosed(JTemplate<?, ?> jt);
default void templateClosed(JTemplate<?, ?> jt) {
}
default void templateSaveBefore(JTemplate<?, ?> jt) {
}
}

10
designer-form/src/main/java/com/fr/design/designer/beans/models/ModelUtil.java

@ -61,6 +61,15 @@ public abstract class ModelUtil {
if (StringUtils.isEmpty(widgetName)) {
widgetName = xCreator.createDefaultName();
}
//先保存默认名字
return uniqueName(form, widgetName, duplicated);
}
public static String uniqueName(Form form, String widgetName) {
return uniqueName(form, widgetName, new HashSet<>());
}
private static String uniqueName(Form form, String widgetName, Set<String> duplicated) {
//先保存默认名字
String raw = widgetName;
int i = 0;
@ -74,5 +83,4 @@ public abstract class ModelUtil {
duplicated.add(widgetName);
return widgetName;
}
}

11
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardLayout.java

@ -7,6 +7,7 @@ import com.fr.base.background.ColorBackground;
import com.fr.design.designer.beans.LayoutAdapter;
import com.fr.design.designer.beans.adapters.layout.FRCardLayoutAdapter;
import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.beans.models.ModelUtil;
import com.fr.design.designer.beans.models.SelectionModel;
import com.fr.design.designer.creator.CRPropertyDescriptor;
import com.fr.design.designer.creator.XCreator;
@ -21,6 +22,7 @@ import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.editors.BooleanEditor;
import com.fr.design.mainframe.widget.editors.CardTagWLayoutBorderStyleEditor;
import com.fr.design.mainframe.widget.editors.DoubleEditor;
import com.fr.form.main.Form;
import com.fr.form.ui.CardAddButton;
import com.fr.form.ui.CardSwitchButton;
import com.fr.form.ui.LayoutBorderStyle;
@ -39,6 +41,7 @@ import com.fr.general.cardtag.DefaultTemplateStyle;
import com.fr.general.cardtag.TemplateStyle;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import com.fr.stable.core.PropertyChangeAdapter;
import javax.swing.border.Border;
@ -246,7 +249,13 @@ public class XWCardLayout extends XLayoutContainer {
*/
@Override
protected void setWrapperName(XLayoutContainer parentPanel, String widgetName) {
parentPanel.toData().setWidgetName("tablayout" + widgetName.replaceAll(createDefaultName(), ""));
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
Form form = formDesigner.getTarget();
String name = "tablayout" + widgetName.replaceAll(createDefaultName(), StringUtils.EMPTY);
if (form.isNameExist(name)) {
name = ModelUtil.uniqueName(formDesigner.getTarget(), parentPanel.createDefaultName());
}
parentPanel.toData().setWidgetName(name);
}
/**

13
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java

@ -53,6 +53,8 @@ import java.util.List;
* @date: 2014-12-9-下午9:59:31
*/
public class XWCardMainBorderLayout extends XWBorderLayout {
private static final String DEFAULT_NAME = "tablayout";
private static final int BORDER_WIDTH = 4;
private static final Color OUTER_BORDER_COLOR = new Color(65, 155, 249, 30);
@ -86,6 +88,17 @@ public class XWCardMainBorderLayout extends XWBorderLayout {
return (WCardMainBorderLayout) super.toData();
}
/**
* 获取默认名字
*
* @return 默认名
* @date 2014-11-25-下午6:22:40
*/
@Override
public String createDefaultName() {
return DEFAULT_NAME;
}
/**
* 添加标题区域
*

21
designer-form/src/main/java/com/fr/design/mainframe/FormArea.java

@ -759,15 +759,24 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
heightPane.setValue(height);
reCalculateHeight((int) height);
}
if (designer.getRootComponent().acceptType(XWFitLayout.class) ) {
XWFitLayout layout = (XWFitLayout) designer.getRootComponent();
// 撤销时先refreshRoot了,此处去掉内边距再增加间隔
layout.moveContainerMargin();
layout.addCompInterval(layout.getAcualInterval());
}
traverAndAdjust(designer.getRootComponent());
this.slidePane.setShowValue((int) slide);
}
// 撤销时先refreshRoot了,此处去掉内边距再增加间隔,循环遍历布局,调整fitlayout布局的间隔
private void traverAndAdjust(XCreator creator) {
if (creator instanceof XWFitLayout) {
XWFitLayout temp = (XWFitLayout) creator;
temp.moveContainerMargin();
temp.addCompInterval(temp.getAcualInterval());
}
for (int i = 0; i < creator.getComponentCount(); i++) {
Object object = creator.getComponent(i);
if (object instanceof XCreator){
traverAndAdjust((XCreator) object);
}
}
}
/**
* 计算滚动条的值和max

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

@ -199,7 +199,9 @@ public class FormParaWidgetPane extends JPanel {
JPanel componentsPara = new JPanel(new FlowLayout(FlowLayout.LEFT));
WidgetOption[] chartOptions = loadChartOptions();
for (WidgetOption chartOption : chartOptions) {
componentsPara.add(new ToolBarButton(chartOption));
ToolBarButton button = new ToolBarButton(chartOption);
button.setPreferredSize(new Dimension(widgetButtonWidth, widgetButtonHeight));
componentsPara.add(button);
}
int x = COMMON_CHAR_NUM * (widgetButtonWidth + smallGAP);
int y = (int) Math.ceil(chartOptions.length / ((double) COMMON_CHAR_NUM)) * (widgetButtonHeight + smallGAP);

10
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java

@ -79,6 +79,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
//文本超出时隐藏
private UICheckBox textOverflowCheckBox;
private int curSelectedIndex;
private UIComboBox showPartComboBox;
private CardLayout showPartLayout;
private JPanel showPartPane;
@ -325,7 +326,16 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
showPartLayout.show(showPartPane, "none");
showPartPane.setPreferredSize(new Dimension(0, 0));
}
// 记录目前自动调整哪个被选中
for (int i = 0; i < adjustRadioButtons.length; i++) {
if (adjustRadioButtons[i].isSelected()) {
curSelectedIndex = i;
break;
}
}
noAutoRadioButton.setSelected(true);
} else {
adjustRadioButtons[curSelectedIndex].setSelected(true);
}
}
});

2
designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareMainPane.java

@ -660,7 +660,7 @@ public class ShareMainPane extends JPanel {
Toolkit.i18nText("Fine-Design_Basic_Error"), ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon"));
return false;
}
if (FileCommonUtils.isFileNameValid(name)) {
if (!FileCommonUtils.isFileNameValid(name)) {
FineJOptionPane.showMessageDialog(
shareDialog,
Toolkit.i18nText("Fine-Design_Share_Generate_Failure_Illegal_Component_Name_Tip"),

39
designer-realize/src/main/java/com/fr/design/sort/common/SortColumnRowPane.java

@ -3,13 +3,14 @@ package com.fr.design.sort.common;
import com.fr.base.Style;
import com.fr.base.background.ColorBackground;
import com.fr.base.svg.IconUtils;
import com.fr.design.designer.TargetComponent;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.JTemplateActionListener;
import com.fr.design.selection.SelectionEvent;
import com.fr.design.selection.SelectionListener;
import com.fr.design.sort.header.HeaderAreaPane;
@ -18,10 +19,6 @@ import com.fr.grid.selection.Selection;
import com.fr.log.FineLoggerFactory;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.CellExpandAttr;
import com.fr.report.cell.cellattr.core.group.DSColumn;
import com.fr.report.core.sort.common.CellSortable;
import com.fr.report.core.sort.header.SortHeader;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.stable.ColumnRow;
import com.fr.stable.EssentialUtils;
@ -157,6 +154,7 @@ public class SortColumnRowPane extends JPanel implements UIObserver {
class SelectActionListener extends MouseAdapter {
SortColumnRowPane columnRowPane;
ColumnRow oldColumnRow;
JTemplateActionListener jTemplateActionListener;
Map<ColumnRow, Style> disableHeaderCellsStyleMap = new HashMap<>();
java.util.List<TemplateCellElement> tempHeaderCells = new ArrayList<>();
@ -178,13 +176,44 @@ public class SortColumnRowPane extends JPanel implements UIObserver {
@Override
public void selectionChanged(SelectionEvent e) {
completeSelectHeader(elementCasePane);
removeJTemplateActionListener();
}
};
elementCasePane.addSelectionChangeListener(gridSelectionChangeListener);
this.addJTemplateActionListener();
isAlreadyAddListener = true;
}
}
private void addJTemplateActionListener() {
JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jTemplate != null) {
removeJTemplateActionListener();
jTemplateActionListener = new JTemplateActionListener() {
@Override
public void templateSaveBefore(JTemplate<?, ?> jt) {
ElementCasePane elementCasePane = SortUtils.getCurrentElementCase();
if (elementCasePane != null) {
recoverSelectHeader(elementCasePane);
}
removeJTemplateActionListener();
}
};
jTemplate.addJTemplateActionListener(jTemplateActionListener);
}
}
private void removeJTemplateActionListener() {
JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jTemplate != null) {
if (jTemplateActionListener != null) {
jTemplate.removeJTemplateActionListener(jTemplateActionListener);
}
}
}
private void prepareSelectHeader(ElementCasePane elementCasePane) {
ashDisableHeaderCellsStyle(elementCasePane.getEditingElementCase());
oldSelection = (CellSelection) elementCasePane.getSelection();

Loading…
Cancel
Save