From 02d6e3050c6020a0f2492e53245d3014ca889862 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 31 Oct 2018 18:02:05 +0800 Subject: [PATCH 1/8] =?UTF-8?q?REPORT-10591=20=E8=87=AA=E9=80=82=E5=BA=94?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E5=86=85=E7=BD=AE=20=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/conf/FitAttrState.java | 76 ++++++ .../fun/FormElementCaseEditorProcessor.java | 2 +- .../fun/FormElementCaseEditorProvider.java | 2 +- ...bstractFormElementCaseEditorProcessor.java | 2 +- ...AbstractFormElementCaseEditorProvider.java | 2 +- .../menupane/BrowserFitAttrPane.java | 232 ++++++++++++++++++ .../mainframe/menupane/FitPreviewPane.java | 74 ++++++ .../mainframe/menupane/FitRadioGroup.java | 80 ++++++ .../mainframe/menupane/FontRadioGroup.java | 17 ++ .../menupane/ReportFitAttrAction.java | 107 ++++++++ .../mainframe/menupane/ReportFitAttrPane.java | 56 +++++ .../menupane/TemplateBrowserFitAttrPane.java | 77 ++++++ .../menupane/TemplateFitAttrPane.java | 55 +++++ .../fr/design/images/reportfit.preview/00.png | Bin 0 -> 745 bytes .../fr/design/images/reportfit.preview/10.png | Bin 0 -> 1643 bytes .../fr/design/images/reportfit.preview/11.png | Bin 0 -> 740 bytes .../fr/design/images/reportfit.preview/20.png | Bin 0 -> 2459 bytes .../fr/design/images/reportfit.preview/21.png | Bin 0 -> 788 bytes .../fr/design/images/reportfit.preview/30.png | Bin 0 -> 788 bytes .../images/reportfit.preview/gray/00.png | Bin 0 -> 745 bytes .../images/reportfit.preview/gray/10.png | Bin 0 -> 1507 bytes .../images/reportfit.preview/gray/11.png | Bin 0 -> 740 bytes .../images/reportfit.preview/gray/20.png | Bin 0 -> 2277 bytes .../images/reportfit.preview/gray/21.png | Bin 0 -> 782 bytes .../images/reportfit.preview/gray/30.png | Bin 0 -> 783 bytes .../design/designer/creator/XElementCase.java | 23 +- .../java/com/fr/design/mainframe/JForm.java | 5 +- .../BrowserFitAlignmentItems.java | 21 ++ .../widget/propertypane/BrowserFitEditor.java | 47 ++++ .../BrowserFitPropertyEditor.java | 45 ++++ .../widget/propertypane/BrowserFitRender.java | 10 + .../propertypane/BrowserFitWrapper.java | 9 + .../com/fr/design/mainframe/JWorkBook.java | 2 + 33 files changed, 927 insertions(+), 17 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/conf/FitAttrState.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/menupane/BrowserFitAttrPane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/menupane/FitPreviewPane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/menupane/FitRadioGroup.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/menupane/FontRadioGroup.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/menupane/ReportFitAttrAction.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/menupane/ReportFitAttrPane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/menupane/TemplateBrowserFitAttrPane.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/menupane/TemplateFitAttrPane.java create mode 100644 designer-base/src/main/resources/com/fr/design/images/reportfit.preview/00.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/reportfit.preview/10.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/reportfit.preview/11.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/reportfit.preview/20.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/reportfit.preview/21.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/reportfit.preview/30.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/reportfit.preview/gray/00.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/reportfit.preview/gray/10.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/reportfit.preview/gray/11.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/reportfit.preview/gray/20.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/reportfit.preview/gray/21.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/reportfit.preview/gray/30.png create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitAlignmentItems.java create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitEditor.java create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitPropertyEditor.java create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitRender.java create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitWrapper.java diff --git a/designer-base/src/main/java/com/fr/conf/FitAttrState.java b/designer-base/src/main/java/com/fr/conf/FitAttrState.java new file mode 100644 index 0000000000..9ad42fd6e7 --- /dev/null +++ b/designer-base/src/main/java/com/fr/conf/FitAttrState.java @@ -0,0 +1,76 @@ +package com.fr.conf; + +import com.fr.design.designer.properties.items.Item; +import com.fr.report.fun.ReportFitAttrProvider; +import com.fr.stable.StringUtils; + +/** + * Created by Administrator on 2016/4/13/0013. + */ +public enum FitAttrState { + DEFAULT(0) { + @Override + public String description() { + return com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Fit_Default"); + } + + }, + // 横向自适应, 纵向根据横向的比例来适配 + HORIZONTAL_FIT(1) { + @Override + public String description() { + return com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Fit_Horizontal"); + } + }, + // 双向自适应, 横纵向都是根据页面宽高来计算 + DOUBLE_FIT(2) { + @Override + public String description() { + return com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Fit_Horizontal_Vertical"); + } + }, + + NOT_FIT(3) { + @Override + public String description() { + return com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Fit_No"); + } + }; + + + private int state; + + + FitAttrState(int state) { + this.state = state; + } + + public static FitAttrState parse(ReportFitAttrProvider attr) { + + if (attr == null) { + return DEFAULT; + } + + for (FitAttrState attrState : values()) { + if (attrState.state == attr.fitStateInPC()) { + return attrState; + } + } + + return DEFAULT; + } + + public int getState() { + return this.state; + } + + + public String description() { + return StringUtils.EMPTY; + } + + public Item propertyItem() { + return new Item(this.description(), this.getState()); + } + +} diff --git a/designer-base/src/main/java/com/fr/design/fun/FormElementCaseEditorProcessor.java b/designer-base/src/main/java/com/fr/design/fun/FormElementCaseEditorProcessor.java index 21866a2c32..28d763bf71 100644 --- a/designer-base/src/main/java/com/fr/design/fun/FormElementCaseEditorProcessor.java +++ b/designer-base/src/main/java/com/fr/design/fun/FormElementCaseEditorProcessor.java @@ -1,6 +1,6 @@ package com.fr.design.fun; -import com.fr.stable.fun.ReportFitAttrProvider; +import com.fr.report.fun.ReportFitAttrProvider; import com.fr.stable.fun.mark.Immutable; import java.beans.PropertyDescriptor; diff --git a/designer-base/src/main/java/com/fr/design/fun/FormElementCaseEditorProvider.java b/designer-base/src/main/java/com/fr/design/fun/FormElementCaseEditorProvider.java index 92a1a835f4..6a0cf7bba1 100644 --- a/designer-base/src/main/java/com/fr/design/fun/FormElementCaseEditorProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/FormElementCaseEditorProvider.java @@ -2,7 +2,7 @@ package com.fr.design.fun; import com.fr.form.FormProvider; import com.fr.form.ui.ElementCaseEditorProvider; -import com.fr.stable.fun.ReportFitAttrProvider; +import com.fr.report.fun.ReportFitAttrProvider; import com.fr.stable.fun.mark.Mutable; import java.beans.PropertyDescriptor; diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java index 08a5a1606f..191f513908 100644 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java @@ -1,7 +1,7 @@ package com.fr.design.fun.impl; import com.fr.design.fun.FormElementCaseEditorProcessor; -import com.fr.stable.fun.ReportFitAttrProvider; +import com.fr.report.fun.ReportFitAttrProvider; import com.fr.stable.fun.mark.API; import java.beans.PropertyDescriptor; diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormElementCaseEditorProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormElementCaseEditorProvider.java index 8764eaf898..f9d3e1b173 100644 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormElementCaseEditorProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormElementCaseEditorProvider.java @@ -3,7 +3,7 @@ package com.fr.design.fun.impl; import com.fr.design.fun.FormElementCaseEditorProvider; import com.fr.form.FormProvider; import com.fr.form.ui.ElementCaseEditorProvider; -import com.fr.stable.fun.ReportFitAttrProvider; +import com.fr.report.fun.ReportFitAttrProvider; import com.fr.stable.fun.mark.API; import java.beans.PropertyDescriptor; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/menupane/BrowserFitAttrPane.java b/designer-base/src/main/java/com/fr/design/mainframe/menupane/BrowserFitAttrPane.java new file mode 100644 index 0000000000..eeaa3047ca --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/menupane/BrowserFitAttrPane.java @@ -0,0 +1,232 @@ +package com.fr.design.mainframe.menupane; + +import com.fr.conf.FitAttrState; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ibutton.UIRadioButton; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.log.FineLoggerFactory; +import com.fr.main.ReportFitAttr; +import com.fr.main.ReportFitConfig; +import com.fr.report.fun.ReportFitAttrProvider; + +import javax.swing.BorderFactory; +import javax.swing.ButtonGroup; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Cursor; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +/** + * Created by Administrator on 2016/5/5/0005. + */ +public class BrowserFitAttrPane extends BasicBeanPane { + + protected FontRadioGroup fontRadioGroup; + protected FitRadioGroup fitRadionGroup; + protected UICheckBox globalCheck; + protected FitPreviewPane fitPreviewPane; + protected ReportFitAttrProvider localFitAttr; + protected UIRadioButton defaultRadio; + protected UIRadioButton horizonRadio; + protected UIRadioButton doubleRadio; + protected UIRadioButton notFitRadio; + protected UIRadioButton fontFitRadio; + protected UIRadioButton fontNotFitRadio; + private UIButton editGlobalOps; + private JPanel borderPane; + private JPanel globalOpsPane; + private JPanel fitOpsPane; + + public BrowserFitAttrPane() { + initComponents(ReportFitConfig.getInstance().getFrmFitAttr()); + } + + protected void initComponents(ReportFitAttr globalFitAttr) { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + globalOpsPane = initGlobalOpsPane(globalFitAttr); + this.add(globalOpsPane, BorderLayout.NORTH); + fitOpsPane = initFitOpsPane(); + + } + + protected void initBorderPane(String title) { + borderPane = FRGUIPaneFactory.createTitledBorderPaneCenter(title); + borderPane.add(fitOpsPane, BorderLayout.CENTER); + fitPreviewPane = new FitPreviewPane(); + borderPane.add(fitPreviewPane, BorderLayout.SOUTH); + this.add(borderPane, BorderLayout.CENTER); + } + + private JPanel initFitOpsPane() { + double p = TableLayout.PREFERRED; + double[] rowSize = {p, p}; + double[] columnSize = {p, p, p, p, p}; + + ActionListener actionListener = getPreviewActionListener(); + + fontRadioGroup = new FontRadioGroup(); + fontFitRadio = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Fit")); + fontFitRadio.setSelected(true); + fontNotFitRadio = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Fit_No")); + addRadioToGroup(fontRadioGroup, fontFitRadio, fontNotFitRadio); + fontRadioGroup.addActionListener(actionListener); + + fitRadionGroup = new FitRadioGroup(); + defaultRadio = new UIRadioButton(FitAttrState.DEFAULT.description()); + horizonRadio = new UIRadioButton(FitAttrState.HORIZONTAL_FIT.description()); + doubleRadio = new UIRadioButton(FitAttrState.DOUBLE_FIT.description()); + notFitRadio = new UIRadioButton(FitAttrState.NOT_FIT.description()); + addRadioToGroup(fitRadionGroup, defaultRadio, horizonRadio, doubleRadio, notFitRadio); + fitRadionGroup.addActionListener(actionListener); + + + JPanel fitOpsPane = TableLayoutHelper.createTableLayoutPane(initFitComponents(), rowSize, columnSize); + fitOpsPane.setBorder(BorderFactory.createEmptyBorder(10, 13, 10, 10)); + return fitOpsPane; + } + + protected Component[][] initFitComponents() { + Component[][] components = new Component[][]{ + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Fit-Font")), fontFitRadio, null, fontNotFitRadio}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Fit-Element")), defaultRadio, horizonRadio, doubleRadio, notFitRadio} + }; + return components; + } + + private void addRadioToGroup(ButtonGroup buttonGroup, UIRadioButton... radios) { + for (UIRadioButton radio : radios) { + buttonGroup.add(radio); + } + } + + private JPanel initGlobalOpsPane(final ReportFitAttr globalFitAttr) { + final JPanel globalOpsPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); + globalCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Use-Global")); + globalOpsPane.add(globalCheck); + globalCheck.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + boolean isLocalConfig = !globalCheck.isSelected(); + //勾选全局时,采用全局保存的自适应属性更新界面 + if (!isLocalConfig) { + ReportFitAttrProvider attr = globalFitAttr; + fontRadioGroup.selectFontFit(((ReportFitAttr) attr).isFitFont()); + fitRadionGroup.selectIndexButton(attr.fitStateInPC()); + fitPreviewPane.refreshPreview(getCurrentFitOptions(), fitRadionGroup.isEnabled()); + remove(BrowserFitAttrPane.this.borderPane); + initBorderPane(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Global")); + } else { + ReportFitAttrProvider attr = localFitAttr; + fontRadioGroup.selectFontFit(((ReportFitAttr) attr).isFitFont()); + fitRadionGroup.selectIndexButton(attr.fitStateInPC()); + fitPreviewPane.refreshPreview(getCurrentFitOptions(), fitRadionGroup.isEnabled()); + remove(BrowserFitAttrPane.this.borderPane); + initBorderPane(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Local")); + } + fontRadioGroup.setEnabled(isLocalConfig); + fitRadionGroup.setEnabled(isLocalConfig); + editGlobalOps.setVisible(!isLocalConfig); + String fitOptions = getCurrentFitOptions(); + fitPreviewPane.refreshPreview(fitOptions, fitRadionGroup.isEnabled()); + } + }); + + editGlobalOps = new UIButton(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Edit-Global")); + editGlobalOps.setVisible(false); + editGlobalOps.addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent evt) { + fontRadioGroup.setEnabled(true); + fitRadionGroup.setEnabled(true); + String fitOptions = getCurrentFitOptions(); + + fitPreviewPane.refreshPreview(fitOptions, fitRadionGroup.isEnabled()); + } + + public void mouseEntered(MouseEvent e) { + setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + } + + public void mouseExited(MouseEvent e) { + setCursor(Cursor.getDefaultCursor()); + } + }); + globalOpsPane.add(editGlobalOps); + return globalOpsPane; + } + + @Override + protected String title4PopupWindow() { + return com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Attr-Set"); + } + + @Override + public void populateBean(ReportFitAttrProvider attr) { + if (attr == null) { + //如果为空, 就用全局的 + attr = ReportFitConfig.getInstance().getFrmFitAttr(); + populateGlobalComponents(); + } else { + initBorderPane(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Local")); + } + this.localFitAttr = attr; + fontRadioGroup.selectFontFit(((ReportFitAttr) attr).isFitFont()); + fitRadionGroup.selectIndexButton(attr.fitStateInPC()); + fitPreviewPane.refreshPreview(getCurrentFitOptions(), fitRadionGroup.isEnabled()); + } + + protected void populateGlobalComponents() { + globalCheck.setSelected(true); + fontRadioGroup.setEnabled(false); + fitRadionGroup.setEnabled(false); + editGlobalOps.setVisible(true); + initBorderPane(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Global")); + } + + //有八种组合, 不过有意义的就是6种, 以此为key去缓存里找对应的预览图片 + public String getCurrentFitOptions() { + return fitRadionGroup.getSelectRadioIndex() + "" + fontRadioGroup.getSelectRadioIndex(); + } + + private ActionListener getPreviewActionListener() { + return new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + String fitOptions = getCurrentFitOptions(); + fitPreviewPane.refreshPreview(fitOptions, fontRadioGroup.isEnabled()); + } + }; + } + + @Override + public ReportFitAttrProvider updateBean() { + ReportFitAttr attr = new ReportFitAttr(); + attr.setFitFont(fontRadioGroup.isFontFit()); + attr.setFitStateInPC(fitRadionGroup.getSelectRadioIndex()); + + // 直接用全局的 + if (globalCheck.isSelected()) { + updateGlobalConfig(attr); + return null; + } + this.localFitAttr = attr; + return attr; + } + + private void updateGlobalConfig(ReportFitAttr attr) { + try { + ReportFitConfig manager = ReportFitConfig.getInstance(); + manager.setFrmFitAttr(attr); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage()); + } + } +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/mainframe/menupane/FitPreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/menupane/FitPreviewPane.java new file mode 100644 index 0000000000..fbc12c3b3d --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/menupane/FitPreviewPane.java @@ -0,0 +1,74 @@ +package com.fr.design.mainframe.menupane; + +import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.general.IOUtils; + +import javax.swing.ImageIcon; +import java.util.HashMap; +import java.util.Map; + +/** + * Created by Administrator on 2016/5/5/0005. + */ +public class FitPreviewPane extends BasicPane { + private static final String DEFAULT_FONT_TAG = "00"; + private static final String DEFAULT_TAG = "01"; + private static final String HORIZON_FONT_TAG = "10"; + private static final String HORIZON_TAG = "11"; + private static final String DOUBLE_FONT_TAG = "20"; + private static final String DOUBLE_TAG = "21"; + private static final String NOT_FONT_TAG = "30"; + private static final String NOT_TAG = "31"; + + private UILabel imageLabel; + private Map cachedPreviewImage = new HashMap(); + private Map globalCachedPreviewImage = new HashMap(); + + public FitPreviewPane() { + //初始化缓存图片, 有些无意义的组合. + initCacheImage(); + //初始化组件 + initComponents(); + } + + //默认和不自适应时,字体自适应不起效,只有6张图 + private void initCacheImage() { + globalCachedPreviewImage.put(DEFAULT_FONT_TAG, new ImageIcon(IOUtils.readImage("/com/fr/design/images/reportfit/preview/gray/" + DEFAULT_FONT_TAG + ".png"))); + globalCachedPreviewImage.put(DEFAULT_TAG, new ImageIcon(IOUtils.readImage("/com/fr/design/images/reportfit/preview/gray/" + DEFAULT_FONT_TAG + ".png"))); + globalCachedPreviewImage.put(HORIZON_FONT_TAG, new ImageIcon(IOUtils.readImage("/com/fr/design/images/reportfit/preview/gray/" + HORIZON_FONT_TAG + ".png"))); + globalCachedPreviewImage.put(HORIZON_TAG, new ImageIcon(IOUtils.readImage("/com/fr/design/images/reportfit/preview/gray/" + HORIZON_TAG + ".png"))); + globalCachedPreviewImage.put(DOUBLE_FONT_TAG, new ImageIcon(IOUtils.readImage("/com/fr/design/images/reportfit/preview/gray/" + DOUBLE_FONT_TAG + ".png"))); + globalCachedPreviewImage.put(DOUBLE_TAG, new ImageIcon(IOUtils.readImage("/com/fr/design/images/reportfit/preview/gray/" + DOUBLE_TAG + ".png"))); + globalCachedPreviewImage.put(NOT_FONT_TAG, new ImageIcon(IOUtils.readImage("/com/fr/design/images/reportfit/preview/gray/" + NOT_FONT_TAG + ".png"))); + globalCachedPreviewImage.put(NOT_TAG, new ImageIcon(IOUtils.readImage("/com/fr/design/images/reportfit/preview/gray/" + NOT_FONT_TAG + ".png"))); + cachedPreviewImage.put(DEFAULT_FONT_TAG, new ImageIcon(IOUtils.readImage("/com/fr/design/images/reportfit/preview/" + DEFAULT_FONT_TAG + ".png"))); + cachedPreviewImage.put(DEFAULT_TAG, new ImageIcon(IOUtils.readImage("/com/fr/design/images/reportfit/preview/" + DEFAULT_FONT_TAG + ".png"))); + cachedPreviewImage.put(HORIZON_FONT_TAG, new ImageIcon(IOUtils.readImage("/com/fr/design/images/reportfit/preview/" + HORIZON_FONT_TAG + ".png"))); + cachedPreviewImage.put(HORIZON_TAG, new ImageIcon(IOUtils.readImage("/com/fr/design/images/reportfit/preview/" + HORIZON_TAG + ".png"))); + cachedPreviewImage.put(DOUBLE_FONT_TAG, new ImageIcon(IOUtils.readImage("/com/fr/design/images/reportfit/preview/" + DOUBLE_FONT_TAG + ".png"))); + cachedPreviewImage.put(DOUBLE_TAG, new ImageIcon(IOUtils.readImage("/com/fr/design/images/reportfit/preview/" + DOUBLE_TAG + ".png"))); + cachedPreviewImage.put(NOT_FONT_TAG, new ImageIcon(IOUtils.readImage("/com/fr/design/images/reportfit/preview/" + NOT_FONT_TAG + ".png"))); + cachedPreviewImage.put(NOT_TAG, new ImageIcon(IOUtils.readImage("/com/fr/design/images/reportfit/preview/" + NOT_FONT_TAG + ".png"))); + } + + private void initComponents() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + imageLabel = new UILabel(); + imageLabel.setIcon(cachedPreviewImage.get(DEFAULT_TAG)); + this.add(imageLabel); + } + + public void refreshPreview(String index, boolean isEditedable) { + ImageIcon newImageIcon = isEditedable ? cachedPreviewImage.get(index) : globalCachedPreviewImage.get(index); + imageLabel.setIcon(newImageIcon); + } + + @Override + protected String title4PopupWindow() { + return com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Preview"); + } + + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/menupane/FitRadioGroup.java b/designer-base/src/main/java/com/fr/design/mainframe/menupane/FitRadioGroup.java new file mode 100644 index 0000000000..e2612f794c --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/menupane/FitRadioGroup.java @@ -0,0 +1,80 @@ +package com.fr.design.mainframe.menupane; + +import com.fr.design.gui.ibutton.UIRadioButton; + +import javax.swing.AbstractButton; +import javax.swing.ButtonGroup; +import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.List; + +/** + * 自适应四个按钮选项的group + *

+ * Created by Administrator on 2016/5/5/0005. + */ +public class FitRadioGroup extends ButtonGroup { + + private List radioButtons = new ArrayList(); + + @Override + public void add(AbstractButton button) { + super.add(button); + + UIRadioButton radioButton = (UIRadioButton) button; + radioButtons.add(radioButton); + } + + /** + * 设置按钮状态 + */ + public boolean isEnabled() { + return radioButtons.get(0).isEnabled(); + } + + /** + * 设置按钮状态 + */ + public void setEnabled(boolean enabled) { + for (UIRadioButton radioButton : radioButtons) { + radioButton.setEnabled(enabled); + } + } + + /** + * 获取当前选中的按钮index + * + * @return 按钮index + */ + public int getSelectRadioIndex() { + for (int i = 0, len = radioButtons.size(); i < len; i++) { + if (radioButtons.get(i).isSelected()) { + return i; + } + } + + return 0; + } + + /** + * 选中指定index的按钮 + */ + public void selectIndexButton(int index) { + if (index < 0 || index > radioButtons.size() - 1) { + return; + } + + UIRadioButton button = radioButtons.get(index); + button.setSelected(true); + } + + /** + * 给所有的按钮加上监听 + */ + public void addActionListener(ActionListener actionListener) { + for (UIRadioButton radioButton : radioButtons) { + radioButton.addActionListener(actionListener); + } + } + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/menupane/FontRadioGroup.java b/designer-base/src/main/java/com/fr/design/mainframe/menupane/FontRadioGroup.java new file mode 100644 index 0000000000..5bb7d55052 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/menupane/FontRadioGroup.java @@ -0,0 +1,17 @@ +package com.fr.design.mainframe.menupane; + +/** + * 字体的两个选项组成的group + *

+ * Created by Administrator on 2016/5/5/0005. + */ +public class FontRadioGroup extends FitRadioGroup { + + public void selectFontFit(boolean isFontFit) { + selectIndexButton(isFontFit ? 0 : 1); + } + + public boolean isFontFit() { + return getSelectRadioIndex() == 0; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/menupane/ReportFitAttrAction.java b/designer-base/src/main/java/com/fr/design/mainframe/menupane/ReportFitAttrAction.java new file mode 100644 index 0000000000..3c4d977fab --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/menupane/ReportFitAttrAction.java @@ -0,0 +1,107 @@ +package com.fr.design.mainframe.menupane; + +import com.fr.base.BaseUtils; +import com.fr.design.actions.JTemplateAction; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.dialog.UIDialog; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.JTemplate; +import com.fr.design.menu.MenuKeySet; +import com.fr.report.fun.FitProvider; +import com.fr.report.fun.ReportFitAttrProvider; + +import javax.swing.KeyStroke; +import java.awt.Dimension; +import java.awt.event.ActionEvent; + +/** + * Created by Administrator on 2015/7/6 0006. + */ +public class ReportFitAttrAction extends JTemplateAction { + private static final Dimension MEDIUM = new Dimension(430, 400); + private static final MenuKeySet REPORT_FIT_ATTR = new MenuKeySet() { + @Override + public char getMnemonic() { + return 'T'; + } + + @Override + public String getMenuName() { + return com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Fit-Template"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; + private static final MenuKeySet REPORT_FIT_ATTR_ELEMENTCASE = new MenuKeySet() { + @Override + public char getMnemonic() { + return 'T'; + } + + @Override + public String getMenuName() { + return com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Fit-Elementcase"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; + + public ReportFitAttrAction(JTemplate jTemplate) { + super(jTemplate); + initMenuStyle(); + } + + private void initMenuStyle() { + JTemplate jTemplate = getEditingComponent(); + if (jTemplate.isJWorkBook()) { + this.setMenuKeySet(REPORT_FIT_ATTR); + } else { + this.setMenuKeySet(REPORT_FIT_ATTR_ELEMENTCASE); + } + this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/fit.png")); + } + + /** + * Action触发事件 + * + * @param e 事件 + */ + public void actionPerformed(ActionEvent e) { + final JTemplate jwb = getEditingComponent(); + if (jwb == null) { + return; + } + final FitProvider wbTpl = (FitProvider) jwb.getTarget(); + ReportFitAttrProvider fitAttr = wbTpl.getFitAttr(); + if (jwb.isJWorkBook()) { + final TemplateFitAttrPane attrPane = new TemplateFitAttrPane(); + showReportFitDialog(fitAttr, jwb, wbTpl, attrPane); + } else { + final ReportFitAttrPane attrPane = new ReportFitAttrPane(); + showReportFitDialog(fitAttr, jwb, wbTpl, attrPane); + } + } + + private void showReportFitDialog(ReportFitAttrProvider fitAttr, final JTemplate jwb, final FitProvider wbTpl, final BasicBeanPane attrPane) { + attrPane.populateBean(fitAttr); + UIDialog dialog = attrPane.showUnsizedWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { + @Override + public void doOk() { + wbTpl.setFitAttr(attrPane.updateBean()); + jwb.fireTargetModified(); + } + }); + dialog.setSize(MEDIUM); + dialog.setVisible(true); + } + +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/mainframe/menupane/ReportFitAttrPane.java b/designer-base/src/main/java/com/fr/design/mainframe/menupane/ReportFitAttrPane.java new file mode 100644 index 0000000000..27faf6fa87 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/menupane/ReportFitAttrPane.java @@ -0,0 +1,56 @@ +package com.fr.design.mainframe.menupane; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.report.fun.ReportFitAttrProvider; + +import javax.swing.BorderFactory; +import javax.swing.BoxLayout; + +/** + * Created by Administrator on 2015/7/6 0006. + */ +public class ReportFitAttrPane extends BasicBeanPane { + + private BrowserFitAttrPane attrPane; + + + public ReportFitAttrPane() { + initComponents(); + } + + private void initComponents() { + this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + attrPane = new BrowserFitAttrPane(); + this.add(attrPane); + + } + + /** + * 展示界面 + * + * @param fitAttr 自适应属性 + */ + public void populateBean(ReportFitAttrProvider fitAttr) { + attrPane.populateBean(fitAttr); + } + + /** + * 提交数据 + * + * @return 界面上的更新数据 + */ + public ReportFitAttrProvider updateBean() { + return attrPane.updateBean(); + } + + /** + * 标题 + * + * @return 标题 + */ + protected String title4PopupWindow() { + return com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Fit-Attr"); + } + +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/mainframe/menupane/TemplateBrowserFitAttrPane.java b/designer-base/src/main/java/com/fr/design/mainframe/menupane/TemplateBrowserFitAttrPane.java new file mode 100644 index 0000000000..e37ce09a37 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/menupane/TemplateBrowserFitAttrPane.java @@ -0,0 +1,77 @@ +package com.fr.design.mainframe.menupane; + +import com.fr.design.gui.ilable.UILabel; +import com.fr.log.FineLoggerFactory; +import com.fr.main.ReportFitAttr; +import com.fr.main.ReportFitConfig; +import com.fr.report.fun.ReportFitAttrProvider; + +import java.awt.Component; + +/** + * Created by 夏翔 on 2016/6/24. + */ +public class TemplateBrowserFitAttrPane extends BrowserFitAttrPane { + + public TemplateBrowserFitAttrPane() { + initComponents(ReportFitConfig.getInstance().getCptFitAttr()); + } + + + @Override + protected Component[][] initFitComponents() { + Component[][] components = new Component[][]{ + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Fit-Font")), fontFitRadio, null, fontNotFitRadio}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Fit-Element")), horizonRadio, doubleRadio, notFitRadio} + }; + return components; + } + + @Override + public void populateBean(ReportFitAttrProvider attr) { + //模板界面,自适应选项去掉了默认,这边的判断为了兼容之前的设置 + if (attr != null && attr.fitStateInPC() == 0) { + attr.setFitStateInPC(3); + } + ReportFitAttrProvider fitAttr = ReportFitConfig.getInstance().getCptFitAttr(); + if (attr == null) { + //如果为空, 就用全局的 + attr = fitAttr; + populateGlobalComponents(); + } else if (fitAttr.fitStateInPC() == 0) { + attr = new ReportFitAttr(); + attr.setFitStateInPC(3); + initBorderPane(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Local")); + } else { + initBorderPane(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Local")); + } + this.localFitAttr = attr; + fontRadioGroup.selectFontFit((attr).isFitFont()); + fitRadionGroup.selectIndexButton(attr.fitStateInPC()); + fitPreviewPane.refreshPreview(getCurrentFitOptions(), fitRadionGroup.isEnabled()); + } + + @Override + public ReportFitAttrProvider updateBean() { + ReportFitAttr attr = new ReportFitAttr(); + attr.setFitFont(fontRadioGroup.isFontFit()); + attr.setFitStateInPC(fitRadionGroup.getSelectRadioIndex()); + + // 直接用全局的 + if (globalCheck.isSelected()) { + updateGlobalConfig(attr); + return null; + } + this.localFitAttr = attr; + return attr; + } + + private void updateGlobalConfig(ReportFitAttr attr) { + try { + ReportFitConfig manager = ReportFitConfig.getInstance(); + manager.setCptFitAttr(attr); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage()); + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/menupane/TemplateFitAttrPane.java b/designer-base/src/main/java/com/fr/design/mainframe/menupane/TemplateFitAttrPane.java new file mode 100644 index 0000000000..675af9c541 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/menupane/TemplateFitAttrPane.java @@ -0,0 +1,55 @@ +package com.fr.design.mainframe.menupane; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.report.fun.ReportFitAttrProvider; + +import javax.swing.BorderFactory; +import javax.swing.BoxLayout; + +/** + * Created by 夏翔 on 2016/6/24. + */ +public class TemplateFitAttrPane extends BasicBeanPane { + private TemplateBrowserFitAttrPane attrPane; + + + public TemplateFitAttrPane() { + initComponents(); + } + + private void initComponents() { + this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); + this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + attrPane = new TemplateBrowserFitAttrPane(); + this.add(attrPane); + + } + + /** + * 展示界面 + * + * @param fitAttr 自适应属性 + */ + public void populateBean(ReportFitAttrProvider fitAttr) { + attrPane.populateBean(fitAttr); + } + + + /** + * 提交数据 + * + * @return 界面上的更新数据 + */ + public ReportFitAttrProvider updateBean() { + return attrPane.updateBean(); + } + + /** + * 标题 + * + * @return 标题 + */ + protected String title4PopupWindow() { + return com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Fit-Attr"); + } +} diff --git a/designer-base/src/main/resources/com/fr/design/images/reportfit.preview/00.png b/designer-base/src/main/resources/com/fr/design/images/reportfit.preview/00.png new file mode 100644 index 0000000000000000000000000000000000000000..58033c96a2867f61277c7bbd00abc054caefe261 GIT binary patch literal 745 zcmeAS@N?(olHy`uVBq!ia0vp^AAooP2NRIoyR*y)NO2Z;L>4nJa0`PlBg3pY5A!ydkGr}~$MpHT-+$d# z>|I@6m;dq8oc8kNEmh0CWVMd`%eJ4Zc=lnE<-wxGbDq5@k1RbWD0_bUe2G)hM!WCk z_vrnr482&UdwCA?yC~T|5kar|xbC$}W}Rbv-?zijU;S#o|7FK#GN1ca>{?thXSQi| zp1Exr&+W^_yDxrJJF(7n_j}>=j`j-wzaJ8KNcf;`TnteP3QJ&rLD7+ z?-D(n^fvL@RrkYsKV~MM^Izwi_4T4VfBO0LS1fFAZ1^$f^yBTU=lT8JEPqRUPpDD4 zmv%03{)&|7+LEduiMK1WW?8b|F1ZL6mTEWr+MasxV20L1JCyBEZS>Jxy)1gbAUkplBJg}T`sl}WPup2ywVZMoS3 ePd;cLV0h5Ee%`3dVtmW1$*Qeu_ zYr{BBp((?VqAjf)Y-}!@j{Bj<^PF@3IscsV$NTwwpZAaVulIf4bVqwQXt&yK002O? zHZZ46&u&(MwD=}z)Too2+I7{&{TcwsC~TD&kdvpf*;I|Nx)|Xc>K7616^;eY`i6RA zHEe^ua9Ag-mv3ws9cu;vl7HC3&Z1&Qrt_h8X!wDy;Ptn4N4)~GQuTsl33(taLS@o= zXAu}l1S9cA&Z?$S{-jJfBXKW_N|`(GQ>ww*Xj}}@LN;rOC~;%@I7162<}FSUqln3? z0bAJCU-_Ow)4E%9;`rDKAqm`wjw}lqS{fD9xCgfJz=A#PpUP)Pa%bvWqRN%YdsNPI z7g_9?a@SEw6F=RFOhw9PCH-x_@jg)}CNENh1|6Mel^#05rv*S9hA3;snq)=YFx|__Sc;+BL6<@q z{Nveyg$KWVKk_$Hgc-Ooh#AQH`we$-JSg9JIk-HUCDD zjDaZVGxlAN8=ue;ufjkIKW4>$rl#8F;~H4ZbcQFg0Z*EFIP=2QZYDhk;%6bk6e4Z=dc`&+BSytii&|vjP$} z29vT&VAc2V{eF{UudkaundWeHwOuymIWV0f1Gm;JZd+!&Nlk zCRV1lnBY;$=5`kK>%VySC~?FJ-`AP}Jydc^N7e;JGiIAq(MdLOi^@1r_2wn96Fp^} z?N3&4L}0u-sO;sj)Xg)KNN7%+=4Wc0wW*7tnXdX&@w)9h35_P`%fotmW~n6CxwzuW zitI3B9hB*kD1+`uJyK&r{_gf-$j|Y;cf#9pFsEl5Vo3gTaoB=UzG<1JlxJf*6Yk1UCzqznssAAo%d%%FY--xjb>)*3i$h_UIXUDCq zcQA!WB12xjvEKJZ28+JLv>66X1!aB_wse4*uj}vjc!Yu&0VSB~?{!NXqh+W}?s=k< zuf*h7n4JCI4xR`Sk>SYK=IXY#jcYr$JmQEBjy2D;bYw$)lFKaoE&PELsjt}9-?NJJ z;BwltluFlMh=^1RiyhO`)B2x*&OSgIl)Qy){eSuEq;33{EPu2kpdO*9p|-Ac1-Mq} VKGTiaz-&GWz}CthR%v4nJa0`PlBg3pY5ZZ9qm$~?`Wbg3+ z`$_HBe`_zEZGSIxi|=WZ=MA&3vD}}2W!K)O$)BChT0XceX#V2ml3yP)txn8IwiEoF zr!V_F(bi_$?03d(uP-O>zW7h=#4^|Fcf#i_!!AVsn9tCC?xwW%5~U2FW7!;=VeV#g zRED@4=7lra`D^oyHeUNKHAiLltvRwq4!ac`KTj@ws~h+K?)=Tq#edCvmouaG+}D5B z=jLqIjnjWr`b_3qtJk)pua~p8UW{9{Y-aHR-^~?&-J1Pu((~6$=z=*IBcM5?fWA>= z$gZ8N{o?e~OWW2uPH@mXs>t5A5E2n!--4J>k2_ufM;N{^K#E54bo+YwmTNARV6m*> bG+@};xqf5sUHOZ^6w2V~>gTe~DWM4f&lND! literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/reportfit.preview/20.png b/designer-base/src/main/resources/com/fr/design/images/reportfit.preview/20.png new file mode 100644 index 0000000000000000000000000000000000000000..7a39d66d58a978280a5213209d03d3ef7173c188 GIT binary patch literal 2459 zcmb_eSyU3-8l^!i%$!Tf#36?qOU;VR5mGTo4F?=>$Qg%Ha4N0Lp|COwHBEjq1vMp0 zP(suG`b$l7R>+Cc2EmbX%8^U0?&`kWweG`x_|CW2{?_@P&faHVcR<>R13^Fl03dE> z3w089zOWu_-z+>Em@$UJw&R>FIvM~FllfVj0Qm*-LQ(+-bHkm948+CyMg;&Y{UiMX zloP4^5d0x)zYZ4?5jJ# zWBT4hg6|)Pc>2m8-yNl`C83YdK6S7K>n}Q2O=nN#yw1BnCkOaq1s5oJn-L_h^qiny zZW-kkKt;4P4;uRf19pmEF52{;2#_ZFn-ikHyM9f7A%HySpz*&EzTfJe~sDb^!8h5_+-EbPT_AovVDtL>F#JY<)W_F#SVMnaR_RQ#|QrN5D zZ{72)BiB8jdrI#i)i{5chP|B}4%^Mnk4!@6$1{;Bi?r0orfwR^X%=U#t4nKIQ~hDL zkINhza4#OK`oQuHz9zFi-M{DfqXsN-Fmd=c$~gXzcZ)T| zG%7<`*r5di3)u4=hf|}k6f~XJdtkw9XZ4Vs{NCsxM!79 z@K1fz=o%RQpB8^4FV}^`tq3v0Fq_qK6u62Q#~(6Zb@ z!+9miY349l-Mv^69@loRFX;KYUJ^~wr4w%05VL%Xp+NlXRVQ%Qp;|mGkZ5ai4Pv6R z%c?4_CGk$a<*PeRf^ekJh7iLkAQ6+1uo329| zV%uCmUi@L_vWiP>o3YXTR4qaJ=USH}G9@h>9~ii&6}VGe9wgM!FA@GhLc#s!{%2t- z0nJM@fDR_IN&JFB{av6WFvOT-ckHs_|7pEb`eJKyVO7VwaPIn>wKQr-m~Big%4@2u zY4=N&8iSEb4aD{(hU+$!8bKP1*YVtw&78PlEyIRi=*AdQ0yaIn#0xd0e|fEq)AV`?!MUll@OH!>4H9I zP1z9H$mcrk1K;V;Txv16uxBf1T?tWT z46eFZctd?^J9X;JS%N)tK1#5_uV1NSU>s)^NtpgG(4bs(pXmLuK1cacdO+vhXRTc-4vAV}MvZ|n&MU)ScS85-% z5qloYLe^V)<-!fu_D>d+h)g%r9oEiC!LYLSVIB($&AFM4K?~HT=uw-fZN|Bu4G#4T zAh29h36sE+5G#9!Hg8fZ%XFfi@+=k}=hN#3qLvgNzLT>>ybzL5)UO%+RH8Ghdw_B{ zS>DlnO*cKwd;xWU+@`Z)(1s>g>vL|xR|YedpNpAnQup1Rb|Kg|SDv?Cb{^j2VONw%P|ukYNqK0Ss8JMnTQk9ew@lO`K?Gxm?OnC@Wm zuGJ<2GSU0U=x_m1j%Qiw2MSu~x!oW;2ZfA5a;;M$!ffwhs@s(2jLO4A2tbhi_dX=d zh|4J^1xTSwrP%e2$c}XrOh^l9z%P zlZQ2e4+Vy;!e@n_3TII&FY7J!`cN$;&Qw-1fMmXXV{hHEn+h0Ih}Nr%D<8gO7!GVb z%}F1TmDV5j(5@5nnI7Hm5?&V0#8{wX5osK;HTx~ZjV9@5$LzE@$M2Rk_? zVDd%SWA}H?!DOtoSGRtq0#9otd9mxg1FzOlr_kJax(d`3dFk`T58?B8&aqpSjR_=n zM4~}@N%Yve_GQwYSboM#kqC5`O_0)ZYW3#dA>fyJ{fYy>ZA=&p{utUH^k1#*a{8-I g-owpAaRKlkU<8B5IWhKPg~1A72SY+1Tlpma3!q1bF#rGn literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/reportfit.preview/21.png b/designer-base/src/main/resources/com/fr/design/images/reportfit.preview/21.png new file mode 100644 index 0000000000000000000000000000000000000000..b8165ae99ce91d14edf2c31f6352e401cbd4ee65 GIT binary patch literal 788 zcmeAS@N?(olHy`uVBq!ia0vp^AAooP2NRIoyR*y)NO2Z;L>4nJa0`PlBg3pY5~)xf__b%0Z;z z;jIsMVqezn61?MIzEpa{1Wz?#hiuLVg+KOf;Wdk6Zr^_*SN>T+j=p?A_p;xAe*QD+ z2%UQ_-1%PGx%tZ+d|7%II9^c55HM+Cb8H4PS$LsL4k;*8&;-g<2C4%y-N0Hnq?%Z3 zt>ULw{i~193ZFKs`1{{4g0Ei8nmb=N?YyOavq+Zb619+ym)W!Y{EY2&)FbkyT$cG0 z9X7Yv<@mRv?uB zbT-`698yqEL;at)t-?2m;% znicc?mY-U;_PvF*NoBtIzO*NAtG}0Be7Ah@+^?>n;NCU2Q?%r0{_D0qXXpG)Y+VHp r4pPzp)TcAn#!osVvf|i!24;p{iRCXg2tO(Wrf3FFS3j3^P64nJa0`PlBg3pY5~)xfAI3%0Z$b z(4e-=wDzmux5sJ~Eq`~grm?5#}W+0iw311%0=Qllm`E>5ylk@M%=qEhuJD&WxB|BoxZYj|} z(O)Niy_KVrz;A2o{5Mnk>yx{C<4l)tdRJ$-v{rNdJI&?SS3RuQwOl6lxscsn%UvhS z_KNV8<;%sV=h<29J)v88yWnxv#+l5&K)p?87fg$c5Ur8Ko)+&#WBH(H-% zn+zn}f!=TgM*-MJASTpvju*i3gYYL%0g`Ft>qf*m$#&aBUf$a-ut#9ZL-z(o2Hn_w V^RIJzodu?722WQ%mvv4FO#lavMe6_n literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/reportfit.preview/gray/00.png b/designer-base/src/main/resources/com/fr/design/images/reportfit.preview/gray/00.png new file mode 100644 index 0000000000000000000000000000000000000000..cc90692cca5b0cdcbddf02d95bc0886663d88ff0 GIT binary patch literal 745 zcmeAS@N?(olHy`uVBq!ia0vp^AAooP2NRIoyR*y)NO2Z;L>4nJa0`PlBg3pY53*g3ZaI(d5|QnLDbsb`-57xd1 zDwxE4{enV7G%paOhHf@TWpEG?Yqy<;>78Hu%sGmF2qrMFept4; UtBgerm`oWwUHx3vIVCg!01R<7lmGw# literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/reportfit.preview/gray/10.png b/designer-base/src/main/resources/com/fr/design/images/reportfit.preview/gray/10.png new file mode 100644 index 0000000000000000000000000000000000000000..603b9dbcdadc9d09400ad761a042278e79707bd4 GIT binary patch literal 1507 zcma)+do&XY9LIO52y5Lq9(nW<7ng2w)i&=u+I6VLHBwkv+6ZA-V=lXNOUR+Qc};mN z?ILbkG;>h9ZM(CDSsshZ8s=4F@)(!!-#z!-^EtoY@0{QH{{Hy=&iDLop7Hhos_j(+ z002PPDOdPfomq=ARi(Au(iCsKR(3|83Wx;&)HT=R8$e;P?pjkX&dop0C+c!s0x|{# za1M>Sh}sXkiVQ=+QOHo-H5SSa0N5T4b9MGj?4J-Fh}QHpP#OMQ_22|X*ZfdhZrd-e ze%dN~GH?Ik+Us{Pv)n58ZV063tlrLD#-9}?(AZc_-9$QC-u`x;n-8;MRW3*p@Xw3* zq7t42%D*LAHZU?Wf8lPat?pLqBT4a1C8^pd0l$*vMBL;Me?R}ReZ16;E8&rc=(yO` z6-5}YR5Tnp)Phe)PF8#tbBILZ>X$n?`y8#bGaawL3J#rtQ0N@7b%GVbG!I6&Hx}1_ zu8iiYrg+z(!hMsGw7O!S<(9&UIXpnN!yV)wA5$#N>*(lM)6jW$tr(T)*5+o6IUfhZ zA;s-dVI7Cr7x9!vL)emJzE;!I(~e1B9^*fO@gEHq-@nZ4c^IzTa8#$%F@-=Nlm>D{ z>>Au~H|4a4epQ>a*p%(P7}zBPgTV`nbK&v+ge;~?I{JjnDBs*82-p8Q;(J6+b~Ze{ z_$54h>Nj5UE)YmYT7Io5wm%UBD~S9xpw3T1W_yoUG{MzNG*EV*K7Oz95)z0u8!IG=4`EwPVYN zdo0{|%v#HPwIdizq5I*2a6bz0qyYSvQ~cd>>c>Fak+PWqT9kM~{=o}8gjF;Zf9ZNq z0m11nBf48FJ5kqXnWno}djqm-kI|mi_rJMlZ0jqrrsQ8{5R`2~%ccjL@=}(FQZhTW zlypeIat?;z(w;S9J9E#tlW)dwc|Mr=`z*jWIAZ z#8T*y7p?1#5i?e*e<+Z#eb`TqN+c3-s-h%cuN(f%MpOj%*mNsUY0Ix2(}NAY$1Ur76M&52;F`{6gVB>4PG0x%23y0+o&MT&JQ0b5 zqM3B`!yj>V>7C&}@|5T0^0oECQ;i0b9Hx&z;o8Vo1Hri0^`E};G_oCV0ZoNe1|kl4 zVUolCD}xf%Pyh>U^ec3cagTjBI~zAy6*o%t zdV6(D#iG^USK%%vYmc@ORr&@fr^!q^!}>8u4mJI0VzMW8s*{k6B9(tsu_*VaGj4BR z0{tzXux~qOC>CQ@nGilvh>KoRI)rsZ?s#67?YoZDp@bgn5j~pYjZNO)AdXLy?-`;IsN!_uD zdztel-(K0h$%bS-|A*{4nJa0`PlBg3pY5WuU{{6`O4~F`|KUXt`_W$ThF#} zFrNT_8N;vYAEJRb1TdyL0oKd~9y*-Y0zCGVDU+Pjj~2XK!+AFHy<>ySaIRAjHiW z&R_F7=eqgK8(;Ub=TEwudrr@?fEVOR92#EOpWYi{dw)*+?(J(;W8&nCSMIvso6I`5 zer44<%lT>C>B)avBBx(>k6tw|r}FRQ)o*pz*MBMb_Gi)irzhL4KDV*2KR&Z~+taT~ z_tMWL{tr00ZBJcgpoHVTr(X@vD@?mCZ}Q?u@wY=l)8KDgdTX22WQ%mvv4FO#tm8D;59% literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/reportfit.preview/gray/20.png b/designer-base/src/main/resources/com/fr/design/images/reportfit.preview/gray/20.png new file mode 100644 index 0000000000000000000000000000000000000000..ac11df1caf192627d4429292bc52992ef342038c GIT binary patch literal 2277 zcmb7`dpHw(8^;%UTb>Y$*?6Bu4mszUh{|YN&WAbVOk_ioLz_@kgq)^E^fc$K867N# zXRJb^S)!bTeo1I0KoQ~Iz`pQ{(Cv<}^dJBLKY{+V9RNy!yf6qMqTPwk;W%Qn|9LFH zJTN=}3$r@sAB1(n`Ul2FwquV00KoHBD07#Xk%dAf$1%@+DIxnsP(jaRF$v{>T~s)1 z1fp^z!Ut1T&5}uLJ*DjCa`lX=jN-hR3rus)R!mklHGMUzyDR?ALbcS0irw>74pCj< z0wD*neSEbbpU9v7@+HRlu8u7~oIr3^vZlZNsCE9Z3Bpw@1O)Xos7+0g>+MngQK66- zf5n63b#-;Kv$KPPgQ<#m z91b@yIEcwleyp%AOb^a;y1SdMY&Sw1ww|J=O^+VM=h;xGggAWvl)Ab)gTW}Y5AyeK z2Kr1xen~t97(b20swM|215;iOSXfvjM_W2eYJjUVNF>q%w1D&?P0h&2Xj;j}#s>Nr zAO{9VM@OGwzx@a@H1LBcw+wwo;S&vtD#Me?y7jYap7}0*_(1cKM zc5**`uxw|>2S;R2+LQ6H$}re+Ky3i_uHR~C6}Fte^Ij3_sA9HDmNyHblKX6Qbo43J zXK_uh{6>d%=(%&UzP7cQlzCgwO1UL-UZM0ICkOA}j|xED4PrP-tBNqYixD?+#A0PC5vkf{A9qS9pp` zXt`A7*6dne%6<5zx@Mkt)zBei+Y(qdY|){!volhyTFZE(TpcLiD%HqcvOx7#lLqb# z9B64*TOk$jQZEXKuade09a^|tZgcYvEt*+cfkUUEThN&8n-iyyU}`T8oQ&Cd3>fI+ z7GHq+4`v?hvSOkAUQ?1jt0 zL4Qj4cs84&Vq#KrEq=o}Ke)0X(3z=Z!=a@F$+$QovGu<6<9%}1Rge+SkDMEV_C6V} z?5&MRJwQC+oHcc)uu%2)z2VhbEyFR;-m0k0Ys8wl)eSc{H`HEbVl3)MX%(QX=fGGq1(4Au`c;dG1YOsynC<=`P1&u{438rlLgG1%9ZS z%UeuTvQq`-SnI{c?1v?N(~{(CU!=9tAmk+a;VZuJeJF7R&u%n#xu@jhTvy((XBgs4 zcjvFH`|G9V2W8gqf(0t(DaUSiTQ4;Iq7%}e5js;d5>=c1#H)?gIc_>5`tLsJt*2ubtB18xtQ zUW#MglP8gf>vl@5N8j4FYgVo1xSuGk%dtX}eJ^Ml!ly4- z()#8o^J6K%<3>i{i<7yRW`fEU#l*$zRALJlW0@h7QU3160#;f-Du{J6J*SEfR~;{K z8PMJp^>Qxw=VrZ2N-#HMATu>Pfqu5|fK+@1g|Oylmdh_$sT`aqk(z^of~p+P*2Sur zY|Ew_5vP%0Fql36xm-~cB0j}f;DlLjFaOat=6cnoB&oGuF6m~y4?fiFVh>SaN7|U~ zrL!Ir+AmEX6@P9b)1*!6lz8r5UP$b|H01-SHr4MIi|;FeIwwoygIA=UHQhOR#O1H2Ym#T9=Dfes z!y)-BP2rH{c!^S?^*o4rTnM4{8#g6Uz(pKx|(~oG>Pm14nJa0`PlBg3pY5~)xf|%$>>%P0 zm>m&&{fK-{=B~Y5Gp8tQ>0tR_X{&zGCpq`gW2>V-45v@I#6D%wE4y{qS3AnQD%&mj z$+GyL39FY<1`BT!n`83=K@$!sFjF~00K#;;pa5a^E^vf0f$AVkuolM)0y;0Y<$kaF zmmmLX?HkkQ-xRO-hwuG)HRtapt#>in?#qnqRNi%-t)Jd_x5_;BIM$47TWvCcPs{&42QS$>*#lQU+e zRn8Tk+`c|8>*4C>-NsM$KHKw5>(9wKtLwj%P5a(#TK%DBbK-Z){_pQCiu-^8=61OH z&Y>SJHRt9W{V{!+q=u`W#48ziG3zx@FMTr#wNX~oA>$8 z-dw*XK*SLm`M6^o8c0}zV)j?}pcza@e+VTov`k*eXm|Ez1TZZ#c)I$ztaD0e0sve@ BO2hyF literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/reportfit.preview/gray/30.png b/designer-base/src/main/resources/com/fr/design/images/reportfit.preview/gray/30.png new file mode 100644 index 0000000000000000000000000000000000000000..c6f452a8a00f8e18900a3da1a0ac32a38dda4a80 GIT binary patch literal 783 zcmeAS@N?(olHy`uVBq!ia0vp^AAooP2NRIoyR*y)NO2Z;L>4nJa0`PlBg3pY5~)xs#an%0Z+d zPRU0!JXT!vDhY$A+)o|NkDn z*Y(PtW= z+x_qJ3wN#CU1u8`Q}gTj_AVjooHu(OD!22`-hcV!mgo9l)Lg zs{(lrsG&`%d0nn_`h#s(eQTq&<||%)yI3^uaY%8Qo%d!}-QRQV`}682J1n$H zjKkxmOxNG~dHtzBp%y7|?tLqi+uts3+gdB4_46nf$dS;{wmG-S?G)Fp%vsxV|0)zb zVE~6cSRUaYpre(+5d+r+RL~2KBc$kp27%)RvUCfWK!b*4-4BnJJ$Cmx$=_sD!)d^v YePAu;$(*Doz{Jep>FVdQ&MBb@09bBFjsO4v literal 0 HcmV?d00001 diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java index 1797ce9fbd..a9e655e5b2 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java @@ -13,6 +13,7 @@ import com.fr.design.mainframe.*; import com.fr.design.mainframe.widget.editors.ElementCaseToolBarEditor; import com.fr.design.mainframe.widget.editors.PaddingMarginEditor; import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor; +import com.fr.design.mainframe.widget.propertypane.BrowserFitPropertyEditor; import com.fr.form.FormElementCaseContainerProvider; import com.fr.form.FormElementCaseProvider; import com.fr.form.FormProvider; @@ -22,8 +23,8 @@ import com.fr.form.ui.ElementCaseEditorProvider; import com.fr.stable.ArrayUtils; import com.fr.stable.CoreGraphHelper; import com.fr.stable.core.PropertyChangeAdapter; -import com.fr.stable.fun.FitProvider; -import com.fr.stable.fun.ReportFitAttrProvider; +import com.fr.report.fun.FitProvider; +import com.fr.report.fun.ReportFitAttrProvider; import javax.swing.*; import java.awt.*; @@ -104,19 +105,18 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme new CRPropertyDescriptor("toolBars", this.data.getClass()).setEditorClass(ElementCaseToolBarEditor.class) .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_EC_Toolbar")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced") + + }; CRPropertyDescriptor[] extraTableEditor = getExtraTableEditor(); - return (CRPropertyDescriptor[]) ArrayUtils.addAll(propertyTableEditor, extraTableEditor); + return ArrayUtils.addAll(propertyTableEditor, extraTableEditor); } + public CRPropertyDescriptor[] getExtraTableEditor(){ CRPropertyDescriptor[] extraTableEditor = resolveCompatible(); - FormElementCaseEditorProcessor processor = ExtraDesignClassManager.getInstance().getSingle(FormElementCaseEditorProcessor.MARK_STRING); - if (processor == null) { - return extraTableEditor; - } this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); - FitProvider wbTpl = (FitProvider) designer.getTarget(); + FitProvider wbTpl = designer.getTarget(); ReportFitAttrProvider fitAttr = wbTpl.getFitAttr(); ElementCaseEditor editor = this.toData(); //兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应) @@ -128,11 +128,12 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme reportFit = fitAttr.fitInBrowser() ? editor.getReportFitAttr() : fitAttr; } ReportFitAttrProvider reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : reportFit; - PropertyDescriptor[] extraEditor = processor.createPropertyDescriptor(this.data.getClass(), reportFitAttr); + BrowserFitPropertyEditor browserFitPropertyEditor = new BrowserFitPropertyEditor(); + CRPropertyDescriptor extraEditor = browserFitPropertyEditor.createPropertyDescriptor(this.data.getClass(), reportFitAttr); if (editor.getReportFitAttr() == null) { - editor.setReportFitInPc(processor.getFitStateInPC(fitAttr)); + editor.setReportFitInPc(browserFitPropertyEditor.getFitStateInPC(fitAttr)); } - return (CRPropertyDescriptor[]) ArrayUtils.addAll(extraTableEditor, extraEditor); + return ArrayUtils.addAll(extraTableEditor, new CRPropertyDescriptor[] {extraEditor}); } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index 2fb5febd3c..b755edec73 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -36,6 +36,7 @@ import com.fr.design.mainframe.actions.FormMobileAttrAction; import com.fr.design.mainframe.actions.TemplateParameterAction; import com.fr.design.mainframe.form.FormECCompositeProvider; import com.fr.design.mainframe.form.FormECDesignerProvider; +import com.fr.design.mainframe.menupane.ReportFitAttrAction; import com.fr.design.mainframe.templateinfo.JFormProcessInfo; import com.fr.design.mainframe.templateinfo.TemplateProcessInfo; import com.fr.design.mainframe.toolbar.ToolBarMenuDock; @@ -503,9 +504,9 @@ public class JForm extends JTemplate implements BaseJForm { @Override public ShortCut[] shortcut4TemplateMenu() { if (this.index == FORM_TAB) { - return (ShortCut[]) ArrayUtils.addAll(new ShortCut[]{new TemplateParameterAction(this), new FormMobileAttrAction(this)}, new ShortCut[0]); + return (ShortCut[]) ArrayUtils.addAll(new ShortCut[]{new TemplateParameterAction(this), new ReportFitAttrAction(this), new ReportFitAttrAction(this)}, new ShortCut[0]); } else { - return (ShortCut[]) ArrayUtils.addAll(new ShortCut[]{new TemplateParameterAction(this), new FormMobileAttrAction(this)}, this.elementCaseDesign.shortcut4TemplateMenu()); + return (ShortCut[]) ArrayUtils.addAll(new ShortCut[]{new TemplateParameterAction(this), new ReportFitAttrAction(this)}, this.elementCaseDesign.shortcut4TemplateMenu()); } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitAlignmentItems.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitAlignmentItems.java new file mode 100644 index 0000000000..ca6fd2ca14 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitAlignmentItems.java @@ -0,0 +1,21 @@ +package com.fr.design.mainframe.widget.propertypane; + +import com.fr.conf.FitAttrState; +import com.fr.design.designer.properties.items.Item; +import com.fr.design.designer.properties.items.ItemProvider; + +public class BrowserFitAlignmentItems implements ItemProvider { + + private static Item[] VALUE_ITEMS = { + FitAttrState.HORIZONTAL_FIT.propertyItem(), + FitAttrState.DOUBLE_FIT.propertyItem(), + FitAttrState.NOT_FIT.propertyItem(), + }; + + @Override + public Item[] getItems() { + return VALUE_ITEMS; + } + + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitEditor.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitEditor.java new file mode 100644 index 0000000000..4b3a7488ac --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitEditor.java @@ -0,0 +1,47 @@ +package com.fr.design.mainframe.widget.propertypane; + +import com.fr.design.designer.properties.items.Item; +import com.fr.design.designer.properties.items.ItemProvider; +import com.fr.design.mainframe.widget.editors.ComboEditor; + +import java.util.Vector; + +public class BrowserFitEditor extends ComboEditor { + public BrowserFitEditor() { + this(new BrowserFitAlignmentItems()); + } + + public BrowserFitEditor(ItemProvider provider) { + this(provider.getItems()); + } + + public BrowserFitEditor(Item[] items) { + super(items); + } + + public BrowserFitEditor(Vector items) { + super(items); + } + + @Override + public Object getValue() { + Item item = (Item) comboBox.getSelectedItem(); + return item.getValue(); + } + + @Override + public void setValue(Object value) { + Item item = new Item("", value); + comboBox.setSelectedItem(item); + } + + /** + * 是否立即刷新 + * + * @return 是或者否 + */ + @Override + public boolean refreshInTime() { + return false; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitPropertyEditor.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitPropertyEditor.java new file mode 100644 index 0000000000..1ffa7a0e1b --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitPropertyEditor.java @@ -0,0 +1,45 @@ +package com.fr.design.mainframe.widget.propertypane; + +import com.fr.design.designer.creator.CRPropertyDescriptor; +import com.fr.design.form.util.XCreatorConstants; +import com.fr.main.ReportFitConfig; +import com.fr.report.fun.ReportFitAttrProvider; + +import java.beans.IntrospectionException; + +/** + * Created by zhouping on 2015/9/10. + */ +public class BrowserFitPropertyEditor { + + /** + * 生成属性表 + * + * @param temp 传入当前操作的class + * @param reportFitAttr 传入的自适应属性 + * @return 返回属性表 + */ + public CRPropertyDescriptor createPropertyDescriptor(Class temp, ReportFitAttrProvider reportFitAttr) { + if (getFitStateInPC(reportFitAttr) == 0) { + return null; + } + try { + CRPropertyDescriptor propertyDescriptors = new CRPropertyDescriptor("fitStateInPC", temp).setEditorClass(BrowserFitEditor.class) + .setRendererClass(BrowserFitRender.class).setI18NName(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Fit-In-Web")) + .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"); + return propertyDescriptors; + } catch (IntrospectionException e) { + return null; + } + } + + public int getFitStateInPC(ReportFitAttrProvider fitAttrProvider) { + if (fitAttrProvider != null) { + return fitAttrProvider.fitStateInPC(); + } + return ReportFitConfig.getInstance().getFrmFitAttr().fitStateInPC(); + + } + + +} \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitRender.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitRender.java new file mode 100644 index 0000000000..f8dce2acc1 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitRender.java @@ -0,0 +1,10 @@ +package com.fr.design.mainframe.widget.propertypane; + +import com.fr.design.mainframe.widget.renderer.EncoderCellRenderer; + +public class BrowserFitRender extends EncoderCellRenderer { + + public BrowserFitRender() { + super(new BrowserFitWrapper()); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitWrapper.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitWrapper.java new file mode 100644 index 0000000000..7e1f63b8ac --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitWrapper.java @@ -0,0 +1,9 @@ +package com.fr.design.mainframe.widget.propertypane; + +import com.fr.design.designer.properties.ItemWrapper; + +public class BrowserFitWrapper extends ItemWrapper { + public BrowserFitWrapper() { + super(new BrowserFitAlignmentItems()); + } +} diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index bfc01d0bf9..0e33e1891d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -41,6 +41,7 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icontainer.UIModeControlContainer; import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.mainframe.cell.QuickEditorRegion; +import com.fr.design.mainframe.menupane.ReportFitAttrAction; import com.fr.design.mainframe.templateinfo.JWorkBookProcessInfo; import com.fr.design.mainframe.templateinfo.TemplateProcessInfo; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; @@ -698,6 +699,7 @@ public class JWorkBook extends JTemplate { new ReportWebAttrAction(this), new ReportExportAttrAction(this), new ReportParameterAction(this), + new ReportFitAttrAction(this), new ReportMobileAttrAction(this), new ReportPrintSettingAction(this), new ReportWatermarkAction(this), From c9fcaab0d0e49224e9c96bb2a9719640c9fa3efb Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 31 Oct 2018 19:33:09 +0800 Subject: [PATCH 2/8] =?UTF-8?q?REPORT-10591=20=E8=87=AA=E9=80=82=E5=BA=94?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E5=86=85=E7=BD=AE=20=20=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 --- .../main/java/com/fr/conf/FitAttrState.java | 8 +++---- .../menupane/BrowserFitAttrPane.java | 22 +++++++++--------- .../mainframe/menupane/FitPreviewPane.java | 2 +- .../menupane/ReportFitAttrAction.java | 6 ++--- .../mainframe/menupane/ReportFitAttrPane.java | 2 +- .../menupane/TemplateBrowserFitAttrPane.java | 8 +++---- .../menupane/TemplateFitAttrPane.java | 2 +- .../com/fr/design/images/reportfit/fit.png | Bin 0 -> 976 bytes .../preview}/00.png | Bin .../preview}/10.png | Bin .../preview}/11.png | Bin .../preview}/20.png | Bin .../preview}/21.png | Bin .../preview}/30.png | Bin .../preview}/gray/00.png | Bin .../preview}/gray/10.png | Bin .../preview}/gray/11.png | Bin .../preview}/gray/20.png | Bin .../preview}/gray/21.png | Bin .../preview}/gray/30.png | Bin .../java/com/fr/design/mainframe/JForm.java | 2 +- .../BrowserFitPropertyEditor.java | 2 +- 22 files changed, 27 insertions(+), 27 deletions(-) create mode 100644 designer-base/src/main/resources/com/fr/design/images/reportfit/fit.png rename designer-base/src/main/resources/com/fr/design/images/{reportfit.preview => reportfit/preview}/00.png (100%) rename designer-base/src/main/resources/com/fr/design/images/{reportfit.preview => reportfit/preview}/10.png (100%) rename designer-base/src/main/resources/com/fr/design/images/{reportfit.preview => reportfit/preview}/11.png (100%) rename designer-base/src/main/resources/com/fr/design/images/{reportfit.preview => reportfit/preview}/20.png (100%) rename designer-base/src/main/resources/com/fr/design/images/{reportfit.preview => reportfit/preview}/21.png (100%) rename designer-base/src/main/resources/com/fr/design/images/{reportfit.preview => reportfit/preview}/30.png (100%) rename designer-base/src/main/resources/com/fr/design/images/{reportfit.preview => reportfit/preview}/gray/00.png (100%) rename designer-base/src/main/resources/com/fr/design/images/{reportfit.preview => reportfit/preview}/gray/10.png (100%) rename designer-base/src/main/resources/com/fr/design/images/{reportfit.preview => reportfit/preview}/gray/11.png (100%) rename designer-base/src/main/resources/com/fr/design/images/{reportfit.preview => reportfit/preview}/gray/20.png (100%) rename designer-base/src/main/resources/com/fr/design/images/{reportfit.preview => reportfit/preview}/gray/21.png (100%) rename designer-base/src/main/resources/com/fr/design/images/{reportfit.preview => reportfit/preview}/gray/30.png (100%) diff --git a/designer-base/src/main/java/com/fr/conf/FitAttrState.java b/designer-base/src/main/java/com/fr/conf/FitAttrState.java index 9ad42fd6e7..d02270db61 100644 --- a/designer-base/src/main/java/com/fr/conf/FitAttrState.java +++ b/designer-base/src/main/java/com/fr/conf/FitAttrState.java @@ -11,7 +11,7 @@ public enum FitAttrState { DEFAULT(0) { @Override public String description() { - return com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Fit_Default"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Default"); } }, @@ -19,21 +19,21 @@ public enum FitAttrState { HORIZONTAL_FIT(1) { @Override public String description() { - return com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Fit_Horizontal"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Horizontal"); } }, // 双向自适应, 横纵向都是根据页面宽高来计算 DOUBLE_FIT(2) { @Override public String description() { - return com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Fit_Horizontal_Vertical"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Horizontal_Vertical"); } }, NOT_FIT(3) { @Override public String description() { - return com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Fit_No"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-No"); } }; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/menupane/BrowserFitAttrPane.java b/designer-base/src/main/java/com/fr/design/mainframe/menupane/BrowserFitAttrPane.java index eeaa3047ca..6b9db985d7 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/menupane/BrowserFitAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/menupane/BrowserFitAttrPane.java @@ -74,9 +74,9 @@ public class BrowserFitAttrPane extends BasicBeanPane { ActionListener actionListener = getPreviewActionListener(); fontRadioGroup = new FontRadioGroup(); - fontFitRadio = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Fit")); + fontFitRadio = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit")); fontFitRadio.setSelected(true); - fontNotFitRadio = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Fit_No")); + fontNotFitRadio = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-No")); addRadioToGroup(fontRadioGroup, fontFitRadio, fontNotFitRadio); fontRadioGroup.addActionListener(actionListener); @@ -96,8 +96,8 @@ public class BrowserFitAttrPane extends BasicBeanPane { protected Component[][] initFitComponents() { Component[][] components = new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Fit-Font")), fontFitRadio, null, fontNotFitRadio}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Fit-Element")), defaultRadio, horizonRadio, doubleRadio, notFitRadio} + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Font")), fontFitRadio, null, fontNotFitRadio}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Element")), defaultRadio, horizonRadio, doubleRadio, notFitRadio} }; return components; } @@ -110,7 +110,7 @@ public class BrowserFitAttrPane extends BasicBeanPane { private JPanel initGlobalOpsPane(final ReportFitAttr globalFitAttr) { final JPanel globalOpsPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); - globalCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Use-Global")); + globalCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-UseGlobal")); globalOpsPane.add(globalCheck); globalCheck.addActionListener(new ActionListener() { @Override @@ -123,14 +123,14 @@ public class BrowserFitAttrPane extends BasicBeanPane { fitRadionGroup.selectIndexButton(attr.fitStateInPC()); fitPreviewPane.refreshPreview(getCurrentFitOptions(), fitRadionGroup.isEnabled()); remove(BrowserFitAttrPane.this.borderPane); - initBorderPane(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Global")); + initBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Global")); } else { ReportFitAttrProvider attr = localFitAttr; fontRadioGroup.selectFontFit(((ReportFitAttr) attr).isFitFont()); fitRadionGroup.selectIndexButton(attr.fitStateInPC()); fitPreviewPane.refreshPreview(getCurrentFitOptions(), fitRadionGroup.isEnabled()); remove(BrowserFitAttrPane.this.borderPane); - initBorderPane(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Local")); + initBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Local")); } fontRadioGroup.setEnabled(isLocalConfig); fitRadionGroup.setEnabled(isLocalConfig); @@ -140,7 +140,7 @@ public class BrowserFitAttrPane extends BasicBeanPane { } }); - editGlobalOps = new UIButton(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Edit-Global")); + editGlobalOps = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-EditGlobal")); editGlobalOps.setVisible(false); editGlobalOps.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { @@ -165,7 +165,7 @@ public class BrowserFitAttrPane extends BasicBeanPane { @Override protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Attr-Set"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-AttrSet"); } @Override @@ -175,7 +175,7 @@ public class BrowserFitAttrPane extends BasicBeanPane { attr = ReportFitConfig.getInstance().getFrmFitAttr(); populateGlobalComponents(); } else { - initBorderPane(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Local")); + initBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Local")); } this.localFitAttr = attr; fontRadioGroup.selectFontFit(((ReportFitAttr) attr).isFitFont()); @@ -188,7 +188,7 @@ public class BrowserFitAttrPane extends BasicBeanPane { fontRadioGroup.setEnabled(false); fitRadionGroup.setEnabled(false); editGlobalOps.setVisible(true); - initBorderPane(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Global")); + initBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Global")); } //有八种组合, 不过有意义的就是6种, 以此为key去缓存里找对应的预览图片 diff --git a/designer-base/src/main/java/com/fr/design/mainframe/menupane/FitPreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/menupane/FitPreviewPane.java index fbc12c3b3d..68d268136b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/menupane/FitPreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/menupane/FitPreviewPane.java @@ -67,7 +67,7 @@ public class FitPreviewPane extends BasicPane { @Override protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Preview"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Preview"); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/menupane/ReportFitAttrAction.java b/designer-base/src/main/java/com/fr/design/mainframe/menupane/ReportFitAttrAction.java index 3c4d977fab..fd4a4e3cfb 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/menupane/ReportFitAttrAction.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/menupane/ReportFitAttrAction.java @@ -28,7 +28,7 @@ public class ReportFitAttrAction extends JTemplateAction { @Override public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Fit-Template"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Template"); } @Override @@ -44,7 +44,7 @@ public class ReportFitAttrAction extends JTemplateAction { @Override public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Fit-Elementcase"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Elementcase"); } @Override @@ -67,7 +67,7 @@ public class ReportFitAttrAction extends JTemplateAction { } this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/fit.png")); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/reportfit/fit.png")); } /** diff --git a/designer-base/src/main/java/com/fr/design/mainframe/menupane/ReportFitAttrPane.java b/designer-base/src/main/java/com/fr/design/mainframe/menupane/ReportFitAttrPane.java index 27faf6fa87..32de70550d 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/menupane/ReportFitAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/menupane/ReportFitAttrPane.java @@ -50,7 +50,7 @@ public class ReportFitAttrPane extends BasicBeanPane { * @return 标题 */ protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Fit-Attr"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Attr"); } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/mainframe/menupane/TemplateBrowserFitAttrPane.java b/designer-base/src/main/java/com/fr/design/mainframe/menupane/TemplateBrowserFitAttrPane.java index e37ce09a37..420306f5fd 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/menupane/TemplateBrowserFitAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/menupane/TemplateBrowserFitAttrPane.java @@ -21,8 +21,8 @@ public class TemplateBrowserFitAttrPane extends BrowserFitAttrPane { @Override protected Component[][] initFitComponents() { Component[][] components = new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Fit-Font")), fontFitRadio, null, fontNotFitRadio}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Fit-Element")), horizonRadio, doubleRadio, notFitRadio} + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Font")), fontFitRadio, null, fontNotFitRadio}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Element")), horizonRadio, doubleRadio, notFitRadio} }; return components; } @@ -41,9 +41,9 @@ public class TemplateBrowserFitAttrPane extends BrowserFitAttrPane { } else if (fitAttr.fitStateInPC() == 0) { attr = new ReportFitAttr(); attr.setFitStateInPC(3); - initBorderPane(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Local")); + initBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Local")); } else { - initBorderPane(com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Local")); + initBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Local")); } this.localFitAttr = attr; fontRadioGroup.selectFontFit((attr).isFitFont()); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/menupane/TemplateFitAttrPane.java b/designer-base/src/main/java/com/fr/design/mainframe/menupane/TemplateFitAttrPane.java index 675af9c541..a24140f02c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/menupane/TemplateFitAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/menupane/TemplateFitAttrPane.java @@ -50,6 +50,6 @@ public class TemplateFitAttrPane extends BasicBeanPane { * @return 标题 */ protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Fit-Attr"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Attr"); } } diff --git a/designer-base/src/main/resources/com/fr/design/images/reportfit/fit.png b/designer-base/src/main/resources/com/fr/design/images/reportfit/fit.png new file mode 100644 index 0000000000000000000000000000000000000000..9f6dd87b94574dbce8bd0c458eeb05094d3a2f2b GIT binary patch literal 976 zcmeAS@N?(olHy`uVBq!ia0vp^LO{&V!2%?m`@?4fDVB6cUq=Rpjs4tz5?O(Kg=CK) zUj~LMH3o);76yi2K%s^g3=E|P3=FRl7#OT(FffQ0%-I!a1C(G&@^*J&U|7|wYy{+S z7I;J!GcYg%bpde+Q)f8?1EaF1i(`n!`Pz&7y=NB+9RGM-c>gP0G~$|Szw)E16-w&Q zuUvmHS*&uZK*d*tlPUAj8$Y?w9s9>2BidNr3jx`O|%H#^k*c9Wd&yH%n08j^gw9~I6O zDmis+ZiBR|%e&@Dm3wa({(bg{yR0x*^YN+p_ea;-AM6U;KXu`ROG!rO?n-PEeUrIq z)sxLH&USaF#YBDnEcwXKYvm)ksFlDlR4s9hC`m~yNwrEYN(E93Mh1qax&~&tMn)lq zmR5$wRwjnp1{PKZ1{zXZfI*L>AvZrIGp!Q0hDdjwA3zPhARCJF(@M${i&7apa}(23 zeG}6&ld~1f^epr&bj=k44b2oPEX?A~Oca2&o9G%C=^9xmWR#Q?Sn2DRmzV2hf;0g! zP?KJMQF`Q(_ zXI25@LC@02+sWzC1cPfp=_DlS&>&BSw9K4TVBqLy implements BaseJForm { @Override public ShortCut[] shortcut4TemplateMenu() { if (this.index == FORM_TAB) { - return (ShortCut[]) ArrayUtils.addAll(new ShortCut[]{new TemplateParameterAction(this), new ReportFitAttrAction(this), new ReportFitAttrAction(this)}, new ShortCut[0]); + return (ShortCut[]) ArrayUtils.addAll(new ShortCut[]{new TemplateParameterAction(this), new ReportFitAttrAction(this)}, new ShortCut[0]); } else { return (ShortCut[]) ArrayUtils.addAll(new ShortCut[]{new TemplateParameterAction(this), new ReportFitAttrAction(this)}, this.elementCaseDesign.shortcut4TemplateMenu()); } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitPropertyEditor.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitPropertyEditor.java index 1ffa7a0e1b..3eee63f9e7 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitPropertyEditor.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitPropertyEditor.java @@ -25,7 +25,7 @@ public class BrowserFitPropertyEditor { } try { CRPropertyDescriptor propertyDescriptors = new CRPropertyDescriptor("fitStateInPC", temp).setEditorClass(BrowserFitEditor.class) - .setRendererClass(BrowserFitRender.class).setI18NName(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Fit-In-Web")) + .setRendererClass(BrowserFitRender.class).setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-In-Web")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"); return propertyDescriptors; } catch (IntrospectionException e) { From e62c6b857e78f78acc4ae36a5c13ee9167cf1c6c Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 31 Oct 2018 19:54:43 +0800 Subject: [PATCH 3/8] =?UTF-8?q?REPORT-10591=20=E8=87=AA=E9=80=82=E5=BA=94?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E5=86=85=E7=BD=AE=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reportfit/FitType.java} | 10 +++++----- .../menupane/BrowserFitAttrPane.java | 12 ++++++------ .../menupane/FitPreviewPane.java | 2 +- .../menupane/FitRadioGroup.java | 2 +- .../menupane/FontRadioGroup.java | 2 +- .../menupane/ReportFitAttrAction.java | 2 +- .../menupane/ReportFitAttrPane.java | 2 +- .../menupane/TemplateBrowserFitAttrPane.java | 2 +- .../menupane/TemplateFitAttrPane.java | 2 +- .../main/java/com/fr/design/utils/DesignUtils.java | 12 ++++++------ .../src/main/java/com/fr/design/mainframe/JForm.java | 3 +-- .../propertypane/BrowserFitAlignmentItems.java | 8 ++++---- .../main/java/com/fr/design/mainframe/JWorkBook.java | 2 +- 13 files changed, 30 insertions(+), 31 deletions(-) rename designer-base/src/main/java/com/fr/{conf/FitAttrState.java => design/reportfit/FitType.java} (88%) rename designer-base/src/main/java/com/fr/design/{mainframe => reportfit}/menupane/BrowserFitAttrPane.java (96%) rename designer-base/src/main/java/com/fr/design/{mainframe => reportfit}/menupane/FitPreviewPane.java (99%) rename designer-base/src/main/java/com/fr/design/{mainframe => reportfit}/menupane/FitRadioGroup.java (97%) rename designer-base/src/main/java/com/fr/design/{mainframe => reportfit}/menupane/FontRadioGroup.java (89%) rename designer-base/src/main/java/com/fr/design/{mainframe => reportfit}/menupane/ReportFitAttrAction.java (98%) rename designer-base/src/main/java/com/fr/design/{mainframe => reportfit}/menupane/ReportFitAttrPane.java (96%) rename designer-base/src/main/java/com/fr/design/{mainframe => reportfit}/menupane/TemplateBrowserFitAttrPane.java (98%) rename designer-base/src/main/java/com/fr/design/{mainframe => reportfit}/menupane/TemplateFitAttrPane.java (96%) diff --git a/designer-base/src/main/java/com/fr/conf/FitAttrState.java b/designer-base/src/main/java/com/fr/design/reportfit/FitType.java similarity index 88% rename from designer-base/src/main/java/com/fr/conf/FitAttrState.java rename to designer-base/src/main/java/com/fr/design/reportfit/FitType.java index d02270db61..08538956c4 100644 --- a/designer-base/src/main/java/com/fr/conf/FitAttrState.java +++ b/designer-base/src/main/java/com/fr/design/reportfit/FitType.java @@ -1,4 +1,4 @@ -package com.fr.conf; +package com.fr.design.reportfit; import com.fr.design.designer.properties.items.Item; import com.fr.report.fun.ReportFitAttrProvider; @@ -7,7 +7,7 @@ import com.fr.stable.StringUtils; /** * Created by Administrator on 2016/4/13/0013. */ -public enum FitAttrState { +public enum FitType { DEFAULT(0) { @Override public String description() { @@ -41,17 +41,17 @@ public enum FitAttrState { private int state; - FitAttrState(int state) { + FitType(int state) { this.state = state; } - public static FitAttrState parse(ReportFitAttrProvider attr) { + public static FitType parse(ReportFitAttrProvider attr) { if (attr == null) { return DEFAULT; } - for (FitAttrState attrState : values()) { + for (FitType attrState : values()) { if (attrState.state == attr.fitStateInPC()) { return attrState; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/menupane/BrowserFitAttrPane.java b/designer-base/src/main/java/com/fr/design/reportfit/menupane/BrowserFitAttrPane.java similarity index 96% rename from designer-base/src/main/java/com/fr/design/mainframe/menupane/BrowserFitAttrPane.java rename to designer-base/src/main/java/com/fr/design/reportfit/menupane/BrowserFitAttrPane.java index 6b9db985d7..68669f316e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/menupane/BrowserFitAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/reportfit/menupane/BrowserFitAttrPane.java @@ -1,6 +1,6 @@ -package com.fr.design.mainframe.menupane; +package com.fr.design.reportfit.menupane; -import com.fr.conf.FitAttrState; +import com.fr.design.reportfit.FitType; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIRadioButton; @@ -81,10 +81,10 @@ public class BrowserFitAttrPane extends BasicBeanPane { fontRadioGroup.addActionListener(actionListener); fitRadionGroup = new FitRadioGroup(); - defaultRadio = new UIRadioButton(FitAttrState.DEFAULT.description()); - horizonRadio = new UIRadioButton(FitAttrState.HORIZONTAL_FIT.description()); - doubleRadio = new UIRadioButton(FitAttrState.DOUBLE_FIT.description()); - notFitRadio = new UIRadioButton(FitAttrState.NOT_FIT.description()); + defaultRadio = new UIRadioButton(FitType.DEFAULT.description()); + horizonRadio = new UIRadioButton(FitType.HORIZONTAL_FIT.description()); + doubleRadio = new UIRadioButton(FitType.DOUBLE_FIT.description()); + notFitRadio = new UIRadioButton(FitType.NOT_FIT.description()); addRadioToGroup(fitRadionGroup, defaultRadio, horizonRadio, doubleRadio, notFitRadio); fitRadionGroup.addActionListener(actionListener); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/menupane/FitPreviewPane.java b/designer-base/src/main/java/com/fr/design/reportfit/menupane/FitPreviewPane.java similarity index 99% rename from designer-base/src/main/java/com/fr/design/mainframe/menupane/FitPreviewPane.java rename to designer-base/src/main/java/com/fr/design/reportfit/menupane/FitPreviewPane.java index 68d268136b..fe6232c889 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/menupane/FitPreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/reportfit/menupane/FitPreviewPane.java @@ -1,4 +1,4 @@ -package com.fr.design.mainframe.menupane; +package com.fr.design.reportfit.menupane; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ilable.UILabel; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/menupane/FitRadioGroup.java b/designer-base/src/main/java/com/fr/design/reportfit/menupane/FitRadioGroup.java similarity index 97% rename from designer-base/src/main/java/com/fr/design/mainframe/menupane/FitRadioGroup.java rename to designer-base/src/main/java/com/fr/design/reportfit/menupane/FitRadioGroup.java index e2612f794c..363ee64f70 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/menupane/FitRadioGroup.java +++ b/designer-base/src/main/java/com/fr/design/reportfit/menupane/FitRadioGroup.java @@ -1,4 +1,4 @@ -package com.fr.design.mainframe.menupane; +package com.fr.design.reportfit.menupane; import com.fr.design.gui.ibutton.UIRadioButton; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/menupane/FontRadioGroup.java b/designer-base/src/main/java/com/fr/design/reportfit/menupane/FontRadioGroup.java similarity index 89% rename from designer-base/src/main/java/com/fr/design/mainframe/menupane/FontRadioGroup.java rename to designer-base/src/main/java/com/fr/design/reportfit/menupane/FontRadioGroup.java index 5bb7d55052..f0c313b5cd 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/menupane/FontRadioGroup.java +++ b/designer-base/src/main/java/com/fr/design/reportfit/menupane/FontRadioGroup.java @@ -1,4 +1,4 @@ -package com.fr.design.mainframe.menupane; +package com.fr.design.reportfit.menupane; /** * 字体的两个选项组成的group diff --git a/designer-base/src/main/java/com/fr/design/mainframe/menupane/ReportFitAttrAction.java b/designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrAction.java similarity index 98% rename from designer-base/src/main/java/com/fr/design/mainframe/menupane/ReportFitAttrAction.java rename to designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrAction.java index fd4a4e3cfb..cb64e4b098 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/menupane/ReportFitAttrAction.java +++ b/designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrAction.java @@ -1,4 +1,4 @@ -package com.fr.design.mainframe.menupane; +package com.fr.design.reportfit.menupane; import com.fr.base.BaseUtils; import com.fr.design.actions.JTemplateAction; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/menupane/ReportFitAttrPane.java b/designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrPane.java similarity index 96% rename from designer-base/src/main/java/com/fr/design/mainframe/menupane/ReportFitAttrPane.java rename to designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrPane.java index 32de70550d..e0b40215e4 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/menupane/ReportFitAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrPane.java @@ -1,4 +1,4 @@ -package com.fr.design.mainframe.menupane; +package com.fr.design.reportfit.menupane; import com.fr.design.beans.BasicBeanPane; import com.fr.report.fun.ReportFitAttrProvider; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/menupane/TemplateBrowserFitAttrPane.java b/designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateBrowserFitAttrPane.java similarity index 98% rename from designer-base/src/main/java/com/fr/design/mainframe/menupane/TemplateBrowserFitAttrPane.java rename to designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateBrowserFitAttrPane.java index 420306f5fd..3b3903fa62 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/menupane/TemplateBrowserFitAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateBrowserFitAttrPane.java @@ -1,4 +1,4 @@ -package com.fr.design.mainframe.menupane; +package com.fr.design.reportfit.menupane; import com.fr.design.gui.ilable.UILabel; import com.fr.log.FineLoggerFactory; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/menupane/TemplateFitAttrPane.java b/designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateFitAttrPane.java similarity index 96% rename from designer-base/src/main/java/com/fr/design/mainframe/menupane/TemplateFitAttrPane.java rename to designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateFitAttrPane.java index a24140f02c..48238e85cf 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/menupane/TemplateFitAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateFitAttrPane.java @@ -1,4 +1,4 @@ -package com.fr.design.mainframe.menupane; +package com.fr.design.reportfit.menupane; import com.fr.design.beans.BasicBeanPane; import com.fr.report.fun.ReportFitAttrProvider; diff --git a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java index 240176eef7..77173cebb5 100644 --- a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java @@ -65,12 +65,12 @@ public class DesignUtils { * @return 启动了返回true */ public static boolean isStarted() { - try { - new Socket("localhost", port); - return true; - } catch (Exception exp) { - - } +// try { +// new Socket("localhost", port); +// return true; +// } catch (Exception exp) { +// +// } return false; } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index a6d7e14803..5f043c6983 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -32,11 +32,10 @@ import com.fr.design.gui.xpane.FormHyperlinkGroupPane; import com.fr.design.gui.xpane.FormHyperlinkGroupPaneNoPop; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.actions.EmbeddedFormExportExportAction; -import com.fr.design.mainframe.actions.FormMobileAttrAction; import com.fr.design.mainframe.actions.TemplateParameterAction; import com.fr.design.mainframe.form.FormECCompositeProvider; import com.fr.design.mainframe.form.FormECDesignerProvider; -import com.fr.design.mainframe.menupane.ReportFitAttrAction; +import com.fr.design.reportfit.menupane.ReportFitAttrAction; import com.fr.design.mainframe.templateinfo.JFormProcessInfo; import com.fr.design.mainframe.templateinfo.TemplateProcessInfo; import com.fr.design.mainframe.toolbar.ToolBarMenuDock; diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitAlignmentItems.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitAlignmentItems.java index ca6fd2ca14..27669e8aba 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitAlignmentItems.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitAlignmentItems.java @@ -1,15 +1,15 @@ package com.fr.design.mainframe.widget.propertypane; -import com.fr.conf.FitAttrState; +import com.fr.design.reportfit.FitType; import com.fr.design.designer.properties.items.Item; import com.fr.design.designer.properties.items.ItemProvider; public class BrowserFitAlignmentItems implements ItemProvider { private static Item[] VALUE_ITEMS = { - FitAttrState.HORIZONTAL_FIT.propertyItem(), - FitAttrState.DOUBLE_FIT.propertyItem(), - FitAttrState.NOT_FIT.propertyItem(), + FitType.HORIZONTAL_FIT.propertyItem(), + FitType.DOUBLE_FIT.propertyItem(), + FitType.NOT_FIT.propertyItem(), }; @Override diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index 0e33e1891d..7072c55dd2 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -41,7 +41,7 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icontainer.UIModeControlContainer; import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.mainframe.cell.QuickEditorRegion; -import com.fr.design.mainframe.menupane.ReportFitAttrAction; +import com.fr.design.reportfit.menupane.ReportFitAttrAction; import com.fr.design.mainframe.templateinfo.JWorkBookProcessInfo; import com.fr.design.mainframe.templateinfo.TemplateProcessInfo; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; From d29f62101d61f9317f310068e90a84fd0d1bd633 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 31 Oct 2018 20:01:04 +0800 Subject: [PATCH 4/8] =?UTF-8?q?REPORT-10591=20=E8=87=AA=E9=80=82=E5=BA=94?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E5=86=85=E7=BD=AE=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/designer/creator/XElementCase.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java index a9e655e5b2..acbc78d185 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java @@ -115,6 +115,10 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme public CRPropertyDescriptor[] getExtraTableEditor(){ CRPropertyDescriptor[] extraTableEditor = resolveCompatible(); + return ArrayUtils.addAll(extraTableEditor, new CRPropertyDescriptor[] {getReportFitEditor()}); + } + + private CRPropertyDescriptor getReportFitEditor() { this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); FitProvider wbTpl = designer.getTarget(); ReportFitAttrProvider fitAttr = wbTpl.getFitAttr(); @@ -133,7 +137,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme if (editor.getReportFitAttr() == null) { editor.setReportFitInPc(browserFitPropertyEditor.getFitStateInPC(fitAttr)); } - return ArrayUtils.addAll(extraTableEditor, new CRPropertyDescriptor[] {extraEditor}); + return extraEditor; } From 6dede79ce43cc3e47c3d4e2a31397093734217fb Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 31 Oct 2018 20:31:25 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fun/FormElementCaseEditorProvider.java | 15 ------------- ...AbstractFormElementCaseEditorProvider.java | 21 ------------------- 2 files changed, 36 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/fun/FormElementCaseEditorProvider.java b/designer-base/src/main/java/com/fr/design/fun/FormElementCaseEditorProvider.java index 6a0cf7bba1..70aeadd13a 100644 --- a/designer-base/src/main/java/com/fr/design/fun/FormElementCaseEditorProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/FormElementCaseEditorProvider.java @@ -2,7 +2,6 @@ package com.fr.design.fun; import com.fr.form.FormProvider; import com.fr.form.ui.ElementCaseEditorProvider; -import com.fr.report.fun.ReportFitAttrProvider; import com.fr.stable.fun.mark.Mutable; import java.beans.PropertyDescriptor; @@ -18,18 +17,4 @@ public interface FormElementCaseEditorProvider extends Mutable { PropertyDescriptor[] createPropertyDescriptor(Class temp, FormProvider formProvider, ElementCaseEditorProvider editor); - /** - * 生成属性表 - * @param temp 传入当前操作的class - * @param reportFitAttr 传入的自适应属性 - * @return 返回属性表 - */ - PropertyDescriptor[] createPropertyDescriptor(Class temp, ReportFitAttrProvider reportFitAttr); - - /** - * 返回pc自适应属性值 - * @param fitAttrProvider 传入的自适应属性 - * @return 返回pc自适应属性值 - */ - int getFitStateInPC(ReportFitAttrProvider fitAttrProvider); } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormElementCaseEditorProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormElementCaseEditorProvider.java index f9d3e1b173..5098894e04 100644 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormElementCaseEditorProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormElementCaseEditorProvider.java @@ -3,7 +3,6 @@ package com.fr.design.fun.impl; import com.fr.design.fun.FormElementCaseEditorProvider; import com.fr.form.FormProvider; import com.fr.form.ui.ElementCaseEditorProvider; -import com.fr.report.fun.ReportFitAttrProvider; import com.fr.stable.fun.mark.API; import java.beans.PropertyDescriptor; @@ -28,24 +27,4 @@ public abstract class AbstractFormElementCaseEditorProvider implements FormEleme return new PropertyDescriptor[0]; } - /** - * 生成属性表 - * @param temp 传入当前操作的class - * @param reportFitAttr 传入的自适应属性 - * @return 返回属性表 - */ - @Override - public PropertyDescriptor[] createPropertyDescriptor(Class temp, ReportFitAttrProvider reportFitAttr) { - return new PropertyDescriptor[0]; - } - - /** - * 返回pc自适应属性值 - * @param fitAttrProvider 传入的自适应属性 - * @return 返回pc自适应属性值 - */ - @Override - public int getFitStateInPC(ReportFitAttrProvider fitAttrProvider) { - return 0; - } } \ No newline at end of file From 90c9c827d76e9a116ccd5ebbadb70e90b13cec2a Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 31 Oct 2018 20:34:39 +0800 Subject: [PATCH 6/8] =?UTF-8?q?REPORT-10591=20=E8=87=AA=E9=80=82=E5=BA=94?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E5=86=85=E7=BD=AE=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fun/FormElementCaseEditorProcessor.java | 31 ------------- ...bstractFormElementCaseEditorProcessor.java | 44 ------------------- 2 files changed, 75 deletions(-) delete mode 100644 designer-base/src/main/java/com/fr/design/fun/FormElementCaseEditorProcessor.java delete mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java diff --git a/designer-base/src/main/java/com/fr/design/fun/FormElementCaseEditorProcessor.java b/designer-base/src/main/java/com/fr/design/fun/FormElementCaseEditorProcessor.java deleted file mode 100644 index 28d763bf71..0000000000 --- a/designer-base/src/main/java/com/fr/design/fun/FormElementCaseEditorProcessor.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.fr.design.fun; - -import com.fr.report.fun.ReportFitAttrProvider; -import com.fr.stable.fun.mark.Immutable; - -import java.beans.PropertyDescriptor; - -/** - * Created by Slpire on 2016/10/28. - */ -public interface FormElementCaseEditorProcessor extends Immutable { - String MARK_STRING = "PropertyEditor"; - - int CURRENT_LEVEL = 1; - - - /** - * 生成属性表 - * @param temp 传入当前操作的class - * @param reportFitAttr 传入的自适应属性 - * @return 返回属性表 - */ - PropertyDescriptor[] createPropertyDescriptor(Class temp, ReportFitAttrProvider reportFitAttr); - - /** - * 返回pc自适应属性值 - * @param fitAttrProvider 传入的自适应属性 - * @return 返回pc自适应属性值 - */ - int getFitStateInPC(ReportFitAttrProvider fitAttrProvider); -} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java deleted file mode 100644 index 191f513908..0000000000 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractFormElementCaseEditorProcessor.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.fr.design.fun.impl; - -import com.fr.design.fun.FormElementCaseEditorProcessor; -import com.fr.report.fun.ReportFitAttrProvider; -import com.fr.stable.fun.mark.API; - -import java.beans.PropertyDescriptor; - -/** - * Created by zhouping on 2015/9/10. - */ -@API(level = FormElementCaseEditorProcessor.CURRENT_LEVEL) -public abstract class AbstractFormElementCaseEditorProcessor implements FormElementCaseEditorProcessor { - - public int currentAPILevel() { - return CURRENT_LEVEL; - } - - public int layerIndex() { - return DEFAULT_LAYER_INDEX; - } - - - /** - * 生成属性表 - * @param temp 传入当前操作的class - * @param reportFitAttr 传入的自适应属性 - * @return 返回属性表 - */ - @Override - public PropertyDescriptor[] createPropertyDescriptor(Class temp, ReportFitAttrProvider reportFitAttr) { - return new PropertyDescriptor[0]; - } - - /** - * 返回pc自适应属性值 - * @param fitAttrProvider 传入的自适应属性 - * @return 返回pc自适应属性值 - */ - @Override - public int getFitStateInPC(ReportFitAttrProvider fitAttrProvider) { - return 0; - } -} \ No newline at end of file From 2a692fb92fc98446e565fda230f44bfcf231ad87 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 31 Oct 2018 20:35:03 +0800 Subject: [PATCH 7/8] =?UTF-8?q?REPORT-10591=20=E8=87=AA=E9=80=82=E5=BA=94?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E5=86=85=E7=BD=AE=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/designer/creator/XElementCase.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java index acbc78d185..c6f3bfb02f 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java @@ -4,7 +4,6 @@ import com.fr.base.BaseUtils; import com.fr.design.ExtraDesignClassManager; import com.fr.design.designer.properties.mobile.ElementCasePropertyUI; import com.fr.design.form.util.XCreatorConstants; -import com.fr.design.fun.FormElementCaseEditorProcessor; import com.fr.design.fun.FormElementCaseEditorProvider; import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.fun.impl.AbstractFormElementCaseEditorProvider; From 0c07b5851256f174dc464c2e593ebc2831d5fb69 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Thu, 1 Nov 2018 16:44:09 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8C=85=E5=90=8D?= =?UTF-8?q?=EF=BC=8C=20=E7=A7=BB=E9=99=A4ReportFitAttrProvider=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/reportfit/FitType.java | 4 ++-- .../menupane/BrowserFitAttrPane.java | 19 +++++++++---------- .../menupane/ReportFitAttrAction.java | 10 +++++----- .../reportfit/menupane/ReportFitAttrPane.java | 8 ++++---- .../menupane/TemplateBrowserFitAttrPane.java | 11 +++++------ .../menupane/TemplateFitAttrPane.java | 8 ++++---- .../design/designer/creator/XElementCase.java | 10 +++++----- .../BrowserFitPropertyEditor.java | 8 ++++---- 8 files changed, 38 insertions(+), 40 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/reportfit/FitType.java b/designer-base/src/main/java/com/fr/design/reportfit/FitType.java index 08538956c4..6b342240dd 100644 --- a/designer-base/src/main/java/com/fr/design/reportfit/FitType.java +++ b/designer-base/src/main/java/com/fr/design/reportfit/FitType.java @@ -1,7 +1,7 @@ package com.fr.design.reportfit; import com.fr.design.designer.properties.items.Item; -import com.fr.report.fun.ReportFitAttrProvider; +import com.fr.report.reportfit.ReportFitAttr; import com.fr.stable.StringUtils; /** @@ -45,7 +45,7 @@ public enum FitType { this.state = state; } - public static FitType parse(ReportFitAttrProvider attr) { + public static FitType parse(ReportFitAttr attr) { if (attr == null) { return DEFAULT; diff --git a/designer-base/src/main/java/com/fr/design/reportfit/menupane/BrowserFitAttrPane.java b/designer-base/src/main/java/com/fr/design/reportfit/menupane/BrowserFitAttrPane.java index 68669f316e..470a2101bb 100644 --- a/designer-base/src/main/java/com/fr/design/reportfit/menupane/BrowserFitAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/reportfit/menupane/BrowserFitAttrPane.java @@ -10,9 +10,8 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.log.FineLoggerFactory; -import com.fr.main.ReportFitAttr; -import com.fr.main.ReportFitConfig; -import com.fr.report.fun.ReportFitAttrProvider; +import com.fr.report.reportfit.ReportFitAttr; +import com.fr.reportfit.ReportFitConfig; import javax.swing.BorderFactory; import javax.swing.ButtonGroup; @@ -28,13 +27,13 @@ import java.awt.event.MouseEvent; /** * Created by Administrator on 2016/5/5/0005. */ -public class BrowserFitAttrPane extends BasicBeanPane { +public class BrowserFitAttrPane extends BasicBeanPane { protected FontRadioGroup fontRadioGroup; protected FitRadioGroup fitRadionGroup; protected UICheckBox globalCheck; protected FitPreviewPane fitPreviewPane; - protected ReportFitAttrProvider localFitAttr; + protected ReportFitAttr localFitAttr; protected UIRadioButton defaultRadio; protected UIRadioButton horizonRadio; protected UIRadioButton doubleRadio; @@ -118,14 +117,14 @@ public class BrowserFitAttrPane extends BasicBeanPane { boolean isLocalConfig = !globalCheck.isSelected(); //勾选全局时,采用全局保存的自适应属性更新界面 if (!isLocalConfig) { - ReportFitAttrProvider attr = globalFitAttr; + ReportFitAttr attr = globalFitAttr; fontRadioGroup.selectFontFit(((ReportFitAttr) attr).isFitFont()); fitRadionGroup.selectIndexButton(attr.fitStateInPC()); fitPreviewPane.refreshPreview(getCurrentFitOptions(), fitRadionGroup.isEnabled()); remove(BrowserFitAttrPane.this.borderPane); initBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Global")); } else { - ReportFitAttrProvider attr = localFitAttr; + ReportFitAttr attr = localFitAttr; fontRadioGroup.selectFontFit(((ReportFitAttr) attr).isFitFont()); fitRadionGroup.selectIndexButton(attr.fitStateInPC()); fitPreviewPane.refreshPreview(getCurrentFitOptions(), fitRadionGroup.isEnabled()); @@ -169,7 +168,7 @@ public class BrowserFitAttrPane extends BasicBeanPane { } @Override - public void populateBean(ReportFitAttrProvider attr) { + public void populateBean(ReportFitAttr attr) { if (attr == null) { //如果为空, 就用全局的 attr = ReportFitConfig.getInstance().getFrmFitAttr(); @@ -178,7 +177,7 @@ public class BrowserFitAttrPane extends BasicBeanPane { initBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Local")); } this.localFitAttr = attr; - fontRadioGroup.selectFontFit(((ReportFitAttr) attr).isFitFont()); + fontRadioGroup.selectFontFit((attr).isFitFont()); fitRadionGroup.selectIndexButton(attr.fitStateInPC()); fitPreviewPane.refreshPreview(getCurrentFitOptions(), fitRadionGroup.isEnabled()); } @@ -207,7 +206,7 @@ public class BrowserFitAttrPane extends BasicBeanPane { } @Override - public ReportFitAttrProvider updateBean() { + public ReportFitAttr updateBean() { ReportFitAttr attr = new ReportFitAttr(); attr.setFitFont(fontRadioGroup.isFontFit()); attr.setFitStateInPC(fitRadionGroup.getSelectRadioIndex()); diff --git a/designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrAction.java b/designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrAction.java index cb64e4b098..dc41879565 100644 --- a/designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrAction.java +++ b/designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrAction.java @@ -8,8 +8,8 @@ import com.fr.design.dialog.UIDialog; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; import com.fr.design.menu.MenuKeySet; -import com.fr.report.fun.FitProvider; -import com.fr.report.fun.ReportFitAttrProvider; +import com.fr.report.reportfit.FitProvider; +import com.fr.report.reportfit.ReportFitAttr; import javax.swing.KeyStroke; import java.awt.Dimension; @@ -81,7 +81,7 @@ public class ReportFitAttrAction extends JTemplateAction { return; } final FitProvider wbTpl = (FitProvider) jwb.getTarget(); - ReportFitAttrProvider fitAttr = wbTpl.getFitAttr(); + ReportFitAttr fitAttr = wbTpl.getReportFitAttr(); if (jwb.isJWorkBook()) { final TemplateFitAttrPane attrPane = new TemplateFitAttrPane(); showReportFitDialog(fitAttr, jwb, wbTpl, attrPane); @@ -91,12 +91,12 @@ public class ReportFitAttrAction extends JTemplateAction { } } - private void showReportFitDialog(ReportFitAttrProvider fitAttr, final JTemplate jwb, final FitProvider wbTpl, final BasicBeanPane attrPane) { + private void showReportFitDialog(ReportFitAttr fitAttr, final JTemplate jwb, final FitProvider wbTpl, final BasicBeanPane attrPane) { attrPane.populateBean(fitAttr); UIDialog dialog = attrPane.showUnsizedWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { @Override public void doOk() { - wbTpl.setFitAttr(attrPane.updateBean()); + wbTpl.setReportFitAttr(attrPane.updateBean()); jwb.fireTargetModified(); } }); diff --git a/designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrPane.java b/designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrPane.java index e0b40215e4..983ff21ab2 100644 --- a/designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/reportfit/menupane/ReportFitAttrPane.java @@ -1,7 +1,7 @@ package com.fr.design.reportfit.menupane; import com.fr.design.beans.BasicBeanPane; -import com.fr.report.fun.ReportFitAttrProvider; +import com.fr.report.reportfit.ReportFitAttr; import javax.swing.BorderFactory; import javax.swing.BoxLayout; @@ -9,7 +9,7 @@ import javax.swing.BoxLayout; /** * Created by Administrator on 2015/7/6 0006. */ -public class ReportFitAttrPane extends BasicBeanPane { +public class ReportFitAttrPane extends BasicBeanPane { private BrowserFitAttrPane attrPane; @@ -31,7 +31,7 @@ public class ReportFitAttrPane extends BasicBeanPane { * * @param fitAttr 自适应属性 */ - public void populateBean(ReportFitAttrProvider fitAttr) { + public void populateBean(ReportFitAttr fitAttr) { attrPane.populateBean(fitAttr); } @@ -40,7 +40,7 @@ public class ReportFitAttrPane extends BasicBeanPane { * * @return 界面上的更新数据 */ - public ReportFitAttrProvider updateBean() { + public ReportFitAttr updateBean() { return attrPane.updateBean(); } diff --git a/designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateBrowserFitAttrPane.java b/designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateBrowserFitAttrPane.java index 3b3903fa62..de8108ace3 100644 --- a/designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateBrowserFitAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateBrowserFitAttrPane.java @@ -2,9 +2,8 @@ package com.fr.design.reportfit.menupane; import com.fr.design.gui.ilable.UILabel; import com.fr.log.FineLoggerFactory; -import com.fr.main.ReportFitAttr; -import com.fr.main.ReportFitConfig; -import com.fr.report.fun.ReportFitAttrProvider; +import com.fr.report.reportfit.ReportFitAttr; +import com.fr.reportfit.ReportFitConfig; import java.awt.Component; @@ -28,12 +27,12 @@ public class TemplateBrowserFitAttrPane extends BrowserFitAttrPane { } @Override - public void populateBean(ReportFitAttrProvider attr) { + public void populateBean(ReportFitAttr attr) { //模板界面,自适应选项去掉了默认,这边的判断为了兼容之前的设置 if (attr != null && attr.fitStateInPC() == 0) { attr.setFitStateInPC(3); } - ReportFitAttrProvider fitAttr = ReportFitConfig.getInstance().getCptFitAttr(); + ReportFitAttr fitAttr = ReportFitConfig.getInstance().getCptFitAttr(); if (attr == null) { //如果为空, 就用全局的 attr = fitAttr; @@ -52,7 +51,7 @@ public class TemplateBrowserFitAttrPane extends BrowserFitAttrPane { } @Override - public ReportFitAttrProvider updateBean() { + public ReportFitAttr updateBean() { ReportFitAttr attr = new ReportFitAttr(); attr.setFitFont(fontRadioGroup.isFontFit()); attr.setFitStateInPC(fitRadionGroup.getSelectRadioIndex()); diff --git a/designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateFitAttrPane.java b/designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateFitAttrPane.java index 48238e85cf..e78259af6f 100644 --- a/designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateFitAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/reportfit/menupane/TemplateFitAttrPane.java @@ -1,7 +1,7 @@ package com.fr.design.reportfit.menupane; import com.fr.design.beans.BasicBeanPane; -import com.fr.report.fun.ReportFitAttrProvider; +import com.fr.report.reportfit.ReportFitAttr; import javax.swing.BorderFactory; import javax.swing.BoxLayout; @@ -9,7 +9,7 @@ import javax.swing.BoxLayout; /** * Created by 夏翔 on 2016/6/24. */ -public class TemplateFitAttrPane extends BasicBeanPane { +public class TemplateFitAttrPane extends BasicBeanPane { private TemplateBrowserFitAttrPane attrPane; @@ -30,7 +30,7 @@ public class TemplateFitAttrPane extends BasicBeanPane { * * @param fitAttr 自适应属性 */ - public void populateBean(ReportFitAttrProvider fitAttr) { + public void populateBean(ReportFitAttr fitAttr) { attrPane.populateBean(fitAttr); } @@ -40,7 +40,7 @@ public class TemplateFitAttrPane extends BasicBeanPane { * * @return 界面上的更新数据 */ - public ReportFitAttrProvider updateBean() { + public ReportFitAttr updateBean() { return attrPane.updateBean(); } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java index c6f3bfb02f..1b30af7719 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java @@ -19,11 +19,11 @@ import com.fr.form.FormProvider; import com.fr.form.ui.ElementCaseEditor; import com.fr.form.ui.ElementCaseEditorProvider; +import com.fr.report.reportfit.ReportFitAttr; import com.fr.stable.ArrayUtils; import com.fr.stable.CoreGraphHelper; import com.fr.stable.core.PropertyChangeAdapter; -import com.fr.report.fun.FitProvider; -import com.fr.report.fun.ReportFitAttrProvider; +import com.fr.report.reportfit.FitProvider; import javax.swing.*; import java.awt.*; @@ -120,17 +120,17 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme private CRPropertyDescriptor getReportFitEditor() { this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); FitProvider wbTpl = designer.getTarget(); - ReportFitAttrProvider fitAttr = wbTpl.getFitAttr(); + ReportFitAttr fitAttr = wbTpl.getReportFitAttr(); ElementCaseEditor editor = this.toData(); //兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应) if (editor.getFitStateInPC() == 0) { editor.setReportFitAttr(null); } - ReportFitAttrProvider reportFit = editor.getReportFitAttr(); + ReportFitAttr reportFit = editor.getReportFitAttr(); if(fitAttr != null){ reportFit = fitAttr.fitInBrowser() ? editor.getReportFitAttr() : fitAttr; } - ReportFitAttrProvider reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : reportFit; + ReportFitAttr reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : reportFit; BrowserFitPropertyEditor browserFitPropertyEditor = new BrowserFitPropertyEditor(); CRPropertyDescriptor extraEditor = browserFitPropertyEditor.createPropertyDescriptor(this.data.getClass(), reportFitAttr); if (editor.getReportFitAttr() == null) { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitPropertyEditor.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitPropertyEditor.java index 3eee63f9e7..cdbc0c1a18 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitPropertyEditor.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/propertypane/BrowserFitPropertyEditor.java @@ -2,8 +2,8 @@ package com.fr.design.mainframe.widget.propertypane; import com.fr.design.designer.creator.CRPropertyDescriptor; import com.fr.design.form.util.XCreatorConstants; -import com.fr.main.ReportFitConfig; -import com.fr.report.fun.ReportFitAttrProvider; +import com.fr.report.reportfit.ReportFitAttr; +import com.fr.reportfit.ReportFitConfig; import java.beans.IntrospectionException; @@ -19,7 +19,7 @@ public class BrowserFitPropertyEditor { * @param reportFitAttr 传入的自适应属性 * @return 返回属性表 */ - public CRPropertyDescriptor createPropertyDescriptor(Class temp, ReportFitAttrProvider reportFitAttr) { + public CRPropertyDescriptor createPropertyDescriptor(Class temp, ReportFitAttr reportFitAttr) { if (getFitStateInPC(reportFitAttr) == 0) { return null; } @@ -33,7 +33,7 @@ public class BrowserFitPropertyEditor { } } - public int getFitStateInPC(ReportFitAttrProvider fitAttrProvider) { + public int getFitStateInPC(ReportFitAttr fitAttrProvider) { if (fitAttrProvider != null) { return fitAttrProvider.fitStateInPC(); }