Browse Source

Pull request #6957: REPORT-63322 决策报表及聚合报表,无法拖动组件

Merge in DESIGN/design from ~STARRYI/design:feature/x to feature/x

* commit '99762bf62231dc01547e9481f870db8ac833393a':
  REPORT-63322 决策报表及聚合报表,无法拖动组件
feature/x
starryi 3 years ago
parent
commit
bec217b675
  1. 22
      designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java

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

@ -18,6 +18,7 @@ import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWAbsoluteLayout;
import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.icon.IconPathConstants;
@ -31,12 +32,15 @@ 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.log.FineLoggerFactory;
import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JOptionPane;
import javax.swing.JWindow;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import java.awt.Color;
import java.awt.Component;
import java.awt.Point;
@ -316,6 +320,24 @@ public class FormCreatorDropTarget extends DropTarget {
*/
@Override
public synchronized void drop(DropTargetDropEvent dtde) {
try {
dropXCreator(dtde);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
if (addingModel.getXCreator().isShared()) {
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Share_Drag_Component_Error_Info"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Error"),
JOptionPane.ERROR_MESSAGE,
UIManager.getIcon("OptionPane.errorIcon")
);
}
dtde.rejectDrop();
}
}
private void dropXCreator(DropTargetDropEvent dtde) {
Point loc = dtde.getLocation();
this.adding(designer.getRelativeX(loc.x), designer.getRelativeY(loc.y));
// 放到事件末尾执行

Loading…
Cancel
Save