From fab281b2b2e0d4ffb822773e0d64c197adb24a80 Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 13 Aug 2018 16:54:07 +0800 Subject: [PATCH 01/14] =?UTF-8?q?REPORT-10045=20=E9=87=8D=E6=9E=84=20UILis?= =?UTF-8?q?tControlPane=20=E5=92=8C=20JListControlPane=EF=BC=88=E9=83=A8?= =?UTF-8?q?=E5=88=86=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/gui/controlpane/JControlPane.java | 77 +- .../gui/controlpane/JControlUpdatePane.java | 112 +++ .../gui/controlpane/JListControlPane.java | 554 ++++---------- .../controlpane/ListControlPaneHandlers.java | 71 ++ .../controlpane/ListControlPaneProvider.java | 14 + .../gui/controlpane/ObjectJControlPane.java | 2 +- .../gui/controlpane/ObjectUIControlPane.java | 2 +- .../controlpane/ShortCutListenerProvider.java | 15 + .../design/gui/controlpane/UIControlPane.java | 188 +---- .../gui/controlpane/UIListControlPane.java | 686 ++++-------------- .../AbstractShortCutFactory.java | 179 +++++ .../shortcutfactory/NewShortCutFactory.java | 172 +++++ .../shortcutfactory/OldShortCutFactory.java | 112 +++ .../src/main/java/com/fr/env/EnvListPane.java | 5 - .../component/VanChartHyperLinkPane.java | 18 +- .../component/VanChartShortCutFactory.java | 33 + .../VanChartConditionListControlPane.java | 2 +- .../background/AlertLineListControlPane.java | 6 +- .../background/BackgroundListControlPane.java | 6 +- ...VanChartStackedAndAxisListControlPane.java | 6 +- .../report/share/ConfusionManagerPane.java | 6 +- 21 files changed, 1061 insertions(+), 1205 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java create mode 100644 designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneHandlers.java create mode 100644 designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/gui/controlpane/ShortCutListenerProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/AbstractShortCutFactory.java create mode 100644 designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/NewShortCutFactory.java create mode 100644 designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/OldShortCutFactory.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartShortCutFactory.java diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java index 55201d639e..172810f0eb 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java @@ -17,24 +17,30 @@ import java.awt.*; * Date: 2016/5/17 * Time: 15:07 */ -public abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper { - protected static final int SHORT_WIDTH = 30; //每加一个short Divider位置加30 - protected JPanel controlUpdatePane; +abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, ShortCutListenerProvider { + private static final int SHORT_WIDTH = 30; //每加一个short Divider位置加30 + JPanel controlUpdatePane; - private ShortCut4JControlPane[] shorts; - private NameableCreator[] creators; + ShortCut4JControlPane[] shorts; + NameableCreator[] creators; private ToolBarDef toolbarDef; - private UIToolbar toolBar; + UIToolbar toolBar; // peter:这是整体的一个cardLayout Pane protected CardLayout cardLayout; protected JPanel cardPane; + protected AbstractShortCutFactory shortCutFactory; - public JControlPane() { + JControlPane() { + this.initShortCutFactory(); this.initComponentPane(); } + protected void initShortCutFactory() { + this.shortCutFactory = OldShortCutFactory.newInstance(this); + } + /** * 生成添加按钮的NameableCreator * @@ -42,14 +48,10 @@ public abstract class JControlPane extends BasicPane implements UnrepeatedNameHe */ public abstract NameableCreator[] createNameableCreators(); - public ShortCut4JControlPane[] getShorts() { + ShortCut4JControlPane[] getShorts() { return shorts; } - public void setShorts(ShortCut4JControlPane[] shorts) { - this.shorts = shorts; - } - public void setCreators(NameableCreator[] creators) { this.creators = creators; } @@ -111,6 +113,15 @@ public abstract class JControlPane extends BasicPane implements UnrepeatedNameHe protected abstract JPanel createControlUpdatePane(); + protected void initToolBar() { + toolbarDef = new ToolBarDef(); + for (ShortCut4JControlPane sj : shorts) { + toolbarDef.addShortCut(sj.getShortCut()); + } + toolBar = ToolBarDef.createJToolBar(); + toolbarDef.updateToolBar(toolBar); + } + protected JPanel getLeftPane() { // LeftPane JPanel leftPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); @@ -122,12 +133,8 @@ public abstract class JControlPane extends BasicPane implements UnrepeatedNameHe return leftPane; } - toolbarDef = new ToolBarDef(); - for (ShortCut4JControlPane sj : shorts) { - toolbarDef.addShortCut(sj.getShortCut()); - } - toolBar = ToolBarDef.createJToolBar(); - toolbarDef.updateToolBar(toolBar); + initToolBar(); + leftPane.add(toolBar, BorderLayout.NORTH); return leftPane; } @@ -143,30 +150,10 @@ public abstract class JControlPane extends BasicPane implements UnrepeatedNameHe return shorts.length * SHORT_WIDTH; } - protected ShortCut4JControlPane[] createShortcuts() { - return new ShortCut4JControlPane[]{ - addItemShortCut(), - removeItemShortCut(), - copyItemShortCut(), - moveUpItemShortCut(), - moveDownItemShortCut(), - sortItemShortCut() - }; + return shortCutFactory.createShortCuts(); } - protected abstract ShortCut4JControlPane addItemShortCut(); - - protected abstract ShortCut4JControlPane removeItemShortCut(); - - protected abstract ShortCut4JControlPane copyItemShortCut(); - - protected abstract ShortCut4JControlPane moveUpItemShortCut(); - - protected abstract ShortCut4JControlPane moveDownItemShortCut(); - - protected abstract ShortCut4JControlPane sortItemShortCut(); - public abstract Nameable[] update(); @@ -179,10 +166,10 @@ public abstract class JControlPane extends BasicPane implements UnrepeatedNameHe public void checkButtonEnabled() { } - protected void doBeforeRemove() { + void doBeforeRemove() { } - protected void doAfterRemove() { + void doAfterRemove() { } public NameableCreator[] creators() { @@ -192,10 +179,10 @@ public abstract class JControlPane extends BasicPane implements UnrepeatedNameHe protected abstract boolean hasInvalid(boolean isAdd); /** - * 刷新 NameableCreator - * - * @param creators 生成器 - */ + * 刷新 NameableCreator + * + * @param creators 生成器 + */ public void refreshNameableCreator(NameableCreator[] creators) { this.creators = creators; shorts = this.createShortcuts(); diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java new file mode 100644 index 0000000000..177b2517d1 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java @@ -0,0 +1,112 @@ +package com.fr.design.gui.controlpane; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.data.tabledata.tabledatapane.GlobalMultiTDTableDataPane; +import com.fr.design.data.tabledata.tabledatapane.GlobalTreeTableDataPane; +import com.fr.design.data.tabledata.tabledatapane.MultiTDTableDataPane; +import com.fr.design.data.tabledata.tabledatapane.TreeTableDataPane; +import com.fr.design.gui.ilist.ListModelElement; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.general.ComparatorUtils; + +import javax.swing.JPanel; +import java.awt.CardLayout; + +/** + * Created by plough on 2018/8/13. + */ +class JControlUpdatePane extends JPanel { + private ListControlPaneProvider listControlPane; + private CardLayout card; + private JPanel cardPane; + private BasicBeanPane[] updatePanes; + + private ListModelElement elEditing; + + private JControlUpdatePane(ListControlPaneProvider listControlPane) { + this.listControlPane = listControlPane; + initUpdatePane(); + } + + public static JControlUpdatePane newInstance(ListControlPaneProvider listControlPane) { + return new JControlUpdatePane(listControlPane); + } + + private void initUpdatePane() { + NameableCreator[] creators = listControlPane.creators(); + if (creators == null) { + return; + } + card = new CardLayout(); + cardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); + cardPane.setLayout(card); + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.add(cardPane); + int len = creators.length; + updatePanes = new BasicBeanPane[len]; + } + + public BasicBeanPane[] getUpdatePanes() { + return updatePanes; + } + + public void populate() { + ListModelElement el = listControlPane.getSelectedElement(); + if (el == null) { + return; + } + + elEditing = el; + NameableCreator[] creators = listControlPane.creators(); + + for (int i = 0, len = updatePanes.length; i < len; i++) { + Object ob2Populate = creators[i].acceptObject2Populate(el.wrapper); + if (ob2Populate != null) { + if (updatePanes[i] == null) { + if (isMulti(creators[i].getUpdatePane()) || isTree(creators[i].getUpdatePane())) { + updatePanes[i] = listControlPane.createPaneByCreators(creators[i], el.wrapper.getName()); + } else { + updatePanes[i] = listControlPane.createPaneByCreators(creators[i]); + } + cardPane.add(updatePanes[i], String.valueOf(i)); + } + card.show(cardPane, String.valueOf(i)); + updatePanes[i].populateBean(ob2Populate); + break; + } + } + } + + + public boolean isMulti(Class _class) { + return ComparatorUtils.equals(_class, GlobalMultiTDTableDataPane.class) || ComparatorUtils.equals(_class, MultiTDTableDataPane.class); + } + + public boolean isTree(Class _class) { + return ComparatorUtils.equals(_class, GlobalTreeTableDataPane.class) || ComparatorUtils.equals(_class, TreeTableDataPane.class); + } + + public void update() { + NameableCreator[] creators = listControlPane.creators(); + for (int i = 0; i < updatePanes.length; i++) { + BasicBeanPane pane = updatePanes[i]; + + if (pane != null && pane.isVisible()) { + Object bean = pane.updateBean(); + if (i < creators.length) { + creators[i].saveUpdatedBean(elEditing, bean); + } + } + } + } + + public void checkValid() throws Exception { + if (updatePanes != null) { + for (int i = 0; i < updatePanes.length; i++) { + if (updatePanes[i] != null) { + updatePanes[i].checkValid(); + } + } + } + } +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java index efaf27a76b..57f4ec1ab3 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java @@ -2,21 +2,11 @@ package com.fr.design.gui.controlpane; import com.fr.base.BaseUtils; import com.fr.base.FRContext; -import com.fr.design.actions.UpdateAction; import com.fr.design.beans.BasicBeanPane; -import com.fr.design.data.tabledata.tabledatapane.GlobalMultiTDTableDataPane; -import com.fr.design.data.tabledata.tabledatapane.GlobalTreeTableDataPane; -import com.fr.design.data.tabledata.tabledatapane.MultiTDTableDataPane; -import com.fr.design.data.tabledata.tabledatapane.TreeTableDataPane; -import com.fr.design.gui.HyperlinkFilterHelper; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilist.JNameEdList; import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.ModNameActionListener; -import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.menu.LineSeparator; -import com.fr.design.menu.MenuDef; -import com.fr.design.menu.ShortCut; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; import com.fr.general.IOUtils; @@ -25,19 +15,26 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import com.fr.stable.core.PropertyChangeAdapter; -import javax.swing.*; +import javax.swing.DefaultListCellRenderer; +import javax.swing.DefaultListModel; +import javax.swing.JList; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; +import javax.swing.ListSelectionModel; +import javax.swing.SwingUtilities; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; -import java.awt.*; -import java.awt.event.ActionEvent; +import java.awt.BorderLayout; +import java.awt.Component; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.util.Arrays; import java.util.Comparator; -public abstract class JListControlPane extends JControlPane { - public static final String LIST_NAME = "JControl_List"; +public abstract class JListControlPane extends JControlPane implements ListControlPaneProvider { + private static final String LIST_NAME = "JControl_List"; protected JNameEdList nameableList; protected int editingIndex; @@ -50,7 +47,7 @@ public abstract class JListControlPane extends JControlPane { @Override protected JPanel createControlUpdatePane() { - return new JControlUpdatePane(); + return JControlUpdatePane.newInstance(this); } /** @@ -87,7 +84,7 @@ public abstract class JListControlPane extends JControlPane { }); } - public JNameEdList createJNameList() { + protected JNameEdList createJNameList() { JNameEdList nameEdList = new JNameEdList(new DefaultListModel()) { @Override protected void doAfterLostFocus() { @@ -98,59 +95,10 @@ public abstract class JListControlPane extends JControlPane { return nameEdList; } - public void updateControlUpdatePane() { + private void updateControlUpdatePane() { ((JControlUpdatePane) controlUpdatePane).update(); } - protected void doWhenPopulate(BasicBeanPane beanPane) { - - } - - protected void doBeforePopulate(ListModelElement el, Object obj) { - - } - - @Override - protected ShortCut4JControlPane addItemShortCut() { - ShortCut addItemShortCut; - NameableCreator[] creators = creators(); - if (creators.length == 1) { - addItemShortCut = new AddItemUpdateAction(creators); - } else { - addItemShortCut = new AddItemMenuDef(creators); - } - return new AbsoluteEnableShortCut(addItemShortCut); - } - - @Override - protected ShortCut4JControlPane removeItemShortCut() { - return new NormalEnableShortCut(new RemoveItemAction()); - } - - @Override - protected ShortCut4JControlPane copyItemShortCut() { - return new NormalEnableShortCut(new CopyItemAction()); - } - - @Override - protected ShortCut4JControlPane moveUpItemShortCut() { - return new NormalEnableShortCut(new MoveUpItemAction()); - } - - @Override - protected ShortCut4JControlPane moveDownItemShortCut() { - return new NormalEnableShortCut(new MoveDownItemAction()); - } - - @Override - protected ShortCut4JControlPane sortItemShortCut() { - return new NormalEnableShortCut(new SortItemAction()); - } - - public void setNameListEditable(boolean editable) { - this.nameableList.setEditable(editable); - } - @Override public Nameable[] update() { java.util.List res = new java.util.ArrayList(); @@ -186,7 +134,7 @@ public abstract class JListControlPane extends JControlPane { * * @param l 名字改变时的监听 */ - public void addModNameActionListener(ModNameActionListener l) { + protected void addModNameActionListener(ModNameActionListener l) { this.nameableList.addModNameActionListener(l); } @@ -195,7 +143,7 @@ public abstract class JListControlPane extends JControlPane { * * @param l 监听 */ - public void addEditingListener(PropertyChangeAdapter l) { + protected void addEditingListener(PropertyChangeAdapter l) { this.nameableList.addEditingListner(l); } @@ -267,7 +215,7 @@ public abstract class JListControlPane extends JControlPane { * @param nameable 添加的Nameable * @param index 序号 */ - public void addNameable(Nameable nameable, int index) { + private void addNameable(Nameable nameable, int index) { JNameEdList nameEdList = JListControlPane.this.nameableList; DefaultListModel model = (DefaultListModel) nameEdList.getModel(); @@ -347,262 +295,152 @@ public abstract class JListControlPane extends JControlPane { } } - /** - * 增加项的UpdateAction - */ - protected class AddItemUpdateAction extends UpdateAction { - final NameableCreator creator; - - public AddItemUpdateAction(NameableCreator[] creators) { - this.creator = creators[0]; - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Add")); - this.setMnemonic('A'); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png")); - } - - @Override - public void actionPerformed(ActionEvent e) { - Nameable nameable = creator.createNameable(JListControlPane.this); - - JListControlPane.this.addNameable(nameable, getModel().getSize()); + @Override + public void onAddItem(NameableCreator creator) { + if (hasInvalid(true)) { + return; } - } - - /* - * 增加项的MenuDef - */ - protected class AddItemMenuDef extends MenuDef { - public AddItemMenuDef(NameableCreator[] creators) { - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Add")); - this.setMnemonic('A'); - this.setIconPath("/com/fr/design/images/control/addPopup.png"); - wrapActionListener(creators); - } - - private void wrapActionListener(NameableCreator[] creators) { - for (final NameableCreator creator : creators) { - if (filterNameableCreator(creator)) { - continue; - } - boolean isTrue = ComparatorUtils.equals(creator.menuName(), com.fr.design.i18n.Toolkit.i18nText("Datasource-Stored_Procedure")) || - ComparatorUtils.equals(creator.menuName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Relation_TableData")) || ComparatorUtils.equals(creator.menuName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Multi_Dimensional_Database")); - if (isTrue) { - this.addShortCut(new LineSeparator()); - } - this.addShortCut(new UpdateAction() { - { - this.setName(creator.menuName()); - Icon icon = creator.menuIcon(); - if (icon != null) { - this.setSmallIcon(icon); - } - } - - @Override - public void actionPerformed(ActionEvent e) { - if (hasInvalid(true)) { - return; - } - - Nameable nameable = creator.createNameable(JListControlPane.this); - JListControlPane.this.addNameable(nameable, getModel().getSize()); - } - }); - } - } + Nameable nameable = creator.createNameable(JListControlPane.this); + JListControlPane.this.addNameable(nameable, getModel().getSize()); } - /* - * 移除item - */ - private class RemoveItemAction extends UpdateAction { - public RemoveItemAction() { - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Remove")); - this.setMnemonic('R'); - this.setSmallIcon(BaseUtils - .readIcon("/com/fr/base/images/cell/control/remove.png")); - } - - @Override - public void actionPerformed(ActionEvent evt) { - try { - JListControlPane.this.nameableList.getCellEditor() - .stopCellEditing(); - } catch (Exception ignored) { - } - // bug:在选中一个NameObject并删除,会遗留下Name. - doBeforeRemove(); - if (GUICoreUtils.removeJListSelectedNodes(SwingUtilities - .getWindowAncestor(JListControlPane.this), nameableList)) { - checkButtonEnabled(); - doAfterRemove(); - } + @Override + public void onRemoveItem() { + try { + JListControlPane.this.nameableList.getCellEditor() + .stopCellEditing(); + } catch (Exception ignored) { + } + // bug:在选中一个NameObject并删除,会遗留下Name. + doBeforeRemove(); + if (GUICoreUtils.removeJListSelectedNodes(SwingUtilities + .getWindowAncestor(JListControlPane.this), nameableList)) { + checkButtonEnabled(); + doAfterRemove(); } } - /* - * CopyItem - */ - private class CopyItemAction extends UpdateAction { - public CopyItemAction() { - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Copy")); - this.setMnemonic('C'); - this.setSmallIcon(BaseUtils - .readIcon("/com/fr/design/images/m_edit/copy.png")); + @Override + public void onCopyItem() { + // p:选中的值. + ListModelElement selectedValue = (ListModelElement) nameableList.getSelectedValue(); + if (selectedValue == null) { + return; } - @Override - public void actionPerformed(ActionEvent evt) { - // p:选中的值. - ListModelElement selectedValue = (ListModelElement) nameableList.getSelectedValue(); - if (selectedValue == null) { - return; - } - - ((JControlUpdatePane) controlUpdatePane).update(); + ((JControlUpdatePane) controlUpdatePane).update(); - Nameable selectedNameable = selectedValue.wrapper; + Nameable selectedNameable = selectedValue.wrapper; - // p: 用反射机制实现 - try { - Nameable newNameable = (Nameable) BaseUtils.cloneObject(selectedNameable); - newNameable.setName(createUnrepeatedCopyName(selectedNameable.getName())); + // p: 用反射机制实现 + try { + Nameable newNameable = (Nameable) BaseUtils.cloneObject(selectedNameable); + newNameable.setName(createUnrepeatedCopyName(selectedNameable.getName())); - JListControlPane.this.addNameable(newNameable, nameableList.getSelectedIndex() + 1); - } catch (Exception e) { - FRContext.getLogger().error(e.getMessage(), e); - } + JListControlPane.this.addNameable(newNameable, nameableList.getSelectedIndex() + 1); + } catch (Exception e) { + FRContext.getLogger().error(e.getMessage(), e); } } - /* - * 上移Item - */ - private class MoveUpItemAction extends UpdateAction { - public MoveUpItemAction() { - this.setName(com.fr.design.i18n.Toolkit.i18nText("Utils-Move_Up")); - this.setMnemonic('U'); - this.setSmallIcon(BaseUtils - .readIcon("/com/fr/design/images/control/up.png")); + @Override + public void onMoveUpItem() { + int selectedIndex = nameableList.getSelectedIndex(); + if (selectedIndex == -1) { + return; } - @Override - public void actionPerformed(ActionEvent evt) { - int selectedIndex = nameableList.getSelectedIndex(); - if (selectedIndex == -1) { - return; - } - - // 上移 - if (selectedIndex > 0) { - DefaultListModel listModel = (DefaultListModel) nameableList - .getModel(); + // 上移 + if (selectedIndex > 0) { + DefaultListModel listModel = (DefaultListModel) nameableList + .getModel(); - Object selecteObj1 = listModel.get(selectedIndex - 1); - listModel.set(selectedIndex - 1, listModel.get(selectedIndex)); - listModel.set(selectedIndex, selecteObj1); + Object selecteObj1 = listModel.get(selectedIndex - 1); + listModel.set(selectedIndex - 1, listModel.get(selectedIndex)); + listModel.set(selectedIndex, selecteObj1); - nameableList.setSelectedIndex(selectedIndex - 1); - nameableList.ensureIndexIsVisible(selectedIndex - 1); - } + nameableList.setSelectedIndex(selectedIndex - 1); + nameableList.ensureIndexIsVisible(selectedIndex - 1); } } - /* - * 下移Item - */ - private class MoveDownItemAction extends UpdateAction { - public MoveDownItemAction() { - this.setName(com.fr.design.i18n.Toolkit.i18nText("Utils-Move_Down")); - this.setMnemonic('D'); - this.setSmallIcon(BaseUtils - .readIcon("/com/fr/design/images/control/down.png")); + @Override + public void onMoveDownItem() { + int selectedIndex = nameableList.getSelectedIndex(); + if (selectedIndex == -1) { + return; } - @Override - public void actionPerformed(ActionEvent evt) { - int selectedIndex = nameableList.getSelectedIndex(); - if (selectedIndex == -1) { - return; - } - - if (selectedIndex < nameableList.getModel().getSize() - 1) { - DefaultListModel listModel = (DefaultListModel) nameableList - .getModel(); + if (selectedIndex < nameableList.getModel().getSize() - 1) { + DefaultListModel listModel = (DefaultListModel) nameableList + .getModel(); - Object selecteObj1 = listModel.get(selectedIndex + 1); - listModel.set(selectedIndex + 1, listModel.get(selectedIndex)); - listModel.set(selectedIndex, selecteObj1); + Object selecteObj1 = listModel.get(selectedIndex + 1); + listModel.set(selectedIndex + 1, listModel.get(selectedIndex)); + listModel.set(selectedIndex, selecteObj1); - nameableList.setSelectedIndex(selectedIndex + 1); - nameableList.ensureIndexIsVisible(selectedIndex + 1); - } + nameableList.setSelectedIndex(selectedIndex + 1); + nameableList.ensureIndexIsVisible(selectedIndex + 1); } } - private class SortItemAction extends UpdateAction { - private boolean isAtoZ = false; - - public SortItemAction() { - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Sort")); - this.setMnemonic('S'); - this.setSmallIcon(BaseUtils - .readIcon("/com/fr/design/images/control/sortAsc.png")); + @Override + public void onSortItem(boolean isAtoZ) { + // p:选中的值. + Object selectedValue = nameableList.getSelectedValue(); + + DefaultListModel listModel = (DefaultListModel) nameableList + .getModel(); + Nameable[] nameableArray = new Nameable[listModel.getSize()]; + if (nameableArray.length <= 0) { + return; } - @Override - public void actionPerformed(ActionEvent evt) { - // p:选中的值. - Object selectedValue = nameableList.getSelectedValue(); - - DefaultListModel listModel = (DefaultListModel) nameableList - .getModel(); - Nameable[] nameableArray = new Nameable[listModel.getSize()]; - if (nameableArray.length <= 0) { - return; - } + for (int i = 0; i < listModel.getSize(); i++) { + nameableArray[i] = ((ListModelElement) listModel.getElementAt(i)).wrapper; + } - for (int i = 0; i < listModel.getSize(); i++) { - nameableArray[i] = ((ListModelElement) listModel.getElementAt(i)).wrapper; - } + // p:排序. + if (isAtoZ) { + Comparator nameableComparator = new Comparator() { + @Override + public int compare(Nameable o1, Nameable o2) { + return -ComparatorUtils.compare(o1.getName(), o2 + .getName()); + } + }; + isAtoZ = !isAtoZ; + Arrays.sort(nameableArray, nameableComparator); + } else { + Comparator nameableComparator = new Comparator() { + @Override + public int compare(Nameable o1, Nameable o2) { + return ComparatorUtils.compare(o1.getName(), o2 + .getName()); + } + }; + isAtoZ = !isAtoZ; + Arrays.sort(nameableArray, nameableComparator); + } - // p:排序. - if (isAtoZ) { - Comparator nameableComparator = new Comparator() { - @Override - public int compare(Nameable o1, Nameable o2) { - return -ComparatorUtils.compare(o1.getName(), o2 - .getName()); - } - }; - isAtoZ = !isAtoZ; - Arrays.sort(nameableArray, nameableComparator); - } else { - Comparator nameableComparator = new Comparator() { - @Override - public int compare(Nameable o1, Nameable o2) { - return ComparatorUtils.compare(o1.getName(), o2 - .getName()); - } - }; - isAtoZ = !isAtoZ; - Arrays.sort(nameableArray, nameableComparator); - } + for (int i = 0; i < nameableArray.length; i++) { + listModel.set(i, new ListModelElement(nameableArray[i])); + } - for (int i = 0; i < nameableArray.length; i++) { - listModel.set(i, new ListModelElement(nameableArray[i])); - } + // p:需要选中以前的那个值. + if (selectedValue != null) { + nameableList.setSelectedValue(selectedValue, true); + } - // p:需要选中以前的那个值. - if (selectedValue != null) { - nameableList.setSelectedValue(selectedValue, true); - } + checkButtonEnabled(); + // p:需要repaint. + nameableList.repaint(); + } - checkButtonEnabled(); - // p:需要repaint. - nameableList.repaint(); - } + @Override + public boolean isItemSelected() { + return getModel().getSize() > 0 && nameableList.getSelectedIndex() != -1; } /* @@ -690,129 +528,13 @@ public abstract class JListControlPane extends JControlPane { } } - public class AbsoluteEnableShortCut extends ShortCut4JControlPane { - public AbsoluteEnableShortCut(ShortCut shortCut) { - this.shortCut = shortCut; - } - - /** - * 检查是否可用 - */ - @Override - public void checkEnable() { - this.shortCut.setEnabled(true); - } - } - - public class NormalEnableShortCut extends ShortCut4JControlPane { - public NormalEnableShortCut(ShortCut shortCut) { - this.shortCut = shortCut; - } - - /** - * 检查是否可用 - */ - @Override - public void checkEnable() { - this.shortCut.setEnabled(getModel() - .getSize() > 0 - && JListControlPane.this.nameableList.getSelectedIndex() != -1); - } - } - - - private class JControlUpdatePane extends JPanel { - private CardLayout card; - private JPanel cardPane; - private BasicBeanPane[] updatePanes; - - private ListModelElement elEditing; - - public JControlUpdatePane() { - initUpdatePane(); - } - - private void initUpdatePane() { - NameableCreator[] creators = creators(); - if (creators == null) { - return; - } - card = new CardLayout(); - cardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); - cardPane.setLayout(card); - this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.add(cardPane); - int len = creators.length; - updatePanes = new BasicBeanPane[len]; - } - - public void populate() { - ListModelElement el = (ListModelElement) JListControlPane.this.nameableList.getSelectedValue(); - if (el == null) { - return; - } - - elEditing = el; - NameableCreator[] creators = creators(); - - for (int i = 0, len = updatePanes.length; i < len; i++) { - Object ob2Populate = creators[i].acceptObject2Populate(el.wrapper); - if (ob2Populate != null) { - if (updatePanes[i] == null) { - if (isMulti(creators[i].getUpdatePane()) || isTree(creators[i].getUpdatePane())) { - updatePanes[i] = createPaneByCreators(creators[i], el.wrapper.getName()); - } else { - updatePanes[i] = createPaneByCreators(creators[i]); - } - cardPane.add(updatePanes[i], String.valueOf(i)); - } - card.show(cardPane, String.valueOf(i)); - doBeforePopulate(el, ob2Populate); - updatePanes[i].populateBean(ob2Populate); - doWhenPopulate(updatePanes[i]); - break; - } - } - } - - public boolean isMulti(Class _class) { - return ComparatorUtils.equals(_class, GlobalMultiTDTableDataPane.class) || ComparatorUtils.equals(_class, MultiTDTableDataPane.class); - } - - public boolean isTree(Class _class) { - return ComparatorUtils.equals(_class, GlobalTreeTableDataPane.class) || ComparatorUtils.equals(_class, TreeTableDataPane.class); - } - - public void update() { - NameableCreator[] creators = creators(); - for (int i = 0; i < updatePanes.length; i++) { - BasicBeanPane pane = updatePanes[i]; - - if (pane != null && pane.isVisible()) { - Object bean = pane.updateBean(); - if (i < creators.length) { - creators[i].saveUpdatedBean(elEditing, bean); - } - } - } - } - - public void checkValid() throws Exception { - if (updatePanes != null) { - for (int i = 0; i < updatePanes.length; i++) { - if (updatePanes[i] != null) { - updatePanes[i].checkValid(); - } - } - } - } - } - - protected BasicBeanPane createPaneByCreators(NameableCreator creator) { + @Override + public BasicBeanPane createPaneByCreators(NameableCreator creator) { return Reflect.on(creator.getUpdatePane()).create().get(); } - private BasicBeanPane createPaneByCreators(NameableCreator creator, String string) { + @Override + public BasicBeanPane createPaneByCreators(NameableCreator creator, String string) { return Reflect.on(creator.getUpdatePane()).create(string).get(); } @@ -827,7 +549,7 @@ public abstract class JListControlPane extends JControlPane { } private int getInValidIndex() { - BasicBeanPane[] p = ((JControlUpdatePane) controlUpdatePane).updatePanes; + BasicBeanPane[] p = ((JControlUpdatePane) controlUpdatePane).getUpdatePanes(); if (p != null) { for (int i = 0; i < p.length; i++) { if (p[i] != null) { @@ -866,12 +588,8 @@ public abstract class JListControlPane extends JControlPane { nameableList.setSelectedIndex(index); } - - /** - * 用于在list面板中,过滤某些下拉选项 - * @return true:过滤掉这个creator - */ - protected boolean filterNameableCreator(NameableCreator creator) { - return !HyperlinkFilterHelper.whetherAddHyperlink4cell(creator.menuName()); + @Override + public ListModelElement getSelectedElement() { + return (ListModelElement) JListControlPane.this.nameableList.getSelectedValue(); } } diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneHandlers.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneHandlers.java new file mode 100644 index 0000000000..868f97e0b5 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneHandlers.java @@ -0,0 +1,71 @@ +package com.fr.design.gui.controlpane; + +import com.fr.design.gui.ilist.ListModelElement; +import com.fr.general.ComparatorUtils; +import com.fr.stable.ArrayUtils; +import com.fr.stable.Nameable; + +import javax.swing.DefaultListModel; + +/** + * Created by plough on 2018/8/13. + */ +public class ListControlPaneHandlers { + ListControlPaneProvider listControlPane; + + private ListControlPaneHandlers(ListControlPaneProvider listControlPane) { + this.listControlPane = listControlPane; + } + + public ListControlPaneHandlers newInstance(ListControlPaneProvider listControlPane) { + return new ListControlPaneHandlers(listControlPane); + } + + + private String createUnrepeatedCopyName(String suffix) { + DefaultListModel model = listControlPane.getModel(); + String[] names = new String[model.getSize()]; + for (int i = 0; i < model.size(); i++) { + names[i] = ((ListModelElement) model.get(i)).wrapper.getName(); + } + String lastName = "CopyOf" + suffix; + while (ArrayUtils.contains(names, lastName)) { + lastName = "CopyOf" + lastName; + } + return lastName; + } + + + /** + * 生成不重复的名字 + * + * @param prefix 名字前缀 + * @return 名字 + */ + public String createUnrepeatedName(String prefix) { + DefaultListModel model = listControlPane.getModel(); + Nameable[] all = new Nameable[model.getSize()]; + for (int i = 0; i < model.size(); i++) { + all[i] = ((ListModelElement) model.get(i)).wrapper; + } + // richer:生成的名字从1开始. kunsnat: 添加属性从0开始. + int count = all.length + 1; + while (true) { + String name_test = prefix + count; + boolean repeated = false; + for (int i = 0, len = model.size(); i < len; i++) { + Nameable nameable = all[i]; + if (ComparatorUtils.equals(nameable.getName(), name_test)) { + repeated = true; + break; + } + } + + if (!repeated) { + return name_test; + } + + count++; + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneProvider.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneProvider.java new file mode 100644 index 0000000000..43dcd72600 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneProvider.java @@ -0,0 +1,14 @@ +package com.fr.design.gui.controlpane; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.ilist.ListModelElement; + +/** + * Created by plough on 2018/8/13. + */ +public interface ListControlPaneProvider { + NameableCreator[] creators(); + ListModelElement getSelectedElement(); + BasicBeanPane createPaneByCreators(NameableCreator creator); + BasicBeanPane createPaneByCreators(NameableCreator creator, String string); +} diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectJControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectJControlPane.java index 2fd680a9c5..5fc72214c5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectJControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectJControlPane.java @@ -22,7 +22,7 @@ public abstract class ObjectJControlPane extends JListControlPane { } @Override - protected BasicBeanPane createPaneByCreators(NameableCreator creator) { + public BasicBeanPane createPaneByCreators(NameableCreator creator) { try { return Reflect.on(creator.getUpdatePane()).create(object).get(); } catch (Exception e) { diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectUIControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectUIControlPane.java index 3b2a1b0711..4cfad0c57e 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectUIControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectUIControlPane.java @@ -20,7 +20,7 @@ public abstract class ObjectUIControlPane extends UIListControlPane { } @Override - protected BasicBeanPane createPaneByCreators(NameableCreator creator) { + public BasicBeanPane createPaneByCreators(NameableCreator creator) { try { if (object == null) { return super.createPaneByCreators(creator); diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/ShortCutListenerProvider.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/ShortCutListenerProvider.java new file mode 100644 index 0000000000..5ee93bd47f --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/ShortCutListenerProvider.java @@ -0,0 +1,15 @@ +package com.fr.design.gui.controlpane; + +/** + * Created by plough on 2018/8/12. + */ +public interface ShortCutListenerProvider { + void onAddItem(NameableCreator creator); + void onRemoveItem(); + void onCopyItem(); + void onMoveUpItem(); + void onMoveDownItem(); + void onSortItem(boolean isAtoZ); + boolean isItemSelected(); + NameableCreator[] creators(); +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java index d0a4c12c5f..546aceb55c 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java @@ -2,7 +2,6 @@ package com.fr.design.gui.controlpane; import com.fr.base.chart.BasePlot; import com.fr.design.constants.UIConstants; -import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itoolbar.UIToolBarUI; import com.fr.design.gui.itoolbar.UIToolbar; @@ -11,10 +10,8 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.DesignerContext; import com.fr.design.menu.ShortCut; -import com.fr.design.menu.ToolBarDef; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.stable.ArrayUtils; -import com.fr.stable.Nameable; import com.fr.stable.StringUtils; import javax.swing.BorderFactory; @@ -49,85 +46,30 @@ import java.awt.event.WindowEvent; /** * Created by plough on 2017/7/21. */ -public abstract class UIControlPane extends BasicPane implements UnrepeatedNameHelper { - protected static final int SHORT_WIDTH = 30; //每加一个short Divider位置加30 - protected JPanel controlUpdatePane; - private ShortCut4JControlPane[] shorts; - private NameableCreator[] creators; - private ToolBarDef toolbarDef; - private UIToolbar toolBar; +abstract class UIControlPane extends JControlPane { private UIToolbar topToolBar; protected Window popupEditDialog; - // peter:这是整体的一个cardLayout Pane - protected CardLayout cardLayout; - protected JPanel cardPane; protected BasePlot plot; private static final int TOP_TOOLBAR_HEIGHT = 20; private static final int TOP_TOOLBAR_WIDTH = 156; // 可能因为用了tablelayout,要比其他地方多一个像素,看起来才正常 private static final int TOP_TOOLBAR_WIDTH_SHORT = 76; - public UIControlPane() { - this.initComponentPane(); + UIControlPane() { + super(); } - public UIControlPane(BasePlot plot) { + UIControlPane(BasePlot plot) { + super(); this.plot = plot; - this.initComponentPane(); } - /** - * 生成添加按钮的NameableCreator - * - * @return 按钮的NameableCreator - */ - public abstract NameableCreator[] createNameableCreators(); - - public ShortCut4JControlPane[] getShorts() { - return shorts; - } - - public void setShorts(ShortCut4JControlPane[] shorts) { - this.shorts = shorts; - } - - public void setCreators(NameableCreator[] creators) { - this.creators = creators; - } - - public ToolBarDef getToolbarDef() { - return toolbarDef; - } - - public void setToolbarDef(ToolBarDef toolbarDef) { - this.toolbarDef = toolbarDef; - } - - public UIToolbar getToolBar() { - return toolBar; - } - - public void setToolBar(UIToolbar toolBar) { - this.toolBar = toolBar; - } - - public CardLayout getCardLayout() { - return cardLayout; - } - - public void setCardLayout(CardLayout cardLayout) { - this.cardLayout = cardLayout; - } - - public JPanel getCardPane() { - return cardPane; - } + public abstract void saveSettings(); - public void setCardPane(JPanel cardPane) { - this.cardPane = cardPane; + @Override + protected void initShortCutFactory() { + this.shortCutFactory = NewShortCutFactory.newInstance(this); } - public abstract void saveSettings(); - // 是否使用新样式 protected boolean isNewStyle() { return true; @@ -169,11 +111,22 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH this.checkButtonEnabled(); } - protected void getPopupEditDialog(JPanel cardPane) { + private void getPopupEditDialog(JPanel cardPane) { popupEditDialog = new PopupEditDialog(cardPane); } - protected abstract JPanel createControlUpdatePane(); + @Override + protected void initToolBar() { + super.initToolBar(); + toolBar.setUI(new UIToolBarUI() { + @Override + public void paint(Graphics g, JComponent c) { + Graphics2D g2 = (Graphics2D) g; + g2.setColor(Color.WHITE); + g2.fillRect(0, 0, c.getWidth(), c.getHeight()); + } + }); + } protected JPanel getLeftPane() { // LeftPane @@ -188,20 +141,8 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH return leftPane; } - toolbarDef = new ToolBarDef(); - for (ShortCut4JControlPane sj : shorts) { - toolbarDef.addShortCut(sj.getShortCut()); - } - toolBar = ToolBarDef.createJToolBar(); - toolBar.setUI(new UIToolBarUI() { - @Override - public void paint(Graphics g, JComponent c) { - Graphics2D g2 = (Graphics2D) g; - g2.setColor(Color.WHITE); - g2.fillRect(0, 0, c.getWidth(), c.getHeight()); - } - }); - toolbarDef.updateToolBar(toolBar); + initToolBar(); + // 封装一层,加边框 JPanel toolBarPane = new JPanel(new BorderLayout()); toolBarPane.add(toolBar, BorderLayout.CENTER); @@ -220,7 +161,7 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH }); topToolBar.setBorder(null); topToolBar.setLayout(new BorderLayout()); - ShortCut addItem = addItemShortCut().getShortCut(); + ShortCut addItem = shortCutFactory.addItemShortCut().getShortCut(); addItem.intoJToolBar(topToolBar); JPanel leftTopPane = getLeftTopPane(topToolBar); @@ -249,85 +190,22 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH return "add item "; } - /** - * 初始化左边面板 - */ - protected void initLeftPane(JPanel leftPane) { - - } - - protected int getLeftPreferredSize() { - return shorts.length * SHORT_WIDTH; - } - - protected ShortCut4JControlPane[] createShortcuts() { - return new ShortCut4JControlPane[]{ - copyItemShortCut(), - moveUpItemShortCut(), - moveDownItemShortCut(), - sortItemShortCut(), - removeItemShortCut() - }; - } - - protected abstract ShortCut4JControlPane addItemShortCut(); - - protected abstract ShortCut4JControlPane removeItemShortCut(); - - protected abstract ShortCut4JControlPane copyItemShortCut(); - - protected abstract ShortCut4JControlPane moveUpItemShortCut(); - - protected abstract ShortCut4JControlPane moveDownItemShortCut(); - - protected abstract ShortCut4JControlPane sortItemShortCut(); - - public abstract Nameable[] update(); - - - public void populate(Nameable[] nameableArray) { +// return AbstractShortCutFactory.getInstance(this).createNewShortCuts(); + return shortCutFactory.createShortCuts(); } - /** - * 检查按钮可用状态 Check button enabled. - */ - public void checkButtonEnabled() { - } - - protected void doBeforeRemove() { - } - - protected void doAfterRemove() { - } - - public NameableCreator[] creators() { - return creators == null ? new NameableCreator[0] : creators; - } - - protected abstract boolean hasInvalid(boolean isAdd); - /** * 刷新 NameableCreator * * @param creators 生成器 */ public void refreshNameableCreator(NameableCreator[] creators) { - this.creators = creators; - shorts = this.createShortcuts(); - toolbarDef.clearShortCuts(); - for (ShortCut4JControlPane sj : shorts) { - toolbarDef.addShortCut(sj.getShortCut()); - } - - toolbarDef.updateToolBar(toolBar); - toolBar.validate(); - toolBar.repaint(); - + super.refreshNameableCreator(creators); // 顶部按钮 topToolBar.removeAll(); - ShortCut addItem = addItemShortCut().getShortCut(); + ShortCut addItem = shortCutFactory.addItemShortCut().getShortCut(); addItem.intoJToolBar(topToolBar); topToolBar.validate(); this.controlUpdatePane = createControlUpdatePane();//REPORT-4841 刷新一下编辑面板 @@ -337,13 +215,13 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH } // 点击"编辑"按钮,弹出面板 - protected class PopupEditDialog extends JDialog { + class PopupEditDialog extends JDialog { private JComponent editPane; private PopupToolPane popupToolPane; private static final int WIDTH = 570; private static final int HEIGHT = 490; - public PopupEditDialog(JComponent pane) { + PopupEditDialog(JComponent pane) { super(DesignerContext.getDesignerFrame()); setUndecorated(true); pane.setBorder(BorderFactory.createEmptyBorder(20, 10, 10, 10)); @@ -475,11 +353,11 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH } }; - public PopupToolPane(JDialog parentDialog) { + PopupToolPane(JDialog parentDialog) { this(StringUtils.EMPTY, parentDialog); } - public PopupToolPane(String title, JDialog parentDialog) { + PopupToolPane(String title, JDialog parentDialog) { super(); this.parentDialog = parentDialog; originColor = UIConstants.DIALOG_TITLEBAR_BACKGROUND; diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java index 1c938b362d..9de012bbf7 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java @@ -3,39 +3,37 @@ package com.fr.design.gui.controlpane; import com.fr.base.BaseUtils; import com.fr.base.FRContext; import com.fr.base.chart.BasePlot; -import com.fr.design.actions.UpdateAction; -import com.fr.design.actions.core.ActionFactory; import com.fr.design.beans.BasicBeanPane; import com.fr.design.constants.UIConstants; -import com.fr.design.data.tabledata.tabledatapane.GlobalMultiTDTableDataPane; -import com.fr.design.data.tabledata.tabledatapane.GlobalTreeTableDataPane; -import com.fr.design.data.tabledata.tabledatapane.MultiTDTableDataPane; -import com.fr.design.data.tabledata.tabledatapane.TreeTableDataPane; -import com.fr.design.gui.HyperlinkFilterHelper; -import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.UINameEdList; -import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; -import com.fr.design.menu.LineSeparator; -import com.fr.design.menu.MenuDef; -import com.fr.design.menu.ShortCut; -import com.fr.design.menu.ToolBarDef; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; - import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; -import com.fr.stable.StringUtils; -import javax.swing.*; +import javax.swing.DefaultListModel; +import javax.swing.JList; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; +import javax.swing.ListSelectionModel; +import javax.swing.SwingUtilities; import javax.swing.event.ListDataEvent; import javax.swing.event.ListDataListener; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; -import java.awt.*; -import java.awt.event.*; +import java.awt.BorderLayout; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Toolkit; +import java.awt.Window; +import java.awt.event.InputEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.util.Arrays; @@ -45,7 +43,7 @@ import java.util.Comparator; * Created by plough on 2017/7/19. */ -public abstract class UIListControlPane extends UIControlPane { +public abstract class UIListControlPane extends UIControlPane implements ListControlPaneProvider { public static final String LIST_NAME = "UIControl_List"; private static final int EDIT_RANGE = 25; // 编辑按钮的x坐标范围 @@ -66,7 +64,7 @@ public abstract class UIListControlPane extends UIControlPane { @Override protected JPanel createControlUpdatePane() { - return new JControlUpdatePane(); + return JControlUpdatePane.newInstance(this); } /** @@ -141,55 +139,6 @@ public abstract class UIListControlPane extends UIControlPane { ((JControlUpdatePane) controlUpdatePane).update(); } - protected void doWhenPopulate(BasicBeanPane beanPane) { - - } - - protected void doBeforePopulate(ListModelElement el, Object obj) { - - } - - @Override - protected ShortCut4JControlPane addItemShortCut() { - ShortCut addItemShortCut; - NameableCreator[] creators = creators(); - if (creators.length == 1) { - addItemShortCut = new AddItemUpdateAction(creators); - } else { - addItemShortCut = getAddItemMenuDef(creators); - } - return new AbsoluteEnableShortCut(addItemShortCut); - } - - protected AddItemMenuDef getAddItemMenuDef (NameableCreator[] creators) { - return new AddItemMenuDef(creators); - } - - @Override - protected ShortCut4JControlPane removeItemShortCut() { - return new NormalEnableShortCut(new RemoveItemAction()); - } - - @Override - protected ShortCut4JControlPane copyItemShortCut() { - return new NormalEnableShortCut(new CopyItemAction()); - } - - @Override - protected ShortCut4JControlPane moveUpItemShortCut() { - return new NormalEnableShortCut(new MoveUpItemAction()); - } - - @Override - protected ShortCut4JControlPane moveDownItemShortCut() { - return new NormalEnableShortCut(new MoveDownItemAction()); - } - - @Override - protected ShortCut4JControlPane sortItemShortCut() { - return new NormalEnableShortCut(new SortItemAction()); - } - public void setNameListEditable(boolean editable) { this.nameableList.setEditable(editable); } @@ -259,22 +208,6 @@ public abstract class UIListControlPane extends UIControlPane { popupEditDialog(); } - /** - * 是否重命名 - * - * @return 是则true - */ - public boolean isContainsRename() { - String rename = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Please_Rename") + "!"; - String[] names = this.nameableList.getAllNames(); - for (int i = names.length - 1; i >= 0; i--) { - if (ComparatorUtils.equals(names[i], rename)) { - return true; - } - } - return false; - } - protected DefaultListModel getModel() { return (DefaultListModel) UIListControlPane.this.nameableList.getModel(); } @@ -377,320 +310,148 @@ public abstract class UIListControlPane extends UIControlPane { return resultPos; } - /** - * 增加项的UpdateAction - */ - protected class AddItemUpdateAction extends UpdateAction { - final NameableCreator creator; - - public AddItemUpdateAction(NameableCreator[] creators) { - this.creator = creators[0]; - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Add")); - this.setMnemonic('A'); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png")); - } - - /** - * Gets component on toolbar. - * - * @return the created components on toolbar. - */ - @Override - public JComponent createToolBarComponent() { - Object object = this.getValue(UIButton.class.getName()); - if (!(object instanceof AbstractButton)) { - // 直接使用默认UI - UIButton button = new UIButton(); - // 添加一个名字作为自动化测试用 - button.setName(getName()); - - //设置属性. - Integer mnemonicInteger = (Integer) this.getValue(Action.MNEMONIC_KEY); - if (mnemonicInteger != null) { - button.setMnemonic((char) mnemonicInteger.intValue()); - } - - button.setIcon((Icon) this.getValue(Action.SMALL_ICON)); - button.addActionListener(this); - - button.registerKeyboardAction(this, this.getAccelerator(), JComponent.WHEN_IN_FOCUSED_WINDOW); - - this.putValue(UIButton.class.getName(), button); - button.setText(StringUtils.EMPTY); - button.setEnabled(this.isEnabled()); - - //peter:产生tooltip - button.setToolTipText(ActionFactory.createButtonToolTipText(this)); - object = button; - } - - return (JComponent) object; - } - - @Override - public void actionPerformed(ActionEvent e) { - Nameable nameable = creator.createNameable(UIListControlPane.this); - - UIListControlPane.this.addNameable(nameable, getModel().getSize()); - } + @Override + public void onAddItem(NameableCreator creator) { + Nameable nameable = creator.createNameable(this); + this.addNameable(nameable, getModel().getSize()); } - /* - * 增加项的MenuDef - */ - protected class AddItemMenuDef extends MenuDef { - public AddItemMenuDef(NameableCreator[] creators) { - super(true); - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Add")); - this.setMnemonic('A'); - this.setIconPath("/com/fr/design/images/control/addPopup.png"); - wrapActionListener(creators); + @Override + public void onRemoveItem() { + try { + this.nameableList.getCellEditor().stopCellEditing(); + } catch (Exception ignored) { + // do nothing + } + // bug:在选中一个NameObject并删除,会遗留下Name. + doBeforeRemove(); + if (GUICoreUtils.removeJListSelectedNodes(SwingUtilities + .getWindowAncestor(this), nameableList)) { + checkButtonEnabled(); + doAfterRemove(); } + } - /** - * 生成UIButton - * @return 菜单按钮 - */ - public UIButton createUIButton() { - createdButton = super.createUIButton(); - // 此按钮单独抽出,不应使用工具栏外观 - if (!createdButton.isOpaque()) { - createdButton.setOpaque(true); - createdButton.setNormalPainted(true); - createdButton.setBorderPaintedOnlyWhenPressed(false); - } - return createdButton; + @Override + public void onCopyItem() { + // p:选中的值. + ListModelElement selectedValue = (ListModelElement) nameableList.getSelectedValue(); + if (selectedValue == null) { + return; } - private void wrapActionListener(NameableCreator[] creators) { - for (final NameableCreator creator : creators) { - if (!whetherAdd(creator.menuName())) { - continue; - } - boolean isTrue = ComparatorUtils.equals(creator.menuName(), com.fr.design.i18n.Toolkit.i18nText("Datasource-Stored_Procedure")) || - ComparatorUtils.equals(creator.menuName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Relation_TableData")) || ComparatorUtils.equals(creator.menuName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Multi_Dimensional_Database")); - if (isTrue) { - this.addShortCut(new LineSeparator()); - } - this.addShortCut(new UpdateAction() { - { - this.setName(creator.menuName()); - Icon icon = creator.menuIcon(); - if (icon != null) { - this.setSmallIcon(icon); - } - } - - @Override - public void actionPerformed(ActionEvent e) { - if (hasInvalid(true)) { - return; - } - - Nameable nameable = creator.createNameable(UIListControlPane.this); - - UIListControlPane.this.addNameable(nameable, getModel().getSize()); - } - }); - } - } + ((JControlUpdatePane) controlUpdatePane).update(); - protected boolean whetherAdd(String itemName){ - return HyperlinkFilterHelper.whetherAddHyperlink4cell(itemName); - } - } + Nameable selectedNameable = selectedValue.wrapper; - /* - * 移除item - */ - private class RemoveItemAction extends UpdateAction { - public RemoveItemAction() { - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Remove")); - this.setMnemonic('R'); - this.setSmallIcon(BaseUtils - .readIcon("/com/fr/base/images/cell/control/remove.png")); - } + // p: 用反射机制实现 + try { + Nameable newNameable = (Nameable) BaseUtils.cloneObject(selectedNameable); + newNameable.setName(createUnrepeatedCopyName(selectedNameable.getName())); - @Override - public void actionPerformed(ActionEvent evt) { - try { - UIListControlPane.this.nameableList.getCellEditor() - .stopCellEditing(); - } catch (Exception ignored) { - // do nothing - } - // bug:在选中一个NameObject并删除,会遗留下Name. - doBeforeRemove(); - if (GUICoreUtils.removeJListSelectedNodes(SwingUtilities - .getWindowAncestor(UIListControlPane.this), nameableList)) { - checkButtonEnabled(); - doAfterRemove(); - } + UIListControlPane.this.addNameable(newNameable, nameableList.getSelectedIndex() + 1); + } catch (Exception e) { + FRContext.getLogger().error(e.getMessage(), e); } } - /* - * CopyItem - */ - private class CopyItemAction extends UpdateAction { - public CopyItemAction() { - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Copy")); - this.setMnemonic('C'); - this.setSmallIcon(BaseUtils - .readIcon("/com/fr/design/images/m_edit/copy.png")); + @Override + public void onMoveUpItem() { + int selectedIndex = nameableList.getSelectedIndex(); + if (selectedIndex == -1) { + return; } - @Override - public void actionPerformed(ActionEvent evt) { - // p:选中的值. - ListModelElement selectedValue = (ListModelElement) nameableList.getSelectedValue(); - if (selectedValue == null) { - return; - } - - ((JControlUpdatePane) controlUpdatePane).update(); - - Nameable selectedNameable = selectedValue.wrapper; + // 上移 + if (selectedIndex > 0) { + DefaultListModel listModel = (DefaultListModel) nameableList + .getModel(); - // p: 用反射机制实现 - try { - Nameable newNameable = (Nameable) BaseUtils.cloneObject(selectedNameable); - newNameable.setName(createUnrepeatedCopyName(selectedNameable.getName())); + Object selecteObj1 = listModel.get(selectedIndex - 1); + listModel.set(selectedIndex - 1, listModel.get(selectedIndex)); + listModel.set(selectedIndex, selecteObj1); - UIListControlPane.this.addNameable(newNameable, nameableList.getSelectedIndex() + 1); - } catch (Exception e) { - FRContext.getLogger().error(e.getMessage(), e); - } + nameableList.setSelectedIndex(selectedIndex - 1); + nameableList.ensureIndexIsVisible(selectedIndex - 1); } } - /* - * 上移Item - */ - private class MoveUpItemAction extends UpdateAction { - public MoveUpItemAction() { - this.setName(com.fr.design.i18n.Toolkit.i18nText("Utils-Move_Up")); - this.setMnemonic('U'); - this.setSmallIcon(BaseUtils - .readIcon("/com/fr/design/images/control/up.png")); + @Override + public void onMoveDownItem() { + int selectedIndex = nameableList.getSelectedIndex(); + if (selectedIndex == -1) { + return; } - @Override - public void actionPerformed(ActionEvent evt) { - int selectedIndex = nameableList.getSelectedIndex(); - if (selectedIndex == -1) { - return; - } - - // 上移 - if (selectedIndex > 0) { - DefaultListModel listModel = (DefaultListModel) nameableList - .getModel(); + if (selectedIndex < nameableList.getModel().getSize() - 1) { + DefaultListModel listModel = (DefaultListModel) nameableList + .getModel(); - Object selecteObj1 = listModel.get(selectedIndex - 1); - listModel.set(selectedIndex - 1, listModel.get(selectedIndex)); - listModel.set(selectedIndex, selecteObj1); + Object selecteObj1 = listModel.get(selectedIndex + 1); + listModel.set(selectedIndex + 1, listModel.get(selectedIndex)); + listModel.set(selectedIndex, selecteObj1); - nameableList.setSelectedIndex(selectedIndex - 1); - nameableList.ensureIndexIsVisible(selectedIndex - 1); - } + nameableList.setSelectedIndex(selectedIndex + 1); + nameableList.ensureIndexIsVisible(selectedIndex + 1); } } - /* - * 下移Item - */ - private class MoveDownItemAction extends UpdateAction { - public MoveDownItemAction() { - this.setName(com.fr.design.i18n.Toolkit.i18nText("Utils-Move_Down")); - this.setMnemonic('D'); - this.setSmallIcon(BaseUtils - .readIcon("/com/fr/design/images/control/down.png")); + @Override + public void onSortItem(boolean isAtoZ) { + // p:选中的值. + Object selectedValue = nameableList.getSelectedValue(); + + DefaultListModel listModel = (DefaultListModel) nameableList + .getModel(); + Nameable[] nameableArray = new Nameable[listModel.getSize()]; + if (nameableArray.length <= 0) { + return; } - @Override - public void actionPerformed(ActionEvent evt) { - int selectedIndex = nameableList.getSelectedIndex(); - if (selectedIndex == -1) { - return; - } - - if (selectedIndex < nameableList.getModel().getSize() - 1) { - DefaultListModel listModel = (DefaultListModel) nameableList - .getModel(); - - Object selecteObj1 = listModel.get(selectedIndex + 1); - listModel.set(selectedIndex + 1, listModel.get(selectedIndex)); - listModel.set(selectedIndex, selecteObj1); - - nameableList.setSelectedIndex(selectedIndex + 1); - nameableList.ensureIndexIsVisible(selectedIndex + 1); - } + for (int i = 0; i < listModel.getSize(); i++) { + nameableArray[i] = ((ListModelElement) listModel.getElementAt(i)).wrapper; } - } - - private class SortItemAction extends UpdateAction { - private boolean isAtoZ = false; - public SortItemAction() { - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Sort")); - this.setMnemonic('S'); - this.setSmallIcon(BaseUtils - .readIcon("/com/fr/design/images/control/sortAsc.png")); + // p:排序. + if (isAtoZ) { + Comparator nameableComparator = new Comparator() { + @Override + public int compare(Nameable o1, Nameable o2) { + return -ComparatorUtils.compare(o1.getName(), o2 + .getName()); + } + }; + isAtoZ = !isAtoZ; + Arrays.sort(nameableArray, nameableComparator); + } else { + Comparator nameableComparator = new Comparator() { + @Override + public int compare(Nameable o1, Nameable o2) { + return ComparatorUtils.compare(o1.getName(), o2 + .getName()); + } + }; + isAtoZ = !isAtoZ; + Arrays.sort(nameableArray, nameableComparator); } - @Override - public void actionPerformed(ActionEvent evt) { - // p:选中的值. - Object selectedValue = nameableList.getSelectedValue(); - - DefaultListModel listModel = (DefaultListModel) nameableList - .getModel(); - Nameable[] nameableArray = new Nameable[listModel.getSize()]; - if (nameableArray.length <= 0) { - return; - } - - for (int i = 0; i < listModel.getSize(); i++) { - nameableArray[i] = ((ListModelElement) listModel.getElementAt(i)).wrapper; - } - - // p:排序. - if (isAtoZ) { - Comparator nameableComparator = new Comparator() { - @Override - public int compare(Nameable o1, Nameable o2) { - return -ComparatorUtils.compare(o1.getName(), o2 - .getName()); - } - }; - isAtoZ = !isAtoZ; - Arrays.sort(nameableArray, nameableComparator); - } else { - Comparator nameableComparator = new Comparator() { - @Override - public int compare(Nameable o1, Nameable o2) { - return ComparatorUtils.compare(o1.getName(), o2 - .getName()); - } - }; - isAtoZ = !isAtoZ; - Arrays.sort(nameableArray, nameableComparator); - } + for (int i = 0; i < nameableArray.length; i++) { + listModel.set(i, new ListModelElement(nameableArray[i])); + } - for (int i = 0; i < nameableArray.length; i++) { - listModel.set(i, new ListModelElement(nameableArray[i])); - } + // p:需要选中以前的那个值. + if (selectedValue != null) { + nameableList.setSelectedValue(selectedValue, true); + } - // p:需要选中以前的那个值. - if (selectedValue != null) { - nameableList.setSelectedValue(selectedValue, true); - } + checkButtonEnabled(); + // p:需要repaint. + nameableList.repaint(); + } - checkButtonEnabled(); - // p:需要repaint. - nameableList.repaint(); - } + @Override + public boolean isItemSelected() { + return getModel().getSize() > 0 && nameableList.getSelectedIndex() != -1; } /* @@ -768,179 +529,7 @@ public abstract class UIListControlPane extends UIControlPane { } } - - public class AbsoluteEnableShortCut extends ShortCut4JControlPane { - public AbsoluteEnableShortCut(ShortCut shortCut) { - this.shortCut = shortCut; - } - - /** - * 检查是否可用 - */ - @Override - public void checkEnable() { - this.shortCut.setEnabled(true); - } - } - - public class NormalEnableShortCut extends ShortCut4JControlPane { - public NormalEnableShortCut(ShortCut shortCut) { - this.shortCut = shortCut; - } - - /** - * 检查是否可用 - */ - @Override - public void checkEnable() { - this.shortCut.setEnabled(getModel() - .getSize() > 0 - && UIListControlPane.this.nameableList.getSelectedIndex() != -1); - } - } - - public class SortEnableShortCut extends ShortCut4JControlPane { - public SortEnableShortCut(ShortCut shortCut) { - this.shortCut = shortCut; - } - - /** - * 检查是否可用 - */ - @Override - public void checkEnable() { - this.shortCut.setEnabled(getModel().getSize() > 1); - } - - } - - public class MoveUpEnableShortCut extends ShortCut4JControlPane { - public MoveUpEnableShortCut(ShortCut shortCut) { - this.shortCut = shortCut; - } - - /** - * 检查是否可用 - */ - @Override - public void checkEnable() { - this.shortCut.setEnabled(getModel().getSize() > 1 - && UIListControlPane.this.nameableList.getSelectedIndex() > 0); - } - - } - - public class MoveDownEnableShortCut extends ShortCut4JControlPane { - public MoveDownEnableShortCut(ShortCut shortCut) { - this.shortCut = shortCut; - } - - /** - * 检查是否可用 - */ - @Override - public void checkEnable() { - this.shortCut.setEnabled(getModel().getSize() > 1 - && UIListControlPane.this.nameableList.getSelectedIndex() < UIListControlPane.this.nameableList.getModel().getSize() - 1); - } - - } - - - protected Object getob2Populate (Object ob2Populate) { - return ob2Populate; - } - - private class JControlUpdatePane extends JPanel { - private CardLayout card; - private JPanel cardPane; - private BasicBeanPane[] updatePanes; - - private ListModelElement elEditing; - - public JControlUpdatePane() { - initUpdatePane(); - } - - private void initUpdatePane() { - NameableCreator[] creators = creators(); - if (creators == null) { - return; - } - card = new CardLayout(); - cardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); - cardPane.setLayout(card); - this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.add(cardPane); - int len = creators.length; - updatePanes = new BasicBeanPane[len]; - } - - public void populate() { - ListModelElement el = (ListModelElement) UIListControlPane.this.nameableList.getSelectedValue(); - if (el == null) { - return; - } - - elEditing = el; - NameableCreator[] creators = creators(); - - for (int i = 0, len = updatePanes.length; i < len; i++) { - Object ob2Populate = creators[i].acceptObject2Populate(el.wrapper); - ob2Populate = getob2Populate(ob2Populate); - if (ob2Populate != null) { - if (updatePanes[i] == null) { - if (isMulti(creators[i].getUpdatePane()) || isTree(creators[i].getUpdatePane())) { - updatePanes[i] = createPaneByCreators(creators[i], el.wrapper.getName()); - } else { - updatePanes[i] = createPaneByCreators(creators[i]); - } - cardPane.add(updatePanes[i], String.valueOf(i)); - } - card.show(cardPane, String.valueOf(i)); - doBeforePopulate(el, ob2Populate); - updatePanes[i].populateBean(ob2Populate); - doWhenPopulate(updatePanes[i]); - break; - } - } - } - - - public boolean isMulti(Class _class) { - return ComparatorUtils.equals(_class, GlobalMultiTDTableDataPane.class) || ComparatorUtils.equals(_class, MultiTDTableDataPane.class); - } - - public boolean isTree(Class _class) { - return ComparatorUtils.equals(_class, GlobalTreeTableDataPane.class) || ComparatorUtils.equals(_class, TreeTableDataPane.class); - } - - public void update() { - NameableCreator[] creators = creators(); - for (int i = 0; i < updatePanes.length; i++) { - BasicBeanPane pane = updatePanes[i]; - - if (pane != null && pane.isVisible()) { - Object bean = pane.updateBean(); - if (i < creators.length) { - creators[i].saveUpdatedBean(elEditing, bean); - } - } - } - } - - public void checkValid() throws Exception { - if (updatePanes != null) { - for (int i = 0; i < updatePanes.length; i++) { - if (updatePanes[i] != null) { - updatePanes[i].checkValid(); - } - } - } - } - } - - protected BasicBeanPane createPaneByCreators(NameableCreator creator) { + public BasicBeanPane createPaneByCreators(NameableCreator creator) { try { return creator.getUpdatePane().newInstance(); } catch (InstantiationException e) { @@ -950,7 +539,7 @@ public abstract class UIListControlPane extends UIControlPane { } } - protected BasicBeanPane createPaneByCreators(NameableCreator creator, String string) { + public BasicBeanPane createPaneByCreators(NameableCreator creator, String string) { Constructor constructor = null; try { constructor = creator.getUpdatePane().getDeclaredConstructor(new Class[]{String.class}); @@ -965,21 +554,6 @@ public abstract class UIListControlPane extends UIControlPane { } catch (InvocationTargetException e) { throw new RuntimeException(e); } - - } - - // 选项添加个数有限制等情况下 要求能控制快捷按钮的状态 - protected void setToolbarDefEnable(int shortCutIndex, int itemIndex, boolean enabled) { - ToolBarDef toolbarDef = getToolbarDef(); - if (toolbarDef.getShortCutCount() > shortCutIndex) { - ShortCut sc = toolbarDef.getShortCut(shortCutIndex); - if (sc instanceof AddItemMenuDef) { - AddItemMenuDef am = (AddItemMenuDef) sc; - if (am.getShortCutCount() > itemIndex) { - am.getShortCut(itemIndex).setEnabled(enabled); - } - } - } } /** @@ -993,7 +567,7 @@ public abstract class UIListControlPane extends UIControlPane { } private int getInValidIndex() { - BasicBeanPane[] p = ((JControlUpdatePane) controlUpdatePane).updatePanes; + BasicBeanPane[] p = ((JControlUpdatePane) controlUpdatePane).getUpdatePanes(); if (p != null) { for (int i = 0; i < p.length; i++) { if (p[i] != null) { @@ -1031,4 +605,8 @@ public abstract class UIListControlPane extends UIControlPane { nameableList.setSelectedIndex(index); } + @Override + public ListModelElement getSelectedElement() { + return (ListModelElement) this.nameableList.getSelectedValue(); + } } diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/AbstractShortCutFactory.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/AbstractShortCutFactory.java new file mode 100644 index 0000000000..ff1c34fd67 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/AbstractShortCutFactory.java @@ -0,0 +1,179 @@ +package com.fr.design.gui.controlpane.shortcutfactory; + +import com.fr.base.BaseUtils; +import com.fr.design.actions.UpdateAction; +import com.fr.design.gui.controlpane.NameableCreator; +import com.fr.design.gui.controlpane.ShortCut4JControlPane; +import com.fr.design.gui.controlpane.ShortCutListenerProvider; +import com.fr.design.menu.ShortCut; +import com.fr.general.Inter; + +import java.awt.event.ActionEvent; + +/** + * 生成 ShortCut 的抽象工厂 + * Created by plough on 2018/8/2. + */ +public abstract class AbstractShortCutFactory { + protected ShortCutListenerProvider listener; + + AbstractShortCutFactory(ShortCutListenerProvider listener) { + setListener(listener); + } + + /** + * 生成一组默认的 ShortCut + */ + abstract public ShortCut4JControlPane[] createShortCuts(); + + abstract public ShortCut createAddItemUpdateAction(NameableCreator[] creator); + + abstract public ShortCut createAddItemMenuDef(NameableCreator[] creator); + + public ShortCut4JControlPane addItemShortCut() { + ShortCut addItemShortCut; + NameableCreator[] creators = listener.creators(); + if (creators.length == 1) { + addItemShortCut = createAddItemUpdateAction(creators); + } else { + addItemShortCut = createAddItemMenuDef(creators); + } + return new AbsoluteEnableShortCut(addItemShortCut); + } + + public ShortCut4JControlPane removeItemShortCut() { + return new NormalEnableShortCut(new RemoveItemAction()); + } + + public ShortCut4JControlPane copyItemShortCut() { + return new NormalEnableShortCut(new CopyItemAction()); + } + + public ShortCut4JControlPane moveUpItemShortCut() { + return new NormalEnableShortCut(new MoveUpItemAction()); + } + + public ShortCut4JControlPane moveDownItemShortCut() { + return new NormalEnableShortCut(new MoveDownItemAction()); + } + + public ShortCut4JControlPane sortItemShortCut() { + return new NormalEnableShortCut(new SortItemAction()); + } + + public void setListener(ShortCutListenerProvider listener) { + this.listener = listener; + } + + private class AbsoluteEnableShortCut extends ShortCut4JControlPane { + AbsoluteEnableShortCut(ShortCut shortCut) { + this.shortCut = shortCut; + } + + /** + * 检查是否可用 + */ + @Override + public void checkEnable() { + this.shortCut.setEnabled(true); + } + } + + private class NormalEnableShortCut extends ShortCut4JControlPane { + NormalEnableShortCut(ShortCut shortCut) { + this.shortCut = shortCut; + } + + /** + * 检查是否可用 + */ + @Override + public void checkEnable() { + this.shortCut.setEnabled(listener.isItemSelected()); + } + } + + /* + * 移除item + */ + private class RemoveItemAction extends UpdateAction { + RemoveItemAction() { + this.setName(Inter.getLocText("FR-Action_Remove")); + this.setMnemonic('R'); + this.setSmallIcon(BaseUtils + .readIcon("/com/fr/base/images/cell/control/remove.png")); + } + + @Override + public void actionPerformed(ActionEvent evt) { + listener.onRemoveItem(); + } + } + + /* + * CopyItem + */ + private class CopyItemAction extends UpdateAction { + CopyItemAction() { + this.setName(Inter.getLocText("FR-Action_Copy")); + this.setMnemonic('C'); + this.setSmallIcon(BaseUtils + .readIcon("/com/fr/design/images/m_edit/copy.png")); + } + + @Override + public void actionPerformed(ActionEvent evt) { + listener.onCopyItem(); + } + } + + /* + * 上移Item + */ + private class MoveUpItemAction extends UpdateAction { + MoveUpItemAction() { + this.setName(Inter.getLocText("Utils-Move_Up")); + this.setMnemonic('U'); + this.setSmallIcon(BaseUtils + .readIcon("/com/fr/design/images/control/up.png")); + } + + @Override + public void actionPerformed(ActionEvent evt) { + listener.onMoveUpItem(); + } + } + + /* + * 下移Item + */ + private class MoveDownItemAction extends UpdateAction { + MoveDownItemAction() { + this.setName(Inter.getLocText("Utils-Move_Down")); + this.setMnemonic('D'); + this.setSmallIcon(BaseUtils + .readIcon("/com/fr/design/images/control/down.png")); + } + + @Override + public void actionPerformed(ActionEvent evt) { + listener.onMoveDownItem(); + } + } + + private class SortItemAction extends UpdateAction { + private boolean isAtoZ = false; + + SortItemAction() { + this.setName(Inter.getLocText("FR-Action_Sort")); + this.setMnemonic('S'); + this.setSmallIcon(BaseUtils + .readIcon("/com/fr/design/images/control/sortAsc.png")); + } + + @Override + public void actionPerformed(ActionEvent evt) { + listener.onSortItem(isAtoZ); + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/NewShortCutFactory.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/NewShortCutFactory.java new file mode 100644 index 0000000000..f7fa96f0cf --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/NewShortCutFactory.java @@ -0,0 +1,172 @@ +package com.fr.design.gui.controlpane.shortcutfactory; + +import com.fr.base.BaseUtils; +import com.fr.design.actions.UpdateAction; +import com.fr.design.actions.core.ActionFactory; +import com.fr.design.gui.HyperlinkFilterHelper; +import com.fr.design.gui.controlpane.AbstractShortCutFactory; +import com.fr.design.gui.controlpane.NameableCreator; +import com.fr.design.gui.controlpane.ShortCut4JControlPane; +import com.fr.design.gui.controlpane.ShortCutListenerProvider; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.menu.LineSeparator; +import com.fr.design.menu.MenuDef; +import com.fr.design.menu.ShortCut; +import com.fr.general.ComparatorUtils; +import com.fr.stable.StringUtils; + +import javax.swing.AbstractButton; +import javax.swing.Action; +import javax.swing.Icon; +import javax.swing.JComponent; +import java.awt.event.ActionEvent; + +/** + * Created by plough on 2018/8/13. + */ +public class NewShortCutFactory extends AbstractShortCutFactory { + + protected NewShortCutFactory(ShortCutListenerProvider listenerProvider) { + super(listenerProvider); + } + + public static NewShortCutFactory newInstance(ShortCutListenerProvider listenerProvider) { + return new NewShortCutFactory(listenerProvider); + } + + @Override + public ShortCut4JControlPane[] createShortCuts() { + return new ShortCut4JControlPane[]{ + copyItemShortCut(), + moveUpItemShortCut(), + moveDownItemShortCut(), + sortItemShortCut(), + removeItemShortCut() + }; + } + + @Override + public ShortCut createAddItemUpdateAction(NameableCreator[] creators) { + return new AddItemUpdateAction(creators); + } + + @Override + public ShortCut createAddItemMenuDef(NameableCreator[] creators) { + return new AddItemMenuDef(creators); + } + + /** + * 增加项的UpdateAction + */ + protected class AddItemUpdateAction extends UpdateAction { + final NameableCreator creator; + + public AddItemUpdateAction(NameableCreator[] creators) { + this.creator = creators[0]; + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Add")); + this.setMnemonic('A'); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png")); + } + + /** + * Gets component on toolbar. + * + * @return the created components on toolbar. + */ + @Override + public JComponent createToolBarComponent() { + Object object = this.getValue(UIButton.class.getName()); + if (!(object instanceof AbstractButton)) { + // 直接使用默认UI + UIButton button = new UIButton(); + // 添加一个名字作为自动化测试用 + button.setName(getName()); + + //设置属性. + Integer mnemonicInteger = (Integer) this.getValue(Action.MNEMONIC_KEY); + if (mnemonicInteger != null) { + button.setMnemonic((char) mnemonicInteger.intValue()); + } + + button.setIcon((Icon) this.getValue(Action.SMALL_ICON)); + button.addActionListener(this); + + button.registerKeyboardAction(this, this.getAccelerator(), JComponent.WHEN_IN_FOCUSED_WINDOW); + + this.putValue(UIButton.class.getName(), button); + button.setText(StringUtils.EMPTY); + button.setEnabled(this.isEnabled()); + + //peter:产生tooltip + button.setToolTipText(ActionFactory.createButtonToolTipText(this)); + object = button; + } + + return (JComponent) object; + } + + @Override + public void actionPerformed(ActionEvent e) { + listener.onAddItem(creator); + } + } + + /* + * 增加项的MenuDef + */ + protected class AddItemMenuDef extends MenuDef { + public AddItemMenuDef(NameableCreator[] creators) { + super(true); + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Add")); + this.setMnemonic('A'); + this.setIconPath("/com/fr/design/images/control/addPopup.png"); + wrapActionListener(creators); + } + + /** + * 生成UIButton + * @return 菜单按钮 + */ + public UIButton createUIButton() { + createdButton = super.createUIButton(); + // 此按钮单独抽出,不应使用工具栏外观 + if (!createdButton.isOpaque()) { + createdButton.setOpaque(true); + createdButton.setNormalPainted(true); + createdButton.setBorderPaintedOnlyWhenPressed(false); + } + return createdButton; + } + + private void wrapActionListener(NameableCreator[] creators) { + for (final NameableCreator creator : creators) { + if (!whetherAdd(creator.menuName())) { + continue; + } + boolean isTrue = ComparatorUtils.equals(creator.menuName(), com.fr.design.i18n.Toolkit.i18nText("Datasource-Stored_Procedure")) || + ComparatorUtils.equals(creator.menuName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Relation_TableData")) || ComparatorUtils.equals(creator.menuName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Multi_Dimensional_Database")); + if (isTrue) { + this.addShortCut(new LineSeparator()); + } + this.addShortCut(new UpdateAction() { + { + this.setName(creator.menuName()); + Icon icon = creator.menuIcon(); + if (icon != null) { + this.setSmallIcon(icon); + } + } + + @Override + public void actionPerformed(ActionEvent e) { + listener.onAddItem(creator); + } + }); + } + } + + protected boolean whetherAdd(String itemName){ + return HyperlinkFilterHelper.whetherAddHyperlink4cell(itemName); + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/OldShortCutFactory.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/OldShortCutFactory.java new file mode 100644 index 0000000000..a608ebb3e3 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/OldShortCutFactory.java @@ -0,0 +1,112 @@ +package com.fr.design.gui.controlpane.shortcutfactory; + +import com.fr.base.BaseUtils; +import com.fr.design.actions.UpdateAction; +import com.fr.design.gui.HyperlinkFilterHelper; +import com.fr.design.gui.controlpane.NameableCreator; +import com.fr.design.gui.controlpane.ShortCut4JControlPane; +import com.fr.design.gui.controlpane.ShortCutListenerProvider; +import com.fr.design.menu.LineSeparator; +import com.fr.design.menu.MenuDef; +import com.fr.design.menu.ShortCut; +import com.fr.general.ComparatorUtils; +import com.fr.general.Inter; + +import javax.swing.Icon; +import java.awt.event.ActionEvent; + +/** + * Created by plough on 2018/8/13. + */ +public class OldShortCutFactory extends AbstractShortCutFactory { + + private OldShortCutFactory(ShortCutListenerProvider listenerProvider) { + super(listenerProvider); + } + + public static OldShortCutFactory newInstance(ShortCutListenerProvider listenerProvider) { + return new OldShortCutFactory(listenerProvider); + } + + @Override + public ShortCut4JControlPane[] createShortCuts() { + return new ShortCut4JControlPane[]{ + addItemShortCut(), + removeItemShortCut(), + copyItemShortCut(), + moveUpItemShortCut(), + moveDownItemShortCut(), + sortItemShortCut() + }; + } + + @Override + public ShortCut createAddItemUpdateAction(NameableCreator[] creators) { + return new AddItemUpdateAction(creators); + } + + @Override + public ShortCut createAddItemMenuDef(NameableCreator[] creators) { + return new AddItemMenuDef(creators); + } + + + /** + * 增加项的UpdateAction + */ + protected class AddItemUpdateAction extends UpdateAction { + final NameableCreator creator; + + public AddItemUpdateAction(NameableCreator[] creators) { + this.creator = creators[0]; + this.setName(Inter.getLocText("FR-Action_Add")); + this.setMnemonic('A'); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png")); + } + + @Override + public void actionPerformed(ActionEvent e) { + listener.onAddItem(creator); + } + } + + /* + * 增加项的MenuDef + */ + private class AddItemMenuDef extends MenuDef { + AddItemMenuDef(NameableCreator[] creators) { + this.setName(Inter.getLocText("FR-Action_Add")); + this.setMnemonic('A'); + this.setIconPath("/com/fr/design/images/control/addPopup.png"); + wrapActionListener(creators); + } + + private void wrapActionListener(NameableCreator[] creators) { + for (final NameableCreator creator : creators) { + if (!HyperlinkFilterHelper.whetherAddHyperlink4cell(creator.menuName())) { + continue; + } + boolean isTrue = ComparatorUtils.equals(creator.menuName(), Inter.getLocText("Datasource-Stored_Procedure")) || + ComparatorUtils.equals(creator.menuName(), Inter.getLocText("DS-Relation_TableData")) || ComparatorUtils.equals(creator.menuName(), Inter.getLocText("DS-Multi_Dimensional_Database")); + if (isTrue) { + this.addShortCut(new LineSeparator()); + } + this.addShortCut(new UpdateAction() { + { + this.setName(creator.menuName()); + Icon icon = creator.menuIcon(); + if (icon != null) { + this.setSmallIcon(icon); + } + } + + @Override + public void actionPerformed(ActionEvent e) { + listener.onAddItem(creator); + } + }); + } + } + } + +} diff --git a/designer-base/src/main/java/com/fr/env/EnvListPane.java b/designer-base/src/main/java/com/fr/env/EnvListPane.java index 6bff9638f6..59eaea4e6e 100644 --- a/designer-base/src/main/java/com/fr/env/EnvListPane.java +++ b/designer-base/src/main/java/com/fr/env/EnvListPane.java @@ -103,9 +103,4 @@ public class EnvListPane extends JListControlPane { } return this.getSelectedName(); } - - @Override - protected boolean filterNameableCreator(NameableCreator creator) { - return false; - } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java index b6aae5da73..dc2b4a7057 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java @@ -74,7 +74,7 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { } - protected BasicBeanPane createPaneByCreators(NameableCreator creator) { + public BasicBeanPane createPaneByCreators(NameableCreator creator) { Constructor constructor = null; try { constructor = creator.getUpdatePane().getConstructor(HashMap.class, boolean.class); @@ -111,8 +111,8 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { } @Override - protected AddItemMenuDef getAddItemMenuDef (NameableCreator[] creators) { - return new AddVanChartItemMenuDef(creators); + protected void initShortCutFactory() { + this.shortCutFactory = VanChartShortCutFactory.newInstance(this); } public void populate(NameJavaScriptGroup nameHyperlink_array) { @@ -272,18 +272,6 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { return null; } - protected class AddVanChartItemMenuDef extends AddItemMenuDef { - - public AddVanChartItemMenuDef(NameableCreator[] creators) { - super(creators); - } - - @Override - protected boolean whetherAdd(String itemName) { - return HyperlinkFilterHelper.whetherAddHyperlink4Chart(itemName); - } - } - //邮箱 public static class VanChartEmailPane extends ChartEmailPane { @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartShortCutFactory.java b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartShortCutFactory.java new file mode 100644 index 0000000000..565c4cbcf1 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartShortCutFactory.java @@ -0,0 +1,33 @@ +package com.fr.van.chart.custom.component; + +import com.fr.design.gui.HyperlinkFilterHelper; +import com.fr.design.gui.controlpane.NameableCreator; +import com.fr.design.gui.controlpane.NewShortCutFactory; +import com.fr.design.gui.controlpane.ShortCutListenerProvider; +import com.fr.design.menu.ShortCut; + +/** + * Created by plough on 2018/8/13. + */ +public class VanChartShortCutFactory extends NewShortCutFactory { + private VanChartShortCutFactory(ShortCutListenerProvider listenerProvider) { + super(listenerProvider); + } + + @Override + public ShortCut createAddItemMenuDef(NameableCreator[] creators) { + return new AddVanChartItemMenuDef(creators); + } + + private class AddVanChartItemMenuDef extends AddItemMenuDef { + + AddVanChartItemMenuDef(NameableCreator[] creators) { + super(creators); + } + + @Override + protected boolean whetherAdd(String itemName) { + return HyperlinkFilterHelper.whetherAddHyperlink4Chart(itemName); + } + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartConditionListControlPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartConditionListControlPane.java index 617ce56a20..65b8360474 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartConditionListControlPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartConditionListControlPane.java @@ -41,7 +41,7 @@ public class VanChartConditionListControlPane extends VanChartUIListControlPane } - protected BasicBeanPane createPaneByCreators(NameableCreator creator) { + public BasicBeanPane createPaneByCreators(NameableCreator creator) { Constructor constructor = null; try { constructor = creator.getUpdatePane().getConstructor(Plot.class); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/AlertLineListControlPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/AlertLineListControlPane.java index 428d20a134..8bade1b883 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/AlertLineListControlPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/AlertLineListControlPane.java @@ -40,9 +40,9 @@ public class AlertLineListControlPane extends VanChartUIListControlPane { protected ShortCut4JControlPane[] createShortcuts() { return new ShortCut4JControlPane[]{ - moveUpItemShortCut(), - moveDownItemShortCut(), - removeItemShortCut() + shortCutFactory.moveUpItemShortCut(), + shortCutFactory.moveDownItemShortCut(), + shortCutFactory.removeItemShortCut() }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/BackgroundListControlPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/BackgroundListControlPane.java index 95e6a48a46..061cf54a19 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/BackgroundListControlPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/BackgroundListControlPane.java @@ -42,9 +42,9 @@ public class BackgroundListControlPane extends VanChartUIListControlPane { protected ShortCut4JControlPane[] createShortcuts() { return new ShortCut4JControlPane[]{ - moveUpItemShortCut(), - moveDownItemShortCut(), - removeItemShortCut() + shortCutFactory.moveUpItemShortCut(), + shortCutFactory.moveDownItemShortCut(), + shortCutFactory.removeItemShortCut() }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartStackedAndAxisListControlPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartStackedAndAxisListControlPane.java index 70cdcc399f..3d2b2964fb 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartStackedAndAxisListControlPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartStackedAndAxisListControlPane.java @@ -40,9 +40,9 @@ public class VanChartStackedAndAxisListControlPane extends VanChartUIListControl protected ShortCut4JControlPane[] createShortcuts() { return new ShortCut4JControlPane[]{ - moveUpItemShortCut(), - moveDownItemShortCut(), - removeItemShortCut() + shortCutFactory.moveUpItemShortCut(), + shortCutFactory.moveDownItemShortCut(), + shortCutFactory.removeItemShortCut() }; } diff --git a/designer-realize/src/main/java/com/fr/design/report/share/ConfusionManagerPane.java b/designer-realize/src/main/java/com/fr/design/report/share/ConfusionManagerPane.java index 6546465f2c..aa0a4e4ca8 100644 --- a/designer-realize/src/main/java/com/fr/design/report/share/ConfusionManagerPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/share/ConfusionManagerPane.java @@ -77,7 +77,11 @@ public class ConfusionManagerPane extends JListControlPane { @Override protected ShortCut4JControlPane[] createShortcuts() { - return new ShortCut4JControlPane[] { moveUpItemShortCut(), moveDownItemShortCut(), sortItemShortCut() }; + return new ShortCut4JControlPane[] { + shortCutFactory.moveUpItemShortCut(), + shortCutFactory.moveDownItemShortCut(), + shortCutFactory.sortItemShortCut() + }; } } From 3b4dad290ed9994707c5261380bf2abe8d3415ea Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 13 Aug 2018 20:11:56 +0800 Subject: [PATCH 02/14] =?UTF-8?q?REPORT-10045=20=E9=87=8D=E6=9E=84=20UILis?= =?UTF-8?q?tControlPane=20=E5=92=8C=20JListControlPane?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controlpane/CommonShortCutHandlers.java | 212 ++++++++++ .../design/gui/controlpane/JControlPane.java | 44 ++- .../gui/controlpane/JControlUpdatePane.java | 2 +- .../gui/controlpane/JListControlPane.java | 284 +++----------- .../controlpane/ListControlPaneHandlers.java | 71 ---- .../controlpane/ListControlPaneHelper.java | 112 ++++++ .../controlpane/ListControlPaneProvider.java | 25 +- .../gui/controlpane/ObjectUIControlPane.java | 4 - .../design/gui/controlpane/UIControlPane.java | 15 +- .../gui/controlpane/UIListControlPane.java | 300 ++++----------- .../shortcutfactory/NewShortCutFactory.java | 1 - .../com/fr/design/gui/ilist/JNameEdList.java | 61 +-- .../com/fr/design/gui/ilist/UINameEdList.java | 362 +----------------- .../fr/design/gui/ilist/JNameEdListTest.java | 68 ++++ .../fr/design/gui/ilist/UINameEdListTest.java | 82 ++++ .../component/VanChartShortCutFactory.java | 2 +- 16 files changed, 671 insertions(+), 974 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/gui/controlpane/CommonShortCutHandlers.java delete mode 100644 designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneHandlers.java create mode 100644 designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneHelper.java create mode 100644 designer-base/src/test/java/com/fr/design/gui/ilist/JNameEdListTest.java create mode 100644 designer-base/src/test/java/com/fr/design/gui/ilist/UINameEdListTest.java diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/CommonShortCutHandlers.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/CommonShortCutHandlers.java new file mode 100644 index 0000000000..42c0d2f2d0 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/CommonShortCutHandlers.java @@ -0,0 +1,212 @@ +package com.fr.design.gui.controlpane; + +import com.fr.base.BaseUtils; +import com.fr.base.FRContext; +import com.fr.design.gui.ilist.JNameEdList; +import com.fr.design.gui.ilist.ListModelElement; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.ComparatorUtils; +import com.fr.stable.ArrayUtils; +import com.fr.stable.Nameable; + +import javax.swing.DefaultListModel; +import javax.swing.SwingUtilities; +import java.awt.Component; +import java.util.Arrays; +import java.util.Comparator; + +/** + * 存放一些通用的事件处理方法 + * Created by plough on 2018/8/13. + */ +public class CommonShortCutHandlers { + ListControlPaneProvider listControlPane; + JNameEdList nameableList; + + private CommonShortCutHandlers(ListControlPaneProvider listControlPane) { + this.listControlPane = listControlPane; + this.nameableList = listControlPane.getNameableList(); + } + + public static CommonShortCutHandlers newInstance(ListControlPaneProvider listControlPane) { + return new CommonShortCutHandlers(listControlPane); + } + + public void onAddItem(NameableCreator creator) { + if (listControlPane.hasInvalid(true)) { + return; + } + + Nameable nameable = creator.createNameable(listControlPane); + listControlPane.addNameable(nameable, listControlPane.getModel().getSize()); + } + + public void onRemoveItem() { + try { + nameableList.getCellEditor() + .stopCellEditing(); + } catch (Exception ignored) { + } + if (GUICoreUtils.removeJListSelectedNodes(SwingUtilities + .getWindowAncestor((Component) listControlPane), nameableList)) { + listControlPane.checkButtonEnabled(); + } + } + + public void onCopyItem() { + // p:选中的值. + ListModelElement selectedValue = (ListModelElement) nameableList.getSelectedValue(); + if (selectedValue == null) { + return; + } + + listControlPane.getControlUpdatePane().update(); + + Nameable selectedNameable = selectedValue.wrapper; + + // p: 用反射机制实现 + try { + Nameable newNameable = (Nameable) BaseUtils.cloneObject(selectedNameable); + newNameable.setName(createUnrepeatedCopyName(selectedNameable.getName())); + + listControlPane.addNameable(newNameable, listControlPane.getSelectedIndex() + 1); + } catch (Exception e) { + FRContext.getLogger().error(e.getMessage(), e); + } + } + + public void onMoveUpItem() { + int selectedIndex = nameableList.getSelectedIndex(); + if (selectedIndex == -1) { + return; + } + + // 上移 + if (selectedIndex > 0) { + DefaultListModel listModel = (DefaultListModel) nameableList.getModel(); + Object selecteObj1 = listModel.get(selectedIndex - 1); + listModel.set(selectedIndex - 1, listModel.get(selectedIndex)); + listModel.set(selectedIndex, selecteObj1); + + nameableList.setSelectedIndex(selectedIndex - 1); + nameableList.ensureIndexIsVisible(selectedIndex - 1); + } + } + + public void onMoveDownItem() { + int selectedIndex = nameableList.getSelectedIndex(); + if (selectedIndex == -1) { + return; + } + + if (selectedIndex < nameableList.getModel().getSize() - 1) { + DefaultListModel listModel = (DefaultListModel) nameableList + .getModel(); + + Object selecteObj1 = listModel.get(selectedIndex + 1); + listModel.set(selectedIndex + 1, listModel.get(selectedIndex)); + listModel.set(selectedIndex, selecteObj1); + + nameableList.setSelectedIndex(selectedIndex + 1); + nameableList.ensureIndexIsVisible(selectedIndex + 1); + } + } + + public void onSortItem(boolean isAtoZ) { + // p:选中的值. + Object selectedValue = nameableList.getSelectedValue(); + + DefaultListModel listModel = (DefaultListModel) nameableList + .getModel(); + Nameable[] nameableArray = new Nameable[listModel.getSize()]; + if (nameableArray.length <= 0) { + return; + } + + for (int i = 0; i < listModel.getSize(); i++) { + nameableArray[i] = ((ListModelElement) listModel.getElementAt(i)).wrapper; + } + + // p:排序. + if (isAtoZ) { + Comparator nameableComparator = new Comparator() { + @Override + public int compare(Nameable o1, Nameable o2) { + return -ComparatorUtils.compare(o1.getName(), o2 + .getName()); + } + }; + isAtoZ = !isAtoZ; + Arrays.sort(nameableArray, nameableComparator); + } else { + Comparator nameableComparator = new Comparator() { + @Override + public int compare(Nameable o1, Nameable o2) { + return ComparatorUtils.compare(o1.getName(), o2 + .getName()); + } + }; + isAtoZ = !isAtoZ; + Arrays.sort(nameableArray, nameableComparator); + } + + for (int i = 0; i < nameableArray.length; i++) { + listModel.set(i, new ListModelElement(nameableArray[i])); + } + + // p:需要选中以前的那个值. + if (selectedValue != null) { + nameableList.setSelectedValue(selectedValue, true); + } + + listControlPane.checkButtonEnabled(); + // p:需要repaint. + nameableList.repaint(); + } + + private String createUnrepeatedCopyName(String suffix) { + DefaultListModel model = listControlPane.getModel(); + String[] names = new String[model.getSize()]; + for (int i = 0; i < model.size(); i++) { + names[i] = ((ListModelElement) model.get(i)).wrapper.getName(); + } + String lastName = "CopyOf" + suffix; + while (ArrayUtils.contains(names, lastName)) { + lastName = "CopyOf" + lastName; + } + return lastName; + } + + /** + * 生成不重复的名字 + * + * @param prefix 名字前缀 + * @return 名字 + */ + public String createUnrepeatedName(String prefix) { + DefaultListModel model = listControlPane.getModel(); + Nameable[] all = new Nameable[model.getSize()]; + for (int i = 0; i < model.size(); i++) { + all[i] = ((ListModelElement) model.get(i)).wrapper; + } + // richer:生成的名字从1开始. kunsnat: 添加属性从0开始. + int count = all.length + 1; + while (true) { + String name_test = prefix + count; + boolean repeated = false; + for (int i = 0, len = model.size(); i < len; i++) { + Nameable nameable = all[i]; + if (ComparatorUtils.equals(nameable.getName(), name_test)) { + repeated = true; + break; + } + } + + if (!repeated) { + return name_test; + } + + count++; + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java index 172810f0eb..0d01ddbdaa 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java @@ -1,6 +1,8 @@ package com.fr.design.gui.controlpane; import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.controlpane.shortcutfactory.AbstractShortCutFactory; +import com.fr.design.gui.controlpane.shortcutfactory.OldShortCutFactory; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.layout.FRGUIPaneFactory; @@ -19,6 +21,8 @@ import java.awt.*; */ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, ShortCutListenerProvider { private static final int SHORT_WIDTH = 30; //每加一个short Divider位置加30 + private static final String SELECT = "SELECT"; + private static final String EDIT = "EDIT"; JPanel controlUpdatePane; ShortCut4JControlPane[] shorts; @@ -48,7 +52,7 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S */ public abstract NameableCreator[] createNameableCreators(); - ShortCut4JControlPane[] getShorts() { + public ShortCut4JControlPane[] getShorts() { return shorts; } @@ -91,6 +95,18 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S protected void initComponentPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.creators = this.createNameableCreators(); + initCardPane(); + // SplitPane + JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, getLeftPane(), cardPane); + mainSplitPane.setBorder(BorderFactory.createLineBorder(GUICoreUtils.getTitleLineBorderColor())); + mainSplitPane.setOneTouchExpandable(true); + + this.add(mainSplitPane, BorderLayout.CENTER); + mainSplitPane.setDividerLocation(getLeftPreferredSize()); + this.checkButtonEnabled(); + } + + protected void initCardPane() { this.controlUpdatePane = createControlUpdatePane(); // p: edit card layout @@ -99,16 +115,16 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S cardPane.setLayout(this.cardLayout); // p:选择的Label UILabel selectLabel = new UILabel(); - cardPane.add(selectLabel, "SELECT"); - cardPane.add(controlUpdatePane, "EDIT"); - // SplitPane - JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, getLeftPane(), cardPane); - mainSplitPane.setBorder(BorderFactory.createLineBorder(GUICoreUtils.getTitleLineBorderColor())); - mainSplitPane.setOneTouchExpandable(true); + cardPane.add(selectLabel, SELECT); + cardPane.add(controlUpdatePane, EDIT); + } - this.add(mainSplitPane, BorderLayout.CENTER); - mainSplitPane.setDividerLocation(getLeftPreferredSize()); - this.checkButtonEnabled(); + public void showEditPane() { + this.cardLayout.show(cardPane, EDIT); + } + + public void showSelectPane() { + this.cardLayout.show(cardPane, SELECT); } protected abstract JPanel createControlUpdatePane(); @@ -166,18 +182,10 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S public void checkButtonEnabled() { } - void doBeforeRemove() { - } - - void doAfterRemove() { - } - public NameableCreator[] creators() { return creators == null ? new NameableCreator[0] : creators; } - protected abstract boolean hasInvalid(boolean isAdd); - /** * 刷新 NameableCreator * diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java index 177b2517d1..17e3182860 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java @@ -51,7 +51,7 @@ class JControlUpdatePane extends JPanel { } public void populate() { - ListModelElement el = listControlPane.getSelectedElement(); + ListModelElement el = listControlPane.getSelectedValue(); if (el == null) { return; } diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java index 57f4ec1ab3..3eb644c334 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java @@ -1,7 +1,5 @@ package com.fr.design.gui.controlpane; -import com.fr.base.BaseUtils; -import com.fr.base.FRContext; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilist.JNameEdList; @@ -18,7 +16,6 @@ import com.fr.stable.core.PropertyChangeAdapter; import javax.swing.DefaultListCellRenderer; import javax.swing.DefaultListModel; import javax.swing.JList; -import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPopupMenu; import javax.swing.ListSelectionModel; @@ -30,8 +27,6 @@ import java.awt.Component; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; -import java.util.Arrays; -import java.util.Comparator; public abstract class JListControlPane extends JControlPane implements ListControlPaneProvider { private static final String LIST_NAME = "JControl_List"; @@ -40,6 +35,8 @@ public abstract class JListControlPane extends JControlPane implements ListContr protected int editingIndex; protected String selectedName; private boolean isNameRepeated = false; + private CommonShortCutHandlers commonHandlers; + private ListControlPaneHelper helper; public JListControlPane() { this.initComponentPane(); @@ -49,6 +46,20 @@ public abstract class JListControlPane extends JControlPane implements ListContr protected JPanel createControlUpdatePane() { return JControlUpdatePane.newInstance(this); } + + private ListControlPaneHelper getHelper() { + if (helper == null) { + helper = ListControlPaneHelper.newInstance(this); + } + return helper; + } + + private CommonShortCutHandlers getCommonHandlers() { + if (commonHandlers == null) { + commonHandlers = CommonShortCutHandlers.newInstance(this); + } + return commonHandlers; + } /** * 生成添加按钮的NameableCreator @@ -65,7 +76,6 @@ public abstract class JListControlPane extends JControlPane implements ListContr nameableList.setName(LIST_NAME); leftPane.add(new UIScrollPane(nameableList), BorderLayout.CENTER); - nameableList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); nameableList.addMouseListener(listMouseListener); nameableList.addListSelectionListener(new ListSelectionListener() { @@ -101,14 +111,7 @@ public abstract class JListControlPane extends JControlPane implements ListContr @Override public Nameable[] update() { - java.util.List res = new java.util.ArrayList(); - ((JControlUpdatePane) this.controlUpdatePane).update(); - DefaultListModel listModel = (DefaultListModel) this.nameableList.getModel(); - for (int i = 0, len = listModel.getSize(); i < len; i++) { - res.add(((ListModelElement) listModel.getElementAt(i)).wrapper); - } - - return res.toArray(new Nameable[res.size()]); + return getHelper().update(); } @Override @@ -184,9 +187,7 @@ public abstract class JListControlPane extends JControlPane implements ListContr * 获取选中的名字 */ public String getSelectedName() { - ListModelElement el = (ListModelElement) this.nameableList.getSelectedValue(); - - return el == null ? null : el.wrapper.getName(); + return getHelper().getSelectedName(); } protected boolean isNameRepeated(java.util.List[] list, String name) { @@ -215,16 +216,8 @@ public abstract class JListControlPane extends JControlPane implements ListContr * @param nameable 添加的Nameable * @param index 序号 */ - private void addNameable(Nameable nameable, int index) { - JNameEdList nameEdList = JListControlPane.this.nameableList; - DefaultListModel model = (DefaultListModel) nameEdList.getModel(); - - ListModelElement el = new ListModelElement(nameable); - model.add(index, el); - nameableList.setSelectedIndex(index); - nameableList.ensureIndexIsVisible(index); - - nameEdList.repaint(); + public void addNameable(Nameable nameable, int index) { + getHelper().addNameable(nameable, index); } /** @@ -243,199 +236,49 @@ public abstract class JListControlPane extends JControlPane implements ListContr return false; } - protected DefaultListModel getModel() { + public DefaultListModel getModel() { return (DefaultListModel) JListControlPane.this.nameableList.getModel(); } - private String createUnrepeatedCopyName(String suffix) { - DefaultListModel model = this.getModel(); - String[] names = new String[model.getSize()]; - for (int i = 0; i < model.size(); i++) { - names[i] = ((ListModelElement) model.get(i)).wrapper.getName(); - } - String lastName = "CopyOf" + suffix; - while (ArrayUtils.contains(names, lastName)) { - lastName = "CopyOf" + lastName; - } - return lastName; - } - - /** - * 生成不重复的名字 - * - * @param prefix 名字前缀 - * @return 名字 - */ + * 生成不重复的名字 + * + * @param prefix 名字前缀 + * @return 名字 + */ @Override public String createUnrepeatedName(String prefix) { - DefaultListModel model = this.getModel(); - Nameable[] all = new Nameable[model.getSize()]; - for (int i = 0; i < model.size(); i++) { - all[i] = ((ListModelElement) model.get(i)).wrapper; - } - // richer:生成的名字从1开始. kunsnat: 添加属性从0开始. - int count = all.length + 1; - while (true) { - String name_test = prefix + count; - boolean repeated = false; - for (int i = 0, len = model.size(); i < len; i++) { - Nameable nameable = all[i]; - if (ComparatorUtils.equals(nameable.getName(), name_test)) { - repeated = true; - break; - } - } - - if (!repeated) { - return name_test; - } - - count++; - } + return getCommonHandlers().createUnrepeatedName(prefix); } @Override public void onAddItem(NameableCreator creator) { - if (hasInvalid(true)) { - return; - } - - Nameable nameable = creator.createNameable(JListControlPane.this); - JListControlPane.this.addNameable(nameable, getModel().getSize()); + getCommonHandlers().onAddItem(creator); } @Override public void onRemoveItem() { - try { - JListControlPane.this.nameableList.getCellEditor() - .stopCellEditing(); - } catch (Exception ignored) { - } - // bug:在选中一个NameObject并删除,会遗留下Name. - doBeforeRemove(); - if (GUICoreUtils.removeJListSelectedNodes(SwingUtilities - .getWindowAncestor(JListControlPane.this), nameableList)) { - checkButtonEnabled(); - doAfterRemove(); - } + getCommonHandlers().onRemoveItem(); } @Override public void onCopyItem() { - // p:选中的值. - ListModelElement selectedValue = (ListModelElement) nameableList.getSelectedValue(); - if (selectedValue == null) { - return; - } - - ((JControlUpdatePane) controlUpdatePane).update(); - - Nameable selectedNameable = selectedValue.wrapper; - - // p: 用反射机制实现 - try { - Nameable newNameable = (Nameable) BaseUtils.cloneObject(selectedNameable); - newNameable.setName(createUnrepeatedCopyName(selectedNameable.getName())); - - JListControlPane.this.addNameable(newNameable, nameableList.getSelectedIndex() + 1); - } catch (Exception e) { - FRContext.getLogger().error(e.getMessage(), e); - } + getCommonHandlers().onCopyItem(); } @Override public void onMoveUpItem() { - int selectedIndex = nameableList.getSelectedIndex(); - if (selectedIndex == -1) { - return; - } - - // 上移 - if (selectedIndex > 0) { - DefaultListModel listModel = (DefaultListModel) nameableList - .getModel(); - - Object selecteObj1 = listModel.get(selectedIndex - 1); - listModel.set(selectedIndex - 1, listModel.get(selectedIndex)); - listModel.set(selectedIndex, selecteObj1); - - nameableList.setSelectedIndex(selectedIndex - 1); - nameableList.ensureIndexIsVisible(selectedIndex - 1); - } + getCommonHandlers().onMoveUpItem(); } @Override public void onMoveDownItem() { - int selectedIndex = nameableList.getSelectedIndex(); - if (selectedIndex == -1) { - return; - } - - if (selectedIndex < nameableList.getModel().getSize() - 1) { - DefaultListModel listModel = (DefaultListModel) nameableList - .getModel(); - - Object selecteObj1 = listModel.get(selectedIndex + 1); - listModel.set(selectedIndex + 1, listModel.get(selectedIndex)); - listModel.set(selectedIndex, selecteObj1); - - nameableList.setSelectedIndex(selectedIndex + 1); - nameableList.ensureIndexIsVisible(selectedIndex + 1); - } + getCommonHandlers().onMoveDownItem(); } @Override public void onSortItem(boolean isAtoZ) { - // p:选中的值. - Object selectedValue = nameableList.getSelectedValue(); - - DefaultListModel listModel = (DefaultListModel) nameableList - .getModel(); - Nameable[] nameableArray = new Nameable[listModel.getSize()]; - if (nameableArray.length <= 0) { - return; - } - - for (int i = 0; i < listModel.getSize(); i++) { - nameableArray[i] = ((ListModelElement) listModel.getElementAt(i)).wrapper; - } - - // p:排序. - if (isAtoZ) { - Comparator nameableComparator = new Comparator() { - @Override - public int compare(Nameable o1, Nameable o2) { - return -ComparatorUtils.compare(o1.getName(), o2 - .getName()); - } - }; - isAtoZ = !isAtoZ; - Arrays.sort(nameableArray, nameableComparator); - } else { - Comparator nameableComparator = new Comparator() { - @Override - public int compare(Nameable o1, Nameable o2) { - return ComparatorUtils.compare(o1.getName(), o2 - .getName()); - } - }; - isAtoZ = !isAtoZ; - Arrays.sort(nameableArray, nameableComparator); - } - - for (int i = 0; i < nameableArray.length; i++) { - listModel.set(i, new ListModelElement(nameableArray[i])); - } - - // p:需要选中以前的那个值. - if (selectedValue != null) { - nameableList.setSelectedValue(selectedValue, true); - } - - checkButtonEnabled(); - // p:需要repaint. - nameableList.repaint(); + getCommonHandlers().onSortItem(isAtoZ); } @Override @@ -487,16 +330,7 @@ public abstract class JListControlPane extends JControlPane implements ListContr */ @Override public void checkButtonEnabled() { - - int selectedIndex = nameableList.getSelectedIndex(); - if (selectedIndex == -1) { - this.cardLayout.show(cardPane, "SELECT"); - } else { - this.cardLayout.show(cardPane, "EDIT"); - } - for (ShortCut4JControlPane sj : getShorts()) { - sj.checkEnable(); - } + getHelper().checkButtonEnabled(); } private class NameableListCellRenderer extends @@ -548,35 +382,9 @@ public abstract class JListControlPane extends JControlPane implements ListContr ((JControlUpdatePane) this.controlUpdatePane).checkValid(); } - private int getInValidIndex() { - BasicBeanPane[] p = ((JControlUpdatePane) controlUpdatePane).getUpdatePanes(); - if (p != null) { - for (int i = 0; i < p.length; i++) { - if (p[i] != null) { - try { - p[i].checkValid(); - } catch (Exception e) { - return i; - } - } - } - } - return -1; - } - @Override - protected boolean hasInvalid(boolean isAdd) { - int idx = JListControlPane.this.getInValidIndex(); - if (isAdd || nameableList.getSelectedIndex() != idx) { - try { - checkValid(); - } catch (Exception exp) { - JOptionPane.showMessageDialog(JListControlPane.this, exp.getMessage()); - nameableList.setSelectedIndex(idx); - return true; - } - } - return false; + public boolean hasInvalid(boolean isAdd) { + return getHelper().hasInvalid(isAdd); } /** @@ -584,12 +392,28 @@ public abstract class JListControlPane extends JControlPane implements ListContr * * @param index 选中项的序列号 */ + @Override public void setSelectedIndex(int index) { nameableList.setSelectedIndex(index); } @Override - public ListModelElement getSelectedElement() { - return (ListModelElement) JListControlPane.this.nameableList.getSelectedValue(); + public int getSelectedIndex() { + return nameableList.getSelectedIndex(); + } + + @Override + public JNameEdList getNameableList() { + return nameableList; + } + + @Override + public ListModelElement getSelectedValue() { + return (ListModelElement) this.nameableList.getSelectedValue(); + } + + @Override + public JControlUpdatePane getControlUpdatePane() { + return (JControlUpdatePane) controlUpdatePane; } } diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneHandlers.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneHandlers.java deleted file mode 100644 index 868f97e0b5..0000000000 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneHandlers.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.fr.design.gui.controlpane; - -import com.fr.design.gui.ilist.ListModelElement; -import com.fr.general.ComparatorUtils; -import com.fr.stable.ArrayUtils; -import com.fr.stable.Nameable; - -import javax.swing.DefaultListModel; - -/** - * Created by plough on 2018/8/13. - */ -public class ListControlPaneHandlers { - ListControlPaneProvider listControlPane; - - private ListControlPaneHandlers(ListControlPaneProvider listControlPane) { - this.listControlPane = listControlPane; - } - - public ListControlPaneHandlers newInstance(ListControlPaneProvider listControlPane) { - return new ListControlPaneHandlers(listControlPane); - } - - - private String createUnrepeatedCopyName(String suffix) { - DefaultListModel model = listControlPane.getModel(); - String[] names = new String[model.getSize()]; - for (int i = 0; i < model.size(); i++) { - names[i] = ((ListModelElement) model.get(i)).wrapper.getName(); - } - String lastName = "CopyOf" + suffix; - while (ArrayUtils.contains(names, lastName)) { - lastName = "CopyOf" + lastName; - } - return lastName; - } - - - /** - * 生成不重复的名字 - * - * @param prefix 名字前缀 - * @return 名字 - */ - public String createUnrepeatedName(String prefix) { - DefaultListModel model = listControlPane.getModel(); - Nameable[] all = new Nameable[model.getSize()]; - for (int i = 0; i < model.size(); i++) { - all[i] = ((ListModelElement) model.get(i)).wrapper; - } - // richer:生成的名字从1开始. kunsnat: 添加属性从0开始. - int count = all.length + 1; - while (true) { - String name_test = prefix + count; - boolean repeated = false; - for (int i = 0, len = model.size(); i < len; i++) { - Nameable nameable = all[i]; - if (ComparatorUtils.equals(nameable.getName(), name_test)) { - repeated = true; - break; - } - } - - if (!repeated) { - return name_test; - } - - count++; - } - } -} diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneHelper.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneHelper.java new file mode 100644 index 0000000000..5618c407c0 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneHelper.java @@ -0,0 +1,112 @@ +package com.fr.design.gui.controlpane; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.ilist.JNameEdList; +import com.fr.design.gui.ilist.ListModelElement; +import com.fr.stable.Nameable; +import com.fr.stable.StringUtils; + +import javax.swing.DefaultListModel; +import javax.swing.JOptionPane; +import java.awt.Component; + +/** + * 存放一些公用的方法 + * Created by plough on 2018/8/13. + */ +class ListControlPaneHelper { + private ListControlPaneProvider listControlPane; + + private ListControlPaneHelper(ListControlPaneProvider listControlPane) { + this.listControlPane = listControlPane; + } + + public static ListControlPaneHelper newInstance(ListControlPaneProvider listControlPane) { + return new ListControlPaneHelper(listControlPane); + } + + public boolean hasInvalid(boolean isAdd) { + + int idx = getInValidIndex(); + if (isAdd || listControlPane.getSelectedIndex() != idx) { + try { + listControlPane.checkValid(); + } catch (Exception exp) { + JOptionPane.showMessageDialog((Component) listControlPane, exp.getMessage()); + listControlPane.setSelectedIndex(idx); + return true; + } + } + return false; + } + + private int getInValidIndex() { + BasicBeanPane[] p = listControlPane.getControlUpdatePane().getUpdatePanes(); + if (p != null) { + for (int i = 0; i < p.length; i++) { + if (p[i] != null) { + try { + p[i].checkValid(); + } catch (Exception e) { + return i; + } + } + } + } + return -1; + } + + public Nameable[] update() { + java.util.List res = new java.util.ArrayList(); + listControlPane.getControlUpdatePane().update(); + DefaultListModel listModel = listControlPane.getModel(); + for (int i = 0, len = listModel.getSize(); i < len; i++) { + res.add(((ListModelElement) listModel.getElementAt(i)).wrapper); + } + + return res.toArray(new Nameable[res.size()]); + } + + /** + * 获取选中的名字 + */ + public String getSelectedName() { + ListModelElement el = listControlPane.getSelectedValue(); + return el == null ? StringUtils.EMPTY : el.wrapper.getName(); + } + + /** + * 添加 Nameable + * + * @param nameable 添加的Nameable + * @param index 序号 + */ + public void addNameable(Nameable nameable, int index) { + JNameEdList nameableList = listControlPane.getNameableList(); + DefaultListModel model = listControlPane.getModel(); + + ListModelElement el = new ListModelElement(nameable); + model.add(index, el); + nameableList.setSelectedIndex(index); + nameableList.ensureIndexIsVisible(index); + nameableList.repaint(); + } + + /** + * 检查按钮可用状态 Check button enabled. + */ + public void checkButtonEnabled() { + + int selectedIndex = listControlPane.getSelectedIndex(); + if (selectedIndex == -1) { + listControlPane.showSelectPane(); + } else { + listControlPane.showEditPane(); + } + for (ShortCut4JControlPane sj : listControlPane.getShorts()) { + sj.checkEnable(); + } + } + + +} diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneProvider.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneProvider.java index 43dcd72600..1565f348d0 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneProvider.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneProvider.java @@ -1,14 +1,35 @@ package com.fr.design.gui.controlpane; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.ilist.JNameEdList; import com.fr.design.gui.ilist.ListModelElement; +import com.fr.stable.Nameable; + +import javax.swing.DefaultListModel; /** * Created by plough on 2018/8/13. */ -public interface ListControlPaneProvider { +public interface ListControlPaneProvider extends UnrepeatedNameHelper { NameableCreator[] creators(); - ListModelElement getSelectedElement(); BasicBeanPane createPaneByCreators(NameableCreator creator); BasicBeanPane createPaneByCreators(NameableCreator creator, String string); + DefaultListModel getModel(); + boolean hasInvalid(boolean isAdd); + void addNameable(Nameable nameable, int index); + JNameEdList getNameableList(); + int getSelectedIndex(); + void setSelectedIndex(int idx); + ListModelElement getSelectedValue(); + void checkButtonEnabled(); + JControlUpdatePane getControlUpdatePane(); +// BasicBeanPane[] getUpdatePanes(); + /** + * 检查是否符合规范 + * @throws Exception + */ + void checkValid() throws Exception; + void showSelectPane(); + void showEditPane(); + ShortCut4JControlPane[] getShorts(); } diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectUIControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectUIControlPane.java index 4cfad0c57e..c5786b4c64 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectUIControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectUIControlPane.java @@ -10,10 +10,6 @@ import com.fr.design.beans.BasicBeanPane; public abstract class ObjectUIControlPane extends UIListControlPane { private Object object; - public ObjectUIControlPane() { - this(null); - } - public ObjectUIControlPane(Object object) { super(); this.object = object; diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java index 546aceb55c..23583f2278 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java @@ -2,6 +2,7 @@ package com.fr.design.gui.controlpane; import com.fr.base.chart.BasePlot; import com.fr.design.constants.UIConstants; +import com.fr.design.gui.controlpane.shortcutfactory.NewShortCutFactory; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itoolbar.UIToolBarUI; import com.fr.design.gui.itoolbar.UIToolbar; @@ -22,7 +23,6 @@ import javax.swing.JPanel; import javax.swing.JSplitPane; import javax.swing.border.EmptyBorder; import java.awt.BorderLayout; -import java.awt.CardLayout; import java.awt.Color; import java.awt.Component; import java.awt.Cursor; @@ -78,16 +78,9 @@ abstract class UIControlPane extends JControlPane { protected void initComponentPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.creators = this.createNameableCreators(); - this.controlUpdatePane = createControlUpdatePane(); - - // p: edit card layout - this.cardLayout = new CardLayout(); - cardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); - cardPane.setLayout(this.cardLayout); - // p:选择的Label - UILabel selectLabel = new UILabel(); - cardPane.add(selectLabel, "SELECT"); - cardPane.add(controlUpdatePane, "EDIT"); + + initCardPane(); + if (isNewStyle()) { getPopupEditDialog(cardPane); this.add(getLeftPane(), BorderLayout.CENTER); diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java index 9de012bbf7..6d8942bba8 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java @@ -1,22 +1,19 @@ package com.fr.design.gui.controlpane; -import com.fr.base.BaseUtils; -import com.fr.base.FRContext; import com.fr.base.chart.BasePlot; import com.fr.design.beans.BasicBeanPane; import com.fr.design.constants.UIConstants; import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.gui.ilist.JNameEdList; import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.UINameEdList; import com.fr.design.mainframe.DesignerContext; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.ComparatorUtils; import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import javax.swing.DefaultListModel; import javax.swing.JList; -import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPopupMenu; import javax.swing.ListSelectionModel; @@ -36,32 +33,46 @@ import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; -import java.util.Arrays; -import java.util.Comparator; /** * Created by plough on 2017/7/19. */ public abstract class UIListControlPane extends UIControlPane implements ListControlPaneProvider { - public static final String LIST_NAME = "UIControl_List"; + private static final String LIST_NAME = "UIControl_List"; private static final int EDIT_RANGE = 25; // 编辑按钮的x坐标范围 protected UINameEdList nameableList; - protected int editingIndex; + private int editingIndex; protected String selectedName; - private boolean isNameRepeated = false; protected boolean isPopulating = false; + private CommonShortCutHandlers commonHandlers; + private ListControlPaneHelper helper; public UIListControlPane() { - this.initComponentPane(); + super(); + } public UIListControlPane(BasePlot plot) { super(plot); } + private ListControlPaneHelper getHelper() { + if (helper == null) { + helper = ListControlPaneHelper.newInstance(this); + } + return helper; + } + + private CommonShortCutHandlers getCommonHandlers() { + if (commonHandlers == null) { + commonHandlers = CommonShortCutHandlers.newInstance(this); + } + return commonHandlers; + } + @Override protected JPanel createControlUpdatePane() { return JControlUpdatePane.newInstance(this); @@ -120,7 +131,7 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon } } - public UINameEdList createJNameList() { + private UINameEdList createJNameList() { UINameEdList nameEdList = new UINameEdList(new DefaultListModel()) { @Override protected void doAfterLostFocus() { @@ -135,24 +146,17 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon return nameEdList; } - public void updateControlUpdatePane() { + private void updateControlUpdatePane() { ((JControlUpdatePane) controlUpdatePane).update(); } - public void setNameListEditable(boolean editable) { + protected void setNameListEditable(boolean editable) { this.nameableList.setEditable(editable); } @Override public Nameable[] update() { - java.util.List res = new java.util.ArrayList(); - ((JControlUpdatePane) this.controlUpdatePane).update(); - DefaultListModel listModel = (DefaultListModel) this.nameableList.getModel(); - for (int i = 0, len = listModel.getSize(); i < len; i++) { - res.add(((ListModelElement) listModel.getElementAt(i)).wrapper); - } - - return res.toArray(new Nameable[res.size()]); + return getHelper().update(); } @Override @@ -184,9 +188,7 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon * 获取选中的名字 */ public String getSelectedName() { - ListModelElement el = (ListModelElement) this.nameableList.getSelectedValue(); - - return el == null ? null : el.wrapper.getName(); + return getHelper().getSelectedName(); } /** @@ -196,70 +198,14 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon * @param index 序号 */ public void addNameable(Nameable nameable, int index) { - UINameEdList nameEdList = UIListControlPane.this.nameableList; - DefaultListModel model = (DefaultListModel) nameEdList.getModel(); - - ListModelElement el = new ListModelElement(nameable); - model.add(index, el); - nameableList.setSelectedIndex(index); - nameableList.ensureIndexIsVisible(index); - - nameEdList.repaint(); + getHelper().addNameable(nameable, index); popupEditDialog(); } - protected DefaultListModel getModel() { + public DefaultListModel getModel() { return (DefaultListModel) UIListControlPane.this.nameableList.getModel(); } - private String createUnrepeatedCopyName(String suffix) { - DefaultListModel model = this.getModel(); - String[] names = new String[model.getSize()]; - for (int i = 0; i < model.size(); i++) { - names[i] = ((ListModelElement) model.get(i)).wrapper.getName(); - } - String lastName = "CopyOf" + suffix; - while (ArrayUtils.contains(names, lastName)) { - lastName = "CopyOf" + lastName; - } - return lastName; - } - - - /** - * 生成不重复的名字 - * - * @param prefix 名字前缀 - * @return 名字 - */ - @Override - public String createUnrepeatedName(String prefix) { - DefaultListModel model = this.getModel(); - Nameable[] all = new Nameable[model.getSize()]; - for (int i = 0; i < model.size(); i++) { - all[i] = ((ListModelElement) model.get(i)).wrapper; - } - // richer:生成的名字从1开始. kunsnat: 添加属性从0开始. - int count = all.length + 1; - while (true) { - String name_test = prefix + count; - boolean repeated = false; - for (int i = 0, len = model.size(); i < len; i++) { - Nameable nameable = all[i]; - if (ComparatorUtils.equals(nameable.getName(), name_test)) { - repeated = true; - break; - } - } - - if (!repeated) { - return name_test; - } - - count++; - } - } - private void popupEditDialog() { popupEditDialog(null); } @@ -310,143 +256,45 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon return resultPos; } + /** + * 生成不重复的名字 + * + * @param prefix 名字前缀 + * @return 名字 + */ + @Override + public String createUnrepeatedName(String prefix) { + return getCommonHandlers().createUnrepeatedName(prefix); + } + @Override public void onAddItem(NameableCreator creator) { - Nameable nameable = creator.createNameable(this); - this.addNameable(nameable, getModel().getSize()); + getCommonHandlers().onAddItem(creator); } @Override public void onRemoveItem() { - try { - this.nameableList.getCellEditor().stopCellEditing(); - } catch (Exception ignored) { - // do nothing - } - // bug:在选中一个NameObject并删除,会遗留下Name. - doBeforeRemove(); - if (GUICoreUtils.removeJListSelectedNodes(SwingUtilities - .getWindowAncestor(this), nameableList)) { - checkButtonEnabled(); - doAfterRemove(); - } + getCommonHandlers().onRemoveItem(); } @Override public void onCopyItem() { - // p:选中的值. - ListModelElement selectedValue = (ListModelElement) nameableList.getSelectedValue(); - if (selectedValue == null) { - return; - } - - ((JControlUpdatePane) controlUpdatePane).update(); - - Nameable selectedNameable = selectedValue.wrapper; - - // p: 用反射机制实现 - try { - Nameable newNameable = (Nameable) BaseUtils.cloneObject(selectedNameable); - newNameable.setName(createUnrepeatedCopyName(selectedNameable.getName())); - - UIListControlPane.this.addNameable(newNameable, nameableList.getSelectedIndex() + 1); - } catch (Exception e) { - FRContext.getLogger().error(e.getMessage(), e); - } + getCommonHandlers().onCopyItem(); } @Override public void onMoveUpItem() { - int selectedIndex = nameableList.getSelectedIndex(); - if (selectedIndex == -1) { - return; - } - - // 上移 - if (selectedIndex > 0) { - DefaultListModel listModel = (DefaultListModel) nameableList - .getModel(); - - Object selecteObj1 = listModel.get(selectedIndex - 1); - listModel.set(selectedIndex - 1, listModel.get(selectedIndex)); - listModel.set(selectedIndex, selecteObj1); - - nameableList.setSelectedIndex(selectedIndex - 1); - nameableList.ensureIndexIsVisible(selectedIndex - 1); - } + getCommonHandlers().onMoveUpItem(); } @Override public void onMoveDownItem() { - int selectedIndex = nameableList.getSelectedIndex(); - if (selectedIndex == -1) { - return; - } - - if (selectedIndex < nameableList.getModel().getSize() - 1) { - DefaultListModel listModel = (DefaultListModel) nameableList - .getModel(); - - Object selecteObj1 = listModel.get(selectedIndex + 1); - listModel.set(selectedIndex + 1, listModel.get(selectedIndex)); - listModel.set(selectedIndex, selecteObj1); - - nameableList.setSelectedIndex(selectedIndex + 1); - nameableList.ensureIndexIsVisible(selectedIndex + 1); - } + getCommonHandlers().onMoveDownItem(); } @Override public void onSortItem(boolean isAtoZ) { - // p:选中的值. - Object selectedValue = nameableList.getSelectedValue(); - - DefaultListModel listModel = (DefaultListModel) nameableList - .getModel(); - Nameable[] nameableArray = new Nameable[listModel.getSize()]; - if (nameableArray.length <= 0) { - return; - } - - for (int i = 0; i < listModel.getSize(); i++) { - nameableArray[i] = ((ListModelElement) listModel.getElementAt(i)).wrapper; - } - - // p:排序. - if (isAtoZ) { - Comparator nameableComparator = new Comparator() { - @Override - public int compare(Nameable o1, Nameable o2) { - return -ComparatorUtils.compare(o1.getName(), o2 - .getName()); - } - }; - isAtoZ = !isAtoZ; - Arrays.sort(nameableArray, nameableComparator); - } else { - Comparator nameableComparator = new Comparator() { - @Override - public int compare(Nameable o1, Nameable o2) { - return ComparatorUtils.compare(o1.getName(), o2 - .getName()); - } - }; - isAtoZ = !isAtoZ; - Arrays.sort(nameableArray, nameableComparator); - } - - for (int i = 0; i < nameableArray.length; i++) { - listModel.set(i, new ListModelElement(nameableArray[i])); - } - - // p:需要选中以前的那个值. - if (selectedValue != null) { - nameableList.setSelectedValue(selectedValue, true); - } - - checkButtonEnabled(); - // p:需要repaint. - nameableList.repaint(); + getCommonHandlers().onSortItem(isAtoZ); } @Override @@ -517,16 +365,7 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon */ @Override public void checkButtonEnabled() { - - int selectedIndex = nameableList.getSelectedIndex(); - if (selectedIndex == -1) { - this.cardLayout.show(cardPane, "SELECT"); - } else { - this.cardLayout.show(cardPane, "EDIT"); - } - for (ShortCut4JControlPane sj : getShorts()) { - sj.checkEnable(); - } + getHelper().checkButtonEnabled(); } public BasicBeanPane createPaneByCreators(NameableCreator creator) { @@ -566,35 +405,9 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon ((JControlUpdatePane) this.controlUpdatePane).checkValid(); } - private int getInValidIndex() { - BasicBeanPane[] p = ((JControlUpdatePane) controlUpdatePane).getUpdatePanes(); - if (p != null) { - for (int i = 0; i < p.length; i++) { - if (p[i] != null) { - try { - p[i].checkValid(); - } catch (Exception e) { - return i; - } - } - } - } - return -1; - } - @Override - protected boolean hasInvalid(boolean isAdd) { - int idx = UIListControlPane.this.getInValidIndex(); - if (isAdd || nameableList.getSelectedIndex() != idx) { - try { - checkValid(); - } catch (Exception exp) { - JOptionPane.showMessageDialog(UIListControlPane.this, exp.getMessage()); - nameableList.setSelectedIndex(idx); - return true; - } - } - return false; + public boolean hasInvalid(boolean isAdd) { + return getHelper().hasInvalid(isAdd); } /** * 设置选中项 @@ -606,7 +419,22 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon } @Override - public ListModelElement getSelectedElement() { + public int getSelectedIndex() { + return nameableList.getSelectedIndex(); + } + + @Override + public ListModelElement getSelectedValue() { return (ListModelElement) this.nameableList.getSelectedValue(); } + + @Override + public JControlUpdatePane getControlUpdatePane() { + return (JControlUpdatePane) controlUpdatePane; + } + + @Override + public JNameEdList getNameableList() { + return nameableList; + } } diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/NewShortCutFactory.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/NewShortCutFactory.java index f7fa96f0cf..5975dbc0c5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/NewShortCutFactory.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/NewShortCutFactory.java @@ -4,7 +4,6 @@ import com.fr.base.BaseUtils; import com.fr.design.actions.UpdateAction; import com.fr.design.actions.core.ActionFactory; import com.fr.design.gui.HyperlinkFilterHelper; -import com.fr.design.gui.controlpane.AbstractShortCutFactory; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.ShortCut4JControlPane; import com.fr.design.gui.controlpane.ShortCutListenerProvider; diff --git a/designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java b/designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java index 90aeff3dd3..0efa74cec7 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java +++ b/designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java @@ -22,7 +22,6 @@ import java.util.ArrayList; import java.util.Vector; public class JNameEdList extends UIList implements CellEditorListener { - private static final int TEST_LIST_LENTH = 20; private static final int ICON_WIDTH = 20; private boolean editable = true; @@ -232,7 +231,7 @@ public class JNameEdList extends UIList implements CellEditorListener { } Rectangle rect = this.getCellBounds(index, index); // alex:所有的JNameEdList都有Icon,空出前面20 * 20的位置就是放的Icon - rect.setRect(createRect(rect, ICON_WIDTH)); + rect.setRect(createRect(rect, getIconWidth())); editorComp.setBounds(rect); add(editorComp); @@ -247,6 +246,10 @@ public class JNameEdList extends UIList implements CellEditorListener { return true; } + public int getIconWidth() { + return ICON_WIDTH; + } + public Rectangle createRect(Rectangle rect, int iconWidth) { return new Rectangle(rect.x + iconWidth, rect.y, rect.width - iconWidth, rect.height); } @@ -301,9 +304,14 @@ public class JNameEdList extends UIList implements CellEditorListener { String name = StringUtils.isBlank(value.toString()) ? oldName : value.toString(); setNameAt(name, editingIndex); removeComp(); + doAfterStopEditing(); } } + protected void doAfterStopEditing() { + // default: do nothing + } + public String[] getAllNames() { int length = this.getModel().getSize(); String[] names = new String[length]; @@ -335,53 +343,4 @@ public class JNameEdList extends UIList implements CellEditorListener { editorComp = null; repaint(cellRect); } - - /** - * 主函数 - * - * @param args 参数 - */ - public static void main(String... args) { - JFrame f = new JFrame(); - JPanel c = (JPanel) f.getContentPane(); - c.setLayout(new BorderLayout()); - ListModelElement[] data = new ListModelElement[TEST_LIST_LENTH]; - for (int i = 0; i < TEST_LIST_LENTH; i++) { - data[i] = new ListModelElement(new NameObject(i + 1 + "", i)); - } - final JNameEdList list = new JNameEdList(data); - list.setEditable(true); - list.addMouseListener(new MouseAdapter() { - public void mouseReleased(MouseEvent evt) { - list.stopEditing(); - if (evt.getClickCount() >= 2 - && SwingUtilities.isLeftMouseButton(evt)) { - list.editItemAt(list.getSelectedIndex()); - } - } - }) - ; - - list.setCellEditor(new DefaultListCellEditor(new UITextField())); - list.setCellRenderer(new NameableListCellRenderer()); - c.add(list, BorderLayout.CENTER); - f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); - f.setSize(400, 600); - f.setVisible(true); - } - - private static class NameableListCellRenderer extends DefaultListCellRenderer { - @Override - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, - boolean cellHasFocus) { - super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - - if (value instanceof Nameable) { - Nameable wrappee = (Nameable) value; - this.setText(wrappee.getName()); - } - return this; - } - } - } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/gui/ilist/UINameEdList.java b/designer-base/src/main/java/com/fr/design/gui/ilist/UINameEdList.java index c9e3f1d687..f014096930 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ilist/UINameEdList.java +++ b/designer-base/src/main/java/com/fr/design/gui/ilist/UINameEdList.java @@ -19,19 +19,19 @@ import java.util.Vector; /** * Created by plough on 2017/7/23. */ -public class UINameEdList extends UIList implements CellEditorListener { - private static final int TEST_LIST_LENTH = 20; +public class UINameEdList extends JNameEdList { +// private static final int TEST_LIST_LENTH = 20; private static final int BUTTON_WIDTH = 25; - private boolean editable = true; - - // kunsnat: 是否强制ListName是数字 (int型) - private boolean isNameShouldNumber = false; - - transient protected ListCellEditor cellEditor; - transient protected Component editorComp; - transient protected int editingIndex; - private PropertyChangeAdapter editingListner; - private java.util.List ll = new ArrayList(); +// private boolean editable = true; +// +// // kunsnat: 是否强制ListName是数字 (int型) +// private boolean isNameShouldNumber = false; +// +// transient protected ListCellEditor cellEditor; +// transient protected Component editorComp; +// transient protected int editingIndex; +// private PropertyChangeAdapter editingListner; +// private java.util.List ll = new ArrayList(); public UINameEdList(ListModel dataModel) { super(dataModel); @@ -49,115 +49,6 @@ public class UINameEdList extends UIList implements CellEditorListener { super(); } - /* - * Sets是否可编辑 - */ - public void setEditable(boolean editable) { - this.editable = editable; - } - - /** - * 是否可编辑 - * - * @return 是则返回true - */ - public boolean isEditable() { - return this.editable; - } - - public void setNameShouldNumber(boolean isNameShouldNumber) { - this.isNameShouldNumber = isNameShouldNumber; - } - - /** - * 是否强制ListName是数字 (int型) - * - * @return 是则返回true - */ - public boolean isNameShouldNumber() { - return isNameShouldNumber; - } - - /** - * 添加名字改变时的listener - * - * @param l 监听器 - */ - public void addModNameActionListener(ModNameActionListener l) { - ll.add(l); - } - - /** - * 编辑时的监听器 - * - * @param l 监听器 - */ - public void addEditingListner(PropertyChangeAdapter l) { - this.editingListner = l; - } - - /** - * 移除某名字改变时的listener - * - * @param l 监听器 - */ - public void removeModNameActionListener(ModNameActionListener l) { - ll.remove(l); - } - - public ListCellEditor getCellEditor() { - if (cellEditor == null) { - UITextField editField = new UITextField(); - if (editingListner != null) { - editField.addFocusListener(new FocusListener() { - - @Override - public void focusLost(FocusEvent e) { - editingListner.propertyChange(); - - } - - @Override - public void focusGained(FocusEvent e) { - // TODO Auto-generated method stub - - } - }); - } - cellEditor = new DefaultListCellEditor(editField) { - public boolean stopCellEditing() { - boolean isTrue = super.stopCellEditing(); - stopEditing(); - - return isTrue; - } - }; - cellEditor.addCellEditorListener(this); - } - - return cellEditor; - } - - protected void doAfterLostFocus() { - - } - - public void setCellEditor(ListCellEditor editor) { - this.cellEditor = editor; - } - - /* - * 取得index节点的名字 - */ - public String getNameAt(int index) { - Nameable nameable = ((ListModelElement) getModel().getElementAt(index)).wrapper; - if (nameable != null) { - return nameable.getName(); - } - - return null; - } - public Object getType(int index) { Nameable nameable = ((ListModelElement) getModel().getElementAt(index)).wrapper; if (nameable != null && nameable instanceof NameObject) { @@ -166,177 +57,8 @@ public class UINameEdList extends UIList implements CellEditorListener { return null; } - /* - * 设置index节点的名字 - */ - // b:edit改变name的时候怎么办? - public void setNameAt(String name, int index) { - Nameable nameable = ((ListModelElement) getModel().getElementAt(index)).wrapper; - if (nameable != null) { - String oldName = nameable.getName(); - - if (isNameShouldNumber()) { - // kunsnat: 限制只能是数字(int型) - Number number = Utils.string2Number(name); - if (number == null) { - nameable.setName(oldName); - } else { - int newName = number.intValue(); - nameable.setName(String.valueOf(newName)); - } - } else { - nameable.setName(name); - } - - for (int i = 0, len = ll.size(); i < len; i++) { - ll.get(i).nameModed(index, oldName, name); - } - } - } - - /* - * 编辑第index个item - */ - private String oldName; - - /** - * 编辑第index项 - * - * @param index 序号 - * @return 成功返回true - */ - public boolean editItemAt(int index) { - // 如果不可编辑,返回 - if (!this.editable) { - return false; - } - - if (cellEditor != null && !cellEditor.stopCellEditing()) { - return false; - } - if (index < 0 || index >= this.getModel().getSize()) { - return false; - } - - ListCellEditor editor = getCellEditor(); - Object value = editor.getCellEditorValue(); - if (!StringUtils.isBlank(value.toString())) { - oldName = value.toString(); - } - editorComp = prepareEditor(editor, index); - if (editorComp == null) { - return false; - } - Rectangle rect = this.getCellBounds(index, index); - // alex:所有的UINameEdList都有Icon,空出前面20 * 20的位置就是放的Icon - rect.setRect(createRect(rect, BUTTON_WIDTH)); - - editorComp.setBounds(rect); - add(editorComp); - editorComp.validate(); - editorComp.requestFocus(); - if (editorComp instanceof UITextField) { - ((UITextField) editorComp).selectAll(); - } - - setEditingIndex(index); - - return true; - } - - public Rectangle createRect(Rectangle rect, int iconWidth) { - return new Rectangle(rect.x + iconWidth, rect.y, rect.width - iconWidth, rect.height); - } - - public String getEditingName() { - return (String) getCellEditor().getCellEditorValue(); - } - - /* - * 根据ListCellEditor取得编辑器的Component - */ - private Component prepareEditor(ListCellEditor cellEditor, int index) { - String name = getNameAt(index); - boolean isSelected = this.isSelectedIndex(index); - Component comp = cellEditor.getListCellEditorComponent(this, name, isSelected, index); - - return comp; - } - - /* - * 记录正在编辑的index - */ - private void setEditingIndex(int idx) { - editingIndex = idx; - } - - /** - * 编辑取消 - * - * @param e 事件 - */ - public void editingCanceled(ChangeEvent e) { - removeComp(); - } - - /** - * 编辑结束 - * - * @param e 事件 - */ - public void editingStopped(ChangeEvent e) { - doAfterLostFocus(); - stopEditing(); - } - - /** - * 停止编辑事件 - */ - public void stopEditing() { - ListCellEditor editor = getCellEditor(); - if (editor != null && editorComp != null) { - Object value = editor.getCellEditorValue(); - String name = StringUtils.isBlank(value.toString()) ? oldName : value.toString(); - setNameAt(name, editingIndex); - removeComp(); - doAfterStopEditing(); - } - } - - protected void doAfterStopEditing() { - // default: do nothing - } - - public String[] getAllNames() { - int length = this.getModel().getSize(); - String[] names = new String[length]; - for (int i = 0; i < length; i++) { - names[i] = getNameAt(i); - } - return names; - } - - public Object[] getAllTypes() { - int length = this.getModel().getSize(); - Object[] types = new Object[length]; - for (int i = 0; i < length; i++) { - types[i] = getType(i); - } - return types; - } - - - /* - * 移除编辑器的Component - */ - private void removeComp() { - if (editorComp != null) { - remove(editorComp); - } - Rectangle cellRect = this.getCellBounds(editingIndex, editingIndex); - setEditingIndex(-1); - editorComp = null; - repaint(cellRect); + public int getIconWidth() { + return BUTTON_WIDTH; } @Override @@ -355,61 +77,5 @@ public class UINameEdList extends UIList implements CellEditorListener { * * @param args 参数 */ - public static void main(String... args) { - JFrame f = new JFrame(); - JPanel c = (JPanel) f.getContentPane(); - c.setLayout(new BorderLayout()); - ListModelElement[] data = new ListModelElement[TEST_LIST_LENTH]; - for (int i = 0; i < TEST_LIST_LENTH; i++) { - data[i] = new ListModelElement(new NameObject(i + 1 + "", i)); - } - final UINameEdList list = new UINameEdList(data); - list.setEditable(true); - list.addMouseListener(new MouseAdapter() { - public void mouseReleased(MouseEvent evt) { - list.stopEditing(); - if (evt.getClickCount() >= 2 - && SwingUtilities.isLeftMouseButton(evt)) { - list.editItemAt(list.getSelectedIndex()); - } - } - - @Override - public void mouseClicked(MouseEvent e) { - JList list = (JList) e.getSource(); - if (list.locationToIndex(e.getPoint()) == -1 && !e.isShiftDown() - && !isMenuShortcutKeyDown(e)) { - list.clearSelection(); - } - } - - private boolean isMenuShortcutKeyDown(InputEvent event) { - return (event.getModifiers() & Toolkit.getDefaultToolkit() - .getMenuShortcutKeyMask()) != 0; - } - }) - ; - - list.setCellEditor(new DefaultListCellEditor(new UITextField())); - list.setCellRenderer(new NameableListCellRenderer()); - c.add(list, BorderLayout.CENTER); - f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); - f.setSize(400, 600); - f.setVisible(true); - } - - private static class NameableListCellRenderer extends DefaultListCellRenderer { - @Override - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, - boolean cellHasFocus) { - super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - - if (value instanceof Nameable) { - Nameable wrappee = (Nameable) value; - this.setText(wrappee.getName()); - } - return this; - } - } } \ No newline at end of file diff --git a/designer-base/src/test/java/com/fr/design/gui/ilist/JNameEdListTest.java b/designer-base/src/test/java/com/fr/design/gui/ilist/JNameEdListTest.java new file mode 100644 index 0000000000..ba611a66b9 --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/gui/ilist/JNameEdListTest.java @@ -0,0 +1,68 @@ +package com.fr.design.gui.ilist; + +import com.fr.design.gui.itextfield.UITextField; +import com.fr.general.NameObject; +import com.fr.stable.Nameable; + +import javax.swing.DefaultListCellRenderer; +import javax.swing.JFrame; +import javax.swing.JList; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; +import javax.swing.WindowConstants; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Toolkit; +import java.awt.event.InputEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +/** + * Created by plough on 2018/8/13. + */ +public class JNameEdListTest { + private static final int TEST_LIST_LENTH = 20; + + public static void main(String... args) { + JFrame f = new JFrame(); + JPanel c = (JPanel) f.getContentPane(); + c.setLayout(new BorderLayout()); + ListModelElement[] data = new ListModelElement[TEST_LIST_LENTH]; + for (int i = 0; i < TEST_LIST_LENTH; i++) { + data[i] = new ListModelElement(new NameObject(i + 1 + "", i)); + } + final JNameEdList list = new JNameEdList(data); + list.setEditable(true); + list.addMouseListener(new MouseAdapter() { + public void mouseReleased(MouseEvent evt) { + list.stopEditing(); + if (evt.getClickCount() >= 2 + && SwingUtilities.isLeftMouseButton(evt)) { + list.editItemAt(list.getSelectedIndex()); + } + } + }) + ; + + list.setCellEditor(new DefaultListCellEditor(new UITextField())); + list.setCellRenderer(new NameableListCellRenderer()); + c.add(list, BorderLayout.CENTER); + f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); + f.setSize(400, 600); + f.setVisible(true); + } + + private static class NameableListCellRenderer extends DefaultListCellRenderer { + @Override + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, + boolean cellHasFocus) { + super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + + if (value instanceof Nameable) { + Nameable wrappee = (Nameable) value; + this.setText(wrappee.getName()); + } + return this; + } + } +} diff --git a/designer-base/src/test/java/com/fr/design/gui/ilist/UINameEdListTest.java b/designer-base/src/test/java/com/fr/design/gui/ilist/UINameEdListTest.java new file mode 100644 index 0000000000..b2d0c8da42 --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/gui/ilist/UINameEdListTest.java @@ -0,0 +1,82 @@ +package com.fr.design.gui.ilist; + +import com.fr.design.gui.itextfield.UITextField; +import com.fr.general.NameObject; +import com.fr.stable.Nameable; + +import javax.swing.DefaultListCellRenderer; +import javax.swing.JFrame; +import javax.swing.JList; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; +import javax.swing.WindowConstants; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Toolkit; +import java.awt.event.InputEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +/** + * Created by plough on 2018/8/13. + */ +public class UINameEdListTest { + private static final int TEST_LIST_LENTH = 20; + + public static void main(String... args) { + JFrame f = new JFrame(); + JPanel c = (JPanel) f.getContentPane(); + c.setLayout(new BorderLayout()); + ListModelElement[] data = new ListModelElement[TEST_LIST_LENTH]; + for (int i = 0; i < TEST_LIST_LENTH; i++) { + data[i] = new ListModelElement(new NameObject(i + 1 + "", i)); + } + final UINameEdList list = new UINameEdList(data); + list.setEditable(true); + list.addMouseListener(new MouseAdapter() { + public void mouseReleased(MouseEvent evt) { + list.stopEditing(); + if (evt.getClickCount() >= 2 + && SwingUtilities.isLeftMouseButton(evt)) { + list.editItemAt(list.getSelectedIndex()); + } + } + + @Override + public void mouseClicked(MouseEvent e) { + JList list = (JList) e.getSource(); + if (list.locationToIndex(e.getPoint()) == -1 && !e.isShiftDown() + && !isMenuShortcutKeyDown(e)) { + list.clearSelection(); + } + } + + private boolean isMenuShortcutKeyDown(InputEvent event) { + return (event.getModifiers() & Toolkit.getDefaultToolkit() + .getMenuShortcutKeyMask()) != 0; + } + }) + ; + + list.setCellEditor(new DefaultListCellEditor(new UITextField())); + list.setCellRenderer(new NameableListCellRenderer()); + c.add(list, BorderLayout.CENTER); + f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); + f.setSize(400, 600); + f.setVisible(true); + } + + private static class NameableListCellRenderer extends DefaultListCellRenderer { + @Override + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, + boolean cellHasFocus) { + super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + + if (value instanceof Nameable) { + Nameable wrappee = (Nameable) value; + this.setText(wrappee.getName()); + } + return this; + } + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartShortCutFactory.java b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartShortCutFactory.java index 565c4cbcf1..753d98d483 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartShortCutFactory.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartShortCutFactory.java @@ -2,7 +2,7 @@ package com.fr.van.chart.custom.component; import com.fr.design.gui.HyperlinkFilterHelper; import com.fr.design.gui.controlpane.NameableCreator; -import com.fr.design.gui.controlpane.NewShortCutFactory; +import com.fr.design.gui.controlpane.shortcutfactory.NewShortCutFactory; import com.fr.design.gui.controlpane.ShortCutListenerProvider; import com.fr.design.menu.ShortCut; From b0ad001f6963e62ef579a270a2b5c961c9b45736 Mon Sep 17 00:00:00 2001 From: Harrison Date: Tue, 14 Aug 2018 12:02:30 +0800 Subject: [PATCH 03/14] =?UTF-8?q?REPORT-10025=2010.0=20&=205.0=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E4=BE=9D=E6=8D=AE=E5=9B=BD=E9=99=85=E5=8C=96=E8=A7=84?= =?UTF-8?q?=E8=8C=83=E8=B0=83=E6=95=B4=E5=9B=BD=E9=99=85=E5=8C=96=E5=86=85?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/DesignerEnvManager.java | 2 +- .../fr/design/actions/edit/CopyAction.java | 2 +- .../com/fr/design/actions/edit/CutAction.java | 2 +- .../fr/design/actions/edit/PasteAction.java | 2 +- .../fr/design/actions/file/EditEnvAction.java | 6 +-- .../design/actions/file/PreferencePane.java | 4 +- .../actions/server/GlobalParameterAction.java | 2 +- .../actions/server/PlatformManagerAction.java | 2 +- .../data/datapane/connect/JDBCDefPane.java | 8 +-- .../data/datapane/sqlpane/SQLEditPane.java | 2 +- .../AutoStoreProcedureTableModel.java | 6 +-- .../StoreProcedureParameterPane.java | 16 +++--- .../StoreProcedureTableModel.java | 25 +++++---- .../wrapper/StoreProcedureDataWrapper.java | 2 +- .../fr/design/dialog/InformationWarnPane.java | 2 +- .../com/fr/design/dialog/JWizardDialog.java | 23 ++++---- .../editor/DoubleDeckValueEditorPane.java | 4 +- .../com/fr/design/editor/ValueEditorPane.java | 4 +- .../design/editor/editor/BooleanEditor.java | 2 +- .../design/editor/editor/ParameterEditor.java | 2 +- .../fr/design/editor/editor/TextEditor.java | 2 +- .../design/editor/editor/XMLANameEditor.java | 2 +- .../fr/design/extra/PluginOperateUtils.java | 2 +- .../java/com/fr/design/extra/PluginUtils.java | 4 +- .../com/fr/design/extra/QQLoginWebPane.java | 2 +- .../com/fr/design/extra/WebViewDlgHelper.java | 2 +- .../exe/callback/ModifyStatusCallback.java | 2 +- .../com/fr/design/formula/FormulaPane.java | 4 +- .../fr/design/gui/date/UICalendarPanel.java | 4 +- .../gui/frpane/EditingStringListPane.java | 2 +- .../gui/frpane/ObjectProperiesPane.java | 2 +- .../frpane/ReportletParameterViewPane.java | 2 +- .../gui/frpane/TemplateParameterPane.java | 25 +++++---- .../design/gui/frpane/UIAdvancedTextPane.java | 6 +-- .../gui/frpane/UICorrelationComboBoxPane.java | 2 +- .../gui/icombobox/DictionaryConstants.java | 4 +- .../fr/design/gui/iscrollbar/UISBChooser.java | 2 +- .../itableeditorpane/ParameterTableModel.java | 6 +-- .../syntax/ui/rsyntaxtextarea/ErrorStrip.java | 26 +++++----- .../hyperlink/ReporletHyperNorthPane.java | 4 +- .../hyperlink/ReportletHyperlinkPane.java | 2 +- .../javascript/FormSubmitJavaScriptPane.java | 2 +- .../ProcessParameterTableModel.java | 4 +- .../com/fr/design/layout/TableLayoutTest.java | 11 ++-- .../fr/design/mainframe/DesignerFrame.java | 13 ----- .../com/fr/design/mainframe/JTemplate.java | 4 +- .../mainframe/NoSupportAuthorityEdit.java | 2 +- .../mainframe/loghandler/LogHandlerBarUI.java | 2 +- .../mainframe/loghandler/LogMessageBar.java | 2 +- .../widget/wrappers/BackgroundWrapper.java | 2 +- .../java/com/fr/design/menu/KeySetUtils.java | 18 +++---- .../design/parameter/ParameterArrayPane.java | 4 +- .../design/parameter/ParameterInputPane.java | 4 +- .../parameter/ParameterManagerPane.java | 5 +- .../fr/design/parameter/ParameterPane.java | 19 ++++--- .../design/present/dict/DatabaseDictPane.java | 4 +- .../com/fr/design/preview/PagePreview.java | 2 +- .../com/fr/design/preview/ViewPreview.java | 2 +- .../com/fr/design/preview/WritePreview.java | 2 +- .../fr/design/roleAuthority/RoleSourceOP.java | 2 +- .../roleAuthority/RolesAlreadyEditedPane.java | 2 +- .../roleAuthority/RolesEditedSourceOP.java | 2 +- .../java/com/fr/design/style/BorderPane.java | 52 +++++++++---------- .../java/com/fr/design/style/FRFontPane.java | 44 ++++++++-------- .../com/fr/design/style/FontFamilyPane.java | 16 +++--- .../GradientBackgroundSelectPane.java | 4 +- .../pattern/PatternUIComboBoxPane.java | 12 ++--- .../design/style/color/ColorSelectDialog.java | 15 +++--- .../com/fr/design/web/CustomIconPane.java | 8 +-- .../main/java/com/fr/env/LocalEnvPane.java | 4 +- .../fr/start/server/ServerManageFrame.java | 4 +- .../chart/gui/other/TimeSwitchPane.java | 6 +-- .../chart/gui/style/DateAxisValuePane.java | 6 +-- .../designer/beans/actions/CopyAction.java | 3 +- .../designer/beans/actions/CutAction.java | 3 +- .../designer/beans/actions/PasteAction.java | 3 +- .../design/designer/creator/XChartEditor.java | 29 +++++++---- .../creator/XCustomWriteAbleRepeatEditor.java | 2 +- .../designer/creator/XDirectWriteEditor.java | 2 +- .../design/designer/creator/XFieldEditor.java | 4 +- .../designer/creator/XIframeEditor.java | 2 +- .../designer/creator/XNumberEditor.java | 12 ++--- .../fr/design/designer/creator/XPassword.java | 4 +- .../fr/design/designer/creator/XTextArea.java | 4 +- .../design/designer/creator/XTextEditor.java | 4 +- .../designer/creator/XTreeComboBoxEditor.java | 4 +- .../design/designer/creator/XTreeEditor.java | 6 +-- .../design/designer/creator/XWFitLayout.java | 2 +- .../design/form/util/XCreatorConstants.java | 7 ++- .../xtable/ReportAppPropertyGroupModel.java | 7 ++- .../com/fr/design/mainframe/FormDesigner.java | 4 +- .../widget/accessibles/ColorPalette.java | 2 +- .../widget/editors/AdjustModeEditor.java | 2 +- .../widget/editors/DataTableConfigPane.java | 2 +- .../widget/wrappers/ParameterWrapper.java | 2 +- .../ui/designer/FieldEditorDefinePane.java | 2 +- .../ui/designer/IframeEditorDefinePane.java | 2 +- .../ui/designer/ParameterTreeComboBox.java | 4 +- .../mobile/ElementCaseDefinePane.java | 2 +- .../style/ReportFontForegroundAction.java | 14 +++-- .../cell/style/ReportFontNameAction.java | 2 +- .../cell/style/ReportFontUnderlineAction.java | 2 +- .../order/SendFloatElementBackwardAction.java | 7 +-- .../utils/DeprecatedActionManager.java | 4 +- .../design/dscolumn/DSColumnAdvancedPane.java | 2 +- .../headerfooter/HeaderFooterEditPane.java | 6 +-- .../mainframe/AuthorityToolBarPane.java | 13 ++--- .../com/fr/design/report/PageSetupPane.java | 14 ++--- .../fr/design/report/ReportColumnsPane.java | 4 +- .../com/fr/design/report/SubReportPane.java | 24 ++++----- .../fr/design/report/WriteShortCutsPane.java | 2 +- .../FormECRepeatAndFreezeSettingPane.java | 2 +- .../freeze/RepeatAndFreezeSettingPane.java | 2 +- .../webattr/ReportWebWidgetConstants.java | 2 +- .../fr/design/webattr/ViewWebSettingPane.java | 2 +- .../printsettings/NativePrintSettingPane.java | 6 +-- .../widget/ui/FieldEditorDefinePane.java | 2 +- .../widget/ui/ParameterTreeComboBox.java | 4 +- .../widget/ui/btn/DefaultButtonStylePane.java | 2 +- .../cellquick/CellDSColumnEditor.java | 2 +- .../fr/start/module/DesignerActivator.java | 2 +- 121 files changed, 355 insertions(+), 389 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index a9cadd709f..4222144ae3 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -208,7 +208,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } String installHome = StableUtils.getInstallHome(); if (installHome != null && !".".equals(installHome)) { - String name = com.fr.design.i18n.Toolkit.i18nText("FR-Engine_DEFAULT"); + String name = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_DEFAULT"); String envPath = designerEnvManager.getDefaultenvPath(installHome); designerEnvManager.putEnv(name, LocalDesignerWorkspaceInfo.create(name, envPath)); designerEnvManager.setCurEnvName(name); diff --git a/designer-base/src/main/java/com/fr/design/actions/edit/CopyAction.java b/designer-base/src/main/java/com/fr/design/actions/edit/CopyAction.java index 2b02d75eb8..568b439f03 100644 --- a/designer-base/src/main/java/com/fr/design/actions/edit/CopyAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/edit/CopyAction.java @@ -20,7 +20,7 @@ public class CopyAction extends TemplateComponentAction { public CopyAction(TargetComponent t) { super(t); - this.setName(com.fr.design.i18n.Toolkit.i18nText("M_Edit-Copy")); + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Copy")); this.setMnemonic('C'); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/copy.png")); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER)); diff --git a/designer-base/src/main/java/com/fr/design/actions/edit/CutAction.java b/designer-base/src/main/java/com/fr/design/actions/edit/CutAction.java index 0c668c8c6a..67ffae2377 100644 --- a/designer-base/src/main/java/com/fr/design/actions/edit/CutAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/edit/CutAction.java @@ -24,7 +24,7 @@ public class CutAction extends TemplateComponentAction { public CutAction(TargetComponent t) { super(t); - this.setName(com.fr.design.i18n.Toolkit.i18nText("M_Edit-Cut")); + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Cut")); this.setMnemonic('T'); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/cut.png")); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER)); diff --git a/designer-base/src/main/java/com/fr/design/actions/edit/PasteAction.java b/designer-base/src/main/java/com/fr/design/actions/edit/PasteAction.java index 5f88504b69..476516a79c 100644 --- a/designer-base/src/main/java/com/fr/design/actions/edit/PasteAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/edit/PasteAction.java @@ -24,7 +24,7 @@ public class PasteAction extends TemplateComponentAction { public PasteAction(TargetComponent t) { super(t); - this.setName(com.fr.design.i18n.Toolkit.i18nText("M_Edit-Paste")); + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Edit_Paste")); this.setMnemonic('P'); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/paste.png")); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER)); diff --git a/designer-base/src/main/java/com/fr/design/actions/file/EditEnvAction.java b/designer-base/src/main/java/com/fr/design/actions/file/EditEnvAction.java index a4bf798f20..f8b185a09d 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/EditEnvAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/EditEnvAction.java @@ -1,17 +1,17 @@ package com.fr.design.actions.file; -import java.awt.event.ActionEvent; - import com.fr.design.actions.UpdateAction; import com.fr.design.mainframe.TemplatePane; +import java.awt.event.ActionEvent; + public class EditEnvAction extends UpdateAction { public EditEnvAction() { - this.setName(com.fr.design.i18n.Toolkit.i18nText("M-Others") + "..."); + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Others") + "..."); } @Override diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index 72b4d81afe..bb4fe00aec 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -177,8 +177,8 @@ public class PreferencePane extends BasicPane { functionPane.add(supportUndoCheckBox); //添加maxUndoLimit //String[] undoTimes = {"最大撤销次数","5次","10次","15次","20次","50次"}; - String[] undoTimes = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Max_Undo_Limit"), MAX_UNDO_LIMIT_5 + com.fr.design.i18n.Toolkit.i18nText("FR-Designer_time(s)"), MAX_UNDO_LIMIT_10 + com.fr.design.i18n.Toolkit.i18nText("FR-Designer_time(s)") - , MAX_UNDO_LIMIT_15 + com.fr.design.i18n.Toolkit.i18nText("FR-Designer_time(s)"), MAX_UNDO_LIMIT_20 + com.fr.design.i18n.Toolkit.i18nText("FR-Designer_time(s)"), MAX_UNDO_LIMIT_50 + com.fr.design.i18n.Toolkit.i18nText("FR-Designer_time(s)")}; + String[] undoTimes = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Max_Undo_Limit"), MAX_UNDO_LIMIT_5 + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Time(s)"), MAX_UNDO_LIMIT_10 + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Time(s)") + , MAX_UNDO_LIMIT_15 + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Time(s)"), MAX_UNDO_LIMIT_20 + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Time(s)"), MAX_UNDO_LIMIT_50 + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Time(s)")}; maxUndoLimit = new UIComboBox(undoTimes); functionPane.add(maxUndoLimit); diff --git a/designer-base/src/main/java/com/fr/design/actions/server/GlobalParameterAction.java b/designer-base/src/main/java/com/fr/design/actions/server/GlobalParameterAction.java index b206df6df9..c546129e95 100644 --- a/designer-base/src/main/java/com/fr/design/actions/server/GlobalParameterAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/server/GlobalParameterAction.java @@ -83,7 +83,7 @@ public class GlobalParameterAction extends UpdateAction { @Override public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("M_Server-Global_Parameters"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Server_Global_Parameters"); } @Override diff --git a/designer-base/src/main/java/com/fr/design/actions/server/PlatformManagerAction.java b/designer-base/src/main/java/com/fr/design/actions/server/PlatformManagerAction.java index f0fef3eade..5f364303a7 100644 --- a/designer-base/src/main/java/com/fr/design/actions/server/PlatformManagerAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/server/PlatformManagerAction.java @@ -33,7 +33,7 @@ public class PlatformManagerAction extends UpdateAction { @Override public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("M_Server-Platform_Manager"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Server_Platform_Manager"); } @Override diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index a684e45198..2c11903b5a 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -74,9 +74,9 @@ public class JDBCDefPane extends JPanel { private IntegerEditor DBCP_MAX_WAIT = new IntegerEditor(); private UITextField DBCP_VALIDATION_QUERY = new UITextField(); - private UIComboBox DBCP_TESTONBORROW = new UIComboBox(new String[]{com.fr.design.i18n.Toolkit.i18nText("No"), com.fr.design.i18n.Toolkit.i18nText("Yes")}); - private UIComboBox DBCP_TESTONRETURN = new UIComboBox(new String[]{com.fr.design.i18n.Toolkit.i18nText("No"), com.fr.design.i18n.Toolkit.i18nText("Yes")}); - private UIComboBox DBCP_TESTWHILEIDLE = new UIComboBox(new String[]{com.fr.design.i18n.Toolkit.i18nText("No"), com.fr.design.i18n.Toolkit.i18nText("Yes")}); + private UIComboBox DBCP_TESTONBORROW = new UIComboBox(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Yes")}); + private UIComboBox DBCP_TESTONRETURN = new UIComboBox(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Yes")}); + private UIComboBox DBCP_TESTWHILEIDLE = new UIComboBox(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Yes")}); private IntegerEditor DBCP_TIMEBETWEENEVICTIONRUNSMILLS = new IntegerEditor(); private IntegerEditor DBCP_NUMTESTSPEREVICTIONRUN = new IntegerEditor(); @@ -289,7 +289,7 @@ public class JDBCDefPane extends JPanel { if (ComparatorUtils.equals(dbtypeComboBox.getSelectedItem(), ("Access"))) { // ben:这个能不能换种处理方案- - JFileChooser filechooser = new JFileChooser(); - filechooser.setDialogTitle(com.fr.design.i18n.Toolkit.i18nText("Open")); + filechooser.setDialogTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Open")); filechooser.setMultiSelectionEnabled(false); filechooser.addChoosableFileFilter(new ChooseFileFilter(new String[]{"accdb", "mdb"}, "Microsoft Office Access")); int result = filechooser.showOpenDialog(DesignerContext.getDesignerFrame()); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java index 92d8233f59..e475820a52 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java @@ -1 +1 @@ -package com.fr.design.data.datapane.sqlpane; import com.fr.base.FRContext; import com.fr.data.core.DataCoreUtils; import com.fr.data.core.db.TableProcedure; import com.fr.design.actions.UpdateAction; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; import com.fr.general.ComparatorUtils; import com.fr.design.utils.gui.GUICoreUtils; import javax.swing.*; import javax.swing.text.BadLocationException; import javax.swing.text.Document; import java.awt.*; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; import java.awt.dnd.*; import java.awt.event.ActionEvent; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 7.0.3 * Date: 13-5-2 * Time: 上午11:09 */ public class SQLEditPane extends RSyntaxTextArea { public static final boolean REQUEST_DROPTARGET = true; public static final boolean UNREQUEST_DROPTARGET = false; public SQLEditPane() { this(REQUEST_DROPTARGET); } public SQLEditPane(boolean requestDroptarget) { super(); setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_SQL); setAnimateBracketMatching(true); setAntiAliasingEnabled(true); setAutoIndentEnabled(true); setCodeFoldingEnabled(true); setUseSelectedTextColor(true); setCloseCurlyBraces(true); setBracketMatchingEnabled(true); setAntiAliasingEnabled(true); setCloseMarkupTags(true); setLineWrap(true); if (requestDroptarget) { new SQLPaneDropTarget(this); } } private static class SQLPaneDropTarget extends DropTargetAdapter { private TableProcedure sqlTable; public SQLPaneDropTarget(SQLEditPane sqlTextPane) { new DropTarget(sqlTextPane, this); } public void dragEnter(DropTargetDragEvent dtde) { dtde.acceptDrag(dtde.getDropAction()); } public void dragOver(DropTargetDragEvent dtde) { dtde.acceptDrag(dtde.getDropAction()); } public void drop(DropTargetDropEvent dtde) { Point p = dtde.getLocation(); DropTargetContext dtc = dtde.getDropTargetContext(); SQLEditPane jTextPane = (SQLEditPane) dtc.getComponent(); try { Transferable tr = dtde.getTransferable(); DataFlavor[] flavors = tr.getTransferDataFlavors(); for (int i = 0; i < flavors.length; i++) { if (!tr.isDataFlavorSupported(flavors[i])) { continue; } dtde.acceptDrop(dtde.getDropAction()); Object userObj = tr.getTransferData(flavors[i]); if (userObj instanceof TableProcedure) { this.sqlTable = (TableProcedure) userObj; JPopupMenu popupMenu = new JPopupMenu(); popupMenu.add(new NameAction(jTextPane, sqlTable).createMenuItem()); if (ComparatorUtils.equals(sqlTable.getType(), TableProcedure.PROCEDURE)) { popupMenu.add(new CallAction(jTextPane, sqlTable).createMenuItem()); } else { popupMenu.add(new SelectAction(jTextPane, sqlTable).createMenuItem()); } GUICoreUtils.showPopupMenu(popupMenu, jTextPane, (int) p.getX() + 1, (int) p.getY() + 1); } dtde.dropComplete(true); } dtde.rejectDrop(); } catch (Exception e) { dtde.rejectDrop(); } } class NameAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public NameAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName(com.fr.design.i18n.Toolkit.i18nText("Name")); this.setMnemonic('N'); this.setSmallIcon(null); } public void actionPerformed(ActionEvent evt) { if (sqlTable != null) { insertStringTo(sqlTextPane, sqlTable.toString()); } } } class SelectAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public SelectAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName("SELECT *"); this.setMnemonic('s'); this.setSmallIcon(null); } public void actionPerformed(ActionEvent evt) { //daniel: 添加参数 insertStringTo(sqlTextPane, DataCoreUtils.createSelectSQL(sqlTable.getSchema(), sqlTable.getName(), sqlTable.getDialect())); } } class CallAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public CallAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName("CALL PROCEDURE "); this.setMnemonic('s'); this.setSmallIcon(null); } public void actionPerformed(ActionEvent evt) { StringBuffer sBuf = new StringBuffer(); sBuf.append("{call "); if (sqlTable != null) { sBuf.append(sqlTable.toString()).append("()"); } sBuf.append('}'); insertStringTo(sqlTextPane, sBuf.toString()); } } private void insertStringTo(SQLEditPane sqlTextPane, String str) { Document document = sqlTextPane.getDocument(); try { document.insertString(sqlTextPane.getCaretPosition(), str, null); } catch (BadLocationException badLocationException) { FRContext.getLogger().error(badLocationException.getMessage(), badLocationException); } sqlTextPane.requestFocus(); } } } \ No newline at end of file +package com.fr.design.data.datapane.sqlpane; import com.fr.base.FRContext; import com.fr.data.core.DataCoreUtils; import com.fr.data.core.db.TableProcedure; import com.fr.design.actions.UpdateAction; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; import com.fr.general.ComparatorUtils; import com.fr.design.utils.gui.GUICoreUtils; import javax.swing.*; import javax.swing.text.BadLocationException; import javax.swing.text.Document; import java.awt.*; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; import java.awt.dnd.*; import java.awt.event.ActionEvent; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 7.0.3 * Date: 13-5-2 * Time: 上午11:09 */ public class SQLEditPane extends RSyntaxTextArea { public static final boolean REQUEST_DROPTARGET = true; public static final boolean UNREQUEST_DROPTARGET = false; public SQLEditPane() { this(REQUEST_DROPTARGET); } public SQLEditPane(boolean requestDroptarget) { super(); setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_SQL); setAnimateBracketMatching(true); setAntiAliasingEnabled(true); setAutoIndentEnabled(true); setCodeFoldingEnabled(true); setUseSelectedTextColor(true); setCloseCurlyBraces(true); setBracketMatchingEnabled(true); setAntiAliasingEnabled(true); setCloseMarkupTags(true); setLineWrap(true); if (requestDroptarget) { new SQLPaneDropTarget(this); } } private static class SQLPaneDropTarget extends DropTargetAdapter { private TableProcedure sqlTable; public SQLPaneDropTarget(SQLEditPane sqlTextPane) { new DropTarget(sqlTextPane, this); } public void dragEnter(DropTargetDragEvent dtde) { dtde.acceptDrag(dtde.getDropAction()); } public void dragOver(DropTargetDragEvent dtde) { dtde.acceptDrag(dtde.getDropAction()); } public void drop(DropTargetDropEvent dtde) { Point p = dtde.getLocation(); DropTargetContext dtc = dtde.getDropTargetContext(); SQLEditPane jTextPane = (SQLEditPane) dtc.getComponent(); try { Transferable tr = dtde.getTransferable(); DataFlavor[] flavors = tr.getTransferDataFlavors(); for (int i = 0; i < flavors.length; i++) { if (!tr.isDataFlavorSupported(flavors[i])) { continue; } dtde.acceptDrop(dtde.getDropAction()); Object userObj = tr.getTransferData(flavors[i]); if (userObj instanceof TableProcedure) { this.sqlTable = (TableProcedure) userObj; JPopupMenu popupMenu = new JPopupMenu(); popupMenu.add(new NameAction(jTextPane, sqlTable).createMenuItem()); if (ComparatorUtils.equals(sqlTable.getType(), TableProcedure.PROCEDURE)) { popupMenu.add(new CallAction(jTextPane, sqlTable).createMenuItem()); } else { popupMenu.add(new SelectAction(jTextPane, sqlTable).createMenuItem()); } GUICoreUtils.showPopupMenu(popupMenu, jTextPane, (int) p.getX() + 1, (int) p.getY() + 1); } dtde.dropComplete(true); } dtde.rejectDrop(); } catch (Exception e) { dtde.rejectDrop(); } } class NameAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public NameAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name")); this.setMnemonic('N'); this.setSmallIcon(null); } public void actionPerformed(ActionEvent evt) { if (sqlTable != null) { insertStringTo(sqlTextPane, sqlTable.toString()); } } } class SelectAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public SelectAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName("SELECT *"); this.setMnemonic('s'); this.setSmallIcon(null); } public void actionPerformed(ActionEvent evt) { //daniel: 添加参数 insertStringTo(sqlTextPane, DataCoreUtils.createSelectSQL(sqlTable.getSchema(), sqlTable.getName(), sqlTable.getDialect())); } } class CallAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public CallAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName("CALL PROCEDURE "); this.setMnemonic('s'); this.setSmallIcon(null); } public void actionPerformed(ActionEvent evt) { StringBuffer sBuf = new StringBuffer(); sBuf.append("{call "); if (sqlTable != null) { sBuf.append(sqlTable.toString()).append("()"); } sBuf.append('}'); insertStringTo(sqlTextPane, sBuf.toString()); } } private void insertStringTo(SQLEditPane sqlTextPane, String str) { Document document = sqlTextPane.getDocument(); try { document.insertString(sqlTextPane.getCaretPosition(), str, null); } catch (BadLocationException badLocationException) { FRContext.getLogger().error(badLocationException.getMessage(), badLocationException); } sqlTextPane.requestFocus(); } } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/AutoStoreProcedureTableModel.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/AutoStoreProcedureTableModel.java index b33b030c4e..51967e8f35 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/AutoStoreProcedureTableModel.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/AutoStoreProcedureTableModel.java @@ -122,7 +122,7 @@ public class AutoStoreProcedureTableModel extends StoreProcedureTableModel { if(((String) value).length() > 0 && ((String) value).charAt(0) == '=') type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula"); else - type = com.fr.design.i18n.Toolkit.i18nText("Parameter-String"); + type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_String"); }else if(value instanceof Integer) type = com.fr.design.i18n.Toolkit.i18nText("Integer"); else if(value instanceof Double) @@ -130,11 +130,11 @@ public class AutoStoreProcedureTableModel extends StoreProcedureTableModel { else if(value instanceof Date) type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Date"); else if(value instanceof Boolean) - type = com.fr.design.i18n.Toolkit.i18nText("Parameter-Boolean"); + type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Boolean"); else if(value instanceof BaseFormula) type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula"); else - type = com.fr.design.i18n.Toolkit.i18nText("Parameter-String"); + type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_String"); return StoreProcedureParameterPane.getInfo4Value(type); } diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/StoreProcedureParameterPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/StoreProcedureParameterPane.java index 06fe4187c8..872b615e11 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/StoreProcedureParameterPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/StoreProcedureParameterPane.java @@ -30,11 +30,11 @@ public class StoreProcedureParameterPane extends BasicPane { private static NameObject[] nameAndValue = new NameObject[]{ new NameObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cursor"), StoreProcedureConstants.CURSOR), - new NameObject(com.fr.design.i18n.Toolkit.i18nText("Parameter-String"), StoreProcedureConstants.VARCHAR), + new NameObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_String"), StoreProcedureConstants.VARCHAR), new NameObject(com.fr.design.i18n.Toolkit.i18nText("Integer"), StoreProcedureConstants.INTEGER), new NameObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Double"), StoreProcedureConstants.DECIMAL), new NameObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Date"), StoreProcedureConstants.DATE), - new NameObject(com.fr.design.i18n.Toolkit.i18nText("Parameter-Boolean"), StoreProcedureConstants.BOOLEAN), + new NameObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Boolean"), StoreProcedureConstants.BOOLEAN), new NameObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula"), StoreProcedureConstants.FORMULA), new NameObject("IN",StoreProcedureConstants.IN), new NameObject("OUT",StoreProcedureConstants.OUT), @@ -71,7 +71,7 @@ public class StoreProcedureParameterPane extends BasicPane { schemaCombo = new UIComboBox(); initUIComboBox(schemaCombo, schemaName); JPanel namePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - namePane.add(new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Name") + ":"), BorderLayout.WEST); + namePane.add(new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":"), BorderLayout.WEST); nameField = new UITextField(10); namePane.add(nameField, BorderLayout.CENTER); namePane.add(new UILabel(" "), BorderLayout.EAST); @@ -80,7 +80,7 @@ public class StoreProcedureParameterPane extends BasicPane { valuePane.add(new UILabel(" "), BorderLayout.EAST); Component[][] components = {{null}, {namePane}, - {addPane("Model", 1, schemaCombo)}, + {addPane("Fine-Design_Basic_Model", 1, schemaCombo)}, {valuePane}, {null} }; @@ -105,7 +105,7 @@ public class StoreProcedureParameterPane extends BasicPane { @Override protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Parameter"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter"); } public void populate(StoreProcedureParameter stpParameter) { @@ -129,7 +129,7 @@ public class StoreProcedureParameterPane extends BasicPane { if(((String) value).length() > 0 && ((String) value).charAt(0) == '=') type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula"); else - type = com.fr.design.i18n.Toolkit.i18nText("Parameter-String"); + type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_String"); }else if(value instanceof Integer) type = com.fr.design.i18n.Toolkit.i18nText("Integer"); else if(value instanceof Double) @@ -137,11 +137,11 @@ public class StoreProcedureParameterPane extends BasicPane { else if(value instanceof Date) type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Date"); else if(value instanceof Boolean) - type = com.fr.design.i18n.Toolkit.i18nText("Parameter-Boolean"); + type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Boolean"); else if(value instanceof BaseFormula) type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula"); else - type = com.fr.design.i18n.Toolkit.i18nText("Parameter-String"); + type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_String"); int typeVl = getInfo4Value(type); p.setType(typeVl); String schema = (String)schemaCombo.getSelectedItem(); diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/StoreProcedureTableModel.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/StoreProcedureTableModel.java index 6fce66b482..60ac80a725 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/StoreProcedureTableModel.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/StoreProcedureTableModel.java @@ -1,24 +1,23 @@ package com.fr.design.data.tabledata.tabledatapane; -import java.awt.event.ActionEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.util.List; - -import javax.swing.BorderFactory; - import com.fr.base.StoreProcedureParameter; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.gui.itableeditorpane.UITableEditAction; import com.fr.design.gui.itableeditorpane.UITableModelAdapter; import com.fr.design.mainframe.DesignerContext; -import com.fr.design.dialog.BasicDialog; -import com.fr.design.dialog.DialogActionAdapter; + +import javax.swing.BorderFactory; +import java.awt.event.ActionEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.List; public class StoreProcedureTableModel extends UITableModelAdapter { public StoreProcedureTableModel() { - super(new String[] { com.fr.design.i18n.Toolkit.i18nText("Parameter"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type"), com.fr.design.i18n.Toolkit.i18nText("Model"), com.fr.design.i18n.Toolkit.i18nText("Value") }); + super(new String[] { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Model"), com.fr.design.i18n.Toolkit.i18nText("Value") }); if (shouldResponseDoubleClickAction()) { table.addMouseListener(new MouseAdapter() { @@ -36,7 +35,7 @@ public class StoreProcedureTableModel extends UITableModelAdapter(); } columnNameList = Arrays.asList(procedureDataModel.getColumnName()); diff --git a/designer-base/src/main/java/com/fr/design/dialog/InformationWarnPane.java b/designer-base/src/main/java/com/fr/design/dialog/InformationWarnPane.java index 2fc2f53e06..aac7461c33 100644 --- a/designer-base/src/main/java/com/fr/design/dialog/InformationWarnPane.java +++ b/designer-base/src/main/java/com/fr/design/dialog/InformationWarnPane.java @@ -80,7 +80,7 @@ public class InformationWarnPane extends JPanel{ }); arrow.setBounds(90,100,30,30); - UILabel more = new UILabel(""+com.fr.design.i18n.Toolkit.i18nText("More-information")+""); + UILabel more = new UILabel(""+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_More_Information")+""); more.setBounds(125,102,55,25); moreText = new UITextArea(moreInfo); diff --git a/designer-base/src/main/java/com/fr/design/dialog/JWizardDialog.java b/designer-base/src/main/java/com/fr/design/dialog/JWizardDialog.java index 8d6302662a..9c08bdbbb4 100644 --- a/designer-base/src/main/java/com/fr/design/dialog/JWizardDialog.java +++ b/designer-base/src/main/java/com/fr/design/dialog/JWizardDialog.java @@ -1,5 +1,14 @@ package com.fr.design.dialog; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; + +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JDialog; +import javax.swing.JPanel; +import javax.swing.JSeparator; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Dialog; @@ -10,16 +19,6 @@ import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; -import javax.swing.BorderFactory; -import javax.swing.Icon; -import javax.swing.JDialog; -import com.fr.design.gui.ilable.UILabel; -import javax.swing.JPanel; -import javax.swing.JSeparator; - -import com.fr.design.gui.ibutton.UIButton; -import com.fr.design.layout.FRGUIPaneFactory; - /** * Wizard dialog. @@ -110,7 +109,7 @@ public class JWizardDialog extends BasicDialog { back(); } }); - buttonNext = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Next")); + buttonNext = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Next")); buttonNext.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { next(); @@ -365,4 +364,4 @@ public class JWizardDialog extends BasicDialog { @Override public void checkValid() throws Exception { } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/editor/DoubleDeckValueEditorPane.java b/designer-base/src/main/java/com/fr/design/editor/DoubleDeckValueEditorPane.java index 53eb4866fc..de8df9a718 100644 --- a/designer-base/src/main/java/com/fr/design/editor/DoubleDeckValueEditorPane.java +++ b/designer-base/src/main/java/com/fr/design/editor/DoubleDeckValueEditorPane.java @@ -283,7 +283,7 @@ public class DoubleDeckValueEditorPane extends BasicPane implements UIObserver, int i; boolean containFormulaType = false; for (i = 0; i < cards.length; i++) { - if (ComparatorUtils.equals(cards[i].getName(), com.fr.design.i18n.Toolkit.i18nText("FR-Engine_Parameter-Formula"))) { + if (ComparatorUtils.equals(cards[i].getName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_Parameter_Formula"))) { containFormulaType = true; break; } @@ -303,7 +303,7 @@ public class DoubleDeckValueEditorPane extends BasicPane implements UIObserver, if (designerEnvManager.isSupportStringToFormula()) { if (!designerEnvManager.isDefaultStringToFormula()) { int returnValue = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit_String_To_Formula") - + "?", com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Tooltips"), JOptionPane.YES_NO_OPTION); + + "?", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.YES_NO_OPTION); if (returnValue == JOptionPane.OK_OPTION) { setCurrentEditor(j); diff --git a/designer-base/src/main/java/com/fr/design/editor/ValueEditorPane.java b/designer-base/src/main/java/com/fr/design/editor/ValueEditorPane.java index e304d96a86..4ebe3c83fa 100644 --- a/designer-base/src/main/java/com/fr/design/editor/ValueEditorPane.java +++ b/designer-base/src/main/java/com/fr/design/editor/ValueEditorPane.java @@ -264,7 +264,7 @@ public class ValueEditorPane extends BasicPane implements UIObserver, GlobalName int i; boolean containFormulaType = false; for (i = 0; i < cards.length; i++) { - if (ComparatorUtils.equals(cards[i].getName(), com.fr.design.i18n.Toolkit.i18nText("FR-Engine_Parameter-Formula"))) { + if (ComparatorUtils.equals(cards[i].getName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_Parameter_Formula"))) { containFormulaType = true; break; } @@ -284,7 +284,7 @@ public class ValueEditorPane extends BasicPane implements UIObserver, GlobalName if (designerEnvManager.isSupportStringToFormula()) { if (!designerEnvManager.isDefaultStringToFormula()) { int returnValue = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit_String_To_Formula") - + "?", com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Tooltips"), JOptionPane.YES_NO_OPTION); + + "?", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.YES_NO_OPTION); if (returnValue == JOptionPane.OK_OPTION) { setCurrentEditor(j); diff --git a/designer-base/src/main/java/com/fr/design/editor/editor/BooleanEditor.java b/designer-base/src/main/java/com/fr/design/editor/editor/BooleanEditor.java index 78ee449d91..af2589d455 100644 --- a/designer-base/src/main/java/com/fr/design/editor/editor/BooleanEditor.java +++ b/designer-base/src/main/java/com/fr/design/editor/editor/BooleanEditor.java @@ -42,7 +42,7 @@ public class BooleanEditor extends Editor { booleanCheckBox = new UICheckBox("true"); this.add(booleanCheckBox, BorderLayout.CENTER); this.setValue(value); - this.setName(com.fr.design.i18n.Toolkit.i18nText("Parameter-Boolean")); + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Boolean")); booleanCheckBox.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { diff --git a/designer-base/src/main/java/com/fr/design/editor/editor/ParameterEditor.java b/designer-base/src/main/java/com/fr/design/editor/editor/ParameterEditor.java index 813ca021ff..be25cab036 100644 --- a/designer-base/src/main/java/com/fr/design/editor/editor/ParameterEditor.java +++ b/designer-base/src/main/java/com/fr/design/editor/editor/ParameterEditor.java @@ -28,7 +28,7 @@ public class ParameterEditor extends Editor { this.add(parameterCombobox, BorderLayout.CENTER); this.setValue(parameter); - this.setName(com.fr.design.i18n.Toolkit.i18nText("Parameter")); + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter")); } @Override diff --git a/designer-base/src/main/java/com/fr/design/editor/editor/TextEditor.java b/designer-base/src/main/java/com/fr/design/editor/editor/TextEditor.java index 0632be2e46..7084fbcc45 100644 --- a/designer-base/src/main/java/com/fr/design/editor/editor/TextEditor.java +++ b/designer-base/src/main/java/com/fr/design/editor/editor/TextEditor.java @@ -45,7 +45,7 @@ public class TextEditor extends Editor { this.textField.addKeyListener(textKeyListener); this.setValue(value); - this.setName(com.fr.design.i18n.Toolkit.i18nText("Parameter-String")); + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_String")); } public UITextField getTextField() { diff --git a/designer-base/src/main/java/com/fr/design/editor/editor/XMLANameEditor.java b/designer-base/src/main/java/com/fr/design/editor/editor/XMLANameEditor.java index 5676701640..0aaaea3ae8 100644 --- a/designer-base/src/main/java/com/fr/design/editor/editor/XMLANameEditor.java +++ b/designer-base/src/main/java/com/fr/design/editor/editor/XMLANameEditor.java @@ -34,7 +34,7 @@ public class XMLANameEditor extends ColumnIndexEditor{ * @param columnNames 度量值 */ public XMLANameEditor(String[] columnNames) { - this(columnNames, com.fr.design.i18n.Toolkit.i18nText("Measure")); + this(columnNames, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Measure")); } /** diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java b/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java index 36f325521f..b0b1f54324 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java @@ -94,7 +94,7 @@ public class PluginOperateUtils { public void run() { int rv = JOptionPane.showConfirmDialog( null, - com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Delete_Confirmed"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Confirmed"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java b/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java index 6856bc003d..50f81d5741 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginUtils.java @@ -139,7 +139,7 @@ public class PluginUtils { String startVersion = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Start_Version"); String developer = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Developer"); String desc = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Function_Description"); - String updateLog = com.fr.design.i18n.Toolkit.i18nText("FR-Plugin-Update_Log"); + String updateLog = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Plugin_Update_Log"); Map map = new HashMap(); map.put("name", pluginName); @@ -246,7 +246,7 @@ public class PluginUtils { int leftDays = plugin.getLeftDays(); if (leftDays == Integer.MAX_VALUE) { - return com.fr.design.i18n.Toolkit.i18nText("FR-Plugin-Store_Permanent"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Store_Permanent"); } Calendar deadline = Calendar.getInstance(); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); diff --git a/designer-base/src/main/java/com/fr/design/extra/QQLoginWebPane.java b/designer-base/src/main/java/com/fr/design/extra/QQLoginWebPane.java index db7e32e7cf..f3d37cab70 100644 --- a/designer-base/src/main/java/com/fr/design/extra/QQLoginWebPane.java +++ b/designer-base/src/main/java/com/fr/design/extra/QQLoginWebPane.java @@ -177,7 +177,7 @@ public class QQLoginWebPane extends JFXPanel { dialog.close(); } }).build(), - ButtonBuilder.create().text(com.fr.design.i18n.Toolkit.i18nText("FR-Engine_Cancel")).cancelButton(true).onAction(new EventHandler() { + ButtonBuilder.create().text(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_Cancel")).cancelButton(true).onAction(new EventHandler() { @Override public void handle(ActionEvent actionEvent) { // abort action and close the dialog. diff --git a/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java b/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java index 7c2f09becf..11bfc334ab 100644 --- a/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java +++ b/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java @@ -282,7 +282,7 @@ public class WebViewDlgHelper { if (get()) { IOUtils.unzip(new File(StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE)), installHome); PluginStoreConstants.refreshProps(); // 下载完刷新一下版本号等 - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Shop_Installed"), com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Tooltips"), JOptionPane.INFORMATION_MESSAGE); + JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Shop_Installed"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.INFORMATION_MESSAGE); } } catch (InterruptedException | ExecutionException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/ModifyStatusCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/ModifyStatusCallback.java index 301959423b..681180053e 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/ModifyStatusCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/ModifyStatusCallback.java @@ -22,7 +22,7 @@ public class ModifyStatusCallback implements PluginTaskCallback{ public void done(PluginTaskResult result) { if (result.isSuccess()) { jsCallback.execute("success"); - String modifyMessage = isActive ? com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Has_Been_Disabled") : com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Has_Been_Actived"); + String modifyMessage = isActive ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Been_Disabled_Duplicate") : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Plugin_Has_Been_Actived_Duplicate"); JOptionPane.showMessageDialog(null, modifyMessage); } else { JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java index 6e85e9c4b1..c2c69299d1 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java @@ -937,11 +937,11 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { BaseUtils.readIcon("/com/fr/design/images/dialog/parameter.gif"), variableResolver.resolveTableDataParameterVariables()).createMutableTreeNode()); - rootNode.add(new TextFolderUserObject(com.fr.design.i18n.Toolkit.i18nText("ParameterD-Report_Parameter"), + rootNode.add(new TextFolderUserObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ParameterD_Report_Parameter"), BaseUtils.readIcon("/com/fr/design/images/m_report/p.gif"), variableResolver.resolveReportParameterVariables()).createMutableTreeNode()); - rootNode.add(new TextFolderUserObject(com.fr.design.i18n.Toolkit.i18nText("M_Server-Global_Parameters"), + rootNode.add(new TextFolderUserObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Server_Global_Parameters"), BaseUtils.readIcon("/com/fr/design/images/dialog/parameter.gif"), variableResolver.resolveGlobalParameterVariables()).createMutableTreeNode()); diff --git a/designer-base/src/main/java/com/fr/design/gui/date/UICalendarPanel.java b/designer-base/src/main/java/com/fr/design/gui/date/UICalendarPanel.java index b28caa1c7a..5fb0de8957 100644 --- a/designer-base/src/main/java/com/fr/design/gui/date/UICalendarPanel.java +++ b/designer-base/src/main/java/com/fr/design/gui/date/UICalendarPanel.java @@ -161,9 +161,9 @@ public class UICalendarPanel extends JPanel { pWeeks.setPreferredSize(new Dimension(216, 22)); pWeeks.setBackground(new Color(0xFFFFFF)); pWeeks.setOpaque(true); - String[] strWeeks = new String[] {StringUtils.EMPTY, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sun"), com.fr.design.i18n.Toolkit.i18nText("Mon"), + String[] strWeeks = new String[] {StringUtils.EMPTY, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sun"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Mon"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tue"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Wed"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Thu"), - com.fr.design.i18n.Toolkit.i18nText("Fri"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Sat") + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Fri"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Sat") }; for (int i = 1; i <= WEEKDAY_COUNT; i++) { UILabel label = new UILabel(); diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/EditingStringListPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/EditingStringListPane.java index 0f8ba6dacb..febd0deff4 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/EditingStringListPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/EditingStringListPane.java @@ -56,7 +56,7 @@ public abstract class EditingStringListPane extends BasicBeanPane> }); addButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add")); - editButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Modify")); + editButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Modify")); removeButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Remove")); moveUpButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Up")); moveDownButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Down")); diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/ObjectProperiesPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/ObjectProperiesPane.java index fc62de0806..d9f19d8546 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/ObjectProperiesPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/ObjectProperiesPane.java @@ -129,7 +129,7 @@ public class ObjectProperiesPane extends BasicBeanPane { cancel.setMargin(new Insets(0, 0, 0, 0)); this.add(cancel); - this.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Name")+":")); + this.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name")+":")); this.nameField = new UITextField(6); this.add(this.nameField); diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/ReportletParameterViewPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/ReportletParameterViewPane.java index e18d04b94e..37bd82bfc5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/ReportletParameterViewPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/ReportletParameterViewPane.java @@ -95,7 +95,7 @@ public class ReportletParameterViewPane extends BasicPane { @Override protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Parameters"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameters"); } public void populate(ParameterProvider[] parameters) { diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/TemplateParameterPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/TemplateParameterPane.java index 70faa46be3..56f32ff788 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/TemplateParameterPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/TemplateParameterPane.java @@ -1,20 +1,19 @@ package com.fr.design.gui.frpane; -import java.awt.BorderLayout; -import java.awt.Component; - -import javax.swing.BorderFactory; -import com.fr.design.gui.ilable.UILabel; -import javax.swing.JPanel; - import com.fr.base.Parameter; +import com.fr.design.dialog.BasicPane; +import com.fr.design.editor.ValueEditorPane; +import com.fr.design.editor.ValueEditorPaneFactory; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.dialog.BasicPane; -import com.fr.design.editor.ValueEditorPane; -import com.fr.design.editor.ValueEditorPaneFactory; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; /** @@ -30,7 +29,7 @@ public class TemplateParameterPane extends BasicPane { } public void initComponents() { - this.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Parameter"))); + this.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter"))); this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); @@ -39,7 +38,7 @@ public class TemplateParameterPane extends BasicPane { JPanel defaultPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); northPane.add(defaultPane, BorderLayout.CENTER); - UILabel nameLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Name") + ":"); + UILabel nameLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":"); UILabel valueLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Value") + ":"); nameTextField = new UITextField(12); @@ -55,7 +54,7 @@ public class TemplateParameterPane extends BasicPane { @Override protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Parameter"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter"); } public void populate(Parameter parameter) { diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/UIAdvancedTextPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/UIAdvancedTextPane.java index 40039deb20..c3dda67741 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/UIAdvancedTextPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/UIAdvancedTextPane.java @@ -142,7 +142,7 @@ public class UIAdvancedTextPane extends UITextPane { private class CutAction extends UpdateAction { public CutAction() { - setName(com.fr.design.i18n.Toolkit.i18nText("M_Edit-Cut")); + setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Cut")); setMnemonic('T'); setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/cut.png")); setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER)); @@ -161,7 +161,7 @@ public class UIAdvancedTextPane extends UITextPane { private class CopyAction extends UpdateAction { public CopyAction() { - this.setName(com.fr.design.i18n.Toolkit.i18nText("M_Edit-Copy")); + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Copy")); this.setMnemonic('C'); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/copy.png")); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER)); @@ -180,7 +180,7 @@ public class UIAdvancedTextPane extends UITextPane { private class PasteAction extends UpdateAction { public PasteAction() { - this.setName(com.fr.design.i18n.Toolkit.i18nText("M_Edit-Paste")); + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Edit_Paste")); this.setMnemonic('P'); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/paste.png")); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER)); diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java index d1c2a087af..a1f92ddd0e 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java @@ -377,7 +377,7 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver { JPanel content = (JPanel) jf.getContentPane(); content.setLayout(new BorderLayout()); List data = new ArrayList(); - UIMenuNameableCreator reportlet = new UIMenuNameableCreator(com.fr.design.i18n.Toolkit.i18nText("FR-Hyperlink_Reportlet"), + UIMenuNameableCreator reportlet = new UIMenuNameableCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Reportlet"), new ReportletHyperlink(), ReportletHyperlinkPane.class); UIMenuNameableCreator email = new UIMenuNameableCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Email"), diff --git a/designer-base/src/main/java/com/fr/design/gui/icombobox/DictionaryConstants.java b/designer-base/src/main/java/com/fr/design/gui/icombobox/DictionaryConstants.java index ea994849ce..d865fdb690 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombobox/DictionaryConstants.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombobox/DictionaryConstants.java @@ -22,8 +22,8 @@ public class DictionaryConstants { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Length"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Float"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Email"), - com.fr.design.i18n.Toolkit.i18nText("Phone"), - com.fr.design.i18n.Toolkit.i18nText("MobilePhone"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Phone"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_MobilePhone"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_IDCard"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_PostCode"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom")}; diff --git a/designer-base/src/main/java/com/fr/design/gui/iscrollbar/UISBChooser.java b/designer-base/src/main/java/com/fr/design/gui/iscrollbar/UISBChooser.java index 56dfbbdae2..a6ba742830 100644 --- a/designer-base/src/main/java/com/fr/design/gui/iscrollbar/UISBChooser.java +++ b/designer-base/src/main/java/com/fr/design/gui/iscrollbar/UISBChooser.java @@ -106,7 +106,7 @@ public class UISBChooser extends JDialog { JButton b = new JButton("Cancel"); b.addActionListener(new CancelAction()); p3.add(b); - b = new JButton("Fine-Design_Report_OK"); + b = new JButton("OK"); getRootPane().setDefaultButton(b); b.addActionListener(new OKAction()); p3.add(b); diff --git a/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/ParameterTableModel.java b/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/ParameterTableModel.java index 0cfa26f9ef..33e6b8e7bd 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/ParameterTableModel.java +++ b/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/ParameterTableModel.java @@ -35,7 +35,7 @@ public class ParameterTableModel extends UITableModelAdapter } public ParameterTableModel(int paraUseType) { - super(new String[] { com.fr.design.i18n.Toolkit.i18nText("Parameter"), com.fr.design.i18n.Toolkit.i18nText("Value") }); + super(new String[] { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter"), com.fr.design.i18n.Toolkit.i18nText("Value") }); this.setColumnClass(new Class[] { ParameterEditor.class, ParameterValueEditor.class }); this.setDefaultEditor(ParameterValueEditor.class, new ParameterValueEditor(paraUseType)); this.setDefaultEditor(ParameterEditor.class, new ParameterEditor()); @@ -43,7 +43,7 @@ public class ParameterTableModel extends UITableModelAdapter } public ParameterTableModel(int paraUseType, Component component) { - super(new String[] { com.fr.design.i18n.Toolkit.i18nText("Parameter"), com.fr.design.i18n.Toolkit.i18nText("Value") }); + super(new String[] { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter"), com.fr.design.i18n.Toolkit.i18nText("Value") }); this.setColumnClass(new Class[] { ParameterEditor.class, ParameterValueEditor.class }); this.setDefaultEditor(ParameterValueEditor.class, new ParameterValueEditor(paraUseType)); this.setDefaultEditor(ParameterEditor.class, new ParameterEditor()); @@ -52,7 +52,7 @@ public class ParameterTableModel extends UITableModelAdapter } public ParameterTableModel(ValueEditorPane valueEditorPane, ValueEditorPane valueRenderPane, Component component) { - super(new String[] { com.fr.design.i18n.Toolkit.i18nText("Parameter"), com.fr.design.i18n.Toolkit.i18nText("Value") }); + super(new String[] { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter"), com.fr.design.i18n.Toolkit.i18nText("Value") }); this.setColumnClass(new Class[] { ParameterEditor.class, ParameterValueEditor.class }); this.setDefaultEditor(ParameterValueEditor.class, new ParameterValueEditor(valueEditorPane)); this.setDefaultEditor(ParameterEditor.class, new ParameterEditor()); diff --git a/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/ErrorStrip.java b/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/ErrorStrip.java index 508fb93b27..ab210acd58 100644 --- a/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/ErrorStrip.java +++ b/designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/ErrorStrip.java @@ -9,6 +9,17 @@ */ package com.fr.design.gui.syntax.ui.rsyntaxtextarea; +import com.fr.design.gui.syntax.ui.rsyntaxtextarea.parser.Parser; +import com.fr.design.gui.syntax.ui.rsyntaxtextarea.parser.ParserNotice; +import com.fr.design.gui.syntax.ui.rsyntaxtextarea.parser.TaskTagParser.TaskNotice; +import com.fr.design.gui.syntax.ui.rtextarea.RTextArea; + +import javax.swing.JComponent; +import javax.swing.ToolTipManager; +import javax.swing.UIManager; +import javax.swing.event.CaretEvent; +import javax.swing.event.CaretListener; +import javax.swing.text.BadLocationException; import java.awt.Color; import java.awt.Component; import java.awt.Cursor; @@ -24,17 +35,6 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.swing.JComponent; -import javax.swing.ToolTipManager; -import javax.swing.UIManager; -import javax.swing.event.CaretEvent; -import javax.swing.event.CaretListener; -import javax.swing.text.BadLocationException; - -import com.fr.design.gui.syntax.ui.rsyntaxtextarea.parser.Parser; -import com.fr.design.gui.syntax.ui.rsyntaxtextarea.parser.ParserNotice; -import com.fr.design.gui.syntax.ui.rsyntaxtextarea.parser.TaskTagParser.TaskNotice; -import com.fr.design.gui.syntax.ui.rtextarea.RTextArea; @@ -287,7 +287,7 @@ public class ErrorStrip extends JComponent { String text = null; int line = yToLine(e.getY()); if (line>-1) { - text = com.fr.design.i18n.Toolkit.i18nText("Line"); + text = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Line"); text = MessageFormat.format(text, Integer.valueOf(line+1)); } return text; @@ -673,7 +673,7 @@ public class ErrorStrip extends JComponent { try { String word = textArea.getText(range.getStartOffset(), getLength()); - text = com.fr.design.i18n.Toolkit.i18nText("OccurrenceOf"); + text = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_OccurrenceOf"); text = MessageFormat.format(text, word); } catch (BadLocationException ble) { UIManager.getLookAndFeel().provideErrorFeedback(textArea); diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/ReporletHyperNorthPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/ReporletHyperNorthPane.java index 757de93d2c..d35c70a822 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/ReporletHyperNorthPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/ReporletHyperNorthPane.java @@ -86,13 +86,13 @@ public class ReporletHyperNorthPane extends AbstractHyperNorthPane> if (isLowerThanHBB(xmlDesignerVersion)) { String info = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Open-New_Form_Tip"); String moreInfo = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Version_Tip_More_Info"); - new InformationWarnPane(info, moreInfo, com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Tooltips")).show(); + new InformationWarnPane(info, moreInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")).show(); return true; } return false; @@ -884,7 +884,7 @@ public abstract class JTemplate> if (isHigherThanCurrent(xmlDesignerVersion)) { String infor = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Template_Version_Not_Match", StringUtils.parseVersion(xmlDesignerVersion)); String moreInfo = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Version_Tip_More_Info"); - new InformationWarnPane(infor, moreInfo, com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Tooltips")).show(); + new InformationWarnPane(infor, moreInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")).show(); return true; } return false; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/NoSupportAuthorityEdit.java b/designer-base/src/main/java/com/fr/design/mainframe/NoSupportAuthorityEdit.java index 4b2b6445c1..4577f5a0b3 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/NoSupportAuthorityEdit.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/NoSupportAuthorityEdit.java @@ -40,7 +40,7 @@ public class NoSupportAuthorityEdit extends AuthorityEditPane { private JPanel createTextPane() { JPanel panel = new JPanel(new BorderLayout()); - UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("not_support_authority_edit")); + UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Not_Support_Authority_Edit")); uiLabel.setHorizontalAlignment(SwingConstants.CENTER); uiLabel.setVerticalAlignment(SwingConstants.CENTER); panel.add(uiLabel, BorderLayout.CENTER); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBarUI.java b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBarUI.java index 4eb214358c..5a4ba1edaf 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBarUI.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBarUI.java @@ -100,7 +100,7 @@ public class LogHandlerBarUI extends ComponentUI implements MouseListener, Focus g.drawString(button.getText(), textLeadingGap, y); } - g.drawString(com.fr.design.i18n.Toolkit.i18nText("NNormal") + '(' + button.getInfo() + ')', button.getWidth() - 310, y); + g.drawString(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_NNormal") + '(' + button.getInfo() + ')', button.getWidth() - 310, y); g.drawString(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Alert") + '(' + button.getError() + ')', button.getWidth() - 250, y); g.drawString(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Seriously") + '(' + button.getServer() + ')', button.getWidth() - 190, y); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java index dd76e2a714..73f9ce9bdf 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java @@ -56,7 +56,7 @@ public class LogMessageBar extends JPanel { if (message == null) { return; } - messageLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Log") + " | " + message); + messageLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Log") + " | " + message); repaint(); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/wrappers/BackgroundWrapper.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/wrappers/BackgroundWrapper.java index f6c8011e3a..599e16a081 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/widget/wrappers/BackgroundWrapper.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/wrappers/BackgroundWrapper.java @@ -35,7 +35,7 @@ public class BackgroundWrapper implements Encoder, Decoder { } else if (v instanceof GradientBackground) { return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Gradient_Color"); } else { - return com.fr.design.i18n.Toolkit.i18nText("None"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_None"); } } diff --git a/designer-base/src/main/java/com/fr/design/menu/KeySetUtils.java b/designer-base/src/main/java/com/fr/design/menu/KeySetUtils.java index a538d3218e..c9e32f58b4 100644 --- a/designer-base/src/main/java/com/fr/design/menu/KeySetUtils.java +++ b/designer-base/src/main/java/com/fr/design/menu/KeySetUtils.java @@ -184,7 +184,7 @@ public class KeySetUtils { @Override public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("FR-Engine_Export-Excel-Page"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_Export_Excel_Page"); } @Override @@ -202,7 +202,7 @@ public class KeySetUtils { @Override public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("FR-Engine_Export-Excel-Simple"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_Export_Excel_Simple"); } @Override @@ -220,7 +220,7 @@ public class KeySetUtils { @Override public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("FR-Engine_Export-Excel-PageToSheet"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_Export_Excel_PageToSheet"); } @Override @@ -327,7 +327,7 @@ public class KeySetUtils { @Override public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("M_File-ExportT-Template(embedded_data)"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_File_ExportT_Template(embedded_data)"); } @Override @@ -603,7 +603,7 @@ public class KeySetUtils { @Override public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("FR-Designer_ReportColumns-Columns"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportColumns_Columns"); } @Override @@ -639,7 +639,7 @@ public class KeySetUtils { @Override public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("FR-Engine_Frozen"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Frozen"); } @Override @@ -793,7 +793,7 @@ public class KeySetUtils { @Override public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("M_Format-Data_Map"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Format_Data_Map"); } @Override @@ -827,7 +827,7 @@ public class KeySetUtils { @Override public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("M_Insert-Barcode"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Insert_Barcode"); } @Override @@ -947,7 +947,7 @@ public class KeySetUtils { @Override public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("M_Insert-Cell"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Insert_Cell"); } @Override diff --git a/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java b/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java index 39a89bac6a..30cac90eb2 100644 --- a/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java +++ b/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java @@ -54,7 +54,7 @@ public class ParameterArrayPane extends JListControlPane { @Override protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("FR-Engine_Schedule-Template_Parameter"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_Schedule_Template_Parameter"); } /** @@ -64,7 +64,7 @@ public class ParameterArrayPane extends JListControlPane { */ public NameableCreator[] createNameableCreators() { return new NameableCreator[]{ - new NameableSelfCreator(com.fr.design.i18n.Toolkit.i18nText("FR-Engine_Parameter_Name"), Parameter.class, ParameterPane.class) { + new NameableSelfCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_Parameter_Name"), Parameter.class, ParameterPane.class) { public Parameter createNameable(UnrepeatedNameHelper helper) { // 返回参数设置面板. return new Parameter(helper.createUnrepeatedName("p")); diff --git a/designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java b/designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java index f0f880369b..14487ca5fa 100644 --- a/designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java +++ b/designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java @@ -66,7 +66,7 @@ public class ParameterInputPane extends BasicPane { //Content Pane. JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); this.add(new JScrollPane(contentPane), BorderLayout.CENTER); - contentPane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Parameters") + ":")); + contentPane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameters") + ":")); FlowTableLayoutHelper flowTableLayoutHelper = new FlowTableLayoutHelper(); @@ -133,7 +133,7 @@ public class ParameterInputPane extends BasicPane { @Override protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Parameters"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameters"); } /** diff --git a/designer-base/src/main/java/com/fr/design/parameter/ParameterManagerPane.java b/designer-base/src/main/java/com/fr/design/parameter/ParameterManagerPane.java index 5a8407e8db..4cff724f1a 100644 --- a/designer-base/src/main/java/com/fr/design/parameter/ParameterManagerPane.java +++ b/designer-base/src/main/java/com/fr/design/parameter/ParameterManagerPane.java @@ -3,12 +3,9 @@ package com.fr.design.parameter; import com.fr.base.Parameter; import com.fr.base.ParameterConfig; import com.fr.design.dialog.BasicPane; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; -import javax.swing.*; import java.awt.*; @@ -24,7 +21,7 @@ public class ParameterManagerPane extends BasicPane { @Override protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("M_Server-Global_Parameters"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Server_Global_Parameters"); } public void populate(Parameter[] parameters) { diff --git a/designer-base/src/main/java/com/fr/design/parameter/ParameterPane.java b/designer-base/src/main/java/com/fr/design/parameter/ParameterPane.java index c9ab1224e6..063a685d80 100644 --- a/designer-base/src/main/java/com/fr/design/parameter/ParameterPane.java +++ b/designer-base/src/main/java/com/fr/design/parameter/ParameterPane.java @@ -1,19 +1,18 @@ package com.fr.design.parameter; -import java.awt.BorderLayout; -import java.awt.Component; - -import com.fr.design.gui.ilable.UILabel; -import javax.swing.JPanel; - import com.fr.base.Parameter; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.editor.ValueEditorPane; +import com.fr.design.editor.ValueEditorPaneFactory; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.editor.ValueEditorPane; -import com.fr.design.editor.ValueEditorPaneFactory; + +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; public class ParameterPane extends BasicBeanPane { @@ -46,7 +45,7 @@ public class ParameterPane extends BasicBeanPane { // richer:要排列显示的控件 Component[][] components = {{null}, - { null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Name") + ":"),textFieldPanel }, + { null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":"),textFieldPanel }, { null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Default_Value") + ":"),valueEditor } }; double p =TableLayout.PREFERRED; @@ -65,7 +64,7 @@ public class ParameterPane extends BasicBeanPane { @Override protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Parameter"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter"); } @Override diff --git a/designer-base/src/main/java/com/fr/design/present/dict/DatabaseDictPane.java b/designer-base/src/main/java/com/fr/design/present/dict/DatabaseDictPane.java index 5c3c3bd933..668bcd9beb 100644 --- a/designer-base/src/main/java/com/fr/design/present/dict/DatabaseDictPane.java +++ b/designer-base/src/main/java/com/fr/design/present/dict/DatabaseDictPane.java @@ -61,7 +61,7 @@ public class DatabaseDictPane extends FurtherBasicBeanPane i private void initBasicComponet() { // keyColumnPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()}); keyColumnPane = new DoubleDeckValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()}); - FormulaEditor formulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("FR-Engine_Parameter-Formula")); + FormulaEditor formulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_Parameter_Formula")); formulaEditor.setEnabled(true); // valueDictPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor(), formulaEditor}); valueDictPane = new DoubleDeckValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor(), formulaEditor}); @@ -224,7 +224,7 @@ public class DatabaseDictPane extends FurtherBasicBeanPane i String columnNameValue = columnNames.length > 0 ? columnNames[0] : StringUtils.EMPTY; keyColumnPane.setEditors(new Editor[]{columnNameEditor1, columnIndexEditor1}, columnNameValue); - FormulaEditor formulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("FR-Engine_Parameter-Formula")); + FormulaEditor formulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_Parameter_Formula")); formulaEditor.setEnabled(true); formulaEditor.addChangeListener(new ChangeListener() { diff --git a/designer-base/src/main/java/com/fr/design/preview/PagePreview.java b/designer-base/src/main/java/com/fr/design/preview/PagePreview.java index 824de4bb59..e46e1f06c9 100644 --- a/designer-base/src/main/java/com/fr/design/preview/PagePreview.java +++ b/designer-base/src/main/java/com/fr/design/preview/PagePreview.java @@ -12,7 +12,7 @@ import com.fr.design.fun.impl.AbstractPreviewProvider; public class PagePreview extends AbstractPreviewProvider { @Override public String nameForPopupItem() { - return com.fr.design.i18n.Toolkit.i18nText("M-Page_Preview"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Page_Preview"); } @Override diff --git a/designer-base/src/main/java/com/fr/design/preview/ViewPreview.java b/designer-base/src/main/java/com/fr/design/preview/ViewPreview.java index 7cd781760d..02809ba38c 100644 --- a/designer-base/src/main/java/com/fr/design/preview/ViewPreview.java +++ b/designer-base/src/main/java/com/fr/design/preview/ViewPreview.java @@ -15,7 +15,7 @@ import java.util.Map; public class ViewPreview extends AbstractPreviewProvider { @Override public String nameForPopupItem() { - return com.fr.design.i18n.Toolkit.i18nText("M-Data_Analysis"); + return com.fr.design.i18n.Toolkit.i18nText("Fine_Design_Basic_M_Data_Analysis"); } @Override diff --git a/designer-base/src/main/java/com/fr/design/preview/WritePreview.java b/designer-base/src/main/java/com/fr/design/preview/WritePreview.java index 6c1d6192a6..3d027dca7d 100644 --- a/designer-base/src/main/java/com/fr/design/preview/WritePreview.java +++ b/designer-base/src/main/java/com/fr/design/preview/WritePreview.java @@ -15,7 +15,7 @@ import java.util.Map; public class WritePreview extends AbstractPreviewProvider { @Override public String nameForPopupItem() { - return com.fr.design.i18n.Toolkit.i18nText("M-Write_Preview"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Write_Preview"); } @Override diff --git a/designer-base/src/main/java/com/fr/design/roleAuthority/RoleSourceOP.java b/designer-base/src/main/java/com/fr/design/roleAuthority/RoleSourceOP.java index 92c48187bf..1b90df3df2 100644 --- a/designer-base/src/main/java/com/fr/design/roleAuthority/RoleSourceOP.java +++ b/designer-base/src/main/java/com/fr/design/roleAuthority/RoleSourceOP.java @@ -1 +1 @@ -package com.fr.design.roleAuthority; import com.fr.general.NameObject; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.gui.itree.refreshabletree.UserObjectOP; import java.util.*; /** * Author : daisy * Date: 13-8-30 * Time: 下午3:36 */ public class RoleSourceOP implements UserObjectOP { private static final int REPORT_PLATEFORM_MANAGE = 0; private static final int FS_MANAGE = 1; public static int manageMode = -1; public RoleSourceOP() { super(); } public List> init() { //用于存放角色 List> allRoles = new ArrayList>(); Map report_roles = new LinkedHashMap(); Map FS_roles = new LinkedHashMap(); addReportRoles(report_roles); addFSRoles(FS_roles); allRoles.add(report_roles); allRoles.add(FS_roles); return allRoles; } /** * 获取报表平台的角色 */ protected void addReportRoles(Map report_roles) { RoleDataWrapper tdw = new RoleDataWrapper(com.fr.design.i18n.Toolkit.i18nText("M_Server-Platform_Manager")); report_roles.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Role"), tdw); } /** * 获取数据决策系统的角色 */ protected void addFSRoles(Map FS_roles) { RoleDataWrapper tdw = new RoleDataWrapper(com.fr.design.i18n.Toolkit.i18nText("FS_Name")); FS_roles.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Role"), tdw); } public boolean interceptButtonEnabled() { return true; } /** * 移除名字是name的角色 * * @param name */ public void removeAction(String name) { //删除对应模式下的角色 switch (manageMode) { case REPORT_PLATEFORM_MANAGE: //删除报表平台的角色 break; case FS_MANAGE: //删除数据决策系统的角色 break; } } public void addAction(String name) { switch (manageMode) { case REPORT_PLATEFORM_MANAGE: //增加报表平台的角色 break; case FS_MANAGE: //增加数据决策系统的角色 break; } } public void rename(String oldName, String newName) { switch (manageMode) { case REPORT_PLATEFORM_MANAGE: //修改报表平台的角色 break; case FS_MANAGE: //修改数据决策系统的角色 break; } } /** * 根据不同模式生成子节点 * * @return */ @Override public ExpandMutableTreeNode[] load() { Map report_roles = null; Map FS_roles = null; if (this != null) { report_roles = this.init().get(0); FS_roles = this.init().get(1); } else { report_roles = Collections.emptyMap(); FS_roles = Collections.emptyMap(); } List list = new ArrayList(); //所有的角色 List reportlist = new ArrayList(); //报表平台橘色 List FSlist = new ArrayList(); //数据决策系统角色 list.add(initReportRolseNode(report_roles)); addNodeToList(report_roles, reportlist); list.add(initFSRolseNode(FS_roles)); addNodeToList(FS_roles, FSlist); switch (manageMode) { case REPORT_PLATEFORM_MANAGE: return reportlist.toArray(new ExpandMutableTreeNode[reportlist.size()]); case FS_MANAGE: return FSlist.toArray(new ExpandMutableTreeNode[FSlist.size()]); default: return list.toArray(new ExpandMutableTreeNode[list.size()]); } } protected void setDataMode(int i) { manageMode = i; } protected void addNodeToList(Map roleMap, List roleList) { ExpandMutableTreeNode[] roleNode = getNodeArrayFromMap(roleMap); for (int i = 0; i < roleNode.length; i++) { roleList.add(roleNode[i]); } } protected ExpandMutableTreeNode initReportRolseNode(Map report_roles) { ExpandMutableTreeNode templateNode = new ExpandMutableTreeNode(new NameObject(com.fr.design.i18n.Toolkit.i18nText("M_Server-Platform_Manager"), REPORT_PLATEFORM_MANAGE), true); templateNode.addChildTreeNodes(getNodeArrayFromMap(report_roles)); return templateNode; } protected ExpandMutableTreeNode initFSRolseNode(Map FS_roles) { ExpandMutableTreeNode templateNode = new ExpandMutableTreeNode(new NameObject(com.fr.design.i18n.Toolkit.i18nText("FS_Name"), FS_MANAGE), true); templateNode.addChildTreeNodes(getNodeArrayFromMap(FS_roles)); return templateNode; } protected ExpandMutableTreeNode[] getNodeArrayFromMap(Map map) { List roleList = new ArrayList(); Iterator> entryIt = map.entrySet().iterator(); while (entryIt.hasNext()) { Map.Entry entry = entryIt.next(); String name = entry.getKey(); RoleDataWrapper t = entry.getValue(); ExpandMutableTreeNode newChildTreeNode = new ExpandMutableTreeNode(new NameObject(name, t)); roleList.add(newChildTreeNode); newChildTreeNode.add(new ExpandMutableTreeNode()); } return roleList.toArray(new ExpandMutableTreeNode[roleList.size()]); } } \ No newline at end of file +package com.fr.design.roleAuthority; import com.fr.general.NameObject; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.gui.itree.refreshabletree.UserObjectOP; import java.util.*; /** * Author : daisy * Date: 13-8-30 * Time: 下午3:36 */ public class RoleSourceOP implements UserObjectOP { private static final int REPORT_PLATEFORM_MANAGE = 0; private static final int FS_MANAGE = 1; public static int manageMode = -1; public RoleSourceOP() { super(); } public List> init() { //用于存放角色 List> allRoles = new ArrayList>(); Map report_roles = new LinkedHashMap(); Map FS_roles = new LinkedHashMap(); addReportRoles(report_roles); addFSRoles(FS_roles); allRoles.add(report_roles); allRoles.add(FS_roles); return allRoles; } /** * 获取报表平台的角色 */ protected void addReportRoles(Map report_roles) { RoleDataWrapper tdw = new RoleDataWrapper(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Server_Platform_Manager")); report_roles.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Role"), tdw); } /** * 获取数据决策系统的角色 */ protected void addFSRoles(Map FS_roles) { RoleDataWrapper tdw = new RoleDataWrapper(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FS_Name_Duplicate")); FS_roles.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Role"), tdw); } public boolean interceptButtonEnabled() { return true; } /** * 移除名字是name的角色 * * @param name */ public void removeAction(String name) { //删除对应模式下的角色 switch (manageMode) { case REPORT_PLATEFORM_MANAGE: //删除报表平台的角色 break; case FS_MANAGE: //删除数据决策系统的角色 break; } } public void addAction(String name) { switch (manageMode) { case REPORT_PLATEFORM_MANAGE: //增加报表平台的角色 break; case FS_MANAGE: //增加数据决策系统的角色 break; } } public void rename(String oldName, String newName) { switch (manageMode) { case REPORT_PLATEFORM_MANAGE: //修改报表平台的角色 break; case FS_MANAGE: //修改数据决策系统的角色 break; } } /** * 根据不同模式生成子节点 * * @return */ @Override public ExpandMutableTreeNode[] load() { Map report_roles = null; Map FS_roles = null; if (this != null) { report_roles = this.init().get(0); FS_roles = this.init().get(1); } else { report_roles = Collections.emptyMap(); FS_roles = Collections.emptyMap(); } List list = new ArrayList(); //所有的角色 List reportlist = new ArrayList(); //报表平台橘色 List FSlist = new ArrayList(); //数据决策系统角色 list.add(initReportRolseNode(report_roles)); addNodeToList(report_roles, reportlist); list.add(initFSRolseNode(FS_roles)); addNodeToList(FS_roles, FSlist); switch (manageMode) { case REPORT_PLATEFORM_MANAGE: return reportlist.toArray(new ExpandMutableTreeNode[reportlist.size()]); case FS_MANAGE: return FSlist.toArray(new ExpandMutableTreeNode[FSlist.size()]); default: return list.toArray(new ExpandMutableTreeNode[list.size()]); } } protected void setDataMode(int i) { manageMode = i; } protected void addNodeToList(Map roleMap, List roleList) { ExpandMutableTreeNode[] roleNode = getNodeArrayFromMap(roleMap); for (int i = 0; i < roleNode.length; i++) { roleList.add(roleNode[i]); } } protected ExpandMutableTreeNode initReportRolseNode(Map report_roles) { ExpandMutableTreeNode templateNode = new ExpandMutableTreeNode(new NameObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Server_Platform_Manager"), REPORT_PLATEFORM_MANAGE), true); templateNode.addChildTreeNodes(getNodeArrayFromMap(report_roles)); return templateNode; } protected ExpandMutableTreeNode initFSRolseNode(Map FS_roles) { ExpandMutableTreeNode templateNode = new ExpandMutableTreeNode(new NameObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FS_Name_Duplicate"), FS_MANAGE), true); templateNode.addChildTreeNodes(getNodeArrayFromMap(FS_roles)); return templateNode; } protected ExpandMutableTreeNode[] getNodeArrayFromMap(Map map) { List roleList = new ArrayList(); Iterator> entryIt = map.entrySet().iterator(); while (entryIt.hasNext()) { Map.Entry entry = entryIt.next(); String name = entry.getKey(); RoleDataWrapper t = entry.getValue(); ExpandMutableTreeNode newChildTreeNode = new ExpandMutableTreeNode(new NameObject(name, t)); roleList.add(newChildTreeNode); newChildTreeNode.add(new ExpandMutableTreeNode()); } return roleList.toArray(new ExpandMutableTreeNode[roleList.size()]); } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/roleAuthority/RolesAlreadyEditedPane.java b/designer-base/src/main/java/com/fr/design/roleAuthority/RolesAlreadyEditedPane.java index d9eea8ad07..f97a94da24 100644 --- a/designer-base/src/main/java/com/fr/design/roleAuthority/RolesAlreadyEditedPane.java +++ b/designer-base/src/main/java/com/fr/design/roleAuthority/RolesAlreadyEditedPane.java @@ -92,7 +92,7 @@ public class RolesAlreadyEditedPane extends JPanel { } else if (userObj instanceof NameObject) { NameObject nameObject = (NameObject) userObj; this.setText(nameObject.getName()); - if (nameObject.getName() == com.fr.design.i18n.Toolkit.i18nText("M_Server-Platform_Manager")) { + if (nameObject.getName() == com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Server_Platform_Manager")) { this.setIcon(BaseUtils.readIcon("/com/fr/web/images/platform/platform_16_16.png")); } else { this.setIcon(BaseUtils.readIcon("/com/fr/web/images/platform/demo.png")); diff --git a/designer-base/src/main/java/com/fr/design/roleAuthority/RolesEditedSourceOP.java b/designer-base/src/main/java/com/fr/design/roleAuthority/RolesEditedSourceOP.java index 0cf743ba81..88563e8dbf 100644 --- a/designer-base/src/main/java/com/fr/design/roleAuthority/RolesEditedSourceOP.java +++ b/designer-base/src/main/java/com/fr/design/roleAuthority/RolesEditedSourceOP.java @@ -1 +1 @@ -package com.fr.design.roleAuthority; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Map; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.mainframe.JTemplate; import com.fr.general.NameObject; import com.fr.privilege.PrivilegeEditedRoleProvider; /** * Author : daisy * Date: 13-9-25 * Time: 下午4:57 */ public class RolesEditedSourceOP extends RoleSourceOP { /** * 获取报表平台的角色 */ protected void addReportRoles(Map report_roles) { RoleDataWrapper tdw = new RoleDataWrapper(com.fr.design.i18n.Toolkit.i18nText("M_Server-Platform_Manager")); report_roles.put(com.fr.design.i18n.Toolkit.i18nText("M_Server-Platform_Manager"), tdw); } /** * 获取数据决策系统的角色 */ protected void addFSRoles(Map FS_roles) { RoleDataWrapper tdw = new RoleDataWrapper(com.fr.design.i18n.Toolkit.i18nText("FS_Name")); FS_roles.put(com.fr.design.i18n.Toolkit.i18nText("FS_Name"), tdw); } /** * 生成子节点 * * @return */ @Override public ExpandMutableTreeNode[] load() { Map report_roles = null; // Map FS_roles = null; if (this != null) { report_roles = this.init().get(0); // FS_roles = this.init().get(1); } else { report_roles = Collections.emptyMap(); // FS_roles = Collections.emptyMap(); } List list = new ArrayList(); //所有的角色 List reportlist = new ArrayList(); //报表平台橘色 // List FSlist = new ArrayList(); //数据决策系统角色 list.add(initReportRolseNode(report_roles)); addNodeToList(report_roles, reportlist); // list.add(initFSRolseNode(FS_roles)); // addNodeToList(FS_roles, FSlist); return list.toArray(new ExpandMutableTreeNode[list.size()]); } protected ExpandMutableTreeNode initReportRolseNode(Map report_roles) { ExpandMutableTreeNode templateNode = new ExpandMutableTreeNode(new NameObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Roles_Already_Authority_Edited"), 0), true); templateNode.addChildTreeNodes(getNodeArrayFromMap(report_roles)); return templateNode; } protected ExpandMutableTreeNode[] getNodeArrayFromMap(Map map) { List roleList = new ArrayList(); Iterator> entryIt = map.entrySet().iterator(); while (entryIt.hasNext()) { Map.Entry entry = entryIt.next(); String name = entry.getKey(); RoleDataWrapper t = entry.getValue(); JTemplate jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); PrivilegeEditedRoleProvider pe = (PrivilegeEditedRoleProvider) jt.getTarget(); ExpandMutableTreeNode[] expand = t.load(Arrays.asList(pe.getAllEditedRoleSet())); for (ExpandMutableTreeNode expandMutableTreeNode : expand) { roleList.add(expandMutableTreeNode); } } return roleList.toArray(new ExpandMutableTreeNode[roleList.size()]); } } \ No newline at end of file +package com.fr.design.roleAuthority; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Map; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.mainframe.JTemplate; import com.fr.general.NameObject; import com.fr.privilege.PrivilegeEditedRoleProvider; /** * Author : daisy * Date: 13-9-25 * Time: 下午4:57 */ public class RolesEditedSourceOP extends RoleSourceOP { /** * 获取报表平台的角色 */ protected void addReportRoles(Map report_roles) { RoleDataWrapper tdw = new RoleDataWrapper(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Server_Platform_Manager")); report_roles.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Server_Platform_Manager"), tdw); } /** * 获取数据决策系统的角色 */ protected void addFSRoles(Map FS_roles) { RoleDataWrapper tdw = new RoleDataWrapper(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FS_Name_Duplicate")); FS_roles.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FS_Name_Duplicate"), tdw); } /** * 生成子节点 * * @return */ @Override public ExpandMutableTreeNode[] load() { Map report_roles = null; // Map FS_roles = null; if (this != null) { report_roles = this.init().get(0); // FS_roles = this.init().get(1); } else { report_roles = Collections.emptyMap(); // FS_roles = Collections.emptyMap(); } List list = new ArrayList(); //所有的角色 List reportlist = new ArrayList(); //报表平台橘色 // List FSlist = new ArrayList(); //数据决策系统角色 list.add(initReportRolseNode(report_roles)); addNodeToList(report_roles, reportlist); // list.add(initFSRolseNode(FS_roles)); // addNodeToList(FS_roles, FSlist); return list.toArray(new ExpandMutableTreeNode[list.size()]); } protected ExpandMutableTreeNode initReportRolseNode(Map report_roles) { ExpandMutableTreeNode templateNode = new ExpandMutableTreeNode(new NameObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Roles_Already_Authority_Edited"), 0), true); templateNode.addChildTreeNodes(getNodeArrayFromMap(report_roles)); return templateNode; } protected ExpandMutableTreeNode[] getNodeArrayFromMap(Map map) { List roleList = new ArrayList(); Iterator> entryIt = map.entrySet().iterator(); while (entryIt.hasNext()) { Map.Entry entry = entryIt.next(); String name = entry.getKey(); RoleDataWrapper t = entry.getValue(); JTemplate jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); PrivilegeEditedRoleProvider pe = (PrivilegeEditedRoleProvider) jt.getTarget(); ExpandMutableTreeNode[] expand = t.load(Arrays.asList(pe.getAllEditedRoleSet())); for (ExpandMutableTreeNode expandMutableTreeNode : expand) { roleList.add(expandMutableTreeNode); } } return roleList.toArray(new ExpandMutableTreeNode[roleList.size()]); } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/style/BorderPane.java b/designer-base/src/main/java/com/fr/design/style/BorderPane.java index 4ec840e63e..f0a182ab6d 100644 --- a/designer-base/src/main/java/com/fr/design/style/BorderPane.java +++ b/designer-base/src/main/java/com/fr/design/style/BorderPane.java @@ -3,42 +3,40 @@ */ package com.fr.design.style; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; - -import javax.swing.BorderFactory; -import javax.swing.Icon; -import javax.swing.JComponent; -import com.fr.design.gui.ilable.UILabel; -import javax.swing.JPanel; -import javax.swing.JToggleButton; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.swing.event.EventListenerList; - import com.fr.base.BaseUtils; import com.fr.base.CellBorderStyle; import com.fr.base.FRContext; import com.fr.base.GraphHelper; import com.fr.base.Style; +import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.LineComboBox; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.VerticalFlowLayout; -import com.fr.design.dialog.BasicPane; - -import com.fr.stable.Constants; -import com.fr.stable.CoreConstants; import com.fr.design.style.color.ColorSelectBox; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.stable.Constants; +import com.fr.stable.CoreConstants; + +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JComponent; +import javax.swing.JPanel; +import javax.swing.JToggleButton; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.swing.event.EventListenerList; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; /** * CellBorder Pane. @@ -103,7 +101,7 @@ public class BorderPane extends BasicPane { borderAllControlPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 4, 0)); borderAllControlPane.add(new UILabel(" ")); // Button reseting borders - borderAllControlPane.add(createVerButtonPane(NO_BORDERS, com.fr.design.i18n.Toolkit.i18nText("No"))); + borderAllControlPane.add(createVerButtonPane(NO_BORDERS, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No"))); // Button setting all borders to active with // current color and current style excepting inside borders borderAllControlPane.add(createVerButtonPane(EXTERNAL_BORDERS, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_External"))); @@ -148,7 +146,7 @@ public class BorderPane extends BasicPane { JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - northPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Line"), null)); + northPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Line"), null)); JPanel rightTopPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); northPane.add(rightTopPane, BorderLayout.NORTH); JPanel first = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); diff --git a/designer-base/src/main/java/com/fr/design/style/FRFontPane.java b/designer-base/src/main/java/com/fr/design/style/FRFontPane.java index 806c2f937c..767abf9d95 100644 --- a/designer-base/src/main/java/com/fr/design/style/FRFontPane.java +++ b/designer-base/src/main/java/com/fr/design/style/FRFontPane.java @@ -3,19 +3,22 @@ */ package com.fr.design.style; -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; +import com.fr.base.FRContext; +import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.icombobox.LineComboBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.style.color.ColorSelectBox; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.DefaultValues; +import com.fr.general.FRFont; +import com.fr.stable.CoreConstants; import javax.swing.BorderFactory; import javax.swing.Box; import javax.swing.JComponent; -import com.fr.design.gui.ilable.UILabel; import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JScrollPane; @@ -26,19 +29,14 @@ import javax.swing.event.DocumentListener; import javax.swing.event.EventListenerList; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; - -import com.fr.base.FRContext; -import com.fr.design.gui.icheckbox.UICheckBox; -import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.gui.icombobox.LineComboBox; -import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.dialog.BasicPane; -import com.fr.general.DefaultValues; -import com.fr.general.FRFont; - -import com.fr.stable.CoreConstants; -import com.fr.design.style.color.ColorSelectBox; -import com.fr.design.utils.gui.GUICoreUtils; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; /** * Pane to edit Font. @@ -122,7 +120,7 @@ public class FRFontPane extends BasicPane { // underline pane JPanel underlinePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); listVBottomPane.add(underlinePane); - underlinePane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("FRFont-Underline"), null)); + underlinePane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FRFont_Underline"), null)); this.underlineCombo = new LineComboBox(CoreConstants.UNDERLINE_STYLE_ARRAY); this.underlineCombo.addActionListener(actionListener); diff --git a/designer-base/src/main/java/com/fr/design/style/FontFamilyPane.java b/designer-base/src/main/java/com/fr/design/style/FontFamilyPane.java index bbec9e2fb3..37076c66fb 100644 --- a/designer-base/src/main/java/com/fr/design/style/FontFamilyPane.java +++ b/designer-base/src/main/java/com/fr/design/style/FontFamilyPane.java @@ -1,18 +1,16 @@ package com.fr.design.style; -import java.awt.BorderLayout; - -import javax.swing.JList; -import javax.swing.JPanel; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; - import com.fr.base.Utils; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; -import com.fr.design.utils.gui.GUICoreUtils; +import javax.swing.JList; +import javax.swing.JPanel; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import java.awt.BorderLayout; public class FontFamilyPane extends JPanel { private UITextField familyField; @@ -37,7 +35,7 @@ public class FontFamilyPane extends JPanel { // familyPane.setLayout(FRGUIPaneFactory.createBorderLayout()); familyPane.add(FRFontPane.createTextFieldListPane("", familyField, familyList), BorderLayout.CENTER); - familyPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("FRFont-Family"),null)); + familyPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FRFont_Family"),null)); this.add(familyPane); } diff --git a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundSelectPane.java b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundSelectPane.java index 53c6fa962c..155e15604a 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundSelectPane.java +++ b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundSelectPane.java @@ -22,8 +22,8 @@ import java.awt.Dimension; public class GradientBackgroundSelectPane extends BackgroundPane4BoxChange { private static final long serialVersionUID = -2762854865690293473L; - private static final String LEFT_2_RIGHT = com.fr.design.i18n.Toolkit.i18nText("PageSetup-Landscape"); - private static final String TOP_2_BOTTOM = com.fr.design.i18n.Toolkit.i18nText("PageSetup-Portrait"); + private static final String LEFT_2_RIGHT = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Landscape"); + private static final String TOP_2_BOTTOM = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Portrait"); private static final String[] COLOR_DIRECTIONS = { LEFT_2_RIGHT, TOP_2_BOTTOM diff --git a/designer-base/src/main/java/com/fr/design/style/background/pattern/PatternUIComboBoxPane.java b/designer-base/src/main/java/com/fr/design/style/background/pattern/PatternUIComboBoxPane.java index 3fe70120f5..132ccf9832 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/pattern/PatternUIComboBoxPane.java +++ b/designer-base/src/main/java/com/fr/design/style/background/pattern/PatternUIComboBoxPane.java @@ -1,16 +1,14 @@ package com.fr.design.style.background.pattern; -import java.awt.BorderLayout; - -import com.fr.design.gui.ilable.UILabel; -import javax.swing.JPanel; - import com.fr.base.background.PatternBackground; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.general.Background; - import com.fr.design.style.background.BackgroundPane4BoxChange; import com.fr.design.style.color.ColorSelectBox; +import com.fr.general.Background; + +import javax.swing.JPanel; +import java.awt.BorderLayout; /** * @author kunsnat E-mail:kunsnat@gmail.com diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java index 4abacdd4b5..b717ea67e7 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java @@ -1,5 +1,11 @@ package com.fr.design.style.color; +import com.fr.base.chart.BaseChartCollection; +import com.fr.design.gui.chart.MiddleChartDialog; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.utils.gui.GUICoreUtils; + +import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dialog; @@ -9,13 +15,6 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.Serializable; -import javax.swing.JPanel; - -import com.fr.base.chart.BaseChartCollection; -import com.fr.design.gui.chart.MiddleChartDialog; -import com.fr.design.gui.ibutton.UIButton; -import com.fr.design.utils.gui.GUICoreUtils; - /** * 颜色选择器更多颜色对话框 @@ -98,7 +97,7 @@ public class ColorSelectDialog extends MiddleChartDialog{ buttonPane.add(ok); buttonPane.add(cancel); - ok.setActionCommand("Fine-Design_Report_OK"); + ok.setActionCommand("OK"); ok.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { seletePane.setColor(okListener.getColor()); diff --git a/designer-base/src/main/java/com/fr/design/web/CustomIconPane.java b/designer-base/src/main/java/com/fr/design/web/CustomIconPane.java index 7bfb135c12..90d5874ecb 100644 --- a/designer-base/src/main/java/com/fr/design/web/CustomIconPane.java +++ b/designer-base/src/main/java/com/fr/design/web/CustomIconPane.java @@ -143,7 +143,7 @@ public class CustomIconPane extends BasicPane { }else { // add failed - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_Message2"), com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Tooltips"), JOptionPane.WARNING_MESSAGE); + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_Message2"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.WARNING_MESSAGE); } } }).setVisible(true); @@ -174,7 +174,7 @@ public class CustomIconPane extends BasicPane { // remove failed JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_Message2"), - com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Tooltips"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.WARNING_MESSAGE); } } @@ -221,7 +221,7 @@ public class CustomIconPane extends BasicPane { // 失败了再弄回去 iconManager.addIcon(oldIcon, true); // edit failed - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_Message2"), com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Tooltips"), JOptionPane.WARNING_MESSAGE); + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_Message2"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.WARNING_MESSAGE); } } }).setVisible(true); @@ -410,7 +410,7 @@ public class CustomIconPane extends BasicPane { if (WidgetInfoConfig.getInstance().getIconManager().contains(nameTextField.getText())) { JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_Message3"), - com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Tooltips"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.WARNING_MESSAGE); } } diff --git a/designer-base/src/main/java/com/fr/env/LocalEnvPane.java b/designer-base/src/main/java/com/fr/env/LocalEnvPane.java index 3aac639974..eaabd0a9a4 100644 --- a/designer-base/src/main/java/com/fr/env/LocalEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/LocalEnvPane.java @@ -33,7 +33,7 @@ public class LocalEnvPane extends BasicBeanPane { JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); this.add(northPane, BorderLayout.NORTH); - northPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Location") + ":"), BorderLayout.WEST); + northPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Location") + ":"), BorderLayout.WEST); northPane.add(pathTextField = new UITextField(), BorderLayout.CENTER); // 删除选择文件按钮 添加JFileTree @@ -66,7 +66,7 @@ public class LocalEnvPane extends BasicBeanPane { @Override protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Location"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Location"); } @Override diff --git a/designer-base/src/main/java/com/fr/start/server/ServerManageFrame.java b/designer-base/src/main/java/com/fr/start/server/ServerManageFrame.java index c31f72f31c..3b15071790 100644 --- a/designer-base/src/main/java/com/fr/start/server/ServerManageFrame.java +++ b/designer-base/src/main/java/com/fr/start/server/ServerManageFrame.java @@ -104,7 +104,7 @@ public class ServerManageFrame extends JFrame { contentPane.add(infoPane, BorderLayout.SOUTH); infoPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 4, 0)); - infoPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Log") + ":"), BorderLayout.WEST); + infoPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Log") + ":"), BorderLayout.WEST); UITextField logPathTextField = new UITextField(); infoPane.add(logPathTextField, BorderLayout.CENTER); logPathTextField.setEditable(false); @@ -112,7 +112,7 @@ public class ServerManageFrame extends JFrame { UIButton openButton = new UIButton(); infoPane.add(openButton, BorderLayout.EAST); openButton.setIcon(BaseUtils.readIcon("/com/fr/design/images/server/view.png")); - openButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Open")); + openButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Open")); // openButton.addActionListener(new ActionListener() { // public void actionPerformed(ActionEvent evt) { // diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/other/TimeSwitchPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/other/TimeSwitchPane.java index 7277791efa..ed2a54fbef 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/other/TimeSwitchPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/other/TimeSwitchPane.java @@ -41,7 +41,7 @@ public class TimeSwitchPane extends JPanel implements UIObserver { private static final int TICK_WIDTH = 84; private static final int TICK_HEIGHT = 20; private static final int COM_GAP =5; - private static final String YEAR = com.fr.design.i18n.Toolkit.i18nText("Year"); + private static final String YEAR = com.fr.design.i18n.Toolkit.i18nText("Fine_Design_Chart_Year"); private static final String MONTH =com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Month"); private static final String DAY =com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sun"); private static final String HOUR = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_ScheHour"); @@ -49,7 +49,7 @@ public class TimeSwitchPane extends JPanel implements UIObserver { private static final String SECOND = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sche_Second"); private static String[] TYPES = new String[]{ - com.fr.design.i18n.Toolkit.i18nText("Year"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Month"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sun"), + com.fr.design.i18n.Toolkit.i18nText("Fine_Design_Chart_Year"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Month"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sun"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_ScheHour"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sche_Minute"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sche_Second") }; @@ -66,7 +66,7 @@ public class TimeSwitchPane extends JPanel implements UIObserver { private static Map INTS = new HashMap(); static { - INTS.put(ChartConstants.YEAR_TYPE, com.fr.design.i18n.Toolkit.i18nText("Year")); + INTS.put(ChartConstants.YEAR_TYPE, com.fr.design.i18n.Toolkit.i18nText("Fine_Design_Chart_Year")); INTS.put(ChartConstants.MONTH_TYPE, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Month")); INTS.put(ChartConstants.DAY_TYPE, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sun")); INTS.put(ChartConstants.HOUR_TYPE, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_ScheHour")); diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/DateAxisValuePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/DateAxisValuePane.java index 59548d18e4..22b350d7ae 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/DateAxisValuePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/DateAxisValuePane.java @@ -48,14 +48,14 @@ import java.util.regex.Pattern; public class DateAxisValuePane extends FurtherBasicBeanPane{ private static String[] TYPES = new String[]{ - com.fr.design.i18n.Toolkit.i18nText("Year"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Month"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sun"), + com.fr.design.i18n.Toolkit.i18nText("Fine_Design_Chart_Year"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Month"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sun"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_ScheHour"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sche_Minute"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sche_Second") }; private static Map VALUES = new HashMap(); static { - VALUES.put(com.fr.design.i18n.Toolkit.i18nText("Year"), ChartConstants.YEAR_TYPE); + VALUES.put(com.fr.design.i18n.Toolkit.i18nText("Fine_Design_Chart_Year"), ChartConstants.YEAR_TYPE); VALUES.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Month"), ChartConstants.MONTH_TYPE); VALUES.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sun"), ChartConstants.DAY_TYPE); VALUES.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_ScheHour"), ChartConstants.HOUR_TYPE); @@ -65,7 +65,7 @@ public class DateAxisValuePane extends FurtherBasicBeanPane{ private static Map INTS = new HashMap(); static { - INTS.put(ChartConstants.YEAR_TYPE, com.fr.design.i18n.Toolkit.i18nText("Year")); + INTS.put(ChartConstants.YEAR_TYPE, com.fr.design.i18n.Toolkit.i18nText("Fine_Design_Chart_Year")); INTS.put(ChartConstants.MONTH_TYPE, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Month")); INTS.put(ChartConstants.DAY_TYPE, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sun")); INTS.put(ChartConstants.HOUR_TYPE, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_ScheHour")); diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/actions/CopyAction.java b/designer-form/src/main/java/com/fr/design/designer/beans/actions/CopyAction.java index 1becf8be35..969f474838 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/actions/CopyAction.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/actions/CopyAction.java @@ -6,7 +6,6 @@ import com.fr.design.mainframe.FormDesigner; 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; @@ -15,7 +14,7 @@ public class CopyAction extends FormWidgetEditAction { public CopyAction(FormDesigner t) { super(t); - this.setName(com.fr.design.i18n.Toolkit.i18nText("M_Edit-Copy")); + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Copy")); this.setMnemonic('C'); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/copy.png")); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER)); diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/actions/CutAction.java b/designer-form/src/main/java/com/fr/design/designer/beans/actions/CutAction.java index 3951cd9fc5..3b70b0d2a3 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/actions/CutAction.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/actions/CutAction.java @@ -1,6 +1,5 @@ package com.fr.design.designer.beans.actions; -import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import javax.swing.KeyStroke; @@ -16,7 +15,7 @@ public class CutAction extends FormWidgetEditAction { public CutAction(FormDesigner t) { super(t); - this.setName(com.fr.design.i18n.Toolkit.i18nText("M_Edit-Cut")); + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Cut")); this.setMnemonic('T'); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/cut.png")); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER)); diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/actions/PasteAction.java b/designer-form/src/main/java/com/fr/design/designer/beans/actions/PasteAction.java index 46b2a92fb7..5bffe9c660 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/actions/PasteAction.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/actions/PasteAction.java @@ -1,6 +1,5 @@ package com.fr.design.designer.beans.actions; -import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import javax.swing.KeyStroke; @@ -15,7 +14,7 @@ public class PasteAction extends FormWidgetEditAction { public PasteAction(FormDesigner t) { super(t); - this.setName(com.fr.design.i18n.Toolkit.i18nText("M_Edit-Paste")); + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Edit_Paste")); this.setMnemonic('P'); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/paste.png")); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER)); diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java index 2d3f3dac46..e3d74766dd 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java @@ -1,32 +1,41 @@ package com.fr.design.designer.creator; -import java.awt.*; -import java.awt.event.MouseEvent; -import java.beans.IntrospectionException; - -import javax.swing.*; - import com.fr.base.GraphHelper; import com.fr.base.chart.BaseChartCollection; import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.ComponentAdapter; +import com.fr.design.designer.beans.events.DesignerEditor; import com.fr.design.designer.beans.models.SelectionModel; import com.fr.design.designer.properties.mobile.ChartEditorPropertyUI; +import com.fr.design.form.util.XCreatorConstants; import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.gui.chart.BaseChartPropertyPane; import com.fr.design.gui.chart.MiddleChartComponent; import com.fr.design.i18n.Toolkit; -import com.fr.design.mainframe.*; +import com.fr.design.mainframe.BaseJForm; +import com.fr.design.mainframe.CoverReportPane; +import com.fr.design.mainframe.EditingMouseListener; +import com.fr.design.mainframe.FormDesigner; +import com.fr.design.mainframe.HelpDialogManager; import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor; import com.fr.design.module.DesignModuleFactory; -import com.fr.design.designer.beans.events.DesignerEditor; import com.fr.form.ui.BaseChartEditor; import com.fr.form.ui.Widget; -import com.fr.design.form.util.XCreatorConstants; - import com.fr.stable.Constants; import com.fr.stable.core.PropertyChangeAdapter; +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Rectangle; +import java.awt.event.MouseEvent; +import java.beans.IntrospectionException; + /** * form中的图表按钮弹出的控件, 创建初始化图表内容. * diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCustomWriteAbleRepeatEditor.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCustomWriteAbleRepeatEditor.java index 52f9d0092e..ba3ebca140 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCustomWriteAbleRepeatEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCustomWriteAbleRepeatEditor.java @@ -1 +1 @@ -package com.fr.design.designer.creator; import com.fr.design.form.util.XCreatorConstants; import com.fr.form.ui.WriteAbleRepeatEditor; import com.fr.stable.ArrayUtils; import java.awt.*; import java.beans.IntrospectionException; /** * Author : Shockway * Date: 13-9-22 * Time: 上午10:40 */ public abstract class XCustomWriteAbleRepeatEditor extends XWriteAbleRepeatEditor { public XCustomWriteAbleRepeatEditor(WriteAbleRepeatEditor widget, Dimension initSize) { super(widget, initSize); } public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(), new CRPropertyDescriptor[] { new CRPropertyDescriptor("customData", this.data.getClass()).setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Custom_Data")) .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate")}); } } \ No newline at end of file +package com.fr.design.designer.creator; import com.fr.design.form.util.XCreatorConstants; import com.fr.form.ui.WriteAbleRepeatEditor; import com.fr.stable.ArrayUtils; import java.awt.*; import java.beans.IntrospectionException; /** * Author : Shockway * Date: 13-9-22 * Time: 上午10:40 */ public abstract class XCustomWriteAbleRepeatEditor extends XWriteAbleRepeatEditor { public XCustomWriteAbleRepeatEditor(WriteAbleRepeatEditor widget, Dimension initSize) { super(widget, initSize); } public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(), new CRPropertyDescriptor[] { new CRPropertyDescriptor("customData", this.data.getClass()).setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Custom_Data")) .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "Fine-Design_Basic_Validate")}); } } \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XDirectWriteEditor.java b/designer-form/src/main/java/com/fr/design/designer/creator/XDirectWriteEditor.java index 25a04c0bb7..5df9d81d03 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XDirectWriteEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XDirectWriteEditor.java @@ -26,6 +26,6 @@ public abstract class XDirectWriteEditor extends XFieldEditor { return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(), new CRPropertyDescriptor[] { new CRPropertyDescriptor("directEdit", this.data.getClass()) .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Edit")).putKeyValue( - XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate") }); + XCreatorConstants.PROPERTY_VALIDATE, "Fine-Design_Basic_Validate") }); } } \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XFieldEditor.java b/designer-form/src/main/java/com/fr/design/designer/creator/XFieldEditor.java index 8ef52455a8..606bee9932 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XFieldEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XFieldEditor.java @@ -39,10 +39,10 @@ public abstract class XFieldEditor extends XWidgetCreator { private CRPropertyDescriptor[] getCRPropertyDescriptor() throws IntrospectionException { CRPropertyDescriptor allowBlank = new CRPropertyDescriptor("allowBlank", this.data.getClass()).setI18NName( com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Blank")).setEditorClass(InChangeBooleanEditor.class).putKeyValue( - XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"); + XCreatorConstants.PROPERTY_VALIDATE, "Fine-Design_Basic_Validate"); CRPropertyDescriptor blankErrorMsg = new CRPropertyDescriptor("errorMessage", this.data.getClass()).setI18NName( com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Verify_Message")) - .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"); + .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "Fine-Design_Basic_Validate"); CRPropertyDescriptor fontSize = new CRPropertyDescriptor("fontSize", this.data.getClass(), "getFontSize", "setFontSize") .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Report_Advanced"); diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XIframeEditor.java b/designer-form/src/main/java/com/fr/design/designer/creator/XIframeEditor.java index 472eda7160..42747042ed 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XIframeEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XIframeEditor.java @@ -48,7 +48,7 @@ public class XIframeEditor extends XWidgetCreator { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Preference_Vertical_Scroll_Bar_Visible")).putKeyValue( XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), new CRPropertyDescriptor("parameters", this.data.getClass()) - .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Parameters")).setEditorClass(ParameterEditor.class) + .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameters")).setEditorClass(ParameterEditor.class) .setRendererClass(ParameterRenderer.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") }); } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XNumberEditor.java b/designer-form/src/main/java/com/fr/design/designer/creator/XNumberEditor.java index adb16c44bc..9671d3b868 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XNumberEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XNumberEditor.java @@ -49,10 +49,10 @@ public class XNumberEditor extends XWrapperedFieldEditor { CRPropertyDescriptor allowDecimal = new CRPropertyDescriptor("allowDecimals", this.data.getClass()) .setEditorClass(InChangeBooleanEditor.class) .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Decimals")) - .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"); + .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "Fine-Design_Basic_Validate"); CRPropertyDescriptor decimalLength = new CRPropertyDescriptor("maxDecimalLength", this.data.getClass()) .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Decimal_Digits")) - .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"); + .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "Fine-Design_Basic_Validate"); sup = (CRPropertyDescriptor[]) ArrayUtils.addAll(sup, ((NumberEditor)this.data).isAllowDecimals() ? new CRPropertyDescriptor[] {allowDecimal, decimalLength} : new CRPropertyDescriptor[] {allowDecimal}); return (CRPropertyDescriptor[]) ArrayUtils.addAll(sup, @@ -60,21 +60,21 @@ public class XNumberEditor extends XWrapperedFieldEditor { new CRPropertyDescriptor("allowNegative", this.data.getClass()) .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Negative")) .setEditorClass(InChangeBooleanEditor.class) - .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"), + .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "Fine-Design_Basic_Validate"), new CRPropertyDescriptor("minValue", this.data.getClass()) .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Min_Value")) .setEditorClass(SpinnerMinNumberEditor.class) - .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"), + .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "Fine-Design_Basic_Validate"), new CRPropertyDescriptor("maxValue", this.data.getClass()) .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Max_Value")) .setEditorClass(SpinnerMaxNumberEditor.class) - .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"), + .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "Fine-Design_Basic_Validate"), new CRPropertyDescriptor("waterMark", this.data.getClass()) .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), new CRPropertyDescriptor("regErrorMessage", this.data.getClass()) .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Verify_Message")) - .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate") + .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "Fine-Design_Basic_Validate") }); } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XPassword.java b/designer-form/src/main/java/com/fr/design/designer/creator/XPassword.java index 33a60cbb0e..4194e4be03 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XPassword.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XPassword.java @@ -53,12 +53,12 @@ public class XPassword extends XWrapperedFieldEditor { WidgetValueEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Report_Advanced")} , super.supportedDescriptor()); CRPropertyDescriptor regErrorMessage = new CRPropertyDescriptor("regErrorMessage", this.data.getClass()).setI18NName( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Verify_Message")).putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"); + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Verify_Message")).putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "Fine-Design_Basic_Validate"); CRPropertyDescriptor regex = new CRPropertyDescriptor("regex", this.data.getClass()) .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Input_Rule")) .setEditorClass(RegexEditor.RegexEditor4TextArea.class) .putKeyValue("renderer", RegexCellRencerer.class) - .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"); + .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "Fine-Design_Basic_Validate"); CRPropertyDescriptor waterMark = new CRPropertyDescriptor("waterMark", this.data.getClass()) .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Report_Advanced"); diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XTextArea.java b/designer-form/src/main/java/com/fr/design/designer/creator/XTextArea.java index 4eb0af9994..845fe43d9e 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XTextArea.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XTextArea.java @@ -41,9 +41,9 @@ public class XTextArea extends XFieldEditor { WidgetValueEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Report_Advanced")}, super.supportedDescriptor()); CRPropertyDescriptor regex = new CRPropertyDescriptor("regex", this.data.getClass()).setI18NName( com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Input_Rule")).setEditorClass(RegexEditor.RegexEditor4TextArea.class) - .putKeyValue("renderer", RegexCellRencerer.class).putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"); + .putKeyValue("renderer", RegexCellRencerer.class).putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "Fine-Design_Basic_Validate"); CRPropertyDescriptor regErrorMessage = new CRPropertyDescriptor("regErrorMessage", this.data.getClass()).setI18NName( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Verify_Message")).putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"); + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Verify_Message")).putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "Fine-Design_Basic_Validate"); CRPropertyDescriptor waterMark = new CRPropertyDescriptor("waterMark", this.data.getClass()).setI18NName( com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Report_Advanced"); diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XTextEditor.java b/designer-form/src/main/java/com/fr/design/designer/creator/XTextEditor.java index fb272d2102..0ba6e5fe4c 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XTextEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XTextEditor.java @@ -44,9 +44,9 @@ public class XTextEditor extends XWrapperedFieldEditor { WidgetValueEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Report_Advanced"); CRPropertyDescriptor regex = new CRPropertyDescriptor("regex", this.data.getClass()).setI18NName( com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Input_Rule")).setEditorClass(RegexEditor.class).putKeyValue( - "renderer", RegexCellRencerer.class).putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"); + "renderer", RegexCellRencerer.class).putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "Fine-Design_Basic_Validate"); CRPropertyDescriptor regErrorMessage = new CRPropertyDescriptor("regErrorMessage", this.data.getClass()).setI18NName( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Verify_Message")).putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"); + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Verify_Message")).putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "Fine-Design_Basic_Validate"); CRPropertyDescriptor waterMark = new CRPropertyDescriptor("waterMark", this.data.getClass()).setI18NName( com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Report_Advanced"); diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XTreeComboBoxEditor.java b/designer-form/src/main/java/com/fr/design/designer/creator/XTreeComboBoxEditor.java index a18706189b..d4083ecc9a 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XTreeComboBoxEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XTreeComboBoxEditor.java @@ -51,13 +51,13 @@ public class XTreeComboBoxEditor extends XTreeEditor { protected CRPropertyDescriptor[] addAllowEdit(CRPropertyDescriptor[] crp) throws IntrospectionException{ return (CRPropertyDescriptor[])ArrayUtils.add(crp, new CRPropertyDescriptor("directEdit", this.data.getClass()) .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Edit")).putKeyValue( - XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate")); + XCreatorConstants.PROPERTY_VALIDATE, "Fine-Design_Basic_Validate")); } protected CRPropertyDescriptor[] addCustomData(CRPropertyDescriptor[] crp) throws IntrospectionException{ return (CRPropertyDescriptor[])ArrayUtils.add(crp, new CRPropertyDescriptor("customData", this.data.getClass()) .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Custom_Data")).putKeyValue( - XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate")); + XCreatorConstants.PROPERTY_VALIDATE, "Fine-Design_Basic_Validate")); } @Override diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XTreeEditor.java b/designer-form/src/main/java/com/fr/design/designer/creator/XTreeEditor.java index 54a450fc2a..d17f5cca53 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XTreeEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XTreeEditor.java @@ -46,10 +46,10 @@ public class XTreeEditor extends XWidgetCreator { TreeModelRenderer.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), new CRPropertyDescriptor("allowBlank", this.data.getClass()).setI18NName( com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Blank")).setEditorClass(InChangeBooleanEditor.class) - .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"), + .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "Fine-Design_Basic_Validate"), new CRPropertyDescriptor("errorMessage", this.data.getClass()).setI18NName( com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Verify_Message")) - .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"), + .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "Fine-Design_Basic_Validate"), } : new CRPropertyDescriptor[]{ new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName( @@ -60,7 +60,7 @@ public class XTreeEditor extends XWidgetCreator { TreeModelRenderer.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), new CRPropertyDescriptor("allowBlank", this.data.getClass()).setI18NName( com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Blank")).setEditorClass(InChangeBooleanEditor.class).putKeyValue( - XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"),}; + XCreatorConstants.PROPERTY_VALIDATE, "Fine-Design_Basic_Validate"),}; crp = this.addWaterMark(crp); crp = (CRPropertyDescriptor[]) ArrayUtils.add(crp, diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java index d2d8daad8a..73c1949fb9 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java @@ -986,7 +986,7 @@ public class XWFitLayout extends XLayoutContainer { Rectangle bound = dealBound(rec, d, val, 0); if (bound.width < minWidth || bound.height< minHeight) { String widgetName = comp.toData().getWidgetName(); - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("FR-Engine_Invalid_Setting_Cause_Reach_Min_Widget_Size", widgetName)); + JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Engine_Invalid_Setting_Cause_Reach_Min_Widget_Size", widgetName)); return false; } } diff --git a/designer-form/src/main/java/com/fr/design/form/util/XCreatorConstants.java b/designer-form/src/main/java/com/fr/design/form/util/XCreatorConstants.java index c504ed7ff6..b19fff9363 100644 --- a/designer-form/src/main/java/com/fr/design/form/util/XCreatorConstants.java +++ b/designer-form/src/main/java/com/fr/design/form/util/XCreatorConstants.java @@ -3,11 +3,10 @@ */ package com.fr.design.form.util; -import java.awt.BasicStroke; -import java.awt.Color; - import javax.swing.BorderFactory; import javax.swing.border.Border; +import java.awt.BasicStroke; +import java.awt.Color; /** * @author richer @@ -21,7 +20,7 @@ public class XCreatorConstants { // 描述属性的分类 public static final String PROPERTY_CATEGORY = "category"; public static final String DEFAULT_GROUP_NAME = "Form-Basic_Properties"; - public static final String PROPERTY_VALIDATE = "FR-Designer_Validate"; + public static final String PROPERTY_VALIDATE = "Fine-Design_Basic_Validate"; public static final Color FORM_BG = new Color(255, 255, 255); // 拖拽标识块的大小 public static final int RESIZE_BOX_SIZ = 5; diff --git a/designer-form/src/main/java/com/fr/design/gui/xtable/ReportAppPropertyGroupModel.java b/designer-form/src/main/java/com/fr/design/gui/xtable/ReportAppPropertyGroupModel.java index 9022f05d17..2f2eafd01f 100644 --- a/designer-form/src/main/java/com/fr/design/gui/xtable/ReportAppPropertyGroupModel.java +++ b/designer-form/src/main/java/com/fr/design/gui/xtable/ReportAppPropertyGroupModel.java @@ -4,12 +4,11 @@ import com.fr.base.FRContext; import com.fr.design.designer.creator.CRPropertyDescriptor; import com.fr.design.designer.creator.XCreator; import com.fr.design.mainframe.FormDesigner; - -import java.lang.reflect.Method; import com.fr.general.ComparatorUtils; import com.fr.report.stable.FormConstants; -import javax.swing.*; +import javax.swing.JOptionPane; +import java.lang.reflect.Method; public class ReportAppPropertyGroupModel extends PropertyGroupModel { @@ -36,7 +35,7 @@ public class ReportAppPropertyGroupModel extends PropertyGroupModel { //弹窗提示 JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Mobile_Warning"), - com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Tooltips"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.PLAIN_MESSAGE); return false; } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index 86257317db..82ded472ed 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -69,7 +69,7 @@ import java.util.List; */ public class FormDesigner extends TargetComponent
implements TreeSelectionListener, InvocationHandler, BaseFormDesigner, ParaDefinitePane { protected static final ArrayList NAME_ARRAY_LIST = new ArrayList( - Arrays.asList(new String[]{com.fr.design.i18n.Toolkit.i18nText("M_Edit-Cut"), com.fr.design.i18n.Toolkit.i18nText("M_Edit-Copy"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Edit_Delete")}) + Arrays.asList(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Cut"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Copy"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Edit_Delete")}) ); //底层容器的默认大小 protected static final Dimension LARGE_PREFERRED_SIZE = new Dimension(WBorderLayout.DEFAULT_WIDTH, WBorderLayout.DEFAULT_HEIGHT); @@ -358,7 +358,7 @@ public class FormDesigner extends TargetComponent implements TreeSelection private void addParaPaneTooltips() { JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Please_Drag_ParaPane"), - com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Tooltips"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); } /** diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/ColorPalette.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/ColorPalette.java index 31aba0ea5e..7a1f7a8f5a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/ColorPalette.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/ColorPalette.java @@ -23,7 +23,7 @@ public class ColorPalette extends JPopupMenu { private Border BLACK_BORDER = BorderFactory.createLineBorder(new Color(127, 157, 185)); private Object[] colors = new Object[]{new Object[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Black"), new Color(0, 0, 0)}, new Object[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Crimson"), new Color(128, 0, 0)}, new Object[]{com.fr.design.i18n.Toolkit.i18nText("Red"), new Color(255, 0, 0)}, new Object[]{com.fr.design.i18n.Toolkit.i18nText("Pink"), new Color(255, 0, 255)}, new Object[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Rose_Red"), new Color(255, 153, 204)}, new Object[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Brown"), new Color(153, 51, 0)}, - new Object[]{com.fr.design.i18n.Toolkit.i18nText("Orange"), new Color(255, 102, 0)}, new Object[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Light_Orange"), new Color(255, 153, 0)}, new Object[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Golden"), new Color(255, 204, 0)}, + new Object[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Orange"), new Color(255, 102, 0)}, new Object[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Light_Orange"), new Color(255, 153, 0)}, new Object[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Golden"), new Color(255, 204, 0)}, new Object[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Brown_Orange"), new Color(255, 204, 153)}, new Object[]{"", new Color(51, 51, 0)}, new Object[]{"", new Color(128, 128, 0)}, new Object[]{"", new Color(153, 204, 0)}, new Object[]{"", new Color(255, 255, 0)}, new Object[]{"", new Color(255, 255, 153)}, new Object[]{"", new Color(0, 51, 0)}, new Object[]{"", new Color(0, 128, 0)}, new Object[]{"", new Color(51, 153, 102)}, new Object[]{"", new Color(172, 168, 153)}, new Object[]{"", new Color(204, 255, 204)}, new Object[]{"", new Color(0, 51, 102)}, diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/editors/AdjustModeEditor.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/editors/AdjustModeEditor.java index 58db814736..2cca7a0c5c 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/editors/AdjustModeEditor.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/editors/AdjustModeEditor.java @@ -18,7 +18,7 @@ import com.fr.design.gui.icombobox.DictionaryComboBox; */ public class AdjustModeEditor extends AbstractPropertyEditor { public static final String[] AjustRowTypes = new String[] { - com.fr.design.i18n.Toolkit.i18nText("No"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Row_Height"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Column_Width"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default")}; + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Row_Height"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Column_Width"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default")}; private UIComboBox combobox; diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/editors/DataTableConfigPane.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/editors/DataTableConfigPane.java index 6270ebd6d2..19f414f3c8 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/editors/DataTableConfigPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/editors/DataTableConfigPane.java @@ -184,7 +184,7 @@ public class DataTableConfigPane extends JComponent implements PropertyChangeLis * Constructor */ public CutAction() { - this.setName(com.fr.design.i18n.Toolkit.i18nText("M_Edit-Cut")); + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Cut")); this.setMnemonic('T'); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/cut.png")); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER)); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/wrappers/ParameterWrapper.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/wrappers/ParameterWrapper.java index f2f523dd4b..74f4476d2f 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/wrappers/ParameterWrapper.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/wrappers/ParameterWrapper.java @@ -14,7 +14,7 @@ public class ParameterWrapper implements Encoder, Decoder { if (v == null) { return StringUtils.EMPTY; } - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Total") + ((ParameterProvider[]) v).length + com.fr.design.i18n.Toolkit.i18nText("Parameters"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Total") + ((ParameterProvider[]) v).length + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameters"); } @Override diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java index 8b918ccf62..45c2cd9686 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java @@ -134,7 +134,7 @@ public abstract class FieldEditorDefinePane extends Abstr validatePane.add(contentPane, BorderLayout.CENTER); } - UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Validate"), 280, 20, validatePane); + UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Validate"), 280, 20, validatePane); this.add(uiExpandablePane, BorderLayout.CENTER); } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java index cfd0a61143..563553551d 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java @@ -46,7 +46,7 @@ public class IframeEditorDefinePane extends AbstractDataModify { { horizontalCheck, null }, { verticalCheck, null }, { new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Form_Url") + ":"), srcTextField = new UITextField() }, - { new UILabel(com.fr.design.i18n.Toolkit.i18nText("Parameter") + ":"), parameterViewPane = new ReportletParameterViewPane() } }; + { new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter") + ":"), parameterViewPane = new ReportletParameterViewPane() } }; int[][] rowCount = {{1, 1},{1, 1},{1, 1}, {1, 1}}; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 5); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/ParameterTreeComboBox.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/ParameterTreeComboBox.java index d3dc315e57..1fe824156f 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/ParameterTreeComboBox.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/ParameterTreeComboBox.java @@ -142,7 +142,7 @@ public class ParameterTreeComboBox extends FRTreeComboBox { // 报表参数 parameters = model.getReportParameters(); if (!ArrayUtils.isEmpty(parameters)) { - groupList.add(new ParameterGroup(com.fr.design.i18n.Toolkit.i18nText("ParameterD-Report_Parameter"), parameters)); + groupList.add(new ParameterGroup(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ParameterD_Report_Parameter"), parameters)); } // 数据源参数 parameters = model.getTableDataParameters(); @@ -154,7 +154,7 @@ public class ParameterTreeComboBox extends FRTreeComboBox { // 全局参数 parameters = ParameterConfig.getInstance().getGlobalParameters(); if (!ArrayUtils.isEmpty(parameters)) { - groupList.add(new ParameterGroup(com.fr.design.i18n.Toolkit.i18nText("M_Server-Global_Parameters"), parameters)); + groupList.add(new ParameterGroup(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Server_Global_Parameters"), parameters)); } // 全局数据源参数 parameters = new Parameter[0]; diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java index 0b92ce468d..9e833f0ae4 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java @@ -76,7 +76,7 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane{ // 弹窗提示 JOptionPane.showMessageDialog(null, warningText, - com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Tooltips"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.PLAIN_MESSAGE); } super.setValue(value); diff --git a/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontForegroundAction.java b/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontForegroundAction.java index adc5409ef5..1a50b3f53b 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontForegroundAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontForegroundAction.java @@ -3,20 +3,18 @@ */ package com.fr.design.actions.cell.style; -import java.awt.Color; - -import javax.swing.JComponent; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - import com.fr.base.BaseUtils; import com.fr.base.Style; import com.fr.base.core.StyleUtils; import com.fr.design.actions.core.ActionFactory; -import com.fr.general.ComparatorUtils; - import com.fr.design.mainframe.ElementCasePane; import com.fr.design.style.color.UIToolbarColorButton; +import com.fr.general.ComparatorUtils; + +import javax.swing.JComponent; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.Color; /** * Foreground. diff --git a/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontNameAction.java b/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontNameAction.java index 3d1aa2225d..1acf4a4042 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontNameAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontNameAction.java @@ -24,7 +24,7 @@ public class ReportFontNameAction extends AbstractStyleAction { public ReportFontNameAction(ElementCasePane t) { super(t); - this.setName(com.fr.design.i18n.Toolkit.i18nText("FRFont-Family")); + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FRFont_Family")); } @Override diff --git a/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontUnderlineAction.java b/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontUnderlineAction.java index 54dd60424c..d96d22b88f 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontUnderlineAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontUnderlineAction.java @@ -23,7 +23,7 @@ public class ReportFontUnderlineAction extends ReportFontBoldAction { public ReportFontUnderlineAction(ElementCasePane t) { super(t); - this.setName(com.fr.design.i18n.Toolkit.i18nText("FRFont-Underline")); + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FRFont_Underline")); this.setSmallIcon(ICONS, true); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/edit/order/SendFloatElementBackwardAction.java b/designer-realize/src/main/java/com/fr/design/actions/edit/order/SendFloatElementBackwardAction.java index da9a4b5c89..6f634eb8a0 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/edit/order/SendFloatElementBackwardAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/edit/order/SendFloatElementBackwardAction.java @@ -9,11 +9,6 @@ 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. */ @@ -24,7 +19,7 @@ public class SendFloatElementBackwardAction extends AbstractFloatElementOrderAct public SendFloatElementBackwardAction(ElementCasePane t) { super(t); - this.setName(com.fr.design.i18n.Toolkit.i18nText("M_Edit-Send_Backward")); + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Edit_Send_Backward")); 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-realize/src/main/java/com/fr/design/actions/utils/DeprecatedActionManager.java b/designer-realize/src/main/java/com/fr/design/actions/utils/DeprecatedActionManager.java index 1b7385c2e1..3d5e8696b2 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/utils/DeprecatedActionManager.java +++ b/designer-realize/src/main/java/com/fr/design/actions/utils/DeprecatedActionManager.java @@ -94,11 +94,11 @@ public class DeprecatedActionManager { final MenuDef presentMenu = new MenuDef(KeySetUtils.PRESENT.getMenuKeySetName()); presentMenu.setIconPath("com/fr/design/images/data/source/dataDictionary.png"); presentMenu.setMnemonic(KeySetUtils.PRESENT.getMnemonic()); - NewPresentAction dataDictAction = new NewPresentAction(ePane, com.fr.design.i18n.Toolkit.i18nText("M_Format-Data_Map"), DictPresent.class.getName()); + NewPresentAction dataDictAction = new NewPresentAction(ePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Format_Data_Map"), DictPresent.class.getName()); dataDictAction.setMnemonic('D'); NewPresentAction formulaAction = new NewPresentAction(ePane, com.fr.design.i18n.Toolkit.i18nText("Present-Formula_Present"), FormulaPresent.class.getName()); formulaAction.setMnemonic('F'); - NewPresentAction barcodeAction = new NewPresentAction(ePane, com.fr.design.i18n.Toolkit.i18nText("M_Insert-Barcode"), BarcodePresent.class.getName()); + NewPresentAction barcodeAction = new NewPresentAction(ePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Insert_Barcode"), BarcodePresent.class.getName()); barcodeAction.setMnemonic('B'); NewPresentAction currencyLineAction = new NewPresentAction(ePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Currency_Line"), CurrencyLinePresent.class.getName()); currencyLineAction.setMnemonic('L'); diff --git a/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java b/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java index 2f791dd3f5..1bc773994e 100644 --- a/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java +++ b/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java @@ -297,7 +297,7 @@ public class DSColumnAdvancedPane extends BasicPane { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Undefined"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Top_N"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Bottom_N"), - com.fr.design.i18n.Toolkit.i18nText("Odd"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Odd"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Even"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Specify"),}); selectCountComboBox.addActionListener(new ActionListener() { diff --git a/designer-realize/src/main/java/com/fr/design/headerfooter/HeaderFooterEditPane.java b/designer-realize/src/main/java/com/fr/design/headerfooter/HeaderFooterEditPane.java index 8068cdb972..ae1250a2f3 100644 --- a/designer-realize/src/main/java/com/fr/design/headerfooter/HeaderFooterEditPane.java +++ b/designer-realize/src/main/java/com/fr/design/headerfooter/HeaderFooterEditPane.java @@ -194,7 +194,7 @@ public class HeaderFooterEditPane extends JPanel { JPanel headerFooterPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); headFootUnitFieldPane = new AdjustHeightPane(); - headerFooterPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Height") + ":")); + headerFooterPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Height") + ":")); headerFooterPane.add(headFootUnitFieldPane); toolbar.add(headerFooterPane); @@ -633,9 +633,9 @@ public class HeaderFooterEditPane extends JPanel { if (unitType == Constants.UNIT_CM) { unitLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_CM")); } else if (unitType == Constants.UNIT_INCH) { - unitLabel.setText(com.fr.design.i18n.Toolkit.i18nText("PageSetup-inches")); + unitLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup-inches")); } else { - unitLabel.setText(com.fr.design.i18n.Toolkit.i18nText("PageSetup-mm")); + unitLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_mm")); } //ajust the heigt of unitLabel. diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/AuthorityToolBarPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/AuthorityToolBarPane.java index 9041a44e37..ce336b23fb 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/AuthorityToolBarPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/AuthorityToolBarPane.java @@ -1,6 +1,5 @@ package com.fr.design.mainframe; -import com.fr.base.FRContext; import com.fr.common.inputevent.InputEventBaseOnOS; import com.fr.design.beans.BasicBeanPane; import com.fr.design.file.HistoryTemplateListPane; @@ -16,7 +15,6 @@ import com.fr.form.ui.Button; import com.fr.form.ui.ToolBar; import com.fr.form.ui.Widget; import com.fr.general.ComparatorUtils; - import com.fr.main.TemplateWorkBook; import com.fr.report.web.Location; import com.fr.report.web.ToolBarManager; @@ -25,8 +23,11 @@ import com.fr.stable.ArrayUtils; import com.fr.web.attr.ReportWebAttr; import com.fr.workspace.WorkContext; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.awt.Dimension; +import java.awt.FlowLayout; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.awt.event.MouseAdapter; @@ -45,9 +46,9 @@ public class AuthorityToolBarPane extends BasicBeanPane { sortCheckBox.setSelected(true); conditionFilterBox.setSelected(true); listFilterBox.setSelected(true); - return GUICoreUtils.createFlowPane(new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("FR-Engine_ViewPreview") + ":"), + return GUICoreUtils.createFlowPane(new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_ViewPreview") + ":"), sortCheckBox, conditionFilterBox, listFilterBox}, FlowLayout.LEFT, 6); } diff --git a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/NativePrintSettingPane.java b/designer-realize/src/main/java/com/fr/design/webattr/printsettings/NativePrintSettingPane.java index 0ed7aaaccf..dbdf2ff6f6 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/NativePrintSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/printsettings/NativePrintSettingPane.java @@ -226,7 +226,7 @@ public class NativePrintSettingPane extends JPanel { 'x' + Utils.convertNumberStringToString(paperSize.getHeight().toMMValue4Scale2()) + ' ' + - com.fr.design.i18n.Toolkit.i18nText("PageSetup-mm") + + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_mm") + ']'; this.setText(sbuf); break; @@ -247,9 +247,9 @@ public class NativePrintSettingPane extends JPanel { private JPanel getLayoutSettingPane() { JPanel layoutSettingPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); layoutSettingPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); - portraitRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("PageSetup-Portrait")); + portraitRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Portrait")); portraitRadioButton.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20)); - landscapeRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("PageSetup-Landscape")); + landscapeRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Landscape")); layoutSettingPane.add(portraitRadioButton); layoutSettingPane.add(landscapeRadioButton); diff --git a/designer-realize/src/main/java/com/fr/design/widget/ui/FieldEditorDefinePane.java b/designer-realize/src/main/java/com/fr/design/widget/ui/FieldEditorDefinePane.java index c22ef6822d..9c20dfb652 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/ui/FieldEditorDefinePane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/ui/FieldEditorDefinePane.java @@ -127,7 +127,7 @@ public abstract class FieldEditorDefinePane extends Abstr } - UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Validate"), 280, 24, validatePane); + UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Validate"), 280, 24, validatePane); this.add(uiExpandablePane, BorderLayout.CENTER); } diff --git a/designer-realize/src/main/java/com/fr/design/widget/ui/ParameterTreeComboBox.java b/designer-realize/src/main/java/com/fr/design/widget/ui/ParameterTreeComboBox.java index b15d6899b1..e7db157a97 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/ui/ParameterTreeComboBox.java +++ b/designer-realize/src/main/java/com/fr/design/widget/ui/ParameterTreeComboBox.java @@ -144,7 +144,7 @@ public class ParameterTreeComboBox extends FRTreeComboBox { // 报表参数 parameters = model.getReportParameters(); if (!ArrayUtils.isEmpty(parameters)) { - groupList.add(new ParameterGroup(com.fr.design.i18n.Toolkit.i18nText("ParameterD-Report_Parameter"), parameters)); + groupList.add(new ParameterGroup(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ParameterD_Report_Parameter"), parameters)); } // 数据源参数 parameters = model.getTableDataParameters(); @@ -156,7 +156,7 @@ public class ParameterTreeComboBox extends FRTreeComboBox { // 全局参数 parameters = ParameterConfig.getInstance().getGlobalParameters(); if (!ArrayUtils.isEmpty(parameters)) { - groupList.add(new ParameterGroup(com.fr.design.i18n.Toolkit.i18nText("M_Server-Global_Parameters"), parameters)); + groupList.add(new ParameterGroup(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Server_Global_Parameters"), parameters)); } // 全局数据源参数 parameters = new Parameter[0]; diff --git a/designer-realize/src/main/java/com/fr/design/widget/ui/btn/DefaultButtonStylePane.java b/designer-realize/src/main/java/com/fr/design/widget/ui/btn/DefaultButtonStylePane.java index 50efada635..0d9d18d7d1 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/ui/btn/DefaultButtonStylePane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/ui/btn/DefaultButtonStylePane.java @@ -31,7 +31,7 @@ public class DefaultButtonStylePane extends BasicPane { labelPane.add(iconPane); Component[][] n_components = { { new UILabel(com.fr.design.i18n.Toolkit.i18nText("Text") + ":"), buttonNameTextField = new UITextField(20) }, - { new UILabel(com.fr.design.i18n.Toolkit.i18nText("Icon") + ":"), labelPane } }; + { new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Icon") + ":"), labelPane } }; JPanel panel = TableLayoutHelper.createTableLayoutPane(n_components, new double[]{-2, -2}, new double[]{-2, -2}); this.add(panel,BorderLayout.CENTER); diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java index 9bb72fa168..44870549dd 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java @@ -855,7 +855,7 @@ public class CellDSColumnEditor extends CellQuickEditor { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Undefined"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Top_N"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Bottom_N"), - com.fr.design.i18n.Toolkit.i18nText("Odd"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Odd"), com.fr.design.i18n.Toolkit.i18nText("Even"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Specify") }); diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index 715ad9958d..80edec701d 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -252,7 +252,7 @@ public class DesignerActivator extends Activator { private static NameableCreator[] hyperlinkTypes() { return new NameableCreator[]{ - new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("FR-Hyperlink_Reportlet"), ReportletHyperlink.class, ReportletHyperlinkPane.ChartNoRename.class), + new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Reportlet"), ReportletHyperlink.class, ReportletHyperlinkPane.ChartNoRename.class), new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Email"), EmailJavaScript.class, EmailPane.class), new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Web_Link"), WebHyperlink.class, WebHyperlinkPane.ChartNoRename.class), new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_JavaScript_Dynamic_Parameters"), ParameterJavaScript.class, ParameterJavaScriptPane.ChartNoRename.class), From 87af02ba02f9a86a1f44c8c86e47853049ec3c8b Mon Sep 17 00:00:00 2001 From: plough Date: Tue, 14 Aug 2018 14:37:28 +0800 Subject: [PATCH 04/14] =?UTF-8?q?REPORT-10045=20=E9=87=8D=E6=9E=84=20UILis?= =?UTF-8?q?tControlPane=20=E5=92=8C=20JListControlPane=20=3D>=20=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E4=BB=A3=E7=A0=81=EF=BC=8C=E4=BF=AE=E5=A4=8D=E4=B8=80?= =?UTF-8?q?=E4=B8=AAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/gui/controlpane/UIControlPane.java | 4 +- .../gui/controlpane/UIListControlPane.java | 92 ++++++++++--------- ...rtCutFactory.java => ShortCutFactory.java} | 8 +- .../com/fr/design/gui/ilist/UINameEdList.java | 46 +--------- .../fr/design/gui/ilist/JNameEdListTest.java | 68 -------------- .../fr/design/gui/ilist/UINameEdListTest.java | 82 ----------------- .../component/VanChartShortCutFactory.java | 4 +- 7 files changed, 58 insertions(+), 246 deletions(-) rename designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/{NewShortCutFactory.java => ShortCutFactory.java} (95%) delete mode 100644 designer-base/src/test/java/com/fr/design/gui/ilist/JNameEdListTest.java delete mode 100644 designer-base/src/test/java/com/fr/design/gui/ilist/UINameEdListTest.java diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java index 23583f2278..ff9e48e5db 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java @@ -2,7 +2,7 @@ package com.fr.design.gui.controlpane; import com.fr.base.chart.BasePlot; import com.fr.design.constants.UIConstants; -import com.fr.design.gui.controlpane.shortcutfactory.NewShortCutFactory; +import com.fr.design.gui.controlpane.shortcutfactory.ShortCutFactory; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itoolbar.UIToolBarUI; import com.fr.design.gui.itoolbar.UIToolbar; @@ -67,7 +67,7 @@ abstract class UIControlPane extends JControlPane { @Override protected void initShortCutFactory() { - this.shortCutFactory = NewShortCutFactory.newInstance(this); + this.shortCutFactory = ShortCutFactory.newInstance(this); } // 是否使用新样式 diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java index 6d8942bba8..de2a42fa80 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java @@ -96,7 +96,7 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon nameableList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); - nameableList.addMouseListener(listMouseListener); + nameableList.addMouseListener(getListMouseListener()); nameableList.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent evt) { // richie:避免多次update和populate大大降低效率 @@ -305,60 +305,62 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon /* * UINameEdList的鼠标事件 */ - private MouseListener listMouseListener = new MouseAdapter() { - @Override - public void mouseReleased(MouseEvent evt) { - nameableList.stopEditing(); - if (evt.getClickCount() >= 2 - && SwingUtilities.isLeftMouseButton(evt) && evt.getX() > EDIT_RANGE) { - editingIndex = nameableList.getSelectedIndex(); - selectedName = nameableList.getNameAt(editingIndex); - nameableList.editItemAt(nameableList.getSelectedIndex()); - } else if (SwingUtilities.isLeftMouseButton(evt) && evt.getX() <= EDIT_RANGE) { - editingIndex = nameableList.getSelectedIndex(); - selectedName = nameableList.getNameAt(editingIndex); - popupEditDialog(evt.getPoint()); - } + private MouseListener getListMouseListener() { + return new MouseAdapter() { + @Override + public void mouseReleased(MouseEvent evt) { + nameableList.stopEditing(); + if (evt.getClickCount() >= 2 + && SwingUtilities.isLeftMouseButton(evt) && evt.getX() > EDIT_RANGE) { + editingIndex = nameableList.getSelectedIndex(); + selectedName = nameableList.getNameAt(editingIndex); + nameableList.editItemAt(nameableList.getSelectedIndex()); + } else if (SwingUtilities.isLeftMouseButton(evt) && evt.getX() <= EDIT_RANGE) { + editingIndex = nameableList.getSelectedIndex(); + selectedName = nameableList.getNameAt(editingIndex); + popupEditDialog(evt.getPoint()); + } - // peter:处理右键的弹出菜单 - if (!SwingUtilities.isRightMouseButton(evt)) { - return; - } + // peter:处理右键的弹出菜单 + if (!SwingUtilities.isRightMouseButton(evt)) { + return; + } - // peter: 注意,在checkButtonEnabled()方法里面,设置了所有的Action的Enabled. - checkButtonEnabled(); + // peter: 注意,在checkButtonEnabled()方法里面,设置了所有的Action的Enabled. + checkButtonEnabled(); - // p:右键菜单. - JPopupMenu popupMenu = new JPopupMenu(); + // p:右键菜单. + JPopupMenu popupMenu = new JPopupMenu(); - for (ShortCut4JControlPane sj : getShorts()) { - sj.getShortCut().intoJPopupMenu(popupMenu); - } + for (ShortCut4JControlPane sj : getShorts()) { + sj.getShortCut().intoJPopupMenu(popupMenu); + } - // peter: 只有弹出菜单有子菜单的时候,才需要弹出来. - GUICoreUtils.showPopupMenu(popupMenu, nameableList, evt.getX() - 1, - evt.getY() - 1); - } + // peter: 只有弹出菜单有子菜单的时候,才需要弹出来. + GUICoreUtils.showPopupMenu(popupMenu, nameableList, evt.getX() - 1, + evt.getY() - 1); + } - @Override - public void mouseClicked(MouseEvent e) { - JList list = (JList) e.getSource(); - if (list.locationToIndex(e.getPoint()) == -1 && !e.isShiftDown() - && !isMenuShortcutKeyDown(e)) { - list.clearSelection(); + @Override + public void mouseClicked(MouseEvent e) { + JList list = (JList) e.getSource(); + if (list.locationToIndex(e.getPoint()) == -1 && !e.isShiftDown() + && !isMenuShortcutKeyDown(e)) { + list.clearSelection(); + } } - } - private boolean isMenuShortcutKeyDown(InputEvent event) { - return (event.getModifiers() & Toolkit.getDefaultToolkit() - .getMenuShortcutKeyMask()) != 0; - } + private boolean isMenuShortcutKeyDown(InputEvent event) { + return (event.getModifiers() & Toolkit.getDefaultToolkit() + .getMenuShortcutKeyMask()) != 0; + } - @Override - public void mouseMoved(MouseEvent e) { + @Override + public void mouseMoved(MouseEvent e) { - } - }; + } + }; + } /** * 检查按钮可用状态 Check button enabled. diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/NewShortCutFactory.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/ShortCutFactory.java similarity index 95% rename from designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/NewShortCutFactory.java rename to designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/ShortCutFactory.java index 5975dbc0c5..b561c28bac 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/NewShortCutFactory.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/ShortCutFactory.java @@ -23,14 +23,14 @@ import java.awt.event.ActionEvent; /** * Created by plough on 2018/8/13. */ -public class NewShortCutFactory extends AbstractShortCutFactory { +public class ShortCutFactory extends AbstractShortCutFactory { - protected NewShortCutFactory(ShortCutListenerProvider listenerProvider) { + protected ShortCutFactory(ShortCutListenerProvider listenerProvider) { super(listenerProvider); } - public static NewShortCutFactory newInstance(ShortCutListenerProvider listenerProvider) { - return new NewShortCutFactory(listenerProvider); + public static ShortCutFactory newInstance(ShortCutListenerProvider listenerProvider) { + return new ShortCutFactory(listenerProvider); } @Override diff --git a/designer-base/src/main/java/com/fr/design/gui/ilist/UINameEdList.java b/designer-base/src/main/java/com/fr/design/gui/ilist/UINameEdList.java index f014096930..131adbed7a 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ilist/UINameEdList.java +++ b/designer-base/src/main/java/com/fr/design/gui/ilist/UINameEdList.java @@ -1,54 +1,21 @@ package com.fr.design.gui.ilist; -import com.fr.base.Utils; -import com.fr.design.gui.itextfield.UITextField; - import com.fr.general.NameObject; import com.fr.stable.Nameable; -import com.fr.stable.StringUtils; -import com.fr.stable.core.PropertyChangeAdapter; -import javax.swing.*; -import javax.swing.event.CellEditorListener; -import javax.swing.event.ChangeEvent; -import java.awt.*; -import java.awt.event.*; -import java.util.ArrayList; -import java.util.Vector; +import javax.swing.ListModel; +import java.awt.Point; /** * Created by plough on 2017/7/23. */ public class UINameEdList extends JNameEdList { -// private static final int TEST_LIST_LENTH = 20; private static final int BUTTON_WIDTH = 25; -// private boolean editable = true; -// -// // kunsnat: 是否强制ListName是数字 (int型) -// private boolean isNameShouldNumber = false; -// -// transient protected ListCellEditor cellEditor; -// transient protected Component editorComp; -// transient protected int editingIndex; -// private PropertyChangeAdapter editingListner; -// private java.util.List ll = new ArrayList(); - public UINameEdList(ListModel dataModel) { + protected UINameEdList(ListModel dataModel) { super(dataModel); } - public UINameEdList(final Object[] listData) { - super(listData); - } - - public UINameEdList(final Vector listData) { - super(listData); - } - - public UINameEdList() { - super(); - } - public Object getType(int index) { Nameable nameable = ((ListModelElement) getModel().getElementAt(index)).wrapper; if (nameable != null && nameable instanceof NameObject) { @@ -71,11 +38,4 @@ public class UINameEdList extends JNameEdList { return index; } } - - /** - * 主函数 - * - * @param args 参数 - */ - } \ No newline at end of file diff --git a/designer-base/src/test/java/com/fr/design/gui/ilist/JNameEdListTest.java b/designer-base/src/test/java/com/fr/design/gui/ilist/JNameEdListTest.java deleted file mode 100644 index ba611a66b9..0000000000 --- a/designer-base/src/test/java/com/fr/design/gui/ilist/JNameEdListTest.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.fr.design.gui.ilist; - -import com.fr.design.gui.itextfield.UITextField; -import com.fr.general.NameObject; -import com.fr.stable.Nameable; - -import javax.swing.DefaultListCellRenderer; -import javax.swing.JFrame; -import javax.swing.JList; -import javax.swing.JPanel; -import javax.swing.SwingUtilities; -import javax.swing.WindowConstants; -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Toolkit; -import java.awt.event.InputEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; - -/** - * Created by plough on 2018/8/13. - */ -public class JNameEdListTest { - private static final int TEST_LIST_LENTH = 20; - - public static void main(String... args) { - JFrame f = new JFrame(); - JPanel c = (JPanel) f.getContentPane(); - c.setLayout(new BorderLayout()); - ListModelElement[] data = new ListModelElement[TEST_LIST_LENTH]; - for (int i = 0; i < TEST_LIST_LENTH; i++) { - data[i] = new ListModelElement(new NameObject(i + 1 + "", i)); - } - final JNameEdList list = new JNameEdList(data); - list.setEditable(true); - list.addMouseListener(new MouseAdapter() { - public void mouseReleased(MouseEvent evt) { - list.stopEditing(); - if (evt.getClickCount() >= 2 - && SwingUtilities.isLeftMouseButton(evt)) { - list.editItemAt(list.getSelectedIndex()); - } - } - }) - ; - - list.setCellEditor(new DefaultListCellEditor(new UITextField())); - list.setCellRenderer(new NameableListCellRenderer()); - c.add(list, BorderLayout.CENTER); - f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); - f.setSize(400, 600); - f.setVisible(true); - } - - private static class NameableListCellRenderer extends DefaultListCellRenderer { - @Override - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, - boolean cellHasFocus) { - super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - - if (value instanceof Nameable) { - Nameable wrappee = (Nameable) value; - this.setText(wrappee.getName()); - } - return this; - } - } -} diff --git a/designer-base/src/test/java/com/fr/design/gui/ilist/UINameEdListTest.java b/designer-base/src/test/java/com/fr/design/gui/ilist/UINameEdListTest.java deleted file mode 100644 index b2d0c8da42..0000000000 --- a/designer-base/src/test/java/com/fr/design/gui/ilist/UINameEdListTest.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.fr.design.gui.ilist; - -import com.fr.design.gui.itextfield.UITextField; -import com.fr.general.NameObject; -import com.fr.stable.Nameable; - -import javax.swing.DefaultListCellRenderer; -import javax.swing.JFrame; -import javax.swing.JList; -import javax.swing.JPanel; -import javax.swing.SwingUtilities; -import javax.swing.WindowConstants; -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Toolkit; -import java.awt.event.InputEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; - -/** - * Created by plough on 2018/8/13. - */ -public class UINameEdListTest { - private static final int TEST_LIST_LENTH = 20; - - public static void main(String... args) { - JFrame f = new JFrame(); - JPanel c = (JPanel) f.getContentPane(); - c.setLayout(new BorderLayout()); - ListModelElement[] data = new ListModelElement[TEST_LIST_LENTH]; - for (int i = 0; i < TEST_LIST_LENTH; i++) { - data[i] = new ListModelElement(new NameObject(i + 1 + "", i)); - } - final UINameEdList list = new UINameEdList(data); - list.setEditable(true); - list.addMouseListener(new MouseAdapter() { - public void mouseReleased(MouseEvent evt) { - list.stopEditing(); - if (evt.getClickCount() >= 2 - && SwingUtilities.isLeftMouseButton(evt)) { - list.editItemAt(list.getSelectedIndex()); - } - } - - @Override - public void mouseClicked(MouseEvent e) { - JList list = (JList) e.getSource(); - if (list.locationToIndex(e.getPoint()) == -1 && !e.isShiftDown() - && !isMenuShortcutKeyDown(e)) { - list.clearSelection(); - } - } - - private boolean isMenuShortcutKeyDown(InputEvent event) { - return (event.getModifiers() & Toolkit.getDefaultToolkit() - .getMenuShortcutKeyMask()) != 0; - } - }) - ; - - list.setCellEditor(new DefaultListCellEditor(new UITextField())); - list.setCellRenderer(new NameableListCellRenderer()); - c.add(list, BorderLayout.CENTER); - f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); - f.setSize(400, 600); - f.setVisible(true); - } - - private static class NameableListCellRenderer extends DefaultListCellRenderer { - @Override - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, - boolean cellHasFocus) { - super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - - if (value instanceof Nameable) { - Nameable wrappee = (Nameable) value; - this.setText(wrappee.getName()); - } - return this; - } - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartShortCutFactory.java b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartShortCutFactory.java index 753d98d483..9690654553 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartShortCutFactory.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartShortCutFactory.java @@ -2,14 +2,14 @@ package com.fr.van.chart.custom.component; import com.fr.design.gui.HyperlinkFilterHelper; import com.fr.design.gui.controlpane.NameableCreator; -import com.fr.design.gui.controlpane.shortcutfactory.NewShortCutFactory; +import com.fr.design.gui.controlpane.shortcutfactory.ShortCutFactory; import com.fr.design.gui.controlpane.ShortCutListenerProvider; import com.fr.design.menu.ShortCut; /** * Created by plough on 2018/8/13. */ -public class VanChartShortCutFactory extends NewShortCutFactory { +public class VanChartShortCutFactory extends ShortCutFactory { private VanChartShortCutFactory(ShortCutListenerProvider listenerProvider) { super(listenerProvider); } From 1e2ea5b62a096a2c51b2ea6e0a65f7c75c240a79 Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Tue, 14 Aug 2018 16:09:10 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E8=A7=84=E8=8C=83=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=E6=96=87=E4=BB=B6=E5=8F=8A=E5=9B=BD=E9=99=85=E5=8C=96?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/help/SystemInfoPane.java | 2 +- .../fr/design/condition/ConditionAttributesPane.java | 2 +- .../fr/design/data/datapane/connect/JDBCDefPane.java | 4 ++-- .../fr/design/data/datapane/preview/PreviewLabel.java | 2 +- .../tabledatapane/AutoStoreProcedureTableModel.java | 2 +- .../tabledatapane/EmbeddedTableDataDefinedPane.java | 2 +- .../tabledata/tabledatapane/MultiTDTableDataPane.java | 2 +- .../tabledatapane/StoreProcedureParameterPane.java | 4 ++-- .../main/java/com/fr/design/dialog/JWizardDialog.java | 2 +- .../java/com/fr/design/formula/TinyFormulaPane.java | 2 +- .../fr/design/gui/frpane/EditingStringListPane.java | 2 +- .../java/com/fr/design/gui/frpane/ImgChoosePane.java | 2 +- .../com/fr/design/gui/frpane/ImgChooseWrapper.java | 2 +- .../com/fr/design/gui/frpane/ObjectProperiesPane.java | 4 ++-- .../java/com/fr/design/gui/frpane/UITabbedPane.java | 2 +- .../java/com/fr/design/gui/imenutable/UIMenuTable.java | 2 +- .../com/fr/design/gui/imenutable/UIMenuTableUI.java | 2 +- .../main/java/com/fr/design/gui/itable/UITableUI.java | 2 +- .../gui/itableeditorpane/UITableModelAdapter.java | 2 +- .../fr/design/gui/itree/filetree/ReportletPane.java | 2 +- .../widget/accessibles/TemplateStylePane.java | 2 +- .../src/main/java/com/fr/design/menu/KeySetUtils.java | 8 ++++---- .../java/com/fr/design/present/FormulaPresentPane.java | 2 +- .../java/com/fr/design/present/NonePresentPane.java | 2 +- .../src/main/java/com/fr/design/style/BorderPane.java | 2 +- .../src/main/java/com/fr/design/style/FRFontPane.java | 2 +- .../design/style/background/image/ImageSelectPane.java | 2 +- .../fr/design/style/color/DetailColorSelectPane.java | 2 +- .../java/com/fr/design/utils/gui/GUICoreUtils.java | 2 +- .../src/main/java/com/fr/env/RemoteSignInPane.java | 2 +- .../com/fr/design/chart/javascript/ChartEmailPane.java | 2 +- .../mainframe/chart/gui/data/PresentComboBox.java | 4 ++-- .../designer/properties/VerticalSplitProperties.java | 2 +- .../properties/items/HorizontalAlignmentItems.java | 2 +- .../items/LabelHorizontalAlignmentItems.java | 2 +- .../mainframe/widget/accessibles/ColorPalette.java | 4 ++-- .../design/actions/utils/DeprecatedActionManager.java | 4 ++-- .../fr/design/headerfooter/HeaderFooterEditPane.java | 2 +- .../java/com/fr/design/headerfooter/ImagePane.java | 2 +- .../java/com/fr/design/mainframe/SheetNameTabPane.java | 10 +++++----- .../main/java/com/fr/design/present/BarCodePane.java | 6 +++--- .../java/com/fr/design/report/ExcelExportPane.java | 2 +- .../main/java/com/fr/design/report/PDFExportPane.java | 2 +- .../main/java/com/fr/design/report/PageSetupPane.java | 4 ++-- .../com/fr/design/report/ReportExportAttrPane.java | 2 +- .../java/com/fr/design/report/SelectImagePane.java | 2 +- .../main/java/com/fr/design/report/WordExportPane.java | 2 +- .../src/main/java/com/fr/design/style/StylePane.java | 2 +- .../fr/design/webattr/ReportWebWidgetConstants.java | 2 +- .../java/com/fr/design/webattr/ServerPrinterPane.java | 8 ++++---- .../webattr/printsettings/PageMarginSettingPane.java | 2 +- .../com/fr/grid/AbstractGridHeaderMouseHandler.java | 2 +- .../src/main/java/com/fr/poly/group/PolyNameGroup.java | 2 +- 53 files changed, 72 insertions(+), 72 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/help/SystemInfoPane.java b/designer-base/src/main/java/com/fr/design/actions/help/SystemInfoPane.java index f33a0473aa..5170a33a6b 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/SystemInfoPane.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/SystemInfoPane.java @@ -25,7 +25,7 @@ public class SystemInfoPane extends JPanel { return false; } }; - tableModel.addColumn(com.fr.design.i18n.Toolkit.i18nText("Property")); + tableModel.addColumn(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Property")); tableModel.addColumn(com.fr.design.i18n.Toolkit.i18nText("Value")); Properties properties = System.getProperties(); diff --git a/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java b/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java index 2e2024aa8c..188c330538 100644 --- a/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java +++ b/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java @@ -35,7 +35,7 @@ public abstract class ConditionAttributesPane extends BasicBeanPane { JPanel propertyChangePane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); this.add(propertyChangePane); - propertyChangePane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Property") + ":", null)); + propertyChangePane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Property") + ":", null)); // 选择要改变的属性. JPanel addItemPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index 2c11903b5a..d4905b645b 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -131,13 +131,13 @@ public class JDBCDefPane extends JPanel { JPanel userPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); userPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_UserName") + ":")); JPanel userComPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - Component[][] userComComponents = {{userNameTextField, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Password") + ":"), passwordTextField}}; + Component[][] userComComponents = {{userNameTextField, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Password") + ":"), passwordTextField}}; double[] userRowSize = {p}; double[] userColumnSize = {f, p, f}; userComPane = TableLayoutHelper.createCommonTableLayoutPane(userComComponents, userRowSize, userColumnSize, 4); JPanel passwordPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); - passwordPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Password") + ":")); + passwordPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Password") + ":")); Component[][] components = {{dbtypePane, dbtypeComPane}, {driverPane, driverComboBox}, {urlPane, urlComPane}, {userPane, userComPane},}; diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewLabel.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewLabel.java index 02fd23cd48..4fa695fd21 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewLabel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewLabel.java @@ -17,7 +17,7 @@ public class PreviewLabel extends UIButton { public PreviewLabel(Previewable previewable) { super(BaseUtils.readIcon("/com/fr/design/images/m_file/preview.png")); - this.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Preview")); + this.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview")); this.setCursor(new Cursor(Cursor.HAND_CURSOR)); this.previewable = previewable; this.addActionListener(new ActionListener() { diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/AutoStoreProcedureTableModel.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/AutoStoreProcedureTableModel.java index 51967e8f35..a3248ba1d8 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/AutoStoreProcedureTableModel.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/AutoStoreProcedureTableModel.java @@ -124,7 +124,7 @@ public class AutoStoreProcedureTableModel extends StoreProcedureTableModel { else type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_String"); }else if(value instanceof Integer) - type = com.fr.design.i18n.Toolkit.i18nText("Integer"); + type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Integer"); else if(value instanceof Double) type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Double"); else if(value instanceof Date) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataDefinedPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataDefinedPane.java index 16682c4157..1b340d2f48 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataDefinedPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataDefinedPane.java @@ -34,7 +34,7 @@ public class EmbeddedTableDataDefinedPane extends BasicPane{ private static String[] TYPE = { com.fr.design.i18n.Toolkit.i18nText("String"), - com.fr.design.i18n.Toolkit.i18nText("Integer"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Integer"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Double"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Date") }; diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java index cd137544fb..4a5b33033a 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java @@ -140,7 +140,7 @@ public class MultiTDTableDataPane extends AbstractTableDataPane implements UIObserver @Override protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Present-Formula_Present"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Present_Formula_Present"); } @Override diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/EditingStringListPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/EditingStringListPane.java index febd0deff4..d3370a7c07 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/EditingStringListPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/EditingStringListPane.java @@ -57,7 +57,7 @@ public abstract class EditingStringListPane extends BasicBeanPane> addButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add")); editButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Modify")); - removeButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Remove")); + removeButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove")); moveUpButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Up")); moveDownButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Down")); diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/ImgChoosePane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/ImgChoosePane.java index 9a531c60d6..58f0e8f837 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/ImgChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/ImgChoosePane.java @@ -34,7 +34,7 @@ public class ImgChoosePane extends BasicPane { this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel previewContainner = new JPanel(); - previewContainner.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Preview"))); + previewContainner.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"))); previewPane = new ImagePreviewPane(); previewContainner.add(previewPane); diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/ImgChooseWrapper.java b/designer-base/src/main/java/com/fr/design/gui/frpane/ImgChooseWrapper.java index 32a706fc5f..36183f1078 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/ImgChooseWrapper.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/ImgChooseWrapper.java @@ -148,7 +148,7 @@ public class ImgChooseWrapper { imageSizeLabel.setText(StringUtils.EMPTY); } else { imageSizeLabel.setText(selectImage.getWidth(null) + "x" - + selectImage.getHeight(null) + com.fr.design.i18n.Toolkit.i18nText("px")); + + selectImage.getHeight(null) + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Px")); } } } diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/ObjectProperiesPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/ObjectProperiesPane.java index d9f19d8546..72be101c8b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/ObjectProperiesPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/ObjectProperiesPane.java @@ -29,7 +29,7 @@ public class ObjectProperiesPane extends BasicBeanPane { this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel buttonPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - this.addButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add") + " " +com.fr.design.i18n.Toolkit.i18nText("Property")); + this.addButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add") + " " +com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Property")); buttonPane.add(this.addButton, BorderLayout.WEST); this.add(buttonPane, BorderLayout.NORTH); @@ -124,7 +124,7 @@ public class ObjectProperiesPane extends BasicBeanPane { this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); UIButton cancel = new UIButton(BaseUtils.readIcon("/com/fr/base/images/cell/control/remove.png")); - cancel.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Remove")); + cancel.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove")); cancel.addActionListener(cancleListener); cancel.setMargin(new Insets(0, 0, 0, 0)); this.add(cancel); diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/UITabbedPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/UITabbedPane.java index ee8661a835..92ad39559e 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/UITabbedPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/UITabbedPane.java @@ -113,7 +113,7 @@ public class UITabbedPane extends JTabbedPane{ * @param i tab索引 */ public void doRemoveTab(int i){ - int re = JOptionPane.showConfirmDialog(SwingUtilities.getWindowAncestor(UITabbedPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Sure_To_Delete")+ "?", com.fr.design.i18n.Toolkit.i18nText("Remove") + int re = JOptionPane.showConfirmDialog(SwingUtilities.getWindowAncestor(UITabbedPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Sure_To_Delete")+ "?", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove") , JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (re == JOptionPane.OK_OPTION) { super.removeTabAt(i); diff --git a/designer-base/src/main/java/com/fr/design/gui/imenutable/UIMenuTable.java b/designer-base/src/main/java/com/fr/design/gui/imenutable/UIMenuTable.java index 9555c282dc..d950e91ed7 100644 --- a/designer-base/src/main/java/com/fr/design/gui/imenutable/UIMenuTable.java +++ b/designer-base/src/main/java/com/fr/design/gui/imenutable/UIMenuTable.java @@ -211,7 +211,7 @@ public class UIMenuTable extends JTable { JPanel content = (JPanel)jf.getContentPane(); content.setLayout(new BorderLayout()); List data = new ArrayList(); - UIMenuNameableCreator reportlet = new UIMenuNameableCreator(com.fr.design.i18n.Toolkit.i18nText("Reportlet"), + UIMenuNameableCreator reportlet = new UIMenuNameableCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Reportlet"), new ReportletHyperlink(), ReportletHyperlinkPane.class); UIMenuNameableCreator email = new UIMenuNameableCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Email"), diff --git a/designer-base/src/main/java/com/fr/design/gui/imenutable/UIMenuTableUI.java b/designer-base/src/main/java/com/fr/design/gui/imenutable/UIMenuTableUI.java index b00971474b..8dc90f10bb 100644 --- a/designer-base/src/main/java/com/fr/design/gui/imenutable/UIMenuTableUI.java +++ b/designer-base/src/main/java/com/fr/design/gui/imenutable/UIMenuTableUI.java @@ -75,7 +75,7 @@ public class UIMenuTableUI extends UITableUI{ public void mousePressed(MouseEvent e) { if (e.getX() >= table.getWidth() - 20) { int val = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Are_You_Sure_To_Remove_The_Selected_Item") + "?", - com.fr.design.i18n.Toolkit.i18nText("Remove"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); if (val == JOptionPane.OK_OPTION) { uiTable.removeLine(table.rowAtPoint(e.getPoint())); uiTable.fireTargetChanged(); diff --git a/designer-base/src/main/java/com/fr/design/gui/itable/UITableUI.java b/designer-base/src/main/java/com/fr/design/gui/itable/UITableUI.java index f04b644417..370ceacb8f 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itable/UITableUI.java +++ b/designer-base/src/main/java/com/fr/design/gui/itable/UITableUI.java @@ -133,7 +133,7 @@ public class UITableUI extends BasicTableUI { } if (!table.isEditing()) { int val = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Are_You_Sure_To_Remove_The_Selected_Item") + "?", - com.fr.design.i18n.Toolkit.i18nText("Remove"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); if (val == JOptionPane.OK_OPTION) { ((UITable) table).removeLine(table.rowAtPoint(e.getPoint())); ((UITable) table).fireTargetChanged(); diff --git a/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableModelAdapter.java b/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableModelAdapter.java index 273fbdcb63..aa44b14ac5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableModelAdapter.java +++ b/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableModelAdapter.java @@ -252,7 +252,7 @@ public abstract class UITableModelAdapter extends AbstractTabl component = DesignerContext.getDesignerFrame(); } int val = JOptionPane.showConfirmDialog(component, - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Are_You_Sure_To_Remove_The_Selected_Item") + "?", com.fr.design.i18n.Toolkit.i18nText("Remove"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Are_You_Sure_To_Remove_The_Selected_Item") + "?", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); if (val != JOptionPane.OK_OPTION) { return; diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/ReportletPane.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/ReportletPane.java index f8a0552213..7d12a013ed 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/ReportletPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/ReportletPane.java @@ -96,7 +96,7 @@ public class ReportletPane extends BasicPane { @Override protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Reportlet"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Reportlet"); } /* diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/TemplateStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/TemplateStylePane.java index 8effcd10f3..fdd6cbb32c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/TemplateStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/TemplateStylePane.java @@ -54,7 +54,7 @@ public class TemplateStylePane extends BasicPane { JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); westPane.setPreferredSize(new Dimension(100, 500)); centerPane.setPreferredSize(new Dimension(300, 500)); - centerPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Preview"), null)); + centerPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"), null)); centerPane.add(previewPane); styleList.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { diff --git a/designer-base/src/main/java/com/fr/design/menu/KeySetUtils.java b/designer-base/src/main/java/com/fr/design/menu/KeySetUtils.java index c9e32f58b4..8e65415405 100644 --- a/designer-base/src/main/java/com/fr/design/menu/KeySetUtils.java +++ b/designer-base/src/main/java/com/fr/design/menu/KeySetUtils.java @@ -450,7 +450,7 @@ public class KeySetUtils { @Override public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("ReportD-Excel_Export"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportD_Excel_Export"); } @Override @@ -569,7 +569,7 @@ public class KeySetUtils { @Override public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("Report-Write_Attributes"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Report_Write_Attributes"); } @Override @@ -810,7 +810,7 @@ public class KeySetUtils { @Override public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("Present-Formula_Present"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Present_Formula_Present"); } @Override @@ -862,7 +862,7 @@ public class KeySetUtils { @Override public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("Present-No_Present"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Present_No_Present"); } @Override diff --git a/designer-base/src/main/java/com/fr/design/present/FormulaPresentPane.java b/designer-base/src/main/java/com/fr/design/present/FormulaPresentPane.java index a289a9000e..3e70ff8d25 100644 --- a/designer-base/src/main/java/com/fr/design/present/FormulaPresentPane.java +++ b/designer-base/src/main/java/com/fr/design/present/FormulaPresentPane.java @@ -23,7 +23,7 @@ public class FormulaPresentPane extends FurtherBasicBeanPane { @Override public String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Present-Formula_Present"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Present_Formula_Present"); } @Override diff --git a/designer-base/src/main/java/com/fr/design/present/NonePresentPane.java b/designer-base/src/main/java/com/fr/design/present/NonePresentPane.java index 09a2c7cc39..69cf2a44bd 100644 --- a/designer-base/src/main/java/com/fr/design/present/NonePresentPane.java +++ b/designer-base/src/main/java/com/fr/design/present/NonePresentPane.java @@ -18,7 +18,7 @@ public class NonePresentPane extends FurtherBasicBeanPane { @Override public String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Present-No_Present"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Present_No_Present"); } public void reset() { diff --git a/designer-base/src/main/java/com/fr/design/style/BorderPane.java b/designer-base/src/main/java/com/fr/design/style/BorderPane.java index f0a182ab6d..74d0d9e2a0 100644 --- a/designer-base/src/main/java/com/fr/design/style/BorderPane.java +++ b/designer-base/src/main/java/com/fr/design/style/BorderPane.java @@ -95,7 +95,7 @@ public class BorderPane extends BasicPane { JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - centerPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Preview"), null)); + centerPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"), null)); JPanel borderAllControlPane = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane(); centerPane.add(borderAllControlPane, BorderLayout.NORTH); borderAllControlPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 4, 0)); diff --git a/designer-base/src/main/java/com/fr/design/style/FRFontPane.java b/designer-base/src/main/java/com/fr/design/style/FRFontPane.java index 767abf9d95..04b285fd56 100644 --- a/designer-base/src/main/java/com/fr/design/style/FRFontPane.java +++ b/designer-base/src/main/java/com/fr/design/style/FRFontPane.java @@ -184,7 +184,7 @@ public class FRFontPane extends BasicPane { // preview pane. preview = new FRFontPreviewArea(); - preview.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Preview"))); + preview.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"))); rightPane.add(preview, BorderLayout.CENTER); // Cannot select superscript and subscript in the same time. diff --git a/designer-base/src/main/java/com/fr/design/style/background/image/ImageSelectPane.java b/designer-base/src/main/java/com/fr/design/style/background/image/ImageSelectPane.java index 7b53952260..5b845eae91 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/image/ImageSelectPane.java +++ b/designer-base/src/main/java/com/fr/design/style/background/image/ImageSelectPane.java @@ -115,7 +115,7 @@ public class ImageSelectPane extends BackgroundPane4BoxChange { imageSizeLabel.setText(""); } else { imageSizeLabel.setText(selectImage.getWidth(null) + "x" - + selectImage.getHeight(null) + com.fr.design.i18n.Toolkit.i18nText("px")); + + selectImage.getHeight(null) + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Px")); } } diff --git a/designer-base/src/main/java/com/fr/design/style/color/DetailColorSelectPane.java b/designer-base/src/main/java/com/fr/design/style/color/DetailColorSelectPane.java index 5232ab3afa..4245c1293b 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/DetailColorSelectPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/DetailColorSelectPane.java @@ -72,7 +72,7 @@ public class DetailColorSelectPane extends BasicPane { this.getFont().getStyle(), this.getFont().getSize() + 4)); colorPreviewLabel.setBorder(BorderFactory.createEmptyBorder(0, 2, 2, 2)); colorPreviewPane.add(colorPreviewLabel, BorderLayout.CENTER); - UITitledBorder explainBorder = UITitledBorder.createBorderWithTitle(com.fr.design.i18n.Toolkit.i18nText("Preview")); + UITitledBorder explainBorder = UITitledBorder.createBorderWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview")); colorPreviewPane.setBorder(explainBorder); this.addChangeListener(colorPreviewLabelChangeListener); diff --git a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java index 078fe05d0e..1a79fe22cf 100644 --- a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java @@ -684,7 +684,7 @@ public abstract class GUICoreUtils{ return false; } - int returnVal = JOptionPane.showConfirmDialog(ancestorWindow, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Are_You_Sure_To_Remove_The_Selected_Item") + "?", com.fr.design.i18n.Toolkit.i18nText("Remove"), + int returnVal = JOptionPane.showConfirmDialog(ancestorWindow, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Are_You_Sure_To_Remove_The_Selected_Item") + "?", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); if (returnVal == JOptionPane.OK_OPTION) { int minSelectedIndex = nodeList.getMinSelectionIndex(); diff --git a/designer-base/src/main/java/com/fr/env/RemoteSignInPane.java b/designer-base/src/main/java/com/fr/env/RemoteSignInPane.java index 2ca95160f9..99b0fe0699 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteSignInPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteSignInPane.java @@ -24,7 +24,7 @@ public class RemoteSignInPane extends BasicPane { userLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_UserName")+":"); userTextField = new UITextField(); - passLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Password")+":"); + passLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Password")+":"); passwordField = new UIPassWordField(); this.add(userLabel); this.add(userTextField); diff --git a/designer-chart/src/main/java/com/fr/design/chart/javascript/ChartEmailPane.java b/designer-chart/src/main/java/com/fr/design/chart/javascript/ChartEmailPane.java index 1eb6dc9256..a27bf328e1 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/javascript/ChartEmailPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/javascript/ChartEmailPane.java @@ -55,7 +55,7 @@ public class ChartEmailPane extends EmailPane{ } centerPane = new JPanel(new BorderLayout()); if (needRenamePane()) { - JPanel namePane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Name") + ":", SwingConstants.RIGHT), itemNameTextField},}, + JPanel namePane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":", SwingConstants.RIGHT), itemNameTextField},}, new double[] {preferred}, columnSize, 6); centerPane.add(namePane, BorderLayout.NORTH); } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/PresentComboBox.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/PresentComboBox.java index 36da971146..00cea4be16 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/PresentComboBox.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/PresentComboBox.java @@ -25,8 +25,8 @@ public class PresentComboBox extends UIComboBox{ private String[] ITEMS = { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Dictionary"), - com.fr.design.i18n.Toolkit.i18nText("Present-Formula_Present"), - com.fr.design.i18n.Toolkit.i18nText("Present-No_Present") + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Present_Formula_Present"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Present_No_Present") }; public PresentComboBox() { diff --git a/designer-form/src/main/java/com/fr/design/designer/properties/VerticalSplitProperties.java b/designer-form/src/main/java/com/fr/design/designer/properties/VerticalSplitProperties.java index 3ff873e64b..306a2faf1f 100644 --- a/designer-form/src/main/java/com/fr/design/designer/properties/VerticalSplitProperties.java +++ b/designer-form/src/main/java/com/fr/design/designer/properties/VerticalSplitProperties.java @@ -46,7 +46,7 @@ public class VerticalSplitProperties implements GroupModel { if (column == 0) { switch (row) { case 0: - return com.fr.design.i18n.Toolkit.i18nText("Ratio"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Ratio"); case 1: return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Hgap"); case 2: diff --git a/designer-form/src/main/java/com/fr/design/designer/properties/items/HorizontalAlignmentItems.java b/designer-form/src/main/java/com/fr/design/designer/properties/items/HorizontalAlignmentItems.java index 742ffdb979..e0fcfcf942 100644 --- a/designer-form/src/main/java/com/fr/design/designer/properties/items/HorizontalAlignmentItems.java +++ b/designer-form/src/main/java/com/fr/design/designer/properties/items/HorizontalAlignmentItems.java @@ -7,7 +7,7 @@ import java.awt.FlowLayout; public class HorizontalAlignmentItems implements ItemProvider { private static Item[] VALUE_ITEMS = { - new Item(com.fr.design.i18n.Toolkit.i18nText("Left"), FlowLayout.LEFT), + new Item(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Left"), FlowLayout.LEFT), new Item(com.fr.design.i18n.Toolkit.i18nText("Right"), FlowLayout.RIGHT), new Item(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Center"), FlowLayout.CENTER) }; diff --git a/designer-form/src/main/java/com/fr/design/designer/properties/items/LabelHorizontalAlignmentItems.java b/designer-form/src/main/java/com/fr/design/designer/properties/items/LabelHorizontalAlignmentItems.java index 55a1baab77..398a9494f2 100644 --- a/designer-form/src/main/java/com/fr/design/designer/properties/items/LabelHorizontalAlignmentItems.java +++ b/designer-form/src/main/java/com/fr/design/designer/properties/items/LabelHorizontalAlignmentItems.java @@ -7,7 +7,7 @@ import javax.swing.SwingConstants; public class LabelHorizontalAlignmentItems implements ItemProvider { private static Item[] VALUE_ITEMS = { - new Item(com.fr.design.i18n.Toolkit.i18nText("Left"), SwingConstants.LEFT), + new Item(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Left"), SwingConstants.LEFT), new Item(com.fr.design.i18n.Toolkit.i18nText("Right"), SwingConstants.RIGHT), new Item(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Center"), SwingConstants.CENTER) }; diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/ColorPalette.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/ColorPalette.java index 7a1f7a8f5a..8e5f964908 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/ColorPalette.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/ColorPalette.java @@ -21,8 +21,8 @@ import com.fr.design.layout.FRGUIPaneFactory; public class ColorPalette extends JPopupMenu { private Border BLACK_BORDER = BorderFactory.createLineBorder(new Color(127, 157, 185)); - private Object[] colors = new Object[]{new Object[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Black"), new Color(0, 0, 0)}, new Object[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Crimson"), new Color(128, 0, 0)}, new Object[]{com.fr.design.i18n.Toolkit.i18nText("Red"), new Color(255, 0, 0)}, - new Object[]{com.fr.design.i18n.Toolkit.i18nText("Pink"), new Color(255, 0, 255)}, new Object[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Rose_Red"), new Color(255, 153, 204)}, new Object[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Brown"), new Color(153, 51, 0)}, + private Object[] colors = new Object[]{new Object[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Black"), new Color(0, 0, 0)}, new Object[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Crimson"), new Color(128, 0, 0)}, new Object[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Red"), new Color(255, 0, 0)}, + new Object[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Pink"), new Color(255, 0, 255)}, new Object[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Rose_Red"), new Color(255, 153, 204)}, new Object[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Brown"), new Color(153, 51, 0)}, new Object[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Orange"), new Color(255, 102, 0)}, new Object[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Light_Orange"), new Color(255, 153, 0)}, new Object[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Golden"), new Color(255, 204, 0)}, new Object[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Brown_Orange"), new Color(255, 204, 153)}, new Object[]{"", new Color(51, 51, 0)}, new Object[]{"", new Color(128, 128, 0)}, new Object[]{"", new Color(153, 204, 0)}, new Object[]{"", new Color(255, 255, 0)}, new Object[]{"", new Color(255, 255, 153)}, new Object[]{"", new Color(0, 51, 0)}, new Object[]{"", new Color(0, 128, 0)}, diff --git a/designer-realize/src/main/java/com/fr/design/actions/utils/DeprecatedActionManager.java b/designer-realize/src/main/java/com/fr/design/actions/utils/DeprecatedActionManager.java index 3d5e8696b2..b9b2e4ad77 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/utils/DeprecatedActionManager.java +++ b/designer-realize/src/main/java/com/fr/design/actions/utils/DeprecatedActionManager.java @@ -96,13 +96,13 @@ public class DeprecatedActionManager { presentMenu.setMnemonic(KeySetUtils.PRESENT.getMnemonic()); NewPresentAction dataDictAction = new NewPresentAction(ePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Format_Data_Map"), DictPresent.class.getName()); dataDictAction.setMnemonic('D'); - NewPresentAction formulaAction = new NewPresentAction(ePane, com.fr.design.i18n.Toolkit.i18nText("Present-Formula_Present"), FormulaPresent.class.getName()); + NewPresentAction formulaAction = new NewPresentAction(ePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Present_Formula_Present"), FormulaPresent.class.getName()); formulaAction.setMnemonic('F'); NewPresentAction barcodeAction = new NewPresentAction(ePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Insert_Barcode"), BarcodePresent.class.getName()); barcodeAction.setMnemonic('B'); NewPresentAction currencyLineAction = new NewPresentAction(ePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Currency_Line"), CurrencyLinePresent.class.getName()); currencyLineAction.setMnemonic('L'); - NewPresentAction nonePresentAction = new NewPresentAction(ePane, com.fr.design.i18n.Toolkit.i18nText("Present-No_Present"), "NOPRESENT"); + NewPresentAction nonePresentAction = new NewPresentAction(ePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Present_No_Present"), "NOPRESENT"); nonePresentAction.setMnemonic('N'); presentMenu.addShortCut(dataDictAction); presentMenu.addShortCut(formulaAction); diff --git a/designer-realize/src/main/java/com/fr/design/headerfooter/HeaderFooterEditPane.java b/designer-realize/src/main/java/com/fr/design/headerfooter/HeaderFooterEditPane.java index ae1250a2f3..68778dccbc 100644 --- a/designer-realize/src/main/java/com/fr/design/headerfooter/HeaderFooterEditPane.java +++ b/designer-realize/src/main/java/com/fr/design/headerfooter/HeaderFooterEditPane.java @@ -97,7 +97,7 @@ public class HeaderFooterEditPane extends JPanel { JPanel hfPreviewContentPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); centerPane.add(hfPreviewContentPane, BorderLayout.CENTER); - hfPreviewContentPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Preview"),null)); + hfPreviewContentPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"),null)); hfPreviewPane = new HFPreviewPane(); scrollPreviewPane = new JScrollPane(hfPreviewPane); diff --git a/designer-realize/src/main/java/com/fr/design/headerfooter/ImagePane.java b/designer-realize/src/main/java/com/fr/design/headerfooter/ImagePane.java index 4fca75e878..1011f8036c 100644 --- a/designer-realize/src/main/java/com/fr/design/headerfooter/ImagePane.java +++ b/designer-realize/src/main/java/com/fr/design/headerfooter/ImagePane.java @@ -39,7 +39,7 @@ public class ImagePane extends BasicPane { // previewPane.setLayout(FRGUIPaneFactory.createBorderLayout()); if (hasPreviewBorder) { - previewPane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Preview"))); + previewPane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"))); } imagePreviewPane = new ImagePreviewPane(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java index 227cd6c44d..3ecd2caf42 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java @@ -834,7 +834,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse @Override protected String getTemplateReportType() { - return com.fr.design.i18n.Toolkit.i18nText("Report"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Report"); } } @@ -846,13 +846,13 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse @Override protected String getTemplateReportType() { - return com.fr.design.i18n.Toolkit.i18nText("Poly"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Poly"); } } private class RemoveSheetAction extends UpdateAction { RemoveSheetAction() { - this.setName(com.fr.design.i18n.Toolkit.i18nText("Remove")); + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove")); this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/remove.png")); } @@ -908,7 +908,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse private class RenameSheetAction extends UpdateAction { RenameSheetAction() { - this.setName(com.fr.design.i18n.Toolkit.i18nText("Rename")); + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Rename")); this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/rename.png")); } @@ -918,7 +918,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse return; } - String newName = JOptionPane.showInputDialog(reportComposite, com.fr.design.i18n.Toolkit.i18nText("Rename") + ":", reportComposite.getEditingWorkBook().getReportName(selectedIndex)); + String newName = JOptionPane.showInputDialog(reportComposite, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Rename") + ":", reportComposite.getEditingWorkBook().getReportName(selectedIndex)); if (newName != null) { // marks:判断是否重名 boolean isExisted = false; diff --git a/designer-realize/src/main/java/com/fr/design/present/BarCodePane.java b/designer-realize/src/main/java/com/fr/design/present/BarCodePane.java index dafef86580..029f7e9c85 100644 --- a/designer-realize/src/main/java/com/fr/design/present/BarCodePane.java +++ b/designer-realize/src/main/java/com/fr/design/present/BarCodePane.java @@ -167,14 +167,14 @@ public class BarCodePane extends FurtherBasicBeanPane { double[] columnSize = {p, f}; double[] rowSize = {p, p, p}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; - UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("RCodeVersion"), UILabel.LEFT); + UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_RCode_Version"), UILabel.LEFT); uiLabel.setPreferredSize(typeSetLabel.getPreferredSize()); RCodeVersionComboBox.setPreferredSize(new Dimension(155,20)); RCodeErrorCorrectComboBox.setPreferredSize(new Dimension(155,20)); RCodesizespinner.setPreferredSize(new Dimension(155,20)); Component[][] components_special = new Component[][]{ new Component[]{uiLabel, RCodeVersionComboBox}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("RCodeErrorCorrect"), UILabel.LEFT), RCodeErrorCorrectComboBox}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_RCode_Error_Correct"), UILabel.LEFT), RCodeErrorCorrectComboBox}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_RCodeDrawPix"), UILabel.LEFT), RCodesizespinner} }; @@ -230,7 +230,7 @@ public class BarCodePane extends FurtherBasicBeanPane { } private void initErrorCorrectComboBox() { - String[] array = {"L" + com.fr.design.i18n.Toolkit.i18nText("Level") + "7%", "M" + com.fr.design.i18n.Toolkit.i18nText("Level") + "15%", "Q" + com.fr.design.i18n.Toolkit.i18nText("Level") + "25%", "H" + com.fr.design.i18n.Toolkit.i18nText("Level") + "30%"}; + String[] array = {"L" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Level") + "7%", "M" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Level") + "15%", "Q" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Level") + "25%", "H" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Level") + "30%"}; initcombobox(this.RCodeErrorCorrectComboBox, array, 1); } diff --git a/designer-realize/src/main/java/com/fr/design/report/ExcelExportPane.java b/designer-realize/src/main/java/com/fr/design/report/ExcelExportPane.java index 9b1e840369..f829616c7a 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ExcelExportPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ExcelExportPane.java @@ -32,7 +32,7 @@ public class ExcelExportPane extends BasicPane { protected void initComponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); - JPanel outnorthPane =FRGUIPaneFactory.createTitledBorderPane("Excel" + com.fr.design.i18n.Toolkit.i18nText("ReportD-Excel_Export")); + JPanel outnorthPane =FRGUIPaneFactory.createTitledBorderPane("Excel" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportD_Excel_Export")); JPanel northPane=FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); this.add(outnorthPane); outnorthPane.add(northPane); diff --git a/designer-realize/src/main/java/com/fr/design/report/PDFExportPane.java b/designer-realize/src/main/java/com/fr/design/report/PDFExportPane.java index 87f3d3fcf9..7fa71fe950 100644 --- a/designer-realize/src/main/java/com/fr/design/report/PDFExportPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/PDFExportPane.java @@ -27,7 +27,7 @@ public class PDFExportPane extends BasicPane { protected void initComponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); - JPanel outnorthPane =FRGUIPaneFactory.createTitledBorderPane("PDF" + com.fr.design.i18n.Toolkit.i18nText("ReportD-Excel_Export")); + JPanel outnorthPane =FRGUIPaneFactory.createTitledBorderPane("PDF" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportD_Excel_Export")); JPanel northPane=FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); this.add(outnorthPane); outnorthPane.add(northPane); diff --git a/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java b/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java index f7a42d938b..e4a9a25fa9 100644 --- a/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java @@ -184,7 +184,7 @@ public class PageSetupPane extends BasicPane { portraitRadioButton.setSelected(true); - JPanel spp = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Preview")); + JPanel spp = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview")); showPagePane = new ShowPagePane(); spp.add(showPagePane); defaultPane.add(spp); @@ -293,7 +293,7 @@ public class PageSetupPane extends BasicPane { // peter:这个一个垂直的上下的字符panel. JPanel marginRightTextPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); marginRightPane.add(marginRightTextPane); - marginRightTextPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Left") + ":")); + marginRightTextPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Left") + ":")); marginLeftUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); marginRightTextPane.add(marginLeftUnitFieldPane); diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java b/designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java index 00d28b7c97..f2c180abd5 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java @@ -41,7 +41,7 @@ public class ReportExportAttrPane extends BasicPane { @Override protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("ReportD-Excel_Export"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportD_Excel_Export"); } public void populate(ReportExportAttr reportExportAttr) { diff --git a/designer-realize/src/main/java/com/fr/design/report/SelectImagePane.java b/designer-realize/src/main/java/com/fr/design/report/SelectImagePane.java index ce11a13c4e..77a662d6d1 100644 --- a/designer-realize/src/main/java/com/fr/design/report/SelectImagePane.java +++ b/designer-realize/src/main/java/com/fr/design/report/SelectImagePane.java @@ -63,7 +63,7 @@ public class SelectImagePane extends BasicPane { JPanel previewOwnerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); previewContainerPane.add(previewOwnerPane, BorderLayout.CENTER); - previewOwnerPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Preview"), null)); + previewOwnerPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"), null)); previewPane = new ImagePreviewPane(); previewOwnerPane.add(new JScrollPane(previewPane)); diff --git a/designer-realize/src/main/java/com/fr/design/report/WordExportPane.java b/designer-realize/src/main/java/com/fr/design/report/WordExportPane.java index 8913edbbd1..df808c1bcb 100644 --- a/designer-realize/src/main/java/com/fr/design/report/WordExportPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/WordExportPane.java @@ -24,7 +24,7 @@ public class WordExportPane extends BasicPane { protected void initComponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); - JPanel outnorthPane =FRGUIPaneFactory.createTitledBorderPane("Word" + com.fr.design.i18n.Toolkit.i18nText("ReportD-Excel_Export")); + JPanel outnorthPane =FRGUIPaneFactory.createTitledBorderPane("Word" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportD_Excel_Export")); this.add(outnorthPane); JPanel northPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); diff --git a/designer-realize/src/main/java/com/fr/design/style/StylePane.java b/designer-realize/src/main/java/com/fr/design/style/StylePane.java index f0b670e4e2..7fe966b98d 100644 --- a/designer-realize/src/main/java/com/fr/design/style/StylePane.java +++ b/designer-realize/src/main/java/com/fr/design/style/StylePane.java @@ -69,7 +69,7 @@ public class StylePane extends BasicBeanPane