Browse Source

REPORT-4634 组件叠加体验优化=>bug修改=>修复选中form报错的问题

master
plough 7 years ago
parent
commit
ea425ac074
  1. 4
      designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java
  2. 6
      designer_form/src/com/fr/design/mainframe/FormDesigner.java

4
designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java

@ -81,7 +81,9 @@ public class SelectionModel {
// 如果父层是scale和title两个专属容器,返回其父层,组件本身是不让被选中的 // 如果父层是scale和title两个专属容器,返回其父层,组件本身是不让被选中的
if (comp != designer.getRootComponent() && comp != designer.getParaComponent()) { if (comp != designer.getRootComponent() && comp != designer.getParaComponent()) {
XCreator parentContainer = (XCreator) comp.getParent(); XCreator parentContainer = (XCreator) comp.getParent();
comp = parentContainer.isDedicateContainer() ? parentContainer : comp; if (parentContainer != null) {
comp = parentContainer.isDedicateContainer() ? parentContainer : comp;
}
} }
if (selection.removeSelectedCreator(comp) || selection.addSelectedCreator(comp)) { if (selection.removeSelectedCreator(comp) || selection.addSelectedCreator(comp)) {
designer.getEditListenerTable().fireCreatorModified(comp, DesignerEvent.CREATOR_SELECTED); designer.getEditListenerTable().fireCreatorModified(comp, DesignerEvent.CREATOR_SELECTED);

6
designer_form/src/com/fr/design/mainframe/FormDesigner.java

@ -1140,6 +1140,9 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
public boolean isCurrentComponentMovableUp() { public boolean isCurrentComponentMovableUp() {
XCreator creator = getSelectionModel().getSelection().getSelectedCreator(); XCreator creator = getSelectionModel().getSelection().getSelectedCreator();
Container container = creator.getParent(); Container container = creator.getParent();
if (container == null) {
return false;
}
return creator.isMovable() && container.getComponentZOrder(creator) > 0; return creator.isMovable() && container.getComponentZOrder(creator) > 0;
} }
@ -1147,6 +1150,9 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
public boolean isCurrentComponentMovableDown() { public boolean isCurrentComponentMovableDown() {
XCreator creator = getSelectionModel().getSelection().getSelectedCreator(); XCreator creator = getSelectionModel().getSelection().getSelectedCreator();
Container container = creator.getParent(); Container container = creator.getParent();
if (container == null) {
return false;
}
return creator.isMovable() && container.getComponentZOrder(creator) < container.getComponentCount() - 1; return creator.isMovable() && container.getComponentZOrder(creator) < container.getComponentCount() - 1;
} }

Loading…
Cancel
Save