Browse Source

REPORT-4634 组件叠加体验优化=>3=>增加4个按钮、快捷键

master
plough 7 years ago
parent
commit
fef4d56036
  1. 4
      designer_base/src/com/fr/design/locale/designer.properties
  2. 4
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  3. 4
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  4. 4
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  5. 6
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  6. 4
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  7. 37
      designer_form/src/com/fr/design/designer/beans/actions/MoveDownAction.java
  8. 37
      designer_form/src/com/fr/design/designer/beans/actions/MoveToBottomAction.java
  9. 37
      designer_form/src/com/fr/design/designer/beans/actions/MoveToTopAction.java
  10. 36
      designer_form/src/com/fr/design/designer/beans/actions/MoveUpAction.java
  11. 8
      designer_form/src/com/fr/design/mainframe/FormDesigner.java
  12. 19
      designer_form/src/com/fr/design/mainframe/FormHierarchyTreePane.java

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

@ -2149,3 +2149,7 @@ 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

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

@ -2148,3 +2148,7 @@ 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

4
designer_base/src/com/fr/design/locale/designer_ja_JP.properties

@ -2149,3 +2149,7 @@ FR-Designer_Decimal_Places=\u5C0F\u6570\u67A0\u6570:
FR-Base-Load_Resource_File=\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u30ED\u30FC\u30C9
FR-Designer_Env_Des_Https=
FR-Designer_Format_JavaScript=Format Code
FR-Designer_Move_Up=
FR-Designer_Move_Down=
FR-Designer_Move_To_Top=
FR-Designer_Move_To_Bottom=

4
designer_base/src/com/fr/design/locale/designer_ko_KR.properties

@ -2149,3 +2149,7 @@ FR-Designer_Export_Background=
FR-Designer_Print_Background=
FR-Designer_Env_Des_Https=
FR-Designer_Format_JavaScript=Format Code
FR-Designer_Move_Up=
FR-Designer_Move_Down=
FR-Designer_Move_To_Top=
FR-Designer_Move_To_Bottom=

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

@ -2148,4 +2148,8 @@ FR-Designer_Sheet_Label_Page_Display_Position=
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_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

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

@ -2148,3 +2148,7 @@ 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

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

@ -0,0 +1,37 @@
package com.fr.design.designer.beans.actions;
import com.fr.base.BaseUtils;
import com.fr.design.mainframe.FormDesigner;
import com.fr.general.Inter;
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;
/**
* 下移一层控件树内
* Created by plough on 2017/12/4.
*/
public class MoveDownAction extends FormEditAction {
public MoveDownAction(FormDesigner t) {
super(t);
this.setName(Inter.getLocText("FR-Designer_Move_Down"));
this.setMnemonic('T');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/down.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, DEFAULT_MODIFIER));
}
@Override
public boolean executeActionReturnUndoRecordNeeded() {
FormDesigner editPane = getEditingComponent();
if (editPane == null) {
return false;
}
return editPane.cut();
}
}

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

@ -0,0 +1,37 @@
package com.fr.design.designer.beans.actions;
import com.fr.base.BaseUtils;
import com.fr.design.mainframe.FormDesigner;
import com.fr.general.Inter;
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;
/**
* 置于底层控件树内
* Created by plough on 2017/12/4.
*/
public class MoveToBottomAction extends FormEditAction {
public MoveToBottomAction(FormDesigner t) {
super(t);
this.setName(Inter.getLocText("FR-Designer_Move_To_Bottom"));
this.setMnemonic('T');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/down.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, DEFAULT_MODIFIER + InputEvent.ALT_MASK));
}
@Override
public boolean executeActionReturnUndoRecordNeeded() {
FormDesigner editPane = getEditingComponent();
if (editPane == null) {
return false;
}
return editPane.cut();
}
}

37
designer_form/src/com/fr/design/designer/beans/actions/MoveToTopAction.java

@ -0,0 +1,37 @@
package com.fr.design.designer.beans.actions;
import com.fr.base.BaseUtils;
import com.fr.design.mainframe.FormDesigner;
import com.fr.general.Inter;
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;
/**
* 置于顶层控件树内
* Created by plough on 2017/12/4.
*/
public class MoveToTopAction extends FormEditAction {
public MoveToTopAction(FormDesigner t) {
super(t);
this.setName(Inter.getLocText("FR-Designer_Move_To_Top"));
this.setMnemonic('T');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/up.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_CLOSE_BRACKET, DEFAULT_MODIFIER + InputEvent.ALT_MASK));
}
@Override
public boolean executeActionReturnUndoRecordNeeded() {
FormDesigner editPane = getEditingComponent();
if (editPane == null) {
return false;
}
return editPane.cut();
}
}

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

@ -0,0 +1,36 @@
package com.fr.design.designer.beans.actions;
import com.fr.base.BaseUtils;
import com.fr.design.mainframe.FormDesigner;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.event.KeyEvent;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
/**
* 同级上移一层控件树内
* Created by plough on 2017/12/4.
*/
public class MoveUpAction extends FormEditAction {
public MoveUpAction(FormDesigner t) {
super(t);
this.setName(Inter.getLocText("FR-Designer_Move_Up"));
this.setMnemonic('T');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/up.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_CLOSE_BRACKET, DEFAULT_MODIFIER));
}
@Override
public boolean executeActionReturnUndoRecordNeeded() {
FormDesigner editPane = getEditingComponent();
if (editPane == null) {
return false;
}
return editPane.cut();
}
}

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

@ -7,10 +7,7 @@ import com.fr.design.DesignState;
import com.fr.design.designer.TargetComponent;
import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.Painter;
import com.fr.design.designer.beans.actions.CopyAction;
import com.fr.design.designer.beans.actions.CutAction;
import com.fr.design.designer.beans.actions.FormDeleteAction;
import com.fr.design.designer.beans.actions.PasteAction;
import com.fr.design.designer.beans.actions.*;
import com.fr.design.designer.beans.adapters.layout.FRParameterLayoutAdapter;
import com.fr.design.designer.beans.events.CreatorEventListenerTable;
import com.fr.design.designer.beans.events.DesignerEditListener;
@ -1129,7 +1126,8 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
public Action[] getActions() {
if (designerActions == null) {
designerActions = new Action[]{new CutAction(this), new CopyAction(this), new PasteAction(this),
new FormDeleteAction(this)};
new FormDeleteAction(this), new MoveToTopAction(this), new MoveToBottomAction(this),
new MoveUpAction(this), new MoveDownAction(this)};
}
return designerActions;
}

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

@ -29,9 +29,10 @@ import java.util.ArrayList;
*/
public class FormHierarchyTreePane extends FormDockView implements HierarchyTreePane {
public static final int NODE_LENGTH = 2;
public static final int PARA = 0;
public static final int BODY = 1;
private static final int NODE_LENGTH = 2;
private static final int PARA = 0;
private static final int BODY = 1;
private static final int SHORTS_SEPARATOR_POS = 4;
private ShortCut4JControlPane[] shorts;
private ComponentTree componentTree;
@ -125,10 +126,6 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree
}
private JPanel getToolBarPane() {
ToolBarDef toolbarDef = new ToolBarDef();
for (ShortCut4JControlPane sj : shorts) {
toolbarDef.addShortCut(sj.getShortCut());
}
UIToolbar toolBar = ToolBarDef.createJToolBar();
toolBar.setUI(new UIToolBarUI(){
@Override
@ -138,7 +135,13 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree
g2.fillRect(0, 0, c.getWidth(), c.getHeight());
}
});
toolbarDef.updateToolBar(toolBar);
for (int i = 0; i < shorts.length; i++) {
if (i == SHORTS_SEPARATOR_POS) {
toolBar.addSeparator(new Dimension(2, 16));
}
shorts[i].getShortCut().intoJToolBar(toolBar);
}
JPanel toolBarPane = new JPanel(new BorderLayout());
toolBarPane.add(toolBar, BorderLayout.CENTER);
return toolBarPane;

Loading…
Cancel
Save