Browse Source

REPORT-32068 设计器启动黑屏,出现一次,重启后正常

feature/big-screen
hades 5 years ago
parent
commit
ba5c403f7a
  1. 35
      designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java

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

@ -11,6 +11,7 @@ import com.fr.design.gui.ibutton.UIButtonUI;
import com.fr.design.gui.icontainer.UIEastResizableContainer; import com.fr.design.gui.icontainer.UIEastResizableContainer;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.VerticalFlowLayout; import com.fr.design.layout.VerticalFlowLayout;
import com.fr.design.ui.util.UIUtil;
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;
import com.fr.general.FRFont; import com.fr.general.FRFont;
@ -150,12 +151,18 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
public void on(PluginEvent event) { public void on(PluginEvent event) {
PluginContext context = event.getContext(); PluginContext context = event.getContext();
PluginRuntime runtime = context.getRuntime(); PluginRuntime runtime = context.getRuntime();
Set<PropertyItemPaneProvider> providers = runtime.get(PropertyItemPaneProvider.XML_TAG); final Set<PropertyItemPaneProvider> providers = runtime.get(PropertyItemPaneProvider.XML_TAG);
for (PropertyItemPaneProvider provider : providers) { // UI相关的逻辑 用UI线程执行 不走FinePluginController线程 走FinePluginController线程有几率出问题
addPropertyItem(provider); // 容易导致FinePluginController持有Swing内部的java.awt.Component$AWTTreeLock 这个锁不能被UI线程之外的线程持有 否则容易造成UI线程被Blocked住
} UIUtil.invokeLaterIfNeeded(new Runnable() {
updateAllPropertyPane(); @Override
} public void run() {
for (PropertyItemPaneProvider provider : providers) {
addPropertyItem(provider);
}
updateAllPropertyPane();
}
}); }
}, filter); }, filter);
PluginListenerRegistration.getInstance().listen( PluginListenerRegistration.getInstance().listen(
PluginEventType.BeforeStop, PluginEventType.BeforeStop,
@ -164,12 +171,16 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
public void on(PluginEvent event) { public void on(PluginEvent event) {
PluginContext context = event.getContext(); PluginContext context = event.getContext();
PluginRuntime runtime = context.getRuntime(); PluginRuntime runtime = context.getRuntime();
Set<PropertyItemPaneProvider> providers = runtime.get(PropertyItemPaneProvider.XML_TAG); final Set<PropertyItemPaneProvider> providers = runtime.get(PropertyItemPaneProvider.XML_TAG);
for (PropertyItemPaneProvider provider : providers) { UIUtil.invokeLaterIfNeeded(new Runnable() {
removePropertyItem(provider); @Override
public void run() {
} for (PropertyItemPaneProvider provider : providers) {
updateAllPropertyPane(); removePropertyItem(provider);
}
updateAllPropertyPane();
}
});
} }
}, filter); }, filter);
} }

Loading…
Cancel
Save