Browse Source

REPORT-62275 tab高度弹窗撤销问题

bugfix/11.0
方磊 3 years ago
parent
commit
07d4884230
  1. 7
      designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java
  2. 9
      designer-form/src/main/java/com/fr/design/designer/beans/models/AddingModel.java
  3. 2
      designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java

7
designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java

@ -1,12 +1,15 @@
package com.fr.design.designer.beans.adapters.layout;
import com.fr.design.designer.beans.models.AddingModel;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.cardlayout.XWCardTagLayout;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.form.layout.FRBorderLayout;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.general.ComparatorUtils;
import java.awt.BorderLayout;
@ -67,6 +70,10 @@ public class FRCardMainBorderLayoutAdapter extends FRBorderLayoutAdapter {
if (jt != null) {
jt.undoToCurrent();
}
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
AddingModel model = formDesigner.getAddingModel();
model.setAddedIllegal(true);
return true;
} else {
return false;

9
designer-form/src/main/java/com/fr/design/designer/beans/models/AddingModel.java

@ -24,6 +24,7 @@ public class AddingModel {
private int currentX;
private int currentY;
private boolean added;
private boolean addedIllegal = false; // 有时候是添加完成了,但是添加会造成某些控件size不合法,例如tab
public AddingModel(FormDesigner designer, XCreator xCreator) {
this.creator = xCreator;
@ -140,4 +141,12 @@ public class AddingModel {
y + designer.getVerticalScaleValue() - rect.y);
return added;
}
public boolean isAddedIllegal() {
return addedIllegal;
}
public void setAddedIllegal(boolean addedIllegal) {
this.addedIllegal = addedIllegal;
}
}

2
designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java

@ -144,7 +144,9 @@ public class FormCreatorDropTarget extends DropTarget {
designer.getSelectionModel().setSelectedCreators(
FormSelectionUtils.rebuildSelection(xCreator, new Widget[]{widget}));
if (!addingModel.isAddedIllegal()) {
designer.getEditListenerTable().fireCreatorModified(addingModel.getXCreator(), DesignerEvent.CREATOR_ADDED);
}
} else {
Toolkit.getDefaultToolkit().beep();
// 拖入失败 取消选中

Loading…
Cancel
Save