diff --git a/designer-base/src/com/fr/design/DesignerEnvManager.java b/designer-base/src/com/fr/design/DesignerEnvManager.java index c4266cf15..06d205860 100644 --- a/designer-base/src/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/com/fr/design/DesignerEnvManager.java @@ -16,10 +16,10 @@ import com.fr.env.SignIn; import com.fr.file.FILEFactory; import com.fr.general.ComparatorUtils; import com.fr.general.FRLogFormatter; -import com.fr.general.FRLogger; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.general.Inter; +import com.fr.log.FineLoggerFactory; import com.fr.stable.Constants; import com.fr.stable.EnvChangedListener; import com.fr.stable.ListMap; @@ -34,10 +34,9 @@ import com.fr.stable.xml.XMLTools; import com.fr.stable.xml.XMLWriter; import com.fr.stable.xml.XMLableReader; -import javax.swing.SwingWorker; +import javax.swing.*; import javax.swing.SwingWorker.StateValue; -import java.awt.Color; -import java.awt.Rectangle; +import java.awt.*; import java.io.File; import java.io.FileOutputStream; import java.io.FileReader; @@ -228,7 +227,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { try { Thread.sleep(5000); } catch (InterruptedException e) { - FRLogger.getLogger().error("Map Save Error"); + FineLoggerFactory.getLogger().error("Map Save Error"); } } } diff --git a/designer-base/src/com/fr/design/ExtraDesignClassManager.java b/designer-base/src/com/fr/design/ExtraDesignClassManager.java index ce5878946..179251539 100644 --- a/designer-base/src/com/fr/design/ExtraDesignClassManager.java +++ b/designer-base/src/com/fr/design/ExtraDesignClassManager.java @@ -18,9 +18,9 @@ import com.fr.design.gui.core.WidgetOptionFactory; import com.fr.design.menu.ShortCut; import com.fr.design.widget.Appearance; import com.fr.form.ui.Widget; -import com.fr.general.FRLogger; import com.fr.general.GeneralUtils; import com.fr.general.IOUtils; +import com.fr.log.FineLoggerFactory; import com.fr.plugin.AbstractExtraClassManager; import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.injectable.PluginSingleInjection; @@ -208,7 +208,7 @@ public class ExtraDesignClassManager extends AbstractExtraClassManager implement return (Feedback) clazz.newInstance(); } } catch (Exception e) { - FRLogger.getLogger().info("no feed back support"); + FineLoggerFactory.getLogger().info("no feed back support"); } return Feedback.EMPTY; } diff --git a/designer-base/src/com/fr/design/RestartHelper.java b/designer-base/src/com/fr/design/RestartHelper.java index 53aa5e56b..2900e09f5 100644 --- a/designer-base/src/com/fr/design/RestartHelper.java +++ b/designer-base/src/com/fr/design/RestartHelper.java @@ -2,11 +2,18 @@ package com.fr.design; import com.fr.design.mainframe.DesignerContext; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; import com.fr.general.GeneralUtils; -import com.fr.stable.*; - -import java.io.*; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.ArrayUtils; +import com.fr.stable.OperatingSystem; +import com.fr.stable.StableUtils; +import com.fr.stable.StringUtils; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.RandomAccessFile; import java.nio.channels.FileChannel; import java.nio.channels.FileLock; import java.util.ArrayList; @@ -39,7 +46,7 @@ public class RestartHelper { properties.load(file2DeleteInputStream); file2DeleteInputStream.close(); } catch (IOException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } } if (ArrayUtils.getLength(files) != 0) { @@ -53,7 +60,7 @@ public class RestartHelper { properties.store(file2DeleteOutputStream, "save"); file2DeleteOutputStream.close(); } catch (IOException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } } @@ -71,7 +78,7 @@ public class RestartHelper { properties.load(file2MoveInputStream); file2MoveInputStream.close(); } catch (IOException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } } if (!map.isEmpty()) { @@ -84,7 +91,7 @@ public class RestartHelper { properties.store(file2MoveOutputStream, "save"); file2MoveOutputStream.close(); } catch (IOException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } } @@ -156,10 +163,10 @@ public class RestartHelper { FileChannel restartLockFC = randomAccessFile.getChannel(); FileLock restartLock = restartLockFC.tryLock(); if(restartLock == null) { - FRLogger.getLogger().error("restart lock null!"); + FineLoggerFactory.getLogger().error("restart lock null!"); } }catch (Exception e){ - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } if (OperatingSystem.isMacOS()) { restartInMacOS(installHome, filesToBeDelete); @@ -167,7 +174,7 @@ public class RestartHelper { restartInWindows(installHome, filesToBeDelete); } } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } finally { DesignerContext.getDesignerFrame().exit(); } diff --git a/designer-base/src/com/fr/design/actions/community/BBSAction.java b/designer-base/src/com/fr/design/actions/community/BBSAction.java index 09add551d..01cdcee95 100644 --- a/designer-base/src/com/fr/design/actions/community/BBSAction.java +++ b/designer-base/src/com/fr/design/actions/community/BBSAction.java @@ -1,22 +1,21 @@ package com.fr.design.actions.community; -import java.awt.Desktop; -import java.awt.event.ActionEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - -import javax.swing.JOptionPane; -import javax.swing.KeyStroke; - 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.Inter; import com.fr.general.SiteCenter; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + public class BBSAction extends UpdateAction { @@ -46,12 +45,12 @@ public class BBSAction extends UpdateAction Desktop.getDesktop().browse(new URI(url)); } catch (IOException exp) { JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser")); - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); } catch (URISyntaxException exp) { - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); } catch (Exception exp) { - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); - FRContext.getLogger().error("Can not open the browser for URL: " + url); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); } } public static final MenuKeySet BBS = new MenuKeySet() { diff --git a/designer-base/src/com/fr/design/actions/community/BugAction.java b/designer-base/src/com/fr/design/actions/community/BugAction.java index 497a12caa..5d5e6893c 100644 --- a/designer-base/src/com/fr/design/actions/community/BugAction.java +++ b/designer-base/src/com/fr/design/actions/community/BugAction.java @@ -1,22 +1,21 @@ package com.fr.design.actions.community; -import java.awt.Desktop; -import java.awt.event.ActionEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - -import javax.swing.JOptionPane; -import javax.swing.KeyStroke; - 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.Inter; import com.fr.general.SiteCenter; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + public class BugAction extends UpdateAction { @@ -40,12 +39,12 @@ public void actionPerformed(ActionEvent arg0) Desktop.getDesktop().browse(new URI(url)); } catch (IOException exp) { JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser")); - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); } catch (URISyntaxException exp) { - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); } catch (Exception exp) { - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); - FRContext.getLogger().error("Can not open the browser for URL: " + url); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); } } diff --git a/designer-base/src/com/fr/design/actions/community/NeedAction.java b/designer-base/src/com/fr/design/actions/community/NeedAction.java index bf9b3a509..b353dcaa8 100644 --- a/designer-base/src/com/fr/design/actions/community/NeedAction.java +++ b/designer-base/src/com/fr/design/actions/community/NeedAction.java @@ -1,22 +1,21 @@ package com.fr.design.actions.community; -import java.awt.Desktop; -import java.awt.event.ActionEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - -import javax.swing.JOptionPane; -import javax.swing.KeyStroke; - 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.Inter; import com.fr.general.SiteCenter; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + public class NeedAction extends UpdateAction { @@ -41,12 +40,12 @@ public class NeedAction extends UpdateAction Desktop.getDesktop().browse(new URI(url)); } catch (IOException exp) { JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser")); - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); } catch (URISyntaxException exp) { - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); } catch (Exception exp) { - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); - FRContext.getLogger().error("Can not open the browser for URL: " + url); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); } } diff --git a/designer-base/src/com/fr/design/actions/community/QuestionAction.java b/designer-base/src/com/fr/design/actions/community/QuestionAction.java index 7e8ced10b..6cf5f479c 100644 --- a/designer-base/src/com/fr/design/actions/community/QuestionAction.java +++ b/designer-base/src/com/fr/design/actions/community/QuestionAction.java @@ -1,22 +1,21 @@ package com.fr.design.actions.community; -import java.awt.Desktop; -import java.awt.event.ActionEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - -import javax.swing.JOptionPane; -import javax.swing.KeyStroke; - 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.Inter; import com.fr.general.SiteCenter; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + public class QuestionAction extends UpdateAction { @@ -40,12 +39,12 @@ public void actionPerformed(ActionEvent arg0) Desktop.getDesktop().browse(new URI(url)); } catch (IOException exp) { JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser")); - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); } catch (URISyntaxException exp) { - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); } catch (Exception exp) { - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); - FRContext.getLogger().error("Can not open the browser for URL: " + url); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); } } diff --git a/designer-base/src/com/fr/design/actions/community/SignAction.java b/designer-base/src/com/fr/design/actions/community/SignAction.java index 30170bc86..839d2b9d7 100644 --- a/designer-base/src/com/fr/design/actions/community/SignAction.java +++ b/designer-base/src/com/fr/design/actions/community/SignAction.java @@ -1,22 +1,21 @@ package com.fr.design.actions.community; -import java.awt.Desktop; -import java.awt.event.ActionEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - -import javax.swing.JOptionPane; -import javax.swing.KeyStroke; - 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.Inter; import com.fr.general.SiteCenter; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + public class SignAction extends UpdateAction { @@ -41,12 +40,12 @@ public class SignAction extends UpdateAction Desktop.getDesktop().browse(new URI(url)); } catch (IOException exp) { JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser")); - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); } catch (URISyntaxException exp) { - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); } catch (Exception exp) { - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); - FRContext.getLogger().error("Can not open the browser for URL: " + url); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); } } diff --git a/designer-base/src/com/fr/design/actions/community/UpAction.java b/designer-base/src/com/fr/design/actions/community/UpAction.java index 999b7e9e8..acbe2522b 100644 --- a/designer-base/src/com/fr/design/actions/community/UpAction.java +++ b/designer-base/src/com/fr/design/actions/community/UpAction.java @@ -1,22 +1,21 @@ package com.fr.design.actions.community; -import java.awt.Desktop; -import java.awt.event.ActionEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; - -import javax.swing.JOptionPane; -import javax.swing.KeyStroke; - 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.Inter; import com.fr.general.SiteCenter; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + public class UpAction extends UpdateAction { @@ -41,12 +40,12 @@ public class UpAction extends UpdateAction Desktop.getDesktop().browse(new URI(url)); } catch (IOException exp) { JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser")); - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); } catch (URISyntaxException exp) { - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); } catch (Exception exp) { - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); - FRContext.getLogger().error("Can not open the browser for URL: " + url); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); } } diff --git a/designer-base/src/com/fr/design/actions/community/VideoAction.java b/designer-base/src/com/fr/design/actions/community/VideoAction.java index ea53fbf8f..cedbe6273 100644 --- a/designer-base/src/com/fr/design/actions/community/VideoAction.java +++ b/designer-base/src/com/fr/design/actions/community/VideoAction.java @@ -1,23 +1,22 @@ package com.fr.design.actions.community; -import java.awt.Desktop; -import java.awt.event.ActionEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.Locale; - -import javax.swing.JOptionPane; -import javax.swing.KeyStroke; - 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.Inter; import com.fr.general.SiteCenter; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.Locale; + public class VideoAction extends UpdateAction { @@ -47,12 +46,12 @@ public class VideoAction extends UpdateAction Desktop.getDesktop().browse(new URI(url)); } catch (IOException exp) { JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer_Set_default_browser")); - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); } catch (URISyntaxException exp) { - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); } catch (Exception exp) { - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); - FRContext.getLogger().error("Can not open the browser for URL: " + url); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); } } diff --git a/designer-base/src/com/fr/design/actions/core/ActionFactory.java b/designer-base/src/com/fr/design/actions/core/ActionFactory.java index e48caa0ac..00824285c 100644 --- a/designer-base/src/com/fr/design/actions/core/ActionFactory.java +++ b/designer-base/src/com/fr/design/actions/core/ActionFactory.java @@ -7,10 +7,9 @@ import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.JTemplate; import com.fr.design.menu.MenuKeySet; import com.fr.design.selection.QuickEditor; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; -import javax.swing.Action; -import javax.swing.KeyStroke; +import javax.swing.*; import java.awt.event.KeyEvent; import java.lang.reflect.Constructor; import java.util.ArrayList; @@ -350,7 +349,7 @@ public class ActionFactory { if (c == null) { Class cClazz = findQuickEditorClass(clazz, editorClassMap); if (cClazz == null) { - FRLogger.getLogger().error("No Such Editor"); + FineLoggerFactory.getLogger().error("No Such Editor"); return null; } try { diff --git a/designer-base/src/com/fr/design/actions/file/LocalePane.java b/designer-base/src/com/fr/design/actions/file/LocalePane.java index 4dd25c504..a5017bf04 100644 --- a/designer-base/src/com/fr/design/actions/file/LocalePane.java +++ b/designer-base/src/com/fr/design/actions/file/LocalePane.java @@ -4,33 +4,40 @@ package com.fr.design.actions.file; -import java.awt.BorderLayout; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.*; - -import javax.swing.JTable; -import javax.swing.RowFilter; -import javax.swing.SwingWorker; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; -import javax.swing.table.DefaultTableModel; -import javax.swing.table.TableRowSorter; - import com.fr.base.Env; import com.fr.base.FRContext; +import com.fr.design.dialog.BasicPane; import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.dialog.BasicPane; import com.fr.file.filetree.FileNode; -import com.fr.general.*; +import com.fr.general.GeneralUtils; +import com.fr.general.Inter; +import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; -import com.fr.stable.StringUtils; import com.fr.stable.bridge.StableFactory; import com.fr.stable.project.ProjectConstants; +import javax.swing.*; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.TableRowSorter; +import java.awt.*; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Properties; +import java.util.ResourceBundle; +import java.util.Set; +import java.util.Vector; + /** * @author : richie * @since : 8.0 @@ -235,7 +242,7 @@ public class LocalePane extends BasicPane { out.flush(); out.close(); } catch (Exception e) { - FRLogger.getLogger().info(e.getMessage()); + FineLoggerFactory.getLogger().info(e.getMessage()); } } } diff --git a/designer-base/src/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/com/fr/design/actions/file/PreferencePane.java index dd6eaa9ad..fd9024293 100644 --- a/designer-base/src/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/com/fr/design/actions/file/PreferencePane.java @@ -1,7 +1,6 @@ package com.fr.design.actions.file; import com.fr.base.BaseUtils; -import com.fr.base.ServerConfig; import com.fr.design.DesignerEnvManager; import com.fr.design.RestartHelper; import com.fr.design.dialog.BasicDialog; @@ -23,8 +22,9 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; -import com.fr.general.FRLevel; import com.fr.general.Inter; +import com.fr.general.log.Log4jConfig; +import com.fr.third.apache.log4j.Level; import javax.swing.*; import java.awt.*; @@ -81,7 +81,7 @@ public class PreferencePane extends BasicPane { private static final String MINUS = "MINUS"; private static final String DISPLAY_MINUS = "-"; - private static final FRLevel[] LOG = {FRLevel.SEVERE, FRLevel.WARNING, FRLevel.INFO, FRLevel.DEBUG}; + private static final Level[] LOG = {Level.FATAL, Level.ERROR, Level.WARN, Level.INFO, Level.DEBUG}; private static java.util.List LANGUAGE = new ArrayList<>(); private static int designerEnvLanguageIndex; // 打开设置对话框时,设计器使用的语言 @@ -125,7 +125,7 @@ public class PreferencePane extends BasicPane { LANGUAGE.clear(); Map map = Inter.getSupportLocaleMap(); LANGUAGE.add(Inter.getLocText("FR-Designer_Language_Default")); - for(Locale locale : map.keySet()){ + for (Locale locale : map.keySet()) { LANGUAGE.add(getLocaledLanguage(map.get(locale), locale)); } } @@ -177,7 +177,7 @@ public class PreferencePane extends BasicPane { advancePane.add(spaceUpPane); } - private static String getLocaledLanguage(String key, Locale locale){ + private static String getLocaledLanguage(String key, Locale locale) { StringBuilder sb = new StringBuilder(); sb.append(Inter.getLocText(key)).append("("); sb.append(Inter.getLocText(key, locale)).append(")"); @@ -362,8 +362,8 @@ public class PreferencePane extends BasicPane { logLevelPane.add(logLevelComboBox); logLevelComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - - ServerConfig.getInstance().setServerLogLevel(((FRLevel) logLevelComboBox.getSelectedItem()).getLevel()); + + Log4jConfig.getInstance().setRootLevel((Level) logLevelComboBox.getSelectedItem()); } }); } @@ -380,7 +380,7 @@ public class PreferencePane extends BasicPane { languageLabel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - final LocalePane localePane = new LocalePane(); + final LocalePane localePane = new LocalePane(); BasicDialog dlg = localePane.showLargeWindow(SwingUtilities.getWindowAncestor(PreferencePane.this), new DialogActionAdapter() { @Override public void doOk() { @@ -542,8 +542,8 @@ public class PreferencePane extends BasicPane { paginationLineColorTBButton.setColor(designerEnvManager.getPaginationLineColor()); this.logExportDirectoryField.setText(designerEnvManager.getLogLocation()); - - this.logLevelComboBox.setSelectedItem(FRLevel.getByLevel(ServerConfig.getInstance().getServerLogLevel())); + + this.logLevelComboBox.setSelectedItem(Log4jConfig.getInstance().getRootLevel()); this.languageComboBox.setSelectedItem(LANGUAGE.get(designerEnvManager.getLanguage())); designerEnvLanguageIndex = designerEnvManager.getLanguage(); @@ -622,8 +622,8 @@ public class PreferencePane extends BasicPane { if (maxUndoLimit.getSelectedIndex() == SELECTED_INDEX_5) { designerEnvManager.setUndoLimit(MAX_UNDO_LIMIT_50); } - - ServerConfig.getInstance().setServerLogLevel(((FRLevel) logLevelComboBox.getSelectedItem()).getLevel()); + + Log4jConfig.getInstance().setRootLevel(((Level) logLevelComboBox.getSelectedItem())); } diff --git a/designer-base/src/com/fr/design/actions/file/SwitchExistEnv.java b/designer-base/src/com/fr/design/actions/file/SwitchExistEnv.java index 602f440d9..d58c6cc7f 100644 --- a/designer-base/src/com/fr/design/actions/file/SwitchExistEnv.java +++ b/designer-base/src/com/fr/design/actions/file/SwitchExistEnv.java @@ -1,14 +1,14 @@ package com.fr.design.actions.file; import com.fr.base.BaseUtils; +import com.fr.base.Env; import com.fr.base.FRContext; -import com.fr.base.env.resource.LocalEnvConfig; -import com.fr.base.env.resource.RemoteEnvConfig; -import com.fr.core.env.EnvConfig; +import com.fr.dav.LocalEnv; import com.fr.design.DesignerEnvManager; import com.fr.design.actions.UpdateAction; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.tabledata.ResponseDataSourceChange; +import com.fr.design.dialog.InformationWarnPane; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; @@ -18,11 +18,15 @@ import com.fr.design.menu.MenuDef; import com.fr.design.menu.SeparatorDef; import com.fr.env.RemoteEnv; import com.fr.env.SignIn; +import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; import com.fr.general.Inter; +import com.fr.log.FineLoggerFactory; import com.fr.stable.EnvChangedListener; +import com.fr.stable.ProductConstants; +import com.fr.stable.StringUtils; -import javax.swing.JOptionPane; +import javax.swing.*; import java.awt.event.ActionEvent; import java.util.HashMap; import java.util.Iterator; @@ -66,10 +70,10 @@ public class SwitchExistEnv extends MenuDef { public GetExistEnvAction(String envName) { this.setName(envName); - EnvConfig env = DesignerEnvManager.getEnvManager().getEnv(envName); - if (env instanceof LocalEnvConfig) { + Env env = DesignerEnvManager.getEnvManager().getEnv(envName); + if (env instanceof LocalEnv) { this.setSmallIcon(BaseUtils.readIcon("com/fr/design/images/data/bind/localconnect.png")); - } else if (env instanceof RemoteEnvConfig) { + } else if (env instanceof RemoteEnv) { this.setSmallIcon(BaseUtils.readIcon("com/fr/design/images/data/bind/distanceconnect.png")); } } @@ -97,12 +101,20 @@ public class SwitchExistEnv extends MenuDef { */ public void actionPerformed(ActionEvent e) { DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); - EnvConfig selectedEnv = envManager.getEnv(this.getName()); + Env selectedEnv = envManager.getEnv(this.getName()); try { if (selectedEnv instanceof RemoteEnv && !((RemoteEnv) selectedEnv).testServerConnection()) { JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"M-SwitchWorkspace", "Failed"})); return; } + String remoteVersion = selectedEnv.getDesignerVersion(); + if (StringUtils.isBlank(remoteVersion) || ComparatorUtils.compare(remoteVersion, ProductConstants.DESIGNER_VERSION) < 0) { + String infor = Inter.getLocText("Server-version-tip"); + String moreInfo = Inter.getLocText("Server-version-tip-moreInfo"); + FineLoggerFactory.getLogger().error(infor); + new InformationWarnPane(infor, moreInfo, Inter.getLocText("Tooltips")).show(); + return; + } SignIn.signIn(selectedEnv); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshToolArea(); fireDSChanged(); diff --git a/designer-base/src/com/fr/design/actions/help/FeedBackPane.java b/designer-base/src/com/fr/design/actions/help/FeedBackPane.java index e7894e77f..d4f212f3d 100644 --- a/designer-base/src/com/fr/design/actions/help/FeedBackPane.java +++ b/designer-base/src/com/fr/design/actions/help/FeedBackPane.java @@ -7,6 +7,8 @@ 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; +import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; @@ -16,13 +18,11 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.DesignerContext; -import com.fr.design.dialog.BasicDialog; -import com.fr.design.dialog.BasicPane; +import com.fr.design.utils.DesignUtils; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; import com.fr.general.Inter; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; -import com.fr.design.utils.DesignUtils; import javax.swing.*; import javax.swing.border.Border; @@ -33,7 +33,12 @@ import javax.swing.text.AttributeSet; import javax.swing.text.BadLocationException; import javax.swing.text.PlainDocument; import java.awt.*; -import java.awt.event.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; import java.util.Date; import java.util.concurrent.CancellationException; @@ -275,7 +280,7 @@ public class FeedBackPane extends BasicPane { try { return DesignUtils.sendFeedBack(feedBackInfo); } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); return false; } } diff --git a/designer-base/src/com/fr/design/actions/help/ForumAction.java b/designer-base/src/com/fr/design/actions/help/ForumAction.java index 5a07cca92..292ad13f3 100644 --- a/designer-base/src/com/fr/design/actions/help/ForumAction.java +++ b/designer-base/src/com/fr/design/actions/help/ForumAction.java @@ -10,6 +10,7 @@ import com.fr.design.actions.UpdateAction; import com.fr.design.menu.MenuKeySet; import com.fr.general.Inter; import com.fr.general.SiteCenter; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import javax.swing.*; @@ -48,12 +49,12 @@ public class ForumAction extends UpdateAction { Desktop.getDesktop().browse(new URI(url)); } catch (IOException exp) { JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser")); - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); } catch (URISyntaxException exp) { - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); } catch (Exception exp) { - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); - FRContext.getLogger().error("Can not open the browser for URL: " + url); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); } } diff --git a/designer-base/src/com/fr/design/actions/help/SupportQQAction.java b/designer-base/src/com/fr/design/actions/help/SupportQQAction.java index ae59df4a5..703c5632e 100644 --- a/designer-base/src/com/fr/design/actions/help/SupportQQAction.java +++ b/designer-base/src/com/fr/design/actions/help/SupportQQAction.java @@ -5,10 +5,10 @@ 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.Inter; +import com.fr.log.FineLoggerFactory; import com.fr.stable.ProductConstants; import javax.swing.*; @@ -38,9 +38,9 @@ public class SupportQQAction extends UpdateAction { Desktop.getDesktop().browse(new URI(ProductConstants.SUPPORT_QQ)); } catch (IOException exp) { JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser")); - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); } catch (URISyntaxException exp) { - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); } } diff --git a/designer-base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigPane.java b/designer-base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigPane.java index a868e404d..0ab5edd25 100644 --- a/designer-base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigPane.java +++ b/designer-base/src/com/fr/design/actions/help/alphafine/AlphaFineConfigPane.java @@ -8,12 +8,17 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayoutHelper; -import com.fr.general.FRLogger; import com.fr.general.Inter; +import com.fr.log.FineLoggerFactory; import javax.swing.*; import java.awt.*; -import java.awt.event.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; /** * Created by XiaXiang on 2017/4/6. @@ -202,7 +207,7 @@ public class AlphaFineConfigPane extends BasicPane { DesignerEnvManager.loadLogSetting(); DesignerEnvManager.getEnvManager().saveXMLFile(); } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } diff --git a/designer-base/src/com/fr/design/condition/LiteConditionPane.java b/designer-base/src/com/fr/design/condition/LiteConditionPane.java index 58e859ba3..5efa85dc5 100644 --- a/designer-base/src/com/fr/design/condition/LiteConditionPane.java +++ b/designer-base/src/com/fr/design/condition/LiteConditionPane.java @@ -3,7 +3,11 @@ package com.fr.design.condition; import com.fr.base.BaseFormula; import com.fr.base.BaseUtils; import com.fr.data.DataConstants; -import com.fr.data.condition.*; +import com.fr.data.condition.CommonCondition; +import com.fr.data.condition.FormulaCondition; +import com.fr.data.condition.JoinCondition; +import com.fr.data.condition.ListCondition; +import com.fr.data.condition.ObjectCondition; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.formula.FormulaFactory; @@ -18,9 +22,9 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.scrollruler.ModLineBorder; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; import com.fr.general.Inter; import com.fr.general.data.Condition; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import javax.swing.*; @@ -960,7 +964,7 @@ public abstract class LiteConditionPane extends BasicBeanPa try{ newCondition = (Condition)joinCondition.getCondition().clone(); }catch (CloneNotSupportedException e){ - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } return newCondition; } diff --git a/designer-base/src/com/fr/design/data/datapane/ChoosePane.java b/designer-base/src/com/fr/design/data/datapane/ChoosePane.java index 281a61de5..5fabd7c2b 100644 --- a/designer-base/src/com/fr/design/data/datapane/ChoosePane.java +++ b/designer-base/src/com/fr/design/data/datapane/ChoosePane.java @@ -33,15 +33,11 @@ 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.general.FRLogger; import com.fr.general.Inter; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; -import javax.swing.JList; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JTree; -import javax.swing.SwingWorker; +import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.event.PopupMenuEvent; @@ -52,9 +48,7 @@ import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreeCellRenderer; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Dimension; +import java.awt.*; import java.awt.event.FocusAdapter; import java.awt.event.FocusEvent; import java.awt.event.ItemEvent; @@ -283,7 +277,7 @@ public class ChoosePane extends BasicBeanPane implements Refresha schemaBox.setSelectedIndex(index); } } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } schemaBox.setRefreshingModel(false); schemaBox.removePopupMenuListener(listener); diff --git a/designer-base/src/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java b/designer-base/src/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java index 680a69f61..94b38f681 100644 --- a/designer-base/src/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java +++ b/designer-base/src/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java @@ -12,9 +12,10 @@ import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.scrollruler.ModLineBorder; +import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.Inter; +import com.fr.log.FineLoggerFactory; import com.fr.stable.EncodeConstants; -import com.fr.design.utils.gui.GUICoreUtils; import javax.swing.*; import java.awt.*; @@ -121,7 +122,7 @@ public abstract class DatabaseConnectionPane task = new PluginTask<>(webEngine, callback, new GetPluginFromStoreExecutor(new JSONObject(info))); threadPoolExecutor.submit(task); } catch (JSONException e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } } @@ -490,10 +488,10 @@ public class PluginWebBridge { } } catch (NullPointerException e) { //此为uri为空时抛出异常 - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } catch (IOException e) { //此为无法获取系统默认浏览器 - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } } } @@ -505,7 +503,7 @@ public class PluginWebBridge { try { Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind("bbs.register"))); } catch (Exception e) { - FRContext.getLogger().info(e.getMessage()); + FineLoggerFactory.getLogger().info(e.getMessage()); } } diff --git a/designer-base/src/com/fr/design/extra/QQLoginWebPane.java b/designer-base/src/com/fr/design/extra/QQLoginWebPane.java index 82648531c..f74219691 100644 --- a/designer-base/src/com/fr/design/extra/QQLoginWebPane.java +++ b/designer-base/src/com/fr/design/extra/QQLoginWebPane.java @@ -2,6 +2,7 @@ package com.fr.design.extra; import com.fr.base.FRContext; import com.fr.general.*; +import com.fr.log.FineLoggerFactory; import javafx.application.Platform; import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; @@ -148,7 +149,7 @@ public class QQLoginWebPane extends JFXPanel { } }); } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } } diff --git a/designer-base/src/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java b/designer-base/src/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java index db10437fd..c5a159a10 100644 --- a/designer-base/src/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java +++ b/designer-base/src/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java @@ -4,11 +4,11 @@ import com.fr.design.extra.PluginConstants; import com.fr.design.extra.PluginOperateUtils; import com.fr.design.extra.PluginUtils; import com.fr.design.extra.Process; -import com.fr.general.FRLogger; import com.fr.general.SiteCenter; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; import com.fr.json.JSONObject; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; /** @@ -72,7 +72,7 @@ public class GetPluginFromStoreExecutor implements Executor { JSONArray resultJSONArray = PluginUtils.filterPluginsFromVersion(resultArr); result = resultJSONArray.toString(); } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } } else { result = PluginConstants.CONNECTION_404; diff --git a/designer-base/src/com/fr/design/extra/exe/ReadUpdateOnlineExecutor.java b/designer-base/src/com/fr/design/extra/exe/ReadUpdateOnlineExecutor.java index 303d8aee7..2d7917d55 100644 --- a/designer-base/src/com/fr/design/extra/exe/ReadUpdateOnlineExecutor.java +++ b/designer-base/src/com/fr/design/extra/exe/ReadUpdateOnlineExecutor.java @@ -2,9 +2,9 @@ package com.fr.design.extra.exe; import com.fr.design.extra.PluginsReaderFromStore; import com.fr.design.extra.Process; -import com.fr.general.FRLogger; import com.fr.json.JSONArray; import com.fr.json.JSONObject; +import com.fr.log.FineLoggerFactory; import com.fr.plugin.view.PluginView; import com.fr.stable.StringUtils; @@ -42,7 +42,7 @@ public class ReadUpdateOnlineExecutor implements Executor { } result = jsonArray.toString(); } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } } } diff --git a/designer-base/src/com/fr/design/extra/exe/SearchOnlineExecutor.java b/designer-base/src/com/fr/design/extra/exe/SearchOnlineExecutor.java index c46dd5d4e..456b77dd1 100644 --- a/designer-base/src/com/fr/design/extra/exe/SearchOnlineExecutor.java +++ b/designer-base/src/com/fr/design/extra/exe/SearchOnlineExecutor.java @@ -3,11 +3,11 @@ package com.fr.design.extra.exe; import com.fr.design.extra.PluginOperateUtils; import com.fr.design.extra.PluginUtils; import com.fr.design.extra.Process; -import com.fr.general.FRLogger; import com.fr.general.SiteCenter; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; import com.fr.json.JSONObject; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; /** @@ -50,7 +50,7 @@ public class SearchOnlineExecutor implements Executor { JSONArray resultJSONArray = PluginUtils.filterPluginsFromVersion(jsonArray); result = resultJSONArray.toString(); } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } } } diff --git a/designer-base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java b/designer-base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java index 834f4370d..b9d04ecd1 100644 --- a/designer-base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java +++ b/designer-base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java @@ -2,8 +2,8 @@ package com.fr.design.extra.exe.callback; import com.fr.design.extra.PluginOperateUtils; import com.fr.design.extra.PluginUtils; -import com.fr.general.FRLogger; import com.fr.general.Inter; +import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginMarker; import com.fr.plugin.error.PluginErrorCode; import com.fr.plugin.manage.PluginManager; @@ -37,7 +37,7 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback { public void done(PluginTaskResult result) { if (result.isSuccess()) { jsCallback.execute("success"); - FRLogger.getLogger().info(Inter.getLocText("FR-Plugin_Install_Success")); + FineLoggerFactory.getLogger().info(Inter.getLocText("FR-Plugin_Install_Success")); JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Plugin_Install_Success")); } else if (result.errorCode() == PluginErrorCode.NeedDealWithPluginDependency) { int rv = JOptionPane.showOptionDialog( @@ -76,7 +76,7 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback { PluginOperateUtils.updatePluginFromDisk(zipFile, jsCallback); }else { jsCallback.execute("failed"); - FRLogger.getLogger().info(Inter.getLocText("FR-Plugin_Install_Failed")); + FineLoggerFactory.getLogger().info(Inter.getLocText("FR-Plugin_Install_Failed")); JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Plugin_Install_Failed"), JOptionPane.ERROR_MESSAGE); } } diff --git a/designer-base/src/com/fr/design/extra/exe/callback/InstallOnlineCallback.java b/designer-base/src/com/fr/design/extra/exe/callback/InstallOnlineCallback.java index 88f125a98..49da09b9c 100644 --- a/designer-base/src/com/fr/design/extra/exe/callback/InstallOnlineCallback.java +++ b/designer-base/src/com/fr/design/extra/exe/callback/InstallOnlineCallback.java @@ -1,8 +1,8 @@ package com.fr.design.extra.exe.callback; import com.fr.design.extra.PluginOperateUtils; -import com.fr.general.FRLogger; import com.fr.general.Inter; +import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginMarker; import com.fr.plugin.error.PluginErrorCode; import com.fr.plugin.manage.control.AbstractDealPreTaskCallback; @@ -35,7 +35,7 @@ public class InstallOnlineCallback extends AbstractDealPreTaskCallback { String pluginInfo = PluginOperateUtils.getSuccessInfo(result); if (result.isSuccess()) { jsCallback.execute("success"); - FRLogger.getLogger().info(pluginInfo + Inter.getLocText("FR-Plugin_Install_Success")); + FineLoggerFactory.getLogger().info(pluginInfo + Inter.getLocText("FR-Plugin_Install_Success")); JOptionPane.showMessageDialog(null, pluginInfo + Inter.getLocText("FR-Plugin_Install_Success")); } else if(result.errorCode() == PluginErrorCode.HasLowerPluginWhenInstall){ int rv = JOptionPane.showOptionDialog( @@ -55,7 +55,7 @@ public class InstallOnlineCallback extends AbstractDealPreTaskCallback { PluginOperateUtils.updatePluginOnline(pluginMarker, jsCallback); }else { jsCallback.execute("failed"); - FRLogger.getLogger().info(Inter.getLocText("FR-Plugin_Install_Failed")); + FineLoggerFactory.getLogger().info(Inter.getLocText("FR-Plugin_Install_Failed")); JOptionPane.showMessageDialog(null, pluginInfo, Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE); } } diff --git a/designer-base/src/com/fr/design/extra/exe/callback/UninstallPluginCallback.java b/designer-base/src/com/fr/design/extra/exe/callback/UninstallPluginCallback.java index 894903bff..be67ce617 100644 --- a/designer-base/src/com/fr/design/extra/exe/callback/UninstallPluginCallback.java +++ b/designer-base/src/com/fr/design/extra/exe/callback/UninstallPluginCallback.java @@ -1,8 +1,8 @@ package com.fr.design.extra.exe.callback; import com.fr.design.extra.PluginUtils; -import com.fr.general.FRLogger; import com.fr.general.Inter; +import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginMarker; import com.fr.plugin.error.PluginErrorCode; import com.fr.plugin.manage.PluginManager; @@ -25,7 +25,7 @@ public class UninstallPluginCallback extends AbstractPluginTaskCallback { public void done(PluginTaskResult result) { if (result.isSuccess()) { jsCallback.execute("success"); - FRLogger.getLogger().info(Inter.getLocText("FR-Plugin_Delete_Success")); + FineLoggerFactory.getLogger().info(Inter.getLocText("FR-Plugin_Delete_Success")); JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Plugin_Delete_Success")); }else if (result.errorCode() == PluginErrorCode.NeedUninstallDependingPluginFirst) { int rv = JOptionPane.showOptionDialog( @@ -44,7 +44,7 @@ public class UninstallPluginCallback extends AbstractPluginTaskCallback { PluginManager.getController().uninstall(pluginMarker, true, new UninstallPluginCallback(pluginMarker, jsCallback)); } else { jsCallback.execute("failed"); - FRLogger.getLogger().info(Inter.getLocText("FR-Plugin_Delete_Failed")); + FineLoggerFactory.getLogger().info(Inter.getLocText("FR-Plugin_Delete_Failed")); JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE); } } diff --git a/designer-base/src/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java b/designer-base/src/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java index 89f5e1c05..586538a93 100644 --- a/designer-base/src/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java +++ b/designer-base/src/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java @@ -2,8 +2,8 @@ package com.fr.design.extra.exe.callback; import com.fr.design.extra.PluginOperateUtils; import com.fr.design.extra.PluginUtils; -import com.fr.general.FRLogger; import com.fr.general.Inter; +import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginMarker; import com.fr.plugin.error.PluginErrorCode; import com.fr.plugin.manage.PluginManager; @@ -37,7 +37,7 @@ public class UpdateFromDiskCallback extends AbstractPluginTaskCallback { public void done(PluginTaskResult result) { if (result.isSuccess()) { jsCallback.execute("success"); - FRLogger.getLogger().info(Inter.getLocText("FR-Plugin_Update_Success")); + FineLoggerFactory.getLogger().info(Inter.getLocText("FR-Plugin_Update_Success")); JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Plugin_Update_Success")); } else if (result.errorCode() == PluginErrorCode.NeedDealWithPluginDependency) { int rv = JOptionPane.showOptionDialog( @@ -76,7 +76,7 @@ public class UpdateFromDiskCallback extends AbstractPluginTaskCallback { PluginOperateUtils.installPluginFromDisk(zipFile, jsCallback); }else { jsCallback.execute("failed"); - FRLogger.getLogger().info(Inter.getLocText("FR-Plugin_Update_Failed")); + FineLoggerFactory.getLogger().info(Inter.getLocText("FR-Plugin_Update_Failed")); JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE); } } diff --git a/designer-base/src/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java b/designer-base/src/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java index 441e27d95..8219fbe06 100644 --- a/designer-base/src/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java +++ b/designer-base/src/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java @@ -1,9 +1,8 @@ package com.fr.design.extra.exe.callback; -import com.fr.design.extra.PluginUtils; import com.fr.design.extra.PluginOperateUtils; -import com.fr.general.FRLogger; import com.fr.general.Inter; +import com.fr.log.FineLoggerFactory; import com.fr.plugin.manage.control.AbstractDealPreTaskCallback; import com.fr.plugin.manage.control.PluginTask; import com.fr.plugin.manage.control.PluginTaskResult; @@ -32,11 +31,11 @@ public class UpdateOnlineCallback extends AbstractDealPreTaskCallback { String pluginInfo = PluginOperateUtils.getSuccessInfo(result); if (result.isSuccess()) { jsCallback.execute("success"); - FRLogger.getLogger().info(pluginInfo + Inter.getLocText("FR-Plugin_Update_Success")); + FineLoggerFactory.getLogger().info(pluginInfo + Inter.getLocText("FR-Plugin_Update_Success")); JOptionPane.showMessageDialog(null,pluginInfo + Inter.getLocText("FR-Plugin_Update_Success")); } else { jsCallback.execute("failed"); - FRLogger.getLogger().info(Inter.getLocText("FR-Plugin_Update_Failed")); + FineLoggerFactory.getLogger().info(Inter.getLocText("FR-Plugin_Update_Failed")); JOptionPane.showMessageDialog(null, pluginInfo, Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE); } } diff --git a/designer-base/src/com/fr/design/extra/tradition/callback/UpdateOnlineCallback.java b/designer-base/src/com/fr/design/extra/tradition/callback/UpdateOnlineCallback.java index ef594f89f..78661fabd 100644 --- a/designer-base/src/com/fr/design/extra/tradition/callback/UpdateOnlineCallback.java +++ b/designer-base/src/com/fr/design/extra/tradition/callback/UpdateOnlineCallback.java @@ -2,8 +2,8 @@ package com.fr.design.extra.tradition.callback; import com.fr.design.extra.PluginStatusCheckCompletePane; import com.fr.design.extra.PluginUtils; -import com.fr.general.FRLogger; import com.fr.general.Inter; +import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginMarker; import com.fr.plugin.error.PluginErrorCode; import com.fr.plugin.manage.PluginManager; @@ -31,7 +31,7 @@ public class UpdateOnlineCallback implements ProgressCallback { public void done(PluginTaskResult result){ if (result.isSuccess()) { - FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Update_Success")); + FineLoggerFactory.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Update_Success")); JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Install_Successful")); } else if (result.errorCode() == PluginErrorCode.OperationNotSupport) { int rv = JOptionPane.showOptionDialog( @@ -49,7 +49,7 @@ public class UpdateOnlineCallback implements ProgressCallback { } PluginManager.getController().update(pluginMarker, toPluginMarker, new UpdateOnlineCallback(pluginMarker, toPluginMarker, pane)); } else { - FRLogger.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Delete_Failed")); + FineLoggerFactory.getLogger().info(Inter.getLocText("FR-Designer-Plugin_Delete_Failed")); JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE); } } diff --git a/designer-base/src/com/fr/design/file/HistoryTemplateListPane.java b/designer-base/src/com/fr/design/file/HistoryTemplateListPane.java index dfd1f123f..b9ffee91a 100644 --- a/designer-base/src/com/fr/design/file/HistoryTemplateListPane.java +++ b/designer-base/src/com/fr/design/file/HistoryTemplateListPane.java @@ -1,40 +1,37 @@ package com.fr.design.file; -import java.awt.*; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.util.*; -import java.util.List; -import java.util.logging.Level; - -import javax.swing.*; - +import com.fr.base.FRContext; import com.fr.base.chart.chartdata.CallbackEvent; -import com.fr.design.constants.UIConstants; +import com.fr.dav.LocalEnv; +import com.fr.design.DesignModelAdapter; import com.fr.design.DesignerEnvManager; +import com.fr.design.constants.UIConstants; import com.fr.design.data.DesignTableDataManager; -import com.fr.design.gui.ilable.UILabel; - -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; - -import com.fr.base.FRContext; import com.fr.design.data.datapane.TableDataTreePane; -import com.fr.dav.LocalEnv; -import com.fr.design.DesignModelAdapter; import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilist.UIList; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; import com.fr.design.module.DesignModuleFactory; +import com.fr.design.utils.gui.GUIPaintUtils; import com.fr.file.filetree.FileNode; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; import com.fr.general.GeneralContext; import com.fr.general.Inter; +import com.fr.log.FineLoggerFactory; import com.fr.stable.Constants; import com.fr.stable.project.ProjectConstants; -import com.fr.design.utils.gui.GUIPaintUtils; + +import javax.swing.*; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import java.awt.*; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; public class HistoryTemplateListPane extends JPanel implements FileOperations, CallbackEvent { //最大保存内存中面板数,为0时关闭优化内存 @@ -120,7 +117,7 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations, C try { historyList.remove(contains(selected)); selected.getEditingFILE().closeTemplate(); - FRLogger.getLogger().log(Level.INFO, Inter.getLocText(new String[]{"Template", "alraedy_close"}, new String[]{selected.getEditingFILE().getName(), "."})); + FineLoggerFactory.getLogger().info(Inter.getLocText(new String[]{"Template", "alraedy_close"}, new String[]{selected.getEditingFILE().getName(), "."})); MutilTempalteTabPane.getInstance().refreshOpenedTemplate(historyList); } catch (Exception e) { FRContext.getLogger().error(e.getMessage(), e); diff --git a/designer-base/src/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/com/fr/design/file/MutilTempalteTabPane.java index 24aa39693..e2c026465 100644 --- a/designer-base/src/com/fr/design/file/MutilTempalteTabPane.java +++ b/designer-base/src/com/fr/design/file/MutilTempalteTabPane.java @@ -8,14 +8,13 @@ import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIScrollPopUpMenu; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; -import com.fr.design.mainframe.JVirtualTemplate; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUIPaintUtils; import com.fr.file.FILE; import com.fr.file.FileNodeFILE; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; import com.fr.general.Inter; +import com.fr.log.FineLoggerFactory; import com.fr.stable.Constants; import com.fr.stable.ProductConstants; import com.fr.stable.project.ProjectConstants; @@ -23,10 +22,18 @@ import com.fr.stable.project.ProjectConstants; import javax.swing.*; import javax.swing.plaf.basic.BasicMenuItemUI; import java.awt.*; -import java.awt.event.*; -import java.awt.geom.*; +import java.awt.event.AWTEventListener; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.awt.geom.Arc2D; +import java.awt.geom.GeneralPath; +import java.awt.geom.Line2D; +import java.awt.geom.Path2D; +import java.awt.geom.RoundRectangle2D; import java.io.File; -import java.util.logging.Level; /** * Author : daisy @@ -710,7 +717,7 @@ public class MutilTempalteTabPane extends JComponent implements MouseListener, M ProductConstants.PRODUCT_NAME, JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); if (returnVal == JOptionPane.YES_OPTION && specifiedTemplate.saveTemplate()) { specifiedTemplate.saveTemplate(); - FRLogger.getLogger().log(Level.INFO, Inter.getLocText(new String[]{"Template", "already-saved"}, new String[]{specifiedTemplate.getEditingFILE().getName(), "."})); + FineLoggerFactory.getLogger().info(Inter.getLocText(new String[]{"Template", "already-saved"}, new String[]{specifiedTemplate.getEditingFILE().getName(), "."})); } } HistoryTemplateListPane.getInstance().closeSelectedReport(specifiedTemplate); diff --git a/designer-base/src/com/fr/design/file/SaveSomeTemplatePane.java b/designer-base/src/com/fr/design/file/SaveSomeTemplatePane.java index 568428c4e..522495e80 100644 --- a/designer-base/src/com/fr/design/file/SaveSomeTemplatePane.java +++ b/designer-base/src/com/fr/design/file/SaveSomeTemplatePane.java @@ -1 +1 @@ -package com.fr.design.file; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilist.UIList; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.general.ComparatorUtils; import com.fr.general.FRLogger; import com.fr.general.Inter; import com.fr.stable.ProductConstants; import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.*; import java.util.logging.Level; /** * Author : daisy * Date: 13-8-9 * Time: 下午3:41 */ public class SaveSomeTemplatePane extends BasicPane { private UICheckBox[] templateCheckBoxes = null; private BasicDialog dialog; private JPanel templatesChoosePane; private UIScrollPane scrollPane; private java.util.List> unSavedTemplate = new ArrayList>(); private boolean isAllSaved = false; //该变量用来判断是在关闭其他模板或是关闭设计器的时候,是否需要判断当前模板有没有保存 private boolean isJudgeCurrentEditingTemplate = true; public SaveSomeTemplatePane(boolean isNeedTojudgeCurrent) { this.setLayout(FRGUIPaneFactory.createBorderLayout()); if (this.dialog == null) { this.dialog = this.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { @Override public void doOk() { for (int i = 0; i < templateCheckBoxes.length; i++) { if (templateCheckBoxes[i].isSelected()) { saveSelectedTemplate(unSavedTemplate.get(i)); } } isAllSaved = true; } public void doCancel() { isAllSaved = false; } }); } UILabel tip = new UILabel(Inter.getLocText("Select_The_Source_To_Save")); this.add(tip, BorderLayout.NORTH); templatesChoosePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); UIScrollPane scrollPane = new UIScrollPane(templatesChoosePane); this.add(scrollPane, BorderLayout.CENTER); this.isJudgeCurrentEditingTemplate = isNeedTojudgeCurrent; } private void initTemplatesChoosePane() { templatesChoosePane.setBorder(BorderFactory.createTitledBorder("")); for (int i = 0; i < unSavedTemplate.size(); i++) { templateCheckBoxes[i] = new UICheckBox(unSavedTemplate.get(i).getEditingFILE().getName()); templateCheckBoxes[i].setSelected(true); } final UIList templatesList = new UIList(templateCheckBoxes); templatesList.setModel(new UnSeletedTemplateListDataMode()); templatesList.setCellRenderer(new UnSelectedListCellRender()); templatesList.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { super.mousePressed(e); int index = templatesList.getSelectedIndex(); if (index < 0) { return; } UICheckBox checkBox = (UICheckBox) templatesList.getModel().getElementAt(index); checkBox.setSelected(!checkBox.isSelected()); templatesList.repaint(); } }); final UICheckBox filenameCheckBox = new UICheckBox(Inter.getLocText("Choose_All")); filenameCheckBox.setSelected(true); filenameCheckBox.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { boolean isSelected = filenameCheckBox.isSelected(); for (int i = 0; i < templatesList.getModel().getSize(); i++) { UICheckBox checkBox = (UICheckBox) templatesList.getModel().getElementAt(i); checkBox.setSelected(isSelected); } templatesList.repaint(); } }); templatesChoosePane.add(filenameCheckBox, BorderLayout.NORTH); templatesChoosePane.add(templatesList, BorderLayout.CENTER); } public boolean showSavePane() { populate(); //如果有未保存的文件 ,则跳出保存对话框,选择要存储的项目 if (!unSavedTemplate.isEmpty()) { dialog.setVisible(true); } else { isAllSaved = true; } return isAllSaved; } public void populate() { java.util.List> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); JTemplate currentTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); for (int i = 0; i < opendedTemplate.size(); i++) { if (isneedToAdd(opendedTemplate.get(i), currentTemplate)) { unSavedTemplate.add(opendedTemplate.get(i)); } } templateCheckBoxes = new UICheckBox[unSavedTemplate.size()]; initTemplatesChoosePane(); } private boolean isneedToAdd(JTemplate template, JTemplate currentTemplate) { //所有模板都判断是不是保存 if (isJudgeCurrentEditingTemplate) { return !template.isALLSaved(); } //当前编辑的模板不判断是否已经保存 if (ComparatorUtils.equals(template, currentTemplate)) { return false; } else { return !template.isALLSaved(); } } private void saveSelectedTemplate(JTemplate specifiedTemplate) { if (!specifiedTemplate.isSaved()) { specifiedTemplate.stopEditing(); specifiedTemplate.saveTemplate(); } FRLogger.getLogger().log(Level.INFO, Inter.getLocText(new String[]{"Template", "already-saved"}, new String[]{specifiedTemplate.getEditingFILE().getName(), "."})); } public int saveLastOneTemplate() { JTemplate specifiedTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); if (!specifiedTemplate.isALLSaved()) { specifiedTemplate.stopEditing(); int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("Utils-Would_you_like_to_save") + " \"" + specifiedTemplate.getEditingFILE() + "\" ?", ProductConstants.PRODUCT_NAME, JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); if (returnVal == JOptionPane.YES_OPTION && specifiedTemplate.saveTemplate()) { specifiedTemplate.saveTemplate(); FRLogger.getLogger().log(Level.INFO, Inter.getLocText(new String[]{"Template", "already-saved"}, new String[]{specifiedTemplate.getEditingFILE().getName(), "."})); } return returnVal; } return JOptionPane.YES_OPTION; } protected String title4PopupWindow() { return Inter.getLocText("Save"); } private class UnSelectedListCellRender extends DefaultListCellRenderer { @Override public Component getListCellRendererComponent(JList list, Object value, int index, final boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); templateCheckBoxes[index] = (UICheckBox) value; templateCheckBoxes[index].setBackground(list.getBackground()); return templateCheckBoxes[index]; } } private class UnSeletedTemplateListDataMode extends AbstractListModel { @Override public int getSize() { return templateCheckBoxes.length; } @Override public UICheckBox getElementAt(int index) { if (index > getSize() - 1 || index < 0) { return null; } return templateCheckBoxes[index]; } } } \ No newline at end of file +package com.fr.design.file; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilist.UIList; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; import com.fr.log.FineLoggerFactory; import com.fr.stable.ProductConstants; import javax.swing.*; import java.awt.*; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.ArrayList; /** * Author : daisy * Date: 13-8-9 * Time: 下午3:41 */ public class SaveSomeTemplatePane extends BasicPane { private UICheckBox[] templateCheckBoxes = null; private BasicDialog dialog; private JPanel templatesChoosePane; private UIScrollPane scrollPane; private java.util.List> unSavedTemplate = new ArrayList>(); private boolean isAllSaved = false; //该变量用来判断是在关闭其他模板或是关闭设计器的时候,是否需要判断当前模板有没有保存 private boolean isJudgeCurrentEditingTemplate = true; public SaveSomeTemplatePane(boolean isNeedTojudgeCurrent) { this.setLayout(FRGUIPaneFactory.createBorderLayout()); if (this.dialog == null) { this.dialog = this.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { @Override public void doOk() { for (int i = 0; i < templateCheckBoxes.length; i++) { if (templateCheckBoxes[i].isSelected()) { saveSelectedTemplate(unSavedTemplate.get(i)); } } isAllSaved = true; } public void doCancel() { isAllSaved = false; } }); } UILabel tip = new UILabel(Inter.getLocText("Select_The_Source_To_Save")); this.add(tip, BorderLayout.NORTH); templatesChoosePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); UIScrollPane scrollPane = new UIScrollPane(templatesChoosePane); this.add(scrollPane, BorderLayout.CENTER); this.isJudgeCurrentEditingTemplate = isNeedTojudgeCurrent; } private void initTemplatesChoosePane() { templatesChoosePane.setBorder(BorderFactory.createTitledBorder("")); for (int i = 0; i < unSavedTemplate.size(); i++) { templateCheckBoxes[i] = new UICheckBox(unSavedTemplate.get(i).getEditingFILE().getName()); templateCheckBoxes[i].setSelected(true); } final UIList templatesList = new UIList(templateCheckBoxes); templatesList.setModel(new UnSeletedTemplateListDataMode()); templatesList.setCellRenderer(new UnSelectedListCellRender()); templatesList.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { super.mousePressed(e); int index = templatesList.getSelectedIndex(); if (index < 0) { return; } UICheckBox checkBox = (UICheckBox) templatesList.getModel().getElementAt(index); checkBox.setSelected(!checkBox.isSelected()); templatesList.repaint(); } }); final UICheckBox filenameCheckBox = new UICheckBox(Inter.getLocText("Choose_All")); filenameCheckBox.setSelected(true); filenameCheckBox.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { boolean isSelected = filenameCheckBox.isSelected(); for (int i = 0; i < templatesList.getModel().getSize(); i++) { UICheckBox checkBox = (UICheckBox) templatesList.getModel().getElementAt(i); checkBox.setSelected(isSelected); } templatesList.repaint(); } }); templatesChoosePane.add(filenameCheckBox, BorderLayout.NORTH); templatesChoosePane.add(templatesList, BorderLayout.CENTER); } public boolean showSavePane() { populate(); //如果有未保存的文件 ,则跳出保存对话框,选择要存储的项目 if (!unSavedTemplate.isEmpty()) { dialog.setVisible(true); } else { isAllSaved = true; } return isAllSaved; } public void populate() { java.util.List> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); JTemplate currentTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); for (int i = 0; i < opendedTemplate.size(); i++) { if (isneedToAdd(opendedTemplate.get(i), currentTemplate)) { unSavedTemplate.add(opendedTemplate.get(i)); } } templateCheckBoxes = new UICheckBox[unSavedTemplate.size()]; initTemplatesChoosePane(); } private boolean isneedToAdd(JTemplate template, JTemplate currentTemplate) { //所有模板都判断是不是保存 if (isJudgeCurrentEditingTemplate) { return !template.isALLSaved(); } //当前编辑的模板不判断是否已经保存 if (ComparatorUtils.equals(template, currentTemplate)) { return false; } else { return !template.isALLSaved(); } } private void saveSelectedTemplate(JTemplate specifiedTemplate) { if (!specifiedTemplate.isSaved()) { specifiedTemplate.stopEditing(); specifiedTemplate.saveTemplate(); } FineLoggerFactory.getLogger().info( Inter.getLocText(new String[]{"Template", "already-saved"}, new String[]{specifiedTemplate.getEditingFILE().getName(), "."})); } public int saveLastOneTemplate() { JTemplate specifiedTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); if (!specifiedTemplate.isALLSaved()) { specifiedTemplate.stopEditing(); int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("Utils-Would_you_like_to_save") + " \"" + specifiedTemplate.getEditingFILE() + "\" ?", ProductConstants.PRODUCT_NAME, JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); if (returnVal == JOptionPane.YES_OPTION && specifiedTemplate.saveTemplate()) { specifiedTemplate.saveTemplate(); FineLoggerFactory.getLogger().info(Inter.getLocText(new String[]{"Template", "already-saved"}, new String[]{specifiedTemplate.getEditingFILE().getName(), "."})); } return returnVal; } return JOptionPane.YES_OPTION; } protected String title4PopupWindow() { return Inter.getLocText("Save"); } private class UnSelectedListCellRender extends DefaultListCellRenderer { @Override public Component getListCellRendererComponent(JList list, Object value, int index, final boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); templateCheckBoxes[index] = (UICheckBox) value; templateCheckBoxes[index].setBackground(list.getBackground()); return templateCheckBoxes[index]; } } private class UnSeletedTemplateListDataMode extends AbstractListModel { @Override public int getSize() { return templateCheckBoxes.length; } @Override public UICheckBox getElementAt(int index) { if (index > getSize() - 1 || index < 0) { return null; } return templateCheckBoxes[index]; } } } \ No newline at end of file diff --git a/designer-base/src/com/fr/design/file/TemplateTreePane.java b/designer-base/src/com/fr/design/file/TemplateTreePane.java index a52e42389..f2fb514f7 100644 --- a/designer-base/src/com/fr/design/file/TemplateTreePane.java +++ b/designer-base/src/com/fr/design/file/TemplateTreePane.java @@ -15,8 +15,8 @@ import com.fr.file.FileNodeFILE; import com.fr.file.filetree.FileNode; import com.fr.file.filetree.IOFileNodeFilter; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; import com.fr.general.Inter; +import com.fr.log.FineLoggerFactory; import com.fr.stable.CoreConstants; import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; @@ -34,7 +34,6 @@ import java.awt.event.MouseListener; import java.io.File; import java.io.IOException; import java.util.ArrayList; -import java.util.logging.Level; public class TemplateTreePane extends JPanel implements FileOperations { @@ -157,7 +156,7 @@ public class TemplateTreePane extends JPanel implements FileOperations { */ public void refresh() { reportletsTree.refresh(); - FRLogger.getLogger().log(Level.INFO, Inter.getLocText(new String[]{"File-tree", "Refresh_Successfully"}) + "!"); + FineLoggerFactory.getLogger().info(Inter.getLocText(new String[]{"File-tree", "Refresh_Successfully"}) + "!"); } /** @@ -297,11 +296,11 @@ public class TemplateTreePane extends JPanel implements FileOperations { //todo 走下这个流程,否则集群下其它节点无法同步删除 FRContext.getCurrentEnv().deleteFile(nodeFile.getPath()); } catch (IOException e) { - FRLogger.getLogger().info(e.getMessage()); + FineLoggerFactory.getLogger().info(e.getMessage()); FRContext.getCurrentEnv().deleteFile(nodeFile.getPath()); } } else { - FRLogger.getLogger().info("No Trash Available"); + FineLoggerFactory.getLogger().info("No Trash Available"); FRContext.getCurrentEnv().deleteFile(nodeFile.getPath()); } } diff --git a/designer-base/src/com/fr/design/formula/JavaEditorPane.java b/designer-base/src/com/fr/design/formula/JavaEditorPane.java index 0ba32641c..a5245d685 100644 --- a/designer-base/src/com/fr/design/formula/JavaEditorPane.java +++ b/designer-base/src/com/fr/design/formula/JavaEditorPane.java @@ -9,7 +9,7 @@ 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.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.stable.EncodeConstants; import com.fr.stable.JavaCompileInfo; @@ -65,7 +65,7 @@ public class JavaEditorPane extends BasicPane { javaText.setText("//Didn't find java source match the class"); } } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); javaText.setText("//Loading source code from server error"); } } @@ -162,7 +162,7 @@ public class JavaEditorPane extends BasicPane { JOptionPane.showMessageDialog(null, Inter.getLocText(new String[]{"Save", "Successfully"}) + "!"); fireSaveActionListener(); } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); JOptionPane.showMessageDialog(null, Inter.getLocText(new String[]{"Save", "Failed"}) + "!"); } @@ -191,9 +191,9 @@ public class JavaEditorPane extends BasicPane { } JOptionPane.showMessageDialog(null, message); } catch (InterruptedException e1) { - FRLogger.getLogger().error(e1.getMessage(), e1); + FineLoggerFactory.getLogger().error(e1.getMessage(), e1); } catch (ExecutionException e1) { - FRLogger.getLogger().error(e1.getMessage(), e1); + FineLoggerFactory.getLogger().error(e1.getMessage(), e1); } } }.execute(); diff --git a/designer-base/src/com/fr/design/gui/UILookAndFeel.java b/designer-base/src/com/fr/design/gui/UILookAndFeel.java index ed93237f3..f02715716 100644 --- a/designer-base/src/com/fr/design/gui/UILookAndFeel.java +++ b/designer-base/src/com/fr/design/gui/UILookAndFeel.java @@ -29,7 +29,7 @@ import com.fr.design.gui.itoolbar.UIToolBarBorder; import com.fr.design.gui.itoolbar.UIToolBarSeparatorUI; import com.fr.design.gui.itooltip.UIToolTipBorder; import com.fr.design.gui.itree.UITreeUI; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.IOUtils; import javax.swing.ImageIcon; @@ -195,7 +195,7 @@ public class UILookAndFeel extends MetalLookAndFeel { "com/fr/design/images/lookandfeel/" + fileName, UILookAndFeel.class); if (url == null) { - FRLogger.getLogger().error("Icon directory could not be resolved."); + FineLoggerFactory.getLogger().error("Icon directory could not be resolved."); return null; } } diff --git a/designer-base/src/com/fr/design/gui/autocomplete/AutoCompletePopupWindow.java b/designer-base/src/com/fr/design/gui/autocomplete/AutoCompletePopupWindow.java index 8a02bb057..6cdc26bfb 100644 --- a/designer-base/src/com/fr/design/gui/autocomplete/AutoCompletePopupWindow.java +++ b/designer-base/src/com/fr/design/gui/autocomplete/AutoCompletePopupWindow.java @@ -10,7 +10,7 @@ package com.fr.design.gui.autocomplete; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.PopupWindowDecorator; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import javax.swing.*; import javax.swing.event.CaretEvent; @@ -303,7 +303,7 @@ class AutoCompletePopupWindow extends JWindow implements CaretListener, private void installKeyBindings() { if (AutoCompletion.isDebug()) { - FRLogger.getLogger().debug("PopupWindow: Installing keybindings"); + FineLoggerFactory.getLogger().debug("PopupWindow: Installing keybindings"); } if (escapeKap == null) { // Lazily create actions. @@ -711,7 +711,7 @@ class AutoCompletePopupWindow extends JWindow implements CaretListener, private void uninstallKeyBindings() { if (AutoCompletion.isDebug()) { - FRLogger.getLogger().debug("PopupWindow: Removing keybindings"); + FineLoggerFactory.getLogger().debug("PopupWindow: Removing keybindings"); } JTextComponent comp = ac.getTextComponent(); diff --git a/designer-base/src/com/fr/design/gui/autocomplete/ParameterizedCompletionContext.java b/designer-base/src/com/fr/design/gui/autocomplete/ParameterizedCompletionContext.java index 8b93f8540..a9dd305b0 100644 --- a/designer-base/src/com/fr/design/gui/autocomplete/ParameterizedCompletionContext.java +++ b/designer-base/src/com/fr/design/gui/autocomplete/ParameterizedCompletionContext.java @@ -14,7 +14,7 @@ import com.fr.design.gui.autocomplete.ParameterizedCompletionInsertionInfo.Repla import com.fr.design.gui.syntax.ui.rsyntaxtextarea.DocumentRange; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; import com.fr.design.gui.syntax.ui.rtextarea.ChangeableHighlightPainter; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import javax.swing.*; import javax.swing.event.CaretEvent; @@ -440,7 +440,7 @@ class ParameterizedCompletionContext { */ private void installKeyBindings() { if (AutoCompletion.isDebug()) { - FRLogger.getLogger().debug("CompletionContext: Installing keybindings"); + FineLoggerFactory.getLogger().debug("CompletionContext: Installing keybindings"); } JTextComponent tc = ac.getTextComponent(); InputMap im = tc.getInputMap(); @@ -739,7 +739,7 @@ class ParameterizedCompletionContext { private void uninstallKeyBindings() { if (AutoCompletion.isDebug()) { - FRLogger.getLogger().debug("CompletionContext Uninstalling keybindings"); + FineLoggerFactory.getLogger().debug("CompletionContext Uninstalling keybindings"); } JTextComponent tc = ac.getTextComponent(); diff --git a/designer-base/src/com/fr/design/gui/frpane/UITabbedPaneUI.java b/designer-base/src/com/fr/design/gui/frpane/UITabbedPaneUI.java index 38d33984c..d95740798 100644 --- a/designer-base/src/com/fr/design/gui/frpane/UITabbedPaneUI.java +++ b/designer-base/src/com/fr/design/gui/frpane/UITabbedPaneUI.java @@ -2,7 +2,7 @@ package com.fr.design.gui.frpane; import com.fr.base.BaseUtils; import com.fr.design.constants.UIConstants; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.GeneralUtils; import javax.swing.*; @@ -129,7 +129,7 @@ public class UITabbedPaneUI extends BasicTabbedPaneUI { tabPane.addTab(tabName, (Component) GeneralUtils.classForName(classpath).newInstance()); } catch (Exception ex) { - FRLogger.getLogger().error(ex.getMessage(), ex); + FineLoggerFactory.getLogger().error(ex.getMessage(), ex); } } } diff --git a/designer-base/src/com/fr/design/gui/icombobox/LazyComboBox.java b/designer-base/src/com/fr/design/gui/icombobox/LazyComboBox.java index 2ec5590f6..575ab630b 100644 --- a/designer-base/src/com/fr/design/gui/icombobox/LazyComboBox.java +++ b/designer-base/src/com/fr/design/gui/icombobox/LazyComboBox.java @@ -3,7 +3,7 @@ */ package com.fr.design.gui.icombobox; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import javax.swing.DefaultComboBoxModel; @@ -83,7 +83,7 @@ public abstract class LazyComboBox extends UIComboBox implements PopupMenuListen try { LazyComboBox.this.loadList(get()); } catch (InterruptedException | ExecutionException exception) { - FRLogger.getLogger().debug(exception.getMessage()); + FineLoggerFactory.getLogger().debug(exception.getMessage()); } LazyComboBox.this.showPopup(); } diff --git a/designer-base/src/com/fr/design/gui/imenu/UIBasicMenuUI.java b/designer-base/src/com/fr/design/gui/imenu/UIBasicMenuUI.java index 9279ba868..9d8c23259 100644 --- a/designer-base/src/com/fr/design/gui/imenu/UIBasicMenuUI.java +++ b/designer-base/src/com/fr/design/gui/imenu/UIBasicMenuUI.java @@ -6,7 +6,7 @@ package com.fr.design.gui.imenu; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import javax.swing.*; import javax.swing.event.*; @@ -504,7 +504,7 @@ public class UIBasicMenuUI extends UIBasicMenuItemUI { } if (DEBUG) { - FRLogger.getLogger().info("in TinyMenuUI.menuKeyTyped for " + menuItem.getText()); + FineLoggerFactory.getLogger().info("in TinyMenuUI.menuKeyTyped for " + menuItem.getText()); } if (!crossMenuMnemonic) { @@ -544,7 +544,7 @@ public class UIBasicMenuUI extends UIBasicMenuItemUI { return; } if (DEBUG) { - FRLogger.getLogger().info("in TinyMenuUI.menuKeyPressed for " + menuItem.getText()); + FineLoggerFactory.getLogger().info("in TinyMenuUI.menuKeyPressed for " + menuItem.getText()); } char keyChar = e.getKeyChar(); if (!Character.isLetterOrDigit(keyChar)){ diff --git a/designer-base/src/com/fr/design/gui/imenutable/UIMenuNameableCreator.java b/designer-base/src/com/fr/design/gui/imenutable/UIMenuNameableCreator.java index bc593c00a..544d1e4e5 100644 --- a/designer-base/src/com/fr/design/gui/imenutable/UIMenuNameableCreator.java +++ b/designer-base/src/com/fr/design/gui/imenutable/UIMenuNameableCreator.java @@ -1,7 +1,7 @@ package com.fr.design.gui.imenutable; import com.fr.design.beans.BasicBeanPane; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.stable.Nameable; public class UIMenuNameableCreator implements Nameable{ @@ -46,9 +46,9 @@ public class UIMenuNameableCreator implements Nameable{ try { cloneObj = obj.getClass().newInstance(); } catch (InstantiationException e) { - FRLogger.getLogger().error("UIMenuNameableCreator InstantiationException"); + FineLoggerFactory.getLogger().error("UIMenuNameableCreator InstantiationException"); } catch (IllegalAccessException e) { - FRLogger.getLogger().error("UIMenuNameableCreator IllegalAccessException"); + FineLoggerFactory.getLogger().error("UIMenuNameableCreator IllegalAccessException"); } return new UIMenuNameableCreator(name, cloneObj, this.paneClazz); diff --git a/designer-base/src/com/fr/design/gui/style/NumberDragBar.java b/designer-base/src/com/fr/design/gui/style/NumberDragBar.java index cd9e7f8cb..5ab5c1698 100644 --- a/designer-base/src/com/fr/design/gui/style/NumberDragBar.java +++ b/designer-base/src/com/fr/design/gui/style/NumberDragBar.java @@ -1,7 +1,7 @@ package com.fr.design.gui.style; import com.fr.design.constants.UIConstants; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import javax.swing.*; import javax.swing.event.ChangeEvent; @@ -126,7 +126,7 @@ public class NumberDragBar extends JComponent { repaint(); revalidate(); } catch (InterruptedException e) { - FRLogger.getLogger().error(e.toString()); + FineLoggerFactory.getLogger().error(e.toString()); } } }); diff --git a/designer-base/src/com/fr/design/javascript/beautify/JavaScriptFormatHelper.java b/designer-base/src/com/fr/design/javascript/beautify/JavaScriptFormatHelper.java index 10fb64ded..fef32a875 100644 --- a/designer-base/src/com/fr/design/javascript/beautify/JavaScriptFormatHelper.java +++ b/designer-base/src/com/fr/design/javascript/beautify/JavaScriptFormatHelper.java @@ -1,7 +1,7 @@ package com.fr.design.javascript.beautify; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.IOUtils; import com.fr.script.ScriptFactory; @@ -42,7 +42,7 @@ public class JavaScriptFormatHelper { Invocable invocable = (Invocable) scriptEngine; result = (String) invocable.invokeFunction("js_beautify", jsCode, option.toFormatArgument()); } catch (ScriptException | NoSuchMethodException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } return result; } diff --git a/designer-base/src/com/fr/design/mainframe/DesignerContext.java b/designer-base/src/com/fr/design/mainframe/DesignerContext.java index 3b76aab40..9362f37c5 100644 --- a/designer-base/src/com/fr/design/mainframe/DesignerContext.java +++ b/designer-base/src/com/fr/design/mainframe/DesignerContext.java @@ -6,7 +6,7 @@ package com.fr.design.mainframe; import com.fr.base.Style; import com.fr.design.designer.TargetComponent; import com.fr.design.dialog.BasicDialog; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StableUtils; import javax.swing.*; @@ -73,14 +73,14 @@ public class DesignerContext { return (Clipboard) clipMethod.invoke(transferAction, new Object[]{comp}); } catch (Exception securityException) { - FRLogger.getLogger().error(securityException.getMessage(), securityException); + FineLoggerFactory.getLogger().error(securityException.getMessage(), securityException); //用反射机制,获得TransferHandler的getClipboard //这样可以保证和TextField直接的copy paste try { //控件的Clipboard. DesignerContext.clipboard = comp.getToolkit().getSystemClipboard(); } catch (Exception exp) { - FRLogger.getLogger().error(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); DesignerContext.clipboard = new Clipboard("FR"); } } diff --git a/designer-base/src/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/com/fr/design/mainframe/DesignerFrame.java index fa70748d8..d8096aab2 100644 --- a/designer-base/src/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/com/fr/design/mainframe/DesignerFrame.java @@ -40,10 +40,11 @@ import com.fr.file.FILEFactory; import com.fr.file.FileFILE; import com.fr.file.FileNodeFILE; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.GeneralContext; import com.fr.general.Inter; import com.fr.general.env.EnvContext; +import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginContext; import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.manage.PluginFilter; @@ -56,23 +57,9 @@ import com.fr.stable.StableUtils; import com.fr.stable.image4j.codec.ico.ICODecoder; import com.fr.stable.project.ProjectConstants; -import javax.swing.Icon; -import javax.swing.JComponent; -import javax.swing.JFrame; -import javax.swing.JLayeredPane; -import javax.swing.JMenuBar; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.WindowConstants; +import javax.swing.*; import javax.swing.border.MatteBorder; -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Graphics; -import java.awt.Insets; -import java.awt.Point; -import java.awt.Rectangle; -import java.awt.Toolkit; +import java.awt.*; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; import java.awt.dnd.DnDConstants; @@ -95,7 +82,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import java.util.logging.Level; public class DesignerFrame extends JFrame implements JTemplateActionListener, TargetModifiedListener { public static final String DESIGNER_FRAME_NAME = "designer_frame"; @@ -736,18 +722,14 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta JOptionPane.QUESTION_MESSAGE); if (returnVal == JOptionPane.YES_OPTION && editingTemplate.saveTemplate()) { editingTemplate.saveTemplate(); - FRLogger.getLogger().log( - Level.INFO, - Inter.getLocText(new String[]{"Template", "already-saved"}, new String[]{ - editingTemplate.getEditingFILE().getName(), "."})); + FineLoggerFactory.getLogger().info(Inter.getLocText(new String[]{"Template", "already-saved"}, new String[]{ + editingTemplate.getEditingFILE().getName(), "."})); } } else { if (editingTemplate.saveTemplate()) { editingTemplate.saveTemplate(); - FRLogger.getLogger().log( - Level.INFO, - Inter.getLocText(new String[]{"Template", "already-saved"}, new String[]{ - editingTemplate.getEditingFILE().getName(), "."})); + FineLoggerFactory.getLogger().info(Inter.getLocText(new String[]{"Template", "already-saved"}, new String[]{ + editingTemplate.getEditingFILE().getName(), "."})); } } } @@ -846,7 +828,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta return; } } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } // p:判断一下,如何文件为空或者文件不存在,直接返回. @@ -860,7 +842,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta try { openFile(tplFile); } catch (Throwable t) { - FRLogger.getLogger().error(t.getMessage(), t); + FineLoggerFactory.getLogger().error(t.getMessage(), t); addAndActivateJTemplate(); } @@ -964,7 +946,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta try { thread.join(); } catch (InterruptedException e) { - FRLogger.getLogger().error("Map Thread Error"); + FineLoggerFactory.getLogger().error("Map Thread Error"); } DesignerEnvManager.getEnvManager().setLastOpenFile( diff --git a/designer-base/src/com/fr/design/mainframe/JTemplate.java b/designer-base/src/com/fr/design/mainframe/JTemplate.java index 40d00a703..bec2dcf2e 100644 --- a/designer-base/src/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/com/fr/design/mainframe/JTemplate.java @@ -45,7 +45,7 @@ import com.fr.file.MemFILE; import com.fr.form.ui.NoneWidget; import com.fr.form.ui.Widget; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.report.cell.Elem; import com.fr.report.cell.cellattr.CellImage; @@ -531,7 +531,7 @@ public abstract class JTemplate> return false; } } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } diff --git a/designer-base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java b/designer-base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java index 9a5effae4..ebc69aef5 100644 --- a/designer-base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java +++ b/designer-base/src/com/fr/design/mainframe/loghandler/DesignerLogHandler.java @@ -7,11 +7,10 @@ import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogLevel; -import com.fr.general.FRLogger; import com.fr.general.GeneralContext; import com.fr.general.Inter; -import com.fr.general.LogRecordTime; +import com.fr.general.log.Log4jConfig; +import com.fr.log.FineLoggerFactory; import com.fr.log.LogHandler; import com.fr.stable.EnvChangedListener; import com.fr.stable.xml.LogRecordTimeProvider; @@ -38,9 +37,9 @@ import java.util.logging.LogRecord; import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; public class DesignerLogHandler { - protected static final int INFO_INT = FRLogLevel.INFO.intValue(); - protected static final int ERRO_INT = FRLogLevel.ERROR.intValue(); - protected static final int SERVER_INT = FRLogLevel.SEVERE.intValue(); + protected static final int INFO_INT = com.fr.third.apache.log4j.Level.INFO.toInt(); + protected static final int ERROR_INT = com.fr.third.apache.log4j.Level.ERROR.toInt(); + protected static final int WARN_INT = com.fr.third.apache.log4j.Level.WARN.toInt(); private static final int GAP_X = -150; private static final int INFO_GAP_Y = -60; private static final int ERRO_GAP_Y = -40; @@ -51,7 +50,7 @@ public class DesignerLogHandler { @Override public void envChanged() { // envchange后需要重新读取webinf里的log4j配置, 重新添加appender - FRLogger.getLogger().addLogAppender(new LogHandler() { + FineLoggerFactory.getLogger().addLogAppender(new LogHandler() { @Override public DesignerLogAppender getHandler() { return new DesignerLogAppender(); @@ -119,20 +118,20 @@ public class DesignerLogHandler { @Override public void actionPerformed(ActionEvent e) { - JPopupMenu showsetPopup = new JPopupMenu(); - int logLevelvalue = ServerConfig.getInstance().getServerLogLevel().intValue(); - if (logLevelvalue <= INFO_INT) { - showsetPopup.add(showInfo); - showsetPopup.add(showError); - showsetPopup.add(showServer); - showsetPopup.show(caption, caption.getWidth() + GAP_X, INFO_GAP_Y); - } else if (logLevelvalue == ERRO_INT) { - showsetPopup.add(showError); - showsetPopup.add(showServer); - showsetPopup.show(caption, caption.getWidth() + GAP_X, ERRO_GAP_Y); + JPopupMenu jPopupMenu = new JPopupMenu(); + int logLevelInt = Log4jConfig.getInstance().getRootLevel().toInt(); + if (logLevelInt <= INFO_INT) { + jPopupMenu.add(showInfo); + jPopupMenu.add(showError); + jPopupMenu.add(showServer); + jPopupMenu.show(caption, caption.getWidth() + GAP_X, INFO_GAP_Y); + } else if (logLevelInt == ERROR_INT) { + jPopupMenu.add(showError); + jPopupMenu.add(showServer); + jPopupMenu.show(caption, caption.getWidth() + GAP_X, ERRO_GAP_Y); } else { - showsetPopup.add(showServer); - showsetPopup.show(caption, caption.getWidth() + GAP_X, SERVER_GAP_Y); + jPopupMenu.add(showServer); + jPopupMenu.show(caption, caption.getWidth() + GAP_X, SERVER_GAP_Y); } } }); @@ -150,10 +149,6 @@ public class DesignerLogHandler { logHandlerArea.printStackTrace(message, level, date); } - public void printRemoteLog(LogRecordTime logRecordTime) { - logHandlerArea.printStackTrace(logRecordTime); - } - private class LogHandlerArea extends JPanel { private static final long serialVersionUID = 8215630927304621660L; @@ -227,9 +222,9 @@ public class DesignerLogHandler { int logLevelvalue = logRecord.getLevel().intValue(); if (logLevelvalue == INFO_INT && showInfo.isSelected()) { printMessage(logRecord.getMessage(), logLevelvalue, date, logRecord.getThrown()); - } else if (logLevelvalue == ERRO_INT && showError.isSelected()) { + } else if (logLevelvalue == ERROR_INT && showError.isSelected()) { printMessage(logRecord.getMessage(), logLevelvalue, date, logRecord.getThrown()); - } else if (logLevelvalue == SERVER_INT && showServer.isSelected()) { + } else if (logLevelvalue == WARN_INT && showServer.isSelected()) { printMessage(logRecord.getMessage(), logLevelvalue, date, logRecord.getThrown()); } @@ -239,9 +234,9 @@ public class DesignerLogHandler { int logLevelvalue = level.intValue(); if (logLevelvalue == INFO_INT && showInfo.isSelected()) { printMessage(message, logLevelvalue, date); - } else if (logLevelvalue == ERRO_INT && showError.isSelected()) { + } else if (logLevelvalue == ERROR_INT && showError.isSelected()) { printMessage(message, logLevelvalue, date); - } else if (logLevelvalue == SERVER_INT && showServer.isSelected()) { + } else if (logLevelvalue == WARN_INT && showServer.isSelected()) { printMessage(message, logLevelvalue, date); } @@ -269,10 +264,10 @@ public class DesignerLogHandler { private void log(String str, int style) { SimpleAttributeSet attrSet = new SimpleAttributeSet(); - if (style == ERRO_INT) { + if (style == ERROR_INT) { StyleConstants.setForeground(attrSet, new Color(247, 148, 29)); StyleConstants.setBold(attrSet, true); - } else if (style == SERVER_INT) { + } else if (style == WARN_INT) { StyleConstants.setForeground(attrSet, Color.red); StyleConstants.setBold(attrSet, true); } else if (style == INFO_INT) { @@ -291,9 +286,9 @@ public class DesignerLogHandler { } private String swithInter(String str, int style) { - if (style == ERRO_INT) { + if (style == ERROR_INT) { str = Inter.getLocText("FR-Designer_Alert") + ":" + str + "\n"; - } else if (style == SERVER_INT) { + } else if (style == WARN_INT) { str = Inter.getLocText("FR-Designer_Seriously") + ":" + str + "\n"; } else { str = Inter.getLocText("FR-Designer_Normal") + ":" + str + "\n"; @@ -305,9 +300,9 @@ public class DesignerLogHandler { LogMessageBar.getInstance().setMessage(message); if (level == DesignerLogHandler.INFO_INT && showInfo.isSelected()) { caption.infoAdd(); - } else if (level == DesignerLogHandler.ERRO_INT && showError.isSelected()) { + } else if (level == DesignerLogHandler.ERROR_INT && showError.isSelected()) { caption.errorAdd(); - } else if (level == DesignerLogHandler.SERVER_INT && showServer.isSelected()) { + } else if (level == DesignerLogHandler.WARN_INT && showServer.isSelected()) { caption.serverAdd(); } } diff --git a/designer-base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer-base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java index 8a01b6b95..d4450b43e 100644 --- a/designer-base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java +++ b/designer-base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -9,7 +9,7 @@ import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.SiteCenterToken; import com.fr.env.RemoteEnv; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.GeneralUtils; import com.fr.general.IOUtils; import com.fr.general.SiteCenter; @@ -207,7 +207,7 @@ public class TemplateInfoCollector implements Serializable, FileOutputStream out = new FileOutputStream(getInfoFile()); XMLTools.writeOutputStreamXML(this, out); } catch (Exception ex) { - FRLogger.getLogger().error(ex.getMessage()); + FineLoggerFactory.getLogger().error(ex.getMessage()); } } diff --git a/designer-base/src/com/fr/design/style/background/BackgroundPane.java b/designer-base/src/com/fr/design/style/background/BackgroundPane.java index 7d2c5ba69..1caf13e1d 100644 --- a/designer-base/src/com/fr/design/style/background/BackgroundPane.java +++ b/designer-base/src/com/fr/design/style/background/BackgroundPane.java @@ -17,7 +17,7 @@ import javax.swing.event.EventListenerList; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.dialog.BasicPane; import com.fr.general.Background; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; public class BackgroundPane extends BasicPane { @@ -139,7 +139,7 @@ public class BackgroundPane extends BasicPane { try { return quickPane.update(); } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } return null; } diff --git a/designer-base/src/com/fr/design/style/color/ColorPicker.java b/designer-base/src/com/fr/design/style/color/ColorPicker.java index e91968675..90b859fcc 100644 --- a/designer-base/src/com/fr/design/style/color/ColorPicker.java +++ b/designer-base/src/com/fr/design/style/color/ColorPicker.java @@ -5,7 +5,7 @@ package com.fr.design.style.color; */ import com.fr.base.BaseUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import javax.swing.*; import java.awt.*; @@ -73,7 +73,7 @@ public class ColorPicker extends JDialog implements ActionListener try { Thread.sleep(100); // 等待弹窗关闭 } catch (InterruptedException e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } colorPickerPanel.captureScreen(); } diff --git a/designer-base/src/com/fr/design/style/color/ColorSelectConfigManager.java b/designer-base/src/com/fr/design/style/color/ColorSelectConfigManager.java index dd92aa52e..80e1048b7 100644 --- a/designer-base/src/com/fr/design/style/color/ColorSelectConfigManager.java +++ b/designer-base/src/com/fr/design/style/color/ColorSelectConfigManager.java @@ -3,7 +3,7 @@ package com.fr.design.style.color; import com.fr.base.FRContext; import com.fr.file.XMLFileManager; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.GeneralContext; import com.fr.stable.EnvChangedListener; import com.fr.stable.xml.XMLPrintWriter; @@ -99,7 +99,7 @@ public class ColorSelectConfigManager extends XMLFileManager implements ColorSel try { FRContext.getCurrentEnv().writeResource(manager); } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } } diff --git a/designer-base/src/com/fr/design/style/color/CustomChooserPanel.java b/designer-base/src/com/fr/design/style/color/CustomChooserPanel.java index 852c8b2b1..15f11de11 100644 --- a/designer-base/src/com/fr/design/style/color/CustomChooserPanel.java +++ b/designer-base/src/com/fr/design/style/color/CustomChooserPanel.java @@ -28,7 +28,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.islider.UISlider; import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.itextfield.UITextField; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; /** @@ -241,7 +241,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec } } catch (BadLocationException e1) { - FRLogger.getLogger().error(e1.getMessage()); + FineLoggerFactory.getLogger().error(e1.getMessage()); } } } diff --git a/designer-base/src/com/fr/design/utils/DesignUtils.java b/designer-base/src/com/fr/design/utils/DesignUtils.java index 25be2df48..1148d64f4 100644 --- a/designer-base/src/com/fr/design/utils/DesignUtils.java +++ b/designer-base/src/com/fr/design/utils/DesignUtils.java @@ -19,10 +19,10 @@ import com.fr.env.RemoteEnv; import com.fr.file.FileFILE; import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; -import com.fr.general.FRLogger; import com.fr.general.GeneralContext; import com.fr.general.Inter; import com.fr.general.http.HttpClient; +import com.fr.log.FineLoggerFactory; import com.fr.security.JwtUtils; import com.fr.stable.ArrayUtils; import com.fr.stable.CodeUtils; @@ -31,11 +31,8 @@ import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.start.StartServer; -import javax.swing.JOptionPane; -import javax.swing.SwingUtilities; -import javax.swing.UIManager; -import java.awt.Desktop; -import java.awt.Font; +import javax.swing.*; +import java.awt.*; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.ByteArrayInputStream; @@ -55,7 +52,6 @@ import java.net.URLEncoder; import java.util.Calendar; import java.util.Enumeration; import java.util.Locale; -import java.util.logging.Level; /** @@ -137,7 +133,7 @@ public class DesignUtils { try { serverSocket = new ServerSocket(startPort); } catch (IOException e1) { - FRLogger.getLogger().log(Level.WARNING, "Cannot create server socket on" + port); + FineLoggerFactory.getLogger().error("Cannot create server socket on" + port); } while (true) { try { @@ -248,7 +244,7 @@ public class DesignUtils { try { UIManager.setLookAndFeel(UILookAndFeel.class.getName()); } catch (Exception e) { - FRLogger.getLogger().log(Level.WARNING, "Substance Raven Graphite failed to initialize"); + FineLoggerFactory.getLogger().error("Substance Raven Graphite failed to initialize"); } //获取当前系统语言下设计器用的默认字体 FRFont guiFRFont = getCurrentLocaleFont(); diff --git a/designer-base/src/com/fr/design/utils/DrawRoutines.java b/designer-base/src/com/fr/design/utils/DrawRoutines.java index 79c91f106..d6b3fbb03 100644 --- a/designer-base/src/com/fr/design/utils/DrawRoutines.java +++ b/designer-base/src/com/fr/design/utils/DrawRoutines.java @@ -1,7 +1,7 @@ package com.fr.design.utils; import com.fr.design.utils.ColorRoutines; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import javax.swing.*; import java.awt.*; @@ -205,11 +205,11 @@ public class DrawRoutines { try { grabber.grabPixels(); } catch (InterruptedException e) { - FRLogger.getLogger().error("PixelGrabber interrupted waiting for pixels"); + FineLoggerFactory.getLogger().error("PixelGrabber interrupted waiting for pixels"); } if ((grabber.getStatus() & ImageObserver.ABORT) != 0) { - FRLogger.getLogger().info("Image fetch aborted or errored."); + FineLoggerFactory.getLogger().info("Image fetch aborted or errored."); } else { for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { diff --git a/designer-base/src/com/fr/env/RemoteEnv.java b/designer-base/src/com/fr/env/RemoteEnv.java index 373b15f48..f004606f4 100644 --- a/designer-base/src/com/fr/env/RemoteEnv.java +++ b/designer-base/src/com/fr/env/RemoteEnv.java @@ -8,10 +8,7 @@ import com.fr.base.Parameter; import com.fr.base.StoreProcedureParameter; import com.fr.base.TableData; import com.fr.base.Utils; -import com.fr.base.env.EnvContext; -import com.fr.base.env.resource.RemoteEnvConfig; import com.fr.base.remote.RemoteDeziConstants; -import com.fr.core.env.EnvConstants; import com.fr.data.TableDataSource; import com.fr.data.core.DataCoreUtils; import com.fr.data.core.db.TableProcedure; @@ -38,13 +35,11 @@ import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.general.LogRecordTime; import com.fr.general.LogUtils; -import com.fr.general.http.HttpToolbox; import com.fr.io.utils.ResourceIOUtils; import com.fr.json.JSONArray; import com.fr.json.JSONException; import com.fr.json.JSONObject; import com.fr.license.function.VT4FR; -import com.fr.log.FineLoggerFactory; import com.fr.regist.License; import com.fr.report.DesignAuthority; import com.fr.share.ShareConstants; @@ -61,7 +56,6 @@ import com.fr.stable.project.ProjectConstants; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLTools; import com.fr.stable.xml.XMLableReader; -import com.fr.third.guava.collect.ImmutableMap; import com.fr.web.ResourceConstants; import com.fr.report.util.AuthorityXMLUtils; @@ -99,41 +93,128 @@ import java.util.TimerTask; import java.util.logging.Level; import java.util.regex.Pattern; -import static com.fr.third.guava.base.Preconditions.checkArgument; - /** * @author null */ public class RemoteEnv extends AbstractEnv implements DesignAuthorityConfigurable { + private static final int TIME_OUT = 30 * 1000; + private static final int PLAIN_SOCKET_PORT = 80; + private static final int SSL_PORT = 443; + private static final int MAX_PER_ROUTE = 20; + private static final int MAX_TOTAL = 100; + private static final String REMOTE_PLUGIN = "remote_plugin.info"; private static final String CERT_KEY = "javax.net.ssl.trustStore"; private static final String PWD_KEY = "javax.net.ssl.trustStorePassword"; private static final String HTTPS_PREFIX = "https:"; private final static String[] FILE_TYPE = {"cptx", "cpt", "frm", "form", "cht", "chart"}; + private String path; + private String user; + private String password; + private Clock clock = null; + private String userID; + private Timer timer; + private int licNotSupport = 0; + private boolean isRoot = false; + private Timer logTimer = null; + private static ThreadLocal threadLocal = new ThreadLocal<>(); + private boolean isReadTimeOut = false; private String buildFilePath; - private RemoteEnvConfig env; + public RemoteEnv() { + this.clock = new Clock(this); + } public RemoteEnv(String path, String userName, String password) { - env = new RemoteEnvConfig(path, userName, password); + this(); + this.path = path; + this.user = userName; + this.password = password; } + /** + * 返回env配置路径 + */ @Override public String getPath() { - return env.getPath(); + return this.path; } + public void setPath(String s) { + this.path = s; + } + + /** + * 当前设计环境的用户名,用于远程设计 + */ @Override public String getUser() { - return env.getUsername(); + return user; + } + + public void setUser(String user) { + this.user = user; + clearUserID(); } public String getPassword() { - return env.getPassword(); + return password; } - @Override - public String getUserID() { - return EnvContext.currentToken(); + /** + * 修复密码中包含特殊字符,无法登录的问题 + * + * @return encoded password + */ + private String getEncodedPassword() { + try { + return URLEncoder.encode(password, "UTF-8"); + } catch (UnsupportedEncodingException e) { + return password; + } + } + + public void setPassword(String password) { + this.password = password; + clearUserID(); + } + + public Clock getClock() { + return this.clock; + } + + public void setClock(Clock clock) { + this.clock = clock; + } + + private void clearUserID() { + this.userID = null; + } + + public void setThreadLocal(String value) { + synchronized (this) { + threadLocal.set(value); + } + + } + + public String getThreadLocal() { + return threadLocal.get(); + } + + /** + * 所有与服务器端交互前,都要调用这个方法生成UserID + */ + public String getValidUserID() throws EnvException { + // 如果登录之后userID还是null + if (this.userID == null) { + if (!VT4FR.RemoteDesign.support() && licNotSupport <= 0) { + licNotSupport++; + JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Lic_does_not_Support_Remote")); + } + throw new EnvException(Inter.getLocText("Env-Invalid_User_and_Password")); + } + + return this.userID; } /** @@ -167,6 +248,15 @@ public class RemoteEnv extends AbstractEnv implements DesignAuthorityConfigurabl } } + private void doWithTimeOutException() { + boolean isNotNeedTip = ComparatorUtils.equals(getThreadLocal(), "HEART_BEAT") || ComparatorUtils.equals(getThreadLocal(), "LOG_MESSAGE"); + if (!isReadTimeOut && !isNotNeedTip) { + isReadTimeOut = true; + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"Data", "read_time_out"})); + isReadTimeOut = false; + } + FRContext.getLogger().info("Connection reset "); + } /** @@ -234,64 +324,126 @@ public class RemoteEnv extends AbstractEnv implements DesignAuthorityConfigurabl private boolean testConnection(boolean needMessage, boolean isRegisteServer, Component parentComponent) throws Exception { - checkArgument(parentComponent instanceof Component, "parentComponent should be a java.awt.component"); - Component component = parentComponent; - String url = String.format("%s/connection", EnvConstants.toDecisionPath(getPath())); - ImmutableMap params = ImmutableMap.of( - "version", (Object) ProductConstants.DESIGNER_VERSION - ); - ImmutableMap headers = ImmutableMap.of( - EnvConstants.USERNAME, getUser(), - EnvConstants.PWD, getPassword()); - String res = HttpToolbox.post(url, params, headers); - if (res == null) { + refreshHttpSProperty(); + changeEnvPathFromExtra(); + + if (path.startsWith("https") && (!DesignerEnvManager.getEnvManager().isHttps())) { + return false; + } + + InputStream inputStream = RemoteEnvUtils.testConnection(true, this); + inputStream = filterInputStream(inputStream); + String res = IOUtils.inputStream2String(inputStream, EncodeConstants.ENCODING_UTF_8); + + if (StringUtils.isEmpty(res)) { if (needMessage) { - JOptionPane.showMessageDialog(component, Inter.getLocText("Datasource-Connection_failed")); + JOptionPane.showMessageDialog( + parentComponent, + Inter.getLocText("Datasource-Connection_failed"), + UIManager.getString("OptionPane.messageDialogTitle", parentComponent.getLocale()), + JOptionPane.ERROR_MESSAGE + ); } return false; } else if (ComparatorUtils.equals(res, "true")) { + if (!clock.connected && isRegisteServer) { + //服务器中断又重新启动之后,重新向远程服务器注册 + register2Server(); + } return true; - } else { - if (ComparatorUtils.equals(res, EnvConstants.AUTH_ERROR)) { - JOptionPane.showMessageDialog(component, - Inter.getLocText(new String[]{"Datasource-Connection_failed", "Registration-User_Name", "Password", "Error"}, new String[]{",", "", "", "!"}) - , Inter.getLocText("FR-Server-All_Error"), JOptionPane.ERROR_MESSAGE); - return false; + } else if (ComparatorUtils.equals(res, "invalid username or password.")) { + JOptionPane.showMessageDialog( + parentComponent, + Inter.getLocText( + new String[]{"Datasource-Connection_failed", "Registration-User_Name", "Password", "Error"}, + new String[]{",", "", "", "!"} + ), + Inter.getLocText("FR-Server-All_Error"), + JOptionPane.ERROR_MESSAGE); + return false; + } else if (res.contains("RegistEditionException")) { + if (needMessage) { + JOptionPane.showMessageDialog( + parentComponent, + Inter.getLocText( + new String[]{"Datasource-Connection_failed", "Version-does-not-support"}, + new String[]{",", "!"} + ), + UIManager.getString("OptionPane.messageDialogTitle", parentComponent.getLocale()), + JOptionPane.ERROR_MESSAGE + ); } else { - if (ComparatorUtils.equals(res, EnvConstants.WAR_ERROR)) { - if (needMessage) { - JOptionPane.showMessageDialog(component, Inter.getLocText(new String[]{"Datasource-Connection_failed", "NS-war-remote"}, new String[]{",", "!"})); - } else { - FineLoggerFactory.getLogger().info(Inter.getLocText(new String[]{"Datasource-Connection_failed", "NS-war-remote"}, new String[]{",", "!"})); - } - return false; - } else { - if (needMessage) { - JOptionPane.showMessageDialog(component, Inter.getLocText(new String[]{"Datasource-Connection_failed", "Version-does-not-support"}, new String[]{",", "!"})); - } else { - FineLoggerFactory.getLogger().info(Inter.getLocText(new String[]{"Datasource-Connection_failed", "Version-does-not-support"}, new String[]{",", "!"})); - } - return false; - } + FRContext.getLogger().info( + Inter.getLocText( + new String[]{"Datasource-Connection_failed", "Version-does-not-support"}, + new String[]{",", "!"} + ) + ); } + return false; + } else if (ComparatorUtils.equals(res, "war not support remote design.")) { + if (needMessage) { + JOptionPane.showMessageDialog( + parentComponent, + Inter.getLocText( + new String[]{"Datasource-Connection_failed", "NS-war-remote"}, + new String[]{",", "!"} + ), + UIManager.getString("OptionPane.messageDialogTitle", parentComponent.getLocale()), + JOptionPane.ERROR_MESSAGE + ); + } else { + FRContext.getLogger().info( + Inter.getLocText( + new String[]{"Datasource-Connection_failed", "NS-war-remote"}, + new String[]{",", "!"} + ) + ); + } + return false; + } else { + throw new EnvException(res); } } + private void changeEnvPathFromExtra() { + //在env连接之前, 加载一下不依赖env的插件. 看看需不需要改变参数. + DesignerEnvProcessor processor + = ExtraDesignClassManager.getInstance().getSingle(DesignerEnvProcessor.XML_TAG); + if (processor != null) { + this.path = processor.changeEnvPathBeforeConnect(user, password, path); + } + } private void refreshHttpSProperty() { - if (getPath().startsWith(HTTPS_PREFIX) && System.getProperty(CERT_KEY) == null) { + if (path.startsWith(HTTPS_PREFIX) && System.getProperty(CERT_KEY) == null) { DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); System.setProperty(CERT_KEY, envManager.getCertificatePath()); System.setProperty(PWD_KEY, envManager.getCertificatePass()); } } + private void register2Server() { + try { + SignIn.signIn(this); + } catch (Exception e) { + FRContext.getLogger().error(e.getMessage()); + } + } /** * 心跳访问,用来更新当前用户的访问时间 * * @throws Exception e */ + public void heartBeatConnection() throws Exception { + // 刷新参数 + refreshHttpSProperty(); + // 获取结果 + InputStream inputStream = RemoteEnvUtils.headBeatConnection(this); + // 处理结果 + filterInputStream(inputStream); + } /** * 返回描述该运行环境的名字 @@ -303,6 +455,227 @@ public class RemoteEnv extends AbstractEnv implements DesignAuthorityConfigurabl return Inter.getLocText("Env-Remote_Server"); } + /** + * 登录,返回userID + */ + @Override + public void signIn() throws Exception { + if (clock != null && clock.connected) { + return; + } + String remoteVersion = getDesignerVersion(); + if (StringUtils.isBlank(remoteVersion) || ComparatorUtils.compare(remoteVersion, ProductConstants.DESIGNER_VERSION) < 0) { + throw new Exception("version not match"); + } + clearUserID(); + startLogTimer(); + HashMap para = new HashMap<>(); + para.put("op", "fr_remote_design"); + para.put("cmd", "r_sign_in"); + para.put("user", user); + para.put("password", getEncodedPassword()); + + simulateRPC(para, true); + + //neil:调用Clock方法,10秒向服务器发送一个字节,确保没掉线 + if (clock == null) { + Clock clock = new Clock(this); + setClock(clock); + } + clock.start(); + + // 远程登录的心跳访问, 防止设计器强制关闭而没有Logout + if (timer != null) { + timer.cancel(); + } + timer = new Timer(); + timer.schedule(new TimerTask() { + @Override + public void run() { + try { + RemoteEnv.this.setThreadLocal("HEART_BEAT"); + RemoteEnv.this.heartBeatConnection(); + } catch (Exception e) { + FRContext.getLogger().error("Server may be disconnected.", e); + } + } + }, RemoteDeziConstants.HEARTBEAT_DELAY, RemoteDeziConstants.HEARTBEAT_DELAY); + } + + + private void startLogTimer() { + if (logTimer != null) { + logTimer.cancel(); + } + + logTimer = new Timer(); + logTimer.schedule(new TimerTask() { + @Override + public void run() { + try { + RemoteEnv.this.setThreadLocal("LOG_MESSAGE"); + FRContext.getCurrentEnv().printLogMessage(); + } catch (Exception e) { + FRContext.getLogger().info(e.getMessage()); + } + } + }, 10000, 10000); + } + + private void stopLogTimer() { + if (logTimer != null) { + logTimer.cancel(); + logTimer = null; + } + } + + /** + * 根据userID sign out + * + * @return 成功签出返回true + * @throws Exception e + */ + @Override + public boolean signOut() throws Exception { + if (userID == null) { + return true; + } + stopLogTimer(); + // richer:登出的时候就把定时发送的时钟停掉 + clock.stop(); + // richer:把轮训使用的定时器也去掉 + timer.cancel(); + + HashMap para = new HashMap<>(); + para.put("op", "fr_remote_design"); + para.put("cmd", "r_sign_out"); + para.put("id", userID); + + return simulateRPC(para, false); + } + + protected boolean simulateRPC(HashMap para, boolean isSignIn) throws Exception { + refreshHttpSProperty(); + // execute method取到input stream再转成String + String result = null; + try { + result = stream2String(filterInputStream(RemoteEnvUtils.simulateRPCByHttpGet(para, isSignIn, this))); + } catch (Exception e) { + FRContext.getLogger().error(e.getMessage()); + } + if (result == null) { + return false; + } + if (result.contains("RegistEditionException")) { + JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Lic_does_not_Support_Remote")); + return false; + } + try { + JSONObject jo = new JSONObject(result); + if (isSignIn) { + if (jo.has("id")) { + userID = jo.getString("id"); + } + if (jo.has("isRoot")) { + isRoot = jo.getBoolean("isRoot"); + } + + if (userID != null) { + return true; + } + } else { + if (jo.has("res")) { + return jo.getBoolean("res"); + } + } + String exception = jo.getString("exp"); + if (exception != null) { + throw new EnvException(exception); + } + } catch (JSONException je) { + return true; + } + + return true; + } + + protected boolean doLockOperation(String[] filePaths, String cmd) throws Exception { + if (filePaths == null || filePaths.length == 0) { + return true; + } + + JSONArray ja = new JSONArray(filePaths); + HashMap para = new HashMap<>(); + para.put("op", "fr_remote_design"); + para.put("cmd", cmd); + para.put("pathes", ja.toString()); + + return simulateRPC(para, false); + } + + /** + * 取路径filePath下面文件的lock + *

+ * 处于同一个原子操作,要么拿到所有的锁,要么一个锁也没有拿到 + */ + public boolean getLock(String[] filePathes) throws Exception { + return doLockOperation(filePathes, "design_get_lock"); + } + + /** + * 解锁文件 + * + * @param filePaths 文件路径 + * @return 成功解锁返回true + * @throws Exception e + */ + public boolean releaseLock(String[] filePaths) throws Exception { + return doLockOperation(filePaths, "design_release_lock"); + } + + /** + * 当前Env下,tplPath目录下是否存在模板 + * + * @param reportPath 路径 + * @return 是否存在 + */ + @Override + public boolean isTemplateExist(String reportPath) throws Exception { + refreshHttpSProperty(); + if (reportPath == null) { + return false; + } + HashMap para = new HashMap<>(); + para.put("op", "fr_remote_design"); + para.put("cmd", "design_report_exist"); + para.put("report_path", reportPath); + + InputStream input = filterInputStream(RemoteEnvUtils.simulateRPCByHttpGet(para, false, this)); + return ComparatorUtils.equals(stream2String(input), "true"); + } + + /** + * 解锁当前模板,用于远程设计。当远程设计某张模板 时,在解锁之前改模板处于锁定状态 + * + * @param tplPath 路径 + * @throws Exception e + */ + @Override + public void unlockTemplate(String tplPath) throws Exception { + refreshHttpSProperty(); + HashMap para = new HashMap<>(); + para.put("op", "fr_remote_design"); + para.put("cmd", "design_close_report"); + para.put(RemoteDeziConstants.TEMPLATE_PATH, tplPath); + + InputStream input = filterInputStream( + RemoteEnvUtils.simulateRPCByHttpGet(para, false, this) + ); + String info = Utils.inputStream2String(input, EncodeConstants.ENCODING_UTF_8); + + FRContext.getLogger().info(info); + } + public class Bytes2ServerOutputStream extends OutputStream { private ByteArrayOutputStream out = new ByteArrayOutputStream(); private HashMap nameValuePairs; @@ -360,6 +733,33 @@ public class RemoteEnv extends AbstractEnv implements DesignAuthorityConfigurabl } } + /** + * 测试数据连接是否能够正确的连接上 + * + * @param database 数据连接 + * @return 如果能正确的连接到数据库则返回true + * @throws Exception 无法正确连接到数据库则抛出此异常 + */ + @Override + public boolean testConnection(Connection database) throws Exception { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + + // 把database写成xml文件到out + DavXMLUtils.writeXMLFileDatabaseConnection(database, out); + + HashMap para = new HashMap<>(); + para.put("op", "fr_remote_design"); + para.put("cmd", "design_test_con"); + + InputStream input = postBytes2ServerB(out.toByteArray(), para); + + if (input == null) { + return false; + } + + return Boolean.valueOf(IOUtils.inputStream2String(input, EncodeConstants.ENCODING_UTF_8)); + } + @Override public boolean updateAuthorities(DesignAuthority[] authorities) { refreshHttpSProperty(); @@ -389,6 +789,260 @@ public class RemoteEnv extends AbstractEnv implements DesignAuthorityConfigurabl return authorities; } + /** + * ben:取schema + */ + @Override + public String[] getTableSchema(Connection database) throws Exception { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + + DavXMLUtils.writeXMLFileDatabaseConnection(database, out); + HashMap para = new HashMap<>(); + para.put("op", "fr_remote_design"); + para.put("cmd", "design_get_schema"); + InputStream input = postBytes2ServerB(out.toByteArray(), para); + if (input == null) { + return null; + } + return DavXMLUtils.readXMLFileSchema(input); + } + + /** + * b:分别取Table,View,Procedure,实际应用时更有意义 + */ + @Override + public TableProcedure[] getTableProcedure(Connection database, String type, String schema) throws Exception { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + DavXMLUtils.writeXMLFileDatabaseConnection(database, out); + HashMap para = new HashMap<>(); + para.put("op", "fr_remote_design"); + para.put("cmd", "design_get_tables"); + para.put("__type__", type); + para.put("__dbschema__", schema); + InputStream input = postBytes2ServerB(out.toByteArray(), para); + if (input == null) { + return new TableProcedure[0]; + } + return DavXMLUtils.readXMLSQLTables(input); + } + + @Override + public List getProcedures(Connection datasource, String[] schemas, boolean isOracle, boolean isOracleSysSpace) throws Exception { + Map schemaTableProcedureMap = new HashMap<>(); + List sqlTableList = new ArrayList<>(); + TableProcedure[] sqlTableObj; + int len = schemas.length; + if (len > 0) { + for (String schema : schemas) { + sqlTableObj = this.getTableProcedure(datasource, TableProcedure.PROCEDURE, schema); + if (sqlTableObj == null) { + sqlTableObj = new TableProcedure[0]; + } + sqlTableList.add(sqlTableObj); + schemaTableProcedureMap.put(schema, sqlTableObj); + } + } else { + sqlTableObj = this.getTableProcedure(datasource, TableProcedure.PROCEDURE, null); + if (sqlTableObj == null) { + sqlTableObj = new TableProcedure[0]; + } + sqlTableList.add(sqlTableObj); + schemaTableProcedureMap.put(null, sqlTableObj); + } + DataCoreUtils.putProcedureMap(datasource, schemaTableProcedureMap); + return sqlTableList; + } + + /** + * 在当前路径下新建文件夹 + * + * @param folderPath 文件名 + * @return 成功创建返回true + * @throws Exception e + */ + @Override + public boolean createFolder(String folderPath) throws Exception { + refreshHttpSProperty(); + HashMap para = new HashMap<>(); + para.put("op", "fr_remote_design"); + para.put("cmd", "design_create_folder"); + para.put("folder_path", folderPath); + + InputStream input = filterInputStream( + RemoteEnvUtils.simulateRPCByHttpGet(para, false, this) + ); + + if (input == null) { + return false; + } + + return Boolean.valueOf(IOUtils.inputStream2String(input, EncodeConstants.ENCODING_UTF_8)); + } + + /** + * 新建一个文件 + * + * @param filePath :目标文件相对路径 + * @return 成功新建返回true + * @throws Exception e + */ + @Override + public boolean createFile(String filePath) throws Exception { + refreshHttpSProperty(); + HashMap para = new HashMap<>(); + para.put("op", "fr_remote_design"); + para.put("cmd", "design_create_file"); + para.put("file_path", filePath); + + InputStream input = filterInputStream( + RemoteEnvUtils.simulateRPCByHttpGet(para, false, this) + ); + + if (input == null) { + return false; + } + + return Boolean.valueOf(IOUtils.inputStream2String(input, EncodeConstants.ENCODING_UTF_8)); + } + + @Override + public boolean renameFile(String newPath, String oldPath) throws Exception { + refreshHttpSProperty(); + HashMap para = new HashMap<>(); + para.put("op", "fr_remote_design"); + para.put("cmd", "design_rename_file"); + para.put("newPath", newPath); + para.put("oldPath", oldPath); + + InputStream input = filterInputStream( + RemoteEnvUtils.simulateRPCByHttpGet(para, false, this) + ); + + if (input == null) { + return false; + } + + return Boolean.valueOf(IOUtils.inputStream2String(input, EncodeConstants.ENCODING_UTF_8)); + } + + /** + * 判断文件是否存在 + * + * @param filePath :目标文件相对路径 + * @return 文件是否存在 + * @throws Exception e + */ + @Override + public boolean fileExists(String filePath) throws Exception { + refreshHttpSProperty(); + if (filePath == null) { + return false; + } + + HashMap para = new HashMap<>(); + para.put("op", "fr_remote_design"); + para.put("cmd", "design_file_exists"); + para.put("file_path", filePath); + + InputStream input = filterInputStream( + RemoteEnvUtils.simulateRPCByHttpGet(para, false, this) + ); + + if (input == null) { + return false; + } + + return Boolean.valueOf(IOUtils.inputStream2String(input, EncodeConstants.ENCODING_UTF_8)); + } + + /** + * 判断文件是否锁住 + * + * @param filePath 文件路径 + * @return 文件被锁住了,返回true + * @throws Exception e + */ + @Override + public boolean fileLocked(String filePath) throws Exception { + refreshHttpSProperty(); + if (filePath == null) { + return false; + } + + HashMap para = new HashMap<>(); + para.put("op", "fr_remote_design"); + para.put("cmd", "design_file_locked"); + para.put("file_path", filePath); + + InputStream input = filterInputStream( + RemoteEnvUtils.simulateRPCByHttpGet(para, false, this) + ); + + if (input == null) { + return false; + } + + return Boolean.valueOf(IOUtils.inputStream2String(input, EncodeConstants.ENCODING_UTF_8)); + } + + + /** + * 注册环境,用于检测是否启动定时器,主要用于本地环境来监测远程 + * + * @param env 用户环境 + */ + @Override + public void registerUserEnv(UserBaseEnv env) { + } + + /** + * 用于检测用户环境 + * ,启动定时器 + */ + @Override + public void startUserCheckTimer() { + } + + + /** + * 停止定时器 + */ + public void stopUserCheckTimer() { + } + + /** + * 删除文件 + * + * @param filePath 文件地址 + * @return 删除成功返回true + */ + @Override + public boolean deleteFile(String filePath) { + refreshHttpSProperty(); + if (filePath == null) { + return false; + } + try { + HashMap para = new HashMap<>(); + para.put("op", "fr_remote_design"); + para.put("cmd", "delete_file"); + para.put("file_path", filePath); + + InputStream input = filterInputStream( + RemoteEnvUtils.simulateRPCByHttpGet(para, false, this) + ); + + if (input == null) { + return false; + } + + return Boolean.valueOf(IOUtils.inputStream2String(input, EncodeConstants.ENCODING_UTF_8)); + } catch (Exception e) { + FRContext.getLogger().error(e.getMessage()); + } + return false; + } + /** * 远程设计器设计时,假如开了权限就不可预览了。这边放一个全局的map来开后门 * @@ -402,8 +1056,8 @@ public class RemoteEnv extends AbstractEnv implements DesignAuthorityConfigurabl HashMap para = new HashMap<>(); para.put("op", "fr_remote_design"); para.put("cmd", "write_privilege_map"); - para.put("current_user", getUser()); - para.put("current_password", getPassword()); + para.put("current_user", this.user); + para.put("current_password", this.password); para.put("key", key); para.put("value", value); @@ -450,12 +1104,148 @@ public class RemoteEnv extends AbstractEnv implements DesignAuthorityConfigurabl } } - for (int i = 0; i < toBeRemoveTDName.size(); i++) { - dm.removeTableData(toBeRemoveTDName.get(i)); - } - } catch (Exception e) { - FRContext.getLogger().error(e.getMessage()); + for (int i = 0; i < toBeRemoveTDName.size(); i++) { + dm.removeTableData(toBeRemoveTDName.get(i)); + } + } catch (Exception e) { + FRContext.getLogger().error(e.getMessage()); + } + } + + /** + * 列出WEB-INF目录下指定路径的文件夹与文件 + * + * @param rootFilePath 指定目录 + * @return WEB-INF目录下指定路径的文件夹与文件 + * @throws Exception e + */ + @Override + public FileNode[] listFile(String rootFilePath) throws Exception { + return listFile(rootFilePath, false); + } + + /** + * 列出WEB-INF上层目录下指定路径的文件夹与文件 + * + * @param rootFilePath 指定目录 + * @return WEB-INF上层目录下指定路径的文件夹与文件 + * @throws Exception e + */ + @Override + public FileNode[] listReportPathFile(String rootFilePath) throws Exception { + return listFile(rootFilePath, true); + } + + private FileNode[] listFile(String rootFilePath, boolean isWebReport) throws Exception { + refreshHttpSProperty(); + InputStream inputStream = RemoteEnvUtils.listFile(rootFilePath, isWebReport, this); + inputStream = filterInputStream(inputStream); + return DavXMLUtils.readXMLFileNodes(inputStream); + } + + + /** + * 列出目标目录下所有cpt文件或文件夹 + * + * @param rootFilePath 指定目录 + * @return 列出目标目录下所有cpt文件或文件夹 + */ + @Override + public FileNode[] listCpt(String rootFilePath) { + return listCpt(rootFilePath, false); + } + + /** + * 列出目标目录下所有cpt文件或文件夹 + * + * @param rootFilePath 指定目录 + * @param recurse 是否递归查找其子目录 + * @return 列出目标目录下所有cpt文件或文件夹 + * @throws Exception e + */ + @Override + public FileNode[] listCpt(String rootFilePath, boolean recurse) { + List fileNodeList = new ArrayList<>(); + try { + listAll(rootFilePath, fileNodeList, new String[]{"cpt"}, recurse); + } catch (Exception e) { + FRContext.getLogger().error(e.getMessage(), e); + } + return fileNodeList.toArray(new FileNode[fileNodeList.size()]); + } + + private void listAll(String rootFilePath, List nodeList, String[] fileTypes, boolean recurse) throws Exception { + FileNode[] fns = listFile(rootFilePath); + for (FileNode fileNode : fns) { + if (isAcceptFileType(fileNode, fileTypes)) { + nodeList.add(fileNode); + } else if (fileNode.isDirectory()) { + if (recurse) { + listAll(rootFilePath + File.separator + fileNode.getName(), nodeList, fileTypes, true); + } else { + nodeList.add(fileNode); + } + } + } + } + + private boolean isAcceptFileType(FileNode fileNode, String[] fileTypes) { + for (String fileType : fileTypes) { + if (fileNode.isFileType(fileType)) { + return true; + } + } + return false; + } + + /** + * 获取指定数据集的参数 + * + * @param tableData 数据集 + * @return 数据集的参数 + * @throws Exception 获取参数失败则抛出此异常 + */ + @Override + public Parameter[] getTableDataParameters(TableData tableData) throws Exception { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + + //把tableData写成xml文件到out + DavXMLUtils.writeXMLFileTableData(tableData, out); + + HashMap para = new HashMap<>(); + para.put("op", "fr_remote_design"); + para.put("cmd", "design_td_pars"); + InputStream input = postBytes2ServerB(out.toByteArray(), para); + + if (input == null) { + return new Parameter[0]; + } + return DavXMLUtils.readXMLParameters(input); + } + + + /** + * 获取存储过程中的参数 + * + * @param storeProcedure 存储过程 + * @return 返回存储过程中的所有参数组成的数组 + * @throws Exception 如果获取参数失败则抛出此异常 + */ + @Override + public Parameter[] getStoreProcedureParameters(StoreProcedure storeProcedure) throws Exception { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + + // 把tableData写成xml文件到out + DavXMLUtils.writeXMLFileStoreProcedureAndSource(storeProcedure, out); + HashMap para = new HashMap<>(); + para.put("op", "fr_remote_design"); + para.put("cmd", "design_sp_pars"); + InputStream input = postBytes2ServerB(out.toByteArray(), para); + + if (input == null) { + return new Parameter[0]; } + return DavXMLUtils.readXMLParameters(input); } @Override @@ -531,6 +1321,163 @@ public class RemoteEnv extends AbstractEnv implements DesignAuthorityConfigurabl return filterInputStream(RemoteEnvUtils.simulateRPCByHttpPost(bytes, para, false, this)); } + /** + * Read XML.
+ * The method will be invoked when read data from XML file.
+ * May override the method to read the data that you saved. + */ + @Override + public void readXML(XMLableReader reader) { + if (reader.isChildNode()) { + String tmpVal; + if ("DIR".equals(reader.getTagName())) { + if ((tmpVal = reader.getAttrAsString("path", null)) != null) { + this.path = tmpVal; + } + if ((tmpVal = reader.getAttrAsString("user", null)) != null) { + this.user = tmpVal; + } + if ((tmpVal = reader.getAttrAsString("password", null)) != null) { + this.password = tmpVal; + } + } + } + } + + /** + * Write XML.
+ * The method will be invoked when save data to XML file.
+ * May override the method to save your own data. + * + * @param writer the PrintWriter. + */ + @Override + public void writeXML(XMLPrintWriter writer) { + writer.startTAG("DIR").attr("path", this.path).attr("user", this.user).attr("password", this.password).end(); + } + + + public static class Clock { + + private static final long CONNECT_INTERVAL = 3000L; + private boolean connected = false; + + private RemoteEnv remoteEnv; + + public Clock(RemoteEnv remoteEnv) { + this.remoteEnv = remoteEnv; + } + + /** + * 开始连接 + */ + public void start() { + if (connected) { + return; + } + connected = true; + + new Thread(new Runnable() { + @Override + public void run() { + // richie:连续三次尝试连接都没有响应才判定为丢失连接 + while (connected) { + try { + attemptConnect(); + } catch (Exception ex) { + try { + attemptConnect(); + } catch (Exception ee) { + try { + attemptConnect(); + } catch (Exception exc) { + stop(); + if (exc instanceof NoRouteToHostException) { + //网络问题导致的连接中断 + if (JOptionPane.showConfirmDialog(null, Inter.getLocText("FR-Remote_Connect2Server_Again"), UIManager.getString("OptionPane.titleText"), JOptionPane.YES_NO_OPTION) + == JOptionPane.OK_OPTION) { + //调用重新连接服务器的方法 + connectedAgain(); + } + } else { + //服务器关闭引起的连接中断 + if (JOptionPane.showConfirmDialog(null, Inter.getLocText("FR-Remote_Re_Connect_to_Server"), UIManager.getString("OptionPane.titleText"), JOptionPane.YES_NO_OPTION) + == JOptionPane.OK_OPTION) { + //调用重新连接服务器的方法 + connectedAgain(); + } + } + } + } + } + } + } + }).start(); + } + + /** + * 服务器连接中断后重新连接 + */ + private void connectedAgain() { + try { + if (!remoteEnv.testServerConnectionWithOutShowMessagePane()) { + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText(new String[]{"Datasource-Connection_failed", "check_communication"}, + new String[]{",", "!"})); + DesignerFrameFileDealerPane.getInstance().refresh(); + return; + } + String remoteVersion = remoteEnv.getDesignerVersion(); + if (StringUtils.isBlank(remoteVersion) || ComparatorUtils.compare(remoteVersion, ProductConstants.DESIGNER_VERSION) < 0) { + String infor = Inter.getLocText("FR-Server_Version_Tip"); + String moreInfo = Inter.getLocText("FR-Server_Version_Tip_MoreInfo"); + FRContext.getLogger().log(Level.WARNING, infor); + new InformationWarnPane(infor, moreInfo, Inter.getLocText("FR-Designer_Tooltips")).show(); + return; + } + SignIn.signIn(remoteEnv); + HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshToolArea(); + } catch (Exception em) { + FRContext.getLogger().error(em.getMessage(), em); + } + } + + /** + * 停止连接 + */ + public void stop() { + connected = false; + } + + private void attemptConnect() throws Exception { + Thread.sleep(CONNECT_INTERVAL); + Pattern pattern = Pattern.compile("[/:]+"); + String[] strs = pattern.split(remoteEnv.path); + + //host,如:192.168.100.195 + String shost = strs[1]; + //端口,如:8080 + int sport = Integer.parseInt(strs[2]); + + Socket socket = new Socket(shost, sport); + //OOBBINLINE:是否支持发送一个字节的TCP紧急数据,false表示服务器不用处理这个数据 + socket.setOOBInline(false); + socket.sendUrgentData(0xFF); + socket.close(); + } + } + + /** + * 读报表运行环境所需的配置文件,如datasource.xml, config.xml,这些文件都保存在WEB-INF/resources目录下面 + * + * @param resourceName 配置文件的名字,如datasource.xml + * @return 输入流 + * @throws Exception e + */ + @Override + public InputStream readResource(String resourceName) throws Exception { + return readBean(resourceName, ProjectConstants.RESOURCES_NAME); + } + /** * 读取路径下的svg文件 @@ -549,7 +1496,7 @@ public class RemoteEnv extends AbstractEnv implements DesignAuthorityConfigurabl para.put("op", "fr_remote_design"); para.put("cmd", "design_read_svgfile"); para.put("resourcePath", path); - para.put("current_uid", this.getUserID()); + para.put("current_uid", this.getValidUserID()); para.put("currentUsername", this.getUser()); InputStream input = filterInputStream( @@ -589,7 +1536,7 @@ public class RemoteEnv extends AbstractEnv implements DesignAuthorityConfigurabl para.put("op", "svgrelate"); para.put("cmd", "design_save_svg"); para.put("filePath", svgFile.getFilePath()); - para.put("current_uid", this.getUserID()); + para.put("current_uid", this.getValidUserID()); para.put("currentUsername", this.getUser()); // 通过ByteArrayOutputStream将svg写成字节流 @@ -643,7 +1590,7 @@ public class RemoteEnv extends AbstractEnv implements DesignAuthorityConfigurabl para.put("cmd", "design_save_resource"); para.put("resource", mgr.fileName()); para.put("class_name", mgr.getClass().getName()); - para.put("current_uid", this.getUserID()); + para.put("current_uid", this.getValidUserID()); para.put("currentUsername", this.getUser()); // alex:通过ByteArrayOutputStream将mgr写成字节流 @@ -706,6 +1653,38 @@ public class RemoteEnv extends AbstractEnv implements DesignAuthorityConfigurabl return new Bytes2ServerOutputStream(para); } + /** + * 返回数据库表的列名 + * + * @param selectedName 所选择数据库名 + * @param schema 数据库模式,用于存储过程 + * @param tableName 所选择数据库名 + */ + @Override + public String[] getColumns(String selectedName, String schema, String tableName) throws Exception { + refreshHttpSProperty(); + HashMap para = new HashMap<>(); + para.put("op", "fr_remote_design"); + para.put("cmd", "design_columns"); + para.put("dsName", selectedName); + para.put("schema", schema); + para.put("tableName", tableName); + + InputStream input = filterInputStream( + RemoteEnvUtils.simulateRPCByHttpGet(para, false, this) + ); + + if (input == null) { + return null; + } + + String columns = stream2String(input); + if (StringUtils.isEmpty(columns)) { + return null; + } + return columns.split("\\."); + } + /** * 返回模板文件路径 */ @@ -714,6 +1693,98 @@ public class RemoteEnv extends AbstractEnv implements DesignAuthorityConfigurabl return getPath().substring(0, getPath().lastIndexOf("/")); } + @Override + public String getProcedureText(String connectionName, String databaseName) throws Exception { + HashMap para = new HashMap<>(); + para.put("op", "fr_remote_design"); + para.put("cmd", "design_get_procedure_text"); + para.put("procedure_name", databaseName); + para.put("connectionName", connectionName); + + ByteArrayOutputStream out = new ByteArrayOutputStream(); + InputStream input = postBytes2ServerB(out.toByteArray(), para); + if (input == null) { + return StringUtils.EMPTY; + } + return DavXMLUtils.readXMLProcedureText(input); + } + + @Override + public StoreProcedureParameter[] getStoreProcedureDeclarationParameters(String connectionName, String databaseName, String parameterDefaultValue) throws Exception { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + HashMap para = new HashMap<>(); + para.put("op", "fr_remote_design"); + para.put("cmd", "design_get_sp_parameters"); + para.put("__name__", databaseName); + para.put("__default_value__", parameterDefaultValue); + para.put("connectionName", connectionName); + + InputStream input = postBytes2ServerB(out.toByteArray(), para); + if (input == null) { + return new StoreProcedureParameter[0]; + } + return DavXMLUtils.readXMLStoreProcedureParameters(input); + } + + /** + * 获取datasource.xml文件的修改表 + */ + @Override + public ModifiedTable getDataSourceModifiedTables(String type) { + refreshHttpSProperty(); + try { + HashMap para = new HashMap<>(); + para.put("op", "fr_remote_design"); + para.put("cmd", "get_datasource_modified_tables"); + para.put("type", type); + + InputStream input = filterInputStream( + RemoteEnvUtils.simulateRPCByHttpGet(para, false, this) + ); + if (input == null) { + return new ModifiedTable(); + } + return DavXMLUtils.readXMLModifiedTables(input); + } catch (Exception e) { + FRContext.getLogger().error(e.getMessage()); + } + return new ModifiedTable(); + } + + + /** + * 写修改表 + * + * @param modifiedTable 修改表 + * @param type 操作类型,是数据连接还是服务器数据集 + * @return 写入成功返回true + */ + @Override + public boolean writeDataSourceModifiedTables(ModifiedTable modifiedTable, String type) { + + ByteArrayOutputStream out = new ByteArrayOutputStream(); + + // 把tableData写成xml文件到out + DavXMLUtils.writeXMLModifiedTables(modifiedTable, out); + try { + HashMap para = new HashMap<>(); + para.put("op", "fr_remote_design"); + para.put("cmd", "update_modifytable_to_server"); + para.put("type", type); + + InputStream input = postBytes2ServerB(out.toByteArray(), para); + + if (input == null) { + return false; + } + + return Boolean.valueOf(IOUtils.inputStream2String(input, EncodeConstants.ENCODING_UTF_8)); + } catch (Exception e) { + FRContext.getLogger().error(e.getMessage()); + } + return false; + } + public String[] getProcedureColumns(StoreProcedure storeProcedure, Map parameterMap) throws Exception { refreshHttpSProperty(); String[] columns; @@ -780,11 +1851,102 @@ public class RemoteEnv extends AbstractEnv implements DesignAuthorityConfigurabl LogRecordTime[] records = LogUtils.readXMLLogRecords(input); } + @Override + public String getUserID() { + return userID; + } + + + /** + * 预览存储过程 + * + * @param storeProcedure 存储过程 + * @param parameterMap 参数map + * @param rowCount 行数 + * @return 返回取到的存储过程 + */ + @Override + public ProcedureDataModel[] previewProcedureDataModel(StoreProcedure storeProcedure, Map parameterMap, int rowCount) { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + + // 把tableData写成xml文件到out + DavXMLUtils.writeXMLFileStoreProcedureAndSource(storeProcedure, out); + + // 把parameterMap转成JSON格式的字符串 + JSONObject jo = new JSONObject(parameterMap); + String jsonParameter = jo.toString(); + + try { + HashMap para = new HashMap<>(); + para.put("op", "fr_remote_design"); + para.put("cmd", "list_sp"); + para.put("pars", jsonParameter); + + InputStream input = postBytes2ServerB(out.toByteArray(), para); + if (input == null) { + return null; + } + + TableData[] tableDatas = DavXMLUtils.readXMLTableDataArray(input); + if (tableDatas == null || tableDatas.length == 0) { + return new ProcedureDataModel[0]; + } + ProcedureDataModel[] procedureDataModels = new ProcedureDataModel[tableDatas.length]; + for (int i = 0; i < tableDatas.length; i++) { + if (tableDatas[i] instanceof EmbeddedTableData) { + procedureDataModels[i] = ((EmbeddedTableData) tableDatas[i]).trans2ProcedureDataModel(); + } + } + return procedureDataModels; + + + } catch (Exception e) { + FRContext.getLogger().error(e.getMessage()); + } + return new ProcedureDataModel[0]; + } + + + @Override + public String getAppName() { + return "WebReport"; + } + + /** + * 是否为Oracle数据连接 + * + * @param database 数据连接 + * @return 是返回true + * @throws Exception e + */ + @Override + public boolean isOracle(Connection database) throws Exception { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + DavXMLUtils.writeXMLFileDatabaseConnection(database, out); + HashMap para = new HashMap<>(); + para.put("op", "fr_remote_design"); + para.put("cmd", "design_get_isOracle"); + InputStream input = postBytes2ServerB(out.toByteArray(), para); + if (input == null) { + return true; + } + return DavXMLUtils.readXMLBoolean(input); + } + @Override public String[] getSupportedTypes() { return FILE_TYPE; } + /** + * 在模板面板中是否支持增加打开所在文件夹、重命名、删除三个工具栏选项 + * + * @return 不支持返回false + */ + @Override + public boolean isSupportLocalFileOperate() { + return false; + } /** * 判断是否有文件夹权限 @@ -799,7 +1961,7 @@ public class RemoteEnv extends AbstractEnv implements DesignAuthorityConfigurabl HashMap para = new HashMap<>(); para.put("op", "fs_remote_design"); para.put("cmd", "design_filefolder_allow"); - para.put("current_uid", this.getUserID()); + para.put("current_uid", this.getValidUserID()); para.put(RemoteDeziConstants.TEMPLATE_PATH, path); InputStream input = filterInputStream( @@ -817,6 +1979,43 @@ public class RemoteEnv extends AbstractEnv implements DesignAuthorityConfigurabl } + /** + * 是否是管理员身份 + * + * @return 是则返回true + */ + @Override + public boolean isRoot() { + return isRoot; + } + + /** + * 是否为压缩包部署 + * + * @return 是则返回true + */ + @Override + public boolean isPackDeploy() { + return false; + } + + @Override + public String getDesignerVersion() { + refreshHttpSProperty(); + HashMap para = new HashMap<>(); + para.put("op", "fr_remote_design"); + para.put("cmd", "design_get_designer_version"); + para.put("user", user); + para.put("password", getEncodedPassword()); + + try { + return stream2String(filterInputStream(RemoteEnvUtils.simulateRPCByHttpGet(para, true, this))); + } catch (Exception e) { + FRContext.getLogger().error(e.getMessage()); + } + return null; + } + @Override public InputStream getDataSourceInputStream(String filePath) throws Exception { return readBean(filePath, "datasource"); @@ -847,6 +2046,15 @@ public class RemoteEnv extends AbstractEnv implements DesignAuthorityConfigurabl return allRoleList; } + @Override + public String getLicName() { + return License.FILE_NAME; + } + + @Override + public void setLicName(String licName) { + //do nth + } /** @@ -927,7 +2135,7 @@ public class RemoteEnv extends AbstractEnv implements DesignAuthorityConfigurabl HashMap para = new HashMap<>(); para.put("op", "fr_remote_design"); para.put("cmd", "design_read_reufile"); - para.put("current_uid", this.getUserID()); + para.put("current_uid", this.getValidUserID()); para.put("currentUsername", this.getUser()); //拿到服务端传过来的整个共享文件夹的压缩文件的文件流 @@ -973,7 +2181,7 @@ public class RemoteEnv extends AbstractEnv implements DesignAuthorityConfigurabl HashMap para = new HashMap<>(); para.put("op", "fr_remote_design"); para.put("cmd", "design_install_reufile"); - para.put("current_uid", this.getUserID()); + para.put("current_uid", this.getValidUserID()); para.put("currentUsername", this.getUser()); para.put("reuFileName", reuFile.getName()); @@ -1010,7 +2218,7 @@ public class RemoteEnv extends AbstractEnv implements DesignAuthorityConfigurabl HashMap para = new HashMap<>(); para.put("op", "fr_remote_design"); para.put("cmd", "design_remove_reufile"); - para.put("current_uid", this.getUserID()); + para.put("current_uid", this.getValidUserID()); para.put("currentUsername", this.getUser()); para.put("reuFileName", fileName); @@ -1030,7 +2238,7 @@ public class RemoteEnv extends AbstractEnv implements DesignAuthorityConfigurabl HashMap para = new HashMap<>(); para.put("op", "fr_remote_design"); para.put("cmd", "design_get_share_path"); - para.put("current_uid", this.getUserID()); + para.put("current_uid", this.getValidUserID()); para.put("currentUsername", this.getUser()); InputStream input = filterInputStream( @@ -1042,6 +2250,16 @@ public class RemoteEnv extends AbstractEnv implements DesignAuthorityConfigurabl } } + @Override + public void doWhenServerShutDown() { + + } + + @Override + public boolean isLocalEnv() { + + return false; + } @Override public boolean hasPluginServiceStarted(String key) { @@ -1049,4 +2267,22 @@ public class RemoteEnv extends AbstractEnv implements DesignAuthorityConfigurabl return true; } + @Override + public JSONArray getPluginStatus() { + refreshHttpSProperty(); + try { + HashMap para = new HashMap<>(); + para.put("op", "plugin"); + para.put("cmd", "get_status"); + para.put("current_uid", this.getValidUserID()); + para.put("currentUsername", this.getUser()); + + InputStream input = filterInputStream( + RemoteEnvUtils.simulateRPCByHttpGet(para, false, this) + ); + return new JSONArray(stream2String(input)); + } catch (Exception e) { + return JSONArray.create(); + } + } } \ No newline at end of file diff --git a/designer-base/src/com/fr/start/BaseDesigner.java b/designer-base/src/com/fr/start/BaseDesigner.java index 8613ebcc4..5d723f579 100644 --- a/designer-base/src/com/fr/start/BaseDesigner.java +++ b/designer-base/src/com/fr/start/BaseDesigner.java @@ -17,7 +17,7 @@ import com.fr.file.FILE; import com.fr.file.FILEFactory; import com.fr.file.FileFILE; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.stable.OperatingSystem; import java.awt.*; @@ -94,7 +94,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock { } isException = openFile(df, isException, file); } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); if (!isException) { showDesignerFrame(args, df, true); } else { @@ -147,7 +147,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock { Window.class, boolean.class}); method.invoke(null, window, true); } catch (Throwable t) { - FRLogger.getLogger().error("Full screen mode is not supported"); + FineLoggerFactory.getLogger().error("Full screen mode is not supported"); } } diff --git a/designer-base/src/com/fr/start/StartServer.java b/designer-base/src/com/fr/start/StartServer.java index 27ba970c3..828547fd4 100644 --- a/designer-base/src/com/fr/start/StartServer.java +++ b/designer-base/src/com/fr/start/StartServer.java @@ -1,7 +1,7 @@ package com.fr.start; -import com.fr.base.ServerConfig; import com.fr.base.FRContext; +import com.fr.base.ServerConfig; import com.fr.design.DesignModelAdapter; import com.fr.design.DesignerEnvManager; import com.fr.design.data.datapane.TableDataTreePane; @@ -15,12 +15,12 @@ import com.fr.env.SignIn; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; import com.fr.general.Inter; +import com.fr.log.FineLoggerFactory; import com.fr.stable.EnvChangedListener; import com.fr.stable.OperatingSystem; import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; -import com.fr.stable.project.ProjectConstants; import com.fr.start.server.TomcatHost; import javax.swing.*; @@ -69,7 +69,7 @@ public class StartServer { TemplateTreePane.getInstance().refreshDockingView(); TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()); } catch (Exception e) { - FRContext.getLogger().errorWithServerLevel(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } initDemoServerAndBrowser(); } @@ -98,7 +98,7 @@ public class StartServer { tomcatHost.start(); } } catch (Exception e) { - FRContext.getLogger().errorWithServerLevel(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } finally { //先访问Demo, 后访问报表, 不需要重置服务器. NEED_LOAD_ENV = false; @@ -126,9 +126,9 @@ public class StartServer { tomcatHost.start(); } } catch (InterruptedException e) { - FRContext.getLogger().errorWithServerLevel(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } catch (Exception e) { - FRContext.getLogger().errorWithServerLevel(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } finally { NEED_LOAD_ENV = false; } @@ -169,10 +169,10 @@ public class StartServer { } catch (IOException e) { startBrowserFromCommand(uri, e); } catch (URISyntaxException e) { - FRContext.getLogger().errorWithServerLevel(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } catch (Exception e) { - FRContext.getLogger().errorWithServerLevel(e.getMessage(), e); - FRContext.getLogger().error("Can not open the browser for URL: " + uri); + FineLoggerFactory.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + uri); } } @@ -183,10 +183,10 @@ public class StartServer { Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + uri); } catch (IOException ee) { JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer_Set_default_browser")); - FRContext.getLogger().errorWithServerLevel(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } } else { - FRContext.getLogger().errorWithServerLevel(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } } diff --git a/designer-chart/src/com/fr/design/chart/report/MapCubeLayerPane.java b/designer-chart/src/com/fr/design/chart/report/MapCubeLayerPane.java index bde3bc3cd..91ec7e872 100644 --- a/designer-chart/src/com/fr/design/chart/report/MapCubeLayerPane.java +++ b/designer-chart/src/com/fr/design/chart/report/MapCubeLayerPane.java @@ -11,7 +11,7 @@ import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.UIDialog; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; @@ -275,7 +275,7 @@ public class MapCubeLayerPane extends BasicBeanPane{ @Override protected void done() { - FRLogger.getLogger().info("Map Save End"); + FineLoggerFactory.getLogger().info("Map Save End"); } }; diff --git a/designer-chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java b/designer-chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java index 7a4732807..ed2ab0718 100644 --- a/designer-chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java +++ b/designer-chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java @@ -22,7 +22,7 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerFrame; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.stable.CoreConstants; import com.fr.stable.StableUtils; @@ -367,7 +367,7 @@ public class MapGroupExtensionPane extends BasicPane implements UIObserver { StableUtils.pathJoin(new String[]{MapSvgXMLHelper.relativeCustomMapPath(),oldName+SvgProvider.EXTENSION})); refresh(); }catch (Exception exp){ - FRLogger.getLogger().error(exp.getMessage()); + FineLoggerFactory.getLogger().error(exp.getMessage()); } } } @@ -399,7 +399,7 @@ public class MapGroupExtensionPane extends BasicPane implements UIObserver { @Override protected void done() { - FRLogger.getLogger().info(Inter.getLocText("FR-Chart-Map_Saved")); // 地图已经保存. + FineLoggerFactory.getLogger().info(Inter.getLocText("FR-Chart-Map_Saved")); // 地图已经保存. } }; diff --git a/designer-chart/src/com/fr/design/chart/series/PlotSeries/UIGroupExtensionPane.java b/designer-chart/src/com/fr/design/chart/series/PlotSeries/UIGroupExtensionPane.java index 64643e341..b56a436f4 100644 --- a/designer-chart/src/com/fr/design/chart/series/PlotSeries/UIGroupExtensionPane.java +++ b/designer-chart/src/com/fr/design/chart/series/PlotSeries/UIGroupExtensionPane.java @@ -19,7 +19,7 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.DesignerContext; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.GeneralUtils; import com.fr.general.Inter; import com.fr.stable.ArrayUtils; @@ -477,7 +477,7 @@ public class UIGroupExtensionPane extends BasicPane { try { list.setSelectedIndices(null); } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } } } diff --git a/designer-chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java b/designer-chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java index 02a50f828..08292b00c 100644 --- a/designer-chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java +++ b/designer-chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java @@ -13,7 +13,7 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.chart.ChartHyperEditPane; import com.fr.design.module.DesignModuleFactory; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import java.awt.*; @@ -71,7 +71,7 @@ public class ChartHyperPoplinkPane extends AbstractHyperLinkPane implemen editingCollection.addNamedChart(name, newChart); editingCollection.addFunctionRecord(newChart); } catch (CloneNotSupportedException e1) { - FRLogger.getLogger().error("Error in Clone"); + FineLoggerFactory.getLogger().error("Error in Clone"); } checkoutChange(); } diff --git a/designer-chart/src/com/fr/design/mainframe/chart/gui/data/CalculateComboBox.java b/designer-chart/src/com/fr/design/mainframe/chart/gui/data/CalculateComboBox.java index 5d48c4106..fbe0008af 100644 --- a/designer-chart/src/com/fr/design/mainframe/chart/gui/data/CalculateComboBox.java +++ b/designer-chart/src/com/fr/design/mainframe/chart/gui/data/CalculateComboBox.java @@ -9,7 +9,7 @@ import com.fr.data.util.function.NoneFunction; import com.fr.data.util.function.SumFunction; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; /** @@ -56,10 +56,10 @@ public class CalculateComboBox extends UIComboBox{ return (AbstractDataFunction)CLASS_ARRAY[selectIndex].newInstance(); } } catch (InstantiationException e) { - FRLogger.getLogger().error("Function Error"); + FineLoggerFactory.getLogger().error("Function Error"); return null; } catch (IllegalAccessException e) { - FRLogger.getLogger().error("Function Error"); + FineLoggerFactory.getLogger().error("Function Error"); return null; } diff --git a/designer-chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java b/designer-chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java index e0649cccf..a2cd2ec68 100644 --- a/designer-chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java +++ b/designer-chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java @@ -19,7 +19,7 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.stable.StringUtils; @@ -265,9 +265,9 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane{ String tmp = DateUtils.getDate2LStr(toDate); toDate = DateUtils.DATETIMEFORMAT2.parse(tmp); } catch (ParseException e) { - FRLogger.getLogger().error(Inter.getLocText("Cannot_Get_Date")); + FineLoggerFactory.getLogger().error(Inter.getLocText("Cannot_Get_Date")); } return toDate; } diff --git a/designer-chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java b/designer-chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java index c26413b75..5aa9ea49a 100644 --- a/designer-chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java +++ b/designer-chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java @@ -26,7 +26,7 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.js.NameJavaScriptGroup; import com.fr.stable.Constants; @@ -351,7 +351,7 @@ public abstract class AbstractChartTypePane extends FurtherBasicBeanPane{ try { chart.switchPlot((Plot)plot.clone()); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error("Error in change plot"); + FineLoggerFactory.getLogger().error("Error in change plot"); } } diff --git a/designer-chart/src/com/fr/design/mainframe/chart/gui/type/BarPlotPane.java b/designer-chart/src/com/fr/design/mainframe/chart/gui/type/BarPlotPane.java index 7d73ea122..1bb3c9887 100644 --- a/designer-chart/src/com/fr/design/mainframe/chart/gui/type/BarPlotPane.java +++ b/designer-chart/src/com/fr/design/mainframe/chart/gui/type/BarPlotPane.java @@ -6,7 +6,7 @@ import com.fr.chart.chartattr.BarPlot; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; import com.fr.chart.charttypes.BarIndependentChart; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; /** @@ -98,7 +98,7 @@ public class BarPlotPane extends AbstractBarPane{ try { cloned = (Plot)newPlot.clone(); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error("Error In ColumnChart"); + FineLoggerFactory.getLogger().error("Error In ColumnChart"); } return cloned; } diff --git a/designer-chart/src/com/fr/design/mainframe/chart/gui/type/ColumnPlotPane.java b/designer-chart/src/com/fr/design/mainframe/chart/gui/type/ColumnPlotPane.java index ee70cb71a..0ee3811b5 100644 --- a/designer-chart/src/com/fr/design/mainframe/chart/gui/type/ColumnPlotPane.java +++ b/designer-chart/src/com/fr/design/mainframe/chart/gui/type/ColumnPlotPane.java @@ -5,7 +5,7 @@ import com.fr.chart.chartattr.BarPlot; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; import com.fr.chart.charttypes.ColumnIndependentChart; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; /** @@ -95,7 +95,7 @@ public class ColumnPlotPane extends AbstractBarPane{ try { cloned = (Plot)newPlot.clone(); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error("Error In ColumnChart"); + FineLoggerFactory.getLogger().error("Error In ColumnChart"); } return cloned; } diff --git a/designer-chart/src/com/fr/design/mainframe/chart/gui/type/GisMapPlotPane.java b/designer-chart/src/com/fr/design/mainframe/chart/gui/type/GisMapPlotPane.java index cd2a78870..ee6ebe18b 100644 --- a/designer-chart/src/com/fr/design/mainframe/chart/gui/type/GisMapPlotPane.java +++ b/designer-chart/src/com/fr/design/mainframe/chart/gui/type/GisMapPlotPane.java @@ -11,7 +11,7 @@ import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import javax.swing.*; @@ -118,7 +118,7 @@ public class GisMapPlotPane extends AbstractChartTypePane{ try { chart.switchPlot((Plot)plot.clone()); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error("Error In LineChart"); + FineLoggerFactory.getLogger().error("Error In LineChart"); chart.switchPlot(new GisMapPlot()); } diff --git a/designer-chart/src/com/fr/design/mainframe/chart/gui/type/LinePlotPane.java b/designer-chart/src/com/fr/design/mainframe/chart/gui/type/LinePlotPane.java index 4274c4b2a..4cbb2661b 100644 --- a/designer-chart/src/com/fr/design/mainframe/chart/gui/type/LinePlotPane.java +++ b/designer-chart/src/com/fr/design/mainframe/chart/gui/type/LinePlotPane.java @@ -5,7 +5,7 @@ import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.LinePlot; import com.fr.chart.chartattr.Plot; import com.fr.chart.charttypes.LineIndependentChart; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; public class LinePlotPane extends AbstractChartTypePane{ @@ -68,7 +68,7 @@ public class LinePlotPane extends AbstractChartTypePane{ try { chart.switchPlot((Plot)plot.clone()); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error("Error In LineChart"); + FineLoggerFactory.getLogger().error("Error In LineChart"); chart.switchPlot(new LinePlot()); } } diff --git a/designer-chart/src/com/fr/design/mainframe/chart/gui/type/MeterPlotPane.java b/designer-chart/src/com/fr/design/mainframe/chart/gui/type/MeterPlotPane.java index daafa70a1..0c5612e20 100644 --- a/designer-chart/src/com/fr/design/mainframe/chart/gui/type/MeterPlotPane.java +++ b/designer-chart/src/com/fr/design/mainframe/chart/gui/type/MeterPlotPane.java @@ -6,7 +6,7 @@ import com.fr.chart.chartattr.MeterPlot; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.MeterStyle; import com.fr.chart.charttypes.MeterIndependentChart; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; /** @@ -67,7 +67,7 @@ public class MeterPlotPane extends AbstractChartTypePane { try { cloned = (Plot)newPlot.clone(); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error("Error In ColumnChart"); + FineLoggerFactory.getLogger().error("Error In ColumnChart"); } return cloned; } diff --git a/designer-chart/src/com/fr/van/chart/area/VanChartAreaPlotPane.java b/designer-chart/src/com/fr/van/chart/area/VanChartAreaPlotPane.java index 94a3cb9a8..2595f5487 100644 --- a/designer-chart/src/com/fr/van/chart/area/VanChartAreaPlotPane.java +++ b/designer-chart/src/com/fr/van/chart/area/VanChartAreaPlotPane.java @@ -2,7 +2,7 @@ package com.fr.van.chart.area; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.plugin.chart.area.AreaIndependentVanChart; import com.fr.plugin.chart.area.VanChartAreaPlot; @@ -71,7 +71,7 @@ public class VanChartAreaPlotPane extends AbstractVanChartTypePane { try { cloned = (Plot) newPlot.clone(); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error("Error In AreaChart"); + FineLoggerFactory.getLogger().error("Error In AreaChart"); } return cloned; } diff --git a/designer-chart/src/com/fr/van/chart/bar/VanChartBarPlotPane.java b/designer-chart/src/com/fr/van/chart/bar/VanChartBarPlotPane.java index d9645ca79..2d2509aa6 100644 --- a/designer-chart/src/com/fr/van/chart/bar/VanChartBarPlotPane.java +++ b/designer-chart/src/com/fr/van/chart/bar/VanChartBarPlotPane.java @@ -2,7 +2,7 @@ package com.fr.van.chart.bar; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.plugin.chart.bar.BarIndependentVanChart; import com.fr.plugin.chart.column.VanChartColumnPlot; @@ -70,7 +70,7 @@ public class VanChartBarPlotPane extends AbstractVanChartTypePane { try { cloned = (Plot)newPlot.clone(); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error("Error In ColumnChart"); + FineLoggerFactory.getLogger().error("Error In ColumnChart"); } return cloned; } diff --git a/designer-chart/src/com/fr/van/chart/bubble/VanChartBubblePlotPane.java b/designer-chart/src/com/fr/van/chart/bubble/VanChartBubblePlotPane.java index 49927fecc..aa7f46047 100644 --- a/designer-chart/src/com/fr/van/chart/bubble/VanChartBubblePlotPane.java +++ b/designer-chart/src/com/fr/van/chart/bubble/VanChartBubblePlotPane.java @@ -6,7 +6,7 @@ import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionCollection; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.base.VanChartZoom; @@ -82,7 +82,7 @@ public class VanChartBubblePlotPane extends AbstractVanChartTypePane { try { cloned = (Plot)newPlot.clone(); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error("Error In BubbleChart"); + FineLoggerFactory.getLogger().error("Error In BubbleChart"); } return cloned; } diff --git a/designer-chart/src/com/fr/van/chart/column/VanChartColumnPlotPane.java b/designer-chart/src/com/fr/van/chart/column/VanChartColumnPlotPane.java index c61fc8205..c618fa2c2 100644 --- a/designer-chart/src/com/fr/van/chart/column/VanChartColumnPlotPane.java +++ b/designer-chart/src/com/fr/van/chart/column/VanChartColumnPlotPane.java @@ -2,7 +2,7 @@ package com.fr.van.chart.column; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.plugin.chart.column.ColumnIndependentVanChart; import com.fr.plugin.chart.column.VanChartColumnPlot; @@ -71,7 +71,7 @@ public class VanChartColumnPlotPane extends AbstractVanChartTypePane { try { cloned = (Plot)newPlot.clone(); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error("Error In ColumnChart"); + FineLoggerFactory.getLogger().error("Error In ColumnChart"); } return cloned; } diff --git a/designer-chart/src/com/fr/van/chart/custom/CustomPlotDesignerPaneFactory.java b/designer-chart/src/com/fr/van/chart/custom/CustomPlotDesignerPaneFactory.java index 817e386d1..783a35b87 100644 --- a/designer-chart/src/com/fr/van/chart/custom/CustomPlotDesignerPaneFactory.java +++ b/designer-chart/src/com/fr/van/chart/custom/CustomPlotDesignerPaneFactory.java @@ -5,7 +5,7 @@ import com.fr.design.beans.BasicBeanPane; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.CategoryPlotTableDataContentPane; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.PiePlot4VanChart; import com.fr.plugin.chart.attr.plot.VanChartAxisPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot; @@ -59,7 +59,7 @@ public class CustomPlotDesignerPaneFactory { Constructor > constructor = cl.getConstructor(); return constructor.newInstance(); } catch (Exception e){ - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } } return null; @@ -89,7 +89,7 @@ public class CustomPlotDesignerPaneFactory { Constructor constructor = cl.getConstructor(ChartDataPane.class); return constructor.newInstance(parent); } catch (Exception e){ - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } } return new CategoryPlotTableDataContentPane(parent); @@ -125,7 +125,7 @@ public class CustomPlotDesignerPaneFactory { return constructor.newInstance(plot, parent); } } catch (Exception e){ - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } } return new VanChartAxisPane(plot,parent); diff --git a/designer-chart/src/com/fr/van/chart/custom/VanChartCustomPlotPane.java b/designer-chart/src/com/fr/van/chart/custom/VanChartCustomPlotPane.java index 8817d1ddc..22f95f637 100644 --- a/designer-chart/src/com/fr/van/chart/custom/VanChartCustomPlotPane.java +++ b/designer-chart/src/com/fr/van/chart/custom/VanChartCustomPlotPane.java @@ -9,7 +9,7 @@ import com.fr.chart.chartglyph.ConditionCollection; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.type.ChartImagePane; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.plugin.chart.base.VanChartAttrLine; import com.fr.plugin.chart.base.VanChartTools; @@ -263,7 +263,7 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane { try { cloned = (Plot) newPlot.clone(); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error("Error In ScatterChart"); + FineLoggerFactory.getLogger().error("Error In ScatterChart"); } return cloned; } diff --git a/designer-chart/src/com/fr/van/chart/custom/component/VanChartCustomPlotSelectPane.java b/designer-chart/src/com/fr/van/chart/custom/component/VanChartCustomPlotSelectPane.java index bf9c2e88c..8e4212480 100644 --- a/designer-chart/src/com/fr/van/chart/custom/component/VanChartCustomPlotSelectPane.java +++ b/designer-chart/src/com/fr/van/chart/custom/component/VanChartCustomPlotSelectPane.java @@ -4,7 +4,7 @@ import com.fr.chart.chartattr.Chart; import com.fr.design.beans.BasicBeanPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; @@ -250,7 +250,7 @@ public class VanChartCustomPlotSelectPane extends BasicBeanPane { } } } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } diff --git a/designer-chart/src/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java b/designer-chart/src/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java index 1dbf5a1e1..7e675c6e6 100644 --- a/designer-chart/src/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java +++ b/designer-chart/src/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java @@ -23,7 +23,7 @@ import com.fr.design.hyperlink.WebHyperlinkPane; import com.fr.design.javascript.JavaScriptImplPane; import com.fr.design.javascript.ParameterJavaScriptPane; import com.fr.design.module.DesignModuleFactory; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.general.NameObject; import com.fr.js.EmailJavaScript; @@ -81,13 +81,13 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { return constructor.newInstance(getHyperLinkEditorMap(), false); } catch (InstantiationException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } catch (IllegalAccessException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } catch (NoSuchMethodException e) { return super.createPaneByCreators(creator); } catch (InvocationTargetException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } return null; } diff --git a/designer-chart/src/com/fr/van/chart/designer/PlotFactory.java b/designer-chart/src/com/fr/van/chart/designer/PlotFactory.java index a791a8e34..33b9766d8 100644 --- a/designer-chart/src/com/fr/van/chart/designer/PlotFactory.java +++ b/designer-chart/src/com/fr/van/chart/designer/PlotFactory.java @@ -6,7 +6,7 @@ import com.fr.data.core.FormatField; import com.fr.design.gui.icombobox.UIComboBoxRenderer; import com.fr.design.gui.style.FormatPane; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.plugin.chart.area.VanChartAreaPlot; import com.fr.plugin.chart.bubble.VanChartBubblePlot; @@ -198,7 +198,7 @@ public class PlotFactory { Constructor constructor = cl.getConstructor(Plot.class, VanChartStylePane.class); return constructor.newInstance(plot, stylePane); } catch (Exception e){ - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } } return new VanChartPlotLabelPane(plot, stylePane); @@ -218,7 +218,7 @@ public class PlotFactory { Constructor constructor = cl.getConstructor(VanChartStylePane.class); return constructor.newInstance(stylePane); } catch (Exception e){ - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } } return new VanChartPlotLegendPane(stylePane); @@ -238,7 +238,7 @@ public class PlotFactory { Constructor constructor = cl.getConstructor(Plot.class, VanChartStylePane.class); return constructor.newInstance(plot, stylePane); } catch (Exception e){ - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } } return new VanChartPlotTooltipPane(plot, stylePane); @@ -259,7 +259,7 @@ public class PlotFactory { Constructor constructor = cl.getConstructor(VanChartStylePane.class, JPanel.class); return constructor.newInstance(parent, showOnPane); } catch (Exception e){ - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } } return new VanChartLabelContentPane(parent, showOnPane); @@ -280,7 +280,7 @@ public class PlotFactory { Constructor constructor = cl.getConstructor(VanChartStylePane.class, JPanel.class); return constructor.newInstance(parent, showOnPane); } catch (Exception e){ - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } } return new VanChartTooltipContentPane(parent, showOnPane); @@ -301,7 +301,7 @@ public class PlotFactory { Constructor constructor = cl.getConstructor(Plot.class); return constructor.newInstance(plot); } catch (Exception e){ - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } } return new VanChartPlotRefreshTooltipPane(plot); @@ -321,7 +321,7 @@ public class PlotFactory { Constructor constructor = cl.getConstructor(VanChartStylePane.class, JPanel.class); return constructor.newInstance(parent, showOnPane); } catch (Exception e){ - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } } return new VanChartRefreshTooltipContentPane(parent, showOnPane); diff --git a/designer-chart/src/com/fr/van/chart/designer/component/ChartUIMenuNameableCreator.java b/designer-chart/src/com/fr/van/chart/designer/component/ChartUIMenuNameableCreator.java index c9d781c87..5d7c88091 100644 --- a/designer-chart/src/com/fr/van/chart/designer/component/ChartUIMenuNameableCreator.java +++ b/designer-chart/src/com/fr/van/chart/designer/component/ChartUIMenuNameableCreator.java @@ -2,7 +2,7 @@ package com.fr.van.chart.designer.component; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.imenutable.UIMenuNameableCreator; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import java.lang.reflect.Constructor; import java.util.HashMap; @@ -23,9 +23,9 @@ public class ChartUIMenuNameableCreator extends UIMenuNameableCreator { try { cloneObj = obj.getClass().newInstance(); } catch (InstantiationException e) { - FRLogger.getLogger().error("UIMenuNameableCreator InstantiationException"); + FineLoggerFactory.getLogger().error("UIMenuNameableCreator InstantiationException"); } catch (IllegalAccessException e) { - FRLogger.getLogger().error("UIMenuNameableCreator IllegalAccessException"); + FineLoggerFactory.getLogger().error("UIMenuNameableCreator IllegalAccessException"); } return new ChartUIMenuNameableCreator(hyperLinkEditorMap, name, cloneObj, (Class) this.paneClazz); diff --git a/designer-chart/src/com/fr/van/chart/designer/component/VanChartUIMenuNameableCreator.java b/designer-chart/src/com/fr/van/chart/designer/component/VanChartUIMenuNameableCreator.java index 6b5f0d4de..b7b259647 100644 --- a/designer-chart/src/com/fr/van/chart/designer/component/VanChartUIMenuNameableCreator.java +++ b/designer-chart/src/com/fr/van/chart/designer/component/VanChartUIMenuNameableCreator.java @@ -2,7 +2,7 @@ package com.fr.van.chart.designer.component; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.imenutable.UIMenuNameableCreator; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.stable.FCloneable; /** @@ -20,7 +20,7 @@ public class VanChartUIMenuNameableCreator extends UIMenuNameableCreator { try { cloneObj = ((FCloneable)obj).clone(); } catch (CloneNotSupportedException e){ - FRLogger.getLogger().error("VanChartUIMenuNameableCreator CloneNotSupportedException"); + FineLoggerFactory.getLogger().error("VanChartUIMenuNameableCreator CloneNotSupportedException"); } return new UIMenuNameableCreator(name, cloneObj, this.paneClazz); diff --git a/designer-chart/src/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java b/designer-chart/src/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java index aacb5dd0d..7597ff860 100644 --- a/designer-chart/src/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java +++ b/designer-chart/src/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java @@ -16,7 +16,7 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.general.DateUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartTimeAxis; @@ -379,7 +379,7 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane { String tmp = DateUtils.getDate2LStr(toDate); toDate = DateUtils.DATETIMEFORMAT2.parse(tmp); } catch (ParseException e) { - FRLogger.getLogger().error("cannot get date"); + FineLoggerFactory.getLogger().error("cannot get date"); } return toDate; } diff --git a/designer-chart/src/com/fr/van/chart/designer/style/background/BackgroundNameObjectCreator.java b/designer-chart/src/com/fr/van/chart/designer/style/background/BackgroundNameObjectCreator.java index f6836df34..65bca91fc 100644 --- a/designer-chart/src/com/fr/van/chart/designer/style/background/BackgroundNameObjectCreator.java +++ b/designer-chart/src/com/fr/van/chart/designer/style/background/BackgroundNameObjectCreator.java @@ -2,7 +2,7 @@ package com.fr.van.chart.designer.style.background; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.controlpane.UnrepeatedNameHelper; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.NameObject; import com.fr.plugin.chart.attr.axis.VanChartCustomIntervalBackground; import com.fr.stable.Nameable; @@ -34,13 +34,13 @@ public class BackgroundNameObjectCreator extends ChartNameObjectCreator { return new NameObject(helper.createUnrepeatedName(this.menuName()), vanChartCustomIntervalBackground); } catch (NoSuchMethodException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } catch (IllegalAccessException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } catch (InstantiationException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } catch (InvocationTargetException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } return null; } diff --git a/designer-chart/src/com/fr/van/chart/designer/style/background/ChartNameObjectCreator.java b/designer-chart/src/com/fr/van/chart/designer/style/background/ChartNameObjectCreator.java index d41880c4a..8a5a33ca8 100644 --- a/designer-chart/src/com/fr/van/chart/designer/style/background/ChartNameObjectCreator.java +++ b/designer-chart/src/com/fr/van/chart/designer/style/background/ChartNameObjectCreator.java @@ -3,7 +3,7 @@ package com.fr.van.chart.designer.style.background; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.UnrepeatedNameHelper; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.NameObject; import com.fr.plugin.chart.attr.axis.VanChartAlertValue; import com.fr.stable.Nameable; @@ -40,13 +40,13 @@ public class ChartNameObjectCreator extends NameObjectCreator { return new NameObject(helper.createUnrepeatedName(this.menuName()), vanChartAlertValue); } catch (NoSuchMethodException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } catch (IllegalAccessException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } catch (InstantiationException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } catch (InvocationTargetException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } return null; } diff --git a/designer-chart/src/com/fr/van/chart/designer/style/series/StackedAndAxisNameObjectCreator.java b/designer-chart/src/com/fr/van/chart/designer/style/series/StackedAndAxisNameObjectCreator.java index 384ba5b63..ea2f99554 100644 --- a/designer-chart/src/com/fr/van/chart/designer/style/series/StackedAndAxisNameObjectCreator.java +++ b/designer-chart/src/com/fr/van/chart/designer/style/series/StackedAndAxisNameObjectCreator.java @@ -3,7 +3,7 @@ package com.fr.van.chart.designer.style.series; import com.fr.chart.chartglyph.ConditionAttr; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.controlpane.UnrepeatedNameHelper; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.NameObject; import com.fr.plugin.chart.base.AttrSeriesStackAndAxis; import com.fr.stable.Nameable; @@ -36,13 +36,13 @@ public class StackedAndAxisNameObjectCreator extends ChartNameObjectCreator { return new NameObject(helper.createUnrepeatedName(this.menuName()), conditionAttr); } catch (NoSuchMethodException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } catch (IllegalAccessException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } catch (InstantiationException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } catch (InvocationTargetException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } return null; } diff --git a/designer-chart/src/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java b/designer-chart/src/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java index b52940be9..32a7fca7a 100644 --- a/designer-chart/src/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java +++ b/designer-chart/src/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java @@ -12,7 +12,7 @@ import com.fr.design.gui.ilable.MultilineLabel; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.design.mainframe.chart.gui.type.ChartImagePane; import com.fr.general.Background; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.js.NameJavaScriptGroup; import com.fr.plugin.chart.attr.plot.VanChartPlot; @@ -168,7 +168,7 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane{ ((VanChartPlot)newPlot).setCategoryNum( ((VanChartPlot)oldPlot).getCategoryNum()); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error("Error in change plot"); + FineLoggerFactory.getLogger().error("Error in change plot"); } } diff --git a/designer-chart/src/com/fr/van/chart/funnel/designer/type/VanChartFunnelTypePane.java b/designer-chart/src/com/fr/van/chart/funnel/designer/type/VanChartFunnelTypePane.java index 19f18adc9..229593433 100644 --- a/designer-chart/src/com/fr/van/chart/funnel/designer/type/VanChartFunnelTypePane.java +++ b/designer-chart/src/com/fr/van/chart/funnel/designer/type/VanChartFunnelTypePane.java @@ -2,7 +2,7 @@ package com.fr.van.chart.funnel.designer.type; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.funnel.FunnelIndependentVanChart; @@ -57,7 +57,7 @@ public class VanChartFunnelTypePane extends AbstractVanChartTypePane { try { cloned = (Plot)newPlot.clone(); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } return cloned; } diff --git a/designer-chart/src/com/fr/van/chart/gantt/designer/type/VanChartGanttPlotPane.java b/designer-chart/src/com/fr/van/chart/gantt/designer/type/VanChartGanttPlotPane.java index 5e7b6235c..79afbc79e 100644 --- a/designer-chart/src/com/fr/van/chart/gantt/designer/type/VanChartGanttPlotPane.java +++ b/designer-chart/src/com/fr/van/chart/gantt/designer/type/VanChartGanttPlotPane.java @@ -2,7 +2,7 @@ package com.fr.van.chart.gantt.designer.type; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.plugin.chart.gantt.GanttIndependentVanChart; import com.fr.plugin.chart.gantt.VanChartGanttPlot; @@ -51,7 +51,7 @@ public class VanChartGanttPlotPane extends AbstractVanChartTypePane { try { cloned = (Plot)newPlot.clone(); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } return cloned; } diff --git a/designer-chart/src/com/fr/van/chart/gauge/VanChartGaugePlotPane.java b/designer-chart/src/com/fr/van/chart/gauge/VanChartGaugePlotPane.java index 800075d17..803f8ae4c 100644 --- a/designer-chart/src/com/fr/van/chart/gauge/VanChartGaugePlotPane.java +++ b/designer-chart/src/com/fr/van/chart/gauge/VanChartGaugePlotPane.java @@ -2,7 +2,7 @@ package com.fr.van.chart.gauge; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.plugin.chart.gauge.GaugeIndependentVanChart; import com.fr.plugin.chart.gauge.VanChartGaugePlot; @@ -57,7 +57,7 @@ public class VanChartGaugePlotPane extends AbstractVanChartTypePane { try { cloned = (Plot)newPlot.clone(); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error("Error In GaugeChart"); + FineLoggerFactory.getLogger().error("Error In GaugeChart"); } return cloned; } diff --git a/designer-chart/src/com/fr/van/chart/heatmap/designer/type/VanChartHeatMapTypePane.java b/designer-chart/src/com/fr/van/chart/heatmap/designer/type/VanChartHeatMapTypePane.java index cb9531536..307490500 100644 --- a/designer-chart/src/com/fr/van/chart/heatmap/designer/type/VanChartHeatMapTypePane.java +++ b/designer-chart/src/com/fr/van/chart/heatmap/designer/type/VanChartHeatMapTypePane.java @@ -3,7 +3,7 @@ package com.fr.van.chart.heatmap.designer.type; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.heatmap.HeatMapIndependentVanChart; @@ -87,7 +87,7 @@ public class VanChartHeatMapTypePane extends VanChartMapPlotPane { try { cloned = (Plot)newPlot.clone(); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } return cloned; } diff --git a/designer-chart/src/com/fr/van/chart/line/VanChartLinePlotPane.java b/designer-chart/src/com/fr/van/chart/line/VanChartLinePlotPane.java index 71fa52adb..214236be7 100644 --- a/designer-chart/src/com/fr/van/chart/line/VanChartLinePlotPane.java +++ b/designer-chart/src/com/fr/van/chart/line/VanChartLinePlotPane.java @@ -2,7 +2,7 @@ package com.fr.van.chart.line; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.plugin.chart.line.LineIndependentVanChart; import com.fr.plugin.chart.line.VanChartLinePlot; @@ -62,7 +62,7 @@ public class VanChartLinePlotPane extends AbstractVanChartTypePane { try { cloned = (Plot)newPlot.clone(); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error("Error In LineChart"); + FineLoggerFactory.getLogger().error("Error In LineChart"); } return cloned; } diff --git a/designer-chart/src/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java b/designer-chart/src/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java index 3795aec58..78de970b6 100644 --- a/designer-chart/src/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java +++ b/designer-chart/src/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java @@ -5,7 +5,7 @@ import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; import com.fr.design.mainframe.chart.gui.type.ChartImagePane; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.map.MapIndependentVanChart; @@ -104,7 +104,7 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane { VanChartMapPlot mapPlot = (VanChartMapPlot)plot.clone(); sourceChoosePane.populateBean(mapPlot); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } } @@ -145,7 +145,7 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane { try { cloned = (Plot)newPlot.clone(); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } return cloned; } diff --git a/designer-chart/src/com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java b/designer-chart/src/com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java index 1378050e4..bbc02df10 100644 --- a/designer-chart/src/com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java +++ b/designer-chart/src/com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java @@ -2,7 +2,7 @@ package com.fr.van.chart.multilayer; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.multilayer.MultiPieIndependentVanChart; @@ -52,7 +52,7 @@ public class VanChartMultiPiePlotPane extends AbstractVanChartTypePane { try { cloned = (Plot)newPlot.clone(); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error("Error In MultiPieChart"); + FineLoggerFactory.getLogger().error("Error In MultiPieChart"); } return cloned; } diff --git a/designer-chart/src/com/fr/van/chart/pie/VanChartPiePlotPane.java b/designer-chart/src/com/fr/van/chart/pie/VanChartPiePlotPane.java index e36b220ae..47022c6d2 100644 --- a/designer-chart/src/com/fr/van/chart/pie/VanChartPiePlotPane.java +++ b/designer-chart/src/com/fr/van/chart/pie/VanChartPiePlotPane.java @@ -3,7 +3,7 @@ package com.fr.van.chart.pie; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.plugin.chart.PiePlot4VanChart; import com.fr.plugin.chart.pie.PieIndependentVanChart; @@ -65,7 +65,7 @@ public class VanChartPiePlotPane extends AbstractVanChartTypePane { try { cloned = (Plot)newPlot.clone(); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error("Error In PieChart"); + FineLoggerFactory.getLogger().error("Error In PieChart"); } return cloned; } diff --git a/designer-chart/src/com/fr/van/chart/radar/VanChartRadarPlotPane.java b/designer-chart/src/com/fr/van/chart/radar/VanChartRadarPlotPane.java index 88237fb61..89410133a 100644 --- a/designer-chart/src/com/fr/van/chart/radar/VanChartRadarPlotPane.java +++ b/designer-chart/src/com/fr/van/chart/radar/VanChartRadarPlotPane.java @@ -2,7 +2,7 @@ package com.fr.van.chart.radar; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.plugin.chart.radar.RadarIndependentVanChart; import com.fr.plugin.chart.radar.VanChartRadarPlot; @@ -62,7 +62,7 @@ public class VanChartRadarPlotPane extends AbstractVanChartTypePane { try { cloned = (Plot)newPlot.clone(); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error("Error In RadarChart"); + FineLoggerFactory.getLogger().error("Error In RadarChart"); } return cloned; } diff --git a/designer-chart/src/com/fr/van/chart/scatter/VanChartScatterPlotPane.java b/designer-chart/src/com/fr/van/chart/scatter/VanChartScatterPlotPane.java index 73ac3c72f..3994e9e27 100644 --- a/designer-chart/src/com/fr/van/chart/scatter/VanChartScatterPlotPane.java +++ b/designer-chart/src/com/fr/van/chart/scatter/VanChartScatterPlotPane.java @@ -5,7 +5,7 @@ import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionCollection; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.plugin.chart.base.VanChartAttrLine; import com.fr.plugin.chart.base.VanChartTools; @@ -64,7 +64,7 @@ public class VanChartScatterPlotPane extends AbstractVanChartTypePane { try { cloned = (Plot)newPlot.clone(); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error("Error In ScatterChart"); + FineLoggerFactory.getLogger().error("Error In ScatterChart"); } return cloned; } diff --git a/designer-chart/src/com/fr/van/chart/structure/desinger/type/VanChartStructureTypePane.java b/designer-chart/src/com/fr/van/chart/structure/desinger/type/VanChartStructureTypePane.java index 9e54b6779..0ca2a1421 100644 --- a/designer-chart/src/com/fr/van/chart/structure/desinger/type/VanChartStructureTypePane.java +++ b/designer-chart/src/com/fr/van/chart/structure/desinger/type/VanChartStructureTypePane.java @@ -2,7 +2,7 @@ package com.fr.van.chart.structure.desinger.type; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.structure.StructureIndependentVanChart; @@ -60,7 +60,7 @@ public class VanChartStructureTypePane extends AbstractVanChartTypePane { try { cloned = (Plot)newPlot.clone(); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } return cloned; } diff --git a/designer-chart/src/com/fr/van/chart/treemap/VanChartTreeMapPlotPane.java b/designer-chart/src/com/fr/van/chart/treemap/VanChartTreeMapPlotPane.java index d5f6301a4..e74e1f001 100644 --- a/designer-chart/src/com/fr/van/chart/treemap/VanChartTreeMapPlotPane.java +++ b/designer-chart/src/com/fr/van/chart/treemap/VanChartTreeMapPlotPane.java @@ -2,7 +2,7 @@ package com.fr.van.chart.treemap; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.plugin.chart.treemap.TreeMapIndependentVanChart; import com.fr.plugin.chart.treemap.VanChartTreeMapPlot; @@ -48,7 +48,7 @@ public class VanChartTreeMapPlotPane extends VanChartMultiPiePlotPane { try { cloned = (Plot)newPlot.clone(); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error("Error In treeMapChart"); + FineLoggerFactory.getLogger().error("Error In treeMapChart"); } return cloned; } diff --git a/designer-chart/src/com/fr/van/chart/wordcloud/designer/type/VanChartWordCloudTypePane.java b/designer-chart/src/com/fr/van/chart/wordcloud/designer/type/VanChartWordCloudTypePane.java index 93f5a579a..8b1c8955f 100644 --- a/designer-chart/src/com/fr/van/chart/wordcloud/designer/type/VanChartWordCloudTypePane.java +++ b/designer-chart/src/com/fr/van/chart/wordcloud/designer/type/VanChartWordCloudTypePane.java @@ -2,7 +2,7 @@ package com.fr.van.chart.wordcloud.designer.type; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.wordcloud.VanChartWordCloudPlot; @@ -56,7 +56,7 @@ public class VanChartWordCloudTypePane extends AbstractVanChartTypePane { try { cloned = (Plot)newPlot.clone(); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } return cloned; } diff --git a/designer-form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java b/designer-form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java index 40f2bf472..8973f1d20 100644 --- a/designer-form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java +++ b/designer-form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java @@ -11,7 +11,7 @@ import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import java.awt.*; @@ -82,7 +82,7 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter { return acceptWidget(x, y); } } else { - FRLogger.getLogger().error("top layout is null!"); + FineLoggerFactory.getLogger().error("top layout is null!"); } return false; diff --git a/designer-form/src/com/fr/design/designer/beans/painters/FRAbsoluteLayoutPainter.java b/designer-form/src/com/fr/design/designer/beans/painters/FRAbsoluteLayoutPainter.java index 61e9260e3..8c22a9eb0 100644 --- a/designer-form/src/com/fr/design/designer/beans/painters/FRAbsoluteLayoutPainter.java +++ b/designer-form/src/com/fr/design/designer/beans/painters/FRAbsoluteLayoutPainter.java @@ -7,7 +7,7 @@ import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.form.util.XCreatorConstants; import com.fr.design.mainframe.DesignerFrame; import com.fr.design.mainframe.FormDesigner; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import java.awt.*; @@ -64,12 +64,12 @@ public class FRAbsoluteLayoutPainter extends AbstractPainter { if (XCreatorUtils.getHotspotContainer((XCreator) currentComp) != null) { currentComp = XCreatorUtils.getHotspotContainer((XCreator) currentComp).getTopLayout(); if (currentComp == null) { - FRLogger.getLogger().info("FRAbsoluteLayoutPainter get currentComp null!"); + FineLoggerFactory.getLogger().info("FRAbsoluteLayoutPainter get currentComp null!"); return; } } else{ - FRLogger.getLogger().info("FRAbsoluteLayoutPainter getHotspotContainer currentComp null!"); + FineLoggerFactory.getLogger().info("FRAbsoluteLayoutPainter getHotspotContainer currentComp null!"); return; } Color bColor = XCreatorConstants.FIT_LAYOUT_HOTSPOT_COLOR; diff --git a/designer-form/src/com/fr/design/designer/creator/cardlayout/TabMoveAction.java b/designer-form/src/com/fr/design/designer/creator/cardlayout/TabMoveAction.java index 354846d91..966b14407 100644 --- a/designer-form/src/com/fr/design/designer/creator/cardlayout/TabMoveAction.java +++ b/designer-form/src/com/fr/design/designer/creator/cardlayout/TabMoveAction.java @@ -4,7 +4,7 @@ import com.fr.design.designer.beans.actions.FormUndoableAction; import com.fr.design.mainframe.FormDesigner; import com.fr.form.ui.CardSwitchButton; import com.fr.form.ui.container.cardlayout.WTabFitLayout; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; /** * Created by zhouping on 2017/2/17. @@ -37,7 +37,7 @@ public class TabMoveAction extends FormUndoableAction { xwCardTagLayout.setSwitchingTab(false); }catch (Exception e){ xwCardTagLayout.setSwitchingTab(false); - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); return false; } return true; diff --git a/designer-form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java b/designer-form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java index 5c65f5594..96298860c 100644 --- a/designer-form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java +++ b/designer-form/src/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java @@ -21,7 +21,7 @@ import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.form.ui.container.cardlayout.WTabFitLayout; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.general.Background; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.stable.ArrayUtils; import com.fr.stable.core.PropertyChangeAdapter; @@ -200,7 +200,7 @@ public class XWTabFitLayout extends XWFitLayout { try { xCardSwitchButton = (XCardSwitchButton) ((XWCardMainBorderLayout) this.getTopLayout()).getTitlePart().getTagPart().getComponent(0); }catch (Exception e){ - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } return; } diff --git a/designer-form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java b/designer-form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java index 20702ec8f..0fc137df0 100644 --- a/designer-form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java +++ b/designer-form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java @@ -10,7 +10,7 @@ import com.fr.design.mainframe.widget.editors.LayoutTypeEditor; import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WBodyLayoutType; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.FRScreen; import com.fr.general.Inter; @@ -181,7 +181,7 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr return true; } catch (Exception e){ - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); return false; } } diff --git a/designer-form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java b/designer-form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java index a8b022a97..4da7cf743 100644 --- a/designer-form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java +++ b/designer-form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java @@ -17,7 +17,7 @@ import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WBodyLayoutType; import com.fr.form.ui.container.WFitLayout; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import javax.swing.table.DefaultTableCellRenderer; @@ -175,7 +175,7 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel { FormSelectionUtils.rebuildSelection(xfl, new Widget[]{xfl.toData()})); } }catch (Exception e){ - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); return false; } layout.setLayoutType(WBodyLayoutType.parse(state)); diff --git a/designer-form/src/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/com/fr/design/mainframe/FormDesigner.java index 9fa639171..1b659cd4d 100644 --- a/designer-form/src/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/com/fr/design/mainframe/FormDesigner.java @@ -43,7 +43,7 @@ import com.fr.form.ui.WidgetValue; import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.WFitLayout; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.stable.ArrayUtils; import com.fr.stable.CoreGraphHelper; @@ -1291,7 +1291,7 @@ public class FormDesigner extends TargetComponent

implements TreeSelection try { Thread.sleep(1500); } catch (InterruptedException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } pane.setLayout(new BorderLayout()); diff --git a/designer-form/src/com/fr/design/mainframe/FormSelectionUtils.java b/designer-form/src/com/fr/design/mainframe/FormSelectionUtils.java index 86a7536e2..5aa874bd2 100644 --- a/designer-form/src/com/fr/design/mainframe/FormSelectionUtils.java +++ b/designer-form/src/com/fr/design/mainframe/FormSelectionUtils.java @@ -17,7 +17,7 @@ import com.fr.design.utils.ComponentUtils; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WTitleLayout; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import java.awt.Component; @@ -199,7 +199,7 @@ public class FormSelectionUtils { designer.getSelectionModel().getSelection().addSelectedCreator(copiedXCreator); } } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } } diff --git a/designer-form/src/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer-form/src/com/fr/design/mainframe/FormWidgetDetailPane.java index 5c8f873d5..b83603a71 100644 --- a/designer-form/src/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer-form/src/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -10,9 +10,10 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.form.share.ShareLoader; import com.fr.form.ui.ElCaseBindInfo; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.general.SiteCenter; +import com.fr.log.FineLoggerFactory; import com.fr.share.ShareConstants; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; @@ -322,12 +323,12 @@ public class FormWidgetDetailPane extends FormDockView{ Desktop.getDesktop().browse(new URI(url)); } catch (IOException exp) { JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer_Set_default_browser")); - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); } catch (URISyntaxException exp) { - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); } catch (Exception exp) { - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); - FRContext.getLogger().error("Can not open the browser for URL: " + url); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); } } }); @@ -399,7 +400,7 @@ public class FormWidgetDetailPane extends FormDockView{ } } catch (IOException e) { JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Error")); - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } } } @@ -408,7 +409,7 @@ public class FormWidgetDetailPane extends FormDockView{ try { ShareLoader.getLoader().refreshModule(); } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } } diff --git a/designer-form/src/com/fr/design/mainframe/JForm.java b/designer-form/src/com/fr/design/mainframe/JForm.java index 30dff7934..757da397e 100644 --- a/designer-form/src/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/com/fr/design/mainframe/JForm.java @@ -53,7 +53,7 @@ import com.fr.form.ui.Widget; import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.WLayout; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.stable.ArrayUtils; import com.fr.stable.Constants; @@ -735,7 +735,7 @@ public class JForm extends JTemplate implements BaseJForm { try { Thread.sleep(1500); } catch (InterruptedException e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } JPanel pane = new JPanel(); pane.setLayout(new BorderLayout()); diff --git a/designer-form/src/com/fr/design/mainframe/actions/EmbeddedFormExportExportAction.java b/designer-form/src/com/fr/design/mainframe/actions/EmbeddedFormExportExportAction.java index 08b6be6b8..2d8698f35 100644 --- a/designer-form/src/com/fr/design/mainframe/actions/EmbeddedFormExportExportAction.java +++ b/designer-form/src/com/fr/design/mainframe/actions/EmbeddedFormExportExportAction.java @@ -1,13 +1,5 @@ package com.fr.design.mainframe.actions; -import java.awt.event.ActionEvent; -import java.io.FileOutputStream; -import java.util.HashMap; -import java.util.Map; - -import javax.swing.JOptionPane; -import javax.swing.SwingWorker; - import com.fr.base.BaseUtils; import com.fr.base.FRContext; import com.fr.base.Parameter; @@ -25,11 +17,18 @@ import com.fr.file.FILEChooserPane; import com.fr.file.filter.ChooseFileFilter; import com.fr.form.main.Form; import com.fr.form.main.FormEmbeddedTableDataExporter; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; +import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; import com.fr.stable.project.ProjectConstants; +import javax.swing.*; +import java.awt.event.ActionEvent; +import java.io.FileOutputStream; +import java.util.HashMap; +import java.util.Map; + /** * Export Embedded. */ @@ -84,7 +83,7 @@ public class EmbeddedFormExportExportAction extends JTemplateAction{ try { file.mkfile(); } catch (Exception e1) { - FRLogger.getLogger().error("Error In Make New File"); + FineLoggerFactory.getLogger().error("Error In Make New File"); } fileChooserPane = null; FRContext.getLogger().info("\"" + file.getName() + "\"" + Inter.getLocText("FR-Designer_Prepare_Export") + "!"); @@ -141,7 +140,7 @@ public class EmbeddedFormExportExportAction extends JTemplateAction{ Inter.getLocText("FR-Designer_Exported_successfully") + "\n" + filePath); } catch (Exception exp) { this.setProgress(100); - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("FR-Designer_Export_failed") + "\n" + filePath); } return null; diff --git a/designer-form/src/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java b/designer-form/src/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java index 387c6f782..c45de9795 100644 --- a/designer-form/src/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java +++ b/designer-form/src/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java @@ -23,7 +23,7 @@ import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WBodyLayoutType; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.report.core.ReportUtils; @@ -185,7 +185,7 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane { formDesigner.getSelectionModel().setSelectedCreator(xfl); return true; } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); return false; } } diff --git a/designer-form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java b/designer-form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java index 5eb67b136..41c24f940 100644 --- a/designer-form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java +++ b/designer-form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java @@ -32,7 +32,7 @@ import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WBodyLayoutType; import com.fr.form.ui.container.WFitLayout; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.report.core.ReportUtils; @@ -194,7 +194,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify { FormSelectionUtils.rebuildSelection(xWFitLayout, new Widget[]{wAbsoluteBodyLayout})); } } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } //todo 验证下 diff --git a/designer-realize/src/com/fr/design/actions/file/export/AbstractExportAction.java b/designer-realize/src/com/fr/design/actions/file/export/AbstractExportAction.java index 5ba9688b4..526a80152 100644 --- a/designer-realize/src/com/fr/design/actions/file/export/AbstractExportAction.java +++ b/designer-realize/src/com/fr/design/actions/file/export/AbstractExportAction.java @@ -15,7 +15,7 @@ import com.fr.design.parameter.ParameterInputPane; import com.fr.file.FILE; import com.fr.file.FILEChooserPane; import com.fr.file.filter.ChooseFileFilter; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.io.exporter.AppExporter; import com.fr.io.exporter.CSVExporter; @@ -24,6 +24,7 @@ import com.fr.io.exporter.ExcelExporter; import com.fr.io.exporter.Exporter; import com.fr.io.exporter.PDFExporterProcessor; import com.fr.io.exporter.WordExporter; +import com.fr.log.FineLoggerFactory; import com.fr.main.TemplateWorkBook; import com.fr.main.impl.WorkBook; import com.fr.page.PageSetProvider; @@ -34,8 +35,7 @@ import com.fr.report.worksheet.WorkSheet; import com.fr.stable.ActorConstants; import com.fr.stable.ActorFactory; -import javax.swing.JOptionPane; -import javax.swing.SwingWorker; +import javax.swing.*; import java.awt.event.ActionEvent; import java.io.OutputStream; import java.util.Map; @@ -98,7 +98,7 @@ public abstract class AbstractExportAction extends JWorkBookAction { try { file.mkfile(); } catch (Exception e1) { - FRLogger.getLogger().error("Error In Make New File"); + FineLoggerFactory.getLogger().error("Error In Make New File"); } fileChooserPane = null; FRContext.getLogger().info("\"" + file.getName() + "\"" + Inter.getLocText("FR-Designer_Prepare_Export") + "!"); @@ -132,7 +132,7 @@ public abstract class AbstractExportAction extends JWorkBookAction { Inter.getLocText("FR-Designer_Exported_successfully") + "\n" + filePath); } catch (Exception exp) { this.setProgress(100); - FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("FR-Designer_Export_failed") + "\n" + filePath); } return null; diff --git a/designer-realize/src/com/fr/design/actions/insert/flot/ChartFloatAction.java b/designer-realize/src/com/fr/design/actions/insert/flot/ChartFloatAction.java index 3e6790fa6..d4cee179f 100644 --- a/designer-realize/src/com/fr/design/actions/insert/flot/ChartFloatAction.java +++ b/designer-realize/src/com/fr/design/actions/insert/flot/ChartFloatAction.java @@ -15,7 +15,7 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.menu.MenuKeySet; import com.fr.design.module.DesignModuleFactory; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.grid.Grid; import com.fr.grid.selection.FloatSelection; @@ -123,7 +123,7 @@ public class ChartFloatAction extends ElementCaseAction { reportPane.setSelection(new FloatSelection(newFloatElement.getName())); reportPane.fireSelectionChangeListener(); } catch (CloneNotSupportedException e) { - FRLogger.getLogger().error("Error in Float"); + FineLoggerFactory.getLogger().error("Error in Float"); } } }); diff --git a/designer-realize/src/com/fr/design/mainframe/CellWidgetPropertyPane.java b/designer-realize/src/com/fr/design/mainframe/CellWidgetPropertyPane.java index 38d3c3905..9d311c310 100644 --- a/designer-realize/src/com/fr/design/mainframe/CellWidgetPropertyPane.java +++ b/designer-realize/src/com/fr/design/mainframe/CellWidgetPropertyPane.java @@ -7,7 +7,7 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.widget.WidgetPane; import com.fr.form.ui.NoneWidget; import com.fr.form.ui.Widget; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.Selection; @@ -149,7 +149,7 @@ public class CellWidgetPropertyPane extends BasicPane { newWidget.setWidgetPrivilegeControl((WidgetPrivilegeControl) oldWidget.getWidgetPrivilegeControl().clone()); } } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } return newWidget; } diff --git a/designer-realize/src/com/fr/design/mainframe/ElementCasePane.java b/designer-realize/src/com/fr/design/mainframe/ElementCasePane.java index 25622d179..fe4841962 100644 --- a/designer-realize/src/com/fr/design/mainframe/ElementCasePane.java +++ b/designer-realize/src/com/fr/design/mainframe/ElementCasePane.java @@ -81,7 +81,7 @@ import com.fr.design.selection.Selectedable; import com.fr.design.selection.SelectionEvent; import com.fr.design.selection.SelectionListener; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.grid.Grid; import com.fr.grid.GridColumn; @@ -421,10 +421,10 @@ public abstract class ElementCasePane extends Tar c = clazz.getConstructor(ElementCase.class); editor = (CellEditor) c.newInstance(this); } catch (Exception e1) { - FRLogger.getLogger().error(e1.getMessage(), e1); + FineLoggerFactory.getLogger().error(e1.getMessage(), e1); } } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } grid.setDefaultCellEditor(provider.targetObjectClass(), editor); } diff --git a/designer-realize/src/com/fr/design/mainframe/alphafine/cell/model/ActionModel.java b/designer-realize/src/com/fr/design/mainframe/alphafine/cell/model/ActionModel.java index cb2bbc437..324006f93 100644 --- a/designer-realize/src/com/fr/design/mainframe/alphafine/cell/model/ActionModel.java +++ b/designer-realize/src/com/fr/design/mainframe/alphafine/cell/model/ActionModel.java @@ -2,7 +2,7 @@ package com.fr.design.mainframe.alphafine.cell.model; import com.fr.design.actions.UpdateAction; import com.fr.design.mainframe.alphafine.CellType; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.json.JSONException; import com.fr.json.JSONObject; @@ -58,7 +58,7 @@ public class ActionModel extends AlphaCellModel { modelObject.put("className", getAction().getClass().getName()).put("searchCount", getSearchCount()); object.put("result", modelObject).put("cellType", getType().getTypeValue()); } catch (JSONException e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } return object; } diff --git a/designer-realize/src/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java b/designer-realize/src/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java index a42e9ed97..4cb7cd16d 100644 --- a/designer-realize/src/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java +++ b/designer-realize/src/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java @@ -2,7 +2,7 @@ package com.fr.design.mainframe.alphafine.cell.model; import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.CellType; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.json.JSONException; import com.fr.json.JSONObject; @@ -47,7 +47,7 @@ public class DocumentModel extends AlphaCellModel { modelObject.put("title", getName()).put("summary", getContent()).put("did", getDocumentId()).put("searchCount", getSearchCount()); object.put("result", modelObject).put("cellType", getType().getTypeValue()); } catch (JSONException e) { - FRLogger.getLogger().error("DocumentModel: " + e.getMessage()); + FineLoggerFactory.getLogger().error("DocumentModel: " + e.getMessage()); } return object; } @@ -62,9 +62,9 @@ public class DocumentModel extends AlphaCellModel { try { Desktop.getDesktop().browse(new URI(getDocumentUrl())); } catch (IOException e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } catch (URISyntaxException e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } } diff --git a/designer-realize/src/com/fr/design/mainframe/alphafine/cell/model/FileModel.java b/designer-realize/src/com/fr/design/mainframe/alphafine/cell/model/FileModel.java index e18ed9afe..70d55b872 100644 --- a/designer-realize/src/com/fr/design/mainframe/alphafine/cell/model/FileModel.java +++ b/designer-realize/src/com/fr/design/mainframe/alphafine/cell/model/FileModel.java @@ -5,7 +5,7 @@ import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.CellType; import com.fr.file.FileNodeFILE; import com.fr.file.filetree.FileNode; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.json.JSONException; import com.fr.json.JSONObject; @@ -42,7 +42,7 @@ public class FileModel extends AlphaCellModel { modelObject.put("filePath", getFilePath()).put("searchCount", getSearchCount()); object.put("result", modelObject).put("cellType", getType().getTypeValue()); } catch (JSONException e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } return object; } diff --git a/designer-realize/src/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java b/designer-realize/src/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java index 44c6ae660..f8782c10a 100644 --- a/designer-realize/src/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java +++ b/designer-realize/src/com/fr/design/mainframe/alphafine/cell/model/PluginModel.java @@ -5,7 +5,7 @@ import com.fr.design.extra.WebViewDlgHelper; import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.CellType; import com.fr.env.RemoteEnv; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.json.JSONException; import com.fr.json.JSONObject; import com.fr.stable.StringUtils; @@ -93,7 +93,7 @@ public class PluginModel extends AlphaCellModel { modelObject.put("name", getName()).put("description", getContent()).put("pic", getImageUrl()).put("version", getVersion()).put("jartime", getJartime()).put("id", getId()).put("pluginid", getPluginId()).put("type", getType().getTypeValue()).put("price", getPrice()).put("link", getLink()).put("searchCount", getSearchCount()); object.put("result", modelObject).put("cellType", getType().getTypeValue()); } catch (JSONException e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } return object; diff --git a/designer-realize/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer-realize/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index 59237baad..33dd2893e 100644 --- a/designer-realize/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer-realize/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -32,7 +32,7 @@ import com.fr.design.mainframe.alphafine.search.manager.impl.RecommendSearchMana import com.fr.form.main.Form; import com.fr.form.main.FormIO; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.general.http.HttpClient; import com.fr.io.TemplateWorkBookIO; @@ -509,7 +509,7 @@ public class AlphaFineDialog extends UIDialog { try { form = FormIO.readForm(FRContext.getCurrentEnv(), fileName); } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } return FormIO.exportFormAsImage(form); } @@ -521,9 +521,9 @@ public class AlphaFineDialog extends UIDialog { try { rightSearchResultPane.add(new FilePreviewPane(get())); } catch (InterruptedException e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } catch (ExecutionException e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } validate(); repaint(); @@ -541,7 +541,7 @@ public class AlphaFineDialog extends UIDialog { try { workBook = (WorkBook) TemplateWorkBookIO.readTemplateWorkBook(FRContext.getCurrentEnv(), fileName); } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } BufferedImage bufferedImage = new ImageExporter().exportToImage(workBook); return bufferedImage; @@ -556,9 +556,9 @@ public class AlphaFineDialog extends UIDialog { validate(); repaint(); } catch (InterruptedException e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } catch (ExecutionException e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } } @@ -593,7 +593,7 @@ public class AlphaFineDialog extends UIDialog { try { bufferedImage = ImageIO.read(getClass().getResource("/com/fr/design/mainframe/alphafine/images/default_product.png")); } catch (IOException e1) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } } return bufferedImage; @@ -609,9 +609,9 @@ public class AlphaFineDialog extends UIDialog { repaint(); } } catch (InterruptedException e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } catch (ExecutionException e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } } @@ -695,7 +695,7 @@ public class AlphaFineDialog extends UIDialog { Thread.sleep(10); doSearch(searchTextField.getText().toLowerCase()); } catch (InterruptedException e1) { - FRLogger.getLogger().error(e1.getMessage()); + FineLoggerFactory.getLogger().error(e1.getMessage()); } } @@ -788,7 +788,7 @@ public class AlphaFineDialog extends UIDialog { try { object.put("uuid", uuid).put("activityKey", activityKey).put("username", username).put("createTime", createTime).put("key", key).put("resultKind", resultKind).put("resultValue", resultValue); } catch (JSONException e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } final HashMap para = new HashMap<>(); String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime()); @@ -797,7 +797,7 @@ public class AlphaFineDialog extends UIDialog { HttpClient httpClient = new HttpClient(AlphaFineConstants.CLOUD_SERVER_URL, para, true); httpClient.asGet(); if (!httpClient.isServerAlive()) { - FRLogger.getLogger().error("Failed to sent data to server!"); + FineLoggerFactory.getLogger().error("Failed to sent data to server!"); } } diff --git a/designer-realize/src/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java b/designer-realize/src/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java index d4611256c..2fa777f03 100644 --- a/designer-realize/src/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java +++ b/designer-realize/src/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java @@ -8,7 +8,7 @@ import com.fr.design.mainframe.alphafine.cell.model.DocumentModel; import com.fr.design.mainframe.alphafine.cell.model.MoreModel; import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; @@ -88,7 +88,7 @@ public class DocumentSearchManager implements AlphaFineSearchProvider { } } } catch (JSONException e) { - FRLogger.getLogger().error("document search error: " + e.getMessage()); + FineLoggerFactory.getLogger().error("document search error: " + e.getMessage()); } } return lessModelList; diff --git a/designer-realize/src/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java b/designer-realize/src/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java index 8cc578683..33c592073 100644 --- a/designer-realize/src/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java +++ b/designer-realize/src/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java @@ -12,7 +12,7 @@ import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider; import com.fr.file.filetree.FileNode; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.json.JSONObject; import com.fr.stable.StringUtils; @@ -175,7 +175,7 @@ public class FileSearchManager implements AlphaFineSearchProvider { isr.close(); reader.close(); } catch (Exception e) { - FRLogger.getLogger().error("file read error: " + e.getMessage()); + FineLoggerFactory.getLogger().error("file read error: " + e.getMessage()); } } diff --git a/designer-realize/src/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java b/designer-realize/src/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java index 17cd01f58..ab3ce080d 100644 --- a/designer-realize/src/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java +++ b/designer-realize/src/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java @@ -9,7 +9,7 @@ import com.fr.design.mainframe.alphafine.cell.model.PluginModel; import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; @@ -57,7 +57,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider { try { imageUrl = isFromCloud ? AlphaFineConstants.PLUGIN_IMAGE_URL + URLEncoder.encode(object.optString("pic").toString().substring(AlphaFineConstants.PLUGIN_IMAGE_URL.length()), "utf8") : object.optString("pic"); } catch (UnsupportedEncodingException e) { - FRLogger.getLogger().error("plugin icon error: " + e.getMessage()); + FineLoggerFactory.getLogger().error("plugin icon error: " + e.getMessage()); } String version = null; String jartime = null; @@ -133,9 +133,9 @@ public class PluginSearchManager implements AlphaFineSearchProvider { } } } catch (JSONException e) { - FRLogger.getLogger().error("plugin search json error :" + e.getMessage()); + FineLoggerFactory.getLogger().error("plugin search json error :" + e.getMessage()); } catch (UnsupportedEncodingException e) { - FRLogger.getLogger().error("plugin search encode error :" + e.getMessage()); + FineLoggerFactory.getLogger().error("plugin search encode error :" + e.getMessage()); } } return this.lessModelList; diff --git a/designer-realize/src/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java b/designer-realize/src/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java index 9bc485287..2dc1ee9c0 100644 --- a/designer-realize/src/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java +++ b/designer-realize/src/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java @@ -10,7 +10,7 @@ import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel; import com.fr.design.mainframe.alphafine.cell.model.MoreModel; import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; @@ -67,7 +67,7 @@ public class RecommendSearchManager implements AlphaFineSearchProvider { } } } catch (JSONException e) { - FRLogger.getLogger().error("recommend search error! :" + e.getMessage()); + FineLoggerFactory.getLogger().error("recommend search error! :" + e.getMessage()); } Iterator modelIterator = recommendModelList.iterator(); while (modelIterator.hasNext()) { diff --git a/designer-realize/src/com/fr/design/mainframe/bbs/BBSDialog.java b/designer-realize/src/com/fr/design/mainframe/bbs/BBSDialog.java index b0667d4c6..ef4633f5a 100644 --- a/designer-realize/src/com/fr/design/mainframe/bbs/BBSDialog.java +++ b/designer-realize/src/com/fr/design/mainframe/bbs/BBSDialog.java @@ -4,7 +4,7 @@ import com.fr.design.dialog.UIDialog; import com.fr.design.extra.PluginWebBridge; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.SiteCenter; import javafx.application.Platform; @@ -63,7 +63,7 @@ public class BBSDialog extends UIDialog { } }); } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } } diff --git a/designer-realize/src/com/fr/design/mainframe/bbs/BBSLoginDialog.java b/designer-realize/src/com/fr/design/mainframe/bbs/BBSLoginDialog.java index 7acc4a2d7..6c0c8e694 100644 --- a/designer-realize/src/com/fr/design/mainframe/bbs/BBSLoginDialog.java +++ b/designer-realize/src/com/fr/design/mainframe/bbs/BBSLoginDialog.java @@ -11,6 +11,7 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.*; import com.fr.general.http.HttpClient; +import com.fr.log.FineLoggerFactory; import com.fr.stable.EncodeConstants; import com.fr.stable.StringUtils; @@ -280,7 +281,7 @@ public class BBSLoginDialog extends UIDialog { username = URLEncoder.encode(username, EncodeConstants.ENCODING_GBK); password = URLEncoder.encode(password, EncodeConstants.ENCODING_GBK); } catch (UnsupportedEncodingException e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } String url = SiteCenter.getInstance().acquireUrlByKind("bbs.login") + "&username=" + username + "&password=" + password; String loginSuccessFlag = SiteCenter.getInstance().acquireUrlByKind("bbs"); @@ -293,7 +294,7 @@ public class BBSLoginDialog extends UIDialog { return true; } } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } } } diff --git a/designer-realize/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java b/designer-realize/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java index e2a3b30ca..8e5471571 100644 --- a/designer-realize/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java +++ b/designer-realize/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java @@ -3,7 +3,6 @@ package com.fr.design.mainframe.errorinfo; import com.fr.base.FRContext; import com.fr.design.mainframe.SiteCenterToken; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.general.SiteCenter; @@ -11,8 +10,8 @@ import com.fr.general.http.HttpClient; import com.fr.json.JSONException; import com.fr.json.JSONObject; import com.fr.license.function.VT4FR; +import com.fr.log.FineLoggerFactory; import com.fr.log.LogHandler; -import com.fr.stable.CodeUtils; import com.fr.stable.EnvChangedListener; import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; @@ -21,8 +20,6 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStream; -import java.text.SimpleDateFormat; -import java.util.Calendar; import java.util.HashMap; /** @@ -41,7 +38,7 @@ public class ErrorInfoUploader { GeneralContext.addEnvChangedListener(new EnvChangedListener() { @Override public void envChanged() { - FRLogger.getLogger().addLogAppender(new LogHandler() { + FineLoggerFactory.getLogger().addLogAppender(new LogHandler() { @Override public ErrorInfoLogAppender getHandler() { return new ErrorInfoLogAppender(); @@ -53,7 +50,7 @@ public class ErrorInfoUploader { } private ErrorInfoUploader() { - FRLogger.getLogger().addLogAppender(new LogHandler() { + FineLoggerFactory.getLogger().addLogAppender(new LogHandler() { @Override public ErrorInfoLogAppender getHandler() { return new ErrorInfoLogAppender(); diff --git a/designer-realize/src/com/fr/design/module/DesignerModule.java b/designer-realize/src/com/fr/design/module/DesignerModule.java index 0427eee31..5b95d034f 100644 --- a/designer-realize/src/com/fr/design/module/DesignerModule.java +++ b/designer-realize/src/com/fr/design/module/DesignerModule.java @@ -49,7 +49,7 @@ import com.fr.design.parameter.WorkBookParameterReader; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.file.FILE; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.general.ModuleContext; import com.fr.general.xml.GeneralXMLTools; @@ -168,7 +168,7 @@ public class DesignerModule extends DesignModule { try { ActionFactory.registerCellEditor(provider.targetObjectClass(), provider.quickEditor().newInstance()); } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage(), e); + FineLoggerFactory.getLogger().error(e.getMessage(), e); } } } @@ -445,7 +445,7 @@ public class DesignerModule extends DesignModule { ServerPreferenceConfig.getInstance().putStyle(namelist.get(i), Style.DEFAULT_STYLE); } } catch (Exception ex) { - FRLogger.getLogger().error(ex.getMessage()); + FineLoggerFactory.getLogger().error(ex.getMessage()); } jd.dispose(); new StyleListAction().actionPerformed(e);// 弹窗 diff --git a/designer-realize/src/com/fr/design/present/CellWriteAttrPane.java b/designer-realize/src/com/fr/design/present/CellWriteAttrPane.java index 3ef36b121..f2754c555 100644 --- a/designer-realize/src/com/fr/design/present/CellWriteAttrPane.java +++ b/designer-realize/src/com/fr/design/present/CellWriteAttrPane.java @@ -10,7 +10,7 @@ import com.fr.design.mainframe.ElementCasePane; import com.fr.design.widget.WidgetPane; import com.fr.form.ui.NoneWidget; import com.fr.form.ui.Widget; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.Selection; @@ -111,7 +111,7 @@ public class CellWriteAttrPane extends BasicPane { newWidget.setWidgetPrivilegeControl((WidgetPrivilegeControl) oldWidget.getWidgetPrivilegeControl().clone()); } } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } return newWidget; } diff --git a/designer-realize/src/com/fr/design/widget/WidgetEventPane.java b/designer-realize/src/com/fr/design/widget/WidgetEventPane.java index 4e149ac2e..34b42baf9 100644 --- a/designer-realize/src/com/fr/design/widget/WidgetEventPane.java +++ b/designer-realize/src/com/fr/design/widget/WidgetEventPane.java @@ -18,7 +18,7 @@ import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.JTemplate; import com.fr.form.event.Listener; import com.fr.form.ui.Widget; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.general.NameObject; import com.fr.grid.GridUtils; diff --git a/designer-realize/src/com/fr/design/write/submit/SubmitVisitorListPane.java b/designer-realize/src/com/fr/design/write/submit/SubmitVisitorListPane.java index 3dfea6c15..e26e3549c 100644 --- a/designer-realize/src/com/fr/design/write/submit/SubmitVisitorListPane.java +++ b/designer-realize/src/com/fr/design/write/submit/SubmitVisitorListPane.java @@ -14,7 +14,7 @@ import com.fr.design.mainframe.ElementCasePane; import com.fr.design.scrollruler.ModLineBorder; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; -import com.fr.general.FRLogger; +import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.general.NameObject; import com.fr.report.write.BuiltInSQLSubmiter; @@ -137,7 +137,7 @@ public class SubmitVisitorListPane extends ObjectJControlPane { try { editing = (BuiltInSQLSubmiterProvider) editing.clone(); } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage()); + FineLoggerFactory.getLogger().error(e.getMessage()); } editing.setDBManipulation(dbManipulation);