Browse Source

REPORT-4634 组件叠加体验优化=>1=>控件树中点击图表块自身、绝对布局自身,可退出编辑状态

master
plough 7 years ago
parent
commit
dc75b01e11
  1. 3
      designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java
  2. 5
      designer_form/src/com/fr/design/designer/creator/XChartEditor.java
  3. 8
      designer_form/src/com/fr/design/designer/creator/XCreator.java
  4. 9
      designer_form/src/com/fr/design/mainframe/EditingMouseListener.java
  5. 6
      designer_form/src/com/fr/design/mainframe/FormDesigner.java

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

@ -68,7 +68,10 @@ public class SelectionModel {
} }
// 获取e所在的组件 // 获取e所在的组件
XCreator comp = designer.getComponentAt(e); XCreator comp = designer.getComponentAt(e);
selectACreator(comp);
}
public void selectACreator(XCreator comp) {
//布局组件的顶层布局如不可编辑,要获取其顶层布局 //布局组件的顶层布局如不可编辑,要获取其顶层布局
XLayoutContainer topLayout = XCreatorUtils.getHotspotContainer(comp).getTopLayout(); XLayoutContainer topLayout = XCreatorUtils.getHotspotContainer(comp).getTopLayout();
if (topLayout != null && !topLayout.isEditable()) { if (topLayout != null && !topLayout.isEditable()) {

5
designer_form/src/com/fr/design/designer/creator/XChartEditor.java

@ -76,6 +76,11 @@ public class XChartEditor extends XBorderStyleWidgetCreator {
return true; return true;
} }
@Override
public void stopEditing() {
isEditing = false;
}
/** /**
* 得到属性名 * 得到属性名
* @return 属性名 * @return 属性名

8
designer_form/src/com/fr/design/designer/creator/XCreator.java

@ -653,7 +653,15 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
* *
*/ */
public void firePropertyChange(){ public void firePropertyChange(){
// do nothing
}
/**
* 有的控件是有编辑状态的给一个退出编辑的接口
*
*/
public void stopEditing() {
// do nothing
} }
} }

9
designer_form/src/com/fr/design/mainframe/EditingMouseListener.java

@ -489,6 +489,14 @@ public class EditingMouseListener extends MouseInputAdapter {
return false; return false;
} }
// 点击控件树,会触发此方法。如果在设计器中选中组件,则直接走 processTopLayoutMouseClick
public void stopEditTopLayout(XCreator creator) {
if (clickTopLayout != null && clickTopLayout.equals(creator)) {
clickTopLayout.setEditable(false);
}
processTopLayoutMouseClick(creator);
}
public XCreator processTopLayoutMouseClick(XCreator creator) { public XCreator processTopLayoutMouseClick(XCreator creator) {
XLayoutContainer topLayout = XCreatorUtils.getHotspotContainer(creator).getTopLayout(); XLayoutContainer topLayout = XCreatorUtils.getHotspotContainer(creator).getTopLayout();
if (topLayout != null) { if (topLayout != null) {
@ -589,6 +597,7 @@ public class EditingMouseListener extends MouseInputAdapter {
} }
designer.invalidate(); designer.invalidate();
designer.repaint(); designer.repaint();
currentXCreator.stopEditing();
currentXCreator = null; currentXCreator = null;
currentEditor = null; currentEditor = null;
return true; return true;

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

@ -1240,8 +1240,12 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
public void stopEditing(TreePath path) { public void stopEditing(TreePath path) {
// do nothing // do nothing
XCreator comp = (XCreator) path.getLastPathComponent();
editingMouseListener.stopEditing(); editingMouseListener.stopEditing();
editingMouseListener.processTopLayoutMouseClick((XCreator) path.getLastPathComponent()); editingMouseListener.stopEditTopLayout(comp);
editingMouseListener.getSelectionModel().reset();
editingMouseListener.getSelectionModel().selectACreator(comp);
} }
/** /**

Loading…
Cancel
Save