Browse Source

Pull request #5074: REPORT-55629 【组件背景分离】组件复用-控件/组件刚拖入设计画布时,工具栏没加载完全,只显示了一条线,移动鼠标的话才显示正常 && REPORT-55228 【组件背景分离】组件复用-偶现,工具栏会留在设计页面上

Merge in DESIGN/design from ~HADES/design:final/10.0 to final/10.0

* commit 'bace88981dd5994bbbe2e577617df973df797477':
  REPORT-55228 【组件背景分离】组件复用-偶现,工具栏会留在设计页面上
  REPORT-55629 【组件背景分离】组件复用-控件/组件刚拖入设计画布时,工具栏没加载完全,只显示了一条线,移动鼠标的话才显示正常
final/10.0
Kara 3 years ago
parent
commit
df679862db
  1. 3
      designer-base/src/main/java/com/fr/design/PluginClassRefreshManager.java
  2. 7
      designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java

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

@ -27,6 +27,8 @@ public class PluginClassRefreshManager {
private final PluginEventListener pluginAfterRunEventListener = new PluginEventListener() {
@Override
public void on(PluginEvent event) {
// 重载模版之前 触发下hide
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTabChange();
// 兼容之前版本特性
for (String tag : context) {
if (event.getContext().contain(tag)) {
@ -51,6 +53,7 @@ public class PluginClassRefreshManager {
public void on(PluginEvent event) {
PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun, pluginAfterRunEventListener);
if (DesignerLaunchStatus.getStatus() != DesignerLaunchStatus.WORKSPACE_INIT_COMPLETE) {
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTabChange();
HistoryTemplateListCache.getInstance().reloadAllEditingTemplate();
}
}

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

@ -33,6 +33,7 @@ import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.border.Border;
import java.awt.BorderLayout;
import java.awt.Color;
@ -776,11 +777,17 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
}
int extraX = (int) ((bounds.x + bounds.width + SelectedPopupDialog.OFFSET_X) * designer.getScale());
int extraY = (int) (bounds.y * designer.getScale());
// 放到事件尾部执行
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
popup.setLocation(designer.getLocationOnScreen().x + designer.getPaintX() + extraX, designer.getLocationOnScreen().y + designer.getPaintY() + extraY);
popup.updatePane(designer);
popup.setVisible(selected && accept && popup.hasVisibleButtons() && popup.isCanVisible());
popup.setRelativeBounds(bounds);
}
});
}
/**
* 创建右击弹出菜单

Loading…
Cancel
Save