Browse Source

REPORT-14361 部分操作可能导致AWT EDT线程同步异常

bugfix/10.0
yaoh.wu 6 years ago
parent
commit
dbc09c2781
  1. 2
      designer-base/src/main/java/com/fr/design/parameter/ParaDefinitePane.java
  2. 3
      designer-form/src/main/java/com/fr/design/designer/beans/events/DesignerEditListener.java
  3. 50
      designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java
  4. 8
      designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java
  5. 7
      designer-form/src/main/java/com/fr/design/mainframe/FormHierarchyTreePane.java

2
designer-base/src/main/java/com/fr/design/parameter/ParaDefinitePane.java

@ -1 +1 @@
package com.fr.design.parameter; import com.fr.base.Parameter; public interface ParaDefinitePane { public Parameter[] getNoRepeatParas(Parameter[] paras); public void setParameterArray(Parameter[] ps); public Parameter[] getParameterArray(); public void refreshParameter(); public boolean isWithQueryButton(); public void addingParameter2Editor(Parameter p); public void addingParameter2EditorWithQueryButton(Parameter p); public void addingAllParameter2Editor(); } package com.fr.design.parameter; import com.fr.base.Parameter; public interface ParaDefinitePane { public Parameter[] getNoRepeatParas(Parameter[] paras); public Parameter[] getNoRepeatParas(Parameter[] paras); public Parameter[] getNoRepeatParas(Parameter[] paras); public void setParameterArray(Parameter[] ps); public Parameter[] getNoRepeatParas(Parameter[] paras); public Parameter[] getParameterArray(); public Parameter[] getNoRepeatParas(Parameter[] paras); public void refreshParameter(); public Parameter[] getNoRepeatParas(Parameter[] paras); public boolean isWithQueryButton(); public Parameter[] getNoRepeatParas(Parameter[] paras); public void addingParameter2Editor(Parameter p); public Parameter[] getNoRepeatParas(Parameter[] paras); public void addingParameter2EditorWithQueryButton(Parameter p); void addingAllParameter2Editor(); }

3
designer-form/src/main/java/com/fr/design/designer/beans/events/DesignerEditListener.java

@ -4,8 +4,9 @@ import java.util.EventListener;
/** /**
* 界面设计组件触发的编辑处理器接口 * 界面设计组件触发的编辑处理器接口
* @since 6.5.4 *
* @author richer * @author richer
* @since 6.5.4
*/ */
public interface DesignerEditListener extends EventListener { public interface DesignerEditListener extends EventListener {

50
designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java

@ -3,21 +3,6 @@
*/ */
package com.fr.design.form.parameter; package com.fr.design.form.parameter;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Insets;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPanel;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.parameter.ParameterUI; import com.fr.base.parameter.ParameterUI;
@ -39,7 +24,17 @@ import com.fr.design.designer.creator.XWAbsoluteLayout;
import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.properties.FormWidgetAuthorityEditPane; import com.fr.design.designer.properties.FormWidgetAuthorityEditPane;
import com.fr.design.form.util.XCreatorConstants; import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.mainframe.*; import com.fr.design.mainframe.AuthorityEditPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.FormArea;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormDesignerModeForSpecial;
import com.fr.design.mainframe.FormParaPane;
import com.fr.design.mainframe.FormWidgetDetailPane;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.WidgetToolBarPane;
import com.fr.design.parameter.ParaDefinitePane; import com.fr.design.parameter.ParaDefinitePane;
import com.fr.design.parameter.ParameterDesignerProvider; import com.fr.design.parameter.ParameterDesignerProvider;
import com.fr.design.parameter.ParameterPropertyPane; import com.fr.design.parameter.ParameterPropertyPane;
@ -51,9 +46,23 @@ import com.fr.form.ui.WidgetValue;
import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.form.ui.container.WLayout; import com.fr.form.ui.container.WLayout;
import com.fr.form.ui.container.WParameterLayout; import com.fr.form.ui.container.WParameterLayout;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Insets;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/** /**
* Created by IntelliJ IDEA. * Created by IntelliJ IDEA.
* User : Richer * User : Richer
@ -169,7 +178,10 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
this.getEditListenerTable().addListener(new DesignerEditListener() { this.getEditListenerTable().addListener(new DesignerEditListener() {
@Override @Override
public void fireCreatorModified(DesignerEvent evt) { public void fireCreatorModified(final DesignerEvent evt) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) { if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) {
paraDefinitePane.setParameterArray( paraDefinitePane.setParameterArray(
paraDefinitePane.getNoRepeatParas(DesignModelAdapter.getCurrentModelAdapter().getParameters())); paraDefinitePane.getNoRepeatParas(DesignModelAdapter.getCurrentModelAdapter().getParameters()));
@ -178,6 +190,8 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
} }
}); });
} }
});
}
/** /**
* 包裹一层FormArea * 包裹一层FormArea

8
designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java

@ -71,6 +71,7 @@ import javax.swing.Action;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.TransferHandler; import javax.swing.TransferHandler;
import javax.swing.border.Border; import javax.swing.border.Border;
import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionEvent;
@ -692,7 +693,10 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
getEditListenerTable().addListener(new DesignerEditListener() { getEditListenerTable().addListener(new DesignerEditListener() {
@Override @Override
public void fireCreatorModified(DesignerEvent evt) { public void fireCreatorModified(final DesignerEvent evt) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
// 只有选择组件时不触发模版更新,其他都要触发 // 只有选择组件时不触发模版更新,其他都要触发
if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) { if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) {
FormDesigner.this.fireTargetModified(); FormDesigner.this.fireTargetModified();
@ -706,6 +710,8 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
} }
} }
} }
});
}
}); });

7
designer-form/src/main/java/com/fr/design/mainframe/FormHierarchyTreePane.java

@ -18,12 +18,12 @@ import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef; import com.fr.design.menu.ToolBarDef;
import com.fr.design.parameter.HierarchyTreePane; import com.fr.design.parameter.HierarchyTreePane;
import javax.swing.Action; import javax.swing.Action;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Dimension; import java.awt.Dimension;
@ -103,9 +103,14 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree
formDesigner.addDesignerEditListener(new DesignerEditListener() { formDesigner.addDesignerEditListener(new DesignerEditListener() {
@Override @Override
public void fireCreatorModified(DesignerEvent evt) { public void fireCreatorModified(DesignerEvent evt) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
refreshComponentTree(); refreshComponentTree();
} }
}); });
}
});
ComponentTreeModel treeModel = (ComponentTreeModel) componentTree.getModel(); ComponentTreeModel treeModel = (ComponentTreeModel) componentTree.getModel();
XCreator root = (XCreator) treeModel.getRoot(); XCreator root = (XCreator) treeModel.getRoot();

Loading…
Cancel
Save