Browse Source

Pull request #4966: REPORT-55212 【组件背景分离】组件复用-tab里的图表块和报表块无法通过点击原本的编辑按钮和双击触发编辑状态 工具栏的编辑按钮可以触发 && REPORT-55228 【组件背景分离】组件复用 打开其他模板 工具栏会留在设计页面上

Merge in DESIGN/design from ~HADES/design:release/10.0 to release/11.0

* commit '31a95fba76ed4608b66da2bb550ab5d0b064ec48':
  REPORT-55228 【组件背景分离】组件复用-打开其他模板 工具栏会留在设计页面上
  REPORT-55212 【组件背景分离】组件复用-tab里的图表块和报表块无法通过点击原本的编辑按钮和双击触发编辑状态 工具栏的编辑按钮可以触发 && REPORT-55228 【组件背景分离】组件复用 打开其他模板 工具栏会留在设计页面上
fix-lag
Hades 3 years ago
parent
commit
0a0379d223
  1. 6
      designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java
  2. 4
      designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java
  3. 27
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java

6
designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java

@ -830,4 +830,10 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
} }
} }
public void hidePopup() {
if (popup != null) {
popup.setVisible(false);
}
}
} }

4
designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java

@ -624,6 +624,8 @@ public class EditingMouseListener extends MouseInputAdapter {
creator = processTopLayoutMouseClick(creator); creator = processTopLayoutMouseClick(creator);
if (creator != null) { if (creator != null) {
// tab块处于未编辑状态
boolean uneditedTab = designer.getCursor().getType() != Cursor.HAND_CURSOR && creator.acceptType(XWCardMainBorderLayout.class) && !((XWCardMainBorderLayout) creator).isEditable();
// 点击不在tab块的button中 // 点击不在tab块的button中
boolean clickedNonCardButton = !creator.acceptType(XCardAddButton.class, XCardSwitchButton.class); boolean clickedNonCardButton = !creator.acceptType(XCardAddButton.class, XCardSwitchButton.class);
if (clickedNonCardButton && e.getClickCount() == 1 && designer.getCursor().getType() != Cursor.HAND_CURSOR) { if (clickedNonCardButton && e.getClickCount() == 1 && designer.getCursor().getType() != Cursor.HAND_CURSOR) {
@ -641,7 +643,7 @@ public class EditingMouseListener extends MouseInputAdapter {
} }
}); });
} else if (clickedNonCardButton && responseTabLayout(oldCreator, e)) { } else if (clickedNonCardButton && uneditedTab && responseTabLayout(oldCreator, e)) {
// do nothing // do nothing
} else { } else {
creator.respondClick(this, e); creator.respondClick(this, e);

27
designer-form/src/main/java/com/fr/design/mainframe/JForm.java

@ -47,8 +47,6 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.form.FormECCompositeProvider; import com.fr.design.mainframe.form.FormECCompositeProvider;
import com.fr.design.mainframe.form.FormECDesignerProvider; import com.fr.design.mainframe.form.FormECDesignerProvider;
import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.mainframe.share.util.ShareComponentUtils;
import com.fr.design.mainframe.template.info.JFormProcessInfo; import com.fr.design.mainframe.template.info.JFormProcessInfo;
import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.design.mainframe.template.info.TemplateProcessInfo;
import com.fr.design.mainframe.toolbar.ToolBarMenuDock; import com.fr.design.mainframe.toolbar.ToolBarMenuDock;
@ -79,10 +77,8 @@ import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.WBorderLayout;
import com.fr.form.ui.container.WLayout; import com.fr.form.ui.container.WLayout;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.json.JSONArray;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.page.PaperSettingProvider; import com.fr.page.PaperSettingProvider;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.report.cell.Elem; import com.fr.report.cell.Elem;
import com.fr.report.cell.cellattr.CellImage; import com.fr.report.cell.cellattr.CellImage;
import com.fr.report.worksheet.FormElementCase; import com.fr.report.worksheet.FormElementCase;
@ -93,6 +89,8 @@ import com.fr.stable.StringUtils;
import com.fr.stable.bridge.StableFactory; import com.fr.stable.bridge.StableFactory;
import com.fr.web.controller.ViewRequestConstants; import com.fr.web.controller.ViewRequestConstants;
import java.awt.event.ContainerAdapter;
import java.awt.event.ContainerEvent;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JComponent; import javax.swing.JComponent;
@ -135,18 +133,36 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
//FORM_TAB代表是否点击编辑,用于点击编辑前后菜单的显示 //FORM_TAB代表是否点击编辑,用于点击编辑前后菜单的显示
protected int index = FORM_TAB; protected int index = FORM_TAB;
private PluginEventListener pluginListener; private ContainerAdapter containerAdapter = new ContainerAdapter() {
@Override
public void componentRemoved(ContainerEvent e) {
// 当前jfrom未在tab中显示时
if (formDesign != null) {
XCreator[] creators = formDesign.getSelectionModel().getSelection().getSelectedCreators();
for (XCreator creator : creators) {
creator.hidePopup();
}
}
}
};
public JForm() { public JForm() {
super(new Form(new WBorderLayout("form")), "Form"); super(new Form(new WBorderLayout("form")), "Form");
init();
} }
public JForm(Form form, FILE file, Parameter[] parameters) { public JForm(Form form, FILE file, Parameter[] parameters) {
super(form, file, parameters); super(form, file, parameters);
init();
} }
public JForm(Form form, FILE file) { public JForm(Form form, FILE file) {
super(form, file); super(form, file);
init();
}
private void init() {
DesignerContext.getDesignerFrame().getCenterTemplateCardPane().addContainerListener(containerAdapter);
} }
@Override @Override
@ -1114,6 +1130,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
public void whenClose() { public void whenClose() {
super.whenClose(); super.whenClose();
this.releaseResources(); this.releaseResources();
DesignerContext.getDesignerFrame().getCenterTemplateCardPane().removeContainerListener(this.containerAdapter);
} }
@Override @Override

Loading…
Cancel
Save