diff --git a/designer/src/com/fr/design/actions/edit/DeleteAction.java b/designer/src/com/fr/design/actions/edit/DeleteAction.java index 01e07a75b..0fe1f7817 100644 --- a/designer/src/com/fr/design/actions/edit/DeleteAction.java +++ b/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.design.mainframe.ElementCasePane; +import javax.swing.*; +import java.awt.event.KeyEvent; + /** * Delete Row, Column or FloatElement.. */ @@ -18,10 +21,11 @@ public class DeleteAction extends ElementCaseAction { public DeleteAction(ElementCasePane t) { super(t); - this.setName(Inter.getLocText("M_Edit-Delete") + "..."); + this.setName(Inter.getLocText("M_Edit-Delete")); 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)); } @Override diff --git a/designer/src/com/fr/design/actions/edit/order/BringFloatElementForwardAction.java b/designer/src/com/fr/design/actions/edit/order/BringFloatElementForwardAction.java index c1ffd413a..2259388d4 100644 --- a/designer/src/com/fr/design/actions/edit/order/BringFloatElementForwardAction.java +++ b/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.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. */ @@ -21,8 +26,9 @@ public class BringFloatElementForwardAction extends AbstractFloatElementOrderAct this.setName(Inter.getLocText("M_Edit-Bring_Forward")); 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 public void orderWithSelectedFloatElement(ElementCase report, diff --git a/designer/src/com/fr/design/actions/edit/order/BringFloatElementToFrontAction.java b/designer/src/com/fr/design/actions/edit/order/BringFloatElementToFrontAction.java index 880abaeec..b50d68306 100644 --- a/designer/src/com/fr/design/actions/edit/order/BringFloatElementToFrontAction.java +++ b/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.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. */ @@ -20,9 +26,10 @@ public class BringFloatElementToFrontAction extends AbstractFloatElementOrderAct super(t); this.setName(Inter.getLocText("M_Edit-Bring_to_Front")); - this.setMnemonic('t'); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/bringToFront.png")); - } + 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)); + } @Override public void orderWithSelectedFloatElement(ElementCase report, diff --git a/designer/src/com/fr/design/actions/edit/order/SendFloatElementBackwardAction.java b/designer/src/com/fr/design/actions/edit/order/SendFloatElementBackwardAction.java index 166a2f79b..e1eedc355 100644 --- a/designer/src/com/fr/design/actions/edit/order/SendFloatElementBackwardAction.java +++ b/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.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. */ @@ -21,8 +26,9 @@ public class SendFloatElementBackwardAction extends AbstractFloatElementOrderAct this.setName(Inter.getLocText("M_Edit-Send_Backward")); 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 public void orderWithSelectedFloatElement(ElementCase report, diff --git a/designer/src/com/fr/design/actions/edit/order/SendFloatElementToBackAction.java b/designer/src/com/fr/design/actions/edit/order/SendFloatElementToBackAction.java index a97ea3fb9..ee8fa31d4 100644 --- a/designer/src/com/fr/design/actions/edit/order/SendFloatElementToBackAction.java +++ b/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.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. */ @@ -21,8 +27,9 @@ 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/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 public void orderWithSelectedFloatElement(ElementCase report, diff --git a/designer/src/com/fr/design/actions/utils/DeprecatedActionManager.java b/designer/src/com/fr/design/actions/utils/DeprecatedActionManager.java index c072b620d..da9054afc 100644 --- a/designer/src/com/fr/design/actions/utils/DeprecatedActionManager.java +++ b/designer/src/com/fr/design/actions/utils/DeprecatedActionManager.java @@ -68,23 +68,6 @@ public class DeprecatedActionManager { 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. */ diff --git a/designer/src/com/fr/grid/selection/FloatSelection.java b/designer/src/com/fr/grid/selection/FloatSelection.java index 17b8ca7aa..0d441a1f7 100644 --- a/designer/src/com/fr/grid/selection/FloatSelection.java +++ b/designer/src/com/fr/grid/selection/FloatSelection.java @@ -1,33 +1,35 @@ package com.fr.grid.selection; -import java.awt.Toolkit; - -import javax.swing.JPopupMenu; - import com.fr.base.BaseUtils; import com.fr.base.FRContext; import com.fr.design.actions.cell.CleanAuthorityAction; import com.fr.design.actions.cell.FloatStyleAction; import com.fr.design.actions.core.ActionFactory; 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.ElementsTransferable; import com.fr.design.cell.clipboard.FloatElementsClip; import com.fr.design.designer.TargetComponent; import com.fr.design.gui.imenu.UIPopupMenu; 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.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.elementcase.TemplateElementCase; -import com.fr.design.selection.QuickEditor; import com.fr.stable.ColumnRow; import com.fr.stable.unit.FU; import com.fr.stable.unit.OLDPIX; -import com.fr.design.utils.DesignUtils; + +import javax.swing.*; +import java.awt.*; /** * the float selection * @editor zhou @@ -120,19 +122,23 @@ public class FloatSelection extends Selection { popup.add(new CleanAuthorityAction(ePane).createMenuItem()); return popup; } - popup.add(DeprecatedActionManager.getCellMenu(ePane).createJMenu()); popup.add(new FloatStyleAction(ePane).createMenuItem()); popup.add(new HyperlinkAction().createMenuItem()); - // cut, copy and paste popup.addSeparator(); + popup.add(new CutAction(ePane).createMenuItem()); popup.add(new CopyAction(ePane).createMenuItem()); popup.add(new PasteAction(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.add(DeprecatedActionManager.getOrderMenu(ePane)); + popup.add(new EditFloatElementNameAction(ePane).createMenuItem()); return popup; diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index 32d7aeae9..935553293 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -2149,10 +2149,10 @@ FR-Designer_Provide_Choose_All= 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_Format_JavaScript=Format Code -FR-Designer_Move_Up=Move up -FR-Designer_Move_Down=Move down -FR-Designer_Move_To_Top=Move to top -FR-Designer_Move_To_Bottom=Move to bottom +FR-Designer_Move_Up=Move up(F) +FR-Designer_Move_Down=Move down(B) +FR-Designer_Move_To_Top=Move to top(T) +FR-Designer_Move_To_Bottom=Move to bottom(K) FR-Designer_Tab_Style_Template=Style Template FR-Designer_Tab_Template_One=Template One FR-Designer_Tab_Template_Two=Template Two @@ -2160,4 +2160,4 @@ FR-Designer_Tab_Template_Three=Template Three FR-Designer_Tab_Template_Four=Template Four FR-Designer_Tab_Template_Five=Template Five FR-Designer_Tab_Template_Six=Template Six -FR-Designer_Tab_Display_Position=Display Position \ No newline at end of file +FR-Designer_Tab_Display_Position=Display Position diff --git a/designer_base/src/com/fr/design/locale/designer_en_US.properties b/designer_base/src/com/fr/design/locale/designer_en_US.properties index 3fb8826af..a6eaa1eba 100644 --- a/designer_base/src/com/fr/design/locale/designer_en_US.properties +++ b/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_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_Move_Up=Move up -FR-Designer_Move_Down=Move down -FR-Designer_Move_To_Top=Move to top -FR-Designer_Move_To_Bottom=Move to bottom +FR-Designer_Move_Up=Move up(F) +FR-Designer_Move_Down=Move down(B) +FR-Designer_Move_To_Top=Move to top(T) +FR-Designer_Move_To_Bottom=Move to bottom(K) FR-Designer_Tab_Style_Template=Style Template FR-Designer_Tab_Template_One=Template One FR-Designer_Tab_Template_Two=Template Two @@ -2159,4 +2159,4 @@ FR-Designer_Tab_Template_Three=Template Three FR-Designer_Tab_Template_Four=Template Four FR-Designer_Tab_Template_Five=Template Five FR-Designer_Tab_Template_Six=Template Six -FR-Designer_Tab_Display_Position=Display Position \ No newline at end of file +FR-Designer_Tab_Display_Position=Display Position diff --git a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties index 7a1252ab6..118187c15 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties +++ b/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_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_Move_Up=\u4E0A\u79FB\u4E00\u5C42 -FR-Designer_Move_Down=\u4E0B\u79FB\u4E00\u5C42 -FR-Designer_Move_To_Top=\u7F6E\u4E8E\u9876\u5C42 -FR-Designer_Move_To_Bottom=\u7F6E\u4E8E\u5E95\u5C42 +FR-Designer_Move_Up=\u4E0A\u79FB\u4E00\u5C42(F) +FR-Designer_Move_Down=\u4E0B\u79FB\u4E00\u5C42(B) +FR-Designer_Move_To_Top=\u7F6E\u4E8E\u9876\u5C42(T) +FR-Designer_Move_To_Bottom=\u7F6E\u4E8E\u5E95\u5C42(K) FR-Designer_Tab_Style_Template=\u6837\u5F0F\u6A21\u677F FR-Designer_Tab_Template_One=\u6A21\u677F\u4E00 FR-Designer_Tab_Template_Two=\u6A21\u677F\u4E8C @@ -2160,4 +2160,4 @@ FR-Designer_Tab_Template_Three=\u6A21\u677F\u4E09 FR-Designer_Tab_Template_Four=\u6A21\u677F\u56DB FR-Designer_Tab_Template_Five=\u6A21\u677F\u4E94 FR-Designer_Tab_Template_Six=\u6A21\u677F\u516D -FR-Designer_Tab_Display_Position=\u663E\u793A\u4F4D\u7F6E \ No newline at end of file +FR-Designer_Tab_Display_Position=\u663E\u793A\u4F4D\u7F6E diff --git a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties index 0cf4cf60a..0df39773e 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties +++ b/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_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_Move_Up=\u4E0A\u79FB\u4E00\u5C64 -FR-Designer_Move_Down=\u4E0B\u79FB\u4E00\u5C64 -FR-Designer_Move_To_Top=\u7F6E\u65BC\u9802\u5C64 -FR-Designer_Move_To_Bottom=\u7F6E\u65BC\u5E95\u5C64 +FR-Designer_Move_Up=\u4E0A\u79FB\u4E00\u5C64(F) +FR-Designer_Move_Down=\u4E0B\u79FB\u4E00\u5C64(B) +FR-Designer_Move_To_Top=\u7F6E\u65BC\u9802\u5C64(T) +FR-Designer_Move_To_Bottom=\u7F6E\u65BC\u5E95\u5C64(K) FR-Designer_Tab_Style_Template=\u6A23\u5F0F\u6A21\u677F FR-Designer_Tab_Template_One=\u6A21\u677F\u4E00 FR-Designer_Tab_Template_Two=\u6A21\u677F\u4E8C @@ -2159,4 +2159,4 @@ FR-Designer_Tab_Template_Three=\u6A21\u677F\u4E09 FR-Designer_Tab_Template_Four=\u6A21\u677F\u56DB FR-Designer_Tab_Template_Five=\u6A21\u677F\u4E94 FR-Designer_Tab_Template_Six=\u6A21\u677F\u516D -FR-Designer_Tab_Display_Position=\u986F\u793A\u4F4D\u7F6E \ No newline at end of file +FR-Designer_Tab_Display_Position=\u986F\u793A\u4F4D\u7F6E diff --git a/designer_base/src/com/fr/design/utils/ThemeUtils.java b/designer_base/src/com/fr/design/utils/ThemeUtils.java index 9f012f2ee..56060edb6 100644 --- a/designer_base/src/com/fr/design/utils/ThemeUtils.java +++ b/designer_base/src/com/fr/design/utils/ThemeUtils.java @@ -13,7 +13,7 @@ import java.awt.*; */ public class ThemeUtils { 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 NORMAL_BG = new ColorUIResource(212, 212, 216); public static final ColorUIResource DISABLE_TEXT = new ColorUIResource(143, 142, 139); diff --git a/designer_form/src/com/fr/design/designer/beans/actions/MoveDownAction.java b/designer_form/src/com/fr/design/designer/beans/actions/MoveDownAction.java index 1fb579c68..95cde265d 100644 --- a/designer_form/src/com/fr/design/designer/beans/actions/MoveDownAction.java +++ b/designer_form/src/com/fr/design/designer/beans/actions/MoveDownAction.java @@ -24,7 +24,7 @@ public class MoveDownAction extends FormEditAction { public MoveDownAction(FormDesigner t) { super(t); 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.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, DEFAULT_MODIFIER)); } diff --git a/designer_form/src/com/fr/design/designer/beans/actions/MoveToBottomAction.java b/designer_form/src/com/fr/design/designer/beans/actions/MoveToBottomAction.java index 2e3041d9a..9fc69953b 100644 --- a/designer_form/src/com/fr/design/designer/beans/actions/MoveToBottomAction.java +++ b/designer_form/src/com/fr/design/designer/beans/actions/MoveToBottomAction.java @@ -24,7 +24,7 @@ public class MoveToBottomAction extends FormEditAction { public MoveToBottomAction(FormDesigner t) { super(t); 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.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, DEFAULT_MODIFIER + InputEvent.ALT_MASK)); } diff --git a/designer_form/src/com/fr/design/designer/beans/actions/MoveUpAction.java b/designer_form/src/com/fr/design/designer/beans/actions/MoveUpAction.java index 3e214a768..512b075d9 100644 --- a/designer_form/src/com/fr/design/designer/beans/actions/MoveUpAction.java +++ b/designer_form/src/com/fr/design/designer/beans/actions/MoveUpAction.java @@ -23,7 +23,7 @@ public class MoveUpAction extends FormEditAction { public MoveUpAction(FormDesigner t) { super(t); 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.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_CLOSE_BRACKET, DEFAULT_MODIFIER)); } diff --git a/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java b/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java index 850539781..850b737a3 100644 --- a/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java @@ -81,7 +81,9 @@ public class SelectionModel { // 如果父层是scale和title两个专属容器,返回其父层,组件本身是不让被选中的 if (comp != designer.getRootComponent() && comp != designer.getParaComponent()) { 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)) { designer.getEditListenerTable().fireCreatorModified(comp, DesignerEvent.CREATOR_SELECTED); diff --git a/designer_form/src/com/fr/design/designer/creator/XCreator.java b/designer_form/src/com/fr/design/designer/creator/XCreator.java index 665db751a..ed234b62a 100644 --- a/designer_form/src/com/fr/design/designer/creator/XCreator.java +++ b/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.designer.beans.AdapterBus; 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.models.SelectionModel; import com.fr.design.fun.WidgetPropertyUIProvider; +import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.*; 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) { UpdateAction[] actions = formDesigner.getActions(); - JPopupMenu popup = new JPopupMenu(); + JPopupMenu popup = new UIPopupMenu(); for (int i = 0; i < actions.length; i++) { if (i == SHORTS_SEPARATOR_POS) { popup.addSeparator(); diff --git a/designer_form/src/com/fr/design/mainframe/ComponentTree.java b/designer_form/src/com/fr/design/mainframe/ComponentTree.java index 6779dfa03..d71623794 100644 --- a/designer_form/src/com/fr/design/mainframe/ComponentTree.java +++ b/designer_form/src/com/fr/design/mainframe/ComponentTree.java @@ -29,8 +29,8 @@ public class ComponentTree extends JTree { private ComponentTreeModel model; private UITreeUI uiTreeUI = new UITreeUI(); private PopupPreviewPane previewPane; - private static final int PADDING_LEFT = 10; - private static final int PADDING_TOP = 8; + private static final int PADDING_LEFT = 5; + private static final int PADDING_TOP = 5; public ComponentTree(FormDesigner designer) { this.designer = designer; @@ -42,13 +42,19 @@ public class ComponentTree extends JTree { this.setDropMode(DropMode.ON_OR_INSERT); this.setTransferHandler(new TreeTransferHandler()); this.refreshTreeRoot(); - addTreeSelectionListener(designer); - addMouseMotionListener(new ComponetTreeMouseListener(this)); + initListeners(); setEditable(true); setUI(uiTreeUI); 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() { return designer; } @@ -276,6 +282,11 @@ public class ComponentTree extends JTree { hidePreviewPane(); } } + + @Override + public void mouseExited(MouseEvent e) { + hidePreviewPane(); + } } private class PopupPreviewPane extends JPopupMenu { diff --git a/designer_form/src/com/fr/design/mainframe/FormDesigner.java b/designer_form/src/com/fr/design/mainframe/FormDesigner.java index dad299c2c..851a2cdee 100644 --- a/designer_form/src/com/fr/design/mainframe/FormDesigner.java +++ b/designer_form/src/com/fr/design/mainframe/FormDesigner.java @@ -1140,6 +1140,9 @@ public class FormDesigner extends TargetComponent