neil 8 years ago
parent
commit
b67f09ae9f
  1. 2
      designer_base/build.gradle
  2. 2
      designer_base/src/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java
  3. 2
      designer_chart/build.gradle
  4. 8
      designer_form/build.gradle
  5. 69
      designer_form/src/com/fr/design/designer/beans/adapters/layout/FRParameterLayoutAdapter.java
  6. 9
      designer_form/src/com/fr/design/designer/creator/XWParameterLayout.java

2
designer_base/build.gradle

@ -53,7 +53,7 @@ task copyFile(type:Copy,dependsOn:compileJava){
task compressJS{
ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){
classpath {
fileset(dir:'../../../finereport-build-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'){

2
designer_base/src/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java

@ -32,7 +32,7 @@ public abstract class ButtonWithHotkeysDetailPane<T extends Button> extends Butt
private void initComponents() {
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced"));
advancedPane.setPreferredSize(new Dimension(600,300));
advancedPane.setPreferredSize(new Dimension(600, 341));
JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
attrPane.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4));
this.add(advancedPane);

2
designer_chart/build.gradle

@ -51,7 +51,7 @@ task copyFile(type:Copy,dependsOn:compileJava){
task compressJS{
ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){
classpath {
fileset(dir:'../../../finereport-build-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'){

8
designer_form/build.gradle

@ -31,6 +31,11 @@ def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ('\\'))
buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\'))
def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1)
FileTree jars=fileTree(dir:'../../../').include "finereport-*-stable/${branchName}/**/*.jar"
jars.each{File file->
println "-----------this jar path is ${file.path}----------"
}
//ÉùÃ÷ÍⲿÒÀÀµ
dependencies{
compile fileTree(dir:'../../../finereport-lib-stable',include:'**/*.jar')
@ -63,7 +68,8 @@ task copyFile(type:Copy,dependsOn:compileJava){
task compressJS{
ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){
classpath {
fileset(dir:'../../../finereport-build-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'){

69
designer_form/src/com/fr/design/designer/beans/adapters/layout/FRParameterLayoutAdapter.java

@ -1,14 +1,20 @@
package com.fr.design.designer.beans.adapters.layout;
import com.fr.design.beans.GroupModel;
import com.fr.design.designer.beans.ConstraintsGroupModel;
import com.fr.design.designer.beans.HoverPainter;
import com.fr.design.designer.beans.painters.FRParameterLayoutPainter;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.form.parameter.RootDesignGroupModel;
import com.fr.design.utils.ComponentUtils;
import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.container.WParameterLayout;
import java.awt.*;
/**
* 表单参数界面的监听器
*/
@ -39,5 +45,66 @@ public class FRParameterLayoutAdapter extends FRAbsoluteLayoutAdapter {
WParameterLayout wabs = (WParameterLayout)container.toData();
wabs.refreshTagList();
}
/**
* 是否能在指定位置添加组件
*
* @param creator 组件
* @param x 坐标x
* @param y 坐标y
* @return 能则返回true
*/
@Override
public boolean accept(XCreator creator, int x, int y) {
return x >= 0 && y >= 0 && creator.getHeight() <= container.getHeight()
&& creator.getWidth() <= container.getWidth();
}
@Override
protected void addComp(XCreator creator, int x, int y) {
if (XCreatorUtils.getParentXLayoutContainer(creator) != null) {
Rectangle r = ComponentUtils.getRelativeBounds(container);
Rectangle creatorRectangle = ComponentUtils.getRelativeBounds(creator);
x = creatorRectangle.x - r.x;
y = creatorRectangle.y - r.y;
} else {
int w = creator.getWidth() / 2;
int h = creator.getHeight() / 2;
x = x - w;
y = y - h;
}
fix(creator, x, y);
container.add(creator);
LayoutUtils.layoutRootContainer(container);
}
/**
* 调整组件大小到合适尺寸位置
*
* @param creator 组件
* @param x 坐标x
* @param y 坐标y
*/
@Override
public void fix(XCreator creator, int x, int y) {
if (x < 0) {
x = 0;
} else if (x + creator.getWidth() > container.getWidth()) {
x = container.getWidth() - creator.getWidth();
}
if (y < 0) {
y = 0;
} else if (y + creator.getHeight() > container.getHeight()) {
y = container.getHeight() - creator.getHeight();
}
creator.setLocation(x, y);
}
@Override
public ConstraintsGroupModel getLayoutConstraints(XCreator creator) {
return super.getLayoutConstraints(creator);
}
}

9
designer_form/src/com/fr/design/designer/creator/XWParameterLayout.java

@ -174,4 +174,13 @@ public class XWParameterLayout extends XWAbsoluteLayout {
public XLayoutContainer getTopLayout() {
return this;
}
/**
* 新增删除拉伸后更新每个组件的BoundsWidget
*
* @param xCreator
*/
@Override
public void updateBoundsWidget(XCreator xCreator) {
}
}
Loading…
Cancel
Save