Browse Source

Merge pull request #1521 in BA/design from ~PLOUGH/design:feature/9.0 to feature/9.0

* commit '64b27fe39b48f4ca081b66c970c0c964e38deac2':
  REPORT-4634 组件叠加体验优化=>bug修改=>修复鼠标快速移出,缩略图未关闭的问题
  REPORT-4634 组件叠加体验优化=>bug修改=>修复选中form报错的问题
  REPORT-4634 组件叠加体验优化=>视觉调整=>控件树选中项背景色调整
  REPORT-4634 组件叠加体验优化=>视觉调整=>控件树视觉调整
  REPORT-4634 组件叠加体验优化=>视觉调整=>右键菜单调整
master
superman 7 years ago
parent
commit
78bb299e4d
  1. 6
      designer/src/com/fr/design/actions/edit/DeleteAction.java
  2. 8
      designer/src/com/fr/design/actions/edit/order/BringFloatElementForwardAction.java
  3. 11
      designer/src/com/fr/design/actions/edit/order/BringFloatElementToFrontAction.java
  4. 8
      designer/src/com/fr/design/actions/edit/order/SendFloatElementBackwardAction.java
  5. 9
      designer/src/com/fr/design/actions/edit/order/SendFloatElementToBackAction.java
  6. 17
      designer/src/com/fr/design/actions/utils/DeprecatedActionManager.java
  7. 30
      designer/src/com/fr/grid/selection/FloatSelection.java
  8. 8
      designer_base/src/com/fr/design/locale/designer.properties
  9. 8
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  10. 8
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  11. 8
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  12. 2
      designer_base/src/com/fr/design/utils/ThemeUtils.java
  13. 2
      designer_form/src/com/fr/design/designer/beans/actions/MoveDownAction.java
  14. 2
      designer_form/src/com/fr/design/designer/beans/actions/MoveToBottomAction.java
  15. 2
      designer_form/src/com/fr/design/designer/beans/actions/MoveUpAction.java
  16. 2
      designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java
  17. 4
      designer_form/src/com/fr/design/designer/creator/XCreator.java
  18. 19
      designer_form/src/com/fr/design/mainframe/ComponentTree.java
  19. 6
      designer_form/src/com/fr/design/mainframe/FormDesigner.java
  20. 11
      designer_form/src/com/fr/design/mainframe/FormHierarchyTreePane.java
  21. 2
      designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java

6
designer/src/com/fr/design/actions/edit/DeleteAction.java

@ -8,6 +8,9 @@ import com.fr.design.actions.ElementCaseAction;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import javax.swing.*;
import java.awt.event.KeyEvent;
/** /**
* Delete Row, Column or FloatElement.. * Delete Row, Column or FloatElement..
*/ */
@ -18,10 +21,11 @@ public class DeleteAction extends ElementCaseAction {
public DeleteAction(ElementCasePane t) { public DeleteAction(ElementCasePane t) {
super(t); super(t);
this.setName(Inter.getLocText("M_Edit-Delete") + "..."); this.setName(Inter.getLocText("M_Edit-Delete"));
this.setMnemonic('D'); this.setMnemonic('D');
//Richie:删除菜单图标 //Richie:删除菜单图标
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/delete.png")); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/delete.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0));
} }
@Override @Override

8
designer/src/com/fr/design/actions/edit/order/BringFloatElementForwardAction.java

@ -9,6 +9,11 @@ import com.fr.design.mainframe.ElementCasePane;
import com.fr.report.cell.FloatElement; import com.fr.report.cell.FloatElement;
import com.fr.report.elementcase.ElementCase; import com.fr.report.elementcase.ElementCase;
import javax.swing.*;
import java.awt.event.KeyEvent;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/** /**
* Bring FloatElement forward. * Bring FloatElement forward.
*/ */
@ -21,7 +26,8 @@ public class BringFloatElementForwardAction extends AbstractFloatElementOrderAct
this.setName(Inter.getLocText("M_Edit-Bring_Forward")); this.setName(Inter.getLocText("M_Edit-Bring_Forward"));
this.setMnemonic('F'); this.setMnemonic('F');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/bringForward.png")); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/up.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_CLOSE_BRACKET, DEFAULT_MODIFIER));
} }
@Override @Override

11
designer/src/com/fr/design/actions/edit/order/BringFloatElementToFrontAction.java

@ -9,6 +9,12 @@ import com.fr.design.mainframe.ElementCasePane;
import com.fr.report.cell.FloatElement; import com.fr.report.cell.FloatElement;
import com.fr.report.elementcase.ElementCase; import com.fr.report.elementcase.ElementCase;
import javax.swing.*;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/** /**
* Bring FloatElement to front. * Bring FloatElement to front.
*/ */
@ -20,8 +26,9 @@ public class BringFloatElementToFrontAction extends AbstractFloatElementOrderAct
super(t); super(t);
this.setName(Inter.getLocText("M_Edit-Bring_to_Front")); this.setName(Inter.getLocText("M_Edit-Bring_to_Front"));
this.setMnemonic('t'); this.setMnemonic('T');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/bringToFront.png")); 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));
} }
@Override @Override

8
designer/src/com/fr/design/actions/edit/order/SendFloatElementBackwardAction.java

@ -9,6 +9,11 @@ import com.fr.design.mainframe.ElementCasePane;
import com.fr.report.cell.FloatElement; import com.fr.report.cell.FloatElement;
import com.fr.report.elementcase.ElementCase; import com.fr.report.elementcase.ElementCase;
import javax.swing.*;
import java.awt.event.KeyEvent;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/** /**
* Send FloatElement backward. * Send FloatElement backward.
*/ */
@ -21,7 +26,8 @@ public class SendFloatElementBackwardAction extends AbstractFloatElementOrderAct
this.setName(Inter.getLocText("M_Edit-Send_Backward")); this.setName(Inter.getLocText("M_Edit-Send_Backward"));
this.setMnemonic('B'); this.setMnemonic('B');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/sendBackward.png")); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/down.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, DEFAULT_MODIFIER));
} }
@Override @Override

9
designer/src/com/fr/design/actions/edit/order/SendFloatElementToBackAction.java

@ -9,6 +9,12 @@ import com.fr.design.mainframe.ElementCasePane;
import com.fr.report.cell.FloatElement; import com.fr.report.cell.FloatElement;
import com.fr.report.elementcase.ElementCase; import com.fr.report.elementcase.ElementCase;
import javax.swing.*;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/** /**
* Send FloatElement to back. * Send FloatElement to back.
*/ */
@ -21,7 +27,8 @@ public class SendFloatElementToBackAction extends AbstractFloatElementOrderActio
this.setName(Inter.getLocText("M_Edit-Send_to_Back")); this.setName(Inter.getLocText("M_Edit-Send_to_Back"));
this.setMnemonic('K'); this.setMnemonic('K');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/sendToBack.png")); 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));
} }
@Override @Override

17
designer/src/com/fr/design/actions/utils/DeprecatedActionManager.java

@ -68,23 +68,6 @@ public class DeprecatedActionManager {
return clearMenu; return clearMenu;
} }
/**
* Order menu
*/
public static JMenu getOrderMenu(ElementCasePane ePane) {
JMenu orderMenu = new JMenu(Inter.getLocText("M_Edit-Order"));
orderMenu.setIcon(UIConstants.BLACK_ICON);
orderMenu.setMnemonic('O');
orderMenu.setBackground(UIConstants.NORMAL_BACKGROUND);
orderMenu.add(new BringFloatElementToFrontAction(ePane).createMenuItem());
orderMenu.add(new SendFloatElementToBackAction(ePane).createMenuItem());
orderMenu.add(new BringFloatElementForwardAction(ePane).createMenuItem());
orderMenu.add(new SendFloatElementBackwardAction(ePane).createMenuItem());
return orderMenu;
}
/** /**
* Cell Style. * Cell Style.
*/ */

30
designer/src/com/fr/grid/selection/FloatSelection.java

@ -1,33 +1,35 @@
package com.fr.grid.selection; package com.fr.grid.selection;
import java.awt.Toolkit;
import javax.swing.JPopupMenu;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.actions.cell.CleanAuthorityAction; import com.fr.design.actions.cell.CleanAuthorityAction;
import com.fr.design.actions.cell.FloatStyleAction; import com.fr.design.actions.cell.FloatStyleAction;
import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.edit.*; import com.fr.design.actions.edit.*;
import com.fr.design.actions.utils.DeprecatedActionManager; import com.fr.design.actions.edit.order.BringFloatElementForwardAction;
import com.fr.design.actions.edit.order.BringFloatElementToFrontAction;
import com.fr.design.actions.edit.order.SendFloatElementBackwardAction;
import com.fr.design.actions.edit.order.SendFloatElementToBackAction;
import com.fr.design.cell.clipboard.CellElementsClip; import com.fr.design.cell.clipboard.CellElementsClip;
import com.fr.design.cell.clipboard.ElementsTransferable; import com.fr.design.cell.clipboard.ElementsTransferable;
import com.fr.design.cell.clipboard.FloatElementsClip; import com.fr.design.cell.clipboard.FloatElementsClip;
import com.fr.design.designer.TargetComponent; import com.fr.design.designer.TargetComponent;
import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.mainframe.CellElementPropertyPane; import com.fr.design.mainframe.CellElementPropertyPane;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.ElementCasePane.Clear; import com.fr.design.mainframe.ElementCasePane.Clear;
import com.fr.design.selection.QuickEditor;
import com.fr.design.utils.DesignUtils;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.report.cell.FloatElement; import com.fr.report.cell.FloatElement;
import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.elementcase.TemplateElementCase;
import com.fr.design.selection.QuickEditor;
import com.fr.stable.ColumnRow; import com.fr.stable.ColumnRow;
import com.fr.stable.unit.FU; import com.fr.stable.unit.FU;
import com.fr.stable.unit.OLDPIX; import com.fr.stable.unit.OLDPIX;
import com.fr.design.utils.DesignUtils;
import javax.swing.*;
import java.awt.*;
/** /**
* the float selection * the float selection
* @editor zhou * @editor zhou
@ -120,19 +122,23 @@ public class FloatSelection extends Selection {
popup.add(new CleanAuthorityAction(ePane).createMenuItem()); popup.add(new CleanAuthorityAction(ePane).createMenuItem());
return popup; return popup;
} }
popup.add(DeprecatedActionManager.getCellMenu(ePane).createJMenu());
popup.add(new FloatStyleAction(ePane).createMenuItem()); popup.add(new FloatStyleAction(ePane).createMenuItem());
popup.add(new HyperlinkAction().createMenuItem()); popup.add(new HyperlinkAction().createMenuItem());
// cut, copy and paste // cut, copy and paste
popup.addSeparator(); popup.addSeparator();
popup.add(new CutAction(ePane).createMenuItem()); popup.add(new CutAction(ePane).createMenuItem());
popup.add(new CopyAction(ePane).createMenuItem()); popup.add(new CopyAction(ePane).createMenuItem());
popup.add(new PasteAction(ePane).createMenuItem()); popup.add(new PasteAction(ePane).createMenuItem());
popup.add(new DeleteAction(ePane).createMenuItem()); popup.add(new DeleteAction(ePane).createMenuItem());
popup.addSeparator();
popup.add(new BringFloatElementToFrontAction(ePane).createMenuItem());
popup.add(new SendFloatElementToBackAction(ePane).createMenuItem());
popup.add(new BringFloatElementForwardAction(ePane).createMenuItem());
popup.add(new SendFloatElementBackwardAction(ePane).createMenuItem());
popup.addSeparator(); popup.addSeparator();
popup.add(DeprecatedActionManager.getOrderMenu(ePane));
popup.add(new EditFloatElementNameAction(ePane).createMenuItem()); popup.add(new EditFloatElementNameAction(ePane).createMenuItem());
return popup; return popup;

8
designer_base/src/com/fr/design/locale/designer.properties

@ -2149,10 +2149,10 @@ FR-Designer_Provide_Choose_All=
FR-Designer_Decimal_Places= FR-Designer_Decimal_Places=
FR-Designer_Env_Des_Https=If HTTPS is enabled or the HTTPS configuration (certificate path, HTTPS key) is modified, you must restart the designer to take effect. FR-Designer_Env_Des_Https=If HTTPS is enabled or the HTTPS configuration (certificate path, HTTPS key) is modified, you must restart the designer to take effect.
FR-Designer_Format_JavaScript=Format Code FR-Designer_Format_JavaScript=Format Code
FR-Designer_Move_Up=Move up FR-Designer_Move_Up=Move up(F)
FR-Designer_Move_Down=Move down FR-Designer_Move_Down=Move down(B)
FR-Designer_Move_To_Top=Move to top FR-Designer_Move_To_Top=Move to top(T)
FR-Designer_Move_To_Bottom=Move to bottom FR-Designer_Move_To_Bottom=Move to bottom(K)
FR-Designer_Tab_Style_Template=Style Template FR-Designer_Tab_Style_Template=Style Template
FR-Designer_Tab_Template_One=Template One FR-Designer_Tab_Template_One=Template One
FR-Designer_Tab_Template_Two=Template Two FR-Designer_Tab_Template_Two=Template Two

8
designer_base/src/com/fr/design/locale/designer_en_US.properties

@ -2148,10 +2148,10 @@ FR-Designer_Provide_Choose_All=
FR-Designer_Decimal_Places= FR-Designer_Decimal_Places=
FR-Designer_Env_Des_Https=If HTTPS is enabled or the HTTPS configuration (certificate path, HTTPS key) is modified, you must restart the designer to take effect. FR-Designer_Env_Des_Https=If HTTPS is enabled or the HTTPS configuration (certificate path, HTTPS key) is modified, you must restart the designer to take effect.
FR-Designer_Format_JavaScript=Format Code FR-Designer_Format_JavaScript=Format Code
FR-Designer_Move_Up=Move up FR-Designer_Move_Up=Move up(F)
FR-Designer_Move_Down=Move down FR-Designer_Move_Down=Move down(B)
FR-Designer_Move_To_Top=Move to top FR-Designer_Move_To_Top=Move to top(T)
FR-Designer_Move_To_Bottom=Move to bottom FR-Designer_Move_To_Bottom=Move to bottom(K)
FR-Designer_Tab_Style_Template=Style Template FR-Designer_Tab_Style_Template=Style Template
FR-Designer_Tab_Template_One=Template One FR-Designer_Tab_Template_One=Template One
FR-Designer_Tab_Template_Two=Template Two FR-Designer_Tab_Template_Two=Template Two

8
designer_base/src/com/fr/design/locale/designer_zh_CN.properties

@ -2149,10 +2149,10 @@ FR-Designer_Provide_Choose_All=
FR-Designer_Decimal_Places= FR-Designer_Decimal_Places=
FR-Designer_Env_Des_Https=\u82E5\u542F\u7528https\u6216\u4FEE\u6539https\u914D\u7F6E\uFF08\u8BC1\u4E66\u8DEF\u5F84\u3001https\u79D8\u94A5\uFF09\uFF0C\u5FC5\u987B\u91CD\u542F\u8BBE\u8BA1\u5668\u624D\u80FD\u751F\u6548\u3002 FR-Designer_Env_Des_Https=\u82E5\u542F\u7528https\u6216\u4FEE\u6539https\u914D\u7F6E\uFF08\u8BC1\u4E66\u8DEF\u5F84\u3001https\u79D8\u94A5\uFF09\uFF0C\u5FC5\u987B\u91CD\u542F\u8BBE\u8BA1\u5668\u624D\u80FD\u751F\u6548\u3002
FR-Designer_Format_JavaScript=\u683C\u5F0F\u5316\u4EE3\u7801 FR-Designer_Format_JavaScript=\u683C\u5F0F\u5316\u4EE3\u7801
FR-Designer_Move_Up=\u4E0A\u79FB\u4E00\u5C42 FR-Designer_Move_Up=\u4E0A\u79FB\u4E00\u5C42(F)
FR-Designer_Move_Down=\u4E0B\u79FB\u4E00\u5C42 FR-Designer_Move_Down=\u4E0B\u79FB\u4E00\u5C42(B)
FR-Designer_Move_To_Top=\u7F6E\u4E8E\u9876\u5C42 FR-Designer_Move_To_Top=\u7F6E\u4E8E\u9876\u5C42(T)
FR-Designer_Move_To_Bottom=\u7F6E\u4E8E\u5E95\u5C42 FR-Designer_Move_To_Bottom=\u7F6E\u4E8E\u5E95\u5C42(K)
FR-Designer_Tab_Style_Template=\u6837\u5F0F\u6A21\u677F FR-Designer_Tab_Style_Template=\u6837\u5F0F\u6A21\u677F
FR-Designer_Tab_Template_One=\u6A21\u677F\u4E00 FR-Designer_Tab_Template_One=\u6A21\u677F\u4E00
FR-Designer_Tab_Template_Two=\u6A21\u677F\u4E8C FR-Designer_Tab_Template_Two=\u6A21\u677F\u4E8C

8
designer_base/src/com/fr/design/locale/designer_zh_TW.properties

@ -2148,10 +2148,10 @@ FR-Designer_Provide_Choose_All=
FR-Designer_Decimal_Places= FR-Designer_Decimal_Places=
FR-Designer_Env_Des_Https=\u82E5\u555F\u7528https\u6216\u4FEE\u6539https\u914D\u7F6E\uFF08\u8B49\u66F8\u8DEF\u5F91\u3001https\u7955\u9470\uFF09\uFF0C\u5FC5\u9808\u91CD\u555F\u8A2D\u8A08\u5668\u624D\u80FD\u751F\u6548\u3002 FR-Designer_Env_Des_Https=\u82E5\u555F\u7528https\u6216\u4FEE\u6539https\u914D\u7F6E\uFF08\u8B49\u66F8\u8DEF\u5F91\u3001https\u7955\u9470\uFF09\uFF0C\u5FC5\u9808\u91CD\u555F\u8A2D\u8A08\u5668\u624D\u80FD\u751F\u6548\u3002
FR-Designer_Format_JavaScript=Format Code FR-Designer_Format_JavaScript=Format Code
FR-Designer_Move_Up=\u4E0A\u79FB\u4E00\u5C64 FR-Designer_Move_Up=\u4E0A\u79FB\u4E00\u5C64(F)
FR-Designer_Move_Down=\u4E0B\u79FB\u4E00\u5C64 FR-Designer_Move_Down=\u4E0B\u79FB\u4E00\u5C64(B)
FR-Designer_Move_To_Top=\u7F6E\u65BC\u9802\u5C64 FR-Designer_Move_To_Top=\u7F6E\u65BC\u9802\u5C64(T)
FR-Designer_Move_To_Bottom=\u7F6E\u65BC\u5E95\u5C64 FR-Designer_Move_To_Bottom=\u7F6E\u65BC\u5E95\u5C64(K)
FR-Designer_Tab_Style_Template=\u6A23\u5F0F\u6A21\u677F FR-Designer_Tab_Style_Template=\u6A23\u5F0F\u6A21\u677F
FR-Designer_Tab_Template_One=\u6A21\u677F\u4E00 FR-Designer_Tab_Template_One=\u6A21\u677F\u4E00
FR-Designer_Tab_Template_Two=\u6A21\u677F\u4E8C FR-Designer_Tab_Template_Two=\u6A21\u677F\u4E8C

2
designer_base/src/com/fr/design/utils/ThemeUtils.java

@ -13,7 +13,7 @@ import java.awt.*;
*/ */
public class ThemeUtils { public class ThemeUtils {
public static final ColorUIResource NORMAL_FOREGROUND = new ColorUIResource(0, 0, 0); public static final ColorUIResource NORMAL_FOREGROUND = new ColorUIResource(0, 0, 0);
public static final ColorUIResource TEXT_SELECTED_BG_COLOR = new ColorUIResource(43, 107, 197); public static final ColorUIResource TEXT_SELECTED_BG_COLOR = new ColorUIResource(65, 155, 249);
public static final ColorUIResource TEXT_SELECTED_TEXT_COLOR = new ColorUIResource(255, 255, 255); public static final ColorUIResource TEXT_SELECTED_TEXT_COLOR = new ColorUIResource(255, 255, 255);
public static final ColorUIResource NORMAL_BG = new ColorUIResource(212, 212, 216); public static final ColorUIResource NORMAL_BG = new ColorUIResource(212, 212, 216);
public static final ColorUIResource DISABLE_TEXT = new ColorUIResource(143, 142, 139); public static final ColorUIResource DISABLE_TEXT = new ColorUIResource(143, 142, 139);

2
designer_form/src/com/fr/design/designer/beans/actions/MoveDownAction.java

@ -24,7 +24,7 @@ public class MoveDownAction extends FormEditAction {
public MoveDownAction(FormDesigner t) { public MoveDownAction(FormDesigner t) {
super(t); super(t);
this.setName(Inter.getLocText("FR-Designer_Move_Down")); this.setName(Inter.getLocText("FR-Designer_Move_Down"));
this.setMnemonic('T'); this.setMnemonic('B');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/down.png")); 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));
} }

2
designer_form/src/com/fr/design/designer/beans/actions/MoveToBottomAction.java

@ -24,7 +24,7 @@ public class MoveToBottomAction extends FormEditAction {
public MoveToBottomAction(FormDesigner t) { public MoveToBottomAction(FormDesigner t) {
super(t); super(t);
this.setName(Inter.getLocText("FR-Designer_Move_To_Bottom")); this.setName(Inter.getLocText("FR-Designer_Move_To_Bottom"));
this.setMnemonic('T'); this.setMnemonic('K');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/to_bottom.png")); 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));
} }

2
designer_form/src/com/fr/design/designer/beans/actions/MoveUpAction.java

@ -23,7 +23,7 @@ public class MoveUpAction extends FormEditAction {
public MoveUpAction(FormDesigner t) { public MoveUpAction(FormDesigner t) {
super(t); super(t);
this.setName(Inter.getLocText("FR-Designer_Move_Up")); this.setName(Inter.getLocText("FR-Designer_Move_Up"));
this.setMnemonic('T'); this.setMnemonic('F');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/up.png")); 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));
} }

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

@ -81,8 +81,10 @@ 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();
if (parentContainer != null) {
comp = parentContainer.isDedicateContainer() ? parentContainer : comp; 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);
designer.repaint(); designer.repaint();

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

@ -7,10 +7,10 @@ import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.ComponentAdapter; import com.fr.design.designer.beans.ComponentAdapter;
import com.fr.design.designer.beans.actions.*;
import com.fr.design.designer.beans.events.DesignerEditor; import com.fr.design.designer.beans.events.DesignerEditor;
import com.fr.design.designer.beans.models.SelectionModel; import com.fr.design.designer.beans.models.SelectionModel;
import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.fun.WidgetPropertyUIProvider;
import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.*; import com.fr.design.mainframe.*;
import com.fr.design.utils.gui.LayoutUtils; import com.fr.design.utils.gui.LayoutUtils;
@ -673,7 +673,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
*/ */
public JPopupMenu createPopupMenu(FormDesigner formDesigner) { public JPopupMenu createPopupMenu(FormDesigner formDesigner) {
UpdateAction[] actions = formDesigner.getActions(); UpdateAction[] actions = formDesigner.getActions();
JPopupMenu popup = new JPopupMenu(); JPopupMenu popup = new UIPopupMenu();
for (int i = 0; i < actions.length; i++) { for (int i = 0; i < actions.length; i++) {
if (i == SHORTS_SEPARATOR_POS) { if (i == SHORTS_SEPARATOR_POS) {
popup.addSeparator(); popup.addSeparator();

19
designer_form/src/com/fr/design/mainframe/ComponentTree.java

@ -29,8 +29,8 @@ public class ComponentTree extends JTree {
private ComponentTreeModel model; private ComponentTreeModel model;
private UITreeUI uiTreeUI = new UITreeUI(); private UITreeUI uiTreeUI = new UITreeUI();
private PopupPreviewPane previewPane; private PopupPreviewPane previewPane;
private static final int PADDING_LEFT = 10; private static final int PADDING_LEFT = 5;
private static final int PADDING_TOP = 8; private static final int PADDING_TOP = 5;
public ComponentTree(FormDesigner designer) { public ComponentTree(FormDesigner designer) {
this.designer = designer; this.designer = designer;
@ -42,13 +42,19 @@ public class ComponentTree extends JTree {
this.setDropMode(DropMode.ON_OR_INSERT); this.setDropMode(DropMode.ON_OR_INSERT);
this.setTransferHandler(new TreeTransferHandler()); this.setTransferHandler(new TreeTransferHandler());
this.refreshTreeRoot(); this.refreshTreeRoot();
addTreeSelectionListener(designer); initListeners();
addMouseMotionListener(new ComponetTreeMouseListener(this));
setEditable(true); setEditable(true);
setUI(uiTreeUI); setUI(uiTreeUI);
setBorder(BorderFactory.createEmptyBorder(PADDING_TOP, PADDING_LEFT, 0, 0)); setBorder(BorderFactory.createEmptyBorder(PADDING_TOP, PADDING_LEFT, 0, 0));
} }
private void initListeners() {
this.addTreeSelectionListener(designer);
ComponetTreeMouseListener componetTreeMouseListener = new ComponetTreeMouseListener(this);
this.addMouseMotionListener(componetTreeMouseListener);
this.addMouseListener(componetTreeMouseListener);
}
public FormDesigner getDesigner() { public FormDesigner getDesigner() {
return designer; return designer;
} }
@ -276,6 +282,11 @@ public class ComponentTree extends JTree {
hidePreviewPane(); hidePreviewPane();
} }
} }
@Override
public void mouseExited(MouseEvent e) {
hidePreviewPane();
}
} }
private class PopupPreviewPane extends JPopupMenu { private class PopupPreviewPane extends JPopupMenu {

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;
} }

11
designer_form/src/com/fr/design/mainframe/FormHierarchyTreePane.java

@ -13,6 +13,7 @@ import com.fr.design.gui.controlpane.ShortCut4JControlPane;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.itoolbar.UIToolBarUI; import com.fr.design.gui.itoolbar.UIToolBarUI;
import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.gui.style.BorderPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef; import com.fr.design.menu.ToolBarDef;
@ -33,6 +34,7 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree
private static final int PARA = 0; private static final int PARA = 0;
private static final int BODY = 1; private static final int BODY = 1;
private static final int SHORTS_SEPARATOR_POS = 4; private static final int SHORTS_SEPARATOR_POS = 4;
private static final int TOOLBAR_PADDING_RIGHT = 10;
private ShortCut4JControlPane[] shorts; private ShortCut4JControlPane[] shorts;
private ComponentTree componentTree; private ComponentTree componentTree;
@ -114,12 +116,11 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree
shorts = createShortcuts(); shorts = createShortcuts();
JPanel widgetPane = new JPanel(); JPanel widgetPane = new JPanel();
widgetPane.setBorder(BorderFactory.createLineBorder(UIConstants.RULER_LINE_COLOR));
widgetPane.setLayout(FRGUIPaneFactory.createBorderLayout()); widgetPane.setLayout(FRGUIPaneFactory.createBorderLayout());
widgetPane.add(getToolBarPane(), BorderLayout.CENTER); widgetPane.add(getToolBarPane(), BorderLayout.CENTER);
UIScrollPane scrollPane = new UIScrollPane(componentTree); UIScrollPane scrollPane = new UIScrollPane(componentTree);
scrollPane.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, UIConstants.RULER_LINE_COLOR)); scrollPane.setBorder(BorderFactory.createEmptyBorder());
scrollPane.setPreferredSize(new Dimension(210, 170)); scrollPane.setPreferredSize(new Dimension(210, 170));
widgetPane.add(scrollPane, BorderLayout.SOUTH); widgetPane.add(scrollPane, BorderLayout.SOUTH);
return widgetPane; return widgetPane;
@ -144,7 +145,11 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree
JPanel toolBarPane = new JPanel(new BorderLayout()); JPanel toolBarPane = new JPanel(new BorderLayout());
toolBarPane.add(toolBar, BorderLayout.CENTER); toolBarPane.add(toolBar, BorderLayout.CENTER);
return toolBarPane; toolBarPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.BARNOMAL));
JPanel toolBarPaneWrapper = new JPanel(new BorderLayout());
toolBarPaneWrapper.add(toolBarPane, BorderLayout.CENTER);
toolBarPaneWrapper.setBorder(BorderFactory.createEmptyBorder(1, 0, 2, TOOLBAR_PADDING_RIGHT));
return toolBarPaneWrapper;
} }
protected ShortCut4JControlPane[] createShortcuts() { protected ShortCut4JControlPane[] createShortcuts() {

2
designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java

@ -118,7 +118,7 @@ public class ParameterPropertyPane extends JPanel{
private void setEditor(FormDesigner editor) { private void setEditor(FormDesigner editor) {
if (formHierarchyTreePaneWrapper == null) { if (formHierarchyTreePaneWrapper == null) {
formHierarchyTreePaneWrapper = new JPanel(new BorderLayout()); formHierarchyTreePaneWrapper = new JPanel(new BorderLayout());
formHierarchyTreePaneWrapper.setBorder(BorderFactory.createEmptyBorder(PADDING_MIDDLE, PADDING_MIDDLE, 0, PADDING_MIDDLE)); formHierarchyTreePaneWrapper.setBorder(BorderFactory.createEmptyBorder(0, PADDING_MIDDLE, 0, 0));
this.add(formHierarchyTreePaneWrapper, BorderLayout.SOUTH); this.add(formHierarchyTreePaneWrapper, BorderLayout.SOUTH);
} }
formHierarchyTreePaneWrapper.remove(FormHierarchyTreePane.getInstance()); formHierarchyTreePaneWrapper.remove(FormHierarchyTreePane.getInstance());

Loading…
Cancel
Save