Browse Source

Merge pull request #802 in BA/design from ~NEIL/design:master to dev

* commit 'd8daeae4047e1639dbf6e6cfbefec3dc6cc16123': (34 commits)
  ct
  ct
  修复不能自定义参数面板控件标签的bug
  调整布局
  还原代码
  调整布局
  还原代码
  REPORT-2171 表单里嵌套tab后, 滚动条丢失了, 所有自适应都这样
  REPORT-2242 填报提交设置的若干问题修改
  调整布局
  调整布局
  更改为aspectJ构建
  还原修改
  使用aspectJ构建
  对import BoundsWidget进行修改以兼容老版本自适应插件和表单导出
  REPORT-1858  frm组件隐藏
  REPORT-2052 压缩部署加载插件逻辑重构 design 设计器安装的时候实时改变pluginconfig
  无jira任务,屏蔽组件隐藏新功能
  无JIRA任务, release设计器支持1.7jdk
  REPORT-2052 漏传
  ...
master
superman 8 years ago
parent
commit
75a3186262
  1. 6
      designer/src/com/fr/design/mainframe/CellElementPropertyPane.java
  2. 12
      designer/src/com/fr/design/webattr/EditToolBar.java
  3. 20
      designer_base/build.master.gradle
  4. 89
      designer_base/build.master.gradle.bak
  5. 23
      designer_base/build.release.gradle
  6. 3
      designer_base/src/com/fr/design/extra/PluginHelper.java
  7. 2
      designer_base/src/com/fr/env/RemoteEnv.java
  8. 20
      designer_chart/build.master.gradle
  9. 85
      designer_chart/build.master.gradle.bak
  10. 20
      designer_chart/build.release.gradle
  11. 2
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java
  12. 2
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java
  13. 17
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java
  14. 15
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java
  15. 17
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/PiePlotReportDataContentPane.java
  16. 21
      designer_form/build.master.gradle
  17. 22
      designer_form/build.master.gradle.bak
  18. 21
      designer_form/build.release.gradle
  19. 2
      designer_form/src/com/fr/design/designer/beans/ConnectorCreator.java
  20. 2
      designer_form/src/com/fr/design/designer/beans/location/Inner.java
  21. 23
      designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java
  22. 23
      designer_form/src/com/fr/design/designer/creator/XWFitLayout.java
  23. 2
      designer_form/src/com/fr/design/designer/creator/XWScaleLayout.java
  24. 2
      designer_form/src/com/fr/design/designer/creator/XWTitleLayout.java
  25. 6
      designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java
  26. 4
      designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java
  27. 2
      designer_form/src/com/fr/design/mainframe/ConnectorHelper.java
  28. 3
      designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java

6
designer/src/com/fr/design/mainframe/CellElementPropertyPane.java

@ -108,8 +108,10 @@ public class CellElementPropertyPane extends DockingView {
}
public void reInit(ElementCasePane ePane) {
this.add(titlePane, BorderLayout.NORTH);
this.add(cellElementEditPane, BorderLayout.CENTER);
if (titlePane.getParent() == null) { // 如果处于隐藏状态,则让其显示
this.add(titlePane, BorderLayout.NORTH);
this.add(cellElementEditPane, BorderLayout.CENTER);
}
cellElementEditPane.populate(ePane);
}

12
designer/src/com/fr/design/webattr/EditToolBar.java

@ -329,15 +329,16 @@ public class EditToolBar extends BasicPane {
private JavaScriptActionPane javaScriptPane;
private ExportToolBarProvider[] exportToolBarProviders;
private ChangeListener changeListener = new ChangeListener() {
public void stateChanged(ChangeEvent e) {
private ActionListener actionListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (isVerify.isSelected()) {
failSubmit.setVisible(true);
} else {
failSubmit.setVisible(false);
failSubmit.setSelected(false);
}
}
};
public ButtonPane() {
@ -481,7 +482,7 @@ public class EditToolBar extends BasicPane {
submitPane.add(isVerify);
submitPane.add(failSubmit);
submitPane.add(isCurSheet);
isVerify.addChangeListener(changeListener);
isVerify.addActionListener(actionListener);
return submitPane;
}
@ -573,6 +574,9 @@ public class EditToolBar extends BasicPane {
card.show(centerPane, "submit");
Submit submit = ((Submit) widget);
this.isVerify.setSelected(submit.isVerify());
if (!submit.isVerify()) {
this.failSubmit.setVisible(false);
}
this.failSubmit.setSelected(submit.isFailVerifySubmit());
this.isCurSheet.setSelected(submit.isOnlySubmitSelect());
}

20
designer_base/build.master.gradle

@ -1,8 +1,26 @@
apply plugin: 'java'
tasks.withType(JavaCompile){
options.encoding = 'UTF-8'
}
buildscript {
repositories {
maven {
url "http://www.eveoh.nl/files/maven2"
}
}
dependencies {
classpath "nl.eveoh:gradle-aspectj:1.2"
}
}
ext.aspectjVersion = '1.7.4'
apply plugin: 'aspectj'
repositories {
mavenCentral()
}
//jdk版本
sourceCompatibility=1.7
//jar包版本

89
designer_base/build.master.gradle.bak

@ -0,0 +1,89 @@
apply plugin: 'java'
tasks.withType(JavaCompile){
options.encoding = 'UTF-8'
}
buildscript {
repositories {
maven {
url "http://www.eveoh.nl/files/maven2"
}
}
dependencies {
classpath "nl.eveoh:gradle-aspectj:1.2"
}
}
ext.aspectjVersion = '1.7.4'
apply plugin: 'aspectj'
repositories {
mavenCentral()
}
//jdk版本
sourceCompatibility=1.7
//jar包版本
version='8.0'
//jar包重命名
jar{
baseName='fr-designer-core'
}
def srcDir="."
//
sourceSets{
main{
java{
srcDirs=["${srcDir}/src"]
}
}
}
//
FileTree files =fileTree(dir:'./',include:'build.*.gradle')
def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ('\\'))
buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\'))
def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1)
//
dependencies{
compile fileTree(dir:"../../../finereport-lib-stable/${branchName}",include:'**/*.jar')
compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar")
testCompile 'junit:junit:4.12'
}
//.java文件到classes文件夹下参与打包
task copyFile(type:Copy,dependsOn:compileJava){
copy{
from ("${srcDir}/src"){
exclude '**/.setting/**','.classpath','.project','**/*.java','**/*.db','**/*.g','**/package.html'
}
into 'build/classes/main'
}
}
//js文件
task compressJS{
ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){
classpath {
fileset(dir:'../../../finereport-lib4build-stable',includes:'**/*.jar')
}
}
ant.yuicompress(linebreak:"500",warn:"false", munge:"yes",preserveallsemicolons:"false",charset:"utf-8",encoding:"utf-8",outputfolder:'build/classes/main'){
fileset (dir:"${srcDir}/src"){
include (name:'**/*.js')
include (name:'**/*.css')
}
}
}
jar.dependsOn compressJS

23
designer_base/build.release.gradle

@ -1,8 +1,29 @@
apply plugin: 'java'
tasks.withType(JavaCompile){
options.encoding = 'UTF-8'
}
buildscript {
repositories {
maven {
url "http://www.eveoh.nl/files/maven2"
}
}
dependencies {
classpath "nl.eveoh:gradle-aspectj:1.2"
}
}
ext.aspectjVersion = '1.7.4'
apply plugin: 'aspectj'
repositories {
mavenCentral()
}
//jdk版本
sourceCompatibility=1.8
//jar包版本

3
designer_base/src/com/fr/design/extra/PluginHelper.java

@ -7,6 +7,7 @@ import com.fr.design.extra.plugindependence.DownLoadDependenceUI;
import com.fr.general.*;
import com.fr.general.http.HttpClient;
import com.fr.plugin.Plugin;
import com.fr.plugin.PluginConfigManager;
import com.fr.stable.plugin.PluginConstants;
import com.fr.plugin.PluginLoader;
import com.fr.plugin.PluginManagerHelper;
@ -225,6 +226,8 @@ public class PluginHelper {
}
// 删除放解压文件的临时文件夹
StableUtils.deleteFile(new File(TEMP_PATH));
PluginConfigManager.getProviderInstance().pushNewPlugin(plugin);
PluginConfigManager.getProviderInstance().syncPluginConfig();
new SwingWorker<String, Void>() {
@Override

2
designer_base/src/com/fr/env/RemoteEnv.java vendored

@ -55,7 +55,7 @@ import java.util.Timer;
import java.util.logging.Level;
import java.util.regex.Pattern;
public class RemoteEnv implements Env {
public class RemoteEnv extends AbstractEnv {
private static final int TIME_OUT = 30 * 1000;
private static final int PLAIN_SOCKET_PORT = 80;
private static final int SSL_PORT = 443;

20
designer_chart/build.master.gradle

@ -1,8 +1,26 @@
apply plugin: 'java'
tasks.withType(JavaCompile){
options.encoding = 'UTF-8'
}
buildscript {
repositories {
maven {
url "http://www.eveoh.nl/files/maven2"
}
}
dependencies {
classpath "nl.eveoh:gradle-aspectj:1.2"
}
}
ext.aspectjVersion = '1.7.4'
apply plugin: 'aspectj'
repositories {
mavenCentral()
}
//jdk版本
sourceCompatibility=1.7
//jar包的版本

85
designer_chart/build.master.gradle.bak

@ -0,0 +1,85 @@
apply plugin: 'java'
tasks.withType(JavaCompile){
options.encoding = 'UTF-8'
}
buildscript {
repositories {
maven {
url "http://www.eveoh.nl/files/maven2"
}
}
dependencies {
classpath "nl.eveoh:gradle-aspectj:1.2"
}
}
ext.aspectjVersion = '1.7.4'
apply plugin: 'aspectj'
repositories {
mavenCentral()
}
//jdk版本
sourceCompatibility=1.7
//jar包的版本
version='8.0'
def srcDir="."
//jar包进行重命名
jar{
baseName='fr-designer-chart'
}
sourceSets{
main{
java{
srcDirs=["${srcDir}/src"]
}
}
}
FileTree files =fileTree(dir:'./',include:'build.*.gradle')
def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ('\\'))
buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\'))
def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1)
//
dependencies{
compile fileTree(dir:"../../../finereport-lib-stable/${branchName}",include:'**/*.jar')
compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar")
testCompile 'junit:junit:4.12'
}
//.java classes文件夹下参与打包
task copyFile(type:Copy,dependsOn:compileJava){
copy{
from ("${srcDir}/src"){
exclude '**/.setting/**','.classpath','.project','**/*.java','**/*.db','**/*.g','**/package.html'
}
into 'build/classes/main'
}
}
//js文件
task compressJS{
ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){
classpath {
fileset(dir:'../../../finereport-lib4build-stable',includes:'**/*.jar')
}
}
ant.yuicompress(linebreak:"500",warn:"false", munge:"yes",preserveallsemicolons:"false",charset:"utf-8",encoding:"utf-8",outputfolder:'build/classes/main'){
fileset (dir:"${srcDir}/src"){
include (name:'**/*.js')
include (name:'**/*.css')
}
}
}
jar.dependsOn compressJS

20
designer_chart/build.release.gradle

@ -1,8 +1,26 @@
apply plugin: 'java'
tasks.withType(JavaCompile){
options.encoding = 'UTF-8'
}
buildscript {
repositories {
maven {
url "http://www.eveoh.nl/files/maven2"
}
}
dependencies {
classpath "nl.eveoh:gradle-aspectj:1.2"
}
}
ext.aspectjVersion = '1.7.4'
apply plugin: 'aspectj'
repositories {
mavenCentral()
}
//jdk版本
sourceCompatibility=1.8
//jar包的版本

2
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java

@ -45,7 +45,7 @@ public class ChartHyperPoplinkPane extends BasicBeanPane<ChartHyperPoplink> {
ChartCollection cc = createChartCollection();
chartComponent = new ChartComponent();
chartComponent.setPreferredSize(new Dimension(220, 170));// 在单元格弹出时 需要调整保证属性表的大小.
chartComponent.setPreferredSize(new Dimension(200, 170));// 在单元格弹出时 需要调整保证属性表的大小.
chartComponent.setSupportEdit(false);
chartComponent.populate(cc);

2
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java

@ -79,7 +79,7 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
eastPane.setLayout(new BorderLayout());
eastPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 15));
eastPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 5));
JPanel button = new JPanel();
button.setPreferredSize(new Dimension(45, 20));
button.setLayout(new GridLayout(1, 2, 5, 0));

17
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java

@ -3,6 +3,8 @@ package com.fr.design.mainframe.chart.gui.data.report;
import com.fr.base.Formula;
import com.fr.base.Utils;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartdata.NormalReportDataDefinition;
import com.fr.chart.chartdata.SeriesDefinition;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.UIConstants;
import com.fr.design.event.UIObserverListener;
@ -16,6 +18,7 @@ import com.fr.stable.StableUtils;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import java.awt.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -95,6 +98,20 @@ public abstract class AbstractReportDataContentPane extends BasicBeanPane<ChartC
return seriesPane.updateBean();
}
protected List getEntryList(NormalReportDataDefinition seriesList) {
List list = new ArrayList();
for (int i = 0; i < seriesList.size(); i++) {
SeriesDefinition seriesEntry = (SeriesDefinition) seriesList.get(i);
Object[] nameAndValue = new Object[2];
nameAndValue[0] = seriesEntry.getSeriesName();
nameAndValue[1] = seriesEntry.getValue();
if (nameAndValue[0] != null || nameAndValue[1] != null) {
list.add(nameAndValue);
}
}
return list;
}
/**
* 界面标题:
*/

15
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java

@ -18,7 +18,6 @@ import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
public class CategoryPlotReportDataContentPane extends AbstractReportDataContentPane {
@ -113,20 +112,6 @@ public class CategoryPlotReportDataContentPane extends AbstractReportDataContent
filterPane.populateBean(collection);
}
private List getEntryList(NormalReportDataDefinition seriesList) {
List list = new ArrayList();
for (int i = 0; i < seriesList.size(); i++) {
SeriesDefinition seriesEntry = (SeriesDefinition) seriesList.get(i);
Object[] nameAndValue = new Object[2];
nameAndValue[0] = seriesEntry.getSeriesName();
nameAndValue[1] = seriesEntry.getValue();
if (nameAndValue[0] != null && nameAndValue[1] != null) {
list.add(nameAndValue);
}
}
return list;
}
public void updateBean(ChartCollection collection) {
collection.getSelectedChart().setFilterDefinition(new NormalReportDataDefinition());

17
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/PiePlotReportDataContentPane.java

@ -10,7 +10,6 @@ import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.general.Inter;
import java.util.ArrayList;
import java.util.List;
/**
@ -25,7 +24,7 @@ public class PiePlotReportDataContentPane extends AbstractReportDataContentPane
public PiePlotReportDataContentPane(ChartDataPane parent) {
initEveryPane();
this.add(new BoldFontTextLabel(Inter.getLocText("Data_Filter")), "0,4,2,4");
this.add(new BoldFontTextLabel(Inter.getLocText("FR-Chart-Data_Filter")), "0,4,2,4");
this.add(filterPane = new ChartDataFilterPane(new PiePlot(), parent), "0,6,2,4");
}
@ -51,20 +50,6 @@ public class PiePlotReportDataContentPane extends AbstractReportDataContentPane
filterPane.populateBean(collection);
}
private List getEntryList(NormalReportDataDefinition seriesList) {
List list = new ArrayList();
for(int i = 0; i < seriesList.size(); i++) {
SeriesDefinition seriesEntry = (SeriesDefinition)seriesList.get(i);
Object[] nameAndValue = new Object[2];
nameAndValue[0] = seriesEntry.getSeriesName();
nameAndValue[1] = seriesEntry.getValue();
if(nameAndValue[0] != null && nameAndValue[1] != null) {
list.add(nameAndValue);
}
}
return list;
}
public void updateBean(ChartCollection collection) {
collection.getSelectedChart().setFilterDefinition(new NormalReportDataDefinition());

21
designer_form/build.master.gradle

@ -1,8 +1,27 @@
apply plugin: 'java'
tasks.withType(JavaCompile){
options.encoding = 'UTF-8'
}
buildscript {
repositories {
maven {
url "http://www.eveoh.nl/files/maven2"
}
}
dependencies {
classpath "nl.eveoh:gradle-aspectj:1.2"
}
}
ext.aspectjVersion = '1.7.4'
apply plugin: 'aspectj'
repositories {
mavenCentral()
}
//jdk版本
sourceCompatibility=1.7
//jar包版本

22
designer_form/build.master.gradle.bak

@ -3,6 +3,26 @@ apply plugin: 'java'
tasks.withType(JavaCompile){
options.encoding = 'UTF-8'
}
buildscript {
repositories {
maven {
url "http://www.eveoh.nl/files/maven2"
}
}
dependencies {
classpath "nl.eveoh:gradle-aspectj:1.2"
}
}
ext.aspectjVersion = '1.7.4'
apply plugin: 'aspectj'
repositories {
mavenCentral()
}
//jdk版本
sourceCompatibility=1.7
//jar包版本
@ -47,7 +67,7 @@ def dataContent ={def dir ->
}
}
}
FileTree f1=fileTree(dir:'../../../'include:"finereport-*-stable/${branchName}/build/libs/*.jar")
FileTree f1=fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/build/libs/*.jar")
f1.each{File file->
println "----------${file.path}"
}

21
designer_form/build.release.gradle

@ -1,10 +1,27 @@
apply plugin: 'java'
tasks.withType(JavaCompile){
options.encoding = 'UTF-8'
}
buildscript {
repositories {
maven {
url "http://www.eveoh.nl/files/maven2"
}
}
dependencies {
classpath "nl.eveoh:gradle-aspectj:1.2"
}
}
ext.aspectjVersion = '1.7.4'
apply plugin: 'aspectj'
repositories {
mavenCentral()
}
//jdk版本
sourceCompatibility=1.8
sourceCompatibility=1.7
//jar包版本
version='8.0'

2
designer_form/src/com/fr/design/designer/beans/ConnectorCreator.java

@ -6,7 +6,7 @@ import java.util.ArrayList;
import java.util.PriorityQueue;
import com.fr.form.ui.container.WLayout;
import com.fr.form.ui.widget.BoundsWidget;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
public class ConnectorCreator {

2
designer_form/src/com/fr/design/designer/beans/location/Inner.java

@ -9,8 +9,8 @@ import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormSelection;
import com.fr.design.utils.ComponentUtils;
import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.form.ui.widget.BoundsWidget;
import com.fr.stable.ArrayUtils;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import java.awt.*;
import java.awt.Rectangle;

23
designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java

@ -8,6 +8,7 @@ import java.awt.event.ContainerEvent;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.beans.IntrospectionException;
import java.util.ArrayList;
import java.util.HashMap;
import com.fr.design.designer.beans.AdapterBus;
@ -16,6 +17,7 @@ import com.fr.design.designer.beans.LayoutAdapter;
import com.fr.design.designer.beans.adapters.layout.FRAbsoluteLayoutAdapter;
import com.fr.design.designer.beans.location.Direction;
import com.fr.design.designer.beans.models.SelectionModel;
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout;
import com.fr.design.form.layout.FRAbsoluteLayout;
import com.fr.design.icon.IconPathConstants;
import com.fr.design.mainframe.*;
@ -23,7 +25,7 @@ import com.fr.form.ui.Connector;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.form.ui.container.WLayout;
import com.fr.form.ui.widget.BoundsWidget;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import com.fr.general.FRScreen;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
@ -154,8 +156,15 @@ public class XWAbsoluteLayout extends XLayoutContainer {
if (xCreator.acceptType(XWAbsoluteLayout.class)){
((XWAbsoluteLayout) xCreator).updateBoundsWidget();
}
BoundsWidget boundsWidget = layout.getBoundsWidget(xCreator.toData());
Rectangle rectangle = dealWidgetBound(xCreator.getBounds());
// 如果子组件时tab布局,则tab布局内部的组件的wiget也要更新,否则保存后重新打开大小不对
ArrayList<?> childrenList = xCreator.getTargetChildrenList();
if(!childrenList.isEmpty()){
for(int i=0; i<childrenList.size(); i++){
XWTabFitLayout tabLayout = (XWTabFitLayout) childrenList.get(i);
tabLayout.updateBoundsWidget();
}
}
BoundsWidget boundsWidget = (BoundsWidget) layout.getBoundsWidget(xCreator.toData()); Rectangle rectangle = dealWidgetBound(xCreator.getBounds());
}
private Rectangle calculateBound(Rectangle rec, double pw, double ph){
@ -179,7 +188,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
double percentH = ((double) backupBound.height / (double) currentBound.height);
for (int index = 0, n = this.getComponentCount(); index < n; index++){
XCreator creator = (XCreator) this.getComponent(index);
BoundsWidget wgt = layout.getBoundsWidget(creator.toData());
BoundsWidget wgt = (BoundsWidget) layout.getBoundsWidget(creator.toData());
// 用当前的显示大小计算后调正具体位置
Rectangle wgtBound = creator.getBounds();
Rectangle rec = calculateBound(wgtBound, percentW, percentH);
@ -211,7 +220,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
rec.y = (int)(rec.y / prevContainerPercent * containerPercent);
rec.height = (int)(rec.height / prevContainerPercent * containerPercent);
rec.width = (int)(rec.width / prevContainerPercent * containerPercent);
BoundsWidget wgt = toData().getBoundsWidget(creator.toData());
BoundsWidget wgt = (BoundsWidget) toData().getBoundsWidget(creator.toData());
wgt.setBounds(rec);
creator.setBounds(rec);
creator.updateChildBound(minHeight);
@ -467,7 +476,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
XCreator xCreator = (XCreator) getComponent(i);
Rectangle rectangle = xCreator.getBounds();
xCreator.setBounds((int) (rectangle.x * percent), rectangle.y, (int) (rectangle.width * percent), rectangle.height);
BoundsWidget widget = toData().getBoundsWidget(xCreator.toData());
BoundsWidget widget = (BoundsWidget) toData().getBoundsWidget(xCreator.toData());
widget.setBounds(xCreator.getBounds());
}
}
@ -483,7 +492,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
XCreator xCreator = (XCreator) getComponent(i);
Rectangle rectangle = xCreator.getBounds();
xCreator.setBounds(rectangle.x, (int) (rectangle.y * percent), rectangle.width, (int) (rectangle.height * percent));
BoundsWidget widget = toData().getBoundsWidget(xCreator.toData());
BoundsWidget widget = (BoundsWidget) toData().getBoundsWidget(xCreator.toData());
widget.setBounds(xCreator.getBounds());
}
}

23
designer_form/src/com/fr/design/designer/creator/XWFitLayout.java

@ -23,8 +23,8 @@ import com.fr.form.ui.Widget;
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.BoundsWidget;
import com.fr.general.FRScreen;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
@ -351,7 +351,7 @@ public class XWFitLayout extends XLayoutContainer {
}
for (int i=0, size=comps.size(); i<size; i++) {
XCreator creator = (XCreator) comps.get(i);
BoundsWidget widget = toData().getBoundsWidget(creator.toData());
BoundsWidget widget = (BoundsWidget) toData().getBoundsWidget(creator.toData());
Rectangle rec = widget.getBounds();
Rectangle backRec = widget.getBackupBounds();
if (backRec.x<x) {
@ -415,7 +415,7 @@ public class XWFitLayout extends XLayoutContainer {
protected void modifyEdgemostCreator(boolean isHor) {
for (int i=0, size=this.getComponentCount(); i<size; i++) {
XCreator creator = (XCreator) this.getComponent(i);
BoundsWidget widget = toData().getBoundsWidget(creator.toData());
BoundsWidget widget = (BoundsWidget) toData().getBoundsWidget(creator.toData());
Rectangle rec = widget.getBackupBounds();
if (isHor && notHasRightCreator(rec)) {
creator.setSize(creator.getWidth()+needAddWidth, creator.getHeight());
@ -480,7 +480,7 @@ public class XWFitLayout extends XLayoutContainer {
}
for (int i=0, size=comps.size(); i<size; i++) {
XCreator creator = (XCreator) comps.get(i);
BoundsWidget widget = toData().getBoundsWidget(creator.toData());
BoundsWidget widget = (BoundsWidget) toData().getBoundsWidget(creator.toData());
Rectangle rec = widget.getBounds();
Rectangle backRec = widget.getBackupBounds();
if (backRec.y < y) {
@ -519,7 +519,7 @@ public class XWFitLayout extends XLayoutContainer {
for (int i=0; i<size; i++) {
Component comp = this.getComponent(i);
XCreator creator = (XCreator) comp;
BoundsWidget widget = toData().getBoundsWidget(creator.toData());
BoundsWidget widget = (BoundsWidget) toData().getBoundsWidget(creator.toData());
Rectangle rec = widget.getBackupBounds();
//rec.x小于x,右侧大于x
boolean isLowX = rec.x<x && x<rec.x+rec.width;
@ -535,7 +535,7 @@ public class XWFitLayout extends XLayoutContainer {
for (int i=0,size=this.getComponentCount(); i<size; i++) {
Component comp = this.getComponent(i);
XCreator creator = (XCreator) comp;
BoundsWidget widget = toData().getBoundsWidget(creator.toData());
BoundsWidget widget = (BoundsWidget) toData().getBoundsWidget(creator.toData());
Rectangle rec = widget.getBackupBounds();
boolean isLowY = rec.y<y && y<rec.y+rec.height;
if (isLowY || rec.y==y) {
@ -574,7 +574,7 @@ public class XWFitLayout extends XLayoutContainer {
public XCreator getCreatorAt(int x, int y) {
for (int i=0,size=this.getComponentCount(); i<size; i++) {
XCreator creator = (XCreator) this.getComponent(i);
BoundsWidget widget = toData().getBoundsWidget(creator.toData());
BoundsWidget widget = (BoundsWidget) toData().getBoundsWidget(creator.toData());
Rectangle rec = widget.getBackupBounds();
boolean isCurrent = rec.x<=x && x<rec.x+rec.width && rec.y<=y && y<rec.y+rec.height;
if (isCurrent) {
@ -591,7 +591,7 @@ public class XWFitLayout extends XLayoutContainer {
for (int i=0, size=this.getComponentCount(); i<size; i++) {
Component comp = this.getComponent(i);
XCreator creator = (XCreator) comp;
BoundsWidget widget = toData().getBoundsWidget(creator.toData());
BoundsWidget widget = (BoundsWidget) toData().getBoundsWidget(creator.toData());
widget.setBackupBounds(widget.getBounds());
}
}
@ -736,7 +736,7 @@ public class XWFitLayout extends XLayoutContainer {
int containerHeight = 0;
for (int index=0, n=this.getComponentCount(); index<n; index++) {
XCreator creator = (XCreator) this.getComponent(index);
BoundsWidget wgt = layout.getBoundsWidget(creator.toData());
BoundsWidget wgt = (BoundsWidget) layout.getBoundsWidget(creator.toData());
// 用当前的显示大小计算后调正具体位置
Rectangle wgtBound = dealWidgetBound(creator.getBounds());
Rectangle rec = recalculateWidgetBounds(wgtBound, hors, veris);
@ -759,6 +759,7 @@ public class XWFitLayout extends XLayoutContainer {
//如果子组件是绝对布局,则内部的widget也要更新
if (creator.acceptType(XWAbsoluteLayout.class)){
((XWAbsoluteLayout) creator).updateBoundsWidget();
creator.setBackupBound(creator.getBounds());
}
}
layout.setContainerHeight(containerHeight);
@ -814,7 +815,7 @@ public class XWFitLayout extends XLayoutContainer {
WFitLayout wlayout = this.toData();
XWidgetCreator xwc = ((XWidgetCreator) e.getChild());
Widget wgt = xwc.toData();
BoundsWidget bw = wlayout.getBoundsWidget(wgt);
BoundsWidget bw = (BoundsWidget) wlayout.getBoundsWidget(wgt);
wlayout.removeWidget(bw);
updateBoundsWidget();
((FRFitLayoutAdapter)getLayoutAdapter()).updateCreatorBackBound();
@ -992,7 +993,7 @@ public class XWFitLayout extends XLayoutContainer {
int val = toData().getCompInterval()/2;
for (int i=0, len=this.getComponentCount(); i<len; i++) {
XCreator creator = (XCreator) this.getComponent(i);
BoundsWidget widget = toData().getBoundsWidget(creator.toData());
BoundsWidget widget = (BoundsWidget) toData().getBoundsWidget(creator.toData());
Rectangle rec = widget.getBounds();
Dimension d = new Dimension(this.getBackupBound().width, this.getBackupBound().height);
Rectangle bound = dealBound(rec, d, val, percent);

2
designer_form/src/com/fr/design/designer/creator/XWScaleLayout.java

@ -12,7 +12,7 @@ import com.fr.design.designer.beans.adapters.layout.FRScaleLayoutAdapter;
import com.fr.design.form.layout.FRScaleLayout;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WScaleLayout;
import com.fr.form.ui.widget.BoundsWidget;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
/**
* 自适应布局中添加组件时部分控件如数字文本下拉等需要保持控件默认高度21 用此容器来实现

2
designer_form/src/com/fr/design/designer/creator/XWTitleLayout.java

@ -11,8 +11,8 @@ import com.fr.form.ui.Label;
import com.fr.form.ui.Widget;
import com.fr.form.ui.WidgetTitle;
import com.fr.form.ui.container.WTitleLayout;
import com.fr.form.ui.widget.BoundsWidget;
import com.fr.general.ComparatorUtils;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import java.awt.*;
import java.awt.event.ContainerEvent;

6
designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java

@ -19,8 +19,8 @@ import com.fr.design.mainframe.EditingMouseListener;
import com.fr.design.mainframe.FormDesigner;
import com.fr.form.ui.container.WBorderLayout;
import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout;
import com.fr.form.ui.widget.BoundsWidget;
import com.fr.general.IOUtils;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import com.fr.general.Inter;
/**
@ -154,7 +154,7 @@ public class XWCardMainBorderLayout extends XWBorderLayout{
tabLayout.getHeight());
for (int m = 0; m < tabLayout.getComponentCount(); m++) {
XCreator childCreator = tabLayout.getXCreator(m);
BoundsWidget wgt = tabLayout.toData()
BoundsWidget wgt = (BoundsWidget) tabLayout.toData()
.getBoundsWidget(childCreator.toData());
wgt.setBounds(tabLayout.getComponent(m).getBounds());
}
@ -189,7 +189,7 @@ public class XWCardMainBorderLayout extends XWBorderLayout{
tabLayout.getHeight() + offset);
for (int m = 0; m < tabLayout.getComponentCount(); m++) {
XCreator childCreator = tabLayout.getXCreator(m);
BoundsWidget wgt = tabLayout.toData()
BoundsWidget wgt = (BoundsWidget) tabLayout.toData()
.getBoundsWidget(childCreator.toData());
wgt.setBounds(tabLayout.getComponent(m).getBounds());
}

4
designer_form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java

@ -18,7 +18,7 @@ import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.CardSwitchButton;
import com.fr.form.ui.container.cardlayout.WCardTagLayout;
import com.fr.form.ui.container.cardlayout.WTabFitLayout;
import com.fr.form.ui.widget.BoundsWidget;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import com.fr.general.Background;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
@ -425,7 +425,7 @@ public class XWTabFitLayout extends XWFitLayout {
private void updateCompsWidget(){
for(int m=0;m<this.getComponentCount();m++){
XCreator childCreator = this.getXCreator(m);
BoundsWidget wgt = this.toData().getBoundsWidget(childCreator.toData());
BoundsWidget wgt = (BoundsWidget) this.toData().getBoundsWidget(childCreator.toData());
wgt.setBounds(this.getComponent(m).getBounds());
wgt.setBackupBounds(this.getComponent(m).getBounds());
}

2
designer_form/src/com/fr/design/mainframe/ConnectorHelper.java

@ -7,7 +7,7 @@ import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import com.fr.form.ui.widget.BoundsWidget;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
import com.fr.stable.Constants;
import com.fr.base.GraphHelper;
import com.fr.design.designer.beans.ConnectorCreator;

3
designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java

@ -305,9 +305,12 @@ class MobileParaWidgetTable extends JTable {
/**
* cell改变相应的nametag改变
*/
private void firePropertyChange(){
((WParameterLayout) designer.getParaComponent().toData()).add2NameTagMap(uiTableTextField.getText(),
cellData[getSelectedRow()][1]);
((WParameterLayout) designer.getParaComponent().toData()).setNameTagModified(cellData[getSelectedRow()][1],
true);
}
@Override

Loading…
Cancel
Save