Browse Source

Merge branch 'release/9.0' of http://www.finedevelop.com:2015/scm/~zheng/design into release/9.0

master
fr_shine 7 years ago
parent
commit
40a327882e
  1. 2
      designer/src/com/fr/design/actions/insert/flot/ChartFloatAction.java
  2. 2
      designer/src/com/fr/design/actions/insert/flot/FormulaFloatAction.java
  3. 2
      designer/src/com/fr/design/actions/insert/flot/ImageFloatAction.java
  4. 2
      designer/src/com/fr/design/actions/insert/flot/TextBoxFloatAction.java
  5. 2
      designer/src/com/fr/design/mainframe/ReportFloatPane.java
  6. 13
      designer/src/com/fr/start/ReportSplashPane.java
  7. 17
      designer_base/src/com/fr/design/actions/UpdateAction.java
  8. 3
      designer_base/src/com/fr/design/actions/help/AboutPane.java
  9. 1
      designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java
  10. 103
      designer_base/src/com/fr/design/gui/imenu/UIMenuEastAttrItem.java
  11. 2
      designer_base/src/com/fr/design/gui/imenu/UIMenuItem.java
  12. 28
      designer_base/src/com/fr/design/gui/imenu/UIPopupEastAttrMenu.java
  13. 4
      designer_base/src/com/fr/design/gui/imenu/UIPopupMenu.java
  14. 2
      designer_base/src/com/fr/design/locale/designer.properties
  15. 2
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  16. 8
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  17. 7
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  18. 4
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  19. 4
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  20. 734
      designer_base/src/com/fr/design/menu/MenuDef.java

2
designer/src/com/fr/design/actions/insert/flot/ChartFloatAction.java

@ -36,7 +36,7 @@ public class ChartFloatAction extends ElementCaseAction {
public ChartFloatAction(ElementCasePane t) {
super(t);
this.setMenuKeySet(FLOAT_INSERT_CHART);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/chart.png"));
}

2
designer/src/com/fr/design/actions/insert/flot/FormulaFloatAction.java

@ -27,7 +27,7 @@ public class FormulaFloatAction extends AbstractShapeAction {
public FormulaFloatAction(ElementCasePane t) {
super(t);
this.setMenuKeySet(FLOAT_INSERT_FORMULA);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/formula.png"));
}

2
designer/src/com/fr/design/actions/insert/flot/ImageFloatAction.java

@ -34,7 +34,7 @@ public class ImageFloatAction extends ElementCaseAction {
public ImageFloatAction(ElementCasePane t) {
super(t);
this.setMenuKeySet(FLOAT_INSERT_IMAGE);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/image.png"));
}

2
designer/src/com/fr/design/actions/insert/flot/TextBoxFloatAction.java

@ -26,7 +26,7 @@ public class TextBoxFloatAction extends AbstractShapeAction {
public TextBoxFloatAction(ElementCasePane t) {
super(t);
this.setMenuKeySet(FLOAT_INSERT_TEXT);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/text.png"));
}

2
designer/src/com/fr/design/mainframe/ReportFloatPane.java

@ -67,7 +67,7 @@ public class ReportFloatPane extends JPanel {
}
private MenuDef createInsertToolBar() {
MenuDef insertFloatMenu = new MenuDef();
MenuDef insertFloatMenu = new MenuDef(true);
insertFloatMenu.setName(KeySetUtils.INSERT_FLOAT.getMenuKeySetName());
insertFloatMenu.setTooltip(Inter.getLocText("FR-Designer_T_Insert_Float"));
insertFloatMenu.setIconPath("com/fr/design/images/control/addPopup.png");

13
designer/src/com/fr/start/ReportSplashPane.java

@ -8,9 +8,11 @@ import com.fr.base.FRContext;
import com.fr.base.GraphHelper;
import com.fr.design.mainframe.bbs.BBSConstants;
import com.fr.general.GeneralContext;
import com.fr.general.Inter;
import com.fr.general.ModuleContext;
import com.fr.stable.*;
import com.fr.stable.Constants;
import com.fr.stable.CoreGraphHelper;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.module.ModuleAdapter;
import com.fr.stable.module.ModuleListener;
@ -117,13 +119,6 @@ public class ReportSplashPane extends SplashPane{
//加载模块信息
double y = MODULE_INFO_Y + height + leading + ascent;
GraphHelper.drawString(splashG2d, showText, MODULE_INFO_X, y);
//每次随机感谢一位论坛用户
if (shouldShowThanks()) {
splashG2d.setPaint(THANK_COLOR);
String content = Inter.getLocText("FR-Designer_Thanks-To") + GUEST;
GraphHelper.drawString(splashG2d, content, THANK_INFO_X, y);
}
}
// 是否显示鸣谢文字

17
designer_base/src/com/fr/design/actions/UpdateAction.java

@ -9,8 +9,7 @@ import com.fr.base.Style;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.imenu.UICheckBoxMenuItem;
import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.gui.imenu.*;
import com.fr.design.menu.ShortCut;
import com.fr.design.selection.SelectionListener;
import com.fr.general.ComparatorUtils;
@ -249,10 +248,17 @@ public abstract class UpdateAction extends ShortCut implements Action {
this.putValue(UIMenuItem.class.getName(), object);
}
return (UIMenuItem) object;
}
public UIMenuEastAttrItem createMenuItemEastAttr() {
UIMenuEastAttrItem menuItem = new UIMenuEastAttrItem(this);
// 设置名字用作单元测
menuItem.setName(getName());
this.putValue(UIMenuItem.class.getName(), menuItem);
return menuItem;
}
/**
* Gets component on toolbar.
*
@ -317,7 +323,10 @@ public abstract class UpdateAction extends ShortCut implements Action {
@Override
public void intoJPopupMenu(JPopupMenu menu) {
update();
if (menu instanceof UIPopupEastAttrMenu){
menu.add(this.createMenuItemEastAttr());
return;
}
menu.add(this.createMenuItem());
}

3
designer_base/src/com/fr/design/actions/help/AboutPane.java

@ -82,9 +82,6 @@ public class AboutPane extends JPanel {
contentPane.add(actionLabel);
contentPane.add(emailLabel);
if (shouldShowThanks()) {
addThankPane(contentPane);
}
}
// 是否显示服务电话和 qq

1
designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java

@ -488,6 +488,7 @@ public abstract class UIListControlPane extends UIControlPane {
*/
protected class AddItemMenuDef extends MenuDef {
public AddItemMenuDef(NameableCreator[] creators) {
super(true);
this.setName(Inter.getLocText("FR-Action_Add"));
this.setMnemonic('A');
this.setIconPath("/com/fr/design/images/control/addPopup.png");

103
designer_base/src/com/fr/design/gui/imenu/UIMenuEastAttrItem.java

@ -0,0 +1,103 @@
package com.fr.design.gui.imenu;
import com.fr.design.constants.UIConstants;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import sun.swing.SwingUtilities2;
import javax.swing.*;
import javax.swing.plaf.basic.BasicMenuItemUI;
import java.awt.*;
/**
* 右侧属性面板悬浮元素超级链接弹窗重绘
*/
public class UIMenuEastAttrItem extends JMenuItem {
public UIMenuEastAttrItem() {
this(StringUtils.BLANK);
}
public UIMenuEastAttrItem(String string) {
this(string, null);
}
public UIMenuEastAttrItem(String string, Icon pageSmallIcon) {
super(string, pageSmallIcon);
setBackground(UIConstants.NORMAL_BACKGROUND);
setUI(new UIMenuItemEastAttrUI());
}
public UIMenuEastAttrItem(String string, int key) {
super(string, key);
setBackground(UIConstants.NORMAL_BACKGROUND);
setUI(new UIMenuItemEastAttrUI());
}
public UIMenuEastAttrItem(Action action) {
this();
setAction(action);
}
@Override
public String getText() {
return StringUtils.BLANK + super.getText();
}
private class UIMenuItemEastAttrUI extends BasicMenuItemUI {
@Override
protected void paintBackground(Graphics g, JMenuItem menuItem,Color bgColor) {
if(menuItem.getIcon() != null) {
menuItem.setIcon(null);
}
ButtonModel model = menuItem.getModel();
Color oldColor = g.getColor();
int menuWidth = menuItem.getWidth();
int menuHeight = menuItem.getHeight();
g.setColor(UIConstants.NORMAL_BACKGROUND);
g.fillRect(0, 0, menuWidth, menuHeight);
if (menuItem.isOpaque()) {
if (model.isArmed() || (menuItem instanceof JMenu && model.isSelected())) {
GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 0);
} else {
GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, UIConstants.TOOLBARUI_BACKGROUND, 0);
}
g.setColor(oldColor);
}
else if (model.isArmed() || (menuItem instanceof JMenu &&
model.isSelected())) {
GUIPaintUtils.fillPaint((Graphics2D)g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7);
g.setColor(oldColor);
}
}
protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text) {
ButtonModel model = menuItem.getModel();
FontMetrics fm = SwingUtilities2.getFontMetrics(menuItem, g);
if(!model.isEnabled()) {
// *** paint the text disabled
if ( UIManager.get("MenuItem.disabledForeground") instanceof Color ) {
g.setColor( UIManager.getColor("MenuItem.disabledForeground") );
SwingUtilities2.drawStringUnderlineCharAt(menuItem, g,text,
-1, textRect.x, textRect.y + fm.getAscent());
} else {
g.setColor(menuItem.getBackground().brighter());
SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text,
-1, textRect.x, textRect.y + fm.getAscent());
g.setColor(menuItem.getBackground().darker());
SwingUtilities2.drawStringUnderlineCharAt(menuItem, g,text,
-1, textRect.x - 1, textRect.y +
fm.getAscent() - 1);
}
} else {
SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text,
-1, 0, textRect.y + fm.getAscent());
}
}
}
}

2
designer_base/src/com/fr/design/gui/imenu/UIMenuItem.java

@ -37,7 +37,7 @@ public class UIMenuItem extends JMenuItem{
this();
setAction(action);
}
@Override
public String getText() {
return StringUtils.BLANK + super.getText();

28
designer_base/src/com/fr/design/gui/imenu/UIPopupEastAttrMenu.java

@ -0,0 +1,28 @@
package com.fr.design.gui.imenu;
import java.awt.Graphics;
import java.awt.Insets;
import javax.swing.JPopupMenu;
import com.fr.design.constants.UIConstants;
public class UIPopupEastAttrMenu extends JPopupMenu {
public UIPopupEastAttrMenu() {
super();
setBackground(UIConstants.NORMAL_BACKGROUND);
}
@Override
protected void paintBorder(Graphics g) {
g.setColor(UIConstants.POP_DIALOG_BORDER);
g.drawRect(0, 0, getWidth() - 1, getHeight() - 1);
}
@Override
public Insets getInsets() {
return new Insets(0, 1, 1, 1);
}
}

4
designer_base/src/com/fr/design/gui/imenu/UIPopupMenu.java

@ -13,13 +13,13 @@ public class UIPopupMenu extends JPopupMenu{
super();
setBackground(UIConstants.NORMAL_BACKGROUND);
}
@Override
protected void paintBorder(Graphics g) {
g.setColor(UIConstants.LINE_COLOR);
g.drawRect(0, 0, getWidth() - 1, getHeight() - 1);
}
@Override
public Insets getInsets() {
if(onlyText) {

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

@ -1457,7 +1457,7 @@ Ratio=Ratio
DBCP_TEST_ON_BORROW=TestOnBorrow
FR-Designer_layerIndex=
WEB-Write_Setting=Write Setting
M-New_WorkBook=New WorkBook
M-New_WorkBook=New General Report
FR-Designer-Plugin_Has_Been_Actived=Plugin is now active
Datasource-Maximum_Number_of_Preview_Rows=Maximum Number of Preview Rows
ExpandD-Cell_Expand_Attributes=Attribute to Insert Cell to Display Data

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

@ -1460,7 +1460,7 @@ Ratio=Ratio
DBCP_TEST_ON_BORROW=Test before Getting Connections
FR-Designer_layerIndex=
WEB-Write_Setting=Filling Settings
M-New_WorkBook=New WorkBook
M-New_WorkBook=New General Report
FR-Designer-Plugin_Has_Been_Actived=Plugin is now active, restart the designer and sever to enable it and the sever need to be manually restarted
Datasource-Maximum_Number_of_Preview_Rows=Maximum Number of Preview Rows
ExpandD-Cell_Expand_Attributes=Extension Attributes

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

@ -1357,7 +1357,7 @@ RWA-NotChange_Unmodified=\u306E\u6539\u6B63\u3092\u66F4\u65B0\u3057\u306A\u3044
User_Information=\u30E6\u30FC\u30B6\u30FC\u60C5\u5831
Custom_styles_lost=\u30AB\u30B9\u30BF\u30DE\u30A4\u30BA\u30B9\u30BF\u30A4\u30EB\u306F\u5931\u308F\u308C\u307E\u3057\u305F
PageSetup-Margin=\u4F59\u767D
M-New_FormBook=\u8868\u3092\u65B0\u898F\u4F5C\u6210
M-New_FormBook=
Widget-TreeNode=\u30C4\u30EA\u30FC\u30CE\u30FC\u30C9\u30DC\u30BF\u30F3
Form-Url=\u30A2\u30C9\u30EC\u30B9
Utils-Beyond_the_left_side_of_Border=\u5DE6\u30DC\u30FC\u30C0\u30FC\u8D85\u3048
@ -1458,7 +1458,6 @@ Ratio=\u6BD4\u7387
DBCP_TEST_ON_BORROW=\u63A5\u7D9A\u524D\u691C\u67FB\u3092\u53D6\u5F97
FR-Designer_layerIndex=
WEB-Write_Setting=\u5831\u544A\u30DA\u30FC\u30B8\u8A2D\u5B9A
M-New_WorkBook=\u30D6\u30C3\u30AF\u3092\u65B0\u898F\u4F5C\u6210
FR-Designer-Plugin_Has_Been_Actived=\u30D7\u30E9\u30B0\u30A4\u30F3\u306F\u3059\u3067\u306B\u8D77\u52D5\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u30C7\u30B6\u30A4\u30CA\u30FC\u3068\u30B5\u30FC
Datasource-Maximum_Number_of_Preview_Rows=\u30D7\u30EC\u30D3\u30E5\u30FC\u884C\u6570\u6700\u5927\u5024
ExpandD-Cell_Expand_Attributes=\u62E1\u5F35\u5C5E\u6027
@ -1982,7 +1981,6 @@ FR-Base_UnSignIn=\ \u672A\u30ED\u30B0\u30A4\u30F3
Every=\u6BCE
CellWrite-Preview_Cell_Content=\u30BB\u30EB\u5185\u5BB9
FormulaD-Data_Fields=\u30C7\u30FC\u30BF\u30D5\u30A3\u30FC\u30EB\u30C9
FormulaD-Data_Fields=\u30C7\u30FC\u30BF\u30D5\u30A3\u30FC\u30EB\u30C9
FR-Designer_Permissions=\u6A29\u9650
FR-Designer_Form_Button=\u30DC\u30BF\u30F3
FR-Designer_WF_Name=\u540D
@ -2005,8 +2003,6 @@ FR-Designer_Data_Filter=\u30C7\u30FC\u30BF\u30D5\u30A3\u30EB\u30BF
FR-Designer_Can_not_use_FormatBursh=\u9023\u7D9A\u3057\u306A\u3044\u8907\u6570\u9818\u57DF\u3067\u306F\u66F8\u5F0F\u30B3\u30D4\u30FC\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093
Default=\u65E2\u5B9A
FR-Base-Load_Resource_File=\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u30ED\u30FC\u30C9
FormulaD-Data_Fields=\u30C7\u30FC\u30BF\u30D5\u30A3\u30FC\u30EB\u30C9
FR-Designer_Cell_Element=\u30BB\u30EB\u8981\u7D20
FR-Designer_Cell_Attributes=\u30BB\u30EB\u5C5E\u6027
FR-Designer_Float_Element=\u30D5\u30ED\u30FC\u30C8\u8981\u7D20
@ -2124,4 +2120,4 @@ FS-Designer_DS_Filter_Odd_Tip=
FS-Designer_DS_Filter_Even_Tip=
FS-Designer_DS_Filter_Specify_Tip=
FR-Designer_Mobile-Height-Percent=
FR-Designer_Mobile-Height-Limit=
FR-Designer_Mobile-Height-Limit=

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

@ -1357,7 +1357,7 @@ RWA-NotChange_Unmodified=\uC218\uC815\uD558\uC9C0\uC54A\uC73C\uBA74\uC5C5\uB370\
User_Information=\uC0AC\uC6A9\uC790\uC815\uBCF4
Custom_styles_lost=\uC0AC\uC6A9\uC790\uC815\uC758\uC591\uC2DD\uC774\uC5C6\uC2B5\uB2C8\uB2E4.
PageSetup-Margin=\uD398\uC774\uC9C0\uC5EC\uBC31
M-New_FormBook=\uC0C8\uD3FC
M-New_FormBook=
Widget-TreeNode=\uD2B8\uB9AC\uB178\uB4DC\uD0A4
Form-Url=\uC8FC\uC18C
Utils-Beyond_the_left_side_of_Border=\uC67C\uCABD\uC5EC\uBC31\uBC97\uC5B4\uB0A8
@ -1458,7 +1458,7 @@ Ratio=\uBE44\uC728
DBCP_TEST_ON_BORROW=\uB9C1\uD06C\uD68D\uB4DD\uC804\uAC80\uC0AC\uC9C4\uD589
FR-Designer_layerIndex=
WEB-Write_Setting=\uC6F9\uD398\uC774\uC9C0\uC124\uC815\uAE30\uC785
M-New_WorkBook=\uC0C8\uC6CC\uD06C\uBD81
M-New_WorkBook=
FR-Designer-Plugin_Has_Been_Actived=\uD50C\uB7EC\uADF8\uC778\uC774\uAD6C\uB3D9\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\uC124\uACC4\uAE30\uBC0F\uC11C\uBC84\uB97C\uC7AC\uBD80\uD305\uD558\uB824\uBA74\uC11C\uBC84\uB97C\uC218\uB3D9\uC7AC\uBD80\uD305\uD574\uC57C\uD569\uB2C8\uB2E4.
Datasource-Maximum_Number_of_Preview_Rows=\uCD5C\uB300\uBBF8\uB9AC\uBCF4\uAE30\uD589\uC218
ExpandD-Cell_Expand_Attributes=\uD655\uC7A5\uC18D\uC131
@ -1982,7 +1982,6 @@ FR-Base_UnSignIn=\uC544\uC9C1 \uB4F1\uB85D
Every=\uAC01
CellWrite-Preview_Cell_Content=\uC140\uB0B4\uC6A9\uBBF8\uB9AC\uBCF4\uAE30
FormulaD-Data_Fields=\uB370\uC774\uD130\uD56D\uBAA9
FormulaD-Data_Fields=\uB370\uC774\uD130\uD56D\uBAA9
FR-Designer_Permissions=
FR-Designer_Form_Button=
FR-Designer_WF_Name=
@ -1995,7 +1994,6 @@ FR-Designer_Parameter=\uB9E4\uAC1C\uBCC0\uC218
FR-Designer-Plugin_Plugin=\uD50C\uB7EC\uADF8\uC778
FR-Designer_Background=\uBC30\uACBD
Template=\uD15C\uD50C\uB9BF
FR-Designer_Double=\uC18C\uC218
FR-Designer_Original_Marked_Filed=\uCD08\uAE30\uD0DC\uADF8\uD544\uB4DC
FR-Designer_Build_Tree_Accord_Marked_Filed_Length=\uC120\uD0DD\uD55C\uB370\uC774\uD130\uC138\uD2B8\uC758\uD0DC\uADF8\uD544\uB4DC\uAE38\uC774\uC5D0\uB530\uB77C\uD2B8\uB9AC\uC0DD\uC131
FR-Designer_Tree_Data_Field=\uD2B8\uB9AC\uB370\uC774\uD130\uD544\uB4DC
@ -2005,7 +2003,6 @@ FR-Product_Demo=\uC81C\uD488\uC2DC\uC5F0
FR-Designer_Data_Filter=\uB370\uC774\uD130\uC120\uBCC4
Default=\uAE30\uBCF8
FR-Base-Load_Resource_File=\uB85C\uB529\uAD6C\uC131\uD30C\uC77C
FormulaD-Data_Fields=\uB370\uC774\uD130\uD56D\uBAA9
FR-Designer_Cell_Element=\uC140\uC694\uC18C
FR-Designer_Cell_Attributes=\uC140\uC18D\uC131
FR-Designer_Float_Element=\uD638\uBC84\uC694\uC18C

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

@ -1358,7 +1358,7 @@ RWA-NotChange_Unmodified=\u672A\u4FEE\u6539\u4E0D\u66F4\u65B0
User_Information=\u7528\u6237\u4FE1\u606F
Custom_styles_lost=\u81EA\u5B9A\u4E49\u6837\u5F0F\u5DF2\u4E22\u5931
PageSetup-Margin=\u9875\u8FB9\u8DDD
M-New_FormBook=\u65B0\u5EFA\u8868\u5355
M-New_FormBook=\u65B0\u5EFA\u51B3\u7B56\u62A5\u8868
Widget-TreeNode=\u6811\u8282\u70B9\u6309\u94AE
Form-Url=\u5730\u5740
Utils-Beyond_the_left_side_of_Border=\u8D85\u51FA\u5DE6\u8FB9\u754C
@ -1459,7 +1459,7 @@ Ratio=\u6BD4\u7387
DBCP_TEST_ON_BORROW=\u83B7\u53D6\u8FDE\u63A5\u524D\u68C0\u9A8C
FR-Designer_layerIndex=\u4F9D\u8D56\u7684\u5C42\u6570
WEB-Write_Setting=\u586B\u62A5\u9875\u9762\u8BBE\u7F6E
M-New_WorkBook=\u65B0\u5EFA\u5DE5\u4F5C\u7C3F
M-New_WorkBook=\u65B0\u5EFA\u666E\u901A\u62A5\u8868
Datasource-Maximum_Number_of_Preview_Rows=\u6700\u5927\u7684\u9884\u89C8\u884C\u6570
ExpandD-Cell_Expand_Attributes=\u6269\u5C55\u5C5E\u6027
Select_the_repeated_row_and_column=\u9009\u62E9\u9700\u8981\u91CD\u590D\u7684\u884C\u5217

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

@ -1359,7 +1359,6 @@ RWA-NotChange_Unmodified=\u4E0D\u6539\u8B8A\u6642\u4E0D\u66F4\u65B0
User_Information=\u7528\u6236\u8A0A\u606F
Custom_styles_lost=\u81EA\u5B9A\u7FA9\u6A23\u5F0F\u5DF2\u4E1F\u5931
PageSetup-Margin=\u9801\u908A\u8DDD
M-New_FormBook=\u5EFA\u7ACB\u65B0\u5831\u8868
Widget-TreeNode=\u6A39\u7BC0\u9EDE\u6309\u9215
Form-Url=\u5730\u5740
Utils-Beyond_the_left_side_of_Border=\u8D85\u51FA\u5DE6\u908A\u754C
@ -1460,7 +1459,7 @@ Ratio=\u6BD4\u7387
DBCP_TEST_ON_BORROW=\u7372\u53D6\u9023\u63A5\u524D\u6AA2\u9A57
FR-Designer_layerIndex=\u4F9D\u8CF4\u7684\u5C64\u6578
WEB-Write_Setting=\u586B\u5831\u9762\u9762\u8A2D\u5B9A
M-New_WorkBook=\u65B0\u589E\u5DE5\u4F5C\u7C3F
M-New_WorkBook=\u65B0\u589E\u666E\u901A\u5831\u8868
FR-Designer-Plugin_Has_Been_Actived=Plugin is now active
Datasource-Maximum_Number_of_Preview_Rows=\u6700\u5927\u7684\u9810\u89BD\u5217\u6578
ExpandD-Cell_Expand_Attributes=\u64F4\u5C55\u5C6C\u6027
@ -2125,3 +2124,4 @@ FR-Designer_Barcode_Size=
FS-Designer_DS_Filter_Odd_Tip=\u63D0\u793A\uFF1A\u5E8F\u865F\u5F9E1\u958B\u59CB\uFF0C\u9078\u64C7\u4E86\u5947\u6578\u96C6(1,3,5...)
FS-Designer_DS_Filter_Even_Tip=\u63D0\u793A\uFF1A\u5E8F\u865F\u5F9E1\u958B\u59CB\uFF0C\u9078\u64C7\u4E86\u5076\u6578\u96C6(2,4,6...)
FS-Designer_DS_Filter_Specify_Tip=\u63D0\u793A\uFF1A\u683C\u5F0F\u70BA1,2-3,5,8\uFF0C\u5E8F\u865F\u5F9E1\u958B\u59CB\uFF0C\u5185\u7F6E\u53C3\u6578$_count_\u8868\u793A\u7E02\u500B\u6578
M-New_FormBook=\u65B0\u589E\u6C7A\u7B56\u5831\u8868

734
designer_base/src/com/fr/design/menu/MenuDef.java

@ -3,6 +3,7 @@ package com.fr.design.menu;
import com.fr.base.BaseUtils;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.imenu.UIMenu;
import com.fr.design.gui.imenu.UIPopupEastAttrMenu;
import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.gui.imenu.UIScrollMenu;
import com.fr.design.gui.iscrollbar.UIScrollBar;
@ -13,7 +14,10 @@ import javax.swing.*;
import javax.swing.event.MenuEvent;
import javax.swing.event.MenuListener;
import java.awt.*;
import java.awt.event.*;
import java.awt.event.ContainerListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.ArrayList;
import java.util.List;
@ -22,338 +26,406 @@ import java.util.List;
*/
public class MenuDef extends ShortCut {
protected String name;
protected char mnemonic;
protected String iconPath;
protected String tooltip;
//item List.
private List<ShortCut> shortcutList = new ArrayList<ShortCut>();
// peter:产生的JMenu, UIButton以及enabled变量都是为由MenuDef产生的控件所用的
protected boolean enabled = true;
protected UIMenu createdJMenu;
protected UIButton createdButton;
protected JPopupMenu popupMenu;
private boolean hasScrollSubMenu;
private String anchor;
public MenuDef() {
}
public MenuDef(String name) {
this.setName(name);
}
public MenuDef(String name, char mnemonic) {
this.setName(name);
this.setMnemonic(mnemonic);
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public char getMnemonic() {
return mnemonic;
}
public void setMnemonic(char mnemonic) {
this.mnemonic = mnemonic;
}
public void setHasScrollSubMenu(boolean scrollSubMenu) {
this.hasScrollSubMenu = scrollSubMenu;
}
public String getIconPath() {
return iconPath;
}
public void setIconPath(String iconPath) {
this.iconPath = iconPath;
}
public int getShortCutCount() {
return this.shortcutList.size();
}
public ShortCut getShortCut(int index) {
return this.shortcutList.get(index);
}
public String getAnchor() {
return anchor == null ? StringUtils.EMPTY : anchor;
}
public void setAnchor(String anchor) {
this.anchor = anchor;
}
public List<ShortCut> getShortcutList() {
return this.shortcutList;
}
/**
* 插入菜单项
* @param index 插入的位置
* @param shortCut 菜单信息
*/
public void insertShortCut(int index, ShortCut shortCut) {
int size = this.shortcutList.size();
index = Math.min(index, size);
this.shortcutList.add(index, shortCut);
}
/**
* 用可变参数方便添加数组
* @param shortcut 参数 存储菜单项信息
*/
public void addShortCut(ShortCut... shortcut) {
for (ShortCut i : shortcut) {
this.shortcutList.add(i);
}
}
private static final int MENU_DEFAULTWDITH = 156;
protected String name;
//右侧属性表弹出框重绘
protected Boolean isEastAttr = false;
protected char mnemonic;
protected String iconPath;
protected String tooltip;
//item List.
private List<ShortCut> shortcutList = new ArrayList<ShortCut>();
// peter:产生的JMenu, UIButton以及enabled变量都是为由MenuDef产生的控件所用的
protected boolean enabled = true;
protected UIMenu createdJMenu;
protected UIButton createdButton;
protected JPopupMenu popupMenu;
private boolean hasScrollSubMenu;
private String anchor;
public MenuDef() {
}
public MenuDef(String name) {
this.setName(name);
}
public MenuDef(Boolean rePaint) {
this.setRePaint(rePaint);
}
public MenuDef(String name, char mnemonic) {
this.setName(name);
this.setMnemonic(mnemonic);
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public boolean getRePaint() {
return isEastAttr;
}
public void setRePaint(boolean rePaint) {
this.isEastAttr = rePaint;
}
public char getMnemonic() {
return mnemonic;
}
public void setMnemonic(char mnemonic) {
this.mnemonic = mnemonic;
}
public void setHasScrollSubMenu(boolean scrollSubMenu) {
this.hasScrollSubMenu = scrollSubMenu;
}
public String getIconPath() {
return iconPath;
}
public void setIconPath(String iconPath) {
this.iconPath = iconPath;
}
public int getShortCutCount() {
return this.shortcutList.size();
}
public ShortCut getShortCut(int index) {
return this.shortcutList.get(index);
}
public String getAnchor() {
return anchor == null ? StringUtils.EMPTY : anchor;
}
public void setAnchor(String anchor) {
this.anchor = anchor;
}
public List<ShortCut> getShortcutList() {
return this.shortcutList;
}
/**
* 插入菜单项
*
* @param index 插入的位置
* @param shortCut 菜单信息
*/
public void insertShortCut(int index, ShortCut shortCut) {
int size = this.shortcutList.size();
index = Math.min(index, size);
this.shortcutList.add(index, shortCut);
}
/**
* 用可变参数方便添加数组
*
* @param shortcut 参数 存储菜单项信息
*/
public void addShortCut(ShortCut... shortcut) {
for (ShortCut i : shortcut) {
this.shortcutList.add(i);
}
}
public void removeShortCut(ShortCut shortCut) {
this.shortcutList.remove(shortCut);
}
/**
* 清理
*/
public void clearShortCuts() {
this.shortcutList.clear();
}
/**
* 生成UIButton
* @return 菜单按钮
*/
public UIButton createUIButton() {
if (createdButton == null) {
if (iconPath != null) {
createdButton = new UIButton(BaseUtils.readIcon(iconPath));
createdButton.set4ToolbarButton();
} else {
createdButton = new UIButton(name);
}
// 添加名字以作自动化测试
createdButton.setName(name);
createdButton.setToolTipText(tooltip);
createdButton.addMouseListener(mouseListener);
}
return createdButton;
}
public void setTooltip(String text) {
this.tooltip = text;
}
/**
* 生成JMenu
* @return 菜单
*/
public UIMenu createJMenu() {
if (createdJMenu == null) {
if (hasScrollSubMenu) {
createdJMenu = new UIScrollMenu(this.getName());
} else {
createdJMenu = new UIMenu(this.getName());
}
createdJMenu.setMnemonic(this.getMnemonic());
if (this.iconPath != null) {
createdJMenu.setIcon(BaseUtils.readIcon(this.iconPath));
}
createdJMenu.addMenuListener(menuDefListener);
ContainerListener listener = getContainerListener();
if(listener != null){
createdJMenu.getPopupMenu().addContainerListener(listener);
}
}
return createdJMenu;
}
protected ContainerListener getContainerListener() {
return null;
}
/**
* 生成 JPopupMenu
* @return 弹出菜单
*/
public JPopupMenu createJPopupMenu() {
UIMenu menu = createJMenu();
updateMenu();
return menu.getPopupMenu();
}
/**
* 设置是否可用
* @param b 布尔型
*/
@Override
public void setEnabled(boolean b) {
this.enabled = b;
if (createdButton != null) {
createdButton.setEnabled(enabled);
}
if (createdJMenu != null) {
createdJMenu.setEnabled(enabled);
}
}
/**
* 按钮状态
* @return 状态
*/
@Override
public boolean isEnabled() {
return enabled;
}
/**
* 更新菜单
*/
public void updateMenu() {
//peter:这个方法用来产生JMenu的孩子控件,但是不update,action.
this.updatePopupMenu(this.createJMenu().getPopupMenu());
//peter:需要设置JMenu的enabled属性.
if (createdJMenu != null) {
createdJMenu.setEnabled(createdJMenu.getPopupMenu().getComponentCount() > 0 && enabled);
createdJMenu.repaint(10);
}
}
/**
* 更新菜单
* @param popupMenu 菜单
*/
protected void updatePopupMenu(JPopupMenu popupMenu) {
removeComponent(popupMenu);
this.popupMenu = popupMenu;
// 一开始是不能插入分隔符的
boolean nec_seperator = false;
boolean isFirstItem = true;
int actionCount = this.getShortCutCount();
for (int i = 0; i < actionCount; i++) {
ShortCut shortcut = this.getShortCut(i);
// 如果shortcut是SeparatorDef,先不加,先标记一下nec_seperator为true,等下一个shortcut需要加到PopupMenu时再加
if (shortcut instanceof SeparatorDef) {
nec_seperator = true;
continue;
}
if (nec_seperator) {
if (!isFirstItem) {
SeparatorDef.DEFAULT.intoJPopupMenu(popupMenu);
}
nec_seperator = false;
}
shortcut.intoJPopupMenu(popupMenu);
isFirstItem = false;
}
if (createdJMenu != null && createdJMenu.getPopupMenu() != null){
setEnabled(createdJMenu.getPopupMenu().getComponentCount() > 0 && enabled);
}
}
/**
* 删除所有组件 除了滚动条
* @param popupMenu 菜单
*/
public void removeComponent(JPopupMenu popupMenu){
UIScrollBar uiScrollBar = new UIScrollBar();
if(hasScrollSubMenu){
for(Component comp : popupMenu.getComponents()){
if(comp instanceof UIScrollBar){
uiScrollBar =(UIScrollBar) comp;
}
}
}
popupMenu.removeAll();
if(hasScrollSubMenu){
popupMenu.add(uiScrollBar);
}
}
/**
* 添加菜单项
* @param menu 菜单
*/
@Override
public void intoJPopupMenu(JPopupMenu menu) {
updateMenu();
menu.add(this.createJMenu());
}
/**
* 添加
* @param toolBar 菜单条
*/
@Override
public void intoJToolBar(JToolBar toolBar) {
toolBar.add(this.createUIButton());
}
private MenuListener menuDefListener = new MenuListener() {
@Override
public void menuCanceled(MenuEvent evt) {
}
@Override
public void menuDeselected(MenuEvent evt) {
}
@Override
public void menuSelected(MenuEvent evt) {
Object source = evt.getSource();
if (!(source instanceof JMenu)) {
return;
}
MenuDef.this.updateMenu();
}
};
private MouseListener mouseListener = new MouseAdapter() {
@Override
public void mouseReleased(MouseEvent evt) {
Object source = evt.getSource();
UIButton button = (UIButton) source;
if (!button.isEnabled()) {
return;
}
UIPopupMenu popupMenu = new UIPopupMenu();
popupMenu.setInvoker(button);
MenuDef.this.updatePopupMenu(popupMenu);
GUICoreUtils.showPopupMenu(popupMenu, button, 0, button.getSize().height);
}
};
//ben: for ui test
public JPopupMenu getPopupMenu() {
return popupMenu;
}
public void setPopupMenu(JPopupMenu popupMenu) {
this.popupMenu = popupMenu;
}
/**
* 清理
*/
public void clearShortCuts() {
this.shortcutList.clear();
}
/**
* 生成UIButton
*
* @return 菜单按钮
*/
public UIButton createUIButton() {
if (createdButton == null) {
if (iconPath != null) {
createdButton = new UIButton(BaseUtils.readIcon(iconPath));
createdButton.set4ToolbarButton();
} else {
createdButton = new UIButton(name);
}
// 添加名字以作自动化测试
createdButton.setName(name);
createdButton.setToolTipText(tooltip);
createdButton.addMouseListener(mouseListener);
}
return createdButton;
}
public void setTooltip(String text) {
this.tooltip = text;
}
/**
* 生成JMenu
*
* @return 菜单
*/
public UIMenu createJMenu() {
if (createdJMenu == null) {
if (hasScrollSubMenu) {
createdJMenu = new UIScrollMenu(this.getName());
} else {
createdJMenu = new UIMenu(this.getName());
}
createdJMenu.setMnemonic(this.getMnemonic());
if (this.iconPath != null) {
createdJMenu.setIcon(BaseUtils.readIcon(this.iconPath));
}
createdJMenu.addMenuListener(menuDefListener);
ContainerListener listener = getContainerListener();
if (listener != null) {
createdJMenu.getPopupMenu().addContainerListener(listener);
}
}
return createdJMenu;
}
protected ContainerListener getContainerListener() {
return null;
}
/**
* 生成 JPopupMenu
*
* @return 弹出菜单
*/
public JPopupMenu createJPopupMenu() {
UIMenu menu = createJMenu();
updateMenu();
return menu.getPopupMenu();
}
/**
* 设置是否可用
*
* @param b 布尔型
*/
@Override
public void setEnabled(boolean b) {
this.enabled = b;
if (createdButton != null) {
createdButton.setEnabled(enabled);
}
if (createdJMenu != null) {
createdJMenu.setEnabled(enabled);
}
}
/**
* 按钮状态
*
* @return 状态
*/
@Override
public boolean isEnabled() {
return enabled;
}
/**
* 更新菜单
*/
public void updateMenu() {
//peter:这个方法用来产生JMenu的孩子控件,但是不update,action.
this.updatePopupMenu(this.createJMenu().getPopupMenu());
//peter:需要设置JMenu的enabled属性.
if (createdJMenu != null) {
createdJMenu.setEnabled(createdJMenu.getPopupMenu().getComponentCount() > 0 && enabled);
createdJMenu.repaint(10);
}
}
/**
* 更新菜单
*
* @param popupMenu 菜单
*/
protected void updatePopupMenu(JPopupMenu popupMenu) {
removeComponent(popupMenu);
this.popupMenu = popupMenu;
// 一开始是不能插入分隔符的
boolean nec_seperator = false;
boolean isFirstItem = true;
int actionCount = this.getShortCutCount();
for (int i = 0; i < actionCount; i++) {
ShortCut shortcut = this.getShortCut(i);
// 如果shortcut是SeparatorDef,先不加,先标记一下nec_seperator为true,等下一个shortcut需要加到PopupMenu时再加
if (shortcut instanceof SeparatorDef) {
nec_seperator = true;
continue;
}
if (nec_seperator) {
if (!isFirstItem) {
SeparatorDef.DEFAULT.intoJPopupMenu(popupMenu);
}
nec_seperator = false;
}
shortcut.intoJPopupMenu(popupMenu);
isFirstItem = false;
}
if (createdJMenu != null && createdJMenu.getPopupMenu() != null) {
setEnabled(createdJMenu.getPopupMenu().getComponentCount() > 0 && enabled);
}
}
/**
* 更新右侧属性面板菜单
*
* @param popupMenu 菜单
*/
protected void updateEastPopupMenu(JPopupMenu popupMenu) {
removeComponent(popupMenu);
this.popupMenu = popupMenu;
// 一开始是不能插入分隔符的
boolean nec_seperator = false;
boolean isFirstItem = true;
int actionCount = this.getShortCutCount();
for (int i = 0; i < actionCount; i++) {
ShortCut shortcut = this.getShortCut(i);
// 如果shortcut是SeparatorDef,先不加,先标记一下nec_seperator为true,等下一个shortcut需要加到PopupMenu时再加
if (shortcut instanceof SeparatorDef) {
nec_seperator = true;
continue;
}
if (nec_seperator) {
if (!isFirstItem) {
SeparatorDef.DEFAULT.intoJPopupMenu(popupMenu);
}
nec_seperator = false;
}
shortcut.intoJPopupMenu(popupMenu);
isFirstItem = false;
}
if (createdJMenu != null && createdJMenu.getPopupMenu() != null) {
setEnabled(createdJMenu.getPopupMenu().getComponentCount() > 0 && enabled);
}
}
/**
* 删除所有组件 除了滚动条
*
* @param popupMenu 菜单
*/
public void removeComponent(JPopupMenu popupMenu) {
UIScrollBar uiScrollBar = new UIScrollBar();
if (hasScrollSubMenu) {
for (Component comp : popupMenu.getComponents()) {
if (comp instanceof UIScrollBar) {
uiScrollBar = (UIScrollBar) comp;
}
}
}
popupMenu.removeAll();
if (hasScrollSubMenu) {
popupMenu.add(uiScrollBar);
}
}
/**
* 添加菜单项
*
* @param menu 菜单
*/
@Override
public void intoJPopupMenu(JPopupMenu menu) {
updateMenu();
menu.add(this.createJMenu());
}
/**
* 添加
*
* @param toolBar 菜单条
*/
@Override
public void intoJToolBar(JToolBar toolBar) {
toolBar.add(this.createUIButton());
}
private MenuListener menuDefListener = new MenuListener() {
@Override
public void menuCanceled(MenuEvent evt) {
}
@Override
public void menuDeselected(MenuEvent evt) {
}
@Override
public void menuSelected(MenuEvent evt) {
Object source = evt.getSource();
if (!(source instanceof JMenu)) {
return;
}
MenuDef.this.updateMenu();
}
};
private MouseListener mouseListener = new MouseAdapter() {
@Override
public void mouseReleased(MouseEvent evt) {
Object source = evt.getSource();
UIButton button = (UIButton) source;
if (!button.isEnabled()) {
return;
}
if (isEastAttr) {
popupMenu = new UIPopupEastAttrMenu();
popupMenu.setInvoker(button);
MenuDef.this.updateEastPopupMenu(popupMenu);
popupMenu.setPopupSize(new Dimension(MENU_DEFAULTWDITH, popupMenu.getPreferredSize().height));
GUICoreUtils.showPopupMenu(popupMenu, button, 0, button.getSize().height);
} else {
popupMenu = new UIPopupMenu();
popupMenu.setInvoker(button);
MenuDef.this.updatePopupMenu(popupMenu);
GUICoreUtils.showPopupMenu(popupMenu, button, 0, button.getSize().height);
}
}
};
//ben: for ui test
public JPopupMenu getPopupMenu() {
return popupMenu;
}
public void setPopupMenu(JPopupMenu popupMenu) {
this.popupMenu = popupMenu;
}
}
Loading…
Cancel
Save