Browse Source

REPORT-6277 & REPORT-6276 绝对布局下设计器界面调整了组件上下位置后,web端预览没有相应的变化;cpt里悬浮元素的位置用快捷键无法使用(暂时隐去快捷键)

master
plough 7 years ago
parent
commit
affdeb43a6
  1. 5
      designer-form/src/com/fr/design/designer/beans/actions/MoveDownAction.java
  2. 5
      designer-form/src/com/fr/design/designer/beans/actions/MoveToBottomAction.java
  3. 5
      designer-form/src/com/fr/design/designer/beans/actions/MoveToTopAction.java
  4. 5
      designer-form/src/com/fr/design/designer/beans/actions/MoveUpAction.java
  5. 8
      designer-form/src/com/fr/design/designer/creator/XLayoutContainer.java
  6. 2
      designer-realize/src/com/fr/design/actions/edit/DeleteAction.java
  7. 2
      designer-realize/src/com/fr/design/actions/edit/order/BringFloatElementForwardAction.java
  8. 2
      designer-realize/src/com/fr/design/actions/edit/order/BringFloatElementToFrontAction.java
  9. 2
      designer-realize/src/com/fr/design/actions/edit/order/SendFloatElementBackwardAction.java
  10. 2
      designer-realize/src/com/fr/design/actions/edit/order/SendFloatElementToBackAction.java

5
designer-form/src/com/fr/design/designer/beans/actions/MoveDownAction.java

@ -3,6 +3,7 @@ package com.fr.design.designer.beans.actions;
import com.fr.base.BaseUtils;
import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormSelection;
import com.fr.general.Inter;
@ -37,13 +38,13 @@ public class MoveDownAction extends FormEditAction {
}
FormSelection selection = designer.getSelectionModel().getSelection();
XCreator creator = selection.getSelectedCreator();
Container container = creator.getParent();
XLayoutContainer container = (XLayoutContainer) creator.getParent();
int targetIndex = container.getComponentZOrder(creator) + 1;
if (targetIndex >= container.getComponentCount()) {
return false;
}
container.setComponentZOrder(creator, targetIndex);
designer.getEditListenerTable().fireCreatorModified(creator, DesignerEvent.CREATOR_DELETED);
designer.getEditListenerTable().fireCreatorModified(creator, DesignerEvent.CREATOR_SELECTED);
return true;
}

5
designer-form/src/com/fr/design/designer/beans/actions/MoveToBottomAction.java

@ -3,6 +3,7 @@ package com.fr.design.designer.beans.actions;
import com.fr.base.BaseUtils;
import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormSelection;
import com.fr.general.Inter;
@ -37,13 +38,13 @@ public class MoveToBottomAction extends FormEditAction {
}
FormSelection selection = designer.getSelectionModel().getSelection();
XCreator creator = selection.getSelectedCreator();
Container container = creator.getParent();
XLayoutContainer container = (XLayoutContainer) creator.getParent();
int targetIndex = container.getComponentCount() - 1;
if (container.getComponentZOrder(creator) >= targetIndex) {
return false;
}
container.setComponentZOrder(creator, targetIndex);
designer.getEditListenerTable().fireCreatorModified(creator, DesignerEvent.CREATOR_DELETED);
designer.getEditListenerTable().fireCreatorModified(creator, DesignerEvent.CREATOR_SELECTED);
return true;
}

5
designer-form/src/com/fr/design/designer/beans/actions/MoveToTopAction.java

@ -3,6 +3,7 @@ package com.fr.design.designer.beans.actions;
import com.fr.base.BaseUtils;
import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormSelection;
import com.fr.general.Inter;
@ -37,12 +38,12 @@ public class MoveToTopAction extends FormEditAction {
}
FormSelection selection = designer.getSelectionModel().getSelection();
XCreator creator = selection.getSelectedCreator();
Container container = creator.getParent();
XLayoutContainer container = (XLayoutContainer) creator.getParent();
if (container.getComponentZOrder(creator) == 0) {
return false;
}
container.setComponentZOrder(creator, 0);
designer.getEditListenerTable().fireCreatorModified(creator, DesignerEvent.CREATOR_DELETED);
designer.getEditListenerTable().fireCreatorModified(creator, DesignerEvent.CREATOR_SELECTED);
return true;
}

5
designer-form/src/com/fr/design/designer/beans/actions/MoveUpAction.java

@ -3,6 +3,7 @@ package com.fr.design.designer.beans.actions;
import com.fr.base.BaseUtils;
import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormSelection;
import com.fr.general.Inter;
@ -36,13 +37,13 @@ public class MoveUpAction extends FormEditAction {
}
FormSelection selection = designer.getSelectionModel().getSelection();
XCreator creator = selection.getSelectedCreator();
Container container = creator.getParent();
XLayoutContainer container = (XLayoutContainer) creator.getParent();
int targetIndex = container.getComponentZOrder(creator) - 1;
if (targetIndex < 0) {
return false;
}
container.setComponentZOrder(creator, targetIndex);
designer.getEditListenerTable().fireCreatorModified(creator, DesignerEvent.CREATOR_DELETED);
designer.getEditListenerTable().fireCreatorModified(creator, DesignerEvent.CREATOR_SELECTED);
return true;
}

8
designer-form/src/com/fr/design/designer/creator/XLayoutContainer.java

@ -126,6 +126,14 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme
return this;
}
public void setComponentZOrder(XCreator creator, int targetIndex) {
super.setComponentZOrder(creator, targetIndex); // 设计器界面上更改
// 以下是数据层更改,会反映到 web 端
WLayout layout = this.toData();
String widgetName = creator.toData().getWidgetName();
layout.setWidgetIndex(layout.getWidget(widgetName), targetIndex);
}
/**
* 当前组件zorder位置替换新的控件
*

2
designer-realize/src/com/fr/design/actions/edit/DeleteAction.java

@ -25,7 +25,7 @@ public class DeleteAction extends ElementCaseAction {
this.setMnemonic('D');
//Richie:删除菜单图标
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/delete.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0));
// this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0));
}
@Override

2
designer-realize/src/com/fr/design/actions/edit/order/BringFloatElementForwardAction.java

@ -27,7 +27,7 @@ public class BringFloatElementForwardAction extends AbstractFloatElementOrderAct
this.setName(Inter.getLocText("M_Edit-Bring_Forward"));
this.setMnemonic('F');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/up.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_CLOSE_BRACKET, DEFAULT_MODIFIER));
// this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_CLOSE_BRACKET, DEFAULT_MODIFIER));
}
@Override

2
designer-realize/src/com/fr/design/actions/edit/order/BringFloatElementToFrontAction.java

@ -28,7 +28,7 @@ public class BringFloatElementToFrontAction extends AbstractFloatElementOrderAct
this.setName(Inter.getLocText("M_Edit-Bring_to_Front"));
this.setMnemonic('T');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/to_top.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_CLOSE_BRACKET, DEFAULT_MODIFIER + InputEvent.ALT_MASK));
// this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_CLOSE_BRACKET, DEFAULT_MODIFIER + InputEvent.ALT_MASK));
}
@Override

2
designer-realize/src/com/fr/design/actions/edit/order/SendFloatElementBackwardAction.java

@ -27,7 +27,7 @@ public class SendFloatElementBackwardAction extends AbstractFloatElementOrderAct
this.setName(Inter.getLocText("M_Edit-Send_Backward"));
this.setMnemonic('B');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/down.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, DEFAULT_MODIFIER));
// this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, DEFAULT_MODIFIER));
}
@Override

2
designer-realize/src/com/fr/design/actions/edit/order/SendFloatElementToBackAction.java

@ -28,7 +28,7 @@ public class SendFloatElementToBackAction extends AbstractFloatElementOrderActio
this.setName(Inter.getLocText("M_Edit-Send_to_Back"));
this.setMnemonic('K');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/to_bottom.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, DEFAULT_MODIFIER + InputEvent.ALT_MASK));
// this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, DEFAULT_MODIFIER + InputEvent.ALT_MASK));
}
@Override

Loading…
Cancel
Save