From cd809ae63f7518d353b1130caeb0d50adae4c3a5 Mon Sep 17 00:00:00 2001 From: jooyoul_lee Date: Wed, 21 May 2014 20:02:28 +0900 Subject: [PATCH] NSCREEN : remove System.out.print log. 1. print log - using Logger Change-Id: I14922f1d4d7627b58cac89e4cd3139ab344a0616 Signed-off-by: jooyoul_lee --- .../org/tizen/webuibuilder/ui/editor/PageDesigner.java | 18 +++++++++--------- .../ui/views/nscreen/NScreenBaseComposite.java | 12 ++++++++---- .../webuibuilder/ui/views/nscreen/NScreenUtil.java | 7 ++++++- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/editor/PageDesigner.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/editor/PageDesigner.java index 15d650d..0cf5f80 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/editor/PageDesigner.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/editor/PageDesigner.java @@ -383,24 +383,24 @@ public class PageDesigner extends GraphicalEditor implements CommandStackListene setCurrentCssFileToModel(pageData.getCurrentCssFile()); if (NScreenUtil.isLogEnabled()) { + StringBuffer buffer = new StringBuffer(); List applied = pageData.getAppliedCssFiles(); int current = applied.indexOf(pageData.getCurrentCssFile()); - NScreenUtil.nscreen_log("================= CSS Layer (" + applied.size() - + ") ====================="); + buffer.append("\n================= CSS Layer (" + applied.size() + + ") =====================\n"); CssFile appliedCssFile = null; for (int i = 0; i < applied.size(); i++) { appliedCssFile = applied.get(i); if (i == current) { - NScreenUtil.nscreen_log(i + ". " - + new File(appliedCssFile.getCssFilePath()).getName()); + buffer.append(i + ". " + + new File(appliedCssFile.getCssFilePath()).getName() + "\n"); } else { - NScreenUtil.nscreen_log(i + ". " - + new File(appliedCssFile.getCssFilePath()).getName()); + buffer.append(i + ". " + + new File(appliedCssFile.getCssFilePath()).getName() + "\n"); } - } - - NScreenUtil.nscreen_log("====================================================="); + buffer.append("====================================================="); + NScreenUtil.nscreen_log(buffer.toString()); } if (getViewer() != null) { diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/NScreenBaseComposite.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/NScreenBaseComposite.java index 024641a..df6f39e 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/NScreenBaseComposite.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/NScreenBaseComposite.java @@ -87,10 +87,14 @@ public class NScreenBaseComposite extends ScrolledComposite { @Override public void handleEvent(Event event) { - boolean logEnabled = NScreenUtil.isLogEnabled(); - NScreenUtil.nscreen_log("NSCreenLog Off"); - NScreenUtil.enableNScreenLog(!logEnabled); - NScreenUtil.nscreen_log("NSCreenLog On"); + Rectangle rect = nscreenComp.getClientArea(); + Rectangle r = new Rectangle(rect.x, rect.y, 10, 10); + if (r.contains(event.x, event.y)) { + boolean logEnabled = NScreenUtil.isLogEnabled(); + NScreenUtil.nscreen_log("NSCreenLog Off"); + NScreenUtil.enableNScreenLog(!logEnabled); + NScreenUtil.nscreen_log("NSCreenLog On"); + } } }); } diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/NScreenUtil.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/NScreenUtil.java index edda270..07c372a 100644 --- a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/NScreenUtil.java +++ b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/NScreenUtil.java @@ -14,12 +14,15 @@ import java.util.Iterator; import java.util.Map.Entry; import org.eclipse.swt.graphics.Image; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.tizen.common.ui.view.console.ConsoleManager; import org.tizen.webuibuilder.BuilderConstants; import org.tizen.webuibuilder.model.css.CssSelector; import org.tizen.webuibuilder.model.nscreen.NScreenModel; import org.tizen.webuibuilder.model.nscreen.NScreenModel.NScreenType; import org.tizen.webuibuilder.model.nscreen.NScreenModel.Orientation; +import org.tizen.webuibuilder.model.nscreen.descriptors.NScreenDescriptor; import org.tizen.webuibuilder.utility.ResourceManager; @@ -27,6 +30,8 @@ public class NScreenUtil { private static boolean logEnabled = false; private static ConsoleManager console; + private static Logger logger = LoggerFactory.getLogger(NScreenDescriptor.class); + public static void enableNScreenLog(boolean enabled) { logEnabled = enabled; @@ -42,7 +47,7 @@ public class NScreenUtil { public static void nscreen_log(String log) { if (logEnabled) { console.println("[NSCREEN_LOG] " + log); - System.out.println("[NSCREEN_LOG] " + log); + logger.info(log); } } -- 2.7.4