|
|
@ -6,7 +6,10 @@ import com.fr.design.DesignState; |
|
|
|
import com.fr.design.designer.TargetComponent; |
|
|
|
import com.fr.design.designer.TargetComponent; |
|
|
|
import com.fr.design.designer.beans.AdapterBus; |
|
|
|
import com.fr.design.designer.beans.AdapterBus; |
|
|
|
import com.fr.design.designer.beans.Painter; |
|
|
|
import com.fr.design.designer.beans.Painter; |
|
|
|
|
|
|
|
import com.fr.design.designer.beans.actions.CopyAction; |
|
|
|
|
|
|
|
import com.fr.design.designer.beans.actions.CutAction; |
|
|
|
import com.fr.design.designer.beans.actions.FormDeleteAction; |
|
|
|
import com.fr.design.designer.beans.actions.FormDeleteAction; |
|
|
|
|
|
|
|
import com.fr.design.designer.beans.actions.PasteAction; |
|
|
|
import com.fr.design.designer.beans.adapters.layout.FRParameterLayoutAdapter; |
|
|
|
import com.fr.design.designer.beans.adapters.layout.FRParameterLayoutAdapter; |
|
|
|
import com.fr.design.designer.beans.events.CreatorEventListenerTable; |
|
|
|
import com.fr.design.designer.beans.events.CreatorEventListenerTable; |
|
|
|
import com.fr.design.designer.beans.events.DesignerEditListener; |
|
|
|
import com.fr.design.designer.beans.events.DesignerEditListener; |
|
|
@ -65,7 +68,7 @@ import java.util.List; |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 设计界面组件。该组件是界面设计工具的核心,主要负责的是被设计界面的显示,界面设计操作状态的 显示,编辑状态的显示等等。 |
|
|
|
* 设计界面组件。该组件是界面设计工具的核心,主要负责的是被设计界面的显示,界面设计操作状态的 显示,编辑状态的显示等等。 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class FormDesigner extends TargetComponent<Form> implements TreeSelectionListener, InvocationHandler, BaseFormDesigner ,ParaDefinitePane{ |
|
|
|
public class FormDesigner extends TargetComponent<Form> implements TreeSelectionListener, InvocationHandler, BaseFormDesigner, ParaDefinitePane { |
|
|
|
protected static final ArrayList<String> NAME_ARRAY_LIST = new ArrayList<String>( |
|
|
|
protected static final ArrayList<String> NAME_ARRAY_LIST = new ArrayList<String>( |
|
|
|
Arrays.asList(new String[]{Inter.getLocText("M_Edit-Cut"), Inter.getLocText("M_Edit-Copy"), Inter.getLocText("M_Edit-Delete")}) |
|
|
|
Arrays.asList(new String[]{Inter.getLocText("M_Edit-Cut"), Inter.getLocText("M_Edit-Copy"), Inter.getLocText("M_Edit-Delete")}) |
|
|
|
); |
|
|
|
); |
|
|
@ -159,7 +162,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
ParameterPropertyPane.getInstance().populateBean(this); |
|
|
|
ParameterPropertyPane.getInstance().populateBean(this); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Parameter[] getNoRepeatParas(Parameter[] paras){ |
|
|
|
public Parameter[] getNoRepeatParas(Parameter[] paras) { |
|
|
|
List<Parameter> paraList = new ArrayList<Parameter>(); |
|
|
|
List<Parameter> paraList = new ArrayList<Parameter>(); |
|
|
|
java.util.Set set = new java.util.HashSet(); |
|
|
|
java.util.Set set = new java.util.HashSet(); |
|
|
|
for (Parameter p : paras) { |
|
|
|
for (Parameter p : paras) { |
|
|
@ -171,23 +174,23 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
return paraList.toArray(new Parameter[paraList.size()]); |
|
|
|
return paraList.toArray(new Parameter[paraList.size()]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setParameterArray(Parameter[] ps){ |
|
|
|
public void setParameterArray(Parameter[] ps) { |
|
|
|
parameterArray = ps; |
|
|
|
parameterArray = ps; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Parameter[] getParameterArray(){ |
|
|
|
public Parameter[] getParameterArray() { |
|
|
|
return parameterArray; |
|
|
|
return parameterArray; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 刷新参数 |
|
|
|
* 刷新参数 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void refreshParameter(){ |
|
|
|
public void refreshParameter() { |
|
|
|
XLayoutContainer rootContainer = this.getParaComponent(); |
|
|
|
XLayoutContainer rootContainer = this.getParaComponent(); |
|
|
|
if (rootContainer != null){ |
|
|
|
if (rootContainer != null) { |
|
|
|
java.util.List<String> namelist = new ArrayList<String>(); |
|
|
|
java.util.List<String> namelist = new ArrayList<String>(); |
|
|
|
rootContainer.getAllXCreatorNameList(rootContainer,namelist); |
|
|
|
rootContainer.getAllXCreatorNameList(rootContainer, namelist); |
|
|
|
// parameterArray是报表的所有参数, nameList是已经在参数面板添加过控件的参数名
|
|
|
|
// parameterArray是报表的所有参数, nameList是已经在参数面板添加过控件的参数名
|
|
|
|
// 与已有的参数列表比较 如果已经存在 就除去
|
|
|
|
// 与已有的参数列表比较 如果已经存在 就除去
|
|
|
|
Parameter[] ps = getParameterArray(); |
|
|
|
Parameter[] ps = getParameterArray(); |
|
|
@ -201,7 +204,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance(this).getPreferredSize().height); |
|
|
|
EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance(this).getPreferredSize().height); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void removeSame(Parameter[] parameters, List<String> namelist){ |
|
|
|
private void removeSame(Parameter[] parameters, List<String> namelist) { |
|
|
|
for (Parameter parameter : parameters) { |
|
|
|
for (Parameter parameter : parameters) { |
|
|
|
for (String name : namelist) { |
|
|
|
for (String name : namelist) { |
|
|
|
if (name.equalsIgnoreCase(parameter.getName())) { |
|
|
|
if (name.equalsIgnoreCase(parameter.getName())) { |
|
|
@ -214,20 +217,22 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 是否有查询按钮 |
|
|
|
* 是否有查询按钮 |
|
|
|
* @return 有无查询按钮 |
|
|
|
* |
|
|
|
|
|
|
|
* @return 有无查询按钮 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean isWithQueryButton(){ |
|
|
|
public boolean isWithQueryButton() { |
|
|
|
XLayoutContainer rootContainer = this.getParaComponent(); |
|
|
|
XLayoutContainer rootContainer = this.getParaComponent(); |
|
|
|
return rootContainer != null && rootContainer.SearchQueryCreators(rootContainer); |
|
|
|
return rootContainer != null && rootContainer.SearchQueryCreators(rootContainer); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 加入参数到参数面板 |
|
|
|
* 加入参数到参数面板 |
|
|
|
|
|
|
|
* |
|
|
|
* @param parameter 参数 |
|
|
|
* @param parameter 参数 |
|
|
|
* @return 是否加入 |
|
|
|
* @return 是否加入 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void addingParameter2Editor(Parameter parameter){ |
|
|
|
public void addingParameter2Editor(Parameter parameter) { |
|
|
|
if(getParaComponent() == null){ |
|
|
|
if (getParaComponent() == null) { |
|
|
|
addParaPaneTooltips(); |
|
|
|
addParaPaneTooltips(); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -242,11 +247,11 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
if (!(this.autoAddComponent(xLabel, H_COMPONENT_GAP * (currentIndex % NUM_IN_A_LINE) |
|
|
|
if (!(this.autoAddComponent(xLabel, H_COMPONENT_GAP * (currentIndex % NUM_IN_A_LINE) |
|
|
|
+ FIRST_H_LOCATION, FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { |
|
|
|
+ FIRST_H_LOCATION, FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { |
|
|
|
return ; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (!(this.autoAddComponent(xCreator, H_COMPONENT_GAP * (currentIndex % NUM_IN_A_LINE) |
|
|
|
if (!(this.autoAddComponent(xCreator, H_COMPONENT_GAP * (currentIndex % NUM_IN_A_LINE) |
|
|
|
+ SECOND_H_LOCATION, FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { |
|
|
|
+ SECOND_H_LOCATION, FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { |
|
|
|
return ; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
currentIndex++; |
|
|
|
currentIndex++; |
|
|
|
parameterArray = (Parameter[]) ArrayUtils.removeElement(parameterArray, parameter); |
|
|
|
parameterArray = (Parameter[]) ArrayUtils.removeElement(parameterArray, parameter); |
|
|
@ -256,11 +261,12 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 加入参数到参数面板,有查询按钮 |
|
|
|
* 加入参数到参数面板,有查询按钮 |
|
|
|
|
|
|
|
* |
|
|
|
* @param parameter 参数 |
|
|
|
* @param parameter 参数 |
|
|
|
* @return 是否加入 |
|
|
|
* @return 是否加入 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void addingParameter2EditorWithQueryButton(Parameter parameter){ |
|
|
|
public void addingParameter2EditorWithQueryButton(Parameter parameter) { |
|
|
|
if(getParaComponent() == null){ |
|
|
|
if (getParaComponent() == null) { |
|
|
|
addParaPaneTooltips(); |
|
|
|
addParaPaneTooltips(); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -276,12 +282,12 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
if (!(this.autoAddComponent(xLabel, FIRST_H_LOCATION, FIRST_V_LOCATION + V_COMPONENT_GAP |
|
|
|
if (!(this.autoAddComponent(xLabel, FIRST_H_LOCATION, FIRST_V_LOCATION + V_COMPONENT_GAP |
|
|
|
* (currentIndex / NUM_IN_A_LINE)))) { |
|
|
|
* (currentIndex / NUM_IN_A_LINE)))) { |
|
|
|
return ; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!(this.autoAddComponent(xCreator, SECOND_H_LOCATION, FIRST_V_LOCATION + V_COMPONENT_GAP |
|
|
|
if (!(this.autoAddComponent(xCreator, SECOND_H_LOCATION, FIRST_V_LOCATION + V_COMPONENT_GAP |
|
|
|
* (currentIndex / NUM_IN_A_LINE)))) { |
|
|
|
* (currentIndex / NUM_IN_A_LINE)))) { |
|
|
|
return ; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
FormSubmitButton formSubmitButton = new FormSubmitButton(); |
|
|
|
FormSubmitButton formSubmitButton = new FormSubmitButton(); |
|
|
|
formSubmitButton.setWidgetName("Search"); |
|
|
|
formSubmitButton.setWidgetName("Search"); |
|
|
@ -289,7 +295,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
xCreator = XCreatorUtils.createXCreator(formSubmitButton); |
|
|
|
xCreator = XCreatorUtils.createXCreator(formSubmitButton); |
|
|
|
if (!(this.autoAddComponent(xCreator, 270, FIRST_V_LOCATION + V_COMPONENT_GAP |
|
|
|
if (!(this.autoAddComponent(xCreator, 270, FIRST_V_LOCATION + V_COMPONENT_GAP |
|
|
|
* (currentIndex / NUM_IN_A_LINE)))) { |
|
|
|
* (currentIndex / NUM_IN_A_LINE)))) { |
|
|
|
return ; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
currentIndex = currentIndex + NUM_IN_A_LINE - currentIndex % NUM_IN_A_LINE; |
|
|
|
currentIndex = currentIndex + NUM_IN_A_LINE - currentIndex % NUM_IN_A_LINE; |
|
|
|
parameterArray = (Parameter[]) ArrayUtils.removeElement(parameterArray, parameter); |
|
|
|
parameterArray = (Parameter[]) ArrayUtils.removeElement(parameterArray, parameter); |
|
|
@ -300,8 +306,8 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 一键添加所有参数 |
|
|
|
* 一键添加所有参数 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void addingAllParameter2Editor(){ |
|
|
|
public void addingAllParameter2Editor() { |
|
|
|
if(getParaComponent() == null){ |
|
|
|
if (getParaComponent() == null) { |
|
|
|
addParaPaneTooltips(); |
|
|
|
addParaPaneTooltips(); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -350,16 +356,17 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
EastRegionContainerPane.getInstance().refreshDownPane(); |
|
|
|
EastRegionContainerPane.getInstance().refreshDownPane(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void addParaPaneTooltips(){ |
|
|
|
private void addParaPaneTooltips() { |
|
|
|
JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(),Inter.getLocText("FR-Designer-Form-Please_Drag_ParaPane"), |
|
|
|
JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("FR-Designer-Form-Please_Drag_ParaPane"), |
|
|
|
Inter.getLocText("FR-Designer_Tooltips"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); |
|
|
|
Inter.getLocText("FR-Designer_Tooltips"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 自动添加组件 |
|
|
|
* 自动添加组件 |
|
|
|
* @param xCreator 组件 |
|
|
|
* |
|
|
|
* @param x 横坐标 |
|
|
|
* @param xCreator 组件 |
|
|
|
* @param y 纵坐标 |
|
|
|
* @param x 横坐标 |
|
|
|
|
|
|
|
* @param y 纵坐标 |
|
|
|
* @return 是否添加成功 |
|
|
|
* @return 是否添加成功 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean autoAddComponent(XCreator xCreator, int x, int y) { |
|
|
|
public boolean autoAddComponent(XCreator xCreator, int x, int y) { |
|
|
@ -375,10 +382,11 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 在参数很多时,全部添加的时候,可以向下一次排版,若去掉就会在参数面板堆到一起 |
|
|
|
* 在参数很多时,全部添加的时候,可以向下一次排版,若去掉就会在参数面板堆到一起 |
|
|
|
|
|
|
|
* |
|
|
|
* @param creator 组件 |
|
|
|
* @param creator 组件 |
|
|
|
* @param x 长度 |
|
|
|
* @param x 长度 |
|
|
|
* @param y 长度 |
|
|
|
* @param y 长度 |
|
|
|
* @param layout 布局 |
|
|
|
* @param layout 布局 |
|
|
|
* @return 是否扩展 |
|
|
|
* @return 是否扩展 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean prepareForAdd(XCreator creator, int x, int y, XWParameterLayout layout) { |
|
|
|
public boolean prepareForAdd(XCreator creator, int x, int y, XWParameterLayout layout) { |
|
|
@ -404,9 +412,9 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 加入参数面板 |
|
|
|
* 加入参数面板 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void addParaComponent(){ |
|
|
|
public void addParaComponent() { |
|
|
|
if (paraComponent != null) { |
|
|
|
if (paraComponent != null) { |
|
|
|
return ; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
paraHeight = WBorderLayout.DEFAULT_SIZE; |
|
|
|
paraHeight = WBorderLayout.DEFAULT_SIZE; |
|
|
|
paraComponent = new XWParameterLayout(); |
|
|
|
paraComponent = new XWParameterLayout(); |
|
|
@ -414,7 +422,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
paraComponent.setSize(paraComponent.initEditorSize()); |
|
|
|
paraComponent.setSize(paraComponent.initEditorSize()); |
|
|
|
XWBorderLayout formLayoutContainer = (XWBorderLayout) rootComponent.getParent(); |
|
|
|
XWBorderLayout formLayoutContainer = (XWBorderLayout) rootComponent.getParent(); |
|
|
|
formLayoutContainer.toData().setNorthSize(paraHeight); |
|
|
|
formLayoutContainer.toData().setNorthSize(paraHeight); |
|
|
|
formLayoutContainer.add(paraComponent,WBorderLayout.NORTH); |
|
|
|
formLayoutContainer.add(paraComponent, WBorderLayout.NORTH); |
|
|
|
//设下northSize,增加para后,重置border大小,这时候para和root的大小会自适应调整
|
|
|
|
//设下northSize,增加para后,重置border大小,这时候para和root的大小会自适应调整
|
|
|
|
formLayoutContainer.setSize(formLayoutContainer.getWidth(), formLayoutContainer.getHeight() + paraHeight); |
|
|
|
formLayoutContainer.setSize(formLayoutContainer.getWidth(), formLayoutContainer.getHeight() + paraHeight); |
|
|
|
selectionModel.reset(); |
|
|
|
selectionModel.reset(); |
|
|
@ -424,30 +432,33 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 返回根节点父容器 |
|
|
|
* 返回根节点父容器 |
|
|
|
* @return 父容器 |
|
|
|
* |
|
|
|
|
|
|
|
* @return 父容器 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public Component getTopContainer(){ |
|
|
|
public Component getTopContainer() { |
|
|
|
if(rootComponent != null){ |
|
|
|
if (rootComponent != null) { |
|
|
|
// 返回root所在的父容器,非designer
|
|
|
|
// 返回root所在的父容器,非designer
|
|
|
|
return LayoutUtils.getTopContainer(rootComponent); |
|
|
|
return LayoutUtils.getTopContainer(rootComponent); |
|
|
|
} |
|
|
|
} |
|
|
|
return XCreatorUtils.createXCreator(this.getTarget().getContainer()); |
|
|
|
return XCreatorUtils.createXCreator(this.getTarget().getContainer()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 返回参数界面高度 |
|
|
|
* 返回参数界面高度 |
|
|
|
* @return para高度 |
|
|
|
* |
|
|
|
|
|
|
|
* @return para高度 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public int getParaHeight(){ |
|
|
|
public int getParaHeight() { |
|
|
|
return paraHeight; |
|
|
|
return paraHeight; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 重置para的高度 |
|
|
|
* 重置para的高度 |
|
|
|
* @param height 高度 |
|
|
|
* |
|
|
|
|
|
|
|
* @param height 高度 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setParaHeight(int height){ |
|
|
|
public void setParaHeight(int height) { |
|
|
|
XWBorderLayout container = (XWBorderLayout) getTopContainer(); |
|
|
|
XWBorderLayout container = (XWBorderLayout) getTopContainer(); |
|
|
|
container.toData().setNorthSize(height); |
|
|
|
container.toData().setNorthSize(height); |
|
|
|
container.setSize(container.getWidth(), container.getHeight() + height - getParaHeight()); |
|
|
|
container.setSize(container.getWidth(), container.getHeight() + height - getParaHeight()); |
|
|
@ -457,7 +468,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 删除参数界面 |
|
|
|
* 删除参数界面 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void removeParaComponent(){ |
|
|
|
public void removeParaComponent() { |
|
|
|
XWBorderLayout formLayoutContainer = (XWBorderLayout) getTopContainer(); |
|
|
|
XWBorderLayout formLayoutContainer = (XWBorderLayout) getTopContainer(); |
|
|
|
formLayoutContainer.toData().removeWidget(paraComponent.toData()); |
|
|
|
formLayoutContainer.toData().removeWidget(paraComponent.toData()); |
|
|
|
paraHeight = 0; |
|
|
|
paraHeight = 0; |
|
|
@ -472,41 +483,42 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 切换 |
|
|
|
* 切换 |
|
|
|
* @param elementCaseContainer 容器 |
|
|
|
* |
|
|
|
|
|
|
|
* @param elementCaseContainer 容器 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void switchTab(FormElementCaseContainerProvider elementCaseContainer){ |
|
|
|
public void switchTab(FormElementCaseContainerProvider elementCaseContainer) { |
|
|
|
if(this.switchAction == null){ |
|
|
|
if (this.switchAction == null) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
this.elementCaseContainer = elementCaseContainer; |
|
|
|
this.elementCaseContainer = elementCaseContainer; |
|
|
|
this.switchAction.actionPerformed(null); |
|
|
|
this.switchAction.actionPerformed(null); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setElementCaseContainer(FormElementCaseContainerProvider elementCaseContainer){ |
|
|
|
public void setElementCaseContainer(FormElementCaseContainerProvider elementCaseContainer) { |
|
|
|
this.elementCaseContainer = elementCaseContainer; |
|
|
|
this.elementCaseContainer = elementCaseContainer; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public FormElementCaseProvider getElementCase(){ |
|
|
|
public FormElementCaseProvider getElementCase() { |
|
|
|
return this.elementCaseContainer.getElementCase(); |
|
|
|
return this.elementCaseContainer.getElementCase(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getElementCaseContainerName(){ |
|
|
|
public String getElementCaseContainerName() { |
|
|
|
return this.elementCaseContainer.getElementCaseContainerName(); |
|
|
|
return this.elementCaseContainer.getElementCaseContainerName(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setElementCase(FormElementCaseProvider elementCase){ |
|
|
|
public void setElementCase(FormElementCaseProvider elementCase) { |
|
|
|
this.elementCaseContainer.setElementCase(elementCase); |
|
|
|
this.elementCaseContainer.setElementCase(elementCase); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setElementCaseBackground(BufferedImage image){ |
|
|
|
public void setElementCaseBackground(BufferedImage image) { |
|
|
|
this.elementCaseContainer.setBackground(image); |
|
|
|
this.elementCaseContainer.setBackground(image); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Dimension getElementCaseContainerSize(){ |
|
|
|
public Dimension getElementCaseContainerSize() { |
|
|
|
return this.elementCaseContainer.getSize(); |
|
|
|
return this.elementCaseContainer.getSize(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public FormElementCaseContainerProvider getElementCaseContainer(){ |
|
|
|
public FormElementCaseContainerProvider getElementCaseContainer() { |
|
|
|
return this.elementCaseContainer; |
|
|
|
return this.elementCaseContainer; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -524,6 +536,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 增加监听事件 |
|
|
|
* 增加监听事件 |
|
|
|
|
|
|
|
* |
|
|
|
* @param listener 界面组件编辑事件 |
|
|
|
* @param listener 界面组件编辑事件 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void addDesignerEditListener(DesignerEditListener listener) { |
|
|
|
public void addDesignerEditListener(DesignerEditListener listener) { |
|
|
@ -539,15 +552,15 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 表单则判断参数面板是否为绝对布局 |
|
|
|
* 表单则判断参数面板是否为绝对布局 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 是则返回true |
|
|
|
* @return 是则返回true |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean hasWAbsoluteLayout() { |
|
|
|
public boolean hasWAbsoluteLayout() { |
|
|
|
if (paraComponent != null && paraComponent.acceptType(XWParameterLayout.class)){ |
|
|
|
if (paraComponent != null && paraComponent.acceptType(XWParameterLayout.class)) { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} else { |
|
|
|
else{ |
|
|
|
|
|
|
|
if (this.getSelectionModel().getSelection().getSelectedCreator().getParent() != null |
|
|
|
if (this.getSelectionModel().getSelection().getSelectedCreator().getParent() != null |
|
|
|
&& ((XLayoutContainer)this.getSelectionModel().getSelection().getSelectedCreator().getParent()).acceptType(XWAbsoluteLayout.class)){ |
|
|
|
&& ((XLayoutContainer) this.getSelectionModel().getSelection().getSelectedCreator().getParent()).acceptType(XWAbsoluteLayout.class)) { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -555,7 +568,8 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 设置是否为报表块编辑 |
|
|
|
* 设置是否为报表块编辑 |
|
|
|
|
|
|
|
* |
|
|
|
* @param isEditing 是否为报表块编辑 |
|
|
|
* @param isEditing 是否为报表块编辑 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setReportBlockEditing(boolean isEditing) { |
|
|
|
public void setReportBlockEditing(boolean isEditing) { |
|
|
@ -564,25 +578,27 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 是否为报表块编辑 |
|
|
|
* 是否为报表块编辑 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 是否为报表块编辑 |
|
|
|
* @return 是否为报表块编辑 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean isReportBlockEditing() { |
|
|
|
public boolean isReportBlockEditing() { |
|
|
|
return this.isReportBlockEditing; |
|
|
|
return this.isReportBlockEditing; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setWidgetsIntersect(boolean isWidgetsIntersect){ |
|
|
|
public void setWidgetsIntersect(boolean isWidgetsIntersect) { |
|
|
|
this.isWidgetsIntersect = isWidgetsIntersect; |
|
|
|
this.isWidgetsIntersect = isWidgetsIntersect; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean isWidgetsIntersect(){ |
|
|
|
public boolean isWidgetsIntersect() { |
|
|
|
return this.isWidgetsIntersect; |
|
|
|
return this.isWidgetsIntersect; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 是否重命名控件 |
|
|
|
* 是否重命名控件 |
|
|
|
|
|
|
|
* |
|
|
|
* @param creator 组件 |
|
|
|
* @param creator 组件 |
|
|
|
* @param newName 新的组件名 |
|
|
|
* @param newName 新的组件名 |
|
|
|
* @return 组件名有变化,且不和其他一样返回true |
|
|
|
* @return 组件名有变化,且不和其他一样返回true |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean renameCreator(XCreator creator, String newName) { |
|
|
|
public boolean renameCreator(XCreator creator, String newName) { |
|
|
|
if (ComparatorUtils.equals(creator.toData().getWidgetName(), newName)) { |
|
|
|
if (ComparatorUtils.equals(creator.toData().getWidgetName(), newName)) { |
|
|
@ -609,16 +625,17 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 更新界面布局,重绘 |
|
|
|
* 更新界面布局,重绘 |
|
|
|
* @param proxy 动态代理类 |
|
|
|
* |
|
|
|
|
|
|
|
* @param proxy 动态代理类 |
|
|
|
* @param method 接口方法 |
|
|
|
* @param method 接口方法 |
|
|
|
* @param args 参数 |
|
|
|
* @param args 参数 |
|
|
|
* @return 不返回任何对象 |
|
|
|
* @return 不返回任何对象 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { |
|
|
|
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { |
|
|
|
if(rootComponent != null){ |
|
|
|
if (rootComponent != null) { |
|
|
|
LayoutUtils.layoutRootContainer(rootComponent); |
|
|
|
LayoutUtils.layoutRootContainer(rootComponent); |
|
|
|
} |
|
|
|
} |
|
|
|
if(paraComponent != null){ |
|
|
|
if (paraComponent != null) { |
|
|
|
LayoutUtils.layoutRootContainer(paraComponent); |
|
|
|
LayoutUtils.layoutRootContainer(paraComponent); |
|
|
|
} |
|
|
|
} |
|
|
|
repaint(); |
|
|
|
repaint(); |
|
|
@ -654,6 +671,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 增加组件事件 |
|
|
|
* 增加组件事件 |
|
|
|
|
|
|
|
* |
|
|
|
* @param h 动态代理 |
|
|
|
* @param h 动态代理 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void addInvocationHandler(InvocationHandler h) { |
|
|
|
public void addInvocationHandler(InvocationHandler h) { |
|
|
@ -678,7 +696,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 设置其UI类为DesignerUI,负责渲染 |
|
|
|
* 设置其UI类为DesignerUI,负责渲染 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void updateUI() { |
|
|
|
public void updateUI() { |
|
|
@ -741,6 +759,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 更新边框线状态 |
|
|
|
* 更新边框线状态 |
|
|
|
|
|
|
|
* |
|
|
|
* @param e 鼠标事件 |
|
|
|
* @param e 鼠标事件 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void updateDrawLineMode(MouseEvent e) { |
|
|
|
public void updateDrawLineMode(MouseEvent e) { |
|
|
@ -761,7 +780,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
// 撤销恢复操作都会refreshRoot,这时候的target.getContainer里的widget会和之前不一样,所以不用root判断来取
|
|
|
|
// 撤销恢复操作都会refreshRoot,这时候的target.getContainer里的widget会和之前不一样,所以不用root判断来取
|
|
|
|
XLayoutContainer formLayoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(this.getTarget().getContainer()); |
|
|
|
XLayoutContainer formLayoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(this.getTarget().getContainer()); |
|
|
|
// 布局默认都是1,底层的border改为0,不然没意义
|
|
|
|
// 布局默认都是1,底层的border改为0,不然没意义
|
|
|
|
this.getTarget().getContainer().setMargin(new PaddingMargin(0,0,0,0)); |
|
|
|
this.getTarget().getContainer().setMargin(new PaddingMargin(0, 0, 0, 0)); |
|
|
|
formLayoutContainer.setBorder(null); |
|
|
|
formLayoutContainer.setBorder(null); |
|
|
|
if (formLayoutContainer.acceptType(XWBorderLayout.class)) { |
|
|
|
if (formLayoutContainer.acceptType(XWBorderLayout.class)) { |
|
|
|
WBorderLayout borderLayout = (WBorderLayout) formLayoutContainer.toData(); |
|
|
|
WBorderLayout borderLayout = (WBorderLayout) formLayoutContainer.toData(); |
|
|
@ -774,7 +793,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
refreshNorth(northWidget, formLayoutContainer); |
|
|
|
refreshNorth(northWidget, formLayoutContainer); |
|
|
|
refreshCenter(centerWidget, formLayoutContainer); |
|
|
|
refreshCenter(centerWidget, formLayoutContainer); |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
formLayoutContainer.setSize(LARGE_PREFERRED_SIZE); |
|
|
|
formLayoutContainer.setSize(LARGE_PREFERRED_SIZE); |
|
|
|
setRootComponent(formLayoutContainer); |
|
|
|
setRootComponent(formLayoutContainer); |
|
|
|
} |
|
|
|
} |
|
|
@ -790,9 +809,9 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
XLayoutContainer northContainer = (XLayoutContainer) XCreatorUtils.createXCreator(northWidget); |
|
|
|
XLayoutContainer northContainer = (XLayoutContainer) XCreatorUtils.createXCreator(northWidget); |
|
|
|
paraHeight = ((XWBorderLayout)formLayoutContainer).toData().getNorthSize(); |
|
|
|
paraHeight = ((XWBorderLayout) formLayoutContainer).toData().getNorthSize(); |
|
|
|
paraComponent = northContainer; |
|
|
|
paraComponent = northContainer; |
|
|
|
northContainer.setSize(0,paraHeight); |
|
|
|
northContainer.setSize(0, paraHeight); |
|
|
|
formLayoutContainer.add(northContainer, WBorderLayout.NORTH); |
|
|
|
formLayoutContainer.add(northContainer, WBorderLayout.NORTH); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -841,14 +860,16 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 是否是报表的参数面板 |
|
|
|
* 是否是报表的参数面板 |
|
|
|
* @return 否(表单的) |
|
|
|
* |
|
|
|
|
|
|
|
* @return 否(表单的) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean isFormParaDesigner(){ |
|
|
|
public boolean isFormParaDesigner() { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 是否为底层容器 |
|
|
|
* 是否为底层容器 |
|
|
|
|
|
|
|
* |
|
|
|
* @param comp 组件 |
|
|
|
* @param comp 组件 |
|
|
|
* @return 是则返回true |
|
|
|
* @return 是则返回true |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -923,10 +944,10 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public SelectionModel getSelectionModel() { |
|
|
|
public SelectionModel getSelectionModel() { |
|
|
|
if (paraComponent!=null){ |
|
|
|
if (paraComponent != null) { |
|
|
|
paraComponent.setSize(paraComponent.getWidth(),getParaHeight()); |
|
|
|
paraComponent.setSize(paraComponent.getWidth(), getParaHeight()); |
|
|
|
Rectangle rec = rootComponent.getBounds(); |
|
|
|
Rectangle rec = rootComponent.getBounds(); |
|
|
|
rootComponent.setBounds(rec.x,getParaHeight(),rec.width,rec.height); |
|
|
|
rootComponent.setBounds(rec.x, getParaHeight(), rec.width, rec.height); |
|
|
|
} |
|
|
|
} |
|
|
|
return selectionModel; |
|
|
|
return selectionModel; |
|
|
|
} |
|
|
|
} |
|
|
@ -941,6 +962,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 拖拽准备 |
|
|
|
* 拖拽准备 |
|
|
|
|
|
|
|
* |
|
|
|
* @param xCreator 组件 |
|
|
|
* @param xCreator 组件 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void startDraggingBean(XCreator xCreator) { |
|
|
|
public void startDraggingBean(XCreator xCreator) { |
|
|
@ -953,11 +975,12 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 拖拽时相关处理 |
|
|
|
* 拖拽时相关处理 |
|
|
|
* @param xCreator 组件 |
|
|
|
* |
|
|
|
|
|
|
|
* @param xCreator 组件 |
|
|
|
* @param lastPressEvent 鼠标事件 |
|
|
|
* @param lastPressEvent 鼠标事件 |
|
|
|
* @param x 坐标x |
|
|
|
* @param x 坐标x |
|
|
|
* @param y 坐标y |
|
|
|
* @param y 坐标y |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void startDraggingComponent(XCreator xCreator, MouseEvent lastPressEvent, int x, int y) { |
|
|
|
public void startDraggingComponent(XCreator xCreator, MouseEvent lastPressEvent, int x, int y) { |
|
|
|
// 根据所选择的组件的BeanInfo生成相应的AddingModel
|
|
|
|
// 根据所选择的组件的BeanInfo生成相应的AddingModel
|
|
|
@ -978,6 +1001,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 改变组件值 |
|
|
|
* 改变组件值 |
|
|
|
|
|
|
|
* |
|
|
|
* @param e 组件选择事件 |
|
|
|
* @param e 组件选择事件 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -1024,6 +1048,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 是否支持权限编辑 |
|
|
|
* 是否支持权限编辑 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 是则返回true |
|
|
|
* @return 是则返回true |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean isSupportAuthority() { |
|
|
|
public boolean isSupportAuthority() { |
|
|
@ -1048,7 +1073,8 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 是否含有action名 |
|
|
|
* 是否含有action名 |
|
|
|
|
|
|
|
* |
|
|
|
* @param name action名 |
|
|
|
* @param name action名 |
|
|
|
* @return 有则返回true |
|
|
|
* @return 有则返回true |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -1058,6 +1084,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 显示组件 |
|
|
|
* 显示组件 |
|
|
|
|
|
|
|
* |
|
|
|
* @param comp 组件 |
|
|
|
* @param comp 组件 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void makeVisible(XCreator comp) { |
|
|
|
public void makeVisible(XCreator comp) { |
|
|
@ -1088,14 +1115,14 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 返回复制粘贴删除等动作 |
|
|
|
* 返回复制粘贴删除等动作 |
|
|
|
|
|
|
|
* 鼠标右键菜单 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 同上 |
|
|
|
* @return 同上 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public Action[] getActions() { |
|
|
|
public Action[] getActions() { |
|
|
|
if (designer_actions == null) { |
|
|
|
if (designer_actions == null) { |
|
|
|
//先把复制粘贴按钮去掉,只留下删除
|
|
|
|
designer_actions = new Action[]{new CutAction(this), new CopyAction(this), new PasteAction(this), |
|
|
|
// designer_actions = new Action[]{new CutAction(this), new CopyAction(this), new PasteAction(this),
|
|
|
|
new FormDeleteAction(this)}; |
|
|
|
// new FormDeleteAction(this)};
|
|
|
|
|
|
|
|
designer_actions = new Action[]{new FormDeleteAction(this)}; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return designer_actions; |
|
|
|
return designer_actions; |
|
|
|
} |
|
|
|
} |
|
|
@ -1120,6 +1147,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 返回表单区域 |
|
|
|
* 返回表单区域 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 表单区域 |
|
|
|
* @return 表单区域 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public FormArea getArea() { |
|
|
|
public FormArea getArea() { |
|
|
@ -1128,6 +1156,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 设置上层区域 |
|
|
|
* 设置上层区域 |
|
|
|
|
|
|
|
* |
|
|
|
* @param formArea 表单区域 |
|
|
|
* @param formArea 表单区域 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setParent(FormArea formArea) { |
|
|
|
public void setParent(FormArea formArea) { |
|
|
@ -1136,14 +1165,15 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 绘制组件根节点 |
|
|
|
* 绘制组件根节点 |
|
|
|
|
|
|
|
* |
|
|
|
* @param clipg 图形 |
|
|
|
* @param clipg 图形 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void paintContent(Graphics clipg) { |
|
|
|
public void paintContent(Graphics clipg) { |
|
|
|
rootComponent.paint(clipg); |
|
|
|
rootComponent.paint(clipg); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void paintPara(Graphics clipg){ |
|
|
|
public void paintPara(Graphics clipg) { |
|
|
|
if(paraComponent != null){ |
|
|
|
if (paraComponent != null) { |
|
|
|
paraComponent.paint(clipg); |
|
|
|
paraComponent.paint(clipg); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1157,6 +1187,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 返回连线类 |
|
|
|
* 返回连线类 |
|
|
|
|
|
|
|
* |
|
|
|
* @return ConnectorHelper类 |
|
|
|
* @return ConnectorHelper类 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public ConnectorHelper getDrawLineHelper() { |
|
|
|
public ConnectorHelper getDrawLineHelper() { |
|
|
@ -1164,7 +1195,8 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 是否画线模式 |
|
|
|
* 是否画线模式 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 是则返回true |
|
|
|
* @return 是则返回true |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean isDrawLineMode() { |
|
|
|
public boolean isDrawLineMode() { |
|
|
@ -1173,6 +1205,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 设置DrawLineMode |
|
|
|
* 设置DrawLineMode |
|
|
|
|
|
|
|
* |
|
|
|
* @param mode 是or或 |
|
|
|
* @param mode 是or或 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setDrawLineMode(boolean mode) { |
|
|
|
public void setDrawLineMode(boolean mode) { |
|
|
@ -1199,6 +1232,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 返回表单控件权限编辑pane |
|
|
|
* 返回表单控件权限编辑pane |
|
|
|
|
|
|
|
* |
|
|
|
* @return 同上 |
|
|
|
* @return 同上 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public AuthorityEditPane createAuthorityEditPane() { |
|
|
|
public AuthorityEditPane createAuthorityEditPane() { |
|
|
@ -1249,6 +1283,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 粘贴 |
|
|
|
* 粘贴 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 否 |
|
|
|
* @return 否 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -1259,6 +1294,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 剪切 |
|
|
|
* 剪切 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 否 |
|
|
|
* @return 否 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -1273,6 +1309,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 工具栏菜单 |
|
|
|
* 工具栏菜单 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 同上 |
|
|
|
* @return 同上 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -1286,6 +1323,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 模版菜单 |
|
|
|
* 模版菜单 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 同上 |
|
|
|
* @return 同上 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -1295,6 +1333,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 权限菜单 |
|
|
|
* 权限菜单 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 同上 |
|
|
|
* @return 同上 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public ShortCut[] shortCuts4Authority() { |
|
|
|
public ShortCut[] shortCuts4Authority() { |
|
|
@ -1304,6 +1343,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 返回ToolBarDef |
|
|
|
* 返回ToolBarDef |
|
|
|
|
|
|
|
* |
|
|
|
* @return 同上 |
|
|
|
* @return 同上 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -1313,10 +1353,12 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 返回工具栏按钮组件 |
|
|
|
* 返回工具栏按钮组件 |
|
|
|
|
|
|
|
* |
|
|
|
* @return 同上 |
|
|
|
* @return 同上 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public JComponent[] toolBarButton4Form() { |
|
|
|
public JComponent[] toolBarButton4Form() { |
|
|
|
return new JComponent[0]; |
|
|
|
return new JComponent[]{new CutAction(this).createToolBarComponent(), new CopyAction(this).createToolBarComponent(), new PasteAction(this).createToolBarComponent(), |
|
|
|
|
|
|
|
new FormDeleteAction(this).createToolBarComponent()}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|