From c69fefe8e73b9d3320f860c98bff4ba2075f538c Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Thu, 20 May 2021 22:33:22 +0800 Subject: [PATCH 1/8] =?UTF-8?q?REPORT-51992=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E6=80=A7=E8=83=BD=E6=8F=90=E5=8D=87-=E7=BC=A9=E7=95=A5?= =?UTF-8?q?=E5=9B=BE=E5=8D=A0=E5=86=85=E5=AD=98=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout/FRAbsoluteLayoutAdapter.java | 2 +- .../design/designer/creator/XElementCase.java | 637 +++++++++--------- .../designer/creator/XWAbsoluteLayout.java | 2 + .../design/designer/creator/XWFitLayout.java | 3 + 4 files changed, 334 insertions(+), 310 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java index 932338a3fd..5326e6f6c2 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java @@ -298,7 +298,7 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { WAbsoluteLayout wabs = (WAbsoluteLayout)container.toData(); fix(creator,creator.getX(),creator.getY()); wabs.setBounds(creator.toData(),creator.getBounds()); - + XElementCase.updateECImage(creator); XWAbsoluteLayout layout = (XWAbsoluteLayout) container; layout.updateBoundsWidget(creator); } 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 6aafc8c6e1..fc2b1d0468 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 @@ -32,313 +32,332 @@ import java.beans.IntrospectionException; import java.beans.PropertyDescriptor; import java.util.Set; -public class XElementCase extends XBorderStyleWidgetCreator implements FormElementCaseContainerProvider{ - private UILabel imageLable; - private FormDesigner designer; - private static BufferedImage DEFAULT_BACKGROUND; - private boolean isHovering = false; - - static{ - try{ - DEFAULT_BACKGROUND = BaseUtils.readImageWithCache("com/fr/base/images/report/elementcase.png"); - }catch (Throwable e) { - //IBM jdk 1.5.0_22 并发下读取图片有时会异常(EOFException), 这个图片反正只有设计器用到, 捕获住 - DEFAULT_BACKGROUND = CoreGraphHelper.createBufferedImage(0, 0); - } - } - - public XElementCase(ElementCaseEditor widget, Dimension initSize) { - super(widget, initSize); - - - } - - protected void initXCreatorProperties() { - super.initXCreatorProperties(); - - // 报表块初始化时要加载对应的borderStyle - initBorderStyle(); - } - - /** - * 是否支持设置标题 - * @return 是返回true - */ - public boolean hasTitleStyle() { - return true; - } - - /** - * 返回组件属性值 - * @return 返回组件属性值 - * @throws IntrospectionException 异常 - */ - public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { - - CRPropertyDescriptor[] propertyTableEditor = new CRPropertyDescriptor[]{ - new CRPropertyDescriptor("widgetName", this.data.getClass()) - .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Form_Widget_Name")), - new CRPropertyDescriptor("visible", this.data.getClass()).setI18NName( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Visible")).setPropertyChangeListener(new PropertyChangeAdapter() { - - @Override - public void propertyChange() { - makeVisible(toData().isVisible()); - } - }), - new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( - WLayoutBorderStyleEditor.class).setI18NName( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced") - .setPropertyChangeListener(new PropertyChangeAdapter() { - - @Override - public void propertyChange() { - initStyle(); - } - }), - new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class) - .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout_Padding")) - .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"), - 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 ArrayUtils.addAll(propertyTableEditor, extraTableEditor); - } - - - public CRPropertyDescriptor[] getExtraTableEditor(){ - CRPropertyDescriptor[] extraTableEditor = resolveCompatible(); - CRPropertyDescriptor reportFitEditor = getReportFitEditor(); - if (reportFitEditor == null) { - return extraTableEditor; - } - return ArrayUtils.add(extraTableEditor, reportFitEditor); - } - - @Override - public boolean supportMobileStyle() { - return false; - } - - private CRPropertyDescriptor getReportFitEditor() { - this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); - FitProvider wbTpl = designer.getTarget(); - ReportFitAttr fitAttr = wbTpl.getReportFitAttr(); - ElementCaseEditor editor = this.toData(); - //兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应) - if (editor.getFitStateInPC() == 0) { - editor.setReportFitAttr(null); - } - ReportFitAttr reportFit = editor.getReportFitAttr(); - if(fitAttr != null){ - reportFit = fitAttr.fitInBrowser() ? editor.getReportFitAttr() : fitAttr; - } - ReportFitAttr reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : reportFit; - BrowserFitPropertyEditor browserFitPropertyEditor = new BrowserFitPropertyEditor(); - CRPropertyDescriptor extraEditor = browserFitPropertyEditor.createPropertyDescriptor(this.data.getClass(), reportFitAttr); - if (editor.getReportFitAttr() == null) { - editor.setReportFitInPc(browserFitPropertyEditor.getFitStateInPC(fitAttr)); - } - return extraEditor; - } - - - private CRPropertyDescriptor[] resolveCompatible() { - CRPropertyDescriptor[] extraProperty = new CRPropertyDescriptor[0]; - //这边有个插件兼容问题,之后还是要改回process才行 - Set set = ExtraDesignClassManager.getInstance().getArray(AbstractFormElementCaseEditorProvider.MARK_STRING); - for (FormElementCaseEditorProvider provider : set) { - if (provider == null) { - continue; - } - this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); - FormProvider formProvider = designer.getTarget(); - ElementCaseEditorProvider elementCaseEditorProvider = this.toData(); - PropertyDescriptor[] extraEditor = provider.createPropertyDescriptor(this.data.getClass(), formProvider, elementCaseEditorProvider); - extraProperty = (CRPropertyDescriptor[]) ArrayUtils.addAll(extraProperty, extraEditor); - } - return extraProperty; - } - - @Override - protected String getIconName() { - return "text_field_16.png"; - } - - /** - * 返回组件默认名 - * @return 组件类名(小写) - */ - public String createDefaultName() { - return "report"; - } - - @Override - protected JComponent initEditor() { - if (editor == null) { - setBorder(DEFALUTBORDER); - editor = new JPanel(); - editor.setBackground(null); - editor.setLayout(null); - imageLable = initImageBackground(); - - coverPanel = new CoverReportPane(); - coverPanel.setPreferredSize(imageLable.getPreferredSize()); - coverPanel.setBounds(imageLable.getBounds()); - - editor.add(coverPanel); - coverPanel.setVisible(false); - editor.add(imageLable); - } - return editor; - } - - /** - * 从data中获取到图片背景, 并设置到Label上 - */ - private UILabel initImageBackground(){ - UILabel imageLable = new UILabel(); - BufferedImage image = toData().getECImage(); - if (image == null) { - image = DEFAULT_BACKGROUND; - } - setLabelBackground(image, imageLable); - - return imageLable; - } - - /** - * 设置指定Label的背景 - */ - private void setLabelBackground(Image image, UILabel imageLable){ - ImageIcon icon = new ImageIcon(image); - imageLable.setIcon(icon); - imageLable.setOpaque(true); - imageLable.setLayout(null); - imageLable.setBounds(0, 0, icon.getIconWidth(), icon.getIconHeight()); - } - - @Override - public void paintBorder(Graphics g, Rectangle bounds){ - if (!isHovering) { - super.paintBorder(g, bounds); - } - } - - - /** - * 初始化大小 - * @return 尺寸 - */ - public Dimension initEditorSize() { - return BORDER_PREFERRED_SIZE; - } - - /** - * 是否是报表块 - * @return 是 - */ - public boolean isReport() { - return true; - } - - /** - * 该组件是否可以拖入参数面板 - * @return 是则返回true - */ - public boolean canEnterIntoParaPane(){ - return false; - } - - /** - * 返回报表块对应的widget - * @return 返回ElementCaseEditor - */ - public ElementCaseEditor toData() { - return ((ElementCaseEditor) data); - } - - public FormElementCaseProvider getElementCase() { - return toData().getElementCase(); - } - - public String getElementCaseContainerName() { - return toData().getWidgetName(); - } - - public void setElementCase(FormElementCaseProvider el) { - toData().setElementCase(el); - } - - public void setBackground(BufferedImage image){ - toData().setECImage(image); - setEditorIcon(image); - } - - private void setEditorIcon(BufferedImage image){ - setLabelBackground(image, imageLable); - } - - public Dimension getSize(){ - return new Dimension(this.getWidth(), this.getHeight()); - } - - /** - * 响应点击事件 - * @param editingMouseListener 事件处理器 - * @param e 点击事件 - */ - public void respondClick(EditingMouseListener editingMouseListener,MouseEvent e){ - super.respondClick(editingMouseListener, e); - editingMouseListener.refreshTopXCreator(); - if (this.isShareConfigButtonFocus()) { - CoverReportPane.showShareConfig(((XCreator)this.getParent()).toData()); - } else { - switchTab(e, editingMouseListener); - } - } - - - private void switchTab(MouseEvent e,EditingMouseListener editingMouseListener){ - FormDesigner designer = editingMouseListener.getDesigner(); - if (e.getButton() == MouseEvent.BUTTON1 && - (e.getClickCount() == 2 || designer.getCursor().getType() == Cursor.HAND_CURSOR)){ - FormElementCaseContainerProvider component = (FormElementCaseContainerProvider) designer.getComponentAt(e); - //切换设计器 - designer.switchTab(component); - } - } - - @Override - public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { - return new WidgetPropertyUIProvider[]{ new ElementCasePropertyUI(this)}; - } - - /** - * data属性改变触发其他操作 - * - */ - public void firePropertyChange(){ - initStyle(); - } - - /** - * 是否支持设置可用 - * return boolean - */ - public boolean supportSetEnable(){ - return false; - } - - /** - * 是否支持共享-现只支持报表块、图表、tab块、绝对布局 - * @return - */ - public boolean isSupportShared() { - return true; - } +public class XElementCase extends XBorderStyleWidgetCreator implements FormElementCaseContainerProvider { + private UILabel imageLable; + private FormDesigner designer; + private static BufferedImage DEFAULT_BACKGROUND; + private boolean isHovering = false; + + static { + try { + DEFAULT_BACKGROUND = BaseUtils.readImageWithCache("com/fr/base/images/report/elementcase.png"); + } catch (Throwable e) { + //IBM jdk 1.5.0_22 并发下读取图片有时会异常(EOFException), 这个图片反正只有设计器用到, 捕获住 + DEFAULT_BACKGROUND = CoreGraphHelper.createBufferedImage(0, 0); + } + } + + public XElementCase(ElementCaseEditor widget, Dimension initSize) { + super(widget, initSize); + + + } + + protected void initXCreatorProperties() { + super.initXCreatorProperties(); + + // 报表块初始化时要加载对应的borderStyle + initBorderStyle(); + } + + /** + * 是否支持设置标题 + * @return 是返回true + */ + public boolean hasTitleStyle() { + return true; + } + + /** + * 返回组件属性值 + * @return 返回组件属性值 + * @throws IntrospectionException 异常 + */ + public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { + + CRPropertyDescriptor[] propertyTableEditor = new CRPropertyDescriptor[]{ + new CRPropertyDescriptor("widgetName", this.data.getClass()) + .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Form_Widget_Name")), + new CRPropertyDescriptor("visible", this.data.getClass()).setI18NName( + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Visible")).setPropertyChangeListener(new PropertyChangeAdapter() { + + @Override + public void propertyChange() { + makeVisible(toData().isVisible()); + } + }), + new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( + WLayoutBorderStyleEditor.class).setI18NName( + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced") + .setPropertyChangeListener(new PropertyChangeAdapter() { + + @Override + public void propertyChange() { + initStyle(); + } + }), + new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class) + .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout_Padding")) + .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"), + 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 ArrayUtils.addAll(propertyTableEditor, extraTableEditor); + } + + + public CRPropertyDescriptor[] getExtraTableEditor() { + CRPropertyDescriptor[] extraTableEditor = resolveCompatible(); + CRPropertyDescriptor reportFitEditor = getReportFitEditor(); + if (reportFitEditor == null) { + return extraTableEditor; + } + return ArrayUtils.add(extraTableEditor, reportFitEditor); + } + + @Override + public boolean supportMobileStyle() { + return false; + } + + private CRPropertyDescriptor getReportFitEditor() { + this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); + FitProvider wbTpl = designer.getTarget(); + ReportFitAttr fitAttr = wbTpl.getReportFitAttr(); + ElementCaseEditor editor = this.toData(); + //兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应) + if (editor.getFitStateInPC() == 0) { + editor.setReportFitAttr(null); + } + ReportFitAttr reportFit = editor.getReportFitAttr(); + if (fitAttr != null) { + reportFit = fitAttr.fitInBrowser() ? editor.getReportFitAttr() : fitAttr; + } + ReportFitAttr reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : reportFit; + BrowserFitPropertyEditor browserFitPropertyEditor = new BrowserFitPropertyEditor(); + CRPropertyDescriptor extraEditor = browserFitPropertyEditor.createPropertyDescriptor(this.data.getClass(), reportFitAttr); + if (editor.getReportFitAttr() == null) { + editor.setReportFitInPc(browserFitPropertyEditor.getFitStateInPC(fitAttr)); + } + return extraEditor; + } + + + private CRPropertyDescriptor[] resolveCompatible() { + CRPropertyDescriptor[] extraProperty = new CRPropertyDescriptor[0]; + //这边有个插件兼容问题,之后还是要改回process才行 + Set set = ExtraDesignClassManager.getInstance().getArray(AbstractFormElementCaseEditorProvider.MARK_STRING); + for (FormElementCaseEditorProvider provider : set) { + if (provider == null) { + continue; + } + this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); + FormProvider formProvider = designer.getTarget(); + ElementCaseEditorProvider elementCaseEditorProvider = this.toData(); + PropertyDescriptor[] extraEditor = provider.createPropertyDescriptor(this.data.getClass(), formProvider, elementCaseEditorProvider); + extraProperty = (CRPropertyDescriptor[]) ArrayUtils.addAll(extraProperty, extraEditor); + } + return extraProperty; + } + + @Override + protected String getIconName() { + return "text_field_16.png"; + } + + /** + * 返回组件默认名 + * @return 组件类名(小写) + */ + public String createDefaultName() { + return "report"; + } + + @Override + protected JComponent initEditor() { + if (editor == null) { + setBorder(DEFALUTBORDER); + editor = new JPanel(); + editor.setBackground(null); + editor.setLayout(null); + imageLable = initImageBackground(); + + coverPanel = new CoverReportPane(); + coverPanel.setPreferredSize(imageLable.getPreferredSize()); + coverPanel.setBounds(imageLable.getBounds()); + + editor.add(coverPanel); + coverPanel.setVisible(false); + editor.add(imageLable); + } + return editor; + } + + /** + * 从data中获取到图片背景, 并设置到Label上 + */ + private UILabel initImageBackground() { + UILabel imageLable = new UILabel(); + BufferedImage image = toData().getECImage(); + if (image == null) { + image = DEFAULT_BACKGROUND; + } + setLabelBackground(image, imageLable); + + return imageLable; + } + + /** + * 设置指定Label的背景 + */ + private void setLabelBackground(Image image, UILabel imageLable) { + ImageIcon icon = new ImageIcon(image); + imageLable.setIcon(icon); + imageLable.setOpaque(true); + imageLable.setLayout(null); + imageLable.setBounds(0, 0, icon.getIconWidth(), icon.getIconHeight()); + } + + @Override + public void paintBorder(Graphics g, Rectangle bounds) { + if (!isHovering) { + super.paintBorder(g, bounds); + } + } + + + /** + * 初始化大小 + * @return 尺寸 + */ + public Dimension initEditorSize() { + return BORDER_PREFERRED_SIZE; + } + + /** + * 是否是报表块 + * @return 是 + */ + public boolean isReport() { + return true; + } + + /** + * 该组件是否可以拖入参数面板 + * @return 是则返回true + */ + public boolean canEnterIntoParaPane() { + return false; + } + + /** + * 返回报表块对应的widget + * @return 返回ElementCaseEditor + */ + public ElementCaseEditor toData() { + return ((ElementCaseEditor) data); + } + + public FormElementCaseProvider getElementCase() { + return toData().getElementCase(); + } + + public String getElementCaseContainerName() { + return toData().getWidgetName(); + } + + public void setElementCase(FormElementCaseProvider el) { + toData().setElementCase(el); + } + + public void setBackground(BufferedImage image) { + toData().getElementCaseImage().adjustImageBytes(image); + setEditorIcon(toData().getECImage() == null ? DEFAULT_BACKGROUND : toData().getECImage()); + } + + public static void updateECImage(XCreator creator) { + if (creator instanceof XWTitleLayout) { + XWTitleLayout xwTitleLayout = (XWTitleLayout) creator; + for (int i = 0; i < xwTitleLayout.getComponentCount(); i++) { + Component component = xwTitleLayout.getComponent(i); + if (component instanceof XElementCase) { + XElementCase xElementCase = (XElementCase) component; + xElementCase.toData().getElementCaseImage().updateImage(() -> { + xElementCase.setEditorIcon(xElementCase.toData().getECImage() == null ? DEFAULT_BACKGROUND : xElementCase.toData().getECImage()); + if (xElementCase.designer != null) { + xElementCase.designer.repaint(); + } + }); + } + } + } + } + + + private void setEditorIcon(BufferedImage image) { + setLabelBackground(image, imageLable); + } + + public Dimension getSize() { + return new Dimension(this.getWidth(), this.getHeight()); + } + + /** + * 响应点击事件 + * @param editingMouseListener 事件处理器 + * @param e 点击事件 + */ + public void respondClick(EditingMouseListener editingMouseListener, MouseEvent e) { + super.respondClick(editingMouseListener, e); + editingMouseListener.refreshTopXCreator(); + if (this.isShareConfigButtonFocus()) { + CoverReportPane.showShareConfig(((XCreator) this.getParent()).toData()); + } else { + switchTab(e, editingMouseListener); + } + } + + + private void switchTab(MouseEvent e, EditingMouseListener editingMouseListener) { + FormDesigner designer = editingMouseListener.getDesigner(); + if (e.getButton() == MouseEvent.BUTTON1 && + (e.getClickCount() == 2 || designer.getCursor().getType() == Cursor.HAND_CURSOR)) { + FormElementCaseContainerProvider component = (FormElementCaseContainerProvider) designer.getComponentAt(e); + //切换设计器 + designer.switchTab(component); + } + } + + @Override + public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { + return new WidgetPropertyUIProvider[]{new ElementCasePropertyUI(this)}; + } + + /** + * data属性改变触发其他操作 + * + */ + public void firePropertyChange() { + initStyle(); + } + + /** + * 是否支持设置可用 + * return boolean + */ + public boolean supportSetEnable() { + return false; + } + + /** + * 是否支持共享-现只支持报表块、图表、tab块、绝对布局 + * @return + */ + public boolean isSupportShared() { + return true; + } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java index 32273ca08a..7bab26973b 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -21,6 +21,7 @@ import com.fr.design.mainframe.FormArea; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.form.ui.Connector; +import com.fr.form.ui.ElementCaseImage; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; @@ -335,6 +336,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { for (int i = 0, count = abs.getWidgetCount(); i < count; i++) { BoundsWidget bw = (BoundsWidget) abs.getWidget(i); if (bw != null) { + ElementCaseImage.adjustImageSize(bw); Rectangle bounds = bw.getBounds(); XWidgetCreator comp = (XWidgetCreator) XCreatorUtils.createXCreator(bw.getWidget()); if (!comp.acceptType(XWParameterLayout.class)) { diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java index 6d7aa5d9ff..d6cec98e92 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java @@ -12,6 +12,7 @@ import com.fr.design.mainframe.FormArea; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.utils.gui.LayoutUtils; +import com.fr.form.ui.ElementCaseImage; import com.fr.form.ui.PaddingMargin; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; @@ -683,6 +684,7 @@ public class XWFitLayout extends XLayoutContainer { for (int i=0, num=layout.getWidgetCount(); i Date: Fri, 21 May 2021 15:43:23 +0800 Subject: [PATCH 2/8] =?UTF-8?q?REPORT-51992=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E6=80=A7=E8=83=BD=E6=8F=90=E5=8D=87-=E7=BC=A9=E7=95=A5?= =?UTF-8?q?=E5=9B=BE=E5=8D=A0=E5=86=85=E5=AD=98=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout/FRAbsoluteLayoutAdapter.java | 2 +- .../design/designer/creator/XElementCase.java | 22 ++++++----------- .../designer/creator/XWAbsoluteLayout.java | 2 -- .../design/designer/creator/XWFitLayout.java | 3 --- .../fr/design/mainframe/FormSelection.java | 24 +++++++++++++++++++ 5 files changed, 32 insertions(+), 21 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java index 5326e6f6c2..c18f4f753d 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java @@ -298,7 +298,7 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { WAbsoluteLayout wabs = (WAbsoluteLayout)container.toData(); fix(creator,creator.getX(),creator.getY()); wabs.setBounds(creator.toData(),creator.getBounds()); - XElementCase.updateECImage(creator); + //XElementCase.updateECImage2(creator); XWAbsoluteLayout layout = (XWAbsoluteLayout) container; layout.updateBoundsWidget(creator); } 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 fc2b1d0468..9c459e9868 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 @@ -279,22 +279,14 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme setEditorIcon(toData().getECImage() == null ? DEFAULT_BACKGROUND : toData().getECImage()); } - public static void updateECImage(XCreator creator) { - if (creator instanceof XWTitleLayout) { - XWTitleLayout xwTitleLayout = (XWTitleLayout) creator; - for (int i = 0; i < xwTitleLayout.getComponentCount(); i++) { - Component component = xwTitleLayout.getComponent(i); - if (component instanceof XElementCase) { - XElementCase xElementCase = (XElementCase) component; - xElementCase.toData().getElementCaseImage().updateImage(() -> { - xElementCase.setEditorIcon(xElementCase.toData().getECImage() == null ? DEFAULT_BACKGROUND : xElementCase.toData().getECImage()); - if (xElementCase.designer != null) { - xElementCase.designer.repaint(); - } - }); - } + public void updateECImage() { + XElementCase self = this; + self.toData().getElementCaseImage().updateImage(() -> { + self.setEditorIcon(self.toData().getECImage() == null ? DEFAULT_BACKGROUND : self.toData().getECImage()); + if (self.designer != null) { + self.designer.repaint(); } - } + }); } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java index 7bab26973b..32273ca08a 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -21,7 +21,6 @@ import com.fr.design.mainframe.FormArea; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.form.ui.Connector; -import com.fr.form.ui.ElementCaseImage; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; @@ -336,7 +335,6 @@ public class XWAbsoluteLayout extends XLayoutContainer { for (int i = 0, count = abs.getWidgetCount(); i < count; i++) { BoundsWidget bw = (BoundsWidget) abs.getWidget(i); if (bw != null) { - ElementCaseImage.adjustImageSize(bw); Rectangle bounds = bw.getBounds(); XWidgetCreator comp = (XWidgetCreator) XCreatorUtils.createXCreator(bw.getWidget()); if (!comp.acceptType(XWParameterLayout.class)) { diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java index d6cec98e92..6d7aa5d9ff 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java @@ -12,7 +12,6 @@ import com.fr.design.mainframe.FormArea; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.utils.gui.LayoutUtils; -import com.fr.form.ui.ElementCaseImage; import com.fr.form.ui.PaddingMargin; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; @@ -684,7 +683,6 @@ public class XWFitLayout extends XLayoutContainer { for (int i=0, num=layout.getWidgetCount(); i Date: Fri, 21 May 2021 15:46:25 +0800 Subject: [PATCH 3/8] =?UTF-8?q?REPORT-51992=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E6=80=A7=E8=83=BD=E6=8F=90=E5=8D=87-=E7=BC=A9=E7=95=A5?= =?UTF-8?q?=E5=9B=BE=E5=8D=A0=E5=86=85=E5=AD=98=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../beans/adapters/layout/FRAbsoluteLayoutAdapter.java | 2 +- .../src/main/java/com/fr/start/module/DesignerActivator.java | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java index c18f4f753d..932338a3fd 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java @@ -298,7 +298,7 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { WAbsoluteLayout wabs = (WAbsoluteLayout)container.toData(); fix(creator,creator.getX(),creator.getY()); wabs.setBounds(creator.toData(),creator.getBounds()); - //XElementCase.updateECImage2(creator); + XWAbsoluteLayout layout = (XWAbsoluteLayout) container; layout.updateBoundsWidget(creator); } diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index 44d3628961..5c7a20efca 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -40,7 +40,6 @@ import com.fr.design.javascript.JavaScriptImplPane; import com.fr.design.javascript.ParameterJavaScriptPane; import com.fr.design.javascript.ProcessTransitionAdapter; import com.fr.design.mainframe.BaseJForm; -import com.fr.design.mainframe.ElementCaseThumbnail; import com.fr.design.mainframe.FormHierarchyTreePane; import com.fr.design.mainframe.InformationCollector; import com.fr.design.mainframe.JForm; @@ -404,8 +403,6 @@ public class DesignerActivator extends Activator { DesignModuleFactory.registerParameterReader(new FormParameterReader()); StableFactory.registerMarkedClass(BaseJForm.XML_TAG, JForm.class); - - StableFactory.registerMarkedObject(ElementCaseThumbnailProcessor.MARK_STRING, new ElementCaseThumbnail()); } private static void storePassport() { From 298fab27bf729127d6669aea6d722342f1dd17b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 24 May 2021 09:32:40 +0800 Subject: [PATCH 4/8] =?UTF-8?q?CHART-19344=20=E5=8F=96=E8=89=B2=E5=99=A8?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E7=82=B9=E5=87=BB=E4=B9=8B=E5=90=8E=E7=A1=AE?= =?UTF-8?q?=E5=AE=9A=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/style/color/ColorButton.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorButton.java b/designer-base/src/main/java/com/fr/design/style/color/ColorButton.java index f5f2288ff9..a052f99f13 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorButton.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorButton.java @@ -126,6 +126,11 @@ public class ColorButton extends AbstractSelectBox { public void setVisible(boolean b) { super.setVisible(b); } + + @Override + protected boolean selectRealTime() { + return false; + } }; colorPane.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { From 21f61d5e9239a05138e5ecd9dd427c8cd54f565d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 24 May 2021 14:00:43 +0800 Subject: [PATCH 5/8] =?UTF-8?q?CHART-19306=20=E5=85=AC=E5=BC=8F=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=AD=89=E4=BA=8E=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/style/series/ColorPickerPaneWithMaxMin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/ColorPickerPaneWithMaxMin.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/ColorPickerPaneWithMaxMin.java index 5a0846a188..c6ac36a0cc 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/ColorPickerPaneWithMaxMin.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/ColorPickerPaneWithMaxMin.java @@ -93,9 +93,9 @@ public class ColorPickerPaneWithMaxMin extends ColorPickerPaneWithFormula { private void setTextState(TinyFormulaPane tinyFormulaPane, int index, int maxIndex, String value) { boolean enable = false; if (index == 0) { - value = "∞"; + value = "=∞"; } else if (index == maxIndex) { - value = "-∞"; + value = "=-∞"; } else { enable = true; } From 678bff7a07c604a463ce484d2fb68b4d382587e2 Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 24 May 2021 14:04:27 +0800 Subject: [PATCH 6/8] =?UTF-8?q?REPORT-52699=20=E7=BB=84=E4=BB=B6=E5=A4=8D?= =?UTF-8?q?=E7=94=A8-=E5=90=88=E5=85=A5=E4=B8=BB=E7=89=88=E6=9C=AC-feature?= =?UTF-8?q?=E4=B8=BBjar=EF=BC=8C=E4=B8=80=E4=BA=9B=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E6=8F=92=E4=BB=B6=E6=8E=A7=E4=BB=B6=EF=BC=8C=E5=8F=B3?= =?UTF-8?q?=E4=BE=A7=E7=82=B9=E5=87=BB=E4=BA=8B=E4=BB=B6/=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E7=AB=AF=EF=BC=8C=E6=98=BE=E7=A4=BA=E7=9A=84=E8=BF=98?= =?UTF-8?q?=E6=98=AF=E5=B1=9E=E6=80=A7=E8=AE=BE=E7=BD=AE=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/gui/controlpane/EventPropertyPane.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/gui/controlpane/EventPropertyPane.java b/designer-form/src/main/java/com/fr/design/gui/controlpane/EventPropertyPane.java index 1cebe463f3..25cefe3af3 100644 --- a/designer-form/src/main/java/com/fr/design/gui/controlpane/EventPropertyPane.java +++ b/designer-form/src/main/java/com/fr/design/gui/controlpane/EventPropertyPane.java @@ -166,7 +166,9 @@ public class EventPropertyPane extends UIControlPane implements ListControlPaneP } eventListWrapperPane.setVisible(listSize > 0); } - this.selectNameEdList.setSelectedIndex(0); + if (this.selectNameEdList != null) { + this.selectNameEdList.setSelectedIndex(0); + } this.repaint(); } From 1e7065f9690de99b24cb55ac0cc6531570755f72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 24 May 2021 14:21:55 +0800 Subject: [PATCH 7/8] =?UTF-8?q?CHART-19306=20=20=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=B8=90=E5=8F=98=E8=89=B2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java index 9f4f0ecb73..4f2831b227 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java @@ -1,5 +1,6 @@ package com.fr.van.chart.gauge; +import com.fr.chart.base.ChartConstants; import com.fr.chart.base.GradientStyle; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; @@ -46,6 +47,7 @@ public class VanChartGaugeBeautyPane extends VanChartBeautyPane { }; gradientBarPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); + colorGradient.updateColor(ChartConstants.GRADIENT_START, ChartConstants.GRADIENT_END); return gradientBarPane; } From cd40cde35e57e3f277dc213e211153f22d98ea98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 24 May 2021 14:43:55 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E9=A2=9C=E8=89=B2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java index 4f2831b227..61a1fc5e31 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java @@ -47,7 +47,7 @@ public class VanChartGaugeBeautyPane extends VanChartBeautyPane { }; gradientBarPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); - colorGradient.updateColor(ChartConstants.GRADIENT_START, ChartConstants.GRADIENT_END); + colorGradient.updateColor(ChartConstants.GRADIENT_END, ChartConstants.GRADIENT_START); return gradientBarPane; }