Browse Source

Merge pull request #2014 in DESIGN/design from bugfix/10.0 to release/10.0

* commit '76080b2698f4666cc4bc9ecddf93613081d75f5b':
  REPORT-36386 自适应模板出现不自适应情况
  REPORT-30352 删除不需要的import
  REPORT-30352 直接将RTextAreaBase的border的值改为0,以和8.0版本外观保持一致
  REPORT-30352 在文本域的init方法里添加setMargin()
  REPORT-33194 sql新增删除字段预览无变化
  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块,出现问题
feature/big-screen
superman 4 years ago
parent
commit
13f0ebfa0c
  1. 5
      designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java
  2. 7
      designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java
  3. 18
      designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java
  4. 4
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java
  5. 2
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextAreaBase.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. 8
      designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java
  9. 1
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java
  10. 2
      designer-form/src/main/java/com/fr/design/parameter/ParameterPropertyPane.java
  11. 46
      designer-form/src/test/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapterTest.java
  12. 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 java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
/*
@ -51,6 +52,10 @@ public class TableDataSourceAction extends TemplateComponentAction<JTemplate<?,
reportTableDataDialog.setDoOKSucceed(false);
return;
}
Iterator<String> iterator = tds.getTableDataNameIterator();
while (iterator.hasNext()) {
DesignTableDataManager.removeSelectedColumnNames(iterator.next());
}
DesignModelAdapter.getCurrentModelAdapter().renameTableData(tableDataPane.getDsNameChangedMap());
tableDataPane.update(tds);
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());

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.TableData;
import com.fr.config.Configuration;
import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction;
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.DesignerFrame;
import com.fr.design.menu.MenuKeySet;
import com.fr.file.ProcedureConfig;
import com.fr.file.TableDataConfig;
import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import com.fr.transaction.WorkerFacade;
import javax.swing.KeyStroke;
@ -95,6 +92,10 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
}
DesignTableDataManager.clearGlobalDs();
// 保存时 移除服务器数据集列名缓存
for (String name : tableDataConfig.getTableDatas().keySet()) {
DesignTableDataManager.removeSelectedColumnNames(name);
}
Configurations.modify(new WorkerFacade(TableDataConfig.class) {
@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必须转化为内置的
*/
public class PreviewTableModel extends AbstractTableModel {
private static final int LEN_LIMIT = 1000;
private static final String THREE_DOT = "...";
private DataModel dataModel;
private String erroMessage = null;
@ -127,11 +131,21 @@ public class PreviewTableModel extends AbstractTableModel {
public Object getValueAt(int row, int column) {
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) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
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.syntax.ui.rsyntaxtextarea.SyntaxConstants;
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.menu.SeparatorDef;
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") + ".");
}
}
// 保存前 刷新下参数列表 保证获取到最新的参数
refresh();
List<ParameterProvider> parameterList = editorPane.update();
Parameter[] parameters = parameterList.toArray(new Parameter[parameterList.size()]);

2
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/RTextAreaBase.java

@ -25,6 +25,7 @@ import javax.swing.JTextArea;
import javax.swing.event.CaretEvent;
import javax.swing.plaf.ColorUIResource;
import javax.swing.plaf.TextUI;
import javax.swing.plaf.basic.BasicBorders;
import javax.swing.text.AbstractDocument;
import javax.swing.text.BadLocationException;
import javax.swing.text.Caret;
@ -645,6 +646,7 @@ int currentCaretY; // Used to know when to rehighlight current line.
setTabsEmulated(false);
// Stuff needed by the caret listener below.
setBorder(new BasicBorders.MarginBorder());
previousCaretY = currentCaretY = getInsets().top;
// Stuff to highlight the current line.

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) {
int height = creator.getHeight();
int width = creator.getWidth();
//坐标小于0时让它还在容器内
if (x < 0) {
x = container.getX();
x = 0;
} else if (x + creator.getWidth() > container.getWidth()) {
x = container.getWidth() - width;
}
if (y < 0) {
y = container.getY();
y = 0;
} else if (y + creator.getHeight() > container.getHeight()) {
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);
creator.updateChildBound(minHeight);
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);
tabLayout.setBackupBound(tabLayout.getBounds());
int refSize = isHor ? tabLayout.getWidth() : tabLayout.getHeight();
double percent = (double) offset / refSize;
double percent = offset / (double) (refSize - offset);
if (percent < 0 && !tabLayout.canReduce(percent)) {
return;
}
setAdjustedSize(tabLayout, offset, isHor);
for (int m = 0; m < tabLayout.getComponentCount(); m++) {
XCreator childCreator = tabLayout.getXCreator(m);
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);
}

8
designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java

@ -19,6 +19,7 @@ import com.fr.form.ui.container.WBodyLayoutType;
import com.fr.form.ui.container.WFitLayout;
import com.fr.form.ui.container.WLayout;
import com.fr.form.ui.widget.CRBoundsWidget;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger;
import com.fr.general.FRScreen;
import com.fr.stable.ArrayUtils;
@ -1125,7 +1126,12 @@ public class XWFitLayout extends XLayoutContainer {
public Component getBottomComp(int x, int y, int h) {
int val = getAcualInterval();
return this.getComponentAt(x, y+h+default_Length+val);
Component comp = this.getComponentAt(x, y+h+default_Length+val);
if (ComparatorUtils.equals(this, comp)) {
// 如果获取组件等于自身 说明存在偏移 加上一个默认偏移量
return this.getComponentAt(x + default_Length, y+h+default_Length+val);
}
return comp;
}
public Component getRightTopComp(int x, int y, int w) {

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;
}
ParameterPropertyPane.getInstance().setAddParaPaneVisible(isAddParaPaneVisible(comp), this);
ParameterPropertyPane.getInstance().updateAddParaPaneSize();
editingComponent = comp.createToolPane(this, formDesign);
if (DesignerMode.isAuthorityEditing()) {
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());
}
private void updateAddParaPaneSize() {
public void updateAddParaPaneSize() {
if (!addParaPane.isVisible()) {
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/grid/GridUI.java

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

Loading…
Cancel
Save