Browse Source

Pull request #6766: REPORT-62275 tab高度弹窗撤销问题

Merge in DESIGN/design from ~FANGLEI/design:release/10.0 to release/10.0

* commit '19b7fcb536e8ef99218cca5827601eeb6c8ea46e':
  REPORT-62275 tab高度弹窗撤销问题
zheng-1641779399395
fanglei 3 years ago
parent
commit
92d1d8b90c
  1. 8
      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. 14
      designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java

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

@ -1,13 +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.ui.util.UIUtil;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.general.ComparatorUtils;
import java.awt.BorderLayout;
@ -68,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;
@ -142,4 +143,12 @@ public class AddingModel {
y + designer.getVerticalScaleValue() - rect.y);
return added;
}
public boolean isAddedIllegal() {
return addedIllegal;
}
public void setAddedIllegal(boolean addedIllegal) {
this.addedIllegal = addedIllegal;
}
}

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

@ -27,19 +27,16 @@ import com.fr.design.mod.bean.ContentChangeItem;
import com.fr.design.mod.event.TableDataModifyEvent;
import com.fr.design.utils.ComponentUtils;
import com.fr.event.EventDispatcher;
import com.fr.form.share.editor.SharableEditorProvider;
import com.fr.form.share.SharableWidgetProvider;
import com.fr.form.share.ShareLoader;
import com.fr.form.share.editor.SharableEditorProvider;
import com.fr.form.ui.Widget;
import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import java.util.Collections;
import java.util.HashMap;
import javax.swing.BorderFactory;
import javax.swing.JWindow;
import java.util.List;
import java.util.Map;
import javax.swing.SwingUtilities;
import java.awt.Color;
import java.awt.Component;
import java.awt.Point;
@ -49,7 +46,10 @@ import java.awt.dnd.DropTarget;
import java.awt.dnd.DropTargetDragEvent;
import java.awt.dnd.DropTargetDropEvent;
import java.awt.dnd.DropTargetEvent;
import javax.swing.SwingUtilities;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 添加模式下鼠标事件处理器
@ -141,7 +141,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);
}
tabDragInner.tryDragIn();
} else {
Toolkit.getDefaultToolkit().beep();

Loading…
Cancel
Save