Browse Source

Merge branch 'release/10.0' of https://cloud.finedevelop.com/scm/~alex.sung/design into release/10.0

bugfix/10.0
alex.sung 6 years ago
parent
commit
4b9f242eb2
  1. 49
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  2. 9
      designer-base/src/main/java/com/fr/design/actions/community/UpAction.java
  3. 11
      designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java
  4. 12
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  5. 15
      designer-base/src/main/java/com/fr/design/actions/file/export/AbstractExportAction.java
  6. 17
      designer-base/src/main/java/com/fr/design/actions/help/FeedBackPane.java
  7. 70
      designer-base/src/main/java/com/fr/design/actions/help/FineUIAction.java
  8. 9
      designer-base/src/main/java/com/fr/design/actions/help/ForumAction.java
  9. 8
      designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java
  10. 12
      designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java
  11. 10
      designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java
  12. 4
      designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
  13. 18
      designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java
  14. 8
      designer-base/src/main/java/com/fr/design/data/datapane/ChoosePaneSupportFormula.java
  15. 14
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java
  16. 13
      designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java
  17. 9
      designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java
  18. 2
      designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java
  19. 6
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java
  20. 7
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DecoratedTableDataPane.java
  21. 31
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataDefinedPane.java
  22. 45
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java
  23. 12
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java
  24. 11
      designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/StoreProcedureDataWrapper.java
  25. 5
      designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/StoreProcedureNameWrapper.java
  26. 3
      designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/TableDataFactory.java
  27. 28
      designer-base/src/main/java/com/fr/design/dialog/UIDialog.java
  28. 10
      designer-base/src/main/java/com/fr/design/editor/editor/DateEditor.java
  29. 10
      designer-base/src/main/java/com/fr/design/extra/PluginFromStorePane.java
  30. 7
      designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java
  31. 18
      designer-base/src/main/java/com/fr/design/extra/QQLoginWebPane.java
  32. 22
      designer-base/src/main/java/com/fr/design/formula/FormulaPane.java
  33. 7
      designer-base/src/main/java/com/fr/design/formula/FunctionConstants.java
  34. 14
      designer-base/src/main/java/com/fr/design/formula/JavaEditorPane.java
  35. 4
      designer-base/src/main/java/com/fr/design/gui/controlpane/CommonShortCutHandlers.java
  36. 10
      designer-base/src/main/java/com/fr/design/gui/core/CustomWidgetOption.java
  37. 9
      designer-base/src/main/java/com/fr/design/gui/date/SingleObjectComboBoxModel.java
  38. 17
      designer-base/src/main/java/com/fr/design/gui/date/UIDatePicker.java
  39. 15
      designer-base/src/main/java/com/fr/design/gui/demo/LoadingPaneDemo.java
  40. 10
      designer-base/src/main/java/com/fr/design/gui/frpane/LoadingBasicPaneTest.java
  41. 33
      designer-base/src/main/java/com/fr/design/gui/frpane/UIBubbleFloatPane.java
  42. 7
      designer-base/src/main/java/com/fr/design/gui/icombobox/ExtendedComboBoxTest.java
  43. 19
      designer-base/src/main/java/com/fr/design/gui/icombobox/LazyComboBoxTest.java
  44. 13
      designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java
  45. 6
      designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableModelAdapter.java
  46. 17
      designer-base/src/main/java/com/fr/design/gui/itooltip/MultiLineToolTipUI.java
  47. 20
      designer-base/src/main/java/com/fr/design/gui/itooltip/UIToolTip.java
  48. 18
      designer-base/src/main/java/com/fr/design/gui/itooltip/UIToolTipUI.java
  49. 13
      designer-base/src/main/java/com/fr/design/icon/LockIcon.java
  50. 13
      designer-base/src/main/java/com/fr/design/icon/WarningIcon.java
  51. 11
      designer-base/src/main/java/com/fr/design/mainframe/DesignAuthorityEventType.java
  52. 2
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  53. 4
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  54. 19
      designer-base/src/main/java/com/fr/design/mainframe/dnd/ArrayListTransferHandler.java
  55. 6
      designer-base/src/main/java/com/fr/design/mainframe/dnd/ArrayListTransferable.java
  56. 8
      designer-base/src/main/java/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java
  57. 9
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  58. 10
      designer-base/src/main/java/com/fr/design/mainframe/widget/renderer/IconCellRenderer.java
  59. 16
      designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java
  60. 28
      designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java
  61. 4
      designer-base/src/main/java/com/fr/design/style/BorderPane.java
  62. 53
      designer-base/src/main/java/com/fr/design/ui/Assistant.java
  63. 83
      designer-base/src/main/java/com/fr/design/ui/EmbProtocolHandler.java
  64. 22
      designer-base/src/main/java/com/fr/design/ui/ModernRequestClient.java
  65. 15
      designer-base/src/main/java/com/fr/design/ui/ModernUIConstants.java
  66. 182
      designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java
  67. 3
      designer-base/src/main/java/com/fr/design/utils/BrowseUtils.java
  68. 18
      designer-base/src/main/java/com/fr/design/utils/DesignUtils.java
  69. 14
      designer-base/src/main/java/com/fr/design/utils/gui/UIComponentUtils.java
  70. 2
      designer-base/src/main/java/com/fr/design/web/CustomIconPane.java
  71. 4
      designer-base/src/main/java/com/fr/design/widget/EventCreator.java
  72. 93
      designer-base/src/main/java/com/fr/file/AbstractFILE.java
  73. 2
      designer-base/src/main/java/com/fr/file/FileFILE.java
  74. 26
      designer-base/src/main/java/com/fr/file/FileNodeFILE.java
  75. 102
      designer-base/src/main/java/com/fr/file/RenameExportFILE.java
  76. 34
      designer-base/src/main/java/com/fr/file/StashedFILE.java
  77. 8
      designer-base/src/main/java/com/fr/start/Demo.java
  78. 12
      designer-base/src/main/java/com/fr/start/StartDocURL.java
  79. 19
      designer-base/src/main/java/com/fr/start/server/ServerManageFrame.java
  80. 18
      designer-base/src/main/java/com/fr/start/server/ServerTray.java
  81. 12
      designer-base/src/main/resources/com/fr/design/ui/InitNameSpace.js
  82. 8
      designer-base/src/main/resources/com/fr/design/ui/InsertScript.js
  83. 9
      designer-base/src/main/resources/com/fr/design/ui/InsertStyle.js
  84. 220
      designer-base/src/main/resources/com/fr/design/ui/help/demo.js
  85. 12
      designer-base/src/main/resources/com/fr/design/ui/tpl.html
  86. 28
      designer-base/src/test/java/com/fr/design/ui/FineUIDemo.java
  87. 75
      designer-base/src/test/java/com/fr/design/ui/ModernUIPaneTest.java
  88. 32
      designer-base/src/test/java/com/fr/design/ui/StartComponent.java
  89. 20
      designer-base/src/test/resources/com/fr/design/ui/demo.html
  90. 11
      designer-base/src/test/resources/com/fr/design/ui/fineui.html
  91. 57
      designer-base/src/test/resources/com/fr/design/ui/script/start.js
  92. 15
      designer-chart/src/main/java/com/fr/design/chart/ChartAxisFactory.java
  93. 61
      designer-chart/src/main/java/com/fr/design/chart/ChartPlotFactory.java
  94. 8
      designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java
  95. 14
      designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java
  96. 8
      designer-chart/src/main/java/com/fr/design/chart/gui/ChartWidgetOption.java
  97. 13
      designer-chart/src/main/java/com/fr/design/chart/series/PlotSeries/MapCustomPane.java
  98. 28
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/ConditionTrendLinePane.java
  99. 13
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java
  100. 4
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java
  101. Some files were not shown because too many files have changed in this diff Show More

49
designer-base/src/main/java/com/fr/design/DesignerEnvManager.java

@ -4,7 +4,6 @@
package com.fr.design;
import com.fr.base.BaseXMLUtils;
import com.fr.base.FRContext;
import com.fr.base.Utils;
import com.fr.design.actions.help.alphafine.AlphaFineConfigManager;
import com.fr.design.constants.UIConstants;
@ -165,6 +164,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
private static List<SwingWorker> mapWorkerList = new ArrayList<SwingWorker>();
private boolean imageCompress = false;//图片压缩
// 开启内嵌web页面的调试窗口
private boolean openDebug = false;
/**
* DesignerEnvManager.
@ -179,7 +180,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
try {
XMLTools.readFileXML(designerEnvManager, designerEnvManager.getDesignerEnvFile());
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
// james:如果没有env定义,要设置一个默认的
@ -282,11 +283,11 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
Handler handler = new FileHandler(fileName, true);
handler.setFormatter(new FRLogFormatter());
FRContext.getLogger().addLogHandler(handler);
FineLoggerFactory.getLogger().addLogHandler(handler);
} catch (SecurityException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
} catch (IOException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}
@ -323,7 +324,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
}
fileWriter.close();
} catch (IOException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
@ -345,7 +346,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
try {
XMLTools.readFileXML(designerEnvManager, prevEnvFile);
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
// 清空前一个版本中的工作目录和最近打开
nameEnvMap = new ListMap<String, DesignerWorkspaceInfo>();
@ -626,7 +627,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
fout.flush();
fout.close();
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
@ -1384,6 +1385,13 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
reader.readXMLObject(this.configManager);
}
private void readOpenDebug(XMLableReader reader) {
String tmpVal;
if (StringUtils.isNotBlank(tmpVal = reader.getElementValue())) {
this.openDebug = Boolean.parseBoolean(tmpVal);
}
}
public String getUUID() {
return StringUtils.isEmpty(uuid) ? UUID.randomUUID().toString() : uuid;
}
@ -1412,6 +1420,14 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
this.imageCompress = imageCompress;
}
public boolean isOpenDebug() {
return openDebug;
}
public void setOpenDebug(boolean openDebug) {
this.openDebug = openDebug;
}
/**
* Read XML.<br>
* The method will be invoked when read data from XML file.<br>
@ -1459,12 +1475,14 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
readUUID(reader);
} else if ("status".equals(name)) {
readActiveStatus(reader);
} else if (ComparatorUtils.equals(CAS_PARAS, name)) {
} else if (CAS_PARAS.equals(name)) {
readHttpsParas(reader);
} else if (name.equals("AlphaFineConfigManager")) {
} else if ("AlphaFineConfigManager".equals(name)) {
readAlphaFineAttr(reader);
} else if (name.equals("RecentColors")) {
} else if ("RecentColors".equals(name)) {
readRecentColor(reader);
} else if ("OpenDebug".equals(name)) {
readOpenDebug(reader);
} else {
readLayout(reader, name);
}
@ -1669,6 +1687,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
writeHttpsParas(writer);
writeAlphaFineAttr(writer);
writeRecentColor(writer);
writeOpenDebug(writer);
writer.end();
}
@ -1684,6 +1703,14 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
}
}
private void writeOpenDebug(XMLPrintWriter writer) {
if (this.openDebug) {
writer.startTAG("OpenDebug");
writer.textNode(String.valueOf(openDebug));
writer.end();
}
}
//写入uuid
private void writeUUID(XMLPrintWriter writer) {

9
designer-base/src/main/java/com/fr/design/actions/community/UpAction.java

@ -1,16 +1,15 @@
package com.fr.design.actions.community;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.design.actions.UpdateAction;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.CloudCenter;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import javax.swing.JOptionPane;
import javax.swing.KeyStroke;
import java.awt.Desktop;
import java.awt.event.ActionEvent;
import java.io.IOException;
import java.net.URI;
@ -33,7 +32,7 @@ public class UpAction extends UpdateAction
{
String url = CloudCenter.getInstance().acquireUrlByKind("bbs.update");
if (StringUtils.isEmpty(url)) {
FRContext.getLogger().info("The URL is empty!");
FineLoggerFactory.getLogger().info("The URL is empty!");
return;
}
try {

11
designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java

@ -1,6 +1,5 @@
package com.fr.design.actions.core;
import com.fr.base.FRContext;
import com.fr.base.Utils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.file.HistoryTemplateListPane;
@ -215,7 +214,7 @@ public class ActionFactory {
c.setAccessible(true);
return c.newInstance();
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return null;
}
@ -281,7 +280,7 @@ public class ActionFactory {
Constructor<? extends UpdateAction> c = (Constructor<? extends UpdateAction>) clazz.getConstructor(cls);
actions.add(c.newInstance(obj));
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}
@ -301,7 +300,7 @@ public class ActionFactory {
Constructor<? extends UpdateAction> c = (Constructor<? extends UpdateAction>) clazz.getConstructor();
actionNames.add(c.newInstance().getMenuKeySet());
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}
@ -336,7 +335,7 @@ public class ActionFactory {
Constructor<? extends UpdateAction> c = (Constructor<? extends UpdateAction>) clazz.getConstructor(cls);
actions.add(c.newInstance(obj));
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
return actions.toArray(new UpdateAction[actions.size()]);
@ -355,7 +354,7 @@ public class ActionFactory {
constructor.setAccessible(true);
return constructor.newInstance();
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return null;
}

12
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -18,6 +18,7 @@ import com.fr.design.gui.ilable.ActionLabel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -131,6 +132,7 @@ public class PreferencePane extends BasicPane {
private UITextField jdkHomeTextField;
private UICheckBox oracleSpace;
private UISpinner cachingTemplateSpinner;
private UICheckBox openDebugComboBox;
private UICheckBox joinProductImprove;
public PreferencePane() {
@ -171,6 +173,12 @@ public class PreferencePane extends BasicPane {
oracleSpace = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Show_All_Oracle_Tables"));
oraclePane.add(oracleSpace);
JPanel debuggerPane = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Basic_Develop_Tools"));
openDebugComboBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Basic_Open_Debug_Window"));
debuggerPane.add(openDebugComboBox, BorderLayout.CENTER);
advancePane.add(debuggerPane);
JPanel improvePane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Product_Improve"));
joinProductImprove = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Join_Product_Improve"));
improvePane.add(joinProductImprove);
@ -550,6 +558,8 @@ public class PreferencePane extends BasicPane {
this.portEditor.setValue(new Integer(designerEnvManager.getEmbedServerPort()));
openDebugComboBox.setSelected(designerEnvManager.isOpenDebug());
this.oracleSpace.setSelected(designerEnvManager.isOracleSystemSpace());
this.cachingTemplateSpinner.setValue(designerEnvManager.getCachingTemplateLimit());
this.joinProductImprove.setSelected(designerEnvManager.isJoinProductImprove());
@ -609,6 +619,8 @@ public class PreferencePane extends BasicPane {
designerEnvManager.setJettyServerPort(portEditor.getValue().intValue());
designerEnvManager.setOpenDebug(openDebugComboBox.isSelected());
designerEnvManager.setOracleSystemSpace(this.oracleSpace.isSelected());
designerEnvManager.setCachingTemplateLimit((int) this.cachingTemplateSpinner.getValue());
designerEnvManager.setJoinProductImprove(this.joinProductImprove.isSelected());

15
designer-base/src/main/java/com/fr/design/actions/file/export/AbstractExportAction.java

@ -1,7 +1,7 @@
package com.fr.design.actions.file.export;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.actions.JTemplateAction;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.gui.iprogressbar.FRProgressBar;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
@ -9,6 +9,7 @@ import com.fr.design.mainframe.JTemplate;
import com.fr.exception.RemoteDesignPermissionDeniedException;
import com.fr.file.FILE;
import com.fr.file.FILEChooserPane;
import com.fr.file.RenameExportFILE;
import com.fr.file.filter.ChooseFileFilter;
import com.fr.io.exporter.DesignExportType;
import com.fr.io.exporter.ExporterKey;
@ -92,12 +93,17 @@ public abstract class AbstractExportAction<E extends JTemplate<?, ?>> extends JT
int saveValue = fileChooserPane.showSaveDialog(DesignerContext.getDesignerFrame(), "." + this.getDefaultExtension());
if (saveValue == FILEChooserPane.JOPTIONPANE_OK_OPTION || saveValue == FILEChooserPane.OK_OPTION) {
FILE target = fileChooserPane.getSelectedFILE();
//rename 方式导出
target = RenameExportFILE.create(target);
try {
target.mkfile();
} catch (Exception exp) {
FineLoggerFactory.getLogger().error("Error In Make New File", exp);
}
FineLoggerFactory.getLogger().info("\"" + target.getName() + "\"" + Toolkit.i18nText("Fine-Design_Report_Prepare_Export") + "!");
FineLoggerFactory.getLogger().info(
"\"" + RenameExportFILE.recoverFileName(target.getName()) + "\"" +
Toolkit.i18nText("Fine-Design_Report_Prepare_Export") + "!"
);
progressbar = new FRProgressBar(
createExportWork(getSource(), target, para),
@ -124,7 +130,7 @@ public abstract class AbstractExportAction<E extends JTemplate<?, ?>> extends JT
private boolean processNotSaved() {
//当前编辑的模板
E e = getEditingComponent();
if (!e.isALLSaved() && !DesignerMode.isVcsMode()) {
if (!e.isALLSaved() && !DesignModeContext.isVcsMode()) {
e.stopEditing();
int returnVal = JOptionPane.showConfirmDialog(
DesignerContext.getDesignerFrame(),
@ -149,7 +155,7 @@ public abstract class AbstractExportAction<E extends JTemplate<?, ?>> extends JT
private SwingWorker createExportWork(final FILE source, final FILE target, final Map<String, Object> parameterMap) {
final String path = source.getPath();
final String name = target.getName();
final String name = RenameExportFILE.recoverFileName(target.getName());
return new SwingWorker<Void, Void>() {
@ -162,7 +168,6 @@ public abstract class AbstractExportAction<E extends JTemplate<?, ?>> extends JT
dealExporter(outputStream, path, parameterMap);
this.setProgress(80);
outputStream.flush();
outputStream.close();
this.setProgress(100);
FineLoggerFactory.getLogger().info("\"" + name + "\"" + Toolkit.i18nText("Fine-Design_Report_Finish_Export") + "!");

17
designer-base/src/main/java/com/fr/design/actions/help/FeedBackPane.java

@ -4,7 +4,6 @@
package com.fr.design.actions.help;
import com.fr.base.FRContext;
import com.fr.base.FeedBackInfo;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicDialog;
@ -23,7 +22,12 @@ import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.BorderFactory;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.SwingWorker;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
import javax.swing.border.MatteBorder;
@ -31,7 +35,12 @@ import javax.swing.plaf.ColorUIResource;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.PlainDocument;
import java.awt.*;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
@ -299,7 +308,7 @@ public class FeedBackPane extends BasicPane {
} catch (Exception e) {
isSendSuccessful = false;
if (!(e instanceof CancellationException)) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}

70
designer-base/src/main/java/com/fr/design/actions/help/FineUIAction.java

@ -0,0 +1,70 @@
package com.fr.design.actions.help;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.ui.ModernUIPane;
import com.fr.locale.InterProviderFactory;
import com.fr.web.struct.AssembleComponent;
import com.fr.web.struct.Atom;
import com.fr.web.struct.browser.RequestClient;
import com.fr.web.struct.category.ScriptPath;
import com.fr.web.struct.impl.FineUI;
import com.teamdev.jxbrowser.chromium.JSValue;
import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter;
import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent;
import java.awt.event.ActionEvent;
/**
* @author richie
* @version 10.0
* Created by richie on 2019-03-08
*/
public class FineUIAction extends UpdateAction {
public FineUIAction() {
setName("FineUI");
}
@Override
public void actionPerformed(final ActionEvent e) {
ModernUIPane<?> pane = new ModernUIPane.Builder<>()
.prepare(new ScriptContextAdapter() {
@Override
public void onScriptContextCreated(ScriptContextEvent event) {
JSValue pool = event.getBrowser().executeJavaScriptAndReturnValue("window.Pool");
pool.asObject().setProperty("i18n", new I18n());
}
})
.withComponent(new AssembleComponent() {
@Override
public ScriptPath script(RequestClient req) {
return ScriptPath.build("/com/fr/design/ui/help/demo.js");
}
@Override
public Atom[] refer() {
return new Atom[] {FineUI.KEY};
}
})
.build();
BasicDialog dialog = pane.showLargeWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
}
});
dialog.setVisible(true);
}
public static class I18n {
public String i18nText(String key) {
return InterProviderFactory.getProvider().getLocText(key);
}
}
}

9
designer-base/src/main/java/com/fr/design/actions/help/ForumAction.java

@ -5,16 +5,15 @@
package com.fr.design.actions.help;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.design.actions.UpdateAction;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.CloudCenter;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import javax.swing.JOptionPane;
import javax.swing.KeyStroke;
import java.awt.Desktop;
import java.awt.event.ActionEvent;
import java.io.IOException;
import java.net.URI;
@ -42,7 +41,7 @@ public class ForumAction extends UpdateAction {
public void actionPerformed(ActionEvent e) {
String url = CloudCenter.getInstance().acquireUrlByKind("bbs");
if (StringUtils.isEmpty(url)) {
FRContext.getLogger().info("The URL is empty!");
FineLoggerFactory.getLogger().info("The URL is empty!");
return;
}
try {

8
designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java

@ -1,13 +1,13 @@
package com.fr.design.actions.help;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.Utils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.CloudCenter;
import com.fr.general.GeneralContext;
import com.fr.general.http.HttpToolbox;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.CommonUtils;
import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils;
@ -38,11 +38,11 @@ public class TutorialAction extends UpdateAction {
private void nativeExcuteMacInstallHomePrograms(String appName) {
String installHome = StableUtils.getInstallHome();
if(installHome == null) {
FRContext.getLogger().error("Can not find the install home, please check it.");
FineLoggerFactory.getLogger().error("Can not find the install home, please check it.");
} else {
String appPath = StableUtils.pathJoin(new String[]{installHome, "bin", appName});
if(!(new File(appPath)).exists()) {
FRContext.getLogger().error(appPath + " can not be found.");
FineLoggerFactory.getLogger().error(appPath + " can not be found.");
}
String cmd = "open " + appPath;
@ -51,7 +51,7 @@ public class TutorialAction extends UpdateAction {
try {
runtime.exec(cmd);
} catch (IOException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}

12
designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java

@ -1,16 +1,18 @@
package com.fr.design.condition;
import com.fr.base.FRContext;
import com.fr.design.actions.UpdateAction;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory;
import javax.swing.*;
import javax.swing.BoxLayout;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import java.awt.Dimension;
import java.util.HashMap;
import java.util.Iterator;
@ -88,9 +90,9 @@ public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> {
try {
return clazz.newInstance();
} catch (InstantiationException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
} catch (IllegalAccessException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return null;
}

10
designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java

@ -1,7 +1,6 @@
package com.fr.design.data;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.TableData;
import com.fr.data.TableDataSource;
import com.fr.data.api.StoreProcedureAssist;
@ -28,14 +27,17 @@ import com.fr.design.menu.LineSeparator;
import com.fr.design.menu.MenuDef;
import com.fr.general.ComparatorUtils;
import com.fr.general.NameObject;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext;
import javax.swing.*;
import javax.swing.DefaultCellEditor;
import javax.swing.Icon;
import javax.swing.JTree;
import javax.swing.event.CellEditorListener;
import javax.swing.event.ChangeEvent;
import javax.swing.tree.TreeCellEditor;
import java.awt.*;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
@ -413,7 +415,7 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp
}
} catch (Exception ex) {
FRContext.getLogger().error(ex.getMessage(), ex);
FineLoggerFactory.getLogger().error(ex.getMessage(), ex);
}
}

4
designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java

@ -1,6 +1,5 @@
package com.fr.design.data;
import com.fr.base.FRContext;
import com.fr.base.StoreProcedureParameter;
import com.fr.base.TableData;
import com.fr.data.TableDataSource;
@ -30,6 +29,7 @@ import com.fr.file.TableDataConfig;
import com.fr.general.ComparatorUtils;
import com.fr.general.data.DataModel;
import com.fr.general.data.TableDataException;
import com.fr.log.FineLoggerFactory;
import com.fr.script.Calculator;
import com.fr.stable.ArrayUtils;
import com.fr.stable.ParameterProvider;
@ -489,7 +489,7 @@ public abstract class DesignTableDataManager {
}
rs.release();
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}

18
designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java

@ -1,7 +1,6 @@
package com.fr.design.data.datapane;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.TableData;
import com.fr.data.core.DataCoreUtils;
import com.fr.data.core.db.DBUtils;
@ -33,12 +32,15 @@ import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.ConnectionConfig;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext;
import javax.swing.*;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTree;
import javax.swing.SwingWorker;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.PopupMenuEvent;
@ -49,7 +51,9 @@ import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreeNode;
import javax.swing.tree.TreePath;
import java.awt.*;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.ItemEvent;
@ -432,7 +436,7 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
tree.expandPath(path);
}
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
@ -473,7 +477,7 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
DesignerEnvManager.getEnvManager().getMaxNumberOrPreviewRow());
} catch (Exception e) {
failedToFindTable();
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
@ -530,7 +534,7 @@ public class ChoosePane extends BasicBeanPane<DataBaseItems> implements Refresha
// daniel:增加参数
colNames = DataOperator.getInstance().getColumns(selectedDSName, paras.getSchemaName(), selectedTableObject);
} catch (Exception e2) {
FRContext.getLogger().error(e2.getMessage(), e2);
FineLoggerFactory.getLogger().error(e2.getMessage(), e2);
}
if (colNames == null) {

8
designer-base/src/main/java/com/fr/design/data/datapane/ChoosePaneSupportFormula.java

@ -1,7 +1,6 @@
package com.fr.design.data.datapane;
import com.fr.base.BaseFormula;
import com.fr.base.FRContext;
import com.fr.base.Parameter;
import com.fr.base.ParameterHelper;
import com.fr.base.ParameterMapNameSpace;
@ -15,9 +14,10 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.parameter.ParameterInputPane;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.script.Calculator;
import javax.swing.*;
import javax.swing.JTree;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import java.awt.event.ItemEvent;
@ -113,7 +113,7 @@ public class ChoosePaneSupportFormula extends ChoosePane {
selectedDSName = Utils.objectToString(ca.eval(BaseFormula.createFormulaBuilder().build(item)));
// selectedDSName = ParameterHelper.analyzeCurrentContextTableData4Templatee(item, parameters);
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
} else {
selectedDSName = item;
@ -156,7 +156,7 @@ public class ChoosePaneSupportFormula extends ChoosePane {
dsName = dsItem.startsWith("=") ? Utils.objectToString(ca.eval(BaseFormula.createFormulaBuilder().build(dsItem))) : dsItem;
tableName = tableItem.startsWith("=") ? Utils.objectToString(ca.eval(BaseFormula.createFormulaBuilder().build(tableItem))) : tableItem;
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
ori_ds_name = dsName;
ori_table_name = tableName;

14
designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java

@ -1,21 +1,21 @@
package com.fr.design.data.datapane;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.data.impl.DBTableData;
import com.fr.design.actions.tabledata.TableDataAction;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.icon.WarningIcon;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import javax.swing.Icon;
import java.awt.Image;
import java.text.Collator;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
@ -138,10 +138,10 @@ public class TableDataNameObjectCreator extends NameObjectCreator {
try {
return clazzOfInitCase.newInstance();
} catch (InstantiationException | IllegalAccessException e1) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
} catch (IllegalAccessException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return null;
}

13
designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTableModel.java

@ -1,14 +1,13 @@
package com.fr.design.data.datapane.preview;
import com.fr.base.FRContext;
import com.fr.cache.list.IntList;
import com.fr.data.AbstractDataModel;
import com.fr.data.impl.EmbeddedTableData.EmbeddedTDDataModel;
import com.fr.data.impl.storeproc.ProcedureDataModel;
import com.fr.design.utils.DesignUtils;
import com.fr.general.data.DataModel;
import com.fr.general.data.TableDataException;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext;
@ -35,7 +34,7 @@ public class PreviewTableModel extends AbstractTableModel {
this.dataModel = createRowDataModel(rs, maxRowCount);
} catch (TableDataException e) {
// TODO Auto-generated catch block
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
} else {
this.dataModel = sourceResultSet;
@ -98,7 +97,7 @@ public class PreviewTableModel extends AbstractTableModel {
try {
return Integer.toString(column + 1) + ". " + dataModel.getColumnName(column) + checkType(column);
} catch (TableDataException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
DesignUtils.errorMessage(e.getMessage());
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Error");
}
@ -108,7 +107,7 @@ public class PreviewTableModel extends AbstractTableModel {
try {
return this.dataModel.getRowCount();
} catch (TableDataException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return 0;
}
}
@ -120,7 +119,7 @@ public class PreviewTableModel extends AbstractTableModel {
}
return dataModel.getColumnCount();
} catch (TableDataException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
DesignUtils.errorMessage(e.getMessage());
return 0;
}
@ -130,7 +129,7 @@ public class PreviewTableModel extends AbstractTableModel {
try {
return dataModel.getValueAt(row, column);
} catch (TableDataException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
DesignUtils.errorMessage(e.getMessage());
return "";
}

9
designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java

@ -4,7 +4,6 @@
package com.fr.design.data.datapane.preview;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.TableData;
import com.fr.data.TableDataSource;
import com.fr.data.impl.DBTableData;
@ -308,7 +307,7 @@ public class PreviewTablePane extends BasicPane {
int tatalColumn = Integer.parseInt(tatolColumnErrMessage.trim());
columnErrMessage = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Preview_Warn_Text", choiceColumn + 1, tatalColumn);
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return;
}
FineLoggerFactory.getLogger().error(exp.getMessage(), exp);
@ -402,7 +401,7 @@ public class PreviewTablePane extends BasicPane {
fireLoadedListener();
} catch (Exception e) {
if (!(e instanceof CancellationException)) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), e.getMessage(),
null, 0, UIManager.getIcon("OptionPane.errorIcon"));
}
@ -447,7 +446,7 @@ public class PreviewTablePane extends BasicPane {
}
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
previewTablePane.fireLoadedListener();
previewTablePane.showWindow(DesignerContext.getDesignerFrame()).setVisible(true);
@ -468,7 +467,7 @@ public class PreviewTablePane extends BasicPane {
try {
previewTablePane.populateStoreDataSQL();
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
tabPreviewpane.addTab(storeProcedureDataModels[i].getName(), previewTablePane);
}

2
designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java

File diff suppressed because one or more lines are too long

6
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java

@ -29,6 +29,7 @@ import com.fr.design.gui.itableeditorpane.UITableEditorPane;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants;
import com.fr.design.gui.syntax.ui.rtextarea.RTextScrollPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.menu.SeparatorDef;
import com.fr.design.menu.ToolBarDef;
@ -211,10 +212,13 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
isShareCheckBox.setBackground(Color.WHITE);
maxPanel = new MaxMemRowCountPanel();
maxPanel.setBorder(null);
JPanel wrapMaxPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
wrapMaxPanel.add(maxPanel);
wrapMaxPanel.setPreferredSize(new Dimension(250, 20));
UIToolbar editToolBar = ToolBarDef.createJToolBar();
toolBarDef.updateToolBar(editToolBar);
editToolBar.add(isShareCheckBox);
editToolBar.add(maxPanel);
editToolBar.add(wrapMaxPanel);
return editToolBar;
}

7
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DecoratedTableDataPane.java

@ -1,18 +1,17 @@
package com.fr.design.data.tabledata.tabledatapane;
import com.fr.base.FRContext;
import com.fr.data.impl.DecoratedTableData;
import com.fr.design.condition.DSColumnLiteConditionPane;
import com.fr.design.gui.ilist.CheckBoxList;
import com.fr.design.gui.ilist.CheckBoxList.CheckBoxListSelectionChangeListener;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.file.TableDataConfig;
import com.fr.general.data.DataModel;
import com.fr.general.data.TableDataException;
import com.fr.log.FineLoggerFactory;
import com.fr.script.Calculator;
import java.awt.*;
import java.awt.BorderLayout;
public class DecoratedTableDataPane extends AbstractTableDataPane<DecoratedTableData> implements CheckBoxListSelectionChangeListener {
private CheckBoxList availableTableDataNameList;
@ -85,7 +84,7 @@ public class DecoratedTableDataPane extends AbstractTableDataPane<DecoratedTable
columnList.add(model.getColumnName(i));
}
} catch (TableDataException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return;
}

31
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataDefinedPane.java

@ -1,11 +1,12 @@
package com.fr.design.data.tabledata.tabledatapane;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Date;
import com.fr.data.impl.EmbeddedTableData;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import javax.swing.DefaultCellEditor;
import javax.swing.JPanel;
@ -15,14 +16,12 @@ import javax.swing.table.AbstractTableModel;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableColumn;
import com.fr.base.FRContext;
import com.fr.data.impl.EmbeddedTableData;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicPane;
import com.fr.general.ComparatorUtils;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Date;
public class EmbeddedTableDataDefinedPane extends BasicPane{
@ -180,7 +179,7 @@ public class EmbeddedTableDataDefinedPane extends BasicPane{
localDefaultModel.fireTableDataChanged();
checkEnabled();
} catch (CloneNotSupportedException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
@ -193,7 +192,7 @@ public class EmbeddedTableDataDefinedPane extends BasicPane{
try {
tableData = (EmbeddedTableData)(localDefaultModel.getEditableTableData().clone());
} catch (CloneNotSupportedException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return tableData;

45
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java

@ -1,5 +1,25 @@
package com.fr.design.data.tabledata.tabledatapane;
import com.fr.data.impl.EmbeddedTableData;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.date.UIDatePicker;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.general.DateUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.DefaultCellEditor;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableColumn;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
@ -12,29 +32,6 @@ import java.awt.event.MouseEvent;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.BorderFactory;
import javax.swing.DefaultCellEditor;
import com.fr.design.gui.date.UIDatePicker;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableColumn;
import com.fr.base.FRContext;
import com.fr.data.impl.EmbeddedTableData;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.general.DateUtils;
import com.fr.stable.StringUtils;
public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableData> {
private JTable dataJTable ;
@ -214,7 +211,7 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
try {
return (EmbeddedTableData) localDefaultModel.getEditableTableData().clone();
} catch (CloneNotSupportedException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return new EmbeddedTableData();
}
}

12
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java

@ -1,7 +1,6 @@
package com.fr.design.data.tabledata.tabledatapane;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.Parameter;
import com.fr.base.ParameterHelper;
import com.fr.base.Utils;
@ -38,6 +37,7 @@ import com.fr.file.FILEChooserPane;
import com.fr.file.filter.ChooseFileFilter;
import com.fr.general.ComparatorUtils;
import com.fr.general.data.DataSource;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils;
import com.fr.stable.EncodeConstants;
import com.fr.stable.ParameterProvider;
@ -229,7 +229,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
try {
in = url.getSourceStream(params);
} catch (Throwable e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
if (in == null) {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed"),
@ -907,7 +907,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
if (localFileRadioButton.isSelected()) {
String localTextString = StringUtils.trimToNull(localText.getText());
if(StringUtils.isEmpty(localTextString)){
FRContext.getLogger().info("The file path is empty.");
FineLoggerFactory.getLogger().info("The file path is empty.");
loadedTreeModel();
return;
}
@ -915,7 +915,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
} else {
String urlTextString = StringUtils.trimToNull(urlText.getText());
if (StringUtils.isEmpty(urlTextString)){
FRContext.getLogger().info("The url path is empty.");
FineLoggerFactory.getLogger().info("The url path is empty.");
loadedTreeModel();
return;
}
@ -932,13 +932,13 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
if (xmlReader != null) {
xmlReader.readXMLObject(new XMLLayerReader(0));
} else {
FRContext.getLogger().info("The file is wrong or bad, can not create the XMLReader.");
FineLoggerFactory.getLogger().info("The file is wrong or bad, can not create the XMLReader.");
loadedTreeModel();
}
reader.close();
}
} catch (Throwable e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
loadedTreeModel();
}
if(treeModel.getChildCount(treeModel.getRoot()) == 1){

11
designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/StoreProcedureDataWrapper.java

@ -1,7 +1,6 @@
package com.fr.design.data.tabledata.wrapper;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.TableData;
import com.fr.data.impl.storeproc.ProcedureDataModel;
import com.fr.data.impl.storeproc.StoreProcedure;
@ -14,9 +13,11 @@ import com.fr.design.gui.iprogressbar.AutoProgressBar;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.mainframe.DesignerContext;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import javax.swing.*;
import javax.swing.Icon;
import javax.swing.JOptionPane;
import javax.swing.SwingWorker;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -146,7 +147,7 @@ public final class StoreProcedureDataWrapper implements TableDataWrapper {
}
return true;
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return false;
}
@ -217,7 +218,7 @@ public final class StoreProcedureDataWrapper implements TableDataWrapper {
}
} catch (Exception e) {
if (!(e instanceof CancellationException)) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), e.getMessage());
}
loadingBar.close();

5
designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/StoreProcedureNameWrapper.java

@ -1,7 +1,6 @@
package com.fr.design.data.tabledata.wrapper;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.TableData;
import com.fr.data.impl.storeproc.ProcedureDataModel;
import com.fr.data.impl.storeproc.StoreProcedure;
@ -11,7 +10,7 @@ import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.log.FineLoggerFactory;
import com.fr.workspace.WorkContext;
import javax.swing.*;
import javax.swing.Icon;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -77,7 +76,7 @@ public final class StoreProcedureNameWrapper implements TableDataWrapper {
try {
procedureDataModel = DesignTableDataManager.createLazyDataModel(storeProcedure, needLoadingBar)[0];
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}

3
designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/TableDataFactory.java

@ -1,6 +1,5 @@
package com.fr.design.data.tabledata.wrapper;
import com.fr.base.FRContext;
import com.fr.base.TableData;
import com.fr.data.TableDataSource;
import com.fr.data.impl.ClassTableData;
@ -123,7 +122,7 @@ public abstract class TableDataFactory {
}
datapane.populateBean(tabledata); // August:不管tabledata是刚刚新建的还是原来的,一律populate进去,如果出错就是代码写的不好
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
return datapane;

28
designer-base/src/main/java/com/fr/design/dialog/UIDialog.java

@ -1,14 +1,28 @@
package com.fr.design.dialog;
import com.fr.base.FRContext;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import com.fr.log.FineLoggerFactory;
import javax.swing.AbstractAction;
import javax.swing.ActionMap;
import javax.swing.BorderFactory;
import javax.swing.InputMap;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.KeyStroke;
import java.awt.BorderLayout;
import java.awt.Dialog;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.ArrayList;
/**
@ -173,7 +187,7 @@ public abstract class UIDialog extends JDialog {
l.doOk();
} catch (RuntimeException e) {
isDoOKSucceed = false;
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
if (isDoOKSucceed) {

10
designer-base/src/main/java/com/fr/design/editor/editor/DateEditor.java

@ -3,13 +3,13 @@
*/
package com.fr.design.editor.editor;
import com.fr.base.FRContext;
import com.fr.design.gui.date.UIDatePicker;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.GeneralContext;
import com.fr.log.FineLoggerFactory;
import javax.swing.*;
import java.awt.*;
import javax.swing.JComponent;
import java.awt.BorderLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.text.ParseException;
@ -113,7 +113,7 @@ public class DateEditor extends Editor<Date> {
try {
return this.uiDatePicker.getSelectedDate();
} catch (ParseException parseException) {
FRContext.getLogger().error(parseException.getMessage(), parseException);
FineLoggerFactory.getLogger().error(parseException.getMessage(), parseException);
return new Date();
}
}
@ -132,7 +132,7 @@ public class DateEditor extends Editor<Date> {
try {
this.uiDatePicker.setSelectedDate(value);
} catch (ParseException parseException) {
FRContext.getLogger().error(parseException.getMessage(), parseException);
FineLoggerFactory.getLogger().error(parseException.getMessage(), parseException);
}
}

10
designer-base/src/main/java/com/fr/design/extra/PluginFromStorePane.java

@ -1,11 +1,9 @@
package com.fr.design.extra;
import com.fr.base.FRContext;
import com.fr.config.MarketConfig;
import com.fr.design.extra.tradition.callback.UpdateOnlineCallback;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.context.PluginMarker;
@ -15,7 +13,11 @@ import com.fr.plugin.manage.control.ProgressCallback;
import com.fr.plugin.view.PluginView;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.JComponent;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.filechooser.FileNameExtensionFilter;
import java.io.File;
import java.util.List;
@ -206,7 +208,7 @@ public class PluginFromStorePane extends PluginAbstractLoadingViewPane<List<Plug
PluginMarker toPluginMarker = PluginMarker.create(id, latestPluginVersion);
PluginManager.getController().download(pluginMarker, new UpdateOnlineCallback(pluginMarker, toPluginMarker, pane));
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}

7
designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java

@ -1,6 +1,5 @@
package com.fr.design.extra;
import com.fr.base.FRContext;
import com.fr.config.MarketConfig;
import com.fr.design.extra.exe.callback.InstallFromDiskCallback;
import com.fr.design.extra.exe.callback.InstallOnlineCallback;
@ -10,7 +9,6 @@ import com.fr.design.extra.exe.callback.UninstallPluginCallback;
import com.fr.design.extra.exe.callback.UpdateFromDiskCallback;
import com.fr.design.extra.exe.callback.UpdateOnlineCallback;
import com.fr.design.gui.ilable.UILabel;
import com.fr.general.CloudCenter;
import com.fr.general.http.HttpClient;
import com.fr.json.JSONArray;
@ -26,7 +24,8 @@ import com.fr.plugin.manage.control.PluginTaskResult;
import com.fr.plugin.view.PluginView;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import java.io.File;
import java.util.List;
@ -63,7 +62,7 @@ public class PluginOperateUtils {
PluginTask pluginTask = PluginTask.updateTask(currentMarker, toPluginMarker);
PluginControllerHelper.updateOnline(currentMarker, toPluginMarker, new UpdateOnlineCallback(pluginTask, jsCallback));
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}

18
designer-base/src/main/java/com/fr/design/extra/QQLoginWebPane.java

@ -1,7 +1,8 @@
package com.fr.design.extra;
import com.fr.base.FRContext;
import com.fr.general.*;
import com.fr.general.CloudCenter;
import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory;
import javafx.application.Platform;
import javafx.beans.property.BooleanProperty;
@ -25,12 +26,17 @@ import javafx.scene.paint.Color;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebEvent;
import javafx.scene.web.WebView;
import javafx.stage.*;
import javafx.stage.Modality;
import javafx.stage.Screen;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import javafx.stage.WindowEvent;
import javafx.util.Callback;
import netscape.javascript.JSObject;
import javax.swing.*;
import java.awt.*;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import java.awt.Toolkit;
/**
* Created by zhaohehe on 16/7/28.
@ -79,7 +85,7 @@ public class QQLoginWebPane extends JFXPanel {
primaryStage.setY(Screen.getPrimary().getBounds().getHeight() + DEFAULT_PRIMARYSTAGE_HEIGHT);
primaryStage.show();
} catch (Exception e) {
FRContext.getLogger().info(e.getMessage());
FineLoggerFactory.getLogger().info(e.getMessage());
}
webEngine.setConfirmHandler(new Callback<String, Boolean>() {
@Override

22
designer-base/src/main/java/com/fr/design/formula/FormulaPane.java

@ -19,7 +19,6 @@ import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.parser.FRLexer;
import com.fr.parser.FRParser;
@ -28,7 +27,17 @@ import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils;
import com.fr.stable.script.Expression;
import javax.swing.*;
import javax.swing.BorderFactory;
import javax.swing.DefaultListCellRenderer;
import javax.swing.DefaultListModel;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JTree;
import javax.swing.SwingUtilities;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.event.TreeSelectionEvent;
@ -38,7 +47,10 @@ import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.MutableTreeNode;
import javax.swing.tree.TreePath;
import java.awt.*;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
@ -566,7 +578,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
try {
expression = parser.parse();
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
// alex:继续往下面走,expression为null时告知不合法公式
}
@ -1035,6 +1047,6 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
buffer.append("|");
buffer.append("\n");
}
FRContext.getLogger().debug(buffer.toString());
FineLoggerFactory.getLogger().debug(buffer.toString());
}
}

7
designer-base/src/main/java/com/fr/design/formula/FunctionConstants.java

@ -1,6 +1,5 @@
package com.fr.design.formula;
import com.fr.base.FRContext;
import com.fr.file.FunctionConfig;
import com.fr.function.AVERAGE;
import com.fr.function.CHAR;
@ -78,9 +77,9 @@ public final class FunctionConstants {
try {
classFilePath = URLDecoder.decode(classFilePath, EncodeConstants.ENCODING_UTF_8);
} catch (UnsupportedEncodingException e1) {
FRContext.getLogger().error(e1.getMessage(), e1);
FineLoggerFactory.getLogger().error(e1.getMessage(), e1);
}
FRContext.getLogger().info("ClassFilePath:" + classFilePath);
FineLoggerFactory.getLogger().info("ClassFilePath:" + classFilePath);
if (isCustomFormulaPath(classFilePath)) {
continue;
}
@ -193,7 +192,7 @@ public final class FunctionConstants {
classNameList.add(entryName.substring(classPath.length() + 1));
}
} catch (IOException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
} else {
File dir = new File(filePath);

14
designer-base/src/main/java/com/fr/design/formula/JavaEditorPane.java

@ -8,7 +8,6 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.EncodeConstants;
import com.fr.stable.JavaCompileInfo;
@ -17,8 +16,13 @@ import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
import javax.swing.*;
import java.awt.*;
import javax.swing.AbstractAction;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.SwingWorker;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.ByteArrayInputStream;
@ -51,7 +55,7 @@ public class JavaEditorPane extends BasicPane {
try {
return StableUtils.inputStream2String(in, EncodeConstants.ENCODING_UTF_8);
} catch (IOException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
return null;
@ -115,7 +119,7 @@ public class JavaEditorPane extends BasicPane {
try {
return new ByteArrayInputStream(WorkContext.getWorkResource().readFully(StableUtils.pathJoin(ProjectConstants.CLASSES_NAME, javaPath)));
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return null;
}

4
designer-base/src/main/java/com/fr/design/gui/controlpane/CommonShortCutHandlers.java

@ -1,11 +1,11 @@
package com.fr.design.gui.controlpane;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.design.gui.ilist.JNameEdList;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable;
@ -71,7 +71,7 @@ public class CommonShortCutHandlers {
listControlPane.addNameable(newNameable, listControlPane.getSelectedIndex() + 1);
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}

10
designer-base/src/main/java/com/fr/design/gui/core/CustomWidgetOption.java

@ -1,9 +1,9 @@
package com.fr.design.gui.core;
import javax.swing.Icon;
import com.fr.base.FRContext;
import com.fr.form.ui.Widget;
import com.fr.log.FineLoggerFactory;
import javax.swing.Icon;
public class CustomWidgetOption extends WidgetOption {
private static final long serialVersionUID = -8144214820100962842L;
@ -23,9 +23,9 @@ public class CustomWidgetOption extends WidgetOption {
Widget ins = cls.newInstance();
return ins ;
} catch (InstantiationException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
} catch (IllegalAccessException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return null;

9
designer-base/src/main/java/com/fr/design/gui/date/SingleObjectComboBoxModel.java

@ -1,12 +1,11 @@
package com.fr.design.gui.date;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.fr.log.FineLoggerFactory;
import javax.swing.AbstractListModel;
import javax.swing.ComboBoxModel;
import com.fr.base.FRContext;
import java.text.SimpleDateFormat;
import java.util.Date;
public class SingleObjectComboBoxModel extends AbstractListModel implements ComboBoxModel {
private SimpleDateFormat dateFormat;
@ -35,7 +34,7 @@ public class SingleObjectComboBoxModel extends AbstractListModel implements Comb
try {
selectedDate = this.dateFormat.format((Date) anItem);
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
} else {
try {

17
designer-base/src/main/java/com/fr/design/gui/date/UIDatePicker.java

@ -1,19 +1,26 @@
package com.fr.design.gui.date;
import com.fr.base.FRContext;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxUI;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.ComparatorUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import javax.swing.*;
import javax.swing.BorderFactory;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.plaf.ComboBoxUI;
import javax.swing.plaf.basic.BasicComboPopup;
import javax.swing.plaf.basic.ComboPopup;
import java.awt.*;
import java.awt.BorderLayout;
import java.awt.Cursor;
import java.awt.LayoutManager;
import java.awt.event.MouseEvent;
import java.io.Serializable;
import java.text.ParseException;
@ -213,7 +220,7 @@ public class UIDatePicker extends UIComboBox implements Serializable {
calendarPanel.updateHMS();
}
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
} else if (ComparatorUtils.equals(oldValue, Boolean.TRUE)
&& ComparatorUtils.equals(newValue, Boolean.FALSE)) { //HIDE

15
designer-base/src/main/java/com/fr/design/gui/demo/LoadingPaneDemo.java

@ -3,16 +3,15 @@
*/
package com.fr.design.gui.demo;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JPanel;
import com.fr.base.FRContext;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.gui.frpane.LoadingBasicPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicDialog;
import com.fr.log.FineLoggerFactory;
import javax.swing.JPanel;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* Created by IntelliJ IDEA.
@ -35,7 +34,7 @@ public class LoadingPaneDemo extends JPanel {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
container.add(new UIButton(i + "adfadwdadawdwad"));
}

10
designer-base/src/main/java/com/fr/design/gui/frpane/LoadingBasicPaneTest.java

@ -3,11 +3,11 @@
*/
package com.fr.design.gui.frpane;
import javax.swing.JPanel;
import com.fr.base.FRContext;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.log.FineLoggerFactory;
import javax.swing.JPanel;
/**
@ -23,7 +23,7 @@ public class LoadingBasicPaneTest {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
container.add(new UIButton(i + "adfadwdadawdwad"));
}

33
designer-base/src/main/java/com/fr/design/gui/frpane/UIBubbleFloatPane.java

@ -1,19 +1,32 @@
package com.fr.design.gui.frpane;
import java.awt.*;
import java.awt.event.AWTEventListener;
import java.awt.event.MouseEvent;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import com.fr.base.FRContext;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.UIDialog;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.Constants;
import com.sun.awt.AWTUtilities;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.awt.AWTEvent;
import java.awt.BasicStroke;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dialog;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Polygon;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.Stroke;
import java.awt.Toolkit;
import java.awt.Window;
import java.awt.event.AWTEventListener;
import java.awt.event.MouseEvent;
/**
* @author Jerry
* 非模态悬浮对话框气泡形状
@ -300,7 +313,7 @@ public abstract class UIBubbleFloatPane<T> extends BasicBeanPane<T> {
try {
AWTUtilities.setWindowShape(CustomShapedDialog.this, this.getCustomShap());
} catch (UnsupportedOperationException e) {
FRContext.getLogger().info("Not support");
FineLoggerFactory.getLogger().info("Not support");
}
final JPanel contentPane = (JPanel) this.getContentPane();
this.setLayout(null);

7
designer-base/src/main/java/com/fr/design/gui/icombobox/ExtendedComboBoxTest.java

@ -1,18 +1,17 @@
package com.fr.design.gui.icombobox;
import java.awt.BorderLayout;
import com.fr.log.FineLoggerFactory;
import javax.swing.JFrame;
import javax.swing.UIManager;
import com.fr.base.FRContext;
import java.awt.BorderLayout;
public class ExtendedComboBoxTest {
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
final ExtendedComboBox cb = new ExtendedComboBox(

19
designer-base/src/main/java/com/fr/design/gui/icombobox/LazyComboBoxTest.java

@ -3,19 +3,18 @@
*/
package com.fr.design.gui.icombobox;
import java.awt.BorderLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.log.FineLoggerFactory;
import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import com.fr.base.FRContext;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
import java.awt.BorderLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
/**
* @author richer
@ -26,7 +25,7 @@ public class LazyComboBoxTest {
try {
UIManager.setLookAndFeel(new WindowsLookAndFeel());
} catch (UnsupportedLookAndFeelException e1) {
FRContext.getLogger().error(e1.getMessage(), e1);
FineLoggerFactory.getLogger().error(e1.getMessage(), e1);
}
JFrame f = new JFrame();
JPanel p = (JPanel) f.getContentPane();
@ -40,7 +39,7 @@ public class LazyComboBoxTest {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return m;
}

13
designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java

@ -1,7 +1,6 @@
package com.fr.design.gui.ilist;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.data.core.DataCoreUtils;
import com.fr.data.core.db.TableProcedure;
import com.fr.data.core.db.dialect.base.key.check.DataBaseDetail;
@ -13,11 +12,17 @@ import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.dnd.SerializableTransferable;
import com.fr.file.ConnectionConfig;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import javax.swing.DefaultListCellRenderer;
import javax.swing.DefaultListModel;
import javax.swing.Icon;
import javax.swing.JList;
import javax.swing.ListSelectionModel;
import javax.swing.SwingWorker;
import java.awt.Component;
import java.awt.dnd.DnDConstants;
import java.awt.dnd.DragGestureEvent;
import java.awt.dnd.DragGestureListener;
@ -111,7 +116,7 @@ public class TableViewList extends UIList {
} catch (Exception e) {
if (!(e instanceof InterruptedException) && !(e instanceof CancellationException)) {
TableViewList.this.setModel(failed);
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}

6
designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableModelAdapter.java

@ -1,8 +1,8 @@
package com.fr.design.gui.itableeditorpane;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.design.mainframe.DesignerContext;
import com.fr.log.FineLoggerFactory;
import javax.swing.JOptionPane;
import javax.swing.JTable;
@ -166,7 +166,7 @@ public abstract class UITableModelAdapter<T extends Object> extends AbstractTabl
try {
table.getCellEditor().stopCellEditing();
} catch (Exception ee) {
FRContext.getLogger().error(ee.getMessage(), ee);
FineLoggerFactory.getLogger().error(ee.getMessage(), ee);
}
}
}
@ -241,7 +241,7 @@ public abstract class UITableModelAdapter<T extends Object> extends AbstractTabl
try {
table.getCellEditor().stopCellEditing();
} catch (Exception ee) {
FRContext.getLogger().error(ee.getMessage(), ee);
FineLoggerFactory.getLogger().error(ee.getMessage(), ee);
}
}
if (getRowCount() < 1 || selectedRow.length < 0) {

17
designer-base/src/main/java/com/fr/design/gui/itooltip/MultiLineToolTipUI.java

@ -1,5 +1,12 @@
package com.fr.design.gui.itooltip;
import com.fr.base.GraphHelper;
import com.fr.log.FineLoggerFactory;
import javax.swing.JComponent;
import javax.swing.JToolTip;
import javax.swing.SwingUtilities;
import javax.swing.plaf.ToolTipUI;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FontMetrics;
@ -13,14 +20,6 @@ import java.io.StringReader;
import java.util.Enumeration;
import java.util.Vector;
import javax.swing.JComponent;
import javax.swing.JToolTip;
import javax.swing.SwingUtilities;
import javax.swing.plaf.ToolTipUI;
import com.fr.base.FRContext;
import com.fr.base.GraphHelper;
public class MultiLineToolTipUI extends ToolTipUI {
private String[] strs;
@ -65,7 +64,7 @@ public class MultiLineToolTipUI extends ToolTipUI {
v.addElement(line);
}
} catch (IOException ex) {
FRContext.getLogger().error(ex.getMessage(), ex);
FineLoggerFactory.getLogger().error(ex.getMessage(), ex);
}
int lines = v.size();
if (lines < 1) {

20
designer-base/src/main/java/com/fr/design/gui/itooltip/UIToolTip.java

@ -1,12 +1,22 @@
package com.fr.design.gui.itooltip;
import com.fr.base.FRContext;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JToolTip;
import javax.swing.ToolTipManager;
import java.awt.AWTException;
import java.awt.Container;
import java.awt.Point;
import java.awt.Robot;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
/**
* Created with IntelliJ IDEA.
@ -39,7 +49,7 @@ public class UIToolTip extends JToolTip{
}
});
} catch (AWTException e) {
FRContext.getLogger().error(e.getMessage(),e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
this.addMouseWheelListener(new MouseWheelListener() {

18
designer-base/src/main/java/com/fr/design/gui/itooltip/UIToolTipUI.java

@ -1,11 +1,21 @@
package com.fr.design.gui.itooltip;
import com.fr.base.FRContext;
import com.fr.base.GraphHelper;
import com.fr.log.FineLoggerFactory;
import javax.swing.*;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JComponent;
import javax.swing.JToolTip;
import javax.swing.SwingUtilities;
import javax.swing.plaf.ToolTipUI;
import java.awt.*;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FontMetrics;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.geom.GeneralPath;
import java.io.BufferedReader;
import java.io.IOException;
@ -98,7 +108,7 @@ public class UIToolTipUI extends ToolTipUI {
v.addElement(line);
}
} catch (IOException ex) {
FRContext.getLogger().error(ex.getMessage(), ex);
FineLoggerFactory.getLogger().error(ex.getMessage(), ex);
}
int lines = v.size();
if (lines < 1) {

13
designer-base/src/main/java/com/fr/design/icon/LockIcon.java

@ -1,17 +1,16 @@
package com.fr.design.icon;
import com.fr.base.BaseUtils;
import com.fr.log.FineLoggerFactory;
import javax.swing.GrayFilter;
import javax.swing.ImageIcon;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.MediaTracker;
import java.awt.image.ImageObserver;
import javax.swing.GrayFilter;
import javax.swing.ImageIcon;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
public class LockIcon extends ImageIcon {
private final static Image lockImage = BaseUtils.readImage("/com/fr/design/images/gui/locked.gif");
@ -55,7 +54,7 @@ public class LockIcon extends ImageIcon {
try {
tracker.waitForID(0, 0);
} catch (InterruptedException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
loadStatus = tracker.statusID(0, false);

13
designer-base/src/main/java/com/fr/design/icon/WarningIcon.java

@ -1,17 +1,16 @@
package com.fr.design.icon;
import com.fr.base.BaseUtils;
import com.fr.log.FineLoggerFactory;
import javax.swing.GrayFilter;
import javax.swing.ImageIcon;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.MediaTracker;
import java.awt.image.ImageObserver;
import javax.swing.GrayFilter;
import javax.swing.ImageIcon;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
/**
* 警告图片
*
@ -59,7 +58,7 @@ public class WarningIcon extends ImageIcon {
try {
tracker.waitForID(0, 0);
} catch (InterruptedException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
tracker.statusID(0, false);

11
designer-base/src/main/java/com/fr/design/mainframe/DesignAuthorityEventType.java

@ -0,0 +1,11 @@
package com.fr.design.mainframe;
import com.fr.event.Event;
public enum DesignAuthorityEventType implements Event<DesignerFrame> {
// 退出权限编辑
StartEdit,
// 进入权限编辑
StopEdit;
}

2
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -39,6 +39,7 @@ import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus;
import com.fr.design.menu.MenuManager;
import com.fr.design.menu.ShortCut;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.event.EventDispatcher;
import com.fr.exception.DecryptTemplateException;
import com.fr.file.FILE;
import com.fr.file.FILEFactory;
@ -333,6 +334,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
needToAddAuhtorityPaint();
refreshDottedLine();
fireAuthorityStateToNomal();
EventDispatcher.fire(DesignAuthorityEventType.StopEdit, DesignerFrame.this);
}
/**

4
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -636,7 +636,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
try {
file.mkfile();
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
@ -666,7 +666,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
try {
this.getTarget().export(editingFILE.asOutputStream());
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), e.getMessage(), "Save Error", JOptionPane.ERROR_MESSAGE);
return false;
}

19
designer-base/src/main/java/com/fr/design/mainframe/dnd/ArrayListTransferHandler.java

@ -3,18 +3,17 @@
*/
package com.fr.design.mainframe.dnd;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.io.IOException;
import java.util.ArrayList;
import com.fr.log.FineLoggerFactory;
import javax.swing.DefaultListModel;
import javax.swing.JComponent;
import javax.swing.JList;
import javax.swing.TransferHandler;
import com.fr.base.FRContext;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.io.IOException;
import java.util.ArrayList;
/**
* Used for JList.
@ -33,7 +32,7 @@ public class ArrayListTransferHandler extends TransferHandler {
try {
localArrayListFlavor = new DataFlavor(localArrayListType);
} catch (ClassNotFoundException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
serialArrayListFlavor = new DataFlavor(ArrayList.class, "ArrayList");
@ -55,10 +54,10 @@ public class ArrayListTransferHandler extends TransferHandler {
return false;
}
} catch (UnsupportedFlavorException ufe) {
FRContext.getLogger().error(ufe.getMessage(), ufe);
FineLoggerFactory.getLogger().error(ufe.getMessage(), ufe);
return false;
} catch (IOException ioe) {
FRContext.getLogger().error(ioe.getMessage(), ioe);
FineLoggerFactory.getLogger().error(ioe.getMessage(), ioe);
return false;
}

6
designer-base/src/main/java/com/fr/design/mainframe/dnd/ArrayListTransferable.java

@ -1,13 +1,13 @@
package com.fr.design.mainframe.dnd;
import com.fr.log.FineLoggerFactory;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.util.ArrayList;
import java.util.List;
import com.fr.base.FRContext;
public class ArrayListTransferable implements Transferable {
private DataFlavor localArrayListFlavor;
private DataFlavor serialArrayListFlavor;
@ -21,7 +21,7 @@ public class ArrayListTransferable implements Transferable {
try {
localArrayListFlavor = new DataFlavor(localArrayListType);
} catch (ClassNotFoundException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
serialArrayListFlavor = new DataFlavor(ArrayList.class, "ArrayList");

8
designer-base/src/main/java/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java

@ -7,10 +7,10 @@ import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.SiteCenterToken;
import com.fr.general.CloudCenter;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralUtils;
import com.fr.general.IOUtils;
import com.fr.general.CloudCenter;
import com.fr.general.http.HttpClient;
import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
@ -132,11 +132,11 @@ public class TemplateInfoCollector<T extends BaseBook> implements Serializable,
}
xmlInputStream.close();
} catch (FileNotFoundException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
} catch (IOException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
} catch (XMLStreamException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}

9
designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -6,6 +6,7 @@ package com.fr.design.mainframe.toolbar;
import com.fr.base.FRContext;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignState;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.community.BBSAction;
@ -24,6 +25,7 @@ import com.fr.design.actions.file.OpenTemplateAction;
import com.fr.design.actions.file.PreferenceAction;
import com.fr.design.actions.file.SwitchExistEnv;
import com.fr.design.actions.help.AboutAction;
import com.fr.design.actions.help.FineUIAction;
import com.fr.design.actions.help.TutorialAction;
import com.fr.design.actions.help.WebDemoAction;
import com.fr.design.actions.help.alphafine.AlphaFineAction;
@ -499,9 +501,14 @@ public abstract class ToolBarMenuDock {
if (AlphaFineConfigManager.isALPHALicAvailable()) {
shortCuts.add(new AlphaFineAction());
}
shortCuts.add(SeparatorDef.DEFAULT);
if (DesignerEnvManager.getEnvManager().isOpenDebug()) {
shortCuts.add(new FineUIAction());
}
shortCuts.add(new AboutAction());
return shortCuts.toArray(new ShortCut[shortCuts.size()]);
return shortCuts.toArray(new ShortCut[0]);
}
/**

10
designer-base/src/main/java/com/fr/design/mainframe/widget/renderer/IconCellRenderer.java

@ -1,11 +1,13 @@
package com.fr.design.mainframe.widget.renderer;
import java.awt.*;
import com.fr.base.FRContext;
import com.fr.base.Icon;
import com.fr.base.IconManager;
import com.fr.form.ui.WidgetInfoConfig;
import com.fr.log.FineLoggerFactory;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
public class IconCellRenderer extends GenericCellRenderer {
private Image img;
@ -22,7 +24,7 @@ public class IconCellRenderer extends GenericCellRenderer {
this.setImage(icon == null ? null : icon.getImage());
} catch (CloneNotSupportedException e) {
this.setImage(null);
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}

16
designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java

@ -1,6 +1,5 @@
package com.fr.design.module;
import com.fr.base.FRContext;
import com.fr.base.chart.BaseChartCollection;
import com.fr.design.gui.chart.BaseChartPropertyPane;
import com.fr.design.gui.chart.MiddleChartComponent;
@ -15,9 +14,12 @@ import com.fr.design.parameter.HierarchyTreePane;
import com.fr.design.parameter.ParameterDesignerProvider;
import com.fr.design.parameter.ParameterReader;
import com.fr.form.ui.Widget;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StableUtils;
import java.awt.*;
import java.awt.Dialog;
import java.awt.Frame;
import java.awt.Window;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
@ -122,7 +124,7 @@ public class DesignModuleFactory {
try {
return instance.paraPropertyPane.newInstance();
} catch (Exception e) {
FRContext.getLogger().error("Error in Para PropertyPane");
FineLoggerFactory.getLogger().error("Error in Para PropertyPane");
}
}
return null;
@ -137,7 +139,7 @@ public class DesignModuleFactory {
try {
return (ParameterDesignerProvider) instance.formParaDesigner.newInstance();
} catch (Exception e) {
FRContext.getLogger().error("error in form para designer");
FineLoggerFactory.getLogger().error("error in form para designer");
}
}
return null;
@ -172,9 +174,9 @@ public class DesignModuleFactory {
bcc = instance.chartComponentClass.newInstance();
bcc.populate(collection);
} catch (InstantiationException e) {
FRContext.getLogger().error("Error in ChartComponent instant", e);
FineLoggerFactory.getLogger().error("Error in ChartComponent instant", e);
} catch (IllegalAccessException e) {
FRContext.getLogger().error("Error in Access", e);
FineLoggerFactory.getLogger().error("Error in Access", e);
}
}
return bcc;
@ -195,7 +197,7 @@ public class DesignModuleFactory {
}
return c.newInstance(window);
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return null;
}

28
designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java

@ -11,18 +11,29 @@ import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignAuthorityEventType;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.mainframe.DockingView;
import com.fr.design.menu.ToolBarDef;
import javax.swing.*;
import com.fr.event.Event;
import com.fr.event.EventDispatcher;
import com.fr.event.Listener;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTree;
import javax.swing.ScrollPaneConstants;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.tree.DefaultTreeSelectionModel;
import javax.swing.tree.TreeNode;
import javax.swing.tree.TreePath;
import java.awt.*;
import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
@ -40,6 +51,15 @@ public class ReportAndFSManagePane extends DockingView implements Prepare4DataSo
private static ReportAndFSManagePane singleton = new ReportAndFSManagePane();
private static RoleTree roleTree;
static {
EventDispatcher.listen(DesignAuthorityEventType.StopEdit, new Listener<DesignerFrame>() {
public void on(Event event, DesignerFrame param) {
DefaultTreeSelectionModel model = roleTree.getCheckBoxTreeSelectionModel();
model.removeSelectionPaths(model.getSelectionPaths());
}
});
}
private RefreshAction refreshAction = new RefreshAction();
private UIHeadGroup buttonGroup;
private RoleSourceOP op;

4
designer-base/src/main/java/com/fr/design/style/BorderPane.java

@ -5,7 +5,6 @@ package com.fr.design.style;
import com.fr.base.BaseUtils;
import com.fr.base.CellBorderStyle;
import com.fr.base.FRContext;
import com.fr.base.GraphHelper;
import com.fr.base.Style;
import com.fr.design.dialog.BasicPane;
@ -16,6 +15,7 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.VerticalFlowLayout;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.Constants;
import com.fr.stable.CoreConstants;
@ -243,7 +243,7 @@ public class BorderPane extends BasicPane {
this.cellBorderStyle = (CellBorderStyle)cellBorderStyle.clone();
}
} catch (CloneNotSupportedException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
this.insideMode = insideMode;
// ben 这里也有问题,CellBorderStyle的 linestyle和color很可能不止一种

53
designer-base/src/main/java/com/fr/design/ui/Assistant.java

@ -0,0 +1,53 @@
package com.fr.design.ui;
import com.fr.stable.StringUtils;
import com.teamdev.jxbrowser.chromium.Browser;
import com.teamdev.jxbrowser.chromium.BrowserContext;
import com.teamdev.jxbrowser.chromium.ProtocolService;
import com.teamdev.jxbrowser.chromium.URLResponse;
import java.io.DataInputStream;
import java.io.InputStream;
/**
* @author richie
* @version 10.0
* Created by richie on 2019-03-07
*/
public class Assistant {
public static URLResponse inputStream2Response(InputStream inputStream, String filePath) throws Exception {
URLResponse response = new URLResponse();
DataInputStream stream = new DataInputStream(inputStream);
byte[] data = new byte[stream.available()];
stream.readFully(data);
response.setData(data);
String mimeType = getMimeType(filePath);
response.getHeaders().setHeader("Content-Type", mimeType);
return response;
}
private static String getMimeType(String path) {
if (StringUtils.isBlank(path)) {
return "text/html";
}
if (path.endsWith(".html")) {
return "text/html";
}
if (path.endsWith(".css")) {
return "text/css";
}
if (path.endsWith(".js")) {
return "text/javascript";
}
return "text/html";
}
public static void setEmbProtocolHandler(Browser browser, EmbProtocolHandler handler) {
BrowserContext browserContext = browser.getContext();
ProtocolService protocolService = browserContext.getProtocolService();
// 支持读取jar包中文件的自定义协议————emb:/com/fr/design/images/bbs.png
protocolService.setProtocolHandler("emb", handler);
}
}

83
designer-base/src/main/java/com/fr/design/ui/EmbProtocolHandler.java

@ -0,0 +1,83 @@
package com.fr.design.ui;
import com.fr.general.IOUtils;
import com.fr.stable.StringUtils;
import com.fr.web.struct.AssembleComponent;
import com.fr.web.struct.AtomBuilder;
import com.fr.web.struct.PathGroup;
import com.fr.web.struct.category.ScriptPath;
import com.fr.web.struct.category.StylePath;
import com.teamdev.jxbrowser.chromium.ProtocolHandler;
import com.teamdev.jxbrowser.chromium.URLRequest;
import com.teamdev.jxbrowser.chromium.URLResponse;
import java.io.InputStream;
/**
* @author richie
* @version 10.0
* Created by richie on 2019-03-07
*/
public class EmbProtocolHandler implements ProtocolHandler {
private AssembleComponent component;
public EmbProtocolHandler() {
}
public EmbProtocolHandler(AssembleComponent component) {
this.component = component;
}
@Override
public URLResponse onRequest(URLRequest req) {
try {
String path = req.getURL();
if (path.startsWith("emb:dynamic")) {
URLResponse response = new URLResponse();
response.setData(htmlText().getBytes());
response.getHeaders().setHeader("Content-Type", "text/html");
return response;
} else {
int index = path.indexOf("=");
if (index > 0) {
path = path.substring(index + 1);
} else {
path = path.substring(4);
}
InputStream inputStream = IOUtils.readResource(path);
return Assistant.inputStream2Response(inputStream, path);
}
} catch (Exception ignore) {
}
return null;
}
private String htmlText() {
PathGroup pathGroup = AtomBuilder.create().buildAssembleFilePath(ModernRequestClient.KEY, component);
StylePath[] stylePaths = pathGroup.toStylePathGroup();
StringBuilder styleText = new StringBuilder();
for (StylePath path : stylePaths) {
if (StringUtils.isNotBlank(path.toFilePath())) {
styleText.append("<link rel=\"stylesheet\" href=\"emb:");
styleText.append(path.toFilePath());
styleText.append("\"/>");
}
}
String result = ModernUIConstants.HTML_TPL.replaceAll("##style##", styleText.toString());
ScriptPath[] scriptPaths = pathGroup.toScriptPathGroup();
StringBuilder scriptText = new StringBuilder();
for (ScriptPath path : scriptPaths) {
if (StringUtils.isNotBlank(path.toFilePath())) {
scriptText.append("<script src=\"emb:");
scriptText.append(path.toFilePath());
scriptText.append("\"></script>");
}
}
result = result.replaceAll("##script##", scriptText.toString());
return result;
}
}

22
designer-base/src/main/java/com/fr/design/ui/ModernRequestClient.java

@ -0,0 +1,22 @@
package com.fr.design.ui;
import com.fr.web.struct.browser.RequestClient;
/**
* @author richie
* @version 10.0
* Created by richie on 2019-03-07
*/
public enum ModernRequestClient implements RequestClient {
KEY;
@Override
public boolean isIE() {
return false;
}
@Override
public boolean isLowIEVersion() {
return false;
}}

15
designer-base/src/main/java/com/fr/design/ui/ModernUIConstants.java

@ -0,0 +1,15 @@
package com.fr.design.ui;
import com.fr.general.IOUtils;
/**
* @author richie
* @version 10.0
* Created by richie on 2019-03-05
*/
class ModernUIConstants {
static final String SCRIPT_INIT_NAME_SPACE = IOUtils.readResourceAsString("/com/fr/design/ui/InitNameSpace.js");
static final String HTML_TPL = IOUtils.readResourceAsString("/com/fr/design/ui/tpl.html");
}

182
designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java

@ -0,0 +1,182 @@
package com.fr.design.ui;
import com.fr.design.DesignerEnvManager;
import com.fr.design.dialog.BasicPane;
import com.fr.web.struct.AssembleComponent;
import com.teamdev.jxbrowser.chromium.Browser;
import com.teamdev.jxbrowser.chromium.BrowserPreferences;
import com.teamdev.jxbrowser.chromium.JSValue;
import com.teamdev.jxbrowser.chromium.events.FinishLoadingEvent;
import com.teamdev.jxbrowser.chromium.events.LoadAdapter;
import com.teamdev.jxbrowser.chromium.events.LoadListener;
import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter;
import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent;
import com.teamdev.jxbrowser.chromium.events.ScriptContextListener;
import com.teamdev.jxbrowser.chromium.swing.BrowserView;
import javax.swing.*;
import java.awt.*;
/**
* @author richie
* @version 10.0
* Created by richie on 2019-03-04
* 用于加载html5的Swing容器可以在设计选项设置中打开调试窗口示例可查看com.fr.design.ui.ModernUIPaneTest
*/
public class ModernUIPane<T> extends BasicPane {
private Browser browser;
private String namespace = "Pool";
private String variable = "data";
private String expression = "update()";
private ModernUIPane() {
initialize();
}
private void initialize() {
if (browser == null) {
setLayout(new BorderLayout());
BrowserPreferences.setChromiumSwitches("--disable-google-traffic");
if (DesignerEnvManager.getEnvManager().isOpenDebug()) {
JSplitPane splitPane = new JSplitPane();
add(splitPane, BorderLayout.CENTER);
splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
splitPane.setDividerLocation(500);
BrowserPreferences.setChromiumSwitches("--remote-debugging-port=9222");
initializeBrowser();
splitPane.setLeftComponent(new BrowserView(browser));
Browser debugger = new Browser();
debugger.loadURL(browser.getRemoteDebuggingURL());
BrowserView debuggerView = new BrowserView(debugger);
splitPane.setRightComponent(debuggerView);
} else {
initializeBrowser();
add(new BrowserView(browser), BorderLayout.CENTER);
}
}
}
private void initializeBrowser() {
browser = new Browser();
// 初始化的时候,就把命名空间对象初始化好,确保window.a.b.c("a.b.c"为命名空间)对象都是初始化过的
browser.addScriptContextListener(new ScriptContextAdapter() {
@Override
public void onScriptContextCreated(ScriptContextEvent event) {
event.getBrowser().executeJavaScript(String.format(ModernUIConstants.SCRIPT_INIT_NAME_SPACE, namespace));
}
});
}
@Override
protected String title4PopupWindow() {
return "Modern";
}
public void populate(final T t) {
browser.addLoadListener(new LoadAdapter() {
@Override
public void onFinishLoadingFrame(FinishLoadingEvent event) {
if (event.isMainFrame()) {
JSValue ns = event.getBrowser().executeJavaScriptAndReturnValue("window." + namespace);
ns.asObject().setProperty(variable, t);
}
}
});
}
public T update() {
JSValue jsValue = browser.executeJavaScriptAndReturnValue("window." + namespace + "." + expression);
if (jsValue.isObject()) {
return (T)jsValue.asJavaObject();
}
return null;
}
public static class Builder<T> {
private ModernUIPane<T> pane = new ModernUIPane<>();
public Builder<T> prepare(ScriptContextListener contextListener) {
pane.browser.addScriptContextListener(contextListener);
return this;
}
public Builder<T> prepare(LoadListener loadListener) {
pane.browser.addLoadListener(loadListener);
return this;
}
/**
* 加载jar包中的资源
* @param path 资源路径
*/
public Builder<T> withEMB(final String path) {
Assistant.setEmbProtocolHandler(pane.browser, new EmbProtocolHandler());
pane.browser.loadURL("emb:" + path);
return this;
}
/**
* 加载url指向的资源
* @param url 文件的地址
*/
public Builder<T> withURL(final String url) {
Assistant.setEmbProtocolHandler(pane.browser, new EmbProtocolHandler());
pane.browser.loadURL(url);
return this;
}
/**
* 加载Atom组件
* @param component Atom组件
*/
public Builder<T> withComponent(AssembleComponent component) {
Assistant.setEmbProtocolHandler(pane.browser, new EmbProtocolHandler(component));
pane.browser.loadURL("emb:dynamic");
return this;
}
/**
* 加载html文本内容
* @param html 要加载html文本内容
*/
public Builder<T> withHTML(String html) {
Assistant.setEmbProtocolHandler(pane.browser, new EmbProtocolHandler());
pane.browser.loadHTML(html);
return this;
}
/**
* 设置该前端页面做数据交换所使用的对象
* @param namespace 对象名
*/
public Builder<T> namespace(String namespace) {
pane.namespace = namespace;
return this;
}
/**
* java端往js端传数据时使用的变量名字
* @param name 变量的名字
*/
public Builder<T> variable(String name) {
pane.variable = name;
return this;
}
/**
* js端往java端传数据时执行的函数表达式
* @param expression 函数表达式
*/
public Builder<T> expression(String expression) {
pane.expression = expression;
return this;
}
public ModernUIPane<T> build() {
return pane;
}
}
}

3
designer-base/src/main/java/com/fr/design/utils/BrowseUtils.java

@ -1,6 +1,5 @@
package com.fr.design.utils;
import com.fr.base.FRContext;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.OperatingSystem;
import com.fr.stable.StringUtils;
@ -43,7 +42,7 @@ public class BrowseUtils {
public static void browser(String url) {
if (StringUtils.isEmpty(url)) {
FRContext.getLogger().info("The URL is empty!");
FineLoggerFactory.getLogger().info("The URL is empty!");
return;
}
try {

18
designer-base/src/main/java/com/fr/design/utils/DesignUtils.java

@ -1,7 +1,6 @@
package com.fr.design.utils;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.FeedBackInfo;
import com.fr.base.ServerConfig;
import com.fr.design.DesignerEnvManager;
@ -22,8 +21,11 @@ import com.fr.stable.StringUtils;
import com.fr.start.ServerStarter;
import com.fr.workspace.WorkContext;
import javax.swing.*;
import java.awt.*;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import java.awt.Desktop;
import java.awt.Font;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
@ -95,13 +97,13 @@ public class DesignUtils {
writer.flush();
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
} finally {
try {
writer.close();
socket.close();
} catch (IOException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}
@ -237,7 +239,7 @@ public class DesignUtils {
//比如想在中文或英文系统里用韩文设计器
guiFRFont = getNamedFont("Dialog");
if (!guiFRFont.canDisplay(displayChar)) {
FRContext.getLogger().error(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_SimSun_Not_Found"));
FineLoggerFactory.getLogger().error(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_SimSun_Not_Found"));
}
}
}
@ -284,7 +286,7 @@ public class DesignUtils {
String value = values[i].replaceAll("\\\\", "/");
segs[i] = URLEncoder.encode(CodeUtils.cjkEncode(names[i]), EncodeConstants.ENCODING_UTF_8) + "=" + URLEncoder.encode(CodeUtils.cjkEncode(value), "UTF-8");
} catch (UnsupportedEncodingException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
String postfixOfUri = (segs.length > 0 ? "?" + StableUtils.join(segs, "&") : StringUtils.EMPTY);
@ -294,7 +296,7 @@ public class DesignUtils {
String urlPath = getWebBrowserPath();
Desktop.getDesktop().browse(new URI(urlPath + baseRoute + postfixOfUri));
} catch (Exception e) {
FRContext.getLogger().error("cannot open the url Successful", e);
FineLoggerFactory.getLogger().error("cannot open the url Successful", e);
}
} else {
try {

14
designer-base/src/main/java/com/fr/design/utils/gui/UIComponentUtils.java

@ -2,6 +2,8 @@ package com.fr.design.utils.gui;
import com.fr.design.gui.core.UITextComponent;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.stable.StringUtils;
import javax.swing.JComponent;
@ -9,6 +11,7 @@ import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.util.Locale;
/**
* 包含 UI 组件相关的工具方法
@ -45,15 +48,18 @@ public class UIComponentUtils {
}
private static void insertPrefixToText(UITextComponent comp, String prefix) {
if (comp == null) {
if (comp == null || ComparatorUtils.equals(Locale.CHINA, GeneralContext.getLocale())) {
// 最初是为了解决日文国际化显示不全,而增加的换行功能。中文不需要换行。
// windows 下,字体为宋体时,对于 JLabel、JCheckBox、JButton 等控件,使用<html>换行后,文字会下移,可能导致文字下半部分被截断。
// 因此中文直接返回,不加换行逻辑。
return;
}
String text = comp.getText();
if (StringUtils.isEmpty(comp.getText()) || text.startsWith(HTML_TAG)) {
String text = comp.getText();
if (StringUtils.isEmpty(text) || text.startsWith(HTML_TAG)) {
return;
}
comp.setText(prefix + comp.getText());
comp.setText(prefix + text);
}
/**

2
designer-base/src/main/java/com/fr/design/web/CustomIconPane.java

@ -291,7 +291,7 @@ public class CustomIconPane extends BasicPane {
Configurations.update(new WorkerFacade(WidgetInfoConfig.class) {
@Override
public void run() {
WidgetInfoConfig.getInstance().setIconManager(IconManager.getIconManager());
WidgetInfoConfig.getInstance().setIconManager(iconManager);
}
});

4
designer-base/src/main/java/com/fr/design/widget/EventCreator.java

@ -1,12 +1,12 @@
package com.fr.design.widget;
import com.fr.base.FRContext;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameableSelfCreator;
import com.fr.design.gui.controlpane.UnrepeatedNameHelper;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.form.event.Listener;
import com.fr.general.NameObject;
import com.fr.log.FineLoggerFactory;
import com.fr.report.web.util.ReportEngineEventMapping;
import com.fr.stable.Nameable;
@ -43,7 +43,7 @@ public class EventCreator extends NameableSelfCreator {
String localeKey = ReportEngineEventMapping.getLocaleName(eventName);
return com.fr.design.i18n.Toolkit.i18nText(localeKey);
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return eventName;
}
}

93
designer-base/src/main/java/com/fr/file/AbstractFILE.java

@ -0,0 +1,93 @@
package com.fr.file;
import javax.swing.Icon;
import java.io.InputStream;
import java.io.OutputStream;
public abstract class AbstractFILE implements FILE {
@Override
public String prefix() {
throw new UnsupportedOperationException();
}
@Override
public boolean isDirectory() {
throw new UnsupportedOperationException();
}
@Override
public String getName() {
throw new UnsupportedOperationException();
}
@Override
public Icon getIcon() {
throw new UnsupportedOperationException();
}
@Override
public String getPath() {
throw new UnsupportedOperationException();
}
@Override
public void setPath(String path) {
throw new UnsupportedOperationException();
}
@Override
public FILE getParent() {
throw new UnsupportedOperationException();
}
@Override
public FILE[] listFiles() {
throw new UnsupportedOperationException();
}
@Override
public boolean createFolder(String name) {
throw new UnsupportedOperationException();
}
@Override
public boolean mkfile() throws Exception {
throw new UnsupportedOperationException();
}
@Override
public boolean exists() {
throw new UnsupportedOperationException();
}
@Override
public void closeTemplate() throws Exception {
throw new UnsupportedOperationException();
}
@Override
public InputStream asInputStream() throws Exception {
throw new UnsupportedOperationException();
}
@Override
public OutputStream asOutputStream() throws Exception {
throw new UnsupportedOperationException();
}
@Override
public String getEnvFullName() {
throw new UnsupportedOperationException();
}
@Override
public boolean isMemFile() {
throw new UnsupportedOperationException();
}
@Override
public boolean isEnvFile() {
throw new UnsupportedOperationException();
}
}

2
designer-base/src/main/java/com/fr/file/FileFILE.java

@ -201,7 +201,7 @@ public class FileFILE implements FILE {
OutputStream out;
try {
StableUtils.makesureFileExist(file);
out = new FileOutputStream(file, true);
out = new FileOutputStream(file, false);
} catch (Exception e) {
throw SessionLocalManager.createLogPackedException(e);
}

26
designer-base/src/main/java/com/fr/file/FileNodeFILE.java

@ -7,6 +7,9 @@ import com.fr.design.file.NodeAuthProcessor;
import com.fr.design.gui.itree.filetree.FileNodeComparator;
import com.fr.design.gui.itree.filetree.FileTreeIcon;
import com.fr.design.i18n.Toolkit;
import com.fr.event.Event;
import com.fr.event.EventDispatcher;
import com.fr.event.Listener;
import com.fr.file.filetree.FileNode;
import com.fr.general.ComparatorUtils;
import com.fr.io.EncryptUtils;
@ -15,6 +18,8 @@ import com.fr.stable.CoreConstants;
import com.fr.stable.StableUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace;
import com.fr.workspace.WorkspaceEvent;
import com.fr.workspace.resource.WorkResourceTempRenameStream;
import com.fr.workspace.server.lock.TplOperator;
@ -26,6 +31,21 @@ import java.util.Arrays;
public class FileNodeFILE implements FILE {
private static String webRootPath = FRContext.getCommonOperator().getWebRootPath();
private static String[] supportTypes = FRContext.getFileNodes().getSupportedTypes();
static {
EventDispatcher.listen(WorkspaceEvent.AfterSwitch, new Listener<Workspace>() {
@Override
public void on(Event event, Workspace workspace) {
webRootPath = FRContext.getCommonOperator().getWebRootPath();
supportTypes = FRContext.getFileNodes().getSupportedTypes();
}
});
}
private FileNode node;
//记录下FILE对应的运行环境,每次创建都设置下当前的运行环境
@ -95,7 +115,7 @@ public class FileNodeFILE implements FILE {
@Override
public String prefix() {
if (ComparatorUtils.equals(getEnvPath(), FRContext.getCommonOperator().getWebRootPath())) {
if (ComparatorUtils.equals(getEnvPath(), webRootPath)) {
return FILEFactory.WEBREPORT_PREFIX;
}
return FILEFactory.ENV_PREFIX;
@ -212,7 +232,7 @@ public class FileNodeFILE implements FILE {
try {
FileNode[] nodeArray;
nodeArray = listFile(node.getEnvPath());
Arrays.sort(nodeArray, new FileNodeComparator(FRContext.getFileNodes().getSupportedTypes()));
Arrays.sort(nodeArray, new FileNodeComparator(supportTypes));
return fileNodeArray2FILEArray(nodeArray, envPath);
} catch (Exception e) {
@ -235,7 +255,7 @@ public class FileNodeFILE implements FILE {
private FileNode[] listFile(String rootFilePath) {
try {
if (ComparatorUtils.equals(envPath, FRContext.getCommonOperator().getWebRootPath())) {
if (ComparatorUtils.equals(envPath, webRootPath)) {
return FRContext.getFileNodes().listWebRootFile(rootFilePath);
} else {
return FRContext.getFileNodes().list(rootFilePath);

102
designer-base/src/main/java/com/fr/file/RenameExportFILE.java

@ -0,0 +1,102 @@
package com.fr.file;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.third.org.apache.commons.io.FileUtils;
import com.fr.web.session.SessionLocalManager;
import javax.swing.Icon;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
public class RenameExportFILE extends AbstractFILE {
private static final String EXPORT_SUFFIX = ".FRExportTmp";
private FILE file;
private RenameExportFILE(FILE file) {
this.file = new FileFILE(new File(file.getPath() + EXPORT_SUFFIX));
}
public static RenameExportFILE create(FILE file) {
return new RenameExportFILE(file);
}
public static String recoverFileName(String fileName) {
if (StringUtils.isEmpty(fileName) || !fileName.endsWith(EXPORT_SUFFIX)) {
return fileName;
}
return fileName.substring(0, fileName.lastIndexOf(EXPORT_SUFFIX));
}
@Override
public String prefix() {
return file.prefix();
}
@Override
public boolean isDirectory() {
return false;
}
@Override
public String getName() {
return file.getName();
}
@Override
public Icon getIcon() {
return null;
}
@Override
public String getPath() {
return file.getPath();
}
@Override
public FILE getParent() {
return file.getParent();
}
@Override
public boolean mkfile() throws Exception {
return file.mkfile();
}
@Override
public boolean exists() {
return file.exists();
}
@Override
public OutputStream asOutputStream() throws Exception {
final File localeFile = new File(file.getPath());
OutputStream out;
try {
StableUtils.makesureFileExist(localeFile);
out = new FileOutputStream(localeFile, false) {
@Override
public void close() throws IOException {
super.close();
String path = file.getPath();
if (localeFile.exists()) {
FileUtils.copyFile(localeFile, new File(recoverFileName(path)));
if (localeFile.getPath().endsWith(EXPORT_SUFFIX)) {
FileUtils.forceDelete(localeFile);
}
}
}
};
} catch (Exception e) {
throw SessionLocalManager.createLogPackedException(e);
}
return out;
}
}

34
designer-base/src/main/java/com/fr/file/StashedFILE.java

@ -1,15 +1,13 @@
package com.fr.file;
import javax.swing.Icon;
import javax.transaction.NotSupportedException;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.OutputStream;
/**
* 切换环境用于暂存的文件类型
*/
public class StashedFILE implements FILE {
public class StashedFILE extends AbstractFILE {
private FILE file;
private byte[] content;
@ -44,31 +42,6 @@ public class StashedFILE implements FILE {
return file.getPath();
}
@Override
public void setPath(String path) {
throw new UnsupportedOperationException();
}
@Override
public FILE getParent() {
throw new UnsupportedOperationException();
}
@Override
public FILE[] listFiles() {
throw new UnsupportedOperationException();
}
@Override
public boolean createFolder(String name) {
throw new UnsupportedOperationException();
}
@Override
public boolean mkfile() throws Exception {
throw new UnsupportedOperationException();
}
@Override
public boolean exists() {
return false;
@ -84,11 +57,6 @@ public class StashedFILE implements FILE {
return new ByteArrayInputStream(content);
}
@Override
public OutputStream asOutputStream() throws Exception {
throw new NotSupportedException();
}
@Override
public String getEnvFullName() {
return file.getEnvFullName();

8
designer-base/src/main/java/com/fr/start/Demo.java

@ -1,7 +1,7 @@
package com.fr.start;
import com.fr.base.FRContext;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.OperatingSystem;
import com.fr.stable.StableUtils;
@ -11,7 +11,7 @@ public class Demo {
public static void main(String[] args) {
String installHome = StableUtils.getInstallHome();
if (installHome == null) {
FRContext.getLogger().error("Can not find the install home, please check it.");
FineLoggerFactory.getLogger().error("Can not find the install home, please check it.");
return;
}
@ -29,7 +29,7 @@ public class Demo {
try {
builder.start();
} catch (IOException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
} else {
// ProcessBuilder这种方式在window下报错:系统找不到指定文件
@ -37,7 +37,7 @@ public class Demo {
try {
rt.exec(executorPath);
} catch (IOException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}

12
designer-base/src/main/java/com/fr/start/StartDocURL.java

@ -1,11 +1,11 @@
package com.fr.start;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StableUtils;
import java.awt.Desktop;
import java.net.URI;
import com.fr.base.FRContext;
import com.fr.stable.StableUtils;
/**
* 从windows开始菜单点击exe文件启动html格式的帮助文档,
@ -20,7 +20,7 @@ public class StartDocURL {
public static void main(String[] args) {
//p:必须有路径的URL存在
if(args == null || args.length < 1) {
FRContext.getLogger().error(
FineLoggerFactory.getLogger().error(
"Can not find the install home, please check it.");
return;
}
@ -33,7 +33,7 @@ public class StartDocURL {
} else {
String iHome = StableUtils.getInstallHome();
if (iHome == null) {
FRContext.getLogger().error(
FineLoggerFactory.getLogger().error(
"Can not find the install home, please check it.");
return;
}
@ -42,7 +42,7 @@ public class StartDocURL {
Desktop.getDesktop().open(new java.io.File(iHome + args[0]));
}
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}

19
designer-base/src/main/java/com/fr/start/server/ServerManageFrame.java

@ -1,17 +1,20 @@
package com.fr.start.server;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory;
import javax.swing.*;
import java.awt.*;
import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -32,7 +35,7 @@ public class ServerManageFrame extends JFrame {
try {
serverManageFrame.checkButtonEnabled();
} catch(Exception exp) {
FRContext.getLogger().error(exp.getMessage());
FineLoggerFactory.getLogger().error(exp.getMessage());
}
return serverManageFrame;
@ -77,7 +80,7 @@ public class ServerManageFrame extends JFrame {
FineEmbedServer.start();
checkButtonEnabled();
} catch(Exception exp) {
FRContext.getLogger().error(exp.getMessage());
FineLoggerFactory.getLogger().error(exp.getMessage());
}
}
});
@ -94,7 +97,7 @@ public class ServerManageFrame extends JFrame {
FineEmbedServer.stop();
checkButtonEnabled();
} catch(Exception exp) {
FRContext.getLogger().error(exp.getMessage());
FineLoggerFactory.getLogger().error(exp.getMessage());
}
}
});
@ -120,7 +123,7 @@ public class ServerManageFrame extends JFrame {
// try {
// desktop.open();
// } catch(Exception exp) {
// FRContext.getLogger().error(exp.getMessage());
// FineLoggerFactory.getLogger().error(exp.getMessage());
// }
// }
// });

18
designer-base/src/main/java/com/fr/start/server/ServerTray.java

@ -1,13 +1,17 @@
package com.fr.start.server;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.event.Event;
import com.fr.event.EventDispatcher;
import com.fr.event.ListenerAdaptor;
import java.awt.*;
import com.fr.log.FineLoggerFactory;
import java.awt.AWTException;
import java.awt.Image;
import java.awt.MenuItem;
import java.awt.PopupMenu;
import java.awt.SystemTray;
import java.awt.TrayIcon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
@ -61,7 +65,7 @@ public class ServerTray {
try {
FineEmbedServer.start();
} catch (Exception exp) {
FRContext.getLogger().error(exp.getMessage(), exp);
FineLoggerFactory.getLogger().error(exp.getMessage(), exp);
}
}
};
@ -72,7 +76,7 @@ public class ServerTray {
try {
FineEmbedServer.stop();
} catch (Throwable exp) {
FRContext.getLogger().error(exp.getMessage(), exp);
FineLoggerFactory.getLogger().error(exp.getMessage(), exp);
}
}
};
@ -168,7 +172,7 @@ public class ServerTray {
serverManageFrame.repaint();
}
} catch (Exception exp) {
FRContext.getLogger().error(exp.getMessage(), exp);
FineLoggerFactory.getLogger().error(exp.getMessage(), exp);
}
}

12
designer-base/src/main/resources/com/fr/design/ui/InitNameSpace.js

@ -0,0 +1,12 @@
var arr ="%s".split(".").reverse();
var create = function (obj, names) {
var name = names.pop();
if (!name) {
return;
}
if (!obj[name]) {
obj[name] = {};
}
create(obj[name], names);
};
create(window, arr);

8
designer-base/src/main/resources/com/fr/design/ui/InsertScript.js

@ -0,0 +1,8 @@
var arr = "%s".split(",");
var header = document.getElementsByTagName("head")[0];
arr.forEach(function(el) {
var script = document.createElement("script")
script.type = "text/javascript";
script.src = "emb:" + el;
header.appendChild(script);
});

9
designer-base/src/main/resources/com/fr/design/ui/InsertStyle.js

@ -0,0 +1,9 @@
var arr = "%s".split(",");
var header = document.getElementsByTagName("head")[0];
arr.forEach(function(el) {
var css = document.createElement("link");
css.type = "text/css";
css.rel = "stylesheet";
css.href = "emb:" + el;
header.appendChild(css);
});

220
designer-base/src/main/resources/com/fr/design/ui/help/demo.js

@ -0,0 +1,220 @@
window.addEventListener("load", function (ev) {
window.BI.i18nText = function(key) {return window.Pool.i18n.i18nText(key);}
var combo1 = BI.createWidget({
type: "bi.vertical",
items: [
{
type: "bi.text_value_combo",
text: "选项1",
width: 300,
items: [
{
el: {
type: "bi.single_select_radio_item",
width: 290,
text: "选项1",
value: 1
},
text: "选项1",
value: 1,
lgap: 10
},
{
el: {
type: "bi.single_select_radio_item",
width: 290,
text: "选项2",
value: 2
},
lgap: 10,
text: "选项2",
value: 2
},
{
el: {
type: "bi.single_select_radio_item",
width: 290,
text: "选项3",
value: 3
},
lgap: 10,
text: "选项3",
value: 3
}
]
}
]
});
var date = BI.createWidget({
type: "bi.left",
items: [{
el: {
type: "bi.date_time_combo",
value: {
year: 2018,
month: 9,
day: 28,
hour: 13,
minute: 31,
second: 1
}
}
}]
});
var comboTree = BI.createWidget({
type: "bi.vertical",
items: [
{
type: "bi.tree_value_chooser_combo",
width: 300,
itemsCreator: function(op, callback) {
callback([
{
id: 1,
text: "第1项",
value: "1"
},
{
id: 2,
text: "第2项",
value: "2"
},
{
id: 3,
text: "第3项",
value: "3",
open: true
},
{
id: 11,
pId: 1,
text: "子项1",
value: "11"
},
{
id: 12,
pId: 1,
text: "子项2",
value: "12"
},
{
id: 13,
pId: 1,
text: "子项3",
value: "13"
},
{
id: 31,
pId: 3,
text: "子项1",
value: "31"
},
{
id: 32,
pId: 3,
text: "子项2",
value: "32"
},
{
id: 33,
pId: 3,
text: "子项3",
value: "33"
}
]);
}
}
]
});
var color = BI.createWidget({
type: "bi.left",
items: [{
type: "bi.simple_color_chooser",
width: 24,
height: 24
}, {
el: {
type: "bi.color_chooser",
width: 230,
height: 24
},
lgap: 10
}]
});
var Slider = BI.inherit(BI.Widget, {
props: {
width: 300,
height: 50,
min: 0,
max: 100
},
mounted: function() {
var o = this.options;
this.singleSliderInterval.setMinAndMax({
min: o.min,
max: o.max
});
this.singleSliderInterval.setValue({
min: 10,
max: 80
});
this.singleSliderInterval.populate();
},
render: function() {
var self = this,
o = this.options;
return {
type: "bi.vertical",
element: this,
items: [
{
type: "bi.interval_slider",
digit: 0,
width: o.width,
height: o.height,
ref: function(_ref) {
self.singleSliderInterval = _ref;
}
}
]
};
}
});
BI.shortcut("demo.slider_interval", Slider);
var slider = BI.createWidget({
type: "demo.slider_interval"
});
BI.createWidget({
type:"bi.absolute",
element: "body",
items: [{
el: combo1,
left: 100,
top: 100
}, {
el : date,
left: 100,
top : 150
}, {
el : comboTree,
left : 100,
top : 200
}, {
el : color,
left : 100,
top : 250
}, {
el : slider,
left : 400,
top : 100
}]
});
});

12
designer-base/src/main/resources/com/fr/design/ui/tpl.html

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
##style##
##script##
</head>
<body>
</body>
</html>

28
designer-base/src/test/java/com/fr/design/ui/FineUIDemo.java

@ -0,0 +1,28 @@
package com.fr.design.ui;
import com.fr.design.DesignerEnvManager;
import javax.swing.*;
import java.awt.*;
/**
* @author richie
* @version 10.0
* Created by richie on 2019-03-07
*/
public class FineUIDemo {
public static void main(String... args) {
final JFrame frame = new JFrame();
frame.setSize(1200, 800);
JPanel contentPane = (JPanel) frame.getContentPane();
// 是否需要开启调试窗口
DesignerEnvManager.getEnvManager().setOpenDebug(true);
final ModernUIPane<ModernUIPaneTest.Model> pane = new ModernUIPane.Builder<ModernUIPaneTest.Model>()
.withComponent(StartComponent.KEY).build();
contentPane.add(pane, BorderLayout.CENTER);
frame.setVisible(true);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
}
}

75
designer-base/src/test/java/com/fr/design/ui/ModernUIPaneTest.java

@ -0,0 +1,75 @@
package com.fr.design.ui;
import com.fr.design.DesignerEnvManager;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* @author richie
* @version 10.0
* Created by richie on 2019-03-05
*/
public class ModernUIPaneTest {
public static void main(String... args) {
final JFrame frame = new JFrame();
frame.setSize(1200, 800);
JPanel contentPane = (JPanel) frame.getContentPane();
// 是否需要开启调试窗口
DesignerEnvManager.getEnvManager().setOpenDebug(true);
final ModernUIPane<Model> pane = new ModernUIPane.Builder<Model>()
.withEMB("/com/fr/design/ui/demo.html").namespace("Pool").build();
contentPane.add(pane, BorderLayout.CENTER);
Model model = new Model();
model.setAge(20);
model.setName("Pick");
pane.populate(model);
JPanel panel = new JPanel(new FlowLayout());
contentPane.add(panel, BorderLayout.SOUTH);
JButton button = new JButton("点击我可以看到Swing的弹框,输出填写的信息");
panel.add(button);
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Model returnValue = pane.update();
if (returnValue != null) {
JOptionPane.showMessageDialog(frame, String.format("姓名为:%s,年龄为:%d", returnValue.getName(), returnValue.getAge()));
}
}
});
frame.setVisible(true);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
}
public static class Model {
private String name;
private int age;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public void print(String message) {
System.out.println(message);
}
}
}

32
designer-base/src/test/java/com/fr/design/ui/StartComponent.java

@ -0,0 +1,32 @@
package com.fr.design.ui;
import com.fr.web.struct.AssembleComponent;
import com.fr.web.struct.Atom;
import com.fr.web.struct.browser.RequestClient;
import com.fr.web.struct.category.ScriptPath;
import com.fr.web.struct.impl.FineUI;
/**
* @author richie
* @version 10.0
* Created by richie on 2019-03-08
*/
public class StartComponent extends AssembleComponent {
public static final StartComponent KEY = new StartComponent();
private StartComponent() {
}
@Override
public ScriptPath script(RequestClient req) {
return ScriptPath.build("/com/fr/design/ui/script/start.js");
}
@Override
public Atom[] refer() {
return new Atom[] {FineUI.KEY};
}
}

20
designer-base/src/test/resources/com/fr/design/ui/demo.html

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script type="text/javascript">
Pool.update = function () {
Pool.data.setAge(parseInt(document.getElementById("age").value));
Pool.data.setName(document.getElementById("name").value);
return Pool.data;
};
</script>
</head>
<body>
<div>测试页面,请点击最下面的按钮</div>
<input id="name" type="text" placeholder="请输入名字"/>
<input id="age" type="number" placeholder="请输入年龄"/>
<img src="emb:/com/fr/design/images/splash_10.gif">
</body>
</html>

11
designer-base/src/test/resources/com/fr/design/ui/fineui.html

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="emb:/com/fr/web/ui/fineui.min.css"/>
<script src="emb:/com/fr/web/ui/fineui.min.js"/>
</head>
<body>
</body>
</html>

57
designer-base/src/test/resources/com/fr/design/ui/script/start.js

@ -0,0 +1,57 @@
window.addEventListener("load", function (ev) {
var combo1 = BI.createWidget({
type: "bi.vertical",
items: [
{
type: "bi.text_value_combo",
text: "选项1",
width: 300,
items: [
{
el: {
type: "bi.single_select_radio_item",
width: 290,
text: "选项1",
value: 1
},
text: "选项1",
value: 1,
lgap: 10
},
{
el: {
type: "bi.single_select_radio_item",
width: 290,
text: "选项2",
value: 2
},
lgap: 10,
text: "选项2",
value: 2
},
{
el: {
type: "bi.single_select_radio_item",
width: 290,
text: "选项3",
value: 3
},
lgap: 10,
text: "选项3",
value: 3
}
]
}
]
});
BI.createWidget({
type:"bi.absolute",
element: "body",
items: [{
el: combo1,
left: 100,
top: 100
}]
});
});

15
designer-chart/src/main/java/com/fr/design/chart/ChartAxisFactory.java

@ -1,12 +1,17 @@
package com.fr.design.chart;
import com.fr.base.FRContext;
import com.fr.chart.chartattr.Axis;
import com.fr.chart.chartattr.CategoryAxis;
import com.fr.chart.chartattr.RadarAxis;
import com.fr.chart.chartattr.ValueAxis;
import com.fr.design.mainframe.chart.gui.style.axis.*;
import com.fr.design.mainframe.chart.gui.style.axis.ChartAxisUsePane;
import com.fr.design.mainframe.chart.gui.style.axis.ChartCategoryPane;
import com.fr.design.mainframe.chart.gui.style.axis.ChartPercentValuePane;
import com.fr.design.mainframe.chart.gui.style.axis.ChartRadarPane;
import com.fr.design.mainframe.chart.gui.style.axis.ChartSecondValuePane;
import com.fr.design.mainframe.chart.gui.style.axis.ChartValuePane;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import java.util.HashMap;
import java.util.Map;
@ -45,10 +50,8 @@ public class ChartAxisFactory {
Class<? extends ChartAxisUsePane> cls = map.get(clsName);
try {
return cls.newInstance();
} catch (InstantiationException e) {
FRContext.getLogger().error(e.getMessage(), e);
} catch (IllegalAccessException e) {
FRContext.getLogger().error(e.getMessage(), e);
} catch (InstantiationException | IllegalAccessException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return new ChartCategoryPane();
}

61
designer-chart/src/main/java/com/fr/design/chart/ChartPlotFactory.java

@ -1,10 +1,55 @@
package com.fr.design.chart;
import com.fr.base.FRContext;
import com.fr.chart.chartattr.*;
import com.fr.design.chart.axis.*;
import com.fr.design.chart.series.SeriesCondition.dlp.*;
import com.fr.design.mainframe.chart.gui.style.axis.*;
import com.fr.chart.chartattr.Area3DPlot;
import com.fr.chart.chartattr.AreaPlot;
import com.fr.chart.chartattr.Bar2DPlot;
import com.fr.chart.chartattr.Bar3DPlot;
import com.fr.chart.chartattr.BubblePlot;
import com.fr.chart.chartattr.CustomPlot;
import com.fr.chart.chartattr.FunnelPlot;
import com.fr.chart.chartattr.GanttPlot;
import com.fr.chart.chartattr.LinePlot;
import com.fr.chart.chartattr.MapPlot;
import com.fr.chart.chartattr.MeterBluePlot;
import com.fr.chart.chartattr.MeterPlot;
import com.fr.chart.chartattr.Pie3DPlot;
import com.fr.chart.chartattr.PiePlot;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartattr.RadarPlot;
import com.fr.chart.chartattr.RangePlot;
import com.fr.chart.chartattr.StockPlot;
import com.fr.chart.chartattr.XYScatterPlot;
import com.fr.design.chart.axis.BinaryChartStyleAxisPane;
import com.fr.design.chart.axis.ChartStyleAxisPane;
import com.fr.design.chart.axis.CustomChartStyleAxisPane;
import com.fr.design.chart.axis.GanntChartStyleAxisPane;
import com.fr.design.chart.axis.RadarChartStyleAxisPane;
import com.fr.design.chart.axis.TernaryChartStyleAxisPane;
import com.fr.design.chart.axis.ValueChartStyleAxisPane;
import com.fr.design.chart.axis.XYChartStyleAxisPane;
import com.fr.design.chart.series.SeriesCondition.dlp.AreaDataLabelPane;
import com.fr.design.chart.series.SeriesCondition.dlp.Bar2DDataLabelPane;
import com.fr.design.chart.series.SeriesCondition.dlp.BubbleDataLabelPane;
import com.fr.design.chart.series.SeriesCondition.dlp.DataLabelPane;
import com.fr.design.chart.series.SeriesCondition.dlp.FunnelDataLabelPane;
import com.fr.design.chart.series.SeriesCondition.dlp.LineDataLabelPane;
import com.fr.design.chart.series.SeriesCondition.dlp.MapDataLabelPane;
import com.fr.design.chart.series.SeriesCondition.dlp.MeterDataLabelPane;
import com.fr.design.chart.series.SeriesCondition.dlp.PieDataLabelPane;
import com.fr.design.chart.series.SeriesCondition.dlp.RadarDataLabelPane;
import com.fr.design.chart.series.SeriesCondition.dlp.RangeDataLabelPane;
import com.fr.design.chart.series.SeriesCondition.dlp.StockDataLabelPane;
import com.fr.design.chart.series.SeriesCondition.dlp.XYDataLabelPane;
import com.fr.design.mainframe.chart.gui.style.axis.ChartAxisUsePane;
import com.fr.design.mainframe.chart.gui.style.axis.ChartCategoryNoFormulaPane;
import com.fr.design.mainframe.chart.gui.style.axis.ChartCategoryPane;
import com.fr.design.mainframe.chart.gui.style.axis.ChartPercentValueNoFormulaPane;
import com.fr.design.mainframe.chart.gui.style.axis.ChartPercentValuePane;
import com.fr.design.mainframe.chart.gui.style.axis.ChartSecondValueNoFormulaPane;
import com.fr.design.mainframe.chart.gui.style.axis.ChartSecondValuePane;
import com.fr.design.mainframe.chart.gui.style.axis.ChartValueNoFormulaPane;
import com.fr.design.mainframe.chart.gui.style.axis.ChartValuePane;
import com.fr.log.FineLoggerFactory;
import java.lang.reflect.Constructor;
import java.util.HashMap;
@ -91,7 +136,7 @@ public class ChartPlotFactory {
Constructor<? extends ChartStyleAxisPane> c = factoryObject.getAxisPaneClass().getConstructor(Plot.class);
return c.newInstance(plot);
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
return new BinaryChartStyleAxisPane(plot);
@ -109,7 +154,7 @@ public class ChartPlotFactory {
Constructor c = factoryObject.getDataLabelPaneClass().getConstructor();
return (DataLabelPane) c.newInstance();
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
return new DataLabelPane();
@ -122,7 +167,7 @@ public class ChartPlotFactory {
Constructor c = aClass.getConstructor();
return (ChartAxisUsePane) c.newInstance();
}catch (Exception e){
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}

8
designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java

@ -4,7 +4,6 @@ package com.fr.design.chart;
*
*/
import com.fr.base.FRContext;
import com.fr.chart.base.ChartInternationalNameContentBean;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
@ -17,6 +16,7 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.license.exception.RegistEditionException;
import com.fr.license.function.VT4FR;
import com.fr.log.FineLoggerFactory;
import javax.swing.BorderFactory;
import javax.swing.DefaultListCellRenderer;
@ -51,7 +51,7 @@ public class ChartTypePane extends ChartCommonWizardPane {
charts4Icon[i][j].getPlot().setLegend(null);
}
} catch (CloneNotSupportedException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}
@ -172,7 +172,7 @@ public class ChartTypePane extends ChartCommonWizardPane {
try {
oldChart.changePlotInNewType((Plot) chart.getPlot().clone());
} catch (CloneNotSupportedException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
}
@ -195,7 +195,7 @@ public class ChartTypePane extends ChartCommonWizardPane {
chart4Update = (Chart)chart.clone();
cc.addChart(chart4Update);
}catch (CloneNotSupportedException ex){
FRContext.getLogger().error(ex.getMessage(), ex);
FineLoggerFactory.getLogger().error(ex.getMessage(), ex);
}
}

14
designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java

@ -1,6 +1,5 @@
package com.fr.design.chart.gui;
import com.fr.base.FRContext;
import com.fr.base.ScreenResolution;
import com.fr.base.chart.BaseChart;
import com.fr.base.chart.BaseChartCollection;
@ -15,10 +14,19 @@ import com.fr.design.chart.gui.active.ActiveGlyph;
import com.fr.design.chart.gui.active.ChartActiveGlyph;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.chart.MiddleChartComponent;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils;
import com.fr.stable.core.PropertyChangeListener;
import java.awt.*;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Paint;
import java.awt.Point;
import java.awt.RenderingHints;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
@ -122,7 +130,7 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
this.chartCollection4Design = (ChartCollection)cc;
// this.chartCollection4Design = (ChartCollection)cc.clone();
} catch (Exception e) {
FRContext.getLogger().error("ChartCollection clone is Error");
FineLoggerFactory.getLogger().error("ChartCollection clone is Error");
}
reset();
}

8
designer-chart/src/main/java/com/fr/design/chart/gui/ChartWidgetOption.java

@ -1,11 +1,11 @@
package com.fr.design.chart.gui;
import com.fr.base.FRContext;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.design.gui.core.WidgetOption;
import com.fr.form.ui.ChartEditor;
import com.fr.form.ui.Widget;
import com.fr.log.FineLoggerFactory;
import javax.swing.Icon;
@ -42,11 +42,11 @@ public class ChartWidgetOption extends WidgetOption {
widget.addChart((Chart) chart.clone());
return widget;
} catch (InstantiationException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
} catch (IllegalAccessException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
} catch (CloneNotSupportedException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return null;

13
designer-chart/src/main/java/com/fr/design/chart/series/PlotSeries/MapCustomPane.java

@ -1,6 +1,5 @@
package com.fr.design.chart.series.PlotSeries;
import com.fr.base.FRContext;
import com.fr.base.TableData;
import com.fr.base.Utils;
import com.fr.chart.base.MapSvgAttr;
@ -16,13 +15,17 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.chart.gui.data.DatabaseTableDataPane;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralUtils;
import com.fr.general.data.DataModel;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import org.apache.batik.swing.svg.SVGFileFilter;
import javax.swing.*;
import java.awt.*;
import javax.swing.JFileChooser;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
@ -143,7 +146,7 @@ refreshAreaNameBox();
try {
embeddedTableData = DesignTableDataManager.previewTableDataNotNeedInputParameters(tableDataWrappe.getTableData(), TableData.RESULT_ALL, false);
} catch (Exception ee) {
FRContext.getLogger().error(ee.getMessage(), ee);
FineLoggerFactory.getLogger().error(ee.getMessage(), ee);
}
if(embeddedTableData == null){

28
designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/ConditionTrendLinePane.java

@ -1,29 +1,27 @@
package com.fr.design.chart.series.SeriesCondition;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.ParseException;
import javax.swing.ButtonGroup;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.SpinnerNumberModel;
import com.fr.base.FRContext;
import com.fr.base.Utils;
import com.fr.chart.base.ChartEquationType;
import com.fr.chart.base.ConditionTrendLine;
import com.fr.design.chart.comp.BorderAttriPane;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.comp.BorderAttriPane;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory;
import javax.swing.ButtonGroup;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.SpinnerNumberModel;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.ParseException;
public class ConditionTrendLinePane extends BasicBeanPane<ConditionTrendLine> {
private static final long serialVersionUID = 3867164332100351117L;
@ -197,7 +195,7 @@ public class ConditionTrendLinePane extends BasicBeanPane<ConditionTrendLine> {
try {
maSpinner.commitEdit();
} catch (ParseException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
trendLine.getLine().setTrendLineName(nameLabel.getText());

13
designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java

@ -1,6 +1,5 @@
package com.fr.design.chart.series.SeriesCondition;
import com.fr.base.FRContext;
import com.fr.chart.base.AttrAlpha;
import com.fr.chart.base.AttrBackground;
import com.fr.chart.base.AttrContents;
@ -12,10 +11,12 @@ import com.fr.data.condition.ListCondition;
import com.fr.design.condition.ConditionAttrSingleConditionPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.log.FineLoggerFactory;
import javax.swing.*;
import java.awt.*;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.util.Iterator;
/**
@ -114,9 +115,9 @@ public class DataSeriesConditionPane extends ConditionAttributesPane<ConditionAt
try {
return clazz.newInstance();
} catch (InstantiationException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
} catch (IllegalAccessException e) {
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return null;
}

4
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java

@ -1,6 +1,5 @@
package com.fr.design.mainframe.chart.gui;
import com.fr.base.FRContext;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
@ -18,6 +17,7 @@ import com.fr.design.mainframe.chart.gui.item.FlexibleComboBox;
import com.fr.design.mainframe.chart.gui.item.ItemEventType;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import javax.swing.JPanel;
@ -160,7 +160,7 @@ public class ChartTypePane extends AbstractChartAttrPane{
chart = newDefaultChart;
}
}catch (CloneNotSupportedException e){
FRContext.getLogger().error(e.getMessage(), e);
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
//这一步会替换plot

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save