From c9dade872d60a30f8d4c08ae3edb9b5d8c84208e Mon Sep 17 00:00:00 2001 From: zhouping Date: Tue, 15 Nov 2016 14:45:11 +0800 Subject: [PATCH 01/18] =?UTF-8?q?REPORT-750=20=E8=A1=A8=E5=8D=95=E5=85=B1?= =?UTF-8?q?=E5=88=9B=E5=86=85=E6=B5=8B=E9=97=AE=E9=A2=98=20bugfix6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/designer/properties/WidgetPropertyTable.java | 3 ++- designer_form/src/com/fr/design/mainframe/FormDesigner.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java b/designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java index 9f53dddcce..f69771a54a 100644 --- a/designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java +++ b/designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java @@ -21,6 +21,7 @@ import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.cardlayout.XWCardLayout; +import com.fr.general.ComparatorUtils; public class WidgetPropertyTable extends AbstractPropertyTable { @@ -71,7 +72,7 @@ public class WidgetPropertyTable extends AbstractPropertyTable { if (size == 0 || size == 1) { XCreator creator = size == 0 ? designer.getRootComponent() : designer.getSelectionModel().getSelection() .getSelectedCreator(); - if (designer.isRoot(creator)) { + if (ComparatorUtils.equals(creator, designer.getRootComponent())) { groups = designer.getDesignerMode().createRootDesignerPropertyGroup(); } else { groups = getCreatorPropertyGroup(designer, creator); diff --git a/designer_form/src/com/fr/design/mainframe/FormDesigner.java b/designer_form/src/com/fr/design/mainframe/FormDesigner.java index cd3b5b448e..b24b2d96fc 100644 --- a/designer_form/src/com/fr/design/mainframe/FormDesigner.java +++ b/designer_form/src/com/fr/design/mainframe/FormDesigner.java @@ -853,7 +853,7 @@ public class FormDesigner extends TargetComponent
implements TreeSelection * @return 是则返回true */ public boolean isRoot(XCreator comp) { - return comp == rootComponent; + return comp == rootComponent || comp.acceptType(XWAbsoluteBodyLayout.class); } // 计算鼠标事件e所发生的位置相对根组件的位置关系 From dc825bd01ec3c3ae51ae6ef9b7a2d764c6cbf4bb Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Wed, 16 Nov 2016 12:04:48 +0800 Subject: [PATCH 02/18] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E5=B1=9E=E6=80=A7=E8=8F=9C=E5=8D=95=E9=87=8C=E9=9D=A2?= =?UTF-8?q?=E7=9A=84=E5=88=B7=E6=96=B0=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/ReportMobileAttrAction.java | 4 +- .../mainframe/ElementCasePaneDelegate.java | 1 - .../report/mobile/AppFitBrowserPane.java | 16 ++---- .../report/mobile/MobileToolBarPane.java | 32 +++++++++++ .../report/mobile/ReportMobileAttrPane.java | 25 ++++++--- .../dialog}/mobile/MobileRadioCheckPane.java | 13 +++-- .../dialog/mobile/MobileToolBarBeanPane.java | 56 +++++++++++++++++++ .../design/form/mobile/MobileToolBarPane.java | 32 +++++++++++ .../src/com/fr/design/mainframe/JForm.java | 8 ++- .../actions/FormMobileAttrAction.java | 56 +++++++++++++++++++ 10 files changed, 214 insertions(+), 29 deletions(-) create mode 100644 designer/src/com/fr/design/report/mobile/MobileToolBarPane.java rename {designer/src/com/fr/design/report => designer_base/src/com/fr/design/dialog}/mobile/MobileRadioCheckPane.java (83%) create mode 100644 designer_base/src/com/fr/design/dialog/mobile/MobileToolBarBeanPane.java create mode 100644 designer_form/src/com/fr/design/form/mobile/MobileToolBarPane.java create mode 100644 designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java diff --git a/designer/src/com/fr/design/actions/report/ReportMobileAttrAction.java b/designer/src/com/fr/design/actions/report/ReportMobileAttrAction.java index 2bf3856908..f5fd94a321 100644 --- a/designer/src/com/fr/design/actions/report/ReportMobileAttrAction.java +++ b/designer/src/com/fr/design/actions/report/ReportMobileAttrAction.java @@ -57,9 +57,7 @@ public class ReportMobileAttrAction extends JWorkBookAction{ private static final MenuKeySet REPORT_APP_ATTR = new MenuKeySet() { @Override - public char getMnemonic() { - return 'P'; - } + public char getMnemonic() { return 'P'; } @Override public String getMenuName() { diff --git a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java index 79c60d2dc2..67e6975343 100644 --- a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -3,7 +3,6 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; import com.fr.design.fun.MenuHandler; import com.fr.design.menu.KeySetUtils; -import com.fr.design.parameter.ParameterPropertyPane; import com.fr.general.Inter; import com.fr.page.ReportSettingsProvider; import com.fr.design.file.HistoryTemplateListPane; diff --git a/designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java b/designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java index 43471b751d..2b1f44f389 100644 --- a/designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java +++ b/designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java @@ -19,8 +19,6 @@ public class AppFitBrowserPane extends BasicBeanPane { private MobileRadioGroupPane horizionPane; //竖屏设置面板 private MobileRadioGroupPane verticalPane; - //缩放选项面板 - private MobileRadioCheckPane radioCheckPane; //效果预览面板 private AppFitPreviewPane appFitPreviewPane; @@ -36,16 +34,13 @@ public class AppFitBrowserPane extends BasicBeanPane { JPanel fitOpsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); horizionPane = new MobileRadioGroupPane(Inter.getLocText("FR-Designer_Mobile-Horizontal")); verticalPane = new MobileRadioGroupPane(Inter.getLocText("FR-Designer_Mobile-Vertical")); - radioCheckPane = new MobileRadioCheckPane(Inter.getLocText("FR-Designer_Mobile-Zoom")); ActionListener actionListener = getAppPreviewActionListener(); horizionPane.addActionListener(actionListener); verticalPane.addActionListener(actionListener); fitOpsPane.add(horizionPane, BorderLayout.NORTH); - fitOpsPane.add(verticalPane, BorderLayout.CENTER); - fitOpsPane.add(radioCheckPane, BorderLayout.SOUTH); + fitOpsPane.add(verticalPane, BorderLayout.SOUTH); borderPane.add(fitOpsPane); this.add(borderPane); - } public void setAppFitPreviewPane(AppFitPreviewPane appFitPreviewPane) { @@ -54,7 +49,7 @@ public class AppFitBrowserPane extends BasicBeanPane { //纵向和横向独立设置 public int[] getCurrentFitOptions() { - return new int[]{horizionPane.getSelectRadioIndex(), verticalPane.getSelectRadioIndex(), radioCheckPane.getCurrentState()}; + return new int[]{horizionPane.getSelectRadioIndex(), verticalPane.getSelectRadioIndex()}; } @Override @@ -64,7 +59,7 @@ public class AppFitBrowserPane extends BasicBeanPane { } horizionPane.populateBean(ob.getHorziontalAttr()); verticalPane.populateBean(ob.getVerticalAttr()); - radioCheckPane.populateBean(ob.isZoom()); +// radioCheckPane.populateBean(ob.isZoom()); appFitPreviewPane.refreshPreview(getCurrentFitOptions()); } @@ -73,8 +68,9 @@ public class AppFitBrowserPane extends BasicBeanPane { public ElementCaseMobileAttr updateBean() { MobileFitAttrState horizonState = horizionPane.updateBean(); MobileFitAttrState verticalState = verticalPane.updateBean(); - boolean isZoom = radioCheckPane.updateBean(); - return new ElementCaseMobileAttr(horizonState, verticalState, isZoom); +// boolean isZoom = radioCheckPane.updateBean(); +// return new ElementCaseMobileAttr(horizonState, verticalState, isZoom); + return new ElementCaseMobileAttr(horizonState, verticalState); } @Override diff --git a/designer/src/com/fr/design/report/mobile/MobileToolBarPane.java b/designer/src/com/fr/design/report/mobile/MobileToolBarPane.java new file mode 100644 index 0000000000..2a151c4718 --- /dev/null +++ b/designer/src/com/fr/design/report/mobile/MobileToolBarPane.java @@ -0,0 +1,32 @@ +package com.fr.design.report.mobile; + +import com.fr.design.dialog.mobile.MobileToolBarBeanPane; +import com.fr.report.mobile.ElementCaseMobileAttr; + +/** + * Created by 方磊 on 2016/11/8. + */ +public class MobileToolBarPane extends MobileToolBarBeanPane { + + @Override + public void populateBean(ElementCaseMobileAttr ob) { + if (ob == null) { + ob = new ElementCaseMobileAttr(); + } + super.getZoomCheckPane().populateBean(ob.isZoom()); + super.getRefreshCheckPane().populateBean(ob.isRefresh()); + } + + @Override + public ElementCaseMobileAttr updateBean() { + return null; + } + + @Override + public void updateBean(ElementCaseMobileAttr mobileAttr) { + if(mobileAttr != null) { + mobileAttr.setZoom(super.getZoomCheckPane().updateBean()); + mobileAttr.setRefresh(super.getRefreshCheckPane().updateBean()); + } + } +} diff --git a/designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java b/designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java index 3c00232194..5b97137102 100644 --- a/designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java +++ b/designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java @@ -1,6 +1,7 @@ package com.fr.design.report.mobile; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.general.Inter; import com.fr.report.mobile.ElementCaseMobileAttr; @@ -16,22 +17,30 @@ public class ReportMobileAttrPane extends BasicBeanPane{ private MobileUseHtmlGroupPane htmlGroupPane; + //工具栏容器 + private MobileToolBarPane mobileToolBarPane; + public ReportMobileAttrPane() { initComponents(); } private void initComponents() { - this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); - this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); AppFitPreviewPane appFitPreviewPane = new AppFitPreviewPane(); - + this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + JPanel jPanel = new JPanel(); + jPanel.setLayout(new BoxLayout(jPanel, BoxLayout.Y_AXIS)); + jPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); appFitBrowserPane = new AppFitBrowserPane(); appFitBrowserPane.setAppFitPreviewPane(appFitPreviewPane); - this.add(appFitBrowserPane); + jPanel.add(appFitBrowserPane); - this.add(htmlGroupPane = new MobileUseHtmlGroupPane()); + jPanel.add(htmlGroupPane = new MobileUseHtmlGroupPane()); - this.add(appFitPreviewPane); + jPanel.add(mobileToolBarPane = new MobileToolBarPane()); + + jPanel.add(appFitPreviewPane); + UIScrollPane scrollPane = new UIScrollPane(jPanel); + this.add(scrollPane); } @Override @@ -40,7 +49,7 @@ public class ReportMobileAttrPane extends BasicBeanPane{ ob = new ElementCaseMobileAttr(); } appFitBrowserPane.populateBean(ob); - + mobileToolBarPane.populateBean(ob); htmlGroupPane.populateBean(ob); } @@ -48,7 +57,7 @@ public class ReportMobileAttrPane extends BasicBeanPane{ @Override public ElementCaseMobileAttr updateBean() { ElementCaseMobileAttr caseMobileAttr = appFitBrowserPane.updateBean(); - + mobileToolBarPane.updateBean(caseMobileAttr); htmlGroupPane.updateBean(caseMobileAttr); return caseMobileAttr; diff --git a/designer/src/com/fr/design/report/mobile/MobileRadioCheckPane.java b/designer_base/src/com/fr/design/dialog/mobile/MobileRadioCheckPane.java similarity index 83% rename from designer/src/com/fr/design/report/mobile/MobileRadioCheckPane.java rename to designer_base/src/com/fr/design/dialog/mobile/MobileRadioCheckPane.java index 9264619d32..ee38557612 100644 --- a/designer/src/com/fr/design/report/mobile/MobileRadioCheckPane.java +++ b/designer_base/src/com/fr/design/dialog/mobile/MobileRadioCheckPane.java @@ -1,4 +1,4 @@ -package com.fr.design.report.mobile; +package com.fr.design.dialog.mobile; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.icheckbox.UICheckBox; @@ -13,6 +13,9 @@ import java.awt.*; import java.util.ArrayList; import java.util.List; +/** + * 这个类要被复用,移动到design_base中去 + */ public class MobileRadioCheckPane extends BasicBeanPane { private List checkBoxes = new ArrayList(); @@ -26,16 +29,16 @@ public class MobileRadioCheckPane extends BasicBeanPane { double[] rowSize = {p}; double[] columnSize = {p,p}; - UICheckBox checkBox = new UICheckBox(Inter.getLocText("FR-Designer_Mobile-Open")); - checkBox.setSelected(true); + UICheckBox checkBox = new UICheckBox(title); + checkBox.setSelected(false); checkBoxes.add(checkBox); Component[][] components = new Component[][]{ - new Component[]{new UILabel(title), checkBox} + new Component[]{checkBox} }; JPanel fitOpsPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - fitOpsPane.setBorder(BorderFactory.createEmptyBorder(10, 13, 10, 10)); + fitOpsPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 10, 0)); this.add(fitOpsPane); } diff --git a/designer_base/src/com/fr/design/dialog/mobile/MobileToolBarBeanPane.java b/designer_base/src/com/fr/design/dialog/mobile/MobileToolBarBeanPane.java new file mode 100644 index 0000000000..6ccf73e2c5 --- /dev/null +++ b/designer_base/src/com/fr/design/dialog/mobile/MobileToolBarBeanPane.java @@ -0,0 +1,56 @@ +package com.fr.design.dialog.mobile; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.general.Inter; + +import javax.swing.*; +import java.awt.*; + +/** + * Created by fanglei on 2016/11/14. + * 这个toolbar类需要被design和design_form两个模块复用,所以为了结构精简,抽出共同方法作为抽象类供它们使用 + */ +public abstract class MobileToolBarBeanPane extends BasicBeanPane { + //缩放选项面板 + private MobileRadioCheckPane zoomCheckPane; + + //刷新选项面板 + private MobileRadioCheckPane refreshCheckPane; + + public MobileRadioCheckPane getZoomCheckPane() { + return zoomCheckPane; + } + + public MobileRadioCheckPane getRefreshCheckPane() { + return refreshCheckPane; + } + + public MobileToolBarBeanPane() { + initComponents(); + } + + private void initComponents() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + JPanel borderPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow()); + JPanel toobarsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + + UILabel uiLabel = new UILabel("html5"); + uiLabel.setBorder(BorderFactory.createEmptyBorder(5, 15, 10, 15)); + zoomCheckPane = new MobileRadioCheckPane(Inter.getLocText("FR-Designer_Mobile-Zoom")); + refreshCheckPane = new MobileRadioCheckPane("刷新"); + + toobarsPane.add(uiLabel, BorderLayout.WEST); + toobarsPane.add(zoomCheckPane, BorderLayout.CENTER); + toobarsPane.add(refreshCheckPane, BorderLayout.EAST); + borderPane.add(toobarsPane); + this.add(borderPane); + } + + @Override + protected String title4PopupWindow() { + return "工具栏"; + } + +} diff --git a/designer_form/src/com/fr/design/form/mobile/MobileToolBarPane.java b/designer_form/src/com/fr/design/form/mobile/MobileToolBarPane.java new file mode 100644 index 0000000000..2dd0dee51d --- /dev/null +++ b/designer_form/src/com/fr/design/form/mobile/MobileToolBarPane.java @@ -0,0 +1,32 @@ +package com.fr.design.form.mobile; + +import com.fr.design.dialog.mobile.MobileToolBarBeanPane; +import com.fr.report.mobile.ElementCaseMobileAttr; + +/** + * Created by 方磊 on 2016/11/8. + */ +public class MobileToolBarPane extends MobileToolBarBeanPane { + + @Override + public void populateBean(ElementCaseMobileAttr ob) { + if (ob == null) { + ob = new ElementCaseMobileAttr(); + } + super.getZoomCheckPane().populateBean(ob.isZoom()); + super.getRefreshCheckPane().populateBean(ob.isRefresh()); + } + + @Override + public ElementCaseMobileAttr updateBean() { + return null; + } + + @Override + public void updateBean(ElementCaseMobileAttr mobileAttr) { + if(mobileAttr != null) { + mobileAttr.setZoom(super.getZoomCheckPane().updateBean()); + mobileAttr.setRefresh(super.getRefreshCheckPane().updateBean()); + } + } +} diff --git a/designer_form/src/com/fr/design/mainframe/JForm.java b/designer_form/src/com/fr/design/mainframe/JForm.java index c88ebe012b..2c20fbac18 100644 --- a/designer_form/src/com/fr/design/mainframe/JForm.java +++ b/designer_form/src/com/fr/design/mainframe/JForm.java @@ -4,6 +4,7 @@ import com.fr.base.BaseUtils; import com.fr.design.DesignState; import com.fr.design.actions.core.WorkBookSupportable; import com.fr.design.actions.file.WebPreviewUtils; +import com.fr.design.mainframe.actions.FormMobileAttrAction; import com.fr.design.cell.FloatElementsProvider; import com.fr.design.constants.UIConstants; import com.fr.design.designer.beans.actions.FormDeleteAction; @@ -71,6 +72,7 @@ public class JForm extends JTemplate implements BaseJForm { private JComponent editingComponent; private FormECCompositeProvider reportComposite; + //FORM_TAB代表是否点击编辑,用于点击编辑前后菜单的显示 protected int index = FORM_TAB; public JForm() { @@ -383,11 +385,13 @@ public class JForm extends JTemplate implements BaseJForm { public ShortCut[] shortcut4TemplateMenu() { if (this.index == FORM_TAB) { return (ShortCut[]) ArrayUtils.addAll(new ShortCut[]{ - new TemplateParameterAction(this) + new TemplateParameterAction(this), + new FormMobileAttrAction(this) }, new ShortCut[0]); } else { return (ShortCut[]) ArrayUtils.addAll(new ShortCut[]{ - new TemplateParameterAction(this) + new TemplateParameterAction(this), + new FormMobileAttrAction(this) }, this.elementCaseDesign.shortcut4TemplateMenu()); } } diff --git a/designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java b/designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java new file mode 100644 index 0000000000..241d4757ea --- /dev/null +++ b/designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java @@ -0,0 +1,56 @@ +package com.fr.design.mainframe.actions; + +import com.fr.base.BaseUtils; +import com.fr.design.actions.JTemplateAction; +import com.fr.design.mainframe.JForm; +import com.fr.design.menu.MenuKeySet; +import com.fr.form.main.Form; +import com.fr.report.mobile.ElementCaseMobileAttr; + +import javax.swing.*; +import java.awt.event.ActionEvent; + +/** + * Created by fanglei on 2016/11/14. + */ +public class FormMobileAttrAction extends JTemplateAction { + + public FormMobileAttrAction(JForm jf) { + super(jf); + this.setMenuKeySet(REPORT_APP_ATTR); + this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/mobile.png")); + } + + /** + * 执行动作 + * + * @return 是否执行成功 + */ + @Override + public void actionPerformed(ActionEvent e) { + final JForm jf = getEditingComponent(); + if (jf == null) { + return; + } + final Form formTpl = jf.getTarget(); + } + + private static final MenuKeySet REPORT_APP_ATTR = new MenuKeySet() { + @Override + public char getMnemonic() { + return 'T'; + } + + @Override + public String getMenuName() { + return "移动端属性"; + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; +} From c8a1ab412dbff603249b46b36d118c3cac4ada88 Mon Sep 17 00:00:00 2001 From: fr_shine Date: Wed, 16 Nov 2016 16:50:54 +0800 Subject: [PATCH 03/18] =?UTF-8?q?=E6=97=A5=E6=96=87=E8=AF=AD=E8=A8=80?= =?UTF-8?q?=E4=B8=8B=EF=BC=8C=E8=B0=83=E6=8E=92=E7=89=88=E5=92=8Ctooltip?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/chart/gui/ChartDataPane.java | 3 +++ .../chart/gui/data/NormalChartDataPane.java | 2 +- .../chart/gui/data/TableDataPane.java | 2 +- .../CategoryPlotTableDataContentPane.java | 2 +- .../table/SeriesNameUseFieldValuePane.java | 9 ++++---- .../data/table/SeriesTypeUseComboxPane.java | 2 +- .../chart/gui/type/ChartTabPane.java | 23 +++++++++++++++++++ 7 files changed, 35 insertions(+), 8 deletions(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartDataPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartDataPane.java index 7fc3c79d93..464d6aaf96 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartDataPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartDataPane.java @@ -15,6 +15,9 @@ import javax.swing.*; import java.awt.*; public class ChartDataPane extends AbstractChartAttrPane { + + public static final int LABEL_WIDTH = 85; + public static final int LABEL_HEIGHT = 20; protected DataContentsPane contentsPane; protected AttributeChangeListener listener; diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java index d5aa2d93ec..cae7afc39a 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java @@ -57,7 +57,7 @@ public class NormalChartDataPane extends DataContentsPane { JPanel northPane = new JPanel(new BorderLayout(LayoutConstants.HGAP_LARGE,0)); northPane.add(jcb, BorderLayout.CENTER); UILabel label1 = new UILabel(Inter.getLocText("Chart-Data_Resource") + ":", SwingConstants.RIGHT); - label1.setPreferredSize(new Dimension(75,20)); + label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH,ChartDataPane.LABEL_HEIGHT)); northPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label1, null})); this.add(northPane, BorderLayout.NORTH); this.add(cardPane, BorderLayout.CENTER); diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java index 2bed0cb2d4..3b6c71ef1e 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java @@ -32,7 +32,7 @@ public class TableDataPane extends FurtherBasicBeanPane{ private void initDataPane() { UILabel label = new BoldFontTextLabel(Inter.getLocText("Chart-DS_TableData") + ":", SwingConstants.RIGHT) ; - label.setPreferredSize(new Dimension(75,20)); + label.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH,ChartDataPane.LABEL_HEIGHT)); tableDataPane = new DatabaseTableDataPane(label) { @Override protected void userEvent() { diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java index 3f1e532681..a8c1bc1f87 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java @@ -42,7 +42,7 @@ public class CategoryPlotTableDataContentPane extends AbstractTableDataContentPa JPanel categoryPane = new JPanel(new BorderLayout(4,0)); categoryPane.setBorder(BorderFactory.createMatteBorder(0, 0, 6, 1, getBackground())); UILabel label1 = new BoldFontTextLabel(Inter.getLocText("FR-Chart-Category_Name") + ":", SwingConstants.RIGHT) ; - label1.setPreferredSize(new Dimension(75,20)); + label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH,ChartDataPane.LABEL_HEIGHT)); categoryCombox.setPreferredSize(new Dimension(100,20)); categoryCombox.addItem(Inter.getLocText("Chart-Use_None")); diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java index 2d5099db4d..1ef6972a96 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java @@ -11,6 +11,7 @@ import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; @@ -76,12 +77,12 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane { this.setLayout(new BorderLayout(4, LayoutConstants.VGAP_MEDIUM)); JPanel northPane = new JPanel(new BorderLayout(4, 0)); UILabel label1 = new UILabel(Inter.getLocText("ChartF-Series_Name_From") + ":", SwingConstants.RIGHT); - label1.setPreferredSize(new Dimension(75, 20)); + label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT)); northPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label1, null})); northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 1)); this.add(northPane, BorderLayout.NORTH); diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java index 85e7e693c4..40fc6fe55e 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe.chart.gui.type; import com.fr.chart.chartattr.Chart; import com.fr.design.dialog.MultiTabPane; +import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.mainframe.chart.gui.style.legend.AutoSelectedPane; import com.fr.general.ComparatorUtils; import com.fr.stable.StringUtils; @@ -15,6 +16,7 @@ import java.awt.*; public abstract class ChartTabPane extends MultiTabPane { private static final long serialVersionUID = 8633385688766835240L; + private boolean setTooltip = true; @Override protected void initLayout() { @@ -26,6 +28,27 @@ public abstract class ChartTabPane extends MultiTabPane { this.add(centerPane, BorderLayout.CENTER); } + //日文环境下,显示不全的,用tooltip + private void setSomeTooltipText() { + this.setVisible(true); + for(int i = 0, size = paneList.size(); i button.getSize().getWidth()) { + button.setToolTipText(tooltip); + } + } + } + + @Override + public void paint(Graphics g) { + super.paint(g); + if(setTooltip) { + setSomeTooltipText(); + setTooltip = false; + } + } + @Override public boolean accept(Object ob) { return false; From 5b1134f2370a3afd8056a0d6a561a02634e2ae9b Mon Sep 17 00:00:00 2001 From: fr_shine Date: Wed, 16 Nov 2016 16:53:31 +0800 Subject: [PATCH 04/18] =?UTF-8?q?=E6=97=A0=E6=84=8F=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java index 40fc6fe55e..a715643e0b 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java @@ -30,7 +30,6 @@ public abstract class ChartTabPane extends MultiTabPane { //日文环境下,显示不全的,用tooltip private void setSomeTooltipText() { - this.setVisible(true); for(int i = 0, size = paneList.size(); i Date: Thu, 17 Nov 2016 12:55:41 +0800 Subject: [PATCH 05/18] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=85=B1=E4=BA=AB=E8=BF=9C=E7=A8=8B=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/env/RemoteEnv.java | 46 ++++++++++++++++++- .../mainframe/FormWidgetDetailPane.java | 6 --- .../fr/design/mainframe/ShareWidgetPane.java | 17 +++---- 3 files changed, 53 insertions(+), 16 deletions(-) diff --git a/designer_base/src/com/fr/env/RemoteEnv.java b/designer_base/src/com/fr/env/RemoteEnv.java index 6aff74d7ca..ab9cc6f4d7 100644 --- a/designer_base/src/com/fr/env/RemoteEnv.java +++ b/designer_base/src/com/fr/env/RemoteEnv.java @@ -22,6 +22,7 @@ import com.fr.file.CacheManager; import com.fr.file.DatasourceManager; import com.fr.file.DatasourceManagerProvider; import com.fr.file.filetree.FileNode; +import com.fr.form.share.ShareConstants; import com.fr.general.*; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; @@ -31,8 +32,6 @@ import com.fr.plugin.Plugin; import com.fr.plugin.PluginLicense; import com.fr.plugin.PluginLicenseManager; import com.fr.plugin.PluginLoader; -import com.fr.plugin.dependence.PluginServiceCreator; -import com.fr.plugin.dependence.PluginServiceManager; import com.fr.stable.*; import com.fr.stable.file.XMLFileManagerProvider; import com.fr.stable.project.ProjectConstants; @@ -2105,4 +2104,47 @@ public class RemoteEnv implements Env { public void checkAndRegisterLic(FileNode node, Plugin plugin) throws Exception { } + + @Override + public File[] loadREUFile() throws Exception { + File target = new File(CacheManager.getProviderInstance().getCacheDirectory(), + "fr_share"); + StableUtils.deleteFile(target); + StableUtils.mkdirs(target); + File cacheDir = null; + File zip = null; + try { + HashMap para = new HashMap(); + para.put("op", "fr_remote_design"); + para.put("cmd", "design_read_reufile"); + para.put("current_uid", this.createUserID()); + para.put("currentUsername", this.getUser()); + + HttpClient client = createHttpMethod(para); + InputStream input = client.getResponseStream(); + zip = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), "share.zip"); + cacheDir = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), ShareConstants.DIR_SHARE_CACHE); + StableUtils.deleteFile(cacheDir); + StableUtils.mkdirs(cacheDir); + StableUtils.makesureFileExist(zip); + FileOutputStream out = new FileOutputStream(zip); + IOUtils.copyBinaryTo(input, out); + out.flush(); + out.close(); + IOUtils.unzip(zip, cacheDir.getAbsolutePath(), EncodeConstants.ENCODING_GBK);//先解压到临时目录 + if (cacheDir.exists() && cacheDir.isDirectory()) { + return cacheDir.listFiles(new FilenameFilter() { + public boolean accept(File file, String s) { + return s.endsWith("reu"); + } + }); + } + + } catch (Exception e) { + FRContext.getLogger().error(e.getMessage()); + } finally { + StableUtils.deleteFile(zip); + } + return null; + } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java index 5beea605c8..4922d8b114 100644 --- a/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -2,11 +2,6 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; import com.fr.base.FRContext; -import com.fr.design.dialog.BasicPane; -import com.fr.design.dialog.UIDialog; -import com.fr.design.extra.PluginWebBridge; -import com.fr.design.extra.ShopDialog; -import com.fr.design.extra.WebManagerPaneFactory; import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; @@ -99,7 +94,6 @@ public class FormWidgetDetailPane extends FormDockView{ reuWidgetPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); reuWidgetPanel.setBorder(null); if (elCaseBindInfoList == null) { - elCaseBindInfoList = new ElCaseBindInfo[0]; if (sw != null) { sw.cancel(true); } diff --git a/designer_form/src/com/fr/design/mainframe/ShareWidgetPane.java b/designer_form/src/com/fr/design/mainframe/ShareWidgetPane.java index cd04300bf1..3965511355 100644 --- a/designer_form/src/com/fr/design/mainframe/ShareWidgetPane.java +++ b/designer_form/src/com/fr/design/mainframe/ShareWidgetPane.java @@ -14,15 +14,16 @@ public class ShareWidgetPane extends JPanel { public ShareWidgetPane(ElCaseBindInfo[] elCaseBindInfoList, boolean isEdit) { this.setBorder(BorderFactory.createEmptyBorder(10, 3, 0, 0));// 设置面板的边框 ,距离上、左、下、右 的距离 - int rowCount = (elCaseBindInfoList.length + 1) / 2; - this.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 10)); - for (ElCaseBindInfo rbModuleInfo : elCaseBindInfoList) { - ShareWidgetButton widgetButton = new ShareWidgetButton(rbModuleInfo); - widgetButton.setElementCaseEdit(isEdit); - this.add(widgetButton); + if (elCaseBindInfoList != null) { + int rowCount = (elCaseBindInfoList.length + 1) / 2; + this.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 10)); + for (ElCaseBindInfo rbModuleInfo : elCaseBindInfoList) { + ShareWidgetButton widgetButton = new ShareWidgetButton(rbModuleInfo); + widgetButton.setElementCaseEdit(isEdit); + this.add(widgetButton); + } + this.setPreferredSize(new Dimension(240, rowCount * 80)); } - this.setPreferredSize(new Dimension(240, rowCount * 80)); - } } \ No newline at end of file From a8923863400d82eeeef055577702ad7c000d9fbe Mon Sep 17 00:00:00 2001 From: zack Date: Thu, 17 Nov 2016 13:01:19 +0800 Subject: [PATCH 06/18] PMD --- designer_base/src/com/fr/env/RemoteEnv.java | 2 +- .../src/com/fr/design/mainframe/FormWidgetDetailPane.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/designer_base/src/com/fr/env/RemoteEnv.java b/designer_base/src/com/fr/env/RemoteEnv.java index ab9cc6f4d7..85fa191302 100644 --- a/designer_base/src/com/fr/env/RemoteEnv.java +++ b/designer_base/src/com/fr/env/RemoteEnv.java @@ -2145,6 +2145,6 @@ public class RemoteEnv implements Env { } finally { StableUtils.deleteFile(zip); } - return null; + return new File[0]; } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java index 4922d8b114..bcc1400beb 100644 --- a/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -14,6 +14,7 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.share.ShareConstants; import com.fr.form.share.ShareLoader; import com.fr.form.ui.ElCaseBindInfo; +import com.fr.general.FRLogger; import com.fr.general.Inter; import com.fr.general.SiteCenter; import com.fr.stable.StringUtils; @@ -227,7 +228,7 @@ public class FormWidgetDetailPane extends FormDockView{ try { Desktop.getDesktop().browse(new URI(url)); } catch (IOException exp) { - JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser")); + JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer_Set_default_browser")); FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); } catch (URISyntaxException exp) { FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); @@ -303,7 +304,7 @@ public class FormWidgetDetailPane extends FormDockView{ JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_OK")); } catch (IOException e) { JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Error")); - e.printStackTrace(); + FRLogger.getLogger().error(e.getMessage(), e); } } @@ -312,7 +313,7 @@ public class FormWidgetDetailPane extends FormDockView{ try { ShareLoader.getLoader().refreshModule(); } catch (Exception e) { - e.printStackTrace(); + FRLogger.getLogger().error(e.getMessage(), e); } } From 151c0edb752b8cc0b1a7610cb4e21a66dae91f5d Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Thu, 17 Nov 2016 15:28:00 +0800 Subject: [PATCH 07/18] =?UTF-8?q?=E5=AE=8C=E6=88=90=E4=BA=86=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E8=8F=9C=E5=8D=95=E7=9A=84=E6=95=B0=E6=8D=AE=E4=BF=9D?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/mobile/MobileToolBarPane.java | 50 +++++++++++++++-- .../dialog/mobile/MobileToolBarBeanPane.java | 56 ------------------- .../form/mobile/FormMobileAttrPane.java | 53 ++++++++++++++++++ .../design/form/mobile/MobileToolBarPane.java | 44 +++++++++++++-- .../actions/FormMobileAttrAction.java | 19 ++++++- 5 files changed, 153 insertions(+), 69 deletions(-) delete mode 100644 designer_base/src/com/fr/design/dialog/mobile/MobileToolBarBeanPane.java create mode 100644 designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java diff --git a/designer/src/com/fr/design/report/mobile/MobileToolBarPane.java b/designer/src/com/fr/design/report/mobile/MobileToolBarPane.java index 2a151c4718..bea0745cb5 100644 --- a/designer/src/com/fr/design/report/mobile/MobileToolBarPane.java +++ b/designer/src/com/fr/design/report/mobile/MobileToolBarPane.java @@ -1,20 +1,53 @@ package com.fr.design.report.mobile; -import com.fr.design.dialog.mobile.MobileToolBarBeanPane; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.dialog.mobile.MobileRadioCheckPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.general.Inter; import com.fr.report.mobile.ElementCaseMobileAttr; +import javax.swing.*; +import java.awt.*; + /** * Created by 方磊 on 2016/11/8. */ -public class MobileToolBarPane extends MobileToolBarBeanPane { +public class MobileToolBarPane extends BasicBeanPane { + //缩放选项面板 + private MobileRadioCheckPane zoomCheckPane; + + //刷新选项面板 + private MobileRadioCheckPane refreshCheckPane; + + public MobileToolBarPane() { + this.initComponents(); + } + + private void initComponents() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + JPanel borderPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow()); + JPanel toobarsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + + UILabel uiLabel = new UILabel("html5"); + uiLabel.setBorder(BorderFactory.createEmptyBorder(5, 15, 10, 15)); + zoomCheckPane = new MobileRadioCheckPane(Inter.getLocText("FR-Designer_Mobile-Zoom")); + refreshCheckPane = new MobileRadioCheckPane(Inter.getLocText("FR-Designer_Mobile-Refresh")); + + toobarsPane.add(uiLabel, BorderLayout.WEST); + toobarsPane.add(zoomCheckPane, BorderLayout.CENTER); + toobarsPane.add(refreshCheckPane, BorderLayout.EAST); + borderPane.add(toobarsPane); + this.add(borderPane); + } @Override public void populateBean(ElementCaseMobileAttr ob) { if (ob == null) { ob = new ElementCaseMobileAttr(); } - super.getZoomCheckPane().populateBean(ob.isZoom()); - super.getRefreshCheckPane().populateBean(ob.isRefresh()); + this.zoomCheckPane.populateBean(ob.isZoom()); + this.refreshCheckPane.populateBean(ob.isRefresh()); } @Override @@ -25,8 +58,13 @@ public class MobileToolBarPane extends MobileToolBarBeanPane extends BasicBeanPane { - //缩放选项面板 - private MobileRadioCheckPane zoomCheckPane; - - //刷新选项面板 - private MobileRadioCheckPane refreshCheckPane; - - public MobileRadioCheckPane getZoomCheckPane() { - return zoomCheckPane; - } - - public MobileRadioCheckPane getRefreshCheckPane() { - return refreshCheckPane; - } - - public MobileToolBarBeanPane() { - initComponents(); - } - - private void initComponents() { - this.setLayout(FRGUIPaneFactory.createBorderLayout()); - JPanel borderPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow()); - JPanel toobarsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - - UILabel uiLabel = new UILabel("html5"); - uiLabel.setBorder(BorderFactory.createEmptyBorder(5, 15, 10, 15)); - zoomCheckPane = new MobileRadioCheckPane(Inter.getLocText("FR-Designer_Mobile-Zoom")); - refreshCheckPane = new MobileRadioCheckPane("刷新"); - - toobarsPane.add(uiLabel, BorderLayout.WEST); - toobarsPane.add(zoomCheckPane, BorderLayout.CENTER); - toobarsPane.add(refreshCheckPane, BorderLayout.EAST); - borderPane.add(toobarsPane); - this.add(borderPane); - } - - @Override - protected String title4PopupWindow() { - return "工具栏"; - } - -} diff --git a/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java b/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java new file mode 100644 index 0000000000..385608b184 --- /dev/null +++ b/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java @@ -0,0 +1,53 @@ +package com.fr.design.form.mobile; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.general.Inter; +import com.fr.report.mobile.ElementCaseMobileAttr; + +import javax.swing.*; +import java.awt.*; + +/** + * Created by fanglei on 2016/11/17. + */ +public class FormMobileAttrPane extends BasicBeanPane{ + //工具栏容器 + private MobileToolBarPane mobileToolBarPane; + + public FormMobileAttrPane() { + this.initComponents(); + } + + private void initComponents() { + JPanel jPanel = new JPanel(); + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + jPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.mobileToolBarPane = new MobileToolBarPane(); + //设置一个JPanel包裹mobileToolBarPane这个Panel,让jPanel的高度等于mobileToolBarPane高度加10,再放入this中 + jPanel.setPreferredSize(new Dimension(0, (int)this.mobileToolBarPane.getPreferredSize().getHeight() + 10)); + jPanel.add("North", mobileToolBarPane); + this.add(jPanel); + } + + @Override + public void populateBean(ElementCaseMobileAttr ob) { + if (ob == null) { + ob = new ElementCaseMobileAttr(); + } + this.mobileToolBarPane.populateBean(ob); + } + + @Override + public ElementCaseMobileAttr updateBean() { + ElementCaseMobileAttr caseMobileAttr = new ElementCaseMobileAttr(); + this.mobileToolBarPane.updateBean(caseMobileAttr); + return caseMobileAttr; + } + + @Override + protected String title4PopupWindow() { + return Inter.getLocText("FR-Designer_Mobile-Attr"); + } +} diff --git a/designer_form/src/com/fr/design/form/mobile/MobileToolBarPane.java b/designer_form/src/com/fr/design/form/mobile/MobileToolBarPane.java index 2dd0dee51d..7430f3a9ee 100644 --- a/designer_form/src/com/fr/design/form/mobile/MobileToolBarPane.java +++ b/designer_form/src/com/fr/design/form/mobile/MobileToolBarPane.java @@ -1,20 +1,47 @@ package com.fr.design.form.mobile; -import com.fr.design.dialog.mobile.MobileToolBarBeanPane; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.dialog.mobile.MobileRadioCheckPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.general.Inter; import com.fr.report.mobile.ElementCaseMobileAttr; +import javax.swing.*; +import java.awt.*; + /** * Created by 方磊 on 2016/11/8. */ -public class MobileToolBarPane extends MobileToolBarBeanPane { +public class MobileToolBarPane extends BasicBeanPane { + //刷新选项面板 + private MobileRadioCheckPane refreshCheckPane; + + public MobileToolBarPane() { + this.initComponents(); + } + + private void initComponents() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + JPanel borderPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow()); + JPanel toobarsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + + UILabel uiLabel = new UILabel("html5"); + uiLabel.setBorder(BorderFactory.createEmptyBorder(5, 15, 10, 15)); + this.refreshCheckPane = new MobileRadioCheckPane(Inter.getLocText("FR-Designer_Mobile-Refresh")); + + toobarsPane.add(uiLabel, BorderLayout.WEST); + toobarsPane.add(refreshCheckPane, BorderLayout.EAST); + borderPane.add(toobarsPane); + this.add(borderPane); + } @Override public void populateBean(ElementCaseMobileAttr ob) { if (ob == null) { ob = new ElementCaseMobileAttr(); } - super.getZoomCheckPane().populateBean(ob.isZoom()); - super.getRefreshCheckPane().populateBean(ob.isRefresh()); + this.refreshCheckPane.populateBean(ob.isRefresh()); } @Override @@ -25,8 +52,13 @@ public class MobileToolBarPane extends MobileToolBarBeanPane { return; } final Form formTpl = jf.getTarget(); + ElementCaseMobileAttr mobileAttr = formTpl.getReportMobileAttr(); + + final FormMobileAttrPane mobileAttrPane = new FormMobileAttrPane(); + mobileAttrPane.populateBean(mobileAttr); + BasicDialog dialog = mobileAttrPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { + @Override + public void doOk() { + formTpl.setReportMobileAttr(mobileAttrPane.updateBean()); + jf.fireTargetModified(); + } + }); + dialog.setVisible(true); } private static final MenuKeySet REPORT_APP_ATTR = new MenuKeySet() { @@ -45,7 +62,7 @@ public class FormMobileAttrAction extends JTemplateAction { @Override public String getMenuName() { - return "移动端属性"; + return Inter.getLocText("FR-Designer_Mobile-Attr"); } @Override From 1d306eb56f112f73e2a6a0b198e8b01bd2238847 Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Thu, 17 Nov 2016 15:49:59 +0800 Subject: [PATCH 08/18] =?UTF-8?q?=E8=A7=84=E8=8C=83=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/ElementCasePaneDelegate.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java index 67e6975343..a3df2ba3e8 100644 --- a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -102,7 +102,7 @@ public class ElementCasePaneDelegate extends ElementCasePane { // 插入菜单 private MenuDef createInsertMenuDef() { - MenuDef menuDef = new MenuDef(Inter.getLocText("M-Insert"), 'I'); + MenuDef menuDef = new MenuDef(Inter.getLocText("FR-Designer_M-Insert"), 'I'); menuDef.setAnchor(MenuHandler.INSERT); // 单元格菜单 menuDef.addShortCut(DeprecatedActionManager.getCellMenu(this)); From 618817b9b2a79a20fd357304a2639623367faacf Mon Sep 17 00:00:00 2001 From: zack Date: Thu, 17 Nov 2016 15:50:16 +0800 Subject: [PATCH 09/18] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E7=94=A8=E4=BA=86=E9=9D=9E=E6=B3=95=E7=9A=84=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E5=85=B3=E7=B3=BB=EF=BC=8C=E5=85=88=E7=9B=B4=E6=8E=A5=E6=94=B9?= =?UTF-8?q?=E6=88=90=E5=AD=97=E7=AC=A6=E4=B8=B2=EF=BC=8C=E5=90=8E=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/env/RemoteEnv.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/designer_base/src/com/fr/env/RemoteEnv.java b/designer_base/src/com/fr/env/RemoteEnv.java index 85fa191302..ae8c589ee5 100644 --- a/designer_base/src/com/fr/env/RemoteEnv.java +++ b/designer_base/src/com/fr/env/RemoteEnv.java @@ -22,7 +22,6 @@ import com.fr.file.CacheManager; import com.fr.file.DatasourceManager; import com.fr.file.DatasourceManagerProvider; import com.fr.file.filetree.FileNode; -import com.fr.form.share.ShareConstants; import com.fr.general.*; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; @@ -2123,7 +2122,7 @@ public class RemoteEnv implements Env { HttpClient client = createHttpMethod(para); InputStream input = client.getResponseStream(); zip = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), "share.zip"); - cacheDir = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), ShareConstants.DIR_SHARE_CACHE); + cacheDir = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), "fr_share"); StableUtils.deleteFile(cacheDir); StableUtils.mkdirs(cacheDir); StableUtils.makesureFileExist(zip); From b8155e3ca369d4735ed85b2309cf9c8caeb39e7a Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Thu, 17 Nov 2016 15:58:52 +0800 Subject: [PATCH 10/18] =?UTF-8?q?=E6=B6=88=E9=99=A4=E9=AD=94=E6=9C=AF?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/form/mobile/FormMobileAttrPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java b/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java index 385608b184..cf626b888c 100644 --- a/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java +++ b/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java @@ -26,7 +26,8 @@ public class FormMobileAttrPane extends BasicBeanPane{ jPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); this.mobileToolBarPane = new MobileToolBarPane(); //设置一个JPanel包裹mobileToolBarPane这个Panel,让jPanel的高度等于mobileToolBarPane高度加10,再放入this中 - jPanel.setPreferredSize(new Dimension(0, (int)this.mobileToolBarPane.getPreferredSize().getHeight() + 10)); + final int paddingHeight = 10; + jPanel.setPreferredSize(new Dimension(0, (int)this.mobileToolBarPane.getPreferredSize().getHeight() + paddingHeight)); jPanel.add("North", mobileToolBarPane); this.add(jPanel); } From 3036113ec56c5f628b17a49225b91439ac8c0ab7 Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Thu, 17 Nov 2016 17:31:18 +0800 Subject: [PATCH 11/18] =?UTF-8?q?=E7=94=B1=E4=BA=8Ereport=E7=9A=84elementC?= =?UTF-8?q?aseMobileAttrProvider=E6=B2=A1=E6=9C=89=E6=94=B9=E5=A5=BD?= =?UTF-8?q?=EF=BC=8Cform=E9=87=8C=E9=9D=A2=E8=8F=9C=E5=8D=95=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E5=85=88=E5=B1=8F=E8=94=BD=E9=98=B2=E6=AD=A2=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/FormMobileAttrAction.java | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java b/designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java index 935c9f858e..c3f220f847 100644 --- a/designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java +++ b/designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java @@ -35,23 +35,23 @@ public class FormMobileAttrAction extends JTemplateAction { */ @Override public void actionPerformed(ActionEvent e) { - final JForm jf = getEditingComponent(); - if (jf == null) { - return; - } - final Form formTpl = jf.getTarget(); - ElementCaseMobileAttr mobileAttr = formTpl.getReportMobileAttr(); - - final FormMobileAttrPane mobileAttrPane = new FormMobileAttrPane(); - mobileAttrPane.populateBean(mobileAttr); - BasicDialog dialog = mobileAttrPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { - @Override - public void doOk() { - formTpl.setReportMobileAttr(mobileAttrPane.updateBean()); - jf.fireTargetModified(); - } - }); - dialog.setVisible(true); +// final JForm jf = getEditingComponent(); +// if (jf == null) { +// return; +// } +// final Form formTpl = jf.getTarget(); +// ElementCaseMobileAttr mobileAttr = formTpl.getReportMobileAttr(); +// +// final FormMobileAttrPane mobileAttrPane = new FormMobileAttrPane(); +// mobileAttrPane.populateBean(mobileAttr); +// BasicDialog dialog = mobileAttrPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { +// @Override +// public void doOk() { +// formTpl.setReportMobileAttr(mobileAttrPane.updateBean()); +// jf.fireTargetModified(); +// } +// }); +// dialog.setVisible(true); } private static final MenuKeySet REPORT_APP_ATTR = new MenuKeySet() { From f08d615bb3d2d656c72a40a352a864ec67f75d24 Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Fri, 18 Nov 2016 11:51:08 +0800 Subject: [PATCH 12/18] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86formMobileAttr?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E8=A1=A8=E5=8D=95=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/mobile/FormMobileAttrPane.java | 12 +++---- .../design/form/mobile/MobileToolBarPane.java | 12 +++---- .../actions/FormMobileAttrAction.java | 36 +++++++++---------- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java b/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java index cf626b888c..59d57f4a24 100644 --- a/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java +++ b/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java @@ -2,8 +2,8 @@ package com.fr.design.form.mobile; import com.fr.design.beans.BasicBeanPane; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.form.main.mobile.FormMobileAttr; import com.fr.general.Inter; -import com.fr.report.mobile.ElementCaseMobileAttr; import javax.swing.*; import java.awt.*; @@ -11,7 +11,7 @@ import java.awt.*; /** * Created by fanglei on 2016/11/17. */ -public class FormMobileAttrPane extends BasicBeanPane{ +public class FormMobileAttrPane extends BasicBeanPane{ //工具栏容器 private MobileToolBarPane mobileToolBarPane; @@ -33,16 +33,16 @@ public class FormMobileAttrPane extends BasicBeanPane{ } @Override - public void populateBean(ElementCaseMobileAttr ob) { + public void populateBean(FormMobileAttr ob) { if (ob == null) { - ob = new ElementCaseMobileAttr(); + ob = new FormMobileAttr(); } this.mobileToolBarPane.populateBean(ob); } @Override - public ElementCaseMobileAttr updateBean() { - ElementCaseMobileAttr caseMobileAttr = new ElementCaseMobileAttr(); + public FormMobileAttr updateBean() { + FormMobileAttr caseMobileAttr = new FormMobileAttr(); this.mobileToolBarPane.updateBean(caseMobileAttr); return caseMobileAttr; } diff --git a/designer_form/src/com/fr/design/form/mobile/MobileToolBarPane.java b/designer_form/src/com/fr/design/form/mobile/MobileToolBarPane.java index 7430f3a9ee..c46c98ec27 100644 --- a/designer_form/src/com/fr/design/form/mobile/MobileToolBarPane.java +++ b/designer_form/src/com/fr/design/form/mobile/MobileToolBarPane.java @@ -4,8 +4,8 @@ import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.mobile.MobileRadioCheckPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.form.main.mobile.FormMobileAttr; import com.fr.general.Inter; -import com.fr.report.mobile.ElementCaseMobileAttr; import javax.swing.*; import java.awt.*; @@ -13,7 +13,7 @@ import java.awt.*; /** * Created by 方磊 on 2016/11/8. */ -public class MobileToolBarPane extends BasicBeanPane { +public class MobileToolBarPane extends BasicBeanPane { //刷新选项面板 private MobileRadioCheckPane refreshCheckPane; @@ -37,20 +37,20 @@ public class MobileToolBarPane extends BasicBeanPane { } @Override - public void populateBean(ElementCaseMobileAttr ob) { + public void populateBean(FormMobileAttr ob) { if (ob == null) { - ob = new ElementCaseMobileAttr(); + ob = new FormMobileAttr(); } this.refreshCheckPane.populateBean(ob.isRefresh()); } @Override - public ElementCaseMobileAttr updateBean() { + public FormMobileAttr updateBean() { return null; } @Override - public void updateBean(ElementCaseMobileAttr mobileAttr) { + public void updateBean(FormMobileAttr mobileAttr) { if(mobileAttr != null) { mobileAttr.setRefresh(this.refreshCheckPane.updateBean()); } diff --git a/designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java b/designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java index c3f220f847..91b0822d33 100644 --- a/designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java +++ b/designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java @@ -9,8 +9,8 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JForm; import com.fr.design.menu.MenuKeySet; import com.fr.form.main.Form; +import com.fr.form.main.mobile.FormMobileAttr; import com.fr.general.Inter; -import com.fr.report.mobile.ElementCaseMobileAttr; import javax.swing.*; import java.awt.event.ActionEvent; @@ -35,23 +35,23 @@ public class FormMobileAttrAction extends JTemplateAction { */ @Override public void actionPerformed(ActionEvent e) { -// final JForm jf = getEditingComponent(); -// if (jf == null) { -// return; -// } -// final Form formTpl = jf.getTarget(); -// ElementCaseMobileAttr mobileAttr = formTpl.getReportMobileAttr(); -// -// final FormMobileAttrPane mobileAttrPane = new FormMobileAttrPane(); -// mobileAttrPane.populateBean(mobileAttr); -// BasicDialog dialog = mobileAttrPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { -// @Override -// public void doOk() { -// formTpl.setReportMobileAttr(mobileAttrPane.updateBean()); -// jf.fireTargetModified(); -// } -// }); -// dialog.setVisible(true); + final JForm jf = getEditingComponent(); + if (jf == null) { + return; + } + final Form formTpl = jf.getTarget(); + FormMobileAttr mobileAttr = formTpl.getReportMobileAttr(); + + final FormMobileAttrPane mobileAttrPane = new FormMobileAttrPane(); + mobileAttrPane.populateBean(mobileAttr); + BasicDialog dialog = mobileAttrPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { + @Override + public void doOk() { + formTpl.setReportMobileAttr(mobileAttrPane.updateBean()); + jf.fireTargetModified(); + } + }); + dialog.setVisible(true); } private static final MenuKeySet REPORT_APP_ATTR = new MenuKeySet() { From 6abd57636b571e93241ed0dd113ed378c2db92a3 Mon Sep 17 00:00:00 2001 From: sunmondong Date: Fri, 18 Nov 2016 14:00:10 +0800 Subject: [PATCH 13/18] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.master.gradle | 86 +++++++++++++++++++++++++++++ build.release.gradle | 85 ++++++++++++++++++++++++++++ designer_base/build.release.gradle | 70 +++++++++++++++++++++++ designer_chart/build.release.gradle | 66 ++++++++++++++++++++++ designer_form/build.master.gradle | 83 ++++++++++++++++++++++++++++ designer_form/build.release.gradle | 83 ++++++++++++++++++++++++++++ 6 files changed, 473 insertions(+) create mode 100644 build.master.gradle create mode 100644 build.release.gradle create mode 100644 designer_base/build.release.gradle create mode 100644 designer_chart/build.release.gradle create mode 100644 designer_form/build.master.gradle create mode 100644 designer_form/build.release.gradle diff --git a/build.master.gradle b/build.master.gradle new file mode 100644 index 0000000000..c5cc1b92da --- /dev/null +++ b/build.master.gradle @@ -0,0 +1,86 @@ +apply plugin: "java" +tasks.withType(JavaCompile){ + options.encoding = "UTF-8" +} + +def basicDir="../../" +def libDir="${basicDir}/finereport-lib-stable" +//获取什么分支名 +FileTree files =fileTree(dir:"./",include:"build.*.gradle") +def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ("\\")) +def branchName=buildDir.substring(buildDir.lastIndexOf ("\\")+1) + +task appletJar<<{ + + ant{ + mkdir(dir:"${libDir}/tmp-${branchName}") + mkdir(dir:"build/classes/") + copy(todir:"build/classes/"){ + fileset(dir:"${basicDir}/finereport-core-stable/${branchName}/build/classes/main") + + fileset(dir:"${basicDir}/finereport-chart-stable/${branchName}/build/classes/main") + + fileset(dir:"${basicDir}/finereport-report-stable/${branchName}/build/classes/main") + + fileset(dir:"${basicDir}/finereport-platform-stable/${branchName}/build/classes/main") + + fileset(dir:"${basicDir}/finereport-performance-stable/${branchName}/build/classes/main") + + } + unjar(src:"${libDir}/${branchName}/3rd.jar",dest:"${libDir}/tmp-${branchName}") + unjar(src:"${libDir}/${branchName}/servlet-api.jar",dest:"${libDir}/tmp-${branchName}") + jar(jarfile:"build/libs/fr-applet-8.0.jar"){ + fileset(dir:"build/classes"){ + exclude(name:"*.*") + exclude(name:"bin/*.*") + exclude(name:"classes/**") + exclude(name:"com/fr/schedule/**") + exclude(name:"com/fr/cell/**") + exclude(name:"com/fr/dialog/**") + exclude(name:"com/fr/view/**") + exclude(name:"com/fr/web/**") + exclude(name:"com/fr/fs/**") + exclude(name:"com/fr/design/**") + exclude(name:"com/fr/start/**") + exclude(name:"com/fr/process/**") + } + fileset(dir:"${libDir}/tmp-${branchName}"){ + include(name:"javax/mail/**") + include(name:"javax/servlet/**") + include(name:"org/freehep/**") + include(name:"com/fr/third/JAI/**") + include(name:"com/fr/third/antlr/**") + include(name:"com/fr/third/javax/**") + include(name:"com/sun/xml/**") + include(name:"javax/xml/**") + + } + fileset(dir:"build/classes"){ + include(name:"com/fr/web/*.class") + include(name:"com/fr/web/attr/*.class") + } + } + delete(dir:"${libDir}/tmp-${branchName}") + def jdk6home= "D:/FineReport/develop/java/jdk1.6u35" + def keystore="frapplet.store" + def keycert="fr.cert" + def keypassword="123456" + def keyalias="fr" + + exec(executable:"${jdk6home}/bin/keytool"){ + arg(line:"-genkey -dname "CN=FineReport L=NanJing C=China" -keystore ${keystore} -alias ${keyalias} -validity 3650 -storepass ${keypassword}") + } + exec(executable:"${jdk6home}/bin/keytool"){ + arg(line:"-export -keystore ${keystore} -alias ${keyalias} -file ${keycert} -storepass ${keypassword}") + } + + exec(executable:"${jdk6home}/bin/jarsigner"){ + arg(line:"-keystore ${keystore} -storepass ${keypassword} 'build/libs/fr-applet-8.0.jar' ${keyalias}") + } + delete(file:"${keystore}") + delete(file:"${keycert}") + delete(dir:"build/classes") + + } + +} \ No newline at end of file diff --git a/build.release.gradle b/build.release.gradle new file mode 100644 index 0000000000..44aacadb4d --- /dev/null +++ b/build.release.gradle @@ -0,0 +1,85 @@ +apply plugin: "java" +tasks.withType(JavaCompile){ + options.encoding = "UTF-8" +} +def basicDir="../../" +def libDir="${basicDir}/finereport-lib-stable/master" +//获取什么分支名 +FileTree files =fileTree(dir:"./",include:"build.*.gradle") +def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ("\\")) +def branchName=buildDir.substring(buildDir.lastIndexOf ("\\")+1) + +task appletJar<<{ + + ant{ + mkdir(dir:"${libDir}/tmp-${branchName}") + mkdir(dir:"build/classes/") + copy(todir:"build/classes/"){ + fileset(dir:"${basicDir}/finereport-core-stable/${branchName}/build/classes/main") + + fileset(dir:"${basicDir}/finereport-chart-stable/${branchName}/build/classes/main") + + fileset(dir:"${basicDir}/finereport-report-stable/${branchName}/build/classes/main") + + fileset(dir:"${basicDir}/finereport-platform-stable/${branchName}/build/classes/main") + + fileset(dir:"${basicDir}/finereport-performance-stable/${branchName}/build/classes/main") + + } + unjar(src:"${libDir}/3rd.jar",dest:"${libDir}/tmp-${branchName}") + unjar(src:"${libDir}/servlet-api.jar",dest:"${libDir}/tmp-${branchName}") + jar(jarfile:"build/libs/fr-applet-8.0.jar"){ + fileset(dir:"build/classes"){ + exclude(name:"*.*") + exclude(name:"bin/*.*") + exclude(name:"classes/**") + exclude(name:"com/fr/schedule/**") + exclude(name:"com/fr/cell/**") + exclude(name:"com/fr/dialog/**") + exclude(name:"com/fr/view/**") + exclude(name:"com/fr/web/**") + exclude(name:"com/fr/fs/**") + exclude(name:"com/fr/design/**") + exclude(name:"com/fr/start/**") + exclude(name:"com/fr/process/**") + } + fileset(dir:"${libDir}/tmp-${branchName}"){ + include(name:"javax/mail/**") + include(name:"javax/servlet/**") + include(name:"org/freehep/**") + include(name:"com/fr/third/JAI/**") + include(name:"com/fr/third/antlr/**") + include(name:"com/fr/third/javax/**") + include(name:"com/sun/xml/**") + include(name:"javax/xml/**") + + } + fileset(dir:"build/classes"){ + include(name:"com/fr/web/*.class") + include(name:"com/fr/web/attr/*.class") + } + } + delete(dir:"${libDir}/tmp-${branchName}") + def jdk6home= "D:/FineReport/develop/java/jdk1.6u35" + def keystore="frapplet.store" + def keycert="fr.cert" + def keypassword="123456" + def keyalias="fr" + + exec(executable:"${jdk6home}/bin/keytool"){ + arg(line:"-genkey -dname "CN=FineReport L=NanJing C=China" -keystore ${keystore} -alias ${keyalias} -validity 3650 -storepass ${keypassword}") + } + exec(executable:"${jdk6home}/bin/keytool"){ + arg(line:"-export -keystore ${keystore} -alias ${keyalias} -file ${keycert} -storepass ${keypassword}") + } + + exec(executable:"${jdk6home}/bin/jarsigner"){ + arg(line:"-keystore ${keystore} -storepass ${keypassword} 'build/libs/fr-applet-8.0.jar' ${keyalias}") + } + delete(file:"${keystore}") + delete(file:"${keycert}") + delete(dir:"build/classes") + + } + +} \ No newline at end of file diff --git a/designer_base/build.release.gradle b/designer_base/build.release.gradle new file mode 100644 index 0000000000..4ed4ba12b0 --- /dev/null +++ b/designer_base/build.release.gradle @@ -0,0 +1,70 @@ + +apply plugin: 'java' +tasks.withType(JavaCompile){ + options.encoding = 'UTF-8' +} +//指定构建的jdk版本 +sourceCompatibility=1.8 +//指定生成jar包版本 +version='8.0' +//生成jar包重命名 +jar{ + baseName='fr-designer-core' +} + + +def srcDir="." + +//指定源码路径 +sourceSets{ + main{ + java{ + srcDirs=["${srcDir}/src"] + } + } +} +//获取什么分支名 +FileTree files =fileTree(dir:'./',include:'build.*.gradle') +def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ('\\')) +buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\')) +def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) + +//声明外部依赖 +dependencies{ + +compile fileTree(dir:'../../../finereport-lib-stable/master',include:'**/*.jar') +compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar") + + testCompile 'junit:junit:4.12' +} +//复制非.java文件到classes文件夹下参与打包 +task copyFile(type:Copy,dependsOn:compileJava){ + copy{ + from ("${srcDir}/src"){ + exclude '**/.setting/**','.classpath','.project','**/*.java','**/*.db','**/*.g','**/package.html' + } + into 'build/classes/main' + } + +} + + +//压缩项目中的js文件 +task compressJS{ + ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){ + classpath { + fileset(dir:'../../../finereport-lib4build-stable',includes:'**/*.jar') + } + } + ant.yuicompress(linebreak:"500",warn:"false", munge:"yes",preserveallsemicolons:"false",charset:"utf-8",encoding:"utf-8",outputfolder:'build/classes/main'){ + fileset (dir:"${srcDir}/src"){ + include (name:'**/*.js') + include (name:'**/*.css') + } + + } +} +jar.dependsOn compressJS + + + diff --git a/designer_chart/build.release.gradle b/designer_chart/build.release.gradle new file mode 100644 index 0000000000..e97176e24c --- /dev/null +++ b/designer_chart/build.release.gradle @@ -0,0 +1,66 @@ + +apply plugin: 'java' +tasks.withType(JavaCompile){ + options.encoding = 'UTF-8' +} +//指定构建的jdk版本 +sourceCompatibility=1.8 +//指定生成jar包的版本 +version='8.0' + +def srcDir="." + +//对生成的jar包进行重命名 + +jar{ + baseName='fr-designer-chart' +} + +sourceSets{ + main{ + java{ + srcDirs=["${srcDir}/src"] + } + } +} +FileTree files =fileTree(dir:'./',include:'build.*.gradle') +def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ('\\')) +buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\')) +def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) + +//指定外部依赖 +dependencies{ +compile fileTree(dir:'../../../finereport-lib-stable/master',include:'**/*.jar') +compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar") + + testCompile 'junit:junit:4.12' +} +//将非.java 文件复制到classes文件夹下参与打包 +task copyFile(type:Copy,dependsOn:compileJava){ + copy{ + from ("${srcDir}/src"){ + exclude '**/.setting/**','.classpath','.project','**/*.java','**/*.db','**/*.g','**/package.html' + + } + into 'build/classes/main' + } + +} + +//压缩项目中的js文件 +task compressJS{ + ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){ + classpath { + fileset(dir:'../../../finereport-lib4build-stable',includes:'**/*.jar') + } + } + ant.yuicompress(linebreak:"500",warn:"false", munge:"yes",preserveallsemicolons:"false",charset:"utf-8",encoding:"utf-8",outputfolder:'build/classes/main'){ + fileset (dir:"${srcDir}/src"){ + include (name:'**/*.js') + include (name:'**/*.css') + } + + } +} +jar.dependsOn compressJS + diff --git a/designer_form/build.master.gradle b/designer_form/build.master.gradle new file mode 100644 index 0000000000..9c9764727c --- /dev/null +++ b/designer_form/build.master.gradle @@ -0,0 +1,83 @@ + +apply plugin: 'java' +tasks.withType(JavaCompile){ + options.encoding = 'UTF-8' +} +//指定构建的jdk版本 +sourceCompatibility=1.7 +//指定生成的jar包版本 +version='8.0' + +def srcDir="." + + +//指明生成jar包的名字 +jar{ + baseName='fr-designer-report' +} +//源码所在位置 +sourceSets{ + main{ + java{ + srcDirs=["${srcDir}/src", +"${srcDir}/../designer/src"] + } + } +} + +//获取什么分支名 +FileTree files =fileTree(dir:'./',include:'build.*.gradle') +def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ('\\')) +buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\')) +def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) + +//声明外部依赖 +dependencies{ +compile fileTree(dir:"../../../finereport-lib-stable/${branchName}",include:'**/*.jar') +compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar") + + testCompile 'junit:junit:4.12' +} + +//指明无法编译文件所在路径 +def dataContent ={def dir -> + copySpec{ + from ("${dir}"){ + exclude '**/.setting/**','.classpath','.project','**/*.java','**/*.db','**/*.g','**/package.html' + } + } +} + +//将非.java文件复制到classes文件夹下 参与打包 +task copyFile(type:Copy,dependsOn:compileJava){ + copy{ + with dataContent.call("${srcDir}/src") + with dataContent.call("${srcDir}/../designer/src") + into ('build/classes/main') + } + +} + + +//压缩项目中的js文件 +task compressJS{ + ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){ + classpath { + fileset(dir:'../../../finereport-lib4build-stable',includes:'**/*.jar') + } + } + ant.yuicompress(linebreak:"500",warn:"false", munge:"yes",preserveallsemicolons:"false", charset:"utf-8",encoding:"utf-8",outputfolder:'build/classes/main'){ + fileset (dir:"${srcDir}/src"){ + include (name:'**/*.js') + include (name:'**/*.css') + + } + fileset (dir:"${srcDir}/../designer/src"){ + include (name:'**/*.js') + include (name:'**/*.css') + } + + } +} +jar.dependsOn compressJS + diff --git a/designer_form/build.release.gradle b/designer_form/build.release.gradle new file mode 100644 index 0000000000..90abcb81ee --- /dev/null +++ b/designer_form/build.release.gradle @@ -0,0 +1,83 @@ + +apply plugin: 'java' +tasks.withType(JavaCompile){ + options.encoding = 'UTF-8' +} +//指定构建的jdk版本 +sourceCompatibility=1.8 +//指定生成的jar包版本 +version='8.0' + +def srcDir="." + + +//指明生成jar包的名字 +jar{ + baseName='fr-designer-report' +} +//源码所在位置 +sourceSets{ + main{ + java{ + srcDirs=["${srcDir}/src", +"${srcDir}/../designer/src"] + } + } +} + +//获取什么分支名 +FileTree files =fileTree(dir:'./',include:'build.*.gradle') +def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ('\\')) +buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\')) +def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) +//声明外部依赖 +dependencies{ +compile fileTree(dir:'../../../finereport-lib-stable/master',include:'**/*.jar') +compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar") + + testCompile 'junit:junit:4.12' +} + +//指明无法编译文件所在路径 +def dataContent ={def dir -> + copySpec{ + from ("${dir}"){ + exclude '**/.setting/**','.classpath','.project','**/*.java','**/*.db','**/*.g','**/package.html' + } + } +} + +//将非.java文件复制到classes文件夹下 参与打包 +task copyFile(type:Copy,dependsOn:compileJava){ + copy{ + with dataContent.call("${srcDir}/src") + with dataContent.call("${srcDir}/../designer/src") + into ('build/classes/main') + } + +} + + +//压缩项目中的js文件 +task compressJS{ + ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){ + classpath { + + fileset(dir:'../../../finereport-lib4build-stable',includes:'**/*.jar') + } + } + ant.yuicompress(linebreak:"500",warn:"false", munge:"yes",preserveallsemicolons:"false", charset:"utf-8",encoding:"utf-8",outputfolder:'build/classes/main'){ + fileset (dir:"${srcDir}/src"){ + include (name:'**/*.js') + include (name:'**/*.css') + + } + fileset (dir:"${srcDir}/../designer/src"){ + include (name:'**/*.js') + include (name:'**/*.css') + } + + } +} +jar.dependsOn compressJS + From bc446a5405bc36a4c94eff0ecd18071208aeab4c Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Fri, 18 Nov 2016 15:16:13 +0800 Subject: [PATCH 14/18] =?UTF-8?q?static=20final=E4=BF=AE=E9=A5=B0=E5=8F=98?= =?UTF-8?q?=E9=87=8F=EF=BC=8C=E6=B6=88=E9=99=A4=E9=AD=94=E6=9C=AF=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/form/mobile/FormMobileAttrPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java b/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java index 59d57f4a24..0aafd8258c 100644 --- a/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java +++ b/designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java @@ -15,6 +15,8 @@ public class FormMobileAttrPane extends BasicBeanPane{ //工具栏容器 private MobileToolBarPane mobileToolBarPane; + static final int paddingHeight = 10; + public FormMobileAttrPane() { this.initComponents(); } @@ -26,7 +28,6 @@ public class FormMobileAttrPane extends BasicBeanPane{ jPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); this.mobileToolBarPane = new MobileToolBarPane(); //设置一个JPanel包裹mobileToolBarPane这个Panel,让jPanel的高度等于mobileToolBarPane高度加10,再放入this中 - final int paddingHeight = 10; jPanel.setPreferredSize(new Dimension(0, (int)this.mobileToolBarPane.getPreferredSize().getHeight() + paddingHeight)); jPanel.add("North", mobileToolBarPane); this.add(jPanel); From 70eddf71d749e9f4d9e7b4a02e004914397d127b Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Fri, 18 Nov 2016 15:37:11 +0800 Subject: [PATCH 15/18] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E7=9A=84getReportMobileAttr=E6=96=B9=E6=B3=95=E7=9A=84?= =?UTF-8?q?=E5=90=8D=E5=AD=97=E6=94=B9=E6=88=90=E4=BA=86getFormMobileAttr?= =?UTF-8?q?=EF=BC=8C=E8=BF=99=E6=A0=B7=E5=90=88=E9=80=82=E4=B8=80=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/actions/FormMobileAttrAction.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java b/designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java index 91b0822d33..4f67187085 100644 --- a/designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java +++ b/designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java @@ -40,14 +40,14 @@ public class FormMobileAttrAction extends JTemplateAction { return; } final Form formTpl = jf.getTarget(); - FormMobileAttr mobileAttr = formTpl.getReportMobileAttr(); + FormMobileAttr mobileAttr = formTpl.getFormMobileAttr(); final FormMobileAttrPane mobileAttrPane = new FormMobileAttrPane(); mobileAttrPane.populateBean(mobileAttr); BasicDialog dialog = mobileAttrPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { @Override public void doOk() { - formTpl.setReportMobileAttr(mobileAttrPane.updateBean()); + formTpl.setFormMobileAttr(mobileAttrPane.updateBean()); jf.fireTargetModified(); } }); From f069d1eaaee1d592e2d7e2f27e3baf3f128225e7 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Sun, 20 Nov 2016 23:48:18 +0800 Subject: [PATCH 16/18] =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E4=BC=A0dev?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parameter/ParameterDefinitePane.java | 3 - .../design/extra/WebManagerPaneFactory.java | 2 +- designer_base/src/com/fr/env/RemoteEnv.java | 77 +++++++ .../fr/design/mainframe/ComponentTree.java | 50 +---- .../mainframe/FormWidgetDetailPane.java | 208 +++++++++++++++--- .../fr/design/mainframe/ShareWidgetPane.java | 3 +- .../design/mainframe/WidgetPropertyPane.java | 3 - .../mainframe/widget/UITreeComboBox.java | 23 +- .../parameter/ParameterToolBarPane.java | 9 +- 9 files changed, 282 insertions(+), 96 deletions(-) diff --git a/designer/src/com/fr/design/parameter/ParameterDefinitePane.java b/designer/src/com/fr/design/parameter/ParameterDefinitePane.java index 4b8572b710..43fc3c6fc4 100644 --- a/designer/src/com/fr/design/parameter/ParameterDefinitePane.java +++ b/designer/src/com/fr/design/parameter/ParameterDefinitePane.java @@ -20,9 +20,7 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.AuthorityToolBarPane; -import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.JWorkBook; -import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.menu.*; import com.fr.design.module.DesignModuleFactory; @@ -246,7 +244,6 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus isdelayItem.setSelected(reportParameterAttr.isDelayPlaying()); isshowWindowItem.setSelected(reportParameterAttr.isShowWindow()); isEditing = true; - EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance().getPreferredSize().height); ParameterBridge bridge = paraDesignEditor.getParaComponent(); if (parameterUI != null) { bridge.setDelayDisplayContent(reportParameterAttr.isDelayPlaying()); diff --git a/designer_base/src/com/fr/design/extra/WebManagerPaneFactory.java b/designer_base/src/com/fr/design/extra/WebManagerPaneFactory.java index 75a79deddd..e39a605a5d 100644 --- a/designer_base/src/com/fr/design/extra/WebManagerPaneFactory.java +++ b/designer_base/src/com/fr/design/extra/WebManagerPaneFactory.java @@ -26,7 +26,7 @@ public class WebManagerPaneFactory { } public BasicPane createPluginPane() { - if (StableUtils.getMajorJavaVersion() == 8) { + if (StableUtils.getMajorJavaVersion() != 8) { return new ShopManagerPane(new ShopPaneConfig() { @Override String getMainJS() { diff --git a/designer_base/src/com/fr/env/RemoteEnv.java b/designer_base/src/com/fr/env/RemoteEnv.java index ae8c589ee5..406c76ec75 100644 --- a/designer_base/src/com/fr/env/RemoteEnv.java +++ b/designer_base/src/com/fr/env/RemoteEnv.java @@ -31,6 +31,10 @@ import com.fr.plugin.Plugin; import com.fr.plugin.PluginLicense; import com.fr.plugin.PluginLicenseManager; import com.fr.plugin.PluginLoader; +<<<<<<< HEAD +import com.fr.share.ShareConstants; +======= +>>>>>>> 86c666e44132d7f8fa1727a6d78965b2423ce510 import com.fr.stable.*; import com.fr.stable.file.XMLFileManagerProvider; import com.fr.stable.project.ProjectConstants; @@ -1535,6 +1539,7 @@ public class RemoteEnv implements Env { para.put("op", "fr_remote_design"); para.put("cmd", "design_save_resource"); para.put("resource", mgr.fileName()); + para.put("class_name", mgr.getClass().getName()); para.put("current_uid", this.createUserID()); para.put("currentUsername", this.getUser()); @@ -2107,7 +2112,11 @@ public class RemoteEnv implements Env { @Override public File[] loadREUFile() throws Exception { File target = new File(CacheManager.getProviderInstance().getCacheDirectory(), +<<<<<<< HEAD + ShareConstants.DIR_SHARE_CACHE); +======= "fr_share"); +>>>>>>> 86c666e44132d7f8fa1727a6d78965b2423ce510 StableUtils.deleteFile(target); StableUtils.mkdirs(target); File cacheDir = null; @@ -2122,7 +2131,11 @@ public class RemoteEnv implements Env { HttpClient client = createHttpMethod(para); InputStream input = client.getResponseStream(); zip = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), "share.zip"); +<<<<<<< HEAD + cacheDir = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), ShareConstants.DIR_SHARE_CACHE); +======= cacheDir = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), "fr_share"); +>>>>>>> 86c666e44132d7f8fa1727a6d78965b2423ce510 StableUtils.deleteFile(cacheDir); StableUtils.mkdirs(cacheDir); StableUtils.makesureFileExist(zip); @@ -2146,4 +2159,68 @@ public class RemoteEnv implements Env { } return new File[0]; } +<<<<<<< HEAD + + @Override + public boolean installREUFile(File reuFile) { +// if (reuFile == null) { +// return false; +// } +// try { +// HashMap para = new HashMap(); +// para.put("op", "fr_remote_design"); +// para.put("cmd", "design_install_reufile"); +// para.put("current_uid", this.createUserID()); +// para.put("currentUsername", this.getUser()); +// para.put("reuFileName", reuFile.getName()); +// +// HttpClient client = createHttpMethod(para); +// client.setContent(IOUtils.inputStream2Bytes(new FileInputStream(reuFile))); +// InputStream input = execute4InputStream(client); +// return ComparatorUtils.equals(stream2String(input), "true"); +// } catch (Exception e) { +// return false; +// } + return false; + } + + @Override + public boolean removeREUFilesByName(String fileName) { + if (StringUtils.isEmpty(fileName)) { + return true; + } + try { + HashMap para = new HashMap(); + para.put("op", "fr_remote_design"); + para.put("cmd", "design_remove_reufile"); + para.put("current_uid", this.createUserID()); + para.put("currentUsername", this.getUser()); + para.put("reuFileName", fileName); + + HttpClient client = createHttpMethod(para); + InputStream input = execute4InputStream(client); + return ComparatorUtils.equals(stream2String(input), "true"); + } catch (Exception e) { + return false; + } + } + + @Override + public String getSharePath() { + try { + HashMap para = new HashMap(); + para.put("op", "fr_remote_design"); + para.put("cmd", "design_get_share_path"); + para.put("current_uid", this.createUserID()); + para.put("currentUsername", this.getUser()); + + HttpClient client = createHttpMethod(para); + InputStream input = execute4InputStream(client); + return stream2String(input); + } catch (Exception e) { + return StringUtils.EMPTY; + } + } +======= +>>>>>>> 86c666e44132d7f8fa1727a6d78965b2423ce510 } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/mainframe/ComponentTree.java b/designer_form/src/com/fr/design/mainframe/ComponentTree.java index ca84e44c03..f31a64eedf 100644 --- a/designer_form/src/com/fr/design/mainframe/ComponentTree.java +++ b/designer_form/src/com/fr/design/mainframe/ComponentTree.java @@ -37,30 +37,6 @@ public class ComponentTree extends JTree { this.setTransferHandler(new TreeTransferHandler()); this.refreshTreeRoot(); addTreeSelectionListener(designer); - - this.addMouseListener(new MouseAdapter() { - - @Override - public void mouseClicked(MouseEvent e) { - if (e.isPopupTrigger()) { - popupMenu(e); - } - } - - @Override - public void mousePressed(MouseEvent e) { - if (e.isPopupTrigger()) { - popupMenu(e); - } - } - - @Override - public void mouseReleased(MouseEvent e) { - if (e.isPopupTrigger()) { - popupMenu(e); - } - } - }); setEditable(true); } @@ -121,20 +97,6 @@ public class ComponentTree extends JTree { scrollPathToVisible(treepath); } - private void popupMenu(MouseEvent e) { - TreePath path = this.getSelectionPath(); - if (path == null) { - return; - } - Component component = (Component) path.getLastPathComponent(); - if (!(component instanceof XCreator)) { - return; - } - ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, (XCreator) component); - JPopupMenu menu = adapter.getContextPopupMenu(e); - menu.show(this, e.getX(), e.getY()); - } - /** * 刷新 */ @@ -241,12 +203,14 @@ public class ComponentTree extends JTree { creator.notShowInComponentTree(path); } //绝对布局作为body的时候不显示自适应布局父层 - if (((XCreator) parent).acceptType(XWAbsoluteBodyLayout.class) - && (parent.getParent() != null) - && ((XCreator)parent.getParent()).acceptType(XWFitLayout.class)){ - parent = parent.getParent().getParent(); - continue; + if (((XCreator) parent).acceptType(XWAbsoluteBodyLayout.class)) { + if ((parent.getParent() != null) + && ((XCreator)parent.getParent()).acceptType(XWFitLayout.class)){ + parent = parent.getParent().getParent(); + continue; + } } + parent = parent.getParent(); } Object[] components = path.toArray(); diff --git a/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java index bcc1400beb..bb15e23ed1 100644 --- a/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -11,12 +11,13 @@ import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.form.share.ShareConstants; import com.fr.form.share.ShareLoader; import com.fr.form.ui.ElCaseBindInfo; import com.fr.general.FRLogger; import com.fr.general.Inter; import com.fr.general.SiteCenter; +import com.fr.share.ShareConstants; +import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; import javax.swing.*; @@ -40,16 +41,20 @@ import java.net.URISyntaxException; public class FormWidgetDetailPane extends FormDockView{ private UITabbedPane tabbedPane; - private UIScrollPane downPanel; + private UIScrollPane downPane; private JPanel reuWidgetPanel; private UIComboBox comboBox; private ElCaseBindInfo[] elCaseBindInfoList; - private UIButton downloadButton; - private UIButton refreshButton; private UIButton deleteButton; + private UIButton resetButton; + private JPanel editPanel; + private JPanel resetPanel; + private JPanel menutPanel; private static final int OFFSET_X = 140; private static final int OFFSET_Y = 26; private SwingWorker sw; + //组件面板是否可以编辑 + private boolean isEdit; public static FormWidgetDetailPane getInstance() { if (HOLDER.singleton == null) { @@ -109,8 +114,6 @@ public class FormWidgetDetailPane extends FormDockView{ sw.execute(); } initReuWidgetPanel(); - createRefreshButton(); - createDownloadButton(); initMenuPanel(); tabbedPane = new UITabbedPane(); tabbedPane.setOpaque(true); @@ -126,38 +129,74 @@ public class FormWidgetDetailPane extends FormDockView{ * 初始化组件共享和复用面板 */ private void initReuWidgetPanel() { - downPanel = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList, false)); - reuWidgetPanel.add(downPanel); + elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); + downPane = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList, false)); + reuWidgetPanel.add(downPane); } /** * 初始化菜单栏面板 */ private void initMenuPanel() { - JPanel menutPane = new JPanel(); - menutPane.setLayout(FRGUIPaneFactory.createBorderLayout()); - menutPane.setBorder(BorderFactory.createEmptyBorder(3, 8, 3, 3)); - menutPane.setPreferredSize(new Dimension(240, 48)); - menutPane.add(new UILabel(Inter.getLocText("FR-Designer_LocalWidget"), + menutPanel = new JPanel(); + menutPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); + menutPanel.setBorder(BorderFactory.createEmptyBorder(3, 8, 3, 3)); + menutPanel.setPreferredSize(new Dimension(240, 48)); + menutPanel.add(new UILabel(Inter.getLocText("FR-Designer_LocalWidget"), SwingConstants.HORIZONTAL), BorderLayout.WEST); - JPanel buttonPanel = new JPanel(); - buttonPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); - buttonPanel.add(refreshButton, BorderLayout.WEST); - buttonPanel.add(downloadButton, BorderLayout.EAST); - menutPane.add(buttonPanel, BorderLayout.EAST); - menutPane.add(new JPanel(), BorderLayout.CENTER); + + menutPanel.add(initEditButtonPane(), BorderLayout.EAST); + menutPanel.add(new JPanel(), BorderLayout.CENTER); comboBox = new UIComboBox(getFormCategories()); comboBox.setPreferredSize(new Dimension(240, 30)); initComboBoxSelectedListener(); - menutPane.add(comboBox, BorderLayout.SOUTH); - reuWidgetPanel.add(menutPane, BorderLayout.NORTH); + menutPanel.add(comboBox, BorderLayout.SOUTH); + reuWidgetPanel.add(menutPanel, BorderLayout.NORTH); + + } + + /** + * 创建菜单栏按钮面板 + */ + private JPanel initEditButtonPane() { + editPanel = new JPanel(); + editPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); + editPanel.add(createRefreshButton(), BorderLayout.WEST); + editPanel.add(createDownloadButton(), BorderLayout.EAST); + return editPanel; + } + + /** + * 创建取消删除面板 + */ + private JPanel initResetButtonPane() { + resetPanel = new JPanel(); + resetButton = new UIButton(Inter.getLocText("FR-Designer_Reset")); + resetPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); + resetButton.set4ToolbarButton(); + resetButton.setOpaque(true); + resetButton.setBackground(new Color(184, 220, 242)); + resetButton.setForeground(Color.WHITE); + resetButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + refreshDownPanel(false); + replaceButtonPanel(false); + reuWidgetPanel.remove(deleteButton); + } + }); + resetPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); + resetPanel.add(resetButton, BorderLayout.CENTER); + return resetPanel; } + private void initComboBoxSelectedListener() { comboBox.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { + ShareLoader.getLoader().resetRemovedModuleList(); int filterIndex = comboBox.getSelectedIndex(); if (filterIndex == 0) { elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); @@ -165,14 +204,17 @@ public class FormWidgetDetailPane extends FormDockView{ String filterName = comboBox.getSelectedItem().toString(); elCaseBindInfoList = ShareLoader.getLoader().getFilterBindInfoList(filterName); } - refreshDownPanel(false); + refreshDownPanel(isEdit); } }); } - private void createRefreshButton() { - refreshButton = new UIButton(); + /** + * 创建刷新按钮 + */ + private UIButton createRefreshButton() { + UIButton refreshButton = new UIButton(); refreshButton.setIcon(BaseUtils.readIcon("/com/fr/design/form/images/refresh.png")); refreshButton.setToolTipText(Inter.getLocText("FR-Designer_Refresh")); refreshButton.set4ToolbarButton(); @@ -187,6 +229,7 @@ public class FormWidgetDetailPane extends FormDockView{ protected Object doInBackground() throws Exception { ShareLoader.getLoader().refreshModule(); elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); + refreshComboxData(); refreshDownPanel(false); return null; } @@ -194,20 +237,33 @@ public class FormWidgetDetailPane extends FormDockView{ sw.execute(); } }); + return refreshButton; } + private void refreshComboxData() { + comboBox.setSelectedIndex(0); + comboBox.setModel(new DefaultComboBoxModel(getFormCategories())); + } + /** * 创建下载模板的按钮 */ - private void createDownloadButton() { - downloadButton = new UIButton(); + private UIButton createDownloadButton() { + UIButton downloadButton = new UIButton(); downloadButton.setIcon(BaseUtils.readIcon("/com/fr/design/form/images/showmenu.png")); downloadButton.set4ToolbarButton(); downloadButton.setToolTipText(Inter.getLocText("FR-Designer_Download_Template")); downloadButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { +<<<<<<< HEAD + initPopMenu(); + } + }); + return downloadButton; + } +======= UIPopupMenu menu = new UIPopupMenu(); UIMenuItem downloadItem = new UIMenuItem(Inter.getLocText("FR-Designer_Download_Template"), BaseUtils.readIcon("/com/fr/design/form/images/download icon.png")); UIMenuItem installItem = new UIMenuItem(Inter.getLocText("FR-Designer_Install_Template"), BaseUtils.readIcon("/com/fr/design/form/images/install icon.png")); @@ -263,30 +319,82 @@ public class FormWidgetDetailPane extends FormDockView{ }); GUICoreUtils.showPopupMenu(menu, tabbedPane, tabbedPane.getX() + OFFSET_X, OFFSET_Y); +>>>>>>> 86c666e44132d7f8fa1727a6d78965b2423ce510 + /** + * 初始化下拉面板 + */ + private void initPopMenu() { + UIPopupMenu menu = new UIPopupMenu(); + UIMenuItem downloadItem = new UIMenuItem(Inter.getLocText("FR-Designer_Download_Template"), BaseUtils.readIcon("/com/fr/design/form/images/download icon.png")); + UIMenuItem installItem = new UIMenuItem(Inter.getLocText("FR-Designer_Install_Template"), BaseUtils.readIcon("/com/fr/design/form/images/install icon.png")); + UIMenuItem deleteItem = new UIMenuItem(Inter.getLocText("FR-Designer_Delete_Template"), BaseUtils.readIcon("/com/fr/design/form/images/delete icon.png")); + menu.add(downloadItem); + menu.add(installItem); + menu.add(deleteItem); + downloadItem.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + String url = SiteCenter.getInstance().acquireUrlByKind("reuse.url"); + if (StringUtils.isEmpty(url)) { + FRContext.getLogger().info("The URL is empty!"); + return; + } + try { + Desktop.getDesktop().browse(new URI(url)); + } catch (IOException exp) { + JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer_Set_default_browser")); + FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + } catch (URISyntaxException exp) { + FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + } catch (Exception exp) { + FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + FRContext.getLogger().error("Can not open the browser for URL: " + url); + } + } + }); + installItem.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + JFileChooser fileChooser = new JFileChooser(); + fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); + fileChooser.setFileFilter(new FileNameExtensionFilter(".reu", "reu")); + int returnValue = fileChooser.showDialog(new UILabel(), Inter.getLocText("FR-Designer_Select")); + if (returnValue == JFileChooser.APPROVE_OPTION) { + final File chosenFile = fileChooser.getSelectedFile(); + installFromDiskZipFile(chosenFile); + } + } + }); + deleteItem.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + replaceButtonPanel(true); + deleteFromDiskZipFile(); } }); + GUICoreUtils.showPopupMenu(menu, tabbedPane, tabbedPane.getX() + OFFSET_X, OFFSET_Y); } private void deleteFromDiskZipFile() { deleteButton = new UIButton(Inter.getLocText("FR-Designer-CommitTab_Remove")); - deleteButton.setOpaque(true); deleteButton.setBackground(Color.red); + deleteButton.repaint(); deleteButton.setPreferredSize(new Dimension(240, 40)); reuWidgetPanel.add(deleteButton, BorderLayout.SOUTH); deleteButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - if(ShareLoader.getLoader().removeModulesFromList()) { + if (ShareLoader.getLoader().removeModulesFromList()) { refreshShareMoudule(); reuWidgetPanel.remove(deleteButton); elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Removed_Successful")); refreshDownPanel(false); + replaceButtonPanel(false); + refreshComboxData(); } else { - reuWidgetPanel.remove(deleteButton); JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Removed_Failed")); - refreshDownPanel(false); } } @@ -295,6 +403,17 @@ public class FormWidgetDetailPane extends FormDockView{ } +<<<<<<< HEAD + private void replaceButtonPanel(boolean isEdit) { + this.isEdit = isEdit; + if (isEdit) { + menutPanel.remove(editPanel); + menutPanel.add(initResetButtonPane(), BorderLayout.EAST); + } else { + menutPanel.remove(resetPanel); + menutPanel.add(initEditButtonPane(), BorderLayout.EAST); + ShareLoader.getLoader().resetRemovedModuleList(); +======= private void installFromDiskZipFile(File chosenFile) { try { ShareLoader.getLoader().installModuleFromDiskZipFile(chosenFile); @@ -305,8 +424,29 @@ public class FormWidgetDetailPane extends FormDockView{ } catch (IOException e) { JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Error")); FRLogger.getLogger().error(e.getMessage(), e); +>>>>>>> 86c666e44132d7f8fa1727a6d78965b2423ce510 } + + } + + private void installFromDiskZipFile(File chosenFile) { + if (chosenFile != null && chosenFile.getName().endsWith(ShareConstants.SUFFIX_MODULE)) { + try { + if (ShareLoader.getLoader().installModuleFromDiskZipFile(chosenFile)) { + refreshShareMoudule(); + elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); + refreshDownPanel(false); + refreshComboxData(); + JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_OK")); + } else { + JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Error")); + } + } catch (IOException e) { + JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Error")); + FRLogger.getLogger().error(e.getMessage(), e); + } + } } private void refreshShareMoudule() { @@ -321,15 +461,15 @@ public class FormWidgetDetailPane extends FormDockView{ * 获取报表块组件分类 */ public String[] getFormCategories() { - return ShareConstants.WIDGET_CATEGORIES; + return ArrayUtils.addAll(new String[] {Inter.getLocText("FR-Designer_AllCategories")}, ShareLoader.getLoader().getModuleCategory()); } public void refreshDownPanel(boolean isEdit) { - reuWidgetPanel.remove(downPanel); - downPanel = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList, isEdit)); - reuWidgetPanel.add(downPanel); + reuWidgetPanel.remove(downPane); + downPane = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList, isEdit)); + reuWidgetPanel.add(downPane); repaintContainer(); } diff --git a/designer_form/src/com/fr/design/mainframe/ShareWidgetPane.java b/designer_form/src/com/fr/design/mainframe/ShareWidgetPane.java index 3965511355..c5659d9bc1 100644 --- a/designer_form/src/com/fr/design/mainframe/ShareWidgetPane.java +++ b/designer_form/src/com/fr/design/mainframe/ShareWidgetPane.java @@ -1,8 +1,8 @@ package com.fr.design.mainframe; - import com.fr.form.ui.ElCaseBindInfo; + import javax.swing.*; import java.awt.*; @@ -25,5 +25,4 @@ public class ShareWidgetPane extends JPanel { this.setPreferredSize(new Dimension(240, rowCount * 80)); } } - } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java b/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java index cc7f1d7690..860f9f52db 100644 --- a/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java +++ b/designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java @@ -38,7 +38,6 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper private EventPropertyTable eventTable; private List widgetPropertyTables; private FormDesigner designer; - private ComponentTree componentTree; private JPanel wsp; private MobileWidgetTable mobileWidgetTable; private MobileBodyWidgetTable mobileBodyWidgetTable; @@ -122,8 +121,6 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper clearDockingView(); return; } - - componentTree = new ComponentTree(designer); widgetPropertyTables = new ArrayList(); propertyTable = new WidgetPropertyTable(designer); designer.addDesignerEditListener(new WidgetPropertyDesignerAdapter(propertyTable)); diff --git a/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java b/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java index 38b62a99a1..0d7b224f64 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java +++ b/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java @@ -15,6 +15,7 @@ import com.fr.design.designer.beans.*; import com.fr.design.designer.beans.events.DesignerEditListener; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.XCreator; +import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.mainframe.ComponentTree; import com.sun.java.swing.plaf.motif.*; import com.sun.java.swing.plaf.windows.*; @@ -116,7 +117,6 @@ public class UITreeComboBox extends JComboBox{ JLabel lb = (JLabel)r.getTreeCellRendererComponent( tree, value, isSelected, false, false, index, cellHasFocus); - return lb; } return super.getListCellRendererComponent(list, value, index, @@ -129,7 +129,7 @@ public class UITreeComboBox extends JComboBox{ @Override public void fireCreatorModified(DesignerEvent evt) { - if (evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED || evt.getCreatorEventID() == DesignerEvent.CREATOR_PASTED) { + if (evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED) { TreePath[] paths = tree.getSelectedTreePath(); if (tree != null && paths.length > 0) { tree.setAndScrollSelectionPath(paths[0]); @@ -137,7 +137,19 @@ public class UITreeComboBox extends JComboBox{ MenuSelectionManager.defaultManager().clearSelectedPath(); } - } else { + } else if (evt.getCreatorEventID() == DesignerEvent.CREATOR_PASTED) { + tree.refreshUI(); + TreePath[] paths = tree.getSelectedTreePath(); + if (tree != null && paths.length > 0) { + tree.setAndScrollSelectionPath(paths[0]); + setSelectedItem(paths[0]); + MenuSelectionManager.defaultManager().clearSelectedPath(); + } + } else if (evt.getCreatorEventID() == DesignerEvent.CREATOR_CUTED) { + tree.refreshUI(); + setSelectedItem(null); + MenuSelectionManager.defaultManager().clearSelectedPath(); + } else { tree.refreshUI(); repaint(); } @@ -192,13 +204,12 @@ class TreePopup extends JPopupMenu implements ComboPopup{ public TreePopup(JComboBox comboBox){ this.comboBox = (UITreeComboBox)comboBox; - setBorder(BorderFactory.createLineBorder(Color.black)); setLayout(new BorderLayout()); setLightWeightPopupEnabled(comboBox.isLightWeightPopupEnabled()); JTree tree = this.comboBox.getTree(); if(tree != null){ - scrollPane = new JScrollPane(tree); - scrollPane.setBorder(null); + scrollPane = new UIScrollPane(tree); + scrollPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)); add(scrollPane, BorderLayout.CENTER); } } diff --git a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java index e1decfe2b4..9a3f8b563f 100644 --- a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java +++ b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java @@ -33,6 +33,7 @@ public class ParameterToolBarPane extends BasicBeanPane { private static final int GAP_H = 4; private static final int GAP_V = 6; private static final int GAP_BV = 4; + private static final int BUTTON_HEIGHT = 20; private static final int WIDTH = 225; private static final int L_H = 18; @@ -48,12 +49,12 @@ public class ParameterToolBarPane extends BasicBeanPane { return new Dimension(super.getPreferredSize().width, 18); } }; - label.setText(Inter.getLocText("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)); this.add(label); - addAll = new UIButton(Inter.getLocText("Add-all")); + addAll = new UIButton(Inter.getLocText("FR-Designer_Add_all")); this.add(addAll); } @@ -132,7 +133,7 @@ public class ParameterToolBarPane extends BasicBeanPane { layoutContainer(parent); - int h= ((parameterSelectedLabellist.size() == 0) ? L_H : breakid * (20 + GAP_V) + GAP_BV + L_H + GAP_H + addAll.getPreferredSize().height); + int h= ((parameterSelectedLabellist.size() == 0) ? L_H : breakid * (BUTTON_HEIGHT + GAP_V) + GAP_BV + L_H + GAP_H + addAll.getPreferredSize().height); return new Dimension(w, h); } @@ -160,7 +161,7 @@ public class ParameterToolBarPane extends BasicBeanPane { x += (dim.width + GAP_H); } - addAll.setBounds(0, y + GAP_V+ 20, width, addAll.getPreferredSize().height); + addAll.setBounds(0, y + GAP_V + BUTTON_HEIGHT, width, addAll.getPreferredSize().height); } } From 7a7f1c9b567a8f042b2b69dd0da96a05e629d292 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Mon, 21 Nov 2016 00:02:29 +0800 Subject: [PATCH 17/18] =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E4=BC=A0=E4=B8=8Bdev?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/extra/WebManagerPaneFactory.java | 2 +- designer_base/src/com/fr/env/RemoteEnv.java | 14 ---- .../mainframe/FormWidgetDetailPane.java | 71 ------------------- 3 files changed, 1 insertion(+), 86 deletions(-) diff --git a/designer_base/src/com/fr/design/extra/WebManagerPaneFactory.java b/designer_base/src/com/fr/design/extra/WebManagerPaneFactory.java index e39a605a5d..75a79deddd 100644 --- a/designer_base/src/com/fr/design/extra/WebManagerPaneFactory.java +++ b/designer_base/src/com/fr/design/extra/WebManagerPaneFactory.java @@ -26,7 +26,7 @@ public class WebManagerPaneFactory { } public BasicPane createPluginPane() { - if (StableUtils.getMajorJavaVersion() != 8) { + if (StableUtils.getMajorJavaVersion() == 8) { return new ShopManagerPane(new ShopPaneConfig() { @Override String getMainJS() { diff --git a/designer_base/src/com/fr/env/RemoteEnv.java b/designer_base/src/com/fr/env/RemoteEnv.java index 406c76ec75..ce7118e69b 100644 --- a/designer_base/src/com/fr/env/RemoteEnv.java +++ b/designer_base/src/com/fr/env/RemoteEnv.java @@ -31,10 +31,7 @@ import com.fr.plugin.Plugin; import com.fr.plugin.PluginLicense; import com.fr.plugin.PluginLicenseManager; import com.fr.plugin.PluginLoader; -<<<<<<< HEAD import com.fr.share.ShareConstants; -======= ->>>>>>> 86c666e44132d7f8fa1727a6d78965b2423ce510 import com.fr.stable.*; import com.fr.stable.file.XMLFileManagerProvider; import com.fr.stable.project.ProjectConstants; @@ -2112,11 +2109,7 @@ public class RemoteEnv implements Env { @Override public File[] loadREUFile() throws Exception { File target = new File(CacheManager.getProviderInstance().getCacheDirectory(), -<<<<<<< HEAD ShareConstants.DIR_SHARE_CACHE); -======= - "fr_share"); ->>>>>>> 86c666e44132d7f8fa1727a6d78965b2423ce510 StableUtils.deleteFile(target); StableUtils.mkdirs(target); File cacheDir = null; @@ -2131,11 +2124,7 @@ public class RemoteEnv implements Env { HttpClient client = createHttpMethod(para); InputStream input = client.getResponseStream(); zip = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), "share.zip"); -<<<<<<< HEAD cacheDir = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), ShareConstants.DIR_SHARE_CACHE); -======= - cacheDir = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), "fr_share"); ->>>>>>> 86c666e44132d7f8fa1727a6d78965b2423ce510 StableUtils.deleteFile(cacheDir); StableUtils.mkdirs(cacheDir); StableUtils.makesureFileExist(zip); @@ -2159,7 +2148,6 @@ public class RemoteEnv implements Env { } return new File[0]; } -<<<<<<< HEAD @Override public boolean installREUFile(File reuFile) { @@ -2221,6 +2209,4 @@ public class RemoteEnv implements Env { return StringUtils.EMPTY; } } -======= ->>>>>>> 86c666e44132d7f8fa1727a6d78965b2423ce510 } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java index bb15e23ed1..c33e1b113b 100644 --- a/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -257,69 +257,11 @@ public class FormWidgetDetailPane extends FormDockView{ downloadButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { -<<<<<<< HEAD initPopMenu(); } }); return downloadButton; } -======= - UIPopupMenu menu = new UIPopupMenu(); - UIMenuItem downloadItem = new UIMenuItem(Inter.getLocText("FR-Designer_Download_Template"), BaseUtils.readIcon("/com/fr/design/form/images/download icon.png")); - UIMenuItem installItem = new UIMenuItem(Inter.getLocText("FR-Designer_Install_Template"), BaseUtils.readIcon("/com/fr/design/form/images/install icon.png")); - UIMenuItem deleteItem = new UIMenuItem(Inter.getLocText("FR-Designer_Delete_Template"), BaseUtils.readIcon("/com/fr/design/form/images/delete icon.png")); - - menu.add(downloadItem); - menu.add(installItem); - menu.add(deleteItem); - - downloadItem.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - String url = SiteCenter.getInstance().acquireUrlByKind("reuse.url"); - if (StringUtils.isEmpty(url)) { - FRContext.getLogger().info("The URL is empty!"); - return; - } - try { - Desktop.getDesktop().browse(new URI(url)); - } catch (IOException exp) { - JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer_Set_default_browser")); - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); - } catch (URISyntaxException exp) { - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); - } catch (Exception exp) { - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); - FRContext.getLogger().error("Can not open the browser for URL: " + url); - } - - } - }); - - installItem.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - JFileChooser fileChooser = new JFileChooser(); - fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); - fileChooser.setFileFilter(new FileNameExtensionFilter(".reu", "reu")); - int returnValue = fileChooser.showDialog(new JLabel(), Inter.getLocText("FR-Designer_Select")); - if (returnValue == JFileChooser.APPROVE_OPTION) { - final File chosenFile = fileChooser.getSelectedFile(); - installFromDiskZipFile(chosenFile); - - } - } - }); - - deleteItem.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - deleteFromDiskZipFile(); - } - }); - - GUICoreUtils.showPopupMenu(menu, tabbedPane, tabbedPane.getX() + OFFSET_X, OFFSET_Y); ->>>>>>> 86c666e44132d7f8fa1727a6d78965b2423ce510 /** * 初始化下拉面板 @@ -403,7 +345,6 @@ public class FormWidgetDetailPane extends FormDockView{ } -<<<<<<< HEAD private void replaceButtonPanel(boolean isEdit) { this.isEdit = isEdit; if (isEdit) { @@ -413,18 +354,6 @@ public class FormWidgetDetailPane extends FormDockView{ menutPanel.remove(resetPanel); menutPanel.add(initEditButtonPane(), BorderLayout.EAST); ShareLoader.getLoader().resetRemovedModuleList(); -======= - private void installFromDiskZipFile(File chosenFile) { - try { - ShareLoader.getLoader().installModuleFromDiskZipFile(chosenFile); - refreshShareMoudule(); - elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); - refreshDownPanel(false); - JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_OK")); - } catch (IOException e) { - JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Error")); - FRLogger.getLogger().error(e.getMessage(), e); ->>>>>>> 86c666e44132d7f8fa1727a6d78965b2423ce510 } From 3a2e886afc1b25d9fe4b3594c55d6cc437567d7a Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Mon, 21 Nov 2016 01:01:24 +0800 Subject: [PATCH 18/18] =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E4=BC=A0dev?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/CoverReportPane.java | 2 +- .../src/com/fr/design/mainframe/ShareWidgetButton.java | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/CoverReportPane.java b/designer_form/src/com/fr/design/mainframe/CoverReportPane.java index 1d8277c461..196d8752a1 100644 --- a/designer_form/src/com/fr/design/mainframe/CoverReportPane.java +++ b/designer_form/src/com/fr/design/mainframe/CoverReportPane.java @@ -3,7 +3,7 @@ package com.fr.design.mainframe; import com.fr.design.constants.UIConstants; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.icon.IconPathConstants; -import com.fr.form.share.ShareConstants; +import com.fr.share.ShareConstants; import com.fr.general.FRScreen; import com.fr.general.IOUtils; import com.fr.stable.StringUtils; diff --git a/designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java b/designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java index ec663176e9..12e5302b05 100644 --- a/designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java +++ b/designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java @@ -1,12 +1,10 @@ package com.fr.design.mainframe; import com.fr.base.*; -import com.fr.design.constants.UIConstants; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.icon.IconPathConstants; -import com.fr.form.share.ShareConstants; +import com.fr.share.ShareConstants; import com.fr.form.share.ShareLoader; import com.fr.form.ui.ElCaseBindInfo; import com.fr.form.ui.Widget;