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. 10
      designer/src/com/fr/design/actions/edit/order/BringFloatElementForwardAction.java
  3. 13
      designer/src/com/fr/design/actions/edit/order/BringFloatElementToFrontAction.java
  4. 10
      designer/src/com/fr/design/actions/edit/order/SendFloatElementBackwardAction.java
  5. 11
      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. 10
      designer_base/src/com/fr/design/locale/designer.properties
  9. 10
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  10. 10
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  11. 10
      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. 4
      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.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

10
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,

13
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,

10
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,

11
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,

17
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.
*/

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

10
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
FR-Designer_Tab_Display_Position=Display Position

10
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
FR-Designer_Tab_Display_Position=Display Position

10
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
FR-Designer_Tab_Display_Position=\u663E\u793A\u4F4D\u7F6E

10
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
FR-Designer_Tab_Display_Position=\u986F\u793A\u4F4D\u7F6E

2
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);

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

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

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

4
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);

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.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();

19
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 {

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() {
XCreator creator = getSelectionModel().getSelection().getSelectedCreator();
Container container = creator.getParent();
if (container == null) {
return false;
}
return creator.isMovable() && container.getComponentZOrder(creator) > 0;
}
@ -1147,6 +1150,9 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
public boolean isCurrentComponentMovableDown() {
XCreator creator = getSelectionModel().getSelection().getSelectedCreator();
Container container = creator.getParent();
if (container == null) {
return false;
}
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.itoolbar.UIToolBarUI;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.gui.style.BorderPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.menu.ShortCut;
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 BODY = 1;
private static final int SHORTS_SEPARATOR_POS = 4;
private static final int TOOLBAR_PADDING_RIGHT = 10;
private ShortCut4JControlPane[] shorts;
private ComponentTree componentTree;
@ -114,12 +116,11 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree
shorts = createShortcuts();
JPanel widgetPane = new JPanel();
widgetPane.setBorder(BorderFactory.createLineBorder(UIConstants.RULER_LINE_COLOR));
widgetPane.setLayout(FRGUIPaneFactory.createBorderLayout());
widgetPane.add(getToolBarPane(), BorderLayout.CENTER);
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));
widgetPane.add(scrollPane, BorderLayout.SOUTH);
return widgetPane;
@ -144,7 +145,11 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree
JPanel toolBarPane = new JPanel(new BorderLayout());
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() {

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

@ -118,7 +118,7 @@ public class ParameterPropertyPane extends JPanel{
private void setEditor(FormDesigner editor) {
if (formHierarchyTreePaneWrapper == null) {
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);
}
formHierarchyTreePaneWrapper.remove(FormHierarchyTreePane.getInstance());

Loading…
Cancel
Save