Browse Source

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

* commit '6e12f0da837e70174946082fa7a5638b9466060e':
  REPORT-34954 在富文本设置中,未选中数据时直接点击上下标仍然可以同时设置
  REPORT-33194 sql新增删除字段预览无变化
  REPORT-35108 && REPORT-34895
  REPORT-35259 当参数栏参数过多时是否有下拉框 调整格式
  REPORT-35259 当参数栏参数过多时是否有下拉框 删除无用提交
  REPORT-35259 当参数栏参数过多时是否有下拉框
  REPORT-34737 绝对画布中的组件可视状态下移到侧边后组件移出画布可见区域
  REPORT-33103 合并单元格时将用来覆盖网格的矩形的height减小0.5
  REPORT-34596 远程设计服务器数据集字段修改问题
  REPORT-31546 公式面板的说明切换偶尔会失效
  REPORT-34962 数据集不点击刷新也能显示参数
  REPORT-34465 预览视图页面无法关闭
  REPORT-32427 设计器操作决策报表TAB块,出现问题
  REPORT-32427 设计器操作决策报表TAB块,出现问题
persist/11.0
superman 4 years ago
parent
commit
df5124bfb3
  1. 5
      designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java
  2. 9
      designer-base/src/main/java/com/fr/design/actions/file/OpenRecentReportMenuDef.java
  3. 7
      designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java
  4. 18
      designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java
  5. 4
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java
  6. 5
      designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java
  7. 15
      designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java
  8. 1
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java
  9. 2
      designer-form/src/main/java/com/fr/design/parameter/ParameterPropertyPane.java
  10. 46
      designer-form/src/test/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapterTest.java
  11. 2
      designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java
  12. 1
      designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java
  13. 2
      designer-realize/src/main/java/com/fr/grid/GridUI.java

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

@ -15,6 +15,7 @@ import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
import java.util.Map; import java.util.Map;
/* /*
@ -51,6 +52,10 @@ public class TableDataSourceAction extends TemplateComponentAction<JTemplate<?,
reportTableDataDialog.setDoOKSucceed(false); reportTableDataDialog.setDoOKSucceed(false);
return; return;
} }
Iterator<String> iterator = tds.getTableDataNameIterator();
while (iterator.hasNext()) {
DesignTableDataManager.removeSelectedColumnNames(iterator.next());
}
DesignModelAdapter.getCurrentModelAdapter().renameTableData(tableDataPane.getDsNameChangedMap()); DesignModelAdapter.getCurrentModelAdapter().renameTableData(tableDataPane.getDsNameChangedMap());
tableDataPane.update(tds); tableDataPane.update(tds);
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()); TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());

9
designer-base/src/main/java/com/fr/design/actions/file/OpenRecentReportMenuDef.java

@ -1,6 +1,7 @@
package com.fr.design.actions.file; package com.fr.design.actions.file;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.io.File;
import java.util.List; import java.util.List;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
@ -11,6 +12,7 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.KeySetUtils;
import com.fr.design.menu.MenuDef; import com.fr.design.menu.MenuDef;
import com.fr.file.FILEFactory; import com.fr.file.FILEFactory;
import com.fr.file.FileFILE;
/** /**
* Open Resent MenuDef. * Open Resent MenuDef.
@ -68,7 +70,12 @@ public class OpenRecentReportMenuDef extends MenuDef {
* @param e 事件 * @param e 事件
*/ */
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
DesignerContext.getDesignerFrame().openTemplate(FILEFactory.createFILE(this.getPath())); File file = new File(this.getPath());
if (file.exists()) {
DesignerContext.getDesignerFrame().openTemplate(new FileFILE(file));
} else {
DesignerContext.getDesignerFrame().openTemplate(FILEFactory.createFILE(this.getPath()));
}
} }
public String getPath() { public String getPath() {

7
designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java

@ -5,7 +5,6 @@ package com.fr.design.actions.server;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.TableData; import com.fr.base.TableData;
import com.fr.config.Configuration;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
@ -18,12 +17,10 @@ import com.fr.design.gui.NameInspector;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame; import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet; import com.fr.design.menu.MenuKeySet;
import com.fr.file.ProcedureConfig;
import com.fr.file.TableDataConfig; import com.fr.file.TableDataConfig;
import com.fr.transaction.CallBackAdaptor; import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations; import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import com.fr.transaction.WorkerFacade; import com.fr.transaction.WorkerFacade;
import javax.swing.KeyStroke; import javax.swing.KeyStroke;
@ -95,6 +92,10 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
} }
DesignTableDataManager.clearGlobalDs(); DesignTableDataManager.clearGlobalDs();
// 保存时 移除服务器数据集列名缓存
for (String name : tableDataConfig.getTableDatas().keySet()) {
DesignTableDataManager.removeSelectedColumnNames(name);
}
Configurations.modify(new WorkerFacade(TableDataConfig.class) { Configurations.modify(new WorkerFacade(TableDataConfig.class) {
@Override @Override

18
designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java

@ -17,6 +17,10 @@ import javax.swing.table.AbstractTableModel;
* 这个TableModel主要是预览数据的. 字段TableData必须转化为内置的 * 这个TableModel主要是预览数据的. 字段TableData必须转化为内置的
*/ */
public class PreviewTableModel extends AbstractTableModel { public class PreviewTableModel extends AbstractTableModel {
private static final int LEN_LIMIT = 1000;
private static final String THREE_DOT = "...";
private DataModel dataModel; private DataModel dataModel;
private String erroMessage = null; private String erroMessage = null;
@ -127,11 +131,21 @@ public class PreviewTableModel extends AbstractTableModel {
public Object getValueAt(int row, int column) { public Object getValueAt(int row, int column) {
try { try {
return dataModel.getValueAt(row, column); Object value = dataModel.getValueAt(row, column);
if (value != null) {
String strValue = value.toString();
// 字符长度过长 swing会卡住一会
// 同时设计器内预览展示也不需要展示太长的字符
if (strValue.length() > LEN_LIMIT) {
strValue = strValue.substring(0, LEN_LIMIT) + THREE_DOT;
return strValue;
}
}
return value;
} catch (TableDataException e) { } catch (TableDataException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
DesignUtils.errorMessage(e.getMessage()); DesignUtils.errorMessage(e.getMessage());
return ""; return StringUtils.EMPTY;
} }
} }

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

@ -29,7 +29,6 @@ import com.fr.design.gui.itableeditorpane.UITableEditorPane;
import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants;
import com.fr.design.gui.syntax.ui.rtextarea.RTextScrollPane; import com.fr.design.gui.syntax.ui.rtextarea.RTextScrollPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.SeparatorDef;
import com.fr.design.menu.ToolBarDef; import com.fr.design.menu.ToolBarDef;
@ -316,7 +315,8 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
// com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Connect_SQL_Cannot_Null") + "."); // com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Connect_SQL_Cannot_Null") + ".");
} }
} }
// 保存前 刷新下参数列表 保证获取到最新的参数
refresh();
List<ParameterProvider> parameterList = editorPane.update(); List<ParameterProvider> parameterList = editorPane.update();
Parameter[] parameters = parameterList.toArray(new Parameter[parameterList.size()]); Parameter[] parameters = parameterList.toArray(new Parameter[parameterList.size()]);

5
designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java

@ -310,14 +310,15 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter {
public void fix(XCreator creator ,int x, int y) { public void fix(XCreator creator ,int x, int y) {
int height = creator.getHeight(); int height = creator.getHeight();
int width = creator.getWidth(); int width = creator.getWidth();
//坐标小于0时让它还在容器内
if (x < 0) { if (x < 0) {
x = container.getX(); x = 0;
} else if (x + creator.getWidth() > container.getWidth()) { } else if (x + creator.getWidth() > container.getWidth()) {
x = container.getWidth() - width; x = container.getWidth() - width;
} }
if (y < 0) { if (y < 0) {
y = container.getY(); y = 0;
} else if (y + creator.getHeight() > container.getHeight()) { } else if (y + creator.getHeight() > container.getHeight()) {
y = container.getHeight() - height; y = container.getHeight() - height;
} }

15
designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java

@ -114,6 +114,15 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
XCreator creator = (XCreator) container.getComponent(i); XCreator creator = (XCreator) container.getComponent(i);
creator.updateChildBound(minHeight); creator.updateChildBound(minHeight);
creator.setBackupBound(creator.getBounds()); creator.setBackupBound(creator.getBounds());
//tab布局用到
ArrayList<?> childrenList = creator.getTargetChildrenList();
for (int j = 0; j < childrenList.size(); j++) {
XWTabFitLayout tabLayout = (XWTabFitLayout) childrenList.get(j);
for (int m = 0; m < tabLayout.getComponentCount(); m++) {
XCreator childCreator = tabLayout.getXCreator(m);
childCreator.setBackupBound(childCreator.getBounds());
}
}
} }
} }
@ -1039,15 +1048,15 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
XWTabFitLayout tabLayout = (XWTabFitLayout) childrenList.get(j); XWTabFitLayout tabLayout = (XWTabFitLayout) childrenList.get(j);
tabLayout.setBackupBound(tabLayout.getBounds()); tabLayout.setBackupBound(tabLayout.getBounds());
int refSize = isHor ? tabLayout.getWidth() : tabLayout.getHeight(); int refSize = isHor ? tabLayout.getWidth() : tabLayout.getHeight();
double percent = (double) offset / refSize; double percent = offset / (double) (refSize - offset);
if (percent < 0 && !tabLayout.canReduce(percent)) { if (percent < 0 && !tabLayout.canReduce(percent)) {
return; return;
} }
setAdjustedSize(tabLayout, offset, isHor);
for (int m = 0; m < tabLayout.getComponentCount(); m++) { for (int m = 0; m < tabLayout.getComponentCount(); m++) {
XCreator childCreator = tabLayout.getXCreator(m); XCreator childCreator = tabLayout.getXCreator(m);
WAbsoluteLayout.BoundsWidget wgt = (WAbsoluteLayout.BoundsWidget) tabLayout.toData().getBoundsWidget(childCreator.toData()); WAbsoluteLayout.BoundsWidget wgt = (WAbsoluteLayout.BoundsWidget) tabLayout.toData().getBoundsWidget(childCreator.toData());
wgt.setBounds(tabLayout.getComponent(m).getBounds()); wgt.setBounds(childCreator.getBackupBound());
wgt.setBackupBounds(childCreator.getBackupBound());
} }
adjustCreatorsSize(percent, tabLayout, isHor); adjustCreatorsSize(percent, tabLayout, isHor);
} }

1
designer-form/src/main/java/com/fr/design/mainframe/JForm.java

@ -371,6 +371,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
return; return;
} }
ParameterPropertyPane.getInstance().setAddParaPaneVisible(isAddParaPaneVisible(comp), this); ParameterPropertyPane.getInstance().setAddParaPaneVisible(isAddParaPaneVisible(comp), this);
ParameterPropertyPane.getInstance().updateAddParaPaneSize();
editingComponent = comp.createToolPane(this, formDesign); editingComponent = comp.createToolPane(this, formDesign);
if (DesignerMode.isAuthorityEditing()) { if (DesignerMode.isAuthorityEditing()) {
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane( EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(

2
designer-form/src/main/java/com/fr/design/parameter/ParameterPropertyPane.java

@ -103,7 +103,7 @@ public class ParameterPropertyPane extends JPanel{
refreshState(DesignerContext.getDesignerFrame().getSelectedJTemplate()); refreshState(DesignerContext.getDesignerFrame().getSelectedJTemplate());
} }
private void updateAddParaPaneSize() { public void updateAddParaPaneSize() {
if (!addParaPane.isVisible()) { if (!addParaPane.isVisible()) {
return; return;
} }

46
designer-form/src/test/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapterTest.java

@ -0,0 +1,46 @@
package com.fr.design.designer.beans.adapters.layout;
import com.fr.config.dao.DaoContext;
import com.fr.config.dao.impl.LocalClassHelperDao;
import com.fr.config.dao.impl.LocalEntityDao;
import com.fr.config.dao.impl.LocalXmlEntityDao;
import com.fr.design.designer.creator.XButton;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XWAbsoluteLayout;
import com.fr.form.ui.Button;
import com.fr.form.ui.container.WAbsoluteLayout;
import java.awt.Dimension;
import junit.framework.TestCase;
import org.junit.Assert;
public class FRAbsoluteLayoutAdapterTest extends TestCase {
@Override
protected void setUp() throws Exception {
DaoContext.setEntityDao(new LocalEntityDao());
DaoContext.setClassHelperDao(new LocalClassHelperDao());
DaoContext.setXmlEntityDao(new LocalXmlEntityDao());
}
public void testFix(){
WAbsoluteLayout layout =new WAbsoluteLayout();
XWAbsoluteLayout container =new XWAbsoluteLayout(layout);
container.setBounds(0,320,400,160);
FRAbsoluteLayoutAdapter frAbsoluteLayoutAdapter = new FRAbsoluteLayoutAdapter(container);
XCreator button = new XButton(new Button(),new Dimension(88,40));
frAbsoluteLayoutAdapter.fix(button,-1,-1);
Assert.assertEquals(0,button.getX());
Assert.assertEquals(0,button.getY());
frAbsoluteLayoutAdapter.fix(button,350,200);
Assert.assertEquals(312,button.getX());
Assert.assertEquals(120,button.getY());
}
@Override
protected void tearDown() throws Exception {
DaoContext.setEntityDao(null);
DaoContext.setClassHelperDao(null);
DaoContext.setXmlEntityDao(null);
}
}

2
designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java

@ -258,6 +258,7 @@ public class RichTextToolBar extends BasicPane{
boolean isSub = RichTextToolBar.this.subPane.isSelected(); boolean isSub = RichTextToolBar.this.subPane.isSelected();
MutableAttributeSet attr = new SimpleAttributeSet(); MutableAttributeSet attr = new SimpleAttributeSet();
if (!isSub && RichTextToolBar.this.superPane.isSelected()) { if (!isSub && RichTextToolBar.this.superPane.isSelected()) {
RichTextToolBar.this.superPane.setSelected(false);
StyleConstants.setSuperscript(attr, false); StyleConstants.setSuperscript(attr, false);
} }
// 调用setCharacterAttributes函数设置文本区选择文本的字体 // 调用setCharacterAttributes函数设置文本区选择文本的字体
@ -273,6 +274,7 @@ public class RichTextToolBar extends BasicPane{
// 调用setCharacterAttributes函数设置文本区选择文本的字体 // 调用setCharacterAttributes函数设置文本区选择文本的字体
MutableAttributeSet attr = new SimpleAttributeSet(); MutableAttributeSet attr = new SimpleAttributeSet();
if (!isSuper && RichTextToolBar.this.subPane.isSelected()) { if (!isSuper && RichTextToolBar.this.subPane.isSelected()) {
RichTextToolBar.this.subPane.setSelected(false);
StyleConstants.setSubscript(attr, false); StyleConstants.setSubscript(attr, false);
} }
StyleConstants.setSuperscript(attr, !isSuper); StyleConstants.setSuperscript(attr, !isSuper);

1
designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

@ -238,6 +238,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
dlg.setModal(false); dlg.setModal(false);
dlg.setVisible(true); dlg.setVisible(true);
dlg.setAlwaysOnTop(true);
} }
private void showDialogAfterAddCellAction() { private void showDialogAfterAddCellAction() {

2
designer-realize/src/main/java/com/fr/grid/GridUI.java

@ -481,7 +481,7 @@ public class GridUI extends ComponentUI {
// peter:tmpRectangle2D_3只是一个临时的Rectangle2D,由于后面不少地方需要用到这个矩形 // peter:tmpRectangle2D_3只是一个临时的Rectangle2D,由于后面不少地方需要用到这个矩形
this.cell_back_rect.setRect(0, 0, this.tmpRectangle.getWidth() - 1, this.cell_back_rect.setRect(0, 0, this.tmpRectangle.getWidth() - 1,
this.tmpRectangle.getHeight() - 1); this.tmpRectangle.getHeight() - 1.5);
// peter:对于合并的单元格,需要先白色的背景来清除背景. // peter:对于合并的单元格,需要先白色的背景来清除背景.
if (tmpCellElement.getColumnSpan() > 1 || tmpCellElement.getRowSpan() > 1) { if (tmpCellElement.getColumnSpan() > 1 || tmpCellElement.getRowSpan() > 1) {
// REPORT-23492 要看下是否设置了纸张背景 如果设置了按照背景来画 // REPORT-23492 要看下是否设置了纸张背景 如果设置了按照背景来画

Loading…
Cancel
Save