plough 8 years ago
parent
commit
ef7f1ea010
  1. 21
      designer/src/com/fr/start/ReportSplashPane.java
  2. 23
      designer_base/src/com/fr/design/actions/help/AboutPane.java
  3. 1
      designer_base/src/com/fr/design/dialog/BasicDialog.java
  4. 24
      designer_base/src/com/fr/design/dialog/BasicPane.java
  5. 2
      designer_base/src/com/fr/design/extra/PluginHelper.java
  6. 155
      designer_base/src/com/fr/design/formula/FormulaPane.java
  7. 2
      designer_base/src/com/fr/design/insert/formula/variable/cn/$$$.txt
  8. 2
      designer_base/src/com/fr/design/insert/formula/variable/cn/$$page_number.txt
  9. 2
      designer_base/src/com/fr/design/insert/formula/variable/cn/$$totalPage_number.txt
  10. 2
      designer_base/src/com/fr/design/insert/formula/variable/cn/$fr_authority.txt
  11. 2
      designer_base/src/com/fr/design/insert/formula/variable/cn/$fr_username.txt
  12. 4
      designer_base/src/com/fr/design/insert/formula/variable/cn/$fr_userposition.txt
  13. 2
      designer_base/src/com/fr/design/insert/formula/variable/cn/NOFILTER.txt
  14. 2
      designer_base/src/com/fr/design/insert/formula/variable/cn/NULL.txt
  15. 4
      designer_base/src/com/fr/design/insert/formula/variable/cn/contextPath.txt
  16. 2
      designer_base/src/com/fr/design/insert/formula/variable/cn/curReport.txt
  17. 4
      designer_base/src/com/fr/design/insert/formula/variable/cn/formletName.txt
  18. 2
      designer_base/src/com/fr/design/insert/formula/variable/cn/fr_submitinfo.txt
  19. 4
      designer_base/src/com/fr/design/insert/formula/variable/cn/reportName.txt
  20. 4
      designer_base/src/com/fr/design/insert/formula/variable/cn/serverName.txt
  21. 2
      designer_base/src/com/fr/design/insert/formula/variable/cn/serverPort.txt
  22. 4
      designer_base/src/com/fr/design/insert/formula/variable/cn/serverSchema.txt
  23. 4
      designer_base/src/com/fr/design/insert/formula/variable/cn/serverURL.txt
  24. 3
      designer_base/src/com/fr/design/insert/formula/variable/cn/servletURL.txt
  25. 5
      designer_base/src/com/fr/design/insert/formula/variable/cn/sessionID.txt
  26. 2
      designer_base/src/com/fr/design/insert/formula/variable/en/contextPath.txt
  27. 4
      designer_base/src/com/fr/design/insert/formula/variable/en/formletName.txt
  28. 2
      designer_base/src/com/fr/design/insert/formula/variable/en/fr_submitinfo.txt
  29. 4
      designer_base/src/com/fr/design/insert/formula/variable/en/reportName.txt
  30. 4
      designer_base/src/com/fr/design/insert/formula/variable/en/serverName.txt
  31. 4
      designer_base/src/com/fr/design/insert/formula/variable/en/serverSchema.txt
  32. 4
      designer_base/src/com/fr/design/insert/formula/variable/en/serverURL.txt
  33. 3
      designer_base/src/com/fr/design/insert/formula/variable/en/servletURL.txt
  34. 17
      designer_base/src/com/fr/design/locale/designer.properties
  35. 17
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  36. 17
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  37. 17
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  38. 17
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  39. 17
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  40. 27
      designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java
  41. 2
      designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java
  42. 20
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java
  43. 13
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java
  44. 7
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java
  45. 7
      designer_form/src/com/fr/design/designer/creator/XChartEditor.java
  46. 8
      designer_form/src/com/fr/design/designer/creator/XCreator.java
  47. 14
      designer_form/src/com/fr/design/designer/creator/XElementCase.java
  48. 9
      designer_form/src/com/fr/design/designer/creator/XWidgetCreator.java
  49. 3
      designer_form/src/com/fr/design/gui/xtable/PropertyGroupModel.java
  50. 481
      designer_form/src/com/fr/design/mainframe/FormEditToolBar.java
  51. 84
      designer_form/src/com/fr/design/mainframe/FormSettingToolBar.java
  52. 68
      designer_form/src/com/fr/design/mainframe/FormToolBar.java
  53. 164
      designer_form/src/com/fr/design/mainframe/FormToolBarButton.java
  54. 233
      designer_form/src/com/fr/design/mainframe/FormToolBarPane.java
  55. 54
      designer_form/src/com/fr/design/mainframe/FormWebWidgetConstants.java
  56. 57
      designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleElementCaseToolBarEditor.java
  57. 13
      designer_form/src/com/fr/design/mainframe/widget/editors/ElementCaseToolBarEditor.java
  58. 304
      designer_form/src/com/fr/design/mainframe/widget/editors/ElementCaseToolBarPane.java
  59. 34
      designer_form/src/com/fr/design/mainframe/widget/wrappers/ElementCaseToolBarWrapper.java

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

@ -4,6 +4,7 @@
package com.fr.start; package com.fr.start;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.design.mainframe.bbs.BBSConstants; import com.fr.design.mainframe.bbs.BBSConstants;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
@ -18,6 +19,7 @@ import java.awt.*;
import java.awt.font.FontRenderContext; import java.awt.font.FontRenderContext;
import java.awt.font.LineMetrics; import java.awt.font.LineMetrics;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.util.Locale;
import java.util.Random; import java.util.Random;
import java.util.TimerTask; import java.util.TimerTask;
@ -117,9 +119,22 @@ public class ReportSplashPane extends SplashPane{
GraphHelper.drawString(splashG2d, showText, MODULE_INFO_X, y); GraphHelper.drawString(splashG2d, showText, MODULE_INFO_X, y);
//每次随机感谢一位论坛用户 //每次随机感谢一位论坛用户
splashG2d.setPaint(THANK_COLOR); if (shouldShowThanks()) {
String content = Inter.getLocText("FR-Designer_Thanks-To") + GUEST; splashG2d.setPaint(THANK_COLOR);
GraphHelper.drawString(splashG2d, content, THANK_INFO_X, y); String content = Inter.getLocText("FR-Designer_Thanks-To") + GUEST;
GraphHelper.drawString(splashG2d, content, THANK_INFO_X, y);
}
}
// 是否显示鸣谢文字
private boolean shouldShowThanks() {
Locale[] hideLocales = {Locale.US, Locale.KOREA, Locale.JAPAN};
for (Locale loc : hideLocales) {
if (FRContext.getLocale().equals(loc)) {
return false;
}
}
return true;
} }
private static String getRandomUser(){ private static String getRandomUser(){

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

@ -68,10 +68,7 @@ public class AboutPane extends JPanel {
Inter.getLocText("FR-Designer-Basic_Activation_Key_Copy_OK") Inter.getLocText("FR-Designer-Basic_Activation_Key_Copy_OK")
})); }));
// 英文去掉服务电话和 QQ if (shouldShowPhoneAndQQ()){
if (FRContext.getLocale().equals(Locale.US)){
// do nothing
} else {
if(ComparatorUtils.equals(ProductConstants.APP_NAME,FINEREPORT)){ if(ComparatorUtils.equals(ProductConstants.APP_NAME,FINEREPORT)){
boxCenterAlignmentPane = new BoxCenterAligmentPane(Inter.getLocText("FR-Designer_Service_Phone") + ProductConstants.COMPARE_TELEPHONE); boxCenterAlignmentPane = new BoxCenterAligmentPane(Inter.getLocText("FR-Designer_Service_Phone") + ProductConstants.COMPARE_TELEPHONE);
contentPane.add(boxCenterAlignmentPane); contentPane.add(boxCenterAlignmentPane);
@ -85,8 +82,24 @@ public class AboutPane extends JPanel {
contentPane.add(actionLabel); contentPane.add(actionLabel);
contentPane.add(emailLabel); contentPane.add(emailLabel);
if (shouldShowThanks()) {
addThankPane(contentPane);
}
}
addThankPane(contentPane); // 是否显示服务电话和 qq
private boolean shouldShowPhoneAndQQ() {
return !FRContext.getLocale().equals(Locale.US);
}
// 是否显示鸣谢面板
private boolean shouldShowThanks() {
Locale[] hideLocales = {Locale.US, Locale.KOREA, Locale.JAPAN};
for (Locale loc : hideLocales) {
if (FRContext.getLocale().equals(loc)) {
return false;
}
}
return true;
} }
//添加鸣谢面板 //添加鸣谢面板

1
designer_base/src/com/fr/design/dialog/BasicDialog.java

@ -13,6 +13,7 @@ public abstract class BasicDialog extends UIDialog {
public static final Dimension CHART = new Dimension(760, 560); public static final Dimension CHART = new Dimension(760, 560);
public static final Dimension MAP_SIZE = new Dimension(760, 450); public static final Dimension MAP_SIZE = new Dimension(760, 450);
public static final Dimension UPDATE_ONLINE_SIZE = new Dimension(600,300); public static final Dimension UPDATE_ONLINE_SIZE = new Dimension(600,300);
public static final Dimension TOOLBAR_SIZE = new Dimension(660, 327);
public BasicDialog(Frame parent) { public BasicDialog(Frame parent) {
super(parent); super(parent);

24
designer_base/src/com/fr/design/dialog/BasicPane.java

@ -251,6 +251,30 @@ public abstract class BasicPane extends JPanel {
return dg; return dg;
} }
/**
* 显示窗口
*
* @param window 窗口
* @param l 对话框监听器
* @return 对话框
*/
public BasicDialog showToolBarWindow(Window window, DialogActionListener l) {
BasicDialog dg;
if (window instanceof Frame) {
dg = new DIALOG((Frame) window);
} else {
dg = new DIALOG((Dialog) window);
}
if (l != null) {
dg.addDialogActionListener(l);
}
dg.setBasicDialogSize(BasicDialog.TOOLBAR_SIZE);
GUICoreUtils.centerWindow(dg);
dg.setResizable(false);
return dg;
}
protected abstract String title4PopupWindow(); protected abstract String title4PopupWindow();
public String getTitle() { public String getTitle() {

2
designer_base/src/com/fr/design/extra/PluginHelper.java

@ -319,6 +319,8 @@ public class PluginHelper {
if (plugin == null || env == null) { if (plugin == null || env == null) {
return ArrayUtils.EMPTY_STRING_ARRAY; return ArrayUtils.EMPTY_STRING_ARRAY;
} }
//卸载前监听
plugin.preUninstall();
PluginLoader.getLoader().deletePlugin(plugin); PluginLoader.getLoader().deletePlugin(plugin);
return env.deleteFileFromPluginAndLibFolder(plugin); return env.deleteFileFromPluginAndLibFolder(plugin);
} }

155
designer_base/src/com/fr/design/formula/FormulaPane.java

@ -22,6 +22,7 @@ import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.parser.FRLexer; import com.fr.parser.FRLexer;
import com.fr.parser.FRParser; import com.fr.parser.FRParser;
import com.fr.stable.EncodeConstants;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.script.Expression; import com.fr.stable.script.Expression;
@ -38,12 +39,14 @@ import java.awt.event.*;
import java.io.*; import java.io.*;
import java.util.Locale; import java.util.Locale;
import java.util.Set; import java.util.Set;
/** /**
* 公式编辑面板 * 公式编辑面板
*
* @editor zhou * @editor zhou
* @since 2012-3-29下午1:50:53 * @since 2012-3-29下午1:50:53
*/ */
public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
protected VariableTreeAndDescriptionArea variableTreeAndDescriptionArea; protected VariableTreeAndDescriptionArea variableTreeAndDescriptionArea;
protected RSyntaxTextArea formulaTextArea; protected RSyntaxTextArea formulaTextArea;
@ -63,16 +66,16 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
initComponents(); initComponents();
} }
private void initFormulaTextAreaKeyListener(){ private void initFormulaTextAreaKeyListener() {
formulaTextArea.addKeyListener(this); formulaTextArea.addKeyListener(this);
formulaTextArea.addKeyListener(new KeyAdapter() { formulaTextArea.addKeyListener(new KeyAdapter() {
public void keyReleased(KeyEvent e) { public void keyReleased(KeyEvent e) {
formulaTextArea.setForeground(Color.black); formulaTextArea.setForeground(Color.black);
String text = formulaTextArea.getText(); String text = formulaTextArea.getText();
// 判断在中文输入状态是否还包含提示符 要删掉 // 判断在中文输入状态是否还包含提示符 要删掉
//Tips:You_Can_Input_B1_To_Input_The_Data_Of_The_First_Row_Second_Column //Tips:You_Can_Input_B1_To_Input_The_Data_Of_The_First_Row_Second_Column
String tip = "\n\n\n" + Inter.getLocText("FR-Designer_FormulaPane_Tips"); String tip = "\n\n\n" + Inter.getLocText("FR-Designer_FormulaPane_Tips");
if(text.contains(tip)) { if (text.contains(tip)) {
text = text.substring(0, text.indexOf(tip)); text = text.substring(0, text.indexOf(tip));
insertPosition = 0; insertPosition = 0;
formulaTextArea.setText(text); formulaTextArea.setText(text);
@ -81,8 +84,8 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
}); });
} }
private void initFormulaTextAreaMouseListener(){ private void initFormulaTextAreaMouseListener() {
formulaTextArea.addMouseListener(new MouseAdapter() { formulaTextArea.addMouseListener(new MouseAdapter() {
@Override @Override
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
insertPosition = formulaTextArea.getCaretPosition(); insertPosition = formulaTextArea.getCaretPosition();
@ -107,21 +110,23 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
}); });
} }
private void initFormulaTextArea(){ private void initFormulaTextArea() {
formulaTextArea = new RSyntaxTextArea(); formulaTextArea = new RSyntaxTextArea();
configFormulaArea(); configFormulaArea();
initFormulaTextAreaKeyListener(); initFormulaTextAreaKeyListener();
initFormulaTextAreaMouseListener(); initFormulaTextAreaMouseListener();
} }
private void initKeyWordTextFieldKeyListener(){ private void initKeyWordTextFieldKeyListener() {
keyWordTextField.addKeyListener(new KeyListener() { keyWordTextField.addKeyListener(new KeyListener() {
@Override @Override
public void keyTyped(KeyEvent e) { public void keyTyped(KeyEvent e) {
} }
@Override @Override
public void keyReleased(KeyEvent e) { public void keyReleased(KeyEvent e) {
} }
@Override @Override
public void keyPressed(KeyEvent e) { public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) { if (e.getKeyCode() == KeyEvent.VK_ENTER) {
@ -134,8 +139,8 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
}); });
} }
private void initTipsPane(){ private void initTipsPane() {
// tipsPane // tipsPane
JPanel tipsPane = new JPanel(new BorderLayout(4, 4)); JPanel tipsPane = new JPanel(new BorderLayout(4, 4));
this.add(tipsPane, BorderLayout.EAST); this.add(tipsPane, BorderLayout.EAST);
@ -259,6 +264,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
this.formulaTextArea.setText(StringUtils.EMPTY); this.formulaTextArea.setText(StringUtils.EMPTY);
} }
} }
//hugh:为啥会是10呢?搞不懂~~~ //hugh:为啥会是10呢?搞不懂~~~
private static final int KEY_10 = 10; private static final int KEY_10 = 10;
//上下左右 //上下左右
@ -266,6 +272,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
private static final int KEY_38 = 38; private static final int KEY_38 = 38;
private static final int KEY_39 = 39; private static final int KEY_39 = 39;
private static final int KEY_40 = 40; private static final int KEY_40 = 40;
@Override @Override
public void keyReleased(KeyEvent e) { public void keyReleased(KeyEvent e) {
int key = e.getKeyCode(); int key = e.getKeyCode();
@ -455,7 +462,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return Inter.getLocText("FormulaD-Formula_Definition"); return Inter.getLocText("FormulaD-Formula_Definition");
} }
/** /**
@ -562,8 +569,8 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
this.initComponents(); this.initComponents();
} }
private void initFunctionTypeList(JPanel functionPane){ private void initFunctionTypeList(JPanel functionPane) {
functionTypeList = new QuickList(functionTypeListModel); functionTypeList = new QuickList(functionTypeListModel);
UIScrollPane functionTypeScrollPane = new UIScrollPane(functionTypeList); UIScrollPane functionTypeScrollPane = new UIScrollPane(functionTypeList);
functionTypeScrollPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC)); functionTypeScrollPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC));
functionTypeScrollPane.setPreferredSize(new Dimension(140, 200)); functionTypeScrollPane.setPreferredSize(new Dimension(140, 200));
@ -573,22 +580,22 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
initTypeListSelectionListener(); initTypeListSelectionListener();
} }
private void initTypeListCellRenderer(){ private void initTypeListCellRenderer() {
functionTypeList.setCellRenderer( functionTypeList.setCellRenderer(
new DefaultListCellRenderer() { new DefaultListCellRenderer() {
@Override @Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (value instanceof FunctionGroup) { if (value instanceof FunctionGroup) {
this.setText(((FunctionGroup) value).getGroupName()); this.setText(((FunctionGroup) value).getGroupName());
} }
return this; return this;
} }
}); });
} }
private void initTypeListSelectionListener(){ private void initTypeListSelectionListener() {
functionTypeList.addListSelectionListener(new ListSelectionListener() { functionTypeList.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent evt) { public void valueChanged(ListSelectionEvent evt) {
Object selectedValue = ((JList) evt.getSource()).getSelectedValue(); Object selectedValue = ((JList) evt.getSource()).getSelectedValue();
if (!(selectedValue instanceof FunctionGroup)) { if (!(selectedValue instanceof FunctionGroup)) {
@ -608,21 +615,21 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
}); });
} }
private void initGroupTypeModel(){ private void initGroupTypeModel() {
functionTypeListModel.addElement(FunctionConstants.COMMON); functionTypeListModel.addElement(FunctionConstants.COMMON);
for (int i = 0; i < FunctionConstants.EMBFUNCTIONS.length; i++) { for (int i = 0; i < FunctionConstants.EMBFUNCTIONS.length; i++) {
functionTypeListModel.addElement(FunctionConstants.EMBFUNCTIONS[i]); functionTypeListModel.addElement(FunctionConstants.EMBFUNCTIONS[i]);
} }
functionTypeListModel.addElement(FunctionConstants.ALL); functionTypeListModel.addElement(FunctionConstants.ALL);
functionTypeListModel.addElement(FunctionConstants.CUSTOM); functionTypeListModel.addElement(FunctionConstants.CUSTOM);
functionTypeListModel.addElement(FunctionConstants.PLUGIN); functionTypeListModel.addElement(FunctionConstants.PLUGIN);
//hugh: 从函数分组插件中添加分组 //hugh: 从函数分组插件中添加分组
FunctionConstants.addFunctionGroupFromPlugins(functionTypeListModel); FunctionConstants.addFunctionGroupFromPlugins(functionTypeListModel);
} }
private void initFunctionNameListCellRenderer(){ private void initFunctionNameListCellRenderer() {
functionNameList.setCellRenderer(new DefaultListCellRenderer() { functionNameList.setCellRenderer(new DefaultListCellRenderer() {
@Override @Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
@ -635,8 +642,8 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
}); });
} }
private void initFunctionNameListSelectionListener(){ private void initFunctionNameListSelectionListener() {
functionNameList.addListSelectionListener(new ListSelectionListener() { functionNameList.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent evt) { public void valueChanged(ListSelectionEvent evt) {
Object selectedValue = functionNameList.getSelectedValue(); Object selectedValue = functionNameList.getSelectedValue();
@ -652,8 +659,8 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
}); });
} }
private void initFunctionNameListMouseListener(){ private void initFunctionNameListMouseListener() {
functionNameList.addMouseListener(new MouseAdapter() { functionNameList.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent evt) { public void mouseClicked(MouseEvent evt) {
if (evt.getClickCount() >= 2) { if (evt.getClickCount() >= 2) {
Object selectedValue = functionNameList.getSelectedValue(); Object selectedValue = functionNameList.getSelectedValue();
@ -676,8 +683,8 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
}); });
} }
private void initFunctionNameList(JPanel functionPane){ private void initFunctionNameList(JPanel functionPane) {
functionNameList = new JList(new DefaultListModel()); functionNameList = new JList(new DefaultListModel());
UIScrollPane functionNameScrollPane = new UIScrollPane(functionNameList); UIScrollPane functionNameScrollPane = new UIScrollPane(functionNameList);
functionNameScrollPane.setPreferredSize(new Dimension(140, 200)); functionNameScrollPane.setPreferredSize(new Dimension(140, 200));
functionPane.add( functionPane.add(
@ -689,8 +696,8 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
initFunctionNameListMouseListener(); initFunctionNameListMouseListener();
} }
private void initDescriptionTextArea(){ private void initDescriptionTextArea() {
// Description // Description
descriptionTextArea = new UITextArea(16, 27); descriptionTextArea = new UITextArea(16, 27);
UIScrollPane desScrollPane = new UIScrollPane(descriptionTextArea); UIScrollPane desScrollPane = new UIScrollPane(descriptionTextArea);
@ -711,15 +718,15 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
} }
private StringBuilder getText(TextUserObject selectedValue,String path) throws IOException{ private StringBuilder getText(TextUserObject selectedValue, String path) throws IOException {
Reader desReader; Reader desReader;
StringBuilder desBuf = new StringBuilder(); StringBuilder desBuf = new StringBuilder();
InputStream desInputStream = BaseUtils.readResource(path+ ((TextUserObject) selectedValue).displayText+".txt"); InputStream desInputStream = BaseUtils.readResource(path + ((TextUserObject) selectedValue).displayText + ".txt");
if (desInputStream == null) { if (desInputStream == null) {
String description = ""; String description = "";
desReader = new StringReader(description); desReader = new StringReader(description);
} else { } else {
desReader = new InputStreamReader(desInputStream); desReader = new InputStreamReader(desInputStream, EncodeConstants.ENCODING_UTF_8);
} }
BufferedReader reader = new BufferedReader(desReader); BufferedReader reader = new BufferedReader(desReader);
String lineText; String lineText;
@ -732,12 +739,12 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
reader.close(); reader.close();
desReader.close(); desReader.close();
return desBuf; return desBuf;
} }
private void initVariablesTreeSelectionListener(){ private void initVariablesTreeSelectionListener() {
variablesTree.addTreeSelectionListener(new TreeSelectionListener() { variablesTree.addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent e) { public void valueChanged(TreeSelectionEvent e) {
Object selectedValue = ((DefaultMutableTreeNode) variablesTree.getLastSelectedPathComponent()).getUserObject(); Object selectedValue = ((DefaultMutableTreeNode) variablesTree.getLastSelectedPathComponent()).getUserObject();
if (selectedValue == null) { if (selectedValue == null) {
return; return;
} }
@ -751,7 +758,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
path = "/com/fr/design/insert/formula/variable/en/"; path = "/com/fr/design/insert/formula/variable/en/";
} }
if (selectedValue instanceof TextUserObject) { if (selectedValue instanceof TextUserObject) {
desBuf = getText((TextUserObject)selectedValue,path); desBuf = getText((TextUserObject) selectedValue, path);
} }
} catch (IOException exp) { } catch (IOException exp) {
FRContext.getLogger().error(exp.getMessage(), exp); FRContext.getLogger().error(exp.getMessage(), exp);
@ -762,8 +769,8 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
}); });
} }
private void initVariablesTree(){ private void initVariablesTree() {
// vairable. // vairable.
variablesTree = new JTree(); variablesTree = new JTree();
UIScrollPane variablesTreePane = new UIScrollPane(variablesTree); UIScrollPane variablesTreePane = new UIScrollPane(variablesTree);
variablesTreePane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC)); variablesTreePane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC));
@ -810,10 +817,10 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
private void showPopupPane() { private void showPopupPane() {
BasicPane basicPane = new BasicPane() { BasicPane basicPane = new BasicPane() {
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return Inter.getLocText("FR-Designer_FormulaPane_Function_Detail"); return Inter.getLocText("FR-Designer_FormulaPane_Function_Detail");
} }
}; };
basicPane.setLayout(FRGUIPaneFactory.createBorderLayout()); basicPane.setLayout(FRGUIPaneFactory.createBorderLayout());
UITextArea desArea = new UITextArea(); UITextArea desArea = new UITextArea();
@ -904,21 +911,21 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
} }
rootNode.add(new TextFolderUserObject(Inter.getLocText("FormulaD-Data_Fields"), rootNode.add(new TextFolderUserObject(Inter.getLocText("FormulaD-Data_Fields"),
BaseUtils.readIcon("/com/fr/design/images/dialog/table.png"), BaseUtils.readIcon("/com/fr/design/images/dialog/table.png"),
variableResolver.resolveColumnNames()).createMutableTreeNode()); variableResolver.resolveColumnNames()).createMutableTreeNode());
// Set cutReport Variable // Set cutReport Variable
rootNode.add(new TextFolderUserObject(Inter.getLocText("FR-Designer_FormulaPane_Variables"), rootNode.add(new TextFolderUserObject(Inter.getLocText("FR-Designer_FormulaPane_Variables"),
BaseUtils.readIcon("/com/fr/design/images/dialog/variable.png"), BaseUtils.readIcon("/com/fr/design/images/dialog/variable.png"),
variableResolver.resolveCurReportVariables()).createMutableTreeNode()); variableResolver.resolveCurReportVariables()).createMutableTreeNode());
rootNode.add(new TextFolderUserObject(Inter.getLocText(new String[]{"Datasource-Datasource", "Parameter"}), rootNode.add(new TextFolderUserObject(Inter.getLocText(new String[]{"Datasource-Datasource", "Parameter"}),
BaseUtils.readIcon("/com/fr/design/images/dialog/parameter.gif"), BaseUtils.readIcon("/com/fr/design/images/dialog/parameter.gif"),
variableResolver.resolveTableDataParameterVariables()).createMutableTreeNode()); variableResolver.resolveTableDataParameterVariables()).createMutableTreeNode());
rootNode.add(new TextFolderUserObject(Inter.getLocText("ParameterD-Report_Parameter"), rootNode.add(new TextFolderUserObject(Inter.getLocText("ParameterD-Report_Parameter"),
BaseUtils.readIcon("/com/fr/design/images/m_report/p.gif"), BaseUtils.readIcon("/com/fr/design/images/m_report/p.gif"),
variableResolver.resolveReportParameterVariables()).createMutableTreeNode()); variableResolver.resolveReportParameterVariables()).createMutableTreeNode());
rootNode.add(new TextFolderUserObject(Inter.getLocText("M_Server-Global_Parameters"), rootNode.add(new TextFolderUserObject(Inter.getLocText("M_Server-Global_Parameters"),
BaseUtils.readIcon("/com/fr/design/images/dialog/parameter.gif"), BaseUtils.readIcon("/com/fr/design/images/dialog/parameter.gif"),

2
designer_base/src/com/fr/design/insert/formula/variable/cn/$$$.txt

@ -1 +1 @@
΅±Η°Φ΅ 当前值

2
designer_base/src/com/fr/design/insert/formula/variable/cn/$$page_number.txt

@ -1 +1 @@
当前的页数。 当前的页数。

2
designer_base/src/com/fr/design/insert/formula/variable/cn/$$totalPage_number.txt

@ -1 +1 @@
总页数。 总页数。

2
designer_base/src/com/fr/design/insert/formula/variable/cn/$fr_authority.txt

@ -1 +1 @@
使用权限时保存角色的参数 使用权限时保存角色的参数

2
designer_base/src/com/fr/design/insert/formula/variable/cn/$fr_username.txt

@ -1 +1 @@
使用权限时保存用户名的参数 使用权限时保存用户名的参数

4
designer_base/src/com/fr/design/insert/formula/variable/cn/$fr_userposition.txt

@ -1,3 +1 @@
使用权限时,$fr_userposition就是部门角色, 使用权限时,$fr_userposition就是部门角色,格式如:{"jobTitle":"销售经理","departments":"销售"},部门角色是以部门和职务组成的数组。
格式如:{"departments":"销售","jobTitle":"销售经理"},
部门角色是以部门和职务组成的数组。

2
designer_base/src/com/fr/design/insert/formula/variable/cn/NOFILTER.txt

@ -1 +1 @@
NOFILTER是一个与任意值比较都为true的参数。 NOFILTER是一个与任意值比较都为true的参数。

2
designer_base/src/com/fr/design/insert/formula/variable/cn/NULL.txt

@ -1 +1 @@
空值的参数。 空值的参数。

4
designer_base/src/com/fr/design/insert/formula/variable/cn/contextPath.txt

@ -1,3 +1 @@
contextPath是指绝对路径的服务器别名,即虚拟目录. contextPath是指绝对路径的服务器别名,即虚拟目录.假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,contextPath是/WebReport
假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,
contextPath是/WebReport

2
designer_base/src/com/fr/design/insert/formula/variable/cn/curReport.txt

@ -1 +1 @@
当前报表。 当前报表。

4
designer_base/src/com/fr/design/insert/formula/variable/cn/formletName.txt

@ -1,3 +1 @@
表单名字 表单名字假如访问:http://localhost:8080/WebReport/ReportServer?formlet=Form1.frm,formName就是Form1.frm
假如访问:http://localhost:8080/WebReport/ReportServer?formlet=Form1.frm,
formName就是Form1.frm

2
designer_base/src/com/fr/design/insert/formula/variable/cn/fr_submitinfo.txt

@ -1 +1 @@
提交入库事件的返回信息。 fr_submitinfo.success记录成功与否 fr_submitinfo.failinfo简单记录出错信息 提交入库事件的返回信息。fr_submitinfo.success记录成功与否fr_submitinfo.failinfo简单记录出错信息

4
designer_base/src/com/fr/design/insert/formula/variable/cn/reportName.txt

@ -1,3 +1 @@
报表名字 报表名字假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,reportName就是WorkBook1.cpt
假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,
reportName就是WorkBook1.cpt

4
designer_base/src/com/fr/design/insert/formula/variable/cn/serverName.txt

@ -1,3 +1 @@
serverName,是指服务器地址或名称. serverName,是指服务器地址或名称.假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,serverName指的是:localhost,即访问机子的IP
假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,
serverName指的是:localhost,即访问机子的IP

2
designer_base/src/com/fr/design/insert/formula/variable/cn/serverPort.txt

@ -1 +1 @@
serverPort指的是访问的端口 serverPort指的是访问的端口

4
designer_base/src/com/fr/design/insert/formula/variable/cn/serverSchema.txt

@ -1,3 +1 @@
serverSchema,是指协议名称. serverSchema,是指协议名称.假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,serverSchema指的是:http
假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,
serverSchema指的是:http

4
designer_base/src/com/fr/design/insert/formula/variable/cn/serverURL.txt

@ -1,3 +1 @@
serverURL是指访问服务的URL serverURL是指访问服务的URL假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,serverURL就是http://localhost:8080
假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,
serverURL就是http://localhost:8080

3
designer_base/src/com/fr/design/insert/formula/variable/cn/servletURL.txt

@ -1,2 +1 @@
假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt, 假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,servletURL指的是:/WebReport/ReportServer
servletURL指的是:/WebReport/ReportServer

5
designer_base/src/com/fr/design/insert/formula/variable/cn/sessionID.txt

@ -1,4 +1 @@
SessionID属性是返回用户会话的标识。 SessionID属性是返回用户会话的标识。在创建会话时,服务器会为每一个会话生成一个单独的标识,会话标识以长整形数据类型返回。SessionID等于本次会话ID的记录,SessionID 多数情况是用于WEB页面的统计。
在创建会话时,服务器会为每一个会话生成一个单独的标识,
会话标识以长整形数据类型返回。SessionID等于本次会话ID的记录,
SessionID 多数情况是用于WEB页面的统计。

2
designer_base/src/com/fr/design/insert/formula/variable/en/contextPath.txt

@ -1 +1 @@
absolute path of the server http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt£¬ contextPath is /WebReport absolute path of the serverhttp://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cptcontextPath is /WebReport

4
designer_base/src/com/fr/design/insert/formula/variable/en/formletName.txt

@ -1,3 +1 @@
form name form namehttp://localhost:8080/WebReport/ReportServer?formlet=Form1.frm,formName is Form1.frm
http://localhost:8080/WebReport/ReportServer?formlet=Form1.frm£¬
formName is Form1.frm

2
designer_base/src/com/fr/design/insert/formula/variable/en/fr_submitinfo.txt

@ -1 +1 @@
callback status of form submit contains fr_submitinfo.success and fr_submitinfo.failinfo callback status of form submitcontains fr_submitinfo.success and fr_submitinfo.failinfo

4
designer_base/src/com/fr/design/insert/formula/variable/en/reportName.txt

@ -1,3 +1 @@
report name report namehttp://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,reportName is WorkBook1.cpt
http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt£¬
reportName is WorkBook1.cpt

4
designer_base/src/com/fr/design/insert/formula/variable/en/serverName.txt

@ -1,3 +1 @@
address or name of the server address or name of the serverhttp://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,serverName means localhost
http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt£¬
serverName means localhost

4
designer_base/src/com/fr/design/insert/formula/variable/en/serverSchema.txt

@ -1,3 +1 @@
serverSchema serverSchemahttp://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,serverSchema is http
http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt£¬
serverSchema is http

4
designer_base/src/com/fr/design/insert/formula/variable/en/serverURL.txt

@ -1,3 +1 @@
URL of the server URL of the serverhttp://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,serverURL is http://localhost:8080
http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt£¬
serverURL is http://localhost:8080

3
designer_base/src/com/fr/design/insert/formula/variable/en/servletURL.txt

@ -1,2 +1 @@
http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt£¬ http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,servletURL is /WebReport/ReportServer
servletURL is /WebReport/ReportServer

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

@ -91,6 +91,7 @@ FR-Designer_DS-Dictionary=
FR-Designer_Data-confusion= FR-Designer_Data-confusion=
FR-Designer_Data_Type= FR-Designer_Data_Type=
FR-Designer_Double_Click_Edit_OR_Clear= FR-Designer_Double_Click_Edit_OR_Clear=
FR-Designer_Edit_Button_ToolBar=
FR-Designer_Email= FR-Designer_Email=
FR-Designer_Enabled= FR-Designer_Enabled=
FR-Designer_End-Date= FR-Designer_End-Date=
@ -161,6 +162,7 @@ FR-Designer_Refresh_Parameter_In_SQL=
FR-Designer_Reg_Expressions= FR-Designer_Reg_Expressions=
FR-Designer_Reg_Max_Length= FR-Designer_Reg_Max_Length=
FR-Designer_Reg_Min_Length= FR-Designer_Reg_Min_Length=
FR-Designer_Remove_Button_ToolBar=
FR-Designer_ReportColumns-Columns= FR-Designer_ReportColumns-Columns=
FR-Designer_Return-Date= FR-Designer_Return-Date=
FR-Designer_RichText= FR-Designer_RichText=
@ -568,3 +570,18 @@ FR-Designer_Plugin_Should_Update_Please_Contact_Developer=Plugin version is too
FR-Designer_WidgetOrder=Widget Order FR-Designer_WidgetOrder=Widget Order
FR-Designer_Mobile_Form_Analysis_Annotation=annotation\: You can use this attribute to control the analysis of the form in the APP. FR-Designer_Mobile_Form_Analysis_Annotation=annotation\: You can use this attribute to control the analysis of the form in the APP.
FR-Designer_Mobile_Report_Analysis_Annotation=annotation\: You can use this attribute to control the analysis of the report in the APP, only to support the paging preview, fill in the preview of the property is invalid. FR-Designer_Mobile_Report_Analysis_Annotation=annotation\: You can use this attribute to control the analysis of the report in the APP, only to support the paging preview, fill in the preview of the property is invalid.
FR-Designer_Background_Null=
FR-Designer_Background_Color=
FR-Designer_Background_Texture=
FR-Designer_Background_Pattern=
FR-Designer_Background_Gradient_Color=
FR-Designer_Background_Image=
FR-Designer_Background_Clear=
FR-Designer_Background_Image_Select=
FR-Designer_Initial_Background_Tips=
FR-Designer_Mouse_Move_Tips=
FR-Designer_Mouse_Click_Tips=
FR-Designer-Move_Tab_First=move to first
FR-Designer-Move_Tab_End=move to end
FR-Designer-Move_Tab_Next=move to next
FR-Designer-Move_Tab_Prev=move to previous

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

@ -91,6 +91,7 @@ FR-Designer_DS-Dictionary=Data Dictionary
FR-Designer_Data-confusion=Data Confusion FR-Designer_Data-confusion=Data Confusion
FR-Designer_Data_Type=Data type FR-Designer_Data_Type=Data type
FR-Designer_Double_Click_Edit_OR_Clear=Double Click to Edit or Clear FR-Designer_Double_Click_Edit_OR_Clear=Double Click to Edit or Clear
FR-Designer_Edit_Button_ToolBar=Edit Button ToolBar
FR-Designer_Email=Mail FR-Designer_Email=Mail
FR-Designer_Enabled=Enabled FR-Designer_Enabled=Enabled
FR-Designer_End-Date=End Date FR-Designer_End-Date=End Date
@ -163,6 +164,7 @@ FR-Designer_Refresh_Parameter_In_SQL=Whether to refresh parameters in the SQL
FR-Designer_Reg_Expressions=Regular expressions FR-Designer_Reg_Expressions=Regular expressions
FR-Designer_Reg_Max_Length=max length FR-Designer_Reg_Max_Length=max length
FR-Designer_Reg_Min_Length=min length FR-Designer_Reg_Min_Length=min length
FR-Designer_Remove_Button_ToolBar=Remove Button ToolBar
FR-Designer_ReportColumns-Columns=Multi-columns/lines FR-Designer_ReportColumns-Columns=Multi-columns/lines
FR-Designer_Return-Date=Return Date FR-Designer_Return-Date=Return Date
FR-Designer_RichText=Insert Rich Text FR-Designer_RichText=Insert Rich Text
@ -569,3 +571,18 @@ FR-Designer_Plugin_Should_Update_Please_Contact_Developer=Plugin version is too
FR-Designer_WidgetOrder=Widget Order FR-Designer_WidgetOrder=Widget Order
FR-Designer_Mobile_Form_Analysis_Annotation=annotation\: You can use this attribute to control the analysis of the form in the APP. FR-Designer_Mobile_Form_Analysis_Annotation=annotation\: You can use this attribute to control the analysis of the form in the APP.
FR-Designer_Mobile_Report_Analysis_Annotation=annotation\: You can use this attribute to control the analysis of the report in the APP, only to support the paging preview, fill in the preview of the property is invalid. FR-Designer_Mobile_Report_Analysis_Annotation=annotation\: You can use this attribute to control the analysis of the report in the APP, only to support the paging preview, fill in the preview of the property is invalid.
FR-Designer_Background_Null=No Background
FR-Designer_Background_Color=Color
FR-Designer_Background_Texture=Texture
FR-Designer_Background_Pattern=Pattern
FR-Designer_Background_Gradient_Color=Gradient Color
FR-Designer_Background_Image=Image
FR-Designer_Background_Clear=Clear
FR-Designer_Background_Image_Select=Select Picture
FR-Designer_Initial_Background_Tips=Initial background of the button
FR-Designer_Mouse_Move_Tips=Move the mouse to the button on the background, in the absence of not changing the background
FR-Designer_Mouse_Click_Tips=The background of the mouse to click the button, in the absence of not changing the background
FR-Designer-Move_Tab_First=move to first
FR-Designer-Move_Tab_End=move to end
FR-Designer-Move_Tab_Next=move to next
FR-Designer-Move_Tab_Prev=move to previous

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

@ -91,6 +91,7 @@ FR-Designer_DS-Dictionary=\u30C7\u30FC\u30BF\u5B57\u5178
FR-Designer_Data-confusion=\u30C7\u30FC\u30BF\u6DF7\u4EA4 FR-Designer_Data-confusion=\u30C7\u30FC\u30BF\u6DF7\u4EA4
FR-Designer_Data_Type=\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7 FR-Designer_Data_Type=\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7
FR-Designer_Double_Click_Edit_OR_Clear=\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7DE8\u96C6\u307E\u305F\u306F\u30AF\u30EA\u30A2\u3059\u308B FR-Designer_Double_Click_Edit_OR_Clear=\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7DE8\u96C6\u307E\u305F\u306F\u30AF\u30EA\u30A2\u3059\u308B
FR-Designer_Edit_Button_ToolBar=\u30DC\u30BF\u30F3\u306B\u3042\u308B\u30C4\u30FC\u30EB\u6B04\u7DE8\u96C6
FR-Designer_Email=\u30E1\u30FC\u30EB FR-Designer_Email=\u30E1\u30FC\u30EB
FR-Designer_Enabled=\u4F7F\u7528\u53EF\u80FD FR-Designer_Enabled=\u4F7F\u7528\u53EF\u80FD
FR-Designer_End-Date=\u7D42\u4E86\u65E5\u671F FR-Designer_End-Date=\u7D42\u4E86\u65E5\u671F
@ -162,6 +163,7 @@ FR-Designer_Refresh_Parameter_In_SQL=SQL\u4E2D\u306E\u30D1\u30E9\u30E1\u30FC\u30
FR-Designer_Reg_Expressions=\u6B63\u5247\u8868\u73FE\u5F0F FR-Designer_Reg_Expressions=\u6B63\u5247\u8868\u73FE\u5F0F
FR-Designer_Reg_Max_Length=\u6700\u5927\u9577\u3055 FR-Designer_Reg_Max_Length=\u6700\u5927\u9577\u3055
FR-Designer_Reg_Min_Length=\u6700\u5C0F\u9577\u3055 FR-Designer_Reg_Min_Length=\u6700\u5C0F\u9577\u3055
FR-Designer_Remove_Button_ToolBar=\u30DC\u30BF\u30F3\u304C\u3042\u308B\u30C4\u30FC\u30EB\u30D0\u30FC\u3092\u30EA\u30E0\u30FC\u30D6
FR-Designer_ReportColumns-Columns=\u6BB5\u7D44\u307F FR-Designer_ReportColumns-Columns=\u6BB5\u7D44\u307F
FR-Designer_Return-Date=\u65E5\u671F\u306B\u623B\u308B FR-Designer_Return-Date=\u65E5\u671F\u306B\u623B\u308B
FR-Designer_RichText=\u30EA\u30C3\u30C1\u6587\u66F8\u633F\u5165 FR-Designer_RichText=\u30EA\u30C3\u30C1\u6587\u66F8\u633F\u5165
@ -539,3 +541,18 @@ FR-Designer_No=\u3044\u3044\u3048
FR-Designer_Pagination=\u30DA\u30FC\u30B8\u30F3\u30B0 FR-Designer_Pagination=\u30DA\u30FC\u30B8\u30F3\u30B0
FR-Designer_DS_TableData=\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9 FR-Designer_DS_TableData=\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9
FR-Designer_Parameter-Formula=\u6570\u5F0F FR-Designer_Parameter-Formula=\u6570\u5F0F
FR-Designer_Background_Null=
FR-Designer_Background_Color=
FR-Designer_Background_Texture=
FR-Designer_Background_Pattern=
FR-Designer_Background_Gradient_Color=
FR-Designer_Background_Image=
FR-Designer_Background_Clear=
FR-Designer_Background_Image_Select=
FR-Designer_Initial_Background_Tips=
FR-Designer_Mouse_Move_Tips=
FR-Designer_Mouse_Click_Tips=
FR-Designer-Move_Tab_First=
FR-Designer-Move_Tab_End=
FR-Designer-Move_Tab_Next=
FR-Designer-Move_Tab_Prev=

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

@ -91,6 +91,7 @@ FR-Designer_DS-Dictionary=\uB370\uC774\uD130\uC0AC\uC804
FR-Designer_Data-confusion=\uB370\uC774\uD130\uD63C\uD569 FR-Designer_Data-confusion=\uB370\uC774\uD130\uD63C\uD569
FR-Designer_Data_Type=\uB370\uC774\uD130\uC720\uD615 FR-Designer_Data_Type=\uB370\uC774\uD130\uC720\uD615
FR-Designer_Double_Click_Edit_OR_Clear=\uB354\uBE14\uD074\uB9AD\uD558\uC5EC\uD3B8\uC9D1\uB610\uB294\uD074\uB9AC\uC5B4\uC2E4\uD589 FR-Designer_Double_Click_Edit_OR_Clear=\uB354\uBE14\uD074\uB9AD\uD558\uC5EC\uD3B8\uC9D1\uB610\uB294\uD074\uB9AC\uC5B4\uC2E4\uD589
FR-Designer_Edit_Button_ToolBar=\uD0A4\uAC00\uC788\uB294\uD234\uBC14\uD3B8\uC9D1
FR-Designer_Email=\uBA54\uC77C FR-Designer_Email=\uBA54\uC77C
FR-Designer_Enabled=\uC0AC\uC6A9\uAC00\uB2A5 FR-Designer_Enabled=\uC0AC\uC6A9\uAC00\uB2A5
FR-Designer_End-Date=\uC885\uB8CC\uB0A0\uC9DC FR-Designer_End-Date=\uC885\uB8CC\uB0A0\uC9DC
@ -162,6 +163,7 @@ FR-Designer_Refresh_Parameter_In_SQL=SQL\uC758\uB9E4\uAC1C\uBCC0\uC218\uB97C\uC0
FR-Designer_Reg_Expressions=\uC815\uADDC\uD45C\uD604\uC2DD FR-Designer_Reg_Expressions=\uC815\uADDC\uD45C\uD604\uC2DD
FR-Designer_Reg_Max_Length=\uCD5C\uB300\uAE38\uC774 FR-Designer_Reg_Max_Length=\uCD5C\uB300\uAE38\uC774
FR-Designer_Reg_Min_Length=\uCD5C\uC18C\uAE38\uC774 FR-Designer_Reg_Min_Length=\uCD5C\uC18C\uAE38\uC774
FR-Designer_Remove_Button_ToolBar=\uD0A4\uAC00\uC788\uB294\uD234\uBC14\uC81C\uAC70
FR-Designer_ReportColumns-Columns=\uC140\uB098\uB204\uAE30 FR-Designer_ReportColumns-Columns=\uC140\uB098\uB204\uAE30
FR-Designer_Return-Date=\uB0A0\uC9DC\uB3CC\uC544\uAC00\uAE30 FR-Designer_Return-Date=\uB0A0\uC9DC\uB3CC\uC544\uAC00\uAE30
FR-Designer_RichText=\uB9AC\uCE58\uD14D\uC2A4\uD2B8\uBC15\uC2A4\uC0BD\uC785 FR-Designer_RichText=\uB9AC\uCE58\uD14D\uC2A4\uD2B8\uBC15\uC2A4\uC0BD\uC785
@ -536,3 +538,18 @@ FR-Designer_No=\uC544\uB2C8\uC624
FR-Designer_Pagination=\uD398\uC774\uC9C0\uB098\uB204\uAE30 FR-Designer_Pagination=\uD398\uC774\uC9C0\uB098\uB204\uAE30
FR-Designer_DS_TableData=\uB370\uC774\uD130\uC138\uD2B8 FR-Designer_DS_TableData=\uB370\uC774\uD130\uC138\uD2B8
FR-Designer_Parameter-Formula=\uC218\uC2DD FR-Designer_Parameter-Formula=\uC218\uC2DD
FR-Designer_Background_Null=
FR-Designer_Background_Color=
FR-Designer_Background_Texture=
FR-Designer_Background_Pattern=
FR-Designer_Background_Gradient_Color=
FR-Designer_Background_Image=
FR-Designer_Background_Clear=
FR-Designer_Background_Image_Select=
FR-Designer_Initial_Background_Tips=
FR-Designer_Mouse_Move_Tips=
FR-Designer_Mouse_Click_Tips=
FR-Designer-Move_Tab_First=
FR-Designer-Move_Tab_End=
FR-Designer-Move_Tab_Next=
FR-Designer-Move_Tab_Prev=

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

@ -91,6 +91,7 @@ FR-Designer_DS-Dictionary=\u6570\u636E\u5B57\u5178
FR-Designer_Data-confusion=\u6570\u636E\u6DF7\u6DC6 FR-Designer_Data-confusion=\u6570\u636E\u6DF7\u6DC6
FR-Designer_Data_Type=\u6570\u636E\u7C7B\u578B FR-Designer_Data_Type=\u6570\u636E\u7C7B\u578B
FR-Designer_Double_Click_Edit_OR_Clear=\u53CC\u51FB\u8FDB\u884C\u7F16\u8F91\u6216\u6E05\u9664 FR-Designer_Double_Click_Edit_OR_Clear=\u53CC\u51FB\u8FDB\u884C\u7F16\u8F91\u6216\u6E05\u9664
FR-Designer_Edit_Button_ToolBar=\u7F16\u8F91\u6309\u94AE\u6240\u5728\u5DE5\u5177\u680F
FR-Designer_Email=\u90AE\u4EF6 FR-Designer_Email=\u90AE\u4EF6
FR-Designer_Enabled=\u53EF\u7528 FR-Designer_Enabled=\u53EF\u7528
FR-Designer_End-Date=\u7ED3\u675F\u65E5\u671F FR-Designer_End-Date=\u7ED3\u675F\u65E5\u671F
@ -163,6 +164,7 @@ FR-Designer_Refresh_Parameter_In_SQL=\u662F\u5426\u5237\u65B0SQL\u4E2D\u7684\u53
FR-Designer_Reg_Expressions=\u6B63\u5219\u8868\u8FBE\u5F0F FR-Designer_Reg_Expressions=\u6B63\u5219\u8868\u8FBE\u5F0F
FR-Designer_Reg_Max_Length=\u6700\u5927\u957F\u5EA6 FR-Designer_Reg_Max_Length=\u6700\u5927\u957F\u5EA6
FR-Designer_Reg_Min_Length=\u6700\u5C0F\u957F\u5EA6 FR-Designer_Reg_Min_Length=\u6700\u5C0F\u957F\u5EA6
FR-Designer_Remove_Button_ToolBar=\u79FB\u9664\u6309\u94AE\u6240\u5728\u5DE5\u5177\u680F
FR-Designer_ReportColumns-Columns=\u5206\u680F FR-Designer_ReportColumns-Columns=\u5206\u680F
FR-Designer_Return-Date=\u8FD4\u56DE\u65E5\u671F FR-Designer_Return-Date=\u8FD4\u56DE\u65E5\u671F
FR-Designer_RichText=\u63D2\u5165\u5BCC\u6587\u672C FR-Designer_RichText=\u63D2\u5165\u5BCC\u6587\u672C
@ -573,3 +575,18 @@ FR-Designer_Plugin_Should_Update_Please_Contact_Developer=\u63D2\u4EF6\u7248\u67
FR-Designer_WidgetOrder=\u63A7\u4EF6\u987A\u5E8F FR-Designer_WidgetOrder=\u63A7\u4EF6\u987A\u5E8F
FR-Designer_Mobile_Form_Analysis_Annotation=\u6CE8\u91CA\uFF1A\u53EF\u4EE5\u901A\u8FC7\u8BE5\u5C5E\u6027\u63A7\u5236\u8868\u5355\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\u3002 FR-Designer_Mobile_Form_Analysis_Annotation=\u6CE8\u91CA\uFF1A\u53EF\u4EE5\u901A\u8FC7\u8BE5\u5C5E\u6027\u63A7\u5236\u8868\u5355\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\u3002
FR-Designer_Mobile_Report_Analysis_Annotation=\u6CE8\u91CA\: \u53EF\u4EE5\u901A\u8FC7\u8BE5\u5C5E\u6027\u63A7\u5236\u62A5\u8868\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\uFF0C\u53EA\u652F\u6301\u5206\u9875\u9884\u89C8\uFF0C\u586B\u62A5\u9884\u89C8\u65F6\u5C5E\u6027\u65E0\u6548\u3002 FR-Designer_Mobile_Report_Analysis_Annotation=\u6CE8\u91CA\: \u53EF\u4EE5\u901A\u8FC7\u8BE5\u5C5E\u6027\u63A7\u5236\u62A5\u8868\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\uFF0C\u53EA\u652F\u6301\u5206\u9875\u9884\u89C8\uFF0C\u586B\u62A5\u9884\u89C8\u65F6\u5C5E\u6027\u65E0\u6548\u3002
FR-Designer_Background_Null=\u6CA1\u6709\u80CC\u666F
FR-Designer_Background_Color=\u989C\u8272
FR-Designer_Background_Texture=\u7EB9\u7406
FR-Designer_Background_Pattern=\u56FE\u6848
FR-Designer_Background_Gradient_Color=\u6E10\u53D8\u8272
FR-Designer_Background_Image=\u56FE\u7247
FR-Designer_Background_Clear=\u6E05\u9664
FR-Designer_Background_Image_Select=\u9009\u62E9\u56FE\u7247
FR-Designer_Initial_Background_Tips=\u6309\u94AE\u7684\u521D\u59CB\u80CC\u666F
FR-Designer_Mouse_Move_Tips=\u9F20\u6807\u79FB\u52A8\u5230\u6309\u94AE\u4E0A\u7684\u80CC\u666F\uFF0C\u82E5\u65E0\u5219\u4E0D\u6539\u53D8\u80CC\u666F
FR-Designer_Mouse_Click_Tips=\u9F20\u6807\u70B9\u51FB\u6309\u94AE\u65F6\u80CC\u666F\uFF0C\u82E5\u65E0\u5219\u4E0D\u6539\u53D8\u80CC\u666F
FR-Designer-Move_Tab_First=\u79FB\u52A8\u5230\u9996\u4F4D
FR-Designer-Move_Tab_End=\u79FB\u52A8\u5230\u672B\u5C3E
FR-Designer-Move_Tab_Next=\u5F80\u540E\u79FB\u52A8
FR-Designer-Move_Tab_Prev=\u5F80\u524D\u79FB\u52A8

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

@ -91,6 +91,7 @@ FR-Designer_DS-Dictionary=\u8CC7\u6599\u5B57\u5178
FR-Designer_Data-confusion=\u8CC7\u6599\u6DF7\u6DC6 FR-Designer_Data-confusion=\u8CC7\u6599\u6DF7\u6DC6
FR-Designer_Data_Type=\u8CC7\u6599\u985E\u578B FR-Designer_Data_Type=\u8CC7\u6599\u985E\u578B
FR-Designer_Double_Click_Edit_OR_Clear=\u96D9\u64CA\u9032\u884C\u7DE8\u8F2F\u6216\u6E05\u9664 FR-Designer_Double_Click_Edit_OR_Clear=\u96D9\u64CA\u9032\u884C\u7DE8\u8F2F\u6216\u6E05\u9664
FR-Designer_Edit_Button_ToolBar=\u7DE8\u8F2F\u6309\u9215\u6240\u5728\u5DE5\u5177\u6B04
FR-Designer_Email=\u90F5\u4EF6 FR-Designer_Email=\u90F5\u4EF6
FR-Designer_Enabled=\u53EF\u7528 FR-Designer_Enabled=\u53EF\u7528
FR-Designer_End-Date=\u7D50\u675F\u65E5\u671F FR-Designer_End-Date=\u7D50\u675F\u65E5\u671F
@ -162,6 +163,7 @@ FR-Designer_Refresh_Parameter_In_SQL=\u5728SQL\u4E2D\u91CD\u65B0\u6574\u7406\u76
FR-Designer_Reg_Expressions=\u6B63\u5247\u8868\u9054\u5F0F FR-Designer_Reg_Expressions=\u6B63\u5247\u8868\u9054\u5F0F
FR-Designer_Reg_Max_Length=\u6700\u5927\u9577\u5EA6 FR-Designer_Reg_Max_Length=\u6700\u5927\u9577\u5EA6
FR-Designer_Reg_Min_Length=\u6700\u5C0F\u9577\u5EA6 FR-Designer_Reg_Min_Length=\u6700\u5C0F\u9577\u5EA6
FR-Designer_Remove_Button_ToolBar=\u79FB\u9664\u6309\u9215\u6240\u5728\u5DE5\u5177\u6B04
FR-Designer_ReportColumns-Columns=\u5831\u8868\u6B04\u4F4D FR-Designer_ReportColumns-Columns=\u5831\u8868\u6B04\u4F4D
FR-Designer_Return-Date=\u8FD4\u56DE\u65E5\u671F FR-Designer_Return-Date=\u8FD4\u56DE\u65E5\u671F
FR-Designer_RichText= RTF FR-Designer_RichText= RTF
@ -561,3 +563,18 @@ FR-Designer_Plugin_Should_Update_Please_Contact_Developer=\u63D2\u4EF6\u7248\u67
FR-Designer_WidgetOrder=\u63A7\u4EF6\u9806\u5E8F FR-Designer_WidgetOrder=\u63A7\u4EF6\u9806\u5E8F
FR-Designer_Mobile_Form_Analysis_Annotation=\u6CE8\u91CB\uFF1A\u53EF\u4EE5\u901A\u904E\u8A72\u5C6C\u6027\u63A7\u5236\u8868\u55AE\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\u3002 FR-Designer_Mobile_Form_Analysis_Annotation=\u6CE8\u91CB\uFF1A\u53EF\u4EE5\u901A\u904E\u8A72\u5C6C\u6027\u63A7\u5236\u8868\u55AE\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\u3002
FR-Designer_Mobile_Report_Analysis_Annotation=\u6CE8\u91CB\uFF1A\u53EF\u4EE5\u901A\u904E\u8A72\u5C6C\u6027\u63A7\u5236\u5831\u8868\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\uFF0C\u53EA\u652F\u6301\u5206\u9801\u9810\u89BD\uFF0C\u586B\u5831\u9810\u89BD\u6642\u5C6C\u6027\u7121\u6548\u3002 FR-Designer_Mobile_Report_Analysis_Annotation=\u6CE8\u91CB\uFF1A\u53EF\u4EE5\u901A\u904E\u8A72\u5C6C\u6027\u63A7\u5236\u5831\u8868\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\uFF0C\u53EA\u652F\u6301\u5206\u9801\u9810\u89BD\uFF0C\u586B\u5831\u9810\u89BD\u6642\u5C6C\u6027\u7121\u6548\u3002
FR-Designer_Background_Null=
FR-Designer_Background_Color=
FR-Designer_Background_Texture=
FR-Designer_Background_Pattern=
FR-Designer_Background_Gradient_Color=
FR-Designer_Background_Image=
FR-Designer_Background_Clear=
FR-Designer_Background_Image_Select=
FR-Designer_Initial_Background_Tips=
FR-Designer_Mouse_Move_Tips=
FR-Designer_Mouse_Click_Tips=
FR-Designer-Move_Tab_First=\u79FB\u52D5\u5230\u9996\u4F4D
FR-Designer-Move_Tab_End=\u79FB\u52D5\u5230\u672B\u5C3E
FR-Designer-Move_Tab_Next=\u5F80\u5F8C\u79FB\u52D5
FR-Designer-Move_Tab_Prev=\u5F80\u524D\u79FB\u52D5

27
designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java

@ -42,14 +42,14 @@ public class MinMaxValuePane extends JPanel {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = { p, f }; double[] columnSize = { p, f };
double[] rowSize = { p, p, p, p}; double[] rowSize = { p, p, p, p, p, p, p, p};
Component[][] components = getPanelComponents(); Component[][] components = getPanelComponents();
JPanel panel = TableLayoutHelper.createTableLayoutPane(components ,rowSize,columnSize); JPanel panel = TableLayoutHelper.createTableLayoutPane(components ,rowSize,columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER); this.add(panel,BorderLayout.CENTER);
for(int i = 0; i < components.length; i++) { for(int i = 0; i < components.length; i+=2) {
((UICheckBox)components[i][0]).addActionListener(new ActionListener() { ((UICheckBox)components[i][0]).addActionListener(new ActionListener() {
@Override @Override
@ -57,18 +57,21 @@ public class MinMaxValuePane extends JPanel {
checkBoxUse(); checkBoxUse();
} }
}); });
ChartSwingUtils.addListener((UICheckBox)components[i][0], (UITextField)components[i][1]); ChartSwingUtils.addListener((UICheckBox)components[i][0], (UITextField)components[i+1][0]);
} }
} }
protected Component[][] getPanelComponents() {
protected Component[][] getPanelComponents() { return new Component[][]{
return new Component[][]{ new Component[]{minCheckBox},
new Component[]{minCheckBox, minValueField}, new Component[]{minValueField},
new Component[]{maxCheckBox, maxValueField}, new Component[]{maxCheckBox},
new Component[]{isCustomMainUnitBox, mainUnitField}, new Component[]{maxValueField},
new Component[]{isCustomSecUnitBox, secUnitField}, new Component[]{isCustomMainUnitBox},
}; new Component[]{mainUnitField},
} new Component[]{isCustomSecUnitBox},
new Component[]{secUnitField},
};
}
private void checkBoxUse() { private void checkBoxUse() {
minValueField.setEnabled(minCheckBox.isSelected()); minValueField.setEnabled(minCheckBox.isSelected());

2
designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java

@ -22,7 +22,7 @@ public interface IndependentChartUIProvider extends Level {
String XML_TAG = "IndependentChartUIProvider"; String XML_TAG = "IndependentChartUIProvider";
int CURRENT_API_LEVEL = 3; int CURRENT_API_LEVEL = 4;
/** /**
* 图表的类型定义界面类型就是属性表的第一个界面 * 图表的类型定义界面类型就是属性表的第一个界面

20
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java

@ -33,7 +33,7 @@ import java.util.List;
* @version 创建时间2012-12-26 上午10:56:51 * @version 创建时间2012-12-26 上午10:56:51
*/ */
public class ChartTypePane extends AbstractChartAttrPane{ public class ChartTypePane extends AbstractChartAttrPane{
private ComboBoxPane chartTypePane; private ComboBoxPane chartTypeComBox;
private ChartTypeButtonPane buttonPane; private ChartTypeButtonPane buttonPane;
private ChartEditPane editPane; private ChartEditPane editPane;
private ChartCollection editingCollection; private ChartCollection editingCollection;
@ -72,13 +72,13 @@ public class ChartTypePane extends AbstractChartAttrPane{
if (editingCollection != null) { if (editingCollection != null) {
relayoutChartTypePane(editingCollection); relayoutChartTypePane(editingCollection);
}else { }else {
chartTypePane = new ComboBoxPane(); chartTypeComBox = new ComboBoxPane();
} }
BasicScrollPane scrollPane = new BasicScrollPane() { BasicScrollPane scrollPane = new BasicScrollPane() {
@Override @Override
protected JPanel createContentPane() { protected JPanel createContentPane() {
return chartTypePane; return chartTypeComBox;
} }
@Override @Override
@ -99,7 +99,7 @@ public class ChartTypePane extends AbstractChartAttrPane{
}; };
content.add(scrollPane, BorderLayout.CENTER); content.add(scrollPane, BorderLayout.CENTER);
buttonPane.setEditingChartPane(chartTypePane); buttonPane.setEditingChartPane(chartTypeComBox);
return content; return content;
} }
@ -286,7 +286,7 @@ public class ChartTypePane extends AbstractChartAttrPane{
public void relayoutChartTypePane(ChartCollection collection){ public void relayoutChartTypePane(ChartCollection collection){
if (needRelayout(collection)) { if (needRelayout(collection)) {
chartTypePane.relayout(collection); chartTypeComBox.relayout(collection);
//设置面板切换状态 //设置面板切换状态
updatePaneState(collection); updatePaneState(collection);
} }
@ -314,7 +314,7 @@ public class ChartTypePane extends AbstractChartAttrPane{
initContentPane(); initContentPane();
buttonPane.populateBean(collection); buttonPane.populateBean(collection);
chartTypePane.populateBean(chart); chartTypeComBox.populateBean(chart);
this.initAllListeners(); this.initAllListeners();
} }
@ -326,7 +326,7 @@ public class ChartTypePane extends AbstractChartAttrPane{
editingCollection = collection; editingCollection = collection;
buttonPane.update(collection);// 内部操作时 已经做过处理. buttonPane.update(collection);// 内部操作时 已经做过处理.
Chart chart = collection.getSelectedChart(); Chart chart = collection.getSelectedChart();
chartTypePane.updateBean(chart); chartTypeComBox.updateBean(chart);
} }
/** /**
@ -334,7 +334,7 @@ public class ChartTypePane extends AbstractChartAttrPane{
* @return 类型界面 * @return 类型界面
*/ */
public FurtherBasicBeanPane[] getPaneList(){ public FurtherBasicBeanPane[] getPaneList(){
return chartTypePane.getCards().toArray(new FurtherBasicBeanPane[0]); return chartTypeComBox.getCards().toArray(new FurtherBasicBeanPane[0]);
} }
/** /**
@ -342,7 +342,7 @@ public class ChartTypePane extends AbstractChartAttrPane{
* @return 当前选中的图表的index * @return 当前选中的图表的index
*/ */
public int getSelectedIndex(){ public int getSelectedIndex(){
return chartTypePane.getSelectedIndex(); return chartTypeComBox.getSelectedIndex();
} }
/** /**
@ -350,7 +350,7 @@ public class ChartTypePane extends AbstractChartAttrPane{
* @return 选中的图标的序号 * @return 选中的图标的序号
*/ */
public int getSelectedChartIndex(){ public int getSelectedChartIndex(){
return chartTypePane.getSelectedIndex(); return chartTypeComBox.getSelectedIndex();
} }
/** /**

13
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java

@ -23,16 +23,19 @@ import com.fr.design.utils.gui.GUICoreUtils;
public class ChartTextAttrPane extends BasicPane { public class ChartTextAttrPane extends BasicPane {
private static final long serialVersionUID = 6731679928019436869L; private static final long serialVersionUID = 6731679928019436869L;
private static final int FONT_START = 6;
private static final int FONT_END = 72;
protected UIComboBox fontNameComboBox; protected UIComboBox fontNameComboBox;
protected UIComboBox fontSizeComboBox; protected UIComboBox fontSizeComboBox;
protected UIToggleButton bold; protected UIToggleButton bold;
protected UIToggleButton italic; protected UIToggleButton italic;
protected UIColorButton fontColor; protected UIColorButton fontColor;
public static Integer[] Font_Sizes = new Integer[FONT_END-FONT_START+1];
public static Integer[] Font_Sizes = {new Integer(6), new Integer(8), new Integer(9), new Integer(10), new Integer(11), new Integer(12), new Integer(14), new Integer(16), static{
new Integer(18), new Integer(20), new Integer(22), new Integer(24), new Integer(26), new Integer(28), new Integer(36), new Integer(48), new Integer(72)}; for(int i = FONT_START; i <= FONT_END; i++){
Font_Sizes [i - FONT_START] = new Integer(i);
}
}
public ChartTextAttrPane() { public ChartTextAttrPane() {
initComponents(); initComponents();
} }

7
designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java

@ -151,10 +151,11 @@ public class ChartValuePane extends ChartAxisUsePane<Axis>{
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = { LayoutConstants.CHART_ATTR_TOMARGIN,p,f}; double[] columnSize = { LayoutConstants.CHART_ATTR_TOMARGIN,p,f};
double[] rowSize = { p, p,}; double[] rowSize = { p, p, p};
Component[][] component = new Component[][]{ Component[][] component = new Component[][]{
new Component[]{null,initMinMaxValue(),null}, new Component[]{null,initMinMaxValue(),null},
new Component[]{null, addLogarithmicPane2ValuePane(), addLogText()}, new Component[]{null, addLogarithmicPane2ValuePane(), null},
new Component[]{null, null, addLogText()},
}; };
return TableLayoutHelper.createTableLayoutPane(component, rowSize, columnSize); return TableLayoutHelper.createTableLayoutPane(component, rowSize, columnSize);
} }
@ -176,7 +177,7 @@ public class ChartValuePane extends ChartAxisUsePane<Axis>{
logBaseField = new UITextField(4); logBaseField = new UITextField(4);
logBaseField.setText("10"); logBaseField.setText("10");
logBaseField.setPreferredSize(new Dimension(20, 20)); logBaseField.setPreferredSize(new Dimension(55, 20));
logBox.addActionListener(new ActionListener() { logBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {

7
designer_form/src/com/fr/design/designer/creator/XChartEditor.java

@ -85,6 +85,13 @@ public class XChartEditor extends XBorderStyleWidgetCreator {
return new CRPropertyDescriptor[] { return new CRPropertyDescriptor[] {
new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName(Inter new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName(Inter
.getLocText("Form-Widget_Name")), .getLocText("Form-Widget_Name")),
new CRPropertyDescriptor("visible", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Designer_Widget-Visible")).setPropertyChangeListener(new PropertyChangeAdapter() {
@Override
public void propertyChange() {
makeVisible(toData().isVisible());}
}),
new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass(
WLayoutBorderStyleEditor.class).setI18NName( WLayoutBorderStyleEditor.class).setI18NName(
Inter.getLocText("Chart-Style_Name")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") Inter.getLocText("Chart-Style_Name")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")

8
designer_form/src/com/fr/design/designer/creator/XCreator.java

@ -379,6 +379,14 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
toData().setWidgetName(name); toData().setWidgetName(name);
} }
/**
* 重置组件的可见性
* @param visible 可见性
*/
public void resetVisible(boolean visible){
toData().setVisible(visible);
}
/** /**
* 返回编辑的子组件scale为其内部组件 * 返回编辑的子组件scale为其内部组件
* @return 组件 * @return 组件

14
designer_form/src/com/fr/design/designer/creator/XElementCase.java

@ -10,11 +10,9 @@ import com.fr.design.fun.WidgetPropertyUIProvider;
import com.fr.design.fun.impl.AbstractFormElementCaseEditorProvider; import com.fr.design.fun.impl.AbstractFormElementCaseEditorProvider;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.*; import com.fr.design.mainframe.*;
import com.fr.design.mainframe.widget.editors.BooleanEditor; import com.fr.design.mainframe.widget.editors.ElementCaseToolBarEditor;
import com.fr.design.mainframe.widget.editors.PaddingMarginEditor; import com.fr.design.mainframe.widget.editors.PaddingMarginEditor;
import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor; import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor;
import com.fr.design.mainframe.widget.renderer.LayoutBorderStyleRenderer;
import com.fr.design.mainframe.widget.renderer.PaddingMarginCellRenderer;
import com.fr.form.FormElementCaseContainerProvider; import com.fr.form.FormElementCaseContainerProvider;
import com.fr.form.FormElementCaseProvider; import com.fr.form.FormElementCaseProvider;
import com.fr.form.FormProvider; import com.fr.form.FormProvider;
@ -83,6 +81,13 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
CRPropertyDescriptor[] propertyTableEditor = new CRPropertyDescriptor[]{ CRPropertyDescriptor[] propertyTableEditor = new CRPropertyDescriptor[]{
new CRPropertyDescriptor("widgetName", this.data.getClass()) new CRPropertyDescriptor("widgetName", this.data.getClass())
.setI18NName(Inter.getLocText("Form-Widget_Name")), .setI18NName(Inter.getLocText("Form-Widget_Name")),
new CRPropertyDescriptor("visible", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Designer_Widget-Visible")).setPropertyChangeListener(new PropertyChangeAdapter() {
@Override
public void propertyChange() {
makeVisible(toData().isVisible());}
}),
new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass(
WLayoutBorderStyleEditor.class).setI18NName( WLayoutBorderStyleEditor.class).setI18NName(
Inter.getLocText("FR-Designer-Widget_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") Inter.getLocText("FR-Designer-Widget_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
@ -92,11 +97,12 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
public void propertyChange() { public void propertyChange() {
initStyle(); initStyle();
} }
}), }),
new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class) new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class)
.setI18NName(Inter.getLocText("FR-Layout_Padding")) .setI18NName(Inter.getLocText("FR-Layout_Padding"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("showToolBar", this.data.getClass()).setEditorClass(BooleanEditor.class) new CRPropertyDescriptor("ToolBars", this.data.getClass()).setEditorClass(ElementCaseToolBarEditor.class)
.setI18NName(Inter.getLocText("Form-EC_toolbar")) .setI18NName(Inter.getLocText("Form-EC_toolbar"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
}; };

9
designer_form/src/com/fr/design/designer/creator/XWidgetCreator.java

@ -146,6 +146,15 @@ public abstract class XWidgetCreator extends XCreator {
} }
} }
/**
* 渲染Painter
*/
public void paint(Graphics g) {
//不可见时,按钮.4f透明
AlphaComposite composite = this.data.isVisible() ? (AlphaComposite)((Graphics2D)g).getComposite() : AlphaComposite.getInstance(AlphaComposite.SRC_OVER,HALF_OPACITY);
((Graphics2D)g).setComposite(composite);
super.paint(g);
}
/** /**
* 重命名 * 重命名
* *

3
designer_form/src/com/fr/design/gui/xtable/PropertyGroupModel.java

@ -53,6 +53,9 @@ public class PropertyGroupModel extends AbstractPropertyGroupModel {
if(ComparatorUtils.equals(FormConstants.NAME, properties[row].getName())){ if(ComparatorUtils.equals(FormConstants.NAME, properties[row].getName())){
creator.resetCreatorName(value.toString()); creator.resetCreatorName(value.toString());
} }
if(ComparatorUtils.equals("visible", properties[row].getName())){
creator.resetVisible((boolean) value);
}
properties[row].firePropertyChanged(); properties[row].firePropertyChanged();
return true; return true;
} catch (Exception e) { } catch (Exception e) {

481
designer_form/src/com/fr/design/mainframe/FormEditToolBar.java

@ -0,0 +1,481 @@
package com.fr.design.mainframe;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.javascript.JavaScriptActionPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.style.background.BackgroundPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.widget.IconDefinePane;
import com.fr.form.ui.*;
import com.fr.form.ui.Button;
import com.fr.form.web.button.Export;
import com.fr.general.Background;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.*;
/**
* Created by harry on 2017-3-2.
*/
public class FormEditToolBar extends BasicPane {
private JList list;
private DefaultListModel listModel;
private JPanel right;
private CardLayout card;
private ButtonPane bp;
private FormToolBarButton lastButton;
private Background background = null;
private UICheckBox defaultCheckBox;
private ListSelectionListener listSelectionListener = new ListSelectionListener() {
public void valueChanged(ListSelectionEvent evt) {
if (lastButton != null) {
lastButton.setWidget(bp.update());
}
if (list.getSelectedValue() instanceof FormToolBarButton) {
lastButton = (FormToolBarButton) list.getSelectedValue();
if (lastButton.getWidget() instanceof Button) {
card.show(right, "button");
bp.populate(lastButton.getWidget());
} else {
bp.populate(lastButton.getWidget());
card.show(right, "none");
}
}
}
};
private ActionListener actioner = new ActionListener() {
/**
*
*/
public void actionPerformed(ActionEvent arg0) {
final BackgroundPane backgroundPane = new BackgroundPane();
BasicDialog dialog = backgroundPane.showWindow(DesignerContext.getDesignerFrame());
backgroundPane.populate(FormEditToolBar.this.background);
dialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
FormEditToolBar.this.background = backgroundPane.update();
if (FormEditToolBar.this.background != null) {
FormEditToolBar.this.defaultCheckBox.setSelected(false);
}
}
});
dialog.setVisible(true);
}
};
public FormEditToolBar() {
initComponent();
}
/**
* 初始化
*/
public void initComponent() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel left = FRGUIPaneFactory.createBorderLayout_S_Pane();
listModel = new DefaultListModel();
list = new JList(listModel);
list.setCellRenderer(render);
left.add(new JScrollPane(list), BorderLayout.CENTER);
if (listModel.getSize() > 0) {
list.setSelectedIndex(0);
}
ToolBarDef toolbarDef = new ToolBarDef();
toolbarDef.addShortCut(new MoveUpItemAction());
toolbarDef.addShortCut(new MoveDownItemAction());
toolbarDef.addShortCut(new RemoveAction());
UIToolbar toolBar = ToolBarDef.createJToolBar();
toolbarDef.updateToolBar(toolBar);
left.add(toolBar, BorderLayout.NORTH);
right = FRGUIPaneFactory.createCardLayout_S_Pane();
card = new CardLayout();
right.setLayout(card);
bp = new ButtonPane();
right.add("none", FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane());
right.add("button", bp);
JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, left, right);
// splitPane.setDividerLocation(left.getMinimumSize().width);
splitPane.setDividerLocation(120);
this.add(splitPane);
list.addListSelectionListener(listSelectionListener);
JPanel backgroundPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
UIButton bgButton = new UIButton(Inter.getLocText("FR-Designer-Output_Background_Set"));
defaultCheckBox = new UICheckBox(Inter.getLocText("FR-Designer-Output_Default_Background"));
bgButton.addActionListener(actioner);
backgroundPane.add(defaultCheckBox);
backgroundPane.add(bgButton);
backgroundPane.setBorder(BorderFactory.createTitledBorder(Inter.getLocText("FR-Designer-Output_Background_Set")));
this.add(backgroundPane, BorderLayout.SOUTH);
}
ListCellRenderer render = new DefaultListCellRenderer() {
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (value instanceof FormToolBarButton) {
FormToolBarButton button = (FormToolBarButton) value;
this.setText(button.getNameOption().optionName());
this.setIcon(button.getNameOption().optionIcon());
}
return this;
}
};
@Override
protected String title4PopupWindow() {
return Inter.getLocText("FR-Designer_Edit");
}
public void populate(FormToolBar ftoolbar) {
this.populate(ftoolbar, null);
}
public void populate(FormToolBar ftoolbar, FormToolBarButton button) {
if (ftoolbar == null) {
return;
}
for (int i = 0; i < ftoolbar.getButtonlist().size(); i++) {
listModel.addElement(ftoolbar.getButtonlist().get(i));
}
this.list.validate();
this.list.repaint();
if (ftoolbar.getButtonlist().size() > 0) {
this.list.setSelectedIndex(0);
}
if (button != null) {
this.list.setSelectedValue(button, true);
}
this.background = ftoolbar.getBackground();
this.defaultCheckBox.setSelected(ftoolbar.isDefault() ? true : false);
}
public FormToolBar update() {
if (this.list.getSelectedIndex() > -1) {
for (int i = 0; i < listModel.getSize(); i++) {
this.list.setSelectedIndex(i);
FormToolBarButton toolBarButton = (FormToolBarButton) this.list.getSelectedValue();
Widget widget = this.bp.update();
toolBarButton.setWidget(widget);
if (widget instanceof Button) {
String iconname = ((Button) widget).getIconName();
if (StringUtils.isNotBlank(iconname)) {
Image iimage = WidgetManager.getProviderInstance().getIconManager().getIconImage(iconname);
toolBarButton.setIcon(new ImageIcon(iimage));
}
}
}
}
java.util.List<FormToolBarButton> list = new ArrayList<FormToolBarButton>();
for (int i = 0; i < listModel.size(); i++) {
list.add((FormToolBarButton) listModel.get(i));
}
FormToolBar ftoolBar = new FormToolBar();
ftoolBar.setButtonlist(list);
ftoolBar.setDefault(this.defaultCheckBox.isSelected());
if (!ftoolBar.isDefault()) {
ftoolBar.setBackground(this.background);
}
return ftoolBar;
}
private class MoveUpItemAction extends UpdateAction {
public MoveUpItemAction() {
this.setName(Inter.getLocText("Utils-Move_Up"));
this.setMnemonic('U');
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/control/up.png"));
}
/**
*
*/
public void actionPerformed(ActionEvent evt) {
int selectedIndex = list.getSelectedIndex();
if (selectedIndex == -1) {
return;
}
// 上移
if (selectedIndex > 0) {
DefaultListModel listModel = (DefaultListModel) list.getModel();
Object selecteObj1 = listModel.get(selectedIndex - 1);
listModel.set(selectedIndex - 1, listModel.get(selectedIndex));
listModel.set(selectedIndex, selecteObj1);
list.setSelectedIndex(selectedIndex - 1);
list.ensureIndexIsVisible(selectedIndex - 1);
list.validate();
}
}
}
private class MoveDownItemAction extends UpdateAction {
public MoveDownItemAction() {
this.setName(Inter.getLocText("Utils-Move_Down"));
this.setMnemonic('D');
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/control/down.png"));
}
/**
*
*/
public void actionPerformed(ActionEvent evt) {
int selectedIndex = list.getSelectedIndex();
if (selectedIndex == -1) {
return;
}
// 下移
if (selectedIndex == -1) {
return;
}
if (selectedIndex < list.getModel().getSize() - 1) {
DefaultListModel listModel = (DefaultListModel) list.getModel();
Object selecteObj1 = listModel.get(selectedIndex + 1);
listModel.set(selectedIndex + 1, listModel.get(selectedIndex));
listModel.set(selectedIndex, selecteObj1);
list.setSelectedIndex(selectedIndex + 1);
list.ensureIndexIsVisible(selectedIndex + 1);
list.validate();
}
}
}
public class RemoveAction extends UpdateAction {
public RemoveAction() {
this.setName(Inter.getLocText("FR-Designer_Delete"));
this.setSmallIcon(IOUtils.readIcon("/com/fr/base/images/cell/control/remove.png"));
}
/**
* 动作
* @param e 事件
*/
public void actionPerformed(ActionEvent e) {
int i = list.getSelectedIndex();
if (i < 0 || !(listModel.getElementAt(i) instanceof FormToolBarButton)) {
return;
}
int val = JOptionPane.showConfirmDialog(FormEditToolBar.this, Inter.getLocText("FR-Designer_Are_You_Sure_To_Delete_The_Data") + "?", "Message", JOptionPane.YES_NO_OPTION);
if (val != JOptionPane.YES_OPTION) {
return;
}
listModel.removeElementAt(i);
list.validate();
if (listModel.size() > 0) {
list.setSelectedIndex(0);
} else {
card.show(right, "none");
}
}
}
public class ButtonPane extends BasicPane {
private CardLayout card;
private JPanel centerPane;
private UICheckBox icon, text, excelP, excelO;
private Widget widget;
private UITextField nameField;
private IconDefinePane iconPane;
private UIButton button;
private JavaScriptActionPane javaScriptPane;
public ButtonPane() {
this.initComponents();
}
/**
* 初始化元素
*/
public void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel north = FRGUIPaneFactory.createBorderLayout_S_Pane();
icon = new UICheckBox(Inter.getLocText("FR-Designer_Show_Icon"));
text = new UICheckBox(Inter.getLocText("FR-Designer_Show_Text"));
north.add(icon, BorderLayout.NORTH);
north.add(text, BorderLayout.CENTER);
nameField = new UITextField(8);
iconPane = new IconDefinePane();
javaScriptPane = JavaScriptActionPane.createDefault();
double p = TableLayout.PREFERRED;
double rowSize[] = {p, p};
double columnSize[] = {p, p};
Component[][] coms = new Component[][]{{new UILabel(Inter.getLocText(new String[]{"Widget", "Printer-Alias"}) + ":"), nameField}, {new UILabel(Inter.getLocText(new String[]{"Widget", "Icon"}) + ":"), iconPane}};
JPanel nameIconPane = TableLayoutHelper.createTableLayoutPane(coms, rowSize, columnSize);
north.add(nameIconPane, BorderLayout.SOUTH);
north.setBorder(BorderFactory.createTitledBorder(Inter.getLocText(new String[]{"Form-Button", "Property", "Set"})));
this.add(north, BorderLayout.NORTH);
JPanel none = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
centerPane = FRGUIPaneFactory.createCardLayout_S_Pane();
card = new CardLayout();
centerPane.setLayout(card);
centerPane.add("custom", getCustomPane());
centerPane.add("export", getExport());
centerPane.add("none", none);
this.add(centerPane, BorderLayout.CENTER);
}
private JPanel getCustomPane() {
JPanel customPane = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane();
button = new UIButton(Inter.getLocText("FR-Designer_User_Defined_Event"));
customPane.add(button);
customPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("FR-Designer_Edit") + "JS", null));
button.addActionListener(l);
return customPane;
}
private JPanel getExport() {
JPanel export = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
// export.setLayout(new BoxLayout(export, BoxLayout.Y_AXIS));
excelP = new UICheckBox(Inter.getLocText("FR-Designer-Output_Excel_Page"));
excelO = new UICheckBox(Inter.getLocText("FR-Designer-Output_Excel_Simple"));
export.add(excelP);
export.add(Box.createVerticalStrut(2));
export.add(excelO);
export.add(Box.createVerticalStrut(2));
export.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText(new String[]{"Form-Button", "Property", "Set"}), null));
return export;
}
@Override
protected String title4PopupWindow() {
return "Button";
}
ActionListener l = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (!(widget instanceof CustomToolBarButton)) {
return;
}
if (javaScriptPane == null || ((CustomToolBarButton)widget).getJSImpl() == null) {
javaScriptPane = JavaScriptActionPane.createDefault();
}
javaScriptPane.setPreferredSize(new Dimension(750, 500));
BasicDialog dialog = javaScriptPane.showWindow(SwingUtilities.getWindowAncestor(ButtonPane.this));
dialog.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
((CustomToolBarButton) widget).setJSImpl(javaScriptPane.updateBean());
}
});
dialog.setVisible(true);
}
};
/**
* 更新
* @param widget 对应组件
*/
public void populate(Widget widget) {
this.widget = widget;
card.show(centerPane, "none");
if (widget instanceof Button) {
populateDefault();
}
if (widget instanceof Export) {
populateExport();
} else if (widget instanceof CustomToolBarButton) {
populateCustomToolBarButton();
}
}
private void populateExport(){
card.show(centerPane, "export");
Export export = (Export) widget;
this.excelP.setSelected(export.isExcelPAvailable());
this.excelO.setSelected(export.isExcelOAvailable());
}
private void populateCustomToolBarButton(){
card.show(centerPane, "custom");
CustomToolBarButton customToolBarButton = (CustomToolBarButton) widget;
if (customToolBarButton.getJSImpl() != null) {
this.javaScriptPane.populateBean(customToolBarButton.getJSImpl());
}
}
private void populateDefault(){
Button button = (Button) widget;
this.icon.setSelected(button.isShowIcon());
this.text.setSelected(button.isShowText());
this.nameField.setText(button.getText());
this.iconPane.populate(((Button) widget).getIconName());
}
/**
* 更新
*
* @return 对应组件
*/
public Widget update() {
if (widget instanceof Export) {
updateExport();
} else if (widget instanceof CustomToolBarButton) {
((CustomToolBarButton) widget).setJSImpl(this.javaScriptPane.updateBean());
}
if (widget instanceof Button) {
updateDefault();
}
return widget;
}
private void updateDefault(){
((Button) widget).setShowIcon(this.icon.isSelected());
((Button) widget).setShowText(this.text.isSelected());
((Button) widget).setText(this.nameField.getText());
((Button) widget).setIconName(this.iconPane.update());
}
private void updateExport(){
Export export = (Export) widget;
export.setExcelPAvailable(this.excelP.isSelected());
export.setExcelOAvailable(this.excelO.isSelected());
}
}
}

84
designer_form/src/com/fr/design/mainframe/FormSettingToolBar.java

@ -0,0 +1,84 @@
package com.fr.design.mainframe;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* Created by harry on 2017-3-2.
*/
public class FormSettingToolBar extends JPanel {
private Icon setIcon = IOUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnsetting.png");
private Icon delIcon = IOUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnclear.png");
private UIButton setButton;
private UIButton delButton;
private FormToolBarPane toolBarPane;
public FormSettingToolBar(String name, FormToolBarPane toolBarPane) {
super();
this.setBackground(Color.lightGray);
this.add(new UILabel(name));
this.toolBarPane = toolBarPane;
setButton = GUICoreUtils.createTransparentButton(setIcon, setIcon, setIcon);
setButton.setToolTipText(Inter.getLocText("FR-Designer_Edit_Button_ToolBar"));
setButton.setAction(new SetAction());
delButton = GUICoreUtils.createTransparentButton(delIcon, delIcon, delIcon);
delButton.setToolTipText(Inter.getLocText("FR-Designer_Remove_Button_ToolBar"));
delButton.setAction(new DelAction());
this.add(setButton);
this.add(delButton);
}
public void setEnabled(boolean b) {
setButton.setEnabled(b);
delButton.setEnabled(b);
}
public void addActionListener(ActionListener l){
setButton.addActionListener(l);
delButton.addActionListener(l);
}
private class SetAction extends AbstractAction {
public SetAction() {
this.putValue(Action.SMALL_ICON, setIcon);
}
@Override
public void actionPerformed(ActionEvent arg0) {
final FormEditToolBar tb = new FormEditToolBar();
tb.populate(toolBarPane.getFToolBar());
BasicDialog dialog = tb.showWindow(DesignerContext.getDesignerFrame());
dialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
toolBarPane.setFToolBar(tb.update());
}
});
dialog.setVisible(true);
}
}
private class DelAction extends AbstractAction {
public DelAction() {
this.putValue(Action.SMALL_ICON, delIcon);
}
@Override
public void actionPerformed(ActionEvent arg0) {
toolBarPane.removeAll();
toolBarPane.removeButtonList();
toolBarPane.repaint();
}
}
}

68
designer_form/src/com/fr/design/mainframe/FormToolBar.java

@ -0,0 +1,68 @@
package com.fr.design.mainframe;
import com.fr.form.ui.ToolBar;
import com.fr.form.ui.Widget;
import com.fr.general.Background;
import java.util.ArrayList;
import java.util.List;
/**
* Created by harry on 2017-3-2.
*/
public class FormToolBar {
private List<FormToolBarButton> buttonlist = new ArrayList<FormToolBarButton>();
private Background background = null;
private boolean isDefault = true;
public List<FormToolBarButton> getButtonlist() {
return buttonlist;
}
public void setButtonlist(List<FormToolBarButton> buttonlist) {
if (buttonlist == null || buttonlist.size() < 0) {
this.buttonlist = new ArrayList<FormToolBarButton>();
} else {
this.buttonlist = buttonlist;
}
}
public void addButton(FormToolBarButton toolBarButton) {
this.buttonlist.add(toolBarButton);
}
public void removeButton(FormToolBarButton toolBarButton) {
this.buttonlist.remove(toolBarButton);
}
public void clearButton() {
this.buttonlist.clear();
}
public Background getBackground() {
return background;
}
public void setBackground(Background background) {
this.background = background;
}
public boolean isDefault() {
return isDefault;
}
public void setDefault(boolean isDefault) {
this.isDefault = isDefault;
}
public ToolBar getToolBar() {
Widget[] widgets = new Widget[this.getButtonlist().size()];
for (int j = 0; j < this.getButtonlist().size(); j++) {
widgets[j] = this.getButtonlist().get(j).getWidget();
}
ToolBar toolBar = new ToolBar(widgets);
toolBar.setBackground(this.background);
toolBar.setDefault(this.isDefault);
return toolBar;
}
}

164
designer_form/src/com/fr/design/mainframe/FormToolBarButton.java

@ -0,0 +1,164 @@
package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.roleAuthority.ReportAndFSManagePane;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.form.ui.Widget;
import com.fr.form.ui.WidgetManager;
import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
/**
* Created by harry on 2017-3-2.
*/
public class FormToolBarButton extends JButton implements MouseListener {
private Widget widget;
private WidgetOption widgetOption;
public FormToolBarButton(Icon icon, Widget widget) {
this(null, icon, widget);
}
public FormToolBarButton(String text, Icon icon, Widget widget) {
super(text, icon);
setBackground(null);
setRolloverEnabled(true);
this.widget = widget;
if (widget instanceof com.fr.form.ui.Button) {
com.fr.form.ui.Button button = (com.fr.form.ui.Button) widget;
String iconName = button.getIconName();
if (StringUtils.isNotEmpty(iconName)) {
Image iimage = WidgetManager.getProviderInstance().getIconManager().getIconImage(iconName);
if (iimage != null) {
setIcon(new ImageIcon(iimage));
}
}
}
this.addMouseListener(this);
setMargin(new Insets(0, 0, 0, 0));
}
/**
* 改变按钮的权限细粒度状态
*
* @param selectedRole 选择的角色
* @param isVisible 是否可见
*/
public void changeAuthorityState(String selectedRole, boolean isVisible) {
this.widget.changeOnlyVisibleAuthorityState(selectedRole, isVisible);
}
/**
* 是都做过权限细粒度
*
* @param role 选择的角色
* @return 若是对应的该角色做过权限细粒度则返回true
*/
public boolean isDoneAuthorityEdited(String role) {
return this.widget.isDoneVisibleAuthority(role);
}
public Widget getWidget() {
return this.widget;
}
public void setWidget(Widget widget) {
this.widget = widget;
}
public WidgetOption getNameOption() {
return this.widgetOption;
}
public void setNameOption(WidgetOption widgetOption) {
this.widgetOption = widgetOption;
}
protected void paintBorder(Graphics g) {
paintBorder(g, this);
}
protected void paintBorder(Graphics g, FormToolBarButton b) {
String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName();
GUIPaintUtils.drawBorder((Graphics2D) g, 0, 0, b.getWidth(), b.getHeight(), true, Constants.NULL, b.isDoneAuthorityEdited(selectedRoles));
}
/**
* 处理鼠标点击事件
*
* @param e 鼠标点击事件
*/
public void mouseClicked(MouseEvent e) {
//该button只在报表块工具栏中使用,
//parent只有FormToolBarPane一种,故可以直接强转
final FormToolBarPane toolBarPane = (FormToolBarPane) this.getParent();
if (BaseUtils.isAuthorityEditing()) {
auhtorityMouseAction();
return;
}
if (e.getClickCount() >= 2) {
final FormEditToolBar editToolBar = new FormEditToolBar();
editToolBar.populate(toolBarPane.getFToolBar(), this);
BasicDialog dialog = editToolBar.showWindow(DesignerContext.getDesignerFrame());
dialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
toolBarPane.setFToolBar(editToolBar.update());
}
});
dialog.setVisible(true);
}
}
private void auhtorityMouseAction() {
if (this.isEnabled()) {
this.setSelected(!this.isSelected());
}
}
/**
* 鼠标进入事件
*
* @param e 鼠标进入事件
*/
public void mouseEntered(MouseEvent e) {
}
/**
* 鼠标退出事件
*
* @param e 鼠标退出事件
*/
public void mouseExited(MouseEvent e) {
}
/**
* 鼠标按下事件
*
* @param e 鼠标事件
*/
public void mousePressed(MouseEvent e) {
}
/**
* 鼠标释放事件
*
* @param e 鼠标事件
*/
public void mouseReleased(MouseEvent e) {
}
}

233
designer_form/src/com/fr/design/mainframe/FormToolBarPane.java

@ -0,0 +1,233 @@
package com.fr.design.mainframe;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.ui.ToolBar;
import com.fr.form.ui.Widget;
import javax.swing.*;
import java.awt.*;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.List;
/**
* Created by harry on 2017-3-2.
*/
public class FormToolBarPane extends BasicBeanPane<ToolBar> {
private FormToolBar ftoolbar = new FormToolBar();
public FormToolBarPane() {
super();
this.initComponent();
}
/**
* 添加鼠标监听
*
* @param mouselistener 鼠标监听
*/
public void addAuthorityListener(MouseListener mouselistener) {
List<FormToolBarButton> list = ftoolbar.getButtonlist();
for (int i = 0; i < list.size(); i++) {
list.get(i).addMouseListener(mouselistener);
}
}
public FormToolBarPane(FormToolBarButton button) {
super();
this.initComponent();
this.add(button);
}
/**
* 初始化组件
*/
public void initComponent() {
this.addMouseListener(listener);
this.setLayout(FRGUIPaneFactory.createBoxFlowLayout());
this.setTransferHandler(new ToolBarHandler(TransferHandler.COPY));
this.setBorder(BorderFactory.createTitledBorder(""));
}
/**
* 删除鼠标事件
*/
public void removeDefaultMouseListener() {
this.removeMouseListener(listener);
}
@Override
protected String title4PopupWindow() {
return "Toolbar";
}
public void setSelectedButton(FormToolBarButton button) {
this.ftoolbar.addButton(button);
}
/**
* 添加组件
*
* @param comp 组件
*
* @return 被添加的组件
*/
public Component add(Component comp) {
if (comp instanceof FormToolBarButton) {
this.ftoolbar.addButton((FormToolBarButton) comp);
}
return super.add(comp);
}
private Component addComp(Component comp) {
return super.add(comp);
}
public void removeButtonList() {
this.ftoolbar.clearButton();
}
protected void setFToolBar(FormToolBar ftoolbar) {
if (ftoolbar == null) {
ftoolbar = new FormToolBar();
}
this.ftoolbar = ftoolbar;
this.setToolBar(this.ftoolbar.getButtonlist());
}
public List<FormToolBarButton> getToolBarButtons() {
return ftoolbar.getButtonlist();
}
protected FormToolBar getFToolBar() {
return this.ftoolbar;
}
public boolean isEmpty() {
return this.ftoolbar.getButtonlist().size() <= 0;
}
private void setToolBar(List<FormToolBarButton> list) {
if (list == null || list.size() < 0) {
return;
}
this.removeAll();
for (int i = 0; i < list.size(); i++) {
this.addComp(list.get(i));
}
this.validate();
this.repaint();
}
@Override
public void populateBean(ToolBar toolbar) {
this.removeAll();
this.getFToolBar().clearButton();
for (int j = 0; j < toolbar.getWidgetSize(); j++) {
Widget widget = toolbar.getWidget(j);
WidgetOption no = WidgetOption.getToolBarButton(widget.getClass());
if (no == null){
//如果装了什么插件, 放到了工具栏上, 后来删除了插件, 模板里还存着之前的控件
continue;
}
FormToolBarButton button = new FormToolBarButton(no.optionIcon(), widget);
button.setNameOption(no);
this.add(button);
this.validate();
this.repaint();
}
this.getFToolBar().setBackground(toolbar.getBackground());
this.getFToolBar().setDefault(toolbar.isDefault());
}
@Override
public ToolBar updateBean() {
return this.ftoolbar.getToolBar();
}
MouseListener listener = new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() >= 2 && !SwingUtilities.isRightMouseButton(e)) {
final FormEditToolBar tb = new FormEditToolBar();
tb.populate(getFToolBar());
BasicDialog dialog = tb.showWindow(SwingUtilities.getWindowAncestor(FormToolBarPane.this));
dialog.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
FormToolBarPane.this.setFToolBar(tb.update());
}
});
dialog.setVisible(true);
}
}
};
/*
* 拖拽属性设置
*/
private class ToolBarHandler extends TransferHandler {
private int action;
public ToolBarHandler(int action) {
this.action = action;
}
@Override
public boolean canImport(TransferHandler.TransferSupport support) {
if (!support.isDrop()) {
return false;
}
if (!support.isDataFlavorSupported(DataFlavor.stringFlavor)) {
return false;
}
boolean actionSupported = (action & support.getSourceDropActions()) == action;
if (actionSupported) {
support.setDropAction(action);
return true;
}
return false;
}
@Override
public boolean importData(TransferHandler.TransferSupport support) {
if (!canImport(support)) {
return false;
}
WidgetOption data;
try {
data = (WidgetOption) support.getTransferable().getTransferData(DataFlavor.stringFlavor);
} catch (UnsupportedFlavorException e) {
return false;
} catch (java.io.IOException e) {
return false;
}
Widget widget = data.createWidget();
FormToolBarButton btn = new FormToolBarButton(data.optionIcon(), widget);
btn.setNameOption(data);
FormToolBarPane.this.add(btn);
FormToolBarPane.this.validate();
FormToolBarPane.this.repaint();
return true;
}
}
}

54
designer_form/src/com/fr/design/mainframe/FormWebWidgetConstants.java

@ -0,0 +1,54 @@
package com.fr.design.mainframe;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.core.WidgetOptionFactory;
import com.fr.form.ui.CustomToolBarButton;
import com.fr.form.web.button.ExcelO;
import com.fr.form.web.button.ExcelP;
import com.fr.form.web.button.Export;
import com.fr.form.web.button.page.*;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
/**
* Created by harry on 2017-3-3.
*/
public class FormWebWidgetConstants {
private FormWebWidgetConstants() {
}
public static WidgetOption[] getFormElementCaseToolBarInstance() {
return new WidgetOption[]{FIRST, PREVIOUS, PAGENAVI, NEXT, LAST, EXPORT, EXCELP, EXCELO, CUSTOM_BUTTON};
}
// 当前页/总页数
public static final WidgetOption PAGENAVI = WidgetOptionFactory.createByWidgetClass(Inter.getLocText(new String[]{"HJS-Current_Page", "HF-Number_of_Page"}, new String[]{"/", ""}),
IOUtils.readIcon("/com/fr/web/images/pageNumber.png"), PageNavi.class);
// 首页
public static final WidgetOption FIRST = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-First"), IOUtils.readIcon("/com/fr/web/images/first.png"),
First.class);
// 末页
public static final WidgetOption LAST = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-Last"), IOUtils.readIcon("/com/fr/web/images/last.png"),
Last.class);
// 前一页
public static final WidgetOption PREVIOUS = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-Previous"),
IOUtils.readIcon("/com/fr/web/images/previous.png"), Previous.class);
// 后一页
public static final WidgetOption NEXT = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-Next"), IOUtils.readIcon("/com/fr/web/images/next.png"),
Next.class);
// 导出成Excel 分页导出
public static final WidgetOption EXCELP = WidgetOptionFactory.createByWidgetClass(Inter.getLocText(new String[]{"Excel", "FR-Designer_Export_Excel_Page"}, new String[]{"(", ")"}),
IOUtils.readIcon("/com/fr/web/images/excel.png"), ExcelP.class);
// 导出成Excel 原样导出
public static final WidgetOption EXCELO = WidgetOptionFactory.createByWidgetClass(Inter.getLocText(new String[]{"Excel", "FR-Designer_Export_Excel_Simple"}, new String[]{"(", ")"}),
IOUtils.readIcon("/com/fr/web/images/excel.png"), ExcelO.class);
// 导出
public static final WidgetOption EXPORT = WidgetOptionFactory
.createByWidgetClass(Inter.getLocText("FR-Engine_Export"), IOUtils.readIcon("/com/fr/web/images/export.png"), Export.class);
public static final WidgetOption CUSTOM_BUTTON = WidgetOptionFactory
.createByWidgetClass(Inter.getLocText(new String[]{"Custom", "Form-Button"}), CustomToolBarButton.class);
}

57
designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleElementCaseToolBarEditor.java

@ -0,0 +1,57 @@
package com.fr.design.mainframe.widget.accessibles;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.mainframe.FormWebWidgetConstants;
import com.fr.design.mainframe.widget.editors.ElementCaseToolBarPane;
import com.fr.design.mainframe.widget.wrappers.ElementCaseToolBarWrapper;
import com.fr.form.web.FormToolBarManager;
import com.fr.stable.ArrayUtils;
import javax.swing.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* Created by harry on 2017-2-23.
*/
public class AccessibleElementCaseToolBarEditor extends UneditableAccessibleEditor {
private ElementCaseToolBarPane pane;
public AccessibleElementCaseToolBarEditor() {
super(new ElementCaseToolBarWrapper());
}
@Override
protected void showEditorPane() {
if (pane == null) {
pane = new ElementCaseToolBarPane();
pane.setDefaultToolBar(getDefaultToolBarManager(), getToolBarInstance());
}
BasicDialog dlg = pane.showToolBarWindow(SwingUtilities.getWindowAncestor(this), new DialogActionAdapter() {
@Override
public void doOk() {
setValue(pane.updateBean());
fireStateChanged();
}
});
FormToolBarManager[] managers = (FormToolBarManager[]) getValue();
pane.setCheckBoxSelected(ArrayUtils.isNotEmpty(managers));
pane.populateBean((FormToolBarManager[]) getValue());
dlg.setVisible(true);
}
private FormToolBarManager getDefaultToolBarManager() {
return FormToolBarManager.createDefaultToolBar();
}
private WidgetOption[] getToolBarInstance() {
List<WidgetOption> defaultOptions = Arrays.asList(FormWebWidgetConstants.getFormElementCaseToolBarInstance());
List<WidgetOption> options = new ArrayList<WidgetOption>();
options.addAll(defaultOptions);
return options.toArray(new WidgetOption[options.size()]);
}
}

13
designer_form/src/com/fr/design/mainframe/widget/editors/ElementCaseToolBarEditor.java

@ -0,0 +1,13 @@
package com.fr.design.mainframe.widget.editors;
import com.fr.design.mainframe.widget.accessibles.AccessibleElementCaseToolBarEditor;
import com.fr.design.mainframe.widget.accessibles.AccessiblePropertyEditor;
/**
* Created by harry on 2017-2-23.
*/
public class ElementCaseToolBarEditor extends AccessiblePropertyEditor {
public ElementCaseToolBarEditor() {
super(new AccessibleElementCaseToolBarEditor());
}
}

304
designer_form/src/com/fr/design/mainframe/widget/editors/ElementCaseToolBarPane.java

@ -0,0 +1,304 @@
package com.fr.design.mainframe.widget.editors;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.FormSettingToolBar;
import com.fr.design.mainframe.FormToolBarButton;
import com.fr.design.mainframe.FormToolBarPane;
import com.fr.form.ui.Widget;
import com.fr.form.web.FormToolBarManager;
import com.fr.form.web.Location;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableModel;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.ImageObserver;
import java.util.*;
import java.util.List;
/**
* Created by harry on 2017-2-23.
*/
public class ElementCaseToolBarPane extends BasicBeanPane<FormToolBarManager[]> {
private static final int COLUMN = 2;
private int row = 6;
private DefaultTableModel toolbarButtonTableModel;
private JTable layoutTable;
private UICheckBox isUseToolBarCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Use_ToolBar") + ":"); // 是否使用工具栏
private FormToolBarPane northToolBar;
private FormToolBarPane southToolBar;
private FormToolBarManager defaultToolBar;
public ElementCaseToolBarPane() {
toolbarButtonTableModel = new TableModel(row ,COLUMN);
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel north = FRGUIPaneFactory.createBorderLayout_S_Pane();
UIButton defaultButton = new UIButton(Inter.getLocText("FR-Designer_Restore_Default"));
// 恢复默认按钮
defaultButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
northToolBar.removeButtonList();
northToolBar.removeAll();
southToolBar.removeButtonList();
southToolBar.removeAll();
if (defaultToolBar == null) {
return;
}
FormToolBarManager toolBarManager = defaultToolBar;
toolBarManager.setToolBarLocation(Location.createTopEmbedLocation());
FormToolBarManager[] tbm = new FormToolBarManager[] { toolBarManager };
populateBean(tbm);
ElementCaseToolBarPane.this.repaint();
}
});
north.add(isUseToolBarCheckBox, BorderLayout.WEST);
JPanel aa = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane();
aa.add(defaultButton);
north.add(aa, BorderLayout.CENTER);
this.add(north, BorderLayout.NORTH);
northToolBar = new FormToolBarPane();
northToolBar.setPreferredSize(new Dimension(ImageObserver.WIDTH, 26));
northToolBar.setBackground(Color.lightGray);
UIButton topButton = new UIButton(IOUtils.readIcon("com/fr/design/images/arrow/arrow_up.png"));
topButton.setBorder(null);
topButton.setOpaque(false);
topButton.setContentAreaFilled(false);
topButton.setFocusPainted(false);
topButton.setRequestFocusEnabled(false);
topButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (isSelectedtable()) {
WidgetOption no = (WidgetOption)layoutTable.getValueAt(layoutTable.getSelectedRow(), layoutTable.getSelectedColumn());
Widget widget = no.createWidget();
FormToolBarButton tb = new FormToolBarButton(no.optionIcon(), widget);
tb.setNameOption(no);
northToolBar.add(tb);
northToolBar.validate();
northToolBar.repaint();
} else {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("FR-Designer_ChooseOneButton"));
}
}
});
UIButton downButton = new UIButton(IOUtils.readIcon("com/fr/design/images/arrow/arrow_down.png"));
downButton.setBorder(null);
downButton.setMargin(null);
downButton.setOpaque(false);
downButton.setContentAreaFilled(false);
downButton.setFocusPainted(false);
downButton.setRequestFocusEnabled(false);
downButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (isSelectedtable()) {
WidgetOption no = (WidgetOption)layoutTable.getValueAt(layoutTable.getSelectedRow(), layoutTable.getSelectedColumn());
Widget widget = no.createWidget();
FormToolBarButton tb = new FormToolBarButton(no.optionIcon(), widget);
tb.setNameOption(no);
southToolBar.add(tb);
southToolBar.validate();
southToolBar.repaint();
} else {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("FR-Designer_ChooseOneButton"));
}
}
});
initLayoutTable();
JPanel center = FRGUIPaneFactory.createBorderLayout_S_Pane();
center.setBackground(Color.white);
center.add(topButton, BorderLayout.NORTH);
JPanel small = FRGUIPaneFactory.createBorderLayout_S_Pane();
small.setBackground(Color.white);
small.add(new UILabel(StringUtils.BLANK), BorderLayout.NORTH);
small.add(layoutTable, BorderLayout.CENTER);
center.add(small, BorderLayout.CENTER);
center.add(downButton, BorderLayout.SOUTH);
southToolBar = new FormToolBarPane();
southToolBar.setPreferredSize(new Dimension(ImageObserver.WIDTH, 26));
southToolBar.setBackground(Color.lightGray);
JPanel movePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel northContentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
FormSettingToolBar top = new FormSettingToolBar(Inter.getLocText("FR-Designer_ToolBar_Top"), northToolBar);
northContentPane.add(top, BorderLayout.EAST);
northContentPane.add(northToolBar, BorderLayout.CENTER);
northContentPane.setBackground(Color.lightGray);
JPanel southContentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
FormSettingToolBar bottom = new FormSettingToolBar(Inter.getLocText("FR-Designer_ToolBar_Bottom"), southToolBar);
southContentPane.add(bottom, BorderLayout.EAST);
southContentPane.add(southToolBar, BorderLayout.CENTER);
southContentPane.setBackground(Color.lightGray);
movePane.add(northContentPane, BorderLayout.NORTH);
movePane.add(center, BorderLayout.CENTER);
movePane.add(southContentPane, BorderLayout.SOUTH);
this.add(new JScrollPane(movePane), BorderLayout.CENTER);
isUseToolBarCheckBox.setSelected(false);
}
private void initLayoutTable() {
layoutTable = new JTable(toolbarButtonTableModel);
layoutTable.setDefaultRenderer(Object.class, tableRenderer);
layoutTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
layoutTable.setColumnSelectionAllowed(false);
layoutTable.setRowSelectionAllowed(false);
layoutTable.setBackground(Color.white);
int columnWidth = Integer.parseInt(Inter.getLocText("FR-Designer_LayoutTable_Column_Width"));
for (int i = 0; i < layoutTable.getColumnModel().getColumnCount(); i++) {
layoutTable.getColumnModel().getColumn(i).setPreferredWidth(columnWidth);
}
layoutTable.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() > 1 && !SwingUtilities.isRightMouseButton(e)) {
WidgetOption no = (WidgetOption)layoutTable.getValueAt(layoutTable.getSelectedRow(), layoutTable.getSelectedColumn());
Widget widget = no.createWidget();
FormToolBarButton tb = new FormToolBarButton(no.optionIcon(), widget);
tb.setNameOption(no);
northToolBar.add(tb);
northToolBar.validate();
northToolBar.repaint();
}
}
});
}
private boolean isSelectedtable() {
for (int i = 0; i < layoutTable.getColumnCount(); i++) {
if (layoutTable.isColumnSelected(i)) {
return true;
}
}
return false;
}
/**
* 是否被选中
* @return 同上
*/
public boolean isUseToolbar() {
return this.isUseToolBarCheckBox.isSelected();
}
public void setDefaultToolBar(FormToolBarManager defaultToolBar, WidgetOption[] buttonArray) {
this.defaultToolBar = defaultToolBar;
if (buttonArray != null) {
for (int i = 0; i < buttonArray.length; i++) {
toolbarButtonTableModel.setValueAt(buttonArray[i], i % row, i / row);
}
}
}
DefaultTableCellRenderer tableRenderer = new DefaultTableCellRenderer() {
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if (value instanceof WidgetOption) {
WidgetOption nameOption = (WidgetOption)value;
this.setText(nameOption.optionName());
Icon icon = nameOption.optionIcon();
if (icon != null) {
this.setIcon(icon);
}
}
if (value == null) {
this.setText(StringUtils.EMPTY);
this.setIcon(null);
}
return this;
}
};
@Override
protected String title4PopupWindow() {
return Inter.getLocText(new String[]{"Form-EC_toolbar", "Set"});
}
public void setCheckBoxSelected(boolean b) {
this.isUseToolBarCheckBox.setSelected(b);
}
@Override
public void populateBean(FormToolBarManager[] toolBarManager) {
if (ArrayUtils.isEmpty(toolBarManager)) {
defaultToolBar.setToolBarLocation(Location.createTopEmbedLocation());
toolBarManager = new FormToolBarManager[] { defaultToolBar };
}
if (ArrayUtils.isEmpty(toolBarManager)) {
return;
}
for (int i = 0; i < toolBarManager.length; i++) {
Location location = toolBarManager[i].getToolBarLocation();
if (location instanceof Location.Embed) {
if (((Location.Embed)location).getPosition() == Constants.TOP) {
northToolBar.populateBean(toolBarManager[i].getToolBar());
} else if (((Location.Embed)location).getPosition() == Constants.BOTTOM) {
southToolBar.populateBean(toolBarManager[i].getToolBar());
}
}
}
}
@Override
public FormToolBarManager[] updateBean() {
if(!isUseToolbar()){
return new FormToolBarManager[0];
}
List<FormToolBarManager> toolBarManagerList = new ArrayList<FormToolBarManager>();
if (!northToolBar.isEmpty()) {
FormToolBarManager north = new FormToolBarManager();
north.setToolBar(northToolBar.updateBean());
north.setToolBarLocation(Location.createTopEmbedLocation());
toolBarManagerList.add(north);
}
if (!southToolBar.isEmpty()) {
FormToolBarManager south = new FormToolBarManager();
south.setToolBar(southToolBar.updateBean());
south.setToolBarLocation(Location.createBottomEmbedLocation());
toolBarManagerList.add(south);
}
return toolBarManagerList.toArray(new FormToolBarManager[toolBarManagerList.size()]);
}
private class TableModel extends DefaultTableModel {
public TableModel(int i, int j) {
super(i, j);
}
// 禁止jtable的双击编辑功能
public boolean isCellEditable(int row, int column) {
return false;
}
}
}

34
designer_form/src/com/fr/design/mainframe/widget/wrappers/ElementCaseToolBarWrapper.java

@ -0,0 +1,34 @@
package com.fr.design.mainframe.widget.wrappers;
import com.fr.design.Exception.ValidationException;
import com.fr.design.designer.properties.Decoder;
import com.fr.design.designer.properties.Encoder;
import com.fr.form.web.FormToolBarManager;
import com.fr.general.Inter;
/**
* Created by harry on 2017-3-1.
*/
public class ElementCaseToolBarWrapper implements Encoder, Decoder {
@Override
public Object decode(String txt) {
return null;
}
@Override
public void validate(String txt) throws ValidationException {
}
@Override
public String encode(Object v) {
if (v == null) {
return null;
}
FormToolBarManager[] toolBarManager = (FormToolBarManager[])v;
if (toolBarManager.length != 0) {
return Inter.getLocText("FR-Designer_Open");
}
return Inter.getLocText("FR-Designer_Close");
}
}
Loading…
Cancel
Save