From b5a2274d48670c946787cb532e22ee10168dddc7 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 1 Jun 2021 16:18:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?KERNEL-7974=20=E7=9C=8B=E4=B8=8B=E6=96=B0?= =?UTF-8?q?=E7=9A=84=E6=8E=A7=E4=BB=B6=E5=BC=8F=E7=BB=84=E4=BB=B6=E5=81=9A?= =?UTF-8?q?=E6=88=90=E6=8F=92=E4=BB=B6=E6=94=AF=E6=8C=81=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E5=BC=80=E6=94=BE=E4=BB=80=E4=B9=88=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/designer/creator/XCreator.java | 8 ++++- .../fr/design/fun/ShareWidgetUIProcessor.java | 29 +++++++++++++++++++ .../impl/AbstractShareWidgetUIProcessor.java | 19 ++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 designer-form/src/main/java/com/fr/design/fun/ShareWidgetUIProcessor.java create mode 100644 designer-form/src/main/java/com/fr/design/fun/impl/AbstractShareWidgetUIProcessor.java diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java index 3cd33d6c34..01d53f850c 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java @@ -5,11 +5,13 @@ package com.fr.design.designer.creator; import com.fr.base.GraphHelper; import com.fr.base.vcs.DesignerMode; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.UpdateAction; import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.ComponentAdapter; import com.fr.design.designer.beans.events.DesignerEditor; import com.fr.design.designer.beans.models.SelectionModel; +import com.fr.design.fun.ShareWidgetUIProcessor; import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.layout.FRGUIPaneFactory; @@ -298,6 +300,10 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo @Override public JComponent createToolPane(BaseJForm jform, FormDesigner formEditor) { if (!DesignerMode.isAuthorityEditing()) { + ShareWidgetUIProcessor exportProcessor = ExtraDesignClassManager.getInstance().getSingle(ShareWidgetUIProcessor.MARK_STRING); + if (exportProcessor != null) { + return exportProcessor.createToolPane(this, jform, formEditor); + } if (isDedicateContainer() && this.getComponentCount() > 0) { // 图表块和报表块由于控件树处不显示,但对应的属性表要显示,此处处理下 XCreator child = ((XLayoutContainer) this).getXCreator(0); @@ -789,7 +795,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo public boolean isTopable() { return true; } - + } diff --git a/designer-form/src/main/java/com/fr/design/fun/ShareWidgetUIProcessor.java b/designer-form/src/main/java/com/fr/design/fun/ShareWidgetUIProcessor.java new file mode 100644 index 0000000000..510b2cddd4 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/fun/ShareWidgetUIProcessor.java @@ -0,0 +1,29 @@ +package com.fr.design.fun; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.mainframe.BaseJForm; +import com.fr.design.mainframe.FormDesigner; +import com.fr.stable.fun.mark.Immutable; + +import javax.swing.JComponent; + + +/** + * Created by kerry on 5/28/21 + */ +public interface ShareWidgetUIProcessor extends Immutable { + + String MARK_STRING = "ShareWidgetUIProcessor"; + + int CURRENT_LEVEL = 1; + + /** + * 生成属性配置界面 + * + * @param xCreator 选中的Xcreator + * @param formDesigner 表单设计器 + * @return 属性配置界面 + */ + JComponent createToolPane(XCreator xCreator, BaseJForm jform, FormDesigner formDesigner); + +} diff --git a/designer-form/src/main/java/com/fr/design/fun/impl/AbstractShareWidgetUIProcessor.java b/designer-form/src/main/java/com/fr/design/fun/impl/AbstractShareWidgetUIProcessor.java new file mode 100644 index 0000000000..e0eddd09d0 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/fun/impl/AbstractShareWidgetUIProcessor.java @@ -0,0 +1,19 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.ShareWidgetUIProcessor; +import com.fr.stable.fun.mark.API; + +/** + * Created by kerry on 5/28/21 + */ +@API(level = ShareWidgetUIProcessor.CURRENT_LEVEL) +public abstract class AbstractShareWidgetUIProcessor implements ShareWidgetUIProcessor { + + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } +} From dcc454b0c6c7b5df8de37d997000dc55fd2202c9 Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 7 Jun 2021 10:15:41 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-53328=20&&=20REPORT-53314=20?= =?UTF-8?q?=E4=BA=A4=E4=BA=92=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controlpane/UIListGroupControlPane.java | 19 ++++++++++++++++--- .../mainframe/FormWidgetDetailPane.java | 6 +++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java index 6e0313ec72..bb7fee0a36 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java @@ -12,6 +12,7 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.widget.EventCreator; import com.fr.form.event.Listener; import com.fr.form.ui.Widget; +import com.fr.general.FRFont; import com.fr.general.NameObject; import com.fr.report.web.util.ReportEngineEventMapping; import com.fr.stable.ArrayUtils; @@ -26,10 +27,13 @@ import javax.swing.event.ListDataEvent; import javax.swing.event.ListDataListener; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; +import java.awt.AlphaComposite; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.FlowLayout; +import java.awt.Graphics; +import java.awt.Graphics2D; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.lang.reflect.Constructor; @@ -456,7 +460,7 @@ public abstract class UIListGroupControlPane extends UIControlPane implements L getHelper().popupEditDialog(null, this.selectNameEdList, this); } - protected String getWrapperLabelText(){ + protected String getWrapperLabelText() { return StringUtils.EMPTY; } @@ -466,9 +470,18 @@ public abstract class UIListGroupControlPane extends UIControlPane implements L public ListWrapperPane(String labelText, UINameEdList nameEdList) { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - UILabel label = new UILabel(labelText + getWrapperLabelText()); + UILabel label = new UILabel(labelText + getWrapperLabelText()) { + @Override + public void paint(Graphics g) { + ((Graphics2D) g).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.7f)); + super.paint(g); + } + }; label.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0)); - label.setBackground(Color.decode("#FFFFFF")); + label.setOpaque(true); + label.setBackground(Color.WHITE); + label.setForeground(Color.decode("#333334")); + label.setFont(label.getFont().deriveFont(10F)); label.setPreferredSize(new Dimension(224, 26)); this.nameEdList = nameEdList; this.add(label, BorderLayout.NORTH); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java index 170704aa6f..8fbc4d06db 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -4,6 +4,7 @@ import com.fr.base.BaseUtils; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane; import com.fr.design.mainframe.share.ui.online.OnlineWidgetRepoPane; @@ -89,7 +90,7 @@ public class FormWidgetDetailPane extends FormDockView{ cardLayout.show(centerPane, paneList.get(newSelectedIndex).getTitle()); } }; - headGroup.setSelectedIndex(ONLINE_TAB); + headGroup.setSelectedIndex(ComponentReuseNotificationInfo.getInstance().isClickedWidgetLib() ? 0 : ONLINE_TAB); this.add(headGroup, BorderLayout.NORTH); this.add(centerPane, BorderLayout.CENTER); } @@ -105,12 +106,11 @@ public class FormWidgetDetailPane extends FormDockView{ } - public void enterWidgetLib() { + public void enterWidgetLib() { EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_LIB); ComponentReuseNotifyUtil.enterWidgetLibExtraAction(false); } - /** * 定位 *