|
|
@ -18,6 +18,7 @@ import com.fr.design.designer.creator.XLayoutContainer; |
|
|
|
import com.fr.design.designer.creator.XWAbsoluteLayout; |
|
|
|
import com.fr.design.designer.creator.XWAbsoluteLayout; |
|
|
|
import com.fr.design.designer.creator.XWFitLayout; |
|
|
|
import com.fr.design.designer.creator.XWFitLayout; |
|
|
|
import com.fr.design.designer.creator.XWParameterLayout; |
|
|
|
import com.fr.design.designer.creator.XWParameterLayout; |
|
|
|
|
|
|
|
import com.fr.design.file.HistoryTemplateListPane; |
|
|
|
import com.fr.design.form.util.XCreatorConstants; |
|
|
|
import com.fr.design.form.util.XCreatorConstants; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
import com.fr.design.icon.IconPathConstants; |
|
|
|
import com.fr.design.icon.IconPathConstants; |
|
|
@ -25,6 +26,7 @@ import com.fr.design.mainframe.chart.info.ChartInfoCollector; |
|
|
|
import com.fr.design.mod.bean.ChangeItem; |
|
|
|
import com.fr.design.mod.bean.ChangeItem; |
|
|
|
import com.fr.design.mod.bean.ContentChangeItem; |
|
|
|
import com.fr.design.mod.bean.ContentChangeItem; |
|
|
|
import com.fr.design.mod.event.TableDataModifyEvent; |
|
|
|
import com.fr.design.mod.event.TableDataModifyEvent; |
|
|
|
|
|
|
|
import com.fr.design.ui.util.UIUtil; |
|
|
|
import com.fr.design.utils.ComponentUtils; |
|
|
|
import com.fr.design.utils.ComponentUtils; |
|
|
|
import com.fr.event.EventDispatcher; |
|
|
|
import com.fr.event.EventDispatcher; |
|
|
|
import com.fr.form.share.SharableWidgetProvider; |
|
|
|
import com.fr.form.share.SharableWidgetProvider; |
|
|
@ -152,6 +154,9 @@ public class FormCreatorDropTarget extends DropTarget { |
|
|
|
if (creator != null) { |
|
|
|
if (creator != null) { |
|
|
|
creator.setSelected(false); |
|
|
|
creator.setSelected(false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (designer.getAddingModel().isNeedUndoWhenAddingFailed()) { |
|
|
|
|
|
|
|
undoWhenDropFail(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 取消提示
|
|
|
|
// 取消提示
|
|
|
|
designer.setPainter(null); |
|
|
|
designer.setPainter(null); |
|
|
@ -159,6 +164,18 @@ public class FormCreatorDropTarget extends DropTarget { |
|
|
|
designer.stopAddingState(); |
|
|
|
designer.stopAddingState(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void undoWhenDropFail() { |
|
|
|
|
|
|
|
JTemplate<?, ?> jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); |
|
|
|
|
|
|
|
if (jt != null && jt.getUndoManager().canUndo()) { |
|
|
|
|
|
|
|
UIUtil.invokeLaterIfNeeded(new Runnable() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void run() { |
|
|
|
|
|
|
|
jt.undo(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void entering(int x, int y) { |
|
|
|
private void entering(int x, int y) { |
|
|
|
// 将要添加的组件图标移动到鼠标下的位置
|
|
|
|
// 将要添加的组件图标移动到鼠标下的位置
|
|
|
|
addingModel.moveTo(x, y); |
|
|
|
addingModel.moveTo(x, y); |
|
|
|