Fangjie Hu 8 years ago
parent
commit
3486e069cf
  1. 86
      build.master.gradle
  2. 3
      designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
  3. 2
      designer/src/com/fr/design/parameter/ParameterDefinitePane.java
  4. 10
      designer_base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  5. 57
      designer_chart/build.dev.gradle
  6. 43
      designer_chart/build.master.gradle
  7. 45
      designer_chart/build.release.gradle
  8. 83
      designer_form/build.master.gradle
  9. 35
      designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java
  10. 1
      designer_form/src/com/fr/design/designer/properties/FRFitLayoutConstraints.java

86
build.master.gradle

@ -0,0 +1,86 @@
apply plugin: "java"
tasks.withType(JavaCompile){
options.encoding = "UTF-8"
}
def basicDir="../../"
def libDir="${basicDir}/finereport-lib-stable"
//
FileTree files =fileTree(dir:"./",include:"build.*.gradle")
def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ("\\"))
def branchName=buildDir.substring(buildDir.lastIndexOf ("\\")+1)
task appletJar<<{
ant{
mkdir(dir:"${libDir}/tmp-${branchName}")
mkdir(dir:"build/classes/")
copy(todir:"build/classes/"){
fileset(dir:"${basicDir}/finereport-core-stable/${branchName}/build/classes/main")
fileset(dir:"${basicDir}/finereport-chart-stable/${branchName}/build/classes/main")
fileset(dir:"${basicDir}/finereport-report-stable/${branchName}/build/classes/main")
fileset(dir:"${basicDir}/finereport-platform-stable/${branchName}/build/classes/main")
fileset(dir:"${basicDir}/finereport-performance-stable/${branchName}/build/classes/main")
}
unjar(src:"${libDir}/${branchName}/3rd.jar",dest:"${libDir}/tmp-${branchName}")
unjar(src:"${libDir}/${branchName}/servlet-api.jar",dest:"${libDir}/tmp-${branchName}")
jar(jarfile:"build/libs/fr-applet-8.0.jar"){
fileset(dir:"build/classes"){
exclude(name:"*.*")
exclude(name:"bin/*.*")
exclude(name:"classes/**")
exclude(name:"com/fr/schedule/**")
exclude(name:"com/fr/cell/**")
exclude(name:"com/fr/dialog/**")
exclude(name:"com/fr/view/**")
exclude(name:"com/fr/web/**")
exclude(name:"com/fr/fs/**")
exclude(name:"com/fr/design/**")
exclude(name:"com/fr/start/**")
exclude(name:"com/fr/process/**")
}
fileset(dir:"${libDir}/tmp-${branchName}"){
include(name:"javax/mail/**")
include(name:"javax/servlet/**")
include(name:"org/freehep/**")
include(name:"com/fr/third/JAI/**")
include(name:"com/fr/third/antlr/**")
include(name:"com/fr/third/javax/**")
include(name:"com/sun/xml/**")
include(name:"javax/xml/**")
}
fileset(dir:"build/classes"){
include(name:"com/fr/web/*.class")
include(name:"com/fr/web/attr/*.class")
}
}
delete(dir:"${libDir}/tmp-${branchName}")
def jdk6home= "D:/FineReport/develop/java/jdk1.6u35"
def keystore="frapplet.store"
def keycert="fr.cert"
def keypassword="123456"
def keyalias="fr"
exec(executable:"${jdk6home}/bin/keytool"){
arg(line:"-genkey -dname &quot;CN=FineReport L=NanJing C=China&quot; -keystore ${keystore} -alias ${keyalias} -validity 3650 -storepass ${keypassword}")
}
exec(executable:"${jdk6home}/bin/keytool"){
arg(line:"-export -keystore ${keystore} -alias ${keyalias} -file ${keycert} -storepass ${keypassword}")
}
exec(executable:"${jdk6home}/bin/jarsigner"){
arg(line:"-keystore ${keystore} -storepass ${keypassword} 'build/libs/fr-applet-8.0.jar' ${keyalias}")
}
delete(file:"${keystore}")
delete(file:"${keycert}")
delete(dir:"build/classes")
}
}

3
designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java

@ -3,7 +3,6 @@ package com.fr.design.mainframe;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.fun.MenuHandler; import com.fr.design.fun.MenuHandler;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.KeySetUtils;
import com.fr.design.parameter.ParameterPropertyPane;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.page.ReportSettingsProvider; import com.fr.page.ReportSettingsProvider;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
@ -103,7 +102,7 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
// 插入菜单 // 插入菜单
private MenuDef createInsertMenuDef() { private MenuDef createInsertMenuDef() {
MenuDef menuDef = new MenuDef(Inter.getLocText("M-Insert"), 'I'); MenuDef menuDef = new MenuDef(Inter.getLocText("FR-Designer_M-Insert"), 'I');
menuDef.setAnchor(MenuHandler.INSERT); menuDef.setAnchor(MenuHandler.INSERT);
// 单元格菜单 // 单元格菜单
menuDef.addShortCut(DeprecatedActionManager.getCellMenu(this)); menuDef.addShortCut(DeprecatedActionManager.getCellMenu(this));

2
designer/src/com/fr/design/parameter/ParameterDefinitePane.java

@ -20,7 +20,6 @@ import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.AuthorityToolBarPane; import com.fr.design.mainframe.AuthorityToolBarPane;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.JWorkBook; import com.fr.design.mainframe.JWorkBook;
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus;
import com.fr.design.menu.*; import com.fr.design.menu.*;
@ -245,7 +244,6 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus
isdelayItem.setSelected(reportParameterAttr.isDelayPlaying()); isdelayItem.setSelected(reportParameterAttr.isDelayPlaying());
isshowWindowItem.setSelected(reportParameterAttr.isShowWindow()); isshowWindowItem.setSelected(reportParameterAttr.isShowWindow());
isEditing = true; isEditing = true;
EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance().getPreferredSize().height);
ParameterBridge bridge = paraDesignEditor.getParaComponent(); ParameterBridge bridge = paraDesignEditor.getParaComponent();
if (parameterUI != null) { if (parameterUI != null) {
bridge.setDelayDisplayContent(reportParameterAttr.isDelayPlaying()); bridge.setDelayDisplayContent(reportParameterAttr.isDelayPlaying());

10
designer_base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java

@ -27,7 +27,6 @@ import com.fr.file.FILE;
import com.fr.file.FileNodeFILE; import com.fr.file.FileNodeFILE;
import com.fr.file.filetree.FileNode; import com.fr.file.filetree.FileNode;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.CoreConstants; import com.fr.stable.CoreConstants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
@ -43,7 +42,6 @@ import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.io.File; import java.io.File;
import java.util.HashMap; import java.util.HashMap;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
@ -414,13 +412,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
UIButton cancelButton = new UIButton(Inter.getLocText("FR-Designer_Cancel")); UIButton cancelButton = new UIButton(Inter.getLocText("FR-Designer_Cancel"));
// mod by anchore 16/11/16 cancelButton.setBounds(250, 90, 60, 25);
if (ComparatorUtils.equals(Locale.JAPAN, GeneralContext.getLocale())) {
cancelButton.setBounds(250, 90, 80, 25);
} else {
cancelButton.setBounds(180, 90, 80, 25);
}
//cancelButton.setBounds(250, 90, 60, 25);
cancelButton.addActionListener(new ActionListener() { cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
jd.dispose(); jd.dispose();

57
designer_chart/build.dev.gradle

@ -4,60 +4,83 @@ tasks.withType(JavaCompile){
options.encoding = 'UTF-8' options.encoding = 'UTF-8'
} }
//jdk版本 //jdk版本
sourceCompatibility=1.7 sourceCompatibility=1.8
//jar包版本 //jar包版本
version='8.0' version='8.0'
def srcDir="." def srcDir="."
//jar包进行重命名
//jar包的名字
jar{ jar{
baseName='fr-designer-chart' baseName='fr-designer-report'
} }
//
sourceSets{ sourceSets{
main{ main{
java{ java{
srcDirs=["${srcDir}/src"] srcDirs=["${srcDir}/src",
"${srcDir}/../designer/src"]
} }
} }
} }
//
FileTree files =fileTree(dir:'./',include:'build.*.gradle') FileTree files =fileTree(dir:'./',include:'build.*.gradle')
def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ('\\')) def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ('\\'))
buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\')) buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\'))
def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1)
// //jar包
dependencies{ FileTree f=fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar")
compile fileTree(dir:"../../../finereport-lib-stable/${branchName}",include:'**/*.jar') f.each{File file->
compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar") println "----${file.path}"
}
//
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' 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'
//
def dataContent ={def dir ->
copySpec{
from ("${dir}"){
exclude '**/.setting/**','.classpath','.project','**/*.java','**/*.db','**/*.g','**/package.html'
}
} }
into 'build/classes/main' }
//.java文件复制到classes文件夹下
task copyFile(type:Copy,dependsOn:compileJava){
copy{
with dataContent.call("${srcDir}/src")
with dataContent.call("${srcDir}/../designer/src")
into ('build/classes/main')
} }
} }
//js文件 //js文件
task compressJS{ task compressJS{
ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){ ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){
classpath { classpath {
fileset(dir:'../../../finereport-lib4build-stable',includes:'**/*.jar') 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'){ ant.yuicompress(linebreak:"500",warn:"false", munge:"yes",preserveallsemicolons:"false", charset:"utf-8",encoding:"utf-8",outputfolder:'build/classes/main'){
fileset (dir:"${srcDir}/src"){ fileset (dir:"${srcDir}/src"){
include (name:'**/*.js') include (name:'**/*.js')
include (name:'**/*.css') include (name:'**/*.css')
}
fileset (dir:"${srcDir}/../designer/src"){
include (name:'**/*.js')
include (name:'**/*.css')
} }
} }

43
designer_chart/build.master.gradle

@ -5,48 +5,60 @@ tasks.withType(JavaCompile){
} }
//jdk版本 //jdk版本
sourceCompatibility=1.7 sourceCompatibility=1.7
//jar包版本 //jar包版本
version='8.0' version='8.0'
def srcDir="." def srcDir="."
//jar包进行重命名
//jar包的名字
jar{ jar{
baseName='fr-designer-chart' baseName='fr-designer-report'
} }
//
sourceSets{ sourceSets{
main{ main{
java{ java{
srcDirs=["${srcDir}/src"] srcDirs=["${srcDir}/src",
"${srcDir}/../designer/src"]
} }
} }
} }
//
FileTree files =fileTree(dir:'./',include:'build.*.gradle') FileTree files =fileTree(dir:'./',include:'build.*.gradle')
def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ('\\')) def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ('\\'))
buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\')) buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\'))
def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1)
// //
dependencies{ dependencies{
compile fileTree(dir:"../../../finereport-lib-stable/${branchName}",include:'**/*.jar') compile fileTree(dir:"../../../finereport-lib-stable/${branchName}",include:'**/*.jar')
compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar") compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar")
testCompile 'junit:junit:4.12' 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'
//
def dataContent ={def dir ->
copySpec{
from ("${dir}"){
exclude '**/.setting/**','.classpath','.project','**/*.java','**/*.db','**/*.g','**/package.html'
}
} }
into 'build/classes/main' }
//.java文件复制到classes文件夹下
task copyFile(type:Copy,dependsOn:compileJava){
copy{
with dataContent.call("${srcDir}/src")
with dataContent.call("${srcDir}/../designer/src")
into ('build/classes/main')
} }
} }
//js文件 //js文件
task compressJS{ task compressJS{
ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){ ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){
@ -54,10 +66,15 @@ task compressJS{
fileset(dir:'../../../finereport-lib4build-stable',includes:'**/*.jar') 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'){ ant.yuicompress(linebreak:"500",warn:"false", munge:"yes",preserveallsemicolons:"false", charset:"utf-8",encoding:"utf-8",outputfolder:'build/classes/main'){
fileset (dir:"${srcDir}/src"){ fileset (dir:"${srcDir}/src"){
include (name:'**/*.js') include (name:'**/*.js')
include (name:'**/*.css') include (name:'**/*.css')
}
fileset (dir:"${srcDir}/../designer/src"){
include (name:'**/*.js')
include (name:'**/*.css')
} }
} }

45
designer_chart/build.release.gradle

@ -5,59 +5,76 @@ tasks.withType(JavaCompile){
} }
//jdk版本 //jdk版本
sourceCompatibility=1.8 sourceCompatibility=1.8
//jar包版本 //jar包版本
version='8.0' version='8.0'
def srcDir="." def srcDir="."
//jar包进行重命名
//jar包的名字
jar{ jar{
baseName='fr-designer-chart' baseName='fr-designer-report'
} }
//
sourceSets{ sourceSets{
main{ main{
java{ java{
srcDirs=["${srcDir}/src"] srcDirs=["${srcDir}/src",
"${srcDir}/../designer/src"]
} }
} }
} }
//
FileTree files =fileTree(dir:'./',include:'build.*.gradle') FileTree files =fileTree(dir:'./',include:'build.*.gradle')
def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ('\\')) def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ('\\'))
buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\')) buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\'))
def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1)
//
//
dependencies{ dependencies{
compile fileTree(dir:'../../../finereport-lib-stable/master',include:'**/*.jar') compile fileTree(dir:'../../../finereport-lib-stable/master',include:'**/*.jar')
compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar") compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar")
testCompile 'junit:junit:4.12' 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'
//
def dataContent ={def dir ->
copySpec{
from ("${dir}"){
exclude '**/.setting/**','.classpath','.project','**/*.java','**/*.db','**/*.g','**/package.html'
}
} }
into 'build/classes/main' }
//.java文件复制到classes文件夹下
task copyFile(type:Copy,dependsOn:compileJava){
copy{
with dataContent.call("${srcDir}/src")
with dataContent.call("${srcDir}/../designer/src")
into ('build/classes/main')
} }
} }
//js文件 //js文件
task compressJS{ task compressJS{
ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){ ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){
classpath { classpath {
fileset(dir:'../../../finereport-lib4build-stable',includes:'**/*.jar') 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'){ ant.yuicompress(linebreak:"500",warn:"false", munge:"yes",preserveallsemicolons:"false", charset:"utf-8",encoding:"utf-8",outputfolder:'build/classes/main'){
fileset (dir:"${srcDir}/src"){ fileset (dir:"${srcDir}/src"){
include (name:'**/*.js') include (name:'**/*.js')
include (name:'**/*.css') include (name:'**/*.css')
}
fileset (dir:"${srcDir}/../designer/src"){
include (name:'**/*.js')
include (name:'**/*.css')
} }
} }

83
designer_form/build.master.gradle

@ -0,0 +1,83 @@
apply plugin: 'java'
tasks.withType(JavaCompile){
options.encoding = 'UTF-8'
}
//jdk版本
sourceCompatibility=1.7
//jar包版本
version='8.0'
def srcDir="."
//jar包的名字
jar{
baseName='fr-designer-report'
}
//
sourceSets{
main{
java{
srcDirs=["${srcDir}/src",
"${srcDir}/../designer/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'
}
//
def dataContent ={def dir ->
copySpec{
from ("${dir}"){
exclude '**/.setting/**','.classpath','.project','**/*.java','**/*.db','**/*.g','**/package.html'
}
}
}
//.java文件复制到classes文件夹下
task copyFile(type:Copy,dependsOn:compileJava){
copy{
with dataContent.call("${srcDir}/src")
with dataContent.call("${srcDir}/../designer/src")
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')
}
fileset (dir:"${srcDir}/../designer/src"){
include (name:'**/*.js')
include (name:'**/*.css')
}
}
}
jar.dependsOn compressJS

35
designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java

@ -42,7 +42,16 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
public static final String WIDGETPANEICONPATH = "/com/fr/web/images/form/resources/layout_absolute.png"; public static final String WIDGETPANEICONPATH = "/com/fr/web/images/form/resources/layout_absolute.png";
private static final int DEPENDING_SCOPE = 3; private static final int DEPENDING_SCOPE = 3;
private HoverPainter painter; private HoverPainter painter;
//区分拖拽和编辑宽高
private boolean isEdit;
public boolean isEdit() {
return isEdit;
}
public void setEdit(boolean edit) {
isEdit = edit;
}
/** /**
* 构造函数 * 构造函数
* *
@ -411,13 +420,15 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
// 根据需要依附的位置调整拖拽的坐标值 // 根据需要依附的位置调整拖拽的坐标值
private int adjustCoordinateByDependingLine(int coordinate, int[] coordinates) { private int adjustCoordinateByDependingLine(int coordinate, int[] coordinates) {
for (int i = 0; i < coordinates.length; i++) { if(!isEdit) {
if (coordinate == coordinates[i]) { for (int i = 0; i < coordinates.length; i++) {
continue; if (coordinate == coordinates[i]) {
} continue;
if (coordinate > coordinates[i] - DEPENDING_SCOPE && coordinate < coordinates[i] + DEPENDING_SCOPE) { }
coordinate = coordinates[i]; if (coordinate > coordinates[i] - DEPENDING_SCOPE && coordinate < coordinates[i] + DEPENDING_SCOPE) {
break; coordinate = coordinates[i];
break;
}
} }
} }
return coordinate; return coordinate;
@ -425,10 +436,12 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
// 根据需要依附的位置调整拖拽的距离 // 根据需要依附的位置调整拖拽的距离
private int adjustDiffByDependingLine(int coordinate, int[] coordinates, int diff) { private int adjustDiffByDependingLine(int coordinate, int[] coordinates, int diff) {
for (int i = 0; i < coordinates.length; i++) { if(!isEdit) {
if (coordinate + diff > coordinates[i] - DEPENDING_SCOPE && coordinate + diff < coordinates[i] + DEPENDING_SCOPE) { for (int i = 0; i < coordinates.length; i++) {
diff = coordinates[i] - coordinate; if (coordinate + diff > coordinates[i] - DEPENDING_SCOPE && coordinate + diff < coordinates[i] + DEPENDING_SCOPE) {
break; diff = coordinates[i] - coordinate;
break;
}
} }
} }
return diff; return diff;

1
designer_form/src/com/fr/design/designer/properties/FRFitLayoutConstraints.java

@ -128,6 +128,7 @@ public class FRFitLayoutConstraints implements ConstraintsGroupModel {
Rectangle backupBounds = getBounds(); Rectangle backupBounds = getBounds();
FRFitLayoutAdapter layoutAdapter = (FRFitLayoutAdapter) AdapterBus.searchLayoutAdapter(formDesigner, xCreator); FRFitLayoutAdapter layoutAdapter = (FRFitLayoutAdapter) AdapterBus.searchLayoutAdapter(formDesigner, xCreator);
if (layoutAdapter != null) { if (layoutAdapter != null) {
layoutAdapter.setEdit(true);
layoutAdapter.calculateBounds(backupBounds, bounds, xCreator, row, difference); layoutAdapter.calculateBounds(backupBounds, bounds, xCreator, row, difference);
} }
return true; return true;

Loading…
Cancel
Save