Browse Source

REPORT-30708 单元格配置框不跟随右侧配置按钮

feature/big-screen
Henry.Wang 4 years ago
parent
commit
ca6fce530d
  1. 3
      designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
  2. 3
      designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java
  3. 2
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  4. 42
      designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java

3
designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java

@ -10,6 +10,7 @@ import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.gui.imenu.UIScrollPopUpMenu; import com.fr.design.gui.imenu.UIScrollPopUpMenu;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.GUIPaintUtils; import com.fr.design.utils.gui.GUIPaintUtils;
@ -881,6 +882,8 @@ public class MutilTempalteTabPane extends JComponent {
*/ */
@Override @Override
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
//切换文件后清空FixedPopupPane面板
EastRegionContainerPane.getInstance().clearCurrentPopupPane();
//如果在版本管理情况下,不允许切换tab //如果在版本管理情况下,不允许切换tab
if (DesignerMode.isVcsMode()) { if (DesignerMode.isVcsMode()) {
return; return;

3
designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java

@ -11,6 +11,7 @@ import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.file.FILE; import com.fr.file.FILE;
import com.fr.file.FileNodeFILE; import com.fr.file.FileNodeFILE;
import com.fr.file.filetree.FileNode; import com.fr.file.filetree.FileNode;
@ -83,6 +84,8 @@ public class TemplateTreePane extends JPanel implements FileOperations {
@Override @Override
public void mousePressed(MouseEvent evt) { public void mousePressed(MouseEvent evt) {
if (evt.getClickCount() == 2) { if (evt.getClickCount() == 2) {
//切换文件后清空FixedPopupPane面板
EastRegionContainerPane.getInstance().clearCurrentPopupPane();
openFile(); openFile();
} }
} }

2
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -328,6 +328,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
if (DesignModeContext.isAuthorityEditing()) { if (DesignModeContext.isAuthorityEditing()) {
doResize(); doResize();
} }
//刷新FixedPopupPane的位置
EastRegionContainerPane.getInstance().freshCurrentPopupPane();
} }
}); });
this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);

42
designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java

@ -67,6 +67,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private JPanel leftPane; private JPanel leftPane;
private JPanel rightPane; private JPanel rightPane;
private FixedPopupPane currentPopupPane; private FixedPopupPane currentPopupPane;
private UIButton currentButton;
private static final int CONTAINER_WIDTH = containerWidth(); private static final int CONTAINER_WIDTH = containerWidth();
private static final int TAB_WIDTH = 38; private static final int TAB_WIDTH = 38;
private static final int TAB_BUTTON_WIDTH = 32; private static final int TAB_BUTTON_WIDTH = 32;
@ -495,17 +496,17 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
public void replaceAuthorityEditionPane(JComponent pane) { public void replaceAuthorityEditionPane(JComponent pane) {
propertyItemMap.get(KEY_AUTHORITY_EDITION).replaceContentPane(pane); propertyItemMap.get(KEY_AUTHORITY_EDITION).replaceContentPane(pane);
} }
public JComponent getAuthorityEditionPane() { public JComponent getAuthorityEditionPane() {
return propertyItemMap.get(KEY_AUTHORITY_EDITION).getContentPane(); return propertyItemMap.get(KEY_AUTHORITY_EDITION).getContentPane();
} }
public void replaceConfiguredRolesPane(JComponent pane) { public void replaceConfiguredRolesPane(JComponent pane) {
propertyItemMap.get(KEY_CONFIGURED_ROLES).replaceContentPane(pane); propertyItemMap.get(KEY_CONFIGURED_ROLES).replaceContentPane(pane);
} }
public void replaceKeyPane(final String key, final JComponent pane) { public void replaceKeyPane(final String key, final JComponent pane) {
//需要放到 ui 线程中处理 //需要放到 ui 线程中处理
UIUtil.invokeLaterIfNeeded(new Runnable() { UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override @Override
@ -514,11 +515,11 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
} }
}); });
} }
public JComponent getConfiguredRolesPane() { public JComponent getConfiguredRolesPane() {
return propertyItemMap.get(KEY_CONFIGURED_ROLES).getContentPane(); return propertyItemMap.get(KEY_CONFIGURED_ROLES).getContentPane();
} }
public void addParameterPane(JComponent paraPane) { public void addParameterPane(JComponent paraPane) {
propertyItemMap.get(KEY_WIDGET_SETTINGS).replaceHeaderPane(paraPane); propertyItemMap.get(KEY_WIDGET_SETTINGS).replaceHeaderPane(paraPane);
} }
@ -929,6 +930,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
} else { } else {
hideCurrentPopupPane(); hideCurrentPopupPane();
currentPopupPane = popupPane; currentPopupPane = popupPane;
currentButton = button;
GUICoreUtils.showPopupMenu(popupPane, button, -popupPane.getPreferredSize().width, 0); GUICoreUtils.showPopupMenu(popupPane, button, -popupPane.getPreferredSize().width, 0);
} }
} }
@ -990,6 +992,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
} }
public void menuSelectionChanged(boolean isIncluded) { public void menuSelectionChanged(boolean isIncluded) {
System.out.println("qghdefwqe");
} }
public Container getContentPane() { public Container getContentPane() {
@ -1009,6 +1012,33 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
} }
} }
/**
* @Description:刷新currentPopupPane面板位置当设计器缩放时会调用这个函数
* @param
* @return:
* @Author: Henry.Wang
* @date: 2020/7/30 11:39
*/
public void freshCurrentPopupPane() {
hideCurrentPopupPane();
if (currentPopupPane != null && currentButton != null && currentPopupPane.isVisible()) {
GUICoreUtils.showPopupMenu(currentPopupPane, currentButton, -currentPopupPane.getPreferredSize().width, 0);
}
}
/**
* @Description:清空currentPopupPane数据当切换模板时会调用这个函数
* @param
* @return:
* @Author: Henry.Wang
* @date: 2020/7/30 11:42
*/
public void clearCurrentPopupPane() {
hideCurrentPopupPane();
currentPopupPane = null;
currentButton = null;
}
// 弹出属性面板的工具条 // 弹出属性面板的工具条
private class PopupToolPane extends JPanel { private class PopupToolPane extends JPanel {
private String title; private String title;

Loading…
Cancel
Save