31 changed files with 678 additions and 334 deletions
@ -0,0 +1,61 @@ |
|||||||
|
|
||||||
|
apply plugin: 'java' |
||||||
|
tasks.withType(JavaCompile){ |
||||||
|
options.encoding = 'UTF-8' |
||||||
|
} |
||||||
|
version='8.0' |
||||||
|
|
||||||
|
jar{ |
||||||
|
baseName='fr-designer-core' |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
def srcDir="${System.getenv()['JENKINS_HOME']}/workspace/design" |
||||||
|
def libDir="${System.getenv()['JENKINS_HOME']}/workspace/lib" |
||||||
|
|
||||||
|
sourceSets{ |
||||||
|
main{ |
||||||
|
java{ |
||||||
|
srcDirs=["${srcDir}/designer_base/src"] |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
dependencies{ |
||||||
|
compile fileTree(dir:'../../',include:'**/*.jar') |
||||||
|
compile fileTree(dir:libDir,include:'*.jar') |
||||||
|
compile fileTree(dir:"${libDir}/jetty",include:'*.jar') |
||||||
|
testCompile 'junit:junit:4.12' |
||||||
|
} |
||||||
|
|
||||||
|
task copyFile(type:Copy,dependsOn:compileJava){ |
||||||
|
copy{ |
||||||
|
from ("${srcDir}/designer_base/src"){ |
||||||
|
exclude '**/*.java' |
||||||
|
} |
||||||
|
into 'build/classes/main' |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
//ѹËõÏîÄ¿ÖеÄjsÎļþ |
||||||
|
task compressJS{ |
||||||
|
ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){ |
||||||
|
classpath { |
||||||
|
fileset(dir:'../../lib',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}/designer_base/src"){ |
||||||
|
include (name:'**/*.js') |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
} |
||||||
|
jar.dependsOn compressJS |
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,57 @@ |
|||||||
|
|
||||||
|
apply plugin: 'java' |
||||||
|
tasks.withType(JavaCompile){ |
||||||
|
options.encoding = 'UTF-8' |
||||||
|
} |
||||||
|
|
||||||
|
version='8.0' |
||||||
|
|
||||||
|
def srcDir="${System.getenv()['JENKINS_HOME']}/workspace/design" |
||||||
|
def libDir="${System.getenv()['JENKINS_HOME']}/workspace/lib" |
||||||
|
|
||||||
|
|
||||||
|
jar{ |
||||||
|
baseName='fr-designer-chart' |
||||||
|
} |
||||||
|
|
||||||
|
sourceSets{ |
||||||
|
main{ |
||||||
|
java{ |
||||||
|
srcDirs=["${srcDir}/designer_chart/src"] |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
dependencies{ |
||||||
|
compile fileTree(dir:'../../',include:'**/*.jar') |
||||||
|
compile fileTree(dir:libDir,include:'*.jar') |
||||||
|
compile fileTree(dir:"${libDir}/jetty",include:'*.jar') |
||||||
|
testCompile 'junit:junit:4.12' |
||||||
|
} |
||||||
|
|
||||||
|
task copyFile(type:Copy,dependsOn:compileJava){ |
||||||
|
copy{ |
||||||
|
from ("${srcDir}/designer_chart/src"){ |
||||||
|
exclude '**/*.java' |
||||||
|
} |
||||||
|
into 'build/classes/main' |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
//ѹËõÏîÄ¿ÖеÄjsÎļþ |
||||||
|
task compressJS{ |
||||||
|
ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){ |
||||||
|
classpath { |
||||||
|
fileset(dir:'../../lib',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}/designer_chart/src"){ |
||||||
|
include (name:'**/*.js') |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
} |
||||||
|
jar.dependsOn compressJS |
||||||
|
|
@ -0,0 +1,65 @@ |
|||||||
|
|
||||||
|
apply plugin: 'java' |
||||||
|
tasks.withType(JavaCompile){ |
||||||
|
options.encoding = 'UTF-8' |
||||||
|
} |
||||||
|
|
||||||
|
version='8.0' |
||||||
|
|
||||||
|
def srcDir="${System.getenv()['JENKINS_HOME']}/workspace/design" |
||||||
|
def libDir="${System.getenv()['JENKINS_HOME']}/workspace/lib" |
||||||
|
|
||||||
|
|
||||||
|
jar{ |
||||||
|
baseName='fr-designer-report' |
||||||
|
} |
||||||
|
|
||||||
|
sourceSets{ |
||||||
|
main{ |
||||||
|
java{ |
||||||
|
srcDirs=["${srcDir}/designer/src", |
||||||
|
"${srcDir}/designer_form/src"] |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
dependencies{ |
||||||
|
compile fileTree(dir:'../../',include:'**/*.jar') |
||||||
|
compile fileTree(dir:libDir,include:'*.jar') |
||||||
|
compile fileTree(dir:"${libDir}/jetty",include:'*.jar') |
||||||
|
testCompile 'junit:junit:4.12' |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
task copyFile(type:Copy,dependsOn:compileJava){ |
||||||
|
copy{ |
||||||
|
from ("${srcDir}/designer/src"){ |
||||||
|
exclude '**/*.java' |
||||||
|
} |
||||||
|
from ("${srcDir}/designer_form/src") |
||||||
|
into ('build/classes/main') |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
//ѹËõÏîÄ¿ÖеÄjsÎļþ |
||||||
|
task compressJS{ |
||||||
|
ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){ |
||||||
|
classpath { |
||||||
|
fileset(dir:'../../lib',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}/designer/src"){ |
||||||
|
include (name:'**/*.js') |
||||||
|
|
||||||
|
} |
||||||
|
fileset (dir:"${srcDir}/designer_form/src"){ |
||||||
|
include (name:'**/*.js') |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
} |
||||||
|
jar.dependsOn compressJS |
||||||
|
|
@ -1,21 +0,0 @@ |
|||||||
package com.fr.design.designer.beans.adapters.layout; |
|
||||||
|
|
||||||
import com.fr.design.beans.GroupModel; |
|
||||||
import com.fr.design.designer.creator.XLayoutContainer; |
|
||||||
import com.fr.design.designer.creator.XWFitLayout; |
|
||||||
import com.fr.design.designer.properties.BodyMobileLayoutPropertiesGroupModel; |
|
||||||
|
|
||||||
public class FRBodyFitLayoutAdapter extends FRFitLayoutAdapter { |
|
||||||
|
|
||||||
public FRBodyFitLayoutAdapter(XLayoutContainer container) { |
|
||||||
super(container); |
|
||||||
} |
|
||||||
/** |
|
||||||
* 返回布局自身属性,方便一些特有设置在layout刷新时处理 |
|
||||||
*/ |
|
||||||
@Override |
|
||||||
public GroupModel getLayoutProperties() { |
|
||||||
XWFitLayout xfl = (XWFitLayout) container; |
|
||||||
return new BodyMobileLayoutPropertiesGroupModel(xfl); |
|
||||||
} |
|
||||||
} |
|
@ -1,20 +0,0 @@ |
|||||||
package com.fr.design.designer.creator; |
|
||||||
|
|
||||||
import com.fr.design.designer.beans.LayoutAdapter; |
|
||||||
import com.fr.design.designer.beans.adapters.layout.FRBodyFitLayoutAdapter; |
|
||||||
import com.fr.form.ui.container.WFitLayout; |
|
||||||
import java.awt.Dimension; |
|
||||||
|
|
||||||
public class XWBodyFitLayout extends XWFitLayout { |
|
||||||
public XWBodyFitLayout() { |
|
||||||
this(new WFitLayout(), new Dimension()); |
|
||||||
} |
|
||||||
|
|
||||||
public XWBodyFitLayout(WFitLayout widget, Dimension initSize) { |
|
||||||
super(widget, initSize); |
|
||||||
} |
|
||||||
@Override |
|
||||||
public LayoutAdapter getLayoutAdapter() { |
|
||||||
return new FRBodyFitLayoutAdapter(this); |
|
||||||
} |
|
||||||
} |
|
@ -0,0 +1,12 @@ |
|||||||
|
package com.fr.design.designer.properties; |
||||||
|
|
||||||
|
import com.fr.design.mainframe.widget.renderer.EncoderCellRenderer; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by zhouping on 2016/8/1. |
||||||
|
*/ |
||||||
|
public class AbsoluteStateRenderer extends EncoderCellRenderer { |
||||||
|
public AbsoluteStateRenderer() { |
||||||
|
super(new AbsoluteStateWrapper()); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,12 @@ |
|||||||
|
package com.fr.design.designer.properties; |
||||||
|
|
||||||
|
import com.fr.design.designer.properties.items.FRAbsoluteConstraintsItems; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by zhouping on 2016/8/1. |
||||||
|
*/ |
||||||
|
public class AbsoluteStateWrapper extends ItemWrapper{ |
||||||
|
public AbsoluteStateWrapper() { |
||||||
|
super(new FRAbsoluteConstraintsItems()); |
||||||
|
} |
||||||
|
} |
@ -1,111 +0,0 @@ |
|||||||
package com.fr.design.designer.properties; |
|
||||||
|
|
||||||
import com.fr.design.beans.GroupModel; |
|
||||||
import com.fr.form.ui.container.WFitLayout; |
|
||||||
import com.fr.design.designer.creator.XWFitLayout; |
|
||||||
import com.fr.design.gui.icheckbox.UICheckBox; |
|
||||||
import com.fr.design.mainframe.widget.editors.BooleanEditor; |
|
||||||
import com.fr.design.mainframe.widget.editors.PropertyCellEditor; |
|
||||||
import com.fr.general.Inter; |
|
||||||
|
|
||||||
import javax.swing.*; |
|
||||||
import javax.swing.table.TableCellEditor; |
|
||||||
import javax.swing.table.TableCellRenderer; |
|
||||||
import java.awt.*; |
|
||||||
|
|
||||||
public class BodyMobileLayoutPropertiesGroupModel implements GroupModel { |
|
||||||
private PropertyCellEditor reLayoutEditor; |
|
||||||
private CheckBoxCellRenderer reLayoutrenderer; |
|
||||||
private WFitLayout layout; |
|
||||||
private XWFitLayout xfl; |
|
||||||
|
|
||||||
public BodyMobileLayoutPropertiesGroupModel(XWFitLayout xfl) { |
|
||||||
this.xfl = xfl; |
|
||||||
this.layout = xfl.toData(); |
|
||||||
reLayoutrenderer = new CheckBoxCellRenderer(); |
|
||||||
reLayoutEditor = new PropertyCellEditor(new BooleanEditor()); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public String getGroupName() { |
|
||||||
return Inter.getLocText("FR-Designer-Layout_Adaptive_Layout"); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public int getRowCount() { |
|
||||||
return 1; |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public TableCellRenderer getRenderer(int row) { |
|
||||||
return reLayoutrenderer; |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public TableCellEditor getEditor(int row) { |
|
||||||
return reLayoutEditor; |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public Object getValue(int row, int column) { |
|
||||||
if (column == 0) { |
|
||||||
return Inter.getLocText("FR-Designer-App_ReLayout"); |
|
||||||
}else { |
|
||||||
return layout.getAppRelayout(); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public boolean setValue(Object value, int row, int column) { |
|
||||||
int state = 0; |
|
||||||
boolean appRelayoutState = true; |
|
||||||
if(value instanceof Integer) { |
|
||||||
state = (Integer)value; |
|
||||||
}else if (value instanceof Boolean) { |
|
||||||
appRelayoutState = (boolean)value; |
|
||||||
} |
|
||||||
if (column == 0 || state < 0) { |
|
||||||
return false; |
|
||||||
} else { |
|
||||||
layout.setAppRelayout(appRelayoutState); |
|
||||||
return true; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 是否可编辑 |
|
||||||
* @param row 行 |
|
||||||
* @return 否 |
|
||||||
*/ |
|
||||||
@Override |
|
||||||
public boolean isEditable(int row) { |
|
||||||
return true; |
|
||||||
} |
|
||||||
|
|
||||||
private class CheckBoxCellRenderer extends UICheckBox implements TableCellRenderer { |
|
||||||
|
|
||||||
|
|
||||||
public CheckBoxCellRenderer() { |
|
||||||
super(); |
|
||||||
setOpaque(true); |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { |
|
||||||
if (value instanceof Boolean) { |
|
||||||
setSelected(((Boolean) value).booleanValue()); |
|
||||||
setEnabled(table.isCellEditable(row, column)); |
|
||||||
if (isSelected) { |
|
||||||
setBackground(table.getSelectionBackground()); |
|
||||||
setForeground(table.getSelectionForeground()); |
|
||||||
} else { |
|
||||||
setForeground(table.getForeground()); |
|
||||||
setBackground(table.getBackground()); |
|
||||||
} |
|
||||||
} else { |
|
||||||
return null; |
|
||||||
} |
|
||||||
return this; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -0,0 +1,94 @@ |
|||||||
|
package com.fr.design.designer.properties; |
||||||
|
|
||||||
|
import com.fr.design.beans.GroupModel; |
||||||
|
import com.fr.design.designer.creator.XWAbsoluteLayout; |
||||||
|
import com.fr.design.mainframe.widget.editors.AbsoluteLayoutDirectionEditor; |
||||||
|
import com.fr.design.mainframe.widget.editors.IntegerPropertyEditor; |
||||||
|
import com.fr.design.mainframe.widget.editors.PropertyCellEditor; |
||||||
|
import com.fr.form.ui.container.WAbsoluteLayout; |
||||||
|
import com.fr.general.Inter; |
||||||
|
|
||||||
|
import javax.swing.table.DefaultTableCellRenderer; |
||||||
|
import javax.swing.table.TableCellEditor; |
||||||
|
import javax.swing.table.TableCellRenderer; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by zhouping on 2016/8/1. |
||||||
|
*/ |
||||||
|
public class FRAbsoluteLayoutPropertiesGroupModel implements GroupModel { |
||||||
|
|
||||||
|
private PropertyCellEditor editor; |
||||||
|
private DefaultTableCellRenderer renderer; |
||||||
|
private AbsoluteLayoutDirectionEditor stateEditor; |
||||||
|
private AbsoluteStateRenderer stateRenderer; |
||||||
|
private WAbsoluteLayout layout; |
||||||
|
private XWAbsoluteLayout xwAbsoluteLayout; |
||||||
|
|
||||||
|
public FRAbsoluteLayoutPropertiesGroupModel(XWAbsoluteLayout xwAbsoluteLayout){ |
||||||
|
this.xwAbsoluteLayout = xwAbsoluteLayout; |
||||||
|
this.layout = xwAbsoluteLayout.toData(); |
||||||
|
renderer = new DefaultTableCellRenderer(); |
||||||
|
editor = new PropertyCellEditor(new IntegerPropertyEditor()); |
||||||
|
stateEditor = new AbsoluteLayoutDirectionEditor(); |
||||||
|
stateRenderer = new AbsoluteStateRenderer(); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 布局管理器自己的属性 |
||||||
|
*/ |
||||||
|
@Override |
||||||
|
public String getGroupName() { |
||||||
|
return Inter.getLocText("FR-Designer-Widget_Area_Scaling"); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public int getRowCount() { |
||||||
|
return 1; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public TableCellRenderer getRenderer(int row) { |
||||||
|
return stateRenderer; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public TableCellEditor getEditor(int row) { |
||||||
|
return stateEditor; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public Object getValue(int row, int column) { |
||||||
|
if (column == 0) { |
||||||
|
return Inter.getLocText("FR-Designer-Widget_Scaling_Mode"); |
||||||
|
} else { |
||||||
|
return layout.getCompState(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public boolean setValue(Object value, int row, int column) { |
||||||
|
int state = 0; |
||||||
|
if(value instanceof Integer) { |
||||||
|
state = (Integer)value; |
||||||
|
} |
||||||
|
if (column == 0 || state < 0) { |
||||||
|
return false; |
||||||
|
} else { |
||||||
|
if (row == 0) { |
||||||
|
layout.setCompState(state); |
||||||
|
return true; |
||||||
|
} |
||||||
|
return false; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 是否可编辑 |
||||||
|
* @param row 行 |
||||||
|
* @return 否 |
||||||
|
*/ |
||||||
|
@Override |
||||||
|
public boolean isEditable(int row) { |
||||||
|
return true; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,19 @@ |
|||||||
|
package com.fr.design.designer.properties.items; |
||||||
|
|
||||||
|
import com.fr.form.ui.container.WAbsoluteLayout; |
||||||
|
import com.fr.general.Inter; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by zhouping on 2016/8/1. |
||||||
|
*/ |
||||||
|
public class FRAbsoluteConstraintsItems implements ItemProvider{ |
||||||
|
|
||||||
|
public static final Item[] ITEMS = new Item[] { |
||||||
|
new Item(Inter.getLocText("FR-Designer_Widget_Scaling_Mode_Fit"), WAbsoluteLayout.STATE_FIT), |
||||||
|
new Item(Inter.getLocText("FR-Designer_Widget_Scaling_Mode_Fixed"), WAbsoluteLayout.STATE_FIXED) |
||||||
|
}; |
||||||
|
|
||||||
|
public Item[] getItems() { |
||||||
|
return ITEMS; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,13 @@ |
|||||||
|
package com.fr.design.mainframe.widget.editors; |
||||||
|
|
||||||
|
import com.fr.design.designer.properties.EnumerationEditor; |
||||||
|
import com.fr.design.designer.properties.items.FRAbsoluteConstraintsItems; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by zhouping on 2016/8/1. |
||||||
|
*/ |
||||||
|
public class AbsoluteLayoutDirectionEditor extends EnumerationEditor { |
||||||
|
public AbsoluteLayoutDirectionEditor() { |
||||||
|
super(new FRAbsoluteConstraintsItems()); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue