From 9fe5bf5074c5b2e205aa119dab7ee1725f5b489d Mon Sep 17 00:00:00 2001 From: hzzz Date: Mon, 9 Oct 2017 12:03:48 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/images/buttonicon/anas.png | Bin 412 -> 454 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/designer_base/src/com/fr/design/images/buttonicon/anas.png b/designer_base/src/com/fr/design/images/buttonicon/anas.png index 5b0c6d7eab4d945cacbc476ef853ab76cf977db8..92eefc37a4ba2639c49e5c0d7b5a3bc302e3931d 100644 GIT binary patch delta 428 zcmV;d0aN~*1I7c8B!2;OQb$4nuFf3k0004iNkl&)@~)qFbF-~#E>t#oq_eoD}R_U3XNg_vdw(Y_AuPL zcaNbd(~rT+%ZtI2_dLViy?aqKgE%M#z+}ID`^I1?^OwQS&W?eFg@u8Ym6gHE+neFd zn>P%Mf4;$#foZG;Jb3Vc!N$x0MIne|Z*R}Q_2n*#I93A$1Oymfy~OnMhYueZ{<84k zHo$4lFR*0HHh&R@wQE)}+<5f|%)j;KADHf(v4Y_Tw>*jgj4+<#?4SQ(Y!J=#>obGY zqZJHBnsN+mY-|k2j~{2Su(DyebmkbtZH)?s{i*C=y*Ts2KQ>;5Cn~87PksPh^&RK} zJx7LpclR?`D9AE=zBvPK7d#9Y85y?0MUffIz~s!r0VNiBFYd^&|Cbp9^PkV~00IDL WC2!4Ows)%l0000345m9=KQ`=ZGxM1n2zyXNONSNZq&ZpB?l&9_@$g0Ww&SIfU3UGAbY? z4#?^dEM)$M>%?F#T0v_{WSI78ovoStHEF zz`)1H2jeoRs;V;Z{(A-I!x$JYSa9|a!-ePn8N@$-V|erRKg0Lm5TzeKeq;E>zzNd_ zr!fpzbp9V$l6viz9E0G_V+=OtMhriHd}mm?VGjcdJeRigMo$3fWevjJj1SE2ydYpz|3@r;otwy$ob(v6Dz|9CK-sCtRg_oJPiE5 fpPzN00000NkvXXu0mjfr>e59 From 95691e0f4501c421297be8939539bd5312e0ac04 Mon Sep 17 00:00:00 2001 From: hzzz Date: Mon, 9 Oct 2017 12:03:52 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/design/images/.DS_Store | Bin 0 -> 6148 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 designer_base/src/com/fr/design/images/.DS_Store diff --git a/designer_base/src/com/fr/design/images/.DS_Store b/designer_base/src/com/fr/design/images/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..6511d613ac467e828eaf5c635d4953ad9daf0478 GIT binary patch literal 6148 zcmeHKPfrs;6n_I%TdJ@HiV!(8_Mi!n6r+hA47GrYn6%OcO88TD+o9dK%rv{(RwN{i zAAk>lSH%zD#j}6DgYn`Q@Zd$yzWLJtf+rJW$i8OY@Ab`lZ}NVV-Pr*El4(>X0So{L z;}96?L3N6Vc`;5%m-cic5?O--0~^X9Fpz+OfPw#=0rBkifCUZk@pt6;wOU@?a=3-_ zKdicAdwweQnRIoB&Yiyyj`Tz$(cWleEnnlUyl?sqFJrnTV>EA9sAalKcEzt1D4TU? zld`P)*z~EpB7zH?I~bsB(^|A?t7HsLbLN{iqpqx{YOF5VtioFv-e46^#_QtJ&Y6A< z>x7eOx*<7^gd-(mcxPuKHJ+GA?T#mQChy!pdop$F_U>*Z93HuLe__4xVsHQDtJeo_ z-hYr;K=8#SC8n_hAJI6K7`xom#E`cgV!j&25o#`8>g_XP{R6SVSUesdx*Q)K8M#t2 z1}wAuwCaj}rn$r2jMJb+yUbbMeol)%edY_JWc2?Qw?HfFhpxhQ9b*O$9kSK~mr}M; zb?r)abJL@K@rb=#GWxu-%N-}jJ=?cATVC~WE9QK z*>qi#RcU5>%`q+NWLbv$KHn0Nq8c`mbE&8#*Us0?vdyZ=sqc!>WIER|t}DZUq%!b$ zF-U=NMkA4AdR{xjFb4PF5#*r;E!cy7IDmKX3BJHL_(?)!h+HLO4!JRH;N?F^Eb>e?rHlHMSM1bRhcj zLG;Q*-%yBL9qT7#IFPi$KnDy23>;@beEXvq;{2ce^Zj221u9@5VBl;rKteP5nGE)( z&(;%NinBI>V*`f}5!Y5IQ&8#SSQ_Fe9>yUB=Mus|Olxc_L=Q^vAs}f8RKUPLW#AXW Ced1dH literal 0 HcmV?d00001 From dd114fe443525c80cad394608157e6cd7b8a60b3 Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 9 Oct 2017 12:07:14 +0800 Subject: [PATCH 03/14] =?UTF-8?q?REPORT-4983=20=E5=88=87=E6=8D=A2tab?= =?UTF-8?q?=E5=86=8D=E5=88=87=E5=9B=9E=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E9=9D=A2=E6=9D=BF=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parameter/ParameterDefinitePane.java | 2 +- .../parameter/ParameterDesignerProvider.java | 3 +++ .../form/parameter/FormParaDesigner.java | 24 +++++++++---------- .../src/com/fr/design/mainframe/JForm.java | 6 ++--- .../parameter/ParameterPropertyPane.java | 16 +++++++------ .../parameter/ParameterToolBarPane.java | 2 -- 6 files changed, 28 insertions(+), 25 deletions(-) diff --git a/designer/src/com/fr/design/parameter/ParameterDefinitePane.java b/designer/src/com/fr/design/parameter/ParameterDefinitePane.java index 40c2aa4663..4f8adabbbb 100644 --- a/designer/src/com/fr/design/parameter/ParameterDefinitePane.java +++ b/designer/src/com/fr/design/parameter/ParameterDefinitePane.java @@ -298,7 +298,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus */ public void refreshParameter() { if (paraDesignEditor != null) { - paraDesignEditor.refreshParameter(this); + paraDesignEditor.refreshParameter(this, this.workBook); } } diff --git a/designer_base/src/com/fr/design/parameter/ParameterDesignerProvider.java b/designer_base/src/com/fr/design/parameter/ParameterDesignerProvider.java index e0d2ffb55e..abd27f89bf 100644 --- a/designer_base/src/com/fr/design/parameter/ParameterDesignerProvider.java +++ b/designer_base/src/com/fr/design/parameter/ParameterDesignerProvider.java @@ -3,6 +3,7 @@ package com.fr.design.parameter; import com.fr.base.Parameter; import com.fr.base.parameter.ParameterUI; import com.fr.design.mainframe.AuthorityEditPane; +import com.fr.design.mainframe.JTemplate; import javax.swing.*; import java.awt.*; @@ -31,6 +32,8 @@ public interface ParameterDesignerProvider { void refreshParameter(ParaDefinitePane paraDefinitePane); + void refreshParameter(ParaDefinitePane paraDefinitePane, JTemplate jt); + boolean isWithQueryButton(); java.util.List getAllXCreatorNameList(); diff --git a/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java b/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java index e84259fd86..cc100df8ed 100644 --- a/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java +++ b/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java @@ -37,16 +37,7 @@ import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.properties.FormWidgetAuthorityEditPane; import com.fr.design.form.util.XCreatorConstants; -import com.fr.design.mainframe.AuthorityEditPane; -import com.fr.design.mainframe.DesignerContext; -import com.fr.design.mainframe.EastRegionContainerPane; -import com.fr.design.mainframe.FormArea; -import com.fr.design.mainframe.FormDesigner; -import com.fr.design.mainframe.FormDesignerModeForSpecial; -import com.fr.design.mainframe.FormParaPane; -import com.fr.design.mainframe.FormWidgetDetailPane; -import com.fr.design.mainframe.WidgetPropertyPane; -import com.fr.design.mainframe.WidgetToolBarPane; +import com.fr.design.mainframe.*; import com.fr.design.parameter.ParaDefinitePane; import com.fr.design.parameter.ParameterDesignerProvider; import com.fr.design.parameter.ParameterPropertyPane; @@ -224,6 +215,16 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP * @param p 参数面板 */ public void refreshParameter(ParaDefinitePane p) { + refreshParameter(p, DesignerContext.getDesignerFrame().getSelectedJTemplate()); + } + + /** + * 刷新参数 + * + * @param p 参数面板 + * @param jt 当前模版 + */ + public void refreshParameter(ParaDefinitePane p, JTemplate jt) { XLayoutContainer rootContainer = this.getRootComponent(); java.util.List namelist = getAllXCreatorNameList(rootContainer); // parameterArray是报表的所有参数, nameList是已经在参数面板添加过控件的参数名 @@ -240,8 +241,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP } ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean( p.getParameterArray() == null ? new Parameter[0] : p.getParameterArray()); - EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance().getPreferredSize().height); - + ParameterPropertyPane.getInstance().refreshState(jt); } /** diff --git a/designer_form/src/com/fr/design/mainframe/JForm.java b/designer_form/src/com/fr/design/mainframe/JForm.java index 79b4ccc960..650c5fb3eb 100644 --- a/designer_form/src/com/fr/design/mainframe/JForm.java +++ b/designer_form/src/com/fr/design/mainframe/JForm.java @@ -328,10 +328,10 @@ public class JForm extends JTemplate implements BaseJForm { private void setPropertyPaneChange(XComponent comp) { if (comp == null) { - ParameterPropertyPane.getInstance().setAddParaPaneVisible(false); + ParameterPropertyPane.getInstance().setAddParaPaneVisible(false, this); return; } - ParameterPropertyPane.getInstance().setAddParaPaneVisible(comp instanceof XWParameterLayout); + ParameterPropertyPane.getInstance().setAddParaPaneVisible(comp instanceof XWParameterLayout, this); editingComponent = comp.createToolPane(this, formDesign); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM); if (BaseUtils.isAuthorityEditing()) { @@ -718,7 +718,7 @@ public class JForm extends JTemplate implements BaseJForm { EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM); EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(WidgetPropertyPane.getInstance(formDesign)); ParameterPropertyPane parameterPropertyPane = ParameterPropertyPane.getInstance(formDesign); - parameterPropertyPane.setAddParaPaneVisible(false); + parameterPropertyPane.setAddParaPaneVisible(false, this); EastRegionContainerPane.getInstance().addParameterPane(parameterPropertyPane); EastRegionContainerPane.getInstance().setParameterHeight(parameterPropertyPane.getPreferredSize().height); diff --git a/designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java b/designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java index 43e840823b..c749333444 100644 --- a/designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java +++ b/designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java @@ -4,10 +4,7 @@ import com.fr.design.constants.UIConstants; import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.dialog.BasicScrollPane; import com.fr.design.gui.ibutton.UIButton; -import com.fr.design.mainframe.DesignerContext; -import com.fr.design.mainframe.FormDesigner; -import com.fr.design.mainframe.FormHierarchyTreePane; -import com.fr.design.mainframe.JForm; +import com.fr.design.mainframe.*; import javax.swing.*; import java.awt.*; @@ -87,18 +84,23 @@ public class ParameterPropertyPane extends JPanel{ } // 显示或隐藏添加参数面板 + public void refreshState(JTemplate jt) { + setAddParaPaneVisible(toolbarPane.hasSelectedLabelItem(), jt); + } + + // 显示或隐藏添加参数面板 public void refreshState() { - setAddParaPaneVisible(toolbarPane.hasSelectedLabelItem()); + refreshState(DesignerContext.getDesignerFrame().getSelectedJTemplate()); } - public void setAddParaPaneVisible(boolean isVisible) { + public void setAddParaPaneVisible(boolean isVisible, JTemplate jt) { if (isVisible == addParaPane.isVisible() || formHierarchyTreePaneWrapper == null) { return; } // 表单中,只有添加并选中参数面板时,才显示 boolean hideInJForm; try { - hideInJForm = DesignerContext.getDesignerFrame().getSelectedJTemplate() instanceof JForm && + hideInJForm = jt instanceof JForm && !(FormHierarchyTreePane.getInstance().getComponentTree().getSelectionPath().getLastPathComponent() instanceof XWParameterLayout); } catch (NullPointerException ex) { hideInJForm = true; diff --git a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java index 16fc6ce041..daac4c2db8 100644 --- a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java +++ b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java @@ -82,7 +82,6 @@ public class ParameterToolBarPane extends BasicBeanPane { this.add(label); if (parameterArray.length == 0) { - ParameterPropertyPane.getInstance().refreshState(); this.setVisible(false); this.repaint(); return; @@ -103,7 +102,6 @@ public class ParameterToolBarPane extends BasicBeanPane { this.add(addAll); this.doLayout(); - ParameterPropertyPane.getInstance().refreshState(); this.repaint(); } From e3072d5eef9ca01a7f532c3f9531a7d3f6c4513d Mon Sep 17 00:00:00 2001 From: hzzz Date: Mon, 9 Oct 2017 14:06:10 +0800 Subject: [PATCH 04/14] tmp --- designer_base/src/com/fr/design/images/.DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 designer_base/src/com/fr/design/images/.DS_Store diff --git a/designer_base/src/com/fr/design/images/.DS_Store b/designer_base/src/com/fr/design/images/.DS_Store deleted file mode 100644 index 6511d613ac467e828eaf5c635d4953ad9daf0478..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKPfrs;6n_I%TdJ@HiV!(8_Mi!n6r+hA47GrYn6%OcO88TD+o9dK%rv{(RwN{i zAAk>lSH%zD#j}6DgYn`Q@Zd$yzWLJtf+rJW$i8OY@Ab`lZ}NVV-Pr*El4(>X0So{L z;}96?L3N6Vc`;5%m-cic5?O--0~^X9Fpz+OfPw#=0rBkifCUZk@pt6;wOU@?a=3-_ zKdicAdwweQnRIoB&Yiyyj`Tz$(cWleEnnlUyl?sqFJrnTV>EA9sAalKcEzt1D4TU? zld`P)*z~EpB7zH?I~bsB(^|A?t7HsLbLN{iqpqx{YOF5VtioFv-e46^#_QtJ&Y6A< z>x7eOx*<7^gd-(mcxPuKHJ+GA?T#mQChy!pdop$F_U>*Z93HuLe__4xVsHQDtJeo_ z-hYr;K=8#SC8n_hAJI6K7`xom#E`cgV!j&25o#`8>g_XP{R6SVSUesdx*Q)K8M#t2 z1}wAuwCaj}rn$r2jMJb+yUbbMeol)%edY_JWc2?Qw?HfFhpxhQ9b*O$9kSK~mr}M; zb?r)abJL@K@rb=#GWxu-%N-}jJ=?cATVC~WE9QK z*>qi#RcU5>%`q+NWLbv$KHn0Nq8c`mbE&8#*Us0?vdyZ=sqc!>WIER|t}DZUq%!b$ zF-U=NMkA4AdR{xjFb4PF5#*r;E!cy7IDmKX3BJHL_(?)!h+HLO4!JRH;N?F^Eb>e?rHlHMSM1bRhcj zLG;Q*-%yBL9qT7#IFPi$KnDy23>;@beEXvq;{2ce^Zj221u9@5VBl;rKteP5nGE)( z&(;%NinBI>V*`f}5!Y5IQ&8#SSQ_Fe9>yUB=Mus|Olxc_L=Q^vAs}f8RKUPLW#AXW Ced1dH From dfee82505ecf038606bd4d248c457fec9b3102ad Mon Sep 17 00:00:00 2001 From: hzzz Date: Mon, 9 Oct 2017 14:37:24 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=A0=8F=E5=9B=BE?= =?UTF-8?q?=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/images/chart/ChartType.png | Bin 151 -> 138 bytes .../com/fr/plugin/chart/map/images/mapData.png | Bin 489 -> 493 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/designer_base/src/com/fr/design/images/chart/ChartType.png b/designer_base/src/com/fr/design/images/chart/ChartType.png index 504ca9484729be763d7f3445dd5d47ca7d0904a0..3bc69c74d0a68f802b0bd78cf2a08a279d14bee3 100644 GIT binary patch delta 96 zcmV-m0H6Pt0g3^TFa+o;`zAEfcaLa@Z6bz(R_x z*t|ut3n(@K>;-I2Bi3sayI|A+1_p}5fY{i=sSW@WhzuUpC0>I70000|I}3PKeC+k=}TDEG9fD>hs{EYChgV} zD6YC%ZNW&f3kKc*a2V8`_CfJmlj#<$A&xD)2Hp#!E?{7wI1I2wElFYkRTm5(_DYKr P00000NkvXXu0mjf6^twW diff --git a/designer_chart/src/com/fr/plugin/chart/map/images/mapData.png b/designer_chart/src/com/fr/plugin/chart/map/images/mapData.png index 12a9a0df0afcaf2dda93f34e099cb0f35a583579..118314825a15eafd9a43653a9c4b9e97b529e55b 100644 GIT binary patch delta 467 zcmV;^0WALM1MLHlB!2;OQb$4nuFf3k0004}Nklu|M`GfpUgG5wL3+85wp1 z*{4KBMVq&8-~N*Ys$Ed)BXj<9CNGr+L8&&0%V5U7?Dq#hgwFpZGF`s)acO;ey> z1%ZL)2UY~O8LW9HP>hd}k?|cfGn3-UlP5o+7yvT}L<3_c?BBotD}i>@vam4i0on}H z{0XSp9jN&PNFC0UsHmv;=It;W~7))q0ie``jI9&je1OcE+qJb`1 z0%SgCVPOt}*$kEh67ZA=6F{edHk&gsF~%qH-iudKvHkz=$R( z0HhLt5)*J}ZU9pCQ0@mHe!zqzSpcNo193l)?SR7p`bcb$Wq$&UK*a_?h5``JhYEtg z10W6ry5s_y1^q0){xfiX{>$)Lm<1%ffD!5^TmagqZ|^3pg;ykBQ)Lv zfp`Km1|9%4f54_097QZ}7hq3`{|~Ex{fEtam)L|Dp0aQs05TT>EndKc&44$2Df6*u zzQQK>0jL?|%0{S5vAf{*ojd>ezVBub`_PM``7sNRB1kCxBdcXW*F0(RWP?wiJ~1%x zxq|snLlS|SKcH*I1rjthHU9%$u^)*0Kc3ACz^51>zyRUzoN|sY--Q4G002ovPDHLk FV1i2*!La}U From a1512c47492b879dd004286b305a1c2a3de27a19 Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 9 Oct 2017 15:10:20 +0800 Subject: [PATCH 06/14] =?UTF-8?q?REPORT-4883=20=E6=A8=A1=E6=9D=BF=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=8E=A7=E4=BB=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/FormDesigner.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/FormDesigner.java b/designer_form/src/com/fr/design/mainframe/FormDesigner.java index 7572cc2042..98bfbfeb44 100644 --- a/designer_form/src/com/fr/design/mainframe/FormDesigner.java +++ b/designer_form/src/com/fr/design/mainframe/FormDesigner.java @@ -257,7 +257,7 @@ public class FormDesigner extends TargetComponent
implements TreeSelection currentIndex++; parameterArray = (Parameter[]) ArrayUtils.removeElement(parameterArray, parameter); refreshParameter(); - EastRegionContainerPane.getInstance().refreshDownPane(); + fireTargetModified(); } /** @@ -301,7 +301,7 @@ public class FormDesigner extends TargetComponent implements TreeSelection currentIndex = currentIndex + NUM_IN_A_LINE - currentIndex % NUM_IN_A_LINE; parameterArray = (Parameter[]) ArrayUtils.removeElement(parameterArray, parameter); refreshParameter(); - EastRegionContainerPane.getInstance().refreshDownPane(); + fireTargetModified(); } /** @@ -667,9 +667,8 @@ public class FormDesigner extends TargetComponent implements TreeSelection // 只有选择组件时不触发模版更新,其他都要触发 if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) { FormDesigner.this.fireTargetModified(); - //bug59192 - //setParameterArray(getNoRepeatParas(getTarget().getParameters())); - //refreshParameter(); + setParameterArray(getNoRepeatParas(getTarget().getParameters())); + refreshParameter(); } } From 9b8ef8b06aeeca238b99384f8709076671ae5826 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Mon, 9 Oct 2017 15:24:37 +0800 Subject: [PATCH 07/14] =?UTF-8?q?REPORT-4944=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E5=85=83=E7=B4=A0=E3=80=81=E6=82=AC?= =?UTF-8?q?=E6=B5=AE=E5=85=83=E7=B4=A0=E3=80=81=E8=81=9A=E5=90=88=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E7=9A=84=E5=9B=BE=E8=A1=A8=E9=85=8D=E7=BD=AE=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/module/DesignerModule.java | 828 +++++++++--------- .../fr/poly/creator/ChartBlockCreator.java | 320 ++++--- .../com/fr/quickeditor/ChartQuickEditor.java | 54 -- .../chartquick/BasicChartQuickEditor.java | 56 ++ .../chartquick/FloatChartQuickEditor.java | 34 + .../chartquick/PolyChartQuickEditor.java | 31 + .../fr/design/actions/core/ActionFactory.java | 6 +- 7 files changed, 693 insertions(+), 636 deletions(-) delete mode 100644 designer/src/com/fr/quickeditor/ChartQuickEditor.java create mode 100644 designer/src/com/fr/quickeditor/chartquick/BasicChartQuickEditor.java create mode 100644 designer/src/com/fr/quickeditor/chartquick/FloatChartQuickEditor.java create mode 100644 designer/src/com/fr/quickeditor/chartquick/PolyChartQuickEditor.java diff --git a/designer/src/com/fr/design/module/DesignerModule.java b/designer/src/com/fr/design/module/DesignerModule.java index 6cdbea4e5d..c037267fbc 100644 --- a/designer/src/com/fr/design/module/DesignerModule.java +++ b/designer/src/com/fr/design/module/DesignerModule.java @@ -1,415 +1,415 @@ -package com.fr.design.module; - -import com.fr.base.*; -import com.fr.base.io.XMLEncryptUtils; -import com.fr.base.process.ProcessOperator; -import com.fr.base.remote.RemoteDeziConstants; -import com.fr.design.DesignerEnvManager; -import com.fr.design.ExtraDesignClassManager; -import com.fr.design.actions.core.ActionFactory; -import com.fr.design.actions.insert.cell.*; -import com.fr.design.actions.insert.flot.ChartFloatAction; -import com.fr.design.actions.insert.flot.FormulaFloatAction; -import com.fr.design.actions.insert.flot.ImageFloatAction; -import com.fr.design.actions.insert.flot.TextBoxFloatAction; -import com.fr.design.actions.server.StyleListAction; -import com.fr.design.fun.ElementUIProvider; -import com.fr.design.gui.ibutton.UIButton; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.javascript.ProcessTransitionAdapter; -import com.fr.design.mainframe.*; -import com.fr.design.mainframe.bbs.BBSGuestPane; -import com.fr.design.mainframe.form.FormECCompositeProvider; -import com.fr.design.mainframe.form.FormECDesignerProvider; -import com.fr.design.mainframe.form.FormElementCaseDesigner; -import com.fr.design.mainframe.form.FormReportComponentComposite; -import com.fr.design.mainframe.loghandler.DesignerLogImpl; -import com.fr.design.parameter.WorkBookParameterReader; -import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.file.FILE; -import com.fr.general.*; -import com.fr.general.xml.GeneralXMLTools; -import com.fr.io.importer.Excel2007ReportImporter; -import com.fr.io.importer.ExcelReportImporter; -import com.fr.main.impl.WorkBook; -import com.fr.quickeditor.ChartQuickEditor; -import com.fr.quickeditor.cellquick.*; -import com.fr.quickeditor.floatquick.FloatImageQuickEditor; -import com.fr.quickeditor.floatquick.FloatStringQuickEditor; -import com.fr.report.cell.CellElementValueConverter; -import com.fr.report.cell.cellattr.core.RichText; -import com.fr.report.cell.cellattr.core.SubReport; -import com.fr.report.cell.cellattr.core.group.DSColumn; -import com.fr.report.cell.painter.BiasTextPainter; -import com.fr.stable.ArrayUtils; -import com.fr.stable.ParameterProvider; -import com.fr.stable.StringUtils; -import com.fr.stable.bridge.StableFactory; -import com.fr.stable.fun.LogProvider; -import com.fr.stable.script.CalculatorProviderContext; -import com.fr.stable.script.ValueConverter; -import com.fr.stable.web.ServletContext; -import com.fr.stable.web.ServletContextAdapter; -import com.fr.stable.xml.ObjectTokenizer; -import com.fr.stable.xml.ObjectXMLWriterFinder; -import com.fr.start.BBSGuestPaneProvider; -import com.fr.xml.ReportXMLUtils; - -import javax.swing.*; -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.image.BufferedImage; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Set; - -public class DesignerModule extends DesignModule { - - static { - ServletContext.addServletContextListener(new ServletContextAdapter() { - - public void onServletStart() { - ModuleContext.startModule(DesignerModule.class.getName()); - } - }); - } - - /** - * 启动设计器模块 - */ - public void start() { - super.start(); - - justStartModules4Engine(); - justStartModules4Designer(); - - CalculatorProviderContext.setValueConverter(valueConverter()); - GeneralXMLTools.Object_Tokenizer = startXMLReadObjectTokenizer(); - GeneralXMLTools.Object_XML_Writer_Finder = startObjectXMLWriterFinder(); - addAdapterForPlate(); - - registerCellEditor(); - registerFloatEditor(); - registerData4Form(); - registerOtherPane(); - - InformationCollector.getInstance().collectStartTime(); - - ExtraDesignClassManager.getInstance().getFeedback().didFeedback(); - StableFactory.registerMarkedObject(LogProvider.MARK_STRING, DesignerLogImpl.getInstance()); - } - - private void registerOtherPane() { - StableFactory.registerMarkedClass(BBSGuestPaneProvider.XML_TAG, BBSGuestPane.class); - } - - /** - * kunsnat:注册单元格选中Editor - */ - - private void registerCellEditor() { - ActionFactory.registerCellEditor(String.class, CellStringQuickEditor.class); - ActionFactory.registerCellEditor(Number.class, CellStringQuickEditor.class); - ActionFactory.registerCellEditor(Formula.class, CellFormulaQuickEditor.class); - ActionFactory.registerCellEditor(SubReport.class, CellSubReportEditor.class); - ActionFactory.registerCellEditor(RichText.class, CellRichTextEditor.class); - ActionFactory.registerCellEditor(DSColumn.class, CellDSColumnEditor.class); - ActionFactory.registerCellEditor(Image.class, CellImageQuickEditor.class); - ActionFactory.registerCellEditor(BiasTextPainter.class, CellBiasTextPainterEditor.class); - ActionFactory.registerCellEditor(BufferedImage.class, CellImageQuickEditor.class); - - ActionFactory.registerChartCellEditorInEditor(ChartQuickEditor.class); - - Set providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); - for (ElementUIProvider provider : providers) { - ActionFactory.registerCellEditor(provider.targetObjectClass(), provider.quickEditor()); - } - } - - - public String getInterNationalName() { - return Inter.getLocText("FR-Module_Designer"); - } - - - /** - * kunnat: 注册悬浮选中Editor - */ - private void registerFloatEditor() { - ActionFactory.registerFloatEditor(String.class, FloatStringQuickEditor.class); - ActionFactory.registerFloatEditor(Formula.class, FloatStringQuickEditor.class); - - FloatImageQuickEditor floatImageQuickEditor = new FloatImageQuickEditor(); - ActionFactory.registerFloatEditor(Image.class, FloatImageQuickEditor.class); - ActionFactory.registerFloatEditor(BufferedImage.class, FloatImageQuickEditor.class); - ActionFactory.registerChartFloatEditorInEditor(ChartQuickEditor.class); - } - - /** - * kunsnat: 一些模块信息 必须跟随设计器启动, - * 比如 读取CC.XML, 设计器启动之后, 马上会读取XML, 需要Chart_Module中的注册信息 - */ - private void justStartModules4Engine() { - ModuleContext.startModule(ENGINE_MODULE); - } - - private void justStartModules4Designer() { - ModuleContext.startModule(CHART_DESIGNER_MODULE); - ModuleContext.startModule(FORM_DESIGNER_MODULE); - } - - /** - * CellElementValueConverter用来处理设计器格子里的值,将公式/数组/其他元素转换成对应的值。 - * - * @return 返回处理格子值的转换器 - */ - public ValueConverter valueConverter() { - return new CellElementValueConverter(); - } - - @Override - /* - * 针对不同的对象,在读取Object对象的xml的时候需要使用不同的对象生成器 - * @return 返回对象生成器 - */ - public ObjectTokenizer startXMLReadObjectTokenizer() { - return new ReportXMLUtils.ReportObjectTokenizer(); - } - - /** - * 针对不同的对象,在写对象的XML时需要使用不同的XML生成器 - * - * @return 返回xml生成器 - */ - @Override - public ObjectXMLWriterFinder startObjectXMLWriterFinder() { - return new ReportXMLUtils.ReportObjectXMLWriterFinder(); - } - - //wei:fs的模块中可能有需要设计器界面做设置的地方,在这边添加 - private void addAdapterForPlate() { - - ProcessTransitionAdapter.setProcessTransitionAdapter(new ProcessTransitionAdapter() { - - @Override - protected String[] getTransitionNamesByBook(String book) { - return StableFactory.getMarkedObject(ProcessOperator.MARK_STRING, ProcessOperator.class, ProcessOperator.EMPTY).getTransitionNamesByBook(book); - } - - @Override - protected String[] getParaNames(String book) { - return StableFactory.getMarkedObject(ProcessOperator.MARK_STRING, ProcessOperator.class, ProcessOperator.EMPTY).getParaNames(book); - } - - @Override - protected ParameterProvider[] getParas(String book) { - return StableFactory.getMarkedObject(ProcessOperator.MARK_STRING, ProcessOperator.class, ProcessOperator.EMPTY).getParas(book); - } - - protected MultiFieldParameter[] getAllMultiFieldParas(String book) { - return StableFactory.getMarkedObject(ProcessOperator.MARK_STRING, ProcessOperator.class, ProcessOperator.EMPTY).getAllMultiFieldParas(book); - } - }); - } - - private static abstract class AbstractWorkBookApp implements App { - - @Override - public int currentAPILevel() { - return CURRENT_LEVEL; - } - - @Override - public JTemplate openTemplate(FILE tplFile) { - return new JWorkBook(asIOFile(tplFile), tplFile); - } - - @Override - public String mark4Provider() { - return getClass().getName(); - } - - @Override - public void process() { - - } - - @Override - public void undo() { - - } - } - - @Override - /* - * 返回设计器能打开的模板类型的一个数组列表 - * @return 可以打开的模板类型的数组 - */ - public App[] apps4TemplateOpener() { - return new App[]{getCptApp(), getXlsApp(), getXlsxApp()}; - } - - private AbstractWorkBookApp getXlsxApp() { - return new AbstractWorkBookApp() { - @Override - public String[] defaultExtentions() { - return new String[]{"xlsx"}; - } - - @Override - public WorkBook asIOFile(FILE tplFile) { - WorkBook workbook = null; - try { - workbook = new Excel2007ReportImporter().generateWorkBookByStream(tplFile.asInputStream()); - } catch (Exception exp) { - FRContext.getLogger().error("Failed to generate xlsx from " + tplFile, exp); - } - return workbook; - } - }; - } - - private AbstractWorkBookApp getXlsApp() { - return new AbstractWorkBookApp() { - @Override - public String[] defaultExtentions() { - return new String[]{"xls"}; - } - - @Override - public WorkBook asIOFile(FILE tplFile) { - WorkBook workbook = null; - try { - workbook = new ExcelReportImporter().generateWorkBookByStream(tplFile.asInputStream()); - } catch (Exception exp) { - FRContext.getLogger().error("Failed to generate xls from " + tplFile, exp); - } - return workbook; - } - }; - } - - private AbstractWorkBookApp getCptApp() { - return new AbstractWorkBookApp() { - public String[] defaultExtentions() { - return new String[]{"cpt"}; - } - - public WorkBook asIOFile(FILE file) { - if (XMLEncryptUtils.isCptEncoded() && - !XMLEncryptUtils.checkVaild(DesignerEnvManager.getEnvManager().getEncryptionKey())) { - if (!new DecodeDialog(file).isPwdRight()) { - FRContext.getLogger().error(Inter.getLocText("ECP-error_pwd")); - return new WorkBook(); - } - } - - WorkBook tpl = new WorkBook(); - // richer:打开报表通知 - FRContext.getLogger().info(Inter.getLocText(new String[]{"LOG-Is_Being_Openned", "LOG-Please_Wait"}, new String[]{"\"" + file.getName() + "\"" + ",", "..."})); - TempNameStyle namestyle = TempNameStyle.getInstance(); - namestyle.clear(); - String checkStr = StringUtils.EMPTY; - try { - checkStr = IOUtils.inputStream2String(file.asInputStream()); - tpl.readStream(file.asInputStream()); - } catch (Exception exp) { - String errorMessage = StringUtils.EMPTY; - errorMessage = ComparatorUtils.equals(RemoteDeziConstants.INVALID_USER, checkStr) ? Inter.getLocText("FR-Designer_No-Privilege") - : Inter.getLocText("NS-exception_readError"); - FRContext.getLogger().error(errorMessage + file, exp); - } - checkNameStyle(namestyle); - return tpl; - } - }; - } - - private static void checkNameStyle(TempNameStyle namestyle) { - Iterator it = namestyle.getIterator(); - ArrayList al = new ArrayList(); - while (it.hasNext()) { - al.add((String) it.next()); - } - if (!al.isEmpty()) { - showConfirmDialog(al); - } - } - - private static void showConfirmDialog(final ArrayList namelist) { - - final JDialog jd = new JDialog(); - // 模态一下,因为可能会多个样式丢失 - // jd.setModal(true); - jd.setAlwaysOnTop(true); - jd.setSize(450, 150); - jd.setResizable(false); - jd.setIconImage(BaseUtils.readImage("/com/fr/base/images/oem/logo.png")); - String message = namelist.toString().replaceAll("\\[", "").replaceAll("\\]", ""); - UILabel jl = new UILabel(Inter.getLocText(new String[]{"Current_custom_global", "Has_been_gone"}, new String[]{message})); - jl.setHorizontalAlignment(SwingConstants.CENTER); - jd.add(jl, BorderLayout.CENTER); - JPanel jp = new JPanel(); - - // ”是“按钮,点击之后将生成一个全局样式,并写入xml - UIButton confirmButton = new UIButton(Inter.getLocText("FR-Designer_Yes")); - confirmButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - try { - for (int i = 0; i < namelist.size(); i++) { - ConfigManager.getProviderInstance().putStyle(namelist.get(i), Style.DEFAULT_STYLE); - FRContext.getCurrentEnv().writeResource(ConfigManager.getProviderInstance()); - } - } catch (Exception ex) { - FRLogger.getLogger().error(ex.getMessage()); - } - jd.dispose(); - new StyleListAction().actionPerformed(e);// 弹窗 - } - }); - - UIButton noButton = new UIButton(Inter.getLocText("FR-Designer_No")); - noButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - jd.dispose(); - } - }); - - jp.add(confirmButton); - jp.add(noButton); - jd.setTitle(Inter.getLocText("FR-Custom_styles_lost")); - jd.add(jp, BorderLayout.SOUTH); - GUICoreUtils.centerWindow(jd); - jd.setVisible(true); - } - - public Class[] actionsForInsertCellElement() { - return (Class[]) ArrayUtils.addAll(new Class[]{ - DSColumnCellAction.class, - GeneralCellAction.class, - RichTextCellAction.class, - FormulaCellAction.class, - ChartCellAction.class, - ImageCellAction.class, - BiasCellAction.class, - SubReportCellAction.class - }, super.actionsForInsertCellElement()); - } - - public Class[] actionsForInsertFloatElement() { - return (Class[]) ArrayUtils.addAll(new Class[]{ - TextBoxFloatAction.class, - FormulaFloatAction.class, - ChartFloatAction.class, - ImageFloatAction.class - }, super.actionsForInsertFloatElement()); - } - - - private void registerData4Form() { - StableFactory.registerMarkedClass(FormECDesignerProvider.XML_TAG, FormElementCaseDesigner.class); - StableFactory.registerMarkedClass(FormECCompositeProvider.XML_TAG, FormReportComponentComposite.class); - DesignModuleFactory.registerParameterReader(new WorkBookParameterReader()); - } +package com.fr.design.module; + +import com.fr.base.*; +import com.fr.base.io.XMLEncryptUtils; +import com.fr.base.process.ProcessOperator; +import com.fr.base.remote.RemoteDeziConstants; +import com.fr.design.DesignerEnvManager; +import com.fr.design.ExtraDesignClassManager; +import com.fr.design.actions.core.ActionFactory; +import com.fr.design.actions.insert.cell.*; +import com.fr.design.actions.insert.flot.ChartFloatAction; +import com.fr.design.actions.insert.flot.FormulaFloatAction; +import com.fr.design.actions.insert.flot.ImageFloatAction; +import com.fr.design.actions.insert.flot.TextBoxFloatAction; +import com.fr.design.actions.server.StyleListAction; +import com.fr.design.fun.ElementUIProvider; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.javascript.ProcessTransitionAdapter; +import com.fr.design.mainframe.*; +import com.fr.design.mainframe.bbs.BBSGuestPane; +import com.fr.design.mainframe.form.FormECCompositeProvider; +import com.fr.design.mainframe.form.FormECDesignerProvider; +import com.fr.design.mainframe.form.FormElementCaseDesigner; +import com.fr.design.mainframe.form.FormReportComponentComposite; +import com.fr.design.mainframe.loghandler.DesignerLogImpl; +import com.fr.design.parameter.WorkBookParameterReader; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.file.FILE; +import com.fr.general.*; +import com.fr.general.xml.GeneralXMLTools; +import com.fr.io.importer.Excel2007ReportImporter; +import com.fr.io.importer.ExcelReportImporter; +import com.fr.main.impl.WorkBook; +import com.fr.quickeditor.chartquick.BasicChartQuickEditor; +import com.fr.quickeditor.chartquick.FloatChartQuickEditor; +import com.fr.quickeditor.cellquick.*; +import com.fr.quickeditor.floatquick.FloatImageQuickEditor; +import com.fr.quickeditor.floatquick.FloatStringQuickEditor; +import com.fr.report.cell.CellElementValueConverter; +import com.fr.report.cell.cellattr.core.RichText; +import com.fr.report.cell.cellattr.core.SubReport; +import com.fr.report.cell.cellattr.core.group.DSColumn; +import com.fr.report.cell.painter.BiasTextPainter; +import com.fr.stable.ArrayUtils; +import com.fr.stable.ParameterProvider; +import com.fr.stable.StringUtils; +import com.fr.stable.bridge.StableFactory; +import com.fr.stable.fun.LogProvider; +import com.fr.stable.script.CalculatorProviderContext; +import com.fr.stable.script.ValueConverter; +import com.fr.stable.web.ServletContext; +import com.fr.stable.web.ServletContextAdapter; +import com.fr.stable.xml.ObjectTokenizer; +import com.fr.stable.xml.ObjectXMLWriterFinder; +import com.fr.start.BBSGuestPaneProvider; +import com.fr.xml.ReportXMLUtils; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.image.BufferedImage; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Set; + +public class DesignerModule extends DesignModule { + + static { + ServletContext.addServletContextListener(new ServletContextAdapter() { + + public void onServletStart() { + ModuleContext.startModule(DesignerModule.class.getName()); + } + }); + } + + /** + * 启动设计器模块 + */ + public void start() { + super.start(); + + justStartModules4Engine(); + justStartModules4Designer(); + + CalculatorProviderContext.setValueConverter(valueConverter()); + GeneralXMLTools.Object_Tokenizer = startXMLReadObjectTokenizer(); + GeneralXMLTools.Object_XML_Writer_Finder = startObjectXMLWriterFinder(); + addAdapterForPlate(); + + registerCellEditor(); + registerFloatEditor(); + registerData4Form(); + registerOtherPane(); + + InformationCollector.getInstance().collectStartTime(); + + ExtraDesignClassManager.getInstance().getFeedback().didFeedback(); + StableFactory.registerMarkedObject(LogProvider.MARK_STRING, DesignerLogImpl.getInstance()); + } + + private void registerOtherPane() { + StableFactory.registerMarkedClass(BBSGuestPaneProvider.XML_TAG, BBSGuestPane.class); + } + + /** + * kunsnat:注册单元格选中Editor + */ + + private void registerCellEditor() { + ActionFactory.registerCellEditor(String.class, CellStringQuickEditor.class); + ActionFactory.registerCellEditor(Number.class, CellStringQuickEditor.class); + ActionFactory.registerCellEditor(Formula.class, CellFormulaQuickEditor.class); + ActionFactory.registerCellEditor(SubReport.class, CellSubReportEditor.class); + ActionFactory.registerCellEditor(RichText.class, CellRichTextEditor.class); + ActionFactory.registerCellEditor(DSColumn.class, CellDSColumnEditor.class); + ActionFactory.registerCellEditor(Image.class, CellImageQuickEditor.class); + ActionFactory.registerCellEditor(BiasTextPainter.class, CellBiasTextPainterEditor.class); + ActionFactory.registerCellEditor(BufferedImage.class, CellImageQuickEditor.class); + + ActionFactory.registerChartCellEditorInEditor(BasicChartQuickEditor.class); + + Set providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); + for (ElementUIProvider provider : providers) { + ActionFactory.registerCellEditor(provider.targetObjectClass(), provider.quickEditor()); + } + } + + + public String getInterNationalName() { + return Inter.getLocText("FR-Module_Designer"); + } + + + /** + * kunnat: 注册悬浮选中Editor + */ + private void registerFloatEditor() { + ActionFactory.registerFloatEditor(String.class, FloatStringQuickEditor.class); + ActionFactory.registerFloatEditor(Formula.class, FloatStringQuickEditor.class); + ActionFactory.registerFloatEditor(Image.class, FloatImageQuickEditor.class); + ActionFactory.registerFloatEditor(BufferedImage.class, FloatImageQuickEditor.class); + + ActionFactory.registerChartFloatEditorInEditor(FloatChartQuickEditor.class); + } + + /** + * kunsnat: 一些模块信息 必须跟随设计器启动, + * 比如 读取CC.XML, 设计器启动之后, 马上会读取XML, 需要Chart_Module中的注册信息 + */ + private void justStartModules4Engine() { + ModuleContext.startModule(ENGINE_MODULE); + } + + private void justStartModules4Designer() { + ModuleContext.startModule(CHART_DESIGNER_MODULE); + ModuleContext.startModule(FORM_DESIGNER_MODULE); + } + + /** + * CellElementValueConverter用来处理设计器格子里的值,将公式/数组/其他元素转换成对应的值。 + * + * @return 返回处理格子值的转换器 + */ + public ValueConverter valueConverter() { + return new CellElementValueConverter(); + } + + @Override + /* + * 针对不同的对象,在读取Object对象的xml的时候需要使用不同的对象生成器 + * @return 返回对象生成器 + */ + public ObjectTokenizer startXMLReadObjectTokenizer() { + return new ReportXMLUtils.ReportObjectTokenizer(); + } + + /** + * 针对不同的对象,在写对象的XML时需要使用不同的XML生成器 + * + * @return 返回xml生成器 + */ + @Override + public ObjectXMLWriterFinder startObjectXMLWriterFinder() { + return new ReportXMLUtils.ReportObjectXMLWriterFinder(); + } + + //wei:fs的模块中可能有需要设计器界面做设置的地方,在这边添加 + private void addAdapterForPlate() { + + ProcessTransitionAdapter.setProcessTransitionAdapter(new ProcessTransitionAdapter() { + + @Override + protected String[] getTransitionNamesByBook(String book) { + return StableFactory.getMarkedObject(ProcessOperator.MARK_STRING, ProcessOperator.class, ProcessOperator.EMPTY).getTransitionNamesByBook(book); + } + + @Override + protected String[] getParaNames(String book) { + return StableFactory.getMarkedObject(ProcessOperator.MARK_STRING, ProcessOperator.class, ProcessOperator.EMPTY).getParaNames(book); + } + + @Override + protected ParameterProvider[] getParas(String book) { + return StableFactory.getMarkedObject(ProcessOperator.MARK_STRING, ProcessOperator.class, ProcessOperator.EMPTY).getParas(book); + } + + protected MultiFieldParameter[] getAllMultiFieldParas(String book) { + return StableFactory.getMarkedObject(ProcessOperator.MARK_STRING, ProcessOperator.class, ProcessOperator.EMPTY).getAllMultiFieldParas(book); + } + }); + } + + private static abstract class AbstractWorkBookApp implements App { + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public JTemplate openTemplate(FILE tplFile) { + return new JWorkBook(asIOFile(tplFile), tplFile); + } + + @Override + public String mark4Provider() { + return getClass().getName(); + } + + @Override + public void process() { + + } + + @Override + public void undo() { + + } + } + + @Override + /* + * 返回设计器能打开的模板类型的一个数组列表 + * @return 可以打开的模板类型的数组 + */ + public App[] apps4TemplateOpener() { + return new App[]{getCptApp(), getXlsApp(), getXlsxApp()}; + } + + private AbstractWorkBookApp getXlsxApp() { + return new AbstractWorkBookApp() { + @Override + public String[] defaultExtentions() { + return new String[]{"xlsx"}; + } + + @Override + public WorkBook asIOFile(FILE tplFile) { + WorkBook workbook = null; + try { + workbook = new Excel2007ReportImporter().generateWorkBookByStream(tplFile.asInputStream()); + } catch (Exception exp) { + FRContext.getLogger().error("Failed to generate xlsx from " + tplFile, exp); + } + return workbook; + } + }; + } + + private AbstractWorkBookApp getXlsApp() { + return new AbstractWorkBookApp() { + @Override + public String[] defaultExtentions() { + return new String[]{"xls"}; + } + + @Override + public WorkBook asIOFile(FILE tplFile) { + WorkBook workbook = null; + try { + workbook = new ExcelReportImporter().generateWorkBookByStream(tplFile.asInputStream()); + } catch (Exception exp) { + FRContext.getLogger().error("Failed to generate xls from " + tplFile, exp); + } + return workbook; + } + }; + } + + private AbstractWorkBookApp getCptApp() { + return new AbstractWorkBookApp() { + public String[] defaultExtentions() { + return new String[]{"cpt"}; + } + + public WorkBook asIOFile(FILE file) { + if (XMLEncryptUtils.isCptEncoded() && + !XMLEncryptUtils.checkVaild(DesignerEnvManager.getEnvManager().getEncryptionKey())) { + if (!new DecodeDialog(file).isPwdRight()) { + FRContext.getLogger().error(Inter.getLocText("ECP-error_pwd")); + return new WorkBook(); + } + } + + WorkBook tpl = new WorkBook(); + // richer:打开报表通知 + FRContext.getLogger().info(Inter.getLocText(new String[]{"LOG-Is_Being_Openned", "LOG-Please_Wait"}, new String[]{"\"" + file.getName() + "\"" + ",", "..."})); + TempNameStyle namestyle = TempNameStyle.getInstance(); + namestyle.clear(); + String checkStr = StringUtils.EMPTY; + try { + checkStr = IOUtils.inputStream2String(file.asInputStream()); + tpl.readStream(file.asInputStream()); + } catch (Exception exp) { + String errorMessage = StringUtils.EMPTY; + errorMessage = ComparatorUtils.equals(RemoteDeziConstants.INVALID_USER, checkStr) ? Inter.getLocText("FR-Designer_No-Privilege") + : Inter.getLocText("NS-exception_readError"); + FRContext.getLogger().error(errorMessage + file, exp); + } + checkNameStyle(namestyle); + return tpl; + } + }; + } + + private static void checkNameStyle(TempNameStyle namestyle) { + Iterator it = namestyle.getIterator(); + ArrayList al = new ArrayList(); + while (it.hasNext()) { + al.add((String) it.next()); + } + if (!al.isEmpty()) { + showConfirmDialog(al); + } + } + + private static void showConfirmDialog(final ArrayList namelist) { + + final JDialog jd = new JDialog(); + // 模态一下,因为可能会多个样式丢失 + // jd.setModal(true); + jd.setAlwaysOnTop(true); + jd.setSize(450, 150); + jd.setResizable(false); + jd.setIconImage(BaseUtils.readImage("/com/fr/base/images/oem/logo.png")); + String message = namelist.toString().replaceAll("\\[", "").replaceAll("\\]", ""); + UILabel jl = new UILabel(Inter.getLocText(new String[]{"Current_custom_global", "Has_been_gone"}, new String[]{message})); + jl.setHorizontalAlignment(SwingConstants.CENTER); + jd.add(jl, BorderLayout.CENTER); + JPanel jp = new JPanel(); + + // ”是“按钮,点击之后将生成一个全局样式,并写入xml + UIButton confirmButton = new UIButton(Inter.getLocText("FR-Designer_Yes")); + confirmButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + try { + for (int i = 0; i < namelist.size(); i++) { + ConfigManager.getProviderInstance().putStyle(namelist.get(i), Style.DEFAULT_STYLE); + FRContext.getCurrentEnv().writeResource(ConfigManager.getProviderInstance()); + } + } catch (Exception ex) { + FRLogger.getLogger().error(ex.getMessage()); + } + jd.dispose(); + new StyleListAction().actionPerformed(e);// 弹窗 + } + }); + + UIButton noButton = new UIButton(Inter.getLocText("FR-Designer_No")); + noButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + jd.dispose(); + } + }); + + jp.add(confirmButton); + jp.add(noButton); + jd.setTitle(Inter.getLocText("FR-Custom_styles_lost")); + jd.add(jp, BorderLayout.SOUTH); + GUICoreUtils.centerWindow(jd); + jd.setVisible(true); + } + + public Class[] actionsForInsertCellElement() { + return (Class[]) ArrayUtils.addAll(new Class[]{ + DSColumnCellAction.class, + GeneralCellAction.class, + RichTextCellAction.class, + FormulaCellAction.class, + ChartCellAction.class, + ImageCellAction.class, + BiasCellAction.class, + SubReportCellAction.class + }, super.actionsForInsertCellElement()); + } + + public Class[] actionsForInsertFloatElement() { + return (Class[]) ArrayUtils.addAll(new Class[]{ + TextBoxFloatAction.class, + FormulaFloatAction.class, + ChartFloatAction.class, + ImageFloatAction.class + }, super.actionsForInsertFloatElement()); + } + + + private void registerData4Form() { + StableFactory.registerMarkedClass(FormECDesignerProvider.XML_TAG, FormElementCaseDesigner.class); + StableFactory.registerMarkedClass(FormECCompositeProvider.XML_TAG, FormReportComponentComposite.class); + DesignModuleFactory.registerParameterReader(new WorkBookParameterReader()); + } } \ No newline at end of file diff --git a/designer/src/com/fr/poly/creator/ChartBlockCreator.java b/designer/src/com/fr/poly/creator/ChartBlockCreator.java index d713356c60..ec74b37271 100644 --- a/designer/src/com/fr/poly/creator/ChartBlockCreator.java +++ b/designer/src/com/fr/poly/creator/ChartBlockCreator.java @@ -1,166 +1,156 @@ -/* - * Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved. - */ -package com.fr.poly.creator; - -import java.awt.*; -import java.awt.image.BufferedImage; - -import javax.swing.*; - -import com.fr.base.ScreenResolution; -import com.fr.design.DesignState; -import com.fr.design.designer.TargetComponent; -import com.fr.design.file.HistoryTemplateListPane; -import com.fr.design.gui.chart.MiddleChartComponent; -import com.fr.design.menu.MenuDef; -import com.fr.design.menu.ShortCut; -import com.fr.design.menu.ToolBarDef; -import com.fr.design.module.DesignModuleFactory; -import com.fr.design.selection.QuickEditor; -import com.fr.quickeditor.ChartQuickEditor; -import com.fr.report.poly.PolyChartBlock; -import com.fr.stable.unit.FU; -import com.fr.stable.unit.UNIT; -import com.fr.stable.unit.UnitRectangle; - -/** - * @author richer - * @since 6.5.4 创建于2011-5-10 - */ -public class ChartBlockCreator extends BlockCreator { - private MiddleChartComponent cpm; - private ChartBlockEditor editor; - - //图表默认宽高330*240 - private static final UNIT DEFAULT_WIDTH = FU.getInstance(12573000); - private static final UNIT DEFAULT_HEIGHT = FU.getInstance(9144000); - - - public ChartBlockCreator() { - - } - - public ChartBlockCreator(PolyChartBlock block) { - super(block); - } - - public void setResolution(int resolution){ - this.resolution = resolution; - } - - /** - * 初始化 - * @return 初始化的控件. - */ - public JComponent initMonitor() { - cpm = DesignModuleFactory.getChartComponent(getValue().getChartCollection()); - cpm.setBorder(BorderFactory.createLineBorder(Color.lightGray)); - return cpm; - } - - public UnitRectangle getDefaultBlockBounds() { - return new UnitRectangle(UNIT.ZERO, UNIT.ZERO, DEFAULT_WIDTH, DEFAULT_HEIGHT); - } - - @Override - public BlockEditor getEditor() { - if (editor == null) { - editor = new ChartBlockEditor(designer, this); - } - return editor; - } - - @Override - public int getX(float time) { - return (int) (this.getX() * time); - } - - @Override - public int getY(float time) { - return (int) (this.getY() * time); - } - - - /** - * 检测按钮状态 - * - * @date 2015-2-5-上午11:33:46 - * - */ - public void checkButtonEnable() { - if (editor == null) { - editor = new ChartBlockEditor(designer, this); - } - editor.checkChartButtonsEnable(); - } - - @Override - public PolyChartBlock getValue() { - return block; - } - - @Override - public void setValue(PolyChartBlock block) { - this.block = block; - cpm.populate(this.block.getChartCollection()); - } - - - - /** - * 获取当前工具栏组 - * - * @return 工具栏组 - * - * @date 2015-2-5-上午11:29:07 - * - */ - public ToolBarDef[] toolbars4Target() { - return new ToolBarDef[0]; - } - - /** - * 在Form的工具栏组 - * - * @return 组件数组 - * - * @date 2015-2-5-上午11:31:46 - * - */ - public JComponent[] toolBarButton4Form() { - return new JComponent[0]; - } - - /** - * 目标的列表 - * @return 返回列表. - */ - public MenuDef[] menus4Target() { - return new MenuDef[0]; - } - - public int getMenuState(){ - return DesignState.POLY_SHEET; - } - - /** - * 模板的Menu - * @return 模板的menu - */ - public ShortCut[] shortcut4TemplateMenu() { - return new ShortCut[0]; - } - - @Override - public PolyElementCasePane getEditingElementCasePane() { - return null; - } - - @Override - public QuickEditor getQuickEditor(TargetComponent tc) { - ChartQuickEditor quitEditor = new ChartQuickEditor(); - quitEditor.populate(tc); - return quitEditor; - } +package com.fr.poly.creator; + +import com.fr.design.DesignState; +import com.fr.design.designer.TargetComponent; +import com.fr.design.gui.chart.MiddleChartComponent; +import com.fr.design.menu.MenuDef; +import com.fr.design.menu.ShortCut; +import com.fr.design.menu.ToolBarDef; +import com.fr.design.module.DesignModuleFactory; +import com.fr.design.selection.QuickEditor; +import com.fr.quickeditor.chartquick.PolyChartQuickEditor; +import com.fr.report.poly.PolyChartBlock; +import com.fr.stable.unit.FU; +import com.fr.stable.unit.UNIT; +import com.fr.stable.unit.UnitRectangle; + +import javax.swing.*; +import java.awt.*; + +/** + * @author richer + * @since 6.5.4 创建于2011-5-10 + */ +public class ChartBlockCreator extends BlockCreator { + private MiddleChartComponent cpm; + private ChartBlockEditor editor; + + //图表默认宽高330*240 + private static final UNIT DEFAULT_WIDTH = FU.getInstance(12573000); + private static final UNIT DEFAULT_HEIGHT = FU.getInstance(9144000); + + + public ChartBlockCreator() { + + } + + public ChartBlockCreator(PolyChartBlock block) { + super(block); + } + + public void setResolution(int resolution) { + this.resolution = resolution; + } + + /** + * 初始化 + * + * @return 初始化的控件. + */ + public JComponent initMonitor() { + cpm = DesignModuleFactory.getChartComponent(getValue().getChartCollection()); + cpm.setBorder(BorderFactory.createLineBorder(Color.lightGray)); + return cpm; + } + + public UnitRectangle getDefaultBlockBounds() { + return new UnitRectangle(UNIT.ZERO, UNIT.ZERO, DEFAULT_WIDTH, DEFAULT_HEIGHT); + } + + @Override + public BlockEditor getEditor() { + if (editor == null) { + editor = new ChartBlockEditor(designer, this); + } + return editor; + } + + @Override + public int getX(float time) { + return (int) (this.getX() * time); + } + + @Override + public int getY(float time) { + return (int) (this.getY() * time); + } + + + /** + * 检测按钮状态 + * + * @date 2015-2-5-上午11:33:46 + */ + public void checkButtonEnable() { + if (editor == null) { + editor = new ChartBlockEditor(designer, this); + } + editor.checkChartButtonsEnable(); + } + + @Override + public PolyChartBlock getValue() { + return block; + } + + @Override + public void setValue(PolyChartBlock block) { + this.block = block; + cpm.populate(this.block.getChartCollection()); + } + + + /** + * 获取当前工具栏组 + * + * @return 工具栏组 + * @date 2015-2-5-上午11:29:07 + */ + public ToolBarDef[] toolbars4Target() { + return new ToolBarDef[0]; + } + + /** + * 在Form的工具栏组 + * + * @return 组件数组 + * @date 2015-2-5-上午11:31:46 + */ + public JComponent[] toolBarButton4Form() { + return new JComponent[0]; + } + + /** + * 目标的列表 + * + * @return 返回列表. + */ + public MenuDef[] menus4Target() { + return new MenuDef[0]; + } + + public int getMenuState() { + return DesignState.POLY_SHEET; + } + + /** + * 模板的Menu + * + * @return 模板的menu + */ + public ShortCut[] shortcut4TemplateMenu() { + return new ShortCut[0]; + } + + @Override + public PolyElementCasePane getEditingElementCasePane() { + return null; + } + + @Override + public QuickEditor getQuickEditor(TargetComponent tc) { + PolyChartQuickEditor quitEditor = new PolyChartQuickEditor(); + quitEditor.populate(tc); + return quitEditor; + } } \ No newline at end of file diff --git a/designer/src/com/fr/quickeditor/ChartQuickEditor.java b/designer/src/com/fr/quickeditor/ChartQuickEditor.java deleted file mode 100644 index 91ddc28b6f..0000000000 --- a/designer/src/com/fr/quickeditor/ChartQuickEditor.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.fr.quickeditor; - -import com.fr.base.chart.BaseChartCollection; -//import com.fr.chart.chartattr.ChartCollection; -import com.fr.design.designer.TargetComponent; -import com.fr.design.gui.chart.BaseChartPropertyPane; -import com.fr.design.mainframe.ElementCasePane; -import com.fr.design.module.DesignModuleFactory; -import com.fr.design.selection.QuickEditor; -import com.fr.grid.selection.CellSelection; -import com.fr.grid.selection.FloatSelection; -import com.fr.grid.selection.Selection; -import com.fr.poly.PolyDesigner; -import com.fr.poly.creator.ChartBlockEditor; -import com.fr.report.cell.Elem; - -import java.awt.*; - -public class ChartQuickEditor extends QuickEditor{ - // kunsnat: editingPropertyPane初始化 避开设计器启动, 在用到的时候再初始化. - //private BaseChartPropertyPane editingPropertyPane = null; - public ChartQuickEditor() { - setLayout(new BorderLayout()); - setBorder(null); - } - - @Override - protected void refresh() { - BaseChartPropertyPane editingPropertyPane = null; - BaseChartCollection collection = null; - if(tc instanceof PolyDesigner) { - ChartBlockEditor chartBlockEditor = (ChartBlockEditor)((PolyDesigner)tc).getSelection().getEditor(); - collection = chartBlockEditor.getValue().getChartCollection(); - - add(editingPropertyPane = DesignModuleFactory.getChartPropertyPane(), BorderLayout.CENTER); - editingPropertyPane.setSupportCellData(false); - } else { - Selection selection = ((ElementCasePane)tc).getSelection(); - Elem element = null; - if(selection instanceof CellSelection) { - CellSelection cs = (CellSelection)selection; - element = ((ElementCasePane)tc).getEditingElementCase().getCellElement(cs.getColumn(), cs.getRow()); - } else if(selection instanceof FloatSelection){ - FloatSelection fs = (FloatSelection)selection; - element = ((ElementCasePane)tc).getEditingElementCase().getFloatElement(fs.getSelectedFloatName()); - } - collection = (BaseChartCollection) element.getValue(); - add(editingPropertyPane = DesignModuleFactory.getChartPropertyPane(), BorderLayout.CENTER); - - } - editingPropertyPane.populateChartPropertyPane(collection, tc); - } - -} \ No newline at end of file diff --git a/designer/src/com/fr/quickeditor/chartquick/BasicChartQuickEditor.java b/designer/src/com/fr/quickeditor/chartquick/BasicChartQuickEditor.java new file mode 100644 index 0000000000..c0671dfb85 --- /dev/null +++ b/designer/src/com/fr/quickeditor/chartquick/BasicChartQuickEditor.java @@ -0,0 +1,56 @@ +package com.fr.quickeditor.chartquick; + +import com.fr.base.chart.BaseChartCollection; +import com.fr.design.actions.core.ActionFactory; +import com.fr.design.actions.insert.cell.ChartCellAction; +import com.fr.design.gui.chart.BaseChartPropertyPane; +import com.fr.design.module.DesignModuleFactory; +import com.fr.grid.selection.CellSelection; +import com.fr.grid.selection.Selection; +import com.fr.quickeditor.CellQuickEditor; +import com.fr.report.cell.Elem; + +import javax.swing.*; +import java.awt.*; + + +public class BasicChartQuickEditor extends CellQuickEditor { + private JPanel content; + + public BasicChartQuickEditor() { + super(); + } + + @Override + public JComponent createCenterBody() { + content = new JPanel(); + content.setLayout(new BorderLayout()); + return content; + } + + @Override + public boolean isScrollAll() { + return false; + } + + @Override + public Object getComboBoxSelected() { + return ActionFactory.createAction(ChartCellAction.class); + } + + @Override + protected void refreshDetails() { + BaseChartPropertyPane editingPropertyPane; + BaseChartCollection collection; + Selection selection = tc.getSelection(); + Elem element; + CellSelection cs = (CellSelection) selection; + element = tc.getEditingElementCase().getCellElement(cs.getColumn(), cs.getRow()); + collection = (BaseChartCollection) element.getValue(); + editingPropertyPane = DesignModuleFactory.getChartPropertyPane(); + editingPropertyPane.setBorder(BorderFactory.createEmptyBorder()); + content.add(editingPropertyPane, BorderLayout.CENTER); + editingPropertyPane.populateChartPropertyPane(collection, tc); + } + +} \ No newline at end of file diff --git a/designer/src/com/fr/quickeditor/chartquick/FloatChartQuickEditor.java b/designer/src/com/fr/quickeditor/chartquick/FloatChartQuickEditor.java new file mode 100644 index 0000000000..723a3aba23 --- /dev/null +++ b/designer/src/com/fr/quickeditor/chartquick/FloatChartQuickEditor.java @@ -0,0 +1,34 @@ +package com.fr.quickeditor.chartquick; + +import com.fr.base.chart.BaseChartCollection; +import com.fr.design.gui.chart.BaseChartPropertyPane; +import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.module.DesignModuleFactory; +import com.fr.design.selection.QuickEditor; +import com.fr.grid.selection.FloatSelection; +import com.fr.grid.selection.Selection; +import com.fr.report.cell.Elem; + +import java.awt.*; + + +public class FloatChartQuickEditor extends QuickEditor { + public FloatChartQuickEditor() { + setLayout(new BorderLayout()); + setBorder(null); + } + + @Override + protected void refresh() { + BaseChartPropertyPane editingPropertyPane; + BaseChartCollection collection; + Selection selection = tc.getSelection(); + Elem element; + FloatSelection fs = (FloatSelection) selection; + element = tc.getEditingElementCase().getFloatElement(fs.getSelectedFloatName()); + collection = (BaseChartCollection) element.getValue(); + add(editingPropertyPane = DesignModuleFactory.getChartPropertyPane(), BorderLayout.CENTER); + editingPropertyPane.populateChartPropertyPane(collection, tc); + } + +} \ No newline at end of file diff --git a/designer/src/com/fr/quickeditor/chartquick/PolyChartQuickEditor.java b/designer/src/com/fr/quickeditor/chartquick/PolyChartQuickEditor.java new file mode 100644 index 0000000000..f1584f9adb --- /dev/null +++ b/designer/src/com/fr/quickeditor/chartquick/PolyChartQuickEditor.java @@ -0,0 +1,31 @@ +package com.fr.quickeditor.chartquick; + +import com.fr.base.chart.BaseChartCollection; +import com.fr.design.designer.TargetComponent; +import com.fr.design.gui.chart.BaseChartPropertyPane; +import com.fr.design.module.DesignModuleFactory; +import com.fr.design.selection.QuickEditor; +import com.fr.poly.PolyDesigner; +import com.fr.poly.creator.ChartBlockEditor; + +import java.awt.*; + + +public class PolyChartQuickEditor extends QuickEditor { + public PolyChartQuickEditor() { + setLayout(new BorderLayout()); + setBorder(null); + } + + @Override + protected void refresh() { + BaseChartPropertyPane editingPropertyPane; + BaseChartCollection collection; + ChartBlockEditor chartBlockEditor = (ChartBlockEditor) ((PolyDesigner) tc).getSelection().getEditor(); + collection = chartBlockEditor.getValue().getChartCollection(); + add(editingPropertyPane = DesignModuleFactory.getChartPropertyPane(), BorderLayout.CENTER); + editingPropertyPane.setSupportCellData(false); + editingPropertyPane.populateChartPropertyPane(collection, tc); + } + +} \ No newline at end of file diff --git a/designer_base/src/com/fr/design/actions/core/ActionFactory.java b/designer_base/src/com/fr/design/actions/core/ActionFactory.java index a8d9585337..bf59e82332 100644 --- a/designer_base/src/com/fr/design/actions/core/ActionFactory.java +++ b/designer_base/src/com/fr/design/actions/core/ActionFactory.java @@ -24,11 +24,11 @@ public class ActionFactory { private ActionFactory() { } - private static Map> floatEditor = new HashMap>(); + private static Map> floatEditor = new HashMap<>(); private static Class chartCollectionClass = null; - private static Map> cellEditor = new HashMap>(); + private static Map> cellEditor = new HashMap<>(); private static UpdateAction chartPreStyleAction = null; @@ -98,7 +98,7 @@ public class ActionFactory { } /** - * kunsnat: 图表注册 悬浮元素编辑器 , 因为ChartCollecion和ChartQuickEditor一个在Chart,一个在Designer, 所以分开注册. + * kunsnat: 图表注册 悬浮元素编辑器 , 因为ChartCollection和ChartQuickEditor一个在Chart,一个在Designer, 所以分开注册. * * @param editor 待说明 */ From 3e59cec9975d641c1621f2bb670a4fc853c3360a Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 9 Oct 2017 15:43:39 +0800 Subject: [PATCH 08/14] =?UTF-8?q?REPORT-4883=20=E6=A8=A1=E6=9D=BF=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=8E=A7=E4=BB=B6=E9=97=AE=E9=A2=98=3D>=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF=E5=86=85=E9=83=A8?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=97=B6=EF=BC=8C=E5=8F=AF=E7=BB=A7=E7=BB=AD?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_form/src/com/fr/design/mainframe/JForm.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/designer_form/src/com/fr/design/mainframe/JForm.java b/designer_form/src/com/fr/design/mainframe/JForm.java index 650c5fb3eb..2aa57462b6 100644 --- a/designer_form/src/com/fr/design/mainframe/JForm.java +++ b/designer_form/src/com/fr/design/mainframe/JForm.java @@ -331,7 +331,7 @@ public class JForm extends JTemplate implements BaseJForm { ParameterPropertyPane.getInstance().setAddParaPaneVisible(false, this); return; } - ParameterPropertyPane.getInstance().setAddParaPaneVisible(comp instanceof XWParameterLayout, this); + ParameterPropertyPane.getInstance().setAddParaPaneVisible(isAddParaPaneVisible(comp), this); editingComponent = comp.createToolPane(this, formDesign); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM); if (BaseUtils.isAuthorityEditing()) { @@ -342,6 +342,16 @@ public class JForm extends JTemplate implements BaseJForm { } } + private boolean isAddParaPaneVisible(XComponent comp) { + boolean isVisible = false; + try { + isVisible = comp instanceof XWParameterLayout || ((XCreator) comp).getParent() instanceof XWParameterLayout; + } catch (Throwable throwable) { + // 发生异常则返回 false + } + return isVisible; + } + public JComponent getEditingPane() { return editingComponent; } From 318f3ca76b420a0b8ee093e00c0fa2297488ac15 Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 9 Oct 2017 15:45:00 +0800 Subject: [PATCH 09/14] =?UTF-8?q?REPORT-4883=20=E6=A8=A1=E6=9D=BF=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=8E=A7=E4=BB=B6=E9=97=AE=E9=A2=98=3D>=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF=E5=86=85=E7=9A=84?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E5=90=8E=EF=BC=8C=E9=80=89=E4=B8=AD=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/designer/beans/models/SelectionModel.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java b/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java index 2fde27019b..354ba3f63d 100644 --- a/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java @@ -227,7 +227,11 @@ public class SelectionModel { XCreator[] roots = selection.getSelectedCreators(); if (roots.length > 0) { + boolean isInPara = true; // 在参数面板内删除控件 for (XCreator creator : roots) { + if (isInPara && !(creator.getParent() instanceof XWParameterLayout)) { + isInPara = false; + } if (creator.acceptType(XWParameterLayout.class)) { designer.removeParaComponent(); } @@ -236,8 +240,7 @@ public class SelectionModel { // 清除被选中的组件 selection.reset(); } - setSelectedCreator(designer.getRootComponent()); - FormSelectionUtils.rebuildSelection(designer); + setSelectedCreator(isInPara ? designer.getParaComponent() : designer.getRootComponent()); // 触发事件 designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_DELETED); designer.repaint(); From 0d7933f133894aacc5810caa836ff62f9632e6e2 Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 9 Oct 2017 15:49:25 +0800 Subject: [PATCH 10/14] =?UTF-8?q?REPORT-4947=20=E8=A1=A8=E5=8D=95=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=8F=AF=E7=94=A8=E5=8F=AF=E8=A7=81=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/widget/BasicPropertyPane.java | 2 +- .../design/mainframe/widget/ui/BasicSetVisiblePropertyPane.java | 2 ++ .../design/mainframe/widget/ui/FormBasicWidgetPropertyPane.java | 2 ++ .../com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java b/designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java index 9e71296d3b..12b83b3e7d 100644 --- a/designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java +++ b/designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java @@ -28,7 +28,7 @@ public class BasicPropertyPane extends BasicPane { this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); widgetName = new UITextField(); - widgetName.setGlobalName(Inter.getLocText("FR-Designer_Widget_Name")); + widgetName.setGlobalName(Inter.getLocText("FR-Designer_Basic")); double f = TableLayout.FILL; double p = TableLayout.PREFERRED; double[] rowSize = {p}; diff --git a/designer_form/src/com/fr/design/mainframe/widget/ui/BasicSetVisiblePropertyPane.java b/designer_form/src/com/fr/design/mainframe/widget/ui/BasicSetVisiblePropertyPane.java index e67bfc8bab..8b13c4e072 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/ui/BasicSetVisiblePropertyPane.java +++ b/designer_form/src/com/fr/design/mainframe/widget/ui/BasicSetVisiblePropertyPane.java @@ -27,6 +27,8 @@ public class BasicSetVisiblePropertyPane extends FormBasicPropertyPane { pane2.add(otherOtherConfig); } visibleCheckBox = new UICheckBox(Inter.getLocText("Widget-Visible"), true); + visibleCheckBox.setGlobalName(Inter.getLocText("FR-Designer_Basic")); + visibleCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); pane2.add(visibleCheckBox); this.add(pane2, BorderLayout.CENTER); diff --git a/designer_form/src/com/fr/design/mainframe/widget/ui/FormBasicWidgetPropertyPane.java b/designer_form/src/com/fr/design/mainframe/widget/ui/FormBasicWidgetPropertyPane.java index d6aa882960..ccb3a1e915 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/ui/FormBasicWidgetPropertyPane.java +++ b/designer_form/src/com/fr/design/mainframe/widget/ui/FormBasicWidgetPropertyPane.java @@ -17,6 +17,8 @@ public class FormBasicWidgetPropertyPane extends BasicSetVisiblePropertyPane { public UICheckBox createOtherConfig() { enableCheckBox = new UICheckBox(Inter.getLocText("Enabled"), true); + enableCheckBox.setGlobalName(Inter.getLocText("FR-Designer_Basic")); + enableCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); return enableCheckBox; } diff --git a/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java b/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java index 66339e1780..ac9e5848d7 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java +++ b/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java @@ -210,7 +210,7 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane { public void updateCreator() { currentEditorDefinePane.setGlobalName(getGlobalName()); Widget widget = currentEditorDefinePane.updateBean(); - if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_Widget_Name")) && widgetPropertyPane != null) { + if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_Basic")) && widgetPropertyPane != null) { widgetPropertyPane.update(widget); xCreator.resetCreatorName(widget.getWidgetName()); designer.getEditListenerTable().fireCreatorModified(xCreator, DesignerEvent.CREATOR_RENAMED); From 7f7c22f2c520e22c6ede74f91e19662e44eca8cc Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 9 Oct 2017 16:07:07 +0800 Subject: [PATCH 11/14] =?UTF-8?q?REPORT-4883=20=E6=A8=A1=E6=9D=BF=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=8E=A7=E4=BB=B6=E9=97=AE=E9=A2=98=3D>=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=8F=82=E6=95=B0=EF=BC=8C=E5=86=8D=E6=92=A4=E9=94=80?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=88=B7=E6=96=B0=E5=8F=B3=E4=B8=8A=E8=A7=92?= =?UTF-8?q?=E7=9A=84=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_form/src/com/fr/design/mainframe/JForm.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer_form/src/com/fr/design/mainframe/JForm.java b/designer_form/src/com/fr/design/mainframe/JForm.java index 2aa57462b6..6a1789b4b5 100644 --- a/designer_form/src/com/fr/design/mainframe/JForm.java +++ b/designer_form/src/com/fr/design/mainframe/JForm.java @@ -556,6 +556,7 @@ public class JForm extends JTemplate implements BaseJForm { //撤销的时候要重新选择的body布局 this.formDesign.getSelectionModel().setSelectedCreators(FormSelectionUtils.rebuildSelection(formDesign.getRootComponent(), formDesign.getRootComponent() == selectedBodyLayout() ? u.getSelectWidgets() : new Widget[]{selectedBodyLayout().toData()})); + refreshToolArea(); } else { String widgetName = this.formDesign.getElementCaseContainerName(); //这儿太坑了,u.getForm() 与 getTarget内容不一样 From 315bed73112b850788ac137f1e68515e1fbb820a Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Mon, 9 Oct 2017 16:09:08 +0800 Subject: [PATCH 12/14] =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E5=A4=A7=E5=B0=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/quickeditor/CellQuickEditor.java | 2 +- .../chartquick/BasicChartQuickEditor.java | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/designer/src/com/fr/quickeditor/CellQuickEditor.java b/designer/src/com/fr/quickeditor/CellQuickEditor.java index 2b5ce14c7a..43b291c974 100644 --- a/designer/src/com/fr/quickeditor/CellQuickEditor.java +++ b/designer/src/com/fr/quickeditor/CellQuickEditor.java @@ -66,7 +66,7 @@ public abstract class CellQuickEditor extends QuickEditor { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {p, f}; - double[] rowSize = {p, p}; + double[] rowSize = {p, f}; JComponent centerBody = createCenterBody(); JPanel topContent = initTopContent(); if (isScrollAll()) { diff --git a/designer/src/com/fr/quickeditor/chartquick/BasicChartQuickEditor.java b/designer/src/com/fr/quickeditor/chartquick/BasicChartQuickEditor.java index c0671dfb85..7873f50891 100644 --- a/designer/src/com/fr/quickeditor/chartquick/BasicChartQuickEditor.java +++ b/designer/src/com/fr/quickeditor/chartquick/BasicChartQuickEditor.java @@ -11,11 +11,10 @@ import com.fr.quickeditor.CellQuickEditor; import com.fr.report.cell.Elem; import javax.swing.*; -import java.awt.*; public class BasicChartQuickEditor extends CellQuickEditor { - private JPanel content; + private BaseChartPropertyPane editingPropertyPane; public BasicChartQuickEditor() { super(); @@ -23,9 +22,9 @@ public class BasicChartQuickEditor extends CellQuickEditor { @Override public JComponent createCenterBody() { - content = new JPanel(); - content.setLayout(new BorderLayout()); - return content; + editingPropertyPane = DesignModuleFactory.getChartPropertyPane(); + editingPropertyPane.setBorder(BorderFactory.createEmptyBorder()); + return editingPropertyPane; } @Override @@ -40,16 +39,12 @@ public class BasicChartQuickEditor extends CellQuickEditor { @Override protected void refreshDetails() { - BaseChartPropertyPane editingPropertyPane; BaseChartCollection collection; Selection selection = tc.getSelection(); Elem element; CellSelection cs = (CellSelection) selection; element = tc.getEditingElementCase().getCellElement(cs.getColumn(), cs.getRow()); collection = (BaseChartCollection) element.getValue(); - editingPropertyPane = DesignModuleFactory.getChartPropertyPane(); - editingPropertyPane.setBorder(BorderFactory.createEmptyBorder()); - content.add(editingPropertyPane, BorderLayout.CENTER); editingPropertyPane.populateChartPropertyPane(collection, tc); } From 8a9a1d7e7316f2987c0bbcc31e7e973b5e793202 Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 9 Oct 2017 18:55:52 +0800 Subject: [PATCH 13/14] =?UTF-8?q?REPORT-4883=20=E4=BB=A3=E7=A0=81=E8=A7=84?= =?UTF-8?q?=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parameter/ParameterDefinitePane.java | 23 +-- .../designer/beans/models/SelectionModel.java | 150 ++++++++++-------- .../form/parameter/FormParaDesigner.java | 16 +- .../com/fr/design/mainframe/FormDesigner.java | 8 +- .../parameter/ParameterToolBarPane.java | 14 +- 5 files changed, 117 insertions(+), 94 deletions(-) diff --git a/designer/src/com/fr/design/parameter/ParameterDefinitePane.java b/designer/src/com/fr/design/parameter/ParameterDefinitePane.java index 4f8adabbbb..cb53dd8b7c 100644 --- a/designer/src/com/fr/design/parameter/ParameterDefinitePane.java +++ b/designer/src/com/fr/design/parameter/ParameterDefinitePane.java @@ -75,12 +75,23 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus this.setBorder(null); this.setLayout(FRGUIPaneFactory.createBorderLayout()); setComponentBg(this); -// formParaDesignEditor = new FormParaDesigner(new FormParameterUI()); paraDesignEditor = DesignModuleFactory.getFormParaDesigner(); if (paraDesignEditor == null) { return; } paraDesignEditor.initWidgetToolbarPane(); + + this.add(paraDesignEditor.createWrapper(), BorderLayout.CENTER); + + setButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/toolbarbtn/parametersetting.png")); + setButton.set4ToolbarButton(); + isshowWindowItem = new JCheckBoxMenuItem(Inter.getLocText("ParameterD-Show_Parameter_Window")); + isdelayItem = new JCheckBoxMenuItem(Inter.getLocText("ParameterD-Delay_Playing")); + + initListeners(); + } + + private void initListeners() { ((TargetComponent) paraDesignEditor).addTargetModifiedListener(new TargetModifiedListener() { @Override public void targetModified(TargetModifiedEvent e) { @@ -93,7 +104,6 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus paraDesignEditor.addListener(this); propertyChangeListener = new PropertyChangeAdapter() { - @Override public void propertyChange() { if (isEditing) { @@ -102,12 +112,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus } } }; - this.add(paraDesignEditor.createWrapper(), BorderLayout.CENTER); -// WidgetToolBarPane.getRecentSearchManger(formParaDesignEditor); - setButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/toolbarbtn/parametersetting.png")); - setButton.set4ToolbarButton(); - isshowWindowItem = new JCheckBoxMenuItem(Inter.getLocText("ParameterD-Show_Parameter_Window")); isshowWindowItem.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { @@ -116,9 +121,8 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus } } }); - isdelayItem = new JCheckBoxMenuItem(Inter.getLocText("ParameterD-Delay_Playing")); - isdelayItem.addItemListener(new ItemListener() { + isdelayItem.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { if (propertyChangeListener != null) { @@ -128,7 +132,6 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus } }); - setButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { diff --git a/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java b/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java index 354ba3f63d..e805ced3ca 100644 --- a/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java @@ -136,37 +136,7 @@ public class SelectionModel { private void unselectedPaste() { if (designer.getClass().equals(FormDesigner.class)) { if (selection.getSelectedCreator() instanceof XWFitLayout) { - if (selection.getSelectedCreator().getClass().equals(XWTabFitLayout.class)) { - XLayoutContainer container = (XLayoutContainer) selection.getSelectedCreator(); - //tab布局编辑器内部左上角第一个坐标点 - int leftUpX = container.toData().getMargin().getLeft() + 1; - int leftUpY = container.toData().getMargin().getTop() + 1; - //选中第一个坐标点坐在的组件 - selection.setSelectedCreator((XCreator) container.getComponentAt(leftUpX, leftUpY)); - Rectangle rectangle = selection.getRelativeBounds(); - if (hasSelectedPasteSource()) { - selectedPaste(); - } else { - FormSelectionUtils.paste2Container(designer, container, clipboard, - rectangle.x + rectangle.width / 2, - rectangle.y + DELTA_X_Y); - } - } else { - //自适应布局编辑器内部左上角第一个坐标点 - int leftUpX = designer.getRootComponent().toData().getMargin().getLeft() + 1; - int leftUpY = designer.getRootComponent().toData().getMargin().getTop() + 1; - //选中第一个坐标点坐在的组件 - selection.setSelectedCreator((XCreator) designer.getRootComponent().getComponentAt(leftUpX, leftUpY)); - Rectangle rectangle = selection.getRelativeBounds(); - if (hasSelectedPasteSource()) { - selectedPaste(); - } else { - FormSelectionUtils.paste2Container(designer, designer.getRootComponent(), - clipboard, - rectangle.x + rectangle.width / 2, - rectangle.y + DELTA_X_Y); - } - } + pasteXWFitLayout(); } else { //绝对布局 //编辑器外面还有两层容器,使用designer.getRootComponent()获取到的是编辑器中层的容器,不是编辑器表层 @@ -186,6 +156,40 @@ public class SelectionModel { } } + private void pasteXWFitLayout() { + if (selection.getSelectedCreator().getClass().equals(XWTabFitLayout.class)) { + XLayoutContainer container = (XLayoutContainer) selection.getSelectedCreator(); + //tab布局编辑器内部左上角第一个坐标点 + int leftUpX = container.toData().getMargin().getLeft() + 1; + int leftUpY = container.toData().getMargin().getTop() + 1; + //选中第一个坐标点坐在的组件 + selection.setSelectedCreator((XCreator) container.getComponentAt(leftUpX, leftUpY)); + Rectangle rectangle = selection.getRelativeBounds(); + if (hasSelectedPasteSource()) { + selectedPaste(); + } else { + FormSelectionUtils.paste2Container(designer, container, clipboard, + rectangle.x + rectangle.width / 2, + rectangle.y + DELTA_X_Y); + } + } else { + //自适应布局编辑器内部左上角第一个坐标点 + int leftUpX = designer.getRootComponent().toData().getMargin().getLeft() + 1; + int leftUpY = designer.getRootComponent().toData().getMargin().getTop() + 1; + //选中第一个坐标点坐在的组件 + selection.setSelectedCreator((XCreator) designer.getRootComponent().getComponentAt(leftUpX, leftUpY)); + Rectangle rectangle = selection.getRelativeBounds(); + if (hasSelectedPasteSource()) { + selectedPaste(); + } else { + FormSelectionUtils.paste2Container(designer, designer.getRootComponent(), + clipboard, + rectangle.x + rectangle.width / 2, + rectangle.y + DELTA_X_Y); + } + } + } + /** * 粘贴时选择组件 */ @@ -404,45 +408,57 @@ public class SelectionModel { if (x < (bounds.x - XCreatorConstants.RESIZE_BOX_SIZ)) { return Location.outer; } else if ((x >= (bounds.x - XCreatorConstants.RESIZE_BOX_SIZ)) && (x <= bounds.x)) { - if (y < (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) { - return Location.outer; - } else if ((y >= (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) && (y <= bounds.y)) { - return Location.left_top; - } else if ((y > bounds.y) && (y < (bounds.y + bounds.height))) { - return Location.left; - } else if ((y >= (bounds.y + bounds.height)) - && (y <= (bounds.y + bounds.height + XCreatorConstants.RESIZE_BOX_SIZ))) { - return Location.left_bottom; - } else { - return Location.outer; - } + return getDirectionLeft(bounds, y); } else if ((x > bounds.x) && (x < (bounds.x + bounds.width))) { - if (y < (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) { - return Location.outer; - } else if ((y >= (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) && (y <= bounds.y)) { - return Location.top; - } else if ((y > bounds.y) && (y < (bounds.y + bounds.height))) { - return Location.inner; - } else if ((y >= (bounds.y + bounds.height)) - && (y <= (bounds.y + bounds.height + XCreatorConstants.RESIZE_BOX_SIZ))) { - return Location.bottom; - } else { - return Location.outer; - } + return getDirectionCenter(bounds, y); } else if ((x >= (bounds.x + bounds.width)) && (x <= (bounds.x + bounds.width + XCreatorConstants.RESIZE_BOX_SIZ))) { - if (y < (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) { - return Location.outer; - } else if ((y >= (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) && (y <= bounds.y)) { - return Location.right_top; - } else if ((y > bounds.y) && (y < (bounds.y + bounds.height))) { - return Location.right; - } else if ((y >= (bounds.y + bounds.height)) - && (y <= (bounds.y + bounds.height + XCreatorConstants.RESIZE_BOX_SIZ))) { - return Location.right_bottom; - } else { - return Location.outer; - } + return getDirectionRight(bounds, y); + } else { + return Location.outer; + } + } + + private Direction getDirectionRight(Rectangle bounds, int y) { + if (y < (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) { + return Location.outer; + } else if ((y >= (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) && (y <= bounds.y)) { + return Location.right_top; + } else if ((y > bounds.y) && (y < (bounds.y + bounds.height))) { + return Location.right; + } else if ((y >= (bounds.y + bounds.height)) + && (y <= (bounds.y + bounds.height + XCreatorConstants.RESIZE_BOX_SIZ))) { + return Location.right_bottom; + } else { + return Location.outer; + } + } + + private Direction getDirectionCenter(Rectangle bounds, int y) { + if (y < (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) { + return Location.outer; + } else if ((y >= (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) && (y <= bounds.y)) { + return Location.top; + } else if ((y > bounds.y) && (y < (bounds.y + bounds.height))) { + return Location.inner; + } else if ((y >= (bounds.y + bounds.height)) + && (y <= (bounds.y + bounds.height + XCreatorConstants.RESIZE_BOX_SIZ))) { + return Location.bottom; + } else { + return Location.outer; + } + } + + private Direction getDirectionLeft(Rectangle bounds, int y) { + if (y < (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) { + return Location.outer; + } else if ((y >= (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) && (y <= bounds.y)) { + return Location.left_top; + } else if ((y > bounds.y) && (y < (bounds.y + bounds.height))) { + return Location.left; + } else if ((y >= (bounds.y + bounds.height)) + && (y <= (bounds.y + bounds.height + XCreatorConstants.RESIZE_BOX_SIZ))) { + return Location.left_bottom; } else { return Location.outer; } diff --git a/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java b/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java index cc100df8ed..b9d24b2cd8 100644 --- a/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java +++ b/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java @@ -70,6 +70,9 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP private static final int SECOND_H_LOCATION = 170; private static final int ADD_HEIGHT = 20; private static final int H_GAP = 105; + private static final int SUBMIT_BUTTON_H_LOCATION = 270; + private static final int PARA_IMAGE_SHIFT_X = -4; + private static final int FORM_AREA_PADDING_LEFT = 13; private static Image paraImage = BaseUtils.readImage("/com/fr/design/images/form/parameter.png"); @@ -166,12 +169,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP @Override public void fireCreatorModified(DesignerEvent evt) { - if (evt.getCreatorEventID() == DesignerEvent.CREATOR_ADDED - || evt.getCreatorEventID() == DesignerEvent.CREATOR_CUTED - || evt.getCreatorEventID() == DesignerEvent.CREATOR_PASTED - || evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED - || evt.getCreatorEventID() == DesignerEvent.CREATOR_EDITED - || evt.getCreatorEventID() == DesignerEvent.CREATOR_RENAMED) { + if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) { paraDefinitePane.setParameterArray( paraDefinitePane.getNoRepeatParas(DesignModelAdapter.getCurrentModelAdapter().getParameters())); paraDefinitePane.refreshParameter(); @@ -187,7 +185,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP */ public Component createWrapper() { FormArea area = new FormArea(this, false); - area.setBorder(BorderFactory.createEmptyBorder(0, 13, 0, 0)); + area.setBorder(BorderFactory.createEmptyBorder(0, FORM_AREA_PADDING_LEFT, 0, 0)); return area; } @@ -439,7 +437,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP } for (Parameter p : paras) { if (p.getName().equalsIgnoreCase(creator.toData().getWidgetName())) { - g.drawImage(paraImage, creator.getX() - 4, creator.getY() + 2, null); + g.drawImage(paraImage, creator.getX() + PARA_IMAGE_SHIFT_X, creator.getY() + 2, null); break; } } @@ -617,7 +615,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP formSubmitButton.setWidgetName("Search"); formSubmitButton.setText(Inter.getLocText("FR-Designer_Query")); xCreator = XCreatorUtils.createXCreator(formSubmitButton); - if (!(this.autoAddComponent(xCreator, 270, FIRST_V_LOCATION + V_COMPONENT_GAP + if (!(this.autoAddComponent(xCreator, SUBMIT_BUTTON_H_LOCATION, FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { return false; } diff --git a/designer_form/src/com/fr/design/mainframe/FormDesigner.java b/designer_form/src/com/fr/design/mainframe/FormDesigner.java index 98bfbfeb44..fe998656be 100644 --- a/designer_form/src/com/fr/design/mainframe/FormDesigner.java +++ b/designer_form/src/com/fr/design/mainframe/FormDesigner.java @@ -123,6 +123,7 @@ public class FormDesigner extends TargetComponent implements TreeSelection private static final int SECOND_H_LOCATION = 170; private static final int ADD_HEIGHT = 20; private static final int H_GAP = 105; + private static final int SUBMIT_BUTTON_H_LOCATION = 270; public FormDesigner(Form form) { this(form, null); @@ -294,7 +295,7 @@ public class FormDesigner extends TargetComponent implements TreeSelection formSubmitButton.setWidgetName("Search"); formSubmitButton.setText(Inter.getLocText("FR-Designer_Query")); xCreator = XCreatorUtils.createXCreator(formSubmitButton); - if (!(this.autoAddComponent(xCreator, 270, FIRST_V_LOCATION + V_COMPONENT_GAP + if (!(this.autoAddComponent(xCreator, SUBMIT_BUTTON_H_LOCATION, FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { return; } @@ -1146,7 +1147,7 @@ public class FormDesigner extends TargetComponent implements TreeSelection * 同步 */ public void populateRootSize() { - + // do nothing } /** @@ -1232,6 +1233,7 @@ public class FormDesigner extends TargetComponent implements TreeSelection */ @Override public void stopEditing() { + // do nothing } /** @@ -1411,7 +1413,7 @@ public class FormDesigner extends TargetComponent implements TreeSelection parent = parent.getParent(); } - Object[] components = path.toArray(); + Object[] components = (Object[]) path.toArray(); if (components.length == 0) { return null; } diff --git a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java index daac4c2db8..422c08ab09 100644 --- a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java +++ b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java @@ -35,6 +35,7 @@ public class ParameterToolBarPane extends BasicBeanPane { private static final int BUTTON_HEIGHT = 20; private static final int WIDTH = 225; private static final int L_H = 18; + private static final int LABEL_PADDING_LEFT = 4; public ParameterToolBarPane() { this.setLayout(new FlowParameterPaneLayout()); @@ -47,9 +48,9 @@ public class ParameterToolBarPane extends BasicBeanPane { return new Dimension(super.getPreferredSize().width, 18); } }; - label.setText(Inter.getLocText("FR-Following_parameters_are_not_generated")+":"); + label.setText(Inter.getLocText("FR-Following_parameters_are_not_generated") + ":"); label.setHorizontalAlignment(SwingConstants.LEFT); - label.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0)); + label.setBorder(BorderFactory.createEmptyBorder(0, LABEL_PADDING_LEFT, 0, 0)); this.add(label); addAll = new UIButton(Inter.getLocText("FR-Designer_Add_all")); @@ -68,7 +69,7 @@ public class ParameterToolBarPane extends BasicBeanPane { public Parameter getTargetParameter(UIButton button) { int index = parameterSelectedLabellist.indexOf(button); - if(index < 0 || index > parameterList.length - 1) { + if (index < 0 || index > parameterList.length - 1) { return null; } return parameterList[index]; @@ -122,12 +123,15 @@ public class ParameterToolBarPane extends BasicBeanPane { private class FlowParameterPaneLayout implements LayoutManager { public FlowParameterPaneLayout() { + // do nothing } public void addLayoutComponent(String name, Component comp) { + // do nothing } public void removeLayoutComponent(Component comp) { + // do nothing } public Dimension preferredLayoutSize(Container parent) { @@ -135,7 +139,7 @@ public class ParameterToolBarPane extends BasicBeanPane { layoutContainer(parent); - int h= ((parameterSelectedLabellist.size() == 0) ? 0 : breakid * (BUTTON_HEIGHT + GAP_V) + GAP_BV + L_H + GAP_H + addAll.getPreferredSize().height); + int h= (parameterSelectedLabellist.isEmpty() ? 0 : breakid * (BUTTON_HEIGHT + GAP_V) + GAP_BV + L_H + GAP_H + addAll.getPreferredSize().height); return new Dimension(w, h); } @@ -153,7 +157,7 @@ public class ParameterToolBarPane extends BasicBeanPane { breakid = 1; for (UIButton tab : parameterSelectedLabellist) { Dimension dim = tab.getPreferredSize(); - if(x + dim.width > width) { + if (x + dim.width > width) { breakid++; x = 0; y += (dim.height + GAP_V); From 873016ea354fbcf33ab91b11a21e6e71c08165b6 Mon Sep 17 00:00:00 2001 From: zack Date: Tue, 10 Oct 2017 09:53:30 +0800 Subject: [PATCH 14/14] =?UTF-8?q?REPORT-4841=20=E5=B9=B3=E5=8F=B0=E5=86=85?= =?UTF-8?q?=E6=89=93=E5=BC=80=E6=A0=87=E7=AD=BE=E9=A1=B5=E6=8F=92=E4=BB=B6?= =?UTF-8?q?,=E5=90=AF=E7=94=A8=E7=A6=81=E7=94=A8=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/gui/controlpane/UIControlPane.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java b/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java index 68b3675b6e..d3bfb96628 100644 --- a/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java +++ b/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java @@ -302,6 +302,8 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH ShortCut addItem = addItemShortCut().getShortCut(); addItem.intoJToolBar(topToolBar); topToolBar.validate(); + this.controlUpdatePane = createControlUpdatePane();//REPORT-4841 刷新一下编辑面板 + cardPane.add(controlUpdatePane, "EDIT"); this.repaint(); }