|
|
@ -121,7 +121,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
private static final int H_GAP = 105; |
|
|
|
private static final int H_GAP = 105; |
|
|
|
|
|
|
|
|
|
|
|
public FormDesigner(Form form) { |
|
|
|
public FormDesigner(Form form) { |
|
|
|
this(form, null); |
|
|
|
this(form, null); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public FormDesigner(Form form, Action switchAction) { |
|
|
|
public FormDesigner(Form form, Action switchAction) { |
|
|
@ -186,14 +186,14 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
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(); |
|
|
|
if (ps != null) { |
|
|
|
if (ps != null) { |
|
|
|
removeSame(ps, namelist); |
|
|
|
removeSame(ps, namelist); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean( |
|
|
|
ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean( |
|
|
|
getParameterArray() == null ? new Parameter[0] : getParameterArray()); |
|
|
|
getParameterArray() == null ? new Parameter[0] : getParameterArray()); |
|
|
@ -201,15 +201,15 @@ 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())) { |
|
|
|
setParameterArray((Parameter[]) ArrayUtils.removeElement(getParameterArray(), parameter)); |
|
|
|
setParameterArray((Parameter[]) ArrayUtils.removeElement(getParameterArray(), parameter)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -405,10 +405,10 @@ 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(); |
|
|
|
paraComponent.toData().setWidgetName("para"); |
|
|
|
paraComponent.toData().setWidgetName("para"); |
|
|
|
paraComponent.setSize(paraComponent.initEditorSize()); |
|
|
|
paraComponent.setSize(paraComponent.initEditorSize()); |
|
|
@ -428,10 +428,10 @@ 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()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -448,9 +448,9 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
* @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()); |
|
|
|
paraHeight = height; |
|
|
|
paraHeight = height; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -475,39 +475,39 @@ 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; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected FormDesignerModeForSpecial<?> createFormDesignerTargetMode() { |
|
|
|
protected FormDesignerModeForSpecial<?> createFormDesignerTargetMode() { |
|
|
@ -604,7 +604,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
* @param width 指定的宽度 |
|
|
|
* @param width 指定的宽度 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void updateWidth(int width) { |
|
|
|
public void updateWidth(int width) { |
|
|
|
//TODO
|
|
|
|
//TODO
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -615,12 +615,12 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
* @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(); |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
@ -640,7 +640,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void fireCreatorModified(DesignerEvent evt) { |
|
|
|
public void fireCreatorModified(DesignerEvent evt) { |
|
|
|
// 只有选择组件时不触发模版更新,其他都要触发
|
|
|
|
// 只有选择组件时不触发模版更新,其他都要触发
|
|
|
|
if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) { |
|
|
|
if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) { |
|
|
|
FormDesigner.this.fireTargetModified(); |
|
|
|
FormDesigner.this.fireTargetModified(); |
|
|
|
//bug59192
|
|
|
|
//bug59192
|
|
|
@ -702,7 +702,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
* 从root组件递归查找x,y所在的组件,注意是正在被设计的组件,因此其name属性必须不为空 |
|
|
|
* 从root组件递归查找x,y所在的组件,注意是正在被设计的组件,因此其name属性必须不为空 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private XCreator xCreatorAt(int x, int y, XCreator root, XCreator[] except) { |
|
|
|
private XCreator xCreatorAt(int x, int y, XCreator root, XCreator[] except) { |
|
|
|
if (root == null || !root.isVisible()) { |
|
|
|
if (root == null || !root.isVisible()) { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
x -= root.getX(); |
|
|
|
x -= root.getX(); |
|
|
@ -758,21 +758,21 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
* 刷新底层容器 |
|
|
|
* 刷新底层容器 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void refreshRoot() { |
|
|
|
public void refreshRoot() { |
|
|
|
// 撤销恢复操作都会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(); |
|
|
|
|
|
|
|
|
|
|
|
Widget northWidget = borderLayout.getLayoutWidget(WBorderLayout.NORTH); |
|
|
|
Widget northWidget = borderLayout.getLayoutWidget(WBorderLayout.NORTH); |
|
|
|
Widget centerWidget = borderLayout.getLayoutWidget(WBorderLayout.CENTER); |
|
|
|
Widget centerWidget = borderLayout.getLayoutWidget(WBorderLayout.CENTER); |
|
|
|
//本身含有,这儿得先清空再加
|
|
|
|
//本身含有,这儿得先清空再加
|
|
|
|
formLayoutContainer.removeAll(); |
|
|
|
formLayoutContainer.removeAll(); |
|
|
|
|
|
|
|
|
|
|
|
refreshNorth(northWidget, formLayoutContainer); |
|
|
|
refreshNorth(northWidget, formLayoutContainer); |
|
|
|
refreshCenter(centerWidget, formLayoutContainer); |
|
|
|
refreshCenter(centerWidget, formLayoutContainer); |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
formLayoutContainer.setSize(LARGE_PREFERRED_SIZE); |
|
|
|
formLayoutContainer.setSize(LARGE_PREFERRED_SIZE); |
|
|
@ -781,43 +781,43 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void refreshNorth(Widget northWidget, XLayoutContainer formLayoutContainer) { |
|
|
|
private void refreshNorth(Widget northWidget, XLayoutContainer formLayoutContainer) { |
|
|
|
// 如果没有参数界面, 那么就处理下高度以及参数界面的按钮要点亮
|
|
|
|
// 如果没有参数界面, 那么就处理下高度以及参数界面的按钮要点亮
|
|
|
|
if (northWidget == null) { |
|
|
|
if (northWidget == null) { |
|
|
|
paraComponent = null; |
|
|
|
paraComponent = null; |
|
|
|
paraHeight = 0; |
|
|
|
paraHeight = 0; |
|
|
|
FormParaWidgetPane.getInstance(this); |
|
|
|
FormParaWidgetPane.getInstance(this); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
XLayoutContainer northContainer = (XLayoutContainer) XCreatorUtils.createXCreator(northWidget); |
|
|
|
|
|
|
|
paraHeight = ((XWBorderLayout)formLayoutContainer).toData().getNorthSize(); |
|
|
|
|
|
|
|
paraComponent = northContainer; |
|
|
|
|
|
|
|
northContainer.setSize(0,paraHeight); |
|
|
|
|
|
|
|
formLayoutContainer.add(northContainer, WBorderLayout.NORTH); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void refreshCenter(Widget centerWidget, XLayoutContainer formLayoutContainer) { |
|
|
|
|
|
|
|
// 不存在center块, 说明是新建的模板
|
|
|
|
|
|
|
|
if (centerWidget == null) { |
|
|
|
|
|
|
|
XLayoutContainer layoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(new WFitLayout("body")); |
|
|
|
|
|
|
|
layoutContainer.setSize(LARGE_PREFERRED_SIZE); |
|
|
|
|
|
|
|
setRootComponent(layoutContainer); |
|
|
|
|
|
|
|
formLayoutContainer.add(rootComponent, WBorderLayout.CENTER); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
XLayoutContainer centerContainer = (XLayoutContainer) XCreatorUtils.createXCreator(centerWidget); |
|
|
|
|
|
|
|
Dimension d = new Dimension(); |
|
|
|
|
|
|
|
d.width = ((WFitLayout) centerWidget).getContainerWidth(); |
|
|
|
|
|
|
|
d.height = ((WFitLayout) centerWidget).getContainerHeight(); |
|
|
|
|
|
|
|
centerContainer.setSize(d); |
|
|
|
|
|
|
|
formLayoutContainer.setSize(d.width, d.height + paraHeight); |
|
|
|
|
|
|
|
setRootComponent(centerContainer); |
|
|
|
|
|
|
|
// 再次打开时,layout下root,有内边距的话组件加上
|
|
|
|
|
|
|
|
LayoutUtils.layoutContainer(centerContainer); |
|
|
|
|
|
|
|
formLayoutContainer.add(rootComponent, WBorderLayout.CENTER); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
XLayoutContainer northContainer = (XLayoutContainer) XCreatorUtils.createXCreator(northWidget); |
|
|
|
|
|
|
|
paraHeight = ((XWBorderLayout)formLayoutContainer).toData().getNorthSize(); |
|
|
|
|
|
|
|
paraComponent = northContainer; |
|
|
|
|
|
|
|
northContainer.setSize(0,paraHeight); |
|
|
|
|
|
|
|
formLayoutContainer.add(northContainer, WBorderLayout.NORTH); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void refreshCenter(Widget centerWidget, XLayoutContainer formLayoutContainer) { |
|
|
|
|
|
|
|
// 不存在center块, 说明是新建的模板
|
|
|
|
|
|
|
|
if (centerWidget == null) { |
|
|
|
|
|
|
|
XLayoutContainer layoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(new WFitLayout("body")); |
|
|
|
|
|
|
|
layoutContainer.setSize(LARGE_PREFERRED_SIZE); |
|
|
|
|
|
|
|
setRootComponent(layoutContainer); |
|
|
|
|
|
|
|
formLayoutContainer.add(rootComponent, WBorderLayout.CENTER); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
XLayoutContainer centerContainer = (XLayoutContainer) XCreatorUtils.createXCreator(centerWidget); |
|
|
|
|
|
|
|
Dimension d = new Dimension(); |
|
|
|
|
|
|
|
d.width = ((WFitLayout) centerWidget).getContainerWidth(); |
|
|
|
|
|
|
|
d.height = ((WFitLayout) centerWidget).getContainerHeight(); |
|
|
|
|
|
|
|
centerContainer.setSize(d); |
|
|
|
|
|
|
|
formLayoutContainer.setSize(d.width, d.height + paraHeight); |
|
|
|
|
|
|
|
setRootComponent(centerContainer); |
|
|
|
|
|
|
|
// 再次打开时,layout下root,有内边距的话组件加上
|
|
|
|
|
|
|
|
LayoutUtils.layoutContainer(centerContainer); |
|
|
|
|
|
|
|
formLayoutContainer.add(rootComponent, WBorderLayout.CENTER); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected Insets getOutlineInsets() { |
|
|
|
protected Insets getOutlineInsets() { |
|
|
|
return new Insets(10, 10, 10, 10); |
|
|
|
return new Insets(10, 10, 10, 10); |
|
|
@ -962,8 +962,8 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
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
|
|
|
|
// AddingModel和StateModel不一样,适合当前选择的组件相关的
|
|
|
|
// AddingModel和StateModel不一样,适合当前选择的组件相关的
|
|
|
|
int creatorWidth = xCreator.getWidth(); |
|
|
|
int creatorWidth = xCreator.getWidth(); |
|
|
|
int creatorHeight = xCreator.getHeight(); |
|
|
|
int creatorHeight = xCreator.getHeight(); |
|
|
|
this.addingModel = new AddingModel(xCreator, x, y); |
|
|
|
this.addingModel = new AddingModel(xCreator, x, y); |
|
|
|
TransferHandler handler = new DesignerTransferHandler(this, addingModel); |
|
|
|
TransferHandler handler = new DesignerTransferHandler(this, addingModel); |
|
|
|
setTransferHandler(handler); |
|
|
|
setTransferHandler(handler); |
|
|
@ -1007,9 +1007,9 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 显示权限编辑界面 |
|
|
|
* 显示权限编辑界面 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void showAuthorityEditPane() { |
|
|
|
public void showAuthorityEditPane() { |
|
|
|
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setAuthorityMode(true); |
|
|
|
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setAuthorityMode(true); |
|
|
|
if (isSupportAuthority()) { |
|
|
|
if (isSupportAuthority()) { |
|
|
@ -1023,9 +1023,9 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 是否支持权限编辑 |
|
|
|
* 是否支持权限编辑 |
|
|
|
* @return 是则返回true |
|
|
|
* @return 是则返回true |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean isSupportAuthority() { |
|
|
|
public boolean isSupportAuthority() { |
|
|
|
int size = getSelectionModel().getSelection().size(); |
|
|
|
int size = getSelectionModel().getSelection().size(); |
|
|
|
XCreator creator = size == 0 ? getRootComponent() : getSelectionModel().getSelection() |
|
|
|
XCreator creator = size == 0 ? getRootComponent() : getSelectionModel().getSelection() |
|
|
@ -1036,7 +1036,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
protected void setToolbarButtons(boolean flag) { |
|
|
|
protected void setToolbarButtons(boolean flag) { |
|
|
|
//自适应布局和底层都不能删除
|
|
|
|
//自适应布局和底层都不能删除
|
|
|
|
DesignerContext.getDesignerFrame().checkCombineUp(!(isRoot(getSelectionModel().getSelection().getSelectedCreator()) || flag), NAME_ARRAY_LIST); |
|
|
|
DesignerContext.getDesignerFrame().checkCombineUp(!(isRoot(getSelectionModel().getSelection().getSelectedCreator()) || flag), NAME_ARRAY_LIST); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void invalidateLayout() { |
|
|
|
private void invalidateLayout() { |
|
|
@ -1092,7 +1092,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
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)}; |
|
|
|
designer_actions = new Action[]{new FormDeleteAction(this)}; |
|
|
@ -1236,7 +1236,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ToolBarMenuDockPlus getToolBarMenuDockPlus() { |
|
|
|
public ToolBarMenuDockPlus getToolBarMenuDockPlus() { |
|
|
|
return StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, ToolBarMenuDockPlus.class); |
|
|
|
return StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, ToolBarMenuDockPlus.class); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|