Browse Source

REPORT-43795 表单拖拽组件有问题,报表块可以通过body拖入参数面板

feature/big-screen
hades 4 years ago
parent
commit
0de544a588
  1. 4
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  2. 9
      designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java

4
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -145,11 +145,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
}
private void initAndStartPlugin() {
// 启动设计器的时候不加载插件内容,插件引擎监听会加载一次
boolean init = (DesignerContext.getDesignerFrame() != null && DesignerContext.getDesignerFrame().isDesignerOpened()) || DesignerEnvManager.getEnvManager().isEmbedServerLazyStartup();
if (init) {
initPluginPane();
}
startListenPlugin();
}

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

@ -4,6 +4,7 @@ import com.fr.design.beans.location.Absorptionline;
import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.HoverPainter;
import com.fr.design.designer.beans.LayoutAdapter;
import com.fr.design.designer.beans.adapters.layout.FRParameterLayoutAdapter;
import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.beans.location.Direction;
import com.fr.design.designer.beans.location.Location;
@ -136,6 +137,14 @@ public class StateModel {
private boolean addBean(XLayoutContainer container, int mouseX, int mouseY) {
LayoutAdapter adapter = container.getLayoutAdapter();
Rectangle rectangleContainer = ComponentUtils.getRelativeBounds(container);
// 判断是否能把控件从表单布局中拖拽到参数面板中
if (adapter instanceof FRParameterLayoutAdapter) {
for (XCreator xCreator : selectionModel.getSelection().getSelectedCreators()) {
if (!xCreator.canEnterIntoParaPane()) {
return false;
}
}
}
if (selectionModel.getSelection().size() == 1) {
return adapter.addBean(selectionModel.getSelection().getSelectedCreator(),
mouseX + designer.getArea().getHorizontalValue() - rectangleContainer.x,

Loading…
Cancel
Save