--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.tizen.dynamicanalyzer.splash</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Localization: plugin
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.tizen.dynamicanalyzer.splash
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: %providerName
--- /dev/null
+bin.includes = META-INF/,\\r
+ splash.bmp,\\r
+ plugin.properties\r
+\r
--- /dev/null
+#Plugin name\r
+pluginName=bada Application Performance Analyzer Workbench Splash\r
+#Provider name\r
+providerName=Samsung Electronics\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry exported="true" kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.tizen.dynamicanalyzer.widgets</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+#Thu Jul 05 13:02:20 KST 2012
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
--- /dev/null
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Widgets
+Bundle-SymbolicName: org.tizen.dynamicanalyzer.widgets;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.tizen.dynamicanalyzer.widgets.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Export-Package: org.tizen.dynamicanalyzer.widgets,
+ org.tizen.dynamicanalyzer.widgets.animation,
+ org.tizen.dynamicanalyzer.widgets.button,
+ org.tizen.dynamicanalyzer.widgets.button.checkbox,
+ org.tizen.dynamicanalyzer.widgets.button.radio,
+ org.tizen.dynamicanalyzer.widgets.button.toggle,
+ org.tizen.dynamicanalyzer.widgets.chart,
+ org.tizen.dynamicanalyzer.widgets.chartBoard,
+ org.tizen.dynamicanalyzer.widgets.combo,
+ org.tizen.dynamicanalyzer.widgets.graph.bar,
+ org.tizen.dynamicanalyzer.widgets.contextMenu,
+ org.tizen.dynamicanalyzer.widgets.graph.circular,
+ org.tizen.dynamicanalyzer.widgets.helper,
+ org.tizen.dynamicanalyzer.widgets.lifecycle,
+ org.tizen.dynamicanalyzer.widgets.progress,
+ org.tizen.dynamicanalyzer.widgets.scale,
+ org.tizen.dynamicanalyzer.widgets.timeline,
+ org.tizen.dynamicanalyzer.widgets.timer
+Import-Package: org.tizen.dynamicanalyzer.widgets.scale
--- /dev/null
+source.. = src/
+output.. = bin/
+bin.includes = .,\
+ bin/,\
+ Images/,\
+ META-INF/,\
+ .project,\
+ .classpath,\
+ .settings/,\
+ build.properties
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.tizen.dynamicanalyzer.widgets"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets;
+
+public class DAWidgetConstants {
+ public static final String EMPTY_STRING = ""; //$NON-NLS-1$
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.animation;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+
+public class DAAnimationIcon extends Canvas {
+
+ private List<Image> imageList = null;
+
+ Timer timer = null;
+ long startTime = 0;
+ long interval = 100;
+
+ int index = 0;
+
+ public DAAnimationIcon(Composite parent, int style) {
+ super(parent, style | SWT.TRANSPARENT);
+ this.addPaintListener(paintListener);
+ }
+
+ public DAAnimationIcon(Composite parent, int style, List<Image> images) {
+ this(parent, style);
+ imageList = new ArrayList<Image>();
+ imageList.addAll(images);
+ }
+
+ public void setInterval(long interval) {
+ this.interval = interval;
+ }
+
+ public void start() {
+ startTimer();
+ }
+
+ private PaintListener paintListener = new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ Canvas canvas = (Canvas) e.widget;
+ canvas.setBackground(canvas.getParent().getBackground());
+ Rectangle rect = canvas.getClientArea();
+ if (index >= imageList.size()) {
+ index = 0;
+ }
+ e.gc.drawImage(imageList.get(index++), rect.x, rect.y);
+ }
+ };
+
+ private void startTimer() {
+ if (null != timer)
+ stopTimer();
+
+ startTime = System.currentTimeMillis();
+ timer = new Timer();
+
+ timer.schedule(new TimerTask() {
+ @Override
+ public void run() {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (null != this && !isDisposed()) {
+ redraw();
+ update();
+ }
+ }
+ });
+ }
+ }, 10, interval);
+ }
+
+ public void stopTimer() {
+ if (null != timer) {
+ timer.cancel();
+ timer = null;
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.button;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+
+/**
+ * Newly implemented button class
+ *
+ * @author jooyoul lee
+ */
+public class DACustomButton extends Canvas {
+
+ public static final int STATE_NORMAL = 0;
+ public static final int STATE_PUSH = 1;
+ public static final int STATE_HOVER = 2;
+ public static final int STATE_DISABLE = 3;
+
+ public static final int TYPE_IMAGE = 0;
+ public static final int TYPE_COLOR = 1;
+ public static final int TYPE_GRADATION = 2;
+
+ protected int state = STATE_NORMAL;
+ protected DACustomButtonAttribute attr;
+ protected IDACustomButtonRenderer buttonRenderer = null;
+
+ /**
+ * Constructs a new instance of this class given its parent and style value
+ * describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in class SWT
+ * which is applicable to instances of this class, or must be built by
+ * bitwise OR'ing together (that is, using the int "|" operator) two or more
+ * of those SWT style constants. The class description lists the style
+ * constants that are applicable to the class. Style bits are also inherited
+ * from superclasses.
+ * </p>
+ *
+ * @param parent
+ * a composite control which will be the parent of the new
+ * instance (cannot be bull)
+ * @param style
+ * the style of control to construct
+ * @throws IllegalArgumentException
+ * , SWTException
+ */
+ public DACustomButton(Composite parent, int style) {
+ super(parent, style);
+
+ this.setForeground(ColorResources.WHITE);
+ this.addPaintListener(buttonPaintListener);
+ addListeners();
+ buttonRenderer = new DACustomButtonRenderer();
+ attr = new DACustomButtonAttribute();
+ setDefaultColors();
+ }
+
+ /**
+ * Construct a new instance of this class. <br>
+ * The titleText value sets button text.
+ *
+ * @param parent
+ * a composite control which will be the parent of the new
+ * instance (cannot be bull)
+ * @param style
+ * the style of control to construct
+ * @param titleText
+ * the text of button
+ */
+ public DACustomButton(Composite parent, String titleText) {
+ this(parent, SWT.NONE);
+ attr.setText(titleText);
+ }
+
+ /**
+ * Construct a new instance of this class. it makes image button.
+ *
+ * @param parent
+ * a composite control which will be the parent of the new
+ * instance (cannot be bull)
+ * @param normal
+ * the image of normal state of button
+ * @param mouseDown
+ * the image of normal state of button
+ * @param hover
+ * the image of hover state of button
+ * @param disable
+ * the image of disable state of button
+ */
+ public DACustomButton(Composite parent, Image normal, Image mouseDown,
+ Image hover, Image disable) {
+ this(parent, SWT.TRANSPARENT);
+ setImages(normal, mouseDown, hover, disable);
+ attr.setDrawType(TYPE_IMAGE);
+ }
+
+ /**
+ * Construct a new instance of this class. it makes gradation button.
+ *
+ * @param parent
+ * a composite control which will be the parent of the new
+ * instance (cannot be bull)
+ * @param normalStart
+ * the start color of normal state gradation
+ * @param normalEnd
+ * the end color of normal state gradation
+ * @param pushStart
+ * the start color of push state gradation
+ * @param pushEnd
+ * the end color of push state gradation
+ * @param hoverStart
+ * the start color of hover state gradation
+ * @param hoverEnd
+ * the end color of hover state gradation
+ * @param disableStart
+ * the start color of disable state gradation
+ * @param disableEnd
+ * the end color of disable state gradation
+ *
+ */
+ public DACustomButton(Composite parent, Color normalStart, Color normalEnd,
+ Color pushStart, Color pushEnd, Color hoverStart, Color hoverEnd,
+ Color disableStart, Color disableEnd) {
+ this(parent, SWT.NONE);
+ attr.setColor(0, normalStart);
+ attr.setColor(1, normalEnd);
+ attr.setColor(2, pushStart);
+ attr.setColor(3, pushEnd);
+ attr.setColor(4, hoverStart);
+ attr.setColor(5, hoverEnd);
+ attr.setColor(6, disableStart);
+ attr.setColor(7, disableEnd);
+ attr.setDrawType(TYPE_GRADATION);
+ }
+
+ /**
+ * add mouse listeners - enter, exit, mouse down, mouse up
+ */
+ protected void addListeners() {
+ this.addListener(SWT.MouseEnter, buttonMouseListener);
+ this.addListener(SWT.MouseExit, buttonMouseListener);
+ this.addListener(SWT.MouseDown, buttonMouseListener);
+ this.addListener(SWT.MouseUp, buttonMouseListener);
+ }
+
+ /**
+ * Change button state
+ *
+ * @param state
+ * The value of the state in which you want to set.
+ * @see #getState()
+ */
+ protected void changeButtonState(int state) {
+ this.state = state;
+ this.redraw();
+ }
+
+ protected Listener buttonMouseListener = new Listener() {
+ @Override
+ public void handleEvent(Event event) {
+ if (state == STATE_DISABLE) {
+ return;
+ }
+
+ if (event.type == SWT.MouseEnter) {
+ changeButtonState(STATE_HOVER);
+ }
+
+ if (event.type == SWT.MouseExit) {
+ changeButtonState(STATE_NORMAL);
+ }
+
+ if (event.type == SWT.MouseDown) {
+ changeButtonState(STATE_PUSH);
+ }
+
+ if (event.type == SWT.MouseUp) { // FIXME
+ changeButtonState(STATE_HOVER);
+ }
+ }
+ };
+
+ /**
+ * Sets default state colors
+ */
+ private void setDefaultColors() {
+ attr.setColor(STATE_DISABLE,
+ new Color(Display.getCurrent(), 48, 48, 48));
+ attr.setColor(STATE_PUSH, new Color(Display.getCurrent(), 29, 109, 140));
+ attr.setColor(STATE_HOVER, new Color(Display.getCurrent(), 0, 134, 185));
+ attr.setColor(STATE_NORMAL, new Color(Display.getCurrent(), 67, 67, 67));
+ }
+
+ private PaintListener buttonPaintListener = new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ buttonRenderer.draw(e.gc, (Canvas) e.widget, state, attr);
+ }
+ };
+
+ /**
+ * Sets the text of button <br>
+ * This same with setText.
+ *
+ * @param newTitle
+ * the text on the button
+ * @see #setText(String)
+ */
+ public void setTitle(String newTitle) {
+ attr.setText(newTitle);
+ }
+
+ /**
+ * Sets the text of button <br>
+ * This same with setTitle.
+ *
+ * @param newTitle
+ * the text on the button
+ */
+ public void setText(String newTitle) {
+ attr.setText(newTitle);
+ }
+
+ /**
+ * Sets the icon of Icon button <br>
+ * image button means background is image. <br>
+ * icon button means image draws on text field or front of text
+ *
+ * @param img
+ * the icon of icon button
+ */
+ public void setButtonImage(Image img) {
+ attr.setButtonImage(img);
+ }
+
+ /**
+ * Sets the user render of button. <br>
+ * this class has default renderer : DACustomButtonRenderer
+ *
+ * @param newRenderer
+ * user customized renderer
+ * @see DACustomButtonRenderer, DACustomButtonDefaultRenderer
+ */
+ public void setRenderer(IDACustomButtonRenderer newRenderer) {
+ buttonRenderer = newRenderer;
+ }
+
+ /**
+ * Change button state STATE_NORMAL or STATE_DISABLE.
+ *
+ * @param enabled
+ * state of button : true or false
+ */
+ public void setEnabled(boolean enabled) {
+ if (enabled) {
+ changeButtonState(STATE_NORMAL);
+ } else {
+ changeButtonState(STATE_DISABLE);
+ }
+ }
+
+ /**
+ * Gets the state of button enabled or not. <br>
+ * Why not override {@link #isEnabled()}?? <br>
+ * Mac version API {@link #isEnabled()} return false, then cannot catch a
+ * mouse event. <br>
+ * so, we make {@link #isButtonEnabled()} to avoid Mac's Bug!!
+ *
+ * @return if button's state is STATE_DISABLE then returns false, other
+ * state returns true;
+ */
+ public boolean isButtonEnabled() {
+ if (state == STATE_DISABLE) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Sets image button's image.
+ *
+ * @param state
+ * The state of the button you want to set.
+ * @param image
+ * The image of the button you want to set.
+ */
+ public void setImage(int state, Image image) {
+ attr.setImage(state, image);
+ }
+
+ /**
+ * Gets the image of button state
+ *
+ * @param state
+ * The state of the button you want to get.
+ * @return the image of button state.
+ */
+ public Image getImage(int state) {
+ return attr.getImage(state);
+ }
+
+ /**
+ * Sets the color of button state
+ *
+ * @param state
+ * The state of the button you want to set.
+ * @param color
+ * The color of the button you want to set.
+ */
+ public void setColor(int state, Color color) {
+ attr.setColor(state, color);
+ }
+
+ /**
+ * Sets the font of the button text.
+ *
+ * @param font
+ * The font of the button text.
+ */
+ public void setFont(Font font) {
+ attr.setFont(font);
+ }
+
+ /**
+ * Sets the point that indicates the starting point of text drawing.
+ *
+ * @param point
+ * start point of drawing text.
+ */
+ public void setFontPoint(Point point) {
+ attr.setFontPoint(point);
+ }
+
+ /**
+ * Sets the colors of button.
+ *
+ * @param normal
+ * the color of normal state
+ * @param push
+ * the color of push state
+ * @param hover
+ * the color of hover state
+ * @param disable
+ * the color of disable state
+ */
+ public void setColors(Color normal, Color push, Color hover, Color disable) {
+ attr.setColor(STATE_NORMAL, normal);
+ attr.setColor(STATE_PUSH, push);
+ attr.setColor(STATE_HOVER, hover);
+ attr.setColor(STATE_DISABLE, disable);
+ attr.setDrawType(TYPE_COLOR);
+ }
+
+ /**
+ * Sets the images of button
+ *
+ * @param normal
+ * The image of normal state
+ * @param push
+ * The image of push state
+ * @param hover
+ * The image of hover state
+ * @param disable
+ * The image of disable state
+ */
+ public void setImages(Image normal, Image push, Image hover, Image disable) {
+ attr.setImage(STATE_NORMAL, normal);
+ attr.setImage(STATE_PUSH, push);
+ attr.setImage(STATE_HOVER, hover);
+ attr.setImage(STATE_DISABLE, disable);
+ attr.setDrawType(TYPE_IMAGE);
+ }
+
+ /**
+ * Sets the outside outline color of button.
+ *
+ * @param normal
+ * The outline color of normal state.
+ * @param push
+ * The outline color of push state.
+ * @param hover
+ * The outline color of hover state.
+ * @param disable
+ * The outline color of disable state.
+ */
+ public void setOutlineColors(Color normal, Color push, Color hover,
+ Color disable) {
+ attr.setOutlineColor(STATE_NORMAL, normal);
+ attr.setOutlineColor(STATE_PUSH, push);
+ attr.setOutlineColor(STATE_HOVER, hover);
+ attr.setOutlineColor(STATE_DISABLE, disable);
+ }
+
+ /**
+ * Sets the inside outline color of button.
+ *
+ * @param normal
+ * The outline color of normal state.
+ * @param push
+ * The outline color of push state.
+ * @param hover
+ * The outline color of hover state.
+ * @param disable
+ * The outline color of disable state.
+ */
+
+ public void setOutlineInColors(Color normal, Color push, Color hover,
+ Color disable) {
+ attr.setOutlineInColor(STATE_NORMAL, normal);
+ attr.setOutlineInColor(STATE_PUSH, push);
+ attr.setOutlineInColor(STATE_HOVER, hover);
+ attr.setOutlineInColor(STATE_DISABLE, disable);
+ }
+
+ /**
+ * Sets the gradation color of button.
+ *
+ * @param state
+ * The state of the button you want to set.
+ * @param start
+ * The gradation start color of the button you want to set.
+ * @param end
+ * The gradation end color of the button you want to set.
+ */
+ public void setGradationColor(int state, Color start, Color end) {
+ attr.setColor(state * 2, start);
+ attr.setColor(state * 2 + 1, end);
+ }
+
+ /**
+ * Sets the gradation color of button
+ *
+ * @param normalStart
+ * The gradation start color of normal state
+ * @param normalEnd
+ * The gradation end color of normal state
+ * @param pushStart
+ * The gradation start color of push state
+ * @param pushEnd
+ * The gradation end color of push state
+ * @param hoverStart
+ * The gradation start color of hover state
+ * @param hoverEnd
+ * The gradation end color of hover state
+ * @param disableStart
+ * The gradation start color of disable state
+ * @param disableEnd
+ * The gradation end color of disable state
+ */
+ public void setGradation(Color normalStart, Color normalEnd,
+ Color pushStart, Color pushEnd, Color hoverStart, Color hoverEnd,
+ Color disableStart, Color disableEnd) {
+ attr.setColor(0, normalStart);
+ attr.setColor(1, normalEnd);
+ attr.setColor(2, pushStart);
+ attr.setColor(3, pushEnd);
+ attr.setColor(4, hoverStart);
+ attr.setColor(5, hoverEnd);
+ attr.setColor(6, disableStart);
+ attr.setColor(7, disableEnd);
+ attr.setDrawType(TYPE_GRADATION);
+ }
+
+ /**
+ * adds button click listener
+ *
+ * @param listener
+ * user implemented button action listener
+ */
+ public void addClickListener(DACustomButtonClickEventListener listener) {
+ addListener(SWT.MouseUp, listener);
+ }
+
+ /**
+ * Gets the button's state
+ *
+ * @return the state of button.
+ */
+ public int getState() {
+ return state;
+ }
+
+ /**
+ * Sets the font color of button.
+ *
+ * @param normal
+ * The color of normal state
+ * @param push
+ * The color of push state
+ * @param hover
+ * The color of hover state
+ * @param disable
+ * The color of disable state
+ */
+ public void setFontColors(Color normal, Color push, Color hover,
+ Color disable) {
+ attr.setFontColor(STATE_NORMAL, normal);
+ attr.setFontColor(STATE_PUSH, push);
+ attr.setFontColor(STATE_HOVER, hover);
+ attr.setFontColor(STATE_DISABLE, disable);
+ }
+
+ /**
+ * Sets the font color of button.
+ *
+ * @param state
+ * The state of the button you want to set.
+ * @param color
+ * The color of the font you want to set.
+ */
+ public void setFontColor(int state, Color color) {
+ attr.setFontColor(state, color);
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.button;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+
+public class DACustomButtonAttribute {
+ private final int MAX_SIZE = 12;
+ private String text;
+ private Image buttonImage = null;
+ private Font font;
+ private Point fontPoint;
+ private int drawType = DACustomButton.TYPE_COLOR;
+
+ private List<Image> images = new ArrayList<Image>();
+ private List<Color> colors = new ArrayList<Color>();
+ private List<Color> fontColors = new ArrayList<Color>();
+ private List<Color> outlineColors = new ArrayList<Color>();
+ private List<Color> outlineInColors = new ArrayList<Color>();
+
+ public DACustomButtonAttribute() {
+ for (int i = 0; i < MAX_SIZE; i++) {
+ images.add(null);
+ colors.add(null);
+ fontColors.add(null);
+ outlineColors.add(null);
+ outlineInColors.add(null);
+ }
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ public Image getButtonImage() {
+ return buttonImage;
+ }
+
+ public void setButtonImage(Image img) {
+ buttonImage = img;
+ }
+
+ public Font getFont() {
+ return font;
+ }
+
+ public void setFont(Font font) {
+ this.font = font;
+ }
+
+ public Point getFontPoint() {
+ return fontPoint;
+ }
+
+ public void setFontPoint(Point fontPoint) {
+ this.fontPoint = fontPoint;
+ }
+
+ public int getDrawType() {
+ return drawType;
+ }
+
+ public void setDrawType(int type) {
+ drawType = type;
+ }
+
+ public Image getImage(int state) {
+ if (!images.isEmpty()) {
+ return images.get(state);
+ }
+ return null;
+ }
+
+ public void setImage(int state, Image img) {
+ images.set(state, img);
+ }
+
+ public Color getColor(int state) {
+ if (!colors.isEmpty()) {
+ return colors.get(state);
+ }
+ return null;
+ }
+
+ public void setColor(int state, Color color) {
+ colors.set(state, color);
+ }
+
+ public void setFontColor(int state, Color color) {
+ fontColors.set(state, color);
+ }
+
+ public Color getFontColor(int state) {
+ return fontColors.get(state);
+ }
+
+ public void setOutlineColor(int state, Color color) {
+ outlineColors.set(state, color);
+ }
+
+ public Color getOutlineColor(int state) {
+ return outlineColors.get(state);
+ }
+
+ public void setOutlineInColor(int state, Color color) {
+ outlineInColors.set(state, color);
+ }
+
+ public Color getOutlineInColor(int state) {
+ return outlineInColors.get(state);
+ }
+}
--- /dev/null
+/*\r
+ * Dynamic Analyzer\r
+ *\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact: \r
+ * Jooyoul Lee <jy.exe.lee@samsung.com>\r
+ * Juyoung Kim <j0.kim@samsung.com>\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ * \r
+ */\r
+\r
+package org.tizen.dynamicanalyzer.widgets.button;\r
+\r
+import org.eclipse.swt.graphics.Rectangle;\r
+import org.eclipse.swt.widgets.Event;\r
+import org.eclipse.swt.widgets.Listener;\r
+\r
+public abstract class DACustomButtonClickEventListener implements Listener {\r
+\r
+ @Override\r
+ public void handleEvent(Event event) {\r
+ DACustomButton button = (DACustomButton) event.widget;\r
+ if (null != button && button.getState() != DACustomButton.STATE_DISABLE) {\r
+ Rectangle rectangle = button.getBounds();\r
+ int x = event.x;\r
+ int y = event.y;\r
+\r
+ if (x < 0 || x > rectangle.width || y < 0 || y > rectangle.height) {\r
+ return;\r
+ }\r
+ } else {\r
+ return;\r
+ }\r
+\r
+ handleClickEvent(button);\r
+ }\r
+\r
+ public abstract void handleClickEvent(DACustomButton button);\r
+}\r
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.button;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Display;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+
+public class DACustomButtonRenderer implements IDACustomButtonRenderer {
+
+ @Override
+ public void draw(GC gc, Canvas canvas, int state,
+ DACustomButtonAttribute attr) {
+ Rectangle rect = canvas.getClientArea();
+
+ if (attr.getDrawType() == DACustomButton.TYPE_IMAGE) {
+ Image image = attr.getImage(state);
+ if (null == image) {
+ return;
+ }
+
+ gc.drawImage(image, rect.x, rect.y);
+ drawButtonText(gc, rect, attr, state);
+ } else if (attr.getDrawType() == DACustomButton.TYPE_COLOR
+ || attr.getDrawType() == DACustomButton.TYPE_GRADATION) {
+ drawButton(gc, rect, state, attr);
+ }
+ drawButtonImage(gc, rect, attr);
+ }
+
+ public int computeFontSize(Rectangle rect) {
+ if (rect.height > 20)
+ return 10;
+ else
+ return 8;
+ }
+
+ public void drawButton(GC gc, Rectangle rect, int state,
+ DACustomButtonAttribute attr) {
+ if (attr.getDrawType() == DACustomButton.TYPE_COLOR) {
+ gc.setBackground(attr.getColor(state));
+ gc.fillRectangle(rect);
+ } else {
+ int index = state * 2;
+ gc.setForeground(attr.getColor(index));
+ gc.setBackground(attr.getColor(index + 1));
+ gc.fillGradientRectangle(rect.x, rect.y, rect.width, rect.height,
+ true);
+ }
+
+ Rectangle r = new Rectangle(0, 0, rect.width - 1, rect.height - 1);
+ if (attr.getButtonImage() == null) {
+ drawButtonText(gc, r, attr, state);
+ }
+ Color c = gc.getForeground();
+ if (null != attr.getOutlineColor(state)) {
+ gc.setForeground(attr.getOutlineColor(state));
+ } else {
+ gc.setForeground(ColorResources.BLACK);
+ }
+ gc.drawRectangle(r);
+ Rectangle ir = new Rectangle(r.x + 1, r.y + 1, r.width - 2,
+ r.height - 2);
+ if (null != attr.getOutlineInColor(state)) {
+ gc.setForeground(attr.getOutlineInColor(state));
+ } else {
+ gc.setForeground(c);
+ return;
+ }
+ gc.drawRectangle(ir);
+ gc.setForeground(c);
+ }
+
+ protected void drawButtonImage(GC gc, Rectangle rect,
+ DACustomButtonAttribute attr) {
+ if (attr != null && attr.getButtonImage() != null) {
+ Image img = attr.getButtonImage();
+ Rectangle imgRect = img.getBounds();
+ int width = rect.width - imgRect.width;
+ int height = rect.height - imgRect.height;
+ int x = 0, y = 0;
+ if (width > 0) {
+ x = width / 2;
+ }
+
+ if (height > 0) {
+ y = height / 2;
+ }
+ gc.drawImage(img, x, y);
+ }
+ }
+
+ protected void drawButtonText(GC gc, Rectangle rect,
+ DACustomButtonAttribute attr, int state) {
+ String text = null;
+ Font font = null;
+ Point p = null;
+ if (null != (text = attr.getText())) {
+ if (null == (font = attr.getFont())) {
+ font = new Font(Display.getCurrent(), "Arial", //$NON-NLS-1$
+ computeFontSize(rect), SWT.NONE);
+ attr.setFont(font);
+ }
+ gc.setFont(font);
+
+ int x = 0, y = 0;
+ int offset = 0;
+ if (null == (p = attr.getFontPoint())) {
+ p = gc.textExtent(text, SWT.DRAW_MNEMONIC);
+ x = (rect.width - p.x) / 2;
+ y = (rect.height - p.y) / 2;
+ x = (x < 0) ? 0 : x;
+ offset = 0;
+ } else {
+ x = p.x;
+ y = p.y;
+ }
+
+ if (null != attr.getFontColor(state)) {
+ gc.setForeground(attr.getFontColor(state));
+ } else {
+ gc.setForeground(ColorResources.BLACK);
+ }
+
+ if (state == DACustomButton.STATE_PUSH) {
+ x += 1;
+ y += 1;
+ }
+ gc.drawString(text, x + offset, y, true);
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.button;
+
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.widgets.Canvas;
+
+public interface IDACustomButtonRenderer {
+ public void draw(GC gc, Canvas canvas, int state,
+ DACustomButtonAttribute attr);
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.button.checkbox;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.tizen.dynamicanalyzer.widgets.DAWidgetConstants;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
+
+public class DACheckBox extends Canvas {
+ public static final int CHECKBOX_SELECTED = 0;
+ public static final int CHECKBOX_UNSELECTED = 1;
+ public static final int CHECKBOX_UNSELECTED_HOVER = 2;
+ public static final int CHECKBOX_SELECTED_DISABLE = 3;
+ public static final int CHECKBOX_UNSELECTED_DISABLE = 4;
+
+ private int state = CHECKBOX_UNSELECTED;
+ private String text = null;
+
+ public DACheckBox(Composite parent, int style) {
+ super(parent, style);
+ this.addPaintListener(checkboxPaintListener);
+ this.addListener(SWT.MouseEnter, mouseListener);
+ this.addListener(SWT.MouseExit, mouseListener);
+ this.addListener(SWT.MouseUp, mouseListener);
+ text = DAWidgetConstants.EMPTY_STRING;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public void setChecked(boolean checked) {
+ if (checked) {
+ state = CHECKBOX_SELECTED;
+ } else {
+ state = CHECKBOX_UNSELECTED; // FIXME : hover image? - mouse pointer check
+ }
+ }
+
+ public void setCheckboxEnabled(boolean enabled) {
+ if (state == CHECKBOX_SELECTED || state == CHECKBOX_SELECTED_DISABLE) {
+ if (enabled) {
+ state = CHECKBOX_SELECTED;
+ } else {
+ state = CHECKBOX_SELECTED_DISABLE;
+ }
+ } else {
+ if (enabled) {
+ state = CHECKBOX_UNSELECTED;
+ } else {
+ state = CHECKBOX_UNSELECTED_DISABLE;
+ }
+ }
+ redraw();
+ }
+
+ public boolean isCheckboxEnabled() {
+ if (state == CHECKBOX_SELECTED_DISABLE
+ || state == CHECKBOX_UNSELECTED_DISABLE) {
+ return false;
+ }
+ return true;
+ }
+
+ private PaintListener checkboxPaintListener = new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ DACheckBox me = (DACheckBox) e.widget;
+ Rectangle rect = me.getClientArea();
+ Image img = null;
+ if (state == CHECKBOX_SELECTED) {
+ img = ImageResources.CHECKBOX_SELECTED;
+ } else if (state == CHECKBOX_UNSELECTED_HOVER) {
+ img = ImageResources.CHECKBOX_UNSELECTED_HOVER;
+ } else if (state == CHECKBOX_UNSELECTED) {
+ img = ImageResources.CHECKBOX_UNSELECTED;
+ } else if (state == CHECKBOX_UNSELECTED_DISABLE) {
+ img = ImageResources.CHECKBOX_UNSELECTED_DISABLE;
+ } else if (state == CHECKBOX_SELECTED_DISABLE) {
+ img = ImageResources.CHECKBOX_SELECTED_DISABLE;
+ } else {
+ return;
+ }
+ Rectangle imgRect = img.getBounds();
+ int x = 0;
+ int y = (rect.height - imgRect.height) / 2;
+
+ if (null != getBackground()) {
+ e.gc.setBackground(getBackground());
+ }
+ e.gc.fillRectangle(rect);
+ e.gc.drawImage(img, x, y);
+
+ if (state == CHECKBOX_SELECTED_DISABLE
+ || state == CHECKBOX_UNSELECTED_DISABLE) {
+ e.gc.setForeground(ColorResources.CHECKBOX_DISABLED_FONT_COLOR);
+ } else if (null != getForeground()) {
+ e.gc.setForeground(getForeground());
+ } else {
+ e.gc.setForeground(ColorResources.BLACK);
+ }
+
+ int fontHeight = e.gc.getFontMetrics().getHeight();
+ x = imgRect.width + 4;
+ y = (rect.height - fontHeight) / 2;
+ e.gc.drawText(text, x, y);
+ }
+ };
+
+ protected Listener mouseListener = new Listener() {
+
+ @Override
+ public void handleEvent(Event event) {
+ if (state == CHECKBOX_SELECTED_DISABLE
+ || state == CHECKBOX_UNSELECTED_DISABLE) {
+ return;
+ }
+
+ if (event.type == SWT.MouseEnter) {
+ if (state != CHECKBOX_SELECTED) {
+ state = CHECKBOX_UNSELECTED_HOVER;
+ }
+ }
+
+ if (event.type == SWT.MouseExit) {
+ if (state != CHECKBOX_SELECTED) {
+ state = CHECKBOX_UNSELECTED;
+ }
+ }
+
+ if (event.type == SWT.MouseHover) {
+ if (state != CHECKBOX_SELECTED) {
+ state = CHECKBOX_UNSELECTED_HOVER;
+ }
+ }
+
+ if (event.type == SWT.MouseUp) { // FIXME
+ state = CHECKBOX_SELECTED;
+ }
+ redraw();
+ }
+ };
+
+ public void addSelectionListener(DACheckboxSelectionListener listener) {
+ addListener(SWT.MouseUp, listener);
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.button.checkbox;
+
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+
+public abstract class DACheckboxSelectionListener implements Listener {
+
+ @Override
+ public void handleEvent(Event event) {
+ DACheckBox checkbox = (DACheckBox) event.widget;
+ if (checkbox.isCheckboxEnabled()) {
+ handleSelectionEvent(checkbox);
+ }
+ }
+
+ public abstract void handleSelectionEvent(DACheckBox checkbox);
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.button.radio;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.tizen.dynamicanalyzer.widgets.DAWidgetConstants;
+import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
+
+public class DARadioButton extends Canvas {
+ public static final int RADIO_UNSELECTED = 0;
+ public static final int RADIO_SELECTED = 1;
+ public static final int RADIO_UNSELECTED_HOVER = 2;
+
+ private DARadioGroup parent = null;
+ private String text = null;
+ private int state = RADIO_UNSELECTED;
+
+ private Color bgColor = null;
+ private Color fgColor = null;
+
+ public DARadioButton(Composite parent, int style) {
+ super(parent, style);
+ this.addPaintListener(radioPaintListener);
+ this.addListener(SWT.MouseEnter, mouseListener);
+ this.addListener(SWT.MouseExit, mouseListener);
+ this.addListener(SWT.MouseUp, mouseListener);
+ text = DAWidgetConstants.EMPTY_STRING;
+ }
+
+ public void setForeground(Color color) {
+ fgColor = color;
+ }
+
+ public void setBackground(Color color) {
+ bgColor = color;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public void setParent(DARadioGroup parent) {
+ this.parent = parent;
+ }
+
+ public void setSelection(boolean selected) {
+ if (selected) {
+ state = RADIO_SELECTED;
+ } else {
+ state = RADIO_UNSELECTED;
+ }
+ }
+
+ private PaintListener radioPaintListener = new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ DARadioButton me = (DARadioButton) e.widget;
+ Rectangle rect = me.getClientArea();
+ Image img = null;
+ if (state == RADIO_SELECTED) {
+ img = ImageResources.RADIO_SELECTED;
+ } else if (state == RADIO_UNSELECTED_HOVER) {
+ img = ImageResources.RADIO_UNSELECTED_HOVER;
+ } else if (state == RADIO_UNSELECTED) {
+ img = ImageResources.RADIO_UNSELECTED;
+ } else {
+ return;
+ }
+ Rectangle imgRect = img.getBounds();
+ int x = 0;
+ int y = (rect.height - imgRect.height) / 2;
+
+ if (null != bgColor) {
+ e.gc.setBackground(bgColor);
+ }
+ e.gc.fillRectangle(rect);
+ e.gc.drawImage(img, x, y);
+
+ if (null != fgColor) {
+ e.gc.setForeground(fgColor);
+ }
+ int fontHeight = e.gc.getFontMetrics().getHeight();
+ x = imgRect.width + 4;
+ y = (rect.height - fontHeight) / 2;
+ e.gc.drawText(text, x, y);
+ }
+ };
+
+ protected Listener mouseListener = new Listener() {
+
+ @Override
+ public void handleEvent(Event event) {
+ DARadioButton radio = (DARadioButton) event.widget;
+ if (event.type == SWT.MouseEnter) {
+ if (state != RADIO_SELECTED) {
+ state = RADIO_UNSELECTED_HOVER;
+ }
+ }
+
+ if (event.type == SWT.MouseExit) {
+ if (state != RADIO_SELECTED) {
+ state = RADIO_UNSELECTED;
+ }
+ }
+
+ if (event.type == SWT.MouseHover) {
+ if (state != RADIO_SELECTED) {
+ state = RADIO_UNSELECTED_HOVER;
+ }
+ }
+
+ if (event.type == SWT.MouseUp) {
+ parent.setSelection(radio);
+ state = RADIO_SELECTED;
+ }
+ redraw();
+ }
+ };
+
+ public void addSelectionListener(DARadioSelectionListener listener) {
+ addListener(SWT.MouseUp, listener);
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.button.radio;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class DARadioGroup {
+ private int selection = 0;
+ private List<DARadioButton> children = null;
+
+ public void addChild(DARadioButton child) {
+ getChildren().add(child);
+ child.setParent(this);
+ if (getChildren().size() == 1) {
+ setSelection(child);
+ }
+ }
+
+ private List<DARadioButton> getChildren() {
+ if (null == children) {
+ children = new ArrayList<DARadioButton>();
+ }
+ return children;
+ }
+
+ public void setSelection(DARadioButton selection) {
+ int index = getChildren().indexOf(selection);
+ int oldSelect = -1;
+ if (index >= 0) {
+ oldSelect = this.selection;
+ this.selection = index;
+ getChildren().get(oldSelect).setSelection(false);
+ selection.setSelection(true);
+ getChildren().get(oldSelect).redraw();
+ selection.redraw();
+ } else {
+ return;
+ }
+ }
+
+ public DARadioButton getSelection() {
+ return getChildren().get(selection);
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.button.radio;
+
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+
+public abstract class DARadioSelectionListener implements Listener {
+
+ @Override
+ public void handleEvent(Event event) {
+ // TODO Auto-generated method stub
+ handleSelectionEvent((DARadioButton) event.widget);
+ }
+
+ public abstract void handleSelectionEvent(DARadioButton radio);
+}
--- /dev/null
+/*\r
+ * Dynamic Analyzer\r
+ *\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact: \r
+ * Jooyoul Lee <jy.exe.lee@samsung.com>\r
+ * Juyoung Kim <j0.kim@samsung.com>\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ * \r
+ */\r
+\r
+package org.tizen.dynamicanalyzer.widgets.button.toggle;\r
+\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.graphics.Color;\r
+import org.eclipse.swt.graphics.Image;\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.swt.widgets.Event;\r
+import org.eclipse.swt.widgets.Listener;\r
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;\r
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;\r
+\r
+public class DACustomToggleButton extends DACustomButton {\r
+\r
+ public static final int STATE_TOGGLE = 4;\r
+ public static final int STATE_TOGGLE_HOVER = 5;\r
+ public static final int STATE_TOGGLE_PUSH = 6;\r
+ private boolean toggle = false;\r
+ private boolean toggleByButton = false;\r
+\r
+ public DACustomToggleButton(Composite parent, Image normal, Image push,\r
+ Image hover, Image disable, Image toggle, Image toggleHover) {\r
+ super(parent, normal, push, hover, disable);\r
+ buttonRenderer = new DACustomToggleButtonRenderer();\r
+\r
+ attr.setImage(STATE_TOGGLE, toggle);\r
+ attr.setImage(STATE_TOGGLE_HOVER, toggleHover);\r
+ addListeners();\r
+ }\r
+\r
+ public DACustomToggleButton(Composite parent, Image normal, Image push,\r
+ Image hover, Image disable, Image toggle, Image toggleHover,\r
+ Image togglePush) {\r
+ this(parent, normal, push, hover, disable, toggle, toggleHover);\r
+ buttonRenderer = new DACustomToggleButtonRenderer();\r
+\r
+ attr.setImage(STATE_TOGGLE_PUSH, togglePush);\r
+ }\r
+\r
+ public DACustomToggleButton(Composite parent, int style) {\r
+ super(parent, style);\r
+ buttonRenderer = new DACustomToggleButtonRenderer();\r
+ attr.setColor(STATE_TOGGLE, ColorResources.BLUE);\r
+ attr.setColor(STATE_TOGGLE_HOVER, ColorResources.WHITE);\r
+ addListeners();\r
+ }\r
+\r
+ public DACustomToggleButton(Composite parent, Color normalStart,\r
+ Color normalEnd, Color pushStart, Color pushEnd, Color hoverStart,\r
+ Color hoverEnd, Color disableStart, Color disableEnd,\r
+ Color toggleStart, Color toggleEnd, Color toggleHoverStart,\r
+ Color toggleHoverEnd) {\r
+ this(parent, SWT.NONE);\r
+ attr.setColor(0, normalStart);\r
+ attr.setColor(1, normalEnd);\r
+ attr.setColor(2, pushStart);\r
+ attr.setColor(3, pushEnd);\r
+ attr.setColor(4, hoverStart);\r
+ attr.setColor(5, hoverEnd);\r
+ attr.setColor(6, disableStart);\r
+ attr.setColor(7, disableEnd);\r
+ attr.setColor(8, toggleStart);\r
+ attr.setColor(9, toggleEnd);\r
+ attr.setColor(10, toggleHoverStart);\r
+ attr.setColor(11, toggleHoverEnd);\r
+ attr.setDrawType(TYPE_GRADATION);\r
+ }\r
+\r
+ public void setToggled(boolean toggled) {\r
+ toggle = toggled;\r
+ if (toggled) {\r
+ changeButtonState(STATE_TOGGLE);\r
+ } else {\r
+ changeButtonState(STATE_NORMAL);\r
+ }\r
+ }\r
+\r
+ public void setToggled2(boolean toggled) {\r
+ if (!toggleByButton) {\r
+ toggle = toggled;\r
+ if (toggled) {\r
+ changeButtonState(STATE_TOGGLE);\r
+ } else {\r
+ changeButtonState(STATE_NORMAL);\r
+ }\r
+ }\r
+ }\r
+\r
+ public boolean isToggled() {\r
+ return toggle;\r
+ }\r
+\r
+ @Override\r
+ protected void addListeners() {\r
+ if (null != toggleButtonMouseListener) {\r
+ this.addListener(SWT.MouseEnter, toggleButtonMouseListener);\r
+ this.addListener(SWT.MouseExit, toggleButtonMouseListener);\r
+ this.addListener(SWT.MouseDown, toggleButtonMouseListener);\r
+ this.addListener(SWT.MouseUp, toggleButtonMouseListener);\r
+ }\r
+ }\r
+\r
+ private Listener toggleButtonMouseListener = new Listener() {\r
+\r
+ @Override\r
+ public void handleEvent(Event event) {\r
+ if (state == STATE_DISABLE) {\r
+ return;\r
+ }\r
+\r
+ if (event.type == SWT.MouseEnter) {\r
+ if (toggle) {\r
+ changeButtonState(STATE_TOGGLE_HOVER);\r
+ } else {\r
+ changeButtonState(STATE_HOVER);\r
+ }\r
+ }\r
+\r
+ if (event.type == SWT.MouseExit) {\r
+ if (toggle) {\r
+ changeButtonState(STATE_TOGGLE);\r
+ } else {\r
+ changeButtonState(STATE_NORMAL);\r
+ }\r
+ }\r
+\r
+ if (event.type == SWT.MouseDown) {\r
+ if (toggle) {\r
+ if (null != attr.getImage(STATE_TOGGLE_PUSH)) {\r
+ changeButtonState(STATE_TOGGLE_PUSH);\r
+ } else {\r
+ changeButtonState(STATE_PUSH);\r
+ }\r
+ } else {\r
+ changeButtonState(STATE_PUSH);\r
+ }\r
+ }\r
+\r
+ if (event.type == SWT.MouseUp) { // FIXME\r
+ toggle = !toggle;\r
+ toggleByButton = !toggleByButton;\r
+ if (toggle) {\r
+ changeButtonState(STATE_TOGGLE_HOVER);\r
+ } else {\r
+ changeButtonState(STATE_HOVER);\r
+ }\r
+ }\r
+ }\r
+ };\r
+}\r
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.button.toggle;
+
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonRenderer;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonAttribute;
+
+public class DACustomToggleButtonRenderer extends DACustomButtonRenderer {
+
+ @Override
+ public void draw(GC gc, Canvas canvas, int state,
+ DACustomButtonAttribute attr) {
+ Rectangle rect = canvas.getClientArea();
+ if (attr.getDrawType() == DACustomButton.TYPE_IMAGE) {
+ Image image = attr.getImage(state);
+ if (null == image) {
+ return;
+ }
+
+ gc.drawImage(image, rect.x, rect.y);
+ drawButtonText(gc, rect, attr, state);
+ } else if (attr.getDrawType() == DACustomButton.TYPE_COLOR
+ || attr.getDrawType() == DACustomButton.TYPE_GRADATION) {
+ drawButton(gc, rect, state, attr);
+ }
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.widgets.chart;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+
+public class DAChart extends Canvas {
+ private String name;
+ Composite parent = null;
+ private List<DAChartSeries> seriesList = new ArrayList<DAChartSeries>();
+ private DAChartPlot plot = null;
+ private DAChartRenderer chartRenderer = new DAChartRenderer();
+ private boolean bTooltip = false;
+ private Image chartBuffer;
+ public static final int CHART_STYLE_NORMAL=0;
+ public static final int CHART_STYLE_SCREENSHOT=1;
+ public static final int CHART_STYLE_MULTI=2;
+
+ private DAChart(String name, Composite parent) {
+ super(parent, SWT.TRANSPARENT | SWT.DOUBLE_BUFFERED | SWT.NO_BACKGROUND);
+ this.parent = parent;
+ this.name = name;
+ addListeners();
+ }
+ public DAChart(Composite parent, String name) {
+ this(name, parent);
+ plot = new DAChartPlot(this);
+ // TODO Auto-generated constructor stub
+ }
+
+ public DAChart(Composite parent, String name,
+ DAChartSeries series) {
+ this(parent, name);
+ seriesList.add(series);
+
+ // TODO Auto-generated constructor stub
+ }
+
+ public DAChart(Composite parent, String name, int chartStyle) {
+ this(name, parent);
+ switch (chartStyle) {
+ case CHART_STYLE_NORMAL:
+ plot = new DAChartPlot(this);
+ break;
+ case CHART_STYLE_SCREENSHOT:
+ plot = new DAScreenshotChartPlot(this);
+ break;
+ case CHART_STYLE_MULTI:
+ plot = new DAUIEventChartPlot(this);
+ break;
+
+ default:
+ break;
+ }
+
+
+
+ // TODO Auto-generated constructor stub
+ }
+
+ private void addListeners() {
+ this.addPaintListener(chartPaintListener);
+ this.addControlListener(chartControlListener);
+ // showTooltip(true); //FIXME : delete
+ }
+
+ public String getChartName() {
+ return name;
+ }
+
+// public void replacePlot(DACustomChartPlot plot) {
+// this.plot = plot;
+// }
+
+ public DAChartPlot getPlot() {
+ return plot;
+ }
+
+ public List<DAChartSeries> getSeriesList() {
+ return seriesList;
+ }
+
+ public DAChartSeries getSeries(int index) {
+ if (null == seriesList) {
+ return null;
+ }
+ if (seriesList.size() < index) {
+ return null;
+ } else {
+ return seriesList.get(index);
+ }
+ }
+
+ public DAChartSeries getSeries(String name) {
+ if (null == seriesList) {
+ return null;
+ }
+ for (int i = 0; i < seriesList.size(); i++) {
+ DAChartSeries series = seriesList.get(i);
+ if (series.getName().compareTo(name) == 0) {
+ return series;
+ }
+ }
+ return null;
+ }
+
+ public void addSeries(DAChartSeries series) {
+ seriesList.add(series);
+ }
+
+ public void clear() {
+ seriesList.clear();
+ plot.clear();
+ }
+
+ public void contentsClear() {
+ for (int i = 0; i < seriesList.size(); i++) {
+ seriesList.get(i).clear();
+ }
+ }
+
+ private PaintListener chartPaintListener = new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ // TODO Auto-generated method stub
+ redrawChart();
+ chartRenderer.draw(e.gc, (DAChart) e.widget, chartBuffer);
+ }
+ };
+
+ protected void redrawBuffer(){
+ Rectangle rt = getClientArea();
+ if (null != chartBuffer) {
+ chartBuffer.dispose();
+ }
+ if (rt.width > 0 && rt.height > 0) {
+ chartBuffer = new Image(Display.getDefault(), rt.width,
+ rt.height);
+ chartRenderer.drawBuffer(chartBuffer, this);
+ }
+ }
+
+ protected void redrawChart(){
+ int seriesSize = seriesList.size();
+ boolean hasUpdate = false;
+ for(int i=0; i<seriesSize; i++){
+ if(seriesList.get(i).hasUpdate() == true){
+ seriesList.get(i).setUpdate(false);
+ hasUpdate = true;
+ }
+ }
+ if(true == plot.hasUpdate()){
+ plot.setUpdate(false);
+ hasUpdate = true;
+ }
+
+ if(hasUpdate == false){
+ return;
+ }
+ redrawBuffer();
+ }
+
+ public void redrawForce(){
+ redrawBuffer();
+ redraw();
+ }
+
+ private ControlListener chartControlListener = new ControlListener() {
+
+ @Override
+ public void controlMoved(ControlEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void controlResized(ControlEvent e) {
+ // TODO Auto-generated method stub
+ redrawBuffer();
+ }
+ };
+
+ public void showTooltip(boolean show) {
+ if (bTooltip == show) {
+ return;
+ }
+ if (true == show) {
+ this.addListener(SWT.MouseMove, chartTooltipListener);
+ this.addListener(SWT.MouseEnter, chartTooltipListener);
+ this.addListener(SWT.MouseExit, chartTooltipListener);
+ } else {
+ this.removeListener(SWT.MouseMove, chartTooltipListener);
+ this.removeListener(SWT.MouseEnter, chartTooltipListener);
+ this.removeListener(SWT.MouseExit, chartTooltipListener);
+ }
+ }
+
+ private Listener chartTooltipListener = new Listener() {
+
+ @Override
+ public void handleEvent(Event event) {
+
+ switch (event.type) {
+ case SWT.MouseMove:
+ if (null != plot) {
+ DAChartTooltip.getInstance().move();
+ }
+ break;
+ case SWT.MouseEnter:
+ System.out.println("MouseEnter");
+ if (null != plot) {
+ Shell shell = parent.getShell();
+ DAChartTooltip.getInstance().open(shell, plot);
+ }
+ break;
+ case SWT.MouseExit:
+ System.out.println("MouseExit");
+
+ DAChartTooltip.getInstance().close();
+
+ break;
+ default:
+ break;
+ }
+ }
+ };
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.widgets.chart;
+
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+import org.tizen.dynamicanalyzer.widgets.helper.FontResources;
+
+public class DAChartPlot {
+ private double visibleStartX = 0;
+ private double visibleEndX = 0;
+ private double visibleStartY = 0;
+ private double visibleEndY = 0;
+ private double validEndX = 0;
+ private double validEndY = 0;
+ private boolean bAutoHeightRange = false;
+ private boolean bSeriesHeightRange = false;
+ private boolean bShowAxis = false;
+ private Image backgroundImage = null;
+ private DAChart chart;
+ private DAChartPlotIntervalMarker marker = null;
+ private DAChartPlotTooltip tooltip = null;
+ protected boolean hasUpdate = false;
+ private Font axisFont;
+ private String axisUnit;
+
+ private double highlightsStartX = 0;
+ private double highlightsEndX = 0;
+ private Color highlightsColor;
+ private boolean bHighlights = false;
+
+ public DAChartPlot(DAChart chart) {
+ this.chart = chart;
+ }
+
+ public void setChart(DAChart chart) {
+ this.chart = chart;
+ }
+
+ public DAChart getChart() {
+ return chart;
+ }
+
+ public void clear() {
+ visibleStartX = 0;
+ visibleEndX = 0;
+ visibleStartY = 0;
+ visibleEndY = 0;
+ validEndX = 0;
+ validEndY = 0;
+ removeIntervalMarker();
+ removeTooltip();
+ }
+
+ public void setIntervalMarker(DAChartPlotIntervalMarker marker) {
+ this.marker = marker;
+ this.marker.registerChart(chart);
+ }
+
+ public void removeIntervalMarker() {
+ if (null != marker) {
+ this.marker.unRegisterChart(chart);
+ this.marker = null;
+ }
+ }
+
+ public DAChartPlotIntervalMarker getIntervalMarker() {
+ return marker;
+ }
+
+ public void setTooltip(DAChartPlotTooltip tooltip) {
+ this.tooltip = tooltip;
+ this.tooltip.registerChart(chart);
+ }
+
+ public void removeTooltip() {
+ if (null != tooltip) {
+ this.tooltip.unRegisterChart(chart);
+ this.tooltip = null;
+ }
+ }
+
+ public DAChartPlotTooltip getTooltip() {
+ return tooltip;
+ }
+
+ public void setAxisRangeX(double startX, double endX) {
+ setAxisStartX(startX);
+ setAxisEndX(endX);
+ }
+
+ public void setAxisRangeY(double startY, double endY) {
+ setAxisStartY(startY);
+ setAxisEndY(endY);
+ }
+
+ public void setAxisStartX(double startX) {
+ this.visibleStartX = startX;
+ hasUpdate = true;
+ }
+
+ public void setAxisEndX(double endX) {
+ this.visibleEndX = endX;
+ hasUpdate = true;
+ }
+
+ public void setAxisStartY(double startY) {
+ this.visibleStartY = startY;
+ hasUpdate = true;
+ }
+
+ public void setAxisEndY(double endY) {
+ this.visibleEndY = endY;
+ hasUpdate = true;
+ }
+
+ public boolean isAutoHeightRange() {
+ return bAutoHeightRange;
+ }
+
+ public void setAutoHeightRange(boolean auto) {
+ bAutoHeightRange = auto;
+ hasUpdate = true;
+ }
+
+ public boolean isSeriesHeightRange() {
+ return bSeriesHeightRange;
+ }
+
+ public void setSeriesHeightRange(boolean bSeriesHeightRange) {
+ this.bSeriesHeightRange = bSeriesHeightRange;
+ hasUpdate = true;
+ }
+
+ public double getVisibleStartX() {
+ return visibleStartX;
+ }
+
+ public double getVisibleEndX() {
+ return visibleEndX;
+ }
+
+ public double getVisibleStartY() {
+ return visibleStartY;
+ }
+
+ public double getVisibleEndY() {
+ return visibleEndY;
+ }
+
+ public void setBackgroundImage(Image image) {
+ this.backgroundImage = image;
+ hasUpdate = true;
+ }
+
+ public Image getBackgroundImage() {
+ return backgroundImage;
+ }
+
+ public int getXPixcelFromX(double x, Rectangle r) {
+ return (int) (((double) r.width) * (x - visibleStartX) / (visibleEndX - visibleStartX));
+ }
+
+ public int getXPixcelFromX(double x) {
+ Rectangle r = chart.getBounds();
+ return getXPixcelFromX(x, r);
+ }
+
+ public int getYPixcelFromY(DAChartSeries series, double y, Rectangle r) {
+ double endY = 0;
+ if (true == bSeriesHeightRange) {
+ if (true == bAutoHeightRange) {
+ endY = series.getMaxY() * 1.1;
+ } else {
+ endY = series.getEndY() * 1.1;
+ }
+ } else {
+ endY = this.visibleEndY;
+ }
+
+ double pixcelY;
+ if (visibleStartY == endY) {
+ pixcelY = 0;
+ } else {
+ pixcelY = ((double) r.height) * (y - visibleStartY)
+ / (endY - visibleStartY);
+ }
+ return (int) (r.height - pixcelY);
+ }
+
+ public int getYPixcelFromY(DAChartSeries series, double y) {
+ Rectangle r = chart.getBounds();
+ return getYPixcelFromY(series, y, r);
+ }
+
+ public double getXFromXPixcel(int xPixcel, Rectangle r) {
+ return (((visibleEndX - visibleStartX) * (double) xPixcel) / (double) r.width)
+ + visibleStartX;
+ }
+
+ public double getXFromXPixcel(int xPixcel) {
+ Rectangle r = chart.getBounds();
+ return getXFromXPixcel(xPixcel, r);
+ }
+
+ public double getYFromYPixcel(int yPixcel, Rectangle r) {
+ int y = yPixcel + r.height + 1;
+ return (((visibleEndY - visibleStartY) * (double) y) / (double) r.height)
+ + visibleStartY;
+ }
+
+ public double getYFromYPixcel(int yPixcel) {
+ Rectangle r = chart.getBounds();
+ return getYFromYPixcel(yPixcel, r);
+ }
+
+ public double getValidEndX() {
+ return validEndX;
+ }
+
+ public void setValidEndX(double validEndX) {
+ this.validEndX = validEndX;
+ hasUpdate = true;
+ }
+
+ public double getValidEndY() {
+ return validEndY;
+ }
+
+ public void setValidEndY(double validEndY) {
+ this.validEndY = validEndY;
+ hasUpdate = true;
+ }
+
+ protected boolean hasUpdate() {
+ return hasUpdate;
+ }
+
+ protected void setUpdate(boolean bUpdate) {
+ hasUpdate = bUpdate;
+ }
+
+ protected boolean isHilights() {
+ return bHighlights;
+ }
+
+ protected double getHighlightsStartX() {
+ return highlightsStartX;
+ }
+
+ protected double getHighlightsEndX() {
+ return highlightsEndX;
+ }
+
+ protected Color getHighlightsColor() {
+ if (null == highlightsColor) {
+ highlightsColor = ColorResources.YELLOW;
+ }
+ return highlightsColor;
+ }
+
+ public void setHightlightsColor(Color color) {
+ highlightsColor = color;
+ }
+
+ public void setHightlights(double startX, double endX) {
+ highlightsStartX = startX;
+ highlightsEndX = endX;
+ if (highlightsStartX == -1 && highlightsEndX == -1) {
+ bHighlights = false;
+ } else {
+ bHighlights = true;
+ }
+ }
+
+ public void unsetHightlights() {
+ bHighlights = false;
+ }
+
+ public boolean isShowAxis() {
+ return bShowAxis;
+ }
+
+ public void setShowAxis(boolean bShowAxis) {
+ this.bShowAxis = bShowAxis;
+ }
+
+ public Font getAxisFont() {
+ if (null == axisFont) {
+ axisFont = FontResources.CHART_AXIS_FONT;
+ }
+ return axisFont;
+ }
+
+ public void setAxisFont(Font axisFont) {
+ this.axisFont = axisFont;
+ }
+
+ public String getAxisUnit() {
+ return axisUnit;
+ }
+
+ public void setAxisUnit(String axisUnit) {
+ this.axisUnit = axisUnit;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.widgets.chart;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Display;
+
+public class DAChartPlotIntervalMarker {
+ private double startVal;
+ private double endVal;
+ private int alpha = (int) (255*0.25); //default
+ private Color backgroundColor;
+ private Color foregroundColor;
+ private List<DAChart> charts = new ArrayList<DAChart>();
+
+ public DAChartPlotIntervalMarker(double start, double end){
+ startVal = start;
+ endVal = end;
+ }
+
+ public List<DAChart> getRegisteChartList(){
+ return charts;
+ }
+
+ public void registerChart(DAChart chart){
+ charts.add(chart);
+ }
+
+ public void unRegisterChart(DAChart chart){
+ for(int i=0; i<charts.size(); i++){
+ if(charts.get(i).equals(chart)){
+ charts.remove(i);
+ }
+ }
+ }
+
+ private void redrawRegisteredChart(){
+ for(int i=charts.size()-1; i>=0; i--){
+ if(charts.get(i).isDisposed()){
+ charts.remove(i);
+ }
+ else{
+ charts.get(i).redraw();
+ }
+ }
+ }
+
+ public void setInterval(double start, double end){
+ startVal = start;
+ endVal = end;
+ redrawRegisteredChart();
+ }
+
+ public double getStartVal() {
+ return startVal;
+ }
+
+ public void setStartVal(double startVal) {
+ this.startVal = startVal;
+ redrawRegisteredChart();
+ }
+
+ public double getEndVal() {
+ return endVal;
+ }
+
+ public void setEndVal(double endVal) {
+ this.endVal = endVal;
+ redrawRegisteredChart();
+ }
+
+ public int getAlpha() {
+ return alpha;
+ }
+
+ public void setAlpha(int alpha) {
+ this.alpha = alpha;
+ redrawRegisteredChart();
+ }
+
+ public Color getBackgroundColor() {
+ if (null == backgroundColor) {
+ backgroundColor = new Color(Display.getCurrent(), 23, 98, 132);
+ }
+ return backgroundColor;
+ }
+
+ public void setBackgroundColor(Color backgroundColor) {
+ this.backgroundColor = backgroundColor;
+ redrawRegisteredChart();
+ }
+
+ public Color getForegroundColor() {
+ return foregroundColor;
+ }
+
+ public void setForegroundColor(Color foregroundColor) {
+ this.foregroundColor = foregroundColor;
+ redrawRegisteredChart();
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.widgets.chart;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.widgets.Display;
+import org.tizen.dynamicanalyzer.widgets.helper.FontResources;
+
+public class DAChartPlotTooltip {
+ public static final int TOOLTIP_MARGIN = 4;
+ public static final int TOOLTIP_TIME_MARGIN = 20;
+ public static final int TOOLTIP_HEIGHT = 18;
+ public static final int TOOLTIP_SERIES_RECT_LENGTH = 10;
+ public static final int TOOLTIP_SHOW_MIN = 50;
+ private boolean bTooltip = false;
+ private double startVal;
+ private double yPosRatio;
+ private Color backgroundColor;
+ private Color foregroundColor;
+ private Color lineColor;
+ private Color textColor;
+ private Color timeColor;
+ private Font font;
+ private List<DAChart> charts = new ArrayList<DAChart>();
+
+ public DAChartPlotTooltip(double start){
+ setStartVal(start);
+ }
+
+ public List<DAChart> getRegisteChartList(){
+ return charts;
+ }
+
+ public void registerChart(DAChart chart){
+ charts.add(chart);
+ }
+
+ public void unRegisterChart(DAChart chart){
+ for(int i=0; i<charts.size(); i++){
+ if(charts.get(i).equals(chart)){
+ charts.remove(i);
+ }
+ }
+ }
+
+ private void redrawRegisteredChart(){
+ for(int i=0; i<charts.size(); i++){
+ if(charts.get(i).isDisposed()){
+ charts.remove(i);
+ }
+ else{
+ charts.get(i).redraw();
+ }
+ }
+ }
+
+ public Color getBackgroundColor() {
+ if (null == backgroundColor) {
+ backgroundColor = new Color(Display.getCurrent(), 204, 228, 247);
+ }
+ return backgroundColor;
+ }
+
+ public void setBackgroundColor(Color backgroundColor) {
+ this.backgroundColor = backgroundColor;
+ if(true == bTooltip){
+ redrawRegisteredChart();
+ }
+ }
+
+ public Color getForegroundColor() {
+ if (null == foregroundColor) {
+ foregroundColor = new Color(Display.getCurrent(), 240, 249, 255);
+ }
+ return foregroundColor;
+ }
+
+ public void setForegroundColor(Color foregroundColor) {
+ this.foregroundColor = foregroundColor;
+ if(true == bTooltip){
+ redrawRegisteredChart();
+ }
+ }
+
+ public Color getLineColor() {
+ if (null == lineColor) {
+ lineColor = new Color(Display.getCurrent(), 0, 0, 0);
+ }
+ return lineColor;
+ }
+
+ public void setLineColor(Color lineColor) {
+ this.lineColor = lineColor;
+ if(true == bTooltip){
+ redrawRegisteredChart();
+ }
+ }
+
+ public Color getTextColor() {
+ if (null == textColor) {
+ textColor = new Color(Display.getCurrent(), 50, 50, 50);
+ }
+ return textColor;
+ }
+
+ public void setTextColor(Color textColor) {
+ this.textColor = textColor;
+ if(true == bTooltip){
+ redrawRegisteredChart();
+ }
+ }
+
+ public Color getTimeColor() {
+ if (null == timeColor) {
+ timeColor = new Color(Display.getCurrent(), 120, 147, 185);
+ }
+ return timeColor;
+ }
+
+ public void setTimeColor(Color timeColor) {
+ this.timeColor = timeColor;
+ if(true == bTooltip){
+ redrawRegisteredChart();
+ }
+ }
+
+ public Font getFont() {
+ if(null == font){
+ font = FontResources.TIMELINE_FONT;
+ }
+ return font;
+ }
+
+ public void setFont(Font font) {
+ this.font = font;
+ if(true == bTooltip){
+ redrawRegisteredChart();
+ }
+ }
+
+ public double getStartVal() {
+ return startVal;
+ }
+
+ public void setStartVal(double startVal) {
+ this.startVal = startVal;
+ if(true == bTooltip){
+ redrawRegisteredChart();
+ }
+ }
+
+ public double getYPosRatio() {
+ return yPosRatio;
+ }
+
+ public void setYPosRatio(double yPosRatio) {
+ this.yPosRatio = yPosRatio;
+ if(true == bTooltip) {
+ redrawRegisteredChart();
+ }
+ }
+
+ public boolean isTooltip() {
+ return bTooltip;
+ }
+
+ public void setTooltip(boolean show) {
+ this.bTooltip = show;
+ redrawRegisteredChart();
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.widgets.chart;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Display;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+import org.tizen.dynamicanalyzer.widgets.helper.Formatter;
+import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
+
+public class DAChartRenderer {
+ private final int MARGIN = 3;
+ private final int ARROW_MARGIN = 2;
+ private final int EVENT_WIDTH = 2;
+ private final double EVENT_HEIGHT_MARGIN_RATIO = 0.20;
+ private final double LOAD_HEIGHT_MARGIN_RATIO = 0.20;
+ private boolean bInitialized = false;
+ private List<DAChartSeries> seriesList = null;
+ private DAChartPlot plot = null;
+ private Rectangle r = null;
+
+ // private final int SCREENSHOT_HORIZONTAL_TOP_MARGIN = 13;
+ private final int SCREENSHOT_Y_POSITION_MINI = 4;
+ private final int SCREENSHOT_SELECTED_Y_POSITION = 4;
+ private final int SCREENSHOT_SELECTED_Y_POSITION_MINI = 1;
+ // private final int SCREENSHOT_HORIZONTAL_SELECTED_MOVE_SIZE = 19;
+ private final int SCREENSHOT_SELECTED_LINE_WIDTH = 2;
+ private final int SCREENSHOT_BORDER_LINE_WIDTH = 1;
+
+ private final int MULTY_CHECK_BAR_WIDTH = 2;
+
+ private final int AXIS_LINE_WIDTH = 4;
+ private final int AXIS_MARGIN = 2;
+
+ public void draw(GC gc, DAChart chart, Image buffer) {
+ if (false == bInitialized) {
+ initialize(gc, chart);
+ }
+ this.plot = chart.getPlot();
+ r = chart.getClientArea();
+
+ // draw buffer
+ if (null == buffer) {
+ Image backImage = plot.getBackgroundImage();
+ if (null != backImage) {
+ Rectangle rect = backImage.getBounds();
+ gc.drawImage(backImage, rect.x, rect.y, rect.width,
+ rect.height, r.x, r.y, r.width, r.height);
+ }
+ } else {
+ gc.drawImage(buffer, 0, 0);
+ }
+
+ if (r.height > DAChartPlotTooltip.TOOLTIP_SHOW_MIN) {
+ drawTooltip(gc);
+ }
+ drawHighlights(gc);
+ drawRange(gc);
+ }
+
+ private void drawToGc(GC gc, DAChart chart) {
+ if (false == bInitialized) {
+ initialize(gc, chart);
+ }
+ this.plot = chart.getPlot();
+ r = chart.getClientArea();
+
+ // draw background Image
+ Image backImage = plot.getBackgroundImage();
+ if (null != backImage) {
+ Rectangle rect = backImage.getBounds();
+ gc.drawImage(backImage, rect.x, rect.y, rect.width, rect.height,
+ r.x, r.y, r.width, r.height);
+ }
+
+ if (null != seriesList) {
+ int seriesSize = seriesList.size();
+ DAChartSeries series;
+
+ if (true == plot.isAutoHeightRange()) {
+ double maxY = 0;
+ for (int i = 0; i < seriesSize; i++) {
+ double tempY = seriesList.get(i).getMaxY();
+ if (maxY < tempY) {
+ maxY = tempY;
+ }
+ }
+ if (maxY * 1.1 > plot.getVisibleEndY() * 1.1) {
+ plot.setAxisEndY(maxY * 1.1);
+ }
+ }
+
+ for (int i = 0; i < seriesSize; i++) {
+ series = seriesList.get(i);
+ switch (series.getStyle()) {
+ case DAChartSeries.SERIES_STYLE_EVENT:
+ drawEventSeries(gc, series);
+ break;
+ case DAChartSeries.SERIES_STYLE_EVENT_AREA:
+ drawEventAreaSeries(gc, series);
+ break;
+ case DAChartSeries.SERIES_STYLE_BAR:
+ drawBarSeries(gc, series);
+ break;
+ case DAChartSeries.SERIES_STYLE_NONE:
+ case DAChartSeries.SERIES_STYLE_LINE:
+ drawLineSeries(gc, series, false);
+ break;
+ case DAChartSeries.SERIES_STYLE_AREA:
+ drawAreaSeries(gc, series, false);
+ break;
+ case DAChartSeries.SERIES_STYLE_MULTY_CHECK_BAR:
+ drawMultyCheckBarSeries(gc, series, seriesSize, i);
+ break;
+ case DAChartSeries.SERIES_STYLE_STEP:
+ drawStepSeries(gc, series, true);
+ break;
+ case DAChartSeries.SERIES_STYLE_IMAGE:
+ drawImageSeries(gc, series);
+ break;
+ case DAChartSeries.SERIES_STYLE_LOAD:
+ drawLoadSeries(gc, series);
+ break;
+ case DAChartSeries.SERIES_STYLE_ARROW:
+ drawArrowSeries(gc, series);
+ break;
+ case DAChartSeries.SERIES_STYLE_STATE:
+ drawStateSeries(gc, series);
+ break;
+ case DAChartSeries.SERIES_STYLE_LAST_CONTINUE_STEP:
+ drawStepSeries(gc, series, false);
+ break;
+ default:
+ System.out.println("Undefined series style");
+ break;
+ }
+ }
+ if (true == plot.isShowAxis()) {
+ if (true == plot.isSeriesHeightRange()) {
+ for (int i = 0; i < seriesSize; i++) {
+ series = seriesList.get(i);
+ if (0 == i) {
+ drawAxis(gc, r, 0, series.getEndY(), true);
+ } else if (1 == i) {
+ drawAxis(gc, r, 0, series.getEndY(), false);
+ } else {
+ break;
+ }
+ }
+ } else {
+ drawAxis(gc, r, plot.getVisibleStartY(),
+ plot.getVisibleEndY(), true);
+ }
+ }
+ }
+ }
+
+ public void draw(GC gc, DAChart chart) {
+ drawToGc(gc, chart);
+ if (r.height > DAChartPlotTooltip.TOOLTIP_SHOW_MIN) {
+ drawTooltip(gc);
+ }
+ drawRange(gc);
+ }
+
+ public void drawBuffer(Image buffer, DAChart chart) {
+ GC bufGc = new GC(buffer);
+ drawToGc(bufGc, chart);
+ bufGc.dispose();
+ }
+
+ // FIXME : current chart axis is based on byte value(less than 1000)
+ private void drawAxis(GC gc, Rectangle rt, double min, double max,
+ boolean bPosRight) {
+ Color oldCol = gc.getForeground();
+ gc.setForeground(ColorResources.CHART_AXIS);
+
+ Font axisFont = plot.getAxisFont();
+ String axisUnit = plot.getAxisUnit();
+ gc.setFont(axisFont);
+
+ String text;
+ int textX;
+ int textHeight;
+
+ int x1 = 1;
+ int x2 = AXIS_LINE_WIDTH;
+
+ if (true == bPosRight) {
+ x1 = rt.width - 1;
+ x2 = rt.width - AXIS_LINE_WIDTH;
+ }
+ gc.drawLine(x1, 0, x1, rt.height);
+
+ gc.drawLine(x1, rt.height - 1, x2, rt.height - 1);
+ text = Formatter.toByteFormatConvert(min);
+ if (null != axisUnit) {
+ text += axisUnit;
+ }
+ textHeight = gc.textExtent(text).y;
+ if (true == bPosRight) {
+ textX = x1 - gc.textExtent(text).x - AXIS_MARGIN - AXIS_LINE_WIDTH;
+ } else {
+ textX = AXIS_MARGIN + AXIS_LINE_WIDTH;
+ }
+ gc.drawText(text, textX, rt.height - textHeight, true);
+
+ gc.drawLine(x1, rt.height / 2, x2, rt.height / 2);
+ text = Formatter.toByteFormatConvert((min + max) / 2);
+ if (null != axisUnit) {
+ text += axisUnit;
+ }
+ textHeight = gc.textExtent(text).y;
+ if (true == bPosRight) {
+ textX = x1 - gc.textExtent(text).x - AXIS_MARGIN - AXIS_LINE_WIDTH;
+ }
+ gc.drawText(text, textX, rt.height / 2 - textHeight / 2, true);
+
+ gc.drawLine(x1, 0, x2, 0);
+ text = Formatter.toByteFormatConvert(max);
+ if (null != axisUnit) {
+ text += axisUnit;
+ }
+ textHeight = gc.textExtent(text).y;
+ if (true == bPosRight) {
+ textX = x1 - gc.textExtent(text).x - AXIS_MARGIN - AXIS_LINE_WIDTH;
+ }
+ gc.drawText(text, textX, 1, true);
+
+ gc.setForeground(oldCol);
+ }
+
+ private void initialize(GC gc, DAChart chart) {
+ this.seriesList = chart.getSeriesList();
+ bInitialized = true;
+ }
+
+ public void drawRange(GC gc) {
+ DAChartPlotIntervalMarker marker = plot.getIntervalMarker();
+ if (null == marker) {
+ return;
+ }
+ int pixcelStartX = plot.getXPixcelFromX(marker.getStartVal());
+ int pixcelEndX = plot.getXPixcelFromX(marker.getEndVal());
+
+ Color color = marker.getBackgroundColor();
+ int alpha = gc.getAlpha();
+ gc.setAlpha(marker.getAlpha());
+ if (pixcelStartX == pixcelEndX) {
+ gc.setForeground(color);
+ gc.setLineWidth(2);
+ gc.drawLine(pixcelStartX, r.y, pixcelStartX, r.height);
+ } else {
+ gc.setBackground(color);
+ gc.fillRectangle(pixcelStartX, 0, pixcelEndX - pixcelStartX,
+ r.height);
+ }
+ gc.setAlpha(alpha);
+ }
+
+ public void drawHighlights(GC gc) {
+ if (false == plot.isHilights()) {
+ return;
+ }
+ int pixcelStartX = plot.getXPixcelFromX(plot.getHighlightsStartX());
+ int pixcelEndX = plot.getXPixcelFromX(plot.getHighlightsEndX());
+
+ Color color = plot.getHighlightsColor();
+ int alpha = gc.getAlpha();
+ gc.setAlpha(50);
+
+ if (pixcelStartX == pixcelEndX) {
+ gc.setForeground(color);
+ gc.setLineWidth(2);
+ gc.drawLine(pixcelStartX, r.y, pixcelStartX, r.height);
+ } else {
+ gc.setBackground(color);
+ gc.fillRectangle(pixcelStartX, 0, pixcelEndX - pixcelStartX,
+ r.height);
+ }
+
+ gc.setAlpha(alpha);
+ }
+
+ private int getTooltipStartX(double startVal, int width, int margin) {
+ int ret = plot.getXPixcelFromX(startVal);
+ if (ret + width > r.x + r.width) {
+ ret = ret - width - margin;
+ } else if (ret < r.x) {
+ ret = r.x + margin;
+ } else {
+ ret += margin;
+ }
+
+ return ret;
+ }
+
+ private String toTimeFormat(double sec) {
+ String ret;
+ int second = (int) sec;
+ int ms = ((int) (sec * 10)) % 10;
+ if (second > 3600) {
+ ret = String.format("%d:%02d:%02d.", second / 36000,
+ (second % 3600) / 6000, second % 6000);
+ } else {
+ ret = String.format("%02d:%02d", second / 60, second % 60);
+ }
+
+ if (ms != 0) {
+ ret = ret + "." + String.valueOf(ms);
+ }
+
+ return ret;
+ }
+
+ private boolean checkOverlapFromPrevItem(DAChartSeries series, int index) {
+ double val = series.getSeriesItemList().get(index).getX();
+ double prevVal;
+
+ if (index <= 0) {
+ return false;
+ }
+
+ prevVal = series.getSeriesItemList().get(index - 1).getX();
+
+ int pixcelStartX = plot.getXPixcelFromX(val, r);
+ int pixcelStartPrevX = plot.getXPixcelFromX(prevVal, r);
+
+ if (pixcelStartPrevX + EVENT_WIDTH >= pixcelStartX) {
+ return true;
+ }
+ return false;
+ }
+
+ public void drawTooltip(GC gc) {
+ if (plot instanceof DAScreenshotChartPlot) {
+ return;
+ }
+
+ DAChartPlotTooltip tooltip = plot.getTooltip();
+ if (null == tooltip || false == tooltip.isTooltip()
+ || -1 == tooltip.getStartVal()) {
+ return;
+ }
+
+ gc.setFont(tooltip.getFont());
+
+ List<String> tooltipTexts = new ArrayList<String>();
+ List<String> tooltipTimes = new ArrayList<String>();
+ List<Color> tooltipColor = new ArrayList<Color>();
+
+ // make text,time & draw auxiliary line
+ int textWidthMax = 0;
+ int textHeightMax = 0;
+ double realXVal = tooltip.getStartVal();
+ for (int i = 0; i < seriesList.size(); i++) {
+ if (plot instanceof DAUIEventChartPlot) {
+ i = (int) (seriesList.size() * tooltip.getYPosRatio());
+ }
+
+ DAChartSeries series = seriesList.get(i);
+ int index = series.getPrevIndexByXvalue(realXVal);
+ String text = "";
+ String time = "";
+ Color color;
+ if (index >= 0) {
+ double yVal = series.getSeriesItemList().get(index).getY();
+ double xVal = series.getSeriesItemList().get(index).getX();
+
+ if (!(plot instanceof DAUIEventChartPlot)) {
+ text += series.getName() + ": ";
+ time += toTimeFormat(xVal);
+ }
+
+ if (true == series.isSummarizeTooltip()
+ && true == checkOverlapFromPrevItem(series, index)) {
+ text += series.getSummarizeString();
+ } else {
+ text += series.getSeriesItemList().get(index)
+ .getTooltipText();
+ }
+
+ gc.setForeground(tooltip.getLineColor());
+ gc.setLineStyle(SWT.LINE_DOT);
+ gc.setLineWidth(1);
+
+ if (series.getStyle() == DAChartSeries.SERIES_STYLE_BAR
+ || series.getStyle() == DAChartSeries.SERIES_STYLE_LINE
+ || series.getStyle() == DAChartSeries.SERIES_STYLE_AREA) {
+ gc.drawLine(0, plot.getYPixcelFromY(series, yVal, r),
+ r.width, plot.getYPixcelFromY(series, yVal, r));
+ }
+
+ gc.drawLine(plot.getXPixcelFromX(xVal), 0,
+ plot.getXPixcelFromX(xVal), r.height);
+ gc.setLineStyle(SWT.LINE_CUSTOM);
+
+ // event color
+ color = series.getSeriesItemList().get(index).getEventColor();
+ } else {
+ text = series.getName();
+ color = null;
+ }
+
+ tooltipTexts.add(text);
+ tooltipTimes.add(time);
+ tooltipColor.add(color);
+
+ int textWidth = gc.textExtent(text).x
+ + DAChartPlotTooltip.TOOLTIP_TIME_MARGIN
+ + gc.textExtent(time).x;
+ int textHeight = gc.textExtent(text).y;
+ if (textWidthMax < textWidth) {
+ textWidthMax = textWidth;
+ }
+ if (textHeightMax < textHeight) {
+ textHeightMax = textHeight;
+ }
+
+ if (plot instanceof DAUIEventChartPlot) {
+ break;
+ }
+ }
+
+ int preTextWidthMargin = DAChartPlotTooltip.TOOLTIP_MARGIN
+ + DAChartPlotTooltip.TOOLTIP_SERIES_RECT_LENGTH
+ + DAChartPlotTooltip.TOOLTIP_MARGIN;
+ int startX = getTooltipStartX(realXVal, textWidthMax
+ + preTextWidthMargin, DAChartPlotTooltip.TOOLTIP_MARGIN);
+
+ int totalHeight;
+ if (plot instanceof DAUIEventChartPlot) {
+ totalHeight = textHeightMax + DAChartPlotTooltip.TOOLTIP_MARGIN
+ + DAChartPlotTooltip.TOOLTIP_MARGIN;
+ } else {
+ totalHeight = seriesList.size() * textHeightMax
+ + DAChartPlotTooltip.TOOLTIP_MARGIN
+ + DAChartPlotTooltip.TOOLTIP_MARGIN;
+ }
+
+ int startY;
+ if (plot instanceof DAUIEventChartPlot) {
+ startY = (int) (r.height
+ * (int) (tooltip.getYPosRatio() * seriesList.size()) / seriesList
+ .size());
+ if (r.height - startY - totalHeight < 0) {
+ startY = r.height - totalHeight - 1;
+ if (startY < 0) {
+ startY = 0;
+ }
+ }
+
+ } else {
+ startY = (r.y + r.height / 2) - (totalHeight / 2);
+ }
+ gc.setAlpha(150);
+ gc.setBackground(tooltip.getBackgroundColor());
+ gc.setForeground(tooltip.getForegroundColor());
+ gc.fillGradientRectangle(startX, startY, preTextWidthMargin
+ + textWidthMax + DAChartPlotTooltip.TOOLTIP_MARGIN,
+ totalHeight, true);
+ gc.setAlpha(255);
+ gc.setForeground(tooltip.getLineColor());
+ gc.drawRoundRectangle(startX, startY, preTextWidthMargin + textWidthMax
+ + DAChartPlotTooltip.TOOLTIP_MARGIN, totalHeight, 5, 5);
+ gc.setFont(tooltip.getFont());
+
+ String timeStr;
+ for (int i = 0; i < seriesList.size(); i++) {
+ int y = startY + (textHeightMax * i)
+ + DAChartPlotTooltip.TOOLTIP_MARGIN;
+ DAChartSeries series;
+ if (plot instanceof DAUIEventChartPlot) {
+ series = seriesList.get((int) (seriesList.size() * tooltip
+ .getYPosRatio()));
+ } else {
+ series = seriesList.get(i);
+ }
+ Color col = tooltipColor.get(i);
+ if (col == null) {
+ gc.setBackground(series.getColor());
+ } else {
+ gc.setBackground(col);
+ }
+ gc.fillRectangle(startX + DAChartPlotTooltip.TOOLTIP_MARGIN, y
+ + textHeightMax / 2
+ - DAChartPlotTooltip.TOOLTIP_SERIES_RECT_LENGTH / 2,
+ DAChartPlotTooltip.TOOLTIP_SERIES_RECT_LENGTH,
+ DAChartPlotTooltip.TOOLTIP_SERIES_RECT_LENGTH);
+ gc.setBackground(tooltip.getBackgroundColor());
+
+ gc.setForeground(tooltip.getTextColor());
+ gc.drawText(tooltipTexts.get(i), startX
+ + DAChartPlotTooltip.TOOLTIP_MARGIN
+ + DAChartPlotTooltip.TOOLTIP_SERIES_RECT_LENGTH
+ + DAChartPlotTooltip.TOOLTIP_MARGIN, y, SWT.DRAW_DELIMITER
+ | SWT.DRAW_TRANSPARENT);
+
+ gc.setForeground(tooltip.getTimeColor());
+ timeStr = tooltipTimes.get(i);
+ gc.drawText(
+ tooltipTimes.get(i),
+ startX + DAChartPlotTooltip.TOOLTIP_MARGIN
+ + DAChartPlotTooltip.TOOLTIP_SERIES_RECT_LENGTH
+ + DAChartPlotTooltip.TOOLTIP_MARGIN + textWidthMax
+ - DAChartPlotTooltip.TOOLTIP_MARGIN
+ - gc.textExtent(timeStr).x, y, SWT.DRAW_DELIMITER
+ | SWT.DRAW_TRANSPARENT);
+ if (plot instanceof DAUIEventChartPlot) {
+ break;
+ }
+ }
+ }
+
+ private void drawBarSeries(GC gc, DAChartSeries series) {
+ List<DAChartSeriesItem> seriesItems = series.getSeriesItemList();
+ if (null == seriesItems) {
+ return;
+ }
+
+ int seriesItemSize = seriesItems.size();
+
+ if (seriesItemSize < 1) {
+ return;
+ }
+
+ DAChartSeriesItem seriesItem;
+ Color color = series.getColor();
+ gc.setBackground(color);
+ gc.setAlpha((int) (255 * 0.8));
+ gc.setAntialias(SWT.ON);
+
+ int index = series.getPrevIndexByXvalue(plot.getVisibleStartX());
+ if (index < 0) {
+ index = 0;
+ }
+ for (int i = index; i < seriesItemSize; i++) {
+ seriesItem = seriesItems.get(i);
+
+ double barWidthTime = 0;
+ if (seriesItem.getBarWidth() == -1) {
+ barWidthTime = series.getBarWidth();
+ } else {
+ barWidthTime = seriesItem.getBarWidth();
+ }
+
+ double currentX = seriesItem.getX();
+
+ int pixcelStartX = plot.getXPixcelFromX(seriesItem.getX(), r);
+ int pixcelStartY = plot.getYPixcelFromY(series, seriesItem.getY(),
+ r);
+
+ int barWidth = plot.getXPixcelFromX(currentX + barWidthTime, r)
+ - pixcelStartX;
+
+ if (barWidth < 1) {
+ barWidth = 1;
+ }
+
+ color = seriesItem.getEventColor();
+ if (null != color) {
+ gc.setBackground(color);
+ gc.fillRectangle(pixcelStartX, pixcelStartY, barWidth, r.y
+ + r.height - pixcelStartY);
+ gc.setBackground(series.getColor());
+ } else {
+ gc.fillRectangle(pixcelStartX, pixcelStartY, barWidth, r.y
+ + r.height - pixcelStartY);
+ }
+ if (currentX > plot.getVisibleEndX()) {
+ break;
+ }
+ }
+ gc.setAlpha(255);
+ }
+
+ private void drawMultyCheckBarSeries(GC gc, DAChartSeries series,
+ int seriesSize, int seriesIndex) {
+ List<DAChartSeriesItem> seriesItems = series.getSeriesItemList();
+ if (null == seriesItems) {
+ return;
+ }
+
+ int seriesItemSize = seriesItems.size();
+ Rectangle rect = new Rectangle(r.x, r.y
+ + (r.height / seriesSize * seriesIndex), r.width, r.height
+ / seriesSize);
+ if (r.height == DAChartBoard.DEFAULT_CHART_ZOOMIN_HEIGHT - 1) {
+ gc.setForeground(ColorResources.UI_EVENT_CHART_TEXT);
+ Font tempFont = gc.getFont();
+ Font multiCheckBarFont = series.getFont();
+ gc.setFont(multiCheckBarFont);
+ gc.drawText(series.getName(), rect.x + 3, rect.y + 3, true);
+ gc.setFont(tempFont);
+ }
+ if (seriesIndex != 0) {
+ gc.setForeground(ColorResources.UI_EVENT_CHART_SEPERATE_LINE);
+ gc.drawLine(rect.x, rect.y, rect.width, rect.y);
+ }
+
+ if (seriesItemSize < 1) {
+ return;
+ }
+ DAChartSeriesItem seriesItem;
+ Color color = series.getColor();
+ gc.setBackground(color);
+
+ int index = series.getPrevIndexByXvalue(plot.getVisibleStartX());
+ if (index < 0) {
+ index = 0;
+ }
+
+ int highlightedIndexX = ((DAUIEventChartPlot) plot)
+ .getHighlightedEventIndexX();
+ int highlightedIndexY = ((DAUIEventChartPlot) plot)
+ .getHighlightedEventIndexY();
+ for (int i = index; i < seriesItemSize; i++) {
+ seriesItem = seriesItems.get(i);
+
+ double currentX = seriesItem.getX();
+ int pixcelStartX = plot.getXPixcelFromX(currentX, rect);
+ int pixcelStartY = rect.y + MARGIN;
+ if (highlightedIndexY == seriesIndex && highlightedIndexX == i) {
+ //FIXME size
+ pixcelStartY -= 8;
+ }
+
+ color = seriesItem.getEventColor();
+ if (null != color) {
+ gc.setBackground(color);
+ gc.fillRectangle(pixcelStartX, pixcelStartY,
+ MULTY_CHECK_BAR_WIDTH, rect.height - MARGIN);
+ gc.setBackground(series.getColor());
+ } else {
+ gc.fillRectangle(pixcelStartX, pixcelStartY,
+ MULTY_CHECK_BAR_WIDTH, rect.height - MARGIN);
+ }
+ if (currentX > plot.getVisibleEndX()) {
+ break;
+ }
+ }
+ }
+
+ private void drawLineSeries(GC gc, DAChartSeries series, boolean bEndVal) {
+ List<DAChartSeriesItem> seriesItems = series.getSeriesItemList();
+ if (null == seriesItems) {
+ return;
+ }
+ int seriesItemSize = seriesItems.size();
+ if (seriesItemSize < 1) {
+ return;
+ }
+
+ DAChartSeriesItem seriesItem = seriesItems.get(0);
+ int oldPixcelX = plot.getXPixcelFromX(seriesItem.getX(), r);
+ int oldPixcelY = plot.getYPixcelFromY(series, seriesItem.getY(), r);
+
+ if (seriesItemSize == 1) {
+ if (oldPixcelX < r.x) {
+ return;
+ }
+ Color color = seriesItem.getEventColor();
+ if (null == color) {
+ color = series.getColor();
+ }
+ gc.setForeground(color);
+ gc.drawPoint(oldPixcelX, oldPixcelY);
+ return;
+ }
+
+ Color color = series.getColor();
+ gc.setForeground(color);
+ gc.setLineStyle(SWT.LINE_SOLID);
+ gc.setAntialias(SWT.ON);
+
+ int index = series.getPrevIndexByXvalue(plot.getVisibleStartX());
+ if (index < 0) {
+ index = 0;
+ }
+
+ seriesItem = seriesItems.get(index);
+ double currentX = seriesItem.getX();
+
+ int newPixcelX = plot.getXPixcelFromX(currentX, r);
+
+ int newPixcelY = plot.getYPixcelFromY(series, seriesItem.getY(), r);
+
+ for (int i = index; i < seriesItemSize; i++) {
+ seriesItem = seriesItems.get(i);
+ currentX = seriesItem.getX();
+
+ oldPixcelX = newPixcelX;
+ oldPixcelY = newPixcelY;
+
+ newPixcelX = plot.getXPixcelFromX(currentX, r);
+ newPixcelY = plot.getYPixcelFromY(series, seriesItem.getY(), r);
+
+ gc.drawLine(oldPixcelX, oldPixcelY, newPixcelX, newPixcelY);
+ if (currentX > plot.getVisibleEndX()) {
+ return;
+ }
+ }
+ // // draw endVal
+ if (true == bEndVal) {
+ int endX = plot.getXPixcelFromX(plot.getValidEndX(), r);
+ if (endX > newPixcelX) {
+ gc.drawLine(newPixcelX, newPixcelY, endX, newPixcelY);
+ }
+ }
+ }
+
+ private void drawAreaSeries(GC gc, DAChartSeries series, boolean bEndVal) {
+ List<DAChartSeriesItem> seriesItems = series.getSeriesItemList();
+ if (null == seriesItems) {
+ return;
+ }
+
+ int seriesItemSize = seriesItems.size();
+ if (seriesItemSize < 1) {
+ return;
+ }
+
+ DAChartSeriesItem seriesItem = seriesItems.get(0);
+ int oldPixcelX = plot.getXPixcelFromX(seriesItem.getX(), r);
+ int oldPixcelY = plot.getYPixcelFromY(series, seriesItem.getY(), r);
+ int baseY = r.y + r.height;
+
+ if (seriesItemSize == 1) {
+ if (oldPixcelX < r.x) {
+ return;
+ }
+ Color color = seriesItem.getEventColor();
+ if (null == color) {
+ color = series.getColor();
+ }
+ gc.setForeground(color);
+ gc.drawLine(oldPixcelX, baseY, oldPixcelX, oldPixcelY);
+ return;
+ }
+
+ Color color = series.getColor();
+ gc.setAntialias(SWT.ON);
+ gc.setAlpha((int) (255 * 0.8));
+ gc.setForeground(color);
+ gc.setBackground(color);
+ int index = series.getPrevIndexByXvalue(plot.getVisibleStartX());
+ if (index < 0) {
+ index = 0;
+ }
+
+ seriesItem = seriesItems.get(index);
+ double currentX = seriesItem.getX();
+
+ int newPixcelX = plot.getXPixcelFromX(currentX, r);
+ int newPixcelY = plot.getYPixcelFromY(series, seriesItem.getY(), r);
+
+ for (int i = index; i < seriesItemSize; i++) {
+ seriesItem = seriesItems.get(i);
+ currentX = seriesItem.getX();
+
+ oldPixcelX = newPixcelX;
+ oldPixcelY = newPixcelY;
+
+ newPixcelX = plot.getXPixcelFromX(currentX, r);
+ newPixcelY = plot.getYPixcelFromY(series, seriesItem.getY(), r);
+ int[] polygon = { oldPixcelX, baseY, oldPixcelX, oldPixcelY,
+ newPixcelX, newPixcelY, newPixcelX, baseY };
+ gc.setAlpha((int) (255 * 0.8));
+ gc.fillPolygon(polygon);
+ gc.setAlpha((int) (255 * 0.2));
+ gc.drawPolygon(polygon);
+ if (currentX > plot.getVisibleEndX()) {
+ gc.setAlpha(255);
+ return;
+ }
+ }
+ // // draw endVal
+ if (true == bEndVal) {
+ int endX = plot.getXPixcelFromX(plot.getValidEndX(), r);
+ if (endX > newPixcelX) {
+ gc.setAlpha((int) (255 * 0.4));
+ int[] polygon = { newPixcelX, baseY, newPixcelX, newPixcelY,
+ endX, newPixcelY, endX, baseY };
+ gc.fillPolygon(polygon);
+ }
+ }
+
+ gc.setAlpha(255);
+ }
+
+ private void drawStepSeries(GC gc, DAChartSeries series, boolean bEndVal) {
+ List<DAChartSeriesItem> seriesItems = series.getSeriesItemList();
+ if (null == seriesItems) {
+ return;
+ }
+ int seriesItemSize = seriesItems.size();
+ if (seriesItemSize < 1) {
+ return;
+ }
+
+ DAChartSeriesItem seriesItem = seriesItems.get(0);
+ int oldPixcelX = plot.getXPixcelFromX(seriesItem.getX(), r);
+ int oldPixcelY = plot.getYPixcelFromY(series, seriesItem.getY(), r);
+
+ if (seriesItemSize == 1) {
+ if (oldPixcelX < r.x) {
+ return;
+ }
+ Color color = seriesItem.getEventColor();
+ if (null == color) {
+ color = series.getColor();
+ }
+ gc.setForeground(color);
+ gc.drawPoint(oldPixcelX, oldPixcelY);
+ return;
+ }
+
+ Color color = series.getColor();
+ gc.setForeground(color);
+ gc.setLineStyle(SWT.LINE_SOLID);
+
+ int index = series.getPrevIndexByXvalue(plot.getVisibleStartX());
+ if (index < 0) {
+ index = 0;
+ }
+
+ seriesItem = seriesItems.get(index);
+ double currentX = seriesItem.getX();
+
+ int newPixcelX = plot.getXPixcelFromX(currentX, r);
+ int newPixcelY = plot.getYPixcelFromY(series, seriesItem.getY(), r);
+
+ for (int i = index; i < seriesItemSize; i++) {
+ seriesItem = seriesItems.get(i);
+ currentX = seriesItem.getX();
+
+ oldPixcelX = newPixcelX;
+ oldPixcelY = newPixcelY;
+
+ newPixcelX = plot.getXPixcelFromX(currentX, r);
+ newPixcelY = plot.getYPixcelFromY(series, seriesItem.getY(), r);
+
+ gc.drawLine(oldPixcelX, oldPixcelY, newPixcelX, oldPixcelY);
+ gc.drawLine(newPixcelX, oldPixcelY, newPixcelX, newPixcelY);
+ if (currentX > plot.getVisibleEndX()) {
+ return;
+ }
+ }
+ // draw endVal
+ if (true == bEndVal) {
+ int endX = plot.getXPixcelFromX(plot.getValidEndX(), r);
+ if (endX > newPixcelX) {
+ gc.drawLine(newPixcelX, newPixcelY, endX, newPixcelY);
+ }
+ }
+ }
+
+ private void drawImageSeries(GC gc, DAChartSeries series) {
+ List<DAChartSeriesItem> seriesItems = series.getSeriesItemList();
+ if (null == seriesItems || !(plot instanceof DAScreenshotChartPlot)) {
+ return;
+ }
+
+ int seriesItemSize = seriesItems.size();
+ if (seriesItemSize < 1) {
+ return;
+ }
+
+ int index = series.getPrevIndexByXvalue(plot.getVisibleStartX());
+ if (index < 0) {
+ index = 0;
+ }
+
+ int highlightedImageIndex = ((DAScreenshotChartPlot) plot)
+ .getHighlightedImageIndex();
+ int selectedImageIndex = ((DAScreenshotChartPlot) plot)
+ .getSelectedImageIndex();
+ for (int i = index; i < seriesItemSize; i++) {
+ DAChartSeriesItem seriesItem = seriesItems.get(i);
+ double currentX = seriesItem.getX();
+ int pixcelStartX = plot.getXPixcelFromX(currentX, r);
+ Image image = seriesItem.getImage();
+ int yPosition = (int) seriesItem.getY();
+ if (r.height != DAChartBoard.DEFAULT_CHART_ZOOMIN_HEIGHT - 1) {
+ image = new Image(Display.getDefault(), image.getImageData()
+ .scaledTo(image.getBounds().width / 2,
+ image.getBounds().height / 2));
+ yPosition = SCREENSHOT_Y_POSITION_MINI;
+ }
+
+ if (i != highlightedImageIndex && i != selectedImageIndex) {
+ gc.drawImage(image, pixcelStartX, yPosition);
+ gc.setLineWidth(SCREENSHOT_BORDER_LINE_WIDTH);
+ gc.setForeground(ColorResources.SCREENSHOT_CHART_BORDER_LINE);
+ gc.drawRectangle(pixcelStartX, yPosition,
+ image.getBounds().width, image.getBounds().height);
+ }
+
+ if (currentX > plot.getVisibleEndX()) {
+ break;
+ }
+ }
+
+ if (selectedImageIndex >= 0) {
+ gc.setForeground(ColorResources.SCREENSHOT_CHART_SELECTED_LINE);
+ gc.setLineWidth(SCREENSHOT_SELECTED_LINE_WIDTH);
+
+ DAChartSeriesItem seriesItem = seriesItems.get(selectedImageIndex);
+ Image selectedImage = seriesItem.getImage();
+ int yPosition = (int) seriesItem.getY();
+ int highlightedYPosition = SCREENSHOT_SELECTED_Y_POSITION;
+ if (r.height != DAChartBoard.DEFAULT_CHART_ZOOMIN_HEIGHT - 1) {
+ selectedImage = new Image(Display.getDefault(), selectedImage
+ .getImageData().scaledTo(
+ selectedImage.getBounds().width / 2,
+ selectedImage.getBounds().height / 2));
+ yPosition = SCREENSHOT_Y_POSITION_MINI;
+ highlightedYPosition = SCREENSHOT_SELECTED_Y_POSITION_MINI;
+ }
+ int pixcelStartX = plot.getXPixcelFromX(seriesItem.getX(), r);
+ int screenshotWidth = selectedImage.getBounds().width;
+ int screenshotHeight = selectedImage.getBounds().height;
+
+ if (selectedImageIndex == highlightedImageIndex) {
+ gc.drawRectangle(pixcelStartX - 1, highlightedYPosition - 1,
+ screenshotWidth + 3, screenshotHeight + 3);
+ } else {
+ gc.drawImage(selectedImage, pixcelStartX, yPosition);
+ gc.drawRectangle(pixcelStartX - 1, r.y + yPosition - 1,
+ screenshotWidth + 3, screenshotHeight + 3);
+ gc.setLineWidth(SCREENSHOT_BORDER_LINE_WIDTH);
+ gc.setForeground(ColorResources.SCREENSHOT_CHART_BORDER_LINE);
+ gc.drawRectangle(pixcelStartX, yPosition, screenshotWidth,
+ screenshotHeight);
+ }
+ }
+
+ if (highlightedImageIndex >= 0) {
+ DAChartSeriesItem seriesItem = seriesItems
+ .get(highlightedImageIndex);
+ Image highlightedImage = seriesItem.getImage();
+ int highlightedYPosition = SCREENSHOT_SELECTED_Y_POSITION;
+ if (r.height != DAChartBoard.DEFAULT_CHART_ZOOMIN_HEIGHT - 1) {
+ highlightedImage = new Image(Display.getDefault(),
+ highlightedImage.getImageData().scaledTo(
+ highlightedImage.getBounds().width / 2,
+ highlightedImage.getBounds().height / 2));
+ highlightedYPosition = SCREENSHOT_SELECTED_Y_POSITION_MINI;
+ }
+ double currentX = seriesItems.get(highlightedImageIndex).getX();
+ int pixcelStartX = plot.getXPixcelFromX(currentX, r);
+ int screenshotWidth = highlightedImage.getBounds().width;
+ int screenshotHeight = highlightedImage.getBounds().height;
+
+ gc.drawImage(highlightedImage, pixcelStartX, highlightedYPosition);
+ gc.setLineWidth(SCREENSHOT_BORDER_LINE_WIDTH);
+ gc.setForeground(ColorResources.SCREENSHOT_CHART_BORDER_LINE);
+ gc.drawRectangle(pixcelStartX, highlightedYPosition,
+ screenshotWidth, screenshotHeight);
+ }
+ }
+
+ private void drawEventSeries(GC gc, DAChartSeries series) {
+ List<DAChartSeriesItem> seriesItems = series.getSeriesItemList();
+ if (null == seriesItems) {
+ return;
+ }
+
+ int seriesItemSize = seriesItems.size();
+
+ if (seriesItemSize < 1) {
+ return;
+ }
+
+ DAChartSeriesItem seriesItem;
+ Color color = series.getColor();
+ gc.setBackground(color);
+ gc.setForeground(ColorResources.BLACK);
+ gc.setAntialias(SWT.ON);
+
+ int index = series.getPrevIndexByXvalue(plot.getVisibleStartX());
+ if (index < 0) {
+ index = 0;
+ }
+ for (int i = index; i < seriesItemSize; i++) {
+ seriesItem = seriesItems.get(i);
+
+ double currentX = seriesItem.getX();
+
+ int pixcelStartX = plot.getXPixcelFromX(seriesItem.getX(), r);
+
+ Color itemColor = seriesItem.getEventColor();
+ int barHeight = (int) ((r.y + r.height) * EVENT_HEIGHT_MARGIN_RATIO);
+
+ if (null != itemColor) {
+ gc.setBackground(itemColor);
+ gc.fillRectangle(pixcelStartX, r.y + barHeight, EVENT_WIDTH,
+ barHeight);
+ gc.setBackground(color);
+ } else {
+ gc.fillRectangle(pixcelStartX, r.y + barHeight, EVENT_WIDTH,
+ barHeight);
+ }
+ if (currentX > plot.getVisibleEndX()) {
+ break;
+ }
+ }
+ }
+
+ private void drawEventAreaSeries(GC gc, DAChartSeries series) {
+ List<DAChartSeriesItem> seriesItems = series.getSeriesItemList();
+ if (null == seriesItems) {
+ return;
+ }
+
+ int seriesItemSize = seriesItems.size();
+
+ if (seriesItemSize < 1) {
+ return;
+ }
+
+ DAChartSeriesItem seriesItem;
+ Color color = series.getColor();
+ gc.setBackground(color);
+ gc.setAntialias(SWT.ON);
+
+ int index = series.getPrevIndexByXvalue(plot.getVisibleStartX());
+ if (index < 0) {
+ index = 0;
+ }
+ for (int i = index; i < seriesItemSize; i++) {
+ seriesItem = seriesItems.get(i);
+
+ double currentStartX = seriesItem.getX();
+ double currentEndX = seriesItem.getY();
+
+ int pixcelStartX = plot.getXPixcelFromX(currentStartX, r);
+ int pixcelEndX = plot.getXPixcelFromX(currentEndX, r);
+ int width = pixcelEndX - pixcelStartX;
+ if (width < EVENT_WIDTH) {
+ width = EVENT_WIDTH;
+ }
+
+ Color itemColor = seriesItem.getEventColor();
+ int barHeight = (int) ((r.y + r.height) * EVENT_HEIGHT_MARGIN_RATIO);
+
+ if (null != itemColor) {
+ gc.setBackground(itemColor);
+ gc.fillRectangle(pixcelStartX,
+ (r.y + r.height) - barHeight * 2, width, barHeight);
+ gc.setBackground(color);
+ } else {
+ gc.fillRectangle(pixcelStartX,
+ (r.y + r.height) - barHeight * 2, width, barHeight);
+ }
+ if (pixcelStartX > plot.getVisibleEndX()) {
+ break;
+ }
+ }
+ }
+
+ private void drawLoadSeries(GC gc, DAChartSeries series) {
+ List<DAChartSeriesItem> seriesItems = series.getSeriesItemList();
+ if (null == seriesItems) {
+ return;
+ }
+
+ int seriesItemSize = seriesItems.size();
+
+ if (seriesItemSize < 1) {
+ return;
+ }
+
+ DAChartSeriesItem seriesItem;
+ Color color = series.getColor();
+ gc.setBackground(ColorResources.WHITE);
+ gc.setAntialias(SWT.ON);
+
+ int index = series.getPrevIndexByXvalue(plot.getVisibleStartX());
+ if (index < 0) {
+ index = 0;
+ }
+
+ int lastIndex = index;
+ for (int i = index; i < seriesItemSize; i++) {
+ seriesItem = seriesItems.get(i);
+ double currentX = seriesItem.getX();
+ if (currentX > plot.getVisibleEndX()) {
+ lastIndex = i;
+ break;
+ }
+ lastIndex = i;
+ }
+ int heightMargin = (int) ((r.y + r.height) * LOAD_HEIGHT_MARGIN_RATIO);
+ int backStartX = plot.getXPixcelFromX(seriesItems.get(index).getX(), r);
+ int backWidth = plot.getXPixcelFromX(seriesItems.get(lastIndex).getX(),
+ r) - backStartX;
+ gc.fillRectangle(backStartX, r.y + heightMargin, backWidth, r.y
+ + r.height - heightMargin * 2);
+ gc.setBackground(color);
+
+ for (int i = index; i < seriesItemSize; i++) {
+ seriesItem = seriesItems.get(i);
+
+ double barWidthTime = seriesItem.getBarWidth();
+ if (barWidthTime == -1) {
+ barWidthTime = series.getBarWidth();
+ }
+
+ double currentX = seriesItem.getX();
+
+ int pixcelStartX = plot.getXPixcelFromX(seriesItem.getX(), r);
+
+ int barWidth = plot.getXPixcelFromX(currentX + barWidthTime, r)
+ - pixcelStartX;
+
+ if (barWidth < 1) {
+ barWidth = EVENT_WIDTH;
+ }
+
+ color = seriesItem.getEventColor();
+ double load = seriesItem.getY();
+ gc.setAlpha((int) load);
+
+ if (null != color) {
+ gc.setBackground(color);
+ gc.fillRectangle(pixcelStartX, r.y + heightMargin, barWidth,
+ r.y + r.height - heightMargin * 2);
+ gc.setBackground(series.getColor());
+ } else {
+ gc.fillRectangle(pixcelStartX, r.y + heightMargin, barWidth,
+ r.y + r.height - heightMargin * 2);
+ }
+ if (currentX > plot.getVisibleEndX()) {
+ break;
+ }
+ }
+ gc.setAlpha(255);
+ }
+
+ private void drawArrowSeries(GC gc, DAChartSeries series) {
+ List<DAChartSeriesItem> seriesItems = series.getSeriesItemList();
+ if (null == seriesItems) {
+ return;
+ }
+
+ int seriesItemSize = seriesItems.size();
+
+ if (seriesItemSize < 1) {
+ return;
+ }
+
+ DAChartSeriesItem seriesItem;
+ Color color = series.getColor();
+ gc.setBackground(color);
+ gc.setForeground(ColorResources.WHITE);
+ gc.setAntialias(SWT.ON);
+ Font tidFont = series.getFont();
+ gc.setFont(tidFont);
+
+ int index = series.getPrevIndexByXvalue(plot.getVisibleStartX());
+ if (index < 0) {
+ index = 0;
+ }
+ Image arw = ImageResources.CHART_EVENT_CALLEE_ARW;
+ Rectangle imageRect = arw.getBounds();
+
+ for (int i = index; i < seriesItemSize; i++) {
+ seriesItem = seriesItems.get(i);
+
+ double currentX = seriesItem.getX();
+ double arrowPosition = seriesItem.getY();
+
+ int pixcelStartX = plot.getXPixcelFromX(seriesItem.getX(), r);
+
+ int barHeight = (int) ((r.y + r.height) * EVENT_HEIGHT_MARGIN_RATIO);
+ int barPosY = r.y + r.height - barHeight * 2;
+
+ gc.fillRectangle(pixcelStartX, barPosY, EVENT_WIDTH, barHeight);
+
+ if (DAChartSeriesItem.SERIES_ARROW_NONE != arrowPosition) {
+ String number = String
+ .valueOf((int) (seriesItem.getBarWidth()));
+ Rectangle arrowRect = imageRect;
+ // arrowRect.y = (r.y + r.height) / 2 - imageRect.height / 2;
+ arrowRect.y = barPosY + barHeight / 2 - imageRect.height / 2;
+ if (DAChartSeriesItem.SERIES_ARROW_RIGHT == arrowPosition) {
+ arrowRect.x = pixcelStartX + EVENT_WIDTH;
+ } else {
+ arrowRect.x = pixcelStartX - imageRect.width;
+ }
+ gc.drawImage(arw, arrowRect.x, arrowRect.y);
+ Point p = gc.textExtent(number, SWT.DRAW_MNEMONIC);
+ gc.drawText(number, (arrowRect.x + arrowRect.width / 2) - p.x
+ / 2 - ARROW_MARGIN,
+ (arrowRect.y + arrowRect.height / 2) - p.y / 2, true);
+ }
+
+ if (currentX > plot.getVisibleEndX()) {
+ break;
+ }
+ }
+ }
+
+ private void drawStateSeries(GC gc, DAChartSeries series) {
+ List<DAChartSeriesItem> seriesItems = series.getSeriesItemList();
+ if (null == seriesItems) {
+ return;
+ }
+
+ int seriesItemSize = seriesItems.size();
+
+ if (seriesItemSize < 1) {
+ return;
+ }
+
+ DAChartSeriesItem seriesItem;
+ Color color = series.getColor();
+ Color foreColor;
+ gc.setBackground(color);
+ gc.setAntialias(SWT.ON);
+
+ int index = series.getPrevIndexByXvalue(plot.getVisibleStartX());
+ if (index < 0) {
+ index = 0;
+ }
+ int heightMargin = (int) ((r.y + r.height) * LOAD_HEIGHT_MARGIN_RATIO);
+ int prevEndX = 0;
+
+ for (int i = index; i < seriesItemSize; i++) {
+ seriesItem = seriesItems.get(i);
+ double currentX = seriesItem.getX();
+ int pixcelStartX = plot.getXPixcelFromX(seriesItem.getX(), r);
+ color = seriesItem.getEventColor();
+ foreColor = seriesItem.getEventGradationForegroundColor();
+ int state = (int) seriesItem.getY();
+
+ if (null != color) {
+ gc.setBackground(color);
+ }
+
+ int barWidth;// = EVENT_WIDTH;
+ switch (state) {
+ case DAChartSeriesItem.SERIES_STATE_BAR:
+ barWidth = (int) seriesItem.getBarWidth();
+ if (barWidth == -1) {
+ barWidth = EVENT_WIDTH;
+ }
+ gc.fillRectangle(pixcelStartX, r.y + heightMargin, barWidth,
+ r.y + r.height / 2 - heightMargin);
+ prevEndX = pixcelStartX + barWidth;
+ break;
+ case DAChartSeriesItem.SERIES_STATE_CONTINUE:
+ if (i + 1 == seriesItemSize) {
+ barWidth = plot.getXPixcelFromX(plot.getValidEndX(), r)
+ - pixcelStartX;
+
+ } else {
+ barWidth = plot.getXPixcelFromX(seriesItems.get(i + 1)
+ .getX(), r)
+ - pixcelStartX;
+ }
+ if (barWidth <= 0) {
+ barWidth = 1;
+ }
+
+ if (pixcelStartX < prevEndX) {
+ int diff = prevEndX - pixcelStartX;
+
+ pixcelStartX = prevEndX;
+ barWidth -= diff;
+ }
+ if (barWidth <= 0) {
+ barWidth = 0;
+ }
+
+ if (null != foreColor) {
+ gc.setForeground(foreColor);
+ gc.fillGradientRectangle(pixcelStartX, r.y + heightMargin,
+ barWidth, r.y + r.height - heightMargin * 2, true);
+ } else {
+ gc.fillRectangle(pixcelStartX, r.y + heightMargin,
+ barWidth, r.y + r.height - heightMargin * 2);
+ }
+ prevEndX = pixcelStartX + barWidth;
+ break;
+ case DAChartSeriesItem.SERIES_STATE_CONNECTION:
+
+ if (i + 1 < seriesItemSize) {
+ barWidth = plot.getXPixcelFromX(seriesItems.get(i + 1)
+ .getX(), r)
+ - pixcelStartX;
+ } else {
+ barWidth = 1;
+ }
+ if (pixcelStartX < prevEndX) {
+ int diff = prevEndX - pixcelStartX;
+
+ pixcelStartX = prevEndX;
+ barWidth -= diff;
+ }
+ if (barWidth < 0) {
+ barWidth = 0;
+ }
+
+ if (null != foreColor) {
+ gc.setForeground(foreColor);
+ gc.fillGradientRectangle(pixcelStartX, r.y + heightMargin,
+ barWidth, r.y + r.height - heightMargin * 2, true);
+ } else {
+ gc.fillRectangle(pixcelStartX, r.y + heightMargin,
+ barWidth, r.y + r.height - heightMargin * 2);
+ }
+
+ prevEndX = pixcelStartX + barWidth;
+ break;
+ default:
+ break;
+ }
+
+ if (null != color) {
+ gc.setBackground(series.getColor());
+ }
+ if (currentX > plot.getVisibleEndX()) {
+ break;
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.widgets.chart;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.tizen.dynamicanalyzer.widgets.helper.FontResources;
+
+public class DAChartSeries {
+ public static final int SERIES_STYLE_NONE = 0;
+ public static final int SERIES_STYLE_LINE = 1;
+ public static final int SERIES_STYLE_BAR = 2;
+ public static final int SERIES_STYLE_AREA = 3;
+ public static final int SERIES_STYLE_STACK_BAR = 4;
+ public static final int SERIES_STYLE_AREA_STACK = 5;
+ public static final int SERIES_STYLE_STEP = 6;
+ public static final int SERIES_STYLE_IMAGE = 7;
+ public static final int SERIES_STYLE_EVENT = 8;
+ public static final int SERIES_STYLE_EVENT_AREA = 9;
+ public static final int SERIES_STYLE_MULTY_CHECK_BAR = 10;
+ public static final int SERIES_STYLE_LOAD = 11;
+ public static final int SERIES_STYLE_ARROW = 12;
+ public static final int SERIES_STYLE_STATE = 13;
+ public static final int SERIES_STYLE_LAST_CONTINUE_STEP = 14;
+
+ public static final double SERIES_DEFAULT_BAR_WIDTH = 0.5;
+
+ private String name;
+ private int style = SERIES_STYLE_NONE;
+ private List<DAChartSeriesItem> seriesItems = new ArrayList<DAChartSeriesItem>();
+ private Color seriesColor;
+ private double barWidth = SERIES_DEFAULT_BAR_WIDTH;
+ private double maxX = 0;
+ private double maxY = 0;
+ private double endX = 0;
+ private double endY = 0;
+ private boolean hasUpdate = false;
+ private Font font;
+ private boolean summarizeTooltip = false;
+ private String summarizeString;
+
+ public DAChartSeries(String name, int chartStyle) {
+ this.name = name;
+ this.style = chartStyle;
+ }
+
+ public DAChartSeries(String name, int chartStyle, Color seriesColor) {
+ this(name, chartStyle);
+ this.seriesColor = seriesColor;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public int getStyle() {
+ return style;
+ }
+
+ public Color getColor() {
+ return seriesColor;
+ }
+
+ public void setColor(Color Color) {
+ this.seriesColor = Color;
+ }
+
+ public double getBarWidth() {
+ return barWidth;
+ }
+
+ public void setBarWidth(long barWidth) {
+ this.barWidth = barWidth;
+ }
+
+ public List<DAChartSeriesItem> getSeriesItemList() {
+ return seriesItems;
+ }
+
+ public void addSeriesItem(DAChartSeriesItem item) {
+ int insert = 0;
+ for (int i = seriesItems.size(); i > 0; i--) {
+ if (seriesItems.get(i - 1).getX() <= item.getX()) {
+ insert = i;
+ break;
+ }
+ }
+ if (maxX < item.getX()) {
+ maxX = item.getX();
+ }
+ if (maxY < item.getY()) {
+ maxY = item.getY();
+ }
+ seriesItems.add(insert, item);
+ hasUpdate = true;
+ }
+
+ public double getMaxX() {
+ return maxX;
+ }
+
+ public double getMaxY() {
+ return maxY;
+ }
+
+ public int getPrevIndexByXvalue(double x) {
+ int current;
+ int seriesItemSize = seriesItems.size();
+
+ if (0 >= seriesItemSize) {
+ return -1;
+ } else if (seriesItemSize <= (int) x) {
+ current = seriesItemSize - 1;
+ } else if ((int) x < 0) {
+ current = 0;
+ } else {
+ current = (int) x;
+ }
+ int i;
+ if (seriesItems.get(current).getX() == x) {
+ // if same time value, find last value
+ for (i = current + 1; i < seriesItemSize; i++) {
+ if (seriesItems.get(i).getX() != x) {
+ break;
+ }
+ }
+ return i - 1;
+ } else if (seriesItems.get(current).getX() < x) {
+ for (i = current; i < seriesItemSize; i++) {
+ if (seriesItems.get(i).getX() > x) {
+ break;
+ }
+ }
+
+ return i - 1;
+ } else {
+ for (i = current; i >= 0; i--) {
+ if (seriesItems.get(i).getX() <= x) {
+ break;
+ }
+ }
+ return i;
+ }
+ }
+
+ public int getNextIndexByXvalue(double x) {
+ int current;
+ int seriesItemSize = seriesItems.size();
+
+ if (0 >= seriesItemSize) {
+ return -1;
+ } else if (seriesItemSize <= (int) x) {
+ current = seriesItemSize - 1;
+ } else if ((int) x < 0) {
+ current = 0;
+ } else {
+ current = (int) x;
+ }
+ int i;
+ if (seriesItems.get(current).getX() == x) {
+ return current;
+ } else if (seriesItems.get(current).getX() < x) {
+ for (i = current; i < seriesItemSize; i++) {
+ if (seriesItems.get(i).getX() >= x) {
+ return i;
+ }
+ }
+ return -1;
+ } else {
+ for (i = current; i >= 0; i--) {
+ if (seriesItems.get(i).getX() < x) {
+ break;
+ }
+ }
+ return i + 1;
+ }
+ }
+
+ public void clear() {
+ seriesItems.clear();
+ maxX = 0;
+ maxY = 0;
+ }
+
+ public double getEndX() {
+ return endX;
+ }
+
+ public void setEndX(double endX) {
+ this.endX = endX;
+ }
+
+ // need DACustomChartPlot's setSeriesHeightRange(true) and
+ // setAutoHeightRange(false)
+ public double getEndY() {
+ return endY;
+ }
+
+ public void setEndY(double endY) {
+ this.endY = endY;
+ }
+
+ protected boolean hasUpdate() {
+ return hasUpdate;
+ }
+
+ protected void setUpdate(boolean bUpdate) {
+ hasUpdate = bUpdate;
+ }
+
+ public Font getFont() {
+ if (null == font) {
+ font = FontResources.CHART_SERIES_FONT;
+ }
+ return font;
+ }
+
+ public void setFont(Font font) {
+ this.font = font;
+ }
+
+ public void setSummarizeTooltipText(String summarizeString) {
+ setSummarizeTooltip(true);
+ this.setSummarizeString(summarizeString);
+ }
+
+ public boolean isSummarizeTooltip() {
+ return summarizeTooltip;
+ }
+
+ public void setSummarizeTooltip(boolean summarizeTooltip) {
+ this.summarizeTooltip = summarizeTooltip;
+ }
+
+ public String getSummarizeString() {
+ return summarizeString;
+ }
+
+ public void setSummarizeString(String summarizeString) {
+ this.summarizeString = summarizeString;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.widgets.chart;
+
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+
+public class DAChartSeriesItem {
+ public static final int SERIES_STATE_BAR = 0;
+ public static final int SERIES_STATE_CONTINUE = 1;
+ public static final int SERIES_STATE_CONNECTION = 2;
+ public static final int SERIES_ARROW_NONE = 0;
+ public static final int SERIES_ARROW_LEFT = -1;
+ public static final int SERIES_ARROW_RIGHT = 1;
+ private double x = 0;
+ private double y = 0;
+ private double barWidth = -1;
+ private Color eventColor = null;
+ private Color eventGradationForegroundColor = null;
+ private Image image = null;
+ private String tooltipText;
+
+ public DAChartSeriesItem(double x, double y) {
+ this.x = x;
+ this.y = y;
+ }
+
+ public DAChartSeriesItem(double x, double y, Color eventColor) {
+ this.x = x;
+ this.y = y;
+ this.eventColor = eventColor;
+ }
+
+ public DAChartSeriesItem(double x, double y, String tooltipText) {
+ this.x = x;
+ this.y = y;
+ this.tooltipText = tooltipText;
+ }
+
+ public DAChartSeriesItem(double x, double y, Color eventColor,
+ String tooltipText) {
+ this.x = x;
+ this.y = y;
+ this.eventColor = eventColor;
+ this.tooltipText = tooltipText;
+ }
+
+ public DAChartSeriesItem(double x, double y,
+ Color eventGradationForegroundColor,
+ Color eventGradationBackgroundColor, String tooltipText) {
+ this.x = x;
+ this.y = y;
+ this.eventGradationForegroundColor = eventGradationForegroundColor;
+ this.eventColor = eventGradationBackgroundColor;
+ this.tooltipText = tooltipText;
+ }
+
+ public DAChartSeriesItem(double x, Image image) {
+ this.x = x;
+ this.setImage(image);
+ }
+
+ public DAChartSeriesItem(double x, double y, Image image) {
+ this.x = x;
+ this.y = y;
+ this.setImage(image);
+ }
+
+ public DAChartSeriesItem(double x, Image image, String tooltipText) {
+ this.x = x;
+ this.setImage(image);
+ this.tooltipText = tooltipText;
+ }
+
+ public double getX() {
+ return x;
+ }
+
+ public void setX(double x) {
+ this.x = x;
+ }
+
+ public double getY() {
+ return y;
+ }
+
+ public void setY(double y) {
+ this.y = y;
+ }
+
+ public double getBarWidth() {
+ return barWidth;
+ }
+
+ public void setBarWidth(double barWidth) {
+ this.barWidth = barWidth;
+ }
+
+ public Color getEventColor() {
+ return eventColor;
+ }
+
+ public void setEventColor(Color eventColor) {
+ this.eventColor = eventColor;
+ }
+
+ public String getTooltipText() {
+ return tooltipText;
+ }
+
+ public void setTooltipText(String tooltipText) {
+ this.tooltipText = tooltipText;
+ }
+
+ public Image getImage() {
+ return image;
+ }
+
+ public void setImage(Image image) {
+ this.image = image;
+ }
+
+ public Color getEventGradationForegroundColor() {
+ return eventGradationForegroundColor;
+ }
+
+ public void setEventGradationForegroundColor(
+ Color eventGradationForegroundColor) {
+ this.eventGradationForegroundColor = eventGradationForegroundColor;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.chart;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+public class DAChartTooltip {
+ private static DAChartTooltip instance = null;
+ private Shell shell = null;
+ Canvas contents = null;
+ private static final int MAX_WIDTH = 100;
+ private static final int MAX_HEIGHT = 100;
+ private DACustomChartTooltipInfo tooltipInfo = null;
+
+ private class DACustomChartTooltipInfo {
+ public int height = 0;
+ public int width = 0;
+ public List<String> tooltipTexts;
+ public double xVal = 0;
+ public DAChart chart;
+
+ public DACustomChartTooltipInfo() {
+ tooltipTexts = new ArrayList<String>();
+ }
+
+ public void clear() {
+ if (null != tooltipTexts) {
+ tooltipTexts.clear();
+ }
+
+ height = 0;
+ width = 0;
+ xVal = 0;
+ }
+ }
+
+ private DAChartTooltip() {
+ }
+
+ public static DAChartTooltip getInstance() {
+ if (null == instance) {
+ instance = new DAChartTooltip();
+ }
+ return instance;
+ }
+
+ private void init(Shell parent) {
+ if (null == shell) {
+ shell = new Shell(parent, SWT.TOOL | SWT.NO_FOCUS);
+
+ shell.setSize(100, 10);
+ shell.setLayout(new FillLayout());
+
+ contents = new Canvas(shell, SWT.NONE);
+ contents.setBackground(new Color(Display.getCurrent(), 193, 193,
+ 193));
+
+ contents.addPaintListener(new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ drawTooltip(e.gc);
+ }
+ });
+ }
+ }
+
+ public void open(Shell parent, DAChartPlot plot) {
+ boolean bInfo = makeTooltipInfo(plot.getChart());
+ if (false == bInfo) {
+ return;
+ }
+
+ init(parent);
+
+ Point pt = Display.getCurrent().getCursorLocation();
+
+ shell.setBounds(pt.x + 10, pt.y - tooltipInfo.height - 10,
+ tooltipInfo.width, tooltipInfo.height);
+ shell.open();
+ }
+
+ public void move() {
+ if (null == shell || null == tooltipInfo) {
+ return;
+ }
+ DAChartPlotTooltip tooltip = tooltipInfo.chart.getPlot()
+ .getTooltip();
+
+ if (tooltipInfo.xVal != tooltip.getStartVal()) {
+ makeTooltipInfo(tooltipInfo.chart);
+ }
+
+ Point pt = Display.getCurrent().getCursorLocation();
+ shell.setBounds(pt.x + 10, pt.y - tooltipInfo.height - 10,
+ tooltipInfo.width, tooltipInfo.height);
+ }
+
+ private boolean makeTooltipInfo(DAChart chart) {
+ if (null == tooltipInfo) {
+ tooltipInfo = new DACustomChartTooltipInfo();
+ } else {
+ tooltipInfo.clear();
+ }
+ tooltipInfo.chart = chart;
+
+ DAChartPlotTooltip tooltip = chart.getPlot().getTooltip();
+ List<DAChartSeries> seriesList = chart.getSeriesList();
+
+ if (null == tooltip || -1 == tooltip.getStartVal()) {
+ return false;
+ }
+
+ tooltipInfo.height = seriesList.size()
+ * DAChartPlotTooltip.TOOLTIP_HEIGHT
+ + (DAChartPlotTooltip.TOOLTIP_MARGIN * 2);
+ tooltipInfo.xVal = tooltip.getStartVal();
+
+ GC tempGC = new GC(new Image(Display.getCurrent(), MAX_WIDTH,
+ MAX_HEIGHT));
+ tempGC.setFont(tooltip.getFont());
+
+ for (int i = 0; i < seriesList.size(); i++) {
+ DAChartSeries series = seriesList.get(i);
+ int index = series.getPrevIndexByXvalue(tooltipInfo.xVal);
+ String text;
+ if (index >= 0) {
+ text = series.getName()
+ + " : "
+ + series.getSeriesItemList().get(index)
+ .getTooltipText();
+ } else {
+ text = series.getName();
+ }
+
+ tooltipInfo.tooltipTexts.add(text);
+
+ int textWidth = tempGC.textExtent(text).x;
+ if (tooltipInfo.width < textWidth) {
+ tooltipInfo.width = textWidth;
+ }
+ }
+ tooltipInfo.width += DAChartPlotTooltip.TOOLTIP_SERIES_RECT_LENGTH
+ + (DAChartPlotTooltip.TOOLTIP_MARGIN * 3);
+ return true;
+ }
+
+ private void drawTooltip(GC gc) {
+
+ DAChartPlotTooltip tooltip = tooltipInfo.chart.getPlot()
+ .getTooltip();
+ List<DAChartSeries> seriesList = tooltipInfo.chart
+ .getSeriesList();
+
+ if (null == tooltip || false == tooltip.isTooltip()
+ || -1 == tooltip.getStartVal()) {
+ return;
+ }
+
+ gc.setFont(tooltip.getFont());
+ for (int i = 0; i < seriesList.size(); i++) {
+ DAChartSeries series = seriesList.get(i);
+ int y = DAChartPlotTooltip.TOOLTIP_HEIGHT * i
+ + DAChartPlotTooltip.TOOLTIP_MARGIN;
+ gc.setBackground(series.getColor());
+ gc.fillRectangle(
+ DAChartPlotTooltip.TOOLTIP_MARGIN,
+ y
+ + (DAChartPlotTooltip.TOOLTIP_HEIGHT / 2 - DAChartPlotTooltip.TOOLTIP_SERIES_RECT_LENGTH / 2),
+ DAChartPlotTooltip.TOOLTIP_SERIES_RECT_LENGTH,
+ DAChartPlotTooltip.TOOLTIP_SERIES_RECT_LENGTH);
+
+ gc.setBackground(tooltip.getBackgroundColor());
+ gc.drawText(
+ tooltipInfo.tooltipTexts.get(i),
+ DAChartPlotTooltip.TOOLTIP_MARGIN
+ + DAChartPlotTooltip.TOOLTIP_SERIES_RECT_LENGTH
+ + DAChartPlotTooltip.TOOLTIP_MARGIN, y
+ + DAChartPlotTooltip.TOOLTIP_MARGIN);
+ }
+
+ }
+
+ public void close() {
+ if (null != tooltipInfo) {
+ tooltipInfo.clear();
+ }
+ if (null != shell) {
+ shell.dispose();
+ shell = null;
+ }
+
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.chart;
+
+public class DAScreenshotChartPlot extends DAChartPlot {
+ private int selectedImageIndex = -1;
+ private int highlightedImageIndex = -1;
+
+ public DAScreenshotChartPlot(DAChart chart) {
+ super(chart);
+ }
+
+ public int getSelectedImageIndex() {
+ return selectedImageIndex;
+ }
+
+ public void setSelectedImageIndex(int index) {
+ selectedImageIndex = index;
+ hasUpdate = true;
+ }
+
+ public int getHighlightedImageIndex() {
+ return highlightedImageIndex;
+ }
+
+ public void setHighlightedImageIndex(int index) {
+ highlightedImageIndex = index;
+ hasUpdate = true;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.chart;
+
+public class DAUIEventChartPlot extends DAChartPlot {
+ private int highlightedEventIndexX = -1;
+ private int highlightedEventIndexY = -1;
+
+ private boolean isMinimized = false;
+
+ public DAUIEventChartPlot(DAChart chart) {
+ super(chart);
+ }
+
+ public void setMinimizeStatus(boolean status) {
+ isMinimized = status;
+ }
+
+ public boolean getMinimizeStatus() {
+ return isMinimized;
+ }
+
+ public int getHighlightedEventIndexX() {
+ return highlightedEventIndexX;
+ }
+
+ public int getHighlightedEventIndexY() {
+ return highlightedEventIndexY;
+ }
+
+ public void setHighlightedEventIndexX(int index) {
+ highlightedEventIndexX = index;
+ hasUpdate = true;
+ }
+
+ public void setHighlightedEventIndexY(int index) {
+ highlightedEventIndexY = index;
+ hasUpdate = true;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.chartBoard;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.window.DefaultToolTip;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseTrackAdapter;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.ScrollBar;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
+import org.tizen.dynamicanalyzer.widgets.button.toggle.DACustomToggleButton;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+import org.tizen.dynamicanalyzer.widgets.helper.FontResources;
+import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
+import org.tizen.dynamicanalyzer.widgets.lifecycle.LifecycleBar;
+import org.tizen.dynamicanalyzer.widgets.scale.DAScale;
+import org.tizen.dynamicanalyzer.widgets.scale.DAScaleSelectionListener;
+import org.tizen.dynamicanalyzer.widgets.timeline.DACustomTimeline;
+
+public class DAChartBoard extends Composite {
+
+ // private DACustomButton titleButton;
+ private Composite titleComp;
+ private DACustomToggleButton chartZoomButton;
+ private DACustomTimeline timeline; // FIXME
+ private LifecycleBar lifecycleBar;
+ private DefaultToolTip lifecycleBarTooltip;
+ private DefaultToolTip timelineTooltip;
+ private ScrolledComposite itemListScrollComp;
+
+ private DAChartBoardItemList itemList;
+ private DAScale scale;
+ private Composite scrollComp;
+ private ScrollBar hScroll;
+ private DAChartBoardManager boardManager = null;
+ private DAChartBoardItem selectItem;
+ private Image oldImage;
+ private List<DAChartBoardSelectionListener> selectionListenrers;
+ private DAChartPlotIntervalMarker intervalMarker;
+ private boolean bSelection = true;
+ private int itemListHeight = 0;
+ private Font nameFont;
+
+ // private final static int DEFAULT_CHART_ZOOMOUT_HEIGHT = 50;
+ public final static int DEFAULT_CHART_ZOOMIN_HEIGHT = 80;
+ private final static int DEFAULT_CHARTBOARD_HEADER_HEIGHT = 20;
+ private final static int DEFAULT_CHARTBOARD_TITLE_BUTTON_WIDTH = 78;
+ private final static int DEFAULT_CHARTBOARD_ZOOM_BUTTON_WIDTH = 21;
+ private final static int DEFAULT_CHARTBOARD_FOOTER_HEIGHT = 20;
+ private final static int DEFAULT_CHARTBOARD_SCALE_WIDTH = 99;
+ // private final static int DEFAULT_CHART_CELL_HEIGHT = 200;
+ protected final static double DEFAULT_EXPAND_SMALL = 0.5;
+ protected final static double DEFAULT_EXPAND_MEDIUM = 1;
+ protected final static double DEFAULT_EXPAND_MAX = 2;
+ private double itemRatio = DEFAULT_EXPAND_MEDIUM;
+
+ private int chartHeight = DEFAULT_CHART_ZOOMIN_HEIGHT;
+
+ public DAChartBoard(Composite parent, String title) {
+ super(parent, SWT.NONE);
+ this.setLayout(new FormLayout());
+ this.setBackground(ColorResources.WHITE);
+
+ titleComp = new Composite(this, SWT.NONE);
+ titleComp.setLayout(new FillLayout());
+
+ chartZoomButton = new DACustomToggleButton(this,
+ ImageResources.CHART_ALL_SIZE_MIN_NORMAL,
+ ImageResources.CHART_ALL_SIZE_MIN_PUSH,
+ ImageResources.CHART_ALL_SIZE_MIN_HOVER, null,
+ ImageResources.CHART_ALL_SIZE_RESTORE_NORMAL,
+ ImageResources.CHART_ALL_SIZE_RESTORE_HOVER);
+ chartZoomButton
+ .addClickListener(new DACustomButtonClickEventListener() {
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ boolean bZoomout = chartZoomButton.isToggled();
+ zoomoutItem(bZoomout);
+ }
+ });
+
+ timeline = new DACustomTimeline(this);
+ timelineTooltip = new DefaultToolTip(timeline);
+ timelineTooltip.deactivate();
+ timeline.addMouseTrackListener(timelineMouseTrackAdapter);
+
+ lifecycleBar = new LifecycleBar(this);
+ lifecycleBarTooltip = new DefaultToolTip(lifecycleBar);
+ lifecycleBarTooltip.deactivate();
+ lifecycleBar.addMouseTrackListener(timelineMouseTrackAdapter);
+
+ scale = new DAScale(this, SWT.NONE);
+ scale.addSelectionListener(scaleSelectionListener);
+ scale.setMinimum(0);
+ scale.setMaximum(4);
+ scale.setLeftImage(ImageResources.SCALE_CONTROL_MINUS);
+ scale.setRightImage(ImageResources.SCALE_CONTROL_PLUS);
+ scale.setThumbImage(ImageResources.SCALE_CONTROL_THUMB);
+ scale.setRenderer(new DAChartBoardScaleRenderer());
+
+ scrollComp = new Composite(this, SWT.H_SCROLL);
+ scrollComp.setLayout(new FillLayout());
+ hScroll = scrollComp.getHorizontalBar();
+ hScroll.setMinimum(0);
+ hScroll.setMaximum(0);
+ hScroll.setSelection(0);
+ hScroll.setIncrement(1000);
+ hScroll.setVisible(true);
+ hScroll.addSelectionListener(scrollbarSelectionListener);
+
+ itemListScrollComp = new ScrolledComposite(this, SWT.V_SCROLL);
+ itemListScrollComp.setBackground(ColorResources.CHART_BOARD_BACK);
+ itemListScrollComp.addControlListener(new ControlListener() {
+ @Override
+ public void controlResized(ControlEvent e) {
+ setChartAxis();
+ }
+
+ @Override
+ public void controlMoved(ControlEvent e) {
+ }
+ });
+ itemListScrollComp.addPaintListener(new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ Rectangle rt = getClientArea();
+
+ e.gc.setBackground(ColorResources.WHITE);
+ e.gc.setForeground(ColorResources.CHART_BOARD_ITEM_LINE);
+ e.gc.fillRectangle(rt);
+
+ int height = (int) (chartHeight * itemRatio);
+ int nItemSize = rt.height / height + 1;
+ for (int i = 0; i < nItemSize; i++) {
+ e.gc.drawRectangle(rt.x, i * height - 1,
+ DAChartBoardItem.DEFAULT_NAME_CELL_WIDTH, height);
+ e.gc.drawRectangle(
+ DAChartBoardItem.DEFAULT_NAME_CELL_WIDTH, i
+ * height - 1, rt.width
+ - DAChartBoardItem.DEFAULT_NAME_CELL_WIDTH,
+ height);
+ }
+ }
+ });
+
+ itemList = new DAChartBoardItemList(this);
+ itemListScrollComp.setContent(itemList);
+ itemListScrollComp.setExpandHorizontal(true);
+ itemList.setLayout(new FormLayout());
+ itemList.addControlListener(new ControlListener() {
+
+ @Override
+ public void controlResized(ControlEvent e) {
+ if (null != boardManager) {
+ boardManager.timelineWidthChanged(itemList
+ .getItemChartWidth());
+ setChartAxis();
+ }
+ }
+
+ @Override
+ public void controlMoved(ControlEvent e) {
+ }
+ });
+
+ // layout
+ FormData data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(0, 0);
+ data.width = DEFAULT_CHARTBOARD_TITLE_BUTTON_WIDTH;
+ data.height = DEFAULT_CHARTBOARD_HEADER_HEIGHT;
+ titleComp.setLayoutData(data);
+ // titleButton.setLayoutData(data);
+
+ data = new FormData();
+ data.left = new FormAttachment(titleComp, 0);
+ data.top = new FormAttachment(0, 0);
+ // data.width = 0;
+ data.width = DEFAULT_CHARTBOARD_ZOOM_BUTTON_WIDTH;
+ data.height = DEFAULT_CHARTBOARD_HEADER_HEIGHT;
+ chartZoomButton.setLayoutData(data);
+
+ data = new FormData();
+ data.left = new FormAttachment(chartZoomButton, 0);
+ data.top = new FormAttachment(0, 0);
+ data.right = new FormAttachment(100, 0);
+ data.height = DEFAULT_CHARTBOARD_HEADER_HEIGHT - LifecycleBar.HEIGHT;
+ timeline.setLayoutData(data);
+
+ data = new FormData();
+ data.left = new FormAttachment(chartZoomButton, 0);
+ data.right = new FormAttachment(100, 0);
+ data.top = new FormAttachment(timeline, 0);
+ data.height = LifecycleBar.HEIGHT;
+ lifecycleBar.setLayoutData(data);
+
+ data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(titleComp, 0);
+ data.bottom = new FormAttachment(100, -20);
+ data.right = new FormAttachment(100, 0);
+ itemListScrollComp.setLayoutData(data);
+
+ data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(itemListScrollComp, 0);
+ data.bottom = new FormAttachment(100, 0);
+ data.width = DEFAULT_CHARTBOARD_SCALE_WIDTH;
+ data.height = DEFAULT_CHARTBOARD_FOOTER_HEIGHT;
+ scale.setLayoutData(data);
+
+ data = new FormData();
+ data.left = new FormAttachment(scale, 0);
+ data.right = new FormAttachment(100, 0);
+ data.top = new FormAttachment(itemListScrollComp, 0);
+ data.bottom = new FormAttachment(100, 0);
+ data.height = DEFAULT_CHARTBOARD_FOOTER_HEIGHT;
+ scrollComp.setLayoutData(data);
+
+ itemListScrollComp.layout();
+ boardManager = new DAChartBoardManager(this);
+ }
+
+ private void zoomoutItem(boolean bZoomout) {
+ if (true == bZoomout) {
+ itemRatio = DEFAULT_EXPAND_SMALL;
+ } else {
+ itemRatio = DEFAULT_EXPAND_MEDIUM;
+ }
+
+ itemListHeight = itemList.callbackZoom(itemRatio);
+ itemList.setSize(0, itemListHeight);
+
+ itemListScrollComp.redraw();
+ }
+
+ public boolean isZoomout() {
+ if (null == chartZoomButton) {
+ return false;
+ }
+ return chartZoomButton.isToggled();
+ }
+
+ public void setZoomout(boolean bZoomout) {
+ if (null == chartZoomButton || chartZoomButton.isToggled() == bZoomout) {
+ return;
+ }
+ chartZoomButton.setToggled(bZoomout);
+ zoomoutItem(bZoomout);
+ }
+
+ public int getVisibleStart() {
+ if (null == hScroll) {
+ return 0;
+ }
+
+ return hScroll.getSelection();
+ }
+
+ public void setVisibleStart(int val) {
+ if (null == hScroll || hScroll.getSelection() == val) {
+ return;
+ }
+
+ hScroll.setSelection(val);
+ boardManager.scrollbarSelectionChanged(val);
+ }
+
+ public int getScaleVal() {
+ if (null == scale) {
+ return 0;
+ }
+ return scale.getSelection();
+ }
+
+ public void setScaleVal(int sel) {
+ if (null == scale || scale.getSelection() == sel) {
+ return;
+ }
+
+ scale.setSelection(sel);
+
+ if (sel == 0) {
+ boardManager.scaleChanged(DAChartBoardManager.SCALE_100);
+ } else if (sel == 1) {
+ boardManager.scaleChanged(DAChartBoardManager.SCALE_400);
+ } else if (sel == 2) {
+ boardManager.scaleChanged(DAChartBoardManager.SCALE_800);
+ } else if (sel == 3) {
+ boardManager.scaleChanged(DAChartBoardManager.SCALE_1600);
+ } else if (sel == 4) {
+ boardManager.scaleChanged(DAChartBoardManager.SCALE_3200);
+ } else {
+ return;
+ }
+ }
+
+ private DAScaleSelectionListener scaleSelectionListener = new DAScaleSelectionListener() {
+
+ @Override
+ public void widgetSelected() {
+ int sel = scale.getSelection();
+
+ if (sel == 0
+ && boardManager.getScaleVal() != DAChartBoardManager.SCALE_100) {
+ boardManager.scaleChanged(DAChartBoardManager.SCALE_100);
+ } else if (sel == 1
+ && boardManager.getScaleVal() != DAChartBoardManager.SCALE_400) {
+ boardManager.scaleChanged(DAChartBoardManager.SCALE_400);
+ } else if (sel == 2
+ && boardManager.getScaleVal() != DAChartBoardManager.SCALE_800) {
+ boardManager.scaleChanged(DAChartBoardManager.SCALE_800);
+ } else if (sel == 3
+ && boardManager.getScaleVal() != DAChartBoardManager.SCALE_1600) {
+ boardManager.scaleChanged(DAChartBoardManager.SCALE_1600);
+ } else if (sel == 4
+ && boardManager.getScaleVal() != DAChartBoardManager.SCALE_3200) {
+ boardManager.scaleChanged(DAChartBoardManager.SCALE_3200);
+ } else {
+ return;
+ }
+ }
+ };
+
+ private SelectionListener scrollbarSelectionListener = new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ int sel = hScroll.getSelection();
+ boardManager.scrollbarSelectionChanged(sel);
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ };
+
+ private void setChartAxis() {
+ itemList.setChartAxis(getVisibleStartTime(), getVisibleEndTime());
+ }
+
+ protected void notifyScaleChanged(int scaleVal, double thumb,
+ double visibleStartTime) {
+ timeline.setScale(scaleVal);
+ timeline.setStartTime(visibleStartTime);
+ timeline.redraw();
+ lifecycleBar.setScale(scaleVal);
+ lifecycleBar.setVisibleStartTime(visibleStartTime);
+ lifecycleBar.redraw();
+ setScrollThumb((int) (thumb * 1000));
+ hScroll.setSelection((int) (visibleStartTime * 1000));
+ setChartAxis();
+ }
+
+ public void setVisibleStartTime(double time) {
+ boardManager.startTimeChanged(time);
+ }
+
+ public void setVisibleMiddleTime(double time) {
+ boardManager.middleTimeChanged(time);
+ }
+
+ protected void notifyScrollChanged(double visibleStartTime) {
+ timeline.setStartTime(visibleStartTime);
+ timeline.redraw();
+ lifecycleBar.setVisibleStartTime(visibleStartTime);
+ lifecycleBar.redraw();
+ setChartAxis();
+ }
+
+ protected void notifyVisibleStartTimeChanged(double visibleStartTime) {
+ timeline.setStartTime(visibleStartTime);
+ timeline.redraw();
+ lifecycleBar.setVisibleStartTime(visibleStartTime);
+ lifecycleBar.redraw();
+ hScroll.setSelection((int) (visibleStartTime * 1000));
+ setChartAxis();
+ }
+
+ private void notifyRangeTimeChanged() {
+ timeline.redraw();
+ }
+
+ public int getChartWidth() {
+ Rectangle rt;
+ if (null == (rt = scrollComp.getClientArea())) {
+ return 0;
+ } else {
+ return rt.width;
+ }
+ }
+
+ protected void setScrollThumb(int thumb) {
+ hScroll.setThumb(thumb);
+ hScroll.setPageIncrement(thumb);
+ }
+
+ protected void setScrollMaximum(int maximum) {
+ hScroll.setMaximum(maximum);
+ }
+
+ protected void setScrollSelection(int selection) {
+ hScroll.setSelection(selection);
+ }
+
+ protected void registeItem(DAChartBoardItem item) {
+ int listHeight = itemList.registeItem(item);
+ itemList.setSize(0, listHeight);
+ }
+
+ protected DAChartBoardItemList getChartComposite() {
+ return itemList;
+ }
+
+ protected void notifyResizeChild(DAChartBoardItem item) {
+ if (null == itemList) {
+ return;
+ }
+
+ int height = itemList.notifyResizeChild(item);
+ if (height == -1) {
+ return;
+ } else {
+ itemListHeight = height;
+ }
+
+ itemList.setSize(0, itemListHeight);
+ }
+
+ public void setTotalEndTime(long time) {
+ double endTime = (double) time / 1000000;
+
+ boardManager.totalEndTimeChanged(endTime);
+
+ itemList.setChartValidX(endTime);
+
+ timeline.setTotalEndTime(endTime);
+ lifecycleBar.setTotalEndTime(endTime);
+ }
+
+ public void contentsClear() {
+ itemList.contentsClear();
+ setTotalEndTime(0);
+ timeline.setStartTime(0);
+ lifecycleBar.clear();
+ if (null != oldImage) {
+ oldImage = null;
+ }
+ if (null != selectItem) {
+ selectItem = null;
+ }
+ if (intervalMarker != null) {
+ intervalMarker.setInterval(-1, -1);
+ }
+
+ timeline.getStartRangeMarker().setTime(-1);
+ timeline.getEndRangeMarker().setTime(-1);
+ notifyRangeTimeChanged();
+ }
+
+ public void clear() {
+ itemListHeight = 0;
+ itemList.clear();
+ itemList.setSize(0, 0);
+ setTotalEndTime(0);
+ timeline.clear();
+ lifecycleBar.clear();
+ if (null != oldImage) {
+ oldImage = null;
+ }
+ if (null != selectItem) {
+ selectItem = null;
+ }
+ intervalMarker = null;
+ }
+
+ public double getVisibleStartTime() {
+ return boardManager.getVisibleStartTime();
+ }
+
+ public double getVisibleEndTime() {
+ return boardManager.getVisibleEndTime();
+ }
+
+ private void setChartBackgroundImage(DAChart chart, Image image) {
+ if (null == chart) {
+ return;
+ }
+
+ DAChartPlot plot = chart.getPlot();
+ if (null == plot) {
+ return;
+ }
+ plot.setBackgroundImage(image);
+ chart.redraw();
+ }
+
+ protected void NotifyCallbackSelection(DAChartBoardItem item) {
+ selectRow(item);
+ }
+
+ private void selectRow(DAChartBoardItem item) {
+ if (false == bSelection) {
+ return;
+ }
+ if (null != selectItem) {
+ if (null != oldImage) {
+ setChartBackgroundImage(selectItem.getChart(), oldImage);
+ selectItem.selectItem(false);
+ }
+ }
+ selectItem = item;
+ if (null == item) {
+ return;
+ }
+ oldImage = selectItem.getChart().getPlot().getBackgroundImage();
+ setChartBackgroundImage(selectItem.getChart(),
+ ImageResources.CHART_BG_SELECT);
+ selectItem.selectItem(true);
+
+ if (null != selectionListenrers) {
+ for (int i = 0; i < selectionListenrers.size(); i++) {
+ selectionListenrers.get(i).handleSelectionEvent(selectItem);
+ }
+ }
+ }
+
+ public void selectItem(int index) {
+ int itemSize = itemList.getItemSize();
+
+ if (0 == itemSize || index >= itemSize) {
+ return;
+ }
+
+ DAChartBoardItem item = itemList.get(index);
+ selectRow(item);
+ itemListScrollComp.setOrigin(0, itemList.getItemYPos(index));
+ }
+
+ public void selectItem(int parentIndex, int childIndex) {
+ int itemSize = itemList.getItemSize();
+
+ if (0 == itemSize || parentIndex >= itemSize) {
+ return;
+ }
+ DAChartBoardItem item = itemList.get(parentIndex);
+
+ DAChartBoardItemList childList = item.getChildChartComposite();
+
+ int childSize = childList.getItemSize();
+
+ if (0 == childSize || childIndex >= childSize) {
+ return;
+ }
+ item.fold(false);
+ DAChartBoardItem childItem = childList.get(childIndex);
+ selectRow(childItem);
+ int selection = itemList.getItemYPos(parentIndex)
+ + childList.getItemYPos(childIndex);
+ itemListScrollComp.setOrigin(0, selection);
+ }
+
+ public void addSelectionListener(DAChartBoardSelectionListener listener) {
+ if (null == selectionListenrers) {
+ selectionListenrers = new ArrayList<DAChartBoardSelectionListener>();
+ }
+ selectionListenrers.add(listener);
+ }
+
+ public Composite getTitleComp() {
+ return titleComp;
+ }
+
+ private void initIntervalMarker() {
+ intervalMarker = new DAChartPlotIntervalMarker(-1, -1);
+ intervalMarker.setBackgroundColor(ColorResources.CHART_SELECTION_RANGE);
+ intervalMarker.setAlpha((int) (255 * 0.25));
+ }
+
+ public DAChartPlotIntervalMarker getIntervalMarker() {
+ if (null == intervalMarker) {
+ initIntervalMarker();
+ }
+
+ return intervalMarker;
+ }
+
+ public boolean isSelection() {
+ return bSelection;
+ }
+
+ public void setSelection(boolean bSelection) {
+ this.bSelection = bSelection;
+ }
+
+ protected double getItemHeightRatio() {
+ return itemRatio;
+ }
+
+ public LifecycleBar getLifecycleBar() {
+ return lifecycleBar;
+ }
+
+ public void setRangeStartTime(double time) {
+ if (time < 0) {
+ timeline.getStartRangeMarker().setTime(time);
+ } else {
+ double endTime = timeline.getEndRangeMarker().getTime();
+ if (endTime < 0) {
+ timeline.getStartRangeMarker().setTime(time);
+ } else {
+ if (time > endTime) {
+ timeline.getEndRangeMarker().setTime(-1);
+ }
+ timeline.getStartRangeMarker().setTime(time);
+ }
+ }
+
+ notifyRangeTimeChanged();
+ }
+
+ public void setRangeEndTime(double time) {
+ if (time < 0) {
+ timeline.getEndRangeMarker().setTime(time);
+ } else {
+ double startTime = timeline.getStartRangeMarker().getTime();
+ if (startTime < 0) {
+ timeline.getEndRangeMarker().setTime(time);
+ } else {
+ if (time < startTime) {
+ timeline.getStartRangeMarker().setTime(-1);
+ }
+ timeline.getEndRangeMarker().setTime(time);
+ }
+ }
+
+ notifyRangeTimeChanged();
+ }
+
+ private MouseTrackAdapter timelineMouseTrackAdapter = new MouseTrackAdapter() {
+ public void mouseHover(MouseEvent e) {
+ String tooltipMessage = lifecycleBar.getTooltipMessage(e.x);
+ if (tooltipMessage == null) {
+ timelineTooltip.deactivate();
+ lifecycleBarTooltip.deactivate();
+ } else {
+ timelineTooltip.setText(tooltipMessage);
+ timelineTooltip.activate();
+ lifecycleBarTooltip.setText(tooltipMessage);
+ lifecycleBarTooltip.activate();
+ }
+ }
+ };
+
+ public void hideItem(int index) {
+
+ int listHeight = itemList.hideItem(index);
+ itemList.setSize(0, listHeight);
+ }
+
+ public void showItem(int index) {
+ int listHeight = itemList.showItem(index);
+ itemList.setSize(0, listHeight);
+ }
+
+ public void reArrangeItem(Integer a[]) {
+ itemList.reArrangeItem(a);
+ }
+
+ public void setRange(double startTime, double endTime) {
+ itemList.setRange(startTime, endTime);
+ }
+
+ public double getSelectionStartTime() {
+ return intervalMarker.getStartVal();
+ }
+
+ public double getSelectionEndTime() {
+ return intervalMarker.getEndVal();
+ }
+
+ protected Composite getListComposite() {
+ return itemListScrollComp;
+ }
+
+ public DACustomTimeline getTimeline() {
+ return timeline;
+ }
+
+ public Font getNameFont() {
+ if (null == nameFont) {
+ nameFont = FontResources.CHART_ITEM_NAME_FONT;
+ }
+ return nameFont;
+ }
+
+ public void setNameFont(Font nameFont) {
+ this.nameFont = nameFont;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.widgets.chartBoard;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
+
+public class DAChartBoardItem extends Composite {
+ private DAChartBoard parentBoard = null;
+ private DAChartBoardItem parentItem = null;
+ private DAChartBoardItemCell itemCell = null;
+ private DAChartBoardItemList childList = null;
+ // private String itemName;
+
+ private double expandRatio;
+ private double normalRatio;
+
+ private boolean isFold = true;
+ private boolean isHide = false;
+
+ // private boolean isExpand = false;
+ public final static int DEFAULT_ITEM_HEIGHT = 80; // FIXME get from
+ public final static int DEFAULT_NAME_CELL_WIDTH = 99;
+ private int depth = 0;
+
+ private int itemCellHeight = 0;
+ private int itemChildListHeight = 0;
+
+ private void initWidget(String name, Image icon) {
+ initWidget(name, icon, DAChart.CHART_STYLE_NORMAL);
+ }
+
+ private void initWidget(String name, Image icon, int chartStyle) {
+ this.setLayout(new FormLayout());
+ itemCell = new DAChartBoardItemCell(this, name, icon, chartStyle);
+ initRatio();
+ itemCell.addExpandToggleButton();
+
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.left = new FormAttachment(0, 0);
+ data.right = new FormAttachment(100, 0);
+ data.height = (int) (normalRatio * DEFAULT_ITEM_HEIGHT);
+ itemCell.setLayoutData(data);
+ this.layout();
+ }
+
+ public DAChartBoardItem(DAChartBoard parent, String itemName) {
+ super(parent.getChartComposite(), SWT.NONE);
+ parentBoard = parent;
+ initWidget(itemName, null);
+ parentBoard.registeItem(this);
+ }
+
+ public DAChartBoardItem(DAChartBoard parent, String itemName, Image icon,
+ int chartStyle) {
+ super(parent.getChartComposite(), SWT.NONE);
+ parentBoard = parent;
+ initWidget(itemName, icon, chartStyle);
+ parentBoard.registeItem(this);
+ }
+
+ public DAChartBoardItem(DAChartBoardItem parent, String itemName) {
+ super(parent.getChildChartComposite(), SWT.NONE);
+ parentItem = parent;
+ depth = parent.getDepth() + 1;
+ initWidget(itemName, null);
+ parentItem.registeItem(this);
+ }
+
+ public DAChartBoardItem(DAChartBoardItem parent, String itemName,
+ Image icon, int chartStyle) {
+ super(parent.getChildChartComposite(), SWT.NONE);
+ parentItem = parent;
+ depth = parent.getDepth() + 1;
+ initWidget(itemName, icon, chartStyle);
+ parentItem.registeItem(this);
+ }
+
+ protected double getItemHeightRatio() {
+ double itemHeightRatio;
+ if (null != parentBoard) {
+ itemHeightRatio = parentBoard.getItemHeightRatio();
+ } else if (null != parentItem) {
+ itemHeightRatio = parentItem.getItemHeightRatio();
+ } else {
+ itemHeightRatio = DAChartBoard.DEFAULT_EXPAND_MAX;
+ }
+ return itemHeightRatio;
+ }
+
+ protected void initRatio() {
+ normalRatio = getItemHeightRatio();
+ expandRatio = normalRatio;
+ }
+
+ public void useExpand(boolean bUseExpand) {
+ if (true == bUseExpand) {
+ itemCell.addExpandToggleButton();
+ } else {
+ itemCell.removeExpandToggleButton();
+ }
+ }
+
+ protected int getDepth() {
+ return depth;
+ }
+
+ private void callNotifyResizeChild() {
+ if (null != parentBoard) {
+ parentBoard.notifyResizeChild(this);
+ } else if (null != parentItem) {
+ parentItem.notifyResizeChild(this);
+ } else {
+ return;
+ }
+ }
+
+ private void notifyResizeChild(DAChartBoardItem item) {
+ int height = childList.notifyResizeChild(item);
+
+ if (height == -1) {
+ return;
+ }
+ itemChildListHeight = height;
+
+ FormData data = (FormData) childList.getLayoutData();
+ data.height = itemChildListHeight;
+ childList.setLayoutData(data);
+ this.layout();
+ callNotifyResizeChild();
+ }
+
+ private int expandItem() {
+ itemCellHeight = (int) (expandRatio * DEFAULT_ITEM_HEIGHT);
+ FormData data = (FormData) itemCell.getLayoutData();
+ data.height = itemCellHeight;
+ itemCell.setLayoutData(data);
+ this.layout();
+ return itemCellHeight;
+ }
+
+ protected void registeItem(DAChartBoardItem child) {
+ if (0 == childList.getItemSize()) {
+ itemCell.addChildFoldToggleButton();
+ }
+ int chartListHeight = childList.registeItem(child);
+
+ itemChildListHeight = chartListHeight;
+ FormData data = (FormData) childList.getLayoutData();
+ data.height = itemChildListHeight;
+ childList.setLayoutData(data);
+ this.layout();
+ callNotifyResizeChild();
+ }
+
+ protected void callbackFold(boolean bFold) {
+ if (isFold == bFold) {
+ return;
+ }
+ isFold = bFold;
+ childList.setFold(isFold);
+
+ FormData data = (FormData) childList.getLayoutData();
+ if (false == isFold) {
+ data.height = itemChildListHeight;
+ } else {
+ data.height = 0;
+ }
+ childList.setLayoutData(data);
+
+ this.layout();
+ callNotifyResizeChild();
+ }
+
+ protected void callbackExpand(boolean bExpand) {
+ if (true == bExpand) {
+ expandRatio = DAChartBoard.DEFAULT_EXPAND_MAX;
+ } else {
+ expandRatio = normalRatio;
+ }
+ expandItem();
+ callNotifyResizeChild();
+ }
+
+ protected int callbackZoom(double zoomRatio) {
+ normalRatio = zoomRatio;
+ expandRatio = normalRatio;
+
+ if (null != childList) {
+ itemChildListHeight = childList.callbackZoom(zoomRatio);
+ FormData data = (FormData) childList.getLayoutData();
+ data.height = itemChildListHeight;
+ childList.setLayoutData(data);
+ this.layout();
+ }
+
+ itemCell.setExpandButtonNormal();
+ itemCellHeight = expandItem();
+
+ return getItemHeight();
+ }
+
+ protected void NotifyCallbackSelection(DAChartBoardItem item) {
+ if (null != parentBoard) {
+ parentBoard.NotifyCallbackSelection(item);
+ } else if (null != parentItem) {
+ parentItem.NotifyCallbackSelection(item);
+ } else {
+ return;
+ }
+ }
+
+ protected void callbackSelect(boolean bSelect) {
+ if (true == bSelect) {
+ NotifyCallbackSelection(this);
+ } else {
+ NotifyCallbackSelection(null);
+ }
+ }
+
+ protected DAChartBoardItemList getChildChartComposite() {
+ if (null == childList) {
+ childList = new DAChartBoardItemList(this);
+ childList.setLayout(new FormLayout());
+ FormData data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(itemCell, 0);
+ data.right = new FormAttachment(100, 0);
+ data.height = 0;
+ childList.setLayoutData(data);
+ childList.setFold(true);
+ childList.setItemRatio(normalRatio);
+ this.layout();
+ }
+ return childList;
+ }
+
+ public Composite getChartComposite() {
+ if (null == itemCell) {
+ return null;
+ } else {
+ return itemCell.getChartCell();
+ }
+ }
+
+ public DAChart getChart() {
+ if (null == itemCell) {
+ return null;
+ }
+ return itemCell.getChartCell();
+ }
+
+ protected void setChartAxis(double startX, double endX) {
+ DAChart chart = getChart();
+ if (null == chart) {
+ return;
+ }
+
+ DAChartPlot plot = chart.getPlot();
+
+ if (null == plot) {
+ return;
+ }
+ plot.setAxisRangeX(startX, endX);
+ chart.redraw();
+
+ if (null == childList) {
+ return;
+ }
+
+ childList.setChartAxis(startX, endX);
+ }
+
+ protected void setChartValidX(double endX) {
+ DAChart chart = getChart();
+ if (null == chart) {
+ return;
+ }
+
+ DAChartPlot plot = chart.getPlot();
+
+ if (null == plot) {
+ return;
+ }
+ plot.setValidEndX(endX);
+ chart.redraw();
+
+ if (null == childList) {
+ return;
+ }
+
+ childList.setChartValidX(endX);
+ }
+
+ protected void selectItem(boolean select) {
+ itemCell.setSelectCell(select);
+ }
+
+ public void setNameNormalImage(Image image) {
+ itemCell.setNameCellNormalImage(image);
+ }
+
+ public void setNameSelectImage(Image image) {
+ itemCell.setNameCellSelectImage(image);
+ }
+
+ public void clear() {
+ if (null != childList) {
+ childList.clear();
+ }
+ itemCell.getChartCell().clear();
+
+ }
+
+ public void contentsClear() {
+ if (null != childList) {
+ childList.contentsClear();
+ }
+
+ itemCell.getChartCell().contentsClear();
+
+ }
+
+ public boolean setHide(boolean isHide) {
+ if (this.isHide == isHide) {
+ return false;
+ } else {
+ this.isHide = isHide;
+ if (false == isHide) {
+ // itemCellHeight = (int) (expandRatio * DEFAULT_ITEM_HEIGHT);
+ FormData data = (FormData) itemCell.getLayoutData();
+ data.height = getItemHeight();
+ itemCell.setLayoutData(data);
+ this.layout();
+ }
+ return true;
+ }
+ }
+
+ protected void setChartRange(double startX, double endX) {
+ DAChart chart = getChart();
+ if (null == chart) {
+ return;
+ }
+
+ DAChartPlot plot = chart.getPlot();
+
+ if (null == plot) {
+ return;
+ }
+ plot.setHightlights(startX, endX);
+ chart.redraw();
+
+ if (null != childList) {
+ childList.setRange(startX, endX);
+ }
+ }
+
+ public void setItemCellHeight(int itemCellHeight) {
+ this.itemCellHeight = itemCellHeight;
+ }
+
+ public int getItemCellHeight() {
+ return itemCellHeight;
+ }
+
+ public int getItemHeight() {
+ if (true == isHide) {
+ return 0;
+ } else if (true == isFold) {
+ return itemCellHeight;
+ } else {
+ return itemCellHeight + itemChildListHeight;
+ }
+ }
+
+ public void fold(boolean bFold) {
+ if (isFold == bFold) {
+ return;
+ }
+ itemCell.foldChild(bFold);
+ }
+
+ public Font getNameFont() {
+ if (null != parentBoard) {
+ return parentBoard.getNameFont();
+ } else if (null != parentItem) {
+ return parentItem.getNameFont();
+ } else {
+ return null;
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.widgets.chartBoard;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
+import org.tizen.dynamicanalyzer.widgets.button.toggle.DACustomToggleButton;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
+
+class DAChartBoardItemCell extends Composite {
+ private DAChartBoardItem parent;
+ private Canvas nameCell;
+ private DAChart chartCell;
+ private DACustomToggleButton childFoldButton;
+ private DACustomToggleButton expandButton;
+ private final static int DEFAULT_FOLD_TOGGLE_BUTTON_SIZE = 10;
+ private final static int DEFAULT_EXPAND_TOGGLE_BUTTON_SIZE = 16;
+ private final static int DEFAULT_TOGGLE_BUTTON_MARGIN = 5;
+ private final static int DEFAULT_NAME_ICON_MARGIN = 5;
+ private int nameCellWidth = DAChartBoardItem.DEFAULT_NAME_CELL_WIDTH;
+ private boolean selectCell = false;
+ private Image nameCellNormalImage;
+ private Image nameCellSelectImage;
+ private Image nameCellCurrentImage;
+ private String itemName;
+ private Image itemIcon;
+ private Image foldBackBuffer;
+
+ // private Rectangle itemNamePoint;
+ // private Rectangle itemIconPoint;
+
+ protected DAChartBoardItemCell(final DAChartBoardItem parent, String name,
+ Image icon, int chartStyle) {
+ super(parent, SWT.NONE);
+ this.parent = parent;
+ setItemName(name);
+ setItemIcon(icon);
+ this.setBackground(ColorResources.CHART_BOARD_ITEM_LINE);
+ this.setLayout(new FormLayout());
+
+ nameCell = new Canvas(this, SWT.NONE);
+ if (parent.getDepth() == 0) {
+ setNameCellNormalImage(ImageResources.CHART_NAME_BG_NORMAL);
+ setNameCellSelectImage(ImageResources.CHART_NAME_BG_SELECT);
+ } else {
+ setNameCellNormalImage(ImageResources.CHART_NAME_CHILD_BG_NORMAL);
+ setNameCellSelectImage(ImageResources.CHART_NAME_CHILD_BG_SELECT);
+ }
+ nameCellCurrentImage = nameCellNormalImage;
+ redrawFoldBackground();
+ nameCell.addPaintListener(new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ Rectangle rect = ((Canvas) (e.widget)).getClientArea();
+
+ if (null != nameCellCurrentImage) {
+ Rectangle imageRect = nameCellCurrentImage.getBounds();
+ e.gc.drawImage(nameCellCurrentImage, imageRect.x,
+ imageRect.y, imageRect.width, imageRect.height,
+ rect.x, rect.y, rect.width, rect.height);
+ }
+
+ e.gc.setForeground(ColorResources.BLACK);
+ e.gc.setFont(parent.getNameFont());
+ drawNameIcon(e.gc, rect);
+ }
+ });
+ nameCell.addMouseListener(new MouseListener() {
+
+ @Override
+ public void mouseUp(MouseEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void mouseDown(MouseEvent e) {
+ parent.callbackSelect(true);
+ }
+
+ @Override
+ public void mouseDoubleClick(MouseEvent e) {
+ if (null == childFoldButton) {
+ return;
+ }
+ boolean isToggle = childFoldButton.isToggled();
+ childFoldButton.setToggled(!isToggle);
+ parent.callbackFold(isToggle);
+
+ }
+ });
+
+ nameCell.setLayout(new FormLayout());
+
+ chartCell = new DAChart(this, itemName, chartStyle);
+ chartCell.addMouseListener(new MouseListener() {
+
+ @Override
+ public void mouseUp(MouseEvent e) {
+ }
+
+ @Override
+ public void mouseDown(MouseEvent e) {
+ parent.callbackSelect(true);
+ }
+
+ @Override
+ public void mouseDoubleClick(MouseEvent e) {
+ }
+ });
+
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.bottom = new FormAttachment(100, -1);
+ data.left = new FormAttachment(0, 0);
+ data.width = nameCellWidth;
+ nameCell.setLayoutData(data);
+
+ data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.bottom = new FormAttachment(100, -1);
+ data.left = new FormAttachment(nameCell, 0);
+ data.right = new FormAttachment(100, 0);
+ chartCell.setLayoutData(data);
+ }
+
+ protected void foldChild(boolean bFold) {
+ if (null == childFoldButton) {
+ System.out.println("error - childFoldButton is not exist");
+ return;
+ }
+ boolean isFold = !childFoldButton.isToggled();
+ if (isFold == bFold) {
+ return;
+ }
+ childFoldButton.setToggled(!bFold);
+ parent.callbackFold(bFold);
+ }
+
+ protected void addChildFoldToggleButton() {
+ if (null != childFoldButton) {
+ return;
+ }
+ childFoldButton = new DACustomToggleButton(nameCell,
+ ImageResources.TREE_FOLD, ImageResources.TREE_FOLD,
+ ImageResources.TREE_FOLD, null, ImageResources.TREE_OPEN,
+ ImageResources.TREE_OPEN);
+
+ childFoldButton
+ .addClickListener(new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ boolean bToggled = childFoldButton.isToggled();
+ parent.callbackSelect(true);
+ parent.callbackFold(!bToggled);
+ nameCell.redraw();
+ }
+ });
+
+ FormData data = new FormData();
+ data.top = new FormAttachment(50,
+ -(DEFAULT_FOLD_TOGGLE_BUTTON_SIZE / 2));
+ data.left = new FormAttachment(0, DEFAULT_TOGGLE_BUTTON_MARGIN);
+ data.width = DEFAULT_FOLD_TOGGLE_BUTTON_SIZE;
+ data.height = DEFAULT_FOLD_TOGGLE_BUTTON_SIZE;
+ childFoldButton.setLayoutData(data);
+ childFoldButton.setVisible(true);
+ nameCell.layout();
+
+ foldBackBuffer = new Image(Display.getDefault(),
+ DEFAULT_FOLD_TOGGLE_BUTTON_SIZE,
+ DEFAULT_FOLD_TOGGLE_BUTTON_SIZE);
+ redrawFoldBackground();
+ }
+
+ protected void addExpandToggleButton() {
+ if (null != expandButton) {
+ return;
+ }
+ expandButton = new DACustomToggleButton(nameCell,
+ ImageResources.CHART_FULL_NORMAL,
+ ImageResources.CHART_FULL_PUSH,
+ ImageResources.CHART_FULL_HOVER, null,
+ ImageResources.CHART_RESTORE_NORMAL,
+ ImageResources.CHART_RESTORE_HOVER);
+
+ expandButton.addClickListener(new DACustomButtonClickEventListener() {
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ boolean bToggled = expandButton.isToggled();
+ parent.callbackSelect(true);
+ parent.callbackExpand(bToggled);
+ nameCell.redraw();
+ }
+ });
+
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, DEFAULT_TOGGLE_BUTTON_MARGIN);
+ data.right = new FormAttachment(100, -DEFAULT_TOGGLE_BUTTON_MARGIN);
+ data.width = DEFAULT_EXPAND_TOGGLE_BUTTON_SIZE;
+ data.height = DEFAULT_EXPAND_TOGGLE_BUTTON_SIZE;
+ expandButton.setLayoutData(data);
+ expandButton.setVisible(true);
+ nameCell.layout();
+ }
+
+ protected void removeExpandToggleButton() {
+ expandButton.dispose();
+ expandButton = null;
+ }
+
+ protected void setExpandButtonNormal() {
+ if (null != expandButton) {
+ expandButton.setToggled(false);
+ }
+ }
+
+ protected DAChart getChartCell() {
+ return chartCell;
+ }
+
+ private void drawNameIcon(GC gc, Rectangle nameCellRect) {
+ if (null == itemName) {
+ return;
+ }
+ Point allNamep = gc.textExtent(itemName, SWT.DRAW_DELIMITER);
+ Rectangle iconRect;
+
+ int startY = nameCellRect.height / 2 - allNamep.y / 2;
+
+ // drawIcon
+ if (null != itemIcon) {
+ iconRect = itemIcon.getBounds();
+ int NameIconHeight = allNamep.y + iconRect.height
+ + DEFAULT_NAME_ICON_MARGIN;
+ if (NameIconHeight < nameCellRect.height) {
+ startY = nameCellRect.height / 2 - NameIconHeight / 2;
+ gc.drawImage(itemIcon, nameCellRect.width / 2 - iconRect.width
+ / 2, startY);
+ startY += iconRect.height;
+ }
+ }
+
+ // drawName
+ String[] temp = itemName.split("\n");
+ int lineLength = temp.length;
+ Point[] p = new Point[lineLength];
+ int middleX = nameCellRect.width / 2;
+
+ for (int i = 0; i < lineLength; i++) {
+ p[i] = gc.textExtent(temp[i]);
+ gc.drawText(temp[i], middleX - p[i].x / 2, startY, true);
+ startY += p[i].y;
+ }
+ }
+
+ protected boolean isSelectCell() {
+ return selectCell;
+ }
+
+ protected void setSelectCell(boolean selectCell) {
+ this.selectCell = selectCell;
+ if (true == selectCell) {
+ nameCellCurrentImage = nameCellSelectImage;
+ } else {
+ nameCellCurrentImage = nameCellNormalImage;
+ }
+ redrawFoldBackground();
+ nameCell.redraw();
+ }
+
+ protected Image getNameCellNormalImage() {
+ return nameCellNormalImage;
+ }
+
+ protected void setNameCellNormalImage(Image nameCellNormalImage) {
+ this.nameCellNormalImage = nameCellNormalImage;
+ }
+
+ protected Image getNameCellSelectImage() {
+ return nameCellSelectImage;
+ }
+
+ protected void setNameCellSelectImage(Image nameCellSelectImage) {
+ this.nameCellSelectImage = nameCellSelectImage;
+ }
+
+ public String getItemName() {
+ return itemName;
+ }
+
+ public void setItemName(String itemName) {
+ this.itemName = itemName;
+ }
+
+ public Image getItemIcon() {
+ return itemIcon;
+ }
+
+ public void setItemIcon(Image itemIcon) {
+ this.itemIcon = itemIcon;
+ }
+
+ private void redrawFoldBackground() {
+ if (null == childFoldButton) {
+ return;
+ }
+ GC bufGc = new GC(foldBackBuffer);
+ Rectangle nameCellRect = nameCell.getClientArea();
+ Rectangle imageRect = nameCellCurrentImage.getBounds();
+ int copyHeight = DEFAULT_FOLD_TOGGLE_BUTTON_SIZE * imageRect.height
+ / nameCellRect.height;
+
+ bufGc.drawImage(nameCellCurrentImage, 0, imageRect.height / 2
+ - copyHeight / 2, 1, copyHeight, 0, 0,
+ DEFAULT_FOLD_TOGGLE_BUTTON_SIZE,
+ DEFAULT_FOLD_TOGGLE_BUTTON_SIZE);
+
+ childFoldButton.setBackgroundImage(foldBackBuffer);
+ childFoldButton.redraw();
+ bufGc.dispose();
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.chartBoard;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Composite;
+
+class DAChartBoardItemList extends Composite {
+ private List<DAChartBoardItem> items = new ArrayList<DAChartBoardItem>();
+ private int defaultItemHeight = DAChartBoard.DEFAULT_CHART_ZOOMIN_HEIGHT;
+ private double itemRatio = 1;
+ private boolean isFold = false;
+ private int listHeight = 0;
+
+ public DAChartBoardItemList(DAChartBoard parent) {
+ super(parent.getListComposite(), SWT.NONE);
+ }
+
+ public DAChartBoardItemList(DAChartBoardItem parent) {
+ super(parent, SWT.NONE);
+ }
+
+ public int registeItem(DAChartBoardItem item) {
+ int itemHeight = (int) (defaultItemHeight * itemRatio);
+ listHeight += itemHeight;
+ FormData data = new FormData();
+ int itemSize = items.size();
+ if (0 == itemSize) {
+ data.top = new FormAttachment(0, 0);
+ } else {
+ data.top = new FormAttachment(items.get(itemSize - 1), 0);
+ }
+ data.left = new FormAttachment(0, 0);
+ data.right = new FormAttachment(100, 0);
+
+ data.height = itemHeight;
+
+ item.setLayoutData(data);
+ item.setItemCellHeight(itemHeight);
+
+ items.add(item);
+ this.layout();
+
+ return listHeight;
+ }
+
+ public int getDefaultItemHeight() {
+ return defaultItemHeight;
+ }
+
+ public void setDefaultItemHeight(int defaultItemHeight) {
+ this.defaultItemHeight = defaultItemHeight;
+ }
+
+ public double getItemRatio() {
+ return itemRatio;
+ }
+
+ public void setItemRatio(double itemRatio) {
+ this.itemRatio = itemRatio;
+ }
+
+ public boolean isFold() {
+ return isFold;
+ }
+
+ public void setFold(boolean isFold) {
+ this.isFold = isFold;
+ }
+
+ public int getNewItemHeight() {
+ return (int) (defaultItemHeight * itemRatio);
+ }
+
+ public int getListHeight() {
+ return listHeight;
+ }
+
+ public int notifyResizeChild(DAChartBoardItem item) {
+ int listHeight = 0;
+ DAChartBoardItem child;
+ for (int i = 0; i < items.size(); i++) {
+ child = items.get(i);
+ int itemHeight = child.getItemHeight();
+ listHeight += itemHeight;
+ if (child.equals(item)) {
+ FormData data = (FormData) child.getLayoutData();
+ data.height = itemHeight;
+ child.setLayoutData(data);
+ this.layout();
+ }
+ }
+ if (this.listHeight != listHeight) {
+ this.listHeight = listHeight;
+ return this.listHeight;
+ } else {
+ return -1;
+ }
+ }
+
+ public int getItemSize() {
+ return items.size();
+ }
+
+ protected int callbackZoom(double zoomRatio) {
+ itemRatio = zoomRatio;
+ if (null == items) {
+ return 0;
+ }
+ int itemsSize = items.size();
+ DAChartBoardItem item;
+ int itemHeight;
+ listHeight = 0;
+ for (int i = 0; i < itemsSize; i++) {
+ item = items.get(i);
+ itemHeight = item.callbackZoom(zoomRatio);
+ FormData data = (FormData) item.getLayoutData();
+ data.height = itemHeight;
+ item.setLayoutData(data);
+ this.layout();
+ listHeight += itemHeight;
+ }
+
+ return listHeight;
+ }
+
+ protected void setChartAxis(double startX, double endX) {
+ if (null == items) {
+ return;
+ }
+ int itemsSize = items.size();
+ for (int i = 0; i < itemsSize; i++) {
+ items.get(i).setChartAxis(startX, endX);
+ }
+ }
+
+ protected void setChartValidX(double endX) {
+ if (null == items) {
+ return;
+ }
+ int itemsSize = items.size();
+ for (int i = 0; i < itemsSize; i++) {
+ items.get(i).setChartValidX(endX);
+ }
+ }
+
+ public void clear() {
+ if (null == items) {
+ return;
+ }
+ int itemsSize = items.size();
+ for (int i = 0; i < itemsSize; i++) {
+ items.get(i).dispose();
+ }
+ items.clear();
+ listHeight = 0;
+ }
+
+ public void contentsClear() {
+ if (null == items) {
+ return;
+ }
+ int itemsSize = items.size();
+ for (int i = 0; i < itemsSize; i++) {
+ items.get(i).contentsClear();
+ }
+ }
+
+ public int hideItem(int index) {
+ if (null == items) {
+ return -1;
+ }
+ int itemsSize = items.size();
+
+ if (index >= itemsSize || index < 0) {
+ return -1;
+ }
+
+ DAChartBoardItem child = items.get(index);
+ int height = child.getItemHeight();
+
+ if (true == child.setHide(true)) {
+ listHeight -= height;
+ FormData data = (FormData) child.getLayoutData();
+ data.height = 0;
+ child.setLayoutData(data);
+ this.layout();
+
+ }
+ return listHeight;
+ }
+
+ public int showItem(int index) {
+ if (null == items) {
+ return -1;
+ }
+ int itemsSize = items.size();
+
+ if (index >= itemsSize || index < 0) {
+ return -1;
+ }
+
+ DAChartBoardItem child = items.get(index);
+
+ if (true == child.setHide(false)) {
+ int height = child.getItemHeight();
+ listHeight += height;
+ FormData data = (FormData) child.getLayoutData();
+ data.height = height;
+ child.setLayoutData(data);
+ this.layout();
+ }
+
+ return listHeight;
+ }
+
+ public void reArrangeItem(Integer a[]) {
+ if (null == items) {
+ return;
+ }
+ int itemSize = items.size();
+
+ if (a.length != itemSize) {
+ return;
+ }
+
+ int index;
+ DAChartBoardItem temp;
+ FormData data;
+ List<DAChartBoardItem> itemsTemp = new ArrayList<DAChartBoardItem>();
+
+ for (int i = 0; i < itemSize; i++) {
+ index = a[i];
+ temp = items.get(index);
+ data = (FormData) temp.getLayoutData();
+ if (0 == i) {
+ data.top = new FormAttachment(0, 0);
+ } else {
+ data.top = new FormAttachment(itemsTemp.get(i - 1), 0);
+ }
+ temp.setLayoutData(data);
+ itemsTemp.add(temp);
+ }
+ items.clear();
+ items.addAll(itemsTemp);
+ itemsTemp.clear();
+ itemsTemp = null;
+ }
+
+ public void setRange(double startTime, double endTime) {
+ if (null == items) {
+ return;
+ }
+ int itemsSize = items.size();
+ for (int i = 0; i < itemsSize; i++) {
+ items.get(i).setChartRange(startTime, endTime);
+ }
+ }
+
+ public int getItemChartWidth(){
+ int ret = getClientArea().width - DAChartBoardItem.DEFAULT_NAME_CELL_WIDTH;
+
+ if(ret < 0){
+ ret = 0;
+ }
+ return ret;
+ }
+
+ protected DAChartBoardItem get(int index){
+ int itemSize = items.size();
+ if(index >= itemSize){
+ return null;
+ }
+ return items.get(index);
+ }
+
+ protected int getItemYPos(int index){
+ int pos = 0;
+ int itemSize = items.size();
+ if(itemSize == 0 || index >= itemSize){
+ return -1;
+ }
+ for(int i=0; i<index; i++){
+ pos += items.get(i).getItemHeight();
+ }
+ return pos;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.widgets.chartBoard;
+
+import org.tizen.dynamicanalyzer.widgets.timeline.DACustomTimelineRenderer;
+
+class DAChartBoardManager {
+ public final static int SCALE_100 = 1;
+ public final static int SCALE_400 = 4;
+ public final static int SCALE_800 = 8;
+ public final static int SCALE_1600 = 16;
+ public final static int SCALE_3200 = 32;
+
+ private int chartWidth = 0;
+ private double totalStartTime = 0;
+ private double totalEndTime = 0;
+ private double visibleStartTime = 0;
+ private int scaleVal = SCALE_100;
+ private double thumb = 1;
+
+ private DAChartBoard board = null;
+
+ public DAChartBoardManager(DAChartBoard board) {
+ this.board = board;
+ }
+
+ public double getTotalStartTime() {
+ return totalStartTime;
+ }
+
+ public void setTotalStartTime(double totalStartTime) {
+ this.totalStartTime = totalStartTime;
+ }
+
+ public double getTotalEndTime() {
+ return totalEndTime;
+ }
+
+ public void setTotalEndTime(double totalEndTime) {
+ this.totalEndTime = totalEndTime;
+ }
+
+ public double getVisibleStartTime() {
+ return visibleStartTime;
+ }
+
+ public void setVisibleStartTime(double visibleStartTime) {
+ this.visibleStartTime = visibleStartTime;
+ }
+
+ public double getVisibleEndTime() {
+ return visibleStartTime + thumb;
+ }
+
+ public int getScaleVal() {
+ return scaleVal;
+ }
+
+ public void scaleChanged(int scaleVal) {
+ this.scaleVal = scaleVal;
+
+ double newThumb = computeThumb(chartWidth, scaleVal);
+
+ visibleStartTime = computeVisibleStartTime(thumb, newThumb,
+ totalEndTime);
+ thumb = newThumb;
+
+ board.notifyScaleChanged(scaleVal, thumb, visibleStartTime);
+ }
+
+ public void scrollbarSelectionChanged(int sel) {
+ visibleStartTime = (double) sel / 1000.0;
+ board.notifyScrollChanged(visibleStartTime);
+ }
+
+ public void startTimeChanged(double time){
+ if (time+thumb > totalEndTime){
+ time = totalEndTime - thumb;
+ }
+ if(time < 0){
+ time = 0;
+ }
+ visibleStartTime = time;
+ board.notifyVisibleStartTimeChanged(visibleStartTime);
+ }
+
+ public void middleTimeChanged(double middleTime) {
+ double startTime = middleTime - thumb / 2;
+ startTimeChanged(startTime);
+ }
+
+ public void totalEndTimeChanged(double totalEndTime) {
+ totalEndTime += 1;
+ board.setScrollMaximum((int) (totalEndTime * 1000));
+ board.setScrollThumb((int) (thumb * 1000));
+ int visibleEnd = (int) (visibleStartTime * 1000) + (int) (thumb * 1000);
+ int realEnd = (int) (this.totalEndTime * 1000);
+ int distance = realEnd - visibleEnd;
+ if (distance > -1000 && distance < 1000) { //Tolerances
+ visibleStartTime = totalEndTime - thumb;
+ if(visibleStartTime < 0){
+ visibleStartTime = 0;
+ }
+ board.setScrollSelection((int) (visibleStartTime * 1000));
+ board.notifyScrollChanged(visibleStartTime);
+ }
+ this.totalEndTime = totalEndTime;
+ }
+
+ private double computeThumb(int width, int scale) {
+ if (width == 0) {
+ return 0;
+ }
+ double ret = (double) chartWidth
+ / (double) ((DACustomTimelineRenderer.DEFAULT_INTERVAL * scale));
+
+ return ret;
+ }
+
+ private double computeVisibleStartTime(double oldThumb, double newThumb,
+ double totalEndTime) {
+ double ret = 0;
+
+ if (0 == visibleStartTime) {
+ return ret;
+ } else if (visibleStartTime + oldThumb == totalEndTime) {
+ ret = totalEndTime - newThumb;
+ } else {
+ ret = (visibleStartTime + (oldThumb / 2)) - (newThumb / 2);
+ if (ret + newThumb > totalEndTime) {
+ ret = totalEndTime - newThumb;
+ }
+ }
+ if (ret < 0) {
+ ret = 0;
+ }
+ return ret;
+ }
+
+ public void timelineWidthChanged(int width) {
+ chartWidth = width;
+ thumb = computeThumb(chartWidth, scaleVal);
+ board.setScrollThumb((int) (thumb * 1000));
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.widgets.chartBoard;
+
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+import org.tizen.dynamicanalyzer.widgets.scale.DAScaleAttribute;
+import org.tizen.dynamicanalyzer.widgets.scale.DAScaleDefaultRenderer;
+
+public class DAChartBoardScaleRenderer extends DAScaleDefaultRenderer {
+
+ @Override
+ public void draw(GC gc, Canvas canvas, DAScaleAttribute attr) {
+ Rectangle rect = canvas.getClientArea();
+ gc.setForeground(ColorResources.SCALE_BG_COLOR_START);
+ gc.setBackground(ColorResources.SCALE_BG_COLOR_END);
+ gc.fillGradientRectangle(rect.x, rect.y, rect.width, rect.height, true);
+ gc.setForeground(ColorResources.SCALE_OUTLINE_COLOR);
+ gc.drawRectangle(rect.x, rect.y, rect.width - 1, rect.height - 1);
+
+ if (null != attr.getLeftImage() && null != attr.getRightImage()) {
+ gc.drawImage(attr.getLeftImage(), attr.getLeftRect().x,
+ attr.getLeftRect().y);
+ gc.drawImage(attr.getRightImage(), attr.getRightRect().x,
+ attr.getRightRect().y);
+ }
+
+ gc.setBackground(ColorResources.SCALE_AREA_COLOR);
+ gc.fillRectangle(attr.getAreaRect());
+ gc.setForeground(ColorResources.SCALE_AREA_OUTLINE_COLOR);
+ gc.drawRectangle(attr.getAreaRect());
+
+ if (null != attr.getThumbImage()) {
+ gc.drawImage(attr.getThumbImage(), attr.getThumbRect().x,
+ attr.getThumbRect().y);
+ } else {
+ gc.setBackground(ColorResources.RED);
+ gc.fillOval(attr.getThumbRect().x, attr.getThumbRect().y,
+ attr.getThumbRect().width, attr.getThumbRect().height);
+ }
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.chartBoard;
+
+
+public abstract class DAChartBoardSelectionListener{
+ public abstract void handleSelectionEvent(DAChartBoardItem item);
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.combo;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.widgets.DAWidgetConstants;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.IDACustomButtonRenderer;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+
+public class DACustomCombo extends Canvas {
+ public static final int MAX_SIZE = 10;
+ public static final int STATE_NORMAL = 0;
+ public static final int STATE_HOVER = 1;
+ public static final int STATE_PUSH = 2;
+ public static final int STATE_DISABLE = 3;
+
+ private static final int pageSize = 5;
+
+ Composite parent;
+ private Canvas combo = null;
+ private Canvas popup = null;
+ private int itemHeight = 0;
+ private DACustomButton upArrowButton = null;
+ private DACustomButton downArrowButton = null;
+ private int itemIndex = 0;
+ private boolean dirty = false;
+
+ private List<String> items;
+ private List<Rectangle> rects = null;
+
+ private List<Image> images = null;
+ private Image buttonUp = null;
+ private Image buttonDown = null;
+ private boolean enabled = true;
+ private Shell childShell = null;
+ private int selection = 0;
+ private String text = ""; //$NON-NLS-1$
+ private boolean imgCombo = false;
+ private int state = STATE_NORMAL; // 0 normal 1 hover 2 push 3 disable
+ private DACustomComboRenderer comboRenderer = new DACustomComboDefaultRenderer();;
+ private DACustomComboPopupRenderer popupRenderer = new DACustomComboPopupDefaultRenderer();
+ private IDACustomButtonRenderer buttonRenderer = null;
+
+ private List<Color> arrowColors = null;
+ private List<Image> arrowImages = null;
+
+ public DACustomCombo(Composite parent, int style) {
+ super(parent, style);
+ combo = this;
+
+ this.parent = parent;
+ addPaintListener(comboPaintListener);
+ setForeground(ColorResources.WHITE);
+ addListeners();
+ initCombo();
+ }
+
+ public void addListeners() {
+ addListener(SWT.MouseEnter, comboMouseListener);
+ addListener(SWT.MouseHover, comboMouseListener);
+ addListener(SWT.MouseExit, comboMouseListener);
+ addListener(SWT.MouseDown, comboMouseListener);
+ addListener(SWT.MouseMove, comboMouseListener);
+ addListener(SWT.MouseUp, comboMouseListener);
+ }
+
+ public String getText() {
+ if (getItems().size() > 0) {
+ return getItems().get(itemIndex + selection);
+ }
+ return null;
+ }
+
+ public List<String> getItems() {
+ if (null == items) {
+ items = new ArrayList<String>();
+ }
+ return items;
+ }
+
+ private List<Rectangle> getRects() {
+ if (null == rects) {
+ rects = new ArrayList<Rectangle>();
+ }
+ return rects;
+ }
+
+ private void changeComboState(int s) {
+ state = s;
+ redraw();
+ }
+
+ private Listener popupSelectionListener = new DACustomComboSelectionListener() {
+
+ @Override
+ public void selectionEvent(DACustomCombo combo) {
+ System.out.println("default selection" + combo.getText()); //$NON-NLS-1$
+ }
+ };
+
+ public void addSelectionListener(DACustomComboSelectionListener listener) {
+ popupSelectionListener = listener;
+ }
+
+ private Listener comboMouseListener = new Listener() {
+ @Override
+ public void handleEvent(Event event) {
+ if (enabled) {
+ if (event.type == SWT.MouseEnter) {
+ changeComboState(STATE_HOVER);
+ }
+
+ if (event.type == SWT.MouseHover) {
+ if (!isOutOfBounds(event.x, event.y)) {
+ if (0 != (event.stateMask & SWT.BUTTON1)) {
+ changeComboState(STATE_PUSH);
+ } else if (0 == (event.stateMask & SWT.BUTTON1)) {
+ changeComboState(STATE_HOVER);
+ }
+ }
+ }
+
+ if (event.type == SWT.MouseDown) {
+ changeComboState(STATE_PUSH);
+ }
+
+ if (event.type == SWT.MouseUp) {
+ changeComboState(STATE_HOVER);
+ if (childShell == null || childShell.isDisposed()) {
+ openChildShell();
+ } else {
+ childShell.close();
+ childShell = null;
+ }
+ }
+
+ if (event.type == SWT.MouseMove) {
+ if (isOutOfBounds(event.x, event.y)) {
+ changeComboState(STATE_NORMAL);
+ } else if (isOutOfBounds(event.x, event.y)) {
+ if (0 != (event.stateMask & SWT.BUTTON1)) {
+ changeComboState(STATE_PUSH);
+ } else if (0 == (event.stateMask & SWT.BUTTON1)) {
+ changeComboState(STATE_HOVER);
+ }
+ }
+ }
+
+ if (event.type == SWT.MouseExit) {
+ changeComboState(STATE_NORMAL);
+ }
+ }
+ }
+ };
+
+ protected boolean isOutOfBounds(int x, int y) {
+ Rectangle rectangle = combo.getBounds();
+
+ if (x < 0 || x > rectangle.width || y < 0 || y > rectangle.height) {
+ return true;
+ }
+
+ return false;
+ }
+
+ private int getShellWidth() {
+ if (getItems().isEmpty()) {
+ return 0;
+ }
+ int max = 0;
+ int size = items.size();
+ GC gc = new GC(parent.getDisplay(), SWT.NONE);
+ for (int i = 0; i < size; i++) {
+ Point p = gc.textExtent(items.get(i), SWT.DRAW_MNEMONIC);
+ if (p.x > max) {
+ max = p.x;
+ }
+ }
+ max += 10;
+ gc.dispose();
+ return max;
+ }
+
+ public int getItemHeight() {
+ return itemHeight;
+ }
+
+ public void setItemHeight(int height) {
+ itemHeight = height;
+ }
+
+ private void openChildShell() {
+ childShell = new Shell(parent.getShell(), SWT.ON_TOP);
+ childShell.setLayout(new FormLayout());
+
+ Point p = combo.toDisplay(0, 0);
+ Rectangle rect = combo.getBounds();
+ int size = getItems().size();
+
+ int boundSize = (size > MAX_SIZE) ? MAX_SIZE : (size > 0) ? size : 1;
+
+ int textSize = getShellWidth() + 4;
+ int shellWidth = (textSize > rect.width) ? textSize : rect.width;
+ int height = 0;
+
+ if (getItemHeight() == 0) {
+ height = rect.height;
+ } else {
+ height = getItemHeight();
+ }
+ int shellHeight = height * boundSize + 5;
+
+ childShell.setSize(shellWidth, shellHeight);
+ childShell.setLocation(p.x, p.y + rect.height);
+ // childShell.setBackground(ColorResources.BLUE);
+ setSelect(text);
+
+ popup = new Canvas(childShell, SWT.DOUBLE_BUFFERED);
+ popup.setData(this);
+ popup.setBackground(ColorResources.WHITE);
+ popup.addPaintListener(popupPaintListener);
+ popup.addListener(SWT.MouseUp, popupMouseEventListener);
+ popup.addListener(SWT.MouseMove, popupMouseEventListener);
+ popup.addListener(SWT.FocusOut, popupMouseEventListener);
+ popup.addListener(SWT.MouseUp, popupSelectionListener);
+ popup.addListener(SWT.MouseWheel, popupMouseEventListener);
+
+ if (size > MAX_SIZE) {
+ upArrowButton = makeButton();
+ if (buttonUp == null) {
+ upArrowButton.setText(Messages.DACustomCombo_1);
+ } else {
+ upArrowButton.setButtonImage(buttonUp);
+ }
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.left = new FormAttachment(0, 0);
+ data.right = new FormAttachment(100, 0);
+ data.height = height;
+ upArrowButton.setLayoutData(data);
+ upArrowButton.addMouseListener(upArrowListener);
+ upArrowButton.addListener(SWT.MouseExit, upButtonMouseExitListener);
+ shellHeight += height;
+ if (itemIndex > 0) {
+ upArrowButton.setEnabled(true);
+ } else {
+ upArrowButton.setEnabled(false);
+ }
+
+ data = new FormData();
+ data.top = new FormAttachment(upArrowButton, 0);
+ data.left = new FormAttachment(0, 0);
+ data.right = new FormAttachment(100, 0);
+ data.height = height * boundSize + 5 - 2;
+ popup.setLayoutData(data);
+
+ // downArrowButton = new DACustomButton(childShell, SWT.NONE);
+ downArrowButton = makeButton();
+ // downArrowButton.setText("down"); //$NON-NLS-1$
+ if (null == buttonDown) {
+ downArrowButton.setText(Messages.DACustomCombo_2);
+ } else {
+ downArrowButton.setButtonImage(buttonDown);
+ }
+ data = new FormData();
+ data.top = new FormAttachment(popup, 0);
+ data.left = new FormAttachment(0, 0);
+ data.right = new FormAttachment(100, 0);
+ data.height = height;
+ downArrowButton.setLayoutData(data);
+ downArrowButton.addMouseListener(downArrowListener);
+ downArrowButton.addListener(SWT.MouseExit,
+ downButtonMouseExitListener);
+ shellHeight += height;
+ if (itemIndex + MAX_SIZE < size - 1) {
+ downArrowButton.setEnabled(true);
+ } else {
+ downArrowButton.setEnabled(false);
+ }
+
+ childShell.setSize(shellWidth, shellHeight);
+ } else {
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.left = new FormAttachment(0, 0);
+ data.right = new FormAttachment(100, 0);
+ data.height = shellHeight - 2;
+ popup.setLayoutData(data);
+ }
+
+ size = (size > MAX_SIZE) ? MAX_SIZE : size;
+ getRects().clear();
+ for (int i = 0; i < size; i++) {
+ Rectangle r = new Rectangle(2, 2 + i * height, shellWidth - 2,
+ height);
+ getRects().add(r);
+ }
+ childShell.open();
+ }
+
+ private MouseListener upArrowListener = new MouseListener() {
+
+ @Override
+ public void mouseUp(MouseEvent event) {
+ if (!upArrowButton.isButtonEnabled()) {
+ return;
+ }
+
+ if (null != upArrowButton) {
+ Rectangle rectangle = upArrowButton.getBounds();
+ int x = event.x;
+ int y = event.y;
+
+ if (x < 0 || x > rectangle.width || y < 0
+ || y > rectangle.height) {
+ return;
+ }
+ }
+
+ int size = getItems().size();
+ if (itemIndex - pageSize < 0) {
+ itemIndex = 0;
+ upArrowButton.setEnabled(false);
+ } else {
+ itemIndex -= pageSize;
+ }
+
+ if (itemIndex + pageSize < size - 1) {
+ downArrowButton.setEnabled(true);
+ }
+ popup.redraw();
+ }
+
+ @Override
+ public void mouseDown(MouseEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void mouseDoubleClick(MouseEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+ };
+
+ private MouseListener downArrowListener = new MouseListener() {
+
+ @Override
+ public void mouseUp(MouseEvent event) {
+
+ if (!downArrowButton.isButtonEnabled()) {
+ return;
+ }
+
+ if (null != downArrowButton) {
+ Rectangle rectangle = downArrowButton.getBounds();
+ int x = event.x;
+ int y = event.y;
+
+ if (x < 0 || x > rectangle.width || y < 0
+ || y > rectangle.height) {
+ return;
+ }
+ }
+
+ int size = getItems().size();
+ if (itemIndex + pageSize + MAX_SIZE >= size - 1) {
+ itemIndex = size - MAX_SIZE;
+ downArrowButton.setEnabled(false);
+ } else {
+ itemIndex += pageSize;
+ }
+
+ // if (itemIndex - pageSize > 0) {
+ if (itemIndex > 0) {
+ upArrowButton.setEnabled(true);
+ }
+ popup.redraw();
+ }
+
+ @Override
+ public void mouseDown(MouseEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void mouseDoubleClick(MouseEvent arg0) {
+ // TODO Auto-generated method stub
+ }
+ };
+
+ private PaintListener popupPaintListener = new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ List<String> items = getItems();
+ List<String> input = new ArrayList<String>();
+ int size = (items.size() > MAX_SIZE) ? MAX_SIZE : items.size();
+ for (int i = 0; i < size; i++) {
+ input.add(items.get(itemIndex + i));
+ }
+ popupRenderer
+ .draw(e.gc, popup, state, getRects(), selection, input);
+ }
+ };
+
+ public void setText(String text) {
+ if (!setSelect(text)) {
+ this.text = text;
+ redraw();
+ }
+ }
+
+ private boolean setSelect(String text) {
+ if (getItems().isEmpty()) {
+ return false;
+ }
+
+ int index = items.indexOf(text);
+ if (index < 0) {
+ return false;
+ }
+ int size = items.size();
+ if (size < MAX_SIZE) {
+ selection = index;
+ select(selection);
+ } else if (index + MAX_SIZE >= size) {
+ int lower = size - index;
+ selection = MAX_SIZE - lower;
+ itemIndex = size - MAX_SIZE;
+ select(selection);
+ } else {
+ selection = index - itemIndex;
+ select(selection);
+ }
+ return true;
+ }
+
+ public void upEvent() {
+ if (getItems().size() > 0) {
+ setText(getItems().get(itemIndex + selection));
+ } else {
+ setText(""); //$NON-NLS-1$
+ }
+ childShell.close();
+ childShell = null;
+ }
+
+ private Listener popupMouseEventListener = new Listener() {
+
+ @Override
+ public void handleEvent(Event event) {
+ if (event.type == SWT.MouseMove) {
+ List<Rectangle> rs = getRects();
+ int size = rs.size();
+ for (int i = 0; i < size; i++) {
+ if (rs.get(i).contains(event.x, event.y)) {
+ selection = i;
+ popup.redraw();
+ break;
+ }
+ }
+ }
+
+ if (event.type == SWT.FocusOut) {
+ childShell.close();
+ childShell = null;
+ }
+
+ if (event.type == SWT.MouseWheel) {
+ int size = getItems().size();
+ if (null != downArrowButton && null != upArrowButton) {
+ if (event.count < 0) {
+ if (itemIndex - event.count + MAX_SIZE >= size - 1) {
+ itemIndex = size - MAX_SIZE;
+ downArrowButton.setEnabled(false);
+ } else {
+ itemIndex -= event.count;
+ }
+
+ // if (itemIndex - pageSize > 0) {
+ if (itemIndex > 0) {
+ upArrowButton.setEnabled(true);
+ }
+ } else {
+
+ if (itemIndex - event.count < 0) {
+ itemIndex = 0;
+ upArrowButton.setEnabled(false);
+ } else {
+ itemIndex -= event.count;
+ }
+
+ if (itemIndex + event.count < size - 1) {
+ downArrowButton.setEnabled(true);
+ }
+ }
+ popup.redraw();
+ }
+ }
+ }
+ };
+
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ if (enabled) {
+ changeComboState(STATE_NORMAL);
+ if (isImageCombo()) {
+ setBackgroundImage(images.get(STATE_NORMAL));
+ }
+ } else {
+ changeComboState(STATE_DISABLE);
+ if (isImageCombo()) {
+ setBackgroundImage(images.get(STATE_DISABLE));
+ }
+ }
+ }
+
+ private PaintListener comboPaintListener = new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ if (!isImageCombo()) {
+ comboRenderer.draw(e.gc, combo, text, state);
+ } else {
+ comboRenderer.drawImage(e.gc, combo, images.get(state), text,
+ state);
+ }
+ }
+ };
+
+ public void setComboRender(DACustomComboRenderer newRenderer) {
+ comboRenderer = newRenderer;
+ }
+
+ public void setComboPopupRender(DACustomComboPopupRenderer newRenderer) {
+ popupRenderer = newRenderer;
+ }
+
+ // public void removeAll() {
+ // getItems().clear();
+ // }
+
+ public void add(String item) {
+ if (dirty) {
+ getItems().add(item);
+ } else {
+ getItems().set(0, item);
+ dirty = true;
+ }
+ }
+
+ public void select(int index) {
+ selection = index;
+ this.text = items.get(itemIndex + selection);
+ redraw();
+ }
+
+ public String getItem(int index) {
+ if (getItems().size() > 0) {
+ return getItems().get(index);
+ }
+ return ""; //$NON-NLS-1$
+ }
+
+ public void setImages(Image normal, Image hover, Image push, Image disable) {
+ if (null == normal || null == hover || null == push || null == disable) {
+ return;
+ }
+ List<Image> imgs = getImages();
+
+ imgs.add(normal);
+ imgs.add(hover);
+ imgs.add(push);
+ imgs.add(disable);
+ setImageCombo(true);
+ }
+
+ private List<Image> getImages() {
+ if (null == images) {
+ images = new ArrayList<Image>();
+ }
+ return images;
+ }
+
+ private void setImageCombo(boolean b) {
+ this.imgCombo = b;
+ }
+
+ public boolean isImageCombo() {
+ return imgCombo;
+ }
+
+ private Listener upButtonMouseExitListener = new Listener() {
+
+ @Override
+ public void handleEvent(Event event) {
+ }
+ };
+
+ private Listener downButtonMouseExitListener = new Listener() {
+
+ @Override
+ public void handleEvent(Event event) {
+
+ }
+ };
+
+ public boolean isDirty() {
+ return dirty;
+ }
+
+ public void initCombo() {
+ getItems().clear();
+ itemIndex = 0;
+ selection = 0;
+ items.add(DAWidgetConstants.EMPTY_STRING);
+ dirty = false;
+ }
+
+ public void setComboButtonColor(Color normal, Color push, Color hover,
+ Color disable) {
+ arrowColors = new ArrayList<Color>();
+ arrowColors.add(normal);
+ arrowColors.add(push);
+ arrowColors.add(hover);
+ arrowColors.add(disable);
+ }
+
+ public void setComboButtonImage(Image normal, Image push, Image hover,
+ Image disable) {
+ arrowImages = new ArrayList<Image>();
+ arrowImages.add(normal);
+ arrowImages.add(push);
+ arrowImages.add(hover);
+ arrowImages.add(disable);
+ }
+
+ public void setComboButtonGradation(Color normalStart, Color normalEnd,
+ Color pushStart, Color pushEnd, Color hoverStart, Color hoverEnd,
+ Color disableStart, Color disableEnd) {
+ arrowColors = new ArrayList<Color>();
+ arrowColors.add(normalStart);
+ arrowColors.add(normalEnd);
+ arrowColors.add(pushStart);
+ arrowColors.add(pushEnd);
+ arrowColors.add(hoverStart);
+ arrowColors.add(hoverEnd);
+ arrowColors.add(disableStart);
+ arrowColors.add(disableEnd);
+ }
+
+ private DACustomButton makeButton() {
+ DACustomButton button = null;
+ if (arrowImages != null) {
+ button = new DACustomButton(childShell,
+ arrowImages.get(STATE_NORMAL), arrowImages.get(STATE_PUSH),
+ arrowImages.get(STATE_HOVER),
+ arrowImages.get(STATE_DISABLE));
+ } else if (arrowColors != null) {
+ if (arrowColors.size() > 4) {
+ // gradation
+ button = new DACustomButton(childShell,
+ arrowColors.get(STATE_NORMAL),
+ arrowColors.get(STATE_NORMAL + 1),
+ arrowColors.get(STATE_PUSH * 2),
+ arrowColors.get(STATE_PUSH * 2 + 1),
+ arrowColors.get(STATE_HOVER * 2),
+ arrowColors.get(STATE_HOVER * 2 + 1),
+ arrowColors.get(STATE_DISABLE * 2),
+ arrowColors.get(STATE_DISABLE * 2 + 1));
+ } else {
+ button = new DACustomButton(childShell, SWT.NONE);
+ button.setColors(arrowColors.get(STATE_NORMAL),
+ arrowColors.get(STATE_PUSH),
+ arrowColors.get(STATE_HOVER),
+ arrowColors.get(STATE_DISABLE));
+ }
+ } else {
+ button = new DACustomButton(childShell, SWT.NONE);
+ }
+ if (null != buttonRenderer) {
+ button.setRenderer(buttonRenderer);
+ }
+ return button;
+ }
+
+ public void setButtonRenderer(IDACustomButtonRenderer renderer) {
+ buttonRenderer = renderer;
+ }
+
+ public void setButtonImages(Image up, Image down) {
+ buttonUp = up;
+ buttonDown = down;
+ }
+
+ public int getItemIndex(String text) {
+ return getItems().indexOf(text);
+ }
+
+ public boolean isChildShellOpened() {
+ if (childShell == null || childShell.isDisposed()) {
+ return false;
+ }
+ return true;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.combo;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+
+
+public class DACustomComboDefaultRenderer extends DACustomComboRenderer {
+
+ @Override
+ public void draw(GC gc, Canvas canvas, String text, int state) {
+ Rectangle rect = canvas.getClientArea();
+ if (state == DACustomCombo.STATE_NORMAL) {
+ gc.setBackground(ColorResources.WINDOW_BG_COLOR);
+ } else if (state == DACustomCombo.STATE_HOVER) {
+ gc.setBackground(ColorResources.ITEM_BLUE_DARK);
+ } else if (state == DACustomCombo.STATE_PUSH) {
+ gc.setBackground(ColorResources.BLUE);
+ } else if (state == DACustomCombo.STATE_DISABLE) {
+ gc.setBackground(ColorResources.BAR_GRAY1);
+ }
+ gc.fillRectangle(rect);
+ gc.drawRectangle(rect.x, rect.y, rect.width - 20, rect.height - 1);
+
+ if (null == text) {
+ text = ""; //$NON-NLS-1$
+ }
+ Point p = gc.textExtent(text, SWT.DRAW_MNEMONIC);
+ gc.drawString(text, 5, (rect.height - p.y)/2, true);
+ gc.fillRectangle(rect.x + rect.width - 20, rect.y, 19, rect.height - 1);
+ gc.drawRectangle(rect.x + rect.width - 20, rect.y, 19, rect.height - 1);
+ }
+
+ @Override
+ public void drawPattern(GC gc, Canvas canvas, Image patternImage,
+ String text, int state) {
+
+ }
+
+ @Override
+ public void drawImage(GC gc, Canvas canvas, Image image, String text,
+ int state) {
+
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.combo;
+
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+
+
+public class DACustomComboPopupDefaultRenderer extends DACustomComboPopupRenderer {
+
+ @Override
+ public void draw(GC gc, Canvas canvas, int state, List<Rectangle> rects,
+ int selection, List<String> items) {
+ int size = rects.size();
+ for (int i = 0; i < size; i++) {
+ Rectangle r = rects.get(i);
+ gc.setBackground(ColorResources.WINDOW_BG_COLOR);
+ if (selection == i) {
+ gc.setBackground(ColorResources.RED);
+ gc.fillRectangle(r);
+ gc.setBackground(ColorResources.WINDOW_BG_COLOR);
+ }
+ gc.setForeground(ColorResources.WHITE);
+ gc.drawRectangle(r.x, r.y, r.width - 1, r.height - 1);
+ Point p = gc.textExtent(items.get(i), SWT.DRAW_MNEMONIC);
+ gc.drawString(items.get(i), 5, (r.height - p.y) / 2 + i * r.height,
+ true);
+ }
+ }
+
+ @Override
+ public void drawPattern(GC gc, Canvas canvas, Image patternImage,
+ int state, List<Rectangle> rects, int selection, List<String> items) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void drawImage(GC gc, Canvas canvas, Image image, int state,
+ List<Rectangle> rects, int selection, List<String> items) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.combo;
+
+import java.util.List;
+
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+
+public abstract class DACustomComboPopupRenderer {
+ public abstract void draw(GC gc, Canvas canvas, int state,
+ List<Rectangle> rects, int selection, List<String> items);
+
+ public abstract void drawPattern(GC gc, Canvas canvas, Image patternImage,
+ int state, List<Rectangle> rects, int selection, List<String> items);
+
+ public abstract void drawImage(GC gc, Canvas canvas, Image image,
+ int state, List<Rectangle> rects, int selection, List<String> items);
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.combo;
+
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Canvas;
+
+public abstract class DACustomComboRenderer {
+ public abstract void draw(GC gc, Canvas canvas, String text, int state);
+ public abstract void drawPattern(GC gc, Canvas canvas, Image patternImage, String text, int state);
+ public abstract void drawImage(GC gc, Canvas canvas, Image image, String text, int state);
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.combo;
+
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+
+public abstract class DACustomComboSelectionListener implements Listener {
+
+ @Override
+ public void handleEvent(Event event) {
+ Canvas popup = (Canvas) event.widget;
+ DACustomCombo combo = (DACustomCombo) popup.getData();
+ if (null != combo) {
+ selectionEvent(combo);
+ combo.upEvent();
+ }
+ }
+
+ public abstract void selectionEvent(DACustomCombo combo);
+}
--- /dev/null
+package org.tizen.dynamicanalyzer.widgets.combo;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.tizen.dynamicanalyzer.widgets.combo.messages"; //$NON-NLS-1$
+ public static String DACustomCombo_1;
+ public static String DACustomCombo_2;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
--- /dev/null
+DACustomCombo_1=UP
+DACustomCombo_2=DOWN
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * HyunJong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.widgets.contextMenu;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+
+/**
+ * Newly implemented contextMenuItem class
+ *
+ * @author ParkHyunJong
+ *
+ */
+public class DAContextMenu {
+
+ public static final int STATE_NORMAL = 0;
+ public static final int STATE_PUSH = 1;
+ public static final int STATE_HOVER = 2;
+ public static final int STATE_DISABLE = 3;
+
+ private final int DEFAULT_HEIGHT = 24;
+ private final int CHARACTER_WIDTH_PIXEL = 7;
+ private final int STORKE_PIXEL = 2;
+ private final int STAUES_ITEMS_CHECK_TIME = 200;
+ private final int ADJUSTED_CONTEXT_MENU_POINT = 5;
+
+ public static final int MOUSE_LEFT = 1;
+ public static final int MOUSE_RIGHT = 3;
+ private Shell menuShell = null;
+ private Shell parentShell = null;
+ private Composite menuComp = null;
+ private Composite parentComp = null;
+ private Rectangle parentArea = null;
+ private Timer checkEableTimer = null;
+ private List<DAContextMenuItem> itemList = null;
+
+ /**
+ * create contextMenu Shell and Composite, add mouse listeners - mouse down.<br>
+ */
+ private void setDefaultSetting() {
+ if (null != menuShell) {
+ return;
+ }
+ menuShell = new Shell(parentShell, SWT.NO_TRIM);
+ menuShell.setLayout(new FillLayout());
+ menuComp = new Composite(menuShell, SWT.NONE);
+ menuComp.addPaintListener(new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ // TODO Auto-generated method stub
+ e.gc.setForeground(ColorResources.CONTEXT_MENU_STORKE_IN);
+ e.gc.drawRectangle(menuComp.getBounds().x + STORKE_PIXEL - 1,
+ menuComp.getBounds().y + STORKE_PIXEL - 1,
+ menuComp.getBounds().width - 3,
+ menuComp.getBounds().height - 3);
+ }
+ });
+
+ menuComp.setLayout(new FormLayout());
+ menuComp.setBackground(ColorResources.CONTEXT_MENU_STORKE_OUT);
+
+ FormData compData = new FormData();
+ compData.top = new FormAttachment(0, 0);
+ compData.left = new FormAttachment(0, 0);
+ compData.right = new FormAttachment(100, 0);
+ compData.bottom = new FormAttachment(100, 0);
+ menuComp.setLayoutData(compData);
+
+ parentComp.addListener(SWT.MouseUp, parentMouseListener);
+ }
+
+ /**
+ * Construct a new instance of this class.<br>
+ *
+ * @param parent
+ * a composite control which will be the parent of the new
+ * instance (cannot be bull)
+ */
+ public DAContextMenu(Composite parent) {
+ parentComp = parent;
+ parentShell = parent.getShell();
+ setDefaultSetting();
+ }
+
+ /**
+ * Get contextMenu Shell.<br>
+ *
+ * @return contextMenu Shell
+ */
+ public Shell getShell() {
+ return menuShell;
+ }
+
+ /**
+ * Get contextMenu composite.<br>
+ *
+ * @return contextMenu composite
+ */
+ public Composite getComposite() {
+ return this.menuComp;
+ }
+
+ /**
+ * implementation parent mouse listeners event.<br>
+ */
+ private Listener parentMouseListener = new Listener() {
+ @Override
+ public void handleEvent(Event event) {
+ if (event.type == SWT.MouseUp) {
+ switch (event.button) {
+ case MOUSE_LEFT: {
+
+ disappearContextMenu();
+ break;
+ }
+ case MOUSE_RIGHT: {
+ if (null != parentArea) {
+ if (event.x > parentArea.x && event.y > parentArea.y
+ && event.x < parentArea.x + parentArea.width
+ && event.y < parentArea.y + parentArea.height) {
+ open();
+ }
+ } else {
+ open();
+ }
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+ }
+ }
+ };
+
+ /**
+ * implementation item mouse listeners event.<br>
+ */
+ protected Listener itemMouseListener = new Listener() {
+ @Override
+ public void handleEvent(Event event) {
+
+ DAContextMenuItem itme = (DAContextMenuItem) event.widget;
+ if (event.type == SWT.MouseUp) {
+ switch (event.button) {
+ case MOUSE_LEFT: {
+ if (itme.getState() != STATE_DISABLE) {
+ disappearContextMenu();
+ }
+ break;
+ }
+ default: {
+ break;
+ }
+ }
+ }
+ }
+ };
+
+ /**
+ * disappear contextMenu
+ */
+ public void disappearContextMenu() {
+ menuShell.setVisible(false);
+ }
+
+ /**
+ * Appear contextMenu when click mouse leftButton.<br>
+ *
+ * @param x
+ * The value of x of the right mouse button to click
+ * @param y
+ * The value of y of the right mouse button to click
+ */
+ public void open(int x, int y) {
+ if (null == menuShell) {
+ setDefaultSetting();
+ }
+ if (getItems() == null) {
+ menuShell.setSize(CHARACTER_WIDTH_PIXEL, DEFAULT_HEIGHT);
+ } else {
+ menuShell.setSize(itemLongestTextLenght() * CHARACTER_WIDTH_PIXEL,
+ DEFAULT_HEIGHT * getItems().size() + STORKE_PIXEL * 2);
+ }
+ menuShell.setLocation(x, y);
+ menuShell.setVisible(true);
+
+ if (checkEableTimer != null) {
+ checkEableTimer.cancel();
+ checkEableTimer = null;
+ }
+ disposeContextMenu(STAUES_ITEMS_CHECK_TIME);
+ }
+
+ /**
+ * Get the coordinates of the mouse click.<br>
+ *
+ * @return Point object of coordinates of the mouse click
+ */
+ private Point computeContextMenuLocation() {
+ Display display = Display.getCurrent();
+ if (null == display) {
+ display = Display.getDefault();
+ }
+ Point pt = Display.getCurrent().getCursorLocation();
+ return pt;
+ }
+
+ /**
+ * Show the ContextMenu when click the right button.<br>
+ */
+ public void open() {
+ Point pt = computeContextMenuLocation();
+ pt.x = pt.x -= ADJUSTED_CONTEXT_MENU_POINT;
+ pt.y = pt.y -= ADJUSTED_CONTEXT_MENU_POINT;
+ open(pt.x, pt.y);
+ }
+
+ /**
+ * Periodically check the focus has been on the context Menu.<br>
+ *
+ * @param milliseconds
+ * Set the time to check regularly.
+ */
+ public void disposeContextMenu(int milliseconds) {
+ this.checkEableTimer = new Timer();
+ this.checkEableTimer.schedule(new TimerTask() {
+ public void run() {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ Rectangle rt = menuShell.getBounds();
+ Point pt = Display.getCurrent().getCursorLocation();
+ if (false == rt.contains(pt)) {
+ if (checkEableTimer != null) {
+ checkEableTimer.cancel();
+ checkEableTimer = null;
+ }
+ disappearContextMenu();
+ }
+ }
+ });
+ }
+ }, 200, milliseconds);
+ }
+
+ /**
+ * Register the DAContextMenuItem to the contextMenu.<br>
+ *
+ * @param item
+ * contextMenu item object
+ */
+ public void addItem(DAContextMenuItem item) {
+ if (itemList == null) {
+ itemList = new ArrayList<DAContextMenuItem>();
+ }
+ FormData compData = new FormData();
+ if (getItems() == null) {
+ compData.top = new FormAttachment(0, STORKE_PIXEL);
+ } else {
+ compData.top = new FormAttachment(0, DEFAULT_HEIGHT
+ * getItems().size() + STORKE_PIXEL);
+ }
+ compData.left = new FormAttachment(0, STORKE_PIXEL);
+ compData.right = new FormAttachment(100, -STORKE_PIXEL);
+ compData.height = DEFAULT_HEIGHT;
+ item.setLayoutData(compData);
+
+ itemList.add(item);
+ item.addListener(SWT.MouseUp, itemMouseListener);
+ }
+
+ /**
+ * Get the DAContextMenuItem.<br>
+ *
+ * @return contextMenu items list
+ */
+ public List<DAContextMenuItem> getItems() {
+ return itemList;
+ }
+
+ /**
+ * get The text length of the longest item
+ *
+ * @return text length
+ */
+ public int itemLongestTextLenght() {
+ int lenght = 0;
+ if (getItems() == null) {
+ return lenght;
+ }
+ for (DAContextMenuItem item : getItems()) {
+ if (lenght < item.getText().length()) {
+ lenght = item.getText().length();
+ }
+ }
+ return lenght;
+ }
+
+ /**
+ * set parent area
+ *
+ * @param area
+ * parent area
+ */
+ public void setParentArea(Rectangle area) {
+ parentArea = area;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * HyunJong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.widgets.contextMenu;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonRenderer;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+import org.tizen.dynamicanalyzer.widgets.helper.FontResources;
+
+/**
+ * Newly implemented contextMenuItem class
+ *
+ * @author ParkHyunJong
+ *
+ */
+public class DAContextMenuItem extends DACustomButton {
+ private double rangeTime;
+
+ private int seriesIndex = -1;
+ private int eventListStartIndex = -1;
+ private int eventListEndIndex = -1;
+
+ /**
+ * Constructs a new instance of this class given its menu and style value
+ * describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in class SWT
+ * which is applicable to instances of this class, or must be built by
+ * bitwise OR'ing together (that is, using the int "|" operator) two or more
+ * of those SWT style constants. The class description lists the style
+ * constants that are applicable to the class. Style bits are also inherited
+ * from superclasses.
+ * </p>
+ *
+ * @param menu
+ * a DAContextMenu which will be the parent of the new instance
+ * (cannot be bull)
+ * @param style
+ * the style of control to construct
+ */
+ public DAContextMenuItem(DAContextMenu menu) {
+ super(menu.getComposite(), SWT.NONE);
+ setDefaultSetting();
+ menu.addItem(this);
+ }
+
+ /**
+ * Sets Menu Item default state
+ */
+ private void setDefaultSetting() {
+ attr.setColor(STATE_NORMAL,
+ ColorResources.CONTEXT_MENU_STATUS_NORMAL_COLOR);
+ attr.setColor(STATE_HOVER,
+ ColorResources.CONTEXT_MENU_STATUS_HOVER_COLOR);
+ attr.setColor(STATE_PUSH, ColorResources.CONTEXT_MENU_STATUS_PUSH_COLOR);
+ attr.setColor(STATE_DISABLE,
+ ColorResources.CONTEXT_MENU_STATUSE_DISABLE_COLOR);
+ setOutlineColors(ColorResources.CONTEXT_MENU_OUTLINE_NORMAL_COLOR,
+ ColorResources.CONTEXT_MENU_OUTLINE_PUSH_COLOR,
+ ColorResources.CONTEXT_MENU_OUTLINE_HOVER_COLOR,
+ ColorResources.CONTEXT_MENU_OUTLINE_DISABLE_COLOR);
+ setFont(FontResources.CONTEXT_MENU_ITEM_FONT);
+ this.setRenderer(new DACustomButtonRenderer());
+ }
+
+ /**
+ *
+ * adds button click listener
+ *
+ * @param listener
+ * user implemented contextMenu item action listener
+ */
+ public void addClickListener(DAContextMenuListener listener) {
+ addListener(SWT.MouseUp, listener);
+ }
+
+ /**
+ * Sets the text of item <br>
+ */
+ public void setText(String newTitle) {
+ attr.setText(newTitle);
+ setFontPoint(new Point(5, 4));
+ }
+
+ /**
+ * gets the text of item <br>
+ *
+ * @return the text of item
+ */
+ public String getText() {
+ return attr.getText();
+ }
+
+ public double getRangeTime() {
+ return rangeTime;
+ }
+
+ public void setRangeTime(double time) {
+ rangeTime = time;
+ }
+
+ public int getSeriesIndex() {
+ return seriesIndex;
+ }
+
+ public void setSeriesIndex(int index) {
+ seriesIndex = index;
+ }
+
+ public int getEventListStartintdex() {
+ return eventListStartIndex;
+ }
+
+ public void setEventListStartIndex(int index) {
+ eventListStartIndex = index;
+ }
+
+ public double getEventListEndIndex() {
+ return eventListEndIndex;
+ }
+
+ public void setEventListEndIndex(int index) {
+ eventListEndIndex = index;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * HyunJong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.widgets.contextMenu;
+
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+
+/**
+ * Newly implemented contextMenuItem class
+ *
+ * @author ParkHyunJong
+ *
+ */
+public abstract class DAContextMenuListener implements Listener {
+ @Override
+ /**
+ * listener of contextMenu
+ */
+ public void handleEvent(Event event) {
+ if (event.button == DAContextMenu.MOUSE_RIGHT) {
+ return;
+ }
+ DAContextMenuItem item = (DAContextMenuItem) event.widget;
+ if (null != item && item.getState() != DAContextMenuItem.STATE_DISABLE) {
+ Rectangle rectangle = item.getBounds();
+ int x = event.x;
+ int y = event.y;
+ if (x < 0 || x > rectangle.width || y < 0 || y > rectangle.height) {
+ return;
+ }
+ } else {
+ return;
+ }
+
+ widgetSelected(item);
+ }
+
+ /**
+ * call when click item of contextMenu
+ *
+ * @param menuItem
+ */
+ public abstract void widgetSelected(DAContextMenuItem menuItem);
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.graph.bar;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.tizen.dynamicanalyzer.widgets.DAWidgetConstants;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+import org.tizen.dynamicanalyzer.widgets.helper.Formatter;
+
+public class FourBarGraph extends Composite {
+ public static int TYPE_BYTE = 1;
+ public static int TYPE_PERCENT = 0;
+
+ private String measure = Formatter.toByteFormatMeasure(0);
+ private String labelText = DAWidgetConstants.EMPTY_STRING;
+
+ private final int INNER_MARGIN = 3;
+ private final int LABEL_MARGIN = 15;
+ private int graphCount = 4;
+ private int graphWidth = 16;
+ private int graphType = TYPE_PERCENT;
+ private List<SingleBar> graphs;
+ private Label label;
+ private Font labelFont;
+ private Label emptyLabel;
+ private Color fontColor = ColorResources.WHITE;
+ private FourBarGraph me;
+ private Color bgColor = ColorResources.BLACK;
+
+ public FourBarGraph(Composite parent, int style, int type) {
+ super(parent, style);
+ graphType = type;
+ me = this;
+ graphs = new ArrayList<SingleBar>();
+ labelFont = getShell().getDisplay().getSystemFont();
+ this.setLayout(new FormLayout());
+ this.setBackground(bgColor);
+ this.addControlListener(controlListener);
+
+ for (int i = 0; i < graphCount; i++) {
+ SingleBar bar = new SingleBar(me, SWT.NONE, graphType);
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ if (i == 0) {
+ data.left = new FormAttachment(0, INNER_MARGIN);
+ } else {
+ data.left = new FormAttachment(graphs.get(i - 1), INNER_MARGIN);
+ }
+ data.bottom = new FormAttachment(100, -LABEL_MARGIN);
+ bar.setLayoutData(data);
+ graphs.add(bar);
+ }
+
+ emptyLabel = new Label(me, SWT.TRANSPARENT);
+ FormData data = new FormData();
+ data.top = new FormAttachment(graphs.get(0), 0);
+ data.height = 3;
+ data.left = new FormAttachment(0, 0);
+ data.right = new FormAttachment(100, 0);
+ emptyLabel.setLayoutData(data);
+ emptyLabel.setBackground(bgColor);
+
+ label = new Label(me, SWT.TRANSPARENT);
+ data = new FormData();
+ data.top = new FormAttachment(emptyLabel, 0);
+ data.height = 15;
+ data.left = new FormAttachment(0, 0);
+ data.right = new FormAttachment(100, 0);
+ label.setLayoutData(data);
+ label.setFont(labelFont);
+ label.setAlignment(SWT.CENTER);
+ label.setForeground(fontColor);
+ label.setBackground(bgColor);
+ }
+
+ public void setFont(Font font) {
+ label.setFont(font);
+ this.labelFont = font;
+ }
+
+ public void setGraphColor(Color graph, Color gray, Color font) {
+ for (int i = 0; i < graphs.size(); i++) {
+ graphs.get(i).setColors(graph, bgColor, gray, font);
+ }
+ }
+
+ public void setGraphBgColor(Color bg) {
+ for (int i = 0; i < graphs.size(); i++) {
+ graphs.get(i).setBgColor(bg);
+ }
+ }
+
+ public void setMaxSize(long max) {
+ for (int i = 0; i < graphs.size(); i++) {
+ graphs.get(i).setMaxSize(max);
+ }
+ }
+
+ public void setMaxSize(List<Long> maxSizes) {
+ for (int i = 0; i < maxSizes.size() && i < graphCount; i++) {
+ graphs.get(i).setMaxSize(maxSizes.get(i));
+ }
+ }
+
+ public void setCurrentValue(List<Long> currentValues) {
+ for (int i = 0; i < currentValues.size() && i < graphCount; i++) {
+ if (graphType == TYPE_BYTE) {
+ long value = currentValues.get(i);
+ measure = Formatter.toByteFormatMeasure(value);
+ setText(labelText);
+ }
+ graphs.get(i).setCurrentSize(currentValues.get(i));
+ graphs.get(i).redraw();
+ }
+ }
+
+ public void setText(String text) {
+ labelText = text;
+ label.setForeground(fontColor);
+ if (graphType == TYPE_BYTE) {
+ text += " (" + measure + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ text += " (%)"; //$NON-NLS-1$
+ }
+
+ label.setText(text);
+ }
+
+ public void setTextColor(Color color) {
+ label.setForeground(color);
+ fontColor = color;
+ }
+
+ public void setTextBgColor(Color color) {
+ emptyLabel.setBackground(color);
+ label.setBackground(color);
+ }
+
+ public void setBgColor(Color color) {
+ bgColor = color;
+ this.setBackground(bgColor);
+ setGraphBgColor(bgColor);
+ }
+
+ public void setGraphFont(Font font) {
+ int size = graphs.size();
+ for (int i = 0; i < size; i++) {
+ graphs.get(i).setFont(font);
+ }
+ }
+
+ public void setGraphwidth(int graphWidth) {
+ this.graphWidth = graphWidth;
+ }
+
+ ControlListener controlListener = new ControlListener() {
+
+ @Override
+ public void controlResized(ControlEvent e) {
+ Rectangle r = me.getClientArea();
+ int leftMargin = (r.width - ((graphCount * graphWidth) + ((graphCount - 1) * INNER_MARGIN))) / 2;
+ for (int i = 0; i < graphCount; i++) {
+ SingleBar bar = graphs.get(i);
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ if (i == 0) {
+ data.left = new FormAttachment(0, leftMargin);
+ } else {
+ data.left = new FormAttachment(graphs.get(i - 1),
+ INNER_MARGIN);
+ }
+ data.width = graphWidth;
+ data.bottom = new FormAttachment(100, -LABEL_MARGIN);
+ bar.setLayoutData(data);
+ graphs.add(bar);
+ }
+
+ FormData data = new FormData();
+ data.top = new FormAttachment(graphs.get(0), 0);
+ data.height = 3;
+ data.left = new FormAttachment(0, 0);
+ data.right = new FormAttachment(100, 0);
+ emptyLabel.setLayoutData(data);
+
+ data = new FormData();
+ data.top = new FormAttachment(emptyLabel, 0);
+ data.height = 15;
+ data.left = new FormAttachment(0, 0);
+ data.right = new FormAttachment(100, 0);
+ label.setLayoutData(data);
+ }
+
+ @Override
+ public void controlMoved(ControlEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+ };
+
+ public void clear() {
+ for (int i = 0; i < graphs.size(); i++) {
+ graphs.get(i).setCurrentSize(0);
+ graphs.get(i).redraw();
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.graph.bar;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+import org.tizen.dynamicanalyzer.widgets.helper.Formatter;
+
+public class SingleBar extends Canvas {
+
+ public static int TYPE_PERCENT = 0;
+ public static int TYPE_BYTE = 1;
+
+ private final int TOP_MARGIN = 5;
+ private final int BOTTOM_MARGIN = 4;
+ private final int BOTTOM_FULL_MARGIN = 15;
+
+ private int graphType = TYPE_PERCENT;
+
+ private long maxSize;
+ private long currentSize;
+ private Color graphColor;
+ private Color fontColor;
+ private Color bgColor;
+ private Color grayColor;
+ private Font font;
+
+ public SingleBar(Composite parent, int style) {
+ super(parent, style);
+ maxSize = currentSize = 0;
+ this.addPaintListener(barPaintListener);
+
+ graphColor = ColorResources.BLUE;
+ fontColor = ColorResources.RED;
+ bgColor = ColorResources.BLACK;
+ grayColor = ColorResources.BAR_GRAY1;
+ font = new Font(getDisplay(), new FontData[] { new FontData("Arial", 7, //$NON-NLS-1$
+ SWT.NORMAL) });
+ }
+
+ public SingleBar(Composite parent, int style, int type) {
+ this(parent, style);
+ graphType = type;
+ }
+
+ private PaintListener barPaintListener = new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ Canvas canvas = (Canvas) e.widget;
+ canvas.setBackground(bgColor);
+ Rectangle rect = canvas.getClientArea();
+ int graphHeight = rect.height - TOP_MARGIN - BOTTOM_FULL_MARGIN;
+
+ int maxDrawCount = graphHeight / 2;
+ maxDrawCount = (graphHeight % 2 > 0) ? maxDrawCount + 1
+ : maxDrawCount;
+
+ int drawCount = 0;
+ if (maxSize > 0) {
+ drawCount = (int) ((maxDrawCount * currentSize) / maxSize);
+ }
+
+ int startY = rect.y + TOP_MARGIN;
+ int endY = startY + graphHeight;
+
+ int y = endY;
+ for (int i = 0; i <= maxDrawCount; i++) {
+
+ if (i > drawCount || (i == 0 && currentSize == 0)) {
+ e.gc.setForeground(grayColor);
+ } else {
+ e.gc.setForeground(graphColor);
+ }
+ e.gc.drawLine(rect.x, y, rect.x + rect.width, y);
+ e.gc.setForeground(bgColor);
+ y -= 1;
+ e.gc.drawLine(rect.x, y, rect.x + rect.width, y);
+ y -= 1;
+ }
+
+ int textY = endY + BOTTOM_MARGIN;
+ e.gc.setForeground(fontColor);
+ e.gc.setFont(font);
+ String value = null;
+ if (graphType == TYPE_BYTE) {
+ value = Formatter.toByteFormatValue(currentSize);
+ } else {
+ value = Long.toString(currentSize);
+ }
+ Point textSize = e.gc.textExtent(value, SWT.DRAW_MNEMONIC);
+ e.gc.drawText(value, (rect.width - textSize.x) - 2, textY);
+ }
+ };
+
+ public void setMaxSize(long max) {
+ maxSize = max;
+ }
+
+ public void setCurrentSize(long current) {
+ currentSize = current;
+ }
+
+ public void setColors(Color graph, Color bg, Color gray, Color font) {
+ graphColor = graph;
+ bgColor = bg;
+ grayColor = gray;
+ fontColor = font;
+ }
+
+ public void setBgColor(Color bg) {
+ bgColor = bg;
+ }
+
+ public void setFont(Font font) {
+ this.font = font;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.graph.circular;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+import org.tizen.dynamicanalyzer.widgets.helper.Formatter;
+
+public class CircularGraph extends Composite {
+
+ private final int DEFAULT_ANGLE = 90;
+ public static final int TYPE_PERCENT = 0;
+ public static final int TYPE_CUSTOM = 1;
+
+ private Canvas canvas;
+ private Label label;
+ private Label emptyLabel;
+
+ private Font labelFont = getShell().getDisplay().getSystemFont();
+ private Font valueFont = getShell().getDisplay().getSystemFont();
+ private Font measureFont = getShell().getDisplay().getSystemFont();
+
+ private long max = 100;
+ private long value = 0;
+ private Color graphColor = ColorResources.ITEM_BLUE_BRIGHT;
+ private Color bgColor = ColorResources.TITLEBAR_BG_COLOR;
+ private Color centerColor = ColorResources.BLACK;
+ private String measure;
+ private int type = TYPE_PERCENT;
+ private Color textColor = ColorResources.ITEM_BLUE_BRIGHT;
+
+ private final int DEFAULT_WIDTH = 74;
+ private final int DEFAULT_HEIGHT = 74;
+
+ public CircularGraph(Composite parent, int style, int type) {
+ super(parent, style);
+ this.setLayout(new FormLayout());
+ this.type = type;
+
+ if (type == TYPE_PERCENT) {
+ measure = "%"; //$NON-NLS-1$
+ } else {
+ measure = ""; //$NON-NLS-1$
+ }
+
+ canvas = new Canvas(this, SWT.DOUBLE_BUFFERED);
+ canvas.addPaintListener(paintListener);
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.left = new FormAttachment(0, 0);
+ data.right = new FormAttachment(100, 0);
+ // data.bottom = new FormAttachment(100, -25);
+ // data.width = 74;
+ data.height = 75;
+ canvas.setLayoutData(data);
+
+ emptyLabel = new Label(this, SWT.TRANSPARENT);
+ data = new FormData();
+ data.top = new FormAttachment(canvas, 0);
+ data.left = new FormAttachment(0, 0);
+ data.height = 3;
+ data.right = new FormAttachment(100, 0);
+ emptyLabel.setLayoutData(data);
+
+ label = new Label(this, SWT.TRANSPARENT);
+ label.setForeground(textColor);
+ label.setFont(labelFont);
+ label.setAlignment(SWT.CENTER);
+ data = new FormData();
+ data.top = new FormAttachment(emptyLabel, 0);
+ data.left = new FormAttachment(0, 0);
+ data.height = 25;
+ data.right = new FormAttachment(100, 0);
+ label.setLayoutData(data);
+ }
+
+ private PaintListener paintListener = new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ Rectangle rect = canvas.getBounds();
+ int x = rect.x;
+ int y = rect.y;
+ int width = rect.width;
+ int height = rect.height;
+
+ x = (width > DEFAULT_WIDTH) ? x + (width - DEFAULT_WIDTH) / 2 : x;
+ y = (height > DEFAULT_HEIGHT) ? y + (height - DEFAULT_HEIGHT) / 2
+ : y;
+
+ // if (width > height) {
+ // x += (rect.width - rect.height) / 2;
+ // width = height;
+ // } else if (width < height) {
+ // y += (rect.height - rect.width) / 2;
+ // height = width;
+ // }
+
+ width = height = 74;
+ e.gc.setAntialias(SWT.ON);
+ e.gc.setBackground(bgColor);
+ e.gc.fillOval(x, y, width, height);
+ e.gc.setBackground(graphColor);
+ e.gc.fillArc(x, y, width, height, DEFAULT_ANGLE, calculateAngle());
+ // e.gc.setBackground(ColorResources.BLACK);
+ e.gc.setBackground(centerColor);
+ e.gc.fillOval(x + 9, y + 9, 56, 56);
+
+ // Draws text.
+ String centerText = getCenterText();
+
+ e.gc.setFont(valueFont);
+ e.gc.setForeground(graphColor);
+ Point textSize = e.gc.textExtent(centerText, SWT.DRAW_MNEMONIC);
+ e.gc.drawText(centerText, (rect.width - textSize.x) / 2,
+ 28 - 6 + 1, true);
+ // (rect.height - textSize.y) / 2 - 5, true);
+
+ e.gc.setFont(measureFont);
+ e.gc.setForeground(graphColor);
+ Point measureSize = e.gc.textExtent(measure, SWT.DRAW_MNEMONIC);
+ e.gc.drawText(measure, (rect.width - measureSize.x) / 2,
+ 46 - 4 + 1, true);
+ // (rect.height - measureSize.y) / 2 - 5 + textSize.y, true);
+ }
+ };
+
+ public void setMax(long max) {
+ this.max = max;
+ canvas.redraw();
+ }
+
+ public void update(long max, long value) {
+ this.max = max;
+ this.value = value;
+ canvas.redraw();
+ canvas.update();
+ }
+
+ public void update(long value) {
+ this.value = value;
+ canvas.redraw();
+ }
+
+ private int calculateAngle() {
+ int angle = (int) (360 * ((float) value / max)) * (-1);
+ return angle;
+ }
+
+ public void setText(String text) {
+ label.setForeground(textColor);
+ label.setText(text);
+ }
+
+ public void setFont(Font font) {
+ label.setFont(font);
+ this.labelFont = font;
+ }
+
+ public void setValueFont(Font font) {
+ this.valueFont = font;
+ }
+
+ public void setMeasureFont(Font font) {
+ this.measureFont = font;
+ }
+
+ public void setLabelBg(Color color) {
+ label.setBackground(color);
+ emptyLabel.setBackground(color);
+ }
+
+ public void setTextColor(Color color) {
+ textColor = color;
+ }
+
+ private String getCenterText() {
+ String str = null;
+ if (type == TYPE_PERCENT) {
+ int percent = (int) (((float) value / max) * 100);
+ str = Integer.toString(percent);
+ } else {
+ // type : memory size
+ if (value >= 1024) {
+ double dValue = (value) / 1024.;
+ if (dValue >= 1024. * 1024) {
+ dValue = (dValue) / 1024. * 1024;
+ setMeasure("GB"); //$NON-NLS-1$
+ } else if (dValue >= 1024.) {
+ dValue = (dValue) / 1024.0;
+ setMeasure("MB"); //$NON-NLS-1$
+ } else {
+ setMeasure("KB"); //$NON-NLS-1$
+ }
+ str = Formatter.toDoubleFormat1(Double.toString(dValue));
+ } else {
+ str = Long.toString(value);
+ }
+ }
+ return str;
+ }
+
+ public void setMeasure(String m) {
+ measure = m;
+ }
+
+ public void setGraphColor(Color color) {
+ graphColor = color;
+ }
+
+ public void setGraphBgColor(Color color) {
+ bgColor = color;
+ }
+
+ public void setCenterColor(Color color) {
+ centerColor = color;
+ }
+}
--- /dev/null
+/*\r
+ * Dynamic Analyzer\r
+ *\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact: \r
+ * Jooyoul Lee <jy.exe.lee@samsung.com>\r
+ * Juyoung Kim <j0.kim@samsung.com>\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ * \r
+ */\r
+package org.tizen.dynamicanalyzer.widgets.helper;\r
+\r
+import org.eclipse.jface.resource.ColorRegistry;\r
+import org.eclipse.swt.graphics.Color;\r
+import org.eclipse.swt.graphics.RGB;\r
+\r
+public class ColorResources {\r
+\r
+ private static ColorRegistry colorRegistry = new ColorRegistry();\r
+\r
+ public static final Color WHITE = getColor("white", new RGB(255, 255, 255)); //$NON-NLS-1$\r
+ public static final Color BLACK = getColor("black", new RGB(0, 0, 0)); //$NON-NLS-1$\r
+ public static final Color BLUE = getColor("blue", new RGB(0, 0, 255)); //$NON-NLS-1$\r
+ public static final Color RED = getColor("red", new RGB(255, 0, 0)); //$NON-NLS-1$\r
+ public static final Color PURPLE = getColor("PUPLE", new RGB(226, 101, 225)); //$NON-NLS-1$\r
+ public static final Color YELLOW = getColor("yellow", new RGB(250, 210, 10)); //$NON-NLS-1$\r
+\r
+ // scale widget\r
+ public static Color SCALE_OUTLINE_COLOR = getColor(\r
+ "scale_outline_color", new RGB(150, 150, 150)); //$NON-NLS-1$\r
+ public static Color SCALE_BG_COLOR_START = getColor(\r
+ "scale_bg_color_start", new RGB(253, 253, 253)); //$NON-NLS-1$\r
+ public static Color SCALE_BG_COLOR_END = getColor(\r
+ "scale_bg_color_end", new RGB(186, 186, 186)); //$NON-NLS-1$\r
+ public static Color SCALE_AREA_COLOR = getColor(\r
+ "scale_area_color", new RGB(103, 103, 103)); //$NON-NLS-1$\r
+ public static Color SCALE_AREA_OUTLINE_COLOR = getColor(\r
+ "scale_area_outline_color", new RGB(250, 250, 250)); //$NON-NLS-1$\r
+\r
+ // timeline\r
+ public static Color TIMELINE_NUMBER_COLOR = getColor(\r
+ "timeline_number", new RGB(0, 45, 96)); //$NON-NLS-1$\r
+ public static Color TIMELINE_TICK_COLOR = getColor(\r
+ "timeline_tick", new RGB(159, 159, 159)); //$NON-NLS-1$\r
+ public static Color TIMELINE_BG_COLOR = getColor(\r
+ "timeline_bg", new RGB(247, 247, 247)); //$NON-NLS-1$\r
+\r
+ // chart\r
+ public static Color CHART_NAME_BACK_START = getColor(\r
+ "chart_name_back_start", new RGB(215, 215, 215)); //$NON-NLS-1$\r
+ public static Color CHART_NAME_BACK_END = getColor(\r
+ "chart_name_back_end", new RGB(157, 166, 168)); //$NON-NLS-1$\r
+ public static Color CHART_NAME_SELECT_BACK_START = getColor(\r
+ "chart_name_back_select_start", new RGB(180, 242, 254)); //$NON-NLS-1$\r
+ public static Color CHART_NAME_SELECT_BACK_END = getColor(\r
+ "chart_name_back_select_end", new RGB(56, 178, 208)); //$NON-NLS-1$\r
+\r
+ public static Color UI_EVENT_CHART_SEPERATE_LINE = getColor(\r
+ "UI_event_chart_seperate_line", new RGB(189, 207, 213)); //$NON-NLS-1$\r
+ public static Color UI_EVENT_CHART_TEXT = getColor(\r
+ "UI_event _chat_text", new RGB(83, 83, 83)); //$NON-NLS-1$\r
+\r
+ public static Color SCREENSHOT_CHART_SELECTED_LINE = getColor(\r
+ "screenshot_chart_selected_line", new RGB(59, 188, 232)); //$NON-NLS-1$\r
+ public static Color SCREENSHOT_CHART_BORDER_LINE = getColor(\r
+ "screenshot_chart_border_line", new RGB(117, 117, 117)); //$NON-NLS-1$\r
+\r
+ public static Color CHART_BOARD_BACK = getColor(\r
+ "chart_board_back", new RGB(230, 230, 230)); //$NON-NLS-1$\r
+ public static Color CHART_BOARD_ITEM_LINE = getColor(\r
+ "chart_board_item_line", new RGB(171, 171, 171)); //$NON-NLS-1$\r
+\r
+ public static Color CHART_BOARD_ITEM_NAME_FOLD_BG = getColor(\r
+ "chart_fold_bg", new RGB(186, 190, 191)); //$NON-NLS-1$\r
+\r
+ public static Color CHART_SELECTION_RANGE = getColor(\r
+ "chart_selection_range", new RGB(23, 98, 132)); //$NON-NLS-1$\r
+ \r
+ public static Color CHART_AXIS = getColor(\r
+ "chart_axis", new RGB(94, 144, 160)); //$NON-NLS-1$\r
+\r
+ // shell window background color\r
+ public static final Color WINDOW_BG_COLOR = getColor(\r
+ "window_bg_color", new RGB(51, 52, 53)); //$NON-NLS-1$\r
+ //\r
+ // /** title bar colors **/\r
+ // public static final Color TITLEBAR_TEXT_COLOR = getColor(\r
+ // "titlebar_text_color", new RGB(64, 208, 255)); //$NON-NLS-1$\r
+ //\r
+ public static final Color TITLEBAR_BG_COLOR = getColor(\r
+ "titlebar_bg", new RGB(78, 79, 81)); //$NON-NLS-1$\r
+\r
+ public static final Color CHECKBOX_DISABLED_FONT_COLOR = getColor(\r
+ "checkbox_disabled_font_color", new RGB(135, 135, 135)); //$NON-NLS-1$\r
+ \r
+ /*** stop progress dialog ***/\r
+ public static final Color STOP_PROGRESS_LINE1_COLOR = getColor("stop_progress_line1_color", new RGB(2, 171, 208)); //$NON-NLS-1$\r
+ public static final Color STOP_PROGRESS_LINE2_COLOR = getColor("stop_progress_line2_color", new RGB(86, 86, 86)); //$NON-NLS-1$\r
+ public static final Color STOP_PROGRESS_BACKGROUND_COLOR = getColor("stop_progress_background_color", new RGB(230, 230, 230)); //$NON-NLS-1$\r
+ public static final Color STOP_PROGRESS_INFO_FONT_COLOR = getColor("stop_progress_info_font_color", new RGB(70, 70, 70)); //$NON-NLS-1$\r
+ public static final Color STOP_PROGRESS_BAR_START_COLOR = getColor("stop_progress_bar_start_color", new RGB(0, 181, 222)); //$NON-NLS-1$\r
+ public static final Color STOP_PROGRESS_BAR_END_COLOR = getColor("stop_progress_bar_end_color", new RGB(4, 108, 143)); //$NON-NLS-1$\r
+ public static final Color STOP_PROGRESS_BAR_BG_START_COLOR = getColor("stop_progress_bar_bg_start_color", new RGB(204, 204, 204)); //$NON-NLS-1$\r
+ public static final Color STOP_PROGRESS_BAR_BG_END_COLOR = getColor("stop_progress_bar_bg_end_color", new RGB(212, 212, 212)); //$NON-NLS-1$\r
+ public static final Color STOP_PROGRESS_BAR_OUTLINE_COLOR = getColor("stop_progress_bar_outline_color", new RGB(150, 150, 150)); //$NON-NLS-1$\r
+ \r
+ \r
+ \r
+ /*** context menu colors ***/\r
+ public static Color CONTEXT_MENU_STATUS_NORMAL_COLOR = getColor("context_menu_status_normal_color", new RGB(230, 230, 230)); //$NON-NLS-1$);\r
+ public static Color CONTEXT_MENU_STATUS_PUSH_COLOR = getColor("context_menu_status_push_color", new RGB(50, 185, 231)); //$NON-NLS-1$\r
+ public static Color CONTEXT_MENU_STATUS_HOVER_COLOR = getColor("context_menu_status_hover_color", new RGB(230, 230, 230)); //$NON-NLS-1$\r
+ public static Color CONTEXT_MENU_STATUSE_DISABLE_COLOR = getColor("context_menu_status_disable_color", new RGB(128, 134,136)); //$NON-\r
+ \r
+ public static Color CONTEXT_MENU_OUTLINE_NORMAL_COLOR = getColor("context_menu_outline_normal_color", new RGB(189, 189, 189)); //$NON-NLS-1$);\r
+ public static Color CONTEXT_MENU_OUTLINE_PUSH_COLOR = getColor("context_menu_outline_push_color", new RGB(255, 255, 255)); //$NON-NLS-1$\r
+ public static Color CONTEXT_MENU_OUTLINE_HOVER_COLOR = getColor("context_menu_outline_hover_color", new RGB(50, 185, 231)); //$NON-NLS-1$\r
+ public static Color CONTEXT_MENU_OUTLINE_DISABLE_COLOR = getColor("context_menu_outline_disable_color", new RGB(115, 115, 115)); //$NON-NLS-1$\r
+ \r
+ public static Color CONTEXT_MENU_STORKE_OUT = getColor("context_menu_storke_out", new RGB(120, 120, 120)); //$NON-NLS-1$\r
+ public static Color CONTEXT_MENU_STORKE_IN = getColor("context_menu_storke_in", new RGB(50, 185, 231)); //$NON-NLS-1$\r
+\r
+ \r
+ //\r
+ // /** device and application combo specific colors start **/\r
+ // public static final Color DEVICE_APPLICATION_ENABLE = WHITE;\r
+ //\r
+ // public static final Color DEVICE_APPLICATION_DISABLE = getColor(\r
+ // "device_application_disable", new RGB(128, 128, 128)); //$NON-NLS-1$\r
+ //\r
+ // public static final Color DEVICE_APPLICATION_POPUP_OUTER_1 = getColor(\r
+ // "device_application_popup_outer_1", new RGB(31, 31, 31)); //$NON-NLS-1$\r
+ //\r
+ // public static final Color DEVICE_APPLICATION_POPUP_OUTER_2 = getColor(\r
+ // "device_application_popup_outer_2", new RGB(31, 137, 163)); //$NON-NLS-1$\r
+ //\r
+ // public static final Color DEVICE_APPLICATION_DROPDOWN_TEXT = WHITE;\r
+ //\r
+ // public static final Color DEVICE_APPLICATION_ITEM_NORMAL_TOP = getColor(\r
+ // "device_application_item_normal_top", new RGB(76, 76, 77)); //$NON-NLS-1$\r
+ //\r
+ // public static final Color DEVICE_APPLICATION_ITEM_NORMAL_INNER =\r
+ // getColor(\r
+ // "device_application_item_normal_inner", new RGB(66, 66, 67)); //$NON-NLS-1$\r
+ //\r
+ // public static final Color DEVICE_APPLICATION_ITEM_NORMAL_BOTTOM =\r
+ // getColor(\r
+ // "device_application_item_normal_bottom", new RGB(56, 56, 60)); //$NON-NLS-1$\r
+ //\r
+ // public static final Color DEVICE_APPLICATION_ITEM_SELECT_TOP = getColor(\r
+ // "device_application_item_select_top", new RGB(76, 76, 77)); //$NON-NLS-1$\r
+ //\r
+ // public static final Color DEVICE_APPLICATION_ITEM_SELECT_INNER =\r
+ // getColor(\r
+ // "device_application_item_select_inner", new RGB(0, 151, 201)); //$NON-NLS-1$\r
+ //\r
+ // public static final Color DEVICE_APPLICATION_ITEM_SELECT_BOTTOM =\r
+ // getColor(\r
+ // "device_application_item_select_bottom", new RGB(56, 56, 60)); //$NON-NLS-1$\r
+ //\r
+ // /** device and application combo specific colors end **/\r
+ //\r
+ // /** normal view layout colors start **/\r
+ //\r
+ // public static final Color NORMAL_VIEW_LAYOUT_OUTER = getColor(\r
+ // "normal_view_layout_outer", new RGB(160, 160, 160)); //$NON-NLS-1$\r
+ //\r
+ // public static final Color NORMAL_VIEW_LAYOUT_MIDDLE = getColor(\r
+ // "normal_view_layout_middle", new RGB(74, 74, 74)); //$NON-NLS-1$\r
+ //\r
+ // public static final Color NORMAL_VIEW_LAYOUT_INNER = getColor(\r
+ // "normal_view_layout_inner", new RGB(66, 66, 68)); //$NON-NLS-1$\r
+ //\r
+ // /** normal view layout colors end **/\r
+ //\r
+ // /** current view colors start **/\r
+ // public static final Color CURRENT_VIEW_OUTLINE = getColor(\r
+ // "current_view_outline", new RGB(160, 160, 160)); //$NON-NLS-1$\r
+ // public static final Color CURRENT_VIEW_TITLE_TEXT = WHITE;\r
+ // public static final Color CURRENT_VIEW_MIDDLE =\r
+ // NORMAL_VIEW_LAYOUT_MIDDLE;\r
+ // public static final Color CURRENT_VIEW_INNER = NORMAL_VIEW_LAYOUT_INNER;\r
+ //\r
+ // public static final Color CURRENT_VIEW_TABLE_TITLE_BG = getColor(\r
+ // "current_view_table_title_bg", new RGB(59, 59, 60)); //$NON-NLS-1$\r
+ // public static final Color CURRENT_VIEW_TABLE_TITLE_TEXT = getColor(\r
+ // "current_view_table_title_text", new RGB(151, 230, 255)); //$NON-NLS-1$\r
+ // public static final Color CURRENT_VIEW_TABLE_CONTENTS_BG = getColor(\r
+ // "current_view_table_contents_bg", new RGB(84, 85, 86)); //$NON-NLS-1$\r
+ // public static final Color CURRENT_VIEW_TABLE_CONTENTS_TEXT = getColor(\r
+ // "current_view_table_contents_text", new RGB(216, 216, 216)); //$NON-NLS-1$\r
+ // public static final Color CURRENT_VIEW_TABLE_LINE = getColor(\r
+ // "current_view_table_line", new RGB(136, 137, 138)); //$NON-NLS-1$\r
+ //\r
+ // public static final Color CURRENT_VIEW_CPU_TEXT = getColor(\r
+ // "current_view_cpu_text", new RGB(2, 171, 208)); //$NON-NLS-1$\r
+ // public static final Color CURRENT_VIEW_PROCESS_TEXT = getColor(\r
+ // "current_view_process_text", new RGB(114, 203, 8)); //$NON-NLS-1$\r
+ // public static final Color CURRENT_VIEW_GRAPH_BG = getColor(\r
+ // "current_view_graph_bg", new RGB(79, 79, 81)); //$NON-NLS-1$\r
+ // public static final Color CURRENT_VIEW_CPU_GRAPH = CURRENT_VIEW_CPU_TEXT;\r
+ // public static final Color CURRENT_VIEW_PROCESS_GRAPH =\r
+ // CURRENT_VIEW_PROCESS_TEXT;\r
+ // public static final Color CURRENT_VIEW_GRAPH_OUTLINE = getColor(\r
+ // "current_view_graph_outline", new RGB(43, 44, 45)); //$NON-NLS-1$\r
+ //\r
+ // public static final Color CURRENT_VIEW_SNAPSHOT_OUTLINE = getColor(\r
+ // "current_view_snapshot_outline", new RGB(49, 104, 127)); //$NON-NLS-1$\r
+ // /** current view colors end **/\r
+ //\r
+ // /** common table colors start **/\r
+ // public static final Color TABLE_HEADER_BG = getColor(\r
+ // "table_header_bg", new RGB(59, 59, 60)); //$NON-NLS-1$\r
+ // public static final Color TABLE_LINE = getColor(\r
+ // "table_line", new RGB(136, 137, 138)); //$NON-NLS-1$\r
+ // public static final Color TABLE_CONTENTS_NORMAL = getColor(\r
+ // "table_contents_normal", new RGB(84, 85, 86)); //$NON-NLS-1$\r
+ // public static final Color TABLE_CONTENTS_HOVER = getColor(\r
+ // "table_contents_hover", new RGB(72, 98, 108)); //$NON-NLS-1$\r
+ // public static final Color TABLE_CONTENTS_SELECTED_START = getColor(\r
+ // "table_contents_selected_start", new RGB(0, 146, 193)); //$NON-NLS-1$\r
+ // public static final Color TABLE_CONTENTS_SELECTED_END = getColor(\r
+ // "table_contents_selected_end", new RGB(0, 60, 79)); //$NON-NLS-1$\r
+ // public static final Color TABLE_HEADER_FONT_COLOR = getColor(\r
+ // "table_title_font_color", new RGB(151, 230, 255)); //$NON-NLS-1$\r
+ // public static final Color TABLE_CONTENTS_FONT_COLOR = getColor(\r
+ // "table_contents_font_color", new RGB(216, 216, 216)); //$NON-NLS-1$\r
+ // /** common table colors end **/\r
+ //\r
+ // /** open trace popup colors **/\r
+ // public static final Color OPEN_TRACE_POPUP_CONTENTS_BG_COLOR = getColor(\r
+ // "open_trace_popup_contents_bg_color", new RGB(51, 52, 53)); //$NON-NLS-1$\r
+ // public static final Color OPEN_TRACE_POPUP_BOTTOM_BG_COLOR = getColor(\r
+ // "open_trace_popup_bottom_bg_color", new RGB(39, 39, 40)); //$NON-NLS-1$\r
+ // public static final Color OPEN_TRACE_TITLE_TEXT_COLOR =\r
+ // TITLEBAR_TEXT_COLOR;\r
+ // public static final Color OPEN_TRACE_INNERTITLE_TEXT_COLOR = WHITE;\r
+ // public static final Color OPEN_TRACE_BUTTON_TEXT_COLOR = WHITE;\r
+ // public static final Color OPEN_TRACE_TABLE_OUTLINE_COLOR =\r
+ // CURRENT_VIEW_TABLE_LINE;\r
+ // public static final Color OPEN_TRACE_TABLE_LINE1_NORMAL = getColor(\r
+ // "open_trace_table_line1_normal", new RGB(78, 78, 79)); //$NON-NLS-1$\r
+ // public static final Color OPEN_TRACE_TABLE_LINE1_HOVER = getColor(\r
+ // "open_trace_table_line1_hover", new RGB(72, 98, 108)); //$NON-NLS-1$\r
+ // public static final Color OPEN_TRACE_TABLE_LINE_SELECTED_START =\r
+ // getColor(\r
+ // "open_trace_table_line_selected_start", new RGB(0, 146, 193)); //$NON-NLS-1$\r
+ // public static final Color OPEN_TRACE_TABLE_LINE_SELECTED_END = getColor(\r
+ // "open_trace_table_line_selected_end", new RGB(0, 60, 79)); //$NON-NLS-1$\r
+ //\r
+ // public static final Color OPEN_TRACE_TABLE_LINE2_NORMAL = getColor(\r
+ // "open_trace_table_line2_normal", new RGB(84, 85, 86)); //$NON-NLS-1$\r
+ // public static final Color OPEN_TRACE_TABLE_LINE2_HOVER = getColor(\r
+ // "open_trace_table_line2_hover", new RGB(72, 98, 108)); //$NON-NLS-1$\r
+ //\r
+ // public static final Color OPEN_TRACE_TABLE2_FONT_COLOR = getColor(\r
+ // "open_trace_table2_font_color", new RGB(255, 85, 57)); //$NON-NLS-1$\r
+ //\r
+ // /** snapshot viewer colors **/\r
+ // public static final Color SNAPSHOT_VIEWER_BORDER = getColor(\r
+ // "snapshot_viewer_border", new RGB(49, 104, 127)); //$NON-NLS-1$\r
+ //\r
+ // /** File chart colors **/\r
+ // public static final Color FILE_CLOSED_START = getColor(\r
+ // "file_closed_start", new RGB(168, 198, 71)); //$NON-NLS-1$\r
+ // public static final Color FILE_CLOSED_END = getColor(\r
+ // "file_closed_end", new RGB(130, 152, 54)); //$NON-NLS-1$\r
+ // public static final Color FILE_USED_START = getColor(\r
+ // "file_used_start", new RGB(58, 138, 203)); //$NON-NLS-1$\r
+ // public static final Color FILE_USED_END = getColor(\r
+ // "file_used_end", new RGB(44, 104, 153)); //$NON-NLS-1$\r
+ // public static final Color FILE_OPEN_START = getColor(\r
+ // "file_open_start", new RGB(255, 135, 82)); //$NON-NLS-1$\r
+ // public static final Color FILE_OPEN_END = getColor(\r
+ // "file_open_end", new RGB(232, 73, 73)); //$NON-NLS-1$\r
+ // public static final Color FILE_FAILED_START = getColor(\r
+ // "file_failed_start", new RGB(226, 58, 242)); //$NON-NLS-1$\r
+ // public static final Color FILE_FAILED_END = getColor(\r
+ // "file_failed_end", new RGB(164, 40, 176)); //$NON-NLS-1$\r
+ // public static final Color FILE_CHART_SELECTION_BG = getColor(\r
+ // "file_chart_selection_bg", new RGB(0, 151, 201)); //$NON-NLS-1$\r
+ // public static final Color FILE_CHART_PARENT_BG = getColor(\r
+ // "file_chart_parent_bg", new RGB(84, 85, 86)); //$NON-NLS-1$\r
+ // public static final Color FILE_CHART_CHILD_BG = getColor(\r
+ // "file_chart_child_bg", new RGB(59, 59, 60)); //$NON-NLS-1$\r
+ //\r
+ //\r
+ //\r
+ // public static final Color VIEW_BORDER = getColor(\r
+ // "view_border", new RGB(74, 74, 74)); //$NON-NLS-1$\r
+ // public static final Color VIEW_BG_COLOR = getColor(\r
+ // "view_bg_color", new RGB(66, 66, 68)); //$NON-NLS-1$\r
+ //\r
+ // public static final Color TAB_BG_COLOR = VIEW_BG_COLOR; //$NON-NLS-1$\r
+ // public static final Color TABLE_BG_COLOR = getColor(\r
+\r
+ // "table_bg_color", new RGB(84, 85, 87)); //$NON-NLS-1$\r
+ // public static final Color TABLE_HEADER_COLOR = getColor(\r
+ // "table_header_color", new RGB(59, 59, 61)); //$NON-NLS-1$\r
+ // // public static final Color TABLE_HEADER_FONT_COLOR = getColor(\r
+ // // "table_header_font_color", new RGB(75, 229, 253)); //$NON-NLS-1$\r
+ // public static final Color TABLE_LINE_COLOR = getColor(\r
+ // "table_line_color", new RGB(96, 97, 99)); //$NON-NLS-1$\r
+ //\r
+ // public static final Color UNSELECTED_TAB_FIRST = getColor(\r
+ // "unselected_tab_first", new RGB(51, 51, 51)); //$NON-NLS-1$\r
+ // public static final Color UNSELECTED_TAB_SECOND = getColor(\r
+ // "unselected_tab_second", new RGB(42, 42, 42)); //$NON-NLS-1$\r
+ // public static final Color SELECTED_TAB_FIRST = getColor(\r
+ // "selected_tab_first", new RGB(74, 74, 74)); //$NON-NLS-1$\r
+ // public static final Color SELECTED_TAB_SECOND = getColor(\r
+ // "selected_tab_second", new RGB(128, 129, 130)); //$NON-NLS-1$\r
+ //\r
+ // public static final Color TOOLTIP = getColor(\r
+ // "tooltip", new RGB(255, 255, 225)); //$NON-NLS-1$\r
+ //\r
+ public static final Color BAR_GRAY1 = getColor(\r
+ "barGRAY1", new RGB(177, 177, 177)); //$NON-NLS-1$\r
+ // public static final Color BAR_GRAY2 = getColor(\r
+ // "barGRAY2", new RGB(153, 153, 153)); //$NON-NLS-1$\r
+ // public static final Color BAR_GRAY3 = getColor(\r
+ // "barGRAY3", new RGB(216, 216, 216)); //$NON-NLS-1$\r
+ //\r
+ // /* Timeline */\r
+ public static final Color ITEM_BLUE_BRIGHT = getColor("item blue right",\r
+ new RGB(131, 196, 218));//$NON-NLS-1$\r
+ public static final Color ITEM_BLUE_DARK = getColor("item blue dark",\r
+ new RGB(38, 104, 138));//$NON-NLS-1$\r
+ public static final Color LIFECYCLE_INITIALIZING_TOP = getColor(\r
+ "lifecycle_initializing_top", new RGB(123, 182, 240));//$NON-NLS-1$\r
+ public static final Color LIFECYCLE_INITIALIZING_BOTTOM = getColor(\r
+ "lifecycle_initializing_bottom", new RGB(65, 141, 218));//$NON-NLS-1$\r
+ public static final Color LIFECYCLE_RUNNING_TOP = getColor(\r
+ "lifecycle_running_top", new RGB(194, 238, 131));//$NON-NLS-1$\r
+ public static final Color LIFECYCLE_RUNNING_BOTTOM = getColor(\r
+ "lifecycle_running_bottom", new RGB(143, 198, 63));//$NON-NLS-1$\r
+ public static final Color LIFECYCLE_PAUSING_TOP = getColor(\r
+ "lifecycle_pausing_top", new RGB(170, 170, 170));//$NON-NLS-1$\r
+ public static final Color LIFECYCLE_PAUSING_BOTTOM = getColor(\r
+ "lifecycle_pausing_bottom", new RGB(113, 113, 113));//$NON-NLS-1$\r
+ public static final Color LIFECYCLE_TERMINATING_TOP = getColor(\r
+ "lifecycle_terminating_top", new RGB(223, 143, 140));//$NON-NLS-1$\r
+ public static final Color LIFECYCLE_TERMINATING_BOTTOM = getColor(\r
+ "lifecycle_terminating_bottom", new RGB(198, 82, 77));//$NON-NLS-1$\r
+\r
+ \r
+ \r
+ // public static final Color ITEM_BG = getColor("item background", new\r
+ // RGB(50,\r
+ // 50, 50));//$NON-NLS-1$\r
+ // public static final java.awt.Color ITEM_BG_AWT = new java.awt.Color(50,\r
+ // 50,\r
+ // 50);//$NON-NLS-1$\r
+ // public static final java.awt.Color ITEM_BLUE_AWT = new java.awt.Color(38,\r
+ // 104, 138);//$NON-NLS-1$\r
+ // public static final Color TIMELINE_BG = getColor(\r
+ // "timeline_bg", new RGB(50, 50, 50)); //$NON-NLS-1$\r
+ // public static final Color TRANS = getColor(\r
+ // "timeline_bg", new RGB(50, 50, 50)); //$NON-NLS-1$\r
+ // public static final Color SNAPSHOT_CHART_FOREGROUND = BAR_GRAY1;\r
+ // public static final Color SNAPSHOT_CHART_BACKGROUND = getColor(\r
+ // "snapshot_chart_bg", new RGB(50, 50, 50)); //$NON-NLS-1$\r
+ //\r
+ // public static final Color GRAY_80 = getColor("GRAY_80", new RGB(80, 80, 80)); //$NON-NLS-1$\r
+ // public static final Color GRAY_110 = getColor(\r
+ // "GRAY_110", new RGB(110, 110, 110)); //$NON-NLS-1$\r
+ // public static final Color GRAY_130 = getColor(\r
+ // "GRAY_130", new RGB(130, 130, 130)); //$NON-NLS-1$\r
+ // public static final Color GRAY_170 = getColor(\r
+ // "GRAY_170", new RGB(170, 170, 170)); //$NON-NLS-1$\r
+ // public static final Color GRAY_210 = getColor(\r
+ // "GRAY_210", new RGB(210, 210, 210)); //$NON-NLS-1$\r
+ //\r
+ // public static final java.awt.Color DEFAULT_CHART_FOREGROUND =\r
+ // java.awt.Color.LIGHT_GRAY;\r
+ // public static final java.awt.Color DEFAULt_CHART_BACKGROUND = new\r
+ // java.awt.Color(\r
+ // 66, 66, 68);\r
+ // public static final Color DEFAULT_FOREGROUND = getColor(\r
+ // "defaultForeground", new RGB(0, 0, 0)); //$NON-NLS-1$\r
+ // public static final Color DEFAULT_BACKGROUND = getColor(\r
+ // "defaultBackground", new RGB(255, 255, 255)); //$NON-NLS-1$\r
+ // public static final Color DEFAULT_RED = getColor(\r
+ // "defaultRed", new RGB(173, 13, 1)); //$NON-NLS-1$\r
+ //\r
+ // // circular graph\r
+ // public static final Color CPU_CIRCULAR_GRAPH_COLOR = getColor(\r
+ // "cpu_circular_graph_color", new RGB(2, 171, 208)); //$NON-NLS-1$\r
+ // public static final Color PROCESS_CIRCULAR_GRAPH_COLOR = getColor(\r
+ // "process_circular_graph_color", new RGB(114, 203, 8)); //$NON-NLS-1$\r
+ //\r
+ // public static final Color PROFILING_GRAPH_COLOR_START = getColor(\r
+ // "profiling_graph_color_start", new RGB(145, 190, 3)); //$NON-NLS-1$\r
+ // public static final Color PROFILING_GRAPH_COLOR_END = getColor(\r
+ // "profiling_graph_color_end", new RGB(114, 149, 1)); //$NON-NLS-1$\r
+ //\r
+ // public static final Color PROFILING_GRAPH_SELECTION_COLOR_START =\r
+ // getColor(\r
+ // "profiling_graph_selection_color_start", new RGB(255, 135, 82)); //$NON-NLS-1$\r
+ // public static final Color PROFILING_GRAPH_SELECTION_COLOR_END = getColor(\r
+ // "profiling_graph_selection_color_end", new RGB(232, 73, 73)); //$NON-NLS-1$\r
+\r
+ private static Color getColor(String colorName, RGB rgb) {\r
+ if (!colorRegistry.hasValueFor(colorName)) {\r
+ colorRegistry.put(colorName, rgb);\r
+ }\r
+\r
+ return colorRegistry.get(colorName);\r
+ }\r
+\r
+}\r
--- /dev/null
+/*\r
+ * Dynamic Analyzer\r
+ *\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact: \r
+ * Jooyoul Lee <jy.exe.lee@samsung.com>\r
+ * Juyoung Kim <j0.kim@samsung.com>\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ * \r
+ */\r
+package org.tizen.dynamicanalyzer.widgets.helper;\r
+\r
+import org.eclipse.jface.resource.FontRegistry;\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.graphics.Font;\r
+import org.eclipse.swt.graphics.FontData;\r
+import org.eclipse.ui.PlatformUI;\r
+\r
+public class FontResources {\r
+\r
+ private static FontRegistry fontRegistry = new FontRegistry();\r
+\r
+ public static final String ARIAL = "Arial"; //$NON-NLS-1$\r
+ private static final Font systemFont = PlatformUI.getWorkbench()\r
+ .getDisplay().getSystemFont();\r
+\r
+ public static final Font EX_FONT = getFont("ex_font", //$NON-NLS-1$\r
+ new FontData[] { new FontData(ARIAL, 28, SWT.NORMAL) });\r
+ public static final Font TITLEBAR = getFont(\r
+ "titlebar", resizeSystemFont(10));//$NON-NLS-1$\r
+\r
+ /** device and application combo specific fonts **/\r
+ public static final Font COMBO = getFont("combo", resizeSystemFont(10));//$NON-NLS-1$\r
+\r
+ public static final Font DROPDOWN = getFont(\r
+ "dropdown", resizeSystemFont(10));//$NON-NLS-1$\r
+\r
+ /** table specific fonts **/\r
+ public static final Font TABLE_HEADER = getFont(\r
+ "table_header", setSystemFont(SWT.NONE, 8));//$NON-NLS-1$\r
+ public static final Font TABLE_CONTENTS = getFont(\r
+ "table_contents", resizeSystemFont(8));//$NON-NLS-1$\r
+\r
+ /** open trace window specific fonts **/\r
+ public static final Font OPEN_TRACE_TITLE = getFont(\r
+ "open_trace_title", resizeSystemFont(9));//$NON-NLS-1$\r
+ public static final Font OPEN_TRACE_INNER_TITLE = getFont(\r
+ "open_trace_inner_title", resizeSystemFont(8));//$NON-NLS-1$\r
+ public static final Font OPEN_TRACE_BUTTON = getFont("open_trace_button", //$NON-NLS-1$\r
+ resizeSystemFont(9));//$NON-NLS-1$\r
+ public static final Font OPEN_TRACE_TEXT = getFont(\r
+ "open_trace_text", resizeSystemFont(8));//$NON-NLS-1$\r
+\r
+ /** about window specific fonts **/\r
+ public static final Font ABOUT_TITLE = getFont(\r
+ "about_title", resizeSystemFont(12));//$NON-NLS-1$\r
+ public static final Font ABOUT_TEXT = getFont(\r
+ "about_text", resizeSystemFont(9));//$NON-NLS-1$\r
+\r
+ public static final Font TEST_TEXT = getFont(\r
+ "about_text", resizeSystemFont(28));//$NON-NLS-1$\r
+\r
+ /** detail info font **/\r
+ public static final Font DETAIL_INFO_FONT = getFont(\r
+ "detail_info_font", resizeSystemFont(9));//$NON-NLS-1$\r
+\r
+ public static final Font CATEGORY = getFont("category", resizeSystemFont(8));//$NON-NLS-1$\r
+\r
+ public static final Font TIMER = getFont("timer", resizeSystemFont(12));//$NON-NLS-1$\r
+\r
+ public static final Font TIMER_MSEC = getFont(\r
+ "timer_msec", resizeSystemFont(10));//$NON-NLS-1$\r
+\r
+ public static final Font VIEW_TITLE = getFont(\r
+ "view_title", resizeSystemFont(10));//$NON-NLS-1$\r
+\r
+ public static final Font TOOLTIP = getFont("tooltip", resizeSystemFont(9));//$NON-NLS-1$\r
+\r
+ public static final Font TABLE_HEADER_FONT = getFont(\r
+ "table_header_font", resizeSystemFont(8));//$NON-NLS-1$\r
+ public static final Font TABLE_CELL_FONT = getFont(\r
+ "table_cell_font", resizeSystemFont(8));//$NON-NLS-1$\r
+\r
+ public static final Font TIMELINE_FONT = getFont(\r
+ "table_font", resizeSystemFont(8));//$NON-NLS-1$\r
+ public static final Font TIMELINE_TICK_FONT = getFont(\r
+ "time_tick", resizeSystemFont(7));//$NON-NLS-1$\r
+\r
+ public static final Font CIRCULAR_GRAPH_FONT = getFont(\r
+ "circular_graph_font", resizeSystemFont(13));//$NON-NLS-1$\r
+ public static final Font CIRCULAR_GRAPH_MEASURE_FONT = getFont(\r
+ "circular_graph_measure_font", resizeSystemFont(9));//$NON-NLS-1$\r
+ public static final Font CIRCULAR_LABEL_FONT = getFont(\r
+ "circular_label_font", resizeSystemFont(9));//$NON-NLS-1$\r
+\r
+ public static final Font ADDITEM_BUTTON_FONT = getFont(\r
+ "additem_button_font", resizeSystemFont(8));//$NON-NLS-1$\r
+ public static final Font TAB_BUTTON_FONT = getFont(\r
+ "tab_button_font", resizeSystemFont(10));//$NON-NLS-1$\r
+\r
+ public static final Font CURRENT_TABLE_HEADER_FONT = getFont(\r
+ "current_table_header_font", resizeSystemFont(8));//$NON-NLS-1$\r
+ public static final Font CURRENT_TABLE_CELL_FONT = getFont(\r
+ "current_table_cell_font", resizeSystemFont(8));//$NON-NLS-1$\r
+\r
+ public static final Font DIALOG_BUTTON_FONT = getFont(\r
+ "dialog_button_font", resizeSystemFont(10));//$NON-NLS-1$\r
+\r
+ public static final Font SCORE_TITLE_FONT = getFont(\r
+ "score_title_font", setSystemFont(SWT.BOLD, 12));//$NON-NLS-1$\r
+\r
+ public static final Font CHART_ITEM_NAME_FONT = getFont(\r
+ "chart_time_name_font", resizeSystemFont(8));//$NON-NLS-1$\r
+\r
+ public static final Font CHART_ARROW_TID_FONT = getFont(\r
+ "chart_arrow_tid_font", setSystemFont(SWT.BOLD, 7));//$NON-NLS-1$\r
+\r
+ public static final Font CHART_SERIES_FONT = getFont(\r
+ "chart_series_font", setSystemFont(SWT.BOLD, 7));//$NON-NLS-1$\r
+\r
+ public static final Font CHART_AXIS_FONT = getFont(\r
+ "chart_axis_font", resizeSystemFont(8));//$NON-NLS-1$\r
+ \r
+ // * stop progress dialog\r
+ public static final Font STOP_PROGRESS_FONT = getFont(\r
+ "stop_progress_font", resizeSystemFont(8));//$NON-NLS-1$\r
+ public static final Font PROGRESS_FONT = getFont(\r
+ "progress_font", resizeSystemFont(9));//$NON-NLS-1$\r
+\r
+ public static final Font CONTEXT_MENU_ITEM_FONT = getFont(\r
+ "context_menu_item_font", resizeSystemFont(9));//$NON-NLS-1$\r
+ \r
+ public static Font getFont(String fontName, FontData[] fontData) {\r
+ if (!fontRegistry.hasValueFor(fontName)) {\r
+ fontRegistry.put(fontName, fontData);\r
+ }\r
+\r
+ return fontRegistry.get(fontName);\r
+ }\r
+\r
+ public static FontData[] resizeSystemFont(int size) {\r
+ FontData[] fontData = systemFont.getFontData();\r
+ for (int i = 0; i < fontData.length; i++) {\r
+ fontData[i].setHeight(size);\r
+ }\r
+ return fontData;\r
+ }\r
+\r
+ public static FontData[] setStyleSystemFont(int style) {\r
+ FontData[] fontData = systemFont.getFontData();\r
+ for (int i = 0; i < fontData.length; i++) {\r
+ fontData[i].setStyle(style);\r
+ }\r
+ return fontData;\r
+ }\r
+\r
+ public static FontData[] setSystemFont(int style, int size) {\r
+ FontData[] fontData = systemFont.getFontData();\r
+ for (int i = 0; i < fontData.length; i++) {\r
+ fontData[i].setStyle(style);\r
+ fontData[i].setHeight(size);\r
+ }\r
+ return fontData;\r
+ }\r
+}\r
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.helper;
+
+import java.text.DecimalFormat;
+
+public class Formatter {
+
+ public static String toHexString(String decimal) {
+ if (null == decimal || decimal.isEmpty()) {
+ return null;
+ }
+
+ try {
+ if (decimal.isEmpty()) {
+ return null;
+ } else {
+ long data = 0;
+ data = Long.parseLong(decimal);
+ return String.format("0x%08X", data); //$NON-NLS-1$
+ }
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ return decimal;
+ }
+ }
+
+ public static String toDoubleFormat1(String value) {
+ if (null == value || value.isEmpty()) {
+ return null;
+ }
+
+ try {
+ double data = Double.parseDouble(value);
+ return String.format("%.1f", data); //$NON-NLS-1$
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ return value;
+ }
+ }
+
+ public static String toByteNumberFormat(String value) {
+ if (null == value || value.isEmpty()) {
+ return null;
+ }
+
+ try {
+ long num = Long.parseLong(value);
+ String str = ""; //$NON-NLS-1$
+ while (num > 0) {
+ long n = num % 1000;
+ if (str.isEmpty()) {
+ str += Long.toString(n);
+ } else {
+ String zero = ""; //$NON-NLS-1$
+ if (str.length() == 1) {
+ zero += "00"; //$NON-NLS-1$
+ } else if (str.length() == 2) {
+ zero += "0"; //$NON-NLS-1$
+ }
+ str = zero + Long.toString(n) + "," + str; //$NON-NLS-1$
+ }
+ num /= 1000;
+ }
+ if (str.isEmpty()) {
+ str += "0"; //$NON-NLS-1$
+ }
+ return str;
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ return "0"; //$NON-NLS-1$
+ }
+ }
+
+ public static String toByteToMbNumberFormat2(String value) {
+ if (null == value || value.isEmpty()) {
+ return null;
+ }
+ try {
+ long num = Long.parseLong(value);
+ num /= 1024; // KB
+ double kb = num / 1024.;
+
+ String str = Formatter.toDoubleFormat2(Double.toString(kb));
+ return str;
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ return "0"; //$NON-NLS-1$
+ }
+ }
+
+ public static String toDoubleFormat2(String value) {
+ if (null == value || value.isEmpty()) {
+ return null;
+ }
+
+ try {
+ double data = Double.parseDouble(value);
+ return String.format("%.2f", data); //$NON-NLS-1$
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ return value;
+ }
+ }
+
+ public static String toTimeFormat(long time) {
+ time /= 1000;
+ long ms = time % 1000;
+ time /= 1000;
+ long second = time % 60;
+ time /= 60;
+ long minute = time % 60;
+ String strMinute = Long.toString(minute);
+ if (strMinute.length() < 2) {
+ strMinute = "0" + strMinute; //$NON-NLS-1$
+ }
+
+ String strSecond = Long.toString(second);
+ if (strSecond.length() < 2) {
+ strSecond = "0" + strSecond; //$NON-NLS-1$
+ }
+
+ String strMs = Long.toString(ms);
+ if (strMs.length() == 2) {
+ strMs = "0" + strMs; //$NON-NLS-1$
+ } else if (strMs.length() == 1) {
+ strMs = "00" + strMs; //$NON-NLS-1$
+ }
+
+ String output = strMinute + ":" + strSecond + ":" + strMs; //$NON-NLS-1$ //$NON-NLS-2$
+ return output;
+ }
+
+ public static String toTimeFormat(String time) {
+ long longTime = Long.parseLong(time);
+
+ return toTimeFormat(longTime);
+ }
+
+ public static String toTimeFormat2(String msTime) {
+ long longTime = Long.parseLong(msTime);
+ long ms = longTime % 1000;
+ longTime /= 1000;
+ long second = longTime % 60;
+
+ String strSecond = Long.toString(second);
+ if (strSecond.length() < 2) {
+ strSecond = "0" + strSecond; //$NON-NLS-1$
+ }
+
+ String strMs = Long.toString(ms);
+ if (strMs.length() == 2) {
+ strMs = "0" + strMs; //$NON-NLS-1$
+ } else if (strMs.length() == 1) {
+ strMs = "00" + strMs; //$NON-NLS-1$
+ }
+
+ String output = strSecond + ":" + strMs; //$NON-NLS-1$
+ return output;
+ }
+
+ public static String toTimelineFormat(int totalSecond){
+ String output;
+
+ int second = totalSecond % 60;
+ int minute = totalSecond / 60;
+
+ if(minute > 60){
+ int hours = minute/60;
+ output = String.format("%d:%02d:%02d", hours, minute%60, second); //$NON-NLS-1$
+ }
+ else{
+ output = String.format("%02d:%02d", minute,second); //$NON-NLS-1$
+ }
+ return output;
+ }
+
+ public static String toPercentageFormat(Double input) {
+ String ret = String.format("%.2f", input); //$NON-NLS-1$
+ ret += " %"; //$NON-NLS-1$
+ return ret;
+ }
+
+ public static String toNumberFormat(long input) {
+ int reminder = 0;
+ long quotient = input;
+ String output = ""; //$NON-NLS-1$
+
+ while (true) {
+ reminder = (int) (quotient % 1000);
+ quotient = quotient / 1000;
+ String value = Integer.toString(reminder);
+ if (quotient > 0) {
+ if (value.length() < 2) {
+ value = "00" + value; //$NON-NLS-1$
+ } else if (value.length() < 3) {
+ value = "0" + value; //$NON-NLS-1$
+ }
+ output = value + output;
+ output = "," + output; //$NON-NLS-1$
+ } else {
+ output = value + output;
+ break;
+ }
+ }
+ return output;
+ }
+
+ public static String toNumberFormat(double input) {
+ return toNumberFormat((long) input);
+ }
+
+ public static String toByteFormat(long input) {
+ int reminder = 0;
+ long quotient = input;
+ int count = 0;
+ String value = ""; //$NON-NLS-1$
+
+ while (true) {
+ if (quotient >= 1024) {
+ reminder = (int) (quotient % 1024);
+ quotient = quotient / 1024;
+ count++;
+ continue;
+ } else {
+ value = Long.toString(quotient);
+ String remStr = Integer.toString(reminder);
+ if (count > 0) {
+ if (remStr.length() < 3) {
+ value += ".0"; //$NON-NLS-1$
+ } else {
+ value += "." + remStr.substring(0, 1); //$NON-NLS-1$
+ }
+ }
+ value += " " + getMeasure(count); //$NON-NLS-1$
+ break;
+ }
+ }
+ return value;
+ }
+
+ public static String toByteFormat(double input) {
+ return toByteFormat((long) input);
+ }
+
+ public static String toBpsFormat(long nByte, long startTime, long endTime) {
+ String value = ""; //$NON-NLS-1$
+ DecimalFormat df1 = new DecimalFormat("#,##0.00"); //$NON-NLS-1$
+ double Bps = nByte;
+
+ if (endTime - startTime >= 1000000) {
+ Bps = ((double) nByte * ((double) 1000000 / (double) (endTime - startTime)));
+ }
+
+ value += df1.format(Bps) + " Bps"; //$NON-NLS-1$
+ return value;
+ }
+
+ public static String toBpsFormat(double nByte, long startTime, long endTime) {
+ return toBpsFormat((long) nByte, startTime, endTime);
+ }
+
+ private static String getMeasure(int count) {
+ if (count == 4) {
+ return "TB"; //$NON-NLS-1$
+ } else if (count == 3) {
+ return "GB"; //$NON-NLS-1$
+ } else if (count == 2) {
+ return "MB"; //$NON-NLS-1$
+ } else if (count == 1) {
+ return "KB"; //$NON-NLS-1$
+ } else {
+ return "Byte"; //$NON-NLS-1$
+ }
+ }
+
+ // only return value
+ public static String toByteFormatValue(long input) {
+ int reminder = 0;
+ long quotient = input;
+ int count = 0;
+ String value = ""; //$NON-NLS-1$
+
+ while (true) {
+ if (quotient >= 1024) {
+ reminder = (int) (quotient % 1024);
+ quotient = quotient / 1024;
+ count++;
+ continue;
+ } else {
+ value = Long.toString(quotient);
+ String remStr = Integer.toString(reminder);
+ if (count > 0) {
+ if (remStr.length() < 3) {
+ value += ".0"; //$NON-NLS-1$
+ } else {
+ value += "." + remStr.substring(0, 1); //$NON-NLS-1$
+ }
+ }
+ // value += " " + getMeasure(count); //$NON-NLS-1$
+ break;
+ }
+ }
+ return value;
+ }
+
+ // only return measure
+ public static String toByteFormatMeasure(long input) {
+ long quotient = input;
+ int count = 0;
+ String value = null;
+
+ while (true) {
+ if (quotient >= 1024) {
+ quotient = quotient / 1024;
+ count++;
+ continue;
+ } else {
+ value = getMeasure(count); //$NON-NLS-1$
+ break;
+ }
+ }
+ return value;
+ }
+
+ public static String toByteFormatConvert(double input){
+ char[] c = new char[]{'K', 'M', 'G', 'T'};
+ long k = 1024;
+ char unit = ' ';
+ long quotient = (long)input;
+ long remainder = ((long)(input*(double)k)) % k;
+ String ret;
+
+ long n = k;
+ for(int i=0; i<c.length; i++){
+ if(input < n){
+ break;
+ }
+ remainder = quotient % k;
+ quotient /= k;
+ unit = c[i];
+ n *= k;
+ }
+ if(0 == remainder || unit == ' '){
+ ret = String.format("%d",quotient);
+ }
+ else{
+ ret = String.format("%d.%d%c", quotient,remainder,unit);
+ }
+ return ret;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.helper;
+
+import java.io.File;
+import java.io.InputStream;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+
+public class ImageResources {
+ private static ImageRegistry imageRegistry = new ImageRegistry();
+
+ // Dialog button
+ public static final Image DIALOG_PUSH = getPngImage("dialog_button_push"); //$NON-NLS-1$
+
+ public static final Image ABOUT = getPngImage("toolbar_about_nor"); //$NON-NLS-1$
+ public static final Image ABOUT_PUSH = getPngImage("toolbar_about_push"); //$NON-NLS-1$
+ public static final Image ABOUT_HOVER = getPngImage("toolbar_about_hover"); //$NON-NLS-1$
+ public static final Image ABOUT_DISABLE = getPngImage("toolbar_about_disable"); //$NON-NLS-1$
+
+ public static final Image VIEW_SOURCE = getPngImage("toolbar_source_view_nor"); //$NON-NLS-1$
+ public static final Image VIEW_SOURCE_PUSH = getPngImage("toolbar_source_view_push"); //$NON-NLS-1$
+ public static final Image VIEW_SOURCE_HOVER = getPngImage("toolbar_source_view_hover"); //$NON-NLS-1$
+ public static final Image VIEW_SOURCE_TOGGLE = getPngImage("toolbar_source_view_tog"); //$NON-NLS-1$
+ public static final Image VIEW_SOURCE_DISABLE = getPngImage("toolbar_source_view_disable"); //$NON-NLS-1$
+
+ /* combo */
+ public static final Image COMBO_DROPDOWN_UP = getPngImage("dropdown_up"); //$NON-NLS-1$
+ public static final Image COMBO_DROPDOWN_DOWN = getPngImage("dropdown_down"); //$NON-NLS-1$
+
+ /* timeline */
+ public static final Image TIMELINE_DETAILED_TIME_BALLOON = getPngImage("timeline_mouse_x"); //$NON-NLS-1$
+
+ /* snapshot */
+ public static final Image SNAPSHOT_LEFT_NORMAL = getPngImage("snapshot_arrow_left_nor"); //$NON-NLS-1$
+ public static final Image SNAPSHOT_LEFT_PUSH = getPngImage("snapshot_arrow_left_push"); //$NON-NLS-1$
+ public static final Image SNAPSHOT_LEFT_HOVER = getPngImage("snapshot_arrow_left_hover"); //$NON-NLS-1$
+ public static final Image SNAPSHOT_LEFT_DISABLE = getPngImage("snapshot_arrow_left_disable"); //$NON-NLS-1$
+ public static final Image SNAPSHOT_RIGHT_NORMAL = getPngImage("snapshot_arrow_right_nor"); //$NON-NLS-1$
+ public static final Image SNAPSHOT_RIGHT_PUSH = getPngImage("snapshot_arrow_right_push"); //$NON-NLS-1$
+ public static final Image SNAPSHOT_RIGHT_HOVER = getPngImage("snapshot_arrow_right_hover"); //$NON-NLS-1$
+ public static final Image SNAPSHOT_RIGHT_DISABLE = getPngImage("snapshot_arrow_right_disable"); //$NON-NLS-1$
+
+ public static final Image TIMER = getPngImage("toolbar_time_bg"); //$NON-NLS-1$
+
+ public static final Image NO_IMAGE = getPngImage("noImage"); //$NON-NLS-1$
+
+ /* chart */
+ public static final Image CHART_EVENT_CALLEE_ARW = getPngImage("event_callee_arw"); //$NON-NLS-1$
+ public static final Image CHART_BG_SELECT = getPngImage("timeline_right_bg_selected"); //$NON-NLS-1$
+ public static final Image CHART_NAME_BG_NORMAL = getPngImage("timeline_left_bg_normal"); //$NON-NLS-1$
+ public static final Image CHART_NAME_BG_SELECT = getPngImage("timeline_left_bg_selected"); //$NON-NLS-1$
+ public static final Image CHART_NAME_CHILD_BG_NORMAL = getPngImage("timeline_left_child_bg_normal"); //$NON-NLS-1$
+ public static final Image CHART_NAME_CHILD_BG_SELECT = getPngImage("timeline_left_child_bg_selected"); //$NON-NLS-1$
+ public static final Image CHART_ALL_SIZE_MIN_NORMAL = getPngImage("time_line_size_min_normal"); //$NON-NLS-1$
+ public static final Image CHART_ALL_SIZE_MIN_PUSH = getPngImage("time_line_size_min_push"); //$NON-NLS-1$
+ public static final Image CHART_ALL_SIZE_MIN_HOVER = getPngImage("time_line_size_min_hover"); //$NON-NLS-1$
+ public static final Image CHART_ALL_SIZE_RESTORE_NORMAL = getPngImage("time_line_size_restore_normal"); //$NON-NLS-1$
+ public static final Image CHART_ALL_SIZE_RESTORE_PUSH = getPngImage("time_line_size_restore_push"); //$NON-NLS-1$
+ public static final Image CHART_ALL_SIZE_RESTORE_HOVER = getPngImage("time_line_size_restore_hover"); //$NON-NLS-1$
+ public static final Image CHART_FULL_NORMAL = getPngImage("timeline_left_full_nor"); //$NON-NLS-1$
+ public static final Image CHART_FULL_PUSH = getPngImage("timeline_left_full_push"); //$NON-NLS-1$
+ public static final Image CHART_FULL_HOVER = getPngImage("timeline_left_full_hover"); //$NON-NLS-1$
+ public static final Image CHART_RESTORE_NORMAL = getPngImage("timeline_left_restore_nor"); //$NON-NLS-1$
+ public static final Image CHART_RESTORE_PUSH = getPngImage("timeline_left_restore_push"); //$NON-NLS-1$
+ public static final Image CHART_RESTORE_HOVER = getPngImage("timeline_left_restore_hover"); //$NON-NLS-1$
+
+ /* range */
+ public static final Image RANGE_MARKER_START = getPngImage("range_marker_start");//$NON-NLS-1$
+ public static final Image RANGE_MARKER_END = getPngImage("range_marker_end");//$NON-NLS-1$
+ public static final Image RANGE_MARKER_START_PUSH = getPngImage("range_marker_start_push");//$NON-NLS-1$
+ public static final Image RANGE_MARKER_END_PUSH = getPngImage("range_marker_end_push");//$NON-NLS-1$
+ public static final Image RANGE_MARKER_START_HOVER = getPngImage("range_marker_start_hover");//$NON-NLS-1$
+ public static final Image RANGE_MARKER_END_HOVER = getPngImage("range_marker_end_hover");//$NON-NLS-1$
+
+ /*** scale ***/
+ public static final Image SCALE_CONTROL_MINUS = getPngImage("scale_control_minus"); //$NON-NLS-1$
+ public static final Image SCALE_CONTROL_PLUS = getPngImage("scale_control_plus"); //$NON-NLS-1$
+ public static final Image SCALE_CONTROL_THUMB = getPngImage("scale_control_thumb"); //$NON-NLS-1$
+
+ /*** tree fold ***/
+ public static final Image TREE_FOLD = getPngImage("tree_fold"); //$NON-NLS-1$
+ public static final Image TREE_OPEN = getPngImage("tree_open"); //$NON-NLS-1$
+
+ // check box
+ public static final Image CHECKBOX_SELECTED = getPngImage("checkbox_selected"); //$NON-NLS-1$
+ public static final Image CHECKBOX_UNSELECTED = getPngImage("checkbox_unselected"); //$NON-NLS-1$
+ public static final Image CHECKBOX_UNSELECTED_HOVER = getPngImage("checkbox_unselected_hover"); //$NON-NLS-1$
+ public static final Image CHECKBOX_UNSELECTED_DISABLE = getPngImage("checkbox_unselected_disable"); //$NON-NLS-1$
+ public static final Image CHECKBOX_SELECTED_DISABLE = getPngImage("checkbox_selected_disable"); //$NON-NLS-1$
+
+ // radio button
+ public static final Image RADIO_SELECTED = getPngImage("radio_selected"); //$NON-NLS-1$
+ public static final Image RADIO_UNSELECTED = getPngImage("radio_unselected"); //$NON-NLS-1$
+ public static final Image RADIO_UNSELECTED_HOVER = getPngImage("radio_unselected_hover"); //$NON-NLS-1$
+
+ /*** stop progress dialog ***/
+ public static final Image STOP_PROGRESS_LOADING_01 = getPngImage("loading_icon_01"); //$NON-NLS-1$
+ public static final Image STOP_PROGRESS_LOADING_02 = getPngImage("loading_icon_02"); //$NON-NLS-1$
+ public static final Image STOP_PROGRESS_LOADING_03 = getPngImage("loading_icon_03"); //$NON-NLS-1$
+ public static final Image STOP_PROGRESS_LOADING_04 = getPngImage("loading_icon_04"); //$NON-NLS-1$
+ public static final Image STOP_PROGRESS_LOADING_05 = getPngImage("loading_icon_05"); //$NON-NLS-1$
+ public static final Image STOP_PROGRESS_LOADING_06 = getPngImage("loading_icon_06"); //$NON-NLS-1$
+ public static final Image STOP_PROGRESS_LOADING_07 = getPngImage("loading_icon_07"); //$NON-NLS-1$
+ public static final Image STOP_PROGRESS_LOADING_08 = getPngImage("loading_icon_08"); //$NON-NLS-1$
+
+ private static Image getImage(String folderName, String imageName,
+ String extension) {
+ // if (null == imageRegistry.get(imageName)
+ // || imageRegistry.get(imageName).isDisposed()) {
+ //
+ // // next 3line using in plugin
+ // // ImageDescriptor desc =
+ // // AbstractUIPlugin.imageDescriptorFromPlugin(
+ // // Activator.PLUGIN_ID, folderName + imageName + extension);
+ //
+ // /*** enable when test execution! **/
+ // String strUrl = "file:" + folderName + imageName + extension;
+ // URL url = null;
+ // try {
+ // url = new URL(strUrl);
+ // } catch (MalformedURLException e) {
+ // // TODO Auto-generated catch block
+ // e.printStackTrace();
+ // }
+ // ImageDescriptor desc = ImageDescriptor.createFromURL(url);
+ // imageRegistry.put(imageName, desc);
+ // }
+ //
+ // return imageRegistry.get(imageName);
+ if (null == imageRegistry.get(imageName)
+ || imageRegistry.get(imageName).isDisposed()) {
+
+ String path = "/Images/" + imageName + ".png"; //$NON-NLS-1$ //$NON-NLS-2$
+ InputStream stream = ImageResources.class.getResourceAsStream(path);
+ ImageData imageData = new ImageData(stream);
+ ImageDescriptor desc = ImageDescriptor
+ .createFromImageData(imageData);
+ imageRegistry.put(imageName, desc);
+ }
+ return imageRegistry.get(imageName);
+ }
+
+ private static Image getImage(String imageName, String extension) {
+ return getImage("Images" + File.separator, imageName, extension); //$NON-NLS-1$
+ }
+
+ private static Image getPngImage(String imageName) {
+ return getImage(imageName, ".png"); //$NON-NLS-1$
+ }
+
+ @SuppressWarnings("unused")
+ private static Image getWidgetImage(String imageName) {
+ if (null == imageRegistry.get(imageName)
+ || imageRegistry.get(imageName).isDisposed()) {
+
+ String path = "/Images/" + imageName + ".png"; //$NON-NLS-1$ //$NON-NLS-2$
+ InputStream stream = ImageResources.class.getResourceAsStream(path);
+ ImageData imageData = new ImageData(stream);
+ ImageDescriptor desc = ImageDescriptor
+ .createFromImageData(imageData);
+ imageRegistry.put(imageName, desc);
+ }
+ return imageRegistry.get(imageName);
+ }
+}
--- /dev/null
+package org.tizen.dynamicanalyzer.widgets.helper;
+
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Shell;
+
+public class WidgetUtils {
+ // use : no title bar window
+ public static void setCenter(Shell shell) {
+ Shell parent = shell.getParent().getShell();
+
+ Rectangle pRect = parent.getBounds();
+ Rectangle pChild = shell.getBounds();
+
+ int deltaX = pRect.width - pChild.width;
+ int deltaY = pRect.height - pChild.height;
+
+ int childX = pRect.x + deltaX / 2;
+ int childY = pRect.y + deltaY / 2;
+
+ shell.setLocation(childX, childY);
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.lifecycle;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.widgets.timeline.DACustomTimeline;
+import org.tizen.dynamicanalyzer.widgets.timeline.DACustomTimelineRenderer;
+
+public class LifecycleBar extends Canvas {
+ public static final int HEIGHT = 4;
+ private double visibleStartTime = 0;
+ private double totalEndTime = 0;
+ private int scale = DACustomTimeline.SCALE_100;
+ private List<LifecycleData> lifecycleDataList = new ArrayList<LifecycleData>();
+
+ private PaintListener paintListener = new PaintListener() {
+ @Override
+ public void paintControl(PaintEvent e) {
+ for (LifecycleData lifecycleData : lifecycleDataList) {
+ double startTime = lifecycleData.getStartTime();
+ int startPx = (int) secondToPixcel(startTime);
+ double endTime = lifecycleData.getEndTime();
+
+ if (startPx < getClientArea().width) {
+ if (endTime == -1) {
+ endTime = totalEndTime;
+ }
+
+ if (endTime > visibleStartTime) {
+ GC gc = e.gc;
+ int endPx = (int) secondToPixcel(endTime);
+
+ gc.setForeground(lifecycleData.getColorTop());
+ gc.setBackground(lifecycleData.getColorBottom());
+ gc.fillGradientRectangle(startPx + 1, 0, endPx
+ - startPx + 1, HEIGHT, true);
+ }
+ } else {
+ break;
+ }
+ }
+ }
+ };
+
+ public LifecycleBar(Composite parent) {
+ super(parent, SWT.NONE);
+ addPaintListener(paintListener);
+ }
+
+ public void setVisibleStartTime(double visibleStartTime) {
+ this.visibleStartTime = visibleStartTime;
+ }
+
+ public void setTotalEndTime(double totalEndTime) {
+ this.totalEndTime = totalEndTime;
+ redraw();
+ }
+
+ public void setScale(int scale) {
+ this.scale = scale;
+ }
+
+ public void addLifecycleData(LifecycleData lifecycleData) {
+ int size = lifecycleDataList.size();
+ if (size != 0) {
+ LifecycleData lastData = lifecycleDataList.get(size - 1);
+ lastData.setEndTime(lifecycleData.getStartTime());
+ }
+
+ lifecycleDataList.add(lifecycleData);
+ }
+
+ public String getTooltipMessage(int x) {
+ double time = pixcelToSecond(x);
+ int size = lifecycleDataList.size();
+ if (size == 0
+ || (lifecycleDataList.get(0).getStartTime() > time && lifecycleDataList
+ .get(size - 1).getEndTime() < time)) {
+ return null;
+ }
+
+ for (LifecycleData data : lifecycleDataList) {
+ double endTime = data.getEndTime();
+ if (endTime == -1) {
+ endTime = totalEndTime;
+ }
+
+ if (time >= data.getStartTime() && time <= endTime) {
+ return data.getText();
+ }
+ }
+
+ return null;
+ }
+
+ public void clear() {
+ visibleStartTime = 0;
+ totalEndTime = 0;
+ lifecycleDataList.clear();
+ redraw();
+ }
+
+ private double secondToPixcel(double second) {
+ return (second - visibleStartTime) * scale
+ * DACustomTimelineRenderer.DEFAULT_INTERVAL;
+ }
+
+ private double pixcelToSecond(int pixcel) {
+ return (double) pixcel / scale
+ / DACustomTimelineRenderer.DEFAULT_INTERVAL + visibleStartTime;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.lifecycle;
+
+import org.eclipse.swt.graphics.Color;
+
+public class LifecycleData {
+ private double startTime;
+ private double endTime = -1;
+ private Color colorTop;
+ private Color colorBottom;
+ private String text;
+
+ public LifecycleData(double startTime, Color colorTop, Color colorBottom,
+ String text) {
+ this.startTime = startTime;
+ this.colorTop = colorTop;
+ this.colorBottom = colorBottom;
+ this.text = text;
+ }
+
+ public double getStartTime() {
+ return startTime;
+ }
+
+ public double getEndTime() {
+ return endTime;
+ }
+
+ public void setEndTime(double endTime) {
+ this.endTime = endTime;
+ }
+
+ public Color getColorTop() {
+ return colorTop;
+ }
+
+ public Color getColorBottom() {
+ return colorBottom;
+ }
+
+ public String getText() {
+ return text;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.widgets.progress;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.widgets.DAWidgetConstants;
+import org.tizen.dynamicanalyzer.widgets.animation.DAAnimationIcon;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+import org.tizen.dynamicanalyzer.widgets.helper.FontResources;
+import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
+
+public class Progress extends Canvas {
+
+ public static final int PROGRESS_STYLE_BAR_ALONE = 0;
+ public static final int PROGRESS_STYLE_ALL = 1;
+
+ private List<Image> loadingImage = new ArrayList<Image>();
+ private DAAnimationIcon icon = null;
+ private String upperText = DAWidgetConstants.EMPTY_STRING;
+ private String bottomText = DAWidgetConstants.EMPTY_STRING;
+ private int maxSize = 100;
+ private int value = 0;
+
+ private Color barStartColor = ColorResources.STOP_PROGRESS_BAR_START_COLOR;
+ private Color barEndColor = ColorResources.STOP_PROGRESS_BAR_END_COLOR;
+ private Color barStartBgColor = ColorResources.STOP_PROGRESS_BAR_BG_START_COLOR;
+ private Color barEndBgColor = ColorResources.STOP_PROGRESS_BAR_BG_END_COLOR;
+
+ private Color barOutlineColor = ColorResources.STOP_PROGRESS_BAR_OUTLINE_COLOR;
+
+ private Color dialogOutlineColor1 = ColorResources.STOP_PROGRESS_LINE1_COLOR;
+ private Color dialogOutlineColor2 = ColorResources.STOP_PROGRESS_LINE2_COLOR;
+
+ private Color barBgColor = ColorResources.STOP_PROGRESS_BACKGROUND_COLOR;
+
+ private Color progressUpperFontColor = ColorResources.BLACK;
+ private Color progressLowerFontColor = ColorResources.STOP_PROGRESS_INFO_FONT_COLOR;
+
+ private Font progressLowerFont = FontResources.STOP_PROGRESS_FONT;
+ private Font progressUpperFont = FontResources.PROGRESS_FONT;
+
+ private int style = PROGRESS_STYLE_ALL;
+
+ public Progress(Composite parent, int style) {
+ super(parent, style);
+ this.addPaintListener(progressPaintListener);
+ this.setLayout(new FormLayout());
+ loadingImage.add(ImageResources.STOP_PROGRESS_LOADING_01);
+ loadingImage.add(ImageResources.STOP_PROGRESS_LOADING_02);
+ loadingImage.add(ImageResources.STOP_PROGRESS_LOADING_03);
+ loadingImage.add(ImageResources.STOP_PROGRESS_LOADING_04);
+ loadingImage.add(ImageResources.STOP_PROGRESS_LOADING_05);
+ loadingImage.add(ImageResources.STOP_PROGRESS_LOADING_06);
+ loadingImage.add(ImageResources.STOP_PROGRESS_LOADING_07);
+ loadingImage.add(ImageResources.STOP_PROGRESS_LOADING_08);
+
+ icon = new DAAnimationIcon(this, SWT.NONE, loadingImage);
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 11);
+ data.left = new FormAttachment(0, 12);
+ data.width = 24;
+ data.height = 24;
+ icon.setLayoutData(data);
+ icon.start();
+ }
+
+ public Progress(Composite parent, int style, int progressStyle) {
+ this(parent, style);
+ style = progressStyle;
+ }
+
+ public int getValue() {
+ return value;
+ }
+
+ public void setValue(int value) {
+ this.value = value;
+ this.redraw();
+ this.update();
+ }
+
+ public void close() {
+ icon.stopTimer();
+ }
+
+ public void setBarStartColor(Color color) {
+ barStartColor = color;
+ }
+
+ public void setBarEndColor(Color color) {
+ barEndColor = color;
+ }
+
+ public void setBarStartBackgroundColor(Color color) {
+ barStartBgColor = color;
+ }
+
+ public void setBarEndBackgroundColor(Color color) {
+ barEndBgColor = color;
+ }
+
+ public void setBarBackgroundColor(Color color) {
+ barBgColor = color;
+ }
+
+ public Color getDialogOutlineColor1() {
+ return dialogOutlineColor1;
+ }
+
+ public void setDialogOutlineColor1(Color color) {
+ this.dialogOutlineColor1 = color;
+ }
+
+ public Color getDialogOutlineColor2() {
+ return dialogOutlineColor2;
+ }
+
+ public void setDialogOutlineColor2(Color color) {
+ this.dialogOutlineColor2 = color;
+ }
+
+ public void setBarOutlineColor(Color color) {
+ barOutlineColor = color;
+ }
+
+ public void setLoadingImage(List<Image> loadingImage) {
+ if (null != loadingImage && !this.loadingImage.isEmpty()) {
+ this.loadingImage.clear();
+ this.loadingImage = null;
+ this.loadingImage = loadingImage;
+ }
+ }
+
+ public void setProgressUpperFontColor(Color color) {
+ progressUpperFontColor = color;
+ }
+
+ public void setProgressLowerFontColor(Color color) {
+ progressLowerFontColor = color;
+ }
+
+ public void setProgressLowerFont(Font font) {
+ progressLowerFont = font;
+ }
+
+ public void setProgressUpperFont(Font font) {
+ progressUpperFont = font;
+ }
+
+ public String getUpperText() {
+ return upperText;
+ }
+
+ public void setUpperText(String upperText) {
+ this.upperText = upperText;
+ this.redraw();
+ this.update();
+ }
+
+ public String getBottomText() {
+ return bottomText;
+ }
+
+ public void setBottomText(String bottomText) {
+ this.bottomText = bottomText;
+ this.redraw();
+ this.update();
+ }
+
+ public int getMaxSize() {
+ return maxSize;
+ }
+
+ public void setMaxSize(int maxSize) {
+ this.maxSize = maxSize;
+ }
+
+ public void errorOccured(String Message, String bottomErrorMessage) {
+ barStartColor = ColorResources.RED;
+ barEndColor = ColorResources.WHITE;
+ setBottomText(bottomErrorMessage);
+ setUpperText(Message);
+ }
+
+ private PaintListener progressPaintListener = new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ Canvas canvas = (Canvas) e.widget;
+ canvas.setBackground(barBgColor);
+ Rectangle rect = canvas.getBounds();
+
+ if (style == PROGRESS_STYLE_ALL) {
+ // draw outline
+ e.gc.setForeground(dialogOutlineColor2);
+ e.gc.drawRectangle(rect);
+ e.gc.setForeground(dialogOutlineColor1);
+ e.gc.drawRectangle(rect.x + 1, rect.y + 1, rect.width - 2,
+ rect.height - 2);
+
+ // draw upper text
+ Font prevFont = e.gc.getFont();
+ if (null != progressUpperFont) {
+ e.gc.setFont(progressUpperFont);
+ }
+ if (null != progressUpperFontColor) {
+ e.gc.setForeground(progressUpperFontColor);
+ }
+ e.gc.drawText(upperText, 41, 18);
+ e.gc.setFont(prevFont);
+
+ // draw bottom text
+ prevFont = e.gc.getFont();
+ if (null != progressLowerFont) {
+ e.gc.setFont(progressLowerFont);
+ }
+ if (null != progressLowerFontColor) {
+ e.gc.setForeground(progressLowerFontColor);
+ }
+ e.gc.drawText(bottomText, 12, 76);
+ e.gc.setFont(prevFont);
+
+ // draw progress bar
+ Rectangle barRect = new Rectangle(12, 45, rect.width - 24, 22);
+ e.gc.setForeground(barStartBgColor);
+ e.gc.setBackground(barEndBgColor);
+ e.gc.fillGradientRectangle(barRect.x, barRect.y, barRect.width,
+ barRect.height, true);
+
+ int width = (value * barRect.width) / 100;
+ e.gc.setForeground(barStartColor);
+ e.gc.setBackground(barEndColor);
+ e.gc.fillGradientRectangle(barRect.x, barRect.y, width,
+ barRect.height, true);
+
+ e.gc.setForeground(barOutlineColor);
+ e.gc.drawRectangle(barRect);
+ } else if (style == PROGRESS_STYLE_BAR_ALONE) {
+ // draw progress bar
+ e.gc.setForeground(barStartBgColor);
+ e.gc.setBackground(barEndBgColor);
+ e.gc.fillGradientRectangle(rect.x, rect.y, rect.width,
+ rect.height, true);
+
+ int width = (value * rect.width) / 100;
+ e.gc.setForeground(barStartColor);
+ e.gc.setBackground(barEndColor);
+ e.gc.fillGradientRectangle(rect.x, rect.y, width, rect.height,
+ true);
+
+ e.gc.setForeground(barOutlineColor);
+ e.gc.drawRectangle(rect);
+ } else {
+ System.out.println("invalid progress style..."); //$NON-NLS-1$
+ }
+ }
+ };
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.scale;
+
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+
+public class DACustomScaleRenderer extends DAScaleDefaultRenderer {
+
+ @Override
+ public void draw(GC gc, Canvas canvas, DAScaleAttribute attr) {
+ Rectangle rect = canvas.getClientArea();
+ gc.setBackground(ColorResources.PURPLE);
+ gc.fillRectangle(rect);
+
+ if (null != attr.getLeftImage() && null != attr.getRightImage()) {
+ gc.drawImage(attr.getLeftImage(), attr.getLeftRect().x,
+ attr.getLeftRect().y);
+ gc.drawImage(attr.getRightImage(), attr.getRightRect().x,
+ attr.getRightRect().y);
+ } else {
+ gc.setBackground(ColorResources.BLUE);
+ gc.fillRectangle(attr.getLeftRect());
+ gc.fillRectangle(attr.getRightRect());
+ }
+
+ gc.setBackground(ColorResources.BLACK);
+ gc.fillRectangle(attr.getAreaRect());
+
+ if (null != attr.getThumbImage()) {
+ gc.drawImage(attr.getThumbImage(), attr.getThumbRect().x,
+ attr.getThumbRect().y);
+ } else {
+ gc.setBackground(ColorResources.RED);
+ gc.fillOval(attr.getThumbRect().x, attr.getThumbRect().y,
+ attr.getThumbRect().width, attr.getThumbRect().height);
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.scale;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+
+public class DAScale extends Canvas {
+
+ private static final int LEFT_AREA_WIDTH = 20;
+ private static final int RIGHT_AREA_WIDTH = 20;
+ private static final int LEFT_MARGIN = 3;
+ private static final int RIGHT_MARGIN = 3;
+ // private static final int TOP_MARGIN = 10;
+ // private static final int BOTTOM_MARGIN = 10;
+ private static final int DEFAULT_AREA_HEIGHT = 6;
+ private static final int THUMB_AREA_START = LEFT_AREA_WIDTH + LEFT_MARGIN;
+
+ private static final int THUMB_HEIGHT = 14;
+ private static final int THUMB_WIDTH = 14;
+
+ private DAScaleAttribute attr;
+ private DAScaleDefaultRenderer renderer;
+ private DAScaleSelectionListener selectionListener = null;
+
+ private List<Integer> selectPositions = null;
+ private int selection = 0;
+
+ private int increment;
+ private int pageIncrement;
+ private int maxValue;
+ private int minValue;
+
+ private int areaWidth = 0;
+ private int areaHeight = 0;
+
+ private boolean mouseDown = false;
+
+ private Rectangle thumbRect = null;
+ private Rectangle areaRect= null;
+ private Rectangle leftRect= null;
+ private Rectangle rightRect= null;
+
+ public DAScale(Composite parent, int style) {
+ super(parent, style);
+ increment = 1;
+ pageIncrement = 1;
+ maxValue = 2;
+ minValue = 0;
+ attr = new DAScaleAttribute();
+ renderer = new DACustomScaleRenderer();
+ selectPositions = new ArrayList<Integer>();
+
+ addListener(SWT.MouseDown, mouseListener);
+ addListener(SWT.MouseUp, mouseListener);
+ addListener(SWT.MouseMove, mouseListener);
+
+ addPaintListener(paintListener);
+ addControlListener(controlListener);
+ }
+
+ public void setIncrement(int increment) {
+ this.increment = increment;
+ }
+
+ public int getIncrement() {
+ return increment;
+ }
+
+ public void setPageIncrement(int increment) {
+ this.pageIncrement = increment;
+ }
+
+ public int getPageIncrement() {
+ return pageIncrement;
+ }
+
+ public void setMaximum(int max) {
+ maxValue = max;
+ }
+
+ public int getMaximum() {
+ return maxValue;
+ }
+
+ public void setMinimum(int min) {
+ minValue = min;
+ }
+
+ public int getMinimum() {
+ return minValue;
+ }
+
+ public int getSelection() {
+ int tick = getTickTize();
+
+ int thumbX = thumbRect.x + THUMB_WIDTH / 2;
+ int width = thumbX - areaRect.x;
+
+ if (width == 0) {
+ return minValue;
+ } else if (areaRect.width == width) {
+ return maxValue;
+ }
+
+ else {
+ int quotient = width / tick;
+ int reminder = width % tick;
+ int result = 0;
+
+ if (reminder == 0) {
+ result = quotient + minValue;
+ } else {
+ result = quotient + minValue + 1;
+ }
+ return result;
+ }
+ }
+
+ public void setLeftImage(Image left) {
+ attr.setLeftImage(left);
+ }
+
+ public void setRightImage(Image right) {
+ attr.setRightImage(right);
+ }
+
+ public void setThumbImage(Image thumb) {
+ attr.setThumbImage(thumb);
+ }
+
+ public void setSelection(int selection) {
+ if (selection > maxValue) {
+ selection = maxValue;
+ } else if (selection < minValue) {
+ selection = minValue;
+ }
+ this.selection = selection - minValue;
+ int thumbPos = selectPositions.get(this.selection);
+ thumbRect = getThumbRect(thumbPos);
+ redraw();
+ }
+
+ public void addSelectionListener(DAScaleSelectionListener listener) {
+ if (null == listener) {
+ return;
+ }
+ selectionListener = listener;
+ }
+
+ public void setRenderer(DAScaleDefaultRenderer renderer) {
+ this.renderer = renderer;
+ }
+
+ private boolean pointInRect(Rectangle rect, Point p) {
+ if ((p.x > rect.x) && (p.x > rect.y) && (p.x < rect.x + rect.width)
+ && (p.y < rect.y + rect.height)) {
+ return true;
+ }
+ return false;
+ }
+
+ private Rectangle getThumbRect(int pointX) {
+
+ int thumbHeight = THUMB_HEIGHT;
+ int thumbWidth = THUMB_WIDTH;
+
+ if (null != attr.getThumbImage()) {
+ Rectangle thumbImageRect = attr.getThumbImage().getBounds();
+ thumbHeight = thumbImageRect.height;
+ thumbWidth = thumbImageRect.width;
+ }
+
+ if (pointX < areaRect.x) {
+ pointX = areaRect.x;
+ } else if (pointX > areaRect.x + areaRect.width) {
+ pointX = areaRect.x + areaRect.width;
+ }
+ int y = areaRect.y - (thumbHeight - areaRect.height) / 2;
+ int x = pointX - thumbWidth / 2;
+ return new Rectangle(x, y, thumbWidth, thumbHeight);
+ }
+
+ private void setSelectionInternal(int pointX) {
+ if (pointX <= areaRect.x) {
+ selection = 0;
+ } else if (pointX >= areaRect.x + areaRect.width) {
+ selection = maxValue - minValue;
+ } else {
+ int tick = getTickTize();
+
+ int width = pointX - areaRect.x;
+
+ int quotient = width / tick;
+ int reminder = width % tick;
+
+ if (reminder == 0) {
+ selection = quotient;
+ } else {
+ selection = quotient + 1;
+ }
+ }
+ }
+
+ private int getScaleSize() {
+ return maxValue - minValue - 1;
+ }
+
+ private int getTickTize() {
+ return areaRect.width / getScaleSize();
+ }
+
+ private void increaseSelection() {
+ if (selection < maxValue - minValue) {
+ selection += 1;
+ }
+ }
+
+ private void decreaseSelection() {
+ if (selection > 0) {
+ selection -= 1;
+ }
+ }
+
+ /*** listeners ***/
+ private Listener mouseListener = new Listener() {
+
+ @Override
+ public void handleEvent(Event event) {
+ if (event.type == SWT.MouseDown) {
+ if (pointInRect(thumbRect, new Point(event.x, event.y))) {
+ mouseDown = true;
+ } else if ((event.x >= areaRect.x)
+ && (event.x <= areaRect.x + areaRect.width)) {
+ int thumbX = thumbRect.x + THUMB_WIDTH / 2;
+ if (event.x < thumbX) {
+ decreaseSelection();
+ } else {
+ increaseSelection();
+ }
+ int delta = selectPositions.get(selection);
+ thumbRect = getThumbRect(delta);
+ redraw();
+ }
+ }
+
+ if (event.type == SWT.MouseUp) {
+ mouseDown = false;
+
+ if (pointInRect(leftRect, new Point(event.x, event.y))) {
+ decreaseSelection();
+ int delta = selectPositions.get(selection);
+ thumbRect = getThumbRect(delta);
+ redraw();
+ }
+
+ if (pointInRect(rightRect, new Point(event.x, event.y))) {
+ increaseSelection();
+ int delta = selectPositions.get(selection);
+ thumbRect = getThumbRect(delta);
+ redraw();
+ }
+ }
+
+ if (event.type == SWT.MouseMove) {
+ if (mouseDown) {
+ setSelectionInternal(event.x);
+ thumbRect = getThumbRect(event.x);
+// mouseX = event.x;
+ redraw();
+ }
+ }
+ if (null != selectionListener) {
+ selectionListener.widgetSelected();
+ }
+ }
+ };
+
+ private PaintListener paintListener = new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ attr.setAreaRect(areaRect);
+ attr.setLeftRect(leftRect);
+ attr.setRightRect(rightRect);
+ attr.setThumbRect(thumbRect);
+ renderer.draw(e.gc, (Canvas) e.widget, attr);
+ }
+ };
+
+ private ControlListener controlListener = new ControlListener() {
+
+ @Override
+ public void controlResized(ControlEvent e) {
+ Canvas canvas = (Canvas) e.widget;
+ Rectangle rect = canvas.getClientArea();
+
+ if ((null != attr.getLeftImage())
+ && ((null != attr.getRightImage()))) {
+ leftRect = attr.getLeftImage().getBounds();
+ if (leftRect.height < rect.height) {
+ leftRect.y += (rect.height - leftRect.height) / 2;
+ }
+
+ if (leftRect.width < LEFT_AREA_WIDTH) {
+ leftRect.x += (LEFT_AREA_WIDTH - leftRect.width) / 2;
+ }
+ rightRect = attr.getRightImage().getBounds();
+
+ if (rightRect.height < rect.height) {
+ rightRect.y += (rect.height - rightRect.height) / 2;
+ }
+
+ if (rightRect.width < RIGHT_AREA_WIDTH) {
+ rightRect.x += (RIGHT_AREA_WIDTH - rightRect.width) / 2;
+ }
+
+ rightRect = new Rectangle(
+ rect.x + rect.width - rightRect.width, rightRect.y,
+ rightRect.width, rightRect.height);
+ } else {
+ leftRect = new Rectangle(rect.x, rect.y, LEFT_AREA_WIDTH,
+ rect.height);
+ rightRect = new Rectangle(rect.x + rect.width
+ - RIGHT_AREA_WIDTH, rect.y, RIGHT_AREA_WIDTH,
+ rect.height);
+ }
+ areaWidth = rect.width
+ - (leftRect.width + LEFT_MARGIN + rightRect.width + RIGHT_MARGIN);
+ areaHeight = DEFAULT_AREA_HEIGHT;
+ int areaY = rect.y + (rect.height - areaHeight) / 2;
+ areaRect = new Rectangle(rect.x + THUMB_AREA_START, areaY,
+ areaWidth, areaHeight);
+
+ if (thumbRect == null) {
+ thumbRect = getThumbRect(areaRect.x);
+ }
+
+ initSelectPosition();
+ }
+
+ @Override
+ public void controlMoved(ControlEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+ };
+
+ private void initSelectPosition() {
+ selectPositions.clear();
+ int size = maxValue - minValue + 1;
+ int tickSize = getTickTize();
+
+ for (int i = 0; i < size; i++) {
+ if (i == 0) {
+ selectPositions.add(areaRect.x);
+ } else if (i == (size - 1)) {
+ selectPositions.add(areaRect.x + areaRect.width);
+ } else {
+ int pos = tickSize * (i - 1) + tickSize / 2 + areaRect.x;
+ selectPositions.add(pos);
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.scale;
+
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+
+public class DAScaleAttribute {
+ private Image leftImage = null;
+ private Image rightImage = null;
+ private Image thumbImage = null;
+
+ private Rectangle thumbRect = null;
+ private Rectangle areaRect = null;
+ private Rectangle leftRect = null;
+ private Rectangle rightRect = null;
+
+ public Rectangle getThumbRect() {
+ return thumbRect;
+ }
+
+ public void setThumbRect(Rectangle thumbRect) {
+ this.thumbRect = thumbRect;
+ }
+
+ public Rectangle getAreaRect() {
+ return areaRect;
+ }
+
+ public void setAreaRect(Rectangle areaRect) {
+ this.areaRect = areaRect;
+ }
+
+ public Rectangle getLeftRect() {
+ return leftRect;
+ }
+
+ public void setLeftRect(Rectangle leftRect) {
+ this.leftRect = leftRect;
+ }
+
+ public Rectangle getRightRect() {
+ return rightRect;
+ }
+
+ public void setRightRect(Rectangle rightRect) {
+ this.rightRect = rightRect;
+ }
+
+ public Image getLeftImage() {
+ return leftImage;
+ }
+
+ public void setLeftImage(Image leftImage) {
+ this.leftImage = leftImage;
+ }
+
+ public Image getRightImage() {
+ return rightImage;
+ }
+
+ public void setRightImage(Image rightImage) {
+ this.rightImage = rightImage;
+ }
+
+ public Image getThumbImage() {
+ return thumbImage;
+ }
+
+ public void setThumbImage(Image thumbImage) {
+ this.thumbImage = thumbImage;
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.scale;
+
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.widgets.Canvas;
+
+public abstract class DAScaleDefaultRenderer {
+ public abstract void draw(GC gc, Canvas canvas, DAScaleAttribute attr);
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.scale;
+
+public abstract class DAScaleSelectionListener {
+ public abstract void widgetSelected();
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.widgets.test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
+import org.tizen.dynamicanalyzer.widgets.button.toggle.DACustomToggleButton;
+import org.tizen.dynamicanalyzer.widgets.combo.DACustomCombo;
+import org.tizen.dynamicanalyzer.widgets.combo.DACustomComboSelectionListener;
+import org.tizen.dynamicanalyzer.widgets.graph.bar.FourBarGraph;
+import org.tizen.dynamicanalyzer.widgets.graph.bar.SingleBar;
+import org.tizen.dynamicanalyzer.widgets.graph.circular.CircularGraph;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
+import org.tizen.dynamicanalyzer.widgets.scale.DAScale;
+import org.tizen.dynamicanalyzer.widgets.scale.DAScaleSelectionListener;
+import org.tizen.dynamicanalyzer.widgets.timer.TimerClock;
+
+public class TestClass {
+ public static void main(String[] args) {
+ Display display = new Display();
+ Shell shell = new Shell(display);
+
+ shell.setSize(new Point(1000, 1000));
+
+ shell.setLayout(new FormLayout());
+ shell.open();
+ DACustomButton button = new DACustomButton(shell, SWT.NONE);
+ button.setText("test");
+ FormData data = new FormData();
+ data.top = new FormAttachment(5, 0);
+ data.left = new FormAttachment(10, 0);
+ data.width = 200;
+ data.height = 50;
+ button.setLayoutData(data);
+
+ button.addClickListener(new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ System.out.println("button test");
+ }
+ });
+
+ DACustomButton imgButton = new DACustomButton(shell,
+ ImageResources.ABOUT, ImageResources.ABOUT_PUSH,
+ ImageResources.ABOUT_HOVER, ImageResources.ABOUT_DISABLE);
+ imgButton.setText("test2");
+ data = new FormData();
+ data.top = new FormAttachment(button, 10);
+ data.left = new FormAttachment(10, 0);
+ data.width = 200;
+ data.height = 50;
+ imgButton.setLayoutData(data);
+
+ DACustomToggleButton toggle = new DACustomToggleButton(shell, SWT.NONE);
+ toggle.setText("toggle");
+ data = new FormData();
+ data.top = new FormAttachment(imgButton, 10);
+ data.left = new FormAttachment(10, 0);
+ data.width = 200;
+ data.height = 50;
+ toggle.setLayoutData(data);
+
+ DACustomToggleButton imgToggle = new DACustomToggleButton(shell,
+ ImageResources.VIEW_SOURCE, ImageResources.VIEW_SOURCE_PUSH,
+ ImageResources.VIEW_SOURCE_HOVER,
+ ImageResources.VIEW_SOURCE_DISABLE,
+ ImageResources.VIEW_SOURCE_TOGGLE,
+ ImageResources.VIEW_SOURCE_HOVER);
+ imgToggle.setText("toggle");
+ data = new FormData();
+ data.top = new FormAttachment(toggle, 10);
+ data.left = new FormAttachment(10, 0);
+ data.width = 200;
+ data.height = 50;
+ imgToggle.setLayoutData(data);
+
+ DACustomCombo combo = new DACustomCombo(shell, SWT.NONE);
+ for (int i = 0; i < 29; i++) {
+ combo.add("test " + i);
+ }
+ data = new FormData();
+ data.top = new FormAttachment(imgToggle, 10);
+ data.left = new FormAttachment(10, 0);
+ data.width = 200;
+ data.height = 50;
+ combo.setLayoutData(data);
+
+ CircularGraph circle = new CircularGraph(shell, SWT.NONE,
+ CircularGraph.TYPE_PERCENT);
+ data = new FormData();
+ data.top = new FormAttachment(combo, 10);
+ data.left = new FormAttachment(10, 0);
+ data.width = 200;
+ data.height = 100;
+ circle.setLayoutData(data);
+ circle.setMax(100);
+ circle.update(50);
+ circle.setTextColor(ColorResources.BLACK);
+ circle.setText("circlular graph test");
+
+ SingleBar bar = new SingleBar(shell, SWT.NONE);
+ data = new FormData();
+ data.top = new FormAttachment(circle, 10);
+ data.left = new FormAttachment(10, 0);
+ data.width = 20;
+ data.height = 80;
+ bar.setLayoutData(data);
+
+ bar.setMaxSize(100);
+ bar.setCurrentSize(45);
+
+ FourBarGraph fbar = new FourBarGraph(shell, SWT.NONE,
+ FourBarGraph.TYPE_PERCENT);
+ data = new FormData();
+ data.top = new FormAttachment(bar, 10);
+ data.left = new FormAttachment(10, 0);
+ data.width = 100;
+ data.height = 100;
+ fbar.setLayoutData(data);
+
+ fbar.setMaxSize(100);
+ fbar.setText("CALL");
+ List<Long> testdata = new ArrayList<Long>();
+ testdata.add((long) 55);
+ testdata.add((long) 72);
+ testdata.add((long) 41);
+ testdata.add((long) 87);
+ fbar.setCurrentValue(testdata);
+ fbar.setTextColor(ColorResources.RED);
+ fbar.setBgColor(ColorResources.WHITE);
+
+ TimerClock clock = new TimerClock(shell, SWT.NONE);
+ data = new FormData();
+ data.top = new FormAttachment(fbar, 10);
+ data.left = new FormAttachment(10, 0);
+ data.width = 140;
+ data.height = 25;
+ clock.setLayoutData(data);
+
+ clock.start();
+
+ DAScale scale = new DAScale(shell, SWT.NONE);
+ data = new FormData();
+ data.top = new FormAttachment(clock, 10);
+ data.left = new FormAttachment(10, 0);
+ data.width = 140;
+ data.height = 20;
+ scale.setLayoutData(data);
+ scale.setMaximum(10);
+ scale.setMinimum(5);
+ scale.addSelectionListener(new DAScaleSelectionListener() {
+
+ @Override
+ public void widgetSelected() {
+ System.out.println("test selection listener");
+
+ }
+ });
+
+
+ DACustomComboSelectionListener comboSelectionListener = new DACustomComboSelectionListener() {
+ @Override
+ public void selectionEvent(DACustomCombo combo) {
+ System.out.println("combo selected :" + combo.getText());
+ }
+ };
+
+ combo.addSelectionListener(comboSelectionListener);
+
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ clock.stop();
+ display.dispose();
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.widgets.timeline;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseMoveListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
+
+public class DACustomTimeline extends Canvas {
+ public final static int SCALE_100 = 1;
+ public final static int SCALE_400 = 4;
+ public final static int SCALE_800 = 8;
+ private double startTime = 0;
+ private int scale = SCALE_100;
+
+ List<Double> stickyTimeList = new ArrayList<Double>();
+ private double totalEndTime = 0;
+
+ private boolean drawDetailedTime = false;
+ private double detailedTime;
+ private int detailedTimePosition;
+
+ private DACustomTimelineRenderer timelineRenderer = new DACustomTimelineRenderer();
+ private DACustomTimelineRangeMarker startRangeMarker = new DACustomTimelineRangeMarker(
+ ImageResources.RANGE_MARKER_START,
+ ImageResources.RANGE_MARKER_START_PUSH);
+ private DACustomTimelineRangeMarker endRangeMarker = new DACustomTimelineRangeMarker(
+ ImageResources.RANGE_MARKER_END,
+ ImageResources.RANGE_MARKER_END_PUSH);
+
+ public DACustomTimeline(Composite parent) {
+ super(parent, SWT.NONE);
+ this.addPaintListener(chartPaintListener);
+ this.addMouseListener(new RangeMarkerMouseEventListener());
+ this.addMouseMoveListener(new RangeMarkerMouseMoveEventListener());
+ }
+
+ public double getStartTime() {
+ return startTime;
+ }
+
+ public void setStartTime(double startTime) {
+ this.startTime = startTime;
+ }
+
+ public int getScale() {
+ return scale;
+ }
+
+ public void setScale(int scale) {
+ this.scale = scale;
+ }
+
+ public DACustomTimelineRangeMarker getStartRangeMarker() {
+ return startRangeMarker;
+ }
+
+ public DACustomTimelineRangeMarker getEndRangeMarker() {
+ return endRangeMarker;
+ }
+
+ private PaintListener chartPaintListener = new PaintListener() {
+ @Override
+ public void paintControl(PaintEvent e) {
+ timelineRenderer.draw(e.gc, (DACustomTimeline) e.widget);
+ }
+ };
+
+ public void setDrawDetailedTime(boolean draw) {
+ drawDetailedTime = draw;
+ }
+
+ public boolean getDrawDetailedTime() {
+ return drawDetailedTime;
+ }
+
+ public void setDetailedTime(double detailedTime) {
+ this.detailedTime = detailedTime;
+ }
+
+ public double getDetailedTime() {
+ return detailedTime;
+ }
+
+ public void setDetailedTimePosition(int position) {
+ this.detailedTimePosition = position;
+ }
+
+ public int getDetailedTimePosition() {
+ return detailedTimePosition;
+ }
+
+ private double secondToPixcel(double second) {
+ return (second - startTime) * scale
+ * DACustomTimelineRenderer.DEFAULT_INTERVAL;
+ }
+
+ private double pixcelToSecond(int pixcel) {
+ return (double) pixcel / scale
+ / DACustomTimelineRenderer.DEFAULT_INTERVAL + startTime;
+ }
+
+ public void setTotalEndTime(double time) {
+ totalEndTime = time;
+ }
+
+ public void addStickyTime(double time) {
+ stickyTimeList.add(time);
+ }
+
+ public void clear() {
+ setStartTime(0);
+ stickyTimeList.clear();
+ }
+
+ private class RangeMarkerMouseEventListener extends MouseAdapter {
+ public void mouseDown(MouseEvent e) {
+ double startMarkerPosition = secondToPixcel(startRangeMarker
+ .getTime());
+ double endMarkerPosition = secondToPixcel(endRangeMarker.getTime());
+
+ if (e.x >= endMarkerPosition
+ - endRangeMarker.getImage().getBounds().width
+ && e.x <= endMarkerPosition) {
+ endRangeMarker.setPushStatus(true);
+ DACustomTimeline.this.redraw();
+ } else if (e.x >= startMarkerPosition
+ && e.x <= startMarkerPosition
+ + startRangeMarker.getImage().getBounds().width) {
+ startRangeMarker.setPushStatus(true);
+ DACustomTimeline.this.redraw();
+ }
+ }
+
+ public void mouseUp(MouseEvent e) {
+ if (startRangeMarker.isPushed()) {
+ startRangeMarker.setPushStatus(false);
+ if (startRangeMarker.getTime() > endRangeMarker.getTime()) {
+ endRangeMarker.setTime(-1);
+ }
+ DACustomTimeline.this.redraw();
+ } else if (endRangeMarker.isPushed()) {
+ endRangeMarker.setPushStatus(false);
+ if (endRangeMarker.getTime() < startRangeMarker.getTime()) {
+ startRangeMarker.setTime(-1);
+ }
+ DACustomTimeline.this.redraw();
+ }
+ }
+ }
+
+ private class RangeMarkerMouseMoveEventListener implements
+ MouseMoveListener {
+ public void mouseMove(MouseEvent e) {
+ double stickyTime;
+
+ if (stickyTimeList.size() == 0) {
+ stickyTime = 0;
+ } else if (stickyTimeList.size() == 1) {
+ stickyTime = stickyTimeList.get(0);
+ } else {
+ double eTime = pixcelToSecond(e.x);
+ double minGapTime = stickyTimeList.get(0);
+
+ for (int i = 1; i < stickyTimeList.size(); i++) {
+ if (Math.abs(eTime - minGapTime) > Math.abs(eTime
+ - stickyTimeList.get(i))) {
+ minGapTime = stickyTimeList.get(i);
+ }
+ }
+
+ if (Math.abs(eTime - minGapTime) > Math.abs(eTime
+ - totalEndTime)) {
+ minGapTime = totalEndTime;
+ }
+
+ stickyTime = minGapTime;
+ }
+
+ int timePixcel = (int) secondToPixcel(stickyTime);
+
+ if (e.x - timePixcel < 5 && e.x - timePixcel > -5) {
+ e.x = timePixcel;
+ }
+
+ if (startRangeMarker.isPushed()) {
+ if (e.x < 0) {
+ e.x = 0;
+ } else if (e.x > DACustomTimeline.this.getBounds().width
+ - startRangeMarker.getImage().getBounds().width) {
+ double endTimePx = secondToPixcel(totalEndTime);
+ if (e.x > endTimePx) {
+ e.x = (int) endTimePx;
+ } else {
+ e.x = DACustomTimeline.this.getBounds().width
+ - startRangeMarker.getImage().getBounds().width;
+ }
+ } else {
+ double endTimePx = secondToPixcel(totalEndTime);
+ if (e.x > endTimePx) {
+ e.x = (int) endTimePx;
+ }
+ }
+
+ double movedTime = pixcelToSecond(e.x);
+ startRangeMarker.setTime(movedTime);
+ DACustomTimeline.this.redraw();
+ } else if (endRangeMarker.isPushed()) {
+ if (e.x < 0 + endRangeMarker.getImage().getBounds().width) {
+ e.x = endRangeMarker.getImage().getBounds().width;
+ } else if (e.x > DACustomTimeline.this.getBounds().width) {
+ double endTimePx = secondToPixcel(totalEndTime);
+ if (e.x > endTimePx) {
+ e.x = (int) endTimePx;
+ } else {
+ e.x = DACustomTimeline.this.getBounds().width;
+ }
+ } else {
+ double endTimePx = secondToPixcel(totalEndTime);
+ if (e.x > endTimePx) {
+ e.x = (int) endTimePx;
+ }
+ }
+
+ double movedTime = pixcelToSecond(e.x);
+ endRangeMarker.setTime(movedTime);
+ DACustomTimeline.this.redraw();
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.timeline;
+
+import org.eclipse.swt.graphics.Image;
+
+public class DACustomTimelineRangeMarker {
+ private double time = -1;
+ private Image normalImage;
+ private Image pushedImage;
+
+ private boolean isPushed = false;
+
+ public DACustomTimelineRangeMarker(Image normalImage, Image pushedImage) {
+ this.normalImage = normalImage;
+ this.pushedImage = pushedImage;
+ }
+
+ public void setTime(double time) {
+ this.time = time;
+ }
+
+ public double getTime() {
+ return time;
+ }
+
+ public void setPushStatus(boolean status) {
+ this.isPushed = status;
+ }
+
+ public Image getImage() {
+ if(isPushed) {
+ return pushedImage;
+ } else {
+ return normalImage;
+ }
+ }
+
+ public boolean isPushed() {
+ return isPushed;
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.widgets.timeline;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Display;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+import org.tizen.dynamicanalyzer.widgets.helper.Formatter;
+import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
+
+public class DACustomTimelineRenderer {
+ public static final int DEFAULT_FONT_SIZE = 6;
+ public static final int DEFAULT_INTERVAL = 5;
+
+ private final Image balloon = ImageResources.TIMELINE_DETAILED_TIME_BALLOON;
+ private final int balloonHalfWidth = balloon.getBounds().width / 2;
+
+ private int startTime;
+ int scale;
+ Font font = new Font(Display.getCurrent(), "Verdana", // FIXME
+ DEFAULT_FONT_SIZE, SWT.NORMAL);
+
+ private void drawRangeMarkers(GC gc, DACustomTimeline timeline) {
+ DACustomTimelineRangeMarker startMarker = timeline
+ .getStartRangeMarker();
+ DACustomTimelineRangeMarker endMarker = timeline.getEndRangeMarker();
+
+ if (startMarker.getTime() >= 0) {
+ double startMarkerTime = startMarker.getTime()
+ - timeline.getStartTime();
+ int pixcelStartX = (int) Math.round(startMarkerTime * scale
+ * DEFAULT_INTERVAL);
+ gc.drawImage(startMarker.getImage(), pixcelStartX, 1);
+ }
+
+ if (endMarker.getTime() >= 0) {
+ double endMarkerTime = endMarker.getTime()
+ - timeline.getStartTime();
+ int pixcelEndX = (int) Math.round(endMarkerTime * scale
+ * DEFAULT_INTERVAL);
+ gc.drawImage(endMarker.getImage(), pixcelEndX
+ - endMarker.getImage().getBounds().width, 1);
+ }
+ }
+
+ private void drawTimeString(GC gc, int totalSecond, int pixcelX, int pixcelY) {
+ Point p;
+ String timeString = Formatter.toTimelineFormat(totalSecond);
+
+ p = gc.textExtent(timeString, SWT.DRAW_MNEMONIC);
+ gc.setForeground(ColorResources.TIMELINE_NUMBER_COLOR);
+ gc.drawText(timeString, pixcelX - p.x / 2, pixcelY, true);
+ gc.setForeground(ColorResources.TIMELINE_TICK_COLOR);
+ }
+
+ public void draw(GC gc, DACustomTimeline timeline) {
+ Rectangle rt = timeline.getClientArea();
+ gc.setFont(font);
+ gc.setBackground(ColorResources.TIMELINE_BG_COLOR);
+ gc.fillRectangle(rt);
+
+ // draw underLine
+ gc.drawLine(0, rt.height - 1, rt.width, rt.height - 1);
+
+ // draw time
+ int pixcelX = 0;
+ scale = timeline.getScale();
+ int secondInterval = scale * DEFAULT_INTERVAL;
+ startTime = (int) timeline.getStartTime();
+ pixcelX -= (timeline.getStartTime() - (double) startTime)
+ * ((double) secondInterval);
+
+ for (; pixcelX < rt.width; startTime++, pixcelX += secondInterval) {
+ if (startTime % 10 == 0) {
+ drawTimeString(gc, startTime, pixcelX, 1);
+ gc.drawLine(pixcelX, rt.height - 7, pixcelX, rt.height - 1);
+ } else if (startTime % 5 == 0) {
+ if (scale >= DACustomTimeline.SCALE_400) {
+ drawTimeString(gc, startTime, pixcelX, 1);
+ }
+ gc.drawLine(pixcelX, rt.height - 5, pixcelX, rt.height - 1);
+ } else {
+ if (scale >= DACustomTimeline.SCALE_800) {
+ drawTimeString(gc, startTime, pixcelX, 1);
+ }
+ gc.drawLine(pixcelX, rt.height - 3, pixcelX, rt.height - 1);
+ }
+ }
+
+ drawRangeMarkers(gc, timeline);
+
+ if (timeline.getDrawDetailedTime()) {
+ gc.drawImage(balloon, 0, 0, balloon.getBounds().width,
+ balloon.getBounds().height,
+ timeline.getDetailedTimePosition() - balloonHalfWidth, 0,
+ balloon.getBounds().width, timeline.getBounds().height - 1);
+
+ String time = Formatter.toTimeFormat((long) (timeline
+ .getDetailedTime() * 1000000));
+ gc.setForeground(ColorResources.BLACK);
+ gc.setFont(new Font(Display.getCurrent(), "Verdana", 7, SWT.NONE));
+
+ gc.drawString(time,
+ timeline.getDetailedTimePosition()
+ - gc.stringExtent(time).x / 2, 1, true);
+ }
+ }
+}
--- /dev/null
+package org.tizen.dynamicanalyzer.widgets.timer;
+
+public interface IAlarm {
+ public void action();
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.widgets.timer;
+
+import java.util.Date;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.tizen.dynamicanalyzer.widgets.DAWidgetConstants;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+
+public class TimerClock extends Canvas {
+
+ private class TimeString {
+ public String hour;
+ public String hour2;
+ public String min;
+ public String min2;
+ public String sec;
+ public String sec2;
+ }
+
+ private static final int HOUR_TIME_X = 29;
+ private static final int COLON_X = 52;
+ private static final int MIN_TIME_X = 59;
+ private static final int COLON_X2 = 82;
+ private static final int SEC_TIME_X = 89;
+ private static final int TIME_WIDTH = 11;
+ private static final int HOUR = 3600000;
+ private static final int MIN = 60000;
+ private static final int SEC = 1000;
+ private static final int TWO_DIGIT = 10;
+ private static final int TIMER_PERIOD = 1000;
+ private static final String ZERO = "0"; //$NON-NLS-1$
+
+ private Timer timer;
+ private long startTime;
+ private long time;
+
+ private long alarmTime = -1;
+ private IAlarm alarm = null;
+
+ private Image bgImage = null;
+ private Font clockFont = null;
+ private Color fontColor = null;
+
+ private Canvas me = null;
+
+ public TimerClock(Composite parent, int style) {
+ super(parent, style);
+ me = this;
+ addPaintListener(paintListener);
+ setBackground(ColorResources.RED);
+ }
+
+ private PaintListener paintListener = new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ GC gc = e.gc;
+ Rectangle myRect = me.getClientArea();
+
+ if (bgImage != null) {
+ myRect = me.getClientArea();
+ gc.drawImage(bgImage, myRect.x, myRect.y);
+ } else {
+ gc.setBackground(ColorResources.BLUE);
+ gc.fillRectangle(myRect);
+ }
+
+ TimeString timeString = getTimeString(time);
+ if (null != clockFont) {
+ gc.setFont(clockFont);
+ }
+ if (null != fontColor) {
+ gc.setForeground(fontColor);
+ } else {
+ gc.setForeground(ColorResources.WHITE);
+ }
+ Point p = gc.textExtent(timeString.hour, SWT.DRAW_MNEMONIC);
+
+ int y = (myRect.height - p.y) / 2;
+ // Draws hour text.
+ gc.drawText(timeString.hour, HOUR_TIME_X, y, true);
+ gc.drawText(timeString.hour2, HOUR_TIME_X + TIME_WIDTH, y, true);
+
+ gc.drawText(":", COLON_X, y, true); //$NON-NLS-1$
+
+ // Draws minute text.
+ gc.drawText(timeString.min, MIN_TIME_X, y, true);
+ gc.drawText(timeString.min2, MIN_TIME_X + TIME_WIDTH, y, true);
+
+ gc.drawText(":", COLON_X2, y, true); //$NON-NLS-1$
+
+ // Draws second text.
+ gc.drawText(timeString.sec, SEC_TIME_X, y, true);
+ gc.drawText(timeString.sec2, SEC_TIME_X + TIME_WIDTH, y, true);
+ }
+ };
+
+ private TimeString getTimeString(long time) {
+ long hour = time / HOUR;
+ long min = (time - (hour * HOUR)) / MIN;
+ long sec = (time - (hour * HOUR) - (min * MIN)) / SEC;
+
+ // Gets hour string.
+ String hourStr = DAWidgetConstants.EMPTY_STRING;
+ String hourStr2 = DAWidgetConstants.EMPTY_STRING;
+ if (TWO_DIGIT > hour) {
+ hourStr = ZERO;
+ hourStr2 = Long.toString(hour);
+ } else {
+ hourStr = Long.toString(hour / TWO_DIGIT);
+ hourStr2 = Long.toString(hour % TWO_DIGIT);
+ }
+
+ // Gets minute string.
+ String minStr = DAWidgetConstants.EMPTY_STRING;
+ String minStr2 = DAWidgetConstants.EMPTY_STRING;
+ if (TWO_DIGIT > min) {
+ minStr = ZERO;
+ minStr2 = Long.toString(min);
+ } else {
+ minStr = Long.toString(min / TWO_DIGIT);
+ minStr2 = Long.toString(min % TWO_DIGIT);
+ }
+
+ // Gets second string.
+ String secStr = DAWidgetConstants.EMPTY_STRING;
+ String secStr2 = DAWidgetConstants.EMPTY_STRING;
+ if (TWO_DIGIT > sec) {
+ secStr = ZERO;
+ secStr2 = Long.toString(sec);
+ } else {
+ secStr = Long.toString(sec / TWO_DIGIT);
+ secStr2 = Long.toString(sec % TWO_DIGIT);
+ }
+
+ // Gets millisecond string.
+ TimeString timeString = new TimeString();
+ timeString.hour = hourStr.toString();
+ timeString.hour2 = hourStr2.toString();
+ timeString.min = minStr.toString();
+ timeString.min2 = minStr2.toString();
+ timeString.sec = secStr.toString();
+ timeString.sec2 = secStr2.toString();
+
+ return timeString;
+ }
+
+ public void start() {
+ if (null != timer) {
+ stop();
+ }
+ startTime = System.currentTimeMillis();
+ timer = new Timer();
+ timer.schedule(new TimerTask() {
+ @Override
+ public void run() {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ time = System.currentTimeMillis() - startTime;
+ if (null != timer) {
+ redraw();
+ }
+
+ if (alarmTime <= time * SEC && alarmTime > 0) {
+ if (null != alarm) {
+ alarm.action();
+ }
+ // alarm is one shot
+ removeAlarm();
+ }
+ }
+ });
+ }
+ }, new Date(), TIMER_PERIOD);
+ }
+
+ public void stop() {
+ if (null != timer) {
+ timer.cancel();
+ timer = null;
+ System.out.println("timer canceled!! "); //$NON-NLS-1$
+ }
+ }
+
+ public void setTime(long micTime) {
+ time = micTime / SEC;
+ redraw();
+ }
+
+ public long getTimeInMicroseconds() {
+ // Returns time in microseconds
+ return time * SEC;
+ }
+
+ public void setBgImage(Image bg) {
+ this.bgImage = bg;
+ }
+
+ public void setFont(Font font) {
+ this.clockFont = font;
+ }
+
+ public void setFontColor(Color color) {
+ fontColor = color;
+ }
+
+ public Point getTimerSize() {
+ Rectangle r = me.getClientArea();
+ return new Point(r.width, r.height);
+ }
+
+ public void clear() {
+ setTime(0);
+ alarm = null;
+ alarmTime = -1;
+ }
+
+ public void setAlarm(long time, IAlarm alarm) {
+ this.alarmTime = time;
+ this.alarm = alarm;
+ }
+
+ public void removeAlarm() {
+ if (null != this.alarm) {
+ this.alarm = null;
+ }
+ alarmTime = -1;
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.tizen.dynamicanalyzer.workbench.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+bin.includes = feature.xml,\\r
+ feature.properties,\\r
+ license.html,\\r
+ build.properties\r
+root = rootfiles\r
--- /dev/null
+###############################################################################\r
+# Copyright (c) 2005, 2007 IBM Corporation and others.\r
+# All rights reserved. This program and the accompanying materials\r
+# are made available under the terms of the Eclipse Public License v1.0\r
+# which accompanies this distribution, and is available at\r
+# http://www.eclipse.org/legal/epl-v10.html\r
+#\r
+# Contributors:\r
+# IBM Corporation - initial API and implementation\r
+###############################################################################\r
+# features.properties\r
+# contains externalized strings for feature.xml\r
+# "%foo" in feature.xml corresponds to the key "foo" in this file\r
+# java.io.Properties file (ISO 8859-1 with "\" escapes)\r
+# This file should be translated.\r
+\r
+#Plugin name\r
+featureName=Tizen Dynamic Analyzer\r
+\r
+#Provider name\r
+providerName=Samsung Electronics\r
+\r
+# copyright\r
+copyright=\\r
+Copyright (c) 2000 - 2011 Samsung Electronics, Co., Ltd.\n\\r
+All rights reserved.\n\\r
+http://www.tizen.org\r
+\r
+# "licenseURL" property - URL of the "Feature License"\r
+# do not translate value - just change to point to a locale-specific HTML page\r
+licenseURL=http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+########### end of license property ##########################################\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.tizen.dynamicanalyzer.workbench.feature"
+ label="%featureName"
+ version="2.1.0.qualifier"
+ provider-name="%providerName">
+
+ <description url="http://www.example.com/description">
+ [Enter Feature Description here.]
+ </description>
+
+ <copyright url="http://www.example.com/copyright">
+ [Enter Copyright Description here.]
+ </copyright>
+
+ <license url="http://www.example.com/license">
+ [Enter License Description here.]
+ </license>
+
+ <includes
+ id="org.eclipse.rcp"
+ version="0.0.0"/>
+
+ <includes
+ id="org.eclipse.equinox.executable"
+ version="0.0.0"/>
+
+ <plugin
+ id="com.ibm.icu"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.jface.databinding"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.core.databinding"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.core.commands"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.equinox.app"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.equinox.util"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.equinox.ds"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.equinox.simpleconfigurator"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.equinox.launcher"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.core.expressions"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.rcp"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.jface"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.core.jobs"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.core.runtime.compatibility.registry"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ fragment="true"/>
+
+ <plugin
+ id="org.eclipse.core.contenttype"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.equinox.common"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="javax.servlet"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.osgi.services"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.swt"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.equinox.preferences"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.core.runtime.compatibility.auth"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.core.databinding.beans"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.ui.workbench"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.update.configurator"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.osgi"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.core.databinding.property"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.core.databinding.observable"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.core.runtime"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.equinox.registry"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.help"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.tizen.dynamicanalyzer"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.tizen.dynamicanalyzer.splash"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.tizen.dynamicanalyzer.workbench"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.tizen.dynamicanalyzer.widgets"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.tizen.common.sdblib"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<classpath>\r
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
+ <classpathentry exported="true" kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
+ <classpathentry kind="src" path="src"/>\r
+ <classpathentry kind="output" path="bin"/>\r
+</classpath>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.tizen.dynamicanalyzer.workbench</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+#Sat Jan 29 17:22:41 KST 2011\r
+eclipse.preferences.version=1\r
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled\r
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6\r
+org.eclipse.jdt.core.compiler.compliance=1.6\r
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error\r
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error\r
+org.eclipse.jdt.core.compiler.source=1.6\r
--- /dev/null
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Localization: plugin
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.tizen.dynamicanalyzer.workbench;singleton:=true
+Bundle-Version: 2.1.0.qualifier
+Bundle-Vendor: %providerName
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.ui,
+ org.tizen.dynamicanalyzer;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Export-Package: org.tizen.dynamicanalyzer.workbench;
+ uses:="org.eclipse.jface.action,
+ org.eclipse.ui.application,
+ org.eclipse.ui,
+ org.eclipse.equinox.app,
+ org.eclipse.swt.widgets",
+ org.tizen.dynamicanalyzer.workbench.perspective;uses:="org.eclipse.ui"
--- /dev/null
+# Property "aboutText" contains blurb for feature details in the "About"
+# dialog (translated). Maximum 15 lines and 75 characters per line.
+aboutText=%blurb
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=icons/alt_window_32.gif
--- /dev/null
+0=1.0.0
\ No newline at end of file
--- /dev/null
+blurb=DynamicAnalyzer Product\n\
+\n\
+Version: {featureVersion}\n\
+Build id: {0}\n\
+\n\
+(c) Copyright Samsung Electorics. All rights reserved.\n\
+
--- /dev/null
+source.. = src/\r
+output.. = bin/\r
+bin.includes = plugin.xml,\\r
+ META-INF/,\\r
+ .,\\r
+ about.ini,\\r
+ about.mappings,\\r
+ about.properties,\\r
+ plugin.properties,\\r
+ plugin_customization.ini,\\r
+ icons/\r
--- /dev/null
+Internal call=off
+Platform=etc
+Ragne auto select=on
+Build time=09/05/2012 10:30 AM (GMT)
+Snapshot=off
+Selected chart list=CPU,CPU core,CPU frequency,Heap allocation,Process Size,Memory,File,Screenshot,UI event
+Available chart list=CPU,CPU core,CPU frequency,Heap allocation,Process Size,Memory,File,Screenshot,UI event
\ No newline at end of file
--- /dev/null
+Tizen SDK contains software portions licensed under various open source licenses as well as proprietary components. All open source software portions ("Open Source Software") are licensed under the open source licenses that accompany such Open Source Software.\r
+\r
+The licenses governing the Open Source Software are available at: http://developer.tizen.org/download/tizen_sdk_opensource_license.html\r
+\r
+Except for the Open Source Software contained in Tizen SDK, all other software portions contained in Tizen SDK are governed by the terms and conditions of the Tizen Software Development Kit License Agreement, available at: http://developer.tizen.org/download/samsung_sdk_license.html\r
+\r
+You may access and download Tizen SDK Open Source Software at: http://developer.tizen.org/download/tizenopensdk.tar.gz\r
+\r
+BY CLICKING THE "I AGREE" BUTTON OR BY USING ANY PART OF TIZEN SDK, YOU AGREE (ON BEHALF OF YOURSELF AND/OR YOUR COMPANY) TO THE OPEN SOURCE SOFTWARE LICENSE TERMS AND THE TIZEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT. IF YOU DO NOT AGREE WITH THE OPEN SOURCE SOFTWARE LICENSE TERMS OR THE TIZEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT, YOU MAY NOT DOWNLOAD OR USE TIZEN SDK.\r
--- /dev/null
+0 30 30 0 0 0 0 0 0 0
+1 1 1 1 1 1 1 0 0 0
+54 63 68 73 78 82 88 93 98 104
+0 30 0 0 0 0 0 0 0 0
+0 183 191 210 230 0 0 0 0 0
+0 12 17 78 0 0 0 0 0 0
+0 50 54 78 0 0 0 0 0 0
+0 0 0 226 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0
+0 194 194 194 194 194 194 194 194 194
+0 43 2 124 3 191 5 299 8 462
--- /dev/null
+0 30 30 0 0 0 0 0 0 0
+1 1 1 1 1 1 1 0 0 0
+56 69 75 90 111 134 154 178 203 226
+0 30 0 0 0 0 0 0 0 0
+0 185 185 210 230 0 0 0 0 0
+0 76 76 111 0 0 0 0 0 0
+0 28 28 32 0 0 0 0 0 0
+0 0 0 230 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0
+0 260 260 260 260 260 260 260 260 260
+40 50 60 75 60 100 63 166 66 210
--- /dev/null
+file :: + Ui`, -Web ;
+api :: -operator`, -GetItemCount`,-Reserved;
\ No newline at end of file
--- /dev/null
+rem # find & move absolute path
+set ABS_PATH=%~dp0
+cd %ABS_PATH%
+
+set PWD=%CD%
+set ACTIVATOR_PATH=%PWD%
+set ACTIVATOR_BIN=WindowActivator.exe
+set PATH=%ACTIVATOR_PATH%;%PATH%
+
+%ACTIVATOR_PATH%\%ACTIVATOR_BIN% %*
--- /dev/null
+#! /bin/bash
+
+abspath="$(cd "${0%/*}" 2>/dev/null; echo $PWD/${0##*/})"
+absdir=`dirname "$abspath"`
+
+PWD=`pwd`
+
+ACTIVATOR=WindowActivator
+ACTIVATOR_PATH=${absdir}
+
+# for coredump file
+ulimit -c unlimited
+
+${ACTIVATOR_PATH}/${ACTIVATOR} "$@"
+
--- /dev/null
+Set fso = CreateObject("Scripting.FileSystemObject")
+activatorPath = fso.GetParentFolderName(Wscript.scriptFullName)
+activatorScript=activatorPath & "\dynamicanalyzer.bat"
+
+For i = 0 To WScript.Arguments.Count - 1
+ args = args & Chr(34) & WScript.Arguments(i) & Chr(34) & " "
+Next
+
+set WshShell=WScript.CreateObject("WScript.Shell")
+WshShell.run activatorScript & " " & args,0,False
+Set WshShell=Nothing
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<LeakCheckList xmlns="org.tizen.dynamicanalyzer">
+
+ <checks>
+ <name>malloc</name>
+ <type>0</type>
+ <category>1</category>
+ <keyIndex>14</keyIndex>
+ <checkUserCall>true</checkUserCall>
+ </checks>
+
+ <checks>
+ <name>calloc</name>
+ <type>0</type>
+ <category>1</category>
+ <keyIndex>14</keyIndex>
+ <checkUserCall>true</checkUserCall>
+ </checks>
+
+ <checks>
+ <name>app_get_name</name>
+ <type>0</type>
+ <category>1</category>
+ <keyIndex>14</keyIndex>
+ <checkUserCall>false</checkUserCall>
+ </checks>
+
+ <checks>
+ <name>app_get_data_directory</name>
+ <type>0</type>
+ <category>1</category>
+ <keyIndex>14</keyIndex>
+ <checkUserCall>false</checkUserCall>
+ </checks>
+
+ <checks>
+ <name>app_get_package</name>
+ <type>0</type>
+ <category>1</category>
+ <keyIndex>14</keyIndex>
+ <checkUserCall>false</checkUserCall>
+ </checks>
+
+ <checks>
+ <name>app_get_version</name>
+ <type>0</type>
+ <category>1</category>
+ <keyIndex>14</keyIndex>
+ <checkUserCall>false</checkUserCall>
+ </checks>
+
+ <checks>
+ <name>realloc</name>
+ <type>2</type>
+ <category>1</category>
+ <keyIndex>14</keyIndex>
+ <freeIndex>8</freeIndex>
+ <checkUserCall>true</checkUserCall>
+ </checks>
+
+ <checks>
+ <name>free</name>
+ <type>1</type>
+ <category>1</category>
+ <keyIndex>14</keyIndex>
+ <checkUserCall>true</checkUserCall>
+ </checks>
+
+ <checks>
+ <name>open</name>
+ <type>0</type>
+ <category>5</category>
+ <keyIndex>13</keyIndex>
+ <checkUserCall>true</checkUserCall>
+ </checks>
+
+ <checks>
+ <name>File::Construct</name>
+ <type>0</type>
+ <category>5</category>
+ <keyIndex>13</keyIndex>
+ <checkUserCall>false</checkUserCall>
+ </checks>
+
+
+ <checks>
+ <name>File::~File</name>
+ <type>1</type>
+ <category>5</category>
+ <keyIndex>13</keyIndex>
+ <checkUserCall>false</checkUserCall>
+ </checks>
+
+ <checks>
+ <name>close</name>
+ <type>1</type>
+ <category>5</category>
+ <keyIndex>13</keyIndex>
+ <checkUserCall>true</checkUserCall>
+ </checks>
+
+ <checks>
+ <name>fopen</name>
+ <type>0</type>
+ <category>5</category>
+ <keyIndex>13</keyIndex>
+ <checkUserCall>true</checkUserCall>
+ </checks>
+
+ <checks>
+ <name>fclose</name>
+ <type>1</type>
+ <category>5</category>
+ <keyIndex>13</keyIndex>
+ <checkUserCall>true</checkUserCall>
+ </checks>
+</LeakCheckList>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<BaseLogCenter xmlns="org.tizen.dynamicanalyzer">
+ <id>13</id>
+ <name>custom_chart</name>
+ <totalColumnCount>19</totalColumnCount>
+ <customColumn>false</customColumn>
+
+ <ColumnName>Rid</ColumnName>
+ <ColumnName>ID</ColumnName>
+ <ColumnName>SeqNumber</ColumnName>
+ <ColumnName>APIName</ColumnName>
+ <ColumnName>Time</ColumnName>
+
+ <ColumnName>Pid</ColumnName>
+ <ColumnName>Tid</ColumnName>
+ <ColumnName>InputParam</ColumnName>
+ <ColumnName>Return</ColumnName>
+ <ColumnName>PCAddr</ColumnName>
+ <!-- 10 -->
+ <ColumnName>Error</ColumnName>
+ <ColumnName>InternalCall</ColumnName>
+ <ColumnName>CallerPCAddr</ColumnName>
+ <ColumnName>Handle</ColumnName>
+ <ColumnName>Type</ColumnName>
+
+ <ColumnName>Name</ColumnName>
+ <ColumnName>Color</ColumnName>
+ <ColumnName>Value</ColumnName>
+ <ColumnName>Reserved</ColumnName>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER PRIMARY KEY NOT NULL</type>
+ <type>TEXT</type>
+ <type>INTEGER</type>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+
+ <type>TEXT</type>
+ <type>INTEGER</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+
+ <ColumnSize>100</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+
+
+ <ColumnOrder>0</ColumnOrder>
+ <ColumnOrder>1</ColumnOrder>
+ <ColumnOrder>2</ColumnOrder>
+ <ColumnOrder>4</ColumnOrder>
+ <ColumnOrder>3</ColumnOrder>
+
+ <ColumnOrder>13</ColumnOrder>
+ <ColumnOrder>14</ColumnOrder>
+ <ColumnOrder>12</ColumnOrder>
+ <ColumnOrder>11</ColumnOrder>
+ <ColumnOrder>9</ColumnOrder>
+
+ <ColumnOrder>7</ColumnOrder>
+ <ColumnOrder>8</ColumnOrder>
+ <ColumnOrder>10</ColumnOrder>
+ <ColumnOrder>5</ColumnOrder>
+ <ColumnOrder>6</ColumnOrder>
+
+ <ColumnOrder>15</ColumnOrder>
+ <ColumnOrder>16</ColumnOrder>
+ <ColumnOrder>17</ColumnOrder>
+ <ColumnOrder>18</ColumnOrder>
+ <ColumnOrder>19</ColumnOrder>
+
+
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+
+
+ <TableColumnName>Row Id</TableColumnName>
+ <TableColumnName>ID</TableColumnName>
+ <TableColumnName>#</TableColumnName>
+ <TableColumnName>API name</TableColumnName>
+ <TableColumnName>Time</TableColumnName>
+
+ <TableColumnName>Process id</TableColumnName>
+ <TableColumnName>Thread id</TableColumnName>
+ <TableColumnName>Input parm</TableColumnName>
+ <TableColumnName>Return</TableColumnName>
+ <TableColumnName>PC Addr</TableColumnName>
+
+ <TableColumnName>Errno</TableColumnName>
+ <TableColumnName>Internal Call</TableColumnName>
+ <TableColumnName>Caller PC Address</TableColumnName>
+ <TableColumnName>Handle</TableColumnName>
+ <TableColumnName>Type</TableColumnName>
+
+ <TableColumnName>Name</TableColumnName>
+ <TableColumnName>Color</TableColumnName>
+ <TableColumnName>Value</TableColumnName>
+ <TableColumnName>Reserved</TableColumnName>
+</BaseLogCenter>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<BaseLogCenter xmlns="org.tizen.dynamicanalyzer">
+ <id>6</id>
+ <name>lifecycle</name>
+ <totalColumnCount>14</totalColumnCount>
+ <customColumn>false</customColumn>
+
+ <ColumnName>Rid</ColumnName>
+ <ColumnName>ID</ColumnName>
+ <ColumnName>SeqNumber</ColumnName>
+ <ColumnName>APIName</ColumnName>
+ <ColumnName>Time</ColumnName>
+
+ <ColumnName>Pid</ColumnName>
+ <ColumnName>Tid</ColumnName>
+ <ColumnName>InputParam</ColumnName>
+ <ColumnName>Return</ColumnName>
+ <ColumnName>PCAddr</ColumnName>
+ <!-- 10 -->
+ <ColumnName>Error</ColumnName>
+ <ColumnName>InternalCall</ColumnName>
+ <ColumnName>CallerPCAddr</ColumnName>
+ <ColumnName>Reserved</ColumnName>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER PRIMARY KEY NOT NULL</type>
+ <type>TEXT</type>
+ <type>INTEGER</type>
+
+ <type>INTEGER</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>TEXT</type>
+
+ <ColumnSize>100</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>80</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+
+
+ <ColumnOrder>2</ColumnOrder>
+ <ColumnOrder>4</ColumnOrder>
+ <ColumnOrder>3</ColumnOrder>
+ <ColumnOrder>8</ColumnOrder>
+ <ColumnOrder>0</ColumnOrder>
+
+ <ColumnOrder>1</ColumnOrder>
+ <ColumnOrder>5</ColumnOrder>
+ <ColumnOrder>6</ColumnOrder>
+ <ColumnOrder>7</ColumnOrder>
+ <ColumnOrder>9</ColumnOrder>
+
+ <ColumnOrder>10</ColumnOrder>
+ <ColumnOrder>11</ColumnOrder>
+ <ColumnOrder>12</ColumnOrder>
+ <ColumnOrder>13</ColumnOrder>
+
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <TableColumnName>Row Id</TableColumnName>
+ <TableColumnName>ID</TableColumnName>
+ <TableColumnName>#</TableColumnName>
+ <TableColumnName>API name</TableColumnName>
+ <TableColumnName>Time</TableColumnName>
+
+ <TableColumnName>Process id</TableColumnName>
+ <TableColumnName>Thread id</TableColumnName>
+ <TableColumnName>Input parm</TableColumnName>
+ <TableColumnName>Return</TableColumnName>
+ <TableColumnName>PC Addr</TableColumnName>
+
+ <TableColumnName>Errno</TableColumnName>
+ <TableColumnName>Internal Call</TableColumnName>
+ <TableColumnName>CallerPCAddr</TableColumnName>
+ <TableColumnName>Reserved</TableColumnName>
+
+</BaseLogCenter>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<BaseLogCenter xmlns="org.tizen.dynamicanalyzer">
+ <id>1</id>
+ <name>memory</name>
+ <totalColumnCount>17</totalColumnCount>
+ <customColumn>false</customColumn>
+
+ <ColumnName>Rid</ColumnName>
+ <ColumnName>ID</ColumnName>
+ <ColumnName>SeqNumber</ColumnName>
+ <ColumnName>APIName</ColumnName>
+ <ColumnName>Time</ColumnName>
+
+ <ColumnName>Pid</ColumnName>
+ <ColumnName>Tid</ColumnName>
+ <ColumnName>InputParam</ColumnName>
+ <ColumnName>Return</ColumnName>
+ <ColumnName>PCAddr</ColumnName>
+ <!-- 10 -->
+ <ColumnName>Error</ColumnName>
+ <ColumnName>InternalCall</ColumnName>
+ <ColumnName>CallerPCAddr</ColumnName>
+ <ColumnName>Size</ColumnName>
+ <ColumnName>MemoryAPIType</ColumnName>
+
+ <ColumnName>Addr</ColumnName>
+ <ColumnName>Reserved</ColumnName>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER PRIMARY KEY NOT NULL</type>
+ <type>TEXT</type>
+ <type>INTEGER</type>
+
+ <type>INTEGER</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+
+ <type>INTEGER</type>
+ <type>TEXT</type>
+
+
+ <ColumnSize>100</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>80</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+
+
+ <ColumnOrder>0</ColumnOrder>
+ <ColumnOrder>1</ColumnOrder>
+ <ColumnOrder>2</ColumnOrder>
+ <ColumnOrder>3</ColumnOrder>
+ <ColumnOrder>4</ColumnOrder>
+
+ <ColumnOrder>5</ColumnOrder>
+ <ColumnOrder>6</ColumnOrder>
+ <ColumnOrder>7</ColumnOrder>
+ <ColumnOrder>8</ColumnOrder>
+ <ColumnOrder>9</ColumnOrder>
+
+ <ColumnOrder>10</ColumnOrder>
+ <ColumnOrder>11</ColumnOrder>
+ <ColumnOrder>12</ColumnOrder>
+ <ColumnOrder>13</ColumnOrder>
+ <ColumnOrder>14</ColumnOrder>
+
+ <ColumnOrder>15</ColumnOrder>
+ <ColumnOrder>16</ColumnOrder>
+
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+
+ <TableColumnName>Row Id</TableColumnName>
+ <TableColumnName>ID</TableColumnName>
+ <TableColumnName>#</TableColumnName>
+ <TableColumnName>API name</TableColumnName>
+ <TableColumnName>Time</TableColumnName>
+
+ <TableColumnName>Process id</TableColumnName>
+ <TableColumnName>Thread id</TableColumnName>
+ <TableColumnName>Input parm</TableColumnName>
+ <TableColumnName>Return</TableColumnName>
+ <TableColumnName>PC Addr</TableColumnName>
+
+ <TableColumnName>Errno</TableColumnName>
+ <TableColumnName>Internal Call</TableColumnName>
+ <TableColumnName>Caller PC Address</TableColumnName>
+ <TableColumnName>Size</TableColumnName>
+ <TableColumnName>Mem api type</TableColumnName>
+
+ <TableColumnName>Address</TableColumnName>
+ <TableColumnName>Realloc Size</TableColumnName>
+
+</BaseLogCenter>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<BaseLogCenter xmlns="org.tizen.dynamicanalyzer">
+ <id>11</id>
+ <name>profiling</name>
+ <totalColumnCount>7</totalColumnCount>
+ <customColumn>false</customColumn>
+
+ <ColumnName>Rid</ColumnName>
+ <ColumnName>ID</ColumnName>
+ <ColumnName>SeqNumber</ColumnName>
+ <ColumnName>Time</ColumnName>
+ <ColumnName>PCAddr</ColumnName>
+
+ <ColumnName>Callstack</ColumnName>
+ <ColumnName>Reserved</ColumnName>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER PRIMARY KEY NOT NULL</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+
+ <type>TEXT</type>
+ <type>TEXT</type>
+
+ <ColumnSize>100</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+
+
+ <ColumnOrder>0</ColumnOrder>
+ <ColumnOrder>1</ColumnOrder>
+ <ColumnOrder>2</ColumnOrder>
+ <ColumnOrder>3</ColumnOrder>
+ <ColumnOrder>4</ColumnOrder>
+
+ <ColumnOrder>5</ColumnOrder>
+ <ColumnOrder>6</ColumnOrder>
+
+
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <TableColumnName>Row Id</TableColumnName>
+ <TableColumnName>ID</TableColumnName>
+ <TableColumnName>#</TableColumnName>
+ <TableColumnName>Time</TableColumnName>
+ <TableColumnName>PCAddr</TableColumnName>
+
+ <TableColumnName>Callstack log</TableColumnName>
+ <TableColumnName>Reserved</TableColumnName>
+</BaseLogCenter>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<BaseLogCenter xmlns="org.tizen.dynamicanalyzer">
+ <id>5</id>
+ <name>resource</name>
+ <totalColumnCount>20</totalColumnCount>
+ <customColumn>false</customColumn>
+
+ <ColumnName>Rid</ColumnName>
+ <ColumnName>ID</ColumnName>
+ <ColumnName>SeqNumber</ColumnName>
+ <ColumnName>APIName</ColumnName>
+ <ColumnName>Time</ColumnName>
+
+ <ColumnName>Pid</ColumnName>
+ <ColumnName>Tid</ColumnName>
+ <ColumnName>InputParam</ColumnName>
+ <ColumnName>Return</ColumnName>
+ <ColumnName>PCAddr</ColumnName>
+ <!-- 10 -->
+ <ColumnName>Error</ColumnName>
+ <ColumnName>InternalCall</ColumnName>
+ <ColumnName>CallerPCAddr</ColumnName>
+ <ColumnName>Size</ColumnName>
+ <ColumnName>FDValue</ColumnName>
+
+ <ColumnName>FDType</ColumnName>
+ <ColumnName>FDAPIType</ColumnName>
+ <ColumnName>FileSize</ColumnName>
+ <ColumnName>FilePath</ColumnName>
+ <ColumnName>Reserved</ColumnName>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER PRIMARY KEY NOT NULL</type>
+ <type>TEXT</type>
+ <type>INTEGER</type>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+
+ <ColumnSize>100</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+
+
+ <ColumnOrder>0</ColumnOrder>
+ <ColumnOrder>1</ColumnOrder>
+ <ColumnOrder>2</ColumnOrder>
+ <ColumnOrder>4</ColumnOrder>
+ <ColumnOrder>3</ColumnOrder>
+
+ <ColumnOrder>13</ColumnOrder>
+ <ColumnOrder>14</ColumnOrder>
+ <ColumnOrder>12</ColumnOrder>
+ <ColumnOrder>11</ColumnOrder>
+ <ColumnOrder>9</ColumnOrder>
+
+ <ColumnOrder>7</ColumnOrder>
+ <ColumnOrder>8</ColumnOrder>
+ <ColumnOrder>10</ColumnOrder>
+ <ColumnOrder>5</ColumnOrder>
+ <ColumnOrder>6</ColumnOrder>
+
+ <ColumnOrder>15</ColumnOrder>
+ <ColumnOrder>16</ColumnOrder>
+ <ColumnOrder>17</ColumnOrder>
+ <ColumnOrder>18</ColumnOrder>
+ <ColumnOrder>19</ColumnOrder>
+
+
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+
+
+ <TableColumnName>Row Id</TableColumnName>
+ <TableColumnName>ID</TableColumnName>
+ <TableColumnName>#</TableColumnName>
+ <TableColumnName>API name</TableColumnName>
+ <TableColumnName>Time</TableColumnName>
+
+ <TableColumnName>Process id</TableColumnName>
+ <TableColumnName>Thread id</TableColumnName>
+ <TableColumnName>Input parm</TableColumnName>
+ <TableColumnName>Return</TableColumnName>
+ <TableColumnName>PC Addr</TableColumnName>
+
+ <TableColumnName>Errno</TableColumnName>
+ <TableColumnName>Internal Call</TableColumnName>
+ <TableColumnName>Caller PC Address</TableColumnName>
+ <TableColumnName>Size</TableColumnName>
+ <TableColumnName>FD value</TableColumnName>
+
+ <TableColumnName>FD type</TableColumnName>
+ <TableColumnName>FD API Type</TableColumnName>
+ <TableColumnName>File Size</TableColumnName>
+ <TableColumnName>FD api type</TableColumnName>
+ <TableColumnName>File Path</TableColumnName>
+</BaseLogCenter>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<BaseLogCenter xmlns="org.tizen.dynamicanalyzer">
+ <id>8</id>
+ <name>scene</name>
+ <totalColumnCount>21</totalColumnCount>
+ <customColumn>false</customColumn>
+
+ <ColumnName>Rid</ColumnName>
+ <ColumnName>ID</ColumnName>
+ <ColumnName>SeqNumber</ColumnName>
+ <ColumnName>APIName</ColumnName>
+ <ColumnName>Time</ColumnName>
+
+ <ColumnName>Pid</ColumnName>
+ <ColumnName>Tid</ColumnName>
+ <ColumnName>InputParam</ColumnName>
+ <ColumnName>Return</ColumnName>
+ <ColumnName>PCAddr</ColumnName>
+ <!-- 10 -->
+ <ColumnName>Error</ColumnName>
+ <ColumnName>InternalCall</ColumnName>
+ <ColumnName>CallerPCAddr</ColumnName>
+ <ColumnName>SceneName</ColumnName>
+ <ColumnName>FormName</ColumnName>
+
+ <ColumnName>FormClassName</ColumnName>
+ <ColumnName>PanelName</ColumnName>
+ <ColumnName>PanelClassName</ColumnName>
+ <ColumnName>TranseFormTime</ColumnName>
+ <ColumnName>UserTime</ColumnName>
+
+ <ColumnName>Reserved</ColumnName>
+
+
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER PRIMARY KEY NOT NULL</type>
+ <type>TEXT</type>
+ <type>INTEGER</type>
+
+ <type>INTEGER</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+
+ <type>TEXT</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+
+ <type>TEXT</type>
+
+ <ColumnSize>100</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>80</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+
+
+ <ColumnOrder>0</ColumnOrder>
+ <ColumnOrder>1</ColumnOrder>
+ <ColumnOrder>2</ColumnOrder>
+ <ColumnOrder>3</ColumnOrder>
+ <ColumnOrder>4</ColumnOrder>
+
+ <ColumnOrder>5</ColumnOrder>
+ <ColumnOrder>6</ColumnOrder>
+ <ColumnOrder>7</ColumnOrder>
+ <ColumnOrder>8</ColumnOrder>
+ <ColumnOrder>9</ColumnOrder>
+
+ <ColumnOrder>10</ColumnOrder>
+ <ColumnOrder>11</ColumnOrder>
+ <ColumnOrder>12</ColumnOrder>
+ <ColumnOrder>13</ColumnOrder>
+ <ColumnOrder>14</ColumnOrder>
+
+ <ColumnOrder>15</ColumnOrder>
+ <ColumnOrder>16</ColumnOrder>
+ <ColumnOrder>17</ColumnOrder>
+ <ColumnOrder>18</ColumnOrder>
+ <ColumnOrder>19</ColumnOrder>
+ <ColumnOrder>20</ColumnOrder>
+
+
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+
+
+ <TableColumnName>Row Id</TableColumnName>
+ <TableColumnName>ID</TableColumnName>
+ <TableColumnName>#</TableColumnName>
+ <TableColumnName>API name</TableColumnName>
+ <TableColumnName>Time</TableColumnName>
+
+ <TableColumnName>Process id</TableColumnName>
+ <TableColumnName>Thread id</TableColumnName>
+ <TableColumnName>Input parm</TableColumnName>
+ <TableColumnName>Return</TableColumnName>
+ <TableColumnName>PC Addr</TableColumnName>
+
+ <TableColumnName>Errno</TableColumnName>
+ <TableColumnName>Internal call</TableColumnName>
+ <TableColumnName>Caller PCaddr</TableColumnName>
+ <TableColumnName>Scene name</TableColumnName>
+ <TableColumnName>Form name</TableColumnName>
+
+ <TableColumnName>Form Class Name</TableColumnName>
+ <TableColumnName>Panel name</TableColumnName>
+ <TableColumnName>Panel Class Name</TableColumnName>
+ <TableColumnName>TranseFormTime</TableColumnName>
+ <TableColumnName>UserTime</TableColumnName>
+ <TableColumnName>Reserved</TableColumnName>
+
+</BaseLogCenter>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<BaseLogCenter xmlns="org.tizen.dynamicanalyzer">
+ <id>7</id>
+ <name>screenshot</name>
+ <totalColumnCount>16</totalColumnCount>
+ <customColumn>false</customColumn>
+
+ <ColumnName>Rid</ColumnName>
+ <ColumnName>ID</ColumnName>
+ <ColumnName>SeqNumber</ColumnName>
+ <ColumnName>APIName</ColumnName>
+ <ColumnName>Time</ColumnName>
+
+ <ColumnName>Pid</ColumnName>
+ <ColumnName>Tid</ColumnName>
+ <ColumnName>InputParam</ColumnName>
+ <ColumnName>Return</ColumnName>
+ <ColumnName>PCAddr</ColumnName>
+ <!-- 10 -->
+ <ColumnName>Error</ColumnName>
+ <ColumnName>InternalCall</ColumnName>
+ <ColumnName>CallerPCAddr</ColumnName>
+ <ColumnName>ImageFilePath</ColumnName>
+ <ColumnName>Orientation</ColumnName>
+
+ <ColumnName>Reserved</ColumnName>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER PRIMARY KEY NOT NULL</type>
+ <type>TEXT</type>
+ <type>INTEGER</type>
+
+ <type>INTEGER</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>TEXT</type>
+ <type>INTEGER</type>
+
+ <type>TEXT</type>
+
+
+ <ColumnSize>100</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>80</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+
+
+ <ColumnOrder>0</ColumnOrder>
+ <ColumnOrder>1</ColumnOrder>
+ <ColumnOrder>2</ColumnOrder>
+ <ColumnOrder>3</ColumnOrder>
+ <ColumnOrder>4</ColumnOrder>
+
+ <ColumnOrder>5</ColumnOrder>
+ <ColumnOrder>6</ColumnOrder>
+ <ColumnOrder>7</ColumnOrder>
+ <ColumnOrder>8</ColumnOrder>
+ <ColumnOrder>9</ColumnOrder>
+
+ <ColumnOrder>10</ColumnOrder>
+ <ColumnOrder>11</ColumnOrder>
+ <ColumnOrder>12</ColumnOrder>
+ <ColumnOrder>13</ColumnOrder>
+ <ColumnOrder>14</ColumnOrder>
+
+ <ColumnOrder>15</ColumnOrder>
+
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <TableColumnName>Row Id</TableColumnName>
+ <TableColumnName>ID</TableColumnName>
+ <TableColumnName>#</TableColumnName>
+ <TableColumnName>API name</TableColumnName>
+ <TableColumnName>Time</TableColumnName>
+
+ <TableColumnName>Process id</TableColumnName>
+ <TableColumnName>Thread id</TableColumnName>
+ <TableColumnName>Input parm</TableColumnName>
+ <TableColumnName>Return</TableColumnName>
+ <TableColumnName>PC Addr</TableColumnName>
+
+ <TableColumnName>Errno</TableColumnName>
+ <TableColumnName>Internal Call</TableColumnName>
+ <TableColumnName>CallerPCAddr</TableColumnName>
+ <TableColumnName>ImageFilePath</TableColumnName>
+ <TableColumnName>Orientation</TableColumnName>
+ <TableColumnName>Reserved</TableColumnName>
+
+</BaseLogCenter>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<BaseLogCenter xmlns="org.tizen.dynamicanalyzer">
+ <id>14</id>
+ <name>synchronization</name>
+ <totalColumnCount>17</totalColumnCount>
+ <customColumn>false</customColumn>
+
+ <ColumnName>Rid</ColumnName>
+ <ColumnName>ID</ColumnName>
+ <ColumnName>SeqNumber</ColumnName>
+ <ColumnName>APIName</ColumnName>
+ <ColumnName>Time</ColumnName>
+
+ <ColumnName>Pid</ColumnName>
+ <ColumnName>Tid</ColumnName>
+ <ColumnName>InputParam</ColumnName>
+ <ColumnName>Return</ColumnName>
+ <ColumnName>PCAddr</ColumnName>
+ <!-- 10 -->
+ <ColumnName>Error</ColumnName>
+ <ColumnName>InternalCall</ColumnName>
+ <ColumnName>CallerPCAddr</ColumnName>
+ <ColumnName>SyncVal</ColumnName>
+ <ColumnName>SyncType</ColumnName>
+
+ <ColumnName>ApiType</ColumnName>
+ <ColumnName>Reserved</ColumnName>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER PRIMARY KEY NOT NULL</type>
+ <type>TEXT</type>
+ <type>INTEGER</type>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+
+ <type>INTEGER</type>
+ <type>TEXT</type>
+
+ <ColumnSize>100</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+
+
+ <ColumnOrder>0</ColumnOrder>
+ <ColumnOrder>1</ColumnOrder>
+ <ColumnOrder>2</ColumnOrder>
+ <ColumnOrder>4</ColumnOrder>
+ <ColumnOrder>3</ColumnOrder>
+
+ <ColumnOrder>13</ColumnOrder>
+ <ColumnOrder>14</ColumnOrder>
+ <ColumnOrder>12</ColumnOrder>
+ <ColumnOrder>11</ColumnOrder>
+ <ColumnOrder>9</ColumnOrder>
+
+ <ColumnOrder>7</ColumnOrder>
+ <ColumnOrder>8</ColumnOrder>
+ <ColumnOrder>10</ColumnOrder>
+ <ColumnOrder>5</ColumnOrder>
+ <ColumnOrder>6</ColumnOrder>
+
+ <ColumnOrder>15</ColumnOrder>
+ <ColumnOrder>16</ColumnOrder>
+
+
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+
+ <TableColumnName>Row Id</TableColumnName>
+ <TableColumnName>ID</TableColumnName>
+ <TableColumnName>#</TableColumnName>
+ <TableColumnName>API name</TableColumnName>
+ <TableColumnName>Time</TableColumnName>
+
+ <TableColumnName>Process id</TableColumnName>
+ <TableColumnName>Thread id</TableColumnName>
+ <TableColumnName>Input parm</TableColumnName>
+ <TableColumnName>Return</TableColumnName>
+ <TableColumnName>PC Addr</TableColumnName>
+
+ <TableColumnName>Errno</TableColumnName>
+ <TableColumnName>Internal Call</TableColumnName>
+ <TableColumnName>Caller PC Address</TableColumnName>
+ <TableColumnName>Sync val</TableColumnName>
+ <TableColumnName>Sync type</TableColumnName>
+
+ <TableColumnName>Api type</TableColumnName>
+ <TableColumnName>Reserved</TableColumnName>
+</BaseLogCenter>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<BaseLogCenter xmlns="org.tizen.dynamicanalyzer">
+ <id>9</id>
+ <name>system</name>
+ <totalColumnCount>34</totalColumnCount>
+ <customColumn>true</customColumn>
+
+ <ColumnName>Rid</ColumnName>
+ <ColumnName>ID</ColumnName>
+ <ColumnName>SeqNumber</ColumnName>
+ <ColumnName>Energy</ColumnName>
+ <ColumnName>Time</ColumnName>
+
+ <ColumnName>WIFI</ColumnName>
+ <ColumnName>Bluetooth</ColumnName>
+ <ColumnName>GPS</ColumnName>
+ <ColumnName>Brightness</ColumnName>
+ <ColumnName>Camera</ColumnName>
+ <!-- 10 -->
+
+ <ColumnName>Sound</ColumnName>
+ <ColumnName>Audio</ColumnName>
+ <ColumnName>Vibration</ColumnName>
+ <ColumnName>Voltage</ColumnName>
+ <ColumnName>Rssi</ColumnName>
+
+ <ColumnName>Video</ColumnName>
+ <ColumnName>Call</ColumnName>
+ <ColumnName>Dnet</ColumnName>
+ <ColumnName>callAlpha</ColumnName>
+ <ColumnName>rssiAlpha</ColumnName>
+ <!-- 20 -->
+ <ColumnName>CpuFrequency</ColumnName>
+ <ColumnName>AppCpuUsage</ColumnName>
+ <ColumnName>SystemCpuUsage</ColumnName>
+ <ColumnName>VirtualMemory</ColumnName>
+ <ColumnName>ResidentMemory</ColumnName>
+
+ <ColumnName>SharedMemory</ColumnName>
+ <ColumnName>PSSMemory</ColumnName>
+ <ColumnName>AllocationSize</ColumnName>
+ <ColumnName>SystemTotalMemory</ColumnName>
+ <ColumnName>SystemUsedMemory</ColumnName>
+ <!-- 30 -->
+ <ColumnName>SystemUsedStorage</ColumnName>
+ <ColumnName>NumOfThread</ColumnName>
+ <ColumnName>LoadOfThread</ColumnName>
+ <ColumnName>Reserved</ColumnName>
+
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER PRIMARY KEY NOT NULL</type>
+ <type>LONG</type>
+ <type>INTEGER</type>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+
+ <type>TEXT</type>
+ <type>FLOAT</type>
+ <type>TEXT</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+
+
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+
+
+ <ColumnOrder>0</ColumnOrder>
+ <ColumnOrder>1</ColumnOrder>
+ <ColumnOrder>2</ColumnOrder>
+ <ColumnOrder>4</ColumnOrder>
+ <ColumnOrder>3</ColumnOrder>
+
+ <ColumnOrder>14</ColumnOrder>
+ <ColumnOrder>15</ColumnOrder>
+ <ColumnOrder>16</ColumnOrder>
+ <ColumnOrder>17</ColumnOrder>
+ <ColumnOrder>18</ColumnOrder>
+
+ <ColumnOrder>10</ColumnOrder>
+ <ColumnOrder>11</ColumnOrder>
+ <ColumnOrder>12</ColumnOrder>
+ <ColumnOrder>13</ColumnOrder>
+ <ColumnOrder>5</ColumnOrder>
+
+ <ColumnOrder>6</ColumnOrder>
+ <ColumnOrder>7</ColumnOrder>
+ <ColumnOrder>8</ColumnOrder>
+ <ColumnOrder>9</ColumnOrder>
+ <ColumnOrder>19</ColumnOrder>
+
+ <ColumnOrder>20</ColumnOrder>
+ <ColumnOrder>21</ColumnOrder>
+ <ColumnOrder>22</ColumnOrder>
+ <ColumnOrder>23</ColumnOrder>
+ <ColumnOrder>24</ColumnOrder>
+
+ <ColumnOrder>25</ColumnOrder>
+ <ColumnOrder>26</ColumnOrder>
+ <ColumnOrder>27</ColumnOrder>
+ <ColumnOrder>28</ColumnOrder>
+ <ColumnOrder>29</ColumnOrder>
+
+ <ColumnOrder>30</ColumnOrder>
+ <ColumnOrder>31</ColumnOrder>
+ <ColumnOrder>32</ColumnOrder>
+ <ColumnOrder>33</ColumnOrder>
+
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+
+
+ <TableColumnName>Row Id</TableColumnName>
+ <TableColumnName>ID</TableColumnName>
+ <TableColumnName>#</TableColumnName>
+ <TableColumnName>Energy</TableColumnName>
+ <TableColumnName>Time</TableColumnName>
+
+ <TableColumnName>WIFI</TableColumnName>
+ <TableColumnName>Bluetooth</TableColumnName>
+ <TableColumnName>GPS</TableColumnName>
+ <TableColumnName>Brightness</TableColumnName>
+ <TableColumnName>Camera</TableColumnName>
+
+ <TableColumnName>Sound</TableColumnName>
+ <TableColumnName>Audio</TableColumnName>
+ <TableColumnName>Vibration</TableColumnName>
+ <TableColumnName>Voltage</TableColumnName>
+ <TableColumnName>Rssi</TableColumnName>
+
+ <TableColumnName>Video</TableColumnName>
+ <TableColumnName>Call</TableColumnName>
+ <TableColumnName>Dnet</TableColumnName>
+ <TableColumnName>Call Alpha</TableColumnName>
+ <TableColumnName>Rssi Alpha</TableColumnName>
+
+ <TableColumnName>CPU Frequency</TableColumnName>
+ <TableColumnName>App CPU Usage</TableColumnName>
+ <TableColumnName>System CPU Usage</TableColumnName>
+ <TableColumnName>Virtual Memory</TableColumnName>
+ <TableColumnName>Resident Memory</TableColumnName>
+
+ <TableColumnName>Shared Memory</TableColumnName>
+ <TableColumnName>PSS Memory</TableColumnName>
+ <TableColumnName>Allocation Size</TableColumnName>
+ <TableColumnName>System Total Memory</TableColumnName>
+ <TableColumnName>System Used Memory</TableColumnName>
+
+ <TableColumnName>System Used Storage</TableColumnName>
+ <TableColumnName>Thread Count</TableColumnName>
+ <TableColumnName>Thread Load</TableColumnName>
+ <TableColumnName>Reserved</TableColumnName>
+</BaseLogCenter>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<BaseLogCenter xmlns="org.tizen.dynamicanalyzer">
+ <id>12</id>
+ <name>thread</name>
+ <totalColumnCount>18</totalColumnCount>
+ <customColumn>false</customColumn>
+
+ <ColumnName>Rid</ColumnName>
+ <ColumnName>ID</ColumnName>
+ <ColumnName>SeqNumber</ColumnName>
+ <ColumnName>APIName</ColumnName>
+ <ColumnName>Time</ColumnName>
+
+ <ColumnName>Pid</ColumnName>
+ <ColumnName>Tid</ColumnName>
+ <ColumnName>InputParam</ColumnName>
+ <ColumnName>Return</ColumnName>
+ <ColumnName>PCAddr</ColumnName>
+ <!-- 10 -->
+ <ColumnName>Error</ColumnName>
+ <ColumnName>InternalCall</ColumnName>
+ <ColumnName>CallerPCAddr</ColumnName>
+ <ColumnName>PthreadID</ColumnName>
+ <ColumnName>OSPThreadID</ColumnName>
+
+ <ColumnName>ThreadType</ColumnName>
+ <ColumnName>ApiType</ColumnName>
+ <ColumnName>Reserved</ColumnName>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER PRIMARY KEY NOT NULL</type>
+ <type>TEXT</type>
+ <type>INTEGER</type>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>TEXT</type>
+
+ <ColumnSize>100</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+
+
+ <ColumnOrder>0</ColumnOrder>
+ <ColumnOrder>1</ColumnOrder>
+ <ColumnOrder>2</ColumnOrder>
+ <ColumnOrder>4</ColumnOrder>
+ <ColumnOrder>3</ColumnOrder>
+
+ <ColumnOrder>13</ColumnOrder>
+ <ColumnOrder>14</ColumnOrder>
+ <ColumnOrder>12</ColumnOrder>
+ <ColumnOrder>11</ColumnOrder>
+ <ColumnOrder>9</ColumnOrder>
+
+ <ColumnOrder>7</ColumnOrder>
+ <ColumnOrder>8</ColumnOrder>
+ <ColumnOrder>10</ColumnOrder>
+ <ColumnOrder>5</ColumnOrder>
+ <ColumnOrder>6</ColumnOrder>
+
+ <ColumnOrder>15</ColumnOrder>
+ <ColumnOrder>16</ColumnOrder>
+ <ColumnOrder>17</ColumnOrder>
+
+
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+
+ <TableColumnName>Row Id</TableColumnName>
+ <TableColumnName>ID</TableColumnName>
+ <TableColumnName>#</TableColumnName>
+ <TableColumnName>API name</TableColumnName>
+ <TableColumnName>Time</TableColumnName>
+
+ <TableColumnName>Process id</TableColumnName>
+ <TableColumnName>Thread id</TableColumnName>
+ <TableColumnName>Input parm</TableColumnName>
+ <TableColumnName>Return</TableColumnName>
+ <TableColumnName>PC Addr</TableColumnName>
+
+ <TableColumnName>Errno</TableColumnName>
+ <TableColumnName>Internal Call</TableColumnName>
+ <TableColumnName>Caller PC Address</TableColumnName>
+ <TableColumnName>PThread id</TableColumnName>
+ <TableColumnName>OspThread id</TableColumnName>
+
+ <TableColumnName>Thread type</TableColumnName>
+ <TableColumnName>Api type</TableColumnName>
+ <TableColumnName>Reserved</TableColumnName>
+</BaseLogCenter>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<BaseLogCenter xmlns="org.tizen.dynamicanalyzer">
+ <id>2</id>
+ <name>ui_control</name>
+ <totalColumnCount>20</totalColumnCount>
+ <customColumn>false</customColumn>
+
+ <ColumnName>Rid</ColumnName>
+ <ColumnName>ID</ColumnName>
+ <ColumnName>SeqNumber</ColumnName>
+ <ColumnName>APIName</ColumnName>
+ <ColumnName>Time</ColumnName>
+
+ <ColumnName>Pid</ColumnName>
+ <ColumnName>Tid</ColumnName>
+ <ColumnName>InputParam</ColumnName>
+ <ColumnName>Return</ColumnName>
+ <ColumnName>PCAddr</ColumnName>
+
+ <ColumnName>Error</ColumnName>
+ <ColumnName>InternalCall</ColumnName>
+ <ColumnName>CallerPCAddr</ColumnName>
+ <!-- 14 -->
+ <ColumnName>ParentName</ColumnName>
+ <ColumnName>ParentClassName</ColumnName>
+
+ <ColumnName>ParentPointer</ColumnName>
+ <ColumnName>ChildName</ColumnName>
+ <ColumnName>ChildClassName</ColumnName>
+ <ColumnName>ChildPointer</ColumnName>
+ <ColumnName>Reserved</ColumnName>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER PRIMARY KEY NOT NULL</type>
+ <type>TEXT</type>
+ <type>INTEGER</type>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <!-- 14 -->
+ <type>TEXT</type>
+ <type>TEXT</type>
+
+ <type>INTEGER</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+ <type>INTEGER</type>
+ <type>TEXT</type>
+
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+
+
+ <ColumnOrder>0</ColumnOrder>
+ <ColumnOrder>1</ColumnOrder>
+ <ColumnOrder>2</ColumnOrder>
+ <ColumnOrder>3</ColumnOrder>
+ <ColumnOrder>4</ColumnOrder>
+
+ <ColumnOrder>5</ColumnOrder>
+ <ColumnOrder>6</ColumnOrder>
+ <ColumnOrder>7</ColumnOrder>
+ <ColumnOrder>8</ColumnOrder>
+ <ColumnOrder>9</ColumnOrder>
+
+ <ColumnOrder>10</ColumnOrder>
+ <ColumnOrder>11</ColumnOrder>
+ <ColumnOrder>12</ColumnOrder>
+ <ColumnOrder>13</ColumnOrder>
+ <ColumnOrder>14</ColumnOrder>
+
+ <ColumnOrder>15</ColumnOrder>
+ <ColumnOrder>16</ColumnOrder>
+ <ColumnOrder>17</ColumnOrder>
+ <ColumnOrder>18</ColumnOrder>
+ <ColumnOrder>19</ColumnOrder>
+
+
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+
+
+ <TableColumnName>Row Id</TableColumnName>
+ <TableColumnName>ID</TableColumnName>
+ <TableColumnName>#</TableColumnName>
+ <TableColumnName>API name</TableColumnName>
+ <TableColumnName>Time</TableColumnName>
+
+ <TableColumnName>Process id</TableColumnName>
+ <TableColumnName>Thread id</TableColumnName>
+ <TableColumnName>Input parm</TableColumnName>
+ <TableColumnName>Return</TableColumnName>
+ <TableColumnName>PC Addr</TableColumnName>
+
+ <TableColumnName>Errno</TableColumnName>
+ <TableColumnName>Internal Call</TableColumnName>
+ <TableColumnName>Call PC Address</TableColumnName>
+ <TableColumnName>Parent name</TableColumnName>
+ <TableColumnName>Parent Class name</TableColumnName>
+
+ <TableColumnName>Parent pointer</TableColumnName>
+ <TableColumnName>Child name</TableColumnName>
+ <TableColumnName>Child Class name</TableColumnName>
+ <TableColumnName>Child pointer</TableColumnName>
+ <TableColumnName>Reserved</TableColumnName>
+</BaseLogCenter>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<BaseLogCenter xmlns="org.tizen.dynamicanalyzer">
+ <id>3</id>
+ <name>ui_event</name>
+ <totalColumnCount>20</totalColumnCount>
+ <customColumn>false</customColumn>
+
+ <ColumnName>Rid</ColumnName>
+ <ColumnName>ID</ColumnName>
+ <ColumnName>SeqNumber</ColumnName>
+ <ColumnName>APIName</ColumnName>
+ <ColumnName>Time</ColumnName>
+
+ <ColumnName>Pid</ColumnName>
+ <ColumnName>Tid</ColumnName>
+ <ColumnName>InputParam</ColumnName>
+ <ColumnName>Return</ColumnName>
+ <ColumnName>PCAddr</ColumnName>
+ <!-- 10 -->
+ <ColumnName>Error</ColumnName>
+ <ColumnName>InternalCall</ColumnName>
+ <ColumnName>CallerPCAddr</ColumnName>
+ <ColumnName>EventType</ColumnName>
+ <ColumnName>DetailType</ColumnName>
+
+ <ColumnName>x</ColumnName>
+ <ColumnName>y</ColumnName>
+ <ColumnName>info1</ColumnName>
+ <ColumnName>info2</ColumnName>
+ <ColumnName>Reserved</ColumnName>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER PRIMARY KEY NOT NULL</type>
+ <type>TEXT</type>
+ <type>INTEGER</type>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>TEXT</type>
+
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+
+
+ <ColumnOrder>0</ColumnOrder>
+ <ColumnOrder>1</ColumnOrder>
+ <ColumnOrder>2</ColumnOrder>
+ <ColumnOrder>3</ColumnOrder>
+ <ColumnOrder>4</ColumnOrder>
+
+ <ColumnOrder>5</ColumnOrder>
+ <ColumnOrder>6</ColumnOrder>
+ <ColumnOrder>7</ColumnOrder>
+ <ColumnOrder>8</ColumnOrder>
+ <ColumnOrder>9</ColumnOrder>
+
+ <ColumnOrder>10</ColumnOrder>
+ <ColumnOrder>11</ColumnOrder>
+ <ColumnOrder>12</ColumnOrder>
+ <ColumnOrder>13</ColumnOrder>
+ <ColumnOrder>14</ColumnOrder>
+
+ <ColumnOrder>15</ColumnOrder>
+ <ColumnOrder>16</ColumnOrder>
+ <ColumnOrder>17</ColumnOrder>
+ <ColumnOrder>18</ColumnOrder>
+ <ColumnOrder>19</ColumnOrder>
+
+
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+ <ColumnVisibility>false</ColumnVisibility>
+
+
+ <TableColumnName>Row Id</TableColumnName>
+ <TableColumnName>ID</TableColumnName>
+ <TableColumnName>#</TableColumnName>
+ <TableColumnName>API name</TableColumnName>
+ <TableColumnName>Time</TableColumnName>
+
+ <TableColumnName>Process id</TableColumnName>
+ <TableColumnName>Thread id</TableColumnName>
+ <TableColumnName>Input parm</TableColumnName>
+ <TableColumnName>Return</TableColumnName>
+ <TableColumnName>PC Addr</TableColumnName>
+
+ <TableColumnName>Errno</TableColumnName>
+ <TableColumnName>Internal Call</TableColumnName>
+ <TableColumnName>Call PC Address</TableColumnName>
+ <TableColumnName>Event type</TableColumnName>
+ <TableColumnName>Detail type</TableColumnName>
+
+ <TableColumnName>X</TableColumnName>
+ <TableColumnName>Y</TableColumnName>
+ <TableColumnName>Info1</TableColumnName>
+ <TableColumnName>Info2</TableColumnName>
+ <TableColumnName>Reserved</TableColumnName>
+</BaseLogCenter>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<BaseLogCenter xmlns="org.tizen.dynamicanalyzer">
+ <id>4</id>
+ <name>user_function</name>
+ <totalColumnCount>18</totalColumnCount>
+ <customColumn>false</customColumn>
+
+ <ColumnName>Rid</ColumnName>
+ <ColumnName>ID</ColumnName>
+ <ColumnName>SeqNumber</ColumnName>
+ <ColumnName>APIName</ColumnName>
+ <ColumnName>Time</ColumnName>
+
+ <ColumnName>Pid</ColumnName>
+ <ColumnName>Tid</ColumnName>
+ <ColumnName>InputParam</ColumnName>
+ <ColumnName>Return</ColumnName>
+ <ColumnName>PCAddr</ColumnName>
+ <!-- 10 -->
+ <ColumnName>Error</ColumnName>
+ <ColumnName>InternalCall</ColumnName>
+ <ColumnName>CallerPCAddr</ColumnName>
+ <ColumnName>BinaryRangeStart</ColumnName>
+ <ColumnName>BinaryRangeEnd</ColumnName>
+
+ <ColumnName>Type</ColumnName>
+ <ColumnName>ElapsedTime</ColumnName>
+ <ColumnName>Reserved</ColumnName>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER PRIMARY KEY NOT NULL</type>
+ <type>TEXT</type>
+ <type>INTEGER</type>
+
+ <type>INTEGER</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+ <type>TEXT</type>
+
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+ <type>INTEGER</type>
+
+ <type>TEXT</type>
+ <type>INTEGER</type>
+ <type>TEXT</type>
+
+ <ColumnSize>100</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+ <ColumnSize>80</ColumnSize>
+ <ColumnSize>0</ColumnSize>
+
+
+ <ColumnOrder>2</ColumnOrder>
+ <ColumnOrder>4</ColumnOrder>
+ <ColumnOrder>3</ColumnOrder>
+ <ColumnOrder>8</ColumnOrder>
+ <ColumnOrder>0</ColumnOrder>
+
+ <ColumnOrder>1</ColumnOrder>
+ <ColumnOrder>5</ColumnOrder>
+ <ColumnOrder>6</ColumnOrder>
+ <ColumnOrder>7</ColumnOrder>
+ <ColumnOrder>9</ColumnOrder>
+
+ <ColumnOrder>10</ColumnOrder>
+ <ColumnOrder>11</ColumnOrder>
+ <ColumnOrder>12</ColumnOrder>
+ <ColumnOrder>13</ColumnOrder>
+ <ColumnOrder>14</ColumnOrder>
+
+ <ColumnOrder>13</ColumnOrder>
+ <ColumnOrder>14</ColumnOrder>
+ <ColumnOrder>15</ColumnOrder>
+
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+ <ColumnVisibility>true</ColumnVisibility>
+
+ <TableColumnName>Row Id</TableColumnName>
+ <TableColumnName>ID</TableColumnName>
+ <TableColumnName>#</TableColumnName>
+ <TableColumnName>API name</TableColumnName>
+ <TableColumnName>Time</TableColumnName>
+
+ <TableColumnName>Process id</TableColumnName>
+ <TableColumnName>Thread id</TableColumnName>
+ <TableColumnName>Input parm</TableColumnName>
+ <TableColumnName>Return</TableColumnName>
+ <TableColumnName>PC Addr</TableColumnName>
+
+ <TableColumnName>Errno</TableColumnName>
+ <TableColumnName>Internal Call</TableColumnName>
+ <TableColumnName>CallerPCAddr</TableColumnName>
+ <TableColumnName>Binary Range Start</TableColumnName>
+ <TableColumnName>Binary Range End</TableColumnName>
+
+ <TableColumnName>Type</TableColumnName>
+ <TableColumnName>ElapsedTime</TableColumnName>
+ <TableColumnName>Reserved</TableColumnName>
+
+</BaseLogCenter>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?pde version="3.5"?>
+
+<product name="%DynamicAnalyzer" uid="org.tizen.dynamicanalyzer.workbench.product" id="org.tizen.dynamicanalyzer.workbench.product" application="org.tizen.dynamicanalyzer.workbench.application" version="1.0.0.qualifier" useFeatures="true" includeLaunchers="false">
+
+ <configIni use="default">
+ </configIni>
+
+ <launcherArgs>
+ <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
+ <vmArgsWin>-XX:MaxHeapFreeRatio=70
+-XX:MinHeapFreeRatio=40
+-Xms16m
+-Xmx512m</vmArgsWin>
+ </launcherArgs>
+
+ <windowImages i16="/org.tizen.dynamicanalyzer.workbench/icons/16_DA_icon.png" i32="/org.tizen.dynamicanalyzer.workbench/icons/32_DA_icon.png" i48="/org.tizen.dynamicanalyzer.workbench/icons/48_DA_icon.png" i64="/org.tizen.dynamicanalyzer.workbench/icons/64_DA_icon.png" i128="/org.tizen.dynamicanalyzer.workbench/icons/128_DA_icon.png"/>
+
+ <launcher name="dynamic-analyzer">
+ <linux icon="/org.tizen.dynamicanalyzer.workbench/icons/linux_icon.xpm"/>
+ <macosx icon="/org.tizen.dynamicanalyzer.workbench/icons/DA_icon.icns"/>
+ <solaris/>
+ <win useIco="true">
+ <ico path="/org.tizen.dynamicanalyzer.workbench.feature/rootfiles/resources/icons/tizen-sdk-dynamicanalyzer.ico"/>
+ <bmp/>
+ </win>
+ </launcher>
+
+ <vm>
+ <windows include="true">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6</windows>
+ </vm>
+
+ <plugins>
+ </plugins>
+
+ <features>
+ <feature id="org.eclipse.rcp"/>
+ <feature id="org.tizen.dynamicanalyzer.workbench.feature"/>
+ </features>
+
+ <configurations>
+ <plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
+ <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
+ <plugin id="org.eclipse.osgi" autoStart="true" startLevel="-1" />
+ </configurations>
+
+</product>
--- /dev/null
+/* XPM */
+static char *splash[] = {
+/* columns rows colors chars-per-pixel */
+"480 480 14 1",
+" c #05060C",
+". c #0F233A",
+"X c #2F4050",
+"o c #104064",
+"O c #0F537E",
+"+ c #35546B",
+"@ c #106695",
+"# c #31698F",
+"$ c #2379A7",
+"% c #496B83",
+"& c #4E7D9E",
+"* c #5090B9",
+"= c #6F93AB",
+"- c #6CA6CB",
+/* pixels */
+" ",
+" . . . . . . . . . . ",
+" . . . . . . . . . . . . ",
+" . . . . . . . . ",
+" . . . . . . . . ",
+" . . . . . . . . . . . . . ",
+" . . . . . . . ",
+" . . . . . . . . . . . ",
+" . . . . . ",
+" . . . . . . . . . . . . ",
+" . . . . . . . . ",
+" . . . . . . . . . ",
+" . . . . . ",
+" . . . . . . . . . . . . ",
+" . . . . . . . . . ",
+" . . . . . . . ",
+" . . . . . . ",
+" . . . . . . ",
+" . . . . . . . . ",
+" . . . ",
+" . . . . . . . . ",
+" . . ",
+" . . . . . . ",
+" . . . ",
+" . . . . . . ",
+" . . ",
+" . . . . . ",
+" . ",
+" . . . . . ",
+" . . ",
+" ",
+" . . . . ",
+" ",
+" . . . ",
+" . . . . . . ",
+" ",
+" . . . . . . ",
+" . . . . . ",
+" ",
+" . . . . . . . ",
+" . . . . . ",
+" . . . . ",
+" . . . . ",
+" . . . . . . . ",
+" . . ",
+" . . . . . . . . ",
+" . . . . . . ",
+" . . . . . ",
+" . . . . . ",
+" . . . . . . . . ",
+" . . . . . ",
+" . . . . . ",
+" . . . . . . ",
+" . . . . ",
+" . . ",
+" . . . ",
+" . . . ",
+" . . . . . ",
+" . . ",
+" . . . . . . ",
+" . . . . . ",
+" . . . . . . . . . . ",
+" . . . . . . . . . ",
+" . . . . . . . ",
+" . . . . . . . . . . ",
+" . . . . . . . . ",
+" . . . . . . . . . . ",
+" . . . . . . . ",
+" . . . . . . . . . . ",
+" . . . . . . . . . . . . . . ",
+" . . . . . . . . . . . ",
+" . . . . . . . . . . ",
+" . . . . . . . . . . . . . . . . . . . ",
+" . . . . . . . . . . . . . ",
+" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
+" . . . . . . . . . . . . . . . . . . . . .. . . . . . . . .. ... . . . .. . . . . . . . . . ",
+" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ... ... . . . . . . . . . . . . ",
+" . . . . . . . . . . . . . . . . . . . . .. .. ............... . .. .. .. .. . . . . . . . . . . . . ",
+" . . . . . . . . . . . . . . . . . . .. ... .. ....... .. ... ................... ... . . . . . . . ",
+" . . . . . . . . . . . . . . . . . . . .. ... ........ .......................... ..... . .. . . . . . ",
+" . . . . . . . . . . . . . . . . . . .. .................................................. . . . . . . . ",
+" . . . . . . . . . . . . . . . . . . . . .....................X..X.X.X.X.X.X.X.................... . . . . . . ",
+" . . . . . . . . . . . . . . . . . . .............X..X.X.X.X.X.X.X.X.X.X.X.X.XXX.X.X.X....... ..... . . . ",
+" . . . . . . . . . . . . . . . . . . .... .........X..XX.XX.XX.XX.XX.XX.XX.XX.XX.X.XX.X.X.X........ ... .. . . . . ",
+" . . . . . . . . . . . . . . . . . ........X.X.X.X.X.XX.XXXXXXXXXXXXXXXXXXXXXXXXXXX.X.X.X.......... . . . ",
+" . . . . . . . . . . . . . . . . .........X..X.XX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XX.XX.X..X.X..... ... . . . ",
+" . . . . . . . . . . . . . . . . . . .. .....X..XX.XX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.X......... . . . . ",
+" . . . . . . . . . . . . . ..........XX.XXXXXXXXXXXXXXXXXXX+XX+XX+X+XXXXXXXXXXXXXXXX.XX.X.X..... .. . . ",
+" . . . . . . . . . . . . . . . . . .......X.X.X.XXXXXXXXXXXXX+X++++++++++++++++++++++++XXXXXXX.XX.X......... . . . . ",
+" . . . . . . . . . . . . . .......X.XXXXXXXXXXX+X+++++++++++++++++++++++++++++++XXXXXXXXX.X.X..... . . . ",
+" . . . . . . . . . . . . . . .......X.X.XXXXXXXX++++++++++++%++%+%+%+%+%+%+%++++++X+++XXXXXXX.X......... .. . ",
+" . . . . . . . . . . . . . . . . ........XX.XXXXXXXX+++++++++%+%+%+%+%+%%%%%+%+%+%+%%+%+%+++X+XXXXXXX.X.X... . . . . ",
+" . . . . . . . . . . . . ....X..XXXXXXXX+X+++++%+%+%+%%%%%%%%%%%%%%%%%%%%%%+%+%++++X+XXXXXX.X....... .. ",
+" . . . . . . . . . . . . . ........XXX.XXXX++++++%+%+%%+%%%%%%%%%%%%%%%%%%%%%%%%%%%+%+%+++XXXXXX.X.X.... .. . . . ",
+" . . . . . . . . . . . . . . . . . .....X.X.XXXXXX++++++%+%%+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%+%++++++XXXXXX.X..... . . . ",
+" . . . . . . . . . . . . . .....X.XXXXXXX+++++%+%+%%+%%%%%%%%%%%%%%&%%&%%%%%%%%%%%%%%+%%++++XXXXX.X.X..... . . . ",
+" . . . . . . . . . . . . . . . . . . .........X.XXXX++X++%++%%+%%%%%%%%%%%=%=&=%=&&&&=%=%&%%%%%%%%%+%++++XXXXXXX....... . . ",
+" . . . . . . . . . . .. . .....XXX.XXXX+X+++++%%%%%%%%%%&%=&=%&&%=%=%=%=%=%=%=%=%%%%%%%%++++++XXXX.X.X.... . . . ",
+" . . . . . . . . . . . . . . .........XXXXX+++++%%+%%%%%%%%=%=%=%=&==&=&=%=&=&=%=%=%=%=%%%%%%%%+++XXXXX.X......... . ",
+" . . . . . . . . . . . . . . .... ...XXXXXXXX+X+++%+%%%%%%%&&&%=%=%=&=%==========&=&=%=%&%&%%%%%+++++X+XXXX.X..... . . . . ",
+" . . . . . . . . . . . . . . . . . . . . . ....X...XXXXX++++%+%%%%%%%&%=%=%=&=&====&===&==&====&=%=%=%=%%%%%%++++XXXXXX.X...... . . ",
+" . . . . . . . . . . . . . ....X.XXXXXXX++++%+%%%%%%=%=%&=%=&===&================&=&=%=%&%%%%%+%+++XXXX.X...... . . . . ",
+" . . . . . . . . . . . . . . .........X.XXX+X+++%+%%%%%&%&%=&&=&==&=================&===&=%=%=%%%%%+++++XXXXX.X...... . . ",
+" . . . . . . . . . . . . . . . . . . . .....X.X.XXXX++++%+%%%%%=%=%=&==&========================&==&&&%&%%%+%+++X+XXX.X...... . . . . . ",
+" . . . . . . . . . . . . . . . ........X.XXXXXXX++++%%%%%%%%=%=&=&=&=========================&=%=&&%%%%%%+++XXXXX.XX....... . . . . ",
+" . . . . . . . . . . . . . . . . . . . ....X.X.XXXX++++%%+%%%&&=%=&&=&=============================&=%&%&%%%+%++++XXXXX...X...... . . . ",
+" . . . . . . . . . . . . . . . ......X...XXXX+X++++%+%%%%&%%&&&=&============================&===&=&&%%%%%+++++XX.XXX...... .. . .. . . ",
+" . . . . . . . . . . . . . . . . . .. ......XX.XXXX++++%+%%%%%&&=&=&=&===============-==============&=%=%&%%%%%++++X+XXoX.X......... . . . . ",
+" . . . . . . . . . . . . . . . . .. . ........X.X.XXXX++++++%%%%&%&&%&&=&==&=========-=-=-=--=-===========&=&&&%%%%%%++++XoXXX..X...... . .. . . .",
+" . . . . . . . . . . . . . . . . . ... ......X..XXXXXX+++%+%%%%%%&&=&=&============-=-=-=-=-=-=-=========&=%=%&&%%%+++++X+XXo.XX.......... .. . .. ",
+" . . . . . . . . . . . . .. . .........X.oXoX+X+++%+%%%%%&&%&&=&=&=======-=-==-=-=-=-=-==-========&=&&&%%%%%+%+++XXoXX.X.X..... ... .. .. .",
+" . . . . . . . . .. .. . . . .........XX.XXXXXX+++++%%%%%%=%=&==&============-=-=---=--=-=-=-======&=&=%=%%%%%%++++X+XXoX.o..X........... .. ",
+" . . . . . . . . . . .. ... .....X..X.XoX+X+++++%+%%%%%&&&&&=&========-=-=-=-=-=--=--=-=-=========%=%&%%%%+%+++X+XXXoX.Xo................",
+" . . . . . . . . . . . . . . .. ..........X.oXoXoXXo++++%%%%%%%&&&&=&=&==&=========--=-=-=-=-=-=-==-=====&&=&&%&%%%%%+++++X+oXXXoX.X.X.............",
+" . . . . . . . . . . . . .. ..........X..X.X.XXX+X+++++%+%%%&%&%=%=&=&========-=-==-=--=--=-=-==-========&=&&&&%%%%%%+++++XXXoX.X.o.X.o..........",
+" . . . . . . . . . . . .. .. ..........o.XoXoXoX+++++%+%%%%%%&&&&=&=&===========-=-=-=--=--=-=-=-======&=&&&&%%%%%+%++%+X+XoXXoXoXX.o.X.o........",
+" . . . . . . . . . . . . .. . .........o.X.oX.XXoXX+X++++%+%%%%&%&&=%=&===========-==--=-=-=-=-=-=-=-========&=&&&&%%%%+%+++++XoXXXX.oXX.o.X.o.o..o.",
+" . . . . . . . . . .. . .............X.Xo.XoXX++++++%+%%%%%&&&&&&=&=&========-==-=-=-=-=-=-=-=========&=&&=%&&%%%%%%%+++++X+XXoXoXXoXoX.oX.Xo.o.o",
+" . . . . . . . . . . . . ..... ........Xo.XoXXoXXo+X+++++%+%%%%%&%&&&&=&==&=======-=-=-==-=--=-=-=-=-=-=======&=&&&&%%%+%+%++++++X+XXoXoX.XoX.oo.X.X.",
+" . . . . . . . . . . .. ... .........oX.o.Xo.XoX+o+X++++%%+%%%%%&&&&=&=&=&============-=-=-===-=-=-========&=&&=%&&&%&%%%%%+%++++o+XoXXoXoXoXoXo.Xoooo",
+" . . . . . . .. ..........X..X.XoXXoXoX+++++++++%%%%%%&%&&&&&=&==&======-=-=-==-==--=-=-===-=-====&==&=&&&&%%%%+%#+++++++X++XoXXXoXoXoXoXoXo",
+" . . . . . . . . . . . ..... ....o..oXoXoXoXXX++o++++%+%%+%%%&%&&&&=&=&=&===&=========-==-===-===-=-====*===&=&&&&%&%&%%%%+%+#+++O+o+X+oXoXoXoXoXoXoX",
+" . . . . . . . . . . . . .... ......o..X.o.X.oXoXo+o++++++++%+%%%%%&&&&&&&=&=&=&=========-==-==-=-==-======*==*=&=&=&&&&&%%%%%#%+#+++++++++o++o+XoXoXoXoXo",
+" . . . . ... . .........X.XoXoXoXoXX+o+++o++#+%%%%%%%&%&&&&&=&&==&==*==*==============-========*==&==&&&=%&%&%%%%%+%%+#+++++o++OX+o+XOX+oXoXo",
+" . . . . . . . . . .........o..o..X.XoXXo+o+X+++#++#%+%%%%&%&&&&&&&=&=&=&==*=======-==-==-========*=*==*=&=&=&&&&&%&%%#%#%#+%+#++++O+++O++o++o+XO++",
+" . . . . . . . . .. .. .....o.X.X.XXoXoXoX+X++O+++++%+%%%%%%%&%&&&&=&=&=&==&==*=*=================*=*=*=&=&=&=&&&&&&%&%%%%%%+%+%+++++++O++o++OXO+++o+",
+" . . . . . . . . ..........X..oXo.oXoX+o++o++++#+#+%#%#%%%&%&&&&&&&&=&==&==&========*=*=*=*===*=*==*==*==&=&=&&&&%&%&%%%#%#%#%+%#+#++++++O++++++O++",
+" . . . . . . . . . .. .......o..oX.oXXXoX+o++O++++#+%+%#%%%%%&%&&&&&=&=&=&&=&=&=*=****=*==*==*==*=*==*=&=&=&*&=&&&&&&&&%&%&%%%#%+##+#+++#++O+++O+O+O+++",
+" . . . . . . .. .......o.XoXooXo+o++X+++#+++#%+#%#%%%&%&%&&&&&&=&&=&==&==&======*==*==*=*=*=*=*=*=&==&=&&=&&&%&&%&#%#%#%#%#%+###++#+#++#+++++++",
+" . . . . . . . . . .. ........oo.Xo.XoXoXXOX+O+++++#+#%#%%#%%%&%&&&&&&&&&&=&=&=&=&==&=&=*=*=*=*==*=*=*=&=&=&=&&=&&&&&&&&&%&%&%#%%#%#+##+#+#+#++#++#+#+#+O",
+" . . . . . . . . . . . .. .........o.XooXo+o++X+O++#+#+#%+#%%%%%%&%&%&&&&&=&&=&=&==&=&=&=&=*=*==*=*=*=&=&=*=&=*&=&&=&&&&&%&&%&#&%%#%#%#%#%#%+#+%#++#+#+#++#",
+" . . . . . . . . . . . . . . ........o.XX.XoXXoXX+o+++++++#+%#%#%%#%&%&%&&&&&&&&&&=&&=&&=&=&=*=&=&=&=&=&=&=&=*=&=&=&&=&&=&&&&&&&&%&&%#&#%%#%#%+#%+%#%+##%+%+#+##+",
+" . . . . . . . . . . . . . . . . . .. ......X.o.oXoXoXOXO++O++++#+#+#%%#%%%%&%&%&&&&&&&=&&=&&*=&=&=&=&=*=&=*=*=&=*=&=&&=&*&=&*&&&&&&&&&&&&#&&%%&#%%#%#%##%+##+%+##%+#%+#",
+" . . . . . . . . . . . . . . . . . . . . . . . . .. ........oX.XoXoXX++X+++++##+%#%%#%%%$%&%&%&&&&&&&&&&=&&=&=&*=&=&=&=&=&*&=&**&*=&*=&*=&&*&=&&=&&&&&%&%&%&#&#%#%#%#%#%#%%%##%#+%#%+#%",
+" . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . ..........X.ooXoXoXOXO+O+++++#+%##%%#%&%%&%&&&%&&&&&=&&&&=&=&=&*&=*&=&*=&=&=&==&&=&&=&&=&=&&&&&&&&&&&&&&#&%&#&%&#%%#%#%%#%+%#%#%#%#%#",
+" . . . . . . . . . . . .. .. ... . . .. . . . . . . . . . . . . . . . . . . ... .......o.oXo.XXo+X++++++#+##%#%#%#%%&%%&%&&%&&&&&&&&&=&&&&&&=&=&&=&&=&*=&*&=&&*&&*&&&*&&&&&=&&&&&%&%&%&&%&#&#%#&#%&#%#%#%#%#%#%#%#%#",
+" . . . . . . . .. . .. . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . ........o.o.XXooXo+o+O+++++%+#+%#%%#%#%$%&%&&&&&&&&=&&&&=&=&=&&&=&&=*&=&&&=*&*&=&=&*&=&&=&&&&&&&&&&&&%&&#&#&%&#&%#&#%%%#%#%%#%#%#%#%#",
+" . . . . . . . . . . . . .. .. ... ................. .. .. . . . . .. . .. . . . . . . . . . . . . . . . . . . ... .......X.XooXXo+o+++++##+##%##%#%&#&%&%&%&%&&&&&&&&&&&&&&&&*=&&*&&&&*&*&&&&&&&&&&&&&&&&&&&&&&&&&%&&$&%&&%&#&%#&#%#&##&#%#%#%#%#%#%#",
+" . . . . . . . . . . .. ..... ....... ....... . ..... .... .... . . . . . . . . . . . . . . . . . . . . . .. ......o.o.o.oXooX+o+O+O+++#+%+%#%#%#%%&%%&&%&&&%&&&&&&=&*&&=&&&&&&=&=&&&&&*&&=*&*&&&*&&&&&&&&&&&&&&&%&#&&#&&#&#&#&#&#&%#&#&#&#%#%#%#%",
+" . . . . . . . . . . ..... .......... .......................... .... .. . . . . . . . . . . . . . . . . . . . .........Xo.XXoXXOX+++++#+#+##%#%#%%#&#%$&%&&%&&&&&&&&&&&&&&&&&&=&&&&&&*=&&&&*&&&&&&&&&&&&&&&&&&&%&&#&&&%$&#&&#&%&#&#%&#&#%#%#&#&#&#&#",
+" . . . . . . . .. . ... .......................................... ... ....... . .. . . . . . . . . . . . . . . ... .....o.o.XooXoXo+o+O+++#+%#%#%#%%$%&%&%%&%&%&&%&&%&&&&&&&&&&&&&&&&&&&&&&*&&&&&&&&&&&&&&&&&&&&%&&#&&&&#&%&&#&%&#&%&#&#&#%&#&%#&#%#&#%",
+" . . . . . . . . . . .. .......................X..X...X.X.X.X.X..X......X....... . . .. . . . . . . . . . . . . . . . . . . . . . .. .........o.X.oXoX+o+++++#+#+#%+#%#%#%%#&%&%$%&&%&&&%&&&%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&#&%&&&%&&#&#&#&#&#&%&&#&#&#&%&&#&&",
+" . . . . . . . . . .. .... ........X..X..X.X.X..X..X..X.X.X..X.X.X.X.X..X........... .. . . . . . . . . . . . . . . .. ........o.ooXoXOX+o+O++#+#+#%#%#%&#&%&#&%&&%&&&%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%&&#&#&$%&&#&#&#&#&&#&&#&%&#&##&#&#&#&##&%#",
+" . . . . . . . . . . .. .... ......X..X..X.X.X.X.XXX.XXXXX.XX.XXX.XXX.X.X.XX.X.X.X........ . . . . . . . . . . . . . . . . . . . . . . .........o.oXoXoXoXo+o+++#++##%#%#%#%#&%$%&#&%&%&%&&%&%&%&&%&&&&&&&&&&&&&&&&&&&&&%&&%&&%&#&#&$&#&&&%&%&#&&#&&&#&&%&#&&#&&&&&&#&&#&&#&&#&&",
+" . . . . . . .. .............X..X..X.X.X.XXX.X.XX.X.XXXXXXXXXXXXXXXXXX.X.X.X..X......... . . . . . . . . . . . . . . .. .. . .......o..o.oXoXOX+O++++#+#+%#%#%#%%%&%$%&#&$&#&%&&%&&%&&&&%&&%&&%&&&%&&%&%&%&&%&&$%&$&&%&%&&#&#&#&#&&#&&#%&#&#&&%&&#&##&#&&#&&#&%$&#&",
+" . . . . . . . . . . . .. .........X.X.X.X.X.X.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.X.X..X......... . . . . . . . . . . . . . . . . . . . . . . ........o..oo.XooXo+X+++O#+#%#%###%%%$&#&%&%$&%&&%&$&%&#&&&%&%&&%&%&&%%&&#&&#&#&#&#&#&%&%%#$&#%$%&$&%$&%#&&#&&#&&#&#&#&&&&&#&$&#&#&$&&#&$",
+" . . . . . . . .. .........X....X.X.X.XXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.X.X.... ... . . . . . . . . . . . . . . . . . . . . . . . ... .......o.XooXoXoXo+O++#++#+#+%#%#%%%&#&#&%#&%&$%&#&#&%&#&#&%&$&#&#&#&$%&#&%&#&#&#&%&#&#&%%#&%$%%#&&%$&#&#&#&&#&#&$&&&#&#&&&#&&&&&#&&%&",
+" . . . . . . . .. ............X.X.X.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.X.X....... .. . . . . . . . . . . . . . . . . . ... . ......o..o.o.oXo+++o++++#+#%#%#%#%#&#%%$%&#&#&#&%&%&#&#&&#&#&#&%&#&%&#%&#&#&#&#%&#%#$%%$&#&#&#&%$%##&%&#&#&&#&&#&%&#&#&&$&#&&#&#&#&&#&&",
+" . . . . . . .. .. .... .....X.X.X.XX.XXXXXXXXXXXXXXXXXXX+X+++++++++++++++X+X+XXXXXXXXXXX.X.X....... .. . . . . . . . . . . . . . . . . . . . . . . . . . ...........o.oooXoXoXO+++++#+#+%#%#%&#%#&#&%#&%&#&#&#&#&#&#%#&%&#&%#&#&#&#&%$%%$%#&#%$%%&$%#%#&#%##%#&#&##&%$%#&#&&#&&#&&&#&&&#&&$&&&$&&#&",
+" . . . . . . . . . . . . . . .. ..........X..X.XXXXXXXXXXXXXXXXX+X+++++++++++++++++++++++++++++X+XXXXXXXXXX.X....... . . . . . . . . . . . . . . . . . . . . .. . ......o.o.ooXooXo+O++O+#++####%#%##&#%$%%$&##%&#%#&#&#%#&#&##&#%$%#%#%#%#%%#&#%#%#&#%##%#&####&#&####&#&##&#&#&#&&#&&#&#&&#&&$&&#&&&&$&&",
+" . . . . . ... .. ......X...X.X.X.XXXXXXXXXXX++X++X+X+++++++++++++++++++++++++++X+XXXXXXXXX.X.X...... . . . . . . . . . . . . . . . . . . . . . . . . .. ............o.o.oXoXo+XO++#+#++%#%#%#%%#&%$%&#%&$%#&#&#%#&#&#&#&#&##&#&##&#&$###%$%###%##%###########%#&###&##&#&#&#&#&%$&&$&&$&&#&&&$&#&&&",
+" . . . . .. .. ............X.X.XXXXXXXXXXXXX+++X++++++%+++%+%+%+%%+%%%%+%+%+%++++%++++XXXXXXXX.X..... .. . . . . . . . . . . . . . . . . . . . . . . . ... .......o.o.ooXooXOXO+++++#+###+%#%#&#%#%%&#&#%#&#&#%#&##&####%###%###%###%#%&###%##########%#####&#$%##&##&#&#$&#&$&$&&#&&#&&&$&&$&&&&$&$",
+" . . . . . . . . .. .. .......X.X.X.XXXXXXXXXXXXX+X++++++++%++%++%+%+%%+%+%+%+%%+%+%+%++++++++XXXXXX.X.X....... . . . . . . . . . . . . . . . . . . . . . . . . .. . ..........o.o.o.oXo+o++O+O#++#+#%##%##%#&##&#&#&#&#%#&##&%##%#%#%#%##%##%#%#####%#####%########&####%###&###&##&%#&#&#&#&&$&&$&#&$&&&&$&&&&",
+" . . . . . . . ... .........X..X.XXX.XXXXXXXX++++++++++%+%%+%%+%%%%%%%%%%%%%%%%%%%%%%%%%+%++++XXXXXXXX.X..... .. . . . . . . . . . . . . . . . . . . . . . .. .. ......o..o.ooXooXo+o+++++##+%##%#%#&#&#%#&##&###&#$##&##############################################&###&##&#$#&#&#&&&#&&#&&&&&&&$&&&&$&&",
+" . . . . . .... ....X..X.X.X.XXXXXXXXX+X+X+++++%+%+%+%%+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%+++++XXXXXXXX.X..... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. ..........o.o.oooXo+o+O+O#+#+###%##&###%##&#&##&#&##%%######&###################+#+#+#+#+#+##################$%#&#&$&#&#&&$&&$&$&$&&&&$&&&&",
+" . . . . . . . . ... ..........X.X.XXXXXXXXXX++X++++++%+%+%+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%+%+%++++XXXXX..X..... .. . . . . . . . . . . . . . . . . . . . . . .. .. ..........o.o.ooXoooo+o++O++#+##+%#%##%#&#&##&##&####&##&##%###############+##+#+######+###+##+##+########&##&##&#&#&#&$&$&&#&$&#&&&$&$&&&$&$",
+" . . . . . . . . ..........X.X.XX.XXXXXXX+X++++++%+%+%+%%%%%%%%%%%%%%%%%%%&%&%&%&%%%%%%%%%%%++++X+XXXXXX.X...... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .............o.o.o.oXXo+o+O++++#+###%##%#%###&##&####&#####################+##+######+#O+@+@+@+#@+@################&#$#&#&&#&$&&&&&&$&&&&&$&&&&",
+" . . . . . . .. ... .....X.X.X.X.XXXXXXXX+X+++++%+%+%+%%%%%%%%%%%%%=%=%=%=%=%=%=%=%=%&%%%%%%%%+%+++XXXXXX.X....... . . . . . . . . . . . . . . . . . . . . . . . . . . .. ... ..........o.o.oooooo+o+O++O#+#+#%##%#%#&#&##%##&#&####%###%######+##+#+######+@+#O+@+##+#+##O###+#O#+##########&##&#&$&#&&&#&$&$&$&&$&&$&&$&&",
+" . . . . . . . .. ..........X.XXXXXXXXXXX++++++%+%+%%%%%%%%%%%%%&%=%%%=%=%=%=%=%=%=%&&%=%%%%%%%+%++++XXXXXX.X..... .. . . . . . . . . . . . . . . . . . . . . . . . . .. .. ...........o..o.ooXoXoo+o+O+++#+#+##%##&###%#&$#&######&#########+###+####+#+@+@+#O#+#O#O#O#O#+#O#O##+#@+#############&#&$&#$&&&$&&&&&&$&&&&*$&",
+" . . .. ... .......X.XX.X.XXXXXXXX++++++++%++%+%%%%%%%%%=%=%=%&==%=%=%=&==%=%=%=%=%%=%%%%%%%++++X+XXXX.X..... . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . .. .. ... ..........o.o.ooooXOXO+++O+#+###%##%##%#&#&#%&##&#%#####%####+###+##+O#O#O+#+@+@+@+O#+O#+O+O#O+O#+O#O##O#######$#&$&#&#&#&&&$&&$&$&$&*&$*&&&&",
+" . . . . . . . ...........X.XX.XXXXX+X+X+++++%+%+%%%%%%%%%=%%%%&%=%=%=======%========%==%%=%%%%%%%++++XXXXXX...... .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . ... ...........o.o.ooooXooo+OO++O+#+#+##%#%##&#%$%##&####&#%########+##+#O##+#O+#O#O#+#+O#+O#+O#O#O#+#O##O#+##+######%####&#&#&$&#&$&&$&&&&$&&&$*$&",
+" . . . . .... .....X.X.X.XXXXXXXXX+X+++++%+%%%%%%%%%%%%%=&==%=%====%=%========%=%==%=%=%=%%%%%+%++X+XXXX.X...... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ... ............o..o.oo.oooo+OX++O+##+##%#%##%#%$#%#&####&##########+###+@#+#+O#+#O+O+#OOO#O+@+O#O+#O+OO+#O+#O#O#########&#&#$#&$&#&&&&$&&$&$*&&$*&&*&",
+" . . . . ..........X.XX.XXXXXX+X++++%++%%+%%%%%%%%=%=%=%=%==%=%====================%=%%%%%%+%++++XXXXXX.X...... . . . . . . . . . . . . . . . . . . . . . . . . .... ... ............o.o.ooooXo+o+O++O++##+###%##&#%#&##&#&%##%##%######+#O#++@+@+#O+O#+#O+#+O#O+@+O#O+O#+#O+O#O#+#O#+####&####&#&#&#&$&$&&$&&&&&$&&$&&$&",
+" . . . . . . . . . ..........X.X.X.X.XXXXXXX+X++++++%%+%%%%%%%%=%%=%=%=%==%=====================%==%=%&%%%%+%++X+XXX.X...... .. .. . . . . . . . . . . . . . . . . . . . . . . . . . .. . . .............o.o.o.oooooXoOo+O+O+#+##+#%#%#%##&#&#$%#############+#+##+#@#O+#+O#O#OO+O#O#+O+OO+O+O#O+OO#O#+O#O#+#@#######$#&$#&#&&&$&&$&&$&$&*&&&*$*&",
+" . . . . ..........X.XXXXXXXXXX++++%+%++%%%%%%%=%%%&%=%=%==%=======================%=%=%=%%%%%+++++XXXXXX.X..... . . . . . . . . . . . . . . . . . . . . . . . . . . . .. ..................o.ooo.oooo+o+O++#+#+#####%#&#&#&#&%#&#&#&#%#%###+####O#O+O#+O#O+O+++O#O+OO#O+#OO#O+OOO+O+O#O+#+@#+#+######&##&#$&$#&&$&&&$&&&&$*$&&&&",
+" . . . . .. ........X.X.X.X.XX.XXX++X++++++%+%%%%%%%%%%=%=%=%==%============================%=%%%%%%%++++XXXX.X........ . . . . . . . . . . . . . . . . . . . . . . . . . .. . .. ............o.o.o.o.oooXo+o+o+O+#O+##%#%#%##&##&##$%##############O#+#+##+O#O+O#+@O#O+O+O+OOOO+OO+O+#OO#O+O#OO#O##@######$##&#&#&&&$&&$&$&&$&$&&&&$*&",
+" . . . . . . ... ........X.X.XXXXXXXXX+X++++%+%+%%%%%%%%=%=%=%==%===========================%=%=%=&%%%%+%++++XXXXXX.... ... . . . . . . . . . . . . . . . . . . . . . . . . . . .. ... ................o.o.oooooo+oo+O++O#+#+#####&#&##&#&#&#&#&##&######+##O#O#O#O#+O#O+O+O+O#OO#O+O+O+O+OOOO+O+O#O+O#+#O+#O######%$#&$&#$&#&$&&&&$&&&&&$*&&&",
+" . . . . . . .....X.X..XX.X.XXXX++++++++%+%+%%%%%%&&%%=%=%==%===============================%=%%%%%%++++XXXX.X..X..... .. . . . . . . . . . . . . . . . . . . . . . . . . .. . . ..............o.o.o.oooooooXoO+O+O++#+###%#%##%##&#&#&$%$#&#&#########+##+#O+#O#O+#O#O+O+O+OOOO+OOO+OO+OOO+OOO+@+O#O########$##&#$#&#&$&&&$&$&&*$&$*&&$*$",
+" . . . . ...........X.X.XXXXXXXXX+X+++++%+%%%%%%%%%=&%=%=%================================%=&%=%%%%%%++++XXXXX.X...... .... . . . . . . . . . . . . . . . . . . . . . . . ...............o....o.o.o.oooXOoOXO++O#+##+####&#&#&#&$#&#&#&#$############O#O##O#O+#OO+OO+OOO+O+OOO+OOO+OO+OO#O+O#OO#O#O@+@######$##&#$&&#$&$&&$&$&&&&$&&&&",
+" . . . . . . .......X.X.X.X.XXXXX+X++++++%+%+%%%%%%&%%%=%=%==%===============================%=%%%%%%+++++X+XXX.X.X....... . . .. . . . . . . . . . . . . . . . . . . . . . .. . . ............o.o.o.oooooooo++O++O+#+#O###%#%#%#&#&#&&$&#$%&#&#&#####O#O##+#O+#O#O+O#O+#OO+O#OO+@+OO#OOO+OO+OOO#O+#O+############&#$&#&$&&#&&$&&&&$*&&&$*&",
+" . . . .............X.XXXXXXXX+X+X+++++%+%%%%%%%%=%=%=%=%==%============================%==%=&&%%%%+%++++XXXXXX..X........... . . . . . . . . . . . . . . . . . . . . .. .................o.o.oo.oooooXoOXO+O+#+@+##%####&#&#&$&#&#&#&$#&############O#O##O+O+@+O+OOO+OOO+OOOO+OOO+OO+OOO+O+OO#O#O#O#O#@##&#$##&#$&#&$&&$&&&$&&$&$*&&&",
+" . . . . . . ......X.X.X.X.XXXXXX+X++++%+%+%%%%%%%%&%%=%=%==%================================%=%&%%%%%%+++X+XXXX.X.X....... . . .. . . . . . . . . . . . . . . . . . . . . . . . .........o.o..o.oo.ooooXoo+O+O++O+#+##+##%%#&#&$&#&$&$&#&#&$#&#######+#O#+#O+#O#O#O#OO+OO#OOOO+OOOO+OOOOOO+OOOO#O+@+#O#######@#&#$&#&$&$&$&&$&$*&&&&&$&$*",
+" . . . . ............X.XXXXXXXX+X+X+++++%+%+%%%%%&%%=%%=%=%==%=============-=-=-==============%=&&%%%%%+++++XXXXX.X.X............ .. . . . . . . . . . . . . . . . . . . .. ................oo.o.oooooooo+o+O+O#+#+####%###&#&#&#&&#&&#&$&#&##$#########O#O#O#O#+O+OO#O+OO+O+OOO+OOOO+OO+OOO#O+OO#OO#O#O##@###$#&#$#$&$&$&&$&&&&&$*$&&*&&",
+" . . .. . .....X.X.X.X.X.XXXXX++++++++%+%%%%%%%%&%&&=%=%==%====================-==========%=%&%%%%%%+++++X+XXXX.X..X........ ... .. . . . . . . . . . . . . . . . . . . .. .. .......o.oo.ooooo.oooXOXOo++O+O+##+####%&#&#&&&$&#&$&$&#&$#&##&####O#O##O#O#O+O@O#O+OOOO+OOOO+OOO+OOOOOOO+OO+@O+O#O#O##O#######$#&$&#&&$&$&&$&$&&&&&$&&$",
+" . . . . . .........X.X.XXXXXXXX+XX+X++++%+%+%%%%%%%=%&%=%=%==================-=-==============&=%=%%%%%+%++++XXXXX.XX........... ... .. . . . . . . . . . . . . . . . ... .. ........o..o..o.o.oooooXoo+O+O+++#@+###%#####&$&#&#&&$&&#&#&#$&##########O#+#O#O#O+O+OO+O+OOO+OOOOOOOOO+O+OO+OOOO#O+O#+#O##@#$#$##$#&#$&$&#&&$&&&&$&$*&&*&",
+" . . . . ... .....X.X.X.X.XXXXXXX+++++++++%+%%%%%%&%%&%=%=&=&=%=============================&=%=%&%%%%%%%++++X+XoXXXo.XX.X......... ... .. . . . . . . . . . . . . . . . . ..............o.ooooooooXoOo+O+O++O#+#######&#&&&#&&$&&&$&#&$&$#&##$##$####O##O#O#+O#OO#OO#OOOO+OOO+O+OO+OOOOOOOOO+O+OO#O#O##########$&#$&#&$&$&$&&$&$*&&$&$&&",
+" . .. .. ..........X.XXX.XXXXX+X+X++++%+%%+%%%%%%&%=%=%=%=%================-==-=============&=&&&&%%%+%+%++++XXXXoXX..o.o.......... ... .. . . . . . . . . . . .. ........o.o.o.o.o.ooooooXO+o+O+O+#+#+###%##&#&$&&#&&$&&&&&&#&&$#&#&#######O##O#O#OO#+O@+O+O+OO+O+OOO+Oo+O+O+O+O#OOO#OO#O#O#O@#@######$%$&$&$&&&$&$*&&&$&&*$&",
+" . . . . . .......X.X.X.X.XXXXXX+X+X++++++%+%%%%%%%%%&%%&&&=%==%=============================&=&&&&%%&%%%%++++++X+oXXXoXo.X.o........... .. .. . . . . . . . . . . . . . . ... ...........o.o.oooooooXo+OoO+O++#+####%#%#&##&&#&&&&&&&$&$&#&$#&$###$#######O##+@+@+O@+OOO@+OO+OOOOXOoOOOOOOOOOOO+O#OO#O#O####@###$#&$&#&#&$&$#&&$&&$&$*&$&*&",
+" . . . . . ...........X.X.XXXoXXXX+X++++%+++%++%%%%%%&%%=%=%=%=&=&=&===========================&==&&&&%%%%%%+%+++++XXoXX.XXX.X.o.......... .. . . . . . . . . . . .........o.o.o.oo.ooooXOoOXO+O++O+O#+#######&#&$&&$&$&$&&&&&&$&&&#&#&######O###O#O#OO#O+O#O+OOOOO+O+OOO+O+o+O+O+OOOOOO+O#O#O#O@#####$####$&$%$&&$&&$&&$&&$&&$&",
+" . . . . . .. . .....X.X.X.X.XXXXXXXX+X++++++%+%%%%%%%%&%=%%&%=%=%==============================&=&&&&%&%%%%%+%+++++X+XXXoXo.oo.o..o.......... . . . . . . . . . . . . . . . .. ........o.o.oo.oooXooo+OO+O+O+######%#%&#&&&&#&&&&&&&&$&&$&#&$#&$#$########O#O#O+@+OO#O+OOO+O+OOOoO+oOoOOOOOOOO+@+@O#O#O##@###@#####&$&#$&#&$&$&$&&$&&$*&$*&",
+" . . . .. ..........X.XX.XoXoXXX+X++X++++++%++%%%%%%%%%%&&&%=%=&%=%=&=========================&=&=&&&&%%%%%+%%+++++X+XXoXXXX.X.X........ ..... . . . . . . . . . . ........o..o.oooooXooXO+oO+O+O+#++#+######&#&#&&&$&&&$&&&&&&&&&&$&#&#&####@##O#O#O#OO#+OOOO+OOOOOOO+OOOOO+OO+O+OOOOOOO#OO#O@+#O####$##$#$&#&$&#&$&&$&&$&&$&&$&",
+" . . . .........X.X..X.XX.XXXXXX+X++++++%+%+%%%%%%%&&%=%&%=%=%==&============================&=%&&&%&%%%%%%+%++++++o+XXoX.XoX.o.X........ . .. . . . . . . . . ... ........o.oo.oooooooOo+O+O+#+#O####%#%#&#&#&$&&&&&&&&&$&&$&$&$&#&$#&$#####O##O#O#O+#OO#+O#OO+O+O+oOOoOOoOOXOOOO+O#O+OO#O#O##@#######&####&$&$&$&$&&$&&$&&&$&&",
+" . . . . . . . . . . . . .........X.X.XXXXXoXX+X+X++++++%+%+%%%%%%&%%%&&%=%=%=&=%=&======================&==&==&&&&%&%%%%%+%+++++++OXXXoX.XoX.o.o......... . . . . . . . . . . . ......o..o.o.ooooXoo+o+o+O+O+O#+#+#%###&##&$&&&&$&&$*&&&&&&&&$&&$&$&###$####O##+#O#OO#OOOOO+OOOOOOOO+OXOO+OOOOOOOOOOO#O#O#O#@+#@###$#$#$&#$&#&#&$&&$&&$&&$&*$&",
+" . . . . ... .......X.X.X.X.XoXoXXX++X+++++++++%+%%+%%%%%%&%=%&%&&&&=%=&==&=&====================&=&&&&&%&%%&%%%%%+%++++X+X+oXXXoXo.X.X..o........ . . . . . . . . ..........o.o.oo.XooXOXO+O+O+#O#+#####%#&#&&&&&$&&&*&&&&*&&&$&&&&$&#&#$&########O#O#O#O+O#O+OOO+O+OO+OOOOO+OO+O+OO+OO#OOO#O##O#@##@######&#$&#$&$&#&$&$&&$&&$&&&",
+". . . . . . . . . . . . . . . .. .........X.XoXoXXoXXX+X+X+++++%++%+%%%%%%%%%%%&%&&%=%=%=&=%==&=&================&==&=&&=%=%&&%%%%%+%++++++++X++oXXoXXoX.o......... .. . . . . . . . ........o.ooXooXoOXO+O+O+O+#+##+#%###&#&#&$&&&&&&&&*&&*&*&&&$&&#&$&########O#@##+O#O#O#OOO#OOOO+OOoOO+OOOOOOOOOO#OO+O#O#OO#O#+@######$#&##$&#&$&$&$&&$&&$&&$&",
+" . . . . . . . ... ......X.X..X.X.XXoXXoX+X++X+++++%+%%+%%%%%%%&%&%&&&&&&&&&=&=&&==&=============&=&==&=%=&&&%&%%&%%%%%%+%#+++O++o+XoXXo.X.o.X......... . . . . . . . . . ........o.o.o.ooooo+o+O+O++#O########%#&#&$&&&&$*&$*&&&&*&&&&$&&&$&$%#&$####@###O#O#O+@O+O+O#OO+OOOO+OOOOO+oO+OO+OOOOO#OOO+##O###@#####$##$#&#&$#&$&&&$&&$&&$&&$",
+" . . . . . . . . . . . . . . . .. ............X.X.XXoXXX+XX+X++++++++%++%%+%%%%%%&%&%&%=%&&&&&%=&=&&=&=&==&===========&=&=&=&%=%&&%%%%%+%%+%+#++++++X+oXXXoX.X.o...... .. . . . . . . .. .......o.o.oXoXoXoOXO+O+O#+#O#+#####&#&&#&&$&&&&*&&*&*&&*&&&&&$&&#&$#&########+#O#O#O#OOOOO+OOOO+OOOOo+OOOOOOOOOOO+OOO#+@O#O#@O#######%$#&#$#&$&$&#$&$&$&$&&$&",
+" . . . . . . . . . ... .....X.X.X.XoXoXoXoXXo++X++++++%++%%+%%%%%%%&%%&%&%&&&&&&=&&=&=&=&===&==&=&=&=&&=&=&&&&&&&%&%&%&%%%%%#%+#+++O++X+XXXoXXoX.X.o....... . . . . . . .. . ........o.oooXoooXO+o+O++#O+#######%#&#&$&&&$&&*&&&&*&&&&*&$*&&$&&$&#&#$#$###@O#@+#O#O+O#+#O+OO+OOOOOOOOOOO+OO+OO+OOOO+OOOO#O#O###O###$#$##$#&$#&##&$&&$&&$&$&&$",
+" . . . . . . . . . . . . . . . . . ... ..........X.X.X.XoXXXX+X+X++X+++++++%+%%%+%%%%%%&%&%&&%&%=%&&&&&&=&&&=&===========&=&=&=%=&&&&&%&&%%%%%%+%%+#+++++++o+XXoXoXo.X.......... . . . . . . .. ....o..o.X.oXoXoo+O++O#O+##+###%##&#&#&&$&&&*$&*&*&&*&*&&&&&&&&$&&$#&########O##O#O#O#OOOOO+OOOO+OOo+OOOOOOOOOOOOO+O#OO#O#O#+#O###@####&##&##&#$&$&#$&&$&$&&$&",
+" . . . . . . . . . . . . . . .........X..X.Xo.XXoXoXoXX+X+X++++++%+%+%+%%%%%%%%%&%&%&&=%&&&&=%=&&=&=&=&&=%=%=%=%&=&=%&&&&&&&%&&%&%&%%%%#%+%+#+++O+X+oXoXX.X.X..o.... . . . . . . . .........o.ooooXoXO+O+O+++##O######%#&#&&#&&&$&&*&&&*&*&*&*&*&$&&$&$#&#$#########O#O#O+O+O#O+OOO+OOOOOOOOO+oOOOO+OO+OOOO+@O+O@+@@#@######$#$#$&$#&$%$&$&$#&&$&$&&",
+" . . . . . . . . . . . . . . . . . . . .... ........X.o.X.XXoXXXX+X+X+X++++++++%+%+%%+%%%%%%&%%&&%&%%=%&&%=%=&&&&=&=&==&====&=&=&&=&=&&&&&&%&%&%%%%%%%#%+#+++++++++XoXoX.oX....... .. . . . . . . . . ......o..o.oXoXo+o+O+O+@+######%##%$&&$&&$&&*&&*&*&*&*&&*&&&*&&&#&&$&#&$###@##O##+#O#O#O+OO@+OOOOOO+OOoOOOOO+OOOOO+OO#O+O@+@+@+#O#@##$####&##$&#$&%$&#&$&$&&$&$",
+" . . . . . . . . . . . . . . .. . . .........X...X.XoXo.XoXoXXoX++++X+++%+++%+%%+%%%%%%%%%&%%&&%=%&&&=%&&&&=&&=%=&&=%&&&=&&&=&&&&&&&&%&&%&%&%%%%#%+%#+%+++++o+XXXXXoX.o.X....... . . . . . . . . . . . .. ......o.oXoXoXoXO+O+++#+#+#######&#&#&&&&$&&&$&*&$*&&*&*$&*$&&$&$&&$#&$#######@#O@O@+O#OO@O+OOOO+OOOOOOOOOOOOOOOOOOOOOOO#OO@+@#O#####@###$#$#&#$#&$$&#&$&$#$&$&$",
+" . . . . . . . . . . . . . . . . . . . .. . .......X.X.o.X.XXXoXXX+X+X+X+++++++%+%+%+%%%%%%%%&%%%&%&%&%&&%&%=&&&&&&&=&=&=&=&=&&=&&&=&=&&&&&&&%&&%&%%%%%%%%+#+#+++++o+XoX.XX.X....... ... . . . . ..........X.oXoXo+o+O+O+O##+##%#%##&#&$&$&&&&&*&&*&*&*$&&*&&*$&&&&$&#&$###$##@#+#O##O#OO#O+OOOOOOOOOOOOOOOO+OOOOOOOOOO@+OO#O#O#O#@#@@###$####$#$#&$#&#$$&#$&&$&$&",
+" . . . . . . . . . . . . . . . . . .. .........X..X.X.XoXooXXoXXXOX+++++++++%++%+%%+%+%%%%%%%&%&%&%&&&&&=%&&&&&=&&&&&&&=%=%=&&&=%&&&&&&%&%&&%%&%%%%%#+%+%+%+++++X+oXXoXo.X.X........ . . . . . . . . . . . . .. ....o.oo.oXoXo+O+O+O+##+#######&#&#&&#&&$&&&&&*&*&*&**&$*&&*&$&$&$&$#&$######@#@+O#O#OOO@O#OO+OOOO+OOOOOOOOOOO+OOO+OOOOOO+@O#O#O##@####$##$##&$##&$#&$#&$#$#&$#",
+" . . . . . . . . . . . . . . . . . . . . . .. .............X..oX.XoXXoXXoX+X+X+X+++++++++%+%+%%%%%%%%%%%%%%&%&%&%&%&&&&&&&%=&&&=&&&&&&%=&&&=&&&&&&&&&%&&%&%%%%%%#%+%#+#+++O+++oXXXX.X..o....... . . . . . . . . . .........o.XoXoXoX+o+O+#+#+######&##&#&$&&&&&&$&*&$*&&$*&&*&&*&$&&$&&$&#########@+@+@#O#OO#O+OOOOOOOOOOOOOOOOOOOOOOOOOOOO@+O#O#O#O###O###@##$###$#$&$#$&$&#$&$&&#$&",
+" . . . . . . . . . . . . . . . . . . . . .. ........X.X.oX.XoXoXXXoX+OX++++++++++%+%+%+%%+%+%%%%%%&%&%&%&%&%&&&&%&%&&&&&&&&&&&=&=&&&&&&%&&&&&&&%&&%%&%%%%%%%%#%+#+#+++++XX+XoXoX.o....... .. . . . . . . . . . . . .. .....o.o.oXooXo+O+++O+#O##+##%##&#&#&#&$&&&*&&&*&&*&*&*$*&$&&*&$&&$&#$&#$###@#@#O#O#OO#OOO#OO+OOOOOOOOOoOOOOOOOOOOOOO+OOOOOOO#O#O@O##@######$####$#&$#$#&$##$$&$#",
+" . . . . . . . . . . . . . . . . . . . . . ............X..o.X.oXoXoXXoXXOXX++X++++++%+++%+%+%+%%%%%%%%%%%%%%%%&%&%&%&&&&&%&&%&&&&&&%&&%=&%=%=%=%=%&&&&%&&%&%&%%%#%%#%+%+#+++++OXoXoXoX.X.o......... . . . . . . . . . . . .....o..o.o.oXoXo+o+O#+#+########&#&#&$&&&&&$&&*&&&*$&*$&*&&&*$&$&&$&#$%$######O#+@#O#O#OO#OOOOOOOOOOOOOOOOOOOoOOoOOOOOOOOO#O#O#O#O#@#@##@#@####$#$%$#$#&#$#$&#&#$&",
+" . . . . . . . . . . . . . . . ... . ...........X.Xo.X.XoXXoXXXX++o++++++++++%++%+%+%%+%%%%%%%%%%&%&%&%&%&&&%&&&&&&&&&&&&&&&&&&&&%=%&&&%&&&&&%&%&%%%&#%%%#+%##+#+++O+X+oXoXo.X.o....... . . . . . . . . . . .. .........o.XoXoXo+X+O+O+#O#+###%#%#&#&$&&&$&$&&&$&&$*&*&&*&&$*&$&&&$&$&$%$##$#####@+@O#O#OOOOO+OOOOOOOOOOOOOoOOOOOOOOOOOOO+OOOOO+@O##O#O#@#####$#####$##&$#$&#&$$#&$#",
+". . . . . . . . . . . . . . . . . . . . . . ...........o.o..o.XoXoXXoXX+o+oX++X++++++++%+%+%+%+%%+%%%%%%%%%%&%%&%&%&%&&&%&%&&&&&&&&&&&&&&&&&%&&&&&&&%&&&%&%&%&%%%%%%%#%+%+#++++o+XXXoXX.X.o....... .. . .. . . . . . . . . . ......o.o.o.ooXoXOo++O#++###%####&#&#&#&$&&&&&&&&&&&&&*$&*&*$&&&&$&&##&#&#####@#O#@+#O#OO#O#O@OO+OOOOOOOOoOOOOOOOOOOOOOOOOOO+O#O#O#O#O#O#@#@#@###$#$#&$#$&##$##&$#$&",
+" . . . . . . . . . . . . . . .. ............o..X.XX.XoXXoXoXXo+X++++X++++++%+++%+%+%%+%%%%%%%%%%%%%%%&%%&%&%&%&&%&&%&%&&&&&&&&&&&&&&&&%&&&&&&%&&%&%&%%&%#%%#%%##+#++++++o+oXooo.o......... .. . . . . . . . . .. ..........o.oXoXoo+o++O++#O######%#&#&$&#&&&&$&&$&&$*&$*&&&&$&&&&$&$&&$&$#$##$######O#O#OO#OOOOOO+OOOOOOOOoOOOOoOoOOoOOoOOOOO#OOOOOO#O#O##@#O#####$####$#####$#&$#$##&#",
+". . . . . . . . . . . . . . . . .. .... ........X.X.X.oXX.XoXXXoX+XOX+o+++++++++%+%++%+%+%%+%+%%%%%%%%%%%%%&%%&%&%&%&%&%&&&&%&%&&%&%&%&&&&&&%&%&%&&%&&%%&%%&%#%%#%+##+#O++o+XoXoX.oX.X.o....... .. .. . . .. . . . . .. .........o.o.o.XoXoXOXO++O#+#+###&###&#&#&$&$&&&&&&&&&&&&$*$&&*$&$&&&#$&#&#%$#####@#@#O#OO#OO+OO+OOOOOOOOOOOOOoOOOOOOOOOOOOOOOOOO#O#O#OO#O@+@#@#@#@##$###$#$#$#$#&##&$#$",
+" . . . . . . . . . . . . . . . ... ... ........o.o..o.XoX.XXXXoX+X+o+++++++++++++++%+%+%+%%+%%%%%%%%%%%%%%%%%%%&%&%&%&&%&&%&%&&&&&&&&&&&%&%&%&&&&&&%&&%&%&%%#%%%%#%%#+%++++++O+XoXoXo.o.o......... .. . . . .. . . . . . ............o.oooooo+o+O++#+#########&#&$&#&&#&&$&$&&$&&$*&&&&&$&&&&$&$&&#$#$######@#+@+@+@OO#OO#OOOOOOOOOOoOOOOOOoOOoOOOOOOOOO+OOOOOOOO#O#O#@+#@########$####&##$#$#$##$#",
+" . . . . . . . . . . .. .. ............X.X.XoX.XoXoXoXX+o+++X+++++++++%+%+%++%+%+%%+%+%+%%%%%%%%%&%%&%%%%%&%%&%&%&%&%&%&%&%&%&%&&&&&&%&%&%&&%&%&%&%&%&%#%%#%####+#O+X+oXXoXoX.o.o.......... . .. . . .. . . . .... ........o.o.X.oXoXo+O++O#O##+##%#&#&#&#&&$&&&&&&&$&&&&&$&&$&$&&$&$&&&$#&$&%$#######@#O#O#O#OOOOOOOOOOOOOOOOOoOoOOoOOOoOOoOOOOOOOO+O#O#O#O@+@#O#@#@#@#$####$##$####$##$##",
+" . . . . . . . . . . . . .. . ............X.X.o.Xo.XoXXXXXo+XOX+X++++++++++%++%+%+%+%+%+%+%%%%%%%%%%%%%%%%%%%%&%%%&%%&%&%&%&%&&%&&%&%&%%%&%&&%&%&%&%&%%&#&#%#%%##%+#+#+#+++O++oXoXooo.o..o........... .. . . .. ... .. ..........o.o.oooXoo+OXO+O+#+#########&$#&$&&#&$&&&&&&$&&&&&$&&&$&&$&$#&#&###$###@#@+@+@+OOO+OO#OOOOOOOOOOOOOoOOOOOOOOoOOOOOOOOOOO+OOOOOOO#O#O@+@#O##@##@##$###$##$####$###",
+". . . . . . . . . . . . .. .... ........X..o.X.X.XX.XoXoXoXX+X+++o+++++++#+++%++%+%%+%%%%%%+%%+%%+%%%%%%%%%%%%%%%&%%&%%%&%&%&%&%&%&%&%&&%&%&%&%&&%&%%&%&%%%&%%#%%##%###++O+++o+XooX.X.o.o.......... ... ..... .. . ............o..o.ooXoooXo+O+++#+######&#&&#&$&&#&$&&&&$&$&&&$&$&&$&$&&$&#&$&#$#$#######@##O#O#O#O#OOOOOOOOOOOOOoOOOoOoOoOoOOOOoOoOOOOOOOOOO#O#OOO#O@#+@#@#@###@#########$#####$",
+" . . . . . . . . .. .............oX.o.XoXoXXXXoX+X++o+++++++++++++%+%+%+%+%+%%+%+%+%%+%%%%%%%%%%%%%%%%%%%%%&%%&%%%&%%%&%%&%%&%%&%&%&%&%&%&%&&%#&%&#%#&%#%#%#+#+#+++O+o+oXoXooo.o............. .. . .....................o.oo.oooXo+O++O+O#+##+####&##&$&&$&&&#&$&&&&&$&&&&$&&$&$&#&$&##&#&#####@#@+#O#OOO+OOOOOO+OOOOOOOoOOOOOOOOoOOOOoOOOOOOOOOOOO+OOO+O#O#O#O@@#O#@##@##@#@#@######$####",
+" . . . . . . . . .. .........X.X.X.XoXoXoXoXoX+X+o++X++++++++#+%++%+%+%+%%%+%%+%%%%%%%+%%+%#%%%%%%%%%%%%%%%%%%%%&%%%&%%&%%&%%&%&%%&%&%&%%&%%&%&#%%&%%#%#%#%#+#+#O++O+XOXoXo.X.o.o.o.................. .. ..............o.o.oXooXOXo+O++#+#######&#&$&#&#&&$&$&&&$&$&&&&#$&&$&#&$&$&#&$##$##$####@#O##O#O@O#O+OOOOOOOOoOOOOOoOoOoOOoOoOOOoOOoOOOOOOOOOO#OOOO#O#+#O#@#+@#@##@###@#$#@####$#",
+" . . . . . . .............X.o.Xo.Xo.XoXoXXo+Xo+++X+++++++++++%+%+%+%%+%++%%+%%+%+%+%%%+%%%+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&%%%&%%&%%&%&#%&#%%&%#%#%%#%#+##%+#+++O++o+ooXoXoo.o.o.................................o.oo.o.ooooXoXO++O+++##+##&#&##&#&&&&$&&&&$&&&&$&$#&&&$#&$&##&##$########@#@+@#O@O#O+OOOOOOOOOOOOOOOoOoOOoOOOoOOoOOoOOOOOOOOOOOOO#OOO#O#O#O@O#O#O##O##@#@#@##@##@#@#@#",
+" . . . . . .........o.X.X.XoXoXXoXXoXXo+++o++++++++#+#+%+#+%+%++%+%%+#%+%%+%%+%+%%+%#%%%#%#%%%%%%%&%%%%%%%%%&%%%%%%&%%%%%%%&%%%&#%%%&#%&%#&#&%%#%%%#%##+#+#+++O+o+ooXo.oo.o..o.............................o..o.o.oooooXo+o+O+++O#+########&$&#$&$&&#$&&$&$&&#&$&$$&$&#$&#$#$%$##$#####@#@#O#+#OOO#OOOOOOOOOoOoOoOOOoOOoOoOOoOOoOOoOoOOoOOOOOOOOOOO#O@OO#+@#O#O@@#@@##@##@#@##@#@##",
+" . . . . . ..........X.X.o.XooXoXoXoXXo+++X+X++++++++#++%+%+%+%+%%%%%%%+%%+%%%%+%%%%+%%%+%#+%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%&%&%%#&%%&%&#%&#%&%%#%#&#%#%#+#+#+#+O+O++OXoXoXoX.o.o..o..........................o..o..o.oXooXoXOXO++O+#+####%#%&#&#&#&&&&$&&&$&#&&$&$&#&#&##&$##&###$######@##O#O#O#OO#OOOO+OOOOOOOOOOOOoOoOOoOOOoOoOoOOoOOOOoOOOOOOOO+@OOO+O#O@O#O#@#+#O##O#@#@##@#@##@#@",
+" . . . . .. .....o..o.X.o.XX.XoXXXXoX+o+O++++++++#++%+%+%+%+%#%+%+%+%%+%%%%+%%+%+%#%+#%+%%%+%%+#%#%%#%#%#%#%#%%%%%%%%%#%#%#%#%%#%%#%%&#%&##&%#&%#%#%#%#%###+#+O+OXO+oooXooooo.oo...o......................o..o.o.ooo.oXooXo+O+O+#++#+###%##&#%$&&&#$&&$&&$&&$&#&#&$&$&$##&$#$&######@##@##O#O#O#OO@+OOOOOOOOoOoOoOoOOOoOOoOoOOoOOOoOOOoOOOOOOOOOOOO+O@O#OO#O@+@+O@@#+@@#@@#@#@#@#@#@#",
+" . . . . . ............X.X.XXoXoXXXoXo+X+X++++++++++++%++%+#%+%%+%+%%%#%%%%%+%+#%+%#%+%%%%%%%+%#%+%%+%%+%%#%%#%%#%#%#%##%#%#%%%#%%#%%&%%#%%#%%%#%%#%%#%#%#+##+#++#+O+O+o+oXoX.o.oo..o.o..o............o.o.o.o.o.o.o.oo.XooooXO+o++O++##+###%##&#&&#&$&&&$&&$&&$#&$&$&$%####&#############@#O@+@O#OOOO+OOOOOOOOOOOOOOOoOOoOOoOOoOoOOoOoOOoOOOoOOoOOOOOOOOO+OOO#OO#O@O#+@O#@+@+#O#@#@#@#@#@",
+" . . . . . . . ........X.X.oo.XoXXoXoXXOXO+X++++++++#+%+%+%+%#%+#%%%%#%%%%%+%%%%%%%%%+%%+%+%+%#%+%%+%%+%%#+%+%+#%+#%+%#%%#%#%##%#%#%%#%#%&#&#&#&#&%#&#%#%#%#%#+#+#O+++O+OoXoooXooo.oo.o.o..o.o.o.o.o.o..o...o.o.oo.ooooooXooXOXO+O++#O#+##%###&%$&#&$&&$&#&$&&#&$&&#&#&#&$&#$#$##$#####@#@#O##O@+OO#O#OOOOOOOOOoOoOoOoOOoOoOoOoOOoOoOoOoOoOoOOoOOOOOOOOOOOOO#OOO#O+O#O@O#@O#O@@#O@O#O@O#O#",
+" . . .. . .........X.X.oXoXXXoXXoXX+++++++++++++#+%+%+%+%#%+%%%%%#%%%%+%%%%#%+%%+#%%%+%%+#%%+%+#+#%+#%+#%#%#+%%+%%+#%+#+%#%#%#%#%#%#%#%#%%#%#%#%##%#%#%###%###+#+#+O+OXO+oXoooo.oo.o.o..o.o.o....o..o.o.oo.o.oo.oo.o.oXooXoOXO+XO+O+#+#####%#&$&#&&#&$&&&$&&$&&$&$&$#&$###########@#@##O#O#O#O+@OOOOOOOOOOOOOOOOOoOoOoOoOoOOoOoOOoOoOOOoOOOOoOOoOOOOOOOOO#OOO#OOO#OO#O#O+@#O#O#@#O#O##O@@",
+" . . . . . . .. . .......o.X.X.XoXXoX+XOXo+X++++++#+%+%+%+#%%+%%%#%%%%%+%%%%%%%%%%%#%%%+%%#+%%#+%#+%%+#+%+%+%+#+%#+##+#%#+%%#%+#%#%#%#%#%#%#%#%%&%%&#&%#&#%#%##%+##+#+O++O+OXOoXoXoooooo.o.o.o..o.o.o..o.o.o..o.o.oo.oooooooXOo+o++O++#+#+##%##&#&#&#&$&&&$&$&&$&#$&##&#&#####$##########@#O##O#O#OO#O+OOOOOOOOOOoOoOOoOOoOoOoOoOOoOoOoOoOoOOoOoOOOOOOOOOOOOOOOOOOO#O@O#O+@+@@O#O#O@O#O#@O@#O",
+" . . . . . .. . .......X.X.XoXoXoXXoX+XO+X++++O++#++#+%+%#%%+%%%%%%%%#%%%%%%#%%#%+%#%%+%+%#+%%+#+%#+%+#%+#+#+#+%+##+%+%#+%+#+#+###+##%###%#%#%#%#####%#%#%#%#%#%+##+#+#+#+O+O+OXOoooooo.ooo.oo.oo.o.oo.oo.o.o.ooooooo.oooooXoXoXO+O+O+O#+#######%#&#&&&$&&$&&&$&$&&&&$&#&$#&$#&###$#@#@#@O#O#O#O#OOOO+OOOOOOOOOOoOoOOoOoOoOoOoOoOoOoOoOoOoOoOoOOoOOoOoOoOOOOOOOOOOOOOOO+OO@OO@+O#O@O#O#O#O#O#O#",
+" . . . . . . .. ........X.X.oXoXoX+oX+X++++++++++%+%+%+%+%%%%%#%#%%%%%%%%%%%%%%#%%%#%%#%%%+#+%%#+%#+#+%+%#+%+#%+%+##+%+#+#%+#+#+%#+#+%%#%#%#%#%%#%%#%#%#%#%#%##%##+#+#O++O+XOXOXooXoooo.ooo.o.o.oo.o.o.o.ooo.o.o.ooooooooooOo+OXO+O++#+@+######&#&&#$&&$&&$&#&&&#$&%$&$%$###########@#O##O#O#OO#O#O@OOOOOOOOOOOOOOOoOOoOoOoOoOoOoOoOoOoOOoOOoOOoOoOOOOoOoOOOOOOO#O+OOO#O+O#OO@O@O#O#O#O@O@O#O",
+" . . . . . . . . . .. . ......X.X.o.XXXXoXXX+++++++++#+#+#+%#%#%%%#%#%%%%%%%%%%%%#%%%%%%%%+%%%+%+#%%%+#+%+#%+%+#+#+%+#+#+#+#+#+#+%+#+#%+##%####+####%####%##&##&##%##%###+##+#+#O++OO+oOXOooooooooooooo.oo.ooooooo.ooooooooooooooXOXOXOXO+O+#O#+#####%#&#&$#&&&$&&$&&$&$&&$#&#&##&#$##$##@#@+@+#O#O#OO#OO#OO+OOOOOOOoOoOooOoOoOoOoOOoOoOoOoOoOoOoOoOoOoOOOOoOoOOOOOOOOOOOOOOO#OOO@OO+@O+@O@O@O@O#O#O@O",
+" . . . . . . . . . . . .......X..X.oXXoXooX+o++o+++++#+++%+%%+%+%+#%%+%%%%%%%%%%%%%%%%%#%%#%%#%+%#%%++#+%#+%#++#+#+%+#+#+#+#+%+#+#+#+#+#+##+#+%+###%#%##%#%#%###%##%##%##%###+##O#+#O+O+o+OoXoooooooooo.oo.ooo.o.o.ooo.ooooooooooooooOXOO+O++O+#O#####%###&#&&&$&&$&&&$&&&#$&&&#$&#$#########O#@#O#@+O#+O#OOOOOOOOOOoOOOOoOOoOoOoOoOooOoOoOoOoOoOoOoOoOOoOoOoOOOOoOoOOOOOOOOOOOOOOOOO@O+O@OO#OO#O#O#O#O@",
+" . . . . . . . . . . . . .. .......X.X.XoXXXXXX+X+++++++++#%+%+%%%%%%%%%%%%#%%%#%%%#&%%%%%%%%%%%+%#%+%+%#%+#+#++##+%+#+#++#++#+++#++#++#++#+#+#+#+#+#+#+##%####%#%#%#%#%##%##%+##+#++O++O+O+Oo+Ooooooooooooooooooooooooooooooooooooo+o+OXO+O+O+#O#+##+####&#&$&$&$&&$&&$&&$&$&&$#$&#########@#@##O#O#O+@OOO#OO+OOOOOOOOOOoOoOOoOOoOoOoOoOoOoOoOoOoOoOoOoOoOOoOoOoOoOOOOOoOOOOOOOOOOOO+OO+OO@OOOO#OOOOOO@OOO",
+" . . . . . . . . . . . . . . . .. .......X.o.XoXoXoXo+o+++++++#+#+%+#%#%#%%%%%%%%%%%%%&%&%&%%%$%%%#%#%#%#%%%##%+#+%+#+%#++#+#++#++#++#+#++#++#++#++#+#+#+##+###%##%#%###%##%###%##%####+#+##+#O+O+OO+oOo+oooooooooooooooooooooooooooooooOoOoOoOO+O+O++O#+########&#&#&#&&$&&$&&$&$&&$&#&%$&#$&#######+@+@+O#O@+O#OOOOOOOOOOoOOoOoOoOoOooOoOoOoOoOoOoOoOoOoOoOoOoOoOoOOoOOoOoOoOOOOOOOOOOOOOOOOOOOOOOO#OOO#O#O#OO#O",
+" . . . . . . . . . . . . . . . . . . . . . .........XXXoX.XX++X++++++++++%+%+%%%%%%%%%%%%%%&%%&%%%&%%&%&%%&%%%#%%+%+#+%+#%+%+#+#++#+#++#++#+++#+O++#+O#++#+O#++@+#+#+#+#+#+#####%###%#&#%##%##%###+##+O+++O+O+oO+ooOoooooooooooooooooooooooooooooOXOXO+O+o+O+O#O#+##+###&#&$#&$&&$&&&$&&$*&&$&&$&$##$#######@@#O#O#O#O+OOOOO+OOOOOOOOOOoOOoOoOoOoOoOooOooOooOooOooOooOoOoOoOoOoOOoOOoOOOOoOOoOOOOOOOOOOOOOOOOO#OO#OOOOOOO#OO",
+" . . . . . . . . . . . . . . . . . . . . . ... .....X.X.o.oXXo+Xo+X++++++#+%#+%#%#%#%%%%%%%%&%%&%%&%&%%&%%%&%%%#%%#%#%#%#%+%#+#+#+#+#+#++#++#++#+O++#+O+++O+O+++#+#+@+#+##+###+#%###%#%#####%##%##+#+##+#+##O+O+O+Oo+Oo+oOoooooooooooooooooooooooOo+OoO+oOo+O+O+O+#+#O######&##&#&$&&&$&&$*&$&$&&#&$&#&#%$###@##+@#O#O#O#O#O#+OOOOOOOOOoOoOOoOoOoOoOoOooOoOoOoOooOooOoOoOoOoOoOoOoOoOoOOoOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@O@OOOO",
+" . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . ........X.X.XXoXXX++++++++#+#+#+%#%%#%%%#%%%&%&%%&%&%&%&%&%&&%%%%%%%#%%#%+%%+#+#%+#+#+++++#+++#++O++#+O++#+O#+#+#+O+O++#++#++#+#%##+######%#%#%##%##%####+#O#+O+#O+OO+OoOoOooOooooooooooooooooooOoOoOoOo+OO+O+O+O+O#O#O#########&$&$&#&$&&&&&&$&&&$&$&##&$#$######@#@+#O#OOOOOOOOOOOOOOoOOOoOoOoOOoOoOooOoOooOooOoOoOoOoooOooOoOoOoOoOoOOoOOoOOoOOOoOOOOOOOOOOOOO#OOOOOO@OOOOOO#OO",
+" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .......X..o.XXoXX+o+XO+++#++%+%%%+%#%%#%%%%#&%%%%&%&%&%&%&%&%%&%&#&%%%#%%#%#+%#%++#+#++#+#+++#++O++#O+++#+++++++++++#+#++@+#+#+#+#+#####%#%#%#%##%######+#####+#+O++O+o+O+Oo+OooOooOoooooooooOoOoOoOoOoOOO+oOO+OO+O#O#+#+#####&#&#&#&$&&&$&$&$&&&$&&$&#$&$#######@##+@#O#OO#O#O+OOOOOOOOOOOoOOOoOooOoOoOooOooOooOooOooOooOoOoOoOoOoOoOoOOoOoOOoOOOoOOOOOOOOOOOOOOOOOOO#OOOO#OO#OOOO",
+".. . . . .. .. . .. . . . .. . . . . .. . . .. . . .. . . . . . . . . . . . ... ......X.XoXoXXoX+X+++++++#+#+#%%%%#%%%%%&%%&%&%&%&%&%&%&%&&%%%%%%#%%%#%+%##%+#+#++#+#+++#+O++#+++++O#O+O+@+O+O#O#O+O+#+#+O#+##+##+#%+##%###%#&##%#%#####+#+#O#O+#O+OOOoOoOoOXOoOooOoOOoOOoOoOoOoO+O+O+oOO+O+O+O+O+#+#########&#&$&#&$&$&&&&&$&&&$&&$&##&#&#$####@@#@+@O#OO+OO@OOOOOOOoOoOOooOoOOoOooOoOooOooOooOooOooOoOooOoOoOoOOoOoOoOOOoOOOoOOOOoOOOOOOOOOOOOOO#OOOOOOOOOOO@OO",
+". . ... .. . .. .. .... ... . ... .... ... .. . ... . . .. . . . . . . . . . . . . . ......X..o.X.XXoX+X+O+++++#+%+%%+#%#%%%%#&%%&%&%&%&%&%&%&%&%&%&&#&%%%%#%#%#+%+#+#+#+#+++#O+++#++++@+O+++++++O+++O++++#+O+O#+#+#+#+##+###%##%#%##%#%###%+###+##+#+#+O+O++O+O+OoOoOoOOoOoOoOoOOoOoO+oOoOoO+O+O+O+O#O##O#O#@####&##$&#&$&&&&&$&$&*$&$&&$&$&#$#$####@#+#O#O#O#O#O@+OOOOOOOOOOOOoOOOoOoOoOoOoooOooOooOooOooOoooOoOooOoOoOoOoOoOoOOoOoOOOoOOOOoOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"................ ... .... ..... ... .... ... ... . . . . . . . . . . . . . .. ..........o.X.XoXoXXo+++++++#+%+%#%%%#%%#%%&%&%&%&%&%&%&&%&&%&%&%%%%%#%#%%#%%#%#+#%+#+++#+O+++O++O+O++O++OO+O+O++O++O+O+O+#+++#+#+#+######%##%###%##%##%########+#O#O+#O+OO+OOo+O+OXOoOoOoOoOoOo+OOOOO+O+O+OO+OO+O#+#O###########&#&#&&&$&$&&&&*$&&&&$&$%$#&########@#@#O#O#OOOOOOOOOOOOOoOoOoOooOoOoOooOoOoOooOooOooOooOooOooooOooOoOoOoOoOoOoOOOOoOoOOoOOOOOOOOOOOOOOOOO#OO#OO#OOO#O",
+"..................................... .... ... .. ... . ... . . . . . . . . . . . . . . . . . . .....X..XoXoXXXX+X+++++#+%#%#%%#%%%%%%&%%&%&%&%&&%&&%&%&%&&%&%&%%&%%#%#%#+#+%#+#++#O+#++O#++O+O++O++O+++O+O+O+O++O+O++O+@+O+O+#+#+#+#+##%##%#%#%##%#%#%###+###+#+#O+O#+O+O+O+OoO+O+O+OO+OO+OO+o+O+OOO+OO+O+#O#+@+#O#O######&##&$&$&$&$&&$&$&&&$&$&&$&&#$&#$#$####O#O#O#OOO#O+OOOOOOoOOOOOOoOOoOoOooOoooOooooOoooOooooOoooOoOoOoOooOoOoOOoOoOoOoOOOOOOOoOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"................................................... .... . . . . . . . . . . . . . . .........o.oX.X.XoXOX++++++#+%+%+%#%%%#%%&#%&&%&%&&%&%&&%&&%&&%%&%&#%#%#%%#%#%#%+#+#+#+++++O++O+++++O+O+O+OO+O++O+O+O++O+@++@++#+##O#+#+#######%##%##%###########+##O#+#O#O+O+OOOO+OOoOOoOO+OO+OOOO+OO+O+O+O+#O+O#O#+@+#########$#&$%&#&&&&$&&&&$&&&&&$#&$#&$#$%###@#@#+#@O#O#OOOOOOOOOOOOoOoOoOoOoOoOoOoOoOooOoooOooooOoooOoooooOooOoOooOoOoOoOoOoOOoOoOOOOOoOOOOOOOOOOOOOOOOOOOOO#OOO",
+"X..X.X..X..X..X.X..X............................ ...... .... . .. . . . . . . . . . . . . . .. . ......o..ooXoXXX+o+O+#++#+%#%#%%#%%&#%&%&%&%&%&%&&%&%&%&&%&&%&%%&%&#%#%#+%#+##+#++#+#O++O+++O+O+O++O+O++O+O+O+O+O+O++O+O+@+O#O++#+###+#%#%###&##%##&#%#%##+###+##+@+#+O#O+O+O+OO+O+O+O+OOOO+O+OO+OOOO+O#OO+O#+#O#+#########&###&$&$&$&$&&&$&*&$&$&&$&$&####$####@##O#O#OOO+OO+OOOOoOOOOOOoOOoOoOoOooOoooOoooOoooOoOooOooOoOoOooOooOoOoOoOoOoOOOoOoOOOoOoOOOOOOOOOOO#OOOOOOOOOOOOOOO",
+".XX.X.X.XX.X.X.X.X.X.XX.X.X.X.X..o.o.o............... ... . .. . . . . . . . . . . . . . . ........o.X.XoXoXoXOX++++++#+%+%%#%#%%#%&%&#&%&&&&%&&%&&&%&%&%&%&#&#%#%%#%#%###+#+#+#+O+++O++O+O+O+O+O+O+O+O+O+O+O+O+O+OO+O++O+++#+@+#+####+###%##%##&#############O###O#O#+O#O+OO+OOO+OOOO+O+OOO+O+O+O+#O#O+##@+@+##@#O######$#&#&#&&&$&#&&$&&$&&&$&&$&#&$#&$#######O#@O#O#O#OOOOOOOOOOoOoOoOoOoOoOooOooOoooOoOooOooOooOooooooOooOoOooOoOoOoOoOoOoOOOoOOOOOOOOOOOOOOOOOOOOOOOO#OOOOOOO",
+"XX.XX.XX.XX.XXX.XX.X.X.X.X.X.X.oX..X..X.o.o................. .. . . . . . . . . . . . . . . .. .......o.oo.XoXo+X++++++%+%+%#%#%%%%%%&#%&%&#&%&&%&&%&%&&&%&%&%&%%&%&#%#%##%+##+#+O#+#+O#+O+O++O+O++O+O+O+O+O+o+O++O+O++O+O++@+O#+#+###+####%##%##&#%##%##%########+##+#O#O+O#O+O+O+OO+O+OOO+O+O+@O#O#OO#O#OO#O##O#O########&##$&$&#$&&&$&&$&*$&$&&$&&#$&#$%$#####O##O#O#OOOOO#OOOOOOOOOOOOOoOoOoOoOoOoOoOooooOooOooOooooOoOoooOooOoOoOooOoOoOOoOoOoOOOoOOOOOoOOOOOOOOOOOOOOOOOOOO#OO",
+"XXXXXXXXXXXXXX.XXXXXXXXXXoXXoX.X.XX.Xo.X..o.o.o............... .. . . . . . . . . . . . . . . . .........o.o.XoXoXXo+o+O++#++#%+%#%%#%#&#&%&%&%&&%&&&%&&&&%&%&&#&#&%$%#%#%#%##+##+#+#++O+O+O+++OO+O++oO+o+O+o+O+O+O+OO+O+OO+O#O+O#+@+##+#+#########%###&###############O##O#+#O#O+#O#O+O#O+@+O#O#O@+O#O+#O#+#O###+#@#########$##$&##&$&&$&$&&$&&&&&&$&&$#&$########@##@+#O#OO#O+OOOOOOOOoOoOoOoOoOoOoOoOoooOooOoooOooOoooOoOoooOoOooOoOooOoOoOoOoOOOOoOOoOOOoOOOOOOOOOOOOOOO#OOOOO#OOOOO",
+"XXXXXXXXXXXXXXXXXoXXXoXoXXXX.XXXX.XoX.X.oX.X.o..o.o............ .. . . . . . . . . . . . . . .. .....o..o.XooXoXo+o++++#++#+%#%%#%%#%%%&%&#&&%&&%&%&&%&%&%&&%&%&%&%%%%%#%##%##+#+#+O+#O++O+OO++O+o+O+O+OXO+O+o+oO+o+O+O++O+O+O++O+#+@+######%##%###&##&##&#%#%#####+##+###O#+#+@+O#O+@+O#O+@+O+@+@+#O#O#O#O##O#@##+##########&%$&#&$&#&$&&$&&$&$&$&&#&$&#&$&#$#$####+@#O#O#OO@OOOO+OOOOOOOOoOoOoOoOoOooOooOoooOooOooooOooooOoooooOoOooOoOoOoOoOooOoOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"+X+X+X+X+XX+X+X+XXXoXXXXXXXXXXoXXoXoXXoXX.X.X.X.o..o............. ... . . . . . . . . .. . . . . .. .........o.o.oXoXo+X++O+++#+%#%#%#%%#&%$&#&%&%&%&%&&&%&&%&&&#&%&#&#%#&###%##%+#+#+#+O#+++O++O+O+OXO+Oo+o+OO+oOoO+O+oO+Oo+OO+O+O#O#+@+#+##+######%##&##%##&###&###########O###O#O#O#O+#O#O#O#O#O#O#O#O#+@#+####O##+##@#####$#$&$#$#&$&#&$&&$&&&$&&&&&$&$&#&$###$%###@#@@+@+@O+O+OO+OOOOOOoOoOoOOOoOoOooOoOoOooOoOooooOoOoooOoooOoOoOoooOoOooOoOoOOOoOOoOOOoOOoOOoOOOOOOOOOOOOOOOO#OOOOOOO",
+"+++++++++++X++X++X+++X+XXX+oXXXXXXXXXoXXoXoXoXo.X.o.o.o........ .... .. . . . . . . . . . . . . .. .........o.o.XooXoXo+O++++#++#%+%%%#%%%%&%%&#&&#&&&&%&&%&&%&%&%&%&%&%&#%%%#%##+##+#+#++O+O+O+O+OXO+Oo++oOo+oO+o+Oo+oO+O+O+O+O+O+O++O+@+#O###+##########&#&##&##&##%#########O##O#O#+#@+@+#O#O#O#O##O##O@#O#@#O###########$##$##&#&$&#$&$&&#&$&$&&$&$&&$&&#$&#&$#######+@#O#O#O@O#OOOOOOOOOOOOOOoOoOoOoOoOoOooOoooooOoooooOoooOooooooOoOoOoOoOoOoOooOOoOOoOOoOOOOOOOOOOOOOOOOOOOOOOOOOOO@O",
+"+++++++++++++++++++X++++++++++X+oXXXXXoXXXoX.X.Xo.X.o..o........... .. . . . . . . . . . . . . .. ..........o..oXo.XoX++o++O+#+%#%+%#%%%#&#&%&%&%&%&&%&%&%&&%&&&%&$%&#%#&#%#%####+#+#+O#+O+#O++O+O+O+oOXOoO+o+oOXOOXO+OO+oOXO+O+O+O+O#O#+O##+######%##%&##&###$#&#$##&############O###O##O#O#O#+@+#O#+@#+@##+##O######@########$%$#$#&$#&$&$&$&&&$&&$&&$&$&&$&#$####$##@#@#+#@O#OO+OOOO+OOOOoOOoOoOoOoOoOoOooooOoooOoOoooOooooOoOooOoOoOooOooOoOoOoOoOOoOOoOOOOOOOOOOOoOOOOOOOOOOOOOOOOO#OOOO",
+"%+%+%+%+%+%+%+%++++++++++++X++X++++XoXXXoXXXoXoXoXoX.X.o.o............ .. . . . . . . . . . . . . .. . ....o..o.o.oXoo+oo++++++#++#%#%#%#%%&#&%$%&#&&%&%&&&&%&&$%&&%&&%&&#%&#%#%+%###+#++#+O++O+O+O+o+OXO++OXOoO+Oo+oOoOXOo+O+OOO+O+@+O+O+#+#O##+####%######&#&#&###%$##&#######O####O###O#####@##@##@##@####@################$&##&#&$#&&$&#&$&&$&&$&&&$&&&&$&#&$&#$#######O@#O#O#O@O#OOOOOOOOOoOOOoOOoOoOoOoOoOoOoOooooOooooOoooooOoooooOoOoOoOooOoOoOoOoOOoOoOOoOOoOOOOOOOOOO#OOO#OOOOOOOOOO",
+"%%%%%%%%%+%%+%+%%%%%+%+++++++++++X++++o+XXoXXoXoX.oXo.o.X..o...... .. .. . . . . . . . . . . . ... .. .........o.ooXooXoXO++O++#+#+#%#%#%%#&#&%&%&&%&&%&&&%&%&$%&%&#&%$%$%%#%#%#####+#+#O#O+O+O+O+O+oO+OXO+oo+oO+oOo+Oo+o+oO+OoO+o+OO+O+O#O#O+@+#+########&#&##&##&#&$%#&################O###O##O#+##+@#+##O#########@####$##$###$#$#$#&$#$&$&$&$&$&$&&$&&$&$#&$#&#$##&##@##@##O#O#O+OOOO#OOOOOOOOOoOOoOoOoOooOoOooooooOooooOooooOooooOoOoooooOoooOoOoOoOoOOoOOOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"%%%%%%%%%%%%%%%%%%%+%%+%%%%+%+++++++++++o+XOXXXXoXX.oX.Xo.o................ . . . . . . . . . .. ............o.o.ooo+oXOX+O++#+##+%#%%$%%&%%$%&%&%&&%&%&&&%&&%&&&#&%&%&%$%###%###+#+#+#+#+O+O+O+O+O+o+Oo+OoOXOo+oOo+OOo+Oo+OXOOOO+O+O+O++@+#+#@######&#####&##&#$##&##$##&#######################@###@#########@####$####$#&#$#&#&$&#&$&#&$&#&$&&&$&$&$&$&$&$&$#&#$#$#####O##O#O#O#O#OOO+OOOOoOoOOoOoOoOoOooOoooOoOooooOooooOooooOooooOoOoOoOoOoOoOoOoOOoOoOoOOOoOOoOOoOOOOOOOOOOOOOOOOOOOOOO",
+"%%%%%%%%%%%%%%%%%%%%%%%%+%+%+%%+#++++++++++X+OXoXoXXoXo.Xo.o......... . . .. . .. .. . . . . . .. .... ......o.o.oooXoXoX+O++++#+#+%##%#%%&#%&&%&&#&&$&&&&#&%&&%$&#&%$%&##&%#%#%#####+@+O+O+O+O+O+o+o+oOOXOoO+oO+OoOXOoo+OoO+oO+O+O+OO+@+O#O+#O#+#+#######%&###&#$%&#&#&##&###&#####################################$###$#$##$#$%$#&$#&$#&$#&#&&$&&$&&$&&$&#&##&$#&$#####@#@#@#O#O#OOOOOO+OOOOoOOOOoOOoOoOoOoOooOoOooooOooooOoooooOoooOoooooOoooOooOoOoOoOoOOOoOOoOOOOOOOOOOOOOOOOOOOOOOO#OO#OOO",
+"&&&&%&%&%%&%%%%%%%%%%%%%%%%%%%+%+%+#+++++++++X++X+oXoXoX.X.X.o.......... .. .. . . . . . . . .. ..............o.o.o.oooXOo+O+O#+#+##%#%#&#%#&#&#&%&&%&%&#&&&&$%&&%&#&%&#%&##%######+#+#+##+#+O+O+O+OOo+OXOOXOo+oooo+Oo+OoOXOo+OoOo+OO+O+O+O#+@+##O##+###%###&#&#&%$##&#$#&##&##$#$#$#########@###@##############$##$#####&#&#&#&#&#$#&#&$&$&&$&$&&$&$&&$&#&$&$&#&#$#$#$####@##O#O#O#O#O#OOOOOOOOOoOOOoOOoOoOooOooOoooOooooOooooOoooooOooOoOooOoOoOoOooOoOOoOoOOoOOOOoOOoOOOOOOOOOOOOOOOOOOOOOOOO",
+"&&&&&&&&&&&&&&&&&%&%%%%%%%%%%%%%%#%+%++++O++O+o+o+XoXoXoooo.o.o........... .. .. . .. .. .... .... .........o.o.o.oXoXo+o++++++#+####%#%#&#&%&%&&#&&&&&&&%&%&%&%&$&%&#&#&#%##%#%#+##+@+O+O+O+O+OOXO+oOOXOo+oOoOo+OoOoOoOXOOXOo+O+OO+O+OO+O+O#+#O##+######&#####&##&#&#&#&#$%$#&#%#&##$#####################$#$####$#&$$&$#$$&$#$#&$&#&$#&#&$&$&$&$&#&$&&$&$&#&$$#&#####$###@+#@#O#O#OOOOO#OOOOOOOOOoOOoOoOooOooOooOooooOooooOooooOooOooOoooOooOoooOoOoOoOoOOoOOOoOoOOOOOOOoOOOOOO+OOO+OO#OOOO+OO",
+"&=&=&=&=&=&&=&&&&&&&&&&&&&%%%%%%%%%%+##+#+++++++++o+XoXoXX.Xo..o............ ... ... .. .. . .. .............o.o.ooooooo+o+O+O#+##+%#%#%#%&#&#&#&&%&#&%&%&$&%&&#&%&#&%$%##&#%#####+#+#+#O+#O+O+O+O+oO+oOXOoOXOXoOo+oXOXOo+oO+OoOoOXOOO+O+O#O+@+#+######%###&#&##&#&#&#$#&#&#&##&#$##$##$#$##$##$###$###$#$######&$%$#&##&#&##&$&&$%$&$&&$&$&$&$&#&$&$&$&$&$&#$#&$#$#$####@###O#O#O#OO#O#OOOOOOOOoOoOOoOoOoOoOoOoOooOoOooooOooooOoooooooooOooOooOoOoooOoOoOoOOoOoOOOOOOoOOOOOOOOOOOOOOOOOOOO#OO#O",
+"=&===&=&=&=&=&==&=&&&&&&%&&&%%%%%%%#%%+%+#+++O++O+XOXoXoooX.oX.o.o............ ... ... .. .... ............o.o.oooooXo+o+O++O++##+###%#&#&#%&&%&#&$&%&$&&%&%$&%&#&#&#&%&#%#########+@+@+#O+O+O+oOoO+oOo+oOooOoOooOoOOooOoOoOoOXO+OO+O+O+@+O+#O#+@#+######&###&#&$#&$#&#&#&$#&#&#$%$%&#&####$####&###$###&#&$&&$&#$#&#$&$#$&$&$&#$&#&$&$&#&#&#&#&$&#&&$&#&#&$&#&##&#&##$###@@#@#O#O#O#OOO+OO+OOoOOOOoOOoOoOoOooOoooOooooOooooOoooooOoOoOooooOooOooOoOoOoOoOoOoOOOOoOoOOOOOOOOOOOO+@O#OOO#OOOOOOOO",
+"==============&=&=&=&=&=&&&&&&%&%%%%%%%%#%#+#+O+++++X+oXXXoX.oo.o................ ... ...... ............o..o.o.o.Xooo+o+o+O#+#+####%#&#%#&%$%$&&%&%&&&%&$&&&#&#&&&#&%$#&#&#%#%#+#+#+#+O++O+O+OO+O+oOXOoOo+o+ooo+oOoooOoOo+Oo+OOo+oOO+OO+O+#O#+##O#########&##&##&#&%$%$&#&#&#$#&#&#$#$&#$&#%$%$#$&#&#&$#&##&##$&#&$#&$#&$&#&#$&%$&$&#&$&$&$&$&&$&&$#&$&$&$#&#$&$#$#$###@###O#O#O#O#O+O#OOOOOOOOOoOOOoOoOoOoOooOoOoooOooooOooooOoooooooOoOoooOooOooOoOoOoOOoOOoOoOOOOoOOOoOOOOOOOOOOOOOOO+OO#OOO",
+"===========&=====&=&=&&&=&&&&&&&&&%&%#%#%+%#+#+++O+O+OXOoXooXo.o.o.o........... ... ... .. ...............o.o.ooooooXoo+O+O++O#+###%##%#&#%&%&%&#&&$&%&$%&%&%&&$%#&#&#%%############O+#+O+O+OOXOo+oOXOoOoooOooOoOooOo+oOXOooOoOXOOO+OO+OO#O+@+@+########%###&#$&#&#$#&&#&#&#&$&#&$#&$%$#&##$&#&#&#$&#&#&$#&$&$&#&$&$&$&&$&$&$&&$&$&#&$&&$&&&$&$&&$&$&$%$%$%$#$###$####@###@###O#O#OO@OOOO+OOOOOOOOOoOOoOoOoOoOooOooOoooOooooOooooOooOoooooOoOoOooOooOoOoOoOOoOOoOOoOOOOoOOOOOOOOOOOO+OOOO@OOOO#O",
+"=====================&=&=&=&&&&&&&&%&%%%#%#%#+#+#+++o++XXoXooXo.o.o.................. ..................o..o.oo.oooooOXOO++O++##+###%#%#&#&#&#&#&&%&#&%&&%&$&#&%&%$%%$%$%#%#%##+#+#+#O+@+O+O+o+O+oOoOoOoXOoooo+oooOoOoOoOoOOo+OOOoOOO+OO+O+@+O##O#+#######&##&#&#$&#&#&#$&#$&#&%$&&$%$&#&$&%$&$&$#&#&$&#&$&#&#&&$&$&#&$&$&#&$&#$&$&&$&&$&$&$&&$&#$&#&#&#&$%$&#%$&###$###@##O#O##O@+@+O#O#OO+OOOOoOoOOoOoOOoOoOoOooOoOoOoooOooooOooOoooOooOoooOooOoOoOoOoOoOoOOoOOOOOoOOOOOOOOOOOOO#OOOOOO+OO+OOO",
+"=-==============*==&====&=&=&=&&&&&&%&&%%#%#+%#+#+O++O+oOXooXooo.o.o.o................................o.o.o.o.oooooXo+O+O+O#+@+###%##%$%#&#&#&&#&$&&&&$&%&%&%&#&#&#&#%#&########+#@+#+O+O+OOOOoOoOXOXOoOooOoOooOoOooOooOoOXOOoOXO+O+OO+O#O#O##O############$##&#&##&$&#&&#&&#&$&#&$%&$%$&#$&#$%$&#&$#&$&$&#&$&$&$&&$&$&#&$&$&&$&&&$&&$&&$&$&$&#&$&$&$#$&$#&#$#$##$#$######@#@#O#O#O#OOOOOOOOOOOOOOOoOOoOoOoOooOooOoooooOooooOoooooooOoooOooOooOooOoOoOoOoOoOoOOoOoOOOOOOOOOOOOOO+OOOOO#OOO#OOOOO",
+"-=---------=-=========&====&=&&=&&&&&&#&%%#%%####+#+++O+O+oXooXoooo.o.................................o..o.o.oooooooOoOXO++O#+#####%#%%#&%#&#&#&%&%&#%&%&$&#&#&#&#&#%$&##%####+###+@+O#O+OO+o+Oo+oOoOoXoOooooOooooOooOoOXOoOoO+OOOoOO+OO+O+O+O#+#O#O#####&#%#&$#%$&#&#&#$&#&$&%$&#&$&$&#&$&&$&&&$&#&$&$&#&&$&&$&&&$&$&&&$&&&$&&$&$&$&$&$&#&&#&$&&$&#&&##&#$#&##&#####@##@@#+#O##O#OO#O#O+OOOOOOOOoOOOoOOOoOoOOooOooOoOoooOoOooOoOoOoooOoooOooOoOoOooOoOoOoOOOoOOOOoOoOOoOOoOOOOOOOOOOOOOOOOOOOOO",
+"----=-=-=-=--=--=-=====*=*==&=&=&&&&&&&%#&%##%#+#+#O++O+XOXooXo.o.o.o.o.o..........................o.o.oo.oooo.oooo+o+O+O+O#+@+#+###%$%$%$%&#&&#&$%&&$%&#&%&#&#&#$%$%##%$######+@+#+O+O+O+OOOo+oOoOooOoOooOooooOoOoOoOoOoOo+OoOo+oOO+OO+O@+@#+@+@#########$####&$%#&#&$&&#&$%&$&#&$&#&$&$&#&$&$#&&$&&&&&$&$&&$&&$&&&&$&$&&$&&$&&&&&&$&&&$&$&$&&$#&$#$#&$#&##$#$#$######@##O#@#OO#O#OOOOO@O+OOOOOOOOoOOooOOoOooOoOoOoooOooooooOoooooOoooOoOoOooOoOoOoOoOoOOoOoOOoOOOOOOOOOOOOOOOOOOOOOOOO+OOO#OOO",
+"-----------=--=-=-=--*====**=&=*&=&&&&&&&#&%%#%##+#+@+++Oo+OXooooooo.o....o.......................o.o.o..o.o.oooooooOo+O+O#+#+####%#%#&%%&#&#&#&&%&$%&$%&#&#&#&#&%%#&#%##%####O#+#OO#O+OOO+OXOOoOo+oOooooooOooOoooOooOooOoOoOoOOoO+OOOOO+OO+O@+@+#+########&#&#&#&#$&#&#&&$&&&#&&$&$&&$&&&&$&&&&$&&$&$&$&&&&&&&&&&$*$&&*$&*$&*$&$&$&&$&$&&&$&&$&$&#&&#$&$#$&#######$#@###@#O#O#O#OO#O#O+OOOOOOOOoOoOOoOOOoOoOoOooOooOooOoOoOooOoOoOooOooOooooOoOooOoOoOoOoOoOOoOOoOoOOoOOOOOOOOOOOOOOOOOOOOOOOOO",
+"-------------------==-=*=*==*=*&=&&&&&&&&&#&#%##%#+#+#O+++oo+oXoX.o.o.oo.o.....................o.o..o.ooooo.oooooo+o+oO+O+O#O########&##$%&#&#&#&$%&%&%&$%$%$%$%$#$%########+##+@+#+O+O+O+OO+oOoOooOoOoOoooooOooOoooOoOoOoOoO+oOOoOoO+OOO#O#O+@#O#@#O###$###$#$#&#&#&#&$&#&&#&$&#&&&$&&$&$&&$&$&&&$&&&&&&$&$&$*$&$*&&*$&*&$*&&&*&&&$&&$&&$&&$#&$&$&$#&###&##$&#$#######@+##@O#O#O#OOOOOOOOOOOOOOOOOoOoOooOoOoOooOooOooooOooOoooOoooOooOooOoOOoOoOoOoOoOOoOOoOoOOoOOOOOOOoOOOOOOOOOOOOOOOOOOOOOOO",
+"-----------------=---=---==*=*==&**&*&&&#&%&#%#%###+#++O+O+o+ooooooooo.o...o.o...............o..o..o.o..o.ooooooooOoOO+O+O+#+#+#####&##&%$#&#&$&#&&#&$&$%&%&%&#&%%#%$%$%######O##+@+#O+OOO+OoOo+oOoOoooooOoOoooOoooOoooOooOoOoOOoOOOOO+O+O+O+@+O##+############&#$&#$&$#&&$&$&&$&$&$&&$&&&$&&&&&&$&&&&$&$*&&*&&*&*$*&$*&&$&&*$&$*$&*$&&$&$&$&&$&#&#$&#$&#$#$######$##@##@#O#O#O#O#O#+O#OO+OOOOOoOOoOOOoOOoOoOooOooOooOoOooOooOooOoOooOooOoOooOoOoOoOoOoOoOoOOOOoOOOoOoOOOOOOOOOOOOOOOOOOOOO#OOOO",
+"-------------------=--=-=*-=*=**=*=&*&&&&&&#&#&#####+#++O+O+o+oXoooo.oo.oo..o..o...o..o.o.o.o..o.oo.oooooo.ooooooOXO+O+O+@+@######%##&#&#&&#&&%&$&#&$%&%$&$%$%$%$%$%#######+#+##O#O+OO+O+OoO+OoOoOoooOooOoooOoooOoOooOooOoOXOoOXOOXO+OOOO+@+@+##O#@########&#&##&##&&#&&$&#&&$&&$&$&$&&$&&&$*$&$*&&$*$*&*&$*&$*&&*&&*&*$**&$*&*&&$*&&$&&&$&$&$&$&$&#$&#$##&##$###$##@#@+@#O##OO#OOOO@OOOOOOOOOoOOoOOoOOoOoOoOoOoOooOooOooOooOooOoooOooOooOoOoOoOoOoOoOoOOoOoOoOOOoOOOOOoOOOOOOOOOOOOOOOOOOOOOOOO",
+"---------------------=-*=-*=*=*=**&*&&&&&&$&#&#%%##+#+#++O+Oo+oooXoooo.oo.oo.o..o.o..o.....o..o.o.oo.o.o.oooooooOoOoOOO+O+@+#+##%####%$%$&#&$%$&%&$&&&&$%&%$&#&#%$%##########O#+O+#O+#O+OO+OOoOoOooOooOoooOoooOooooOooOoOoOoOoOOXOOoOO+O#OO+O#O#O#+#+#########%$#&$#$$&$#&$&$&$&$&&&&$&&&$*&&&*&*$&*&*&*$&*$*&*$*&*$*$*&*$&*&&$*$*&$&*$&$&&&$&#&$&#$&#$#&$#$###$###@##@##O#O#O#OOO#O+OO+OOOOOOOOOOOoOOoOoOoOoOoOoOoOoOooOooOooOooOooOoOoOoOoOoOoOoOoOoOoOoOOoOOoOOOOOoOOOOOoOOOOOOOOOOOOOOOOOOOO",
+"-------------------------=-=*=*=&=*&**&&&&&&#&####%##+O#++O++oOXooXooooo.o.o.o.o.o.o.o.ooo.ooo.oo.ooooooooooooOoo+O+O+O+@+#+@#####&#&$%&#&#&#&&#&$%&##&#&$%&#%$%####%#####+###+@#+O#OO+O+Oo+oO+oooOoooooOoooOooOoOoooOooOooOoOoOOOXO+OO+O+O#O+#+#O##########&#$%$#&$&#&$&$&$&&$&&$&$&&*$*&$&*$*$&*&$*&&*&*&*&*&*&**&**&*&**$**&&*&$*&&*&$&$&&$&$&$&$#&#$#####$###@##O#+@+#O#O+O#O#OOOOOOOOOOoOoOoOOOoOOoOoOoOooOooOooOoOooOooOooOoOoOoOoOooOoOoOOoOOoOOoOOoOOoOOOoOoOOOOoOOOOoOOOOOOOOOOOOOOOOOO",
+"---------------------=-=-=-*-=*=*&*=&&*&&$&#&%$%%###+#+#+O++O+o+oXoooo.oooooo.oo.o.o.o.o.o.o.oo.oooo.oooooooOoooOOoO+O+O+#O########%$%#%$%$%$&#&$%&#&$%$%%$#%$#%$#%########+@+@++@+O++OOo+OOOoOoOoooOoOoooOooOooooooOooOoOoOoOOXOoOOO+OO+OO+@+@O#+#O#O##########&$#&#&$&&$&&$&&$&&$&*$&&$*&*$*&&*$**&**$*&*&*&***$&**&**&*&*&*$*$*&&*$&$*&$&$&$&$&#&#$&##$#$######O##@+@#O#O#O@+OOOOOO+OOOOOOOOOOOoOoOoOOoOoOoOooOooOoOooOoOoOoOooOooOoOoOOoOoOOoOOoOOoOOoOoOOoOoOOOOOoOOOoOOOOoOOOOOOOOOOOOOOOO",
+"-----------------------=-*-=*=*=*=*&*&&&&&&&#&#&#%####+#O++O+o+o+ooXooooo.o.oo.o.o.oo.oo.ooo.oooo.oooooooooooO+O+O+O+O#+@+#+####%$%$%$&#&&#&&#&$%&$&#&%$&#&#$%%$%#$######+@###O#O+OOOO+OOOo+oOoOoOoOoooOoooooooOoOoOooOooOoOoOoOOOOoOOO+OO+OO#O#O#O##########&####$#$&#$&#&$&$&&$&*&$*&*&&*$*&*&*&*&*&**&***&**&****&**&***&***&*&$*$*&&&$&&$&#&#$#$#$#$#####$#@###@+#@+O@+OO+OOO#O+OOOOOOoOoOoOoOOoOOoOoOoOoOoOoOoOoOoOoOooOoOoOoOoOoOoOoOOoOoOOoOOoOOoOOOOoOOOOOoOoOOOoOOOoOOOOOoOOoOOOoOOOOOO",
+"---------------------=--=-*-*-=*****&*&*&&&$&&$%#%##+##+#+O++O+oOo+ooooooooo.oo.ooo.oo.ooo.ooo.ooooooooooOooOooOo+OO+O+O#+#######%$%#%$&##&$#&$%&$%$%$&#%$%$%##########+###@+O+@+@+#O+OO+oOOoOoOoooooOooooOoOoOooooooOooOoOoOXOOoOXOO+OO+OO+@+O+#O#+#O#########$&#&&#$&$&$&$&&&$*&$&&*$&*$*&*&*&**&***&***&**************&***&**&***&&*$&*$&&$&$&#&$&##&##$######+@#O#O#O#O#O#O#OOOOOOOOOOOOOOOOoOoOOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOOOOoOOoOOoOOoOoOOOoOoOOOoOoOOOOOoOOoOOOOOOoOOOOoOoO",
+"--------------------=--=-*-=***=*=&**&&&&&&&#&#&#&####+##+#O+O+OXOXOXoooooooooooo.oooooo.oooooooooooooooooOO+O+OOO+O#+@##O##########&#&#$&#&#&#&#&%$%&#$%#%#$%$%#######@#+#+#@+@+OOO+OO+OOoOoOooOoOooooOooooooooOoOoOoOoOoOoOOoOOoOO+OOOO+@O+@#O#O#@###O####$####$#$&#&#&$&&$&$&&&*$*&*&**&*&*$**&**&***********************&***&$*&$*&*$&&$&$&$&$#&$#$######@#@@#@+#O#O#OOOOOOOO+OOOOOOoOoOoooOOoOoOoOoOoOoOooOoOoOooOoOoOoOoOoOoOOoOOOoOOOoOoOOOoOOoOOoOOOoOOOOoOoOOOOoOoOOOoOOOoOOOOOOoOOOOoO",
+"----------------------=-*-=*=*=***=*&*&*&&$&&#&#&##%####+#++++O+O+oOo+oXooooooooooooo.ooooooooooooooooooOOoOo+OO+O+O+O#++##+###%#%$%$%$%&#&#&#&$%$&%$##&#&$%#%#######+##+@#@+@+#O+O+O+OOoO+OXOoOoooOoOoooOoOooOooOooooOooOoOoOoOo+OOoOO+OO+OO+O+#O#+#O#########&#$#&#$&$&$&$&$*&*$&&*$&*$*&*&**&********&*********************&***&***&$*&*$&&$&#$&$###$#$##@###@#+#@@+@+O#O#+O+OOOOOOoOOOOOOOoOoOOOoOoOOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOOoOoOOOOoOOOOOoOOoOOOoOoOOOOoOoOOOoOoOOoOOoOoOoOOoOoOOO",
+"--------------------=---=-*-*=**=**&*&&&&&&&$&#$%$%####+#O#O#O++O+O+oOoOoXoooooooooooooooooooooooOoOoOOOo+O+OO+O+O+@#+@#@#######$%$%$&$&$&$&$&$%$%$&#&$##$##$#######@#@+@#+@+@+OO#OOOOOoOoOoOoOoOoOooooOooooooooooOoOooOoOoOoOOOOoOO+OOOO+O#O#O@+@+@####@#####$###&$#&#$&#&&$&&$&*&$***&**&******&*********************************&$*&*&$&&$&&$&$##&$#####$##@+#O#O+@O+O#OOOOOOOO+OOOOOoOooOoOoOooOoOoOoOoOoOoOoOoOoOoOoOoOOoOOoOoOOOoOOoOOOOoOoOOoOOOOOoOOoOOOOoOoOOoOOoOOoOOoOOoOOoOOoOOoOoOo",
+"------------------=---*-*-*-=**=****&*&*&*$&&$&&#&#%######+#+++O+O+O++o+oO+OooooooooooooooooOoOoOoOoOOo+OOOO+OO+OO#O+@#+#######&##&#&#&#&%$%$%$%&$%$%$#%$#%##########+###+@+@+O#OO+O+oO+OOoOoOoOoooooOooooooOoOoOooOooOoOoOoOoOXOOOoOOO+OOOOOO+O#O@+@+@+#########$##$#$#&$&$&&$&*$&*&&&&*&***&**********************************&*&**&*$&*$&&$&$&#&$###$####@#@#@#O#@+O#OOO+OOOOOOOOOOoOoOoOoOoOoOOoOoOoOoOoOoOoOoOoOoOOoOOoOOoOOoOOoOOoOOOOOoOOOOOOOoOoOOoOOOOoOOOOOoOOoOOoOoOoOoOOoOOoOOoOOOoO",
+"-------------------=-*-=-*=**=***=&**&&&$&&&&%$%$%$######+#O#O+O+O+OoOXOo+oOXOoOooOoOoOoOOoOoOoOOOOO+OOO+O+O+O+O+#O#+#+@########$%$#$%$&$%&#&#&#$%$%$%#$%#$######@#O#@#O#O#O+@+O+OOOOOOoOoOOoOoOoOoOoooOoOooooooooOooOooOoOOoOOoOO+OO+OO+OO#+@O#+@+@#@#@#O######$##&#&$&$&$&$&&$&*&$****&**&*****************-**-*******************&*$*&*&$*$&$#&$#$####$##@+#O#O#O+@OOO+OOOOOO+oOoOoOOoOoOoOooOoOoOoOoOoOoOOoOoOoOoOoOOoOOoOOOoOOoOOoOOoOoOOOoOOOOOOOOOOOOoOoOOoOoOoOoOoOOoOoOoOoOoOoOooOooOoO",
+"-----------------=--*-=**-*-=**=***&*&*&*&&$&$&&#&#%########+#+#++O+O+OO+OOXOO+o+OXOXOXOOoOOOOOOo+OXOO+O+O+O+O#+@+@+#@#########&##&#&#&#&#$&$%$&#&#&#%$%##############+@+@+@+O#OOO+O+O+OoOOoOoOooooooooooooOoOooOooOoOoOoOooOOoOOoOoOOOOOO+OOO+O@+@+#O+#+#@#@######$#$##&#&$&&$&*$&**$*&*****************-*-**-*-*-*-*-*-**********&****$&$&&$&&#$&##$#####@##@#O#@+@O+O#OOO+OOOOOOOOOoOoOoOoOoOoOoOoOoOoOoOoOoOOoOoOOOoOOoOOOoOOOoOOOOOOOOOOOOOOOOoOOOOOOoOOOOOOoOOoOOoOOoOoOOoOoOoOoOoOoOoOoOo",
+"--------------=-=-*-=-*-*=******&**&*&&&&&&&&$&#$&$#######O#O#O#O#+O+O+O+O+OOXOOo+OOOoO+o+OXO+O+OO+O+O+OO+O#O#+@+##@#########$%$%$#$&$%$&$%$&#$%$#$%$##$######@#@#O#O#O#O#O+@OO+OOOOOOoOOoOoOooOoOoOoOooOoooooOooOooOoOoOoOOoOOOOOOO+OO+OOOO#O#OO#O@+@#O@#####@###$##&#$&$&$&$*&&*&*&****&***********-*-**-*-*-**-*-*****-***********&*&**&$&&$$&#$####$#@#@#O#O#O+@O+OOOOOOOOoOoOoooOoOoOooooOooOoOoOoOoOoOoOoOoOOOoOoOOoOOoOOOoOOOoOOOOOOOOOOOOOOOOOoOOOOOoOoOoOOoOoOOoOoOoOoOoOooOooOoooooOoo",
+"------------=--*--*-**-=**=*******&*&*&*$*&$&&$&&#&%$########+#+#+O#O+O+O+OO+O+O+Oo++O+OOOOOOO+OO+O#O+O#+@+@+#O##@#+########&#%$%$&%$%$&$#&%$#&$%$%$%$#%#$#######+##@+@+O#O@+O#OOO+OoOOOOoOoOoOoOoooooooooOoOoooOoOooOooOOoOOoOo+OoOOOOOOOOOOOO#OO+O#O#O##O#O###$##&#$#&$#&$&&&$&$*$*&*&**********=*-**-*-*-*-*--**-*--*-**-*-********&*$*$&&$&&#$#&#$######O##O#O@+OOOOOO+OOOOOOoOOOooOooOoOooOoOooOoOooOoOoOoOOoOoOOOoOOOOOOOOOOOOOOOOOOOOOOOOoOOOOOOOOOoOOOOOOOoOOoOoOoOoOoOoooOooOoooOoOooOo",
+"---------=-*-*--*-*-**=**-**=***&**&*&$*&$&&$&%$#$#$%#########O#O##+#O#O+O++OO+O+O+OO+O++O++O+O+O#O+@+@+@+#+@###O###@####$##$#$%$%$&#&$%&$&$&#&#&#####$#####@#@#O#@+#O#@+O+OO+OO+OOOOOoOoOooOoooooOooOooOoooooOooooOooOoOoOOoOOOOOOOOO+OO+OO+OO+O#O@+@+@+@#@##@#####$#&$&#&$&$&*&*&***********-*-*-**-*-*-*-*-*-*--*-**-*-*****-*****&**&&*$&$&$#&$####@#@#O#O#O+@+OO+OO+OOOoOoOoOoooOooOooooOoooOoOooOoOoOoOOoOoOOOOoOOOoOOoOOOOOoOOOOOOOOOOOOOOOOOOOOOOOOOoOoOoOOoOOoOoOoOoooOoooooooOoooooooo",
+"--*-*-=*-*--*-**-*=*-**-**********&*&*&&&&&$&&$&&&#&#&#######+##+#O+#O+#+O#O+O+O+O+O+O+OO#O+O#O@+@+@+##@+#@###############%$#&#&#&$%$&#&$%$%$%$#$%$&$#%#######+###O#@+@+O#O#OO+OOO+Oo+oOoOoOooOoOooOooooooOooOooOoOoOoOoOoOoOoOoOoOO+OOOOOOOO#O@OO@+O@O#O#O#O###@####$###&$&$&&&$*$*&&******-***-**-*-*-*-*--*--*-*-*---*-*-*-*********&*$&&$&$&#$#$#$###@#@#@#O#OO#OOOOOOOOOoOoOoOoOoOooOoOoooOooOooOooOoOoOoOoOOOoOOOOOOOOOOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOoOoOoOooOoOooOoOoOoooooooooo",
+"*=-*=*-*-*-*-*-***-***=********&*&*&$&&*$&&&$&$%$#&#$###############O#O#O#O#O#O#O#O##O#+#O#@+#+#@+#@#O#+@#+@#+@#######$#$%$%$%$#$%$&#$%$%$&#$%$%$######$##@#@#@#O#+@+@+O@O+OOOOOOOOoOOOoOoOoOooooooooOoOooooOooooooooOoOoOoOoOOOOOOoOOOO+OO+OOO+O+OO#+@+@#+##O#####$##&$#$&&&$&$*&&***********-**-*-*--*--*-*--*---*-*-*-*-*-**-*****&*$**&$&&$&$&#######@+#O+O#OO+OOO+OOOoOoOoOoooooooooooooooooooOooOoOoOoOOoOOoOOOoOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOoOoOOoOooOoOoooooOooooooooooOoooo",
+"-*-*-*-**-***=**-************&**&*&*&*$&&$&$&$&#&$%$#%$%#######O#@+##+#O#+@+#O#+@+@+@+@+@+@+#@#O##@+##@#############$###%#$%$%$&#&$%$%$&#&$#&#&##%$##########+#O#O#O#OO#O+@O+O+O+oOOOOoOOoOooOoOoOoOooooooooooooOoOoOoOooOoOOoOoOo+OOOOOO+OOO+OO#OO#OOO+@+@O##@+@#######&#&#$&&*&&*$&*********-*-*-*-*-*-*---*---*----*--*-*-*-**********$&*$&$&##$#$##@#@#@#O#OO#OO+OOOoOOoOoOooOoOooOoooooooooOoooOoOoOoOoOoOOoOOoOOOOOOOOoOOOOOOOOOOO+OO+OO+OO+OO+OOOOOOoOOOOOOoOoOoOoOooOoOoooooooooOooooooo",
+"********-***-*************&*&*&*&*$*&$&&$&&&$&$&#&#&#$%$###########@+@##+@##O##@+##O###@####O####@##@####@######@##$##$&$#&$%$&#$%$%$&$#$%#$#$#$#$####@#@#@#@@#+@+@O+@+OOOO+OOOOOOOoOoOoOoOoOooooooooOooOoOoOoOooooOooOoOOoOoOOOOOOoOOoOOOOOOOOOOO#OO#O#O#O#O#####@###$#$#&$&$&$*$*********-*-**-*-*--*---*---*-----*---*--*-**-******&*&*$&&$&$$&######@+@+@O#OOOOOOOOOOoOoOooooooooooooooooOoooooooOooOoOOoOoOOOoOOOOOOOoOOOOOOOOOO+OOOOOOOOOO+OOOOO+OOOOOOoOoOOOoOoOoooOooooooOoooooooooooooo",
+"******=******************&**&*&*&&*$&&*$&&$&$&#&$%$%$%##&#############+#@#+###+##@##+@#+##O#################$#$#$#$%$&##$#$#&$%$&$%$&##&$&$&#%$############@+#O#O#O#OO@+O#OOOOOOOoOOoOoOoOoOooOoOooOooooooooooooOoOooOoOoOOoOOO+oOOOOOOOOO+OO+O+O+OO#OOO#O#O#O#O@#######&#$&&$&&&*&&*&*********-*-*-*--*-*--*------------*-*-*-**-******$&*&$&$#%$#$##@#@##O#OOO#+O+OOOoOOoOoOoOoOoooooooooooooooooOooOooOoOoOOOoOOOOOOOOOOOOOOOOO+OOOO+O@+O#OO#O@O+OOOOOOOOOOOOOoOoOooOoOoooOoooooooooooooooooo",
+"***=*****************&*&*&*&*&$*$*&&$*$&$&$&$&$&$%$&#$&##$%$########@##@##@##@###+#@##########@#####$#$#$#$##$#&#$%$##$&#&$&$%$&#$&#$%$%$###$##&#$##$@#@#O#+@@+@O#OO+OOOOOOOOOOoOOoOOoOoOoooOooooOoooOoOooOoOoOooOoOOoOoOoOOoOoOOOoOOO+OOOOOOOOOOOO+OO#OO#O#O#@#+@###$#$#&$#&&$&$*$********-*-*-*-*--*---------*------------*-*-******&**$&$&$&&$#######O#O#O#OOOOOOOOOOoOoOoooooooooooooooooooooOoooOoOooOoOoOoOOoOOoOOOOOOOOOOOOOO#O#OOOOOOOOOO+O@O+OOOOOOOOoOOoOOoOooOooOoooooooooooooooooooo",
+"******************&*&*&*&*&*$&*&&$&$&&$&&$&$&#&$#&$%$%$%$##%$###################@#######@#########$##$##$%$#$&#$#&$#&$%$&$&#$&$%$%$#&$&$%$%$%#$#########O##@#O#O#OO#OO#OO+OO+OOOOoOOoOoOoOoOoooOoooooooooOoooooOooOooOoOoOOoOOOOOOOOOOOOOOOOO+OOO#OOO+OO#OOO#O#O@#@######$#&$&$&*&**&*****-***-*-*-*---*---*----------*--*-*--*-*-*****&*&*&&$&$##$##@#@#@#O#O+@+OOOOoOoOoOoooooooooooooooooooooooooOooooOoOoOOOOOOOOOOOOOOOOOOO+O#OOOOOO#O#O#O#O@O+OOOO+OOOoOOOOOoOoOoOoooooooooooooooooooooooo",
+"************&*&*&**&*$*$*$*&*$&$*&&$&$&$&$&#&$&#&$%$&#$%$%$###$#$#########################$#$##$#$#$%$%$&$%$%$&$&$&$&$&$#&$%$&$&$&$%$##$&#$#$##$##$@#@###@O#O#O#O+@OO+OOOOOOOoOoOOoOoOoOoOoOoOooOoOoOooOooOoOOoOoOoOOoOOOoOOOoOOoOOOOOOOOO+OOOOOOOO#O@O+O#O#O#O##O######&#&$&$&&$*&********-*-*-*---*-----------------------*-*-********$*$&$&$#&$#####@+@+@OO#OOOOOOOoOoOooOoooooooooooooooooooooooooOoOoOoOOoOoOOoOOOOOOOO+OOO#OOO#O#O#OOOOOOO+O#O#O+OOOOOOOOoOoOoOooooOoooooooooooooooooooooo",
+"*&*&*&*&*&*&*&*&*&*$*&*&&*$&$&*&$&$*&$&&$&$&$$&$$&#&$#&$%$#%$%$%####$##$###$##$####$#$#$%$%#%$#&#&$&$&$%$%$&$&$#&$%$%$%$&#$&$%$%$##$&$&$#$%$##$#######@#@+##O#O#O@O+@OOO+OOOOOOOOoOOoOoOoOoOoooOoooooOooOooOooOoOoOooOoOoOOoOOOOOOOOoOOOOOOOOOOO+OOOO+OO@O+O@+@+@##@#$#$#$&#$&$*&*$*&****-**-*-*--*----*------------*---*-*--*-*-*****&**&*$&&$&######@##O#O#OOOOOOOOoOOooOoooooooooooooooooooooooooOooOooOoOoOOOOOOOOOOOOOOO@+OOO#OOOOOOO#O#O#O#OOOOO#OOOOOOOOOOOoOoOoOoooooooooooooooooooooooo",
+"&*$*$*$*&$*&$*$*$&&&$*$&$&&$&$&$&$&$&$&$%$%$&##&##$%#&##$%$$%$%$#$&##$%#$&##$%#$&$%$&#&$%$&$&#&$$&#$&$&$&$&$&$&&$&$&$&$&$&$&$&$&$&$%$%##&#$%$###$#@#@##O#O@O#OOO+OOOOOOOOOOOoOoOoOooOoOoooooOoOooOooooooooOooOooOoOoOOoOOoOOOoOO+oOOOOOOOOOOOOOOOO+OO@O+OO#OO#O#O#@######$#&&$&&$*&**********-*-*--*-*---*-----------------*-*-**-*****$*&$&$&$$#$##@#@+@#O#OO+OOOOoOOooOoooooooooooooooooooooooooooooOooOoOOOoOOoOOOOOO+OO+OOO#OOOO#O#O#OO#OO#OO#O#OOOO+OOOOoOOoOOooOoooOooooooooooooooo.o.o.oo",
+"*&*&*&*$*&*&*&*&&*$*&&&*&$&&$&&$&&$&#&$&$&$&$&$$&$%$$#$&$#&%$#$#&$#$#&$&##$&#&$%$%$#%$#&$%$%$&$&$&$&#&$&$&$&$&$&$#&$&$&$&$&$%$&$%$&#$&$$#$#$##$######O#O#@+#O@+@O#OO+OOOOOOoOOOoOoOoOoOoOOoOooooooooOoOoOoooOooOooOoOoOoOOoOOOoOOOOOOOOO+OOOOO+OOOOOOOO#OOO#OO#O##O#@##$#&#$$&&$&&*$&*******-*-*--*----------------------*---*-*-******&*$*&&$&#&#$####@#O#OO#O+OOOOoOoOoOoOoooooooooooooooooooooooOooooOoOooOOoOOOOOOOOOOO@OOOOOOO#OOO#OO#OO#OO#OOOO#O#OO+OOOOoOOoOOooOooooOooooooooooooooooooo",
+"$&$&$*&&$&$$&$&$*$&$&$$&$&$*$&$&$&$&$$&#$&#$%$%$#$&#&$%$%$$#&##$#&#&$##$$&$#$&$&$&$&$&$$&$&$&$&$&&$&$&$&&$&&$&$&$&$&$&#&$&#&$&$%$&$$##$%$&###$##@#@#@#@#O#O@+O@OOOOOOOOOOoOOOoOOoOoOoOoOooOooOoOoOoooooooOoOooOoOoOoOoOOOoOOOOOOOOoOOOOOOOOOOOOOOOO#OOOOOOOO#O#O#O######$#$&#$&*$*&*******-**-**-*--*-*----*---------------*--*-*******$*&&$&$#$#$###@#O+@O#OOOOOOOoOOoOoooooooooooooooooooooooooooooOoooOoOOoOOOOOOOOOOO+OO+@O+@+@O+@OO#OO#OO#OO#O#OOOOOOOOOOOOoOoOooOooOoooooooooooo.oooooo.oo",
+"&$*$&$&$*$&&*$&$&$&*$&$&$&$&$&$&$&$&$&#$&#$&$&$&$%$#$%$#&$%$#$#&$#$$%$&#&#&$&$%$&$%$&$&&&$&$&$&&$&$&&$&&$&$&$&&$&&$&$&$&$&$$&$&$&$#&$&#$##$#$##$####O##O#O#OO#O#OO+OOOOoOOOoOoOoOoOoOoOooOooOoooooOoOoOoOooooOoOoOoOoOOoOOOOoOOoOOOOOOOOOOOOOOOOOOOOO#OOOO#OOOOO@O#@#@#$##$&$&$&&$*$&******-**-*-*-*---*-----------------*---*-*-*****&*&*$&$&$&$######@#O#O+OOOOoOOOoOoooOooooooooooo.oo.ooooooooooooOoOoOoOOoOOoOOOOOOOOO@O+OO@O+OO#O#OO#O#O#O#O+O@+O#O+OOOOoOOOOoOooOoooooooooooooooo.oo.oooo",
+"&&$&&$&$&$&$$&&$&&$&$&&$&$&$&$&$&$#$&$$&$$#$##$#&#$&$#$&$#$&#&$&#&#&$#$$&#$%$&$&#$&$&#$$&&$&&$&$&&$*$&$&$&&$&&$&$&&$&$&$&$&$%$&$#&$#$#$&$#######@#@##O@#O@O#OOOOOOOOOOOOOoOOOOoOOOoOoOoOooOooOoOoooooooooOoOooOoOoOoOoOOoOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOO#OOO#O#O##O#@####$#$#&$&$*&**&*******-*-*-*-*----------------*--*--*-*-*******$*$&&$&$#####@#@O#O#O#OOOOOOOoOooOoooooooooooooooooooooooooooooooooOoOoOOOOOOOOOO+OO#OO@O#OO#O#OO#O#OOO#OOO#OO+O@OOOOOOOOOoOoOoOoooOooooooooooooooooooo.oo",
+"$&$&$&$&$&$&&$&$&$&$&$&$&$&$&$&#$#&$#&#$%$&%$&#$#&$#&#&#$#&#$&$#$&$#$&#&#$&$&#$&$&&$&$&&&$&&$&&*$&*$&&*$&*$&*$*&*$&$&&$&$&$&$&$&$#$#&#$###$$#$#@###@#@#O#O#OO#OO+OOOOOOoOOOoOoOOooOoOoOooOoOooooOoOoOoOoOooOoOooOoOoOOoOOOOOoOOoOOOOoOOOOOOOOOOOOOOOOOOOOOOOO#OOO#O@#@#@###&$&$&&$&&$***********-*-*--*-*-*-*--*---------*--*-*-********&*$&&$&#$######O#O#OOO+OOOOOoOOooOoooooooooo.ooo.oo.oooooooooOoOooOoOoOoOoOOOOOO#OOOO+OO+O@OO#O#OO#O#OO#OO#O#OO+OOOOOOoOOoOoOooOoooooooooooooo.ooooooooo",
+"&$&$&$&$&$&$$&$&$&$&$&$&$&$#$#$&$&$#$#$#&$#$#$#&$##$#$#$%$$&$#&$&$&$&$&$&$&$&$&$&$&&$&$&$&$&&$&$*&$*&$*&*$*&$&&$&*$*$&&$&$&$&$&$&$&#$#&$#$######@#@#O#O#OOOOOOOO@OOOOOOOoOOOoOooOOoOooOoOoooOooooooOoooOoOoOoOoOoOoOOoOOoOoOOOOOOOoOOOOOOOOOOOO+OOOOOOOOOOO#OO#O#O#O####$#$#$#&$*&&**&******-*-*-*-*-*--------*---*-*--*--*-*********&$&$&&$$&#$##$#@@+@OOOO#OOOOoOoOooOoooooooooooooo.oooooooooooooooooOoOoOOOOOOOOOOOOOO+@O#O#O#OO#OO#O#OO#O#O#OOOO#O@O+OOOOOOoOOooOoooOoooooooooooooo.oo.oo.o",
+"&$&$&$&$&$&$&$&$&$&$&$$&#$&$&&$#&#$#&#&$#$&#$&#$#$&#&$&#$&%$#&#$&#$&#&$&$&$&&$&&&$&$&&&$&&&*$*&*&&*$*&*$&*$&*$*&*$&&&$&$&&$&$&$&#$#$&#$####$##@##@+@#@#O#O#O#O@+OOOOOOoOOoOoOoOOooOooOoooOoOooOoOoOooOooOoooOoOoOoOoOOoOOOOOOOOoOOOOOOOOOOOOOOOOO+OOOOOOOOOOOOOOO@O#@#@##$##$&$&$*$&$************-*-*-*-*-*-*--------*---*-*-*-*-***&****&$&&#$####@#@#O#O#OOOOOOOoOOoOooOoooooooooooooooo.oooooooooOooOooOoOoOoOOOOOOOOO@O+OOOOOOO#O#O#OOO#OOO#OO#O#OO+OOOOOOoOOOoOOooOoooOoooooooo.ooooooooooo",
+"$&$&$&$&$&$&$&$$$&$#$#&$$#$#$#$&$$#&$$#$##$#$#$#$&#$#$#$&#$&$$&$&$&$&$&$&$&$&$&$&&$*$*$**$*$*&*$**$*&*$*&$*&$*$*$*$*$*$&$&$&#$&$$&#$#$#$#$##@$#@##@#O+@O@OOOOOOOOOOOOoOOOOoOoOoOoOoOoOoOooOoOooOooOoOoOooOoOoOoOoOOoOoOOoOoOoOOOOOOOOOoOOoOOOOOOOOOOOOOOOOO#OO#O#O#O#O#@###$#$#&$&$*&*$*******-*-*-*-*-*-*---*-*-*-*--*-*-*-*-*******$&$&$&$$#&#$###+#O#O#OO+OOOOoOoOooOooooooooooo.oo.oooooooooooooooooOoOoOOOOOoOOOOOO+OOO@OO#O#OOOOOO#O#OO#OO#OOOOO#OOOOOOOOOoOoOooOooOoooooooooooooo.oo.oo.o",
+"$&$$$&$#$$#$#$#&#$#$&$$&#$&#$&#$##$$#$#$&$#$&#$&$#$$&$&$#$$$#&$&$$&$&$&$&$&$&$&$*$*$&&*$*$*&*$*&*$*$*&*$**$*&*&*$&*&$&*$&$&$&$#&#$$#$#$##$#$##@##@#O#O@+O#O#O+OOOOOOOOOOoOoOOoOoOoOoOooOoOoOooOooOooooooOooOooOoOoOoOOOoOOOOOOOoOOOoOOOOOOOOOOOOOOOOOOOO#OOOOOOOOO#O@#@##$##%$&$&$&$*$*&***********-**-*-*-**-*-*--*-*-*-*-*********&**&*&$&&$$###@#@#O#OOO#OOOOOOOoOoOooooooooooooooooo.oooooooooooooOoooOoOoOoOOOOOOOOOOOOO#OOOOOO#O#O#OOO#OO#OO#O#OO@O+OOOOOOoOOoOooOoooooooooooooooooooooooo",
+"#$#&$#$&$%$&$&$$&$#&#$#$#$#$#$#$&$##$#&##$#$#$#$#$##$#$&$#&$&$#$&#$&$&$&$&&$*&$*$&*&*$*&&*$*$*$*$**&*$**&$*$*$*$*$&$*$&$*$&$&$&$$%$&$##$###@#@#@#O#@O#O@+OOOOOOOOOOoOOoOOoOoOoOoOoOooOooOoooOoOoOooOoOoOooOoOooOoOoOoOoOOoOOoOOOOOOOOoOOOOOoOOoOOOOOOOOOOOOO#O#O#OO#+@#O###$#$#&$&$*&&*$*$***********-**-**-*-*-*-*-**-*****-******$*$&$&$&$####$##@#O#O#O#OOOOOoOoOoOooOoooooooooooooooooooooooooooooooOooOoOOOOOoOOOOOOO+OOOO#O#OOOOOOO#O#OO#OO#OOOO+OOOOOOoOOOoOoOoOooOooooooooooooooo.oooooo",
+"&$#$#$#$#$&$#$#$#$#$$#$#$&#$&$#$#$#$#$#$$#$##$#$##$&$&#$#$&$#$&$&$&$&$&$&$*$&$&&$*&$*$*$*$*&**&***$*$**$*&**&*$&*&*$&*$&$&$&$&$#$&$##$##$#$#####@#O#O#OO@OO#OOOOOoOOOOOoOoOOoOoOoOoOoOoOooOoOooOooOoOoOooOooOoOoOoOoOoOoOOoOOOOoOOoOOOOOOOOOOOOOOoOOoOOoOOOOOOOOOO#O@+@##@####$#$&$&$*$&******************-**-**-***-***-*-*********&*$&&$&$&#$###@#+@#O#OOOOOOOOOOOoOoOoooooooooooooo.oooooooooooooooooOoOoOOoOoOOOOOOOOOOOOOOOOO+O#O#O#OOO#OOO#OOO#O#OOOOOOOOoOOoOoOoOooOoOooooooooooooooooooo",
+"#$#$#&$#$##$#$#&#$###$#&##$###$####$##$###$#$##$&#$##$#$&#$#&$&$$&$&$&$*$&$&*$*$*$*$*&&*$*&*$*$*$****&$**$*$*$*&$*$&$&$*$&$&$#$&#$#$#$##@#@#@@#@+@#O#OO#OOOOOO+OOOOoOoOOoOoOoOoOoOoOooOoOooOooOoOoOooOoOoOoOoOoOoOOoOOOoOoOOoOOOOOOOOOOoOOOOOOOOOOOOOOOOOOOOOOO+@OO#O#O#@####$##&$&$&$*$*$*$************-*****-***-***-**********$*&$*&$&$&$#$###@##@OO#OO#OOOOOoOoOooOooOoooooooooooooooooooooooooooOoooOoOoOOOOOOOOOOOOOOO#OOOO#OOOOOOOO#OOO#OOO#OOOOOO#OOOOOOoOOoOoooOooooooooooooooooooooooo",
+"$#&#$##$##$#$###$#$#$#$#$##$#$##$#$##$#####$##$##$##$#$#$#$&$#$&$&$&$&$&&$*&$*&&$*&&*$*&*$**&***&*&*$***$**&*&*&*$*$*&&$&$&$&$&$$##$###$##@##@#O@#O#OOOOO#OOOOOOOOOOOoOoOoOoOoOoOoOoOooOooOooOoooOoOoOooOoOoOoOoOOoOoOoOOOoOOOOoOOoOOoOOOoOoOoOOoOOOOoOOOOOOOOOOO+OO#O#O#@#@##&#$$$&$&&$*&**********************-*****************$&*&$&$&##$#####@#O##O#OOO+OOOOoOOoOooOoooooooooooooooooooooooooooooOoOooOOoOoOoOoOOOOO#OOOOO+OOOO#O#O#OOO#OOO#OO#OOO#OOOOOOoOOOoOoOoOooOoOoOooooooooooooooooo",
+"#$##$#$##$###$$###$##$##@$#####$######@$#@$##$##$#$$#$#&$&$#$&$&$&$&$&*$*$&$*$*$*$*$*&*$**$**$*$**$***$**&*$*$*$*&$&$*$&$&$$&$#$#$##$#@#@##@#@#@OO#O@O#OOOOOOOOOoOoOoOoOoOoOoOooOoOoOoOooOoOooOoOoOoOoOoOoOoOoOoOoOOOoOOoOOOoOOOOOOOOOOOOOOOOOOOOOoOOOOoOOOOOOOOO@O#O@#@#O###$#$##&$&$*$&$*$*$********************************$*&*&*$&$&$&$###$#@#@+@OO#OOOOOOOOOOoOoOoOooOoooooooooooooooooooooooooooooOoOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOO+@OOO#OOOOOO#OOOOOOOOOOoOOoOoOoOoOooooooooooooooooooooo",
+"##@$####$#$#$##$#$##$##$###$@$@##@#$@$##$###$##$#$##$#$#$#$$&$$&$$&$&$$&$*$*$*$*&*&*$*$**&**$***$***$***$*$**$**$*&*$&$*$&$&$$$&#$#$#$#$#@#@#@+@##O#OOOOOOOOOOOOOOOOoOOoOoOoOoOoOoOooOooOoOooOoOoOoOoOoOoOoOoOOoOOoOoOOOOOoOOOOoOOOOOOOOoOOOOOOoOOOOOOOOOOOOOOOOOOOOO#OO@#@#@#$#$&$$$&$&*$&$**$*$**************************$*&*&*$*$&$&&#$&#$#######O##OO#O#OOOOoOOoOoOooOooooooooooooooooooooooooooooOooOoOoOoOoOoOOOOOOOOOOOO#OO#O#O#O#OOO#OOOO#O#OOOOO+OOOOoOOOoOOoOoOooOoOoOoooooooooooooooo",
+"#$##@$#@##@##@#@#@#$#@#@#@#@###$@$#@##@#@#@$#@$##$#$#$#$#$&$#$&$$&$$&*$&$*$&&$*$*$*****$*$****$***$***$****$**$*$*$*$*$&$$&$&#$$$#$#$#@#@#@#@@@#OO@OO#OO#OOOOOOoOoOoOoOoOoOooOoooOoOooOooooOoOoOooOoOoOoOoOOoOoOOoOOOOoOoOOOOOOOOOoOOOOOOOoOOoOOOOoOOoOOOOOOOOOOOOO#O@O##O#@######$&$&$&$&*$&$***$*$********************$***&*$*$&&&$&$$&$#$##@#@@O#@OOOOOOOOOOOOOOOoOoOooOooooooooooooooooooooooooOoooOoOoOoOOOOOOOoOOOOOOOOOOOOOOOOOOOOO#OOO#OOOOOO+OOOOOOOOOOoOOoOoOoOoOoooooOooooooooooooooo",
+"@#@#$@#$@$#$#$#$#$@#@#$#$#$@#$@##@##@#$@#$##@##@$##$#$#$&$#$&$$&$&$*$$$*&$*$*$*$*$*$$*$*****$*******$*****$***$*&*$*$&$&$&$$$$#&#$#$#@##@#@#O#O@O#O#OOOOOOOOOOOOOOOOoOOoOoOoOooOOooooOooOOoOoOoOoOoOoOoOoOOoOOOOoOOoOoOOOOOOOoOOOOOOOOoOOOOOOOOOOOOOOOOOOoOOOOOOO#OOOO#O@#@#@#@$#$###$$$&$&$&*$&$*$*$*$*$**$*****$**$*$&**&$*$*&&&$&$&$&#$######@##O#O#O#O+OOOOOOoOoOOooOoooOoooooooooooooooooooooooooOooOoOoOoOoOoOOoOOOOOOOOOOOOOOOOOO+OOO+OO#OO+OOOO@+OOOOOOOOOoOoOoOoOoOoOoOoooOoooooooooooo",
+"#@$#@##@##@#@#@#@##$#@#@@#@#@#@#@#@$#@##@#@$#@$##@$#$#$#$#$#$&$$$&$$&*$$&$*$*$*&$*$**$**$*$*****$*******$***$**$*$*$&*$$&$&$&$$$$#$##$#@#@#@@#@+@O@OO#OOOOOOOOoOoOoOOooOooOoOoOooOoOoOoOooOoOoOoOoOoOoOoOoOOoOoOOoOOOOOoOOoOOOOOOOOOOOOOoOOOoOOoOOoOOoOOOOOOOOOOOOO#O#O@O#@#@###@##$#&#$&$&$&$&$&&&$*$*$*$*$*$$*$*&$*&*$*$&*$&$&$$&$&$##$##$##@#O#O#OOOOOO@OOOOOOOOOoOoOoOoOoooooooooooooooooooooOoOoOooOoOoOOoOOOOOOOOoOOOOOOOOOOOOO+OO@OOO@OOOOO#OOOOOOOOOOOOOoOOOoOoOooOoOoOooOoooOoooooooooo",
+"@##@#@$#@#@#@#@#@#@#@#@##@##@#@#@#@#@#@#@#@#@##@#$@####$#$&$#$$#&$$&$$&*$&$*$&*$*$**$**$******$***$***$***$**$**$*$*&$$&$$&$$####$#$#@#@#@#@#@O@O@O#OOO@OOOOOOOOOoOOoOoOoOoOooOoOoOoOoOooOoOoOoOoOoOoOoOOOOoOOOoOOOoOoOOOOOOOOOOOOOOoOOOOOoOOOOOOOOOOOOoOOOOOOOOOOOO@OOO@#O@#@#@##$##$#$#$$&$&$&$$*$&&$&*$&*$**$&*&*$*$&&&$&$&&$&$&#$#$##$####@#@#@#O##+@+OOOOOOOOoOOOoOoOooooOooooooooooooooooooooooooOoOoOoOOoOoOoOoOOOOOOOOOOOOOOOOOOOO+OOOOOOOOOOOOOOOOOOOOOOoOoOOoOoOoOoOooOoOoOoooOoOoOoOo",
+"#@@#@#@#@#@#@$@#@#@@#@$@@#@@#@#@#@#@@#@@#@#@#$@#@##$$@$#$#$$&$&$$&$&$&$$*$*$*$*$*&*$*****$*$********$***$***$**$*$*$$*$&$&$$#$$$$##$@#@#@@@@O@+@O#OOO@OOOOOOOoOoOOoOoOoOoOooOoOooOoOooOoOoOoOoOoOoOOOoOOoOoOOoOOOoOOOOOOoOOOOOOOoOOOOOOOOOOOOOoOOoOOoOOOOOOOOOOOO@OOO#O#OO#O#@@#@##@$##$#&#$$&$&$&$&$&$&$&$&&$&&$&$&&$&$&$&&$&$&$&$&##&#$###@#@+@+O#OOOOOOO+OOOOoOOOoOoOoOoOoOooooooooooooooooooOoOoOoOooOoOoOoOOOoOOOOoOOOOOOOOOOOOOOOOOOOO+OO+@OOOOOOOOOOOOOOOOOOoOoOoOoOoOoOoOooOoOoOoooOoooO",
+"@@#@#@#@@#@@#@#@#@#@#@#@#@@#@@#@@#@@#@@#@#@#@@#@#$@#@##$#$#$#$$&$$&$$$*$*$&$*$*$*$**$*$*$*****$*$*$*******$***$**&*$*&$&$$$$&$#$##$@#@#@@##@+@@O@OO@OOOOOOOOOOOOoOOoOoOoOooOoOoOoOoOoOoOoOoOoOoOoOOoOOOoOOOoOOOOOOOOOoOOOOOOoOOOOOOOOOOOOOOOOOOOOOoOOOOOOoOOOOOOOOOOOOOOO@O#@O#@#@###$##$#$#$#$$&$&$&$&$&$&$$&$&$&$&$&$&$&$&$&#$&#$#$#$#######@#+@#OO#O#O#OOOOOOOOoOOOOoOoOoOoooOoOoooooooooooOooOoooOoOoOoOoOOOOoOOOoOOOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOoOOOoOoOOoOoOoOoOOoOoOoOoOoOoOo",
+"#@@#@@@#@@#@@#@@@@#@@#@#@#@@#@@#@@#@@#@@#@@#@#@#@#@$#$@#$$#$$#$$$&$$*$&$&$*$*$*&*$*$***$**$*$********$*****$*$**$*$&$$*$$&$#$$#$#$@#@#@#@@O@@O@OO#OOOOOOOOOOoOoOOoOOoOoOoOoOooOoOoOoOoOoOoOoOoOoOOoOOoOOOoOOOoOOoOoOOOOOoOOOOOOOOOOOOOOOoOOOoOOOoOOOoOoOOOOOOOOOOOOO@OO@#O@O@#O#@#@#@###$####$##$#$#$&$$&$$&$&$$&$&$#&$#&$$#$$#&#$#######@#@#O#O@O#O#OOOOOOOOOOOOOOOoOoOoOoOooOoooooOoooooooOoooOooOooOoOoOoOOoOoOOoOOoOoOOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOoOOoOoOoOoOoOoOoOooOoOoOoOoO",
+"@#@@#@#@@#@@#@@#@#@@#@@@@@@#@@#@@#@@#@@#@@#@#@#@#@#@#@$#$#$#$$#$&$$&$&$*$*$*$*$*$*$**$**$***************$*$****$*$*$*$$&$$&$$#$#$@#$@#@@#@#@+@O#OO@OO@OOOOOOOOOOoOoOoOoOooOooOooOoOoOoOoOoOoOoOOoOOoOOOoOOoOOOOOOOOOOOOOOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOOOOOOOOOOOO#O@O@O#O#@#@#@##$#$##$#$#$#$#$#$&#$#$&$#$&$#$&$#$&###$##$##$#@####@#@#O#O#OOO#OOO+OOOOOOOOOOOoOOoOoOooOoOoooooooOoooOoooOoOoOoOoOoOoOOOOoOoOOOOOoOOOOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOoOOOOoOoOOOoOOoOoOoOoOOoOoOoOoOo",
+"@@#@@#O#@@#@O#@#@@#O@#O#O#O@+@@+@@+@O#@O#@@@@#@@#@#$@#$@#$#$#&$$$$&$$&$$&$&$*$*$**$*$**$**$***$***$***$*****$*$*$*$*$&$$&$$#$#$#@##@#@#@O@O@O@O@OOOOOOOOOOoOoOoOoOoOooOoOoOoOoOoOooOoOoOoOoOOOoOOOOOOOOOOOOOoOOoOOOOoOOOOOOOOOoOOOoOOoOOOOoOOOoOOOoOOOOoOOOOOOOOOOOOOO@OOOOO#O#@@@O#@#@#@#@#######$###$#$#$#$#$#$#$#$#$#$##$$#$##$##$##@#@@#O#O#O#OO@OOOOOOOOOOOOoOoOoOOoOoOoOoOoOoOoOoOoOooOooOoOooOooOoOoOoOoOoOOOOoOoOoOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOOOOOoOoOOOOoOoOOoOOOoOOoOoOoOoOoOoO",
+"@+@@+@@@@#O#@#O@@+@@#@@#@@#@@#@@#@@@#@@#@@#@#@#@$@#@#@#$#$#$$$#$&$$&$$&$*$*$*$*$*$***$******$*******$******$*$*$*$*$&$*$$&$#$$##$@#@#@@@#@#O@O@OOO@OOOOOoOOOOoOoOOOoOoOoOoOoOoOoOoOoOoOoOoOOoOOOoOoOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@OO@O#OO#O#O@@#@#@#@#@$##$#$#####$#$#$#$#$#$#$##$##$##$###@#@#@##@#O@#O@O#OO#OO#OOOOOOOOOOOOoOOoOOoOoOoOooOooOooOooOooOooOooOooOoOoOOOoOoOoOOOOOoOOOoOoOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOOOOoOOoOOoOOoOOoOoOOoOOoOOoOO",
+"@@#@@#O#@O@@@@#@#@@#O@#O@#O@O@O#O@+@O@+@@#O@@@#@#@#@$#@#$@#$#$$&$$&$&$*$&$*$&*$*$*$*$**$*$*************$**$***$*$*$*$$&$$$$&##$@##@#@#@#OO@O#O@O@OOOOOOOOOoOoOOoOooOoOoOoOoOoOoOoOoOoOOoOOoOOoOOOOOOOOOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOOOOOOOOOoOOoOOoOOOOOOOO#OOO#OOO#@O#@##O#@#@#@#@#@#@##@#$######################@#@#@#@#@#@O#O#O#O#O@OOOOOOOOOOOOOOOOoOOoOOoOoOoOoOoOoOooOooOooOooOooOooOoOoOOooOOoOoOOoOoOOOoOOOOOOOOOOOOOOOOOOOOOOOOOoOOoOOoOOOOoOoOOOOoOOoOOoOOoOOOOoOOoOOoOOo",
+"#@O#O@@O@#@#O#O@O@O@#O@#@O@#@#@@@@@@#@@@O@@#O#@@#@@#@$#@#$#$#$#$$&$$$$$$*$&$*$*$*$*$**$*****$**$*$**$***$***$*$*&*$&$&$$&$#$$@$#$@#@#@@O@@O@O@OOOOOOOOOOoOOOOoOoOoOoOoOooOooOooOoOoOOoOOoOOoOOOOoOOOoOOOOOOOOoOOOOoOOOOoOOoOOoOOOOOOOOOOOOOoOOOOoOOoOOoOOOOOOOOOOoOOOOOOOOOOOOO@OOO@OOO@#O#O@#@#@#@#@#@#@#@#@$#@#$#@#$#@#$@#@@#@##@#@#O#O##O@#O@O#OOO#OO#O#OOOOOOOoOOOoOOoOOoOOoOoOooOoOoOoOoOoOoOoOoOoOoOoOoOOoOoOOoOoOOoOoOOoOoOoOOoOOOOOOOOOOOOOOoOOOOOOOOOOoOOOOOOoOOOOOOOOOOOOOoOOOOOOOOoOO",
+"@O@@@#O#@O@O@@@#@#@O@@O@O@O@OO@+@O@O@O#O#@O@@@O@@#@#@#@#@$#$#$$#$$$&$&$&$*$*$&$**$**$**$**$***************$*$**$$*$*$$&$$$$#$##@#@$@@#O#@O#O@OO@O@OOOOOOOOoOoOoOoOoOoooOoOoOoOoOoOoOoOoOOOOOoOoOOOOOOOOOOOOOOOOOOOOOOoOOOOOOOOOOoOOoOOoOOOOOOoOOOOOOOOOOOOOOOoOOOOOOOOOOOOOOOO#OO#OO#@O#O@#O#O@O@O#@#@#@#@#@##@#@#@#@#@#@##@##@#@#@#O#@#O@O#O@OOOO#OOOOOOOOOOOOOOOOOOoOOoOOoOOoOoOoOoOoOooOoOooOooOoOoOoOoOoOoOoOOoOOOOoOOoOOoOOOOOOoOOOOOOOOOOOoOOOOOOoOOoOOoOOOOOoOOOOOoOoOoOoOOoOOOoOOoOOOOOO",
+"@@O#OO@@O@@O#O@OO@O@O#@O#@O#O@@O@O@+@O@O@O@#O#@#O@#@@@#@$#@#$#$$#$&$$$&$$*$$*$*$*$*$*$**$*****$*******$*$*****$**$*$$&$$&#$$#$@$@#@#@@@@O@O@OO@OOOOOOOoOoOoOOoOoOoOooOoOooOoOoOoOoOOoOOOoOoOOOOOOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOOOOoOOoOOoOOoOoOOOOOOOOOOOOOOOOOOOOOO#OOO#OO#O@O#O#O#O#O@O#O#@#@@#@#@#@#@#@#@#@#@@#@#O@#O#O#O#O#O#O#OOO#O#O#OOOOOOOOOOoOOOOOoOOOoOOoOOoOoOoOoOoOoOoOoOoOooOoOoOoOoOoOoOoOoOOoOoOOOOoOoOOOOOoOOOOOoOOOOoOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOO",
+"O@O@@@O@O#O@@O@O@O#@O@O@O@O@@O@O@+@O@O@O@O@O@@O@@#O@#@#@#@$#$#$#$$$$&$$$*$&*$*$*$*$*$*$**$*$****$**$******$*$$*$$*$&$$$&$$#$#$#@#@@#@+@O@O@O@OOO@OOOOOOOOOOoOoOooOoOoOooOooOooOoOoOoOOoOOOOOoOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOOoOOOOOoOOOOOoOoOOOOOOOOOOOOOOOOOOO@OOO@OO#O@O@O#O@O#O@@OO#O#O@O#O@O#O#O@#O@O#O#O#O#O@@O@O@OOO#OO@OOOOOOO#OOOOOOOOOOOoOOOOoOOOoOOoOOoOoOOoOoOoOoOoOoOOoOoOoOOOoOoOoOoOoOoOOoOoOOoOOoOoOOOoOOOOOoOOOOOOoOOOoOOoOOOOOOoOOOOOOOOOOOoOOOOOOOOOOOOOO",
+"#O@O#O@#O@@O#O@@+@@O@O@@O@O@O@+@O@O@O@O@#O@#O@O#O@#@@#@#@#@$#$#$$&#$$$&$*$$$$$*$*$**$**$****$*$*******$*$**$**$**$$*$&$$$$#$@$#@#@#@@@@@#O@OOO@OOOOOOOOoOOoOOoOoOoOoooOooOoOoOoOoOoOOoOOoOoOOOOOOOOOOOOOOOOOOOOOOOOoOOOOOOOOOOoOOOOOOOOOOOOOOOOOoOOOOOoOOOOOoOOOOoOOoOOOOOOOOOOOOOOOOOOOO@OO@OO#OO#OOO#O#O#O@O#O#O#O#O@O#@O#O#OO@O#O@O#OO#OO#O#OOOOOOOOOOOOOOOOOOOOOOOOoOOOOOoOOoOOoOOoOoOoOoOOoOoOoOooOoOoOoOoOoOoOoOOOoOOoOOOOoOOoOOOOoOOOoOoOOOoOOoOOOoOOOOOOOOoOOOOOOOoOOOoOOOOOoOOoOOOOOOOO",
+"@O@@O@O@O@O@O@O@O@O@O@OO@O@O@O@O@O@O@O@O@O@O@@@O@@O@@@@@$@#@$#$#$$$$&$$$$&*$*$$*$*$$*$**$*$****$*$*$*$***$*$*$*$$*$$$$$&$#$$#@@$@@@@+@O@O@O@OOOOOOOOOOoOOoOoOoOoOooOOoOoOoOoOoOoOOoOoOOoOOOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOOOOoOoOOOoOOoOOOOOOOOOOOOOOOOOOOOO@OOOO@OOOOOOOOOOOOO@OOOOOOOOOO@OO@OO@OOOO#O@O#O#OO@OOO#OOOOOOO@O#OO#O@O#OOOOOOOOOOOOOOOOoOOOOOOOOoOOoOOOoOOOoOoOOoOoOOoOoOoOoOOoOOoOoOoOoOoOooOOoOOoOoOOOoOOOOOOoOOOOOOOOOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"@O@O@@O@O@@O@@@O@O@O@O@O#@O@O@O@O@O@O@O@OO@O@O@@O@@@#@#@#@$#$@$$#$#$$$$*$$$$*$*$*$*$**$*$**$*$********$*$**$*$*$*$*&$&$$$$$#@$#@#@#@@@@O@O@OO@O@OOOOOOOOOoOOoOoOoOOooOoOoOoOoOoOOoOOOOOOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOOOoOOOOOOOOoOOoOOOoOOOOOOOOOOOOO@OOOOO@O@O@O@O@OOOOOO@O@O#OOO#OO#OO#O@OOO@OOO#OO#O#OOO#O#O#OOOOOOOOOOO#OOOOOOOOOOOOOOOOOoOoOoOOOoOOoOOoOoOOoOoOoOOoOOoOOoOoOoOoOoOoOoOoOoOoOoOOoOoOOoOOOOOOoOOOOoOOoOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO+O",
+"@O@O@O@O@O@O@O@@O@O@@O@@O@O@O@O@O@O@O@O@O@O@O@+@@#O@@@@@#@#@#$#$$$$$&$&$$*$&$$$$*$*$*$*$*$****$*$**$****$*$*$*$$*$$$$$$#$#$@$#@@@@@@O@O@O@O@OOOOOOOOOOoOoOOoOoOoOooOOoOooOooOoOoOOOoOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOOoOoOOoOOOOOOoOOOOOOOOOOOOOOOOOO@OOOOOOOOOOOOOOOOOOOOOOO@OOOOOO#OOO#OOOO@OOO#OOOO#OOOOOOO#OO#OO#OOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOoOOoOOOoOOoOOoOoOoOoOoOOoOOoOoOOoOOoOOoOOoOoOOOOoOOOoOoOOOOoOOOOOOOoOOOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO",
+"O@O@O@O@O@O@O@OO@O@O@O@O@O@O@O@OOO@OOO@OO@O@O@@O@O@#O@#@@#@@$@$@#$#$$$$$&$$$$*$*$*$*$*$*$**$*$****$**$*$*$*$*$$*$$*$$&$$$$#$#@#@#@#O#@@@O@O@O@OOOOOOOOOOOOoOoOoOoOoOooOoOoOoOoOOoOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@OOOOOOOOOOOOO#OOOO#OOOO@OO#OOOOOOOOOOOOOOOOOOOOOOOoOOOoOOoOOoOOOoOOoOOOoOOoOOOoOOoOOoOOOoOOoOoOOoOoOoOOoOoOoOOOoOoOoOoOOOoOOoOOoOoOoOOOOOOOOOoOOOOOOOOOOOOOOOOOOOOOOO#OOO@OO",
+"@O@O@O@O@O@O@O@@O@O@O@O@O@O@OOO@O@OO@OO@OO@O@O@O@@@O@@@@#@$#@#$$#$$$#$$$$$*$*$$$*$$*$*$**$*$**$*$***$***$*$*$*$$$*$$$$$#$#@$@@@@@@@@OO@O@OOOOOOOOOOOOoOOoOOOoOoOoOoOoOoOoOOoOOoOOOOoOoOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOoOOoOOOOOOoOoOOOOOoOOOOOOOOOOOOOOOOOOOO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO#OOOOOOOOOOOOOOOOOOOOO#OOOO#OO#OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOoOOoOOoOOoOOoOOoOoOoOOoOoOoOOoOoOoOoOOOOOOoOOOOOoOOOOOOOoOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@",
+"O@O@O@O@O@O@O@OO@OO@OO@OO@OOO@OO@OO@OO@OO@OOO@O@O@O@@@#@@@@@$@#$@$#$$$$&$&$$$$*$$*$$*$*$$*$*$*$**$*$*$*$*$*$*$$*$$$&$$#$$@$@$#@#@#O@@@O@OO@O@OOOOOOOOOoOOoOoOOoOoOoOoOoOoOoOOoOoOoOOOOOOOOOOOOOOOO@OO@O@O@O@O@O@O@OO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOoOOOOOOOoOOOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO#OOO#OOOOOOOOOOO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOoOOoOOOOOOOoOOOOOoOOoOOoOOoOoOOoOoOoOoOOoOOoOooOoOOOoOoOOoOoOoOOOOOOOOOOOOOOOOOOOOOOOOOO#OO#OO#OO@+@+O",
+"@O@O@O@O@O@O@O@@OO@O@O@O@OO@OO@OOO@OO@OO@OO@O@O@O@@@O@@@#@#@#$@$#$#$#$$$$$$&$$$*$$*$$*$**$*$*$*$**$**$*$*$*$$*$$&$$$$$$##$#@#@@@@@@O@O@OO@OOOOOOOOOOOOOOoOOOoOoOoOoOoOoOOoOoOOOOOOoOOoOOOOOOOOOOOOO@OOOOOOOOOOOOOOO@OO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOoOOOOOOOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@OOO#OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOoOOOOoOoOOOOOOoOoOOoOoOoOOoOoOoOOoOOoOOoOOoOOOOoOOOOOOOoOOoOOOOOOOOOOOOOOOOO#OOOOOOOOOOO#OOOO@",
+"O@O@O@O@O@O@O@OO@O@O@OO@OO@O@OOO@OOOOO@OOOO@OO@O@O@O@#O@@@@@$@#@$@#$$$&$$&$$*$&$$*$$*$*$$*$*$*$**$*$*$*$*$*$*$$*$$&$$$#$@$@$@@@#@O@@O@OO@OOOOOOOOOOOOoOoOOOoOOoOOoOoOoOoOoOOoOoOoOOoOOOOOOOOOOOOO@OOO@O@O@O@OO@OO@OOOOOOOOOOOOOOOOOOOOOOOOOOoOOOOOoOOOOoOOoOOOOOOOOOOOOOOOOOoOOoOOOOOOOOOOOOOOOOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO#OOOOO#OOOOOOOOOOO@OOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOOOoOoOOOOoOoOoOOoOoOoOoOoOoOOoOOoOOoOOoOOoOOoOoOOoOoOoOOOOOOOoOOOOOOOOO#OO#OOOO#OO@O#O@OOOO@OO",
+"OOOO@OOO@OO@OO@O@O@OO@OO@O@OO@O@OO@OOOOO@O@OO@OO@OO@O@@@#@@#@@$@$#$$#$$$$$$$$$$$$$*$$*$*$*$*$*$*$*$*$*$*$*$$*$$$$$$$#$$$#$@#@#@@@@O@O@O@OO@OOOOOOOoOoOOOOoOoOoOoOoOOoOoOoOoOoOOoOOOOOoOOOOOOOOOOOO@OOOOOOOOOOOOOOOOO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOOOOOOOOoOOOOOOOOoOOOoOOOOoOoOoOOoOOoOoOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO#OOOO@OOOOOOOOOOOOOOOOOOOOOOOOOOoOOOOoOOoOOOOoOOOOOoOOoOOOOOOOOOoOOoOoOOoOOoOOOoOOoOOOoOOoOOOOoOOOOOOOOOOOOOOOOOOOOOO@OO#OOOOO@O@OOO@",
+"@O@OO@O@OO@OO@O@OO@O@OO@O@OO@OOO@OOOO@OOOOOO@OO@O@O@@O@O@@@@@#@#@@$@$@#$$$$$$$$$*$$$*$$$$$*$*$*$*$*$*$*$*$$*$$*$&$$$$$@$@#@$@@@@O@@O@O@OOOOOOOOOOOOOOOOoOoOOoOoOoOooOoOoOoOoOOoOOoOoOOOOOOOOOOOOO@OOO@O@O@O@O@OO@O@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOoOoOoOoOOOoOOOOoOOOOOOOOoOOOOOOOOOoOoOoOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOoOoOOoOOoOoOoOoOoOOoOOOOoOoOoOoOOoOOOoOOoOOOOoOOOOOOOOOOOOOOOOOOOOOO#OOOOOOOO@OO+OO#OO",
+"O@O@OO@O@O@O@OO@O@O@O@OO@O@OO@OOOO@OOOOO@OO@OO@OO@O@O@@@#@@#@@@@$#@$$$$@$$$$$&$$$$$$$$*$*$$$$$$$*$$$$*$$$*$$$$$$$$$$$$#$@$@@@@@@#@O@OOO@OO@OOOOOOOOoOoOOOoOoOoOoOoOOoOoOoOOoOoOoOOOOOOOOOOOOOOOO@OO@OOOOOOOOOOOOOOOOOO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOOOOOoOOOOOoOOOoOoOOoOoOoOOOOoOoOoOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO#OOOOOO@OOOO@OO@OOOO@OOOOOOOOOOOOOOOOOOoOOOoOOOOOoOOOOOOOoOOOoOOoOOOoOOoOoOOoOOOoOOoOOoOOoOOOoOOOOOoOOOOOOOOOOOOOOOOOOOOO#O@O@+@O+@O@OOO@",
+"O@O@O@OO@O@O@O@O@O@OO@O@OOO@OO@O@OOO@OOOO@OOOOO@OO@O@O@O@O@@@#@#@$@$@@#$#$$#$$$$$&$$*$$$$$*$*$*$$*$*$$$*$$*$$&$&$$$$#$@$@$@#@#@@O@O@O@OOOOOOOOOOOoOOOOoOoOOoOOoOoOooOoOoOOoOoOOOoOOoOOOOOOOOOOOOOO@OO@O@O@O@O@O@O@OO@OOOO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOoOOOoOoOOOOoOOOoOoOOoOOoOoOOOoOOOOOoOoOoOoOOoOOoOOOOOOOOOOO@OOOOOOOOOOO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOoOOoOoOOOoOOOOoOoOOoOOoOoOoOoOOoOOoOOoOOoOOoOOoOOOOOOoOOOOOOOOOOOOO@OOOOOOOOOO@OOOO@OO",
+"@O@O@O@O@O@O@O@O@O@O@OO@O@OO@OOOOO@OOOOOOOOO@OOOO@OO@@O@@@@@@@@@@@#@$$$@$#$$$$$$$$$$$$*$$$$$$$$*$$$*$*$$*$$$$$$$$$$$#$@$@#@@@@@@@O@O@OO@OOOOOOOOOOOOoOOOOoOOoOOoOOOOoOoOoOOOOOoOOOOOOOOOOOOOO@O@O@OO@O@O@OOOOOOOOOO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOOoOoOOoOoOOOoOOoOOOOoOOOoOoOoOOOOOOOOoOOOOOOOOOOOOOOOOOOOOOO#OOOOOOOOOO@OO@OOOO@OOO@OO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOOoOOOoOOOOOoOOoOOoOOOoOoOOOoOOoOOoOOOOOoOOOOoOOOOOOOOOOOOOO#OOOO@O#O@OO@OO@+@O+@",
+"O@O@O@O@O@O@O@O@O@O@O@O@OO@OOO@O@OOOOO@OOOOOOOO@OOO@OO@O@O@O@@#@#@$@@#@$@$@$#$#$$$$$$$$$$$*$$*$$$*$$$$*$$$$$&$$$$$#$@$@#@@@@@@O@O@O@OOOOO@OOOOOOOOOOOOOoOOoOOoOoOoOoOoOOOoOoOoOOOOOOOOOOOOOOOOOOOO@O@OO@OO@@O@O@O@OOOOO@OO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOoOoOOOoOoOOoOoOOoOoOoOoOoOoOoOoOoOOoOOoOooOoOOOoOOoOOoOOOOOOOOOOOOOOOOOOOOOO#OOO@OOOO@OOO@OOOOOOOOOOOOOOOOOOOOOOOOOoOOOOOOOOOOoOOOoOOOoOoOOoOOOoOoOoOOOoOoOOoOOoOOoOoOOOOOOOOOOOOOOOOO#OOOOOOO+OOOOO#OOO#O@OO@O",
+"@O@O@O@O@O@O@O@O@O@OOO@OO@OO@OOOOOOOOOOOOO@OOOOOO@OO@O@O@@O#@@@@@@@#$@$#$@$#$$$$$$$$$$$$*$$$$$$$$$$$$$$$$$&$$$$#$#$@$#@$@#@@@@@O@O@OO@OOOOOOOOOOOoOoOoOOOoOOoOoOOoOOOOoOoOOOOOOoOOOOOOOOOO@O@O@O@O@O@O@O@OOO@OO@OOO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOoOOoOoOOoOoOoOoOoOOoOoOOoOoOoOoOoOoOOoOoOOOoOOOOOOOOOOOOOOOOOOOOO@OO@OOOOOOOO@OOOO@OOO@O@OO@OO@OOOOOOOOOOOOOOOOOOOoOOoOOOOOoOOOoOOOoOoOOoOOOOoOoOoOOOOoOOoOOoOOOOoOOoOOOOOOOOOOOOOOOOOOO@O@O@OOOO@OOOO#OO@",
+"O@O@O@O@O@O@OO@OO@O@O@O@OO@OOOO@OOO@OOOOOOOOOOO@OOOO@O@O@O@O@O@@@#@@@@@@#$@$@$@$#$#$$$$$$$$$$$$*$$$$*$$$$$$$$$$$$$#$@$@#@@@@@@O@O@O@OOOOOOOOOOOOOOOOOOOOoOOoOoOOoOoOoOoOOoOoOoOOOOOOOOOO@OOOO@OO@O@OO@O@O@O@OO@OO@OOOO@OO@OO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOoOoOOOOoOOoOOoOOoOoOoOoOoOOoOoOoOOoOOoOoOOoOOOoOoOOoOoOoOOOOOOOOOOOOO@OOOOOOOO@OO@OOOO@OOO@OOOOOOO@OOO@O@OOOOOOOOOOOOOOOOOOOOoOoOOOoOOOOoOOOOOoOoOoOoOOOoOoOOoOOOoOOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOO+OO@O+O@+@OO@O",
+"@O@O@O@O@O@O@@O@O@O@OOO@OOO@O@OOOOOOOOOOOOOOOOOOOO@OOOOO@@O@@@@O@@@@#@$@@@$@$#$@$$$$#$$$$$$$$$$$$$$$$$$&$$$$$#@$@@$@#@@$@@#@@@@@OOOOO@OOOOOOOOOOOOOoOoOOOOoOOOOoOOOOOOOOOOOOOOOOOOOOOOOOO@O@OO@O@O@O@O@O@O@O@OO@OO@O@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOoOOoOOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOOOOOoOOOOOOOOOOOOOOOO@OOOO@OO@OOOO@OO@O@OO@OOO@O@O@OOO@OOOOO@OOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOoOoOOOOOOOOoOoOOOoOOoOOOOoOOOoOOOOoOOOOOOOOOOOOO#OO#OO#O@O@OO@OO@OO#OO",
+"O@O@O@@O@O@O@O@O@O@O@O@O@O@OOOOOO@OOOOOOOOOOOOOOOOOOOO@O@O@O@O@@#@@@@@@#@$#@#@@$#@$@$$$$$$$$$$$$$$$$$$$$$$$#$$$#$$@$@$@@@@@@O@O@O@O@OOOOOOOOOOOOOoOOOOoOoOOOOoOOOoOOoOoOOoOOOOOOOOOOOOOO@OOO@O@O@O@O@O@O@O@O@O@O@O@OO@O@O@OO@OOOOOOOOOOOOOOOOOOOOOOOO@OO@OO@OO@OOOOOOOOOOOOOOOOOoOOoOOOOoOOOoOOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOOoOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@OOOOOOO@OOO@OOOOOOO@OOO@O@OOO@O@OOOOOOOOOOOOOOOOOOOOOOOOOoOOOOOoOoOoOoOOOOoOOoOOoOoOOOoOOOOoOOOOOoOOOOOOOOOOOOOOOOOOOO+OO@OO@OO@O",
+"@@O@@O@O@@O@O@O@O@OO@OOOO@OO@OO@OOOOOOOOOOOOOOOOOOO@OOOOO@O@O#O@@@@#@@@@@@@$@$#@$@$$#$@$#$$$$$$$$$$$$$$$$$$$@$#@$@#@@#@#@@@@@@O@O@OOOOOOOOOOOOOOOOOoOOOOOoOoOOoOOOOoOOOOOOOOOOOOOOOOO@O@OO@O@OO@O@@O@@O@O@O@O@OO@OO@OOOOOOOOOO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@OOOOOOOOOOOOOOOOOOOOoOoOOoOOoOOoOOoOOoOoOoOoOOoOoOoOOoOOoOOoOoOOoOoOoOOoOOOOOOOOOOOO@OO@OO@O@OO@O@O@OO@OOO@O@O@OOO+@OOOO@OOOOOO@OOOOOOOOOOOOoOOoOOoOOOOOOoOOOOOOoOOOoOoOOoOOOoOOOOoOOOoOOOOOOOOOOOOOOOOOOO#OO#O@O@O@O@O+@O+O@O+",
+"@O@@O@O@@O@@O@@O@O@O@O@@OO@OO@OOOOOOOOOOOOOOOOOOOOOOOO@O@O@O@O@@O@@@@@#@@#@#@@@$@$@$@$$@$@$@#$@$$#$#$#$#$#$#$@$$@#@$@@@@@@@O@O@O@OO@O@OOOOOOOOOOoOOOOoOoOOOOOOOOOoOOOOOOOOOOOOOOOOOOOOOO@O@O@O@O@@O@@O@@O@O@O@O@OO@OO@O@O@O@OOOOOOOOOOOOOOOOOOO@OOO@OO@O@O@O@O@OOOO@OOOOOOOOOOOOOOOoOOOOoOOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOOoOOOOOoOOOOOOOOOOOOOOOOOOOOOOO@OOOOOO@OO@O@OOOOOO#O@OO#O@+O@OO@OOOO@OOOOOOOOOOOOOOOOOOOoOOOOoOOoOOOOoOOOoOOOoOOOOoOOOOOOOoOOOOOOOOOOOOOO#OOOOOOOOOO+OOO@OOO@OO@O",
+"@O@O@@@O@O@O@O@@O@O@OOOO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@O@O@@O@@@@@@@@@@$@#@@@#@$@$@$@$$@$$#$$$$$$@$@$@$@$@@#@$@@#@@@@@@O@O@OOOOOOOOOOOOOoOOOOOoOOOOOoOOoOoOOOOOOOoOOOOOOOOOOOO@O@O@O@O@O@O@O@@O@@O@@O@O@O@O@O@O@OOOOOOOOOOOOOOOOOOOOOOO@OOOOOOOOOOOOOOOOOOO@OOOOOOOOOOOOOOOOoOOOoOOOoOOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOOoOoOOoOOOOOoOOOOOOOOO@OO@O@OO@OO@OO@OO@OOO@OOO@O@O@OOOOO@OOO@OO#OOO@OOOO@OOOOOOOOOOOOOOOoOOOOOOOOOOOoOoOOoOOOoOOoOoOOOoOoOOOOOoOOOOOOOOOOOOOOOO@OO#O@O@O@OOO#OO@+O@",
+"O@@@@O@@O@O@@O@O@O@OO@@OO@O@O@O@OOOOOOOOOOOOOOOOOOOOO@OO@O@OOO@OO@O@O@@@@@@@@@@@@$@$@@$@$@$@$@$@$@$@#@$$@$@$@@#@$@@@@@@@O@O@O@O@OO@OOOOOOOOOOOOOoOOOOoOoOOOOOOOOoOOoOOOOOOOOOOOOO@OOOO@OO@O@O@@O@@O@@O@@O@@O@O@O@O@OO@O@O@OO@OOO@OO@OOOOOOOOOOO@OO@OO@O@O@OO@O@OOOO@OO@OOOOOOOOOOOOOOOOoOOoOOoOOoOoOoOoOoOoOooOoOoOOoOoOoOoOoOoOOoOOoOoOOOOoOOOOOOOOOOOOOOO@OO@OOOOOOO@OO#O@OO#O@O#O@+O@+O@OOO@OOOO@OOOOOOOOOOOOOOOOOOOOOOoOOOOoOOOOOOOOoOOOOOOOOOOOOOOOoOOOOOOOOOOOOOOOOOOOO#OOOOOOOOO#OO@OO@OO",
+"@@O@O@@O@@O@O@@O@O@O@OO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@O@O@O@O@@@O@@@@#@@@#@@@@@$@@$@@$@$@$@$@$$@$#$@#@#@@$@@#@@@@@@@O@O@OOO@OOOOOOOOOOoOOOOOOoOOOOOoOOOOOOOOOOOOOOOOOOOOOOOOO@O@O@O@O@O@O@@O@@O@@O@O@@O@O@O@O@OO@OOOOOOOOOOOOOOO@OO@O@OO@OOOOO@OOOOO@OOOO@O@OOOOOO@OOOOOOOOOoOOoOOOoOOoOoOoOoOoOoOooOoOooOoOoOoOoOoOoOoOOoOOoOOOOoOOOOOOOOOOO@OO@O@OOOO@OO@O@O#OOO@OOO#OOO@OO@O@OO@O+O@OO+@OOOOOOOOOOOOOOOOOOOOOOOoOOOOOOOOoOOoOOOOOoOoOOoOoOOoOoOOOOOOoOOOOOOOOOOOO#OOOO@+@O#OOOOO@+O@OO@",
+"O@@@@@@@O@@O@@O@O@O@O@OO@O@O@O@OOOOOOOOOOOOOOOOOOOOOOOOO@O@OO@OO@O@O@O@@@@@@@@@@@@@@@@$@@@$@@$@@$@#@@$@@@$@$@$@@@@@@@@@@O@O@O@O@OOOOOOOOOOOOOOoOOoOOOOOoOOOOoOoOOOoOOOOOOOOOOOO@O@OO@OO@O@O@@O@@O@@O@@O@@O@O@@O@O@O@O@OO@OO@OO@OOOOOOOOOOOOOO@OOOO@OOOOO@OOOO@OOOO@OO@OOOOOOOOOOOOOOOOOOoOOoOOoOOoOOoOOoOOoOoOOoOoOoOoOoOoOoOoOoOoOoOoOOOOoOoOOOOOOOOOOOOOO@OO@OOOOOO@O#O@O@OO@OO#O@+OO#O@O@OOO@OO@O@O@O@OOOOOOOOOOOOOOOOOOOoOOoOOOOOOoOoOOOOOOOOOOOOOOOOOoOOOOOOOOOOOOOOOOOOOOOOOOOO@+@OO@OO@+O",
+"@@O@O@O@@@O@@O@@O@O@O@O@OO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@OO@O@O@O@O@O@O@@@@@@@@@@@@@@@@@@@@$@@$@#@@$@@@@@@@#@@@@@O@O@O@O@OOOO@OOOOOOOOOOOOOOOOOoOoOOOoOOOOOOoOOOOoOOOOOOOOOOOOO@OO@O@O@O@@O@@@O@@O@@O@@O@O@O@O@O@OO@OO@OOOOO@OO@OOO@OOOOOOO@O@OO@O@O@O@O@O@O@OO@OOO@O@OOOOOOOOOOOOoOOOOOoOOoOOoOOoOoOoOoOooOoOOoOOoOOoOOoOOOoOOOOOOoOOOOOOOOOOOO@OOO@OOOO@OO@O@OOO@OO@O@O@O@OOOO@O@OO+@O+@OOO#OOOOOOOOOOOOOOOOOOoOOOOOOOOOOOOOOOOOOOOOOoOOoOOoOOoOOOOOOOOOOOOOOOOOO#OOOO#OO@O@O@OOOO@OOOOOO@",
+"@O@@@@@@@O@@O@@O@@O@O@O@O@OOO@OOO@OOOOOOOOoOOOoOOOOOOOOOOO@OOO@O@O@O@O@O@@@@O@@@@@@@@@@@$@@$@$@@#@@$@@$@#@$@@$@@@@@@@@@@O@O@OOO@OOOOOOOOOOOoOOoOOoOOOOOoOOOOoOOOOOOOOOOOOOOOOOO@O@OO@O@O@O@O@O@@O@@O@@@O@@O@O@O@O@O@OO@OOOOO@OOOOOOOO@OOOO@O@O@OOOO@OO@O@OO@O@OOO@OO@O@OOOO@OOOOOOOOOOOOOOoOOOoOOoOOoOoOoOoOoOOoOOoOoOoOoOoOOoOoOOOoOoOOOOOOOOOOOOOOOO@OOOO@OOO@OOOO@OO@O#OO@O@O+@O#OO+OO@OO@O+@OOO+O@OOOOOOOOOOOOOOOOOoOOOOOOOOOOOOoOOOOOOOOOOOOOoOOOOoOOOOOOOOOOOOOOOOOOOOOOOO+OO+OO@OO+O@+@OO",
+"@@@O@O@O@@@O@@O@@O@O@O@O@OO@OOO@OOOOOOOOOOOOoOOOOOOOOOOOOOOO@OOO@O@O@@O@O@O@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@O@O@O@O@OOO@OOOOOOOOOOOOOOOOOOOOOOOoOOOOOOOOOOOOOOOOOO@O@OOO@OO@O@O@@@O@@O@@O@@O@@O@@O@@O@O@OO@OO@O@OOOO@OOO@OOOOOO@OOOOO@O@OO@OOOO@OOOO@O@O@OOOOO@OOOOOOOOOOOOOOoOOOOoOOOoOOoOOOoOoOOoOoOoOoOOoOOoOoOoOOOoOoOOOOoOOOOOOOOOOOOOOOO@OOO@O@OO@O@O@OO@O@OO#O@OOOO@O@O#OO#OO@OO@O@OOO@OO@OOOOOOOOOOOOOOOOOOOOOOoOOOOOoOoOOOoOOoOOOoOOOOOOOOOOOOOOOOOOOO@OOO@O@O@O@O@OO@O@OOO@O",
+"O@O@@@@@O@O@@O@@@O@@O@O@O@OO@OOOOOOOOOOOoOoOOOOOOoOOOOOOOOOOOOO@OOO@O@O@@O@O@@O@O@@@@@@@@@@@@@$@@$@@$@@@$@@@#@@@@@@@@O@O@O@OOOOOOOOOOOOOOOOOOoOOOoOOoOoOOOOOOOOOOOOOOOOOOOOOOOO@O@OO@O@O@@O@@O@@@O@@@@O@@O@@O@O@@O@O@O@OOOO@OOOO@OOOOOO@OOOO@O@OOOO@OO@@O@O@@O@O@OO@O@O@OO@OO@OOOOOOOOOOOOoOOOoOOoOOoOoOOOoOOoOOOoOoOoOoOOoOOOoOOoOOOoOOOOOOOOOOOOOOO@OOOO@OOOOO@OO@OO@O@OO@@OO@O#O#OO@OO@OO@OOO#OOOO#OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOoOOOOOOOOOOOOOOOOO#OOOOOOOOOOO#OOOO@OOO",
+"@@@@O@O@@@@O@@O@O@O@O@O@OO@OOO@OOOOOOOOOOOOOoOoOOOOOOOOOOOO@O@OOO@OO@O@O@O@O@O@@@O@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@O@@O@O@O@OOO@OOOOOOOOOOOOOOoOOOOOOOOOoOOoOOOOOOOOOOOOO@O@O@OO@O@O@@O@O@O@@@O@@@O@@@@O@@O@@O@O@O@O@OO@OOOO@OOOOO@OOOOO@OOOOO@O@OO@O@O@O@OO@O@O@OO@OO@O@OOOOOOOOOOOOOOOOOOoOOOOOOoOOoOoOOoOOoOoOOoOOoOoOOoOoOOoOOoOOOoOOoOOOOOOOOOOOOO@OOO@O@OO@OO#OO@+@O#O@O@OO@OO#OO#O#OO#OOO@O#OOO#OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOOOOoOOOOOOOOOOOOOOOOOOO#OOOOOO#OO#O@+@OOOO@+OOO#O",
+"@O@O@@@@@O@@O@@@O@@@O@O@O@OO@OOOO@OOOOOOOOoOOOOOoOoOOOOOOOOOOOO@OOO@OOO@O@O@O@@OO@@O@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@O@OOOOOOOOOOOOOOOOOOOOOOOOoOOOoOOOOOOOOOOOOOOOOO@OOOO@OO@O@O@O@@O@@@@O@@@O@@@@O@@@O@@O@@O@O@OO@OO@O@OOOOOOOOOOO@OOO@O@OO@OO@O@O@OO@O@O@OO@O@OO@OOOO@OO@OOOOOOOOoOOoOOOOoOoOOOoOOOoOOoOoOOoOoOoOoOoOoOOoOOoOOOoOOOOOOOOOOOOOOO@OOOO@OO@OO@OO@OO@O@O@OO@O#O@O#O@O#O@O#O@O@#OOOOOOOO@OO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO#O@OOOO@OOO",
+"@@@@O@O@O@@O@@O@@OO@O@O@OO@OOOO@OOOOOOOOoOOOoOoOOOOOOOOOOOOOOOOOO@OO@O@OO@O@O@O@@O@O@O@@O@@@@@@@@@@@@@@@@@@@@O@O@@O@OO@OOO@O@OOOOOOOOOOOOOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@O@O@O@O@O@@O@@O@O@@@O@@@O@@@@O@@@O@O@O@O@O@OO@OOOO@OO@OO@OOOOO@OO@O@OO@O@OO@O@O@O@O@O@O@O@O@O@O@OOOOOOOOOOOOOOOOOOoOOOOoOOOoOoOOoOOOoOoOOoOOoOOoOOoOOoOOoOOOOOOOOOOOOOOO@OOOO@OOO@OO@O@O@O@O@O@O@#O@O@OO@O#O@O@O@OO#OO@O#O@O@OOO@OOO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOOOOOOOOOOOOOOOOOOOOO@OOO@O#O@O@OOOOO#O@OO@O@",
+"O@O@@@@@@@O@@O@@O@@@O@O@O@OOO@OOOOOOOOOOOOOoOOOOoOOoOOOOOOOOOOOOOOOOO@OO@O@O@O@OO@O@@O@O@@O@O@@O@@@@O@@@O@@@O@@@@@O@O@O@O@OOOOOOO@OOOOOOOOOOOOoOoOOOOOOOOOOOOOOOOOOOOO@O@OO@O@O@O@O@@O@@O@@@@O@@@O@@@@O@@@O@@O@@@O@O@OO@OOO@OOOOOOOOOOO@OOO@OOOO@O@OO@O@O@O@O@O@O@O@OO@OO@OOO@OO@OOOOOOOOOOOOOOoOOOoOoOOOoOOoOoOOOoOoOoOOoOoOOoOOOoOOOoOoOOOOOOOOOOOOOOOOOOOO@OO@OOO@O@+@O#O@O@O#O#OO@O@O#O#O@O@OO@OO@OOO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOoOOOOOOOOOOOOOOOOOOOOOOO+OOO@OOOOO@O+OO",
+"@@@@O@O@O@@@O@@O@@OO@O@O@O@O@OOOO@OOOOOoOoOOOoOoOOOOOOOOOOOOOO@OOO@OOOO@OOO@OO@O@O@OO@@O@@@@@@O@@O@@@@O@@@O@@O@O@O@O@OO@OO@OOOOOOOOOOOOOOoOOOOOOOOOOoOOOOOOOOOOOOOO@OOOOO@OOO@O@O@O@O@@O@@O@@@@@@@@O@@@@O@@@O@O@O@O@O@OOO@OOOO@OO@OO@OOOO@OO@O@OO@O@O@O@O@O@O@O@O@O@O@O@O@O@OOO@OOOOOOOOOoOOoOOOOOOOOOoOOOoOOOOoOoOOOoOoOoOOoOOoOOOOoOOOOOOOOOOOOOOOO@O@O@O@OO@OO#O@+@O@O@O@O@+@O@O@#O@O#O@O@O#O@#O@O@O#OO@O@O@O@O@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO#OOOO#OOOOO@O@OO+@OO@+O@O@O",
+"@@O@@@@@@@@@@@O@@O@@O@O@O@O@OOO@OOOOOOOOOOOOoOOOOOoOoOOOOOOOOOOO@OOOO@OOOO@OO@O@O@O@O@O@O@O@O@@@@@@O@@@@O@@O@@@O@@O@@O@OO@OOO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@O@OO@O@O@O@O@O@@O@@@@@@@@@@@@@@O@@@@@O@@@O@O@O@O@O@OOO@OOOOOOOOOO@OO@OO@O@OO@OO@O@O@@O@O@@O@O@O@OO@OO@O@OOOOOOOOOOOOOOOOoOOoOOoOOOoOOoOoOOoOoOoOOOoOOoOoOOoOoOOOOOOOOOOOOOOOO@OOOOOOOOO@OO@O@O@O@O@O@O@O@O@@O@O#O@O@O@O@O@OO@O#O@O@O@OO@OOOOOO@OOOOOOOOOOOOOOOOOOOOoOOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@OOOOO@OO@OO",
+"@@@@O@@O@O@O@@@O@@O@@O@O@OOO@OOOOOOOOOOOOoOOOoOoOoOOOOOOOOOOOOOOOOOO@OO@O@OO@OO@O@O@@O@O@@O@@O@O@O@@O@O@@@@@O@O@@O@OO@O@OOO@OOOOOOOOOOOOOOOoOOOOoOOOOOOOOOOOOOOO@O@OOO@OO@O@O@O@O@O@@O@@@O@@@@@@O@@@@@@@O@@@O@O@@O@O@OO@OO@OOO@OO@OOO@OOOOOO@OO@O@O@O@O@O@O@@O@O@O@O@O@O@O@OOO@OO@OOOOOOOOOOOOOOOOOOOOoOOOoOOOoOOOOoOOoOOoOOOOOOOOOOoOOOOOOOOOOOO@OOO@OO@O@O@OO@O@O@O@+@O#O@+@O@O#O@O@O#O@O#O#O@@O@OO@OOO@OO@OO@O@OOOO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO#OOOO@OOO@OOOO@O#OOO#OO#",
+"@@O@@O@@@@@@O@O@@O@@O@O@O@O@OOO@OOOOOOOOOOOoOOOOOOOOOOOOOOOOOOOOOO@OOOOOOO@OO@OO@O@O@O@O@O@@O@@@@@O@@O@@@O@O@@@@O@O@O@OO@O@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@OO@OO@OO@O@O@@O@@@O@@@@@O@@@@@O@@O@@@@O@@O@O@O@O@OO@OOO@OO@OOO@OOOO@O@OO@OO@OOO@O@O@@O@O@O@O@@O@O@O@O@O@OO@OOOOOOOOOOOOOOOOOOOoOOOOoOOOoOOOOoOOoOOoOOoOoOoOOoOOOOOOOOOOOOOOOOOOOOO@OOOOOO@O@OO@O@O@OO@O@O@#O@O#O@O@O#O@@O@O#O#O@O@O#OO@O@OO@OOO@OOOO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO+OO#OOOOO@OOOOO",
+"@@@@@@@O@@@@@@@O@@O@O@O@O@OO@OOOO@OOOOOOoOOOOoOoOoOOoOOOOOOOOOOOOOOOO@OO@OOO@OO@O@OO@O@O@@O@@O@O@O@@O@@O@@@@O@O@O@O@O@O@OOOO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@O@O@O@O@OO@O@O@O@@O@@O@@@@@O@@@@@@@@@@@@@O@O@@O@@O@O@O@O@OO@OOOOOOOOOO@OOOOO@OO@OO@O@OO@O@O@@O@@O@O@O@O@O@OO@OOOOO@OOOOOOOOOOOoOOOOOOOOOOOOOOOOoOOOOOOOoOOoOOOOOOOOOOOOOOOOOOOOOO@OO@O@OOO@O@O@OO#O@+@O@O@O@O@O@O@@@O@#O@@O@@O@@O@O@O@O@O@O@OO@O@OO@OO@O@OO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@OO@OOOOOOO@OOOOO@OOO@O@OOOOOO@O+@OO@O",
+"O@O@@O@@@O@O@O@@O@@O@O@O@O@OO@O@OOOOOOOOOOOoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@OO@OOO@O@O@O@O@O@O@@O@@O@@O@@O@O@@O@O@O@O@OO@O@OOOO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@OOO@OO@O@O@O@@O@O@@@O@@@@@@@@@@@O@@O@@@@@@O@@O@@O@O@OO@OO@O@O@O@O@OOOO@O@OO@OO@O@O@O@O@O@O@@O@@@O@O@O@O@O@O@O@OO@O@OOOOOOOOOOOOOOOOOoOOOOoOOOOoOoOoOOOOOOOOoOOoOOOOOOOOOOOOOOOO@OOOOOO@OOO@OO@OOO@O#O@+@O#O@+@O#O@@O@@O@@O#@O#@O@@O@O@O@O@O@OO@O@O@OOO@OOOO@OOOOOOOOOOOOOOOOOOOOOOOOOO@OOOOOOOOOOOOOOOOOOOOOOOOOO@OOO#OOOOOOOO",
+"@@@@O@@@@@@@@O@@@O@@O@@O@OO@OOOOO@OOOOOOOOOOOoOoOoOOoOOOOOOOOOOOOOO@OO@OO@OOO@OO@O@O@O@O@O@O@O@O@O@O@O@O@@O@O@@O@O@O@OO@OOOO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@OO@OO@O@O@O@O@O@@O@@@@O@@@@@O@@@@@@O@@@@@@@O@@O@@O@O@O@O@O@OO@OOOOOOOOO@O@OOOO@OO@OO@OO@O@O@O@O@O@O@O@@O@O@O@O@OO@O@OOOOOOOOOOOOOOOOOOOOOOOOoOOOOOOOOOOOOoOoOoOOOOOOOOOOOOOOOOOOO@OOOO@O@O@OO@OO@OO@@OO@O@O@O@O@O@@O@O#O@O#O@+@O@@O@O#O@O@O@O@OOO@O@OO@OO@OO@O@OOO@OOOOOOOOOOOOOOOOOOOOOOOOOOO@OO@OOOOOOOO#OOOOOOOO#OOOO@OOOO@OO#OO",
+"@@O@@@@@O@O@O@@O@@O@O@O@O@@OO@O@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@OO@OO@O@OO@O@O@O@O@@O@O@O@O@O@@O@@O@O@O@O@OO@O@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@OO@O@O@O@O@O@@O@O@@O@@@@@@@@@@@@@@@@@O@@@@@O@O@O@O@O@OOO@OOO@O@O@O@OOOOO@OO@O@O@OO@O@O@O@@@O@O@O@@O@O@O@O@OO@OOO@O@O@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOoOOOOOOOOOOOOOOOOOOOO@OOOOOO@OOO@OO@O@O@O@O@O@O@O@O#O@@O@@O@@O@@O@O@@O@O@O#OO@+@@O@OOO@OO@OO@OOOO@OOOOOOOOOOOOOOOOOOOOOO@OO@OOOOOOOOOOOOOOOOOO#OO#OOOOO@+OOO@OOOOOOO",
+"@@@@O@@O@@@@@@O@@O@@@O@O@OO@OOOOO@OOOOOOOOOOOOOOoOOOOOOOOOOOOOOO@OOOO@O@OOOOOOOO@OOO@O@OO@O@O@O@@O@@@O@@O@O@O@O@O@OOOO@OOOO@OO@OOOOOOOOOOOOOOOOOOOOOOOO@OO@O@O@OO@OO@O@O@O@O@O@@O@@@@@O@@@@@O@@@@@@@@@@@O@O@@@@@O@O@OO@O@O@O@OOOOOOO@O@O@OO@OO@O@O@O@O@O@O@O@@@@@O@@@@O@@O@@@O@O@OO@OO@OOOOOOOOOOOOOOOOOOOOOOOOOOoOOOOOOOOOOOOOOOOOOOOOOOOOO@OOO@OO@O@O@O@O@O@O@OO@O@O#O@@+@@@O@@O@@O#O@O@@O@#O@O@O@O@O@O@O@O@O@O@OO@O@OO@O@OO@OO@OO@OOOOOOOOOOOO@OOOOOOO@OOOOOOO@OO@OOO@OOOOOO@OOOOO@OOOO@O@O@O",
+"@@O@@@@@@@@@O@@@O@@@O@O@O@O@O@O@OOO@OOOOOOOOOoOOOOOOoOOoOOOOOOOOOOO@OOOOO@OO@O@O@O@O@O@O@O@O@@O@O@@O@@O@O@@@O@O@O@O@O@OOO@OOOOOOO@OOOOOOOOOOOOOOOOOOO@OOOOOOOOOOO@O@OO@O@O@@O@@O@@O@O@@O@@O@@@@@@@@@@@@@@@@@O@O@O@@O@O@O@OO@OOO@O@O@OOOOOO@OO@OO@O@O@O@@O@O@@O@O@O@O@O@@O@OO@O@O@O@OO@OO@OO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@OOO@OO@O@OO@O@OO@O@O@O@O@@O@O#O@O@O@O@O@@@O@O@O@@O@O@O@O@O@O@OO@O@OO@O@OO@OOO@OO@OO@OO@O@O@OO@O@OOOOOOOOOOOOOOO@OOOOOOOOOOOO@O@OOO@O@OOO@O@OOOOOO",
+"@@@@O@O@@O@@@@@@@O@O@@O@OO@OO@OOO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@OOOOO@OOOOO@O@O@O@O@O@O@@O@O@O@O@@@O@O@O@O@O@O@OO@OO@O@OOOOOOOOOOOOOOOOOOOOOOOOOO@O@O@O@O@O@O@O@O@O@O@@O@@O@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@O@O@O@OOO@OO@O@OOOOOO@O@O@OO@O@O@O@O@@O@@O@O@@O@@@O@O@@O@@@O@O@O@O@O@O@OO@OOO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@OOOO@OOO@OOOO@O@OO@O@O@O@@O@O@@@O@@@O#@O@@@O@O#@O@@O@O@O@O@O@O@OO@O@OO@OOOO@OO@O@OO@OOOOOOOOOOOO@OOOOOOOOOOOOOOO@OOOOOOOOOOOO@OOOOOOOOOOOO@OOOOO@O@OO",
+"@@O@@@@O@@@O@O@O@@O@@O@@O@O@O@O@OOOOO@OOOOOOOOOOOOOOOOOOOOOOOOOO@OO@OOO@O@OOOO@O@O@O@O@O@O@O@O@@O@@@O@@O@O@@O@O@OO@OOO@OO@OOOO@O@OOO@OOOOOOOOOOOOOOOO@OOOOOOOOOO@O@O@O@O@@O@O@O@@@O@O@O@@O@@@@@@O@@@@O@@@@@O@O@O@O@O@O@O@OO@OOOOO@O@OO@OOOO@OO@O@O@O@O@O@O@@O@@O@O@O@@O@O@O@@O@O@O@O@OO@OO@O@OO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@OOOO@OO@O@OO@@O@O@O@O@O@O@O@O@@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@OO@OO@O@O@O@O@O@OOOO@O@OOOO@OOO@OOOOOO@OO@OO@OOOO@O@O@O@O@OOOOO#OOOOOO",
+"@@@@O@@@@O@@@@@@@O@@O@O@O@O@OO@O@O@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@OOOOO@O@OO@OO@O@O@@O@@O@O@@O@O@@O@@O@O@O@O@O@O@OO@OO@O@OOOOO@OOOOOOOOOOOOOO@O@OOO@O@O@O@@OO@O@O@O@O@@O@@@O@@@@@@@@@@@O@@@@@@@@@@@@O@@@@O@@O@O@OO@OO@OO@O@O@OOO@OOO@O@O@O@OO@O@O@O@O@O@@O@@O@@@O@@O@@O@O@O@O@O@O@O@O@OO@O@O@O@OO@OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO@OOO@O@OO@OOO@O@OO@OO@O@OO@O@O@O@O@O@O@@O@O@@O#O@@O@@O@@O#O@O@O@O@O@O@O@O@O@O@O@OO@OO@OO@OO@OO@OO@OOO@O@OOOOO@OOOO@OOO@O@OOOOOOO@OO@OOOOOOOOOOO@O@OOOO@O@O@",
+"O@O@@@O@@@@@@O@@O@@O@@O@O@O@O@O@OOOO@OO@OOOOOOOOOOOOOOOOOOOOOOO@O@O@OOOO@O@OOO@OO@O@O@O@O@O@O@@O@@O@@O@@O@@O@@O@O@O@OO@OO@OOOOO@OOOO@OO@OOOOOOOOOOOOO@OO@OOO@OO@O@O@O@O@O@O@@O@@O@@O@@@@O@@@@@@@@@@O@@O@@@@O@@O@@@O@O@O@O@O@OOOOOO@OOO@OO@OOO@O@O@O@O@O@@O@@O@@O@@O@O@O@@O@@O@@O@@O@O@O@O@O@O@O@OOO@OO@O@OO@OOO@OOOOOOOOOOOOOOOOOOO@OO@O@OO@O@O@O@OOO@O@O@OO@O@OO@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@@O@O@O@O@O@O@O@O@OO@O@O@O@O@O@O@O@OO@OO@O@OOOO@O@OOO@OOOO@OOOOO@O@O@OOOOOO@O@O@O@O@OOOOO@O@OOOOO",
+"@@@@@@@@O@@O@@@@@O@@O@@O@O@O@OO@O@O@OO@OO@OOOOOOOOOOOOOOOOOOO@OOOOOO@O@OOOO@OOO@O@O@O@O@O@O@@O@@O@@O@O@O@@O@O@O@O@OO@OO@O@O@O@OO@OOOOO@OO@O@O@O@O@O@OO@OO@@O@O@O@O@O@O@@@O@@O@@@@@O@@@@@@@@@@@@@O@@@@@@@O@@@@O@@O@O@O@OOO@OO@O@O@OOO@OOO@OO@OO@O@O@O@@O@O@O@@O@@O@@O@@O@O@O@@O@O@O@@O@O@O@O@O@O@O@OO@OO@OO@OO@OO@O@O@O@O@O@O@O@O@OOO@OOO@O@OO@O@O@O@O@O@O@O@O@O@O@O@O@@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@OO@OO@O@OOO@OO@OOOO@O@OOOOOOOOO@OOOO@O@OOOOOO@O@O@OOOOOOOOOO@O@OOOOOO@O@O",
+"@O@@O@O@@O@@@@O@O@@O@O@O@O@O@O@OO@OO@OOOOOOO@OOOOOOOOOOOOOO@OOOOOO@OOOO@O@OO@O@OO@OO@O@O@O@O@O@O@@O@O@@@O@O@@O@O@O@O@O@O@OO@OO@OOO@O@OO@OOOOOOOOOOOOO@OO@OO@O@O@O@O@O@O@O@@O@@O@O@@@@O@@@O@@O@@@@@O@@O@@@@@O@@@O@O@O@O@O@OO@OOOOOOO@OOO@OOO@O@OO@O@O@O@O@@O@O@@O@@O@@O@@@@@@O@O@O@@O@@O@O@O@O@O@O@O@OO@OO@OO@OO@OOO@OOO@OOO@OOO@OO@OO@O@OOO@O@O@OOO@O@O@OO@OO@OO@O@O@O#O@@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@OO@O@O@O@OO@O@OO@O@O@OO@OO@O@O@O@OOO@O@OOOO@O@O@OOOOOO@O@O@O@O@OOOO@O@O@OOOO",
+"@@@@@@@@@@@O@@@@@O@@@O@@O@O@O@O@OO@OO@O@O@OOOO@OOO@OO@OO@OOOO@O@O@OO@OOOO@O@OO@O@O@O@O@O@O@O@O@O@O@@@O@O@@O@O@O@O@O@O@OO@O@O@O@O@OOOO@OO@O@O@O@O@O@O@O@O@O@O@O@@O@O@@O@O@O@@O@@@@@@@@@@@@@@@@@O@@@@@@@@O@O@@O@O@@O@O@OO@O@OO@O@O@OOOO@OO@O@OO@O@O@O@O@@O@O@@O@@@O@@O@@O@O@O@@@@@@O@O@O@@O@O@O@O@OO@O@@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@OO@O@@O@O@O@O@@O@O@O@O@O@O@O@O@O@O@O@O@O@@O@O@O@O@O@O@O@O@O@@O@O@O@O@O@OO@O@OO@O@OO@OO@OO@O@O@O@OO@O@O@OO@OOOOO@OO@OOOO@O@OOOOOOO@O@OOOOOOOOOOO@O@OOOO@OO@O@",
+"@@O@O@@O@O@@@O@O@@O@O@O@O@O@O@O@O@O@OO@OOOOO@OOO@OOOOO@OOO@O@OOOOOOOOO@O@OOOO@OO@O@O@O@O@O@O@O@O@@O@O@O@@O@O@O@@O@O@O@O@OO@OO@O@OO@O@OO@OOO@OO@OO@OO@OO@O@O@O@O@O@O@O@@@@@O@@@O@O@O@O@@@O@@O@@@@@@@@@O@@@@@@@@@O@O@O@O@O@OO@OOOOO@O@OO@OOOOO@O@O@O@O@O@O@@O@@O@O@@O@@O@@O@@O@O@O@O@@O@@O@O@O@O@O@@O@OO@O@O@O@O@O@O@O@O@O@O@O@O@O@OO@O@O@OO@O@O@O@OO@OO@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@@O@O@O@O@O@O@O@O@O@O@O@OO@O@OO@O@O@OO@OO@O@O@OOO@O@O@O@OO@OO@O@OOOOOO@O@O@OOOO@O@O@O@O@OOOOO@O@OOO@OO",
+"@@@@@@@@@@O@@@@@O@@O@@O@O@O@O@OO@O@O@OO@O@O@OO@OOO@O@OOO@OOOO@O@O@O@O@OO@O@O@O@O@O@O@O@O@O@@O@O@O@@O@@O@O@@O@@O@O@O@O@O@O@O@OO@O@O@OO@OO@O@O@OO@OO@O@O@O@O@O@@O@O@@O@O@O@O@@O@@@@@@@@@@@@@@@@O@@O@@O@@@O@@O@O@@@O@O@OO@OO@OO@O@OOOOO@OOO@O@OO@OO@O@O@O@@O@O@O@@@O@@O@@O@@O@@O@@@O@@O@@O@@@O@@O@@OO@O@@O@O@O@O@O@O@@O@@O@O@@O@O@O@O@O@O@O@@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@@O@@O@@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@OO@O@O@O@O@OO@O@O@OOO@O@OO@OO@OOO@O@O@OOOOOO@O@OOOOOO@OOO@O@OOO@OO@OO@O",
+"@O@@O@O@O@@@O@O@@O@@O@O@@O@O@O@O@O@O@O@O@OOO@OO@O@OOOO@O@O@O@O@OO@O@OO@OO@O@O@OO@O@O@O@O@O@O@@O@@O@@O@O@@O@@O@O@@O@O@O@O@O@O@O@O@O@O@O@@O@O@O@O@O@O@O@O@O@O@@O@@O@O@@O@@O@@O@@@O@@O@@@@@@@O@@@@@@@@@@@@@O@@@@@O@O@O@O@OO@O@O@OO@O@O@OO@O@OO@O@O@O@O@O@@O@O@O@@O@@O@@O@@O@@O@@@O@@O@@@@@O@O@@O@@O@@@O@O@O@O@@O@@O@@O@O@O@@@O@O@@@O@@O@@O@O@@O@@O@@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@OO@OO@OO@O@O@O@O@O@OO@O@O@OO@O@O@O@O@O@O@O@O@O@O@O@O@O@O@OO@O@O@OO@OO@OO@O@OOOOOO@O@O@OOOOO@O@OOOO@OOOO@OO@OO@OOO",
+"@@@@@@@@@O@@@@@O@@@O@@O@O@@O@O@O@O@O@O@OO@O@OO@OOO@O@OOOO@O@OOO@OO@OO@O@OO@OO@O@O@O@O@O@@O@O@O@O@@O@@O@@O@O@@O@@O@@O@O@OO@O@O@O@O@O@O@OO@O@O@O@O@O@O@O@O@O@O@@O@@O@O@@O@@@O@@O@@@@@@O@@O@@@@@O@@@@@@O@@@@@O@O@@@O@O@O@O@O@OOO@OO@OOO@OOOO@OO@OO@O@O@O@O@O@@@O@@O@@@O@@O@@@@@O@@@@@@O@O@@@@O@@@O@@O@@@@O@@@O@@O@@@O@@@@@O@@@@@@O@@O@@O@@@O@O@@O@@O@O@O@O@O@O@O@O@O@OO@O@O@O@O@O@O@O@@O@@O@O@O@O@O@O@O@O@O@O@O@OO@O@O@OO@O@O@O@O@O@O@O@O@O@O@O@OO@O@O@O@OO@O@O@@O@OO@OO@O@O@OO@O@O@OO@O@OOOO@OO@O@",
+"@@O@O@@O@@@O@O@@@O@@O@O@@O@O@O@O@@O@O@O@O@O@O@O@O@O@OO@O@O@OO@O@O@O@O@OO@O@O@O@O@O@O@@O@O@@@@O@@@O@@O@@O@@@@O@@@O@O@O@O@@O@O@O@O@O@O@O@@O@O@O@O@O@O@O@O@O@@O@O@O@O@@@O@@@O@@@@@@O@O@@@@@@@O@@@@@@O@@@O@@O@@@@@O@@O@O@O@O@O@O@O@OO@O@OO@O@OO@OO@OO@O@O@O@@O@O@@O@@O@@O@@O@@O@@@@O@O@@@@@@O@@@O@@@@@O@O@@@O@@O@@@O@@@@@O@@@@O@O@@@@@O@@@O@@@@O@@O@O@O@@O@@O@@O@@O@O@O@O@O@O@O@O@O@O@OO@OO@O@O@O@O@O@O@O@OO@O@O@O@O@O@O@@O@O@O@O@O@O@O@O@O@O@O@O@@O@O@O@O@O@OO@OO@O@O@O@O@O@OO@OOO@OOO@OO@O@OO@OOOO",
+"@@@@@@O@@O@@@@O@O@@O@@O@O@@O@O@O@O@O@O@O@O@O@O@O@O@O@@O@O@O@@O@O@O@O@O@O@O@O@O@O@@O@O@@O@O@O@@O@O@O@O@O@O@O@@O@O@@O@@O@O@O@O@@O@O@@O@@O@@O@@O@@O@O@@O@@@@O@@@@@@@O@O@@@O@@@O@@@@@@@@@@@@@@@@O@@O@@@@@@@@@@O@O@@O@O@O@OO@O@O@OO@O@OO@O@O@OO@O@O@O@O@O@O@O@O@@O@@O@@O@@@O@@@@@O@@@@@@O@@@@@@@@@@O@O@@@@@O@@@@@@O@@@@O@@@@O@@@@@@O@@@@@O@@@O@@@@O@@@O@O@@O@O@O@O@@O@O@O@O@O@O@O@O@O@O@O@O@O@O@OOO@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@OO@O@O@O@O@O@O@O@O@OO@OO@O@OOO@OO@OOO@O@OO@OOOO@OO@O@",
+"@O@@O@@@@@@O@O@@@@O@@O@O@@O@@@O@O@@O@@O@O@O@O@O@O@O@OO@O@O@O@O@O@O@O@O@O@O@O@O@O@O@@O@O@O@@O@O@O@@O@@O@@@O@@O@@@@O@@O@@O@@O@@O@O@@O@O@O@O@@O@O@@O@@O@@O@O@O@O@O@O@@@O@O@@O@@@O@@O@@O@@O@@O@@@@@@@@@O@@O@O@@@@@O@@O@O@O@O@OO@O@OOO@O@OO@OO@OOO@O@O@O@O@O@@O@O@@O@@O@@O@@O@@O@@@@O@@@@@O@@O@@O@@@@@@@@O@@@O@@O@@@@@@@@O@@@@O@@@@@@O@O@@@O@@O@O@@@@O@@O@O@O@O@@O@O@O@O@OO@OOO@OO@O@O@O@O@O@OO@O@O@OO@O@O@O@O@OO@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@OO@OO@O@OO@OO@O@O@OO@O@OO@OO@O@OOO@OOO@O@OOOOOO",
+"@@@O@@@O@@@@@@@O@@@@O@@@O@@O@O@@@O@@O@@O@@O@@O@O@O@O@@O@O@O@O@O@O@O@O@@O@@O@@O@@O@@O@@@@@O@@@@@@@O@@@@O@@@@O@@O@@@O@@O@@O@O@O@O@O@O@@O@O@O@@O@O@@O@O@O@O@@@O@@@@@O@@@@@@O@@O@@@O@@@@@@@@@@@O@@@@@@@@@@@@@@O@O@@O@@O@O@O@O@O@O@O@O@OO@OO@O@O@@OO@O@O@@@O@O@@@O@@@O@@O@@@@@O@@@O@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@@O@@@@@@@@@@@@@@@@O@O@@O@@O@@@@O@@O@O@O@O@@O@@O@O@OO@OO@OOOOO@OO@O@O@OO@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@OO@O@O@O@OOO@OO@OO@OO@O@OOO@OOO@OOOO@OOO@OOOOO@O@O@",
+"@O@@@O@@@@O@@O@@@@O@@@@@@@O@@@O@O@@O@@O@@O@O@O@@O@O@O@O@O@O@O@O@@O@@@O@@O@@O@@O@@O@@O@O@O@@O@O@O@@@@O@@O@O@@O@@@O@@O@@O@O@@O@O@@O@O@O@O@@O@O@@O@O@O@O@@O@@O@@O@O@@O@O@O@@O@@@O@@@@O@@O@@O@@@@@@O@O@@O@O@O@@O@@O@O@O@@O@O@O@O@O@O@O@O@O@O@O@OO@O@O@O@OO@@@O@O@@@O@@O@@O@O@@@@@@@@@@@O@@@@@@@@@@@@@@@@#@@#@@#@@#@@@@@@@@@@@@@@@@@@@@@O@O@O@@@O@@@@O@@O@O@O@O@@O@@O@@@@O@O@O@O@O@OO@OO@O@O@O@O@OO@OO@O@OOOO@O@O@O@O@O@O@O@O@O@O@OO@O@O@O@O@O@O@O@O@OO@O@O@O@O@O@O@OO@OOOOO@OO@OOO@O@OOO@OOO@O@OOOOO",
+"@@@@@@@O@@@@O@@@O@@@O@O@O@@O@@@@O@O@O@@O@O@@O@O@@O@O@O@@O@@O@@O@O@@O@@O@@@O@@O@@O@@O@@@O@@O@@O@@O@O@@@@@@@@@@@O@@O@@O@@@@O@@O@@O@O@O@O@O@@O@O@@O@@@O@@O@@O@@O@@@O@@@@@@@@@@O@@@O@@@@@@@@@@O@@O@@@@@O@@@@@@O@@O@@O@@O@O@O@O@O@O@OO@O@O@O@O@O@@O@O@O@O@@O@O@@O@O@@O@@O@@@@@O@@O@@@O@@@@@O@@@@@@@@@#@@@@@@@@@@@@@@@#@@@@@@@@@@@@@@@@@@@@@@@@O@@@O@@@@O@@@O@O@@O@O@@O@O@O@O@O@@O@O@O@O@O@O@OO@OO@O@O@OOO@O@OO@O@OO@OO@O@OO@OO@OO@O@O@O@O@O@O@O@O@O@O@OO@OO@OO@OOO@O@OO@O@O@OOOO@OOOOOO@OOO@OOOOO@O@O",
+"@@@O@O@@@@O@@@O@@@O@@@@@@O@@@O@O@@@@@O@@O@@O@O@@O@@@O@@O@O@@O@O@@@O@O@@O@O@@@@O@@@@@@O@@@@@O@@O@@@@@O@O@@O@O@O@@@@O@@@O@O@@O@@O@@@O@@@O@@O@@@@O@@O@@O@@O@@O@@@O@@@@O@O@O@O@@@O@@@@@O@@@O@@@@@@@@@O@@@@@@O@@@O@@O@@O@O@O@O@O@O@O@O@OO@O@O@O@OO@O@O@O@O@@O@@O@@@@O@@O@@O@O@@@@@@@@@@@@@@@@@@@#@@#@@@@#@@@@#@@@#@@@@@@#@@#@@#@@@@@@@O@@@@O@@@@@@@@@O@@@O@O@@@O@@O@O@O@O@O@O@O@O@O@O@OO@OO@O@O@O@O@OO@@O@O@O@O@OO@O@O@O@O@O@O@O@O@O@O@O@O@@O@O@O@O@@O@@O@@O@O@O@@OO@O@O@O@OO@O@OO@O@O@OOO@OOO@O@OOOO",
+"@O@@@@@O@@@@@@@@@@@@O@@@@@@O@@@@O@O@O@@O@@O@@@O@O@O@@O@@@O@O@@@O@O@@@O@@@@@O@@@@O@O@@@O@O@@@@@@O@@@@@@@@O@@@@@@O@@@@O@@@@O@@@O@@O@@O@O@@O@@O@O@@O@@O@@O@@@@@O@@@O@@@@@@@@@@O@@@O@@@@@@@@@O@@@@@O@@@O@O@@@O@@@O@@O@@O@@O@O@O@O@O@O@O@O@O@O@O@@O@O@O@@O@O@@O@@O@@@O@O@O@@@O@O@@@@@@O@@@@@#@@@@@@@@@@@@@#@@@@@@@@#@@@@@@@@@@@@#@@#@@@@@@@@@@@@O@@O@@O@@@@@O@O@@O@O@@@@O@@O@O@O@O@O@O@O@O@O@OO@OO@O@OOO@O@O@O@O@@OO@O@O@O@O@@O@@O@O@O@@O@O@O@O@@O@O@O@O@O@O@O@OOO@O@O@OO@OO@OO@O@OO@OO@O@OO@OOOO@O@O",
+"@@@@@O@@@O@O@O@@O@O@@@@O@O@@@@O@@@@@@O@@@O@@O@@O@@@O@@O@O@@@O@O@@@@@O@@@O@O@@@O@@@@@O@@@@@@O@O@@@@O@@O@@@@@@@@@@@@O@@@@O@@@O@@O@@O@O@@@O@@O@@@@@@O@@O@@@O@O@@@O@@@@@O@@@O@@@@@@@@@@O@@O@@@@@@O@@@@@@@@@O@@O@O@O@O@O@@O@O@O@O@@O@@O@O@O@O@O@@O@O@@O@O@@@O@O@O@@O@@O@@@@O@@@@@@@@@@@@@O@@@@#@@#@@@@#@#@@@@@@#@#@@@@@#@#@@#@@@@@@@@@@@@@@@O@@@@@@@@@@@O@O@O@@@O@O@@O@O@O@O@@O@@O@O@O@OO@O@OO@O@O@OO@O@OOO@OO@O@OO@O@O@O@@O@O@O@O@O@O@O@@O@O@@O@O@@O@O@O@O@O@O@@O@O@O@O@O@O@O@OO@O@OO@OOO@O@O@O@OO@O",
+"@O@O@@@O@@@@@@@O@@@@O@@@@@@O@@@@O@O@@@@O@@O@@O@@@O@@@O@@@@O@@@@O@O@O@@O@@@@@O@@@O@@@@@O@O@@@@@@O@@@@@@@@@O@@O@@O@@@@O@@@@O@@@@@@O@@@@O@@@@@@O@O@@@@@@@O@@@@@O@@@O@@@@@O@@@@@O@@@O@@@@@@@O@@O@@@@O@O@@@@@@@@@@O@@@O@O@O@O@@O@O@O@O@O@O@O@O@O@O@@O@O@O@O@@O@@@O@@O@@O@O@@@O@@O@@@O@@@#@@@@@@@@@@#@@@@@@#@#@@@@@@#@#@@@@@#@@#@@#@@#@@@@@@@@@@@@O@@O@@O@@@@@O@O@@@O@O@@O@O@O@@O@O@O@OO@OO@O@O@OO@O@OO@O@O@OO@O@O@O@O@O@O@O@O@O@O@O@O@O#O@O#O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@OO@O@OO@O@OOO@O@O@OO@",
+"@@@@@@@@@@O@@O@@@@@@@@@O@O@@@O@O@@@O@O@@O@@O@@O@O@@O@@@O@O@@@O@@@@@@@@@O@@O@@@O@@@O@O@@@@@O@@O@@@@@@O@@O@@@@@@@@@@O@@@@O@@@@O@O@@@@@O@@O@@O@@@@@@O@@O@@@@@O@@@@@@@@O@@@@@@O@@@O@@@@@@O@@@@@@@@@@@@@@@O@O@O@O@@O@O@@@O@O@O@O@@O@@O@O@O@O@O@@O@@O@O@O@@O@O@@O@@O@@O@O@@@O@@O@@@@@@@@@@@#@@#@@@@@@@#@@#@@@@$@#@@$@@@$@@$@@@@@@@@@@@@#@@#@@@@@@@@@@@O@@@@O@O@@@O@O@O@@O@@O@O@O@O@O@O@O@O@O@OO@O@OO@O@OO@OO@O@O@OO@O@O@O@O@O@O@O@O@@O@@O@O@@O#O@@O#O@@O@O@O@O@O@O@O@O@O@O@OO@OO@O@OO@O@O@OO@O@OO@OO@O",
+"@O@@O@O@@@@@@@@O@O@O@O@@@@@O@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@O@@@O@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@O@@@@O@@O@O@O@@O@@@O@@@@O@@@@@@O@O@@@@@@O@@O@@O@@@@@@@@@@@@@@O@@@@@@@@@@@@@@@@@@O@@@@@O@@O@@O@O@O@O@@@@@@@@O@@@O@O@@@@O@@O@O@O@O@@O@@O@@O@O@O@O@O@O@O@@O@@O@@@O@@@O@@@@@@@@O@@#@@@@@@@@@@#@#@@@@$@@$@@@@@$@@@@$@@#@@@$@#@@#@@#@@@@@@@@@@@@@@@@@@@@O@@@@O@@@O@O@O@O@O@O@O@O@O@O@O@O@OO@O@O@O@OO@O@O@O@O@O@O@@O@O@@@O@@O@@O@@O@O@@O@@O@O@@O@O@@O@O@@O@@O@O@O@O@O@O@O@O@O@O@O@O@O@OO@O@O@OO@OO@OO@",
+"@@O@@@@@O@@O@O@@@@@@@@@@@O@@@@@O@@@@@O@O@O@O@O@O@@O@O@O@@O@@@O@@@@@@@O@@O@@@O@@@O@@O@@@O@O@@O@@@@@@@O@@@@@@@@@@@@@O@@@@O@@@O@@@@@@@@@O@O@@@@@@@@@@@@@@@@O@@@@@@@@O@@@O@@O@@@@@@@@@@@O@@@@@@O@@@@@@@@@O@O@O@O@@O@@@O@O@O@@O@@O@@O@O@O@O@@O@O@O@@O@@O@@O@O@@O@@O@@@O@@@O@O@O@@@@@O@@@@@@#@@@@@@@@#@@@@@#@$@#@@@#@@#@@@@#@@@@@@@@@@@@#@@@@@@#@@@@O@@@@@@O@O@@O@O@@O@@O@@O@@O@O@O@O@OO@OO@O@O@OO@O@O@O@O@O@O@O@O@O@O@O@O@O@@O#O@@O@#O@O@@O@@O@@@@O@@O@O@@O@@O@@O@@O@O@O@O@O@O@OO@OO@O@OO@O@O@OO@OO@O",
+"@@@@O@@O@@@@@@@O@@O@@O@O@@@O@O@@@O@@O@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@O@@@O@@@@@@O@@@@@@@@O@@O@@@@O@@O@@O@O@@@@@O@@@@@@@@O@@@O@@@@@@@@O@@O@@@@O@@O@@@@@O@@@@@@@@@@@@@@@O@@@O@@@@@@O@@O@@@O@@O@O@@@@@@@@@@O@@O@@O@O@O@O@O@O@@O@@O@O@O@@O@@O@O@O@O@@O@O@@O@@O@O@@O@@@@@@O@@@@@@#@@@@@@#@@@#@@$@#@$@@@@@@@$@@@@@$@#@@@$@#@@#@@#@@@@#@@@@@@@@@@@@@O@@@@@O@@@O@O@O@O@O@O@O@O@O@O@O@O@O@OO@O@OO@OO@O@O@O@O@O@O@O@O@@O@@O@O@@@O@@O@@@@O@@O@@O@O@@O@@O@O@O@O@O@O@O@@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@",
+"@@O@@O@@@O@O@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@@@O@@@@@O@@@@@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@O@@@@O@O@O@O@O@@@O@@O@@@@@@O@@O@@O@@O@@@O@O@@O@O@@O@@@O@O@@@O@@O@@@O@@@O@@O@@@O@@@@O@@#@@@@@@@@@@@@@@@@@#@#@@#@@$#@@@@$@#@@@@@@@@@@@@@@@@#O@@@O@@@@@@@O@O@@O@O@@@O@@@O@@@O@@O@@O@@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@@O@O@@O@@@@O@@O@@O@O@@O@@@O@@@O@@@O@@@@@@@@@O@@@@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O",
+"@O@@O@@O@@@@@@@O@O@O@@O@@O@@@@O@@@O@@@O@@@@O@@@O@@O@@@O@@O@@O@@@@@@@@@@@@@@@@@@@@O@@@@@@O@@O@@@@O@@@@@O@@O@@@@@O@@@@O@@@@@O@@@@O@@@@@@O@@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@O@@@@O@@@O@@@@O@O@O@@@@@O@@@@@@@@@@@O@@@O@@O@O@O@@O@@O@O@O@O@O@@O@O@@@O@@O@O@@@O@O@@O@@O@@O@@@@@@@@@@@@@@@@@@@@@@@#@@#@@#@@#@$@@@$@@@@@@@#@@@@@@@#@$@@#@@#@@@@@@@@@@@@O@@O@@@@@@O@@@O@O@@O@@O@O@O@@O@O@O@O@O@O@O@O@O@O@O@O@O@O@@@O@@@O@@O@@O@@O@O@@O@@O@@@@O@@O@@@O@@@O@@O@O@O@O@O@@O@O@@O@@O@@O@O@O@O@O@O@@O@O@O@O@O@O@",
+"@@O@@@O@@@O@O@O@@@@@O@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@O@@O@O@O@O@O@O@@O@@@O@@@@@O@@O@@O@@@@@@@@O@@@O@O@@O@@@O@O@@@O@@O@@O@@@O@O@O@O@@@#O@@@O@@@#@@@@@@@@@@@@@@@@@@@@@@#@@@@@@@@@@@@@@@@@@@@#@@@@@@@#@@@@@@@@O@O@@@O@@@@@O@O@@O@@@@O@O@@O@O@O@O@O@O@O@O@O@@O@@@@O@@O@O@@O@@@@@O@@@O@@@O@@@O@@@@@@O@@@O@@@@@O@@@O@@@@O@@@O@@O@@O@O@@O@@O@@O@@O@O@O@O@O@O@O",
+"@@@O@O@@O@@@@@@@O@@@@O@O@@@@@@@@O@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@O@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@O@@O@@@@O@@@@@@@@@@@@@@@@@@@@O@@O@@@O@O@@@O@@O@@O@O@O@O@@O@@@@O@@O@O@@@O@@@O@@@O@@O@@@@@@@@@O@@@@@@@@@@@@@@@#@@$@@#@@@#@@#@@#@@@@@#@#@#@@@@#@@@@@@@@@@#O@@@O@@O@@@@@@@@@O@@@O@O@@@@O@@O@O@@O@@O@O@O@O@O@O@O@O@O@O@@O@O@O@@@O@@O@@O@O@@@O@@O@@@O@O@@O@@O@@@@@@@O@O@@@O@@@O@@@@O@@O@@O@@O@O@@O@@O@O@O@O@O@O@O@O@O@",
+"O@O@@@O@@@@O@@O@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@@@O@@O@@@@@O@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@O@O@@O@O@O@O@O@O@O@@O@@@@O@@@@O@@O@@O@@O@@O@@@O@@O@O@@O@@@@O@@O@O@@@O@@O@@@O@@O@@@@@@@@@O@#@@@@#@@@@@@@@@@@@@@@@@@@@@@#@@@@@@@#@@@@@#@@#@@@@@@#@@@@@@@@O@@O@O@@@@O@@@O@O@@O@@@O@O@@O@O@@O@O@O@O@O@O@O@@O@O@O@@O@O@@O@@O@@@@O@@@O@O@O@@@@@@O@@@@@O#O@@@@@O@@@O@@O@O@@@@@@O@@O@@@O@O@O@O@O@O@O@O@O@O@O@O",
+"@@O@O@@@O@@@O@@O@O@@@O@@O@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@O@@O@@@O@@@O@@O@@@@@O@@@O@@@@O@@O@O@@@@@@O@O@@@@O@@@@O@@O@@@O@@@@@O@@@@@@@@@#@@@@@#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@O@@@@O@@O@O@@O@O@@@O@@O@@@O@@@O@@O@O@@@O@O@@O@O@@O@@@O@O@O@O@@@O@O@O@O#@@O@O@@O@@O#O@@O@O@@@@@@O@OO@O@O@O@O@O@@O@@O@@O@@@@@O@@O@@O@",
+"@O@@@O@O@@O@@O@@@@@O@@@@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@O@O@O@O@O@O@O@O@@@O@@@O@@@O@@@@@@O@O@@@O@@@@O@@@O@@@@@O@O@@@@@@O@@O@O@@@@@O@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@#@@@@@$@@@$@@@@@@@@@@@@@@@@@@@@@@O#@@@O@@@O@@@@O@@@@@O@@O@@@@@O@@@O@O@@O@O@O@O@O@@O@@@O@O@@@@O@@@@O@O@O@O@@@@@O@O@@@O@@@O@O#O@@O@@@O@@@O@@@@@OO@O@@@@O@@@O@@@O@O@O@O@O@@O@O@O@@O@O@O@",
+"@@O@@@@@@O@@@@@O@O@@@@O@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@O@@@O@O@@@@@@@@@@@@@@@@@@@O@@@O@@O@@@O@O@@O@@@O@@@@O@O@@O@@@O@O@@@@O@O@O@@@@@@@O@@@@@@O@@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@O@@@O@@@O@O@@O@O@@@O@@O@@O@@O@O@@O@O@O@O@O@O@OO@@O@@O@@O@O@O@@O@O@@O@@@@@@@O@@O@O@@O@@O@O@O@@O@O@O@@@O@@@O@@@@@@@@@@O@@O@O@O@@O@@@O",
+"O@@O@O@O@@@@O@O@@@@@O@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@O@O@O@O@O@O@O@@@@@@O@@@O@@@@@@@@O@@@@O@@@@@@@@O@@@@@O@O@@@@@@O@O@O@@O@O@O@@O@@O@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@O@@@@@@O@@@@@O@@O@@@@@O@@@@O@@@@O@@@@O@O@O@@O@O@@O@@O@O@@@O@@O@@O@@O@@O@@O@O@O@@O@O@@O@@O@O@O@O@@O@@@O@@O@@O@@@O@@@@@@@O@@O@O@@O@O@O@O@O@@O@@@@@@O@@@O@",
+"@@O@@O@@O@O@@@@O@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@$@@$@@$@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@O@O@@@@@@@@O@@@@@@@O@O@O@@@@@@@O@O@O@@@@O@@@@O@@O@@@@@O@@@@@@@O@O@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@O@@@@@O@@@@@@@O@@@@@O@@@@O@O@@O@O@@@O@@O@@@O@@O@@O@O@O@@O@O@@O@@O@@O@@@@O@O@@@@O@O@O@@O@@O@@O@@O@@@O@@O@@O@@O@O@O@O@@O@@@O@@O@@O@@O@@O@@O@O@O@@O@@O",
+"@O@@O@@O@@@@@O@@@@@O@@O@@@@@@@@@@@@@@@@@@@@@@$@@@$@@$@@$@@$@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@$@$@$@$@$@$@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@O@@@@O@O@O@O@@@O@O@O@@@@@@@@@O@O@@@@@@@@@@@@@O@@@@@@@O@@@@O@@O@O@@@@O@O@O@O@O@O@O@O@O@O@O@O@@@@@O@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@O@@@O@@O@@@O@@@@@@@@@@@@O@@@@@@O@@@@O@@@@@@@@@@O@@O@@O@O@@O@@O@@@@@@O@@@O@@O@@O@O@O@O@O@@O@O@O@@@O@@O@@O@@@O@@O@@O@@O@@O@@@@O@@@O@@@O@@O@@O@@@@@O@@@O@@O@@@O@@@@",
+"@@O@@O@@@O@O@@O@O@@@@@@@@@@@@@@@@@@@@@@@@$@@@@@@@@@@@@@@@@@@$@$@@$@$@$@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@$@@$@@@@@@@@@@@@@@@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@O@@@@@O@@@@@O@@@@@@@@@@@O@@O@@@@@O@@@O@@@@@@@@@@@@O@O@@@@@@@@@@@@@@@@@@@@@@@@@O@O@@@@@@O@O@O@O@O@O@O@O@@O@@O@@O@O@@@@O@@@@@@@@@@O@@@@O@O@O@@O@@@@@O@@@@@O@@@@O@O@O@O@@@@O@@O@@@O@@@O@@O@O@@@O@@@@O@@O@@@@O@@@@O@@O@@@O@@@@O@@@@O@@@@O@@@@@O@@@@@O@@@@O@@@@@@@@@@@@@O@@@@@@@@@@@@@@@@O@@",
+"O@@O@@O@O@@@O@@@@@O@O@@O@@@@@@@@@@@@@@@@@@@$@$@$@$@$@$@$@$@$@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@$@@$@@$@@$@@@@@$@@$@@$@@$@@@@@@@@@@@@@@@@@@@@@@@O@O@O@O@O@@@@@O@O@@@@@O@@@@@@@@@O@O@@@@@@@O@@@@O@@@@@@O@@@O@O@@@@@O@O@O@O@O@O@O@O@O@O@O@O@@@@@O@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@O@@@O@@@@@@@@@@@@@@@@@O@@@@@O@@@@@O@@@@@@@@@O@O@@@@@O@@@O@@@O@@@@O@@@O@O@@@@@O@O@@O@O@@O@@O@@O@O@@@@O@@O@O@@@O@O@@@O@O@@@@O@@@@O@O@O@@O@@@@@@@O@@O@@@O@@O@@@@@",
+"@@O@@O@@O@O@@@O@O@@@@@@@@O@@@@@@@@@@@@@$@@@@@@$@@@$@@@@@$@@@$@$@@$@$@$@$@@$@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@$@$@$@$@$@$@$@@$@@$@@$@@$@@$@$@@@@@@@@@@@@@@@@@@@@@@@@@@O@@O@@@@@@@@@@@@@O@O@@@@@@O@O@@@@O@@O@@@@@@@@@@@@@@@@@@@@@@O@@@@O@@@@@O@@O@@@@@@@@@@@@@@@@@@@@@@@@O@O@@O@O@O@O@O@O@O@O@O@O@@O@@O@@O@@O@@@O@@@@@O@@@O@@O@O@O@@O@@O@@@@@O@@@@O@@O@@O@O@O@@O@@@@O@@@@@O@@@O@@@O@@@O@@@@@@O@O@@@@@O@@@@O@@O@@O@@@O@O@@@@@@@@O@@@@O@@@@@O@O@@@O@@@@@@@@@@@@O@@@@@@@@@@@@@@@@@@@@",
+"@O@@O@@O@@@O@O@@@@O@@@@@@@@@@@@@@@@@@@@@@$@$@$@@$@@$@$@$@@$@$@@$@@@@@@@@@@@@@@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@$@@@@@@$@@@@@@@@@$@@$@@$@@@@@@@@@@@@@$@@@$@@@@@@@@@@@@@@@@@@@@@@@@@O@@O@O@O@O@@@O@O@O@@@@@@O@@@@@@O@@@@@@@@@@@@@O@@@@@@@@@O@@@O@O@@@@@@O@O@O@O@O@O@O@O@O@O@O@O@@@O@O@@O@@@@@O@@@@@O@@@@O@O@@O@O@@@@O@@@O@O@@@@@@O@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@@@@@@@@O@@@O@O@@@O@@@@@@@O@@O@@O@O@@@@@O@O@@@O@@O@@O@@@O@@@@@O@O@@O@@@@O@@@O@O@@@@@O@@@@@@@@@@O@@@@@@O@@@@@@O@@@O@@O@O@",
+"@@O@O@O@O@O@@@@O@@@@O@@@O@@@@@@@@@@@@$@@@@$@@$@$@$@@@$@@$@@$@@$@@$@$@$@$@@$@@$@@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@$@@@@$@$@$@$@@$@@$@@@$@$@$@$@$@$@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@O@@@@@@@@O@O@@@@O@@@@@@@@@@O@@@@@@@@@@O@@@@@@@O@@@@@O@O@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@O@@O@O@O@@O@O@@O@O@@@O@O@@@O@O@@O@O@@@@O@O@@@@O@O@@O@@@O@@O@O@@@@@@O@O@O@@O@@O@O@@@@@@@@@@@@@@@@O@@O@@@@@@@@@@@O@O@@@@@O@@@O@@O@@O@@@O@O@@@@@@@@@O@@@O@@@@@@@@@@@@O@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@O@O@@@O@@@O@O@@@O@@@@@@@@@@@@@@@@@@@@@$@$@@$@@$@@$@$@@$@$@$@$@@$@@@@@@@@@@$@@@$@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@$@$@@$@@$@$@@@$@@@$@@$@@$@$@@@$@@@$@@@@@@@@@@$@@$@@@@@@@@@@@@@@O@@O@@O@@@@O@O@O@@O@@O@@O@@@@@@@@@@@@@@@O@@@@@@@@@@@@@@@@@@@O@@@@@@O@@@@@@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@@O@@O@@O@O@@O@@O@O@O@@@O@O@@@@O@@@@@O@@@@O@O@@@@@@@@O@@@@@@@@@O@@@@@@@@@@@@@@@@@O@@@O@@@@@@O@@@@@@@@@@@@@@@O@@@@@@@O@@@@O@@@@@@@@@O@@@@@@@O@@O@@@@@@@@@@@O@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@O@O@O@@O@@@@O@@@@O@@O@@@@@@@@@@@$@@$@@@@$@@$@@$@$@$@$@@$@@$@$@@$@$@$@$@$@@@$@@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@@@$@@$@@@$@$@@$@@$@@$@@@@$@$@@$@@$@$@$@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@O@@@O@@@O@@@@@O@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@O@@O@@O@@O@@@@@@@@@O@@O@O@@O@@O@O@@O@O@@O@@O@@O@@@O@O@@O@@O@@O@O@@O@O@O@@O@O@@O@O@@@@@O@O@O@@@@@O@@@@@@@@@@@@@@O@@O@@@@@@@@@@@@@O@@@@@@O@@@@@O@@O@@@@@O@@O@@@@O@@@@O@O@O@O@@@@O@@O@@@@@@@O@@@O@@O@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@O@@@O@@O@O@O@@@@O@@@@@@@@@@@@@@@@@@@@@$@$@@$@$@$@$@$@$@$@$@$@$@$@$@@$@@$@@@$@@$@$@@@$@@$@@$@@$@@@@@@@@@@@@@@@@@@$@@$@@@$@$@@$@@$@@$@@$@$@$@$@$$@$@$@@$@$@@$@@@@@@@$@@$@@@@@@@@@@@@@@@@@@@@O@@@@O@@@O@@@O@@@O@@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@O@O@O@@O@O@@O@@O@@@O@O@@O@O@O@O@O@O@O@@O@O@O@@O@O@O@O@@O@@O@O@@O@@@@O@O@@@@@@@@@@@@@O@@@@@@@@@O@@@@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@O@O@@O@@O@@O@O@@@@@O@@@@@@@@@@@$@@$@$@@$@$@$@$@$@$@$@$@$@$@$@$@@$@@$@$@@$@$@@$@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@$@@@@$@@$@$@@@$@@$@$@$@@$@@$@@$@@@$@@@$@$@$@$@@@@@$@@@@@@@@@@@@O@@@@@@@O@@@O@@@O@@@@O@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@O@@O@@O@@O@@@@@@@@O@@@@O@O@O@O@O@@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@O@@O@O@@O@@O@O@@@@@O@@O@@O@@O@@@@@@@@@O@@@@@@@@@@O@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@O@@@@@@@O@@O@@@@@@O@O@@@@@O@@@O@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@@@#@@@",
+"O@@O@O@@O@@O@@@@O@O@@@@@@@@@@@@@@@@@@@@$@@@$@$@$@$@$@$@$@$@$@$@$@@$@$@@@$@@@$@@@$@$@@@$@@$@@$@@$@@@@@@@@@@@@@@@@$@@@@@@@$@$@@$@$@@$@$@$@@@$@@$@$@@$@@$@$@$@$@@@@@@@@@$@@@@@@@@@@@@@@@@@@@O@@@@@O@@@O@@O@O@@@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@O@O@O@@O@O@O@@O@@O@@O@@O@O@@O@@O@O@O@O@O@O@O@O@O@O@O@@O@O@O@@O@O@@O@@O@O@@O@@@@@@@@@@@@@O@@@@@@@@@@@O@@@@@@@@@@@@@@@@@@O@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@@@#@@@#@@@@@@@@@@@",
+"@@O@O@O@@O@@O@O@@@@@@@O@@@@@@@@@$@$@$@$@$@$@@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@@$@@$@@$@@@$@@@@@@@@@@@@@@@@@@@@@@@@@$@$@$@@@@$@$@@$$@$@@$@$$@$$@$@$@$@$@$@@$@@$@$@$@$@@@@$@@@@@@@@@@@@@@@@@@@O@@@@@O@@@@@@@@O@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@O@@@@@@O@@@O@O@O@O@O@O@O@O@O@O@O@O@O@@O@O@O@@O@O@O@O@O@O@@O@O@@O@@@@@@@@O@@O@@@@@@@@@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@O@@O@@@O@@@@O@@@@@@@@@O@@O@@@@@O@O@@O@@@@@@@@@@O@@@O@@@@@@@@@#@@@@@@@@@@@@@@@@@@@@@@@",
+"@O@O@@@@O@O@@@@O@@@O@@@@@@@@@@@@@@@@@$@@$@$@$@$@$@$@$@$@$@$@@$@$@$@$@@$@@$@@$@@$@@$@@@$@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@$@$@$@@$@$@$@$$@$@@$@@$@@$@$@$@@@$@@$@@@@@@@$@$@@@@$@@@@@@@@@@@@O@@@@@@@O@@@@@O@@O@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@O@@@@O@O@@O@O@@@@@O@@O@@O@@O@@O@@@O@@@O@O@@O@O@O@O@O@@O@@O@O@@@O@@@O@O@O@@@O@@@@@O@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@O@@O@@O@O@O@@@@@O@@O@@@@@@@@@O@@O@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@@#@@#@",
+"@O@@O@O@@@@O@O@@@O@@@@@@@@@@@@@@@$@$@@$@@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@@$@@$@@$@@$@@@@$@@@@@@@@@@@@@@@@@@@@@@@$@$@$@$@@@$@$@$@$@$@$@$@$$@$@$@$@$@$@$$@@$@$@$@$@$@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@O@O@@@@@@@@@@@@@@@@@@@@@@@@@$@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@O@@@@O@@@@@O@@@@@O@O@O@O@O@O@O@O@@OO@@OO@@O@O@O@O@O@O@@O@O@O@O@O@O@@O@@@@@@@O@@@O@O@@@@@@O@@O@@@@O@@O@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@O@@@@@@@@@@@@@O@@@@@O@@@@@O@@@@@@@@@@@@@@O@@@@@O@@@O@@@@#@@@#@@@#@@@@@@@@@$@@",
+"O@@O@@O@O@O@@@@@@@@@@O@@@@@@@@@$@@@@@$@$@$@$@$@$$@$$@$$@$@$@$@$@$@$@$@@$@$@$@@$@@$@@$@$@@@$@$@@@@@@@@@@@$@@$@@$@@@@@@@@@$@@$@@$@$@$@$@$@$@$@$$@$$@$@$@$@$@$@@$@@$@@@$@$@$@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@O@@O@@@@@@@@@@@@@@@@@@@@@@@$@@$@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@O@O@@@O@@@O@@@O@@O@O@@@O@@O@O@@O@O@O@O@O@O@@O@O@@O@@O@@@O@O@O@@@O@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@O@@@O@@@@@@@@@@@@@@#@@#@@#@@@@@@@@@@@@@#@@@$@@@@@",
+"@@O@@O@@@O@@O@O@@@@@@@@@@@@@@@@@@$@$@$@$@$@$@$$@$@$@$@$$@$@$@$@$@$@$@$@@$@$@@$@@$@@$@@@@$@@@@@@@@@@@@@@@@@@@@@@@$@$@$@$@$@$@$@$@$@$$@$$@$@$$@$@$@$@$@$@$@$@$@$@$@@$@@@@@@@$@@@@@@@@@@@@@@O@@@@@@@O@@@O@@@@@@@@@@@@@@@@@@@@$@@$@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@O@@@@O@O@@@O@O@O@O@O@O@@O@O@O@O@O@O@@O@@O@O@O@O@O@O@@O@O@@O@@O@O@@@@@@@@@O@@O@@@@@@@@@@@@@@@@@@@@@#@@#@@@#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@O@@O@@O@@O@@@@@@@@@@O@@@@@@@@@@@O@@@@@@@@@@@@@@@@@@@@@#@@@#@@@@@@@@#@@@@@@",
+"O@@O@@@O@@O@@@@@@O@@@@@@@@@@@$@@$@@@$@$@$@$@$$@$@$$$@$$@$@$$@$$@$@$@$@$$@$@@$@@$@@$@@@$@@@$@@@@@@@$@@$@@$@$@$@$@@$@@@$@$@@$@@$@$@$$@$$@$@$$@$@$$$@$$@$@$@$@$@@$@@$@@$@$@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@@@@@$@@@@@$@$@$@$@$@$@@@$@@@@@@@@@@@@O@@@@@@@@@@@@@O@@@@@O@@@@@@@@@@@@@@O@@O@O@O@@O@O@O@O@O@@O@O@@O@O@O@O@O@O@@@@O@O@O@O@@O@@@@O@@@O@@@@@@@@@#@@#@@@@@@@@@@@@#@#@#@#@#@@#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@O@@@@@@@@@@@@@@@@@@@@#@@@#@@@@@@@@@#@@@@@@@#@@#@@@@@@#@$@",
+"@@@@@O@@@@@@O@@@@@@@@@@@@@@@@@@$@@$@$@$@$@$$@$@$$@$@$@$$@$@$@$@$$@$@$@@$@@$@@$@@$@@$@@@@$@@@$@@@$@@@@@@@@@@@@@@@$@@$@@$@$@$@$@$@$@$@$@$$$@$$@$@$@$@$@$@$@$@$@$@$@$@$@@@$@@@$@@@@@@@@@@@@@@@@@O@@@@@@@@@O@@O@@@@@@@@@@@@$@$@@@@$@$@@@@@@@@@@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@O@O@O@O@O@O@O@O@@O@O@O@@O@O@O@O@O@O@O@O@O@@O@@O@@O@O@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@@@#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@@@@@@@@@#@@@@@$@@$@$@$@@@@",
+"O@O@O@@@O@O@@@@O@@@@@@@@@@@@@@@@@$@@$@$@$@$@$@$$@$@$$$@$@$$@$$@$@$@$@$@$@$@$@@$@@$@@$@$@@@$@@@@@@@@@@$@@$@$@$@$@@$@@$@$@@$@$@$@$@$$$@$$@$@$@$$$@$$$@$@$@$@$@$@@$@$@@$@$@@$@@@@@@@@@@@@@@@@@@@@@@@O@@O@@@@@@@@@@@@@@@@@@@@@@@$@$@@@$@$@$@$@$@$@@@@$@$@@@@@@@@@@@@@@@@@@@O@@O@@@@O@O@@O@@@O@@@O@@@@O@O@O@@O@O@@O@@O@@O@O@O@O@@O@O@O@@O@@@@@O@O@O@@O@O@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@@@@#@@#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@@@@@@@$@@@@@@@@@@@@@$@",
+"@@@@@@O@@@@@O@@@@@O@@@@@@@@@@$@$@@@$@@$@$$@$$$@$$$@$@$$@$@$$@$@$@$@$@$@@$@$@$@@$@@$@@@@@$@@@@@@@$@@$@@@@@@@@@@@@$@@$@@$@$@$@$@$$@$@$$@$$$$@$$@$$@$@$$@$@$@$@$@$@@$@$@@@$@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@$@$@@@@$@$@@@$@@@@@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@O@@@O@O@@@@@O@@O@O@@O@@O@@O@@@O@@O@@@O@@O@@O@O@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@#@@$@$@@$@$@$@$@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@$@@@@@@@@@$@@@@$@@@",
+"@O@O@O@@O@O@@@@O@@@@@@@@@@@@@@@@@@$@@$@$@$@$@$$@$@$$@$@$$$@$@$@$@$@$@$@$@$@$@@$@@$@@$@$@@@@@$@@@@@@@@@@$@@@@@@$@@@$@@$@@$@$@$@$@$$@$@$$@$@$$@$$@$$@$@$$@$@$@$@$@$@$@@$@@@$@@@$@@@@@@@@@@@@@@@@@O@@@@@@O@@@@@@@@@@@@@@@$@@@@$@$@$@@$@$@$@$@$@$@@@$@$@$@$@@@@@@@@@@@@@@@@@@@@@@@@@@O@@O@@@O@@@O@@@@O@O@O@@O@@@@O@@O@@O@O@O@@O@O@O@@O@@O@O@@O@O@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@$@@@@@@@@@@@@@@@$@@@@@@@@@@@#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@@@@@@@@@@@@$@@@@$@@@@@@",
+"@@@@@@@O@@@@O@@@@@@@@@@@@@@@$@$@$@@$@$@$@$$@$@$$@$$@$$@$@$$@$@$@$@$@$@$@$@$@$@@$@@$@@@@@$@$@@@@@$@@$@@@@@@@$@@@@$@@$@$@$@$@$@$@$@$@$$@$$@$$@$$@$$@$$@$@$@$@$@$@$@@$@$@$@@@@$@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@@@@@@@$@@@@$@$@@$@@$@@$@@@$@@@$@@$@@@@@@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@O@@@@O@@O@@O@O@@@O@@O@@@@@@O@@@@@@O@@O@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@@@@@@@$@$@$@$@$@$@$@@@$@$@$@@$@@@@$@$@$@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@@@$@$@@@@@@@@@@@@@",
+"@O@O@O@@@@O@@@@@@@@@@@@@@@@@@@@@@$@@$@$@$@$@$$$@$$@$$@$$$@$@$$@$@$@$@$@@$@$@@$@$@$@@$@$@@@@@@@@@@@@@@@@$@@@@@$@$@@@$@@$@@$@$@$@$$@$@$$@$$@$$$@$$@$$@$@$@$$@$@$@$@$@@$@@$@$@@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@@@$@@$@$@$@$@$@$@@$@$@$@$@$@$@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@O@@@@@@@@O@O@@@@O@@@@@O@@O@@@@O@O@@@O@O@O@@@@@O@@O@O@O@O@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@@@@@@@@@@@@@@@$@@@@@@@@@$@$@@@@@$@@@$@$@$@@$@@$@@@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@@@$@@@@@@@@@@@@@$@@@@@@$@@",
+"@@@@@@@O@@@@@@O@@@@@@@@@@@@$@$@$@@$@$@$@$$@$@$@$$@$@$@$@$$@$@$@$$@$@$@$@$@$@$@@@$@$@@@@@$@$@@@@@$@@$@@@@@@@@@@@@$@$@@$@$@$@$@$$@$@$$@$$@$$@$@$$@$$@$$$@$@$$@$@$@$@$@$@$@@@$@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@$@$@@$@$@@$@$@@$@$@$@@$@$@@@$@$@@@$@@$@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@O@O@@@@@@O@@@@@@O@@@@@@@O@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@$@@$@@@$@$@$@$@@$@$@$@@@$@$@$@$@@@@@$@@@@@$@@@@$@@@@@@@@$@@$@@@$@@@@@@@@@@@@@@@@@@@@@@@$@@@@@@@@@@@@@$@@@@@@@@@@@$@@@@@@",
+"O@@@O@@@@@@O@@@@@@@@@@@@@@@@@@@@$@@$@$@$@$@$$$$@$@$$@$$@$@$$@$@$@$@$@@$@@$@$@@$@$@@@$@$@@@@@$@@@@@@@@@@$@@@$@@$@@@@@$@@$@$@$@$@$@$$@$@$$@$$$$@$$@$$@$@$$$@$@$@$@$@$@$@@$@$@@@@$@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@@@@@@$@@$@$@$@$@$@$@$@$@@$@$@$@@$@$@@$@@@$@$@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@O@@@O@@O@@@@@O@O@@@@@@@O@O@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@@@@@@@$@@$@@@$@$@@@@@@@@$@$@@$@$@$@@@$@@@@$@$@$@@$@@@$@@@@$@$@$@@$@@@@@@@$@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@O@@O@@@@@@@@@@@@@@@@$@$@$@@$@$@$@$$@$@$@$$$$@$$@$$@$@$$@$@$@$@$@@$@$@@$@@$@$@$@@@@$@@@@@@@$@@$@@@@@@@@@$@@$@$@@$@$@$@$@$@$$@$$@$$@$$@$@$$@$$@$$@$@$@$$@$@$@$@$@$@$@@$@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@$@$@@$@@$@$@$@$@$@$@$@$@$@$@$@$@$@$@@$@$@@@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@O@@@@@@@@@@@@@@O@@@@@@O@@O@@@@@@@@@O@@@@@@@@@@@@@@@@@@@@$@@@@@@$@@@@$@$@$@@@$@@$$@@$@@$$@$$@$@$@$@@$@@$@$@$@$@$@@@@@$@@$@$@@$@$@@@@@@@@@$@$@@@@@@@@$@@@@$@@$@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@O@@@@@@@@@@@@@@@@@@@@@@@@@$@@$@@$@$@$@$$@$$@$@$@$@$$@$$$@$@$@$@$@$@$@$@$@$@$@@@$@@@$@@@$@$@@@@@@@@@@$@@@@@@@@@$@@$@$@@$@$@$$@$@$@$@$$@$@$$$@$$$$$@$$$@$$@$$@$@$@$@$@@$@@$@@@$@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@$@@$@$@$@$@@$@$@$@$@$@$@$@$@@$@$@@$@$@$@@@$@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@O@@O@@@@O@@@@@@@@@O@O@@O@@@@@@@@@@@@@@@@@@@$@@@@@$@@$@@@@$@$@@@@@$@@@$@@@$@@$@@$@@$@$@@$@$@$@$@$@$@$@@$@$@$@@$@@@@$@@@@@$@$@$@@@@@@@$@@@@@@@@$@@@@@@@@@@@@@@@$@@@$@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@$@@$@@@$@$@$@$@$@$@$@$$$@$$@$@$$@$@$@$@$@$@$@$@$@$@$@@@$@$@@$@@@$@@@@@$@@@@@@@@@@@@$@$@$@@@$@@$@$@$@$@$@$$@$$$$@$$$$@$$$@@$@$@$@$@$@$@$@$@$@$@$@$@$@@$@@$@@@$@@@@@@@@@@@@@@@@@@@@@@@@$@$@$@$@$@@$@$@$@$@$@$@$$@$@$@$@$@$@$@$@$@$@@$@$@$@@$@$@@$@@$@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@@@@@$@$@@$@$@$@$@$@@$@@$@@$@$@$@$@$@@$@$@$@$@$@$@$@$@$$@$@$$@$@$@@$@@$@@@$@@@$@@@@@@@@@@@@@@$@@@@@@@@@@@@@@@@@@@@@@",
+"@O@@@@O@@O@@@@@@@@@@@@@@@@@@@@$@@@$@@$@$@$@$$@$@$$@$$$$@$@$@$@$@$@$@$@$@@$@@@$@@$@@$@@$@@@@@@@@@@@@@@@@@@@@@@@@@$@$@@$@$@$@$@$@$$@$$@$@$$$$@$$$@$$@$$@$$@$$$@$@$@$@$@$@$@$@@$@@$@@$@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@$@$@$@$@$@$@$@@$@$@$@$@$@$@$@@$@$@$@$@$@@$@@@@$@@$@@@$@$@$@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O@@@@@@@@@@@@O@@@@@@@@@@@@@@@@@@@@@@$@@@@$@$@@@@$@@$@@@$@@$@$@$@$@$@@$@$@$@$@$@@$@@$@$@$@$@$@$@@@$@@$@$@@$@@@$@@$@@@$@@@@$@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@$@$@$@@$@$@$@$@$@$$@$$$$@$@$@$@$$@$@$@$@$@$@@$@$@@$@$@@$@@$@@@@@$@@$@@$@@@@@@@@@@@@@@$@@@@@$@$@@$@$@$$@$@$$@$$$$@$@$$@$$$@$$@$@$$@$@$$@$@$@$@@$@@$@$@$@@$@@$@$@@@@@@@@@@@@@@@@@@@@@$@@$@$@$@$@@$@$@$@$@$@$@$$@$@$@$@$@$@$@$@$@$@$@$@@$@$@$@$@@$@@$@$@@$@@$@@$@$@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@@@@@$@@@@$@$@@$@@$@$@$@$@$@@$@$@$$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@@$@$@@$@$@@$@@$@@@$@@@@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@$@@@@@@@$@@$@@$@$@$$@$@$@$$@$$$@$@$@$$@$@$@$@$@$@@$@$@@$@@$@@@$@$@@@@@@@@@@@@@@@@@@@@$@@@$@$@$@@$@$@$@$@$@$$@$@$@$$$$@$$$$@$$@$$$@$$@$@$@$$@$@$@$@$@$@$@@$@@$@@@@@$@$@@@@@@@@@@@@@@@@@$@@@@@@$@@$@$@$@$@$@$$@$@$$@$$@$$@$$@$@$@$@$@@$@$@$@$@$@$@$@$@$@$@$@$@@$@$@@@@$@$@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@$@@@@$@@@@$@@@$@$@$@$@$@@$@@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@@$@$@@@$@@@$@@@@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@@@$@$@$@@$@$@$@$@$@$@$$@$$@$@$@$$$@$@$@$@$@$@$@@$@@@@$@@@@@$@@@@@@@$@@$@@$@@@@@@@@@@@@@$@@@@@@$@$@@$@$@$$@$@$$$$$$@$$$$@$@$$@$$@$$@$$$$@$@$$@$@$@$@$@@$@$@$@@$@$@@@@@@$@@@@@@@@@@@@$@@@@$@$@$@@$@@@$@$@$$@$@$@$@$@$@$@$$@$@$@$$@$@$@$@$@$@$@$@$@$@$@$@$@$@$$@$@@$$$@$@$@@$@$@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@@$@@@@@@@$@$@@$@$@@$@$@@$@$@$@$$@$$@$@$$$@$$$@$$$$$@$$@$$@$$@$$@$$@$$@$$@$@$@$@$@$@$@$@@$@@@$@$@@@@@@$@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@@@@$@@@@$@@$@$@$@$@$@$@$$@$$@$$@$$@$@$$@$@$@$@@$@@$@@$@$@@@@$@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@$@$@$@@$@$@$@$@$@$$@$@$@$$@$@$$$$@$$@$$@$$$@$@$$@$@$$@$@$@$@$@$@@$@$@@@$@$@$@@@@@@@@@@@@@@@@@@$@@@$@@$@@$$@$@$@$@$$@$$$@$$$@$$@$@$@$$@$$@$$@$@$@$@$@$@$@$$@$@$@$@$@$@$$@@$@$@$@$@$@$@@$@$@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@$@@@@$@$@@$@$@$@$@$@$@$@$@$@$@$$@$$@$@$$$@$@$$$$@$$$$$@$$@$$@$$@$@$$@$@$@$@$@$@@$@@$@@@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@@@$@@@@$@$@@$@@$@$@$@$$@$@$$@$$@$$@$$@$@$$@$@$@$@$@$@@$@@@@$@@@@$@@@$@@$@@$@@$@@@@@@@@@@@@$@@@@@$@@$@$@$@$@$@$$@$$@$$$$@$$$$@$$$$@$$$$$@$$$$@$$@$@$$@$@$@$@$@$@@$@$@$@@@@@@$@@$@@@@@$@@$@$@@@$@$@@$@$@$@$@$@$$$@$$@$@$@$@$$@$$$$$@$$@$$@$$@$$@$$$$@$$$@$$@$$$@$$@$@$@$@$$@$@$@$@$@$@@@@@@$@@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@@$@@@@@$@$@@@$@@$@$@$@$@$@$$@$$@$$$@$$@$$$$@$$$$$$@$$$$@$@$$$@$$$$@$$$$@$$@$$@$@$@$@$@@$@@$@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@$@@@@@$@$@@@@$@$@$@$@$@$@$$@$@$$@$$@$$@$$@$@$@$@$@@$@@$@@$@$@@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@$@@$@$@@$@$@$@$$@$@$$@$@$$$$@$$@$@$$$@$@$$@$@$@$@$$$@$@$@$@$@$@@$@$@@$@@@$@$@@@@@@@$@@@@@@@@@$@@@@$@$@@$@$@$@$@$@$$@$@$$$@$$@$@$@$@$$@$$@$$@$$@$@$@$$@$@$@$$@$@$$@$$$@$@$@$@$@$@@$@$@$@$$@$@@$@$@@@$@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@@@@@@@$@@$@@@@@$@@$@$@$@$@$@$@$@$@$$@$$@$$$$@$$$$@$@$$$$@$$$$$$$$$$@$$$$@$$@$@$@$@$@$@$@$@@$@@$@@@@$@@$@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@@@@@@@$@@@@@@$@$@@$@@$@$@$$@$@$$@$$@$$@$@$@$@$@$@$@$@$@@$@@$@@@@$@@@@@$@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@@@$@@$@$@$@$@$$@$$$$$@$@$$$$$$$@$$$$$@$$@$$@$@$@$@$@$@$@$@$@$@$@$@$@$@@@$@$@$@@@@$@@$@@$@@$@$@@$@$@$@$@$@$$@$$@$$$@$@$$@$$$$$@$$@$$$$@$$$@$$$$$@$$$$$$@$$$$$@$$@$$$$@$$@$$@$$@$@$@$@@$@$@$@@$@$@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@$@@@$@@$@$$@$@$@@$@$@$@$$$@$$@$$@$$$$$@$$$$@$$$$$$$@$$$$$$@$$$@$$$@$@$$@$$$@$$$@$@$@$@$@@$@@@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
+"@@@@@@@@@@@$@@$@@@@@$@$@@$@@$@$@$@$@$@$@$$@$$@$@$@$$@$@$@$@$@$@@$@$@$@@@$@$@@@$@@@@@@@@$@@@@@@@@@@@@@@@@@@@$@@$@@$@$@$@$@$@$@$@$$@$$@$@$$$$$$@$@$@$$$@$@$$@$$@$$@$@$$@$$@$$@$@$@$@$@@$@@$@$@@@$@@@$@@@@@$@@$@@$@@$@$@$@$@$@$@$$@$$@$@$$$$@$$$@$@$$$$$$@$$$@$$$@$$@$$$@$@$$$@$@$$$@$$@$@$$@$$@$$@$$@$$@$$@$@$@$@$@@$@$@@$@$@$@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@@@$@@@@@$@@$@@$@@$@@$@$@$@$@$@$@$$@$$@$$$@$@$$$@$$$$$$$$$$$$$@$$$$$$$$$$$$$$@$$@$$@$@$@$@$@@$@$@@$@@$@@@@@@@@@@@@@@@@@@@@O@@O@@O@@",
+"@@@@$@@$@$@@@$@@$@$@@$@$@@$@$@$@$@$@$$@$$@$$@$$$@$$@$@$@$@$@$@$@$@@$@@$@@@@@$@@@$@@$@@@@@@@@@@@@@@@@@@@@@@@@@$@@@@@$@@$@$@$@$@$@$$@$$$$@$@$@$$$$$$$@$$$$@$$@$$@$$@$@$@$@$@$@$@$@$@$@$@$@@@@$@$@@$@@@$@$@@@@@$@@$@$@$@$@$@$$@$@$$@$$$$@$@$$@$@$$$@$@$@$$$@$$$@$$@$$$@$$$$$@$$$$$@$$$@$$$$@$$@$$@$@$$@$$@$@$@$@$@@$@@$@@$@@@$@@@@$@$@@@@@@@@@@@@@@@@@@@@@@@$@@@@$@@@$@@$@@@@$@@$@$@$@@$@@$@$@$@$$@$$@$$@$$$$$@$$$$$$$$$$$$$$$$$$$$$$$@$$@$$$$$@$$@$$$@$$@$@$@$@@$@@@@@$@@@@@@@@@@@@@@@O@@@@@@@@@@@",
+"@@$@@$@@@@$@$@@$@@@@$@@@$@$@$@$@$@$@$@$$@$$@$$$@$$@$@$@$@$@$@$@@$@$@@$@@$@$@@@@@@@@@@@@$@@@@@@@@@@@@@@@@@@@@@@@$@$@@$@$@@$@$@$$@$@$@$@$$$$$$$@$@$@$$@$@$$$@$$@$$@$$@$$@$$$@$$@$@$@$@$@$@$@$@@@$@@$@$@@@@@$@$@@$@$@$@$@$$@$@$$$@$$$@$@$$$@$$$$$@$$$$$$$$$$$$$$$$$$$$$$$@$$$$$@$$$$@$$$$@$$$$$$@$$$@$$@$@$$@$$$@$$@$@$@$@$@$@@@$@@@@@$@$@@$@@$@@@@@@@@$@@$@@@@$@@@@@@$@@@$@$@@$@$@@$@$@$@$@$@$$$@$$@$$@$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$$$@$$@$@$$@$@@$@@$@$@@@@@@@@@@@@@@@@@@@@O@@O@@O@@",
+"@@@@@@@$@@@@@$@@$@$@$@$@$@@$@$@$@$@$@$@$$@$$@$@$$@$$@$@$@$@$@@$@$@$@$@@$@@@$@@$@@$@@$@@@@@@@@@@@@@@@@@@@@@@$@@@@@$@$@@$@$@$@$@$$@$$$@$$@$@$@$$$$$$$@$$$$@$$@$$@$$@$$@$$@$@$@$$@$@$@$@@$@@$@$@$@@$@@@$@$@$@@$@$@@$@$@$@$@$@$@$@$$@$$$$$@$$$@$@$$$@$$$$@$$@$$@$$@$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$@$$$@$$@$@$$@$$@$@$@$@$@$@$@$@$@@@@@@@$@@@$@@$@@@@@@@@$@@@@$@@$@@@$@@@@$@@$@$@@$@$@$@$@$$@$$@$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$$$$@$@$$@$@$@@@@$@@$@@@@@@@@@@@O@@@@@@@@@@@@",
+"$@$@$@$@@$@$@@$@$@@$@@$@$@$@$@$@$@$$@$$$@$$@$$$@$@$@$$@$@$@$@$@$@@$@@@$@@$@@$@@@@@@@@@@$@@@@@@@@@@@@@@@@@@@@@@$@$@@@@$@@$@$@$@$@$$@$$@$$$$$$$@$@$@$$$$@$$@$$@$$@$$@$$@$$@$$$@$@$@$@$@$@$@$@@$@@$@@$@$@@$@@$@@$@$@$@$@$$@$$@$$$@$$$$$@$$$@$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$@$$@$$$$@$$$$$$$$$$@$$@$$$$$$$$@$$$$@$$@$$@$$$@$@$@$@$@$@$@@$@$@$@@@$@@$@@@@$@@$@$@@@$@@$@@@$@@$@$@@$@$@@$$@$@$$@$$$@$$@$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$@$@$$@$@$@@$@@$@@@@@@@@@@@@@@@@@@@O@@O@O@@O@",
+"@@@$@@@$@$@@$@@@@$@@$@$@$@$@$@$$@$@$@$@$$@$$@$@$$$@$@$@$@$@$@$@@$@@$@$@@$@@@@@@$@@$@@$@@@@@@@@@@@@@@@@@@@@@$@@@@@$@$@$@$@$@$@$@$@$@$@$$@$@$@$$$$$$$@$@$$@$$$$$$$@$$@$$@$$@$@$@$$@$@$@$@$@@$@$@$@$@@$@@$@$@@$@$@$@$@$$@$$@$$$@$$$@$@$$$$$$$@$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$$@$$$@$$@$$@$@$$$@$@$@$@$@$@$@@$@@$@@@@@@$@@@@$@@@@$@@@@@@$@@@$@$@@$@@$@$@@$@$@$@$@$$@$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$@$$$$@$$@$@$@$@@@@$@@@@@@@@@@@@@@@@@@@O@@@@@@@",
+"@$@@@$@@$@@$@@$@$@@$@$@$@$@$@$@$@$@$@$$@$$@$$$$@$@$@$@$@$@$@$@$@$@$@@@$@@$@$@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@$@@$@@$@@$@$@$@$$@$$$@$$$$$$$@$@$@$$$$@$$$@$@$@$$@$$@$$$@$$$@$$@$@$$@$@$@$@$@$@$@@$@@$@$@@$@@$@$@$@$@$$@$@$@$$@$$$$$$$@$@$$$@$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$$$@$$$@$@$$$@$@$@$@$@@$@@$@@$@$@$@@@$@@@@$@@$@$@$@@@$@$@@@$@@$@$@$@$@$@$@$$$@$$$@$$$@$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$@$$@$$@$@$@$@$@@@@@@@@@@@@@@O@@O@O@@@@@@O@@",
+"@@$@$@@$@$@$@$@$@$$@$@$@$@$@$@$@$@$$@$@$@$$@$@$$$$$$@$$@$$@$@$@$@$@@$@@@@@@@@@@$@@$@@$@@$@@$@@$@@$@@$@@$@@$@$@@@$@$@$@$@$@$@$$$@$$@$@$$@$$@$$$$$$$$@$$$$@$$$$$$$@$$@$$@$$@$@$@$$@$@$@$@$@$@@$@$@$@$@$@$@$@$@$@$@$$@$$@$$$$@$$@$$@$@$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$@$$@$$@$$@$@$@$@$@$@$@$@@@@@@$@$@@$@@@$@@@@$@@$@@$@$@$@$@$@$@$$$$$$$$@$@$$@$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$@$@$@@$@$@$@@@@@@@@@@@@@@@@@@O@O@@@@O",
+"$@@$@@$@@@$@@$@@$@@$@$@$@$@$@$@$@$$@$@$@$$@$$$$@$@$@$@$@$@$@$@$@$@@$@@@$@$@$@$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@$@$@@@@$@$@$@$@$@$@$@$$$$$$@$$$$$@$$@$$$$@$$$@$@$@$$@$$@$$@$@$$@$$@$$@$@$@$@$@$@$@$@$@$@$@$@$@$@$$@$@$$@$$@$@$$@$$$$$$$$$$@$$$@$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$@$$@$@$@$@$@$@$@$@$@$$@$@@@$@@$@$@@$@$@@$@@$@@$@$@$@$@$@$@$@@$@$$@$$@$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$@$$@$@$$@$@$@@$@@@$@@@@@@@@@@@O@@O@@@@@@O@@",
+"@$@@$@$@$@$@$@$@$@$@$@@$@$@$@$@$$@$@$$@$$@$$@$@$$@$$$@$$@$$@$@$@@$@@$@$@@@@@@@@$@@$@@$@@$@@$@@$@@$@@$@@$@$@@$@@@$@$@$@$@$$@$$@$$@$$@$@$$$$@$@$$$$$$@$$$$@$$$$$$$@$$@$$@$$$@$$@$@$@$$@$@$@$@$@$@@$@$@$@$@$@$@$@$$@$@$$@$$@$$$$$@$$@$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$$@$@$$$$@$$@$$$@$$$@$$@$@$@$@$@@$@$@$@@$@@@$@@@@$@@$@@$@@$@@$@$@$@$@$@$$@$@$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$@$$$@@$@$@$@@@$@@@@@@@@@@@@@@@@@@O@@O@@@@",
+"@$@$@$@$@$@$@$@$@$@$@$$@$@$$@$$@$@$$@$$@$$@$$@$$@$$@$@$@$@$@$@$@$@$@$@@@$@$@$@$@@@@$@@@@@$@@@@@$@@@@@$@@@@@$@@$@$@$@$@$@$@$$@$@$$$@$$$$$@$$$$$$@$@$$$$@$$$$@$$@$$@$$$@$$$@$$@$$$@$$@$@$@$@$@$@$$@$@$@$@$@$@$$@$@$$$@$$@$$$@$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$@$$@$$@$@$@$@$@$@$@$@$@@$@@$@$@$$@@$@$@$@@$@$@$@$@$@$@$@$$@$$@$$$@$$$@$@$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$@$@$$@$@$@@$@@@$@@@@@@@@@@@@@O@@@@@@@@@@",
+"@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$$@$@$@$$@$$@$$$@$$@$$@$$@$@$@$@$@@$@@$@@@@@$@@@$@$@@@$@$@@@$@$@@@$@$@@@$@@$@@$@@@$@$@$@$@$@$$$$@$@$$@$$@$$$@$$$$$$$@$$$$@$$$$$$$$$$@$$$@$$@$$@$@$@$@$$@$@$@$@$@@$@$@$@$@$@$@$$@$@$@$$@$$@$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$$$@$$@$$@$@$@$@$@$@$@$@@$@@$@$@@@$@$@$@$@$@$@$$@$@$$@$$@$@$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$@$$$@$@$@$@$@$@$@@@@@@@@@@@@@@@@@@O@@O@@O@",
+"$@$@$@$@$$@$$@$$@$$@$@$@$$@$$@$$@$$$$$@$$@$$@$@$$@$$@$$@$@$$@$@$@$@$@@$@$@$@@$@$@@@@$@@@@@$@@@@@$@@@@$@@$@@$@@$@$@$@$@$@$$@$@$@$$$@$$$$$$@$$$$@$$@$$$$@$$$$$$@$$$@$$$$$$@$$@$$$$$$$$@$@$@$$@$@$$$@$$@$@$$@$$@$@$$$$@$$$$$$$$@$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$@$$@$$$$@$$@$$@$@$@$$@$@$@$@$@$@$@$@$@$@$@@$@$@$@$@$@$@$$$@$$@$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$@$$$@$@$@$@@@@@@$@@@@@@@@O@@@@@@@@@@@@@",
+"@$@$@$@$@$$@$$@$$@$@$$@$@$$@$$@$$@$@$@$$@$$@$$$$@$$@$@$@$$@@$@$@$@$@$@@$@$@@$@@@$@$@@$@$@$@@$@$@@$@$@@$@@@$@@$@$@$@$@$@$@$$$@$$$@$$$@$$$$$$@$$$$@$$@$$$$$$@$$$$@$$$@$@$$$$@$$@$@$@$@$$@$$@$@$$@@$$@$@$$@$@$@$$$@$@$$$@$@$$@$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$@$$@$$@$$$@$@$@$@$@$@$@$@$@@$@$@$@$@$@$@$@$@$@$$@$@$$@$$@$@$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$$@$@$@$@@$@$@$@@@@@@@@@@@@@O@@@@@@@@@@",
+"$@$$@$$@$$@$$@$$@$@$$@$@$$@$$@$$@$$@$$$@$$@$$@$@$$@$$@$@$@$$@$@@$@$@@$@$@@@$@$@$@@@$@@$@@@$@@$@@$@@@$@@@$@@$@@$@@$@$@$@$$@$@$$@$$$@$$$@$$@$$$$@$$$$$$@$$@$$$$$$$$$$$$$$$@$$@$$$$$$@$$@$@$@$@$@$$$@$@$$@$@$@$$@$$@$$@$$$$@$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$@$$@$@$$$@$$@$@$@$@$@$@$@@$@@$@@$@$@$@$@$$@$@$$@$$@$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$@$@$@@$@@@@@@@@@@@@@@@@@@@@@O@@@@",
+"$$@$$@$$@$$@$$@$$$$@$$$$@$$@$$@$$@$$@$@$$$$$@$$$@$$@$$@$$@$@$@$$@$@$@$@$@$@@@$@@$@$@@$@@$@@$@@$@@$@$@$@$@$@$@$@$@$@$@$$@$$@$$@$$@$$$$$$$$$$@$$$$@$$$$$$$$$$@$$@$$@$$@$$$$@$$@$@$@$$@$$$$@$$$@$@$@$$@$@$$$$$@$$@$$@$$@$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$@$$$$@$@$@$$@$$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$$$$@$$$@$$@$$$@$@$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$$$@$$@$@$@$@@$@$@$@@@@@@@@@@@@@@@@@@@@@",
+"$@$@$$@$$@$$@$$@$@$$@$@$$@$$@$$@$$$@$$$$@$@$$$$@$$@$$@$$@$$@$$@@$@@$@$@$@@$@$@@$@$@@$@@$@@$@@$@@$@$@@@@@$@$@$@$@$@$@$@$@$@$$@$$$$$@$$@$@$@$$$$@$$$@$@$@$$@$$$$$$$$$$$$$@$$@$$$@$$@$$@$@$$@$@$$$@$$@$$@$@$@$$@$$@$$@$$@$$@$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$@$$$@$$@$@$$@$@$@$@$@$@$@$@$@$@$@$@$@$$$@$$@$$@$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$@$@$@@$@@$@@@@@$@@@@@@@@@@@@@@@@@@",
+"$$@$$@$$@$$@$$@$$@$@$$@$@$$@$$@$$@$$@$@$$$$@$@$$@$$@$@$@$$@$@$$@$@$@$@$@$@$@$@$@@$@$@$@$@$@$@$@$@@$@$$@$@$@$@$@$@$@$@$$@$$$@$$@$$$$$$$$$$$$@$$$$$$$$$$$$$$$$@$$@$@$@$$$$@$$@$@$$@$$@$$@$@$$@$@$$@$$@$$@$@$@$$@$$$@$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$@$$$$@$$@$@$@$$@$$@$$@$@$@$@$@$@$$@$$@$$@$$$@$$$$@$$@$$$$@$@$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$$@$@$@$@$@$@$@@$@$@@@@@@@@@@@@@@@@@@@@",
+"$@$$$$@$$@$$$$$@$$$$@$$$$@$$$$$@$$@$$$$$@$@$$$$$$@$$@$$$@$$@$$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@@$@$@$@$@$@$$@$$@$$@$@$$$$@$$$$$@$$$@$$$$@$$@$$@$$@$$@$$$$$$$$$$$@$$@$$$$$$$@$$@$$$$@$$@$$@$$@$$@$$$$$@$$$$@$$$$@$$$$$@$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$@$$$@$$$$$$@$$@$$@$@$@$@$@$$@$@$$@$$@$$$@$$$@$$$@$$$@$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$@$@$@$@@$@$@@@$@$@@@@@@@@@@@@@@@",
+"$$@$@$$$$$@$@$$$$@$$$$@$$$$@$@$$$@$$@$@$$$$$@$@$@$$@$$@$$@$$@$@$$@$@$@$@$@$@@$@$@$@@$@$@$@$@$@$@$@$@$@$@$$@$$@$$@$$@$$@$$$$@$@$$$$@$$$$@$$$$@$$$$$$$$$$$$$$$$@$$@$$@$$$$$$@$@$@$$$$@$$@$$$@$$@$$@$$@$$@$@$$$$@$@$$@$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$@$$$@$@$@$$@$$@$$$$@$$@$@$$@$$@$$@$$@$$@$$$$@$$$@$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$@$@$@$@$$@$@$@@$@@$@$@$@@@$@@@@@@@@@@@@@@",
+"@$$$$$$$@$$$$$$@$$$$@$$$$@$$$$$@$$$$$$$$$@$@$$$$$@$$@$$@$$@$$@$$@$@$@$@$@$@$$@$@$@$@$@$@$@$@$@$@$@$@$@$@$@$$@$$@$@$$@$$$$@$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$@$$@$$$$$$$$$@$$@$$$$$$$$@$$$$$$$@$$$$@$$@$$@$$$$$$@$$$$$$$@$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$@$$$$$$@$$@$$$@$@$$@$$$@$$@$$$$$@$$@$$$$@$$@$@$$$$$$@$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$@$@$@$$@$@$@@@$@$@$@$@$@@@@@@$@@",
+"$$@$@$@$$$@$@$$$$@$$$$@$$$$@$$$$$@$@$$@$@$$$$@$@$$$$$$@$$$$@$$@$@$$@$$@$@$@$@$@$@$$@$@$@$@$@$@$$@$@$$@$$@$$@$$@$$$@$$$@$@$$@$$$@$$$$@$$$$$$$$$$$$$$@$$$$$$$$$$@$$@$$$$$@$$$@$$@$$$$@$@$@$$$@$$$$@$$$$@$@$@$$$@$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$@$$$$$$$$@$$@$$$@$$@$@$$$@$$@$$$$$$$$$@$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$@$@$$$@$$@$$@@$@$@$@$@@$@@$@@@$@$@$@@$@",
+"@$$$$$$$@$$$$$$@$$$$@$$$$@$$$@$@$$$$@$$$$$@$@$$$$$@$@$$$@$@$$@$$@$@$$@$@$$@$@$$@$$@$@$$@$$@$$@$@$$@$@$$@$@$$@$$@$@$$@$$$$@$$$$$$$$$$$$$$$$@$$@$$$$$$$$$$@$$$@$$$$$$@$@$$$$$$$$$$$@$$$$$$$@$$@$@$$$$@$$$$$$$$$$@$$$$$@$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$@$$$$$$$$@$$$$$@$@$@$$$$@$@$$$$$$$@$$@$$$$@$$@$@$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$@$@$$@$$@$$@$@@$@$@$@@$@$@$@@@$@@$@@",
+"$$@$$$$$$$$$$@$$$$@$$$$@$$$@$$$$$@$$$$@$$@$$$$@$@$$$$$@$$$$@$$@$$$$@$$$$@$@$$@$@$@$$$@$$@$$@$$$$@$$$$@$$$$$$$$$$$$$$$$$$$$$$@$$@$$@$$$$@$$$$$$$$@$$$$@$$$$$$$$$$@$$$$$$$@$$@$$$$@$$@$$@$$$@$$$$@$@$$$@$@$$@$@$$$$@$$$$@$$$@$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$$$$@$$$$$$$$@$$$$$$@$@$@$$$$$$@$$$$@$$$$@$@$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$@$$@$@$@$@$$@$@$@$$@@$@$@$@$@$@$@",
+"@$$$$@$@$$$@$$$$@$$$$$$$$@$$$$$@$$$$@$$$$$$$@$$$$$$$@$$$$@$$@$$@$@$$@$@$$@$@$@$@$$@$@$@$$@$$@$@$$@$@$$@$@$$@$@$@$$$$@$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$@$$$$$$$@$$$$$@$$$@$$$$@$$$$$@$$$$@$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$@$@$$@$$$$@$$@$$$$$$$@$@$$$$@$$$$@$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$@$$$$@$$@$$@$@$@$@$@$@$@$@$@$@$@@$@",
+"$$@$$$$$$@$$$@$$$$@$@$@$$$$@$@$$$@$$$$@$@$$$$$@$@$@$$$@$@$$$$$@$$$$@$$$$@$$$@$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$@$$@$$$$$$$@$$$$$@$$$@$$$@$$$$$$$$$$@$$$@$$@$$$$@$$$$$$@$@$$$@$$@$@$$@$$@$$$@$$$$@$$@$$$$@$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$@$@$@$$$$$@$$$$@$$$$@$$$$$$$@$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$$$$$$$@$@$$@$$@$@$@$@$@$@$@$@$@$@$@$@$@",
+"@$$$$$@$$$$$$$$$$$$$$$$$$@$$$$$$$$$$@$$$$@$@$@$$$$$$@$$$$$@$@$$$$@$$$$@$$$@$$$@$$$@$$@$@$@$$@$$@$@$$@$$@$$$@$$@$$$$$$@$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$@$$$@$$$$$$$$$$$$$$$$$$$$@$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$@$$$$@$$$$$$$$$$$$$$$$$$@$$$$@$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$$$$$$$@$$@$$$@$$$@$@$$@$@$@$@$@$@",
+"$$$@$$$$@$$@$$@$$@$$$$$@$$$@$$@$@$@$$$@$$$$$$$$@$@$$$@$@$$$$$@$@$$@$@$$@$@$$@$$$@$$$@$$$$$$@$$$$$$$@$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$@$$@$$$@$$@$$$$$$@$$$$$@$$@$$@$$@$$$@$$@$$@$$@$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$$$@$$$$$$$$$$$$@$$@$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$@$@$$@$$@$$@$$$@$$$$@$$$$@$@$$$@$",
+"$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$@$@$@$@$$$$@$$$$@$$@$$$$$$$$$$$$$$$$$$@$$$@$$$$@$$$$$@$$@$$$$$@$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$@$$$$$$$$$$$$$@$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$@$$$$$$$$$@$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$@$$$$$$$$$$$$$$$@$$$$@$$$@$@$$$@$@$$",
+"$@$$$$$$$$$$$$$$$$$$$$$$$@$$@$$$$$$@$$$$$$$$$$$@$@$$@$$$$$@$$$@$@$$@$@$$@$@$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$@$$$$$$@$$@$$$$$@$$@$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$@$$$$$$$$$@$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$@$$$@$$@$$@$$$$$@$$$@$$$$$@$$$$@$",
+"$$$$$@$$@$$$@$$$@$$$$$@$$$$$$$@$$@$$$$@$$@$@$@$$$$@$$$@$@$$$@$$$$$$$$$@$$$$$$@$@$$@$$$$$$$@$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$@$$$$@$$$$$$$$$$$@$$$$$$$$@$@$@$$@$$$$@$$$@$$@$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$@$$$@$$$$$$$$@$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$@$$$$@$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$@$$$$$$@$$$$@$$$$$$$$$@$$@$$$$$$$@$$@$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$@$$$$$$$$@$$@$$$$$$$$$$@$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$$$$$@$$$@$$$$$@$$$$$$$$@$$$$$@$$$$@",
+"$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$$$$@$$$@$$$$@$$@$$$$@$$$$@$$@$@$$$$$$$@$$$$$$$$$$$$$$$@$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$@$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$@$$$$$$$$$$@$$$$$@$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$@$$$$@$$@$$$$@$$$$@$$$$@$$@$$$$@$$@$$$@$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$@$$$$$$$$$$$$$$$$$@$$$$$$@$$$$@$$$@$$$$$$$@$$$$$$$$@$$@$$$$@$$@$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$@$$$$$$$$$$$@$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$@$$@$$$$$$$$$$$$$$@$$@$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$@$$$@$$$$$$$$@$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$@$$$$$$$@$$$$$@$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$@$$$$@$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$@$$$@$$$$$$$$$$@$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$@$$@$$$$$$$$$$@$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$@$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$@$$$@$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$@$$$$$$$$@$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$@$@$$@$$$@$$@$$@$$@$$@$$@$$@$$@$@$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$@$$$@$$$$$$$$$$$@$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$@$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$$$@$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$@$$$$$$$$@$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$@$$$$$$$@$$$@$$$@$$$@$$$@$$@$@$@$$@$$$$$$$@$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$@$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$@$$$$$$$$$$$$$$$$$$@$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$@$$$$$@$$$$$$$@$$$$$$$@$$$$$$$$@$$@$@$$$$$$@$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$@$$$$$$$$@$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$@$$@$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$@$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$@$$$$$$@$$$$$$$@$$$$$$@$@$@$$$$$$$$$@$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$@$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$@$$$$$$$@$$$$@$$@$$$@$@$@$$$$$$@$$@$$@$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$@$$$@$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$@$$$@$$$$$$$$$@$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$@$$@$$$@$$$$$$$@$$$$$$@$@$@$$$@$$$$$@$$@$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*$$*$$*$$*$$*$$*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$@$$$$$$@$$$$$@$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$@$$$@$@$@$$$@$$@$$$$$$$@$$$$$@$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$@$$@$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$@$$$$$$$@$$$$$$@$$$$$$@$$$$@$$@$@$@$$$@$@$$$$$$@$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$@$$@$$@$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*$$$$$$$$$$$$$$$$$$$*$$$*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$@$$@$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$$$$$@$@$$@$@$@$$$$@$$@$$$$$$@$$$$$$$$$@$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*$$*$$*$$*$$*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$@$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$$$$@$$$$$@$@$$$$$@$@$@$$$@$@$$@$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*$$$$$$$$$$$$$$$$$$$$*$$$$$$$*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$@$$$$@$$$$@$$$$@$@$$$$@$@$@$@$$$$@$$$$$$$@$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$@$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$@$$@$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$@$@$$@$$$$$$@$$$$$@$$$@$@$$$@$@$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*$$$$$$$$*$$$*$$$*$$$*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$@$$$$$@$$$$@$$$@$@$@$$@$@$$@$@$$$$@$$$$$@$$$@$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$*$$$*$$$$$$$$$$$$$$$$$$$$$$$$$@$$$@$$$$$$$$$$@$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*$$*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$@$$$$$$$@$$$@$$@$$@$$$@$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*$$$$$$$$$$$$$$$$$$$$$$$$$$$$*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$@$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$@$$$@$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$$@$@$$@$@$$@$@$@$$$@$$$@$$@$$@$$$@$@$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*$$*$$*$$$*$$$$$$$$$$*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$@$$$@$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$@$$$$@$$$$$@$$$@$@$$@$$@$$@$$$$$$@$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
+"$$$*$$$$$$$$$$$*$$$$$$$$$$$$$$$$$$$$$$$$@$$@$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*$$$$$$$$$$$$$$$$$$$$*$$$*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$@$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@$$@$@$$$$@$$$$@$@$$@$$$$@$$@$$$$$@$$$@$$$$$$$$@$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
+};
--- /dev/null
+#Plugin name\r
+pluginName=Dynamic Analyzer Workbench\r
+#Provider name\r
+providerName=Samsung Electronics\r
+\r
+#Product name, Application Name\r
+DynamicAnalyzer=Tizen Dynamic Analyzer\r
+\r
+#Perspective name\r
+MainPerspective=MainPerspective
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<?eclipse version="3.4"?>\r
+<plugin>\r
+\r
+ <extension\r
+ id="application"\r
+ point="org.eclipse.core.runtime.applications">\r
+ <application>\r
+ <run\r
+ class="org.tizen.dynamicanalyzer.workbench.Application">\r
+ </run>\r
+ </application>\r
+ </extension>\r
+ <extension\r
+ id="product"\r
+ point="org.eclipse.core.runtime.products">\r
+ <product\r
+ application="org.tizen.dynamicanalyzer.workbench.application"\r
+ name="%DynamicAnalyzer">\r
+ <property\r
+ name="appName"\r
+ value="%DynamicAnalyzer">\r
+ </property>\r
+ <property\r
+ name="windowImages"\r
+ value="icons/16_DA_icon.png,icons/32_DA_icon.png,icons/48_DA_icon.png,icons/64_DA_icon.png,icons/128_DA_icon.png">\r
+ </property>\r
+ <property\r
+ name="preferenceCustomization"\r
+ value="plugin_customization.ini">\r
+ </property>\r
+ </product>\r
+ </extension>\r
+ <extension\r
+ point="org.eclipse.ui.perspectives">\r
+ <perspective\r
+ class="org.tizen.dynamicanalyzer.workbench.perspective.DAMainPerspective"\r
+ id="org.tizen.dynamicanalyzer.workbench.perspective.DAMainPerspective"\r
+ name="%MainPerspective">\r
+ </perspective>\r
+ </extension>\r
+\r
+</plugin>\r
--- /dev/null
+org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP = false\r
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.workbench;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.PrintStream;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Locale;
+
+import org.eclipse.equinox.app.IApplication;
+import org.eclipse.equinox.app.IApplicationContext;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+
+public class Application implements IApplication {
+ private final boolean STDOUT_TO_FILE = false;
+
+ @Override
+ public Object start(IApplicationContext context) throws Exception {
+ Display display = PlatformUI.createDisplay();
+ SimpleDateFormat format = new SimpleDateFormat("yyyy_MM_dd_HH-mm-ss", //$NON-NLS-1$
+ Locale.KOREA);
+ Date date = new Date();
+ String logPostFix = format.format(date);
+ WorkbenchPathManager.setLogPostFix(logPostFix);
+ if (STDOUT_TO_FILE) {
+ String logPath = WorkbenchPathManager.getLogsPath();
+ File logs = new File(logPath);
+ if (!logs.exists()) {
+ logs.mkdir();
+ }
+
+ String logFileName = "da_log_" + logPostFix;//$NON-NLS-1$
+ logPath += File.separator + logFileName;
+
+ File file = new File(logPath);
+ FileOutputStream fos = new FileOutputStream(file);
+ PrintStream ps = new PrintStream(fos);
+ System.setOut(ps);
+ System.setErr(ps);
+ }
+
+ String[] argv = (String[]) context.getArguments().get(
+ "application.args");//$NON-NLS-1$
+ if (argv.length > 0) {
+ ApplicationWorkbenchWindowAdvisor.setAutoStart(true);
+ } else {
+ ApplicationWorkbenchWindowAdvisor.setAutoStart(false);
+ }
+
+ int returnCode = PlatformUI.createAndRunWorkbench(display,
+ new ApplicationWorkbenchAdvisor());
+
+ if (returnCode == PlatformUI.RETURN_RESTART) {
+ return IApplication.EXIT_RESTART;
+ } else {
+ return IApplication.EXIT_OK;
+ }
+ }
+
+ @Override
+ public void stop() {
+ if (!PlatformUI.isWorkbenchRunning()) {
+ return;
+ }
+ final IWorkbench workbench = PlatformUI.getWorkbench();
+ final Display display = workbench.getDisplay();
+ display.syncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (!display.isDisposed()) {
+ workbench.close();
+ }
+ }
+ });
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.workbench;
+
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.application.ActionBarAdvisor;
+import org.eclipse.ui.application.IActionBarConfigurer;
+
+public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
+
+ public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
+ super(configurer);
+ }
+
+ @Override
+ protected void fillMenuBar(IMenuManager menuBar) {
+ }
+
+ @Override
+ protected void makeActions(IWorkbenchWindow window) {
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.workbench;
+
+import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
+import org.eclipse.ui.application.WorkbenchAdvisor;
+import org.eclipse.ui.application.WorkbenchWindowAdvisor;
+import org.tizen.dynamicanalyzer.workbench.perspective.DAMainPerspective;
+
+
+public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
+
+ @Override
+ public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
+ IWorkbenchWindowConfigurer configurer) {
+ return new ApplicationWorkbenchWindowAdvisor(configurer);
+ }
+
+ @Override
+ public String getInitialWindowPerspectiveId() {
+ return DAMainPerspective.ID;
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.workbench;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Monitor;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.application.ActionBarAdvisor;
+import org.eclipse.ui.application.IActionBarConfigurer;
+import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
+import org.eclipse.ui.application.WorkbenchWindowAdvisor;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.common.DASingletonFocusManager;
+import org.tizen.dynamicanalyzer.common.PathManager;
+import org.tizen.dynamicanalyzer.communicator.IDECommunicator;
+import org.tizen.dynamicanalyzer.communicator.ResourceCommunicator;
+import org.tizen.dynamicanalyzer.handlers.ExitHandler;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.ui.toolbar.configuration.ConfigurationDialogValues;
+import org.tizen.dynamicanalyzer.ui.toolbar.configuration.WelcomeDialog;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+
+public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
+
+ private static final int DEFAULT_WIDTH = 1024;
+ private static final int DEFAULT_HEIGHT = 768;
+ private static final int MIN_WIDTH = 800;
+ private static final int MIN_HEIGHT = 600;
+ private int width = DEFAULT_WIDTH;
+ private int height = DEFAULT_HEIGHT;
+ static boolean isAutoStart = false;
+
+ public ApplicationWorkbenchWindowAdvisor(
+ IWorkbenchWindowConfigurer configurer) {
+ super(configurer);
+ }
+
+ @Override
+ public ActionBarAdvisor createActionBarAdvisor(
+ IActionBarConfigurer configurer) {
+ return new ApplicationActionBarAdvisor(configurer);
+ }
+
+ @Override
+ public void createWindowContents(Shell shell) {
+ ToolbarArea.createInstance(getWindowConfigurer(), shell);
+
+ if (DASingletonFocusManager.checkDASingleton()) {
+ System.out.print("Already DA Running \n"); //$NON-NLS-1$
+ DASingletonFocusManager.setFocusDA();
+ System.exit(-1);
+ }
+ }
+
+ @Override
+ public void preWindowOpen() {
+ Monitor[] monitors = PlatformUI.getWorkbench().getDisplay()
+ .getMonitors();
+
+ Rectangle rectangle = null;
+
+ rectangle = monitors[0].getBounds();
+
+ if (rectangle.width < DEFAULT_WIDTH
+ || rectangle.height < DEFAULT_HEIGHT) {
+ width = MIN_WIDTH;
+ height = MIN_HEIGHT;
+ }
+
+ IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
+ configurer.setInitialSize(new Point(width, height));
+ configurer.setShowStatusLine(false);
+ configurer.setShellStyle(SWT.SHELL_TRIM/* | SWT.NO_BACKGROUND */);
+ }
+
+ public void postWindowOpen() {
+ PathManager.pathCheck();
+ DASingletonFocusManager.setSaveFocusDAPid();
+ IDECommunicator.startIDECommunicatorThread();
+ if (!isAutoStart) {
+ ConfigurationDialogValues.getInstance()
+ .setSettingValueFromConfigFile();
+ if (!ConfigurationDialogValues.getInstance().isShowInitia()) {
+ final Shell shell = AnalyzerUtil.getWorkbenchWindow()
+ .getShell();
+ WelcomeDialog dialog = new WelcomeDialog(shell, SWT.NONE); // FIXME
+ dialog.open();
+ }
+ }
+ PathManager.setLogPostFix(WorkbenchPathManager.getLogPostFix());
+ }
+
+ public boolean preWindowShellClose() {
+ if (ResourceCommunicator.isRunning()) {
+ ResourceCommunicator
+ .sendMessage(AnalyzerConstants.MSG_STOP
+ + CommonConstants.CMD_SPLIT + 0
+ + CommonConstants.CMD_SPLIT);
+ }
+
+ AnalyzerUtil.executeCommand(ExitHandler.ID);
+
+ ToolbarArea.getInstance().dispose();
+ return true;
+ }
+
+ public static void setAutoStart(boolean status) {
+ isAutoStart = status;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.workbench;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+public class WorkbenchPathManager {
+
+ public static final String WIN_INSTALL_NODE = "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders";//$NON-NLS-1$
+ public static final String WIN_INSTALL_KEY = "Local AppData"; //$NON-NLS-1$
+
+ public static final String LINUX_INSTALL_ENV = "HOME";//$NON-NLS-1$
+ public static final String TIZEN_SDK_DATA = "tizen-sdk-data";//$NON-NLS-1$
+ public static final String TIZEN_SDK_DATA_PATH = getTizenSdkDataPath();
+ public static final String INSTALL = "tizensdkpath"; //$NON-NLS-1$
+ public static final String TIZEN_ROOT_PATH = getDefaultRoot();
+ public static final String TOOLS_FOLDER_NAME = "tools"; //$NON-NLS-1$
+ public static final String DYNAMIC_ANALYZER_FOLDER_NAME = "dynamic-analyzer"; //$NON-NLS-1$
+ public static final String SAVE_FOLDER_NAME = "save"; //$NON-NLS-1$
+ public static final String LOG_FOLDER_NAME = "logs"; //$NON-NLS-1$
+ public static final String DYNAMIC_ANALYZER_INSTALL_PATH = getInstallPath();
+ public static final String CONFIG_FOLDER_NAME = "config"; //$NON-NLS-1$
+ public static final String CONFIG_FOLDER_PATH = getConfigFolderPath();
+ public static final String CONFIG_FILE_NAME = "config"; //$NON-NLS-1$
+
+ public static final String OS_KEY = "os.name"; //$NON-NLS-1$
+ public static final String LINUX = "linux"; //$NON-NLS-1$
+ public static final String MAC = "mac"; //$NON-NLS-1$
+ public static final String WIN = "win"; //$NON-NLS-1$
+
+ private static String logPostFix = null;
+
+ public static String getLogPostFix() {
+ return logPostFix;
+ }
+
+ public static void setLogPostFix(String postFix) {
+ logPostFix = postFix;
+ }
+
+ public static String getRegistryValue(String node, String key) {
+ BufferedReader br = null;
+ String value = ""; //$NON-NLS-1$
+
+ String query = "reg query " + "\"" + node + "\" /v " + "\"" + key + "\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ try {
+ Process process = Runtime.getRuntime().exec(query);
+ String encoding = System.getProperty("sun.jnu.encoding"); //$NON-NLS-1$
+
+ br = new BufferedReader(new InputStreamReader(
+ process.getInputStream(), encoding));
+
+ String line = null;
+ while ((line = br.readLine()) != null) {
+ int index = line.indexOf("REG_SZ"); //$NON-NLS-1$
+ if (index >= 0) {
+ value = line.substring(index + "REG_SZ".length()).trim(); //$NON-NLS-1$
+ }
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ } finally {
+ if (br != null) {
+ try {
+ br.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ return value;
+ }
+
+ public static String getTizenSdkDataPath() {
+ String defaultPath = null;
+ if (isWin()) {
+ defaultPath = getRegistryValue(WIN_INSTALL_NODE, WIN_INSTALL_KEY)
+ + File.separator + TIZEN_SDK_DATA;
+ } else if (isMac()) {
+ defaultPath = System.getenv(LINUX_INSTALL_ENV) + File.separator
+ + TIZEN_SDK_DATA;
+ } else if (isLinux()) {
+ defaultPath = System.getenv(LINUX_INSTALL_ENV) + File.separator
+ + TIZEN_SDK_DATA;
+ } else {
+ System.out.println("Please check OS and install the Tizen SDK"); //$NON-NLS-1$
+ System.exit(-1);
+ }
+ return defaultPath;
+ }
+
+ public static String getDefaultRoot() {
+ String rootPath = null;
+ BufferedReader br = null;
+ String line = null;
+ try {
+ rootPath = TIZEN_SDK_DATA_PATH + File.separator + INSTALL;
+ File file = new File(rootPath);
+ if (!file.isFile()) {
+ return null;
+ }
+ br = new BufferedReader(new InputStreamReader(new FileInputStream(
+ file)));
+ line = br.readLine();
+ return line.substring(line.indexOf("=") + 1); //$NON-NLS-1$
+ } catch (IOException e) {
+ System.out.println("Fail to read."); //$NON-NLS-1$
+ e.printStackTrace();
+ } finally {
+ if (null != br) {
+ try {
+ br.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ return rootPath;
+ }
+
+ public static String getInstallPath() {
+ String installPath = TIZEN_ROOT_PATH;
+ if (null != installPath) {
+ installPath += File.separator + TOOLS_FOLDER_NAME + File.separator
+ + DYNAMIC_ANALYZER_FOLDER_NAME;
+ }
+ return installPath;
+ }
+
+ public static String getSavePath() {
+ String savePath = TIZEN_SDK_DATA_PATH;
+ if (null != savePath) {
+ savePath += File.separator + DYNAMIC_ANALYZER_FOLDER_NAME
+ + File.separator + SAVE_FOLDER_NAME;
+ }
+ return savePath;
+ }
+
+ public static String getLogsPath() {
+ String savePath = TIZEN_SDK_DATA_PATH + File.separator
+ + DYNAMIC_ANALYZER_FOLDER_NAME + File.separator;
+ if (null != savePath) {
+ savePath += LOG_FOLDER_NAME;
+ }
+ return savePath;
+ }
+
+ public static String getSdbPath() {
+ String path = TIZEN_ROOT_PATH;
+ if (null != path) {
+ path += File.separator + "tools" + File.separator + "sdb"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ return path;
+ }
+
+ public static String getConfigFolderPath() {
+ String configFolderPath = DYNAMIC_ANALYZER_INSTALL_PATH;
+ if (null != configFolderPath) {
+ configFolderPath += File.separator + CONFIG_FOLDER_NAME;
+ }
+ return configFolderPath;
+ }
+
+ public static String getConfigFilePath() {
+ String configFilePath = CONFIG_FOLDER_PATH;
+
+ if (null != configFilePath) {
+ configFilePath += File.separator + CONFIG_FILE_NAME;
+ }
+ return configFilePath;
+ }
+
+ public static void pathCheck() {
+ if (null == TIZEN_ROOT_PATH) {
+ System.out.println("Tizen Root Path is null"); //$NON-NLS-1$
+ System.exit(-1);
+ }
+ }
+
+ private static String getOS() {
+ return System.getProperty(OS_KEY).toLowerCase();
+ }
+
+ public static boolean isLinux() {
+ return getOS().indexOf(LINUX) >= 0;
+ }
+
+ public static boolean isMac() {
+ return getOS().indexOf(MAC) >= 0;
+ }
+
+ public static boolean isWin() {
+ return getOS().indexOf(WIN) >= 0;
+ }
+}
--- /dev/null
+/*\r
+ * Dynamic Analyzer\r
+ *\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact: \r
+ * Jooyoul Lee <jy.exe.lee@samsung.com>\r
+ * Juyoung Kim <j0.kim@samsung.com>\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ * \r
+ */\r
+\r
+package org.tizen.dynamicanalyzer.workbench.perspective;\r
+\r
+import org.eclipse.ui.IPageLayout;\r
+import org.eclipse.ui.IPerspectiveFactory;\r
+\r
+public class DAMainPerspective implements IPerspectiveFactory {\r
+\r
+ public static final String ID = DAMainPerspective.class.getName();\r
+\r
+ @Override\r
+ public void createInitialLayout(IPageLayout layout) {\r
+ layout.setEditorAreaVisible(false);\r
+ }\r
+\r
+}\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry exported="true" kind="lib" path="lib/sqlitejdbc-v056.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.eclipse.cdt.core_5.3.1.201109151620.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.eclipse.cdt.debug.edc_2.0.0.201109151658.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.eclipse.cdt.dsf_2.2.0.201109151620.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jcommon-1.0.17.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="lib" path="lib/org.eclipse.nebula.widgets.grid_1.0.0.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.tizen.dynamicanalyzer</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+ <linkedResources>
+ <link>
+ <name>Link</name>
+ <type>2</type>
+ <locationURI>TEMP</locationURI>
+ </link>
+ </linkedResources>
+</projectDescription>
--- /dev/null
+#Fri Oct 01 12:23:52 KST 2010\r
+eclipse.preferences.version=1\r
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled\r
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6\r
+org.eclipse.jdt.core.compiler.compliance=1.6\r
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error\r
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error\r
+org.eclipse.jdt.core.compiler.source=1.6\r
--- /dev/null
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Localization: plugin
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.tizen.dynamicanalyzer;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: %providerName
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.tizen.dynamicanalyzer.widgets;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-Activator: org.tizen.dynamicanalyzer.common.AnalyzerPlugin
+Bundle-ActivationPolicy: lazy
+Bundle-ClassPath: .,
+ lib/sqlitejdbc-v056.jar,
+ lib/org.eclipse.cdt.core_5.3.1.201109151620.jar,
+ lib/org.eclipse.cdt.debug.edc_2.0.0.201109151658.jar,
+ lib/org.eclipse.cdt.dsf_2.2.0.201109151620.jar,
+ lib/jcommon-1.0.17.jar,
+ lib/org.eclipse.nebula.widgets.grid_1.0.0.jar
+Export-Package: org.tizen.dynamicanalyzer.common,
+ org.tizen.dynamicanalyzer.communicator,
+ org.tizen.dynamicanalyzer.error,
+ org.tizen.dynamicanalyzer.handlers,
+ org.tizen.dynamicanalyzer.ui.toolbar,
+ org.tizen.dynamicanalyzer.ui.toolbar.configuration,
+ org.tizen.dynamicanalyzer.ui.widgets,
+ org.tizen.dynamicanalyzer.utils
+Import-Package: org.tizen.sdblib
--- /dev/null
+source.. = src/\r
+output.. = bin/\r
+bin.includes = .,\\r
+ bin/,\\r
+ plugin.xml,\\r
+ META-INF/,\\r
+ theme/,\\r
+ schema/,\\r
+ plugin.properties,\\r
+ lib/,\\r
+ build.properties,\\r
+ Link/,\\r
+ .settings/,\\r
+ .project,\\r
+ .classpath,\\r
+ lib/org.eclipse.nebula.widgets.grid_1.0.0.jar\r
+
--- /dev/null
+#Plugin name\r
+pluginName=Dynamic Analyzer Core Plug-in\r
+#Provider name\r
+providerName=Samsung Electronics\r
+\r
+#Command category, View category\r
+DynamicAnalyzer=Dynamic Analyzer\r
+\r
+#Command name\r
+StartStopTrace=Start Stop Trace\r
+Replay=Replay\r
+\r
+#Command name, Command label, Toolbar tooltip\r
+SaveTrace=Save Trace\r
+OpenTrace=Open Trace\r
+Realtime=Realtime\r
+Battery=Battery\r
+Exit=Exit\r
+OpenTraceComplete=Open Trace Complete\r
+Clear=Clear\r
+\r
+#Theme name\r
+DynamicAnalyzerTheme=Dynamic Analyzer Theme\r
+\r
+#View name\r
+Timeline=Timeline\r
+RealtimeAnalysis=Realtime analysis\r
+Snapshot=Snapshot\r
+Detail=Detail\r
+BatteryAnalysis=Battery analysis\r
+DeviceInfo=DeviceInfo\r
+NtimeAnalysis=N-time analysis\r
+BaseView=BaseView\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.commands">
+ <category
+ description="%DynamicAnalyzer"
+ id="org.tizen.dynamicanalyzer.commands"
+ name="%DynamicAnalyzer">
+ </category>
+ <command
+ categoryId="org.tizen.dynamicanalyzer.commands"
+ id="org.tizen.dynamicanalyzer.handlers.OpenTraceHandler"
+ name="%OpenTrace">
+ </command>
+ <command
+ categoryId="org.tizen.dynamicanalyzer.commands"
+ id="org.tizen.dynamicanalyzer.handlers.ReplayTraceHandler"
+ name="%Replay">
+ </command>
+ <command
+ categoryId="org.tizen.dynamicanalyzer.commands"
+ id="org.tizen.dynamicanalyzer.handlers.RealtimePerspectiveHandler"
+ name="%Realtime">
+ </command>
+ <command
+ categoryId="org.tizen.dynamicanalyzer.commands"
+ id="org.tizen.dynamicanalyzer.handlers.ExitHandler"
+ name="%Exit">
+ </command>
+ <command
+ categoryId="org.tizen.dynamicanalyzer.commands"
+ id="org.tizen.dynamicanalyzer.handlers.OpenTraceCompleteHandler"
+ name="%OpenTraceComplete">
+ </command>
+ <command
+ categoryId="org.tizen.dynamicanalyzer.commands"
+ id="org.tizen.dynamicanalyzer.handlers.ClearHandler"
+ name="%Clear">
+ </command>
+ <command
+ categoryId="org.tizen.dynamicanalyzer.commands"
+ id="org.tizen.dynamicanalyzer.handlers.StopHandler"
+ name="Stop">
+ </command>
+ <command
+ categoryId="org.tizen.dynamicanalyzer.commands"
+ id="org.tizen.dynamicanalyzer.handlers.StartHandler"
+ name="Start">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.tizen.dynamicanalyzer.handlers.OpenTraceHandler"
+ commandId="org.tizen.dynamicanalyzer.handlers.OpenTraceHandler">
+ </handler>
+ <handler
+ class="org.tizen.dynamicanalyzer.handlers.ReplayTraceHandler"
+ commandId="org.tizen.dynamicanalyzer.handlers.ReplayTraceHandler">
+ </handler>
+ <handler
+ class="org.tizen.dynamicanalyzer.handlers.RealtimePerspectiveHandler"
+ commandId="org.tizen.dynamicanalyzer.handlers.RealtimePerspectiveHandler">
+ </handler><handler
+ class="org.tizen.dynamicanalyzer.handlers.ExitHandler"
+ commandId="org.tizen.dynamicanalyzer.handlers.ExitHandler">
+ </handler>
+ <handler
+ class="org.tizen.dynamicanalyzer.handlers.OpenTraceCompleteHandler"
+ commandId="org.tizen.dynamicanalyzer.handlers.OpenTraceCompleteHandler">
+ </handler>
+ <handler
+ class="org.tizen.dynamicanalyzer.handlers.ClearHandler"
+ commandId="org.tizen.dynamicanalyzer.handlers.ClearHandler">
+ </handler>
+ <handler
+ class="org.tizen.dynamicanalyzer.handlers.StartHandler"
+ commandId="org.tizen.dynamicanalyzer.handlers.StartHandler">
+ </handler>
+ <handler
+ class="org.tizen.dynamicanalyzer.handlers.StopHandler"
+ commandId="org.tizen.dynamicanalyzer.handlers.StopHandler">
+ </handler>
+ </extension>
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID="org.tizen.dynamicanalyzer.workbench.perspective.DAMainPerspective">
+ <view
+ closeable="false"
+ id="org.tizen.dynamicanalyzer.ui.page.BaseView"
+ minimized="false"
+ moveable="false"
+ relationship="left"
+ relative="org.eclipse.ui.editorss"
+ showTitle="false"
+ standalone="true">
+ </view>
+ </perspectiveExtension>
+ </extension>
+ <extension
+ point="org.eclipse.ui.themes">
+ <theme
+ id="org.tizen.dynamicanalyzer.theme"
+ name="%DynamicAnalyzerTheme">
+ <colorOverride
+ id="org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_BG_END"
+ value="102,102,102">
+ </colorOverride>
+ <colorOverride
+ id="org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_BG_START"
+ value="153,153,153">
+ </colorOverride>
+ <colorOverride
+ id="org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_TEXT_COLOR"
+ value="255,255,255">
+ </colorOverride>
+ <colorOverride
+ id="org.eclipse.ui.workbench.ACTIVE_TAB_BG_END"
+ value="051,051,255">
+ </colorOverride>
+ <colorOverride
+ id="org.eclipse.ui.workbench.ACTIVE_TAB_BG_START"
+ value="153,153,255">
+ </colorOverride>
+ <colorOverride
+ id="org.eclipse.ui.workbench.ACTIVE_TAB_TEXT_COLOR"
+ value="255,255,255">
+ </colorOverride>
+ <colorOverride
+ id="org.eclipse.ui.workbench.INACTIVE_TAB_BG_END"
+ value="102,102,102">
+ </colorOverride>
+ <colorOverride
+ id="org.eclipse.ui.workbench.INACTIVE_TAB_BG_START"
+ value="153,153,153">
+ </colorOverride>
+ <colorOverride
+ id="org.eclipse.ui.workbench.INACTIVE_TAB_TEXT_COLOR"
+ value="255,255,255">
+ </colorOverride>
+ </theme>
+ </extension>
+ <extension
+ point="org.eclipse.ui.views">
+ <view
+ category="org.tizen.dynamicanalyzer.ui.page"
+ class="org.tizen.dynamicanalyzer.ui.page.BaseView"
+ id="org.tizen.dynamicanalyzer.ui.page.BaseView"
+ name="%BaseView"
+ restorable="true">
+ </view>
+ <category
+ id="org.tizen.dynamicanalyzer.ui.page"
+ name="views">
+ </category>
+ </extension>
+</plugin>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<xsd:schema targetNamespace="org.tizen.dynamicanalyzer"\r
+ xmlns="org.tizen.dynamicanalyzer" xmlns:sm="org.tizen.dynamicanalyzer"\r
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">\r
+\r
+ <xsd:complexType name="BaseLogCenter">\r
+ <xsd:sequence>\r
+ <xsd:element name="id" type="xsd:int" />\r
+ <xsd:element name="name" type="xsd:string" />\r
+ <xsd:element name="totalColumnCount" type="xsd:int" />\r
+ <xsd:element name="customColumn" type="xsd:boolean" />\r
+ <xsd:element name="ColumnName" type="xsd:string"\r
+ minOccurs="0" maxOccurs="unbounded" />\r
+ <xsd:element name="type" type="xsd:string" minOccurs="0"\r
+ maxOccurs="unbounded" />\r
+ <xsd:element name="ColumnSize" type="xsd:int" minOccurs="0"\r
+ maxOccurs="unbounded" />\r
+ <xsd:element name="ColumnOrder" type="xsd:int" minOccurs="0"\r
+ maxOccurs="unbounded" />\r
+ <xsd:element name="ColumnVisibility" type="xsd:boolean"\r
+ minOccurs="0" maxOccurs="unbounded" />\r
+ <xsd:element name="TableColumnName" type="xsd:string"\r
+ minOccurs="0" maxOccurs="unbounded" />\r
+ </xsd:sequence>\r
+ </xsd:complexType>\r
+\r
+ <xsd:complexType name="LeakCheckList">\r
+ <xsd:sequence>\r
+ <xsd:element name="checks" type="sm:Check" minOccurs="0"\r
+ maxOccurs="unbounded" />\r
+ </xsd:sequence>\r
+ </xsd:complexType>\r
+\r
+ <xsd:complexType name="Check">\r
+ <xsd:sequence>\r
+ <xsd:element name="name" type="xsd:string" />\r
+ <xsd:element name="type" type="xsd:int" />\r
+ <xsd:element name="category" type="xsd:int" />\r
+ <xsd:element name="keyIndex" type="xsd:int" />\r
+ <xsd:element name="freeIndex" type="xsd:int" />\r
+ <xsd:element name="checkUserCall" type="xsd:boolean" />\r
+ </xsd:sequence>\r
+ </xsd:complexType>\r
+</xsd:schema>
\ No newline at end of file
--- /dev/null
+/*\r
+ * Dynamic Analyzer\r
+ *\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact: \r
+ * Jooyoul Lee <jy.exe.lee@samsung.com>\r
+ * Juyoung Kim <j0.kim@samsung.com>\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ * \r
+ */\r
+\r
+package org.tizen.dynamicanalyzer.common;\r
+\r
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;\r
+\r
+public class AnalyzerConstants {\r
+ // if log change occurs then increase save data version!!\r
+ public static final String SAVE_DATA_VERSION = "0.84"; //$NON-NLS-1$\r
+ public static final boolean CHECK_INTERNAL = true;\r
+\r
+ /* folder names */\r
+ public static final String TOOLS_FOLDER_NAME = "tools"; //$NON-NLS-1$\r
+ public static final String TARGET_FOLDER_NAME = "target"; //$NON-NLS-1$\r
+ public static final String DYNAMIC_ANALYZER_FOLDER_NAME = "dynamic-analyzer"; //$NON-NLS-1$\r
+ public static final String SAVE_FOLDER_NAME = "save"; //$NON-NLS-1$\r
+ public static final String PLATFORM_FOLDER_NAME = "platforms"; //$NON-NLS-1$\r
+ public static final String LOGS_FOLDER_NAME = "logs"; //$NON-NLS-1$\r
+ public static final String TEMP_FOLDER_NAME = "temp"; //$NON-NLS-1$\r
+ public static final String TEMP_FOLDER_RUN_PREFIX = ".RUN"; //$NON-NLS-1$\r
+ public static final String IMAGE_FOLDER_NAME = "img"; //$NON-NLS-1$\r
+ public static final String SMALL_IMAGE_FOLDER_NAME = "small"; //$NON-NLS-1$\r
+ public static final String ICON_WORKBENCH_FOLDER_NAME = "icons"; //$NON-NLS-1$\r
+ public static final String XML_FOLDER_NAME = "xml"; //$NON-NLS-1$\r
+ public static final String CONFIG_FOLDER_NAME = "config"; //$NON-NLS-1$\r
+ public static final String CONFIG_FILE_NAME = "config"; //$NON-NLS-1$\r
+ public static final String TIZEN_SDK_DATA = "tizen-sdk-data";//$NON-NLS-1$\r
+ public static final String INSTALL = "tizensdkpath"; //$NON-NLS-1$\r
+ public static final String ABOUT_IDE_FOLDER_NAME = "ide"; //$NON-NLS-1$\r
+ public static final String ABOUT_PLUGINS_FOLDER_NAME = "plugins"; //$NON-NLS-1$\r
+ public static final String ABOUT_BASE_PLATFORM_FOLDER_NAME = "org.tizen.base.platform"; //$NON-NLS-1$\r
+ public static final String ABOUT_FILE_NAME = "about.mappings"; //$NON-NLS-1$\r
+ public static final String LICENSE_FILE_NAME = "license"; //$NON-NLS-1$\r
+ public static final String USER_INTERFACE_API_LIST_FILE_NAME = "user_interface_api_list"; //$NON-NLS-1$\r
+\r
+ public static final String DA_DAEMON_NAME = "da_manager"; //$NON-NLS-1$\r
+ public static final String TOOL_RECORDER_NAME = "da_event"; //$NON-NLS-1$\r
+ public static final String READELF_BIN = "readelf"; //$NON-NLS-1$\r
+\r
+ public static final String WIN_INSTALL_NODE = "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders";//$NON-NLS-1$\r
+ public static final String WIN_INSTALL_KEY = "Local AppData"; //$NON-NLS-1$\r
+ public static final String LINUX_INSTALL_ENV = "HOME";//$NON-NLS-1$\r
+\r
+ public static final String VERSION_NAME = "version"; //$NON-NLS-1$\r
+ public static final String DATABASE_NAME = "da.trace"; //$NON-NLS-1$\r
+ public static final String DEFAULT_IMAGE_NAME = "noImage.jpg"; //$NON-NLS-1$\r
+ public final static String PROBE_LIB_TIZEN = "da_probe_tizen.so"; //$NON-NLS-1$\r
+ public final static String PROBE_LIB_OSP = "da_probe_osp.so"; //$NON-NLS-1$\r
+\r
+ /* Save Data table */\r
+ public static final String LEAK_DATA_TABLE_NAME = "LeakData"; //$NON-NLS-1$\r
+ public static final String FAILED_DATA_TABLE_NAME = "FailedData"; //$NON-NLS-1$\r
+\r
+ /* thread names */\r
+ public static final String LOG_QUEUE_OBSERVING_THREAD = "Log Queue Observing thread"; //$NON-NLS-1$\r
+ public static final String COMMUNICATOR_RECEIVE_THREAD = "Communicator Receive Thread"; //$NON-NLS-1$\r
+ public static final String MESSAGE_INTERNAL_IMAGE_THREAD = "Internal Image Process Thread"; //$NON-NLS-1$\r
+ public static final String STOP_LOG_THREAD = "Stop Log Thread"; //$NON-NLS-1$\r
+ public static final String BATTERY_RECEIVE_THREAD = "Battery Receive Thread"; //$NON-NLS-1$\r
+ public static final String SLP_APP_RUN_THREAD = "SLP App Run Thread"; //$NON-NLS-1$\r
+ public static final String OPEN_TRACE_THREAD = "Open trace input thread"; //$NON-NLS-1$\r
+ public static final String INSERT_LOG_THREAD = "Insert log thread"; //$NON-NLS-1$\r
+ public static final String IDE_COMMUNICATOR_THREAD = "IDE Communicator thread"; //$NON-NLS-1$\r
+ public static final String SEND_MESSAGE_THREAD = "Send message thread"; //$NON-NLS-1$\r
+ public static final String START_STOP_THREAD = "Start stop thread"; //$NON-NLS-1$\r
+ public static final String FILE_CHART_MANAGER_THREAD = "File Chart Manager thread"; //$NON-NLS-1$\r
+ public static final String FUNCTION_USAGE_PROFILING_THREAD = "Function usage profiling thread"; //$NON-NLS-1$\r
+ public static final String USER_INTERFACE_PAGE_MANAGER_THREAD = "User Interface Page Managerthread"; //$NON-NLS-1$ \r
+\r
+ /* log parsing token and callstack parsing token, etc... */\r
+ public static final String CALLSTACK_START = "callstack_start"; //$NON-NLS-1$\r
+ public static final String CALLSTACK_END = "callstack_end"; //$NON-NLS-1$\r
+ public static final String CALLSTACK_CUT_MEMORY_TOKEN = "\\["; //$NON-NLS-1$\r
+ public static final String CALLSTACK_API_TOKEN = "\\("; //$NON-NLS-1$\r
+ public static final String CALLSTACK_API_TOKEN_STRING = "("; //$NON-NLS-1$\r
+ public static final String CALLSTACK_API_EMPTY_TOKEN = "\\)"; //$NON-NLS-1$\r
+ public static final String CALLSTACK_API_OFFSET_TOKEN = "\\+"; //$NON-NLS-1$\r
+ public static final String CLASS = "class"; //$NON-NLS-1$\r
+ public static final String DATA_PARSING_TOKEN = "`,"; //$NON-NLS-1$\r
+\r
+ /* timer intervals */\r
+ public static final int SOCKET_CHECK_INTERVAL = 10;\r
+ public static final int SOCKET_TIMEOUT = 10000;\r
+ public static final int SOCKET_FORWARD_INTERVAL = 1000;\r
+ public static final int LOG_CHECK_INTERVAL = 1000;\r
+ public static final int SAVE_PREPARE_TIME = 2000;\r
+ public static final long TIMER_START_TIME_DEFAULT = 1000;\r
+ public static final int TIMER_INTERVAL_DEFAULT = 1000;\r
+\r
+ /* project save index */\r
+ public static final int PROJECT_VERSION_INDEX = 0;\r
+ public static final int PROJECT_CREATE_TIME_INDEX = 1;\r
+ public static final int PROJECT_APPNAME_INDEX = 2;\r
+ public static final int PROJECT_DEVICE_INDEX = 3;\r
+ public static final int PROJECT_LAST_DATA_INDEX = 4;\r
+ public static final int PROJECT_LAST_TIME_INDEX = 5;\r
+ public static final int PROJECT_TOTAL_SAMPLE_COUNT = 6;\r
+ public static final int PROJECT_PKG_ID_INDEX = 7;\r
+ public static final int PROJECT_STOP_TIME_INDEX = 8;\r
+\r
+ /* save return values */\r
+ public static final int ERROR_EXTENSION_FAIL = -1;\r
+ public static final int SUCCESS = 1;\r
+ public static final int ERROR_SAVE_FAIL = 0;\r
+ public static final int FAIL = -2;\r
+\r
+ /* data size */\r
+ public static final int INSERT_DATA_PACKAGE_SIZE = 80;\r
+ public static final int MAX_REPEAT_COUNT = 5;\r
+\r
+ /* log parsing size */\r
+ public static final int DATABASE_READ_SIZE = 99;\r
+\r
+ /* Message Type */\r
+ public static final int MSG_APP_INFO = 1; //$NON-NLS-1$\r
+ public static final int MSG_USER_PROFILING_SAMPLE = 3; //$NON-NLS-1$\r
+ public static final int MSG_DEVICE_LOG = 4; //$NON-NLS-1$\r
+ public static final int MSG_LOG = 5; //$NON-NLS-1$\r
+ public static final int MSG_IMAGE = 6; //$NON-NLS-1$\r
+ public static final int MSG_TERMINATE = 7; //$NON-NLS-1$\r
+ public static final int MSG_DEBUG = 9; //$NON-NLS-1$\r
+\r
+ public static final String MSG_START = "100"; //$NON-NLS-1$\r
+ public static final String MSG_STOP = "101"; //$NON-NLS-1$\r
+ public static final String MSG_OPTION = "103"; //$NON-NLS-1$\r
+\r
+ public static final int OPT_OFF = 0x0000;\r
+ public static final int OPT_CPUMEM = 0x0001;\r
+ public static final int OPT_FUNC = 0x0002;\r
+ public static final int OPT_ALLOC = 0x0004;\r
+ public static final int OPT_FILE = 0x0008;\r
+ public static final int OPT_THREAD = 0x0010;\r
+ public static final int OPT_UI = 0x0020;\r
+ public static final int OPT_SNAPSHOT = 0x0040;\r
+ public static final int OPT_EVENT = 0x0080;\r
+ public static final int OPT_RECORD = 0x0100;\r
+\r
+ public static final int DAEMON_LISTEN_TRY = 50;\r
+\r
+ /* app info */\r
+ public static final int APP_INFO_SYSTEM_MEMORY_SIZE = 0;\r
+ public static final int APP_INFO_STORAGE_SIZE = 1;\r
+ public static final int APP_INFO_BLUETOOTH_SUPPORT = 2;\r
+ public static final int APP_INFO_GPS_SUPPORT = 3;\r
+ public static final int APP_INFO_WIFI_SUPPORT = 4;\r
+ public static final int APP_INFO_CAMERA_COUNT = 5;\r
+ public static final int APP_INFO_NETWORK_TYPE = 6;\r
+ public static final int APP_INFO_MAX_BRIGHTNESS = 7;\r
+ public static final int APP_INFO_WIDTH = 8;\r
+ public static final int APP_INFO_HEIGHT = 9;\r
+ public static final int APP_INFO_THEME = 10;\r
+ public static final int APP_INFO_VERSION = 11;\r
+ public static final int APP_INFO_SCALE = 12;\r
+ public static final int APP_INFO_REMOVABLE = 13;\r
+ public static final int APP_INFO_COMMENT = 14;\r
+ public static final int APP_INFO_PID = 15;\r
+ public static final int APP_INFO_START_TIME = 16;\r
+ public static final int APP_INFO_PIE_BUILD = 17;\r
+ public static final int APP_INFO_BASE_ADDRESS = 18;\r
+ public static final int APP_INFO_APP_TYPE = 19;\r
+ public static final int APP_INFO_BINARY_PATH = 20;\r
+ public static final int APP_INFO_SIZE = 21;\r
+\r
+ /* app type */\r
+ public static final int APP_TYPE_TIZEN = 0;\r
+ public static final int APP_TYPE_OSP = 1;\r
+\r
+ /* Source Line errors */\r
+ public static final int SOURCELINE_NOERROR = 0;\r
+ public static final int SOURCELINE_NULL_PATH = 1;\r
+ public static final int SOURCELINE_NULL_ADDRESS = 2;\r
+ public static final int SOURCELINE_FILE_NOT_FOUND = 3;\r
+ public static final int SOURCELINE_BAD_ADDRESS = 4;\r
+ public static final int SOURCELINE_NO_SYMBOL_INFORMATION = 5;\r
+ public static final int SOURCELINE_NO_MATCHING_LINE = 6;\r
+ public static final int SOURCELINE_UNKNOWN_ERROR = 7;\r
+ public static final int SOURCELINE_NO_SOURCELINE_DATA = 8;\r
+ public static final int SOURCELINE_PIE_BUILD = 9;\r
+ public static final int SOURCE_FILE_NOT_FOUND = 10;\r
+\r
+ public static final String[] sourcelineErrorMsg = {\r
+ AnalyzerLabels.EMPTY_STRING,\r
+ AnalyzerLabels.ANALYZER_CONSTANTS_SOURCELINE_NULL_PATH,\r
+ AnalyzerLabels.ANALYZER_CONSTANTS_SOURCELINE_NULL_ADDRESS,\r
+ AnalyzerLabels.ANALYZER_CONSTANTS_SOURCELINE_FILE_NOT_FOUND,\r
+ AnalyzerLabels.ANALYZER_CONSTANTS_SOURCELINE_BAD_ADDRESS,\r
+ AnalyzerLabels.ANALYZER_CONSTANTS_SOURCELINE_NO_SYMBOL_INFORMATION,\r
+ AnalyzerLabels.ANALYZER_CONSTANTS_SOURCELINE_NO_MATCHING_LINE,\r
+ AnalyzerLabels.ANALYZER_CONSTANTS_SOURCELINE_UNKNOWN_ERROR,\r
+ AnalyzerLabels.ANALYZER_CONSTANTS_SOURCELINE_NO_SOURCELINE_DATA,\r
+ AnalyzerLabels.ANALYZER_CONSTANTS_SOURCELINE_PIE_BUILD,\r
+ AnalyzerLabels.ANALYZER_CONSTANTS_SOURCELINE_NOT_FOUND };\r
+\r
+ // user call check\r
+ public final static String USER_BIN_POS = "/opt/apps/"; //$NON-NLS-1$\r
+ public final static int USER_CALL = 1;\r
+ public final static int INTERNAL_CALL = 2;\r
+ public final static int USER_CALL_CHECK_ERROR = -1;\r
+\r
+ // comparator type\r
+ public final static int SORT_TYPE_NONE = 0;\r
+ public final static int SORT_TYPE_NUM = 1;\r
+ public final static int SORT_TYPE_STRING = 2;\r
+ public final static int SORT_TYPE_GRID = 3;\r
+\r
+ // function usage profile data type\r
+ public final static int FUPD_APPLICATION = 1;\r
+ public final static int FUPD_DEPENDENT_LIB = 2;\r
+}\r
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.common;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.handlers.ClearHandler;
+import org.tizen.dynamicanalyzer.handlers.StartHandler;
+import org.tizen.dynamicanalyzer.model.BaseLogCenter;
+import org.tizen.dynamicanalyzer.model.ImageInfo;
+import org.tizen.dynamicanalyzer.model.LeakCheckList;
+import org.tizen.dynamicanalyzer.model.LogCenter;
+import org.tizen.dynamicanalyzer.project.Project;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
+import org.tizen.dynamicanalyzer.theme.DATheme;
+import org.tizen.dynamicanalyzer.theme.DAThemeWhite;
+import org.tizen.dynamicanalyzer.ui.page.BaseView;
+import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.summary.failed.FailedChecker;
+import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakDetector;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;
+import org.tizen.dynamicanalyzer.ui.summary.warning.WarningChecker;
+import org.tizen.dynamicanalyzer.ui.timeline.calltrace.UserFunctionManager;
+import org.tizen.dynamicanalyzer.ui.toolbar.StopProcessManager;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.utils.ExtensionFilter;
+import org.tizen.dynamicanalyzer.utils.ImageListSortComparator;
+import org.tizen.dynamicanalyzer.utils.XMLManager;
+
+public class AnalyzerManager {
+ private static DATheme theme = null;
+ private static Project project = null;
+
+ private static List<BaseLogCenter> baseLogCenters;
+ private static List<LogCenter> logCenters;
+ private static List<String> projectList = null;
+
+ private static HashMap<String, ImageInfo> imageSet = null;
+ private static List<ImageInfo> imageList = null;
+ private static int imageListSize = 0;
+
+ private static LeakDetector leakDetector = new LeakDetector();
+ private static FailedChecker failedChecker = new FailedChecker();
+ private static FailedChecker calledChecker = new FailedChecker();
+ private static WarningChecker warningChecker = new WarningChecker();
+
+ private static boolean appInfoArrived = false;
+ private static boolean isHaveSampleThread = false;
+ private static boolean exit = false;
+
+ private static String startBinaryAddr = null;
+ private static String endBinaryAddr = null;
+
+ public static boolean isExit() {
+ return exit;
+ }
+
+ public static void setExit(boolean e) {
+ exit = e;
+ }
+
+ public static List<String> getProjectList() {
+ if (null == projectList) {
+ projectList = new ArrayList<String>();
+ }
+ return projectList;
+ }
+
+ public static void removeFromProjectList(String path) {
+ int size = getProjectList().size();
+ for (int i = 0; i < size; i++) {
+ if (projectList.get(i).equals(path)) {
+ projectList.remove(i);
+ break;
+ }
+ }
+ }
+
+ public static DATheme getTheme() {
+ if (null == theme) {
+ // theme = DAThemeBlack.getInstance();
+ theme = DAThemeWhite.getInstance();
+ }
+ return theme;
+ }
+
+ public static void setTheme(DATheme t) {
+ theme = t;
+ ColorResources.initColors();
+
+ // TODO: redraw all widgets!
+ // AnalyzerUtil.getWorkbenchWindow().getWorkbench()
+ // .getActiveWorkbenchWindow();
+ }
+
+ public static boolean hasSampleThread() {
+ return isHaveSampleThread;
+ }
+
+ public static void setSampleThread(boolean b) {
+ isHaveSampleThread = b;
+ }
+
+ public static boolean isBinStartEndSet() {
+ if ((null != startBinaryAddr && !startBinaryAddr.isEmpty())
+ && (null != endBinaryAddr && !endBinaryAddr.isEmpty())) {
+ return true;
+ }
+ return false;
+ }
+
+ public static void setBinaryStartEndAddr(String start, String end) {
+ startBinaryAddr = start;
+ endBinaryAddr = end;
+ }
+
+ public static boolean isInBinaryRange(String addrStr) {
+ try {
+ long startAddr = Long.parseLong(startBinaryAddr);
+ long endAddr = Long.parseLong(endBinaryAddr);
+ long addr = Long.parseLong(addrStr);
+ if (addr > endAddr || addr < startAddr) {
+ return false;
+ }
+ return true;
+
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ return false;
+ }
+
+ }
+
+ public static void releaseConnection() {
+ if (null != project) {
+ project.closeConnection();
+ }
+ }
+
+ public static void clear() {
+ if (null != project) {
+ if (!project.isValid()) {
+ project.closeConnection();
+ String sourcePath = project.getSavePath();
+ if (null != sourcePath && !sourcePath.isEmpty()) {
+ boolean success = AnalyzerUtil.deleteFile(new File(
+ sourcePath));
+ AnalyzerManager.removeFromProjectList(sourcePath);
+ if (success) {
+ // logs for debug
+ System.out.println("invalid project deleted!"); //$NON-NLS-1$
+ } else {
+ System.out.println("invalid project delete fail..."); //$NON-NLS-1$
+ }
+ }
+ }
+ project = null;
+ }
+
+ imageSet = null;
+ imageList = null;
+ imageListSize = 0;
+
+ leakDetector.clear();
+ failedChecker.clear();
+ warningChecker.clear();
+ calledChecker.clear();
+ isHaveSampleThread = false;
+ StopProcessManager.clear();
+ UserFunctionManager.getInstance().clear();
+ FunctionUsageProfiler.clear();
+ FunctionUsageProfiler.stopProfiler();
+ RangeDataManager.getInstance().initRange();
+ startBinaryAddr = null;
+ endBinaryAddr = null;
+ appInfoArrived = false;
+ }
+
+ public static List<ImageInfo> getImageList() {
+ if (null == imageList) {
+ imageList = new ArrayList<ImageInfo>();
+ imageListSize = 0;
+ }
+ if (imageList.size() != getImageSet().size()) {
+ imageList.clear();
+ Collection<ImageInfo> imageCol = getImageSet().values();
+ imageList.addAll(imageCol);
+ Collections.sort(imageList, new ImageListSortComparator());
+ imageListSize = imageList.size();
+ }
+ return imageList;
+ }
+
+ public static HashMap<String, ImageInfo> getImageSet() {
+ if (null == imageSet) {
+ imageSet = new HashMap<String, ImageInfo>();
+ ImageInfo noImage = new ImageInfo();
+ noImage.setSeq("-1"); //$NON-NLS-1$
+ noImage.setTime("-1"); //$NON-NLS-1$
+ imageSet.put(noImage.getSeq(), noImage);
+ }
+ return imageSet;
+ }
+
+ public static String getImagePathByTime(String timeStr) {
+ imageList = getImageList();
+ String path = null;
+ for (int i = 0; i < imageListSize; i++) {
+ long imgTime = Long.parseLong(imageList.get(i).getTime());
+ long time = Long.parseLong(timeStr);
+ if (imgTime <= time) {
+ path = AnalyzerManager.getProject().getSavePath()
+ + File.separator + AnalyzerConstants.IMAGE_FOLDER_NAME
+ + File.separator + imageList.get(i).getSeq()
+ + CommonConstants.EXTENSION_PNG_IMAGE;
+ } else {
+ break;
+ }
+ }
+ if (null != path) {
+ return path;
+ } else {
+ return AnalyzerConstants.DEFAULT_IMAGE_NAME;
+ }
+ }
+
+ public static ImageInfo getImageInfoByTime(String timeStr) {
+ imageList = getImageList();
+ for (int i = imageListSize - 1; i >= 0; i--) {
+ long imgTime = Long.parseLong(imageList.get(i).getTime());
+ long time = Long.parseLong(timeStr);
+ if (imgTime <= time) {
+ return imageList.get(i);
+ }
+ }
+ return null;
+ }
+
+ public static int getImageIndexByTime(String timeStr) {
+ imageList = getImageList();
+ for (int i = imageListSize - 1; i >= 0; i--) {
+ long imgTime = Long.parseLong(imageList.get(i).getTime());
+ long time = Long.parseLong(timeStr);
+ if (imgTime <= time) {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ public static void setProject(Project p) {
+ project = p;
+ getProjectList().add(p.getSavePath());
+ }
+
+ public static void setProjectNoRegist(Project p) {
+ project = p;
+ }
+
+ public static Project getProject() {
+ return project;
+ }
+
+ public static List<BaseLogCenter> getBaseLogCenters() {
+ if (null == baseLogCenters) {
+ baseLogCenters = getAvailableLogCenters();
+ }
+ return baseLogCenters;
+ }
+
+ public static List<LogCenter> getInnerLogCenters() {
+ if (null == logCenters || logCenters.isEmpty()) {
+ if (null == logCenters) {
+ logCenters = new ArrayList<LogCenter>();
+ }
+ List<BaseLogCenter> baseLogcs = AnalyzerManager.getBaseLogCenters();
+ if (null == baseLogcs || baseLogcs.isEmpty()) {
+ System.out
+ .println("DynamicAnalyzer folder or logc file is missing! ");//$NON-NLS-1$
+ return null;
+ }
+ int size = baseLogcs.size();
+ for (int i = 0; i < size; i++) {
+ logCenters.add(copyLogCenter(baseLogcs.get(i)));
+ }
+ }
+ return logCenters;
+ }
+
+ public static LogCenter copyLogCenter(BaseLogCenter from) {
+ LogCenter to = new LogCenter();
+ to.setId(from.getId());
+ to.setName(from.getName());
+ to.setTotalColumnCount(from.getTotalColumnCount());
+ to.setCustomColumn(from.isCustomColumn());
+
+ to.getColumnName().addAll(from.getColumnName());
+ to.getType().addAll(from.getType());
+ to.getColumnSizes().addAll(from.getColumnSize());
+ to.getColumnOrder().addAll(from.getColumnOrder());
+ to.getColumnVisibility().addAll(from.getColumnVisibility());
+ to.getTableColumnName().addAll(from.getTableColumnName());
+ return to;
+ }
+
+ public static BaseLogCenter getBaseLogCenterById(int id) {
+ if (null != baseLogCenters) {
+ int size = baseLogCenters.size();
+ for (int i = 0; i < size; i++) {
+ if (id == baseLogCenters.get(i).getId()) {
+ return baseLogCenters.get(i);
+ }
+ }
+ }
+ return null;
+ }
+
+ public static List<BaseLogCenter> getAvailableLogCenters() {
+ String path = AnalyzerPaths.DYNAMIC_ANALYZER_INSTALL_PATH
+ + File.separator + AnalyzerConstants.XML_FOLDER_NAME;
+ File file = new File(path);
+ if (!file.exists()) {
+ return null;
+ }
+
+ File fileList[] = file.listFiles(new ExtensionFilter(
+ CommonConstants.EXTENSION_LOG_CENTER));
+ int fileListLength = fileList.length;
+ if (1 > fileListLength) {
+ return null;
+ }
+
+ List<BaseLogCenter> logcs = new ArrayList<BaseLogCenter>();
+ BaseLogCenter logc = new BaseLogCenter();
+ for (int i = 0; i < fileListLength; i++) {
+ logc = (BaseLogCenter) XMLManager.unmarshal(new File(path
+ + File.separator + fileList[i].getName()));
+ if (null != logc) {
+ logcs.add(logc);
+ }
+ }
+
+ return logcs;
+ }
+
+ public static LeakDetector getLeakDetector() {
+ return leakDetector;
+ }
+
+ public static FailedChecker getFailedChecker() {
+ return failedChecker;
+ }
+
+ public static WarningChecker getWarningChecker() {
+ return warningChecker;
+ }
+
+ public static FailedChecker getCalledFunctionChecker() {
+ return calledChecker;
+ }
+
+ public static void initRecordStart() {
+ AnalyzerUtil.executeCommand(ClearHandler.ID);
+ if (!AnalyzerManager.isExit()) {
+ Project project = new Project();
+ project.init();
+ }
+
+ if (!AnalyzerManager.isExit()) {
+ AnalyzerUtil.executeCommand(StartHandler.ID);
+ }
+ }
+
+ public static List<LogCenter> getLogCenters() {
+ if (null != project) {
+ return project.getLogCenters();
+ }
+ return getInnerLogCenters();
+ }
+
+ public void initLogCenters() {
+ if (null != logCenters) {
+ logCenters.clear();
+ } else {
+ logCenters = new ArrayList<LogCenter>();
+ }
+
+ logCenters.addAll(AnalyzerManager.getLogCenters());
+ }
+
+ public static LogCenter getLogCenterById(int id) {
+ List<LogCenter> logcs = getLogCenters();
+ if (null != logcs) {
+ int size = logcs.size();
+ for (int i = 0; i < size; i++) {
+ if (id == logcs.get(i).getId()) {
+ return logcs.get(i);
+ }
+ }
+ }
+ return null;
+ }
+
+ public static LeakCheckList getLeakCheckList() {
+ String path = AnalyzerPaths.DYNAMIC_ANALYZER_INSTALL_PATH
+ + File.separator + AnalyzerConstants.XML_FOLDER_NAME;
+
+ File file = new File(path);
+ if (!file.exists()) {
+ return null;
+ }
+
+ File fileList[] = file.listFiles(new ExtensionFilter(
+ CommonConstants.EXTENSION_LEAK_CHECK));
+ int fileListLength = fileList.length;
+ if (1 > fileListLength) {
+ return null;
+ }
+
+ LeakCheckList output = new LeakCheckList();
+ LeakCheckList leakCheckList = new LeakCheckList();
+ for (int i = 0; i < fileListLength; i++) {
+ leakCheckList = (LeakCheckList) XMLManager.unmarshal(new File(path
+ + File.separator + fileList[i].getName()));
+ output.getChecks().addAll(leakCheckList.getChecks());
+ }
+ leakCheckList = null;
+ return output;
+ }
+
+ public static boolean isOsp() {
+ int type = Integer.parseInt(getProject().getAppInfo().get(
+ AnalyzerConstants.APP_INFO_APP_TYPE));
+ if (type == AnalyzerConstants.APP_TYPE_OSP) {
+ return true;
+ }
+ return false;
+ }
+
+ public static void setAppInfoArrived(boolean arrived) {
+ appInfoArrived = arrived;
+ }
+
+ public static boolean isAppInfoArrived() {
+ return appInfoArrived;
+ }
+
+ public static DAPageComposite getCurrentPage() {
+ BaseView bv = (BaseView) AnalyzerUtil.getViewPart(BaseView.ID);
+ return bv.getTopComposite();
+ }
+
+ public static boolean isRunning() {
+ String state = AnalyzerUtil.getRecordState();
+ if (state.equals(RecordStateSourceProvider.RECORD_RECORDING)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.common;
+
+import java.io.File;
+
+public class AnalyzerPaths {
+ /* paths */
+ public static final String TIZEN_SDK_DATA_PATH = PathManager
+ .getTizenSdkDataPath();
+ public static final String TIZEN_ROOT_PATH = PathManager.getDefaultRoot();
+ public static final String DYNAMIC_ANALYZER_INSTALL_PATH = PathManager
+ .getInstallPath();
+ public static final String DYNAMIC_ANALYZER_SAVE_PATH = PathManager
+ .getSavePath();
+ public static final String TOOL_FOLDER_PATH = DYNAMIC_ANALYZER_INSTALL_PATH
+ + File.separator + AnalyzerConstants.TOOLS_FOLDER_NAME;
+ public static final String TEMP_FOLDER_PATH = DYNAMIC_ANALYZER_SAVE_PATH
+ + File.separator + AnalyzerConstants.TEMP_FOLDER_NAME;
+ public static final String CONFIG_FOLDER_PATH = PathManager
+ .getConfigFolderPath();
+ public static final String ABOUT_FILE_PATH = PathManager
+ .getAboutPath();
+ public static final String SDB_PATH = PathManager.getSdbPath();
+ public static final String READELF_PATH = DYNAMIC_ANALYZER_INSTALL_PATH
+ + File.separator + AnalyzerConstants.TARGET_FOLDER_NAME + File.separator;
+ public static final String TARGET_PATH = PathManager.getTargetPath();
+
+ public static final String DA_SINGLETON_FILE_PATH = PathManager
+ .getSavePath() + File.separator + "active_da"; //$NON-NLS-1$
+ public static final String IDE_ACTIVE_PORT_PATH = PathManager.getSavePath()
+ + File.separator + "active_da_plugin"; //$NON-NLS-1$
+ public static final String IDE_ACTIVE_SAVE_PORT_PATH = PathManager
+ .getSavePath() + File.separator + "current_active_ide_port"; //$NON-NLS-1$
+
+ public static final String WINDOW_ACTIVATOR_LINUX_PATH = TIZEN_ROOT_PATH
+ + "/tools/dynamic-analyzer/tool/windowactivator.sh";//$NON-NLS-1$
+ public static final String WINDOW_ACTIVATOR_WIDOWS_PATH = TIZEN_ROOT_PATH
+ + "/tools/dynamic-analyzer/tool/windowactivator.bat";//$NON-NLS-1$
+ public static final String WINDOW_ACTIVATOR_MACOS_PATH = TIZEN_ROOT_PATH
+ + "/tools/dynamic-analyzer/tool/macoswindowactivator.sh";//$NON-NLS-1$
+
+ public static final String DA_EMULATOR_SOUECE_PATH = TIZEN_ROOT_PATH
+ + "/platforms/tizen2.0/rootstraps/tizen-emulator-2.0.cpp/usr/include/osp"; //$NON-NLS-1$
+ public static final String DA_DEVICE_SOUECE_PATH = TIZEN_ROOT_PATH
+ + "/platforms/tizen2.0/rootstraps/tizen-device-2.0.cpp/usr/include/osp"; //$NON-NLS-1$
+
+ /* Name & Path */
+ public static final String DA_REMOTE_PROBE_PATH = "/home/developer/sdk_tools/da/"; //$NON-NLS-1$
+ public static final String DA_REMOTE_PATH = "/home/developer/sdk_tools/da/"; //$NON-NLS-1$
+ public static final String DA_REMOTE_DAEMON_BINARY_PATH = DA_REMOTE_PATH
+ + AnalyzerConstants.DA_DAEMON_NAME;
+ public static final String TOOL_REMOTE_RECORDER_BINARY_PATH = DA_REMOTE_PATH
+ + AnalyzerConstants.TOOL_RECORDER_NAME;
+ public static final String APPLICATION_LIST_PATH = "/opt/share/applications/"; //$NON-NLS-1$
+
+ public static final String DA_DAEMON_LOG_PATH = "/tmp/da_daemon.log"; //$NON-NLS-1$
+}
--- /dev/null
+/*\r
+ * Dynamic Analyzer\r
+ *\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact: \r
+ * Jooyoul Lee <jy.exe.lee@samsung.com>\r
+ * Juyoung Kim <j0.kim@samsung.com>\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ * \r
+ */\r
+\r
+package org.tizen.dynamicanalyzer.common;\r
+\r
+import java.io.File;\r
+import java.util.List;\r
+\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.widgets.Shell;\r
+import org.eclipse.ui.IPartService;\r
+import org.eclipse.ui.IWorkbench;\r
+import org.eclipse.ui.IWorkbenchListener;\r
+import org.eclipse.ui.IWorkbenchWindow;\r
+import org.eclipse.ui.PlatformUI;\r
+import org.eclipse.ui.plugin.AbstractUIPlugin;\r
+import org.osgi.framework.BundleContext;\r
+import org.tizen.dynamicanalyzer.listeners.AnalyzerPartListener;\r
+import org.tizen.dynamicanalyzer.listeners.AnalyzerPerspectiveListener;\r
+import org.tizen.dynamicanalyzer.resources.ColorResources;\r
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;\r
+\r
+public class AnalyzerPlugin extends AbstractUIPlugin {\r
+\r
+ private static final String THEME_ID = "org.tizen.dynamicanalyzer.theme"; //$NON-NLS-1$\r
+ private static AnalyzerPlugin plugin;\r
+\r
+ public static AnalyzerPlugin getDefault() {\r
+ return plugin;\r
+ }\r
+\r
+ @Override\r
+ public void start(BundleContext context) throws Exception {\r
+ super.start(context);\r
+ plugin = this;\r
+\r
+ // Adds workbench listener.\r
+ IWorkbench workbench = PlatformUI.getWorkbench();\r
+ workbench.getActiveWorkbenchWindow().getPages();\r
+ workbench.addWorkbenchListener(new IWorkbenchListener() {\r
+ @Override\r
+ public void postShutdown(IWorkbench workbench) {\r
+ List<String> tempProjects = AnalyzerManager.getProjectList();\r
+ int size = tempProjects.size();\r
+ for (int i = 0; i < size; i++) {\r
+ File tempFile = new File(tempProjects.get(i));\r
+ if (tempFile.isFile() && tempFile.exists()) {\r
+ AnalyzerUtil.deleteFile(tempFile);\r
+ }\r
+ }\r
+ boolean delete = true;\r
+ /** do not delete : for multi da running **/\r
+ /**\r
+ * boolean delete = false; if (tempFolder.exists() &&\r
+ * tempFolder.isDirectory()) { String[] list =\r
+ * tempFolder.list(); if (0 == list.length) { delete = true; }\r
+ * else { int count = list.length; for (int i = 0; i < count;\r
+ * i++) { String fileName = list[i]; if (fileName\r
+ * .contains(AnalyzerConstants.TEMP_FOLDER_RUN_PREFIX)) { delete\r
+ * = false; break; } if (i + 1 == count) { delete = true; } } }\r
+ **/\r
+ if (delete) {\r
+ AnalyzerManager.releaseConnection();\r
+ File tempDir = new File(AnalyzerPaths.TEMP_FOLDER_PATH);\r
+ if (tempDir.isDirectory() && tempDir.exists()) {\r
+ if (AnalyzerUtil.deleteFile(tempDir)) {\r
+ System.out.println("Delete temp folder!"); //$NON-NLS-1$\r
+ } else {\r
+ System.out.println("Delete temp folder fail..."); //$NON-NLS-1$\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ @Override\r
+ public boolean preShutdown(IWorkbench workbench, boolean forced) {\r
+ return true;\r
+ }\r
+ });\r
+\r
+ // Adds perspective listener.\r
+ IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();\r
+ window.addPerspectiveListener(new AnalyzerPerspectiveListener());\r
+\r
+ // Sets theme and color.\r
+ workbench.getThemeManager().setCurrentTheme(THEME_ID);\r
+ Shell shell = window.getShell();\r
+ shell.setBackgroundMode(SWT.INHERIT_FORCE);\r
+ shell.setBackground(ColorResources.WINDOW_BG_COLOR);\r
+\r
+ File saveFolder = new File(AnalyzerPaths.TEMP_FOLDER_PATH);\r
+ if (saveFolder.exists()) {\r
+ if (AnalyzerUtil.deleteFile(saveFolder)) {\r
+ System.out.println("delete temp folder");\r
+ } else {\r
+ System.out\r
+ .println("BUG: temp folder is already exists but failed to delete");\r
+ }\r
+ }\r
+ if (!saveFolder.isDirectory()) {\r
+ saveFolder.mkdirs();\r
+ }\r
+\r
+ IPartService partService = PlatformUI.getWorkbench()\r
+ .getActiveWorkbenchWindow().getPartService();\r
+\r
+ AnalyzerPartListener partListener = new AnalyzerPartListener();\r
+ partService.addPartListener(partListener);\r
+\r
+ }\r
+\r
+ @Override\r
+ public void stop(BundleContext context) throws Exception {\r
+ plugin = null;\r
+\r
+ super.stop(context);\r
+ }\r
+\r
+}\r
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.common;
+
+public class AnalyzerShellCommands {
+
+ /* Commands */
+ public static final String CMD_GET_LIST = "ls -1 "; //$NON-NLS-1$
+ public static final String CMD_NO_LIST = "ls:"; //$NON-NLS-1$
+ public static final String CMD_CAT_PRINT = "cat "; //$NON-NLS-1$
+ public static final String CMD_NO_CAT_PRINT = "cat:"; //$NON-NLS-1$
+ public static final String CMD_REMOVE = "rm -rf"; //$NON-NLS-1$
+ public static final String CMD_EXE_PERMISSION = "chmod +x "; //$NON-NLS-1$
+
+ public static final String CMD_APPLICATION_LIST = "ls -t " + //$NON-NLS-1$
+ AnalyzerPaths.APPLICATION_LIST_PATH
+ + "*.desktop | xargs egrep -Li \"Removable=False|Multiple=true|packagetype=wgt\" | xargs egrep -Hi \"pkgid|exec|name=\"";//$NON-NLS-1$
+
+ public static final String CMD_UPLOAD_FILE_LIST = "du -b " + //$NON-NLS-1$
+ AnalyzerPaths.DA_REMOTE_PATH + AnalyzerConstants.READELF_BIN
+ + CommonConstants.SPACE + AnalyzerPaths.DA_REMOTE_PATH
+ + AnalyzerConstants.VERSION_NAME + CommonConstants.SPACE
+ + AnalyzerPaths.DA_REMOTE_DAEMON_BINARY_PATH
+ + CommonConstants.SPACE + AnalyzerPaths.DA_REMOTE_PROBE_PATH
+ + AnalyzerConstants.PROBE_LIB_TIZEN + CommonConstants.SPACE
+ + AnalyzerPaths.DA_REMOTE_PROBE_PATH
+ + AnalyzerConstants.PROBE_LIB_OSP + CommonConstants.SPACE
+ + AnalyzerPaths.TOOL_REMOTE_RECORDER_BINARY_PATH;
+
+ public static final String CMD_DAEMON_EXE_PERMISSION = CMD_EXE_PERMISSION
+ + AnalyzerPaths.DA_REMOTE_DAEMON_BINARY_PATH;
+
+ public static final String CMD_READELF_PERMISSION = CMD_EXE_PERMISSION
+ + AnalyzerPaths.DA_REMOTE_PATH + AnalyzerConstants.READELF_BIN;
+
+ public static final String CMD_IS_DAEMON_EXIST = CMD_GET_LIST
+ + AnalyzerPaths.DA_REMOTE_DAEMON_BINARY_PATH;
+
+ public static final String CMD_IS_DAEMON_LISTEN = "ps ax | grep " //$NON-NLS-1$
+ + AnalyzerConstants.DA_DAEMON_NAME + " | grep -v grep"; //$NON-NLS-1$
+
+ public static final String CMD_LS_VERSION = CMD_GET_LIST
+ + AnalyzerPaths.DA_REMOTE_PATH + AnalyzerConstants.VERSION_NAME;
+
+ public static final String CMD_CAT_VERSION = CMD_CAT_PRINT
+ + AnalyzerPaths.DA_REMOTE_PATH + AnalyzerConstants.VERSION_NAME;
+
+ public static final String CMD_PIDOF_DAEMON = "pidof " //$NON-NLS-1$
+ + AnalyzerConstants.DA_DAEMON_NAME;
+
+ public static final String CMD_KILL_DAEMON = "kill -9 "; //$NON-NLS-1$
+ public static final String CMD_IS_ARM_ARCH = "uname -m"; //$NON-NLS-1$
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.common;
+
+public class CommonConstants {
+
+ /* special character */
+ public static final String EMPTY = ""; //$NON-NLS-1$
+ public static final String SPACE = " "; //$NON-NLS-1$
+ public static final String TAB = " "; //$NON-NLS-1$
+ public static final String SLASH = "/"; //$NON-NLS-1$
+ public static final String BSLASH = "\\"; //$NON-NLS-1$
+ public static final String CMD_SPLIT = "|"; //$NON-NLS-1$
+ public static final String CMD_SPLIT_READ = "\\|"; //$NON-NLS-1$
+ public static final String CMD_SPLIT_DOT = "\\."; //$NON-NLS-1$
+ public static final String NEW_LINE_CHAR = "\\n"; //$NON-NLS-1$
+ public static final String NEW_LINE = "\n"; //$NON-NLS-1$
+ public static final String DOT = "."; //$NON-NLS-1$
+ public static final String COMMA = ","; //$NON-NLS-1$
+ public static final String COLON = ":"; //$NON-NLS-1$
+ public static final String DOUBLE_COLON = "::"; //$NON-NLS-1$
+ public static final String SEMICOLON = ";"; //$NON-NLS-1$
+ public static final String DASH = "-"; //$NON-NLS-1$
+ public static final String UNDERBAR = "_"; //$NON-NLS-1$
+ public static final String OPEN_BRACKET = "("; //$NON-NLS-1$
+ public static final String CLOSE_BRACKET = ")"; //$NON-NLS-1$
+ public static final String OPEN_SQUARE_BRACKET = "["; //$NON-NLS-1$
+ public static final String CLOSE_SQUARE_BRACKET = "]"; //$NON-NLS-1$
+ public static final String TILDE = "~"; //$NON-NLS-1$
+ public static final String ELLIPSIS = "..."; //$NON-NLS-1$
+ public static final String ZERO = "0"; //$NON-NLS-1$
+ public static final String EQUAL = "="; //$NON-NLS-1$
+ public static final String ASTERISK = "*"; //$NON-NLS-1$
+ public static final String GRAVE_ACCENT = "`"; //$NON-NLS-1$
+ public static final String PERCENT = "%"; //$NON-NLS-1$
+ public static final String EMULATOR = "emulator"; //$NON-NLS-1$
+ public static final String ON = "on"; //$NON-NLS-1$
+ public static final String OFF = "off"; //$NON-NLS-1$
+ public static final String PLUS = "+"; //$NON-NLS-1$
+
+ public static final String LOCAL_HOST = "127.0.0.1"; //$NON-NLS-1$
+
+ /* extensions */
+ public static final String EXTENSION_LOG_CENTER = ".logc"; //$NON-NLS-1$
+ public static final String EXTENSION_LEAK_CHECK = ".leak"; //$NON-NLS-1$
+ public static final String EXTENSION_JPG_IMAGE = ".jpg"; //$NON-NLS-1$
+ public static final String EXTENSION_PNG_IMAGE = ".png"; //$NON-NLS-1$
+ public static final String EXTENSION_GIF_IMAGE = ".gif"; //$NON-NLS-1$
+
+ /* Arch */
+ public static final String ARM_ARCH = "arm"; //$NON-NLS-1$
+ public static final String X86_ARCH = "x86"; //$NON-NLS-1$
+
+ /* OS */
+ public static final String OS_KEY = "os.name"; //$NON-NLS-1$
+ public static final String LINUX = "linux"; //$NON-NLS-1$
+ public static final String MAC = "mac"; //$NON-NLS-1$
+ public static final String WIN = "win"; //$NON-NLS-1$
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.common;
+
+import org.eclipse.swt.widgets.Control;
+
+public class DASelectionData {
+ private String viewId;
+ private long startTime;
+ private long endTime;
+ private Object data;
+ private Control control;
+
+ public DASelectionData() {
+ // TODO Auto-generated constructor stub
+ }
+
+ public DASelectionData(String id, long start, long end, Object data,
+ Control ctrl) {
+ viewId = id;
+ startTime = start;
+ endTime = end;
+ this.data = data;
+ control = ctrl;
+ }
+
+ public Control getControl() {
+ return control;
+ }
+
+ public void setControl(Control control) {
+ this.control = control;
+ }
+
+ public String getViewId() {
+ return viewId;
+ }
+
+ public void setViewId(String viewId) {
+ this.viewId = viewId;
+ }
+
+ public long getStartTime() {
+ return startTime;
+ }
+
+ public void setStartTime(long startTime) {
+ this.startTime = startTime;
+ }
+
+ public long getEndTime() {
+ return endTime;
+ }
+
+ public void setEndTime(long endTime) {
+ this.endTime = endTime;
+ }
+
+ public Object getData() {
+ return data;
+ }
+
+ public void setData(Object data) {
+ this.data = data;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.common;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+import java.lang.management.ManagementFactory;
+import java.lang.management.RuntimeMXBean;
+import java.nio.channels.FileChannel;
+import java.nio.channels.FileLock;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.toolbar.ConfigureManager;
+import org.tizen.dynamicanalyzer.ui.widgets.DADialog;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+
+public class DASingletonFocusManager {
+ private static String pid = null;
+ private static String Processid = null;
+ private static int selfPid = 0;
+ private static Runtime runtime;
+ private static Process process;
+
+ private DASingletonFocusManager() {
+ selfPid = -1;
+ }
+
+ private DASingletonFocusManager(int iPid) {
+ selfPid = iPid;
+ }
+
+ private static void getPid() {
+
+ if (selfPid > 0) {
+ pid = String.valueOf(selfPid);
+ } else {
+ ManagementFactory.getRuntimeMXBean();
+ RuntimeMXBean rt = ManagementFactory.getRuntimeMXBean();
+ Processid = rt.getName();
+ pid = Processid.substring(0, Processid.indexOf("@"));//$NON-NLS-1$
+ }
+ }
+
+ private static String[] getSaveFocusPath() {
+
+ String[] returnStr = null;
+ String strPid = ConfigureManager.getInstance().getValue(
+ ConfigureLabels.SINGLETON_FOCUS_DA_PID);
+
+ if (AnalyzerUtil.isWin()) {
+ returnStr = new String[] {
+ AnalyzerPaths.WINDOW_ACTIVATOR_WIDOWS_PATH, strPid };
+ } else if (AnalyzerUtil.isMac()) {
+ returnStr = new String[] {
+ AnalyzerPaths.WINDOW_ACTIVATOR_MACOS_PATH, strPid };
+ } else if (AnalyzerUtil.isLinux()) {
+ returnStr = new String[] {
+ AnalyzerPaths.WINDOW_ACTIVATOR_LINUX_PATH, strPid };
+ } else {
+ Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
+ DADialog warning = new DADialog(shell, SWT.NONE);
+ warning.setMessage(AnalyzerLabels.OS_WARNING);
+ warning.setIcon(ImageResources.DIALOG_WARNING_ICON);
+ warning.open();
+ }
+
+ return returnStr;
+ }
+
+ private static int executeCommand(String[] cmds) {
+ int retValue = 0;
+ try {
+ if (cmds.length == 0) {
+ retValue = -1;
+ } else {
+ runtime = Runtime.getRuntime();
+ process = runtime.exec(cmds);
+
+ if (process != null) {
+ process.waitFor();
+ retValue = process.exitValue();
+ }
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } finally {
+ if (process != null) {
+ process.destroy();
+ }
+ }
+ return retValue;
+ }
+
+ public static void setFocusDA() {
+ executeCommand(getSaveFocusPath());
+ }
+
+ public static void setSaveFocusDAPid() {
+ getPid();
+ ConfigureManager.getInstance().setValue(
+ ConfigureLabels.SINGLETON_FOCUS_DA_PID, pid);
+ }
+
+ public static boolean checkDASingleton() {
+
+ File file = null;
+ FileLock fileLock = null;
+ FileChannel fchannel = null;
+
+ file = new File(AnalyzerPaths.DA_SINGLETON_FILE_PATH);
+ try {
+ fchannel = new RandomAccessFile(file, "rw").getChannel();//$NON-NLS-1$
+ } catch (FileNotFoundException e1) {
+ e1.printStackTrace();
+ }
+ try {
+ fileLock = fchannel.tryLock();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ if (fileLock == null) {
+ return true;
+ }
+
+ return false;
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.common;
+
+public class DesignConstants {
+ public static final int VIEW_TITLEBAR_HEIGHT = 22;
+
+ public static final int COMBO_DEVICE_TOP = 7;
+ public static final int COMBO_DEVICE_LEFT = 6;
+ public static final int COMBO_DEVICE_HEIGHT = 24;
+ public static final int COMBO_DEVICE_WIDTH = 145;
+
+ public static final int COMBO_APP_TOP = 7;
+ public static final int COMBO_APP_LEFT = 6;
+ public static final int COMBO_APP_HEIGHT = 24;
+ public static final int COMBO_APP_WIDTH = 145;
+
+ public static final int SNAPSHOT_VIEW_WIDTH = 220;
+ public static final int SNAPSHOT_VIEW_HEIGHT = 315 ;
+
+ public static final int DA_BUTTON_HEIGHT = 28;
+ public static final int DA_BUTTON_WIDTH = 100;
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.common;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.toolbar.ConfigureManager;
+import org.tizen.dynamicanalyzer.ui.widgets.DADialog;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+
+public class PathManager {
+ private static String logPostFix = null;
+
+ public static void setLogPostFix(String postFix) {
+ logPostFix = postFix;
+ }
+
+ public static String getLogPostFix() {
+ return logPostFix;
+ }
+
+ public static String getRegistryValue(String node, String key) {
+ BufferedReader br = null;
+ String value = CommonConstants.EMPTY;
+
+ String query = "reg query " + "\"" + node + "\" /v " + "\"" + key + "\""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ try {
+ Process process = Runtime.getRuntime().exec(query);
+ String encoding = System.getProperty("sun.jnu.encoding"); //$NON-NLS-1$
+
+ br = new BufferedReader(new InputStreamReader(
+ process.getInputStream(), encoding));
+
+ String line = null;
+ while ((line = br.readLine()) != null) {
+ int index = line.indexOf("REG_SZ"); //$NON-NLS-1$
+ if (index >= 0) {
+ value = line.substring(index + "REG_SZ".length()).trim(); //$NON-NLS-1$
+ }
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ } finally {
+ AnalyzerUtil.tryClose(br);
+ }
+ return value;
+ }
+
+ public static String getTizenSdkDataPath() {
+ String defaultPath = null;
+ if (AnalyzerUtil.isLinux()) {
+ defaultPath = System.getenv(AnalyzerConstants.LINUX_INSTALL_ENV)
+ + File.separator + AnalyzerConstants.TIZEN_SDK_DATA;
+ } else if (AnalyzerUtil.isWin()) {
+ defaultPath = getRegistryValue(AnalyzerConstants.WIN_INSTALL_NODE,
+ AnalyzerConstants.WIN_INSTALL_KEY)
+ + File.separator
+ + AnalyzerConstants.TIZEN_SDK_DATA;
+ } else if (AnalyzerUtil.isMac()) {
+ defaultPath = System.getenv(AnalyzerConstants.LINUX_INSTALL_ENV)
+ + File.separator + AnalyzerConstants.TIZEN_SDK_DATA;
+ } else {
+ final Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
+ DADialog dialog = new DADialog(shell, SWT.NONE); // FIXME
+ dialog.setIcon(ImageResources.DIALOG_WARNING_ICON);
+ dialog.setMessage(AnalyzerLabels.OS_WARNING);
+ if (dialog.open() == true) {
+ System.exit(-1);
+ }
+ }
+
+ return defaultPath;
+ }
+
+ public static String getDefaultRoot() {
+ String rootPath = null;
+ BufferedReader br = null;
+ String line = null;
+ try {
+ rootPath = AnalyzerPaths.TIZEN_SDK_DATA_PATH + File.separator
+ + AnalyzerConstants.INSTALL;
+ File file = new File(rootPath);
+ if (!file.isFile()) {
+ return null;
+ }
+ br = new BufferedReader(new InputStreamReader(new FileInputStream(
+ file)));
+ line = br.readLine();
+ return line.substring(line.indexOf(CommonConstants.EQUAL) + 1);
+ } catch (IOException e) {
+ e.printStackTrace();
+ } finally {
+ if (null != br) {
+ try {
+ br.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ return rootPath;
+ }
+
+ public static String getInstallPath() {
+ String installPath = AnalyzerPaths.TIZEN_ROOT_PATH;
+ if (null != installPath) {
+ installPath += File.separator + AnalyzerConstants.TOOLS_FOLDER_NAME
+ + File.separator
+ + AnalyzerConstants.DYNAMIC_ANALYZER_FOLDER_NAME;
+ }
+ return installPath;
+ }
+
+ public static String getSavePath() {
+ String savePath = AnalyzerPaths.TIZEN_SDK_DATA_PATH;
+ if (null != savePath) {
+ savePath += File.separator
+ + AnalyzerConstants.DYNAMIC_ANALYZER_FOLDER_NAME
+ + File.separator + AnalyzerConstants.SAVE_FOLDER_NAME;
+ }
+ return savePath;
+ }
+
+ public static String getLogPath() {
+ String logPath = AnalyzerPaths.TIZEN_SDK_DATA_PATH;
+ if (null != logPath) {
+ logPath += File.separator
+ + AnalyzerConstants.DYNAMIC_ANALYZER_FOLDER_NAME
+ + File.separator + AnalyzerConstants.LOGS_FOLDER_NAME;
+ }
+ return logPath;
+ }
+
+ public static String getSdbPath() {
+ String path = AnalyzerPaths.TIZEN_ROOT_PATH;
+ if (null != path) {
+ path += File.separator + AnalyzerConstants.TOOLS_FOLDER_NAME
+ + File.separator + "sdb"; //$NON-NLS-1$
+ }
+ return path;
+ }
+
+ public static String getTargetPath() {
+ String platform = getPlatform();
+ if (null != platform && !platform.isEmpty()) {
+ return AnalyzerPaths.TIZEN_ROOT_PATH + File.separator
+ + AnalyzerConstants.PLATFORM_FOLDER_NAME + File.separator
+ + platform + File.separator
+ + AnalyzerConstants.DYNAMIC_ANALYZER_FOLDER_NAME
+ + File.separator;
+ } else {
+ return AnalyzerPaths.DYNAMIC_ANALYZER_INSTALL_PATH + File.separator
+ + AnalyzerConstants.TARGET_FOLDER_NAME + File.separator;
+ }
+
+ }
+
+ public static String getPlatform() {
+ String platform = ConfigureManager.getInstance().getValue(
+ ConfigureLabels.PLATFORM);
+ if (null == platform || platform.isEmpty()
+ || platform.equals(ConfigureLabels.PLATFORM_ETC)) {
+ return null;
+ } else {
+ return platform;
+ }
+ }
+
+ public static String getConfigFolderPath() {
+ String configFolderPath = AnalyzerPaths.DYNAMIC_ANALYZER_INSTALL_PATH;
+ if (null != configFolderPath) {
+ configFolderPath += File.separator
+ + AnalyzerConstants.CONFIG_FOLDER_NAME;
+ }
+ return configFolderPath;
+ }
+
+ public static String getConfigFilePath() {
+ String configFilePath = AnalyzerPaths.CONFIG_FOLDER_PATH;
+
+ if (null != configFilePath) {
+ configFilePath += File.separator
+ + AnalyzerConstants.CONFIG_FILE_NAME;
+ }
+ return configFilePath;
+ }
+
+ public static String getAboutPath() {
+ String aboutFolderPath = AnalyzerPaths.TIZEN_ROOT_PATH;
+ if (null == aboutFolderPath) {
+ return null;
+ }
+ aboutFolderPath += (File.separator
+ + AnalyzerConstants.ABOUT_IDE_FOLDER_NAME + File.separator + AnalyzerConstants.ABOUT_PLUGINS_FOLDER_NAME);
+
+ File dir = new File(aboutFolderPath);
+ String[] files;
+ if (dir.exists()) {
+ files = dir.list(new FilenameFilter() {
+
+ @Override
+ public boolean accept(File dir, String name) {
+ // TODO Auto-generated method stub
+ return name
+ .contains(AnalyzerConstants.ABOUT_BASE_PLATFORM_FOLDER_NAME);
+ }
+ });
+ } else {
+ return null;
+ }
+
+ if (files.length != 1) {
+ return null;
+ }
+ String aboutFilePath = aboutFolderPath + File.separator + files[0]
+ + File.separator + AnalyzerConstants.ABOUT_FILE_NAME;
+
+ return aboutFilePath;
+ }
+
+ public static void pathCheck() {
+ if (null == AnalyzerPaths.TIZEN_ROOT_PATH) {
+ final Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
+ DADialog dialog = new DADialog(shell, SWT.NONE); // FIXME
+ dialog.setIcon(ImageResources.DIALOG_WARNING_ICON);
+ dialog.setMessage(AnalyzerLabels.PATH_WARNING);
+ if (dialog.open() == true) {
+ System.exit(-1);
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.common;
+
+public class SnapshotConstants {
+ public static final int DEFAULT_IMAGE_WIDTH = 270;
+ public static final int DEFAULT_IMAGE_HEIGHT = 450;
+ public static final int DEFAULT_IMAGE_MARGIN_X = 5;
+ public static final int DEFAULT_IMAGE_MARGIN_Y = 5;
+ public static final int MAX_IMAGE_WIDTH = 480;
+ public static final int MAX_IMAGE_HEIGHT = 800;
+// public static final int MIN_IMAGE_WIDTH = 90;
+// public static final int MIN_IMAGE_HEIGHT = 150;
+ public static final int MIN_IMAGE_WIDTH = 130;
+ public static final int MIN_IMAGE_HEIGHT = 216;
+ public static final double IMAGE_WIDTH_RATE = 130.0;
+ public static final double IMAGE_HEIGHT_RATE = 216.0;
+
+ public static final int DEFAULT_W_IMAGE_WIDTH = 450;
+ public static final int DEFAULT_W_IMAGE_HEIGHT = 270;
+ public static final int MAX_W_IMAGE_WIDTH = 800;
+ public static final int MAX_W_IMAGE_HEIGHT = 480;
+ public static final int MIN_W_IMAGE_WIDTH = 150;
+ public static final int MIN_W_IMAGE_HEIGHT = 90;
+ public static final double W_IMAGE_WIDTH_RATE = 216.0;
+ public static final double W_IMAGE_HEIGHT_RATE = 130.0;
+
+ public static final int IMAGE_TYPE_NORMAL = 0;
+ public static final int IMAGE_TYPE_WIDE = 1;
+
+ /* chart */
+ public static final int GRAPH_COMP_MARGIN_W = 0;
+ public static final int GRAPH_COMP_MARGIN_H = 0;
+
+ public static final int IMAGE_MARGIN_TOP = 5;
+ public static final int IMAGE_MARGIN_BOTTOM = 10;
+
+ public static final int SNAPSHOT_IMAGE_WIDTH = 50;
+ public static final int SNAPSHOT_IMAGE_HEIGHT = 70;
+
+ public static final int CANVAS_MARGIN_TOP = 10;
+ public static final int CANVAS_MARGIN_BOTTOM = 10;
+ public static final int CANVAS_MARGIN_LEFT = 0;
+ public static final int CANVAS_MARGIN_RIGHT = 0;
+
+ public static final int DEFAULT_FONT_WIDTH = 5;
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * WooJin Jung <woojin2.jung@samsung.com>
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.common;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.lang.ref.WeakReference;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.cdt.debug.edc.internal.symbols.dwarf.DwarfDebugInfoProviderFactory;
+import org.eclipse.cdt.debug.edc.internal.symbols.dwarf.EDCSymbolReader;
+import org.eclipse.cdt.debug.edc.internal.symbols.files.ElfExecutableSymbolicsReaderFactory;
+import org.eclipse.cdt.debug.edc.internal.symbols.files.UnmanglerEABI;
+import org.eclipse.cdt.debug.edc.internal.symbols.files.UnmanglingException;
+import org.eclipse.cdt.debug.edc.symbols.IDebugInfoProvider;
+import org.eclipse.cdt.debug.edc.symbols.IDebugInfoProviderFactory;
+import org.eclipse.cdt.debug.edc.symbols.IEDCSymbolReader;
+import org.eclipse.cdt.debug.edc.symbols.IExecutableSymbolicsReader;
+import org.eclipse.cdt.debug.edc.symbols.IExecutableSymbolicsReaderFactory;
+import org.eclipse.cdt.debug.edc.symbols.ILineEntry;
+import org.eclipse.cdt.debug.edc.symbols.IModuleLineEntryProvider;
+import org.eclipse.cdt.debug.edc.symbols.IUnmangler;
+import org.eclipse.cdt.utils.Addr32;
+import org.eclipse.cdt.utils.elf.Elf;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+
+public class SymbolManager {
+ private static Map<IPath, WeakReference<IEDCSymbolReader>> readerCache = new HashMap<IPath, WeakReference<IEDCSymbolReader>>();
+ private static Map<String, WeakReference<Elf>> elfCache = new HashMap<String, WeakReference<Elf>>();
+
+ public static class SourceLine {
+ private ILineEntry lineEntry;
+ private int errorNo = AnalyzerConstants.SOURCELINE_NOERROR;
+
+ public SourceLine() {
+ this.lineEntry = null;
+ }
+
+ public SourceLine(ILineEntry lineEntry) {
+ this.lineEntry = lineEntry;
+ }
+
+ public int getError() {
+ return errorNo;
+ }
+
+ public void setError(int errorNo) {
+ this.errorNo = errorNo;
+ }
+
+ public void setLineEntry(ILineEntry lineEntry) {
+ this.lineEntry = lineEntry;
+ }
+
+ public boolean isValid() {
+ if (null == lineEntry
+ || errorNo != AnalyzerConstants.SOURCELINE_NOERROR) {
+ return false;
+ }
+ return true;
+ }
+
+ public String getFilePath() {
+ String filePath = lineEntry.getFilePath().toString();
+ try {
+ return new String(stringToBytesASCII(filePath), "UTF-8"); //$NON-NLS-1$
+ } catch (UnsupportedEncodingException e) {
+ e.printStackTrace();
+ return filePath;
+ }
+ }
+
+ public int getLineNumber() {
+ return lineEntry.getLineNumber();
+ }
+ }
+
+ public static byte[] stringToBytesASCII(String str) {
+ char[] buffer = str.toCharArray();
+ byte[] b = new byte[buffer.length];
+
+ for (int i = 0; i < b.length; i++) {
+ b[i] = (byte) buffer[i];
+ }
+ return b;
+ }
+
+ public static IEDCSymbolReader getSymbolReader(IPath path) {
+ IEDCSymbolReader reader = null;
+ WeakReference<IEDCSymbolReader> cacheEntry = readerCache.get(path);
+
+ if (cacheEntry != null) {
+ reader = cacheEntry.get();
+ }
+
+ if (reader != null) {
+ if (reader.getSymbolFile() != null
+ && reader.getSymbolFile().toFile().exists()
+ && reader.getSymbolFile().toFile().lastModified() == reader
+ .getModificationDate()) {
+ return reader;
+ }
+ readerCache.remove(path);
+ }
+
+ IExecutableSymbolicsReaderFactory provider = new ElfExecutableSymbolicsReaderFactory();
+ IExecutableSymbolicsReader exeReader = provider
+ .createExecutableSymbolicsReader(path);
+ if (exeReader != null) {
+ IDebugInfoProviderFactory providerProvider = new DwarfDebugInfoProviderFactory();
+ IDebugInfoProvider dprovider = providerProvider
+ .createDebugInfoProvider(path, exeReader);
+ if (dprovider != null) {
+ if (!exeReader.getSymbolFile().equals(
+ dprovider.getExecutableSymbolicsReader()
+ .getSymbolFile())) {
+ exeReader.dispose();
+ exeReader = dprovider.getExecutableSymbolicsReader();
+ }
+ }
+ reader = new EDCSymbolReader(exeReader, dprovider);
+ }
+
+ if (reader != null) {
+ readerCache.put(path, new WeakReference<IEDCSymbolReader>(reader));
+ }
+
+ return reader;
+ }
+
+ public static SourceLine addr2line(String strPath, String strAddr,
+ boolean isPieBuild, String strBaseAddr) {
+ Addr32 addr, baseAddr, offsetAddr;
+ IEDCSymbolReader reader;
+ SourceLine srcline = new SourceLine();
+
+ if (strPath == null || strPath.isEmpty()) {
+ srcline.setError(AnalyzerConstants.SOURCELINE_NULL_PATH);
+ return srcline;
+ }
+
+ if (strAddr == null || strAddr.isEmpty()) {
+ srcline.setError(AnalyzerConstants.SOURCELINE_NULL_ADDRESS);
+ return srcline;
+ }
+
+ IPath path = new Path(strPath);
+ if (path.toFile().exists() == false) {
+ srcline.setError(AnalyzerConstants.SOURCELINE_FILE_NOT_FOUND);
+ return srcline;
+ }
+
+ try {
+ addr = new Addr32(strAddr);
+ } catch (NumberFormatException e) {
+ srcline.setError(AnalyzerConstants.SOURCELINE_BAD_ADDRESS);
+ return srcline;
+ }
+
+ if (isPieBuild) {
+ if (strBaseAddr == null || strBaseAddr.isEmpty()) {
+ srcline.setError(AnalyzerConstants.SOURCELINE_NULL_ADDRESS);
+ return srcline;
+ }
+
+ try {
+ baseAddr = new Addr32(strBaseAddr);
+ } catch (NumberFormatException e) {
+ srcline.setError(AnalyzerConstants.SOURCELINE_BAD_ADDRESS);
+ return srcline;
+ }
+ offsetAddr = new Addr32(baseAddr.distanceTo(addr).longValue());
+ addr = offsetAddr;
+ }
+
+ try {
+ reader = getSymbolReader(path);
+ } catch (NoClassDefFoundError e) {
+ srcline.setError(AnalyzerConstants.SOURCELINE_NO_SYMBOL_INFORMATION);
+ return srcline;
+ }
+
+ if (reader != null) {
+ IModuleLineEntryProvider moduleLineEntryProvider = reader
+ .getModuleScope().getModuleLineEntryProvider();
+ if (moduleLineEntryProvider != null) {
+ ILineEntry lineEntry = moduleLineEntryProvider
+ .getLineEntryAtAddress(addr);
+ if (lineEntry != null) {
+ if (lineEntry.getLowAddress().compareTo(addr) == 0) {
+ ILineEntry prevEntry = moduleLineEntryProvider
+ .getPreviousLineEntry(lineEntry, false);
+ if (prevEntry != null) {
+ srcline.setLineEntry(prevEntry);
+ return srcline;
+ } else {
+ srcline.setLineEntry(lineEntry);
+ return srcline;
+ }
+ } else {
+ srcline.setLineEntry(lineEntry);
+ return srcline;
+ }
+ } else {
+ srcline.setError(AnalyzerConstants.SOURCELINE_NO_MATCHING_LINE);
+ return srcline;
+ }
+ }
+ }
+ // never goes here
+ srcline.setError(AnalyzerConstants.SOURCELINE_UNKNOWN_ERROR);
+ return srcline;
+ }
+
+ public static String addr2func(String strBinPath, String strAddr,
+ boolean isPieBuild, String strBaseAddr) {
+ Addr32 addr, baseAddr, offsetAddr;
+
+ if (strBinPath == null || strBinPath.isEmpty()) {
+ // FIXME : temp code
+ return AnalyzerLabels.SYMBOL_MANAGER_UNKNOWN;
+ } else {
+ if (!new File(strBinPath).exists()) {
+ return AnalyzerLabels.SYMBOL_MANAGER_UNKNOWN;
+ }
+ }
+
+ if (strAddr == null || strAddr.isEmpty()) {
+ // FIXME
+ return AnalyzerLabels.SYMBOL_MANAGER_UNKNOWN;
+ }
+
+ if (isPieBuild) {
+ if (strBaseAddr == null || strBaseAddr.isEmpty()) {
+ // FIXME
+ return AnalyzerLabels.SYMBOL_MANAGER_UNKNOWN;
+ }
+ }
+
+ addr = new Addr32(strAddr);
+ if (isPieBuild) {
+ baseAddr = new Addr32(strBaseAddr);
+ offsetAddr = new Addr32(baseAddr.distanceTo(addr).longValue());
+ addr = offsetAddr;
+ }
+
+ Elf elf = null;
+ WeakReference<Elf> elfEntry = elfCache.get(strBinPath);
+
+ if (elfEntry != null) {
+ elf = elfEntry.get();
+ }
+
+ if (elf == null) {
+ try {
+ elf = new Elf(strBinPath);
+ elf.loadSymbols();
+ elfCache.put(strBinPath, new WeakReference<Elf>(elf));
+ } catch (IOException e) {
+ // FIXME
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ return elf.getSymbol(addr).toString();
+ }
+
+ public static String demanglingFunctionName(String mangled) {
+ IUnmangler unmangler = null;
+ String demangled = null;
+ unmangler = new UnmanglerEABI();
+ try {
+ demangled = unmangler.unmangle(mangled);
+ } catch (UnmanglingException e) {
+ e.printStackTrace();
+ demangled = mangled;
+ // for debug log
+ System.out.println("Mangled name :" + mangled); //$NON-NLS-1$
+ }
+ return demangled;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.communicator;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.net.Socket;
+import java.net.SocketTimeoutException;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.widgets.Display;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerPaths;
+import org.tizen.dynamicanalyzer.common.AnalyzerShellCommands;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.common.PathManager;
+import org.tizen.dynamicanalyzer.model.DeviceInfo;
+import org.tizen.dynamicanalyzer.project.AppDesktopInfo;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.uirecorder.UIRecorderTool;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.sdblib.IDevice;
+import org.tizen.sdblib.IShellOutputReceiver;
+import org.tizen.sdblib.MultiLineReceiver;
+import org.tizen.sdblib.NullOutputReceiver;
+import org.tizen.sdblib.SdbCommandRejectedException;
+import org.tizen.sdblib.SdbShellProcess;
+import org.tizen.sdblib.ShellCommandUnresponsiveException;
+import org.tizen.sdblib.SmartDevelopmentBridge;
+import org.tizen.sdblib.SmartDevelopmentBridge.IDeviceChangeListener;
+import org.tizen.sdblib.SyncService;
+import org.tizen.sdblib.SyncService.ISyncProgressMonitor;
+import org.tizen.sdblib.SyncService.SyncResult;
+import org.tizen.sdblib.TimeoutException;
+
+public class DACommunicator {
+ /* Port */
+ public static final int LOCAL_PORT = 8000;
+ public static final int REMOTE_PORT = 8001;
+
+ private static Socket sock = null;
+ private static SmartDevelopmentBridge sdbBridge = null;
+ private static AppDesktopInfo selectedApp = null;
+ private static DeviceInfo currentDevice = null;
+ private static BufferedWriter writer = null;
+ private static BufferedReader reader = null;
+ private static boolean isRunning = false;
+ private static List<DeviceInfo> devices = null;
+ private static List<AppDesktopInfo> appDesktopList = null;
+ private static List<String> appDesktopString = null;
+ private static List<String> uploadDataResult = null;
+
+ public static void init() {
+ SmartDevelopmentBridge.init();
+ setNewBridge();
+ sock = null;
+ selectedApp = null;
+ currentDevice = null;
+ writer = null;
+ reader = null;
+ isRunning = false;
+ devices = null;
+ isArch = false;
+ appDesktopList = null;
+ pidOfDaemon = null;
+ existVersion = false;
+ correctVersion = false;
+ }
+
+ public static List<DeviceInfo> getDevices() {
+ if (null == devices) {
+ devices = new ArrayList<DeviceInfo>();
+ }
+ return devices;
+ }
+
+ public static DeviceInfo getDeviceByName(String name) {
+ List<DeviceInfo> devices = getDevices();
+ int size = devices.size();
+ for (int i = 0; i < size; i++) {
+ if (devices.get(i).getIDevice().getSerialNumber().equals(name)) {
+ return devices.get(i);
+ }
+ }
+ return null;
+ }
+
+ public static DeviceInfo getSelectedDevice() {
+ return currentDevice;
+ }
+
+ public static void setSelectedDevice(DeviceInfo device) {
+ currentDevice = device;
+ }
+
+ public static AppDesktopInfo getSelectedApp() {
+ return selectedApp;
+ }
+
+ public static void setSelectedApp(AppDesktopInfo app) {
+ selectedApp = app;
+ }
+
+ public static Socket getSocket() {
+ return sock;
+ }
+
+ public static void setSocket(Socket socket) {
+ sock = socket;
+ }
+
+ public static SmartDevelopmentBridge getBridge() {
+ return sdbBridge;
+ }
+
+ public static void setBridge(SmartDevelopmentBridge bridge) {
+ sdbBridge = bridge;
+ }
+
+ public static void setNewBridge() {
+ if (null != AnalyzerPaths.SDB_PATH) {
+ sdbBridge = SmartDevelopmentBridge.createBridge(
+ AnalyzerPaths.SDB_PATH, false);
+ sdbBridge.waitforStart();
+ }
+ }
+
+ public static boolean isRunning() {
+ return isRunning;
+ }
+
+ public static void setRunning(boolean run) {
+ isRunning = run;
+ }
+
+ public static void loadDevices() {
+ IDevice[] devices = null;
+ getDevices().clear();
+ if (null != sdbBridge) {
+ devices = sdbBridge.getDevices();
+ int size = devices.length;
+ if (size > 0) {
+ for (int i = 0; i < size; i++) {
+ addDevice(devices[i]);
+ }
+ }
+ }
+ }
+
+ private static void addDevice(IDevice device) {
+ DeviceInfo devInfo = new DeviceInfo(device);
+ devices.add(devInfo);
+ }
+
+ private static boolean isArch = false;
+
+ private static MultiLineReceiver archReceiver = new MultiLineReceiver() {
+ @Override
+ public void processNewLines(String[] lines) {
+ if (lines[0].contains(CommonConstants.ARM_ARCH)) {
+ isArch = true;
+ }
+ }
+ };
+
+ public static boolean isCurrentDeviceArmArch() {
+ execShellCommand(AnalyzerShellCommands.CMD_IS_ARM_ARCH, archReceiver);
+
+ return isArch;
+ }
+
+ protected static List<String> getDevicesNameList() {
+ List<String> devNameList = null;
+ if (null != sdbBridge) {
+ List<DeviceInfo> devicesList = getDevices();
+ devNameList = new ArrayList<String>();
+ for (DeviceInfo device : devicesList) {
+ devNameList.add(device.getIDevice().getSerialNumber());
+ }
+ }
+
+ return devNameList;
+ }
+
+ private static MultiLineReceiver appListReceiver = new MultiLineReceiver() {
+ @Override
+ public void processNewLines(String[] appLines) {
+ for (int i = 0; i < appLines.length; i++) {
+ appDesktopString.add(appLines[i]);
+ }
+ }
+ };
+
+ private static AppDesktopInfo findDesktopInfoByDesktopName(
+ String desktopName) {
+ appDesktopList = getAppDesktopList();
+ int size = appDesktopList.size();
+ for (int i = 0; i < size; i++) {
+ if (appDesktopList.get(i).getDesktopName().equals(desktopName)) {
+ return appDesktopList.get(i);
+ }
+ }
+ return null;
+ }
+
+ public static List<AppDesktopInfo> getAppListFromTarget() {
+ getAppDesktopList().clear();
+ getAppDesktopString().clear();
+
+ execShellCommand(AnalyzerShellCommands.CMD_APPLICATION_LIST,
+ appListReceiver);
+
+ int size = appDesktopString.size();
+ for (int i = 0; i < size; i++) {
+ String line = appDesktopString.get(i);
+ String[] splitLine = line.split(CommonConstants.COLON);
+ String desktopName = splitLine[0];
+
+ AppDesktopInfo desktopInfo = findDesktopInfoByDesktopName(desktopName);
+ if (null == desktopInfo) {
+ desktopInfo = new AppDesktopInfo();
+ desktopInfo.setDesktopName(desktopName);
+ appDesktopList.add(desktopInfo);
+ }
+
+ System.out.println("message : " + splitLine[1]);
+ String[] splitData = splitLine[1].split(CommonConstants.EQUAL);
+ String strData = splitData[0];
+
+ if (strData.toLowerCase().equals("name")) { //$NON-NLS-1$
+ desktopInfo.setName(new String(splitData[1]));
+ } else if (strData.toLowerCase().equals("exec")) { //$NON-NLS-1$
+ desktopInfo.setExecPath(new String(splitData[1]));
+ } else if (strData.toLowerCase().contains("pkgid")) {//$NON-NLS-1$
+ desktopInfo.setPkgId(new String(splitData[1]));
+ }
+ }
+
+ // verification
+ size = appDesktopList.size();
+ for (int i = 0; i < size; i++) {
+ AppDesktopInfo appInfo = appDesktopList.get(i);
+ if (null == appInfo.getExecPath()
+ || appInfo.getExecPath().isEmpty()) {
+ appDesktopList.remove(i);
+ } else if (null == appInfo.getName() || appInfo.getName().isEmpty()) {
+ String execPath = appInfo.getExecPath();
+ String[] splitPath = execPath.split("\\/"); //$NON-NLS-1$
+ String name = new String(splitPath[splitPath.length - 1]);
+ appInfo.setName(name);
+ }
+ }
+
+ // /*** do not delete for debug ***/
+ // for (int i = 0; i < appDesktopList.size(); i++) {
+ // AppDesktopInfo info = appDesktopList.get(i);
+ // System.out.println("name " + info.getName() + " path : "
+ // + info.getExecPath());
+ // }
+
+ return appDesktopList;
+ }
+
+ private static List<AppDesktopInfo> getAppDesktopList() {
+ if (null == appDesktopList) {
+ appDesktopList = new ArrayList<AppDesktopInfo>();
+ }
+ return appDesktopList;
+ }
+
+ private static List<String> getAppDesktopString() {
+ if (null == appDesktopString) {
+ appDesktopString = new ArrayList<String>();
+ }
+ return appDesktopString;
+ }
+
+ public static AppDesktopInfo getAppDesktopInfoByName(String name) {
+ List<AppDesktopInfo> appInfoList = getAppDesktopList();
+ int size = appInfoList.size();
+ for (int i = 0; i < size; i++) {
+ AppDesktopInfo ai = appInfoList.get(i);
+ if (ai.getName().equals(name)) {
+ return ai;
+ }
+ }
+ return null;
+ }
+
+ public static AppDesktopInfo getAppDesktopInfoByAppId(String id) {
+ List<AppDesktopInfo> appInfoList = getAppDesktopList();
+ int size = appInfoList.size();
+ for (int i = 0; i < size; i++) {
+ AppDesktopInfo ai = appInfoList.get(i);
+ if (ai.getPkgId().equals(id)) {
+ return ai;
+ }
+ }
+ return null;
+ }
+
+ public static Socket createSocket(int port) {
+ try {
+ sock = new Socket(CommonConstants.LOCAL_HOST, port);
+ if (null == sock) {
+ System.out.println("failed to create a socket"); //$NON-NLS-1$
+ return null;
+ }
+
+ sock.setSoTimeout(AnalyzerConstants.SOCKET_TIMEOUT);
+ sock.setReuseAddress(true);
+ sock.setTcpNoDelay(true);
+
+ reader = new BufferedReader(new InputStreamReader(
+ sock.getInputStream()));
+ writer = new BufferedWriter(new OutputStreamWriter(
+ sock.getOutputStream()));
+
+ new Thread(null, new ReceiveCommunicator(),
+ AnalyzerConstants.COMMUNICATOR_RECEIVE_THREAD).start();
+
+ } catch (SocketTimeoutException e) {
+ System.out.println("socket timeout."); //$NON-NLS-1$
+ e.printStackTrace();
+ } catch (UnknownHostException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ return sock;
+ }
+
+ public static void closeSocket() {
+ AnalyzerUtil.tryClose(reader, writer, sock);
+ }
+
+ public static BufferedReader getSockBufferedReader() {
+ return reader;
+ }
+
+ public static BufferedWriter getSockBufferedWriter() {
+ return writer;
+ }
+
+ public static void foward(int local, int remote) {
+ if (null != currentDevice && currentDevice.getIDevice().isOnline()) {
+ try {
+ currentDevice.getIDevice().createForward(local, remote);
+ Thread.sleep(AnalyzerConstants.SOCKET_FORWARD_INTERVAL);
+ } catch (TimeoutException e) {
+ e.printStackTrace();
+ } catch (SdbCommandRejectedException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public static void unfoward(int local, int remote) {
+ if (null != currentDevice && currentDevice.getIDevice().isOnline()) {
+ try {
+ currentDevice.getIDevice().removeForward(local, remote);
+ Thread.sleep(AnalyzerConstants.SOCKET_FORWARD_INTERVAL);
+ } catch (TimeoutException e) {
+ e.printStackTrace();
+ } catch (SdbCommandRejectedException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ private static String pidOfDaemon = null;
+
+ private static MultiLineReceiver pidofDaemon = new MultiLineReceiver() {
+ @Override
+ public void processNewLines(String[] lines) {
+ if (0 != lines.length && !lines[0].isEmpty()) {
+ pidOfDaemon = lines[0];
+ }
+ }
+ };
+
+ public static boolean isDaemonAlive() {
+ execShellCommand(AnalyzerShellCommands.CMD_PIDOF_DAEMON, pidofDaemon);
+ if (null != pidOfDaemon) {
+ return true;
+ }
+ return false;
+ }
+
+ public static void killDaemon() {
+ if (null != pidOfDaemon) {
+ System.out.println("kill daemon : " + pidOfDaemon); //$NON-NLS-1$
+ execShellCommand(AnalyzerShellCommands.CMD_KILL_DAEMON
+ + CommonConstants.SPACE + pidOfDaemon);
+ }
+ }
+
+ public static void execShellCommand(String command) {
+ execShellCommand(command, new NullOutputReceiver());
+ }
+
+ public static void execShellCommand(String command,
+ IShellOutputReceiver receiver) {
+ if (null != currentDevice && currentDevice.getIDevice().isOnline()) {
+ try {
+ currentDevice.getIDevice().executeShellCommand(command,
+ receiver);
+ } catch (TimeoutException e) {
+ e.printStackTrace();
+ } catch (SdbCommandRejectedException e) {
+ e.printStackTrace();
+ } catch (ShellCommandUnresponsiveException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public static SdbShellProcess execCommand(String command) {
+ if (null != currentDevice && currentDevice.getIDevice().isOnline()) {
+ try {
+ return currentDevice.getIDevice().executeShellCommand(command);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ return null;
+ }
+
+ public static void sendMessage(String message) {
+ try {
+ if (null != sock) {
+ writer.write(message);
+ writer.flush();
+ }
+
+ } catch (IOException e) {
+ System.out.println(e.getMessage());
+ }
+ }
+
+ public static SyncResult push(String local, String remote) {
+ return push(local, remote, SyncService.getNullProgressMonitor());
+ }
+
+ public static SyncResult pull(String local, String remote) {
+ return pull(local, remote, SyncService.getNullProgressMonitor());
+ }
+
+ public static SyncResult push(String local, String remote,
+ ISyncProgressMonitor monitor) {
+ SyncResult result = null;
+ if (null != currentDevice && currentDevice.getIDevice().isOnline()) {
+ try {
+ SyncService service = currentDevice.getIDevice()
+ .getSyncService();
+ if (null != service) {
+ result = service.pushFile(local, remote, monitor);
+ }
+ } catch (TimeoutException e) {
+ e.printStackTrace();
+ } catch (SdbCommandRejectedException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ return result;
+ }
+
+ public static SyncResult pull(String remote, String local,
+ ISyncProgressMonitor monitor) {
+ SyncResult result = null;
+ if (null != currentDevice && currentDevice.getIDevice().isOnline()) {
+ try {
+ SyncService service = currentDevice.getIDevice()
+ .getSyncService();
+ if (null != service) {
+ result = service.pullFile(remote, local, monitor);
+ }
+ } catch (TimeoutException e) {
+ e.printStackTrace();
+ } catch (SdbCommandRejectedException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ return result;
+ }
+
+ public static void removeCommand(String path) {
+ if (null != currentDevice && currentDevice.getIDevice().isOnline()) {
+ try {
+ currentDevice.getIDevice().executeShellCommand(
+ AnalyzerShellCommands.CMD_REMOVE
+ + CommonConstants.SPACE + path,
+ new NullOutputReceiver());
+ } catch (TimeoutException e) {
+ e.printStackTrace();
+ } catch (SdbCommandRejectedException e) {
+ e.printStackTrace();
+ } catch (ShellCommandUnresponsiveException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public static boolean isTargetEmulator() {
+ DeviceInfo device = getSelectedDevice();
+ if (device != null) {
+ if (device.getIDevice().getSerialNumber()
+ .contains(CommonConstants.EMULATOR)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private static long uploadFile(String source, String targetPath) {
+ SyncResult result = push(source, targetPath);
+ if (null == result || SyncService.RESULT_OK != result.getCode()) {
+ System.out
+ .println("upload " + targetPath + " is failed : " + source); //$NON-NLS-1$ //$NON-NLS-2$
+ System.out.println("Error : " + result.getMessage()); //$NON-NLS-1$
+ return -1;
+ }
+
+ File file = new File(source);
+ if (file.exists()) {
+ return file.length();
+ } else {
+ System.out.println("upload error! file is not exist : " + source); //$NON-NLS-1$
+ return -1;
+ }
+ }
+
+ public static boolean upload() {
+ long readelfSize = -1;
+ long probeTizenSize = -1;
+ long probeOspSize = -1;
+ long versionSize = -1;
+ long daemonSize = -1;
+ long daeventSize = -1;
+ String target = AnalyzerPaths.TARGET_PATH;
+
+ if (isCurrentDeviceArmArch()) {
+ target += CommonConstants.ARM_ARCH;
+ } else {
+ target += CommonConstants.X86_ARCH;
+ }
+
+ String source = AnalyzerPaths.DYNAMIC_ANALYZER_INSTALL_PATH
+ + File.separator + AnalyzerConstants.VERSION_NAME;
+ versionSize = uploadFile(source, AnalyzerPaths.DA_REMOTE_PATH
+ + AnalyzerConstants.VERSION_NAME);
+
+ source = target + File.separator + AnalyzerConstants.DA_DAEMON_NAME;
+ daemonSize = uploadFile(source,
+ AnalyzerPaths.DA_REMOTE_DAEMON_BINARY_PATH);
+
+ source = target + File.separator + AnalyzerConstants.PROBE_LIB_TIZEN;
+ probeTizenSize = uploadFile(source, AnalyzerPaths.DA_REMOTE_PROBE_PATH
+ + AnalyzerConstants.PROBE_LIB_TIZEN);
+
+ source = target + File.separator + AnalyzerConstants.PROBE_LIB_OSP;
+ probeOspSize = uploadFile(source, AnalyzerPaths.DA_REMOTE_PROBE_PATH
+ + AnalyzerConstants.PROBE_LIB_OSP);
+
+ source = target + File.separator + AnalyzerConstants.TOOL_RECORDER_NAME;
+ daeventSize = uploadFile(source,
+ AnalyzerPaths.TOOL_REMOTE_RECORDER_BINARY_PATH);
+
+ String readelf = AnalyzerPaths.READELF_PATH;
+
+ // for readelf
+ if (isCurrentDeviceArmArch()) {
+ readelf += CommonConstants.ARM_ARCH;
+ } else {
+ readelf += CommonConstants.X86_ARCH;
+ }
+ source = readelf + File.separator + AnalyzerConstants.READELF_BIN;
+ readelfSize = uploadFile(source, AnalyzerPaths.DA_REMOTE_PATH
+ + AnalyzerConstants.READELF_BIN);
+
+ if (readelfSize < 0 || probeTizenSize < 0 || probeOspSize < 0
+ || versionSize < 0 || daemonSize < 0 || daeventSize < 0) {
+ return false;
+ } else {
+ execShellCommand(AnalyzerShellCommands.CMD_UPLOAD_FILE_LIST,
+ uploadDataReceiver);
+ int size = getUploadDataResult().size();
+ List<String> resultString = new ArrayList<String>();
+ for (int i = 0; i < size; i++) {
+ String[] splitResult = uploadDataResult.get(i).split("\\/"); //$NON-NLS-1$
+ resultString.add(new String(splitResult[0].trim()));
+ }
+
+ boolean ret = true;
+ // readelf
+ if (readelfSize != Long.parseLong(resultString.get(0))) {
+ System.out.println("readelf file size is different!! "); //$NON-NLS-1$
+ ret = false;
+ }
+ // version
+ if (versionSize != Long.parseLong(resultString.get(1))) {
+ System.out.println("version file size is different!! "); //$NON-NLS-1$
+ ret = false;
+ }
+ // daemon
+ if (daemonSize != Long.parseLong(resultString.get(2))) {
+ System.out.println("da_manager file size is different!! "); //$NON-NLS-1$
+ ret = false;
+ }
+ // probe tizen
+ if (probeTizenSize != Long.parseLong(resultString.get(3))) {
+ System.out.println("probe tizen file size is different!! "); //$NON-NLS-1$
+ ret = false;
+ }
+ // probe osp
+ if (probeOspSize != Long.parseLong(resultString.get(4))) {
+ System.out.println("probe osp file size is different!! "); //$NON-NLS-1$
+ ret = false;
+ }
+
+ // da_event
+ if (daeventSize != Long.parseLong(resultString.get(5))) {
+ System.out.println("da_event file size is different!! "); //$NON-NLS-1$
+ ret = false;
+ }
+ return ret;
+ }
+ }
+
+ private static MultiLineReceiver uploadDataReceiver = new MultiLineReceiver() {
+ @Override
+ public void processNewLines(String[] appLines) {
+ for (int i = 0; i < appLines.length; i++) {
+ getUploadDataResult().add(appLines[i]);
+ }
+ }
+ };
+
+ private static List<String> getUploadDataResult() {
+ if (null == uploadDataResult) {
+ uploadDataResult = new ArrayList<String>();
+ }
+ return uploadDataResult;
+ }
+
+ private static boolean existVersion = false;
+
+ private static MultiLineReceiver lsVersion = new MultiLineReceiver() {
+ @Override
+ public void processNewLines(String[] lines) {
+ existVersion = false;
+ if (0 != lines.length && !lines[0].isEmpty()
+ && !lines[0].startsWith(AnalyzerShellCommands.CMD_NO_LIST)) {
+ existVersion = true;
+ }
+ }
+ };
+
+ private static boolean isVersionExist() {
+ execShellCommand(AnalyzerShellCommands.CMD_LS_VERSION, lsVersion);
+ return existVersion;
+ }
+
+ private static String getDAVersion() {
+ File version = new File(AnalyzerPaths.DYNAMIC_ANALYZER_INSTALL_PATH
+ + File.separator + AnalyzerConstants.VERSION_NAME);
+ if (version.exists()) {
+ BufferedReader br;
+ try {
+ br = new BufferedReader(new FileReader(version));
+ return br.readLine();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ return null;
+ }
+
+ private static boolean correctVersion = false;
+
+ private static MultiLineReceiver catVersion = new MultiLineReceiver() {
+ @Override
+ public void processNewLines(String[] lines) {
+ correctVersion = false;
+ if (0 != lines.length && !lines[0].isEmpty()
+ && !lines[0].startsWith(AnalyzerShellCommands.CMD_NO_LIST)) {
+
+ String daVersion = getDAVersion();
+ if (null != daVersion && daVersion.equals(lines[0])) {
+ correctVersion = true;
+ return;
+ }
+ }
+ }
+ };
+
+ private static boolean isCorrectVersion() {
+ execShellCommand(AnalyzerShellCommands.CMD_CAT_VERSION, catVersion);
+ return correctVersion;
+ }
+
+ public static boolean needUpdateVersion() {
+ if (!isVersionExist() || !isCorrectVersion()) {
+ return true;
+ }
+ return false;
+ }
+
+ public static void addDeviceListener() {
+ SmartDevelopmentBridge.addDeviceChangeListener(deviceChanged);
+ }
+
+ public static void removeDeviceListener() {
+ SmartDevelopmentBridge.removeDeviceChangeListener(deviceChanged);
+ }
+
+ public static void testDisConnected() {
+ deviceChanged.deviceDisconnected(currentDevice.getIDevice());
+ }
+
+ public static boolean isDeviceConnected() {
+ if (null == devices || devices.isEmpty()) {
+ return false;
+ }
+ return true;
+ }
+
+ private static IDeviceChangeListener deviceChanged = new IDeviceChangeListener() {
+ @Override
+ public void deviceDisconnected(IDevice device) {
+ // called : each device disconnected time
+ System.out.println("device disconnected : "
+ + device.getSerialNumber());
+ DeviceInfo deviceInfo = getDeviceByName(device.getSerialNumber());
+ devices.remove(deviceInfo);
+ checkDevices();
+ if (isRunning()) {
+ System.out.println("Disconnected while DA is running."); //$NON-NLS-1$
+ UIRecorderTool.getInstance().stop();
+ DACommunicator.setRunning(false);
+ }
+ }
+
+ @Override
+ public void deviceConnected(IDevice device) {
+ // It called when dynamic-analyzer start, only one time
+ System.out
+ .println("device connected : " + device.getSerialNumber());
+ }
+
+ @Override
+ public void deviceChanged(IDevice device, int changeMask) {
+ // called : device added - already dynamic-analyzer running (not
+ // tracing)
+ System.out.println("device changed : " + device.getSerialNumber()
+ + " " + changeMask);
+ if (1 == changeMask) {
+ addDevice(device);
+ checkDevices();
+ if (null != getSelectedDevice() && null != getSelectedApp()) {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ ToolbarArea.getInstance().setStartButtonEnablement(
+ true);
+ }
+ });
+ }
+ }
+ }
+ };
+
+ public static void checkDevices() {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ List<String> deviceSerials = new ArrayList<String>();
+ String selectedDevice = ToolbarArea.getInstance()
+ .getSelectedDevice();
+ int size = getDevices().size();
+ int selIndex = 0;
+ for (int i = 0; i < size; i++) {
+ String serial = devices.get(i).getIDevice()
+ .getSerialNumber();
+ deviceSerials.add(serial);
+ if (null != selectedDevice && selectedDevice.equals(serial)) {
+ selIndex = i;
+ }
+ }
+ if (!devices.isEmpty()) {
+ setSelectedDevice(devices.get(selIndex));
+ } else {
+ clearDeviceAppInfo();
+ }
+ ToolbarArea.getInstance().setDeviceComboItems(deviceSerials);
+ }
+ });
+ }
+
+ private static void clearDeviceAppInfo() {
+ setSelectedDevice(null);
+ setSelectedApp(null);
+ getAppDesktopList().clear();
+ getAppDesktopString().clear();
+ }
+
+ public static void setSelectedDeviceBySerial(String serial) {
+ if (null == serial || serial.isEmpty()) {
+ setSelectedDevice(null);
+ }
+ int size = getDevices().size();
+ for (int i = 0; i < size; i++) {
+ if (serial.equals(devices.get(i).getIDevice().getSerialNumber())) {
+ setSelectedDevice(devices.get(i));
+ }
+ }
+ }
+
+ public static void pullDaemonLog() {
+ final String from = AnalyzerPaths.DA_DAEMON_LOG_PATH;
+ final String to = PathManager.getLogPath() + File.separator
+ + "da_daemon_log_" + PathManager.getLogPostFix();//$NON-NLS-1$
+ SyncResult res = pull(from, to);
+ if (null != res && SyncService.RESULT_OK == res.getCode()) {
+ System.out.println("daemon log copying success!!");//$NON-NLS-1$
+ } else {
+ System.out.println("Failed to get " + from); //$NON-NLS-1$
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.communicator;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerPaths;
+import org.tizen.dynamicanalyzer.common.AnalyzerShellCommands;
+import org.tizen.sdblib.MultiLineReceiver;
+
+public class DaemonExecution {
+
+ private static boolean isDaemonExist = false;
+
+ private static DaemonExecution execution = new DaemonExecution();
+
+ public static DaemonExecution getInstance() {
+ return execution;
+ }
+
+ private boolean listen = false;
+
+ private MultiLineReceiver netDaemonReceiver = new MultiLineReceiver() {
+ @Override
+ public void processNewLines(String[] lines) {
+ for (String line : lines) {
+ if (line.contains(AnalyzerConstants.DA_DAEMON_NAME)) {
+ listen = true;
+ }
+ }
+ }
+ };
+
+ private boolean isDaemonListen() {
+ DACommunicator.execShellCommand(AnalyzerShellCommands.CMD_IS_DAEMON_LISTEN,
+ netDaemonReceiver);
+
+ return listen;
+ }
+
+ public boolean runDaemon() {
+ DACommunicator.execCommand(AnalyzerPaths.DA_REMOTE_DAEMON_BINARY_PATH);
+ int i = 1;
+
+ while (!isDaemonListen()) {
+ if (i > AnalyzerConstants.DAEMON_LISTEN_TRY) {
+ return false;
+ }
+ System.out.println("waiting for daemon until listening. try # : " //$NON-NLS-1$
+ + i);
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ i++;
+ }
+ return true;
+ }
+
+ private MultiLineReceiver isDaemonReceiver = new MultiLineReceiver() {
+ @Override
+ public void processNewLines(String[] lines) {
+ if (0 == lines.length
+ || lines[0].startsWith(AnalyzerShellCommands.CMD_NO_LIST)) {
+ return;
+ }
+
+ for (String line : lines) {
+ if (line.contains(AnalyzerPaths.DA_REMOTE_DAEMON_BINARY_PATH)) {
+ isDaemonExist = true;
+ break;
+ }
+ }
+ }
+ };
+
+ public boolean isDaemonExist() {
+ DACommunicator.execShellCommand(AnalyzerShellCommands.CMD_IS_DAEMON_EXIST,
+ isDaemonReceiver);
+
+ return isDaemonExist;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.communicator;
+
+import java.io.BufferedWriter;
+import java.io.DataInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStreamWriter;
+import java.io.RandomAccessFile;
+import java.net.Socket;
+import java.net.UnknownHostException;
+import java.nio.channels.FileChannel;
+import java.nio.channels.FileLock;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.AnalyzerPaths;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.common.DASingletonFocusManager;
+import org.tizen.dynamicanalyzer.model.DeviceInfo;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.project.AppDesktopInfo;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.ui.widgets.DADialog;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+
+public class IDECommunicator implements Runnable {
+ private final int MAXBUFSIZE = 1024;
+
+ private final String IDE_DA_COMMUNICATION_TYPE_1 = "STATUS";//$NON-NLS-1$
+ private final String IDE_DA_COMMUNICATION_TYPE_2 = "RUN";//$NON-NLS-1$
+ private final static String IDE_DA_COMMUNICATION_TYPE_3 = "SOURCE";//$NON-NLS-1$
+ private final String IDE_DA_COMMUNICATION_TYPE_1_RECORD = "record";//$NON-NLS-1$
+ private final String IDE_DA_COMMUNICATION_TYPE_1_STOP = "stop";//$NON-NLS-1$
+ private static Socket socket = null;
+ private int port = 0;
+ private static BufferedWriter writer = null;
+ private static Thread instance;
+
+ private File file = null;
+ private FileLock fileLock = null;
+ private FileChannel fchannel = null;
+
+ public void run() {
+ while (true) {
+ try {
+ resetSocket();
+ // Waiting Start IDE
+ System.out.println(" Waiting Start IDE"); //$NON-NLS-1$
+ try {
+ file = new File(AnalyzerPaths.IDE_ACTIVE_PORT_PATH);
+ fchannel = new RandomAccessFile(file, "rw").getChannel();//$NON-NLS-1$
+ } catch (FileNotFoundException e1) {
+ e1.printStackTrace();
+ closeFileLockData();
+ errorMessageBox();
+ return;
+ }
+ while (true) {
+ try {
+ fileLock = fchannel.tryLock();
+ if (fileLock == null) { // Active IDE
+ break;
+ } else {
+ fileLock.release();
+ Thread.sleep(1000);
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ closeFileLockData();
+ errorMessageBox();
+ return;
+ }
+ }
+ closeFileLockData();
+ // Read IDE Port
+ if (readActiveIdePort() != true) {
+ System.out.println("Failed Read Active IDE Port");//$NON-NLS-1$
+ continue;
+ }
+ // Connect IDE Socket
+ if (setIDESocket() != true) {
+ System.out.println("Failed Connect IDE Socket");//$NON-NLS-1$
+ continue;
+ }
+ System.out.println("Connect IDE");//$NON-NLS-1$
+ int readSize = 0;
+ byte receiveBuffer[] = new byte[MAXBUFSIZE];
+ InputStream in = null;
+ while (true) {
+ try {
+ in = getSocket().getInputStream();
+ System.out.print("IDE recvMessage Wait\n");//$NON-NLS-1$
+ readSize = in.read(receiveBuffer);
+ if (readSize > 0) {
+ parsingReceiveMessage(new String(receiveBuffer));
+ } else {
+ break;
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ break;
+ }
+ }
+ System.out.println("Disconnect IDE");//$NON-NLS-1$
+ } catch (InterruptedException e) {
+ break;
+ }
+ }
+ }
+
+ private void errorMessageBox() {
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ popupMessage(AnalyzerLabels.IDE_DA_COMMUNICATION_ERROR_MESSAGE);
+ }
+ });
+ }
+
+ private void closeFileLockData() {
+ if (file != null) {
+ file = null;
+ }
+ AnalyzerUtil.tryClose(fchannel);
+ if (fileLock != null) {
+ fileLock = null;
+ }
+ }
+
+ public static void startIDECommunicatorThread() {
+ if (null == instance || !instance.isAlive()) {
+ instance = new Thread(null, new IDECommunicator(),
+ AnalyzerConstants.IDE_COMMUNICATOR_THREAD);
+ instance.start();
+ }
+ }
+
+ public static void stopIDEcommunicatorThread() {
+ if (null != instance && instance.isAlive()) {
+ instance.interrupt();
+ }
+ }
+
+ private Socket getSocket() {
+ return socket;
+ }
+
+ private void resetSocket() {
+ socket = null;
+ writer = null;
+ }
+
+ public static boolean isConnected() {
+ if (socket == null) {
+ return false;
+ }
+ return true;
+ }
+
+ public static void sendCodeInfoToIDE(final String path, final String line) {
+ sendMessageToIDE(sendMessageString(IDE_DA_COMMUNICATION_TYPE_3, path,
+ line));
+ }
+
+ public static boolean sendMessageToIDE(final String message) {
+ try {
+ if (socket != null) {
+ writer = new BufferedWriter(new OutputStreamWriter(
+ socket.getOutputStream()));
+ writer.write(message);
+ writer.flush();
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ return false;
+ }
+ return true;
+ }
+
+ // Management Receive Message
+ private void parsingReceiveMessage(String msg) {
+ String[] strMsg = msg.split(AnalyzerConstants.DATA_PARSING_TOKEN);
+ if (strMsg[0].equals(IDE_DA_COMMUNICATION_TYPE_1)) {
+ sendDAStatus();
+ } else if (strMsg[0].equals(IDE_DA_COMMUNICATION_TYPE_2)) {
+ if (isDAReadyStatus()) {
+ autoStartApplication(strMsg);
+ }
+ } else {
+ System.out.println(" wrong receive message ");//$NON-NLS-1$
+ }
+ }
+
+ // Receive Message DA Status , Send DA Status
+ private void sendDAStatus() {
+ if (isDAReadyStatus()) {
+ sendMessageToIDE(sendMessageString(IDE_DA_COMMUNICATION_TYPE_1,
+ IDE_DA_COMMUNICATION_TYPE_1_STOP, CommonConstants.EMPTY));
+ } else {
+ sendMessageToIDE(sendMessageString(IDE_DA_COMMUNICATION_TYPE_1,
+ IDE_DA_COMMUNICATION_TYPE_1_RECORD, CommonConstants.EMPTY));
+ }
+ }
+
+ private boolean isDAReadyStatus() {
+ if (AnalyzerManager.isRunning()) {
+ sendMessageToIDE(sendMessageString(IDE_DA_COMMUNICATION_TYPE_1,
+ IDE_DA_COMMUNICATION_TYPE_1_RECORD, CommonConstants.EMPTY));
+ DASingletonFocusManager.setFocusDA();
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ popupMessage(AnalyzerLabels.RE_TRACE_FORM_IDE);
+ }
+ });
+ return false;
+ }
+ return true;
+ }
+
+ private static String sendMessageString(String first, String second,
+ String third) {
+
+ StringBuffer sendMsg = new StringBuffer();
+ sendMsg.append(first).append(AnalyzerConstants.DATA_PARSING_TOKEN)
+ .append(second).append(AnalyzerConstants.DATA_PARSING_TOKEN)
+ .append(third);
+ return sendMsg.toString();
+
+ }
+
+ // trace Application
+ private void autoStartApplication(String[] strMsg) {
+
+ final String deviceName = new String(strMsg[1].trim());
+ final String appid = new String(strMsg[2].trim());
+
+ System.out.println("auto start : " + appid);
+ DeviceInfo device = DACommunicator.getDeviceByName(deviceName);
+ DACommunicator.setSelectedDevice(device);
+
+ DACommunicator.getAppListFromTarget();
+ AppDesktopInfo appInfo = DACommunicator.getAppDesktopInfoByAppId(appid);
+ if (null == appInfo) {
+ System.out.println("invalid application name :" + appid);
+ return;
+ }
+ final String appName = appInfo.getName();
+ System.out.println("IDE recv - deviceName: " + deviceName
+ + " appName : " + appName);
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ ToolbarArea.getInstance().setDeviceComboText(deviceName);
+ ToolbarArea.getInstance().setAppComboText(appName);
+ ToolbarArea.getInstance().startTrace();
+ }
+ });
+ DASingletonFocusManager.setFocusDA();
+ }
+
+ private void popupMessage(final String message) {
+ Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
+ DADialog warning = new DADialog(shell, SWT.NONE);
+ warning.setMessage(message);
+ warning.setIcon(ImageResources.DIALOG_WARNING_ICON);
+ warning.open();
+ }
+
+ private boolean readActiveIdePort() {
+ boolean bSuccess = true;
+ // read port from current_active_ide_port
+ try {
+ File logs = new File(AnalyzerPaths.IDE_ACTIVE_SAVE_PORT_PATH);
+ if (!logs.exists()) {
+ bSuccess = false;
+ }
+ FileInputStream fis = new FileInputStream(
+ AnalyzerPaths.IDE_ACTIVE_SAVE_PORT_PATH);
+ DataInputStream dis = new DataInputStream(fis);
+ try {
+ port = dis.readInt();
+ } catch (IOException e) {
+ e.printStackTrace();
+ bSuccess = false;
+ } finally {
+ AnalyzerUtil.tryClose(fis, dis);
+ }
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ bSuccess = false;
+ }
+ return bSuccess;
+ }
+
+ private boolean setIDESocket() {
+ try {
+ socket = new Socket(CommonConstants.LOCAL_HOST, port);
+ } catch (UnknownHostException e) {
+ e.printStackTrace();
+ socket = null;
+ return false;
+ } catch (IOException e) {
+ e.printStackTrace();
+ socket = null;
+ return false;
+ }
+ return true;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.communicator;
+
+import org.tizen.dynamicanalyzer.logparser.MessageProcess;
+
+public class ReceiveCommunicator implements Runnable {
+
+ @Override
+ public void run() {
+ MessageProcess.getInstance().run(
+ ResourceCommunicator.getSockBufferedReader());
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.communicator;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.model.DeviceInfo;
+import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
+import org.tizen.dynamicanalyzer.ui.toolbar.ConfigureManager;
+
+public class ResourceCommunicator extends DACommunicator {
+
+ public static boolean connect() {
+
+ if (isDaemonAlive()) {
+ killDaemon();
+ }
+
+ if (needUpdateVersion()) {
+ System.out.println("Update utils and libs..."); //$NON-NLS-1$
+ if (!upload()) {
+ System.out.println("Failed to upload files..."); //$NON-NLS-1$
+ return false;
+ }
+ }
+
+ if (!DaemonExecution.getInstance().runDaemon()) {
+ System.out.println("Failed to start da_daemon"); //$NON-NLS-1$
+ return false;
+ }
+
+ foward(LOCAL_PORT, REMOTE_PORT);
+
+ setRunning(true);
+
+ if (null == createSocket(LOCAL_PORT)) {
+ System.out.println("socket creation failed."); //$NON-NLS-1$
+ return false;
+ }
+
+ return true;
+ }
+
+ public static void sendStartMessage() {
+ int isArm = 0;
+ int isEmul = 0;
+ int res = 0;
+
+ if (!isCurrentDeviceArmArch()) {
+ isArm = 1;
+ }
+
+ DeviceInfo device = getSelectedDevice();
+ if (null != device
+ && device.getIDevice().getSerialNumber()
+ .startsWith(CommonConstants.EMULATOR)) {
+ isEmul = 1;
+ }
+
+ String rearMessage = ""+res
+ + isEmul
+ + isArm
+ + CommonConstants.CMD_SPLIT
+ + getConfiguration()
+ + CommonConstants.CMD_SPLIT
+ + ResourceCommunicator.getSelectedApp().getExecPath();
+
+ String message = AnalyzerConstants.MSG_START
+ + CommonConstants.CMD_SPLIT
+// + (ResourceCommunicator.getSelectedApp().getExecPath().length() + 7)
+ + rearMessage.length()
+ + CommonConstants.CMD_SPLIT
+ + rearMessage;
+// + res
+// + isEmul
+// + isArm
+// + CommonConstants.CMD_SPLIT
+// + getConfiguration()
+// + CommonConstants.CMD_SPLIT
+// + ResourceCommunicator.getSelectedApp().getExecPath();
+ System.out.println("Send message :" + message); //$NON-NLS-1$
+ sendMessage(message);
+ }
+
+ public static void sendSnapshotMessage(int state) {
+ String message = AnalyzerConstants.MSG_OPTION
+ + CommonConstants.CMD_SPLIT + 3 + CommonConstants.CMD_SPLIT
+ + state;
+ sendMessage(message);
+ }
+
+ public static int getConfiguration() {
+ int state = 0;
+
+ state |= ConfigureManager.getInstance().getValueInt(
+ ConfigureLabels.FUNCTIONPROFILING);
+ state |= ConfigureManager.getInstance().getValueInt(
+ ConfigureLabels.ALLOCATION);
+ state |= ConfigureManager.getInstance().getValueInt(
+ ConfigureLabels.FILE);
+ state |= ConfigureManager.getInstance().getValueInt(
+ ConfigureLabels.THREAD);
+ state |= ConfigureManager.getInstance().getValueInt(
+ ConfigureLabels.USERINTERFACE);
+ state |= ConfigureManager.getInstance().getValueInt(
+ ConfigureLabels.SNAPSHOT);
+ state |= ConfigureManager.getInstance().getValueInt(
+ ConfigureLabels.EVENT);
+ state |= ConfigureManager.getInstance().getValueInt(
+ ConfigureLabels.RECORDING);
+
+ return state;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.error;
+
+import org.tizen.dynamicanalyzer.nl.ErrorLabels;
+
+public enum DAErrorCode {
+ /** /usr/include/asm-generic/errno-base.h **/
+ EPERM(1,ErrorLabels.EPERM),
+ ENOENT(2, ErrorLabels.ENOENT),
+ ESRCH(3,ErrorLabels.ESRCH),
+ EINTR(4,ErrorLabels.EINTR),
+ EIO(5,ErrorLabels.EIO),
+ ENXIO(6,ErrorLabels.ENXIO),
+ E2BIG(7,ErrorLabels.E2BIG),
+ ENOEXEC(8, ErrorLabels.ENOEXEC),
+ EBADF(9, ErrorLabels.EBADF),
+ ECHILD(10, ErrorLabels.ECHILD),
+ EAGAIN(11, ErrorLabels.EAGAIN),
+ ENOMEM(12, ErrorLabels.ENOMEM),
+ EACCES(13, ErrorLabels.EACCES),
+ EFAULT(14, ErrorLabels.EFAULT),
+ ENOTBLK(15, ErrorLabels.ENOTBLK),
+ EBUSY(16, ErrorLabels.EBUSY),
+ EEXIST(17, ErrorLabels.EEXIST),
+ EXDEV(18, ErrorLabels.EXDEV),
+ ENODEV(19, ErrorLabels.ENODEV),
+ ENOTDIR(20, ErrorLabels.ENOTDIR),
+ EISDIR(21, ErrorLabels.EISDIR),
+ EINVAL(22, ErrorLabels.EINVAL),
+ ENFILE(23, ErrorLabels.ENFILE),
+ EMFILE(24, ErrorLabels.EMFILE),
+ ENOTTY(25, ErrorLabels.ENOTTY),
+ ETXTBSY(26, ErrorLabels.ETXTBSY),
+ EFBIG(27, ErrorLabels.EFBIG),
+ ENOSPC(28, ErrorLabels.ENOSPC),
+ ESPIPE(29, ErrorLabels.ESPIPE),
+ EROFS(30, ErrorLabels.EROFS),
+ EMLINK(31, ErrorLabels.EMLINK),
+ EPIPE(32, ErrorLabels.EPIPE),
+ EDOM(33, ErrorLabels.EDOM),
+ ERANGE(34, ErrorLabels.ERANGE),
+
+ /** /usr/include/asm-generic/errno.h **/
+ EDEADLK(35, ErrorLabels.EDEADLK),
+ ENAMETOOLONG(36, ErrorLabels.ENAMETOOLONG),
+ ENOLCK(37, ErrorLabels.ENOLCK),
+ ENOSYS(38, ErrorLabels.ENOSYS),
+ ENOTEMPTY(39, ErrorLabels.ENOTEMPTY),
+ ELOOP(40, ErrorLabels.ELOOP),
+// EWOULDBLOCK(EAGAIN, ErrorLabels.E),
+ ENOMSG(42, ErrorLabels.ENOMSG),
+ EIDRM(43, ErrorLabels.EIDRM),
+ ECHRNG(44, ErrorLabels.ECHRNG),
+ EL2NSYNC(45, ErrorLabels.EL2NSYNC),
+ EL3HLT(46, ErrorLabels.EL3HLT),
+ EL3RST(47, ErrorLabels.EL3RST),
+ ELNRNG(48, ErrorLabels.ELNRNG),
+ EUNATCH(49, ErrorLabels.EUNATCH),
+ ENOCSI(50, ErrorLabels.ENOCSI),
+ EL2HLT(51, ErrorLabels.EL2HLT),
+ EBADE(52, ErrorLabels.EBADE),
+ EBADR(53, ErrorLabels.EBADR),
+ EXFULL(54, ErrorLabels.EXFULL),
+ ENOANO(55, ErrorLabels.ENOANO),
+ EBADRQC(56, ErrorLabels.EBADRQC),
+ EBADSLT(57, ErrorLabels.EBADSLT),
+
+// #define EDEADLOCK EDEADLK ??
+
+ EBFONT(59, ErrorLabels.EBFONT),
+ ENOSTR(60, ErrorLabels.ENOSTR),
+ ENODATA(61, ErrorLabels.ENODATA),
+ ETIME(62, ErrorLabels.ETIME),
+ ENOSR(63, ErrorLabels.ENOSR),
+ ENONET(64, ErrorLabels.ENONET),
+ ENOPKG(65, ErrorLabels.ENOPKG),
+ EREMOTE(66, ErrorLabels.EREMOTE),
+ ENOLINK(67, ErrorLabels.ENOLINK),
+ EADV(68, ErrorLabels.EADV),
+ ESRMNT(69, ErrorLabels.ESRMNT),
+ ECOMM(70, ErrorLabels.ECOMM),
+ EPROTO(71, ErrorLabels.EPROTO),
+ EMULTIHOP(72, ErrorLabels.EMULTIHOP),
+ EDOTDOT(73, ErrorLabels.EDOTDOT),
+ EBADMSG(74, ErrorLabels.EBADMSG),
+ EOVERFLOW(75, ErrorLabels.EOVERFLOW),
+ ENOTUNIQ(76, ErrorLabels.ENOTUNIQ),
+ EBADFD(77, ErrorLabels.EBADFD),
+ EREMCHG(78, ErrorLabels.EREMCHG),
+ ELIBACC(79, ErrorLabels.ELIBACC),
+ ELIBBAD(80, ErrorLabels.ELIBBAD),
+ ELIBSCN(81, ErrorLabels.ELIBSCN),
+ ELIBMAX(82, ErrorLabels.ELIBMAX),
+ ELIBEXEC(83, ErrorLabels.ELIBEXEC),
+ EILSEQ(84, ErrorLabels.EILSEQ),
+ ERESTART(85, ErrorLabels.ERESTART),
+ ESTRPIPE(86, ErrorLabels.ESTRPIPE),
+ EUSERS(87, ErrorLabels.EUSERS),
+ ENOTSOCK(88, ErrorLabels.ENOTSOCK),
+ EDESTADDRREQ(89, ErrorLabels.EDESTADDRREQ),
+ EMSGSIZE(90, ErrorLabels.EMSGSIZE),
+ EPROTOTYPE(91, ErrorLabels.EPROTOTYPE),
+ ENOPROTOOPT(92, ErrorLabels.ENOPROTOOPT),
+ EPROTONOSUPPORT(93, ErrorLabels.EPROTONOSUPPORT),
+ ESOCKTNOSUPPORT(94, ErrorLabels.ESOCKTNOSUPPORT),
+ EOPNOTSUPP(95, ErrorLabels.EOPNOTSUPP),
+ EPFNOSUPPORT(96, ErrorLabels.EPFNOSUPPORT),
+ EAFNOSUPPORT(97, ErrorLabels.EAFNOSUPPORT),
+ EADDRINUSE(98, ErrorLabels.EADDRINUSE),
+ EADDRNOTAVAIL(99, ErrorLabels.EADDRNOTAVAIL),
+ ENETDOWN(100, ErrorLabels.ENETDOWN),
+ ENETUNREACH(101, ErrorLabels.ENETUNREACH),
+ ENETRESET(102, ErrorLabels.ENETRESET),
+ ECONNABORTED(103, ErrorLabels.ECONNABORTED),
+ ECONNRESET(104, ErrorLabels.ECONNRESET),
+ ENOBUFS(105, ErrorLabels.ENOBUFS),
+ EISCONN(106, ErrorLabels.EISCONN),
+ ENOTCONN(107, ErrorLabels.ENOTCONN),
+ ESHUTDOWN(108, ErrorLabels.ESHUTDOWN),
+ ETOOMANYREFS(109, ErrorLabels.ETOOMANYREFS),
+ ETIMEDOUT(110, ErrorLabels.ETIMEDOUT),
+ ECONNREFUSED(111, ErrorLabels.ECONNREFUSED),
+ EHOSTDOWN(112, ErrorLabels.EHOSTDOWN),
+ EHOSTUNREACH(113, ErrorLabels.EHOSTUNREACH),
+ EALREADY(114, ErrorLabels.EALREADY),
+ EINPROGRESS(115, ErrorLabels.EINPROGRESS),
+ ESTALE(116, ErrorLabels.ESTALE),
+ EUCLEAN(117, ErrorLabels.EUCLEAN),
+ ENOTNAM(118, ErrorLabels.ENOTNAM),
+ ENAVAIL(119, ErrorLabels.ENAVAIL),
+ EISNAM(120, ErrorLabels.EISNAM),
+ EREMOTEIO(121, ErrorLabels.EREMOTEIO),
+ EDQUOT(122, ErrorLabels.EDQUOT),
+ ENOMEDIUM(123, ErrorLabels.ENOMEDIUM),
+ EMEDIUMTYPE(124, ErrorLabels.EMEDIUMTYPE),
+ ECANCELED(125, ErrorLabels.ECANCELED),
+ ENOKEY(126, ErrorLabels.ENOKEY),
+ EKEYEXPIRED(127, ErrorLabels.EKEYEXPIRED),
+ EKEYREVOKED(128, ErrorLabels.EKEYREVOKED),
+ EKEYREJECTED(129, ErrorLabels.EKEYREJECTED),
+
+ EOWNERDEAD(130, ErrorLabels.EOWNERDEAD),
+ ENOTRECOVERABLE(131, ErrorLabels.ENOTRECOVERABLE),
+
+
+ E_SUCCESS(SET_E_SEVERITY(0), ErrorLabels.E_SUCCESS),
+ E_FAILURE(SET_E_SEVERITY(1), ErrorLabels.E_FAILURE),
+ ERR_SRC_FRAMEWORK(getE_FAILURE() + SET_E_TYPE(1), ErrorLabels.ERR_SRC_FRAMEWORK),
+ ERR_SRC_USER(getE_FAILURE() + SET_E_TYPE(2), ErrorLabels.ERR_SRC_USER),
+
+ /** --- A --- **/
+ E_ADDRESS_CHANGED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1100), ErrorLabels.E_ADDRESS_CHANGED),
+ E_ALREADY_BOUND(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1101), ErrorLabels.E_ALREADY_BOUND),
+ E_ALREADY_CONNECTED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1102), ErrorLabels.E_ALREADY_CONNECTED),
+ E_ALREADY_OPENED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1103), ErrorLabels.E_ALREADY_OPENED),
+ E_AUTHENTICATION(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1104), ErrorLabels.E_AUTHENTICATION),
+ E_APP_NOT_INSTALLED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1105), ErrorLabels.E_APP_NOT_INSTALLED),
+ E_ALREADY_SET(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1106), ErrorLabels.E_ALREADY_SET),
+ /** --- B --- **/
+ /** --- C --- **/
+ E_CHUNKED_TRANSACTION(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1300), ErrorLabels.E_CHUNKED_TRANSACTION),
+ E_CONNECTION_BUSY(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1301), ErrorLabels.E_CONNECTION_BUSY),
+ E_CONNECTION_FAILED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1302), ErrorLabels.E_CONNECTION_FAILED),
+ E_CONNECTION_RESET(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1303), ErrorLabels.E_CONNECTION_RESET),
+ E_CREDENTIAL_EXPIRED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1304), ErrorLabels.E_CREDENTIAL_EXPIRED),
+ E_CERTIFICATE_VERIFICATION_FAILED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1305), ErrorLabels.E_CERTIFICATE_VERIFICATION_FAILED),
+
+ /** --- D --- **/
+ E_DATA_NOT_FOUND(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1400), ErrorLabels.E_DATA_NOT_FOUND),
+ E_DATABASE(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1401), ErrorLabels.E_DATABASE),
+ E_DECODING_FAILED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1402), ErrorLabels.E_DECODING_FAILED),
+ E_DEVICE_BUSY(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1403), ErrorLabels.E_DEVICE_BUSY),
+ E_DEVICE_FAILED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1404), ErrorLabels.E_DEVICE_FAILED),
+ E_DEVICE_INCOMPATIBLE(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1405), ErrorLabels.E_DEVICE_INCOMPATIBLE),
+ E_DEVICE_UNAVAILABLE(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1406), ErrorLabels.E_DEVICE_UNAVAILABLE),
+ E_DHCP(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1407), ErrorLabels.E_DHCP),
+ E_DIMENSION_CHANGED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1408), ErrorLabels.E_DIMENSION_CHANGED),
+ E_DNS(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1409), ErrorLabels.E_DNS),
+ E_DNS_NOT_FOUND(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1410), ErrorLabels.E_DNS_NOT_FOUND),
+
+ /** --- E --- **/
+ E_EFFECTS_DISABLED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1500), ErrorLabels.E_EFFECTS_DISABLED),
+ E_EMPTY_BODY(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1501), ErrorLabels.E_EMPTY_BODY),
+ E_ENCODING_FAILED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1502), ErrorLabels.E_ENCODING_FAILED),
+ E_END_OF_FILE(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1503), ErrorLabels.E_END_OF_FILE),
+
+ /** --- F --- **/
+// E_FAILURE(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1600), ErrorLabels.E_),
+ E_FDN_MODE(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1600), ErrorLabels.E_FDN_MODE),
+ E_FILE_ALREADY_EXIST(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1601), ErrorLabels.E_FILE_ALREADY_EXIST),
+ E_FILE_NOT_FOUND(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1602), ErrorLabels.E_FILE_NOT_FOUND),
+
+ /** --- G --- **/
+ E_GROUP_NOT_FOUND(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1700), ErrorLabels.E_GROUP_NOT_FOUND),
+
+ /** --- H --- **/
+ E_HOST_NOT_FOUND(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1800), ErrorLabels.E_HOST_NOT_FOUND),
+ E_HOST_UNREACHABLE(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1801), ErrorLabels.E_HOST_UNREACHABLE),
+ E_HTTP_USER(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1802), ErrorLabels.E_HTTP_USER),
+
+ /** --- I --- **/
+ E_ILLEGAL_ACCESS(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1900), ErrorLabels.E_ILLEGAL_ACCESS),
+ E_IN_PROGRESS(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1901), ErrorLabels.E_IN_PROGRESS),
+ E_INACCESSIBLE_PATH(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1902), ErrorLabels.E_INACCESSIBLE_PATH),
+ E_INIT_FAILED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1903), ErrorLabels.E_INIT_FAILED),
+ E_INSTANTIATION_FAILED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1904), ErrorLabels.E_INSTANTIATION_FAILED),
+ E_INSUFFICIENT_PRIORITY(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1905), ErrorLabels.E_INSUFFICIENT_PRIORITY),
+ E_INTERRUPTED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1906), ErrorLabels.E_INTERRUPTED),
+ E_INVALID_ACCOUNT(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1907), ErrorLabels.E_INVALID_ACCOUNT),
+ E_INVALID_ADDRESS(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1908), ErrorLabels.E_INVALID_ADDRESS),
+ E_INVALID_ARG(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1909), ErrorLabels.E_INVALID_ARG),
+ E_INVALID_CONDITION(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1910), ErrorLabels.E_INVALID_CONDITION),
+ E_INVALID_CONNECTION(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1911), ErrorLabels.E_INVALID_CONNECTION),
+ E_INVALID_CONTENT(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1912), ErrorLabels.E_INVALID_CONTENT),
+ E_INVALID_CONTEXT(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1913), ErrorLabels.E_INVALID_CONTEXT),
+ E_INVALID_DATA(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1914), ErrorLabels.E_INVALID_DATA),
+ E_INVALID_DOMAIN(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1915), ErrorLabels.E_INVALID_DOMAIN),
+ E_INVALID_ENCODING_RANGE(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1916), ErrorLabels.E_INVALID_ENCODING_RANGE),
+ E_INVALID_FORMAT(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1917), ErrorLabels.E_INVALID_FORMAT),
+ E_INVALID_HEADER(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1918), ErrorLabels.E_INVALID_HEADER),
+ E_INVALID_KEY(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1919), ErrorLabels.E_INVALID_KEY),
+ E_INVALID_OPERATION(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1920), ErrorLabels.E_INVALID_OPERATION),
+ E_INVALID_PROXY(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1921), ErrorLabels.E_INVALID_PROXY),
+ E_INVALID_SIM_STATE(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1922), ErrorLabels.E_INVALID_SIM_STATE),
+ E_INVALID_SERVER(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1923), ErrorLabels.E_INVALID_SERVER),
+ E_INVALID_SESSION(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1924), ErrorLabels.E_INVALID_SESSION),
+ E_INVALID_SOCKET(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1925), ErrorLabels.E_INVALID_SOCKET),
+ E_INVALID_STATE(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1926), ErrorLabels.E_INVALID_STATE),
+ E_INVALID_TRANSACTION(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1927), ErrorLabels.E_INVALID_TRANSACTION),
+ E_IO(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1928), ErrorLabels.E_IO),
+ E_NOT_JOINED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1929), ErrorLabels.E_NOT_JOINED),
+ E_INVALID_CERTIFICATE(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1930), ErrorLabels.E_INVALID_CERTIFICATE),
+ E_INVALID_URL(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(1931), ErrorLabels.E_INVALID_URL),
+
+ /** --- J ---**/
+ /** --- K --- **/
+ E_KEY_ALREADY_EXIST(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2100), ErrorLabels.E_KEY_ALREADY_EXIST),
+ E_KEY_NOT_FOUND(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2101), ErrorLabels.E_KEY_NOT_FOUND),
+
+ /** --- L --- **/
+ E_LANDMARK(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2200), ErrorLabels.E_LANDMARK),
+ E_LIBRARY_NOT_FOUND(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2201), ErrorLabels.E_LIBRARY_NOT_FOUND),
+ E_LIBRARY_NOT_LOADED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2202), ErrorLabels.E_LIBRARY_NOT_LOADED),
+ E_LINK(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2203), ErrorLabels.E_LINK),
+ E_LOCATION(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2204), ErrorLabels.E_LOCATION),
+ E_LOCATION_SERVICE(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2205), ErrorLabels.E_LOCATION_SERVICE),
+ E_LOCK_FAILED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2206), ErrorLabels.E_LOCK_FAILED),
+ E_LANGUAGE_NOT_SET(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2207), ErrorLabels.E_LANGUAGE_NOT_SET),
+
+ /** --- M --- **/
+ E_MAX_EXCEEDED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2300), ErrorLabels.E_MAX_EXCEEDED),
+ E_MISSING_INPUT(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2301), ErrorLabels.E_MISSING_INPUT),
+ E_MOBILE_FAILED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2302), ErrorLabels.E_MOBILE_FAILED),
+ E_MODEL_NOT_FOUND(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2303), ErrorLabels.E_MODEL_NOT_FOUND),
+
+ /** --- N --- **/
+ E_NETWORK_FAILED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2400), ErrorLabels.E_NETWORK_FAILED),
+ E_NETWORK_UNAVAILABLE(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2401), ErrorLabels.E_NETWORK_UNAVAILABLE),
+ E_NO_CERTIFICATE(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2402), ErrorLabels.E_NO_CERTIFICATE),
+ E_NOT_A_MEMBER(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2403), ErrorLabels.E_NOT_A_MEMBER),
+ E_NOT_PAIRED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2404), ErrorLabels.E_NOT_PAIRED),
+ E_NOT_RESPONDING(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2405), ErrorLabels.E_NOT_RESPONDING),
+ E_NUM_FORMAT(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2406), ErrorLabels.E_NUM_FORMAT),
+
+ /** --- O --- **/
+ E_OBJ_ALREADY_EXIST(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2500), ErrorLabels.E_OBJ_ALREADY_EXIST),
+ E_OBJ_NOT_FOUND(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2501), ErrorLabels.E_OBJ_NOT_FOUND),
+ E_OBJECT_LOCKED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2502), ErrorLabels.E_OBJECT_LOCKED),
+ E_ON_INITIALIZING(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2503), ErrorLabels.E_ON_INITIALIZING),
+ E_OPERATION_CANCELED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2504), ErrorLabels.E_OPERATION_CANCELED),
+ E_OPERATION_FAILED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2505), ErrorLabels.E_OPERATION_FAILED),
+ E_OUT_OF_MEMORY(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2506), ErrorLabels.E_OUT_OF_MEMORY),
+ E_OUT_OF_RANGE(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2507), ErrorLabels.E_OUT_OF_RANGE),
+ E_OVERFLOW(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2508), ErrorLabels.E_OVERFLOW),
+
+ /** --- P --- **/
+ E_PAIRING_FAILED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2600), ErrorLabels.E_PAIRING_FAILED),
+ E_PARSING_FAILED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2601), ErrorLabels.E_PARSING_FAILED),
+ E_PRIVILEGE_DENIED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2602), ErrorLabels.E_PRIVILEGE_DENIED),
+
+ /** --- Q --- **/
+
+ /** --- R --- **/
+ E_READ_ONLY(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2800), ErrorLabels.E_READ_ONLY),
+ E_REJECTED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2801), ErrorLabels.E_REJECTED),
+ // not used
+ E_REMOTE_DEVICE_NOT_FOUND(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2802), ErrorLabels.E_REMOTE_DEVICE_NOT_FOUND),
+ // not used
+ E_REMOVE_SERVICE_NOT_FOUND(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2803), ErrorLabels.E_REMOVE_SERVICE_NOT_FOUND),
+ E_RESOURCE_UNAVAILABLE(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2804), ErrorLabels.E_RESOURCE_UNAVAILABLE),
+ E_RIGHT_EXPIRED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2805), ErrorLabels.E_RIGHT_EXPIRED),
+
+ /** --- S --- **/
+ E_SECTION_ALREADY_EXIST(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2900), ErrorLabels.E_SECTION_ALREADY_EXIST),
+ E_SECTION_NOT_FOUND(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2901), ErrorLabels.E_SECTION_NOT_FOUND),
+ E_SERVER(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2902), ErrorLabels.E_SERVER),
+ E_SERVICE_BUSY(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2903), ErrorLabels.E_SERVICE_BUSY),
+ E_SERVICE_LIMITED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2904), ErrorLabels.E_SERVICE_LIMITED),
+ E_SERVICE_LOCKED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2905), ErrorLabels.E_SERVICE_LOCKED),
+ E_SERVICE_UNAVAILABLE(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2906), ErrorLabels.E_SERVICE_UNAVAILABLE),
+ E_SESSION_DEACTIVATED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2907), ErrorLabels.E_SESSION_DEACTIVATED),
+ // not used
+ E_SESSION_UNAVAILABLE(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2908), ErrorLabels.E_SESSION_UNAVAILABLE),
+ // not used
+ E_SIZE_MISMATCH(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2909), ErrorLabels.E_SIZE_MISMATCH),
+ E_SOCKET_USER(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2910), ErrorLabels.E_SOCKET_USER),
+ E_STORAGE_FULL(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2911), ErrorLabels.E_STORAGE_FULL),
+ E_SYMBOL_NOT_FOUND(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2912), ErrorLabels.E_SYMBOL_NOT_FOUND),
+ E_SYNTAX(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2913), ErrorLabels.E_SYNTAX),
+ E_SYSTEM(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2914), ErrorLabels.E_SYSTEM),
+ E_SERVICE_DEACTIVATED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(2915), ErrorLabels.E_SERVICE_DEACTIVATED),
+
+ /** --- T --- **/
+ E_TABLE_NOT_FOUND(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(3000), ErrorLabels.E_TABLE_NOT_FOUND),
+ E_TIMEOUT(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(3001), ErrorLabels.E_TIMEOUT),
+ E_TYPE_MISMATCH(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(3002), ErrorLabels.E_TYPE_MISMATCH),
+
+ /** --- U --- **/
+ E_UNDERFLOW(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(3100), ErrorLabels.E_UNDERFLOW),
+ E_UNKNOWN(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(3101), ErrorLabels.E_UNKNOWN),
+ E_UNSUPPORTED_ALGORITHM(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(3102), ErrorLabels.E_UNSUPPORTED_ALGORITHM),
+ E_UNSUPPORTED_CODEC(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(3103), ErrorLabels.E_UNSUPPORTED_CODEC),
+ E_UNSUPPORTED_FAMILY(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(3104), ErrorLabels.E_UNSUPPORTED_FAMILY),
+ E_UNSUPPORTED_FORMAT(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(3105), ErrorLabels.E_UNSUPPORTED_FORMAT),
+ E_UNSUPPORTED_PROTOCOL(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(3106), ErrorLabels.E_UNSUPPORTED_PROTOCOL),
+ E_UNSUPPORTED_OPERATION(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(3107), ErrorLabels.E_UNSUPPORTED_OPERATION),
+ E_UNSUPPORTED_OPTION(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(3108), ErrorLabels.E_UNSUPPORTED_OPTION),
+ E_UNSUPPORTED_SERVICE(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(3109), ErrorLabels.E_UNSUPPORTED_SERVICE),
+ E_UNSUPPORTED_TYPE(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(3110), ErrorLabels.E_UNSUPPORTED_TYPE),
+ E_URL_CHANGED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(3111), ErrorLabels.E_URL_CHANGED),
+ E_USER_AGENT_NOT_ALLOWED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(3112), ErrorLabels.E_USER_AGENT_NOT_ALLOWED),
+ E_USER_ALREADY_REGISTERED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(3113), ErrorLabels.E_USER_ALREADY_REGISTERED),
+ E_USER_NOT_FOUND(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(3114), ErrorLabels.E_USER_NOT_FOUND),
+ E_USER_NOT_REGISTERED(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(3115), ErrorLabels.E_USER_NOT_REGISTERED),
+ E_UNSUPPORTED_LANGUAGE(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(3116), ErrorLabels.E_UNSUPPORTED_LANGUAGE),
+ E_UNSUPPORTED_VERSION(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(3117), ErrorLabels.E_UNSUPPORTED_VERSION),
+ E_UNSUPPORTED_LOCALE(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(3118), ErrorLabels.E_UNSUPPORTED_LOCALE),
+
+ /** --- V --- **/
+
+ /** --- W --- **/
+ E_WOULD_BLOCK(getERR_SRC_FRAMEWORK() + SET_E_CAUSE(3300), ErrorLabels.E_WOULD_BLOCK);
+ /** --- X --- **/
+ /** --- Y --- **/
+ /** --- Z --- **/
+
+ private final long errno;
+ private final String message;
+ private static final int E_SEVERITY_POS = 31;
+ private static final int E_TYPE_POS = 29;
+
+ private DAErrorCode(long errno, String message) {
+ this.errno = errno;
+ this.message = message;
+ }
+
+ public long getErrno() {
+ return errno;
+
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ private static long SET_E_SEVERITY(long x) {
+ return PUT_MASK(0, x, E_SEVERITY_POS);
+ }
+
+ private static long PUT_MASK(long var, long val, long pos) {
+ return ((var) | ((val) << (pos)));
+ }
+
+ private static long SET_E_TYPE(long x) {
+ return PUT_MASK(0, x, E_TYPE_POS);
+ }
+
+ private static long getE_FAILURE()
+ {
+ return SET_E_SEVERITY(1);
+ }
+
+ private static long getERR_SRC_FRAMEWORK()
+ {
+ return SET_E_SEVERITY(1) + SET_E_TYPE(1);
+ }
+
+ private static long SET_E_CAUSE(long x) {
+ return x;
+ }
+}
\ No newline at end of file
--- /dev/null
+/*\r
+ * Dynamic Analyzer\r
+ *\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact: \r
+ * Jooyoul Lee <jy.exe.lee@samsung.com>\r
+ * Juyoung Kim <j0.kim@samsung.com>\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ * \r
+ */\r
+\r
+package org.tizen.dynamicanalyzer.error;\r
+\r
+import java.util.Hashtable;\r
+\r
+public class ErrorCodeManager {\r
+ private static ErrorCodeManager instance = null;\r
+ private Hashtable<Long, DAErrorCode> hash = new Hashtable<Long, DAErrorCode>();\r
+\r
+ public static ErrorCodeManager getInatance() {\r
+ if (instance == null) {\r
+ instance = new ErrorCodeManager();\r
+ }\r
+ return instance;\r
+ }\r
+\r
+ public ErrorCodeManager() {\r
+ initErrorCode();\r
+ }\r
+\r
+ public DAErrorCode getErrorCode(long errno) {\r
+ return hash.get(errno);\r
+ }\r
+\r
+ public String getErrorCode(String strErr) {\r
+ long errno = -1;\r
+ try {\r
+ errno = Long.parseLong(strErr);\r
+ } catch (NumberFormatException e) {\r
+ e.printStackTrace();\r
+ // errno = -1 and returns null\r
+ }\r
+ return hash.get(errno).name();\r
+ }\r
+\r
+ public String getErrorDescription(String strErr) {\r
+ long errno = -1;\r
+ try {\r
+ errno = Long.parseLong(strErr);\r
+ } catch (NumberFormatException e) {\r
+ e.printStackTrace();\r
+ // errno = -1 and returns null\r
+ }\r
+ return hash.get(errno).getMessage();\r
+ }\r
+\r
+ public void initErrorCode() {\r
+ DAErrorCode[] cErrorCodes = DAErrorCode.values();\r
+ int size = cErrorCodes.length;\r
+ for (int i = 0; i < size; i++) {\r
+ hash.put((long) cErrorCodes[i].getErrno(), cErrorCodes[i]);\r
+ }\r
+ }\r
+\r
+}\r
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.handlers;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.swt.widgets.Display;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.logparser.LogInserter;
+import org.tizen.dynamicanalyzer.logparser.LogParser;
+import org.tizen.dynamicanalyzer.sql.SqlManager;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager;
+import org.tizen.dynamicanalyzer.ui.page.BaseView;
+import org.tizen.dynamicanalyzer.ui.toolbar.StopLogProcessor;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.utils.UpdateViewTimer;
+
+public class ClearHandler extends AbstractHandler {
+
+ public final static String ID = ClearHandler.class.getName();
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ UpdateViewTimer.stop();
+ AnalyzerManager.clear();
+ LogParser.clear();
+ LogInserter.clear();
+ CallStackManager.clear();
+ AnalyzerManager.getWarningChecker().clear();
+ StopLogProcessor.clear();
+ SqlManager.getInstance().clear();
+
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ ((BaseView) AnalyzerUtil.getViewPart(BaseView.ID)).clear();
+ ToolbarArea.getInstance().clearTimer();
+ }
+ });
+
+ return null;
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.handlers;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
+import org.tizen.dynamicanalyzer.communicator.IDECommunicator;
+import org.tizen.dynamicanalyzer.logparser.LogInserter;
+import org.tizen.dynamicanalyzer.logparser.LogParser;
+import org.tizen.dynamicanalyzer.ui.toolbar.StopLogProcessor;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.ui.toolbar.opentrace.OpenTraceInputReader;
+import org.tizen.dynamicanalyzer.utils.UpdateViewTimer;
+
+public class ExitHandler extends AbstractHandler {
+
+ public static final String ID = ExitHandler.class.getName();
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ AnalyzerManager.setExit(true);
+ ToolbarArea.getInstance().stopTimer();
+ UpdateViewTimer.stop();
+ LogParser.stopLogParser();
+ StopLogProcessor.stopStopLogProcessThread();
+ IDECommunicator.stopIDEcommunicatorThread();
+ OpenTraceInputReader.stopOpenTraceInputReader();
+ LogInserter.stopInsertLogThread();
+ if (DACommunicator.isDaemonAlive()) {
+ DACommunicator.killDaemon();
+ }
+ DACommunicator.pullDaemonLog();
+ return null;
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.handlers;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.swt.widgets.Display;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.AnalyzerPaths;
+import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+
+public class OpenTraceCompleteHandler extends AbstractHandler {
+ public static String ID = OpenTraceCompleteHandler.class.getName();
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ DAPageComposite page = AnalyzerManager.getCurrentPage();
+ page.updatePage();
+ if (AnalyzerManager.getProject().getSavePath()
+ .contains(AnalyzerPaths.TEMP_FOLDER_PATH)) {
+ ToolbarArea.getInstance().setMainControlEnablement(true);
+ } else {
+ ToolbarArea.getInstance().setSaveButtonEnable(false);
+ }
+ }
+ });
+
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ DAPageComposite page = AnalyzerManager.getCurrentPage();
+ page.updatePage();
+ }
+ });
+ System.out.println("open trace complete!!"); //$NON-NLS-1$
+ return null;
+ }
+
+}
--- /dev/null
+/*\r
+ * Dynamic Analyzer\r
+ *\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact: \r
+ * Jooyoul Lee <jy.exe.lee@samsung.com>\r
+ * Juyoung Kim <j0.kim@samsung.com>\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ * \r
+ */\r
+\r
+package org.tizen.dynamicanalyzer.handlers;\r
+\r
+import java.sql.ResultSet;\r
+import java.sql.SQLException;\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+import java.util.List;\r
+\r
+import org.eclipse.core.commands.AbstractHandler;\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.widgets.Display;\r
+import org.eclipse.swt.widgets.Shell;\r
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;\r
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;\r
+import org.tizen.dynamicanalyzer.common.CommonConstants;\r
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;\r
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;\r
+import org.tizen.dynamicanalyzer.model.ImageInfo;\r
+import org.tizen.dynamicanalyzer.model.LogCenter;\r
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;\r
+import org.tizen.dynamicanalyzer.project.Project;\r
+import org.tizen.dynamicanalyzer.resources.ImageResources;\r
+import org.tizen.dynamicanalyzer.sql.DBTableInfo;\r
+import org.tizen.dynamicanalyzer.sql.DBTableManager;\r
+import org.tizen.dynamicanalyzer.sql.SqlManager;\r
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackData;\r
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager;\r
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit;\r
+import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;\r
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;\r
+import org.tizen.dynamicanalyzer.ui.range.RangePage;\r
+import org.tizen.dynamicanalyzer.ui.summary.failed.FailedChecker;\r
+import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData;\r
+import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakData;\r
+import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakDetector;\r
+import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;\r
+import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfileDataMaker;\r
+import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfilingChildData;\r
+import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfilingData;\r
+import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;\r
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;\r
+import org.tizen.dynamicanalyzer.ui.toolbar.opentrace.OpenTraceProgressManager;\r
+import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;\r
+import org.tizen.dynamicanalyzer.ui.widgets.DADialog;\r
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;\r
+import org.tizen.dynamicanalyzer.widgets.combo.DACustomCombo;\r
+\r
+public class OpenTraceHandler extends AbstractHandler {\r
+\r
+ public static final String ID = OpenTraceHandler.class.getName();\r
+ Project p = null;\r
+\r
+ @Override\r
+ public Object execute(ExecutionEvent event) throws ExecutionException {\r
+\r
+ p = AnalyzerManager.getProject();\r
+ ResultSet rs = SqlManager.getInstance().selectAllFromProject(p);\r
+ if (null == rs) {\r
+ AnalyzerUtil.executeCommand(ClearHandler.ID);\r
+ return null;\r
+ }\r
+ List<String> pInfo = new ArrayList<String>();\r
+ try {\r
+ while (rs.next()) {\r
+ pInfo.add(rs.getString("info")); //$NON-NLS-1$\r
+ }\r
+ rs.close();\r
+ } catch (SQLException e) {\r
+ AnalyzerUtil.executeCommand(ClearHandler.ID);\r
+ e.printStackTrace();\r
+ return null;\r
+ }\r
+\r
+ if (pInfo.isEmpty()) {\r
+ // TODO: message box\r
+ // TODO: valid check\r
+ System.out.println("The trace file is invalid."); //$NON-NLS-1$\r
+ AnalyzerUtil.executeCommand(ClearHandler.ID);\r
+ return null;\r
+ }\r
+ OpenTraceProgressManager.getInstance().openTracePrgressStart(\r
+ AnalyzerLabels.OPEN_TRACE_PROGRESS_LOADING);\r
+ int size = pInfo.size();\r
+ List<String> logCenterNames = new ArrayList<String>();\r
+ for (int i = 0; i < size; i++) {\r
+ if (i == AnalyzerConstants.PROJECT_VERSION_INDEX) {\r
+ if (!AnalyzerConstants.SAVE_DATA_VERSION.equals(pInfo\r
+ .get(AnalyzerConstants.PROJECT_VERSION_INDEX))) {\r
+ System.out.println("The trace file version is invalid."); //$NON-NLS-1$\r
+ OpenTraceProgressManager\r
+ .getInstance()\r
+ .closeOpenTraceDialog(\r
+ AnalyzerLabels.OPEN_TRACE_PROGRESS_VERSION_INVALID);\r
+ createWarningDialog(AnalyzerLabels.OPEN_TRACE_PROGRESS_VERSION_INVALID_REMOVE);\r
+ return null;\r
+ }\r
+ p.setVersion(AnalyzerConstants.SAVE_DATA_VERSION);\r
+ } else if (i == AnalyzerConstants.PROJECT_CREATE_TIME_INDEX) {\r
+ p.setCreateTime(pInfo.get(i));\r
+ } else if (i == AnalyzerConstants.PROJECT_APPNAME_INDEX) {\r
+ p.setAppName(pInfo.get(i));\r
+ } else if (i == AnalyzerConstants.PROJECT_PKG_ID_INDEX) {\r
+ p.setPkgId(pInfo.get(i));\r
+ } else if (i == AnalyzerConstants.PROJECT_STOP_TIME_INDEX) {\r
+ try {\r
+ long stopTime = Long.parseLong(pInfo.get(i));\r
+ p.setStopTime(stopTime);\r
+ } catch (NumberFormatException e) {\r
+ OpenTraceProgressManager.getInstance()\r
+ .closeOpenTraceDialog(\r
+ AnalyzerLabels.OPEN_TRACE_PROGRESS_INVALID);\r
+ createWarningDialog(AnalyzerLabels.OPEN_TRACE_PROGRESS_INVALID_REMOVE);\r
+ AnalyzerUtil.executeCommand(ClearHandler.ID);\r
+ return null;\r
+ }\r
+ } else if (i == AnalyzerConstants.PROJECT_DEVICE_INDEX) {\r
+ p.setDevice(pInfo.get(i));\r
+ } else if (i == AnalyzerConstants.PROJECT_LAST_DATA_INDEX) {\r
+ p.setLastLogNum(pInfo.get(i));\r
+ } else if (i == AnalyzerConstants.PROJECT_LAST_TIME_INDEX) {\r
+ try {\r
+ long lastTime = Long.parseLong(pInfo.get(i));\r
+ p.setLastTime(lastTime);\r
+ } catch (NumberFormatException e) {\r
+ OpenTraceProgressManager.getInstance()\r
+ .closeOpenTraceDialog(\r
+ AnalyzerLabels.OPEN_TRACE_PROGRESS_INVALID);\r
+ createWarningDialog(AnalyzerLabels.OPEN_TRACE_PROGRESS_INVALID_REMOVE);\r
+ AnalyzerUtil.executeCommand(ClearHandler.ID);\r
+ return null;\r
+ }\r
+ } else if (i == AnalyzerConstants.PROJECT_TOTAL_SAMPLE_COUNT) {\r
+ try {\r
+ int totalSampleCount = Integer.parseInt(pInfo.get(i));\r
+ p.setTotalProfilingSampleCount(totalSampleCount);\r
+ } catch (NumberFormatException e) {\r
+ OpenTraceProgressManager.getInstance()\r
+ .closeOpenTraceDialog(\r
+ AnalyzerLabels.OPEN_TRACE_PROGRESS_INVALID);\r
+ createWarningDialog(AnalyzerLabels.OPEN_TRACE_PROGRESS_INVALID_REMOVE);\r
+ AnalyzerUtil.executeCommand(ClearHandler.ID);\r
+ return null;\r
+ }\r
+ } else {\r
+ logCenterNames.add(pInfo.get(i));\r
+ }\r
+ }\r
+\r
+ if (!DACommunicator.isDeviceConnected()) {\r
+ Display.getDefault().syncExec(new Runnable() {\r
+ @Override\r
+ public void run() {\r
+ DACustomCombo deviceCombo = ToolbarArea.getInstance()\r
+ .getDeviceCombo();\r
+ DACustomCombo appCombo = ToolbarArea.getInstance()\r
+ .getAppCombo();\r
+ deviceCombo.setText(AnalyzerManager.getProject()\r
+ .getDevice());\r
+ appCombo.setText(AnalyzerManager.getProject().getAppName());\r
+ deviceCombo.setEnabled(true);\r
+ appCombo.setEnabled(true);\r
+ }\r
+ });\r
+ }\r
+\r
+ int percent = OpenTraceProgressManager.getInstance().getPercent();\r
+ if (p.initLogCenters(logCenterNames) && loadAppInfo(p)\r
+ && loadCallStackData(p) && loadCallStackApis(p)\r
+ && loadProfilingData() && loadProfilingChildData()\r
+ && loadLeakData(p) && loadFailedData() && loadImageSet(p)) {\r
+ OpenTraceProgressManager.getInstance().setProgressPercent(\r
+ AnalyzerLabels.OPEN_TRACE_PROGRESS_LOADING, percent += 60);\r
+ } else {\r
+ OpenTraceProgressManager.getInstance().closeOpenTraceDialog(\r
+ AnalyzerLabels.OPEN_TRACE_PROGRESS_LOADING_FAILED);\r
+ createWarningDialog(AnalyzerLabels.OPEN_TRACE_PROGRESS_INVALID_REMOVE);\r
+ AnalyzerUtil.executeCommand(ClearHandler.ID);\r
+ return null;\r
+ }\r
+\r
+ p.closeConnection();\r
+\r
+ ToolbarArea.getInstance().setTime(p.getLastTime());\r
+ ToolbarArea.getInstance().setAppComboText(p.getAppName());\r
+ ToolbarArea.getInstance().setRepalyButtonEnable(true);\r
+ if (AnalyzerManager.getProject().getBinaryPath().isEmpty()) {\r
+ ToolbarArea.getInstance().setSourceViewEnable(false);\r
+ ToolbarArea.getInstance().setSourceViewTooltip(\r
+ AnalyzerLabels.MESSAGE_PROCESS_PG_WARNING);\r
+ } else {\r
+ ToolbarArea.getInstance().setSourceViewEnable(true);\r
+ ToolbarArea.getInstance().setSourceViewTooltip(\r
+ AnalyzerLabels.MESSAGE_PROCESS_VIEW_SOURCE);\r
+ }\r
+ OpenTraceProgressManager.getInstance().setProgressPercent(\r
+ AnalyzerLabels.OPEN_TRACE_PROGRESS_LOADING, percent += 3);\r
+ /* add each part action.. close... open...etc... */\r
+\r
+ /* resource log view action start */\r
+ List<LogCenter> logCenters = AnalyzerManager.getLogCenters();\r
+ size = logCenters.size();\r
+ for (int i = 0; i < size; i++) {\r
+ LogCenter center = logCenters.get(i);\r
+ int dataSize = SqlManager.getInstance().selectCount(center);\r
+ center.setDataSize(dataSize);\r
+ }\r
+\r
+ if (RangeDataManager.getInstance().isBeingAnalyzed()) {\r
+ DAPageComposite page = AnalyzerManager.getCurrentPage();\r
+ if (page instanceof RangePage) {\r
+ AnalyzerUtil.changePage(TimelinePage.ID);\r
+ }\r
+ }\r
+\r
+ OpenTraceProgressManager.getInstance().runThreads();\r
+ OpenTraceProgressManager.getInstance().openTraceComplete();\r
+\r
+ return null;\r
+ }\r
+\r
+ private boolean loadCallStackData(Project p) {\r
+ ResultSet rs = SqlManager.getInstance()\r
+ .selectAllFromTable(DBTableManager.TABLE_INDEX_CALLSTACK_DATA);\r
+ if (null == rs) {\r
+ return false;\r
+ }\r
+\r
+ try {\r
+ while (rs.next()) {\r
+ int seq = rs.getInt("seq"); //$NON-NLS-1$\r
+ String addrs = rs.getString("callstack"); //$NON-NLS-1$\r
+ if (null == addrs) {\r
+ continue;\r
+ }\r
+ String[] splitAddrs = addrs.split(CommonConstants.SLASH);\r
+ CallStackData csd = new CallStackData(seq);\r
+ List<Long> addrList = csd.getAddrs();\r
+ int size = splitAddrs.length;\r
+ for (int i = 0; i < size; i++) {\r
+ long addr = Long.parseLong(splitAddrs[i]);\r
+ addrList.add(addr);\r
+ }\r
+ CallStackManager.getInstance().getCallStackDataBySeqMap()\r
+ .put(seq, csd);\r
+ }\r
+ rs.close();\r
+ } catch (SQLException e) {\r
+ e.printStackTrace();\r
+ return false;\r
+ }\r
+ return true;\r
+ }\r
+\r
+ private boolean loadCallStackApis(Project p) {\r
+ ResultSet rs = SqlManager.getInstance()\r
+ .selectAllFromTable(DBTableManager.TABLE_INDEX_CALLSTACK_UNITS);\r
+ if (null == rs) {\r
+ return false;\r
+ }\r
+\r
+ HashMap<Long, CallStackUnit> apiHash = CallStackManager.getInstance()\r
+ .getCallStackApiByAddrMap();\r
+ try {\r
+ while (rs.next()) {\r
+ long addr = rs.getLong("addr"); //$NON-NLS-1$\r
+ String api = rs.getString("api"); //$NON-NLS-1$\r
+ CallStackUnit csa = new CallStackUnit(addr, api);\r
+ apiHash.put(addr, csa);\r
+ }\r
+ rs.close();\r
+ } catch (SQLException e) {\r
+ e.printStackTrace();\r
+ return false;\r
+ }\r
+ return true;\r
+ }\r
+\r
+ private boolean loadAppInfo(Project p) {\r
+ ResultSet rs = SqlManager.getInstance()\r
+ .selectAllFromTable(DBTableManager.TABLE_INDEX_APP_INFO);\r
+ if (null == rs) {\r
+ return false;\r
+ }\r
+\r
+ List<String> info = p.getAppInfo();\r
+ try {\r
+ int index = 0;\r
+ while (rs.next()) {\r
+ info.set(index++, rs.getString("info")); //$NON-NLS-1$\r
+ }\r
+ rs.close();\r
+ } catch (SQLException e) {\r
+ e.printStackTrace();\r
+ return false;\r
+ }\r
+ return true;\r
+ }\r
+\r
+ private boolean loadImageSet(Project p) {\r
+ String query = "select SeqNumber, Time from screenshot;";//$NON-NLS-1$\r
+ List<List<String>> input = SqlManager.getInstance().executeSelectQueryFD(query, 2);\r
+ if (null == input) {\r
+ return false;\r
+ }\r
+\r
+ int size = input.size();\r
+\r
+ for (int i = 0; i < size; i++) {\r
+ List<String> imgLog = input.get(i);\r
+ String seq = imgLog.get(0);\r
+ String time = imgLog.get(1);\r
+ ImageInfo imgInfo = new ImageInfo();\r
+ imgInfo.setSeq(seq);\r
+ imgInfo.setTime(time);\r
+ AnalyzerManager.getImageSet().put(seq, imgInfo);\r
+ }\r
+ return true;\r
+ }\r
+\r
+ private boolean loadLeakData(Project p) {\r
+ ResultSet rs = SqlManager.getInstance()\r
+ .selectAllFromTable(DBTableManager.TABLE_INDEX_LEAK_DATA);\r
+ LeakDetector leakDectector = AnalyzerManager.getLeakDetector();\r
+ if (null == rs || leakDectector == null) {\r
+ return false;\r
+ }\r
+\r
+ int size = DBTableManager.commonColumns.length;\r
+\r
+ try {\r
+ while (rs.next()) {\r
+ List<String> data = new ArrayList<String>();\r
+ for (int i = 1; i <= size; i++) {\r
+ data.add(rs.getString(i));\r
+ }\r
+ LeakData leakData = new LeakData(data);\r
+ if (null != leakData.getParentKey()\r
+ && !leakData.getParentKey().isEmpty()) {\r
+ LeakData parent = leakDectector.getLeakHash().get(\r
+ leakData.getParentKey());\r
+ if (null == parent) {\r
+ continue;\r
+ } else {\r
+ parent.getChildren().add(leakData);\r
+ }\r
+ } else {\r
+ leakDectector.getLeakHash()\r
+ .put(leakData.getKey(), leakData);\r
+ }\r
+ }\r
+ rs.close();\r
+ } catch (SQLException e) {\r
+ e.printStackTrace();\r
+ return false;\r
+ }\r
+ return true;\r
+ }\r
+\r
+ private boolean loadFailedData() {\r
+ ResultSet rs = SqlManager.getInstance()\r
+ .selectAllFromTable(DBTableManager.TABLE_INDEX_FAILED_DATA);\r
+ FailedChecker failedChecker = AnalyzerManager.getFailedChecker();\r
+ if (null == rs || failedChecker == null) {\r
+ return false;\r
+ }\r
+\r
+ int size = DBTableManager.commonColumns.length;\r
+\r
+ try {\r
+ while (rs.next()) {\r
+ List<String> data = new ArrayList<String>();\r
+ for (int i = 1; i <= size; i++) {\r
+ data.add(rs.getString(i));\r
+ }\r
+ // possibility of extensions - network, efl, db, etc...\r
+ int id = Integer\r
+ .parseInt(data.get(LogCenterConstants.ID_INDEX));\r
+ if (id == LogCenterConstants.LOG_RESOURCE) {\r
+ // if file failed api data is skip - file chart make it!\r
+ int type = Integer.parseInt(data\r
+ .get(LogCenterConstants.RESOURCE_FDTYPE_INDEX));\r
+ if (type == LogCenterConstants.FD_TYPE_FILE) {\r
+ continue;\r
+ }\r
+ }\r
+ FailedData failedData = new FailedData(data);\r
+ failedChecker.getFailedList().add(failedData);\r
+ }\r
+ rs.close();\r
+ } catch (SQLException e) {\r
+ e.printStackTrace();\r
+ return false;\r
+ }\r
+ return true;\r
+ }\r
+\r
+ private boolean loadProfilingData() {\r
+ DBTableInfo profilingData = DBTableManager.getInstance().getTableInfo(\r
+ DBTableManager.TABLE_INDEX_PROFILING_DATA);\r
+ ResultSet rs = SqlManager.getInstance()\r
+ .selectAllFromTable(DBTableManager.TABLE_INDEX_PROFILING_DATA);\r
+ ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()\r
+ .getProfileDataMaker();\r
+ if (null == rs || profiler == null) {\r
+ return false;\r
+ }\r
+\r
+ int size = profilingData.getColumnNames().length;\r
+\r
+ try {\r
+ while (rs.next()) {\r
+ List<String> data = new ArrayList<String>();\r
+ for (int i = 1; i <= size; i++) {\r
+ data.add(rs.getString(i));\r
+ }\r
+ // possibility of extensions - network, efl, db, etc...\r
+ ProfilingData fupData = new ProfilingData(data, profiler);\r
+ String seq = data.get(ProfilingData.SEQUENCE_INDEX);\r
+ profiler.getProfilingDataMap().put(seq, fupData);\r
+ String symbol = data.get(ProfilingData.KEY_INDEX);\r
+ FunctionUsageProfiler.getSymbolSeqHash().put(symbol, seq);\r
+ UIDataManager.getInstance().getfunctionProfilingDataChecker()\r
+ .addProfilingData(fupData);\r
+ }\r
+ rs.close();\r
+ } catch (SQLException e) {\r
+ e.printStackTrace();\r
+ return false;\r
+ }\r
+\r
+ ProfilingData ab = profiler\r
+ .getProfilingDataByKey(FunctionUsageProfiler.APPLICATION_KEY);\r
+ profiler.setAppBin(ab);\r
+ ProfilingData dl = profiler\r
+ .getProfilingDataByKey(FunctionUsageProfiler.DEPENDENT_LIB_KEY);\r
+ profiler.setDependentLib(dl);\r
+ return true;\r
+ }\r
+\r
+ private boolean loadProfilingChildData() {\r
+ DBTableInfo profilingChildData = DBTableManager.getInstance()\r
+ .getTableInfo(DBTableManager.TABLE_INDEX_PROFILING_CHILD_DATA);\r
+ ResultSet rs = SqlManager.getInstance()\r
+ .selectAllFromTable(DBTableManager.TABLE_INDEX_PROFILING_CHILD_DATA);\r
+ ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()\r
+ .getProfileDataMaker();\r
+ if (null == rs || profiler == null) {\r
+ return false;\r
+ }\r
+\r
+ int size = profilingChildData.getColumnNames().length;\r
+\r
+ try {\r
+ while (rs.next()) {\r
+ List<String> data = new ArrayList<String>();\r
+ for (int i = 1; i <= size; i++) {\r
+ data.add(rs.getString(i));\r
+ }\r
+\r
+ if (data.size() < 2) {\r
+ continue;\r
+ }\r
+\r
+ String seqs = data.get(1);\r
+ String[] splitSeqs = seqs.split(CommonConstants.SLASH);\r
+ List<String> childData = new ArrayList<String>();\r
+ for (int ii = 0; ii < splitSeqs.length; ii++) {\r
+ childData.add(new String(splitSeqs[ii]));\r
+ }\r
+ ProfilingData parent = profiler.getProfilingDataMap().get(\r
+ data.get(0));\r
+ ProfilingChildData child = parent.getChildData();\r
+ child.getChildren().addAll(childData);\r
+ profiler.getChildListMap().put(data.get(0), child);\r
+ }\r
+ rs.close();\r
+ } catch (SQLException e) {\r
+ e.printStackTrace();\r
+ return false;\r
+ }\r
+ return true;\r
+ }\r
+\r
+ private void createWarningDialog(String message) {\r
+ final Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();\r
+ final DADialog dialog = new DADialog(shell, SWT.NONE);\r
+ dialog.setIcon(ImageResources.DIALOG_WARNING_ICON);\r
+ dialog.setMessage(message);\r
+ Display.getDefault().syncExec(new Runnable() {\r
+ @Override\r
+ public void run() {\r
+ dialog.open();\r
+ }\r
+ });\r
+ }\r
+}\r
--- /dev/null
+/*\r
+ * Dynamic Analyzer\r
+ *\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact: \r
+ * Jooyoul Lee <jy.exe.lee@samsung.com>\r
+ * Juyoung Kim <j0.kim@samsung.com>\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ * \r
+ */\r
+\r
+package org.tizen.dynamicanalyzer.handlers;\r
+\r
+import org.eclipse.core.commands.AbstractHandler;\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+import org.eclipse.ui.IWorkbench;\r
+import org.eclipse.ui.PlatformUI;\r
+import org.eclipse.ui.WorkbenchException;\r
+\r
+public class RealtimePerspectiveHandler extends AbstractHandler {\r
+\r
+ public static final String ID = RealtimePerspectiveHandler.class.getName();\r
+ public static final String PERSPECTIVE_ID = "org.tizen.dynamicanalyzer.workbench.perspective.DAMainPerspective"; //$NON-NLS-1$\r
+\r
+ @Override\r
+ public Object execute(ExecutionEvent event) throws ExecutionException {\r
+ IWorkbench workbench = PlatformUI.getWorkbench();\r
+ try {\r
+ workbench.showPerspective(PERSPECTIVE_ID,\r
+ workbench.getActiveWorkbenchWindow());\r
+ } catch (WorkbenchException e) {\r
+ e.printStackTrace();\r
+ }\r
+\r
+ return null;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Gun Kim <gune.kim@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.handlers;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.uirecorder.UIRecorderTool;
+import org.tizen.dynamicanalyzer.widgets.timer.IAlarm;
+import org.tizen.dynamicanalyzer.widgets.timer.TimerClock;
+
+public class ReplayTraceHandler extends AbstractHandler {
+
+ public static final String ID = ReplayTraceHandler.class.getName();
+ public static Integer FAILED = 1;
+ public static boolean isReplay = false;
+ public static long stopTime = -1;
+ public static String RECORD_DATA_FILE_NAME = "/uirecorder.xml"; //$NON-NLS-1$
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ UIRecorderTool recorderMng = UIRecorderTool.getInstance();
+ String xmlFileName = AnalyzerManager.getProject().getSavePath()
+ + RECORD_DATA_FILE_NAME;
+
+ if (xmlFileName == null || xmlFileName.isEmpty()) {
+ return FAILED;
+ } else {
+ recorderMng.setXmlPath(xmlFileName);
+ recorderMng.setReplayFlag(true);
+ isReplay = true;
+ stopTime = AnalyzerManager.getProject().getStopTime();
+ }
+ return null;
+ }
+
+ public static void setStopAlarm() {
+ TimerClock timer = ToolbarArea.getInstance().getTimer();
+ timer.setAlarm(stopTime, new IAlarm() {
+
+ @Override
+ public void action() {
+ ToolbarArea.getInstance().stopTrace();
+ isReplay = false;
+ stopTime = -1;
+ }
+ });
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.handlers;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.swt.widgets.Display;
+import org.tizen.dynamicanalyzer.nl.SummaryLabels;
+import org.tizen.dynamicanalyzer.ui.info.snapshot.SnapshotView;
+import org.tizen.dynamicanalyzer.ui.summary.SummaryPage;
+import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakView;
+import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
+import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+
+public class StartHandler extends AbstractHandler {
+
+ public final static String ID = StartHandler.class.getName();
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ DATabComposite timelineTabComp = (DATabComposite) AnalyzerUtil
+ .getView(TimelinePage.ID, DATabComposite.ID);
+ SnapshotView snapshotView = (SnapshotView) timelineTabComp
+ .getTab(SnapshotView.ID);
+ snapshotView.setLatestButtonEnable(false);
+
+ LeakView leakView = (LeakView) AnalyzerUtil.getView(
+ SummaryPage.ID, LeakView.ID);
+ leakView.setViewTitle(SummaryLabels.LEAK_VIEW_TITLE_LEAK_CANDIDATE);
+ }
+ });
+ return null;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.handlers;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.swt.widgets.Display;
+import org.tizen.dynamicanalyzer.nl.SummaryLabels;
+import org.tizen.dynamicanalyzer.ui.info.snapshot.SnapshotView;
+import org.tizen.dynamicanalyzer.ui.summary.SummaryPage;
+import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakView;
+import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
+import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+
+public class StopHandler extends AbstractHandler {
+
+ public final static String ID = StopHandler.class.getName();
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ DATabComposite timelineTabComp = (DATabComposite) AnalyzerUtil
+ .getView(TimelinePage.ID, DATabComposite.ID);
+ SnapshotView snapshotView = (SnapshotView) timelineTabComp
+ .getTab(SnapshotView.ID);
+ snapshotView.setLatestButtonEnable(false);
+
+ LeakView leakView = (LeakView) AnalyzerUtil.getView(
+ SummaryPage.ID, LeakView.ID);
+ leakView.setViewTitle(SummaryLabels.LEAK_VIEW_TITLE_LEAK);
+ }
+ });
+ return null;
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.listeners;
+
+import org.eclipse.ui.IPartListener2;
+import org.eclipse.ui.IWorkbenchPartReference;
+
+public class AnalyzerPartListener implements IPartListener2 {
+
+ @Override
+ public void partActivated(IWorkbenchPartReference partRef) {
+ }
+
+ @Override
+ public void partBroughtToTop(IWorkbenchPartReference partRef) {
+ }
+
+ @Override
+ public void partClosed(IWorkbenchPartReference partRef) {
+ }
+
+ @Override
+ public void partDeactivated(IWorkbenchPartReference partRef) {
+ }
+
+ @Override
+ public void partOpened(IWorkbenchPartReference partRef) {
+ }
+
+ @Override
+ public void partHidden(IWorkbenchPartReference partRef) {
+ }
+
+ @Override
+ public void partVisible(IWorkbenchPartReference partRef) {
+
+ }
+
+ @Override
+ public void partInputChanged(IWorkbenchPartReference partRef) {
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.listeners;
+
+import org.eclipse.ui.IPerspectiveDescriptor;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PerspectiveAdapter;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+
+public class AnalyzerPerspectiveListener extends PerspectiveAdapter {
+
+ @Override
+ public void perspectiveActivated(IWorkbenchPage page,
+ IPerspectiveDescriptor perspective) {
+
+ ToolbarArea.getInstance().initToolbarEnablement();
+ DACommunicator.init();
+
+ DACommunicator.addDeviceListener();
+ DACommunicator.loadDevices();
+ DACommunicator.checkDevices();
+
+ }
+
+ @Override
+ public void perspectiveDeactivated(IWorkbenchPage page,
+ IPerspectiveDescriptor perspective) {
+ DACommunicator.removeDeviceListener();
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.listeners;
+
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.graphics.Point;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.ui.file.FilePage;
+import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
+import org.tizen.dynamicanalyzer.ui.thread.ThreadPage;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIPage;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+
+public class SummaryMouseDoubleClickListener implements MouseListener {
+
+ boolean doubleClicked = false;
+ List<String> data = null;
+ String pageId = null;
+
+ @Override
+ public void mouseUp(MouseEvent e) {
+ if (doubleClicked) {
+ doubleClicked = false;
+ if (null != pageId && null != data) {
+ AnalyzerUtil.changePage(pageId);
+ DAPageComposite page = (DAPageComposite) AnalyzerUtil
+ .getTabPage(pageId);
+ page.setSelection(data);
+ }
+ }
+ }
+
+ @Override
+ public void mouseDown(MouseEvent e) {
+ }
+
+ @Override
+ public void mouseDoubleClick(MouseEvent e) {
+ // swt.button1 = left click
+ // swt.button3 = rightn click
+ if (ToolbarArea.getInstance().isSourceViewEnabled()
+ || !(e.widget instanceof Grid)) {
+ return;
+ }
+ Grid grid = (Grid) e.widget;
+ GridItem item = grid.getItem(new Point(e.x, e.y));
+ if (null == item) {
+ return;
+ }
+ DATableDataFormat tableData = (DATableDataFormat) item.getData();
+ data = tableData.getData();
+ String logId = data.get(LogCenterConstants.ID_INDEX);
+ int id = Integer.parseInt(logId);
+ if (id == LogCenterConstants.LOG_RESOURCE) {
+ // String fdType =
+ // data.get(LogCenterConstants.RESOURCE_FDTYPE_INDEX);
+ // int type = Integer.parseInt(fdType);
+ // if (type == LogCenterConstants.FD_TYPE_FILE) {
+ pageId = FilePage.ID;
+ // }
+ // else {
+ // TODO: pageId = NetworkPage.ID;
+ // }
+ } else if (id == LogCenterConstants.LOG_THREAD) {
+ pageId = ThreadPage.ID;
+ } else if (id == LogCenterConstants.LOG_CONTROL) {
+ pageId = UIPage.ID;
+ } else {
+ return;
+ }
+
+ doubleClicked = true;
+ }
+
+}
--- /dev/null
+/*\r
+ * Dynamic Analyzer\r
+ *\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact: \r
+ * Jooyoul Lee <jy.exe.lee@samsung.com>\r
+ * Juyoung Kim <j0.kim@samsung.com>\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ * \r
+ */\r
+package org.tizen.dynamicanalyzer.listeners;\r
+\r
+import java.io.BufferedReader;\r
+import java.io.FileNotFoundException;\r
+import java.io.FileReader;\r
+import java.io.IOException;\r
+import java.util.List;\r
+\r
+import org.eclipse.nebula.widgets.grid.Grid;\r
+import org.eclipse.nebula.widgets.grid.GridItem;\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.graphics.Cursor;\r
+import org.eclipse.swt.graphics.Point;\r
+import org.eclipse.swt.graphics.Rectangle;\r
+import org.eclipse.swt.layout.GridLayout;\r
+import org.eclipse.swt.widgets.Display;\r
+import org.eclipse.swt.widgets.Event;\r
+import org.eclipse.swt.widgets.Label;\r
+import org.eclipse.swt.widgets.Listener;\r
+import org.eclipse.swt.widgets.Shell;\r
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;\r
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;\r
+import org.tizen.dynamicanalyzer.common.CommonConstants;\r
+import org.tizen.dynamicanalyzer.common.SymbolManager;\r
+import org.tizen.dynamicanalyzer.common.SymbolManager.SourceLine;\r
+import org.tizen.dynamicanalyzer.communicator.IDECommunicator;\r
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;\r
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;\r
+import org.tizen.dynamicanalyzer.resources.ColorResources;\r
+import org.tizen.dynamicanalyzer.resources.FontResources;\r
+import org.tizen.dynamicanalyzer.resources.ImageResources;\r
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager;\r
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;\r
+import org.tizen.dynamicanalyzer.ui.widgets.DADialog;\r
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;\r
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;\r
+\r
+public class TableTooltipListener implements Listener {\r
+\r
+ private Grid grid = null;\r
+ private Shell tooltip;\r
+ private Object oldItem;\r
+ private boolean enabled = true;\r
+\r
+ private static final int MARGIN = 5;\r
+ private static final int SPACING = 0;\r
+ private static final int SOURCE_LINE_TOP = 5;\r
+ private static final int SOURCE_LINE_BOTTOM = 11;\r
+ private static final int TOOLTIP_OFFSET = 5;\r
+ private static final Cursor sourceCursor = new Cursor(null,\r
+ ImageResources.VIEW_SOURCE_CURSOR.getImageData(), 0, 0);\r
+ private static Cursor defaultCursor = null;\r
+\r
+ public TableTooltipListener(Grid table) {\r
+ this.grid = table;\r
+ defaultCursor = grid.getCursor();\r
+ }\r
+\r
+ public void handleEvent(Event event) {\r
+ if (!ToolbarArea.getInstance().getSourceViewEnable()) {\r
+ return;\r
+ }\r
+\r
+ int columnHeight = grid.getHeaderHeight();\r
+ boolean isHeader = false;\r
+ if (event.y < columnHeight) {\r
+ isHeader = true;\r
+ }\r
+\r
+ boolean isToggled = ToolbarArea.getInstance().isSourceViewEnabled();\r
+ if (enabled && !isHeader) {\r
+ setViewCursor(isToggled);\r
+ }\r
+\r
+ GridItem gridItem = null;\r
+ switch (event.type) {\r
+ case SWT.Dispose:\r
+ disposeTooltip();\r
+ break;\r
+ case SWT.KeyDown:\r
+ break;\r
+ case SWT.KeyUp:\r
+ if (SWT.F2 == event.keyCode) {\r
+ isToggled = !isToggled;\r
+ if (enabled && !isHeader) {\r
+ setViewCursor(isToggled);\r
+ }\r
+ ToolbarArea.getInstance().setSourceViewState(isToggled);\r
+ }\r
+ break;\r
+ case SWT.MouseEnter:\r
+ grid.setFocus();\r
+ if (isToggled && enabled) {\r
+ createTooltip(event);\r
+ }\r
+ break;\r
+ case SWT.MouseExit:\r
+ disposeTooltip();\r
+ break;\r
+ case SWT.MouseMove:\r
+ gridItem = grid.getItem(new Point(event.x, event.y));\r
+ if (null == oldItem) {\r
+ oldItem = gridItem;\r
+ }\r
+ if (null != tooltip) {\r
+ if (null != gridItem) {\r
+ if (!gridItem.equals((GridItem) oldItem)) {\r
+ oldItem = gridItem;\r
+ } else {\r
+ return;\r
+ }\r
+ }\r
+ tooltip.dispose();\r
+ tooltip = null;\r
+ }\r
+ break;\r
+ case SWT.MouseDoubleClick:\r
+ if (isToggled && enabled) {\r
+ openIDE(event);\r
+ }\r
+ break;\r
+ case SWT.MouseHover:\r
+ grid.setFocus();\r
+ if (isToggled && enabled) {\r
+ createTooltip(event);\r
+ }\r
+ break;\r
+ default:\r
+ break;\r
+ }\r
+ }\r
+\r
+ public void setEnable(boolean enabled) {\r
+ this.enabled = enabled;\r
+ }\r
+\r
+ private void setViewCursor(boolean toggled) {\r
+ if (!toggled) {\r
+ grid.setCursor(defaultCursor);\r
+ disposeTooltip();\r
+ } else {\r
+ grid.setCursor(sourceCursor);\r
+ }\r
+ }\r
+\r
+ private void createErrorPopup(String message) {\r
+ Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();\r
+ DADialog warning = new DADialog(shell, SWT.NONE);\r
+ warning.setMessage(message);\r
+ warning.setIcon(ImageResources.DIALOG_WARNING_ICON);\r
+ warning.open();\r
+ }\r
+\r
+ private void createErrorTooltip(Event event, int errno) {\r
+ // Creates tooltip.\r
+ Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();\r
+ tooltip = new Shell(shell, SWT.ON_TOP | SWT.NO_FOCUS | SWT.TOOL);\r
+ tooltip.setBackground(ColorResources.TOOLTIP);\r
+ GridLayout gridLayout = new GridLayout();\r
+ gridLayout.marginTop = MARGIN;\r
+ gridLayout.marginBottom = MARGIN;\r
+ gridLayout.marginLeft = MARGIN;\r
+ gridLayout.marginRight = MARGIN;\r
+ gridLayout.verticalSpacing = SPACING;\r
+ tooltip.setLayout(gridLayout);\r
+\r
+ // Creates tooltip title label.\r
+ Label title = new Label(tooltip, SWT.NONE);\r
+ title.setForeground(ColorResources.BLACK);\r
+ title.setBackground(ColorResources.TOOLTIP);\r
+ String text = AnalyzerConstants.sourcelineErrorMsg[errno];\r
+ title.setText(text);\r
+\r
+ tooltipShow(event.x, event.y);\r
+ }\r
+\r
+ private void createTooltip(Event event) {\r
+ GridItem item = grid.getItem(new Point(event.x, event.y));\r
+ if (null != item) {\r
+ disposeTooltip();\r
+\r
+ // Gets source path and line.\r
+ SourceLine sl = getSourceLine(item);\r
+ if (null == sl\r
+ || sl.getError() != AnalyzerConstants.SOURCELINE_NOERROR) {\r
+ createErrorTooltip(event, sl.getError());\r
+ return;\r
+ }\r
+\r
+ // Creates tooltip.\r
+ Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();\r
+ tooltip = new Shell(shell, SWT.ON_TOP | SWT.NO_FOCUS | SWT.TOOL);\r
+ tooltip.setBackground(ColorResources.TOOLTIP);\r
+ GridLayout gridLayout = new GridLayout();\r
+ gridLayout.marginTop = MARGIN;\r
+ gridLayout.marginBottom = MARGIN;\r
+ gridLayout.marginLeft = MARGIN;\r
+ gridLayout.marginRight = MARGIN;\r
+ gridLayout.verticalSpacing = SPACING;\r
+ tooltip.setLayout(gridLayout);\r
+\r
+ // Creates tooltip title label.\r
+ Label title = new Label(tooltip, SWT.NONE);\r
+ title.setFont(FontResources.TOOLTIP);\r
+ title.setForeground(ColorResources.BLACK);\r
+ title.setBackground(ColorResources.TOOLTIP);\r
+\r
+ // Sets tooltip title text.\r
+ String filePath = sl.getFilePath();\r
+ int line = sl.getLineNumber();\r
+ title.setText(filePath + CommonConstants.SPACE\r
+ + CommonConstants.SPACE + CommonConstants.NEW_LINE);\r
+\r
+ // Creates tooltip label.\r
+ Label top = new Label(tooltip, SWT.NONE);\r
+ top.setForeground(ColorResources.BLACK);\r
+ top.setBackground(ColorResources.TOOLTIP);\r
+\r
+ Label center = new Label(tooltip, SWT.NONE);\r
+ center.setForeground(ColorResources.RED);\r
+ center.setBackground(ColorResources.TOOLTIP);\r
+\r
+ Label bottom = new Label(tooltip, SWT.NONE);\r
+ bottom.setForeground(ColorResources.BLACK);\r
+ bottom.setBackground(ColorResources.TOOLTIP);\r
+\r
+ // Makes tooltip text.\r
+ BufferedReader reader = null;\r
+ StringBuilder topStr = new StringBuilder(CommonConstants.EMPTY);\r
+ StringBuilder centerStr = new StringBuilder(CommonConstants.EMPTY);\r
+ StringBuilder bottomStr = new StringBuilder(CommonConstants.EMPTY);\r
+ try {\r
+ reader = new BufferedReader(new FileReader(filePath));\r
+ int topStart = line - SOURCE_LINE_TOP;\r
+ if (0 > topStart - 1) {\r
+ topStart = 1;\r
+ }\r
+ int topEnd = line;\r
+ int bottomStart = line + 1;\r
+ int bottomEnd = line + SOURCE_LINE_BOTTOM;\r
+\r
+ for (int i = 0; i < topStart - 1; i++) {\r
+ reader.readLine();\r
+ }\r
+\r
+ String temp = null;\r
+ for (int i = topStart; i < topEnd; i++) {\r
+ if (null != (temp = reader.readLine())) {\r
+ topStr.append(i + CommonConstants.TAB + temp);\r
+ } else {\r
+ break;\r
+ }\r
+ if (i != topEnd - 1) {\r
+ topStr.append(CommonConstants.NEW_LINE);\r
+ }\r
+ }\r
+\r
+ if (null != (temp = reader.readLine())) {\r
+ centerStr.append(line + CommonConstants.TAB + temp);\r
+ }\r
+\r
+ for (int i = bottomStart; i < bottomEnd; i++) {\r
+ if (null != (temp = reader.readLine())) {\r
+ bottomStr.append(i + CommonConstants.TAB + temp);\r
+ } else {\r
+ break;\r
+ }\r
+ if (i != bottomEnd - 1) {\r
+ bottomStr.append(CommonConstants.NEW_LINE);\r
+ }\r
+ }\r
+ } catch (FileNotFoundException e) {\r
+ e.printStackTrace();\r
+ createErrorTooltip(event,\r
+ AnalyzerConstants.SOURCE_FILE_NOT_FOUND);\r
+ } catch (IOException e) {\r
+ e.printStackTrace();\r
+ } finally {\r
+ AnalyzerUtil.tryClose(reader);\r
+ }\r
+\r
+ // Sets tooltip text.\r
+ top.setText(topStr.toString());\r
+ center.setText(centerStr.toString());\r
+ bottom.setText(bottomStr.toString());\r
+\r
+ tooltipShow(event.x, event.y);\r
+ }\r
+ }\r
+\r
+ private void tooltipShow(int x, int y) {\r
+ Point size = tooltip.computeSize(SWT.DEFAULT, SWT.DEFAULT);\r
+ Point pt = grid.toDisplay(x, y);\r
+ Rectangle displayRect = Display.getCurrent().getBounds();\r
+ // 1. right side check!\r
+ pt.x = ((pt.x + size.x) > displayRect.width) ? pt.x - size.x\r
+ - TOOLTIP_OFFSET : pt.x + TOOLTIP_OFFSET;\r
+ // 2. bottom check!\r
+ pt.y = ((pt.y + size.y) > displayRect.height) ? pt.y - size.y\r
+ - TOOLTIP_OFFSET : pt.y + TOOLTIP_OFFSET;\r
+ tooltip.setBounds(pt.x, pt.y, size.x, size.y);\r
+ tooltip.setVisible(true);\r
+ }\r
+\r
+ private void disposeTooltip() {\r
+ if (null != tooltip && !tooltip.isDisposed()) {\r
+ tooltip.dispose();\r
+ tooltip = null;\r
+ }\r
+ }\r
+\r
+ private SourceLine getSourceLine(GridItem item) {\r
+ // Gets source path and line.\r
+ DATableDataFormat tableData = (DATableDataFormat) item.getData();\r
+ List<String> data = tableData.getData();\r
+ String addr = null;\r
+ int id = Integer.parseInt(data.get(LogCenterConstants.ID_INDEX));\r
+ if (id == LogCenterConstants.LOG_USER_FUNCTION) {\r
+ addr = data.get(LogCenterConstants.CALLER_PCADDR_INDEX);\r
+ } else if (id == LogCenterConstants.TYPE_CALLSTACK) {\r
+ addr = (String) tableData.getObject();\r
+ } else {\r
+ String seq = data.get(LogCenterConstants.SEQUENCE_NUMBER_INDEX);\r
+ if (seq == null || seq.isEmpty()) {\r
+ SourceLine sl = new SourceLine();\r
+ sl.setError(AnalyzerConstants.SOURCELINE_NO_SOURCELINE_DATA);\r
+ return sl;\r
+ }\r
+ int seqNum = -1;\r
+ try {\r
+ seqNum = Integer.parseInt(seq);\r
+ } catch (NumberFormatException e) {\r
+ seq = data.get(LogCenterConstants.SEQUENCE_NUMBER_INDEX);\r
+ try {\r
+ seqNum = Integer.parseInt(seq);\r
+ } catch (NumberFormatException e2) {\r
+ // not supported action\r
+ SourceLine sl = new SourceLine();\r
+ sl.setError(AnalyzerConstants.SOURCELINE_NO_SOURCELINE_DATA);\r
+ return sl;\r
+ }\r
+ }\r
+ if (seqNum < 0) {\r
+ SourceLine sl = new SourceLine();\r
+ sl.setError(AnalyzerConstants.SOURCELINE_NO_SOURCELINE_DATA);\r
+ return sl;\r
+ }\r
+ addr = CallStackManager.getInstance().getPCAddrBySeq(seqNum);\r
+ }\r
+ boolean isPieBuild = AnalyzerManager.getProject().isPieBuild();\r
+ String baseAddr = AnalyzerManager.getProject().getBaseAddress();\r
+ String path = AnalyzerManager.getProject().getBinaryPath();\r
+ SourceLine sl = SymbolManager.addr2line(path, addr, isPieBuild,\r
+ baseAddr);\r
+ return sl;\r
+ }\r
+\r
+ private void openIDE(Event event) {\r
+\r
+ SourceLine sl = null;\r
+\r
+ GridItem item = grid.getItem(new Point(event.x, event.y));\r
+ if (null == item) {\r
+ return;\r
+ }\r
+ sl = getSourceLine(item);\r
+\r
+ if ((null == sl) || (!sl.isValid())\r
+ || (IDECommunicator.isConnected() == false)) {\r
+ createErrorPopup(AnalyzerLabels.SOURCE_NOT_EXIST);\r
+ return;\r
+ }\r
+\r
+ IDECommunicator.sendCodeInfoToIDE(sl.getFilePath(),\r
+ Integer.toString(sl.getLineNumber()));\r
+ }\r
+\r
+}\r
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.logparser;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class InsertLogQueue {
+ private static final int FULL_COUNT = 10000;
+ List<LogPackage> logs = null;
+
+ private List<LogPackage> getLogs() {
+ if (null == logs) {
+ logs = new ArrayList<LogPackage>();
+ }
+ return logs;
+ }
+
+ public synchronized LogPackage getFirstLog() {
+ while (isEmpty()) {
+ if (LogParser.isLogParsingComplete()) {
+ return null;
+ }
+ try {
+ wait();
+ } catch (InterruptedException e) {
+ System.out.println("insert log queue interrupt called!!"); //$NON-NLS-1$
+ continue;
+ }
+ }
+
+ LogPackage output = logs.get(0);
+ logs.remove(0);
+ notifyAll();
+ return output;
+ }
+
+ public synchronized void push(LogPackage input) {
+ while (isFull()) {
+ try {
+ wait();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ break;
+ }
+ }
+ getLogs().add(input);
+ notifyAll();
+ }
+
+ public boolean isEmpty() {
+ return getLogs().isEmpty();
+ }
+
+ private boolean isFull() {
+ if (size() > FULL_COUNT) {
+ return true;
+ }
+ return false;
+ }
+
+ public int size() {
+ return getLogs().size();
+ }
+
+ public void clear() {
+ getLogs().clear();
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.logparser;
+
+public class LogCenterConstants {
+
+ /* probe IDs */
+ public static final int LOG_MEMORY = 1;
+ public static final int LOG_CONTROL = 2;
+ public static final int LOG_RECODER = 3;
+ public static final int LOG_USER_FUNCTION = 4;
+ public static final int LOG_RESOURCE = 5;
+ public static final int LOG_LIFECYCLE = 6;
+ public static final int LOG_SCREENSHOT = 7;
+ public static final int LOG_SCENE = 8;
+ public static final int LOG_DEVICE = 9;
+ public static final int LOG_PROFILING = 11;
+ public static final int LOG_THREAD = 12;
+ public static final int LOG_CUSTOM_CHART = 13;
+ public static final int LOG_SYNC = 14;
+
+ public static final int TYPE_CALLSTACK = 99;
+
+ /* log common index */
+ public static final int ID_INDEX = 0;
+ public static final int SEQUENCE_NUMBER_INDEX = 1;
+ public static final int APINAME_INDEX = 2;
+ public static final int TIME_INDEX = 3;
+ public static final int PROCESS_ID_INDEX = 4;
+ public static final int THREAD_ID_INDEX = 5;
+ public static final int INPUTPARM_INDEX = 6;
+ public static final int RETURN_INDEX = 7;
+ public static final int PCADDR_INDEX = 8;
+ public static final int ERROR_INDEX = 9;
+ public static final int INTERNAL_FLAG_INDEX = 10;
+ public static final int CALLER_PCADDR_INDEX = 11;
+
+ /* log memory : 1 */
+ public static final int MEMORY_SIZE_INDEX = 12;
+ public static final int MEMORY_APITYPE_INDEX = 13;
+ public static final int MEMORY_ADDR_INDEX = 14;
+ public static final int MEMORY_RESERVED_INDEX = 15;
+
+ /* Log UserInterface Control : 2 */
+ public static final int USER_INTERFACE_CONTROL_LIST_PARENT_NAME_INDEX = 12;
+ public static final int USER_INTERFACE_CONTROL_LIST_PARENT_CLASS_NAME_INDEX = 13;
+ public static final int USER_INTERFACE_CONTROL_LIST_PARENT_POINTER_INDEX = 14;
+ public static final int USER_INTERFACE_CONTROL_LIST_CHILD_NAME_INDEX = 15;
+ public static final int USER_INTERFACE_CONTROL_LIST_CHILD_CLASS_NAME_INDEX = 16;
+ public static final int USER_INTERFACE_CONTROL_LIST_CHILD_POINTER_INDEX = 17;
+ public static final int USER_INTERFACE_CONTROL_LIST_CONTRIL_TYPE_INDEX = 18;
+
+ /* Log UI Event : 3 */
+ public static final int UI_EVENT_EVENT_TYPE = 12;
+ public static final int UI_EVENT_DETAIL_TYPE = 13;
+ public static final int UI_EVENT_X = 14;
+ public static final int UI_EVENT_Y = 15;
+ public static final int UI_EVENT_INFO1 = 16;
+ public static final int UI_EVENT_INFO2 = 17;
+
+ /* log user function : 4 */
+ public static final int USER_FUNCTION_BINARY_RANGE_START_INDEX = 12;
+ public static final int USER_FUNCTION_BINARY_RANGE_END_INDEX = 13;
+ public static final int USER_FUNCTION_TYPE_INDEX = 14;
+ public static final int USER_FUNCTION_ELAPSED_TIME_INDEX = 15;
+
+ public static final int USER_FUNCTION_EVENT_TYPE_ENTER = 0;
+ public static final int USER_FUNCTION_EVENT_TYPE_EXIT = 1;
+
+ public static final String USER_FUNCTION_CALLBACK_FUNC_SYMBOL = "(~~ internal library ~~"; //$NON-NLS-1$
+ public static final String USER_FUNCTION_CALLBACK_FUNC = "~~ internal library ~~"; //$NON-NLS-1$
+ public static final long USER_FUNCTION_CALLBACK_FUNC_ADDR = 0;
+
+ /* log resource (file) : 5 */
+ public static final int RESOURCE_SIZE_INDEX = 12;
+ public static final int RESOURCE_FDVALUE_INDEX = 13;
+ public static final int RESOURCE_FDTYPE_INDEX = 14;
+ public static final int RESOURCE_FDAPITYPE_INDEX = 15;
+ public static final int RESOURCE_FILE_SIZE_INDEX = 16;
+ public static final int RESOURCE_FILE_PATH_INDEX = 17;
+ public static final int RESOURCE_RESERVED_INDEX = 18;
+
+ public static final int FD_TYPE_FILE = 0;
+ public static final int FD_TYPE_SOCKET = 1;
+ public static final int FD_TYPE_THREAD = 2;
+
+ public static final String FD_API_TYPE_OPEN = "0"; //$NON-NLS-1$
+ public static final String FD_API_TYPE_CLOSE = "1"; //$NON-NLS-1$
+ public static final String FD_API_TYPE_READ = "2"; //$NON-NLS-1$
+ public static final String FD_API_TYPE_WRITE = "3"; //$NON-NLS-1$
+ public static final String FD_API_TYPE_OTHERS = "4"; //$NON-NLS-1$
+ public static final String FD_API_INTERNAL_START = "11"; //$NON-NLS-1$
+ public static final String FD_API_INTERNAL_CLOSE = "12"; //$NON-NLS-1$
+ public static final String FD_API_WAIT = "13"; //$NON-NLS-1$
+ public static final String FD_API_INTERNAL_USE = "14"; //$NON-NLS-1$
+
+ public static final int FD_API_TYPE_NUMBER_OPEN = 0;
+ public static final int FD_API_TYPE_NUMBER_CLOSE = 1;
+ public static final int FD_API_TYPE_NUMBER_READ = 2;
+ public static final int FD_API_TYPE_NUMBER_WRITE = 3;
+ public static final int FD_API_TYPE_NUMBER_OTHERS = 4;
+ public static final int FD_API_TYPE_NUMBER_FAILED = 5;
+
+ /* Log snapshot */
+ public static final int SNAPSHOT_IMAGE_PATH_INDEX = 12;
+ public static final int SNAPSHOT_ROTATE_INDEX = 13;
+
+ /* Log UserInterface Scene Transforms : 8 */
+ public static final int USER_INTERFACE_SCENE_TRANSFORMS_LIST_SCENE_NAME_INDEX = 12;
+ public static final int USER_INTERFACE_SCENE_TRANSFORMS_LIST_FORM_NAME_INDEX = 13;
+ public static final int USER_INTERFACE_SCENE_TRANSFORMS_LIST_FORM_POINTER_INDEX = 14;
+ public static final int USER_INTERFACE_SCENE_TRANSFORMS_LIST_PANEL_NAME_INDEX = 15;
+ public static final int USER_INTERFACE_SCENE_TRANSFORMS_LIST_PANEL_POINTER_INDEX = 16;
+ public static final int USER_INTERFACE_SCENE_TRANSFORMS_LIST_TRANSITION_INDEX = 17;
+ public static final int USER_INTERFACE_SCENE_TRANSFORMS_LIST_USERTIME_INDEX = 18;
+
+ /* log Device : 9 */
+ public static final int DEVICE_ENERGY_INDEX = 2;
+ public static final int DEVICE_TIME_INDEX = TIME_INDEX;
+ public static final int DEVICE_WIFI_INDEX = 4;
+ public static final int DEVICE_BLUETOOTH_INDEX = 5;
+ public static final int DEVICE_GPS_INDEX = 6;
+ public static final int DEVICE_BRIGHTNESS_INDEX = 7;
+ public static final int DEVICE_CAMERA_INDEX = 8;
+ public static final int DEVICE_SOUND_INDEX = 9;
+ public static final int DEVICE_AUDIO_INDEX = 10;
+ public static final int DEVICE_VIBRATION_INDEX = 11;
+ public static final int DEVICE_VOLTAGE_INDEX = 12;
+ public static final int DEVICE_RSSI_INDEX = 13;
+ public static final int DEVICE_VIDEO_INDEX = 14;
+ public static final int DEVICE_CALL_INDEX = 15;
+ public static final int DEVICE_DNET_INDEX = 16;
+ public static final int DEVICE_CALL_ALPHA_INDEX = 17;
+ public static final int DEVICE_RSSI_ALPHA_INDEX = 18;
+ public static final int DEVICE_CPU_FREQUENCY_INDEX = 19;
+ public static final int DEVICE_APP_CPU_USAGE_INDEX = 20;
+ public static final int DEVICE_SYSTEM_CPU_USAGE_INDEX = 21;
+ public static final int DEVICE_VSS_MEMORY_INDEX = 22;
+ public static final int DEVICE_RSS_MEMORY_INDEX = 23;
+ public static final int DEVICE_SHARED_MEMORY_INDEX = 24;
+ public static final int DEVICE_PSS_MEMORY_INDEX = 25;
+ public static final int DEVICE_ALLOCATION_SIZE_INDEX = 26;
+ public static final int DEVICE_SYSTEM_TOTAL_MEMORY_INDEX = 27;
+ public static final int DEVICE_SYSTEM_USED_MEMORY_INDEX = 28;
+ public static final int DEVICE_SYSTEM_USED_STORAGE_INDEX = 29;
+ public static final int DEVICE_THREAD_COUNT_INDEX = 30;
+ public static final int DEVICE_THREAD_LOAD_INDEX = 31;
+ public static final int DEVICE_THREAD_RESERVED_INDEX = 32;
+
+ /* sample log : 11 */
+ public static final int PROFILING_LOG_TIME_INDEX = 2;
+ public static final int PROFILING_LOG_PCADDR_INDEX = 3;
+ public static final int PROFILING_LOG_CALLSTACK_INDEX = 4;
+ public static final int PROFILING_LOG_RESERVED_INDEX = 5;
+
+ /* thread log : 12 */
+ public static final int THREAD_PTHREAD_ID_INDEX = 12;
+ public static final int THREAD_TIZENTHREAD_ID_INDEX = 13;
+ public static final int THREAD_TYPE_INDEX = 14;
+ public static final int THREAD_API_TYPE_INDEX = 15;
+
+ public static final int THREAD_TYPE_PTHREAD = 0;
+ public static final int THREAD_TYPE_TIZEN = 1;
+ public static final int THREAD_TYPE_MAIN = 2;
+
+ public static final int THREAD_API_TYPE_NEW = 0;
+ public static final int THREAD_API_TYPE_START = 1;
+ public static final int THREAD_API_TYPE_STOP = 2;
+ public static final int THREAD_API_TYPE_EXIT = 3;
+ public static final int THREAD_API_TYPE_WAIT_START = 4;
+ public static final int THREAD_API_TYPE_WAIT_END = 5;
+ public static final int THREAD_API_TYPE_INTERNAL_START = 6;
+ public static final int THREAD_API_TYPE_INTERNAL_STOP = 7;
+ public static final int THREAD_API_TYPE_OTHER = 8;
+
+ /* internal log */
+ public static final int INTERNAL_CALL = 1;
+ public static final int USER_CALL = 2;
+
+ /* custom log : 13 */
+ public static final int CUSTOM_CHART_HANDLE = 12;
+ public static final int CUSTOM_CHART_TYPE = 13;
+ public static final int CUSTOM_CHART_TEXT = 14;
+ public static final int CUSTOM_CHART_COLOR = 15;
+ public static final int CUSTOM_CHART_VALUE = 16;
+ public static final int CUSTOM_CHART_RESERVED = 17;
+
+ /* synchronization log : 14 */
+ public static final int SYNC_VAL_INDEX = 12;
+ public static final int SYNC_TYPE_INDEX = 13;
+ public static final int SYNC_API_TYPE_INDEX = 14;
+
+ public static final int SYNC_TYPE_TIZEN_MUTEX = 0;
+ public static final int SYNC_TYPE_TIZEN_MONITOR = 1;
+ public static final int SYNC_TYPE_TIZEN_SEMAPHORE = 2;
+ public static final int SYNC_TYPE_PTHREAD_MUTEX = 3;
+ public static final int SYNC_TYPE_PTHREAD_COND_VARIABLE = 4;
+ public static final int SYNC_TYPE_PTHREAD_RWLOCK = 5;
+ public static final int SYNC_TYPE_PTHREAD_SPINLOCK = 6;
+ public static final int SYNC_TYPE_PTHREAD_BARRIER = 7;
+
+ public static final int SYNC_API_TYPE_NEW = 0;
+ public static final int SYNC_API_TYPE_ACQUIRE_WAIT_START = 1;
+ public static final int SYNC_API_TYPE_ACQUIRE_WAIT_END = 2;
+ public static final int SYNC_API_TYPE_RELEASE = 3;
+ public static final int SYNC_API_TYPE_TRY_ACQUIRE = 4;
+ public static final int SYNC_API_TYPE_COND_WAIT_START = 5;
+ public static final int SYNC_API_TYPE_COND_WAIT_END = 6;
+ public static final int SYNC_API_TYPE_NOTIFY = 7;
+ public static final int SYNC_API_TYPE_NOTIFY_ALL = 8;
+ public static final int SYNC_API_TYPE_OTHER = 9;
+
+ /* Common Column Size */
+ public static final int COMMON_COLUMN_SIZE_RID = 80;
+ public static final int COMMON_COLUMN_SIZE_ID = 20;
+ public static final int COMMON_COLUMN_SIZE_SEQNUMBER = 0;
+ public static final int COMMON_COLUMN_SIZE_APINAME = 100;
+ public static final int COMMON_COLUMN_SIZE_TIME = 120;
+ public static final int COMMON_COLUMN_SIZE_PID = 80;
+ public static final int COMMON_COLUMN_SIZE_TID = 80;
+ public static final int COMMON_COLUMN_SIZE_INPUTPARAM = 200;
+ public static final int COMMON_COLUMN_SIZE_RETURN = 0;
+ public static final int COMMON_COLUMN_SIZE_PCADDR = 0;
+ public static final int COMMON_COLUMN_SIZE_ERROR = 0;
+
+ public static String getLogCenterNameFromId(int id) {
+ if (id == LOG_MEMORY) {
+ return "memory"; //$NON-NLS-1$
+ } else if (id == LOG_USER_FUNCTION) {
+ return "user function"; //$NON-NLS-1$
+ } else if (id == LOG_RESOURCE) {
+ return "resource"; //$NON-NLS-1$
+ } else if (id == LOG_THREAD) {
+ return "thread"; //$NON-NLS-1$
+ } else {
+ return "etc..."; //$NON-NLS-1$
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.logparser;
+
+import java.util.List;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.model.LogCenter;
+import org.tizen.dynamicanalyzer.sql.SqlManager;
+
+/** log insert into database **/
+public class LogInserter implements Runnable {
+
+ private static Thread insertLogThread = null;
+ private static InsertLogQueue insertLogQueue = null;
+ private static boolean isCompleted = false;
+
+ public static void startInsertLogThread() {
+ if (null == insertLogThread || !insertLogThread.isAlive()) {
+ insertLogThread = new Thread(null, new LogInserter(),
+ AnalyzerConstants.INSERT_LOG_THREAD);
+ insertLogThread.start();
+ isCompleted = false;
+ }
+ }
+
+ public static void stopInsertLogThread() {
+ if (null != insertLogThread && insertLogThread.isAlive()) {
+ try {
+ sendNotify();
+ insertLogThread.join();
+ System.out.println("insert thread join complete!!"); //$NON-NLS-1$
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public static InsertLogQueue getInsertLogQueue() {
+ if (null == insertLogQueue) {
+ insertLogQueue = new InsertLogQueue();
+ }
+ return insertLogQueue;
+ }
+
+ public static void clear() {
+ stopInsertLogThread();
+ getInsertLogQueue().clear();
+ }
+
+ /** insert thread **/
+ private LogPackage logPackage;
+
+ public LogInserter() {
+ logPackage = new LogPackage();
+ }
+
+ public void initLogPackage() {
+ logPackage.clear();
+ }
+
+ private LogPackage getLogPackage() {
+ if (null == logPackage) {
+ logPackage = new LogPackage();
+ }
+ return logPackage;
+ }
+
+ @Override
+ public void run() {
+ List<LogCenter> logcs = AnalyzerManager.getLogCenters();
+ int size = logcs.size();
+ InsertLogQueue logQueue = getInsertLogQueue();
+ while (!AnalyzerManager.isExit()) {
+ try {
+ LogPackage logPack = logQueue.getFirstLog();
+ if (null == logPack) {
+ break;
+ }
+ for (int i = 0; i < size; i++) {
+ LogCenter logCenter = logcs.get(i);
+ Logs newLogs = new Logs(logCenter.getId());
+ Logs logs = logPack.getLogs(logCenter.getId());
+ if (null != logs) {
+ newLogs.getLogs().addAll(logs.getCloneLogs());
+ getLogPackage().putLogs(logs);
+ }
+ } // for
+
+ for (int i = 0; i < size; i++) {
+ LogCenter logCenter = logcs.get(i);
+ Logs logs = getLogPackage().getLogs(logCenter.getId());
+ if (null != logs) {
+ SqlManager.getInstance().insert(logCenter, logs.getLogs());
+ int count = logCenter.getDataSize();
+ count += logs.getLogs().size();
+ logCenter.setDataSize(count);
+ }
+ }
+ initLogPackage();
+ } catch (InterruptedException e) {
+ System.out.println("insert log thread interrupted"); //$NON-NLS-1$
+ break;
+ }
+ }
+ isCompleted = true;
+ System.out.println("insert log thread end"); //$NON-NLS-1$
+ }
+
+ public static boolean isComplete() {
+ return isCompleted;
+ }
+
+ public static void sendNotify() {
+ InsertLogQueue insertLogQueue = getInsertLogQueue();
+ synchronized (insertLogQueue) {
+ insertLogQueue.notifyAll();
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.logparser;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class LogListQueue {
+ private List<List<List<String>>> data = null;
+
+ public LogListQueue() {
+ data = new ArrayList<List<List<String>>>();
+ }
+
+ public synchronized List<List<String>> getFirst() {
+ while (isEmpty()) {
+ if (LogParser.isLogParsingComplete()) {
+ return null;
+ }
+ try {
+ wait();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ List<List<String>> output = data.get(0);
+ data.remove(0);
+ notifyAll();
+ return output;
+ }
+
+ public synchronized void putLog(List<List<String>> input) {
+ while (isFull()) {
+ try {
+ wait();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ break;
+ }
+ }
+ data.add(input);
+ notifyAll();
+ }
+
+ public boolean isEmpty() {
+ if (null == data) {
+ data = new ArrayList<List<List<String>>>();
+ }
+ return data.isEmpty();
+ }
+
+ private boolean isFull() {
+ if (size() > 10000) {
+ return true;
+ }
+ return false;
+ }
+
+ public int size() {
+ return data.size();
+ }
+
+ public void clear() {
+ data.clear();
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.logparser;
+
+import java.util.HashMap;
+import java.util.List;
+
+
+public class LogPackage {
+ private HashMap<Integer, Logs> logMap;
+
+ public void clear()
+ {
+ getLogMap().clear();
+ }
+
+ public LogPackage() {
+ logMap = new HashMap<Integer, Logs>();
+ }
+
+ private HashMap<Integer, Logs> getLogMap()
+ {
+ if (null == logMap)
+ {
+ logMap = new HashMap<Integer, Logs>();
+ }
+ return logMap;
+ }
+ public boolean isEmpty()
+ {
+ return getLogMap().isEmpty();
+ }
+
+ public void setLogs(int id, List<String> input) {
+ Logs logs = getLogMap().get(id);
+ if (null == logs)
+ {
+ logs = new Logs(id);
+ logMap.put(id, logs);
+ }
+ logs.getLogs().add(input);
+ }
+
+ public void setLogs(int id, Logs logs)
+ {
+ if (null != getLogMap().get(id))
+ {
+ logMap.remove(id);
+ }
+ logMap.put(id, logs);
+ }
+
+ public Logs getLogs(int id)
+ {
+ return getLogMap().get(id);
+ }
+
+ public void putLogs(Logs logs)
+ {
+ if (null != logs)
+ {
+ int id = logs.getId();
+ Logs base = getLogMap().get(id);
+ if (null == base)
+ {
+ logMap.put(id, logs);
+ }
+ else
+ {
+ base.getLogs().addAll(logs.getLogs());
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.logparser;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.common.SymbolManager;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
+import org.tizen.dynamicanalyzer.model.ImageInfo;
+import org.tizen.dynamicanalyzer.model.LogCenter;
+import org.tizen.dynamicanalyzer.nl.InformationViewLabels;
+import org.tizen.dynamicanalyzer.project.Project;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager;
+import org.tizen.dynamicanalyzer.ui.page.BaseView;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.utils.ImageUtil;
+import org.tizen.sdblib.SyncService;
+import org.tizen.sdblib.SyncService.SyncResult;
+
+public class LogParser implements Runnable {
+ private final String OSP_MAIN = "OspMain"; //$NON-NLS-1$
+ private final String TIME_POST_FIX = "00";//$NON-NLS-1$
+ private static Thread logParser = null;
+ private static boolean dropCallTraceLog = false;
+ private static LogQueue logQueue = null;
+
+ private static boolean isLogParsingComplete = false;
+
+ private int SMALL_IMG_WIDTH = 40;
+ private int SMALL_IMG_HEIGHT = 66;
+
+ private int DEFAULT_IMG_WIDTH = 480;
+ private int DEFAULT_IMG_HEIGHT = 800;
+
+ /** thread **/
+ private String pid = null;
+ private String lastLogSeqNumber = CommonConstants.ZERO;
+
+ public static void clear() {
+ stopLogParser();
+ getLogQueue().clear();
+ isLogParsingComplete = false;
+ }
+
+ public static LogQueue getLogQueue() {
+ if (null == logQueue) {
+ logQueue = new LogQueue();
+ }
+ return logQueue;
+ }
+
+ public static void setDropCallTraceLog(boolean drop) {
+ dropCallTraceLog = drop;
+ }
+
+ public static boolean isDrapCallTraceLog() {
+ return dropCallTraceLog;
+ }
+
+ public static boolean isLogParsingComplete() {
+ return isLogParsingComplete;
+ }
+
+ public static void setLogParsingComplete(boolean complete) {
+ isLogParsingComplete = complete;
+ }
+
+ public static void startLogParser() {
+ if (null == logParser || !logParser.isAlive()) {
+ logParser = new Thread(null, new LogParser(),
+ AnalyzerConstants.LOG_QUEUE_OBSERVING_THREAD);
+ logParser.start();
+ }
+ }
+
+ public static void stopLogParser() {
+ if (null != logParser && logParser.isAlive()) {
+ LogQueue logQueue = getLogQueue();
+ synchronized (logQueue) {
+ logQueue.notifyAll();
+ }
+ try {
+ System.out.println("wait for log parser join");//$NON-NLS-1$
+ logParser.join();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /*** log parsing thread ***/
+ @Override
+ public void run() {
+ isLogParsingComplete = false;
+ LogQueue logQueue = getLogQueue();
+ while (!AnalyzerManager.isExit()) {
+ List<String> logs = logQueue.getFirst();
+ if (null == logs) {
+ break;
+ }
+ logSlicing(logs);
+ }
+
+ /* log for debug */
+ System.out.println("log parsing thread end!!"); //$NON-NLS-1$
+ isLogParsingComplete = true;
+
+ if (!AnalyzerManager.isExit()) {
+ ToolbarArea.getInstance().stopTimer();
+ }
+ }
+
+ private void logSlicing(List<String> logLumb) {
+ String[] slicedLog = null;
+ Project project = AnalyzerManager.getProject();
+
+ int size = logLumb.size();
+ String logId = null;
+ LogPackage logPack = new LogPackage();
+
+ for (int i = 0; i < size; i++) {
+ if (logLumb.get(i).isEmpty()) {
+ continue;
+ }
+ String[] log = logLumb.get(i).split(CommonConstants.NEW_LINE);
+
+ slicedLog = log[0].split(AnalyzerConstants.DATA_PARSING_TOKEN);
+ logId = slicedLog[LogCenterConstants.ID_INDEX];
+ int id = Integer.parseInt(logId);
+ if (LogCenterConstants.LOG_PROFILING == id) {
+ String[] oldSlicedLog = slicedLog;
+ slicedLog = new String[oldSlicedLog.length + 1];
+ for (int ii = 0; ii < oldSlicedLog.length; ii++) {
+ slicedLog[ii] = oldSlicedLog[ii];
+ }
+ slicedLog[oldSlicedLog.length] = log[1];
+ } else if (LogCenterConstants.LOG_DEVICE != id) {
+ if (null == pid) {
+ pid = slicedLog[LogCenterConstants.PROCESS_ID_INDEX];
+ } else {
+ String p = slicedLog[LogCenterConstants.PROCESS_ID_INDEX];
+ if (!pid.equals(p)) {
+ continue;
+ }
+ }
+ }
+
+ String currentTime = null;
+ int timeIndex = LogCenterConstants.TIME_INDEX;
+ if (LogCenterConstants.LOG_PROFILING == id) {
+ timeIndex = LogCenterConstants.PROFILING_LOG_TIME_INDEX;
+ }
+ try {
+ currentTime = slicedLog[timeIndex];
+ } catch (ArrayIndexOutOfBoundsException e) {
+ e.printStackTrace();
+ return;
+ }
+
+ long longTime = Long.parseLong(currentTime);
+ long lastTime = longTime - project.getStartTime();
+ String modifyedTime = Long.toString(lastTime) + TIME_POST_FIX;
+ slicedLog[timeIndex] = modifyedTime;
+
+ String seq = slicedLog[LogCenterConstants.SEQUENCE_NUMBER_INDEX];
+ long seqNum = Long.parseLong(seq);
+ long lastSeqNum = Long.parseLong(lastLogSeqNumber);
+ if (lastSeqNum < seqNum) {
+ lastLogSeqNumber = slicedLog[LogCenterConstants.SEQUENCE_NUMBER_INDEX];
+ }
+
+ if (id == LogCenterConstants.LOG_USER_FUNCTION) {
+ String apiName = slicedLog[LogCenterConstants.APINAME_INDEX];
+ if (apiName.isEmpty() || apiName.equals("_end")) { //$NON-NLS-1$
+ setFuncName(slicedLog);
+ }
+
+ if (LogParser.isDrapCallTraceLog()) {
+ apiName = slicedLog[LogCenterConstants.APINAME_INDEX];
+ if (!apiName.equals(OSP_MAIN)) {
+ continue;
+ }
+ LogParser.setDropCallTraceLog(false);
+ }
+
+ String start = slicedLog[LogCenterConstants.USER_FUNCTION_BINARY_RANGE_START_INDEX];
+ String end = slicedLog[LogCenterConstants.USER_FUNCTION_BINARY_RANGE_END_INDEX];
+ if (!start.isEmpty() && !end.isEmpty()
+ && !AnalyzerManager.isBinStartEndSet()) {
+ AnalyzerManager.setBinaryStartEndAddr(start, end);
+ }
+
+ if (CallStackManager.getInstance().isIrregularUserCall(
+ slicedLog)) {
+ continue;
+ }
+ pushLog(logId, slicedLog, logPack);
+ /* user callstack create by entry and exit */
+ CallStackManager.getInstance().makeUserCallstack(
+ slicedLog,
+ FunctionUsageProfiler.getInstance()
+ .getProfileDataMaker());
+ } else if (id == LogCenterConstants.LOG_DEVICE
+ || id == LogCenterConstants.LOG_PROFILING) {
+ pushLog(logId, slicedLog, logPack);
+ } else {
+ if (id == LogCenterConstants.LOG_SCREENSHOT) {
+ String remoteImgPath = new String(
+ slicedLog[LogCenterConstants.SNAPSHOT_IMAGE_PATH_INDEX]);
+ String rotate = new String(
+ slicedLog[LogCenterConstants.SNAPSHOT_ROTATE_INDEX]);
+ processImage(remoteImgPath, rotate);
+ }
+ pushLog(logId, slicedLog, logPack);
+ CallStackManager.getInstance().makeCallstackWithoutBacktrace(
+ slicedLog);
+ if (id == LogCenterConstants.LOG_RESOURCE
+ || id == LogCenterConstants.LOG_MEMORY) {
+ AnalyzerManager.getLeakDetector().runLeakDectect(slicedLog);
+ }
+
+ AnalyzerManager.getFailedChecker().check(slicedLog);
+ }
+ }
+ AnalyzerManager.getProject().setLastLogNum(lastLogSeqNumber);
+
+ updateLog(logPack);
+ }
+
+ private void processImage(final String from, String rotate) {
+ final String fileName = getImageName(from);
+ final String to = AnalyzerManager.getProject().getSavePath()
+ + File.separator + AnalyzerConstants.IMAGE_FOLDER_NAME
+ + File.separator + fileName;
+ final int angle = Integer.parseInt(rotate);
+
+ new Thread(null, new Runnable() {
+ @Override
+ public void run() {
+ SyncResult res = DACommunicator.pull(from, to);
+ if (null != res && SyncService.RESULT_OK == res.getCode()) {
+ DACommunicator.removeCommand(from);
+ /* image resizing */
+ String smallImagePath = AnalyzerManager.getProject()
+ .getSavePath()
+ + File.separator
+ + AnalyzerConstants.IMAGE_FOLDER_NAME
+ + File.separator
+ + AnalyzerConstants.SMALL_IMAGE_FOLDER_NAME
+ + File.separator + fileName;
+ ImageUtil.transform(to, to, DEFAULT_IMG_WIDTH,
+ DEFAULT_IMG_HEIGHT, angle);
+ if (angle == 90 || angle == 270) {
+ ImageUtil.resize(to, smallImagePath, SMALL_IMG_HEIGHT,
+ SMALL_IMG_WIDTH);
+ } else {
+ ImageUtil.resize(to, smallImagePath, SMALL_IMG_WIDTH,
+ SMALL_IMG_HEIGHT);
+ }
+ } else {
+ System.out.println("Failed to get '" + from + "' file"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ }, AnalyzerConstants.MESSAGE_INTERNAL_IMAGE_THREAD).start();
+
+ }
+
+ private String getImageName(String fullPath) {
+ String name = null;
+ name = fullPath
+ .substring(fullPath.lastIndexOf(CommonConstants.SLASH) + 1);
+ return name;
+ }
+
+ private void updateLog(LogPackage logPack) {
+ if (null == logPack || logPack.isEmpty()) {
+ return;
+ }
+
+ /* 1. InsertLog extension */
+ LogInserter.getInsertLogQueue().push(logPack);
+ LogInserter.startInsertLogThread();
+
+ BaseView bv = (BaseView) AnalyzerUtil.getViewPart(BaseView.ID);
+ bv.getMainTab().updateLog(logPack);
+ }
+
+ private void setFuncName(String[] input) {
+ boolean isPieBuild = AnalyzerManager.getProject().isPieBuild();
+ String baseAddr = AnalyzerManager.getProject().getBaseAddress();
+ String path = AnalyzerManager.getProject().getBinaryPath();
+ String pcAddr = input[LogCenterConstants.PCADDR_INDEX];
+ String functionName = SymbolManager.addr2func(path, pcAddr, isPieBuild,
+ baseAddr);
+ if (null == functionName || functionName.isEmpty()
+ || functionName.equals("_end")) { //$NON-NLS-1$
+ functionName = InformationViewLabels.CALLSTACK_TABLE_UNKNOWN_FUNCTION;
+ } else {
+ String prevFunctionName = functionName;
+ functionName = SymbolManager
+ .demanglingFunctionName(prevFunctionName);
+ }
+
+ input[LogCenterConstants.APINAME_INDEX] = functionName;
+ }
+
+ private void pushLog(String logId, String[] slicedLog, LogPackage logPack) {
+
+ int id = -1;
+ try {
+ id = Integer.parseInt(logId);
+ } catch (NumberFormatException e) {
+ /* log for debug */
+ e.printStackTrace();
+ return;
+ }
+ if (id < 0) {
+ return;
+ }
+
+ List<String> input = new ArrayList<String>();
+ LogCenter logc = AnalyzerManager.getLogCenterById(id);
+ if (null == logc) {
+ return;
+ }
+
+ int count = logc.getTotalColumnCount();
+ int length = slicedLog.length;
+ for (int i = 0; i < count; i++) {
+ if (i < length && i < count) {
+ input.add(slicedLog[i]);
+ } else {
+ input.add(CommonConstants.EMPTY);
+ }
+ }
+
+ if (id == LogCenterConstants.LOG_SCREENSHOT) {
+ ImageInfo imgInfo = new ImageInfo();
+ imgInfo.setSeq(input.get(LogCenterConstants.SEQUENCE_NUMBER_INDEX));
+ imgInfo.setTime(input.get(LogCenterConstants.TIME_INDEX));
+ AnalyzerManager.getImageSet().put(imgInfo.getSeq(), imgInfo);
+ }
+
+ logPack.setLogs(id, input);
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.logparser;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+
+/** log queue model **/
+public class LogQueue {
+ private static final int FULL_COUNT = 10000;
+ private List<List<String>> data = null;
+
+ public LogQueue() {
+ data = new ArrayList<List<String>>();
+ }
+
+ public synchronized List<String> getFirst() {
+ while (isEmpty()) {
+ try {
+ if (!AnalyzerManager.isRunning()) {
+ return null;
+ }
+ wait();
+ } catch (InterruptedException e) {
+ System.out.println("log queue interrupt!!"); //$NON-NLS-1$
+ continue;
+ }
+ }
+
+ List<String> output = data.get(0);
+ data.remove(0);
+ notifyAll();
+ return output;
+ }
+
+ public synchronized void putLog(List<String> input) {
+ while (isFull()) {
+ try {
+ wait();
+ } catch (InterruptedException e) {
+ // never reach here!
+ e.printStackTrace();
+ break;
+ }
+ }
+
+ if (null == data) {
+ data = new ArrayList<List<String>>();
+ }
+ data.add(input);
+ notifyAll();
+ }
+
+ public boolean isEmpty() {
+ if (null == data) {
+ data = new ArrayList<List<String>>();
+ }
+ return data.isEmpty();
+ }
+
+ public boolean isFull() {
+ if (size() > FULL_COUNT) {
+ return true;
+ }
+ return false;
+ }
+
+ public int size() {
+ return data.size();
+ }
+
+ public void clear() {
+ data.clear();
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.logparser;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Logs {
+ private List<List<String>> logs;
+ int logCenterId;
+
+ public Logs(int id) {
+ logs = new ArrayList<List<String>>();
+ logCenterId = id;
+ }
+
+ public int getId() {
+ return logCenterId;
+ }
+
+ // getLogs -> getRawLogs
+ public List<List<String>> getLogs() {
+ if (null == logs) {
+ logs = new ArrayList<List<String>>();
+ }
+ return logs;
+ }
+
+ public void setLogs(List<List<String>> input) {
+ logs = input;
+ }
+
+ public void setLogCenterId(int id) {
+ logCenterId = id;
+ }
+
+ // cloneLogs -> getLogs
+ public List<List<String>> getCloneLogs() {
+ List<List<String>> newLogs = new ArrayList<List<String>>();
+ int size = logs.size();
+ for (int i = 0; i < size; i++) {
+ List<String> newLog = new ArrayList<String>();
+ newLog.addAll(logs.get(i));
+ newLogs.add(newLog);
+ }
+ return newLogs;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.logparser;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+import org.eclipse.swt.widgets.Display;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.AnalyzerPaths;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
+import org.tizen.dynamicanalyzer.communicator.ResourceCommunicator;
+import org.tizen.dynamicanalyzer.handlers.StopHandler;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
+import org.tizen.dynamicanalyzer.ui.toolbar.StopLogProcessor;
+import org.tizen.dynamicanalyzer.ui.toolbar.StopProcessManager;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.uirecorder.UIRecorderTool;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.sdblib.SyncService;
+import org.tizen.sdblib.SyncService.SyncResult;
+
+public class MessageProcess {
+
+ /* Message Buffer max length */
+ final int MSG_BUFFER_MAX = 100;
+ final int MSG_BUFFER_TIMER_DELAY = 5;
+ final int MSG_BUFFER_TIMER_PERIOD = 1000; // 1 second
+ private static int count = 0;
+ final int WAITING_TIME = 10;
+
+ class AddBufferTimerTask extends TimerTask {
+ @Override
+ public void run() {
+ if (!buffer.isEmpty()) {
+ addBufferToList();
+ count = 0;
+ } else {
+ count++;
+ if (count >= WAITING_TIME) {
+ ToolbarArea.getInstance().stopTrace();
+ }
+ }
+ }
+ }
+
+ private List<String> buffer = new ArrayList<String>();;
+ private Lock lock = new ReentrantLock();
+ private Timer timer = null;
+
+ private static MessageProcess receivedMessage = new MessageProcess();
+ private int messageCount = 0;
+
+ public static MessageProcess getInstance() {
+ return receivedMessage;
+ }
+
+ public void startTimer() {
+ timer = new Timer();
+ timer.scheduleAtFixedRate(new AddBufferTimerTask(),
+ MSG_BUFFER_TIMER_DELAY, MSG_BUFFER_TIMER_PERIOD);
+ }
+
+ public void stopTimer() {
+ if (null != timer) {
+ timer.cancel();
+ timer = null;
+ }
+ }
+
+ private void addBufferToList() {
+ lock.lock();
+ if (null == buffer || 0 == buffer.size()) {
+ lock.unlock();
+ return;
+ }
+ LogParser.getLogQueue().putLog(buffer);
+ buffer = new ArrayList<String>();
+ lock.unlock();
+ }
+
+ public void processMessage(String message) {
+ // DO NOT DELETE : for debugging
+ // System.out.println("count " + messageCount + ": " + message);
+ try {
+ String[] messages = message
+ .split(CommonConstants.CMD_SPLIT_READ, 2);
+ int messageIndex = Integer.parseInt(messages[0]);
+
+ switch (messageIndex) {
+ case AnalyzerConstants.MSG_APP_INFO: /* app info : 1 */
+ if (!AnalyzerManager.isAppInfoArrived()) {
+ processAppInfo(messages[1]);
+ AnalyzerManager.setAppInfoArrived(true);
+ }
+ break;
+ case AnalyzerConstants.MSG_USER_PROFILING_SAMPLE: /* sample : 3 */
+ if (!AnalyzerManager.hasSampleThread()) {
+ AnalyzerManager.setSampleThread(true);
+ }
+ break;
+ case AnalyzerConstants.MSG_DEVICE_LOG: /* device info : 4 */
+ case AnalyzerConstants.MSG_LOG: /* log : 5 */
+ // if (AnalyzerConstants.MSG_LOG == messageIndex) {
+ // System.out
+ // .println("count " + messageCount + ": " + message);
+ // }
+ buffer.add(messages[1]);
+ messageCount += 1;
+ break;
+ case AnalyzerConstants.MSG_IMAGE: /* screenshot : 6 */
+ processImage(messages[1]);
+ break;
+ case AnalyzerConstants.MSG_TERMINATE: /* terminate : 7 */
+ processTerminate();
+ break;
+ case AnalyzerConstants.MSG_DEBUG: /* debug message : 9 */
+ default:
+ // System.out.println("DA_LOG : " + message); //$NON-NLS-1$
+ break;
+ }
+
+ if (MSG_BUFFER_MAX < messageCount) {
+ addBufferToList();
+ messageCount = 0;
+ }
+
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ }
+ }
+
+ private void processAppInfo(String message) {
+ String[] datas = message.split(AnalyzerConstants.DATA_PARSING_TOKEN);
+ List<String> appInfo = AnalyzerManager.getProject().getAppInfo();
+ int size = datas.length;
+ for (int i = 0; i < size; i++) {
+ appInfo.set(i, new String(datas[i]));
+ }
+
+ if (size - 1 < AnalyzerConstants.APP_INFO_BINARY_PATH
+ || null == appInfo.get(AnalyzerConstants.APP_INFO_BINARY_PATH)
+ || appInfo.get(AnalyzerConstants.APP_INFO_BINARY_PATH)
+ .isEmpty()) {
+ ToolbarArea.getInstance().setSourceViewEnable(false);
+ ToolbarArea.getInstance().setSourceViewTooltip(
+ AnalyzerLabels.MESSAGE_PROCESS_PG_WARNING);
+ } else {
+ ToolbarArea.getInstance().setSourceViewEnable(true);
+ ToolbarArea.getInstance().setSourceViewTooltip(
+ AnalyzerLabels.MESSAGE_PROCESS_VIEW_SOURCE);
+ }
+
+ // User Call Trace : App is Tizen C++ or Tizen native
+ int type = Integer.parseInt(appInfo
+ .get(AnalyzerConstants.APP_INFO_APP_TYPE));
+ if (type == AnalyzerConstants.APP_TYPE_OSP) {
+ LogParser.setDropCallTraceLog(true);
+ }
+ }
+
+ private String getImageName(String fullPath) {
+ String name = null;
+ name = fullPath
+ .substring(fullPath.lastIndexOf(CommonConstants.SLASH) + 1);
+ return name;
+ }
+
+ private void processImage(final String from) {
+ final String fileName = getImageName(from);
+ final String to = AnalyzerManager.getProject().getSavePath()
+ + File.separator + AnalyzerConstants.IMAGE_FOLDER_NAME
+ + File.separator + fileName;
+
+ new Thread(null, new Runnable() {
+ @Override
+ public void run() {
+ SyncResult res = DACommunicator.pull(from, to);
+ if (null != res && SyncService.RESULT_OK == res.getCode()) {
+ DACommunicator.removeCommand(from);
+ } else {
+ System.out.println("Failed to get '" + from + "' file"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ }, AnalyzerConstants.MESSAGE_INTERNAL_IMAGE_THREAD).start();
+
+ }
+
+ private void processTerminate() {
+ if (!AnalyzerManager.isExit()) {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ StopProcessManager.getInstance().stopProcessStart(
+ AnalyzerLabels.STOP_PROCESS_DLG_SUMMARIZING_DATA); // socket
+ }
+ });
+ }
+ DACommunicator.setRunning(false);
+ }
+
+ private String message = null;
+ private String[] messages = null;
+
+ private int sentenceIndex = -1;
+ private String sentence = null;
+
+ public void run(BufferedReader bufferedReader) {
+
+ startTimer();
+
+ try {
+ while (DACommunicator.isRunning()
+ && null != (message = bufferedReader.readLine())) {
+ if (message.isEmpty()) {
+ continue;
+ }
+
+ messages = message.split(CommonConstants.CMD_SPLIT_READ, 2);
+
+ System.out.println("message :" + message);
+ try {
+ int index = Integer.parseInt(messages[0]);
+ if (AnalyzerConstants.MSG_APP_INFO == index) {
+ sentenceIndex = AnalyzerConstants.MSG_APP_INFO;
+ sentence = message;
+ } else if (AnalyzerConstants.MSG_START.equals(messages[0])) {
+ // start application
+ DACommunicator.execCommand(ResourceCommunicator.getSelectedApp().getExecPath());
+ } else {
+ if (AnalyzerConstants.MSG_APP_INFO == sentenceIndex) {
+ processMessage(sentence);
+ sentence = null;
+ sentenceIndex = -1;
+ }
+
+ if (AnalyzerConstants.MSG_LOG == index
+ || AnalyzerConstants.MSG_USER_PROFILING_SAMPLE == index) {
+ sentenceIndex = AnalyzerConstants.MSG_LOG;
+ if (null != sentence) {
+ processMessage(sentence);
+ }
+ sentence = message;
+ } else {
+ processMessage(message);
+ }
+ }
+ } catch (NumberFormatException e) {
+ if (message.endsWith(AnalyzerConstants.CALLSTACK_END)) {
+ sentence += CommonConstants.NEW_LINE + message;
+ processMessage(sentence);
+ sentence = null;
+ sentenceIndex = -1;
+ } else {
+ if (null != sentence) {
+ sentence += CommonConstants.NEW_LINE_CHAR + message;
+ if (AnalyzerConstants.MSG_APP_INFO == sentenceIndex) {
+ processMessage(sentence);
+ sentence = null;
+ sentenceIndex = -1;
+ }
+ }
+ }
+ }
+ } // end while()
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ StopProcessManager.getInstance().stopProcessStart(
+ AnalyzerLabels.STOP_PROCESS_DLG_SUMMARIZING_DATA); // socket
+ // timeout
+ }
+ });
+ endingSteps();
+ } catch (IOException e) {
+ System.out
+ .println("### socket timeout - TODO: show this as a dialog."); //$NON-NLS-1$
+
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ StopProcessManager
+ .getInstance()
+ .stopProcessStart(
+ AnalyzerLabels.STOP_PROCESS_DLG_DEVICE_DISCONNECTED); // socket
+ // timeout
+ }
+ });
+ endingSteps();
+ }
+ }
+
+ private void endingSteps() {
+ message = null;
+ DACommunicator.setRunning(false);
+ AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_READY);
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ ToolbarArea.getInstance().setToolbarState(
+ ToolbarArea.TOOLBAR_STATE_READY);
+ }
+ });
+ stopTimer();
+ addBufferToList();
+ UIRecorderTool.getInstance().stop();
+ System.out.println("stop log process start");//$NON-NLS-1$
+ StopLogProcessor.runStopLogProcessThread();
+ DACommunicator.closeSocket();
+ DACommunicator.unfoward(DACommunicator.LOCAL_PORT,
+ DACommunicator.REMOTE_PORT);
+
+ AnalyzerUtil.executeCommand(StopHandler.ID);
+ }
+}
--- /dev/null
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1-b02-fcs
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2012.04.18 at 02:25:05 오후 KST
+//
+
+
+package org.tizen.dynamicanalyzer.model;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for BaseLogCenter complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="BaseLogCenter">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="id" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ * <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="totalColumnCount" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ * <element name="customColumn" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ * <element name="ColumnName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="type" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="ColumnSize" type="{http://www.w3.org/2001/XMLSchema}int" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="ColumnOrder" type="{http://www.w3.org/2001/XMLSchema}int" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="ColumnVisibility" type="{http://www.w3.org/2001/XMLSchema}boolean" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="TableColumnName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "BaseLogCenter", propOrder = {
+ "id",
+ "name",
+ "totalColumnCount",
+ "customColumn",
+ "columnName",
+ "type",
+ "columnSize",
+ "columnOrder",
+ "columnVisibility",
+ "tableColumnName"
+})
+@XmlRootElement(name = "BaseLogCenter")
+public class BaseLogCenter {
+
+ protected int id;
+ @XmlElement(required = true)
+ protected String name;
+ protected int totalColumnCount;
+ protected boolean customColumn;
+ @XmlElement(name = "ColumnName")
+ protected List<String> columnName;
+ protected List<String> type;
+ @XmlElement(name = "ColumnSize", type = Integer.class)
+ protected List<Integer> columnSize;
+ @XmlElement(name = "ColumnOrder", type = Integer.class)
+ protected List<Integer> columnOrder;
+ @XmlElement(name = "ColumnVisibility", type = Boolean.class)
+ protected List<Boolean> columnVisibility;
+ @XmlElement(name = "TableColumnName")
+ protected List<String> tableColumnName;
+
+ /**
+ * Gets the value of the id property.
+ *
+ */
+ public int getId() {
+ return id;
+ }
+
+ /**
+ * Sets the value of the id property.
+ *
+ */
+ public void setId(int value) {
+ this.id = value;
+ }
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+ /**
+ * Gets the value of the totalColumnCount property.
+ *
+ */
+ public int getTotalColumnCount() {
+ return totalColumnCount;
+ }
+
+ /**
+ * Sets the value of the totalColumnCount property.
+ *
+ */
+ public void setTotalColumnCount(int value) {
+ this.totalColumnCount = value;
+ }
+
+ /**
+ * Gets the value of the customColumn property.
+ *
+ */
+ public boolean isCustomColumn() {
+ return customColumn;
+ }
+
+ /**
+ * Sets the value of the customColumn property.
+ *
+ */
+ public void setCustomColumn(boolean value) {
+ this.customColumn = value;
+ }
+
+ /**
+ * Gets the value of the columnName property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the columnName property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getColumnName().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link String }
+ *
+ *
+ */
+ public List<String> getColumnName() {
+ if (columnName == null) {
+ columnName = new ArrayList<String>();
+ }
+ return this.columnName;
+ }
+
+ /**
+ * Gets the value of the type property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the type property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getType().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link String }
+ *
+ *
+ */
+ public List<String> getType() {
+ if (type == null) {
+ type = new ArrayList<String>();
+ }
+ return this.type;
+ }
+
+ /**
+ * Gets the value of the columnSize property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the columnSize property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getColumnSize().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link Integer }
+ *
+ *
+ */
+ public List<Integer> getColumnSize() {
+ if (columnSize == null) {
+ columnSize = new ArrayList<Integer>();
+ }
+ return this.columnSize;
+ }
+
+ /**
+ * Gets the value of the columnOrder property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the columnOrder property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getColumnOrder().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link Integer }
+ *
+ *
+ */
+ public List<Integer> getColumnOrder() {
+ if (columnOrder == null) {
+ columnOrder = new ArrayList<Integer>();
+ }
+ return this.columnOrder;
+ }
+
+ /**
+ * Gets the value of the columnVisibility property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the columnVisibility property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getColumnVisibility().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link Boolean }
+ *
+ *
+ */
+ public List<Boolean> getColumnVisibility() {
+ if (columnVisibility == null) {
+ columnVisibility = new ArrayList<Boolean>();
+ }
+ return this.columnVisibility;
+ }
+
+ /**
+ * Gets the value of the tableColumnName property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the tableColumnName property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getTableColumnName().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link String }
+ *
+ *
+ */
+ public List<String> getTableColumnName() {
+ if (tableColumnName == null) {
+ tableColumnName = new ArrayList<String>();
+ }
+ return this.tableColumnName;
+ }
+
+}
--- /dev/null
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1-b02-fcs
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2012.04.18 at 02:25:05 오후 KST
+//
+
+
+package org.tizen.dynamicanalyzer.model;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for Check complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Check">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="type" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ * <element name="category" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ * <element name="keyIndex" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ * <element name="freeIndex" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ * <element name="checkUserCall" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "Check", propOrder = {
+ "name",
+ "type",
+ "category",
+ "keyIndex",
+ "freeIndex",
+ "checkUserCall"
+})
+public class Check {
+
+ @XmlElement(required = true)
+ protected String name;
+ protected int type;
+ protected int category;
+ protected int keyIndex;
+ protected int freeIndex;
+ protected boolean checkUserCall;
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+ /**
+ * Gets the value of the type property.
+ *
+ */
+ public int getType() {
+ return type;
+ }
+
+ /**
+ * Sets the value of the type property.
+ *
+ */
+ public void setType(int value) {
+ this.type = value;
+ }
+
+ /**
+ * Gets the value of the category property.
+ *
+ */
+ public int getCategory() {
+ return category;
+ }
+
+ /**
+ * Sets the value of the category property.
+ *
+ */
+ public void setCategory(int value) {
+ this.category = value;
+ }
+
+ /**
+ * Gets the value of the keyIndex property.
+ *
+ */
+ public int getKeyIndex() {
+ return keyIndex;
+ }
+
+ /**
+ * Sets the value of the keyIndex property.
+ *
+ */
+ public void setKeyIndex(int value) {
+ this.keyIndex = value;
+ }
+
+ /**
+ * Gets the value of the freeIndex property.
+ *
+ */
+ public int getFreeIndex() {
+ return freeIndex;
+ }
+
+ /**
+ * Sets the value of the freeIndex property.
+ *
+ */
+ public void setFreeIndex(int value) {
+ this.freeIndex = value;
+ }
+
+ /**
+ * Gets the value of the checkUserCall property.
+ *
+ */
+ public boolean isCheckUserCall() {
+ return checkUserCall;
+ }
+
+ /**
+ * Sets the value of the checkUserCall property.
+ *
+ */
+ public void setCheckUserCall(boolean value) {
+ this.checkUserCall = value;
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ColumnData {
+ private String text = null;
+ private int width = 0;
+ private List<ColumnData> children = null;
+
+ public ColumnData(String columnName) {
+ text = columnName;
+ children = new ArrayList<ColumnData>();
+ }
+
+ public ColumnData(String columnName, int width) {
+ text = columnName;
+ this.width = width;
+ children = new ArrayList<ColumnData>();
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public List<ColumnData> getChildren() {
+ return children;
+ }
+
+ public boolean isParent() {
+ if (children.isEmpty()) {
+ return false;
+ }
+ return true;
+ }
+
+ public void setWidth(int width) {
+ this.width = width;
+ }
+
+ public int getWidth() {
+ return width;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.model;
+
+import java.util.List;
+
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.ui.page.ViewAction;
+
+public class DAView extends Composite implements ViewAction {
+ //name is using on tab
+ protected String name = null;
+ protected int[] oldInnerLayout = null;
+ protected int[] oldOuterLayout = null;
+
+ private int[] innerMaxWeight = null;
+ private int[] outerMaxWeight = null;
+
+ public DAView(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ @Override
+ public void updateView() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void updateLog(LogPackage logPack) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void clear() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public Control getControl() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void updateView(DASelectionData data) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void otherViewSelectionOccured() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public String getViewName() {
+ return name;
+ }
+
+ public void setMaxSize(boolean maximized) {
+
+ if (null == innerMaxWeight || null == outerMaxWeight) {
+ return;
+ }
+
+ Composite parent = getParent();
+ if (!(parent instanceof SashForm)) {
+ parent = parent.getParent();
+ if (!(parent instanceof SashForm)) {
+ return;
+ }
+ }
+
+ Composite pParent = parent.getParent();
+ if (!(pParent instanceof SashForm)) {
+ return;
+ }
+
+ SashForm innerForm = (SashForm) parent;
+ SashForm outerForm = (SashForm) pParent;
+
+ if (maximized) {
+ oldInnerLayout = innerForm.getWeights();
+ oldOuterLayout = outerForm.getWeights();
+ innerForm.setWeights(innerMaxWeight);
+ outerForm.setWeights(outerMaxWeight);
+ } else {
+ innerForm.setWeights(oldInnerLayout);
+ outerForm.setWeights(oldOuterLayout);
+ }
+ }
+
+ public void setMaxWeight(int[] inner, int[] outer) {
+ innerMaxWeight = inner;
+ outerMaxWeight = outer;
+ }
+
+ @Override
+ public void setSelection(List<String> data) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
--- /dev/null
+package org.tizen.dynamicanalyzer.model;
+
+import org.tizen.sdblib.IDevice;
+
+public class DeviceInfo {
+ private IDevice device;
+ private String selectedApplication;
+
+ public DeviceInfo(IDevice device) {
+ this.device = device;
+ }
+
+ public void setSelectedAppName(String name) {
+ selectedApplication = name;
+ }
+
+ public String getSelectedAppName() {
+ return selectedApplication;
+ }
+
+ public IDevice getIDevice() {
+ return device;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.model;
+
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+
+public class FindProperty {
+ private boolean backward;
+ private boolean caseSensitive;
+ private boolean wholeWord;
+ private int index;
+ private String lastSearch;
+
+ public FindProperty() {
+ backward = false;
+ caseSensitive = false;
+ wholeWord = false;
+ index = -1;
+ lastSearch = CommonConstants.EMPTY;
+ }
+
+ public String getLastSearch() {
+ return lastSearch;
+ }
+
+ public void setLastSearch(String lastSearch) {
+ this.lastSearch = lastSearch;
+ }
+
+ public boolean isBackward() {
+ return backward;
+ }
+
+ public void setBackward(boolean backward) {
+ this.backward = backward;
+ }
+
+ public boolean isCaseSensitive() {
+ return caseSensitive;
+ }
+
+ public void setCaseSensitive(boolean caseSensitive) {
+ this.caseSensitive = caseSensitive;
+ }
+
+ public boolean isWholeWord() {
+ return wholeWord;
+ }
+
+ public void setWholeWord(boolean wholeWord) {
+ this.wholeWord = wholeWord;
+ }
+
+ public int getIndex() {
+ return index;
+ }
+
+ public void setIndex(int index) {
+ this.index = index;
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.model;
+
+public class ImageInfo {
+ private String seq;
+ private String time;
+
+ public String getTime() {
+ return time;
+ }
+
+ public void setTime(String time) {
+ this.time = time;
+ }
+
+ public void setSeq(String seq) {
+ this.seq = seq;
+ }
+
+ public String getSeq()
+ {
+ return seq;
+ }
+
+}
--- /dev/null
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1-b02-fcs
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2012.04.18 at 02:25:05 오후 KST
+//
+
+
+package org.tizen.dynamicanalyzer.model;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+
+
+/**
+ * <p>Java class for LeakCheckList complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="LeakCheckList">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="checks" type="{org.tizen.dynamicanalyzer}Check" maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "LeakCheckList", propOrder = {
+ "checks"
+})
+@XmlRootElement(name = "LeakCheckList")
+public class LeakCheckList {
+
+ protected List<Check> checks;
+
+ /**
+ * Gets the value of the checks property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the checks property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getChecks().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link Check }
+ *
+ *
+ */
+ public List<Check> getChecks() {
+ if (checks == null) {
+ checks = new ArrayList<Check>();
+ }
+ return this.checks;
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.model;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.sql.SqlManager;
+import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakData;
+
+public class LogCenter extends BaseLogCenter {
+
+ private String insertQuery = null;
+ private String selectCountQuery = null;
+ private int dataSize = 0;
+ private HashMap<String, LeakData> leakHash = null;
+ private int index = 0;
+ private List<Integer> columnSizes = null;
+ private boolean leakHashLock = false;
+
+ public List<Integer> getColumnSizes() {
+ if (null == columnSizes) {
+ columnSizes = new ArrayList<Integer>();
+ }
+ return columnSizes;
+ }
+
+ public int getIndex() {
+ return index;
+ }
+
+ public void addIndex() {
+ index++;
+ }
+
+ public int getDataSize() {
+ return dataSize;
+ }
+
+ public void setDataSize(int size) {
+ dataSize = size;
+ }
+
+ public String getInsertQuery() {
+ if (null == insertQuery) {
+ insertQuery = SqlManager.getInstance().createInsertQuery(this);
+ }
+ return insertQuery;
+ }
+
+ public String getSelectCountQuery() {
+ if (null == selectCountQuery) {
+ StringBuffer query = new StringBuffer();
+ query.append("select count(SeqNumber) from "); //$NON-NLS-1$
+ query.append(this.name);
+ query.append(CommonConstants.SEMICOLON);
+ selectCountQuery = query.toString();
+ }
+ return selectCountQuery;
+ }
+
+ private HashMap<String, LeakData> getLeakHash() {
+ if (null == leakHash) {
+ leakHash = new HashMap<String, LeakData>();
+ }
+ return leakHash;
+ }
+
+ private void leakHashLock() {
+ while (leakHashLock) {
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ leakHashLock = true;
+ }
+
+ private void leakHashUnLock() {
+ leakHashLock = false;
+ }
+
+ public LeakData getLeakData(String key) {
+ leakHashLock();
+ LeakData ret = getLeakHash().get(key);
+ leakHashUnLock();
+ return ret;
+ }
+
+ public void removeLeakData(String key) {
+ leakHashLock();
+ getLeakHash().remove(key);
+ leakHashUnLock();
+ }
+
+ public void putLeakData(String key, LeakData value) {
+ leakHashLock();
+ getLeakHash().put(key, value);
+ leakHashUnLock();
+ }
+
+ public int sizeOfLeakDatas() {
+ leakHashLock();
+ int ret = getLeakHash().size();
+ leakHashUnLock();
+ return ret;
+ }
+}
--- /dev/null
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1-b02-fcs
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2012.04.18 at 02:25:05 오후 KST
+//
+
+
+package org.tizen.dynamicanalyzer.model;
+
+import javax.xml.bind.annotation.XmlRegistry;
+
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the org.tizen.dynamicanalyzer.model package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.tizen.dynamicanalyzer.model
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link Check }
+ *
+ */
+ public Check createCheck() {
+ return new Check();
+ }
+
+ /**
+ * Create an instance of {@link LeakCheckList }
+ *
+ */
+ public LeakCheckList createLeakCheckList() {
+ return new LeakCheckList();
+ }
+
+ /**
+ * Create an instance of {@link BaseLogCenter }
+ *
+ */
+ public BaseLogCenter createBaseLogCenter() {
+ return new BaseLogCenter();
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.model;
+
+public class SnapShotInfo {
+ private double snapshotTime;
+ private int snapshotSeq;
+
+ public double getTime() {
+ return snapshotTime;
+ }
+
+ public void setTime(long time) {
+ snapshotTime = time;
+ }
+
+ public int getSequence() {
+ return snapshotSeq;
+ }
+
+ public void setSequence(int sequence) {
+ snapshotSeq = sequence;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.model;
+
+import java.awt.Color;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.common.SnapshotConstants;
+import org.tizen.dynamicanalyzer.project.Project;
+import org.tizen.dynamicanalyzer.utils.ImageUtil;
+
+public class SnapshotData {
+ private static SnapshotData snapshotData = new SnapshotData();
+
+ private List<SnapShotInfo> infos = new ArrayList<SnapShotInfo>();
+ private HashMap<Integer, ImageDescriptor> imageHash = new HashMap<Integer, ImageDescriptor>();
+ private HashMap<Integer, Double> timeHash = new HashMap<Integer, Double>();
+
+ public static SnapshotData getInstance() {
+ return snapshotData;
+ }
+
+ public void addImageItem(SnapShotInfo snapshotInfo) {
+ if (null != snapshotInfo) {
+ ImageDescriptor imageDesc = null;
+ if (!timeHash.containsKey(snapshotInfo.getSequence())) {
+ infos.add(snapshotInfo);
+ }
+
+ String origImagePath = getImagePathBySeq(snapshotInfo.getSequence());
+ String newImagePath = getImageNewPathBySeq(snapshotInfo
+ .getSequence());
+ ImageUtil.resize(origImagePath, newImagePath,
+ SnapshotConstants.SNAPSHOT_IMAGE_WIDTH,
+ SnapshotConstants.SNAPSHOT_IMAGE_HEIGHT, Color.WHITE);
+ File imageFile = new File(newImagePath);
+ if (imageFile.exists()) {
+ imageDesc = ImageDescriptor.createFromFile(null, newImagePath);
+ }
+
+ imageHash.put(snapshotInfo.getSequence(), imageDesc);
+ timeHash.put(snapshotInfo.getSequence(), snapshotInfo.getTime());
+ }
+ }
+
+ public ImageDescriptor getRedRectImageBySeq(int seq) {
+ ImageDescriptor imageDesc = null;
+
+ String origImagePath = getImagePathBySeq(seq);
+ String newImagePath = getImageNewPathBySeq(seq);
+ ImageUtil.resize(origImagePath, newImagePath,
+ SnapshotConstants.SNAPSHOT_IMAGE_WIDTH,
+ SnapshotConstants.SNAPSHOT_IMAGE_HEIGHT, Color.RED);
+ File imageFile = new File(newImagePath);
+ if (imageFile.exists()) {
+ imageDesc = ImageDescriptor.createFromFile(null, newImagePath);
+ }
+
+ return imageDesc;
+ }
+
+ private String getImageNewPathBySeq(int seq) {
+ Project project = AnalyzerManager.getProject();
+ String imageFolderPath = project.getSavePath() + File.separator
+ + AnalyzerConstants.IMAGE_FOLDER_NAME;
+ String imagePath = imageFolderPath + File.separator + seq + "_new" //$NON-NLS-1$
+ + CommonConstants.EXTENSION_PNG_IMAGE;
+ return imagePath;
+ }
+
+ private String getImagePathBySeq(int seq) {
+ Project project = AnalyzerManager.getProject();
+ String imageFolderPath = project.getSavePath() + File.separator
+ + AnalyzerConstants.IMAGE_FOLDER_NAME;
+ String imagePath = imageFolderPath + File.separator + seq
+ + CommonConstants.EXTENSION_PNG_IMAGE;
+ return imagePath;
+ }
+
+ public void clear() {
+ infos.clear();
+ imageHash.clear();
+ timeHash.clear();
+ }
+
+ public List<SnapShotInfo> getSnapshotInfos() {
+ return infos;
+ }
+
+ public HashMap<Integer, ImageDescriptor> getImageHash() {
+ return imageHash;
+ }
+
+ public HashMap<Integer, Double> getTimeHash() {
+ return timeHash;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.graphics.Image;
+
+public class TableInput {
+ private List<String> text;
+ private List<Image> images;
+ private Object data;
+ private boolean inRange = false;
+ private boolean isSecondSelection = false;
+
+ public TableInput() {
+ text = new ArrayList<String>();
+ images = new ArrayList<Image>();
+ }
+
+ public List<String> getText() {
+ return text;
+ }
+
+ public void setText(List<String> text) {
+ this.text = text;
+ }
+
+ public List<Image> getImages() {
+ return images;
+ }
+
+ public void setImages(List<Image> images) {
+ this.images = images;
+ }
+
+ public Object getData() {
+ return data;
+ }
+
+ public void setData(Object data) {
+ this.data = data;
+ }
+
+ public void setInRange(boolean isIn) {
+ inRange = isIn;
+ }
+
+ public boolean isInRange() {
+ return inRange;
+ }
+
+ public void setSecondSelection(boolean isSelected) {
+ isSecondSelection = isSelected;
+ }
+
+ public boolean isSecondSelection() {
+ return isSecondSelection;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class TreeInput extends TableInput {
+ List<TreeInput> children = null;
+ String parent = null;
+ String child = null;
+
+ public List<TreeInput> getChildren() {
+ if (null == children) {
+ children = new ArrayList<TreeInput>();
+ }
+ return children;
+ }
+
+ public String getParent() {
+ return parent;
+ }
+ public void setParent(String parent) {
+ this.parent = parent;
+ }
+
+ public String getChild() {
+ return child;
+ }
+ public void setChild(String child) {
+ this.child = child;
+ }
+}
--- /dev/null
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1-b02-fcs
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2012.04.18 at 02:25:05 오후 KST
+//
+
+@javax.xml.bind.annotation.XmlSchema(namespace = "org.tizen.dynamicanalyzer", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.tizen.dynamicanalyzer.model;
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.nl;
+
+import org.eclipse.osgi.util.NLS;
+
+public class AnalyzerLabels extends NLS {
+
+ private static final String BUNDLE_NAME = "org.tizen.dynamicanalyzer.nl.AnalyzerLabels"; //$NON-NLS-1$
+
+ public static String OFF;
+ public static String ON;
+
+ public static String APPLY;
+ public static String OK;
+ public static String CANCEL;
+
+ public static String YES;
+ public static String NO;
+
+ public static String OPEN;
+ public static String CLOSE;
+
+ // Toolbar button
+ public static String START_TRACE;
+ public static String STOP_TRACE;
+ public static String SAVE_TRACE;
+ public static String OPEN_TRACE;
+ public static String REPLAY;
+ public static String RANGE_PAGE;
+ public static String VIEW_SOURCE;
+ public static String SNAPSHOT_ENABLE;
+ public static String SETTING;
+
+ // setting menu
+ public static String ABOUT;
+ public static String LICENSE;
+ public static String CONFIGURATION;
+
+ // SingletonInfoDlg.
+ public static String DA_WARNING;
+
+ // Source tooltip
+ public static String SOURCE_NOT_EXIST;
+
+ // Source popup
+ public static String ERROR;
+ public static String CONFIRMATION;
+ public static String VIEW_SOURCE_MESSAGE;
+ public static String VIEW_SOURCE_ERROR_MESSAGE;
+
+ public static String EMPTY_STRING;
+
+ public static String SYMBOL_MANAGER_UNKNOWN;
+
+ public static String MESSAGE_PROCESS_PG_WARNING;
+ public static String MESSAGE_PROCESS_VIEW_SOURCE;
+
+ public static String ANALYZER_CONSTANTS_SOURCELINE_BAD_ADDRESS;
+ public static String ANALYZER_CONSTANTS_SOURCELINE_FILE_NOT_FOUND;
+ public static String ANALYZER_CONSTANTS_SOURCELINE_NO_MATCHING_LINE;
+ public static String ANALYZER_CONSTANTS_SOURCELINE_NO_SOURCELINE_DATA;
+ public static String ANALYZER_CONSTANTS_SOURCELINE_NO_SYMBOL_INFORMATION;
+ public static String ANALYZER_CONSTANTS_SOURCELINE_NOT_FOUND;
+ public static String ANALYZER_CONSTANTS_SOURCELINE_NULL_ADDRESS;
+ public static String ANALYZER_CONSTANTS_SOURCELINE_NULL_PATH;
+ public static String ANALYZER_CONSTANTS_SOURCELINE_PIE_BUILD;
+ public static String ANALYZER_CONSTANTS_SOURCELINE_UNKNOWN_ERROR;
+
+ public static String COOLBAR_AREA_FILE;
+ public static String COOLBAR_AREA_SUMMARY;
+ public static String COOLBAR_AREA_THREAD;
+ public static String COOLBAR_AREA_UI;
+ public static String COOLBAR_AREA_TIMELINE;
+ public static String COOLBAR_AREA_RANGE;
+ public static String COOLBAR_AREA_CONFIGURATION_FEATURES;
+ public static String COOLBAR_AREA_CONFIGURATION_SETTING;
+
+ public static String LICENSE_DIALOG_NOT_FOUND;
+
+ public static String ABOUT_DIALOG_TITLE;
+ public static String ABOUT_DIALOG_BUILD_TIME_TAB;
+ public static String ABOUT_DIALOG_VERSION_TAB;
+ public static String ABOUT_DIALOG_LICENSE;
+
+ public static String CONFIGURATION_DIALOG_AUTO_RANGE;
+ public static String CONFIGURATION_DIALOG_INTERNAL_LEAK;
+ public static String CONFIGURATION_DIALOG_SHOW_SNAPSHOT;
+
+ public static String OPEN_TRACE_DLG_SAVED_FILE;
+ public static String OPEN_TRACE_DLG_TEMP_FILE;
+ public static String OPEN_TRACE_DLG_TEMP_FILE_NAME;
+ public static String OPEN_TRACE_DLG_TRACE_FILE_NAME;
+ public static String OPEN_TRACE_DLG_TRACE_DATE;
+ public static String OPEN_TRACE_DLG_CURRENT_TRACE;
+ public static String OPEN_TRACE_DLG_OLD_VERSION;
+ public static String OPEN_TRACE_DLG_DETAILS_DEVICE;
+ public static String OPEN_TRACE_DLG_DETAILS_APPLICATION;
+ public static String OPEN_TRACE_DLG_DETAILS_CREATE_TIME;
+ public static String OPEN_TRACE_DLG_DETAILS_RECORDING_TIME;
+ public static String OPEN_TRACE_DLG_SAVE_TABLE_NAME;
+ public static String OPEN_TRACE_DLG_TEMP_TABLE_NAME;
+ public static String OPEN_TRACE_DLG_DETAILS_TITLE;
+
+ public static String FIND_DLG_TITLE_PREFIX;
+ public static String FIND_DLG_TITLE_POSTFIX;
+ public static String FIND_DLG_FIND_BUTTON;
+ public static String FIND_DLG_DIRECTION;
+ public static String FIND_DLG_DIRECTION_FORWARD;
+ public static String FIND_DLG_DIRECTION_BACKWARD;
+ public static String FIND_DLG_OPTION;
+ public static String FIND_DLG_CASE_SENSITIVE;
+ public static String FIND_DLG_WHOLE_WORD;
+
+ public static String SAVE_TRACE_DLG_SAVE_FILE_NAME;
+
+ public static String OPEN_TRACE_PROGRESS_LOADING;
+ public static String OPEN_TRACE_PROGRESS_VERSION_INVALID;
+ public static String OPEN_TRACE_PROGRESS_VERSION_INVALID_REMOVE;
+ public static String OPEN_TRACE_PROGRESS_INVALID;
+ public static String OPEN_TRACE_PROGRESS_INVALID_REMOVE;
+ public static String OPEN_TRACE_PROGRESS_LOADING_FAILED;
+ public static String OPEN_TRACE_PROGRESS_ERROR;
+
+ public static String PATH_WARNING;
+ public static String OS_WARNING;
+ public static String RE_TRACE_FORM_IDE;
+ public static String IDE_DA_COMMUNICATION_ERROR_MESSAGE;
+ public static String START_TRACE_ERROR;
+ public static String INVALID_APPLICATION;
+
+ public static String STOP_PROCESS_DLG_PLEASE_WAIT;
+ public static String STOP_PROCESS_DLG_SUMMARIZING_DATA;
+ public static String STOP_PROCESS_DLG_DEVICE_DISCONNECTED;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, AnalyzerLabels.class);
+ }
+
+ private AnalyzerLabels() {
+ }
+
+}
--- /dev/null
+
+OFF=Off
+ON=On
+
+APPLY=Apply
+OK=Ok
+CANCEL=Cancel
+
+YES=Yes
+NO=No
+
+OPEN=Open
+CLOSE=Close
+
+#Toolbar button
+START_TRACE=Start trace
+STOP_TRACE=Stop trace
+SAVE_TRACE=Save trace
+OPEN_TRACE=Open trace
+REPLAY=Replay
+RANGE_PAGE=Range page
+VIEW_SOURCE=View source
+SNAPSHOT_ENABLE=Take snapshot
+SETTING=Settings
+
+#Setting menu
+ABOUT=About Tizen Dynamic Analyzer
+LICENSE=License
+CONFIGURATION=Configuration
+
+# SingletonInfoDlg.
+DA_WARNING=Warning
+
+#Source tooltip
+SOURCE_NOT_EXIST=Source file does not exist.
+
+#Source popup
+ERROR=Error
+CONFIRMATION=Confirmation
+VIEW_SOURCE_MESSAGE=Are you sure you want to view the source in the IDE?
+VIEW_SOURCE_ERROR_MESSAGE=Opening the source file failed.
+EMPTY_STRING=
+
+SYMBOL_MANAGER_UNKNOWN=Unknown function
+
+MESSAGE_PROCESS_PG_WARNING=To view the source, compile with the '-pg' option
+MESSAGE_PROCESS_VIEW_SOURCE=View source
+
+ANALYZER_CONSTANTS_SOURCELINE_BAD_ADDRESS=Address not found. Check the address.
+ANALYZER_CONSTANTS_SOURCELINE_FILE_NOT_FOUND=Application binary not found in the host.
+ANALYZER_CONSTANTS_SOURCELINE_NO_MATCHING_LINE=Matching source not found; the method comes from a shared library.
+ANALYZER_CONSTANTS_SOURCELINE_NO_SOURCELINE_DATA=Source data not supported.
+ANALYZER_CONSTANTS_SOURCELINE_NO_SYMBOL_INFORMATION=Error in reading the symbol. The host and target application binary may not be the same.
+ANALYZER_CONSTANTS_SOURCELINE_NOT_FOUND=Source file not found.
+ANALYZER_CONSTANTS_SOURCELINE_NULL_ADDRESS=Address not found. Enter a valid address.
+ANALYZER_CONSTANTS_SOURCELINE_NULL_PATH=Symbol not found in the application binary.
+ANALYZER_CONSTANTS_SOURCELINE_PIE_BUILD=Application built with the '-pie' option. Matching source with this option not found.
+ANALYZER_CONSTANTS_SOURCELINE_UNKNOWN_ERROR=Unknown error.
+
+COOLBAR_AREA_FILE=File
+COOLBAR_AREA_SUMMARY=Summary
+COOLBAR_AREA_THREAD=Thread
+COOLBAR_AREA_UI=UI
+COOLBAR_AREA_TIMELINE=Timeline
+COOLBAR_AREA_RANGE=Range
+
+COOLBAR_AREA_CONFIGURATION_FEATURES=Features
+COOLBAR_AREA_CONFIGURATION_SETTING=Configuration
+
+LICENSE_DIALOG_NOT_FOUND=License file not found
+
+ABOUT_DIALOG_TITLE=Tizen Dynamic Analyzer
+ABOUT_DIALOG_BUILD_TIME_TAB=Build time\t:
+ABOUT_DIALOG_VERSION_TAB=Version\t\t:
+ABOUT_DIALOG_LICENSE=License
+
+CONFIGURATION_DIALOG_AUTO_RANGE=Auto Range View Transmit
+CONFIGURATION_DIALOG_INTERNAL_LEAK=Internal Leak Analysis
+CONFIGURATION_DIALOG_SHOW_SNAPSHOT=View Snapshot
+
+OPEN_TRACE_DLG_SAVED_FILE=Saved file
+OPEN_TRACE_DLG_TEMP_FILE=Temporary file
+OPEN_TRACE_DLG_TEMP_FILE_NAME=Temporary file name
+OPEN_TRACE_DLG_TRACE_FILE_NAME=Trace file name
+OPEN_TRACE_DLG_TRACE_DATE=Create time
+
+OPEN_TRACE_PROGRESS_LOADING=Loading trace data
+OPEN_TRACE_PROGRESS_VERSION_INVALID=Trace file version is invalid.
+OPEN_TRACE_PROGRESS_VERSION_INVALID_REMOVE=Trace file version is invalid. The file will be deleted.
+OPEN_TRACE_PROGRESS_INVALID=Trace file is invalid.
+OPEN_TRACE_PROGRESS_INVALID_REMOVE=Trace file is invalid. The file will be deleted.
+OPEN_TRACE_PROGRESS_LOADING_FAILED=Trace file data loading failed.
+OPEN_TRACE_PROGRESS_ERROR=Error
+
+OPEN_TRACE_DLG_CURRENT_TRACE=Current trace cannot be deleted.
+OPEN_TRACE_DLG_OLD_VERSION=Save file version invalid.
+OPEN_TRACE_DLG_DETAILS_DEVICE=Device :
+OPEN_TRACE_DLG_DETAILS_APPLICATION=Application :
+OPEN_TRACE_DLG_DETAILS_CREATE_TIME=Create time :
+OPEN_TRACE_DLG_DETAILS_RECORDING_TIME=Recording time :
+OPEN_TRACE_DLG_SAVE_TABLE_NAME=Save Files
+OPEN_TRACE_DLG_TEMP_TABLE_NAME=Temporary Files
+OPEN_TRACE_DLG_DETAILS_TITLE=Trace details
+
+FIND_DLG_TITLE_PREFIX=Search from
+FIND_DLG_TITLE_POSTFIX= table
+FIND_DLG_FIND_BUTTON=Search
+FIND_DLG_DIRECTION=Direction :
+FIND_DLG_DIRECTION_FORWARD=Forward
+FIND_DLG_DIRECTION_BACKWARD=Back
+FIND_DLG_OPTION=Option :
+FIND_DLG_CASE_SENSITIVE=Case sensitive
+FIND_DLG_WHOLE_WORD=Whole word
+
+SAVE_TRACE_DLG_SAVE_FILE_NAME=Enter save file name
+
+PATH_WARNING=Please install the Tizen SDK
+OS_WARNING=Current OS not supported. Please check your OS.
+RE_TRACE_FORM_IDE=Another application is already running.
+IDE_DA_COMMUNICATION_ERROR_MESSAGE=IDE connection error.
+START_TRACE_ERROR=Start trace failed.\nSee log.
+INVALID_APPLICATION=Invalid Application
+
+STOP_PROCESS_DLG_PLEASE_WAIT=Please wait
+STOP_PROCESS_DLG_SUMMARIZING_DATA=Summarizing collected data
+STOP_PROCESS_DLG_DEVICE_DISCONNECTED=Device disconnected
\ No newline at end of file
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * YeongTaik Byeon <yeongtaik.byeon@samsung.com>
+ * HyunJong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.nl;
+
+import org.eclipse.osgi.util.NLS;
+
+public class ConfigureLabels extends NLS {
+ private static final String BUNDLE_NAME = "org.tizen.dynamicanalyzer.nl.ConfigureLabels"; //$NON-NLS-1$
+
+ //table
+ public static String FEATURE_TABLE_TITLE;
+ public static String FEATURE_TABLE_FEATURE_EMPTY;
+ public static String FEATURE_TABLE_FEATURE_NAME;
+ public static String FEATURE_DETAIL_TITLE;
+
+ public static String SETTING_TABLE_TITLE;
+ public static String SETTING_WHITE;
+ public static String SETTING_BLACK;
+ public static String SETTING_CONFIGURATION_TITLE;
+
+ public static String WELCONE_ASK_USE_AGAIN;
+
+ //features name
+
+ public static String FUNCTIONPROFILING;
+ public static String ALLOCATION;
+ public static String FILE;
+ public static String THREAD;
+ public static String USERINTERFACE;
+ public static String SNAPSHOT;
+ public static String EVENT;
+ public static String RECORDING;
+
+ public static String DETAIL_FUNCTIONPROFILING;
+ public static String DETAIL_ALLOCATION;
+ public static String DETAIL_FILE;
+ public static String DETAIL_THREAD;
+ public static String DETAIL_USERINTERFACE;
+ public static String DETAIL_SNAPSHOT;
+ public static String DETAIL_EVENT;
+ public static String DETAIL_RECORDING;
+
+
+ public static String SHOW_INITIAL;
+ public static String AUTO_STOP;
+
+ public static String OFF;
+ public static String ON;
+ public static String INTERNALCALL;
+ public static String RANGEAUTOSELECT;
+ public static String PLATFORM;
+ public static String PLATFORM_ETC;
+ public static String SHOWLOG;
+ public static String SAMPLINGPERIOD;
+ public static String PROCESSSIZE;
+ public static String SINGLETON_FOCUS_DA_PID;
+ public static String CONFIGUREMANAGER_CHART_AVAILABLE_ITEM_LIST;
+ public static String CONFIGUREMANAGER_CHART_SELECTED_ITEM_LIST;
+
+ public static String THEME;
+
+
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, ConfigureLabels.class);
+ }
+
+ private ConfigureLabels(){
+ }
+}
--- /dev/null
+OFF=off
+ON=on
+INTERNALCALL=Internal call
+RANGEAUTOSELECT=Range auto select
+SNAPSHOT=Snapshot
+PLATFORM=Platform
+PLATFORM_ETC=etc
+SHOWLOG=Show log
+SAMPLINGPERIOD=Sampling period
+PROCESSSIZE=Process size
+SINGLETON_FOCUS_DA_PID=Singleton focus DA PID
+CONFIGUREMANAGER_CHART_AVAILABLE_ITEM_LIST=Available chart list
+CONFIGUREMANAGER_CHART_SELECTED_ITEM_LIST=Selected chart list
+FUNCTIONPROFILING=FunctionProfiling
+ALLOCATION=Allocation
+FILE=File
+THREAD=Thread
+USERINTERFACE=UserInterface
+SNAPSHOT=Snapshot
+EVENT=Event
+RECORDING=Recording
+DETAIL_FUNCTIONPROFILING=Shows profile of Function.
+DETAIL_ALLOCATION=Shows heap memory allocation.
+DETAIL_FILE=Shows an analysis of the file usage on the File tab and file chart in the timeLine Page
+DETAIL_THREAD=The Thread tab shows information about thread and synchronization.
+DETAIL_USERINTERFACE=The UI tab shows UI component hierarchy and UI-related function profiling.
+DETAIL_SNAPSHOT=Shows screenShots of application.
+DETAIL_EVENT=Shows UI events that occur on the device.
+DETAIL_RECORDING= Save profiling information for RePlay.
+THEME=theme
+FEATURE_TABLE_TITLE=Default Analysis Features Settings
+FEATURE_TABLE_FEATURE_EMPTY=
+FEATURE_TABLE_FEATURE_NAME=Name
+FEATURE_DETAIL_TITLE=Details
+SETTING_TABLE_TITLE=Appearance Setting
+SETTING_WHITE=White
+SETTING_BLACK=Black
+SETTING_CONFIGURATION_TITLE=Configuration Setting
+SHOW_INITIAL=Not show initial feature setting
+AUTO_STOP=Auto stop while replaying
+WELCONE_ASK_USE_AGAIN=Use this as the default and do not ask again.
\ No newline at end of file
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * YeongTaik Byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.nl;
+
+import org.eclipse.osgi.util.NLS;
+
+public class DAPageChartLabels extends NLS {
+ private static final String BUNDLE_NAME = "org.tizen.dynamicanalyzer.nl.DAPageChartLabels"; //$NON-NLS-1$
+ public static String KEY_COLUMN_HEADER_IMAGE_LEFT_MARGIN;
+ public static String KEY_COLUMN_HEADER_IMAGE_TOP_MARGIN;
+ public static String KEY_COLUMN_HEADER_TEXT_LEFT_MARGIN;
+ public static String KEY_COLUMN_HEADER_TEXT_TOP_MARGIN;
+ public static String KEY_CHART_SCALE;
+ public static String KEY_CHART_START_TIME;
+ public static String KEY_CHART_LAST_TIME;
+ public static String KEY_CHART_ZOOMIN_HEIGHT;
+ public static String KEY_CHART_ZOOMOUT_HEIGHT;
+ public static String KEY_SERIES_SERIES_LIST;
+ public static String KEY_SERIES_CHILDREN;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, DAPageChartLabels.class);
+ }
+ private DAPageChartLabels() {
+ }
+}
--- /dev/null
+KEY_COLUMN_HEADER_IMAGE_LEFT_MARGIN=ImageLeftMargin
+KEY_COLUMN_HEADER_IMAGE_TOP_MARGIN=ImageTopMargin
+KEY_COLUMN_HEADER_TEXT_LEFT_MARGIN=TextLeftMargin
+KEY_COLUMN_HEADER_TEXT_TOP_MARGIN=TextTopMargin
+KEY_CHART_SCALE=ChartScale
+KEY_CHART_START_TIME=StartTime
+KEY_CHART_LAST_TIME=LastTime
+KEY_CHART_ZOOMIN_HEIGHT=ZoomInHeight
+KEY_CHART_ZOOMOUT_HEIGHT=ZoomOutHeight
+KEY_SERIES_SERIES_LIST=SeriesList
+KEY_SERIES_CHILDREN=Children
--- /dev/null
+/*\r
+ * Dynamic Analyzer\r
+ *\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact: \r
+ * Jooyoul Lee <jy.exe.lee@samsung.com>\r
+ * Juyoung Kim <j0.kim@samsung.com>\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ * \r
+ */\r
+\r
+package org.tizen.dynamicanalyzer.nl;\r
+\r
+import org.eclipse.osgi.util.NLS;\r
+\r
+public class ErrorLabels extends NLS {\r
+ private static final String BUNDLE_NAME = "org.tizen.dynamicanalyzer.nl.ErrorLabels"; //$NON-NLS-1$\r
+\r
+ public static String EPERM;\r
+ public static String ENOENT;\r
+ public static String ESRCH;\r
+ public static String EINTR;\r
+ public static String EIO;\r
+ public static String ENXIO;\r
+ public static String E2BIG;\r
+ public static String ENOEXEC;\r
+ public static String EBADF;\r
+ public static String ECHILD;\r
+ public static String EAGAIN;\r
+ public static String ENOMEM;\r
+ public static String EACCES;\r
+ public static String EFAULT;\r
+ public static String ENOTBLK;\r
+ public static String EBUSY;\r
+ public static String EEXIST;\r
+ public static String EXDEV;\r
+ public static String ENODEV;\r
+ public static String ENOTDIR;\r
+ public static String EISDIR;\r
+ public static String EINVAL;\r
+ public static String ENFILE;\r
+ public static String EMFILE;\r
+ public static String ENOTTY;\r
+ public static String ETXTBSY;\r
+ public static String EFBIG;\r
+ public static String ENOSPC;\r
+ public static String ESPIPE;\r
+ public static String EROFS;\r
+ public static String EMLINK;\r
+ public static String EPIPE;\r
+ public static String EDOM;\r
+ public static String ERANGE;\r
+\r
+ public static String EDEADLK;\r
+ public static String ENAMETOOLONG;\r
+ public static String ENOLCK;\r
+ public static String ENOSYS;\r
+ public static String ENOTEMPTY;\r
+ public static String ELOOP;\r
+ public static String ENOMSG;\r
+ public static String EIDRM;\r
+ public static String ECHRNG;\r
+ public static String EL2NSYNC;\r
+ public static String EL3HLT;\r
+ public static String EL3RST;\r
+ public static String ELNRNG;\r
+ public static String EUNATCH;\r
+ public static String ENOCSI;\r
+ public static String EL2HLT;\r
+ public static String EBADE;\r
+ public static String EBADR;\r
+ public static String EXFULL;\r
+ public static String ENOANO;\r
+ public static String EBADRQC;\r
+ public static String EBADSLT;\r
+\r
+\r
+ public static String EBFONT;\r
+ public static String ENOSTR;\r
+ public static String ENODATA;\r
+ public static String ETIME;\r
+ public static String ENOSR;\r
+ public static String ENONET;\r
+ public static String ENOPKG;\r
+ public static String EREMOTE;\r
+ public static String ENOLINK;\r
+ public static String EADV;\r
+ public static String ESRMNT;\r
+ public static String ECOMM;\r
+ public static String EPROTO;\r
+ public static String EMULTIHOP;\r
+ public static String EDOTDOT;\r
+ public static String EBADMSG;\r
+ public static String EOVERFLOW;\r
+ public static String ENOTUNIQ;\r
+ public static String EBADFD;\r
+ public static String EREMCHG;\r
+ public static String ELIBACC;\r
+ public static String ELIBBAD;\r
+ public static String ELIBSCN;\r
+ public static String ELIBMAX;\r
+ public static String ELIBEXEC;\r
+ public static String EILSEQ;\r
+ public static String ERESTART;\r
+ public static String ESTRPIPE;\r
+ public static String EUSERS;\r
+ public static String ENOTSOCK;\r
+ public static String EDESTADDRREQ;\r
+ public static String EMSGSIZE;\r
+ public static String EPROTOTYPE;\r
+ public static String ENOPROTOOPT;\r
+ public static String EPROTONOSUPPORT;\r
+ public static String ESOCKTNOSUPPORT;\r
+ public static String EOPNOTSUPP;\r
+ public static String EPFNOSUPPORT;\r
+ public static String EAFNOSUPPORT;\r
+ public static String EADDRINUSE;\r
+ public static String EADDRNOTAVAIL;\r
+ public static String ENETDOWN;\r
+ public static String ENETUNREACH;\r
+ public static String ENETRESET;\r
+ public static String ECONNABORTED;\r
+ public static String ECONNRESET;\r
+ public static String ENOBUFS;\r
+ public static String EISCONN;\r
+ public static String ENOTCONN;\r
+ public static String ESHUTDOWN;\r
+ public static String ETOOMANYREFS;\r
+ public static String ETIMEDOUT;\r
+ public static String ECONNREFUSED;\r
+ public static String EHOSTDOWN;\r
+ public static String EHOSTUNREACH;\r
+ public static String EALREADY;\r
+ public static String EINPROGRESS;\r
+ public static String ESTALE;\r
+ public static String EUCLEAN;\r
+ public static String ENOTNAM;\r
+ public static String ENAVAIL;\r
+ public static String EISNAM;\r
+ public static String EREMOTEIO;\r
+ public static String EDQUOT;\r
+ public static String ENOMEDIUM;\r
+ public static String EMEDIUMTYPE;\r
+ public static String ECANCELED;\r
+ public static String ENOKEY;\r
+ public static String EKEYEXPIRED;\r
+ public static String EKEYREVOKED;\r
+ public static String EKEYREJECTED;\r
+\r
+ public static String EOWNERDEAD;\r
+ public static String ENOTRECOVERABLE;\r
+\r
+ public static String E_SUCCESS;\r
+ public static String E_FAILURE;\r
+ public static String ERR_SRC_FRAMEWORK;\r
+ public static String ERR_SRC_USER;\r
+\r
+ public static String E_ADDRESS_CHANGED;\r
+ public static String E_ALREADY_BOUND;\r
+ public static String E_ALREADY_CONNECTED;\r
+ public static String E_ALREADY_OPENED;\r
+ public static String E_AUTHENTICATION;\r
+ public static String E_APP_NOT_INSTALLED;\r
+ public static String E_ALREADY_SET;\r
+\r
+ public static String E_CHUNKED_TRANSACTION;\r
+ public static String E_CONNECTION_BUSY;\r
+ public static String E_CONNECTION_FAILED;\r
+ public static String E_CONNECTION_RESET;\r
+ public static String E_CREDENTIAL_EXPIRED;\r
+ public static String E_CERTIFICATE_VERIFICATION_FAILED;\r
+\r
+ public static String E_DATA_NOT_FOUND;\r
+ public static String E_DATABASE;\r
+ public static String E_DECODING_FAILED;\r
+ public static String E_DEVICE_BUSY;\r
+ public static String E_DEVICE_FAILED;\r
+ public static String E_DEVICE_INCOMPATIBLE;\r
+ public static String E_DEVICE_UNAVAILABLE;\r
+ public static String E_DHCP;\r
+ public static String E_DIMENSION_CHANGED;\r
+ public static String E_DNS;\r
+ public static String E_DNS_NOT_FOUND;\r
+\r
+ public static String E_EFFECTS_DISABLED;\r
+ public static String E_EMPTY_BODY;\r
+ public static String E_ENCODING_FAILED;\r
+ public static String E_END_OF_FILE;\r
+\r
+ public static String E_FDN_MODE;\r
+ public static String E_FILE_ALREADY_EXIST;\r
+ public static String E_FILE_NOT_FOUND;\r
+\r
+ public static String E_GROUP_NOT_FOUND;\r
+\r
+ public static String E_HOST_NOT_FOUND;\r
+ public static String E_HOST_UNREACHABLE;\r
+ public static String E_HTTP_USER;\r
+\r
+ public static String E_ILLEGAL_ACCESS;\r
+ public static String E_IN_PROGRESS;\r
+ public static String E_INACCESSIBLE_PATH;\r
+ public static String E_INIT_FAILED;\r
+ public static String E_INSTANTIATION_FAILED;\r
+ public static String E_INSUFFICIENT_PRIORITY;\r
+ public static String E_INTERRUPTED;\r
+ public static String E_INVALID_ACCOUNT;\r
+ public static String E_INVALID_ADDRESS;\r
+ public static String E_INVALID_ARG;\r
+ public static String E_INVALID_CONDITION;\r
+ public static String E_INVALID_CONNECTION;\r
+ public static String E_INVALID_CONTENT;\r
+ public static String E_INVALID_CONTEXT;\r
+ public static String E_INVALID_DATA;\r
+ public static String E_INVALID_DOMAIN;\r
+ public static String E_INVALID_ENCODING_RANGE;\r
+ public static String E_INVALID_FORMAT;\r
+ public static String E_INVALID_HEADER;\r
+ public static String E_INVALID_KEY;\r
+ public static String E_INVALID_OPERATION;\r
+ public static String E_INVALID_PROXY;\r
+ public static String E_INVALID_SIM_STATE;\r
+ public static String E_INVALID_SERVER;\r
+ public static String E_INVALID_SESSION;\r
+ public static String E_INVALID_SOCKET;\r
+ public static String E_INVALID_STATE;\r
+ public static String E_INVALID_TRANSACTION;\r
+ public static String E_IO;\r
+ public static String E_NOT_JOINED;\r
+ public static String E_INVALID_CERTIFICATE;\r
+ public static String E_INVALID_URL;\r
+\r
+ public static String E_KEY_ALREADY_EXIST;\r
+ public static String E_KEY_NOT_FOUND;\r
+\r
+ public static String E_LANDMARK;\r
+ public static String E_LIBRARY_NOT_FOUND;\r
+ public static String E_LIBRARY_NOT_LOADED;\r
+ public static String E_LINK;\r
+ public static String E_LOCATION;\r
+ public static String E_LOCATION_SERVICE;\r
+ public static String E_LOCK_FAILED;\r
+ public static String E_LANGUAGE_NOT_SET;\r
+\r
+ public static String E_MAX_EXCEEDED;\r
+ public static String E_MISSING_INPUT;\r
+ public static String E_MOBILE_FAILED;\r
+ public static String E_MODEL_NOT_FOUND;\r
+\r
+ public static String E_NETWORK_FAILED;\r
+ public static String E_NETWORK_UNAVAILABLE;\r
+ public static String E_NO_CERTIFICATE;\r
+ public static String E_NOT_A_MEMBER;\r
+ public static String E_NOT_PAIRED;\r
+ public static String E_NOT_RESPONDING;\r
+ public static String E_NUM_FORMAT;\r
+\r
+ public static String E_OBJ_ALREADY_EXIST;\r
+ public static String E_OBJ_NOT_FOUND;\r
+ public static String E_OBJECT_LOCKED;\r
+ public static String E_ON_INITIALIZING;\r
+ public static String E_OPERATION_CANCELED;\r
+ public static String E_OPERATION_FAILED;\r
+ public static String E_OUT_OF_MEMORY;\r
+ public static String E_OUT_OF_RANGE;\r
+ public static String E_OVERFLOW;\r
+\r
+ public static String E_PAIRING_FAILED;\r
+ public static String E_PARSING_FAILED;\r
+ public static String E_PRIVILEGE_DENIED;\r
+\r
+ public static String E_READ_ONLY;\r
+ public static String E_REJECTED;\r
+\r
+ public static String E_REMOTE_DEVICE_NOT_FOUND;\r
+\r
+ public static String E_REMOVE_SERVICE_NOT_FOUND;\r
+ public static String E_RESOURCE_UNAVAILABLE;\r
+ public static String E_RIGHT_EXPIRED;\r
+\r
+ public static String E_SECTION_ALREADY_EXIST;\r
+ public static String E_SECTION_NOT_FOUND;\r
+ public static String E_SERVER;\r
+ public static String E_SERVICE_BUSY;\r
+ public static String E_SERVICE_LIMITED;\r
+ public static String E_SERVICE_LOCKED;\r
+ public static String E_SERVICE_UNAVAILABLE;\r
+ public static String E_SESSION_DEACTIVATED;\r
+ public static String E_SESSION_UNAVAILABLE;\r
+ public static String E_SIZE_MISMATCH;\r
+ public static String E_SOCKET_USER;\r
+ public static String E_STORAGE_FULL;\r
+ public static String E_SYMBOL_NOT_FOUND;\r
+ public static String E_SYNTAX;\r
+ public static String E_SYSTEM;\r
+ public static String E_SERVICE_DEACTIVATED;\r
+\r
+ public static String E_TABLE_NOT_FOUND;\r
+ public static String E_TIMEOUT;\r
+ public static String E_TYPE_MISMATCH;\r
+\r
+ public static String E_UNDERFLOW;\r
+ public static String E_UNKNOWN;\r
+ public static String E_UNSUPPORTED_ALGORITHM;\r
+ public static String E_UNSUPPORTED_CODEC;\r
+ public static String E_UNSUPPORTED_FAMILY;\r
+ public static String E_UNSUPPORTED_FORMAT;\r
+ public static String E_UNSUPPORTED_PROTOCOL;\r
+ public static String E_UNSUPPORTED_OPERATION;\r
+ public static String E_UNSUPPORTED_OPTION;\r
+ public static String E_UNSUPPORTED_SERVICE;\r
+ public static String E_UNSUPPORTED_TYPE;\r
+ public static String E_URL_CHANGED;\r
+ public static String E_USER_AGENT_NOT_ALLOWED;\r
+ public static String E_USER_ALREADY_REGISTERED;\r
+ public static String E_USER_NOT_FOUND;\r
+ public static String E_USER_NOT_REGISTERED;\r
+ public static String E_UNSUPPORTED_LANGUAGE;\r
+ public static String E_UNSUPPORTED_VERSION;\r
+ public static String E_UNSUPPORTED_LOCALE;\r
+\r
+ public static String E_WOULD_BLOCK;\r
+\r
+ static {\r
+ // initialize resource bundle\r
+ NLS.initializeMessages(BUNDLE_NAME, ErrorLabels.class);\r
+ }\r
+\r
+ private ErrorLabels() {\r
+ }\r
+}\r
--- /dev/null
+EPERM=Operation not permitted\r
+ENOENT=No such file or directory\r
+ESRCH=No such process\r
+EINTR=Interrupted system call\r
+EIO=I/O error\r
+ENXIO=No such device or address\r
+E2BIG=Argument list too long\r
+ENOEXEC=Exec format error\r
+EBADF=Bad file number\r
+ECHILD=No child processes\r
+EAGAIN=Try again\r
+ENOMEM=Out of memory\r
+EACCES=Permission denied\r
+EFAULT=Bad address\r
+ENOTBLK=Block device required\r
+EBUSY=Device or resource busy\r
+EEXIST=File exists\r
+EXDEV=Cross-device link\r
+ENODEV=No such device\r
+ENOTDIR=Not a directory\r
+EISDIR=Is a directory\r
+EINVAL=Invalid argument\r
+ENFILE=File table overflow\r
+EMFILE=Too many open files\r
+ENOTTY=Not a typewriter\r
+ETXTBSY=Text file busy\r
+EFBIG=File too large\r
+ENOSPC=No space left on device\r
+ESPIPE=Illegal seek\r
+EROFS=Read-only file system\r
+EMLINK=Too many links\r
+EPIPE=Broken pipe\r
+EDOM=Math argument out of domain of func\r
+ERANGE=Math result not representable\r
+\r
+EDEADLK=Resource deadlock would occur\r
+ENAMETOOLONG=File name too long\r
+ENOLCK=No record locks available\r
+ENOSYS=Function not implemented\r
+ENOTEMPTY=Directory not empty\r
+ELOOP=Too many symbolic links encountered\r
+\r
+ENOMSG=No message of desired type\r
+EIDRM=Identifier removed\r
+ECHRNG=Channel number out of range\r
+EL2NSYNC=Level 2 not synchronized\r
+EL3HLT=Level 3 halted\r
+EL3RST=Level 3 reset\r
+ELNRNG=Link number out of range\r
+EUNATCH=Protocol driver not attached\r
+ENOCSI=No CSI structure available\r
+EL2HLT=Level 2 halted\r
+EBADE=Invalid exchange\r
+EBADR=Invalid request descriptor\r
+EXFULL=Exchange full\r
+ENOANO=No anode\r
+EBADRQC=Invalid request code\r
+EBADSLT=Invalid slot\r
+\r
+EBFONT=Bad font file format\r
+ENOSTR=Device not a stream\r
+ENODATA=No data available\r
+ETIME=Timer expired\r
+ENOSR=Out of streams resources\r
+ENONET=Machine is not on the network\r
+ENOPKG=Package not installed\r
+EREMOTE=Object is remote\r
+ENOLINK=Link has been severed\r
+EADV=Advertise error\r
+ESRMNT=Srmount error\r
+ECOMM=Communication error on send\r
+EPROTO=Protocol error\r
+EMULTIHOP=Multihop attempted\r
+EDOTDOT=RFS specific error\r
+EBADMSG=Not a data message\r
+EOVERFLOW=Value too large for defined data type\r
+ENOTUNIQ=Name not unique on network\r
+EBADFD=File descriptor in bad state\r
+EREMCHG=Remote address changed\r
+ELIBACC=Can not access a needed shared library\r
+ELIBBAD=Accessing a corrupted shared library\r
+ELIBSCN=.lib section in a.out corrupted\r
+ELIBMAX=Attempting to link in too many shared libraries\r
+ELIBEXEC=Cannot exec a shared library directly\r
+EILSEQ=Illegal byte sequence\r
+ERESTART=Interrupted system call should be restarted\r
+ESTRPIPE=Streams pipe error\r
+EUSERS=Too many users\r
+ENOTSOCK=Socket operation on non-socket\r
+EDESTADDRREQ=Destination address required\r
+EMSGSIZE=Message too long\r
+EPROTOTYPE=Protocol wrong type for socket\r
+ENOPROTOOPT=Protocol not available\r
+EPROTONOSUPPORT=Protocol not supported\r
+ESOCKTNOSUPPORT=Socket type not supported\r
+EOPNOTSUPP=Operation not supported on transport endpoint \r
+EPFNOSUPPORT=Protocol family not supported\r
+EAFNOSUPPORT=Address family not supported by protocol\r
+EADDRINUSE=Address already in use\r
+EADDRNOTAVAIL=Cannot assign requested address\r
+ENETDOWN=Network is down\r
+ENETUNREACH=Network is unreachable\r
+ENETRESET=Network dropped connection because of reset\r
+ECONNABORTED=Software caused connection abort\r
+ECONNRESET=Connection reset by peer\r
+ENOBUFS=No buffer space available\r
+EISCONN=Transport endpoint is already connected\r
+ENOTCONN=Transport endpoint is not connected\r
+ESHUTDOWN=Cannot send after transport endpoint shutdown\r
+ETOOMANYREFS=Too many references: cannot splice\r
+ETIMEDOUT=Connection timed out\r
+ECONNREFUSED=Connection refused\r
+EHOSTDOWN=Host is down\r
+EHOSTUNREACH=No route to host\r
+EALREADY=Operation already in progress\r
+EINPROGRESS=Operation now in progress\r
+ESTALE=Stale NFS file handle\r
+EUCLEAN=Structure needs cleaning\r
+ENOTNAM=Not a XENIX named type file\r
+ENAVAIL=No XENIX semaphores available\r
+EISNAM=Is a named type file\r
+EREMOTEIO=Remote I/O error\r
+EDQUOT=Quota exceeded\r
+ENOMEDIUM=No medium found\r
+EMEDIUMTYPE=Wrong medium type\r
+ECANCELED=Operation Canceled\r
+ENOKEY=Required key not available\r
+EKEYEXPIRED=Key has expired\r
+EKEYREVOKED=Key has been revoked\r
+EKEYREJECTED=Key was rejected by service\r
+\r
+EOWNERDEAD=Owner died\r
+ENOTRECOVERABLE=State not recoverable\r
+\r
+# Tizen API defined Error codes\r
+E_SUCCESS=Success\r
+E_FAILURE=Failure\r
+ERR_SRC_FRAMEWORK=ERR_SRC_FRAMEWORK\r
+ERR_SRC_USER=ERR_SRC_USER\r
+\r
+E_ADDRESS_CHANGED=The network address is changed externally.\r
+E_ALREADY_BOUND=The target is bounded to another source.\r
+E_ALREADY_CONNECTED=The target is connected to another source.\r
+E_ALREADY_OPENED=The target is already opened.\r
+E_AUTHENTICATION=The authentication request fails.\r
+E_APP_NOT_INSTALLED=The required application is not installed.\r
+E_ALREADY_SET=The specified instance is already set to other values, instances or resources.\r
+ \r
+E_CHUNKED_TRANSACTION=E_CHUNKED_TRANSACTION\r
+E_CONNECTION_BUSY=The connection is busy and therefore cannot process a new request.\r
+E_CONNECTION_FAILED=The connection to the specific destination fails.\r
+E_CONNECTION_RESET=The connection is reset while the other thread is still working on it.\r
+E_CREDENTIAL_EXPIRED=The token is expired.\r
+E_CERTIFICATE_VERIFICATION_FAILED=The server certificate verification has failed.\r
+ \r
+E_DATA_NOT_FOUND=The requested data does not exist.\r
+E_DATABASE=The underlying database system raises an exception.\r
+E_DECODING_FAILED=The decoding operation fails.\r
+E_DEVICE_BUSY=The device is processing the previous task and therefore cannot process a new request.\r
+E_DEVICE_FAILED=The device fails with an unknown reason.\r
+E_DEVICE_INCOMPATIBLE=The device does not support a specific request.\r
+E_DEVICE_UNAVAILABLE=The device is not installed, or not answering at all.\r
+E_DHCP=General DHCP exception.\r
+E_DIMENSION_CHANGED=The dimension has changed.\r
+E_DNS=General DNS exception.\r
+E_DNS_NOT_FOUND=The DNS cannot resolve the requested address.\r
+ \r
+E_EFFECTS_DISABLED=Effects being played on the current haptic device are disabled.\r
+E_EMPTY_BODY=A body is empty.\r
+E_ENCODING_FAILED=The encoding operation fails.\r
+E_END_OF_FILE=The end of file or end of stream is reached unexpectedly during an input operation.\r
+ \r
+E_FDN_MODE=The application tries to call with a number that is not allowed in the FDN mode, while the FDN mode is enabled.\r
+E_FILE_ALREADY_EXIST=An attempt to create the file denoted by the specified pathname fails.\r
+E_FILE_NOT_FOUND=An attempt to open the file denoted by a specified pathname fails.\r
+ \r
+E_GROUP_NOT_FOUND=A required group does not exist.\r
+ \r
+E_HOST_NOT_FOUND=The destination host is not found.\r
+E_HOST_UNREACHABLE=The destination host is unreachable.\r
+E_HTTP_USER=E_HTTP_USER\r
+ \r
+E_ILLEGAL_ACCESS=The user does not have proper permissions.\r
+E_IN_PROGRESS=The application requests an operation which is in progress.\r
+E_INACCESSIBLE_PATH=The return type is supposed to be a file path, but the path is not accessible by the application.\r
+E_INIT_FAILED=Initialization fails.\r
+E_INSTANTIATION_FAILED=An instantiation fails by certain reason.\r
+E_INSUFFICIENT_PRIORITY=The haptic device priority is lower than that of the current effects being played, belonging to another device instance..\r
+E_INTERRUPTED=Interruption from other thread.\r
+E_INVALID_ACCOUNT=An account configuration is invalid.\r
+E_INVALID_ADDRESS=A given address is invalid or not suitable for a requested operation.\r
+E_INVALID_ARG=A combination of passed information is not proper for performing the requested operation.\r
+E_INVALID_CONDITION=A combination of passed information is not proper for performing the requested operation.\r
+E_INVALID_CONNECTION=An operation requests for invalid connection.\r
+E_INVALID_CONTENT=Content is invalid.\r
+E_INVALID_CONTEXT=Context is invalid.\r
+E_INVALID_DATA=The requested (given or referenced) data is invalid.\r
+E_INVALID_DOMAIN=The requested (given or referenced) domain is invalid.\r
+E_INVALID_ENCODING_RANGE=An indicated string contains code pointing outside of bounds by the specified character encoding scheme.\r
+E_INVALID_FORMAT=The specified input has invalid format.\r
+E_INVALID_HEADER=The specified input has invalid header.\r
+E_INVALID_KEY=The specified input has invalid format.\r
+E_INVALID_OPERATION=Current state of the instance prohibits the execution of the specified operation.\r
+E_INVALID_PROXY=The proxy address is invalid.\r
+E_INVALID_SIM_STATE=The SIM is not in proper state for processing the requested operation.\r
+E_INVALID_SERVER=The DNS request goes to an invalid DNS server.\r
+E_INVALID_SESSION=The relevant session is invalid.\r
+E_INVALID_SOCKET=The socket which is responsible for the application's request is invalid.\r
+E_INVALID_STATE=An instance is not in valid state.\r
+E_INVALID_TRANSACTION=The relevant transaction is invalid.\r
+E_IO=An exception occurs during I/O operations. This is a general exception produced by failed or interrupted I/O operations.\r
+E_NOT_JOINED=The client has not joined the domain controller.\r
+E_INVALID_CERTIFICATE=The server certificate verification has failed on client.\r
+E_INVALID_URL=A given url is invalid or not suitable for a requested operation.\r
+ \r
+E_KEY_ALREADY_EXIST=A specified key already exists.\r
+E_KEY_NOT_FOUND=A required key does not exist.\r
+ \r
+E_LANDMARK=An error related to handling landmark occurs.\r
+E_LIBRARY_NOT_FOUND=A specified library not exists.\r
+E_LIBRARY_NOT_LOADED=A specified library is not loaded.\r
+E_LINK=A link error occurs.\r
+E_LOCATION=A Location API specific error has occurred.\r
+E_LOCATION_SERVICE=An error related to handling service provider requests has occurred.\r
+E_LOCK_FAILED=Locking (or unlocking) fails inside the logic. So cannot guarantee synchronous operation.\r
+E_LANGUAGE_NOT_SET=The language is not set yet.\r
+ \r
+E_MAX_EXCEEDED=The defined limit exceeds.\r
+E_MISSING_INPUT=One or more of the required input is not provided.\r
+E_MOBILE_FAILED=E_MOBILE_FAILED\r
+E_MODEL_NOT_FOUND=E_MODEL_NOT_FOUND\r
+ \r
+E_NETWORK_FAILED=General network exception.\r
+E_NETWORK_UNAVAILABLE=The network is not enabled.\r
+E_NO_CERTIFICATE=The client certificate is required to connect to the server.\r
+E_NOT_A_MEMBER=The operation is permitted only for members, but the current user is not.\r
+E_NOT_PAIRED=Bluetooth pairing is not established.\r
+E_NOT_RESPONDING=The target is not responding.\r
+E_NUM_FORMAT=The specified string does not represent valid number.\r
+ \r
+E_OBJ_ALREADY_EXIST=The specified instance already exists.\r
+E_OBJ_NOT_FOUND=The required instance does not exist.\r
+E_OBJECT_LOCKED=The specified instance is already locked.\r
+E_ON_INITIALIZING=Any request occurs while the target is still initializing.\r
+E_OPERATION_CANCELED=The operation is canceled explicitly.\r
+E_OPERATION_FAILED=The operation fails due to certain reason.\r
+E_OUT_OF_MEMORY=The memory is not sufficient to perform the requested operation.\r
+E_OUT_OF_RANGE=The internal state of the current instance reaches the valid range.\r
+E_OVERFLOW=The operation has caused an overflow.\r
+ \r
+E_PAIRING_FAILED=The requested Bluetooth pairing fails.\r
+E_PARSING_FAILED=The paring fails due to any reason.\r
+E_PRIVILEGE_DENIED=An application invokes an API without a proper privilege.\r
+ \r
+E_READ_ONLY=A write operation is requested for an instance in read only mode.\r
+E_REJECTED=The operation is rejected by remote site.\r
+ \r
+E_REMOTE_DEVICE_NOT_FOUND=E_REMOTE_DEVICE_NOT_FOUND\r
+ \r
+E_REMOVE_SERVICE_NOT_FOUND=E_REMOVE_SERVICE_NOT_FOUND\r
+E_RESOURCE_UNAVAILABLE=The required resource is currently unavailable.\r
+E_RIGHT_EXPIRED=The right to get served has expired.\r
+ \r
+E_SECTION_ALREADY_EXIST=The specified section already exists.\r
+E_SECTION_NOT_FOUND=The required section does not exist.\r
+E_SERVER=A server tells the device that operation has failed due to some reason.\r
+E_SERVICE_BUSY=The dedicated service module is too busy to handle another request.\r
+E_SERVICE_LIMITED=The specific service is restricted by policy.\r
+E_SERVICE_LOCKED=A service is locked.\r
+E_SERVICE_UNAVAILABLE=The dedicated service is not available.\r
+E_SESSION_DEACTIVATED=The base session is deactivated while it's still being used.\r
+E_SESSION_UNAVAILABLE=E_SESSION_UNAVAILABLE\r
+E_SIZE_MISMATCH=E_SIZE_MISMATCH\r
+E_SOCKET_USER=The socket connection is closed by user.\r
+E_STORAGE_FULL=The storage is full.\r
+E_SYMBOL_NOT_FOUND=The specified symbol is not found.\r
+E_SYNTAX=The input statement does not confirm to the specific syntax.\r
+E_SYSTEM=A failure occurs from the underlying system.\r
+E_SERVICE_DEACTIVATED=A service is deactivated.\r
+ \r
+E_TABLE_NOT_FOUND=The specified table does not exist.\r
+E_TIMEOUT=The operation cannot be completed within the specified time period.\r
+E_TYPE_MISMATCH=The specified type does not match.\r
+ \r
+E_UNDERFLOW=The operation causes an underflow.\r
+E_UNKNOWN=A unknown error occurs.\r
+E_UNSUPPORTED_ALGORITHM=The specified algorithm is not supported.\r
+E_UNSUPPORTED_CODEC=The required CODEC is not found.\r
+E_UNSUPPORTED_FAMILY=The requested address family is not supported.\r
+E_UNSUPPORTED_FORMAT=The current implementation does not support the format of the input.\r
+E_UNSUPPORTED_PROTOCOL=The specified protocol is not supported.\r
+E_UNSUPPORTED_OPERATION=The current implementation does not support the requested operation.\r
+E_UNSUPPORTED_OPTION=The specified option is not supported.\r
+E_UNSUPPORTED_SERVICE=The specified service is not supported.\r
+E_UNSUPPORTED_TYPE=The specified type is not supported.\r
+E_URL_CHANGED=The URL is changed.\r
+E_USER_AGENT_NOT_ALLOWED=Used by HTTP transaction.\r
+E_USER_ALREADY_REGISTERED=A user is already registered to the device.\r
+E_USER_NOT_FOUND=The required user does not exist.\r
+E_USER_NOT_REGISTERED=No user is registered to the device yet.\r
+E_UNSUPPORTED_LANGUAGE=The specified language is not supported.\r
+E_UNSUPPORTED_VERSION=The specified version of the input content is not supported.\r
+E_UNSUPPORTED_LOCALE=The specified locale is not supported.\r
+ \r
+E_WOULD_BLOCK=Completed immediately.\r
+\r
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyun Jong Park <phjwithyou.park@samsung.com>
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.nl;
+
+import org.eclipse.osgi.util.NLS;
+
+public class FilePageLabels extends NLS {
+ private static final String BUNDLE_NAME = "org.tizen.dynamicanalyzer.nl.FilePageLabels"; //$NON-NLS-1$
+
+ public static String FILE_API_LIST_VIEW_TITLE;
+ public static String FILE_API_LIST_VIEW_INDEX;
+ public static String FILE_API_LIST_VIEW_TIME;
+ public static String FILE_API_LIST_VIEW_API;
+ public static String FILE_API_LIST_VIEW_PARAMETER;
+ public static String FILE_API_LIST_VIEW_THREAD_ID;
+ public static String FILE_API_LIST_VIEW_RETURN;
+ public static String FILE_API_LIST_VIEW_ERRNO;
+
+ public static String FILE_CHART_FILE;
+ public static String FILE_CHART_UNKNOWN_FILE;
+
+ public static String FILE_DETAILS_TITLE;
+ public static String FILE_DETAILS_API_COUNT;
+ public static String FILE_DETAILS_FAILED_API_COUNT;
+ public static String FILE_DETAILS_FILE_NAME;
+ public static String FILE_DETAILS_FILE_NAME_NEWLINE;
+ public static String FILE_DETAILS_FILE_PATH;
+ public static String FILE_DETAILS_READ_SIZE;
+ public static String FILE_DETAILS_TOTAL_USE_TIME;
+ public static String FILE_DETAILS_WRITE_SIZE;
+ public static String FILE_DETAILS_TOTAL_SIZE;
+
+ public static String FILE_CHART_SERIES_FILE;
+ public static String FILE_CHART_API_FILE;
+
+ public static String FILE_CHART_TOOLTIP_CLOSED;
+ public static String FILE_CHART_TOOLTIP_OPEND;
+ public static String FILE_CHART_TOOLTIP_USED;
+ public static String FILE_CHART_TOOLTIP_UNUSED;
+ public static String FILE_CHART_TOOLTIP_FAILED;
+
+
+
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, FilePageLabels.class);
+ }
+
+ private FilePageLabels() {
+ }
+}
--- /dev/null
+FILE_API_LIST_VIEW_TITLE=File API List
+FILE_API_LIST_VIEW_INDEX=\#
+FILE_API_LIST_VIEW_TIME=Time
+FILE_API_LIST_VIEW_API=File API
+FILE_API_LIST_VIEW_PARAMETER=Parameter
+FILE_API_LIST_VIEW_THREAD_ID=Thread ID
+FILE_API_LIST_VIEW_RETURN=Return value
+FILE_API_LIST_VIEW_ERRNO=Error code
+
+FILE_CHART_FILE=File
+FILE_CHART_UNKNOWN_FILE=unknown file
+
+FILE_DETAILS_TITLE=File Details
+FILE_DETAILS_FILE_NAME=File name :
+FILE_DETAILS_FILE_PATH=File path :
+FILE_DETAILS_TOTAL_SIZE=File size :
+FILE_DETAILS_READ_SIZE=Read size :
+FILE_DETAILS_WRITE_SIZE=Write size :
+FILE_DETAILS_TOTAL_USE_TIME=Usage time :
+FILE_DETAILS_API_COUNT=API count :
+FILE_DETAILS_FAILED_API_COUNT=Failed API count :
+FILE_DETAILS_FILE_NAME_NEWLINE=File name : \n
+
+FILE_CHART_SERIES_FILE=STATE
+FILE_CHART_API_FILE=API
+
+FILE_CHART_TOOLTIP_CLOSED=CLOSED
+FILE_CHART_TOOLTIP_OPEND=OPEND
+FILE_CHART_TOOLTIP_USED=USED
+FILE_CHART_TOOLTIP_UNUSED=UNUSED
+FILE_CHART_TOOLTIP_FAILED=FAILED
+
+
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * YeongTaik Byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.nl;
+
+import org.eclipse.osgi.util.NLS;
+
+public class InformationViewLabels extends NLS {
+ private static final String BUNDLE_NAME = "org.tizen.dynamicanalyzer.nl.InformationViewLabels"; //$NON-NLS-1$
+ public static String CALLSTACK_TABLE_UNKNOWN_LIBRARY;
+ public static String CALLSTACK_TABLE_UNKNOWN_FUNCTION;
+ public static String CALLSTACK_VIEW_ADDRESS;
+ public static String CALLSTACK_VIEW_BINARY_PATH;
+ public static String CALLSTACK_VIEW_FUNCTION;
+ public static String CALLSTACK_VIEW_TITLE;
+ public static String CURRENT_TABLE_AVAILABLE_MEMORY;
+ public static String CURRENT_TABLE_BRIGHTNESS;
+ public static String CURRENT_TABLE_THREAD;
+
+ public static String RANGE_VIEW_TITLE;
+ public static String RANGE_VIEW_AVERAGE;
+ public static String RANGE_VIEW_END;
+ public static String RANGE_VIEW_MAXIMUM;
+ public static String RANGE_VIEW_MINIMUM;
+ public static String RANGE_VIEW_NAME;
+ public static String RANGE_VIEW_START;
+ public static String RANGE_VIEW_STATISTICS;
+
+ public static String SCORE_VIEW_ELECTRIC_ENERGY;
+ public static String SCORE_VIEW_FAIL_COUNT;
+ public static String SCORE_VIEW_LEAK_SIZE;
+ public static String SCORE_VIEW_SCORE;
+ public static String SCORE_VIEW_WARNING_COUNT;
+
+ public static String SNAPSHOT_VIEW_TITLE;
+ public static String SNAPSHOT_VIEW_BLUETOOTH_ELSE;
+ public static String SNAPSHOT_VIEW_BLUETOOTH_OFF;
+ public static String SNAPSHOT_VIEW_BLUETOOTH_TRANSFER;
+ public static String SNAPSHOT_VIEW_BYTE;
+ public static String SNAPSHOT_VIEW_CPU;
+ public static String SNAPSHOT_VIEW_CURRENT_VIEW;
+ public static String SNAPSHOT_VIEW_GPS_CONNECTED;
+ public static String SNAPSHOT_VIEW_GPS_OFF;
+ public static String SNAPSHOT_VIEW_GPS_SEARCHING;
+ public static String SNAPSHOT_VIEW_MB;
+ public static String SNAPSHOT_VIEW_PROCESS;
+ public static String SNAPSHOT_VIEW_WIFI_CONNECTED;
+ public static String SNAPSHOT_VIEW_WIFI_OFF;
+ public static String SNAPSHOT_VIEW_WIFI_TRANSFER;
+ public static String SNAPSHOT_VIEW_WIFI_UNCONNECTED;
+ public static String SNAPSHOT_VIEW_LATEST;
+
+ public static String STATS_TABLE_CHILD;
+ public static String STATS_TABLE_CPU_APP;
+ public static String STATS_TABLE_CPU_CORE0;
+ public static String STATS_TABLE_CPU_CORE1;
+ public static String STATS_TABLE_CPU_CORE2;
+ public static String STATS_TABLE_CPU_CORE3;
+ public static String STATS_TABLE_CPU_TOTAL;
+ public static String STATS_TABLE_CPU_FREQUENCY;
+ public static String STATS_TABLE_ENERGY;
+ public static String STATS_TABLE_FILE_COUNT;
+ public static String STATS_TABLE_HEAP_USER;
+ public static String STATS_TABLE_PROCESS_PSS;
+ public static String STATS_TABLE_PROCESS_RSS;
+ public static String STATS_TABLE_PROCESS_VSS;
+ public static String STATS_TABLE_MEMORY_PROCESS;
+ public static String STATS_TABLE_MEMORY_SYSTEM;
+ public static String STATS_TABLE_MEMORY_TOTAL;
+ public static String STATS_TABLE_READ_SIZE;
+ public static String STATS_TABLE_TIME;
+ public static String STATS_TABLE_WRITE_SIZE;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, InformationViewLabels.class);
+ }
+
+ private InformationViewLabels() {
+ }
+}
--- /dev/null
+CALLSTACK_TABLE_UNKNOWN_LIBRARY=<unknown library>
+CALLSTACK_TABLE_UNKNOWN_FUNCTION=<unknown function>
+CALLSTACK_VIEW_ADDRESS=Address
+CALLSTACK_VIEW_BINARY_PATH=Binary path
+CALLSTACK_VIEW_FUNCTION=Function
+CALLSTACK_VIEW_TITLE=Callstack
+CURRENT_TABLE_AVAILABLE_MEMORY=Available memory
+CURRENT_TABLE_BRIGHTNESS=Brightness
+CURRENT_TABLE_THREAD=Thread
+
+RANGE_VIEW_TITLE=Range
+RANGE_VIEW_AVERAGE=Avg.
+RANGE_VIEW_END=End
+RANGE_VIEW_MAXIMUM=Max.
+RANGE_VIEW_MINIMUM=Min.
+RANGE_VIEW_NAME=Name
+RANGE_VIEW_START=Start
+RANGE_VIEW_STATISTICS=Stats
+
+SCORE_VIEW_ELECTRIC_ENERGY=Electric energy
+SCORE_VIEW_FAIL_COUNT=Fail count
+SCORE_VIEW_LEAK_SIZE=Leak size
+SCORE_VIEW_SCORE=Score
+SCORE_VIEW_WARNING_COUNT=Warning count
+
+SNAPSHOT_VIEW_TITLE=Snapshot
+SNAPSHOT_VIEW_BLUETOOTH_ELSE=Bluetooth on
+SNAPSHOT_VIEW_BLUETOOTH_OFF=Bluetooth off
+SNAPSHOT_VIEW_BLUETOOTH_TRANSFER=Bluetooth transfer in progress...
+SNAPSHOT_VIEW_BYTE=Byte
+SNAPSHOT_VIEW_CPU=CPU
+SNAPSHOT_VIEW_CURRENT_VIEW=Current view
+SNAPSHOT_VIEW_GPS_CONNECTED=GPS connected
+SNAPSHOT_VIEW_GPS_OFF=GPS off
+SNAPSHOT_VIEW_GPS_SEARCHING=GPS searching
+SNAPSHOT_VIEW_MB=\ MB
+SNAPSHOT_VIEW_PROCESS=Process
+SNAPSHOT_VIEW_WIFI_CONNECTED=Wi-Fi connected
+SNAPSHOT_VIEW_WIFI_OFF=Wi-Fi off
+SNAPSHOT_VIEW_WIFI_TRANSFER=Wi-Fi transfer in progress...
+SNAPSHOT_VIEW_WIFI_UNCONNECTED=Wi-Fi ont connected
+SNAPSHOT_VIEW_LATEST=Latest
+
+STATS_TABLE_CHILD= -
+STATS_TABLE_CPU_APP=Application CPU load
+STATS_TABLE_CPU_CORE0=Core 0
+STATS_TABLE_CPU_CORE1=Core 1
+STATS_TABLE_CPU_CORE2=Core 2
+STATS_TABLE_CPU_CORE3=Core 3
+STATS_TABLE_CPU_TOTAL=Total CPU load
+STATS_TABLE_CPU_FREQUENCY=CPU frequency
+STATS_TABLE_ENERGY=Energy (mW)
+STATS_TABLE_FILE_COUNT=File count
+STATS_TABLE_HEAP_USER=Application heap size
+STATS_TABLE_PROCESS_PSS=PSS
+STATS_TABLE_PROCESS_RSS=RSS
+STATS_TABLE_PROCESS_VSS=VSS
+STATS_TABLE_MEMORY_PROCESS=Process memory
+STATS_TABLE_MEMORY_SYSTEM=System memory
+STATS_TABLE_MEMORY_TOTAL=Total memory
+STATS_TABLE_READ_SIZE=File read size
+STATS_TABLE_TIME=Time
+STATS_TABLE_WRITE_SIZE=File write size
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * This program and the accompanying materials are made available
+ * under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.nl;
+
+import org.eclipse.osgi.util.NLS;
+
+public class SummaryLabels extends NLS {
+ private static final String BUNDLE_NAME = "org.tizen.dynamicanalyzer.nl.SummaryLabels"; //$NON-NLS-1$
+
+ public static String FAILED_API_LIST_VIEW_TITLE;
+ public static String FAILED_API_LIST_VIEW_INDEX;
+ public static String FAILED_API_LIST_VIEW_NAME;
+ public static String FAILED_API_LIST_VIEW_PARAMETER;
+ public static String FAILED_API_LIST_VIEW_RETURN;
+ public static String FAILED_API_LIST_VIEW_TIME;
+ public static String FAILED_API_LIST_VIEW_ERROR_CODE;
+ public static String FAILED_API_LIST_VIEW_ERROR_DESCRIPTION;
+
+ public static String FUNCTION_USAGE_PROFILER_APPLICATION;
+ public static String FUNCTION_USAGE_PROFILER_DEPENDENT_LIB;
+
+ public static String FUNCTION_USER_PROFILING_VIEW_TITLE;
+ public static String FUNCTION_USER_PROFILING_VIEW_NAME;
+ public static String FUNCTION_USER_PROFILING_VIEW_CPU_TIME;
+ public static String FUNCTION_USER_PROFILING_VIEW_CPU_RATE;
+ public static String FUNCTION_USER_PROFILING_VIEW_ELASPED_TIME;
+ public static String FUNCTION_USER_PROFILING_VIEW_CALL_COUNT;
+ public static String FUNCTION_USER_PROFILING_VIEW_EXCLUSIVE;
+ public static String FUNCTION_USER_PROFILING_VIEW_INCLUSIVE;
+
+ public static String WARNING_CASE_BRIEF_DUPLICATE;
+ public static String WARNING_CASE_BRIEF_NO_OPERATION;
+ public static String WARNING_CASE_BRIEF_JOINABLE_LEAK;
+ public static String WARNING_CASE_POST_FIX_DUPLICATE;
+ public static String WARNING_CASE_POST_FIX_NO_OPERATION;
+ public static String WARNING_CASE_POST_FIX_JOINABLE_LEAK;
+
+ public static String WARNING_CASE_PRE_FIX;
+
+ public static String WARNING_LIST_VIEW_TITLE;
+ public static String WARNING_LIST_VIEW_CATEGORY;
+ public static String WARNING_LIST_VIEW_INDEX;
+ public static String WARNING_LIST_VIEW_WARNING_MESSAGE;
+ public static String WARNING_TABLE_FILE;
+ public static String WARNING_TABLE_SOCKET;
+
+ public static String FILE_DETAILS_TITLE;
+
+ public static String LEAK_DATA_DEFAULT_FORMAT;
+
+ public static String LEAK_TABLE_ETC;
+ public static String LEAK_TABLE_MEMORY;
+ public static String LEAK_TABLE_RESOURCE;
+
+ public static String LEAK_VIEW_TITLE_LEAK_CANDIDATE;
+ public static String LEAK_VIEW_TITLE_LEAK;
+ public static String LEAK_VIEW_FILE_PARAMETER;
+ public static String LEAK_VIEW_INDEX;
+ public static String LEAK_VIEW_NAME;
+ public static String LEAK_VIEW_RETURN;
+ public static String LEAK_VIEW_TIME;
+ public static String LEAK_VIEW_TYPE;
+
+ public static String SUMMARY_PAGE_CALLSTACK_TITLE;
+ public static String SUMMARY_PAGE_SNAPSHOT_TITLE;
+
+ public static String RANGE_PAGE_PROFILING_TABLE_NAME;
+ public static String RANGE_PAGE_LEAK_TABLE_NAME;
+ public static String RANGE_PAGE_FAILED_TABLE_NAME;
+ public static String RANGE_PAGE_WARNING_TABLE_NAME;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, SummaryLabels.class);
+ }
+
+ private SummaryLabels() {
+ }
+}
--- /dev/null
+FAILED_API_LIST_VIEW_TITLE=Failed API
+FAILED_API_LIST_VIEW_INDEX=\#
+FAILED_API_LIST_VIEW_NAME=Name
+FAILED_API_LIST_VIEW_PARAMETER=Parameter
+FAILED_API_LIST_VIEW_RETURN=Return value
+FAILED_API_LIST_VIEW_TIME=Time
+FAILED_API_LIST_VIEW_ERROR_CODE=Error code
+FAILED_API_LIST_VIEW_ERROR_DESCRIPTION=Error description
+
+FUNCTION_USAGE_PROFILER_APPLICATION=Application
+FUNCTION_USAGE_PROFILER_DEPENDENT_LIB=Dependent library
+
+FUNCTION_USER_PROFILING_VIEW_TITLE=Function Usage Profiling
+FUNCTION_USER_PROFILING_VIEW_NAME=Library/function name
+FUNCTION_USER_PROFILING_VIEW_CPU_RATE=CPU rate
+FUNCTION_USER_PROFILING_VIEW_CPU_TIME=CPU time
+FUNCTION_USER_PROFILING_VIEW_ELASPED_TIME=Elapsed time
+FUNCTION_USER_PROFILING_VIEW_CALL_COUNT=Call count
+FUNCTION_USER_PROFILING_VIEW_EXCLUSIVE=Exclusive
+FUNCTION_USER_PROFILING_VIEW_INCLUSIVE=Inclusive
+
+WARNING_CASE_BRIEF_DUPLICATE=Duplicate file open.
+WARNING_CASE_BRIEF_NO_OPERATION=File closed without using it.
+WARNING_CASE_BRIEF_JOINABLE_LEAK=The joinable thread must call the join() method.
+WARNING_CASE_POST_FIX_DUPLICATE=File open multiple times with different file descriptors. It is recommended to open the file once and share the file descriptor.
+WARNING_CASE_POST_FIX_NO_OPERATION=File closed without accessing it. It is recommended to check if the file must be opened.
+WARNING_CASE_POST_FIX_JOINABLE_LEAK=If the thread is joinable, the join() method must be called, else it could create memory leaks.
+
+WARNING_CASE_PRE_FIX=<
+
+WARNING_LIST_VIEW_TITLE=Warning List
+WARNING_LIST_VIEW_CATEGORY=Category
+WARNING_LIST_VIEW_INDEX=\#
+WARNING_LIST_VIEW_WARNING_MESSAGE=Warning
+WARNING_TABLE_FILE=File
+WARNING_TABLE_SOCKET=Socket
+
+FILE_DETAILS_TITLE=Warning
+
+LEAK_DATA_DEFAULT_FORMAT=--:--:---
+
+LEAK_TABLE_ETC=Other
+LEAK_TABLE_MEMORY=Memory
+LEAK_TABLE_RESOURCE=Resource
+
+LEAK_VIEW_TITLE_LEAK_CANDIDATE=Leak candidates
+LEAK_VIEW_TITLE_LEAK=Leaks
+LEAK_VIEW_FILE_PARAMETER=File/parameter
+LEAK_VIEW_INDEX=\#
+LEAK_VIEW_NAME=API
+LEAK_VIEW_RETURN=Return value
+LEAK_VIEW_TIME=Time
+LEAK_VIEW_TYPE=Leak type
+
+SUMMARY_PAGE_CALLSTACK_TITLE=Callstack
+SUMMARY_PAGE_SNAPSHOT_TITLE=Snapshot
+
+RANGE_PAGE_PROFILING_TABLE_NAME=Range Function Usage Profiling
+RANGE_PAGE_LEAK_TABLE_NAME=Range Leaks
+RANGE_PAGE_FAILED_TABLE_NAME=Range Failed API
+RANGE_PAGE_WARNING_TABLE_NAME=Range Warning
\ No newline at end of file
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * YeongTaik Byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.nl;
+
+import org.eclipse.osgi.util.NLS;
+
+public class ThreadPageLabels extends NLS {
+ private static final String BUNDLE_NAME = "org.tizen.dynamicanalyzer.nl.ThreadPageLabels"; //$NON-NLS-1$
+ public static String THREAD_CHART_THREAD;
+ public static String THREAD_CHART_TITLE;
+ public static String THREAD_DETAILS_TITLE;
+ public static String SYNC_CHART_TITLE;
+
+ public static String THREAD_CHART_SERIES_LOAD;
+ public static String THREAD_CHART_SERIES_EVENT;
+ public static String THREAD_CHART_SERIES_API;
+
+ public static String THREAD_ITEM_TYPE_MAIN;
+ public static String THREAD_ITEM_TYPE_TIZEN;
+ public static String THREAD_ITEM_TYPE_PTHREAD;
+ public static String THREAD_ATTR_TYPE_JOINABLE;
+ public static String THREAD_ATTR_TYPE_DETACHED;
+
+ public static String SYNC_TYPE_TIZEN_MUTEX;
+ public static String SYNC_TYPE_TIZEN_MONITOR;
+ public static String SYNC_TYPE_TIZEN_SEMAPHORE;
+ public static String SYNC_TYPE_PTHREAD_MUTEX;
+ public static String SYNC_TYPE_PTHREAD_COND_VARIABLE;
+ public static String SYNC_TYPE_PTHREAD_RWLOCK;
+ public static String SYNC_TYPE_PTHREAD_SPINLOCK;
+ public static String SYNC_TYPE_PTHREAD_BARRIER;
+ public static String SYNC_ATTR_TYPE_NORMAL;
+ public static String SYNC_ATTR_TYPE_ERRORCHECK;
+ public static String SYNC_ATTR_TYPE_RECURSIVE;
+ public static String SYNC_ATTR_TYPE_DEFAULT;
+
+ public static String THREAD_API_TIZEN_JOIN;
+ public static String SYNC_API_PTHREAD_MUTEX_INIT;
+ public static String SYNC_API_PTHREAD_MUTEXATTR_INIT;
+ public static String SYNC_API_PTHREAD_MUTEXATTR_SETTYPE;
+
+ public static String THREAD_CHART_NAME_PREFIX;
+ public static String THREAD_CHART_NAME_POSTFIX;
+ public static String THREAD_CHART_NAME_TID;
+ public static String THREAD_CHART_NAME_OBJ;
+
+ public static String THREAD_SYNC_CHART_SERIES_STATE;
+
+ public static String THREAD_CHART_ITEM_CREATED;
+ public static String THREAD_CHART_ITEM_EXITED;
+ public static String THREAD_CHART_ITEM_JOINED;
+ public static String THREAD_CHART_ITEM_PERCENT;
+
+ public static String SYNC_CHART_ITEM_USED;
+ public static String SYNC_CHART_ITEM_UNUSED;
+ public static String SYNC_CHART_ITEM_WAITED;
+ public static String SYNC_CHART_ITEM_FAILED;
+
+ /* Thread API List view */
+ public static String THREAD_API_LIST_VEIW_TITLE;
+ public static String THREAD_API_LIST_VIEW_INDEX;
+ public static String THREAD_API_LIST_VIEW_TIME;
+ public static String THREAD_API_LIST_VIEW_NAME;
+ public static String THREAD_API_LIST_VIEW_PARAMETER;
+ public static String THREAD_API_LIST_VIEW_THREAD_ID;
+ public static String THREAD_API_LIST_VIEW_RETURN;
+ public static String THREAD_API_LIST_VIEW_ERRNO;
+
+ /* Thread Details */
+ public static String THREAD_DETAILS_TID;
+ public static String THREAD_DETAILS_TTYPE;
+ public static String THREAD_DETAILS_TATTRTYPE;
+ public static String THREAD_DETAILS_STARTTIME;
+ public static String THREAD_DETAILS_ENDTIME;
+
+ /* Thread Tooltip*/
+ public static String THREAD_TOOLTIP_APIS;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, ThreadPageLabels.class);
+ }
+
+ private ThreadPageLabels() {
+ }
+}
--- /dev/null
+THREAD_CHART_THREAD=Thread
+THREAD_CHART_TITLE=Thread Chart
+THREAD_DETAILS_TITLE=Thread Details
+SYNC_CHART_TITLE=Sync Chart
+
+THREAD_CHART_SERIES_LOAD=LOAD
+THREAD_CHART_SERIES_EVENT=EVENT
+THREAD_CHART_SERIES_API=API
+
+THREAD_ITEM_TYPE_MAIN=main thread
+THREAD_ITEM_TYPE_TIZEN=TIZEN thread
+THREAD_ITEM_TYPE_PTHREAD=pthread
+THREAD_ATTR_TYPE_JOINABLE=PTHREAD_CREATE_JOINABLE
+THREAD_ATTR_TYPE_DETACHED=PTHREAD_CREATE_DETACHED
+
+SYNC_TYPE_TIZEN_MUTEX=TIZEN mutex
+SYNC_TYPE_TIZEN_MONITOR=TIZEN monitor
+SYNC_TYPE_TIZEN_SEMAPHORE=TIZEN semaphore
+SYNC_TYPE_PTHREAD_MUTEX=pthread mutex
+SYNC_TYPE_PTHREAD_COND_VARIABLE=pthread \ncondition variable
+SYNC_TYPE_PTHREAD_RWLOCK=pthread rwlock
+SYNC_TYPE_PTHREAD_SPINLOCK=pthread spinlock
+SYNC_TYPE_PTHREAD_BARRIER=pthread barrier
+SYNC_ATTR_TYPE_NORMAL=PTHREAD_MUTEX_NORMAL
+SYNC_ATTR_TYPE_ERRORCHECK=PTHREAD_MUTEX_ERRORCHECK
+SYNC_ATTR_TYPE_RECURSIVE=PTHREAD_MUTEX_RECURSIVE
+SYNC_ATTR_TYPE_DEFAULT=PTHREAD_MUTEX_DEFAULT
+
+THREAD_API_TIZEN_JOIN=Thread::Join
+SYNC_API_PTHREAD_MUTEX_INIT=pthread_mutex_init
+SYNC_API_PTHREAD_MUTEXATTR_INIT=pthread_mutexattr_init
+SYNC_API_PTHREAD_MUTEXATTR_SETTYPE=pthread_mutexattr_settype
+
+THREAD_CHART_NAME_PREFIX=\n(
+THREAD_CHART_NAME_POSTFIX=)
+THREAD_CHART_NAME_TID=tid :
+THREAD_CHART_NAME_OBJ=object name :\n
+
+THREAD_SYNC_CHART_SERIES_STATE=STATE
+
+THREAD_CHART_ITEM_CREATED=CREATED
+THREAD_CHART_ITEM_EXITED=EXITED
+THREAD_CHART_ITEM_JOINED=JOINED
+THREAD_CHART_ITEM_PERCENT=%
+
+SYNC_CHART_ITEM_USED= USED
+SYNC_CHART_ITEM_UNUSED= UNUSED
+SYNC_CHART_ITEM_WAITED= WAITED
+SYNC_CHART_ITEM_FAILED= FAILED
+
+THREAD_API_LIST_VEIW_TITLE=Thread API List
+THREAD_API_LIST_VIEW_INDEX=#
+THREAD_API_LIST_VIEW_TIME=Time
+THREAD_API_LIST_VIEW_NAME=Thread API
+THREAD_API_LIST_VIEW_PARAMETER=Parameter
+THREAD_API_LIST_VIEW_THREAD_ID=Thread ID
+THREAD_API_LIST_VIEW_RETURN=Return value
+THREAD_API_LIST_VIEW_ERRNO=Error Code
+
+THREAD_DETAILS_TID=Thread ID :
+THREAD_DETAILS_TTYPE=Type :
+THREAD_DETAILS_TATTRTYPE=Attr Type :
+THREAD_DETAILS_STARTTIME=Start Time :
+THREAD_DETAILS_ENDTIME=End Time :
+
+THREAD_TOOLTIP_APIS=APIs
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * SangHyun Lee <sanghyunnim.lee@samsung.com>
+ * YeongTaik Byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.nl;
+
+import org.eclipse.osgi.util.NLS;
+
+public class TimelineChartLabels extends NLS {
+ private static final String BUNDLE_NAME = "org.tizen.dynamicanalyzer.nl.TimelineChartLabels"; //$NON-NLS-1$
+ public static String CPU_CHART_SERIES_NAME_APP_LOAD;
+ public static String CPU_CHART_SERIES_NAME_TOTAL_LOAD;
+ public static String CPU_CHART_TITLE;
+
+ public static String CPU_CORE_CHART_SERIES_NAME_CORE0;
+ public static String CPU_CORE_CHART_SERIES_NAME_CORE1;
+ public static String CPU_CORE_CHART_SERIES_NAME_CORE2;
+ public static String CPU_CORE_CHART_SERIES_NAME_CORE3;
+ public static String CPU_CORE_CHART_TITLE;
+
+ public static String CPU_FREQUENCY_CHART_FREQUENCY;
+ public static String CPU_FREQUENCY_CHART_TITLE;
+
+ public static String FILE_CHART_SERIES_NAME_FD_COUNT;
+ public static String FILE_CHART_SERIES_NAME_READ;
+ public static String FILE_CHART_SERIES_NAME_WRITE;
+ public static String FILE_CHART_TITLE;
+
+ public static String HEAP_CHART_SERIES_NAME_PLATFORM_ALLOCATION;
+ public static String HEAP_CHART_SERIES_NAME_USER_ALLOCATION;
+ public static String HEAP_CHART_TITLE;
+
+ public static String PROCESS_MEMORY_CHART_PSS;
+ public static String PROCESS_MEMORY_CHART_RSS;
+ public static String PROCESS_MEMORY_CHART_VSS;
+ public static String PROCESS_MEMORY_CHART_TITLE;
+
+ public static String SYSTEM_MEMORY_CHART_SERIES_NAME_PROC_RESIDENT;
+ public static String SYSTEM_MEMORY_CHART_SERIES_NAME_SYSTEM;
+ public static String SYSTEM_MEMORY_CHART_SERIES_NAME_TOTAL;
+ public static String SYSTEM_MEMORY_CHART_TITLE;
+
+ public static String SCREENSHOT_CHART_TITLE;
+
+ public static String UI_EVENT_CHART_SERIES_NAME_KEY;
+ public static String UI_EVENT_CHART_SERIES_NAME_TOUCH;
+ public static String UI_EVENT_CHART_SERIES_NAME_GESTURE;
+ public static String UI_EVENT_CHART_SERIES_NAME_ORIENTATION;
+ public static String UI_EVENT_CHART_TITLE;
+
+ public static String TIMELINE_TICK_ADD;
+
+ public static String EDIT_CHART_DLG_TITLE;
+
+ public static String RANGE_CONTEXT_SET_START;
+ public static String RANGE_CONTEXT_SET_END;
+ public static String RANGE_CONTEXT_ANALYSIS;
+ public static String RANGE_CONTEXT_CLEAR;
+ public static String RANGE_CONTEXT_EVENT_LIST;
+
+ public static String UIEVENT_ORIENTATION;
+ public static String UIEVENT_ORIENTATION_NONE;
+ public static String UIEVENT_ORIENTATION_PORTRAIT;
+ public static String UIEVENT_ORIENTATION_LANDSCAPE;
+ public static String UIEVENT_ORIENTATION_PORTRAIT_REVERSE;
+ public static String UIEVENT_ORIENTATION_LANDSCAPE_REVERSE;
+
+ public static String UIEVENT_TOUCH_PRESSED;
+ public static String UIEVENT_TOUCH_LONG_PRESSED;
+ public static String UIEVENT_TOUCH_RELEASED;
+ public static String UIEVENT_TOUCH_MOVED;
+ public static String UIEVENT_TOUCH_DOUBLE_PRESSED;
+ public static String UIEVENT_TOUCH_FOCUS_IN;
+ public static String UIEVENT_TOUCH_FOCUS_OUT;
+ public static String UIEVENT_TOUCH_CANCELED;
+
+ public static String UIEVENT_GESTURE_FLICK;
+ public static String UIEVENT_GESTURE_LONG_PRESS;
+ public static String UIEVENT_GESTURE_PANNING;
+ public static String UIEVENT_GESTURE_PINCH;
+ public static String UIEVENT_GESTURE_ROTATION;
+ public static String UIEVENT_GESTURE_TAP;
+
+ public static String UIEVENT_INFO_DISTANCE;
+ public static String UIEVENT_INFO_DURATION;
+ public static String UIEVENT_INFO_MOVE_ALLOWANCE;
+ public static String UIEVENT_INFO_COUNT;
+ public static String UIEVENT_INFO_TOUCH_COUNT;
+ public static String UIEVENT_INFO_CENTER;
+ public static String UIEVENT_INFO_ANGLE;
+ public static String UIEVENT_INFO_TAP_INTERVAL;
+
+ public static String UIEVENT_FLICK_DIRECTION_RIGHT;
+ public static String UIEVENT_FLICK_DIRECTION_UP;
+ public static String UIEVENT_FLICK_DIRECTION_LEFT;
+ public static String UIEVENT_FLICK_DIRECTION_DOWN;
+
+ public static String LIFECYCLE_INITIALIZING;
+ public static String LIFECYCLE_RUNNING;
+ public static String LIFECYCLE_PAUSING;
+ public static String LIFECYCLE_TERMINATING;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, TimelineChartLabels.class);
+ }
+
+ private TimelineChartLabels() {
+ }
+}
--- /dev/null
+
+
+
+
+
+
+
+
+CPU_CHART_SERIES_NAME_APP_LOAD=Application
+CPU_CHART_SERIES_NAME_TOTAL_LOAD=Total CPU load
+CPU_CHART_TITLE=CPU
+
+CPU_CORE_CHART_SERIES_NAME_CORE0=Core 0
+CPU_CORE_CHART_SERIES_NAME_CORE1=Core 1
+CPU_CORE_CHART_SERIES_NAME_CORE2=Core 2
+CPU_CORE_CHART_SERIES_NAME_CORE3=Core 3
+CPU_CORE_CHART_TITLE=CPU core
+
+CPU_FREQUENCY_CHART_FREQUENCY=CPU frequency
+CPU_FREQUENCY_CHART_TITLE=CPU frequency
+
+FILE_CHART_SERIES_NAME_FD_COUNT=File count
+FILE_CHART_SERIES_NAME_READ=Read size
+FILE_CHART_SERIES_NAME_WRITE=Write size
+FILE_CHART_TITLE=File
+
+HEAP_CHART_SERIES_NAME_PLATFORM_ALLOCATION=Platform
+HEAP_CHART_SERIES_NAME_USER_ALLOCATION=Application
+HEAP_CHART_TITLE=Heap allocation
+
+PROCESS_MEMORY_CHART_PSS=Proportional set size
+PROCESS_MEMORY_CHART_RSS=Resident set size
+PROCESS_MEMORY_CHART_VSS=Virtual set size
+PROCESS_MEMORY_CHART_TITLE=Process Size
+
+SYSTEM_MEMORY_CHART_SERIES_NAME_PROC_RESIDENT=Process memory size
+SYSTEM_MEMORY_CHART_SERIES_NAME_SYSTEM=System memory size
+SYSTEM_MEMORY_CHART_SERIES_NAME_TOTAL=Total memory size
+SYSTEM_MEMORY_CHART_TITLE=Memory
+
+SCREENSHOT_CHART_TITLE=Screenshot
+
+UI_EVENT_CHART_SERIES_NAME_KEY=Key
+UI_EVENT_CHART_SERIES_NAME_TOUCH=Touch
+UI_EVENT_CHART_SERIES_NAME_GESTURE=Gesture
+UI_EVENT_CHART_SERIES_NAME_ORIENTATION=Orientation
+UI_EVENT_CHART_TITLE=UI event
+
+TIMELINE_TICK_ADD=Add
+
+EDIT_CHART_DLG_TITLE=Edit chart
+
+RANGE_CONTEXT_SET_START=Set range start
+RANGE_CONTEXT_SET_END=Set range end
+RANGE_CONTEXT_ANALYSIS=Analyze
+RANGE_CONTEXT_CLEAR=Clear range
+RANGE_CONTEXT_EVENT_LIST=Event list
+
+UIEVENT_ORIENTATION=Orientation
+UIEVENT_ORIENTATION_NONE=None
+UIEVENT_ORIENTATION_PORTRAIT=Portrait
+UIEVENT_ORIENTATION_LANDSCAPE=Landscape
+UIEVENT_ORIENTATION_PORTRAIT_REVERSE=Reverse portrait
+UIEVENT_ORIENTATION_LANDSCAPE_REVERSE=Reverse landscape
+
+UIEVENT_TOUCH_PRESSED=Press
+UIEVENT_TOUCH_LONG_PRESSED=Long press
+UIEVENT_TOUCH_RELEASED=Release
+UIEVENT_TOUCH_MOVED=Move
+UIEVENT_TOUCH_DOUBLE_PRESSED=Double press
+UIEVENT_TOUCH_FOCUS_IN=Focus in
+UIEVENT_TOUCH_FOCUS_OUT=Focus out
+UIEVENT_TOUCH_CANCELED=Cancel
+
+UIEVENT_GESTURE_FLICK=Flick
+UIEVENT_GESTURE_LONG_PRESS=Long press
+UIEVENT_GESTURE_PANNING=Pan
+UIEVENT_GESTURE_PINCH=Pinch
+UIEVENT_GESTURE_ROTATION=Rotate
+UIEVENT_GESTURE_TAP=Tap
+
+UIEVENT_INFO_DISTANCE=Distance
+UIEVENT_INFO_DURATION=Duration
+UIEVENT_INFO_MOVE_ALLOWANCE=Move allowance
+UIEVENT_INFO_COUNT=Count
+UIEVENT_INFO_TOUCH_COUNT=Touch count
+UIEVENT_INFO_CENTER=Center
+UIEVENT_INFO_ANGLE=Angle
+UIEVENT_INFO_TAP_INTERVAL=Tap interval
+
+UIEVENT_FLICK_DIRECTION_RIGHT=Right
+UIEVENT_FLICK_DIRECTION_UP=Up
+UIEVENT_FLICK_DIRECTION_LEFT=Left
+UIEVENT_FLICK_DIRECTION_DOWN=Down
+
+LIFECYCLE_INITIALIZING=Initializing
+LIFECYCLE_RUNNING=Running
+LIFECYCLE_PAUSING=Pausing
+LIFECYCLE_TERMINATING=Terminating
\ No newline at end of file
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * SangHyun Lee <sanghyunnim.lee@samsung.com>
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * YeongTaik Byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.nl;
+
+import org.eclipse.osgi.util.NLS;
+
+public class TimelinePageLabels extends NLS {
+ private static final String BUNDLE_NAME = "org.tizen.dynamicanalyzer.nl.TimelinePageLabels"; //$NON-NLS-1$
+ public static String CALL_TRACE_VIEW_NAME;
+ public static String CALL_TRACE_VIEW_TIME;
+ public static String CALL_TRACE_VIEW_TID;
+ public static String CALL_TRACE_VIEW_TITLE;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, TimelinePageLabels.class);
+ }
+
+ private TimelinePageLabels() {
+ }
+}
--- /dev/null
+CALL_TRACE_VIEW_NAME=API
+CALL_TRACE_VIEW_TIME=Time
+CALL_TRACE_VIEW_TID=Thread id
+CALL_TRACE_VIEW_TITLE=Call Trace
+
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.nl;
+
+import org.eclipse.osgi.util.NLS;
+
+public class UserInterfacePageLabels extends NLS {
+
+ private static final String BUNDLE_NAME = "org.tizen.dynamicanalyzer.nl.UserInterfacePageLabels"; //$NON-NLS-1$
+ public static String USERINTERFACE_SNAPSHOT_VIEW_NAME;
+
+ public static String USERINTERFACE_CONTROL_LIST_VIEW_NAME;
+ public static String USERINTERFACE_CONTROL_LIST_VIEW_COLUMN_0;
+ public static String USERINTERFACE_CONTROL_LIST_VIEW_COLUMN_1;
+ public static String USERINTERFACE_CONTROL_LIST_VIEW_COLUMN_2;
+ public static String USERINTERFACE_CONTROL_LIST_VIEW_COLUMN_3;
+
+ public static String USERINTERFACE_SCENETRANSFORM_LIST_VIEW_NAME;
+ public static String USERINTERFACE_SCENETRANSFORM_LIST_VIEW_COLUMN_0;
+ public static String USERINTERFACE_SCENETRANSFORM_LIST_VIEW_COLUMN_1;
+ public static String USERINTERFACE_SCENETRANSFORM_LIST_VIEW_COLUMN_2;
+ public static String USERINTERFACE_SCENETRANSFORM_LIST_VIEW_COLUMN_3;
+ public static String USERINTERFACE_SCENETRANSFORM_LIST_VIEW_COLUMN_4;
+
+ public static String USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_NAME;
+ public static String USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_0;
+ public static String USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_1;
+ public static String USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_2;
+ public static String USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_3;
+ public static String USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_4;
+ public static String USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_5;
+ public static String USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_6;
+ public static String USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_7;
+ public static String USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_8;
+
+ public static String USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_INCLUSIVE_ELAPSED_TIME;
+ public static String USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_EXCLUSIVE_ELAPSED_TIME;
+ public static String USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_INCLUSIVE_CPU_TIME;
+ public static String USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_EXCLUSIVE_CPU_TIME;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, UserInterfacePageLabels.class);
+ }
+
+ private UserInterfacePageLabels() {
+ }
+}
\ No newline at end of file
--- /dev/null
+
+USERINTERFACE_CONTROL_LIST_VIEW_NAME = Controls
+USERINTERFACE_CONTROL_LIST_VIEW_COLUMN_0 = Class name
+USERINTERFACE_CONTROL_LIST_VIEW_COLUMN_1 = Initializing time
+USERINTERFACE_CONTROL_LIST_VIEW_COLUMN_2 = Terminating time
+USERINTERFACE_CONTROL_LIST_VIEW_COLUMN_3 = Control type
+
+USERINTERFACE_SCENETRANSFORM_LIST_VIEW_NAME = Scene Transition
+USERINTERFACE_SCENETRANSFORM_LIST_VIEW_COLUMN_0 = Time
+USERINTERFACE_SCENETRANSFORM_LIST_VIEW_COLUMN_1 = Scene name
+USERINTERFACE_SCENETRANSFORM_LIST_VIEW_COLUMN_2 = Form name
+USERINTERFACE_SCENETRANSFORM_LIST_VIEW_COLUMN_3 = Panel name
+USERINTERFACE_SCENETRANSFORM_LIST_VIEW_COLUMN_4 = Transition time
+
+USERINTERFACE_SNAPSHOT_VIEW_NAME = Snapshot
+
+USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_NAME = UI Function Profiling
+USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_0 = Library/function name
+USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_1 = Sum
+USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_2 = Average
+USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_3 = Sum
+USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_4 = Average
+USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_5 = Sum
+USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_6 = Average
+USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_7 = Sum
+USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_8 = Average
+USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_INCLUSIVE_ELAPSED_TIME = Inclusive elapsed time
+USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_EXCLUSIVE_ELAPSED_TIME = Exclusive elapsed time
+USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_INCLUSIVE_CPU_TIME = Inclusive CPU time
+USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_EXCLUSIVE_CPU_TIME = Exclusive CPU time
+
+
+
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.project;
+
+public class AppDesktopInfo {
+ private String desktopName;
+ private String name;
+ private String id;
+ private String execPath;
+
+ public String getDesktopName() {
+ return desktopName;
+ }
+
+ public void setDesktopName(String desktopName) {
+ this.desktopName = desktopName;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getExecPath() {
+ return execPath;
+ }
+
+ public void setExecPath(String execPath) {
+ this.execPath = execPath;
+ }
+
+ public void setPkgId(String pkgid) {
+ id = pkgid;
+ }
+
+ public String getPkgId() {
+ return id;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.project;
+
+import java.io.File;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+import java.util.concurrent.Semaphore;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.AnalyzerPaths;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
+import org.tizen.dynamicanalyzer.model.BaseLogCenter;
+import org.tizen.dynamicanalyzer.model.DeviceInfo;
+import org.tizen.dynamicanalyzer.model.LogCenter;
+import org.tizen.dynamicanalyzer.sql.SqlManager;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;
+
+public class Project {
+ private final String DEFAULT_TIME_FORMAT = "_yyyy-MM-dd-HH-mm-ss";//$NON-NLS-1$
+ private final String PIE_BUILD_FLAG = "1";//$NON-NLS-1$
+ private String appName = null;
+ private String pkgId = null;
+ private String createTime = null;
+ private List<LogCenter> logCenters;
+ private Connection connection;
+ private String savePath;
+ private String lastLogNum = CommonConstants.ZERO;
+ private String version = null;
+ private String device = null;
+ private List<String> appInfo = null;
+ private long startTime = 0;
+ private long lastTime = 0;
+ private int systemMemorySize = 0;
+ private int pid = 0;
+ private long stopTime = -1;
+
+ private Semaphore semaphore = new Semaphore(1);
+
+ public String getMaxBrightness() {
+ if (!getAppInfo().isEmpty()) {
+ String size = appInfo
+ .get(AnalyzerConstants.APP_INFO_MAX_BRIGHTNESS);
+ return size;
+ }
+ return null;
+ }
+
+ public long getStartTime() {
+ if (0 == startTime) {
+ if (!getAppInfo().isEmpty()) {
+ String time = appInfo
+ .get(AnalyzerConstants.APP_INFO_START_TIME);
+ if (time.isEmpty()) {
+ System.out.println("ERROR : start time is empty!!"); //$NON-NLS-1$
+ } else {
+ startTime = Long.parseLong(time);
+ }
+ }
+ }
+ return startTime;
+ }
+
+ public int getSystemMemorySize() {
+ if (0 == systemMemorySize) {
+ if (!getAppInfo().isEmpty()) {
+ String time = appInfo
+ .get(AnalyzerConstants.APP_INFO_SYSTEM_MEMORY_SIZE);
+ if (!time.isEmpty()) {
+ systemMemorySize = Integer.parseInt(time);
+ } else {
+ systemMemorySize = 0;
+ }
+ }
+ }
+ return systemMemorySize;
+ }
+
+ public int getPID() {
+ if (0 == pid) {
+ if (!getAppInfo().isEmpty()) {
+ String pID = appInfo.get(AnalyzerConstants.APP_INFO_PID);
+ pid = Integer.parseInt(pID);
+ }
+ }
+ return pid;
+ }
+
+ public long getLastTime() {
+ return lastTime;
+ }
+
+ public void setLastTime(long lastTime) {
+ this.lastTime = lastTime;
+ }
+
+ public List<String> getAppInfo() {
+ if (null == appInfo) {
+ appInfo = new ArrayList<String>();
+ for (int i = 0; i < AnalyzerConstants.APP_INFO_SIZE; i++) {
+ appInfo.add(""); //$NON-NLS-1$
+ }
+ }
+ return appInfo;
+ }
+
+ public void setVersion(String ver) {
+ version = ver;
+ }
+
+ public void setDevice(String dev) {
+ device = dev;
+ }
+
+ public String getDevice() {
+ return device;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public String getLastLogNum() {
+ return lastLogNum;
+ }
+
+ public String getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(String createTime) {
+ this.createTime = createTime;
+ }
+
+ public void setLastLogNum(String last) {
+ long prev = 0, current = 0;
+ try {
+ prev = Long.parseLong(lastLogNum);
+ current = Long.parseLong(last);
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ return;
+ }
+ if (prev < current) {
+ lastLogNum = last;
+ }
+ }
+
+ public void setStopTime(long time) {
+ stopTime = time;
+ }
+
+ public long getStopTime() {
+ return stopTime;
+ }
+
+ public void init() {
+ appName = DACommunicator.getSelectedApp().getName();
+ pkgId = DACommunicator.getSelectedApp().getPkgId();
+ DeviceInfo deviceName = DACommunicator.getSelectedDevice();
+ if (null != deviceName
+ && null != deviceName.getIDevice().getSerialNumber()
+ && !deviceName.getIDevice().getSerialNumber().isEmpty()) {
+ device = DACommunicator.getSelectedDevice().getIDevice()
+ .getSerialNumber();
+ } else {
+ device = CommonConstants.SPACE;
+ }
+
+ version = AnalyzerConstants.SAVE_DATA_VERSION;
+
+ SimpleDateFormat format = new SimpleDateFormat(DEFAULT_TIME_FORMAT,
+ Locale.KOREA);
+ Date date = new Date();
+ createTime = date.toString();
+ savePath = AnalyzerPaths.TEMP_FOLDER_PATH + File.separator + appName
+ + format.format(date);
+ File imgFolder = new File(savePath + File.separator
+ + AnalyzerConstants.IMAGE_FOLDER_NAME);
+ if (!imgFolder.isDirectory()) {
+ imgFolder.mkdirs();
+ }
+
+ File samallImage = new File(savePath + File.separator
+ + AnalyzerConstants.IMAGE_FOLDER_NAME + File.separator
+ + AnalyzerConstants.SMALL_IMAGE_FOLDER_NAME);
+ if (!samallImage.isDirectory()) {
+ samallImage.mkdirs();
+ }
+
+ initLogCenters(null);
+ AnalyzerManager.setProject(this);
+
+ // create table
+ SqlManager.getInstance().createProjectTable(this);
+ int size = getLogCenters().size();
+ for (int i = 0; i < size; i++) {
+ if (AnalyzerManager.isExit()) {
+ return;
+ }
+ SqlManager.getInstance().createTable(logCenters.get(i));
+ }
+ // create save tables
+ SqlManager.getInstance().createTables();
+ }
+
+ public String getSavePath() {
+ return savePath;
+ }
+
+ public void setSavePath(String path) {
+ savePath = path;
+ }
+
+ public Connection getConnection() {
+ try {
+ semaphore.acquire();
+ if (connection == null || connection.isClosed()) {
+ Class.forName("org.sqlite.JDBC"); //$NON-NLS-1$
+ connection = DriverManager.getConnection("jdbc:sqlite:" //$NON-NLS-1$
+ + savePath
+ + File.separator
+ + AnalyzerConstants.DATABASE_NAME);
+ }
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } finally{
+ semaphore.release();
+ }
+ return connection;
+ }
+
+ public void closeConnection() {
+ try {
+ if (connection != null || !connection.isClosed()) {
+ connection.close();
+ }
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public String getAppName() {
+ return appName;
+ }
+
+ public String getPkgId() {
+ return pkgId;
+ }
+
+ public void setAppName(String name) {
+ appName = name;
+ }
+
+ public void setPkgId(String pkgId) {
+ this.pkgId = pkgId;
+ }
+
+ public boolean initLogCenters(List<String> names) {
+ if (null != logCenters) {
+ logCenters = null;
+ }
+
+ logCenters = new ArrayList<LogCenter>();
+ List<LogCenter> baseLogcs = AnalyzerManager.getInnerLogCenters();
+ if (null == baseLogcs || baseLogcs.isEmpty()) {
+ System.out
+ .println("DynamicAnalyzer folder or logc file is missing! "); //$NON-NLS-1$
+ return false;
+ }
+ if (null == names || names.isEmpty()) {
+ int size = baseLogcs.size();
+ for (int i = 0; i < size; i++) {
+ logCenters.add(copyLogCenter(baseLogcs.get(i)));
+ }
+ return true;
+ }
+
+ int size = names.size();
+ int baseSize = baseLogcs.size();
+ for (int i = 0; i < size; i++) {
+ for (int a = 0; a < baseSize; a++) {
+ if (names.get(i).equals(baseLogcs.get(a).getName())) {
+ logCenters.add(copyLogCenter(baseLogcs.get(a)));
+ }
+ }
+ }
+ return true;
+ }
+
+ private LogCenter copyLogCenter(BaseLogCenter from) {
+ LogCenter to = new LogCenter();
+ to.setId(from.getId());
+ to.setName(from.getName());
+ to.setTotalColumnCount(from.getTotalColumnCount());
+ to.setCustomColumn(from.isCustomColumn());
+
+ to.getColumnName().addAll(from.getColumnName());
+ to.getType().addAll(from.getType());
+ to.getColumnSizes().addAll(from.getColumnSize());
+ to.getColumnOrder().addAll(from.getColumnOrder());
+ to.getColumnVisibility().addAll(from.getColumnVisibility());
+ to.getTableColumnName().addAll(from.getTableColumnName());
+ return to;
+ }
+
+ public List<LogCenter> getLogCenters() {
+ return logCenters;
+ }
+
+ public boolean isValid() {
+ if (null == version || null == appName || null == pkgId
+ || null == device || null == lastLogNum || null == logCenters
+ || logCenters.isEmpty()) {
+ return false;
+ }
+ return true;
+ }
+
+ public String getBinaryPath() {
+ if (!getAppInfo().isEmpty()) {
+ return appInfo.get(AnalyzerConstants.APP_INFO_BINARY_PATH);
+ }
+ return null;
+ }
+
+ public boolean isPieBuild() {
+ if (null == appInfo.get(AnalyzerConstants.APP_INFO_PIE_BUILD)) {
+ return false;
+ } else if (PIE_BUILD_FLAG.equals(appInfo
+ .get(AnalyzerConstants.APP_INFO_PIE_BUILD))) { //$NON-NLS-1$
+ return true;
+ }
+ return false;
+ }
+
+ public String getBaseAddress() {
+ if (!getAppInfo().isEmpty()) {
+ return appInfo.get(AnalyzerConstants.APP_INFO_BASE_ADDRESS);
+ }
+ return null;
+ }
+
+ public int getApplicationType() {
+ if (!getAppInfo().isEmpty()) {
+ String appType = appInfo.get(AnalyzerConstants.APP_INFO_APP_TYPE);
+ return Integer.parseInt(appType);
+ }
+ return AnalyzerConstants.APP_TYPE_TIZEN;
+ }
+
+ public void setTotalProfilingSampleCount(int count) {
+ FunctionUsageProfiler.getInstance().getProfileDataMaker()
+ .setTotalSampleCount(count);
+ }
+
+ public int getTotalProfilingSampleCount() {
+ return FunctionUsageProfiler.getInstance().getProfileDataMaker()
+ .getTotalSampleCount();
+ }
+}
--- /dev/null
+/*\r
+ * Dynamic Analyzer\r
+ *\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact: \r
+ * Jooyoul Lee <jy.exe.lee@samsung.com>\r
+ * Juyoung Kim <j0.kim@samsung.com>\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ * \r
+ */\r
+\r
+package org.tizen.dynamicanalyzer.resources;\r
+\r
+import org.eclipse.swt.graphics.Color;\r
+import org.eclipse.swt.graphics.RGB;\r
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;\r
+\r
+public class ColorResources {\r
+ public static final Color WHITE = getColor("white"); //$NON-NLS-1$\r
+ public static final Color BLACK = getColor("black"); //$NON-NLS-1$\r
+ public static final Color BLUE = getColor("blue"); //$NON-NLS-1$\r
+ public static final Color RED = getColor("red"); //$NON-NLS-1$\r
+ public static final Color YELLOW = getColor("yellow"); //$NON-NLS-1$\r
+ public static final Color PURPLE = getColor("purple"); //$NON-NLS-1$\r
+\r
+ public static final Color GREEN = getColor("green"); //$NON-NLS-1$\r
+ public static final Color BROWN = getColor("brown"); //$NON-NLS-1$\r
+ public static final Color NAVY = getColor("navy"); //$NON-NLS-1$\r
+ public static final Color DARKVIOLET = getColor("darkviolet"); //$NON-NLS-1$\r
+ public static final Color MAROON = getColor("maroon"); //$NON-NLS-1$\r
+ public static final Color TEAL = getColor("teal"); //$NON-NLS-1$\r
+ public static final Color INDIGO = getColor("indigo"); //$NON-NLS-1$\r
+ public static final Color DARKGOLDENROD = getColor("darkgoldenrod"); //$NON-NLS-1$\r
+ public static final Color CHOCOLATE = getColor("chocolate"); //$NON-NLS-1$\r
+ public static final Color MAGNETA = getColor("magneta"); //$NON-NLS-1$\r
+\r
+ public static final Color GOLDENROD = getColor("goldenrod"); //$NON-NLS-1$\r
+ public static final Color TURQUOISE = getColor("turquoise"); //$NON-NLS-1$\r
+ public static final Color VIOLET = getColor("violet"); //$NON-NLS-1$\r
+ public static final Color SLATEBLUE = getColor("slateblue"); //$NON-NLS-1$\r
+ public static final Color ORANGE = getColor("orange"); //$NON-NLS-1$\r
+ public static final Color YELLOWGREEN = getColor("yellowgreen"); //$NON-NLS-1$\r
+ public static final Color SKYBLUE = getColor("skyblue"); //$NON-NLS-1$\r
+ public static final Color ORCHID = getColor("orchid"); //$NON-NLS-1$\r
+ public static final Color SANDYBROWN = getColor("sandybrown"); //$NON-NLS-1$\r
+ public static final Color MEDIUMPURPLE = getColor("mediumpurple"); //$NON-NLS-1$\r
+\r
+ // shell window background color\r
+ public static Color WINDOW_BG_COLOR = getColor("window_bg_color"); //$NON-NLS-1$\r
+\r
+ public static Color DIALOG_BG_UPPER = getColor("dialg_bg_upper");//$NON-NLS-1$\r
+ public static Color DIALOG_BG_LOWER = getColor("dialg_bg_lower");//$NON-NLS-1$\r
+ public static Color DIALOG_SUNKEN_1 = getColor("dialg_sunken_1");//$NON-NLS-1$\r
+ public static Color DIALOG_SUNKEN_2 = getColor("dialg_sunken_2");//$NON-NLS-1$\r
+\r
+ public static Color EDIT_CHART_DIALOG_UPPER = getColor("edit_chart_dialog_upper");//$NON-NLS-1$\r
+ public static Color EDIT_CHART_DIALOG_LOWER = getColor("edit_chart_dialog_lower");//$NON-NLS-1$\r
+\r
+ public static Color VIEW_BORDER = getColor("view_border"); //$NON-NLS-1$\r
+ public static Color VIEW_BG_COLOR = getColor("view_bg_color"); //$NON-NLS-1$\r
+ public static Color VIEW_TITLE_FONT_COLOR = getColor("view_title_font_color");//$NON-NLS-1$\r
+\r
+ /** title bar colors **/\r
+ public static Color TITLEBAR_TEXT_COLOR = getColor("titlebar_text_color"); //$NON-NLS-1$\r
+ public static Color TITLEBAR_BG_COLOR = getColor("titlebar_bg"); //$NON-NLS-1$\r
+ public static Color TITLEBAR_START_COLOR = getColor("titlebar_start_color"); //$NON-NLS-1$\r
+ public static Color TITLEBAR_END_COLOR = getColor("titlebar_end_color"); //$NON-NLS-1$\r
+ public static Color TITLEBAR_BOTTOM_STROKE_1 = getColor("titlebar_bottom_stroke_1"); //$NON-NLS-1$\r
+ public static Color TITLEBAR_BOTTOM_STROKE_2 = getColor("titlebar_bottom_stroke_2"); //$NON-NLS-1$\r
+\r
+ /** Coolbar bg color **/\r
+ public static Color COOLBAR_BG_COLOR = getColor("coolbar_bg_color"); //$NON-NLS-1$\r
+ public static Color DEFAULT_FONT_COLOR = getColor("default_font_color");//$NON-NLS-1$\r
+\r
+ /** device and application combo specific colors start **/\r
+ public static Color DEVICE_APPLICATION_ENABLE = getColor("device_application_enable_font"); //$NON-NLS-1$\r
+ public static Color DEVICE_APPLICATION_DISABLE = getColor("device_application_disable"); //$NON-NLS-1$\r
+ public static Color DEVICE_APPLICATION_POPUP_OUTER_1 = getColor("device_application_popup_outer_1"); //$NON-NLS-1$\r
+ public static Color DEVICE_APPLICATION_POPUP_OUTER_2 = getColor("device_application_popup_outer_2"); //$NON-NLS-1$\r
+ public static Color DEVICE_APPLICATION_DROPDOWN_TEXT = getColor("device_application_enable_font"); //$NON-NLS-1$\r
+ public static Color DEVICE_APPLICATION_ITEM_NORMAL_TOP = getColor("device_application_item_normal_top"); //$NON-NLS-1$\r
+ public static Color DEVICE_APPLICATION_ITEM_NORMAL_INNER = getColor("device_application_item_normal_inner"); //$NON-NLS-1$\r
+ public static Color DEVICE_APPLICATION_ITEM_NORMAL_BOTTOM = getColor("device_application_item_normal_bottom"); //$NON-NLS-1$\r
+ public static Color DEVICE_APPLICATION_ITEM_SELECT_TOP = getColor(\r
+ "device_application_item_select_top", new RGB(76, 76, 77)); //$NON-NLS-1$\r
+ public static Color DEVICE_APPLICATION_ITEM_SELECT_INNER = getColor("device_application_item_select_inner"); //$NON-NLS-1$\r
+ public static Color DEVICE_APPLICATION_ITEM_SELECT_BOTTOM = getColor("device_application_item_select_bottom"); //$NON-NLS-1$\r
+\r
+ /*** combo button color ***/\r
+ public static Color DEVICE_APPLICATION_BUTTON_NORMAL_START = getColor("device_application_button_normal_start"); //$NON-NLS-1$\r
+ public static Color DEVICE_APPLICATION_BUTTON_NORMAL_END = getColor("device_application_button_normal_end"); //$NON-NLS-1$\r
+ public static Color DEVICE_APPLICATION_BUTTON_PUSH_START = getColor("device_application_button_push_start"); //$NON-NLS-1$\r
+ public static Color DEVICE_APPLICATION_BUTTON_PUSH_END = getColor("device_application_button_push_end"); //$NON-NLS-1$\r
+ public static Color DEVICE_APPLICATION_BUTTON_HOVER_START = getColor("device_application_button_hover_start"); //$NON-NLS-1$\r
+ public static Color DEVICE_APPLICATION_BUTTON_HOVER_END = getColor("device_application_button_hover_end"); //$NON-NLS-1$\r
+ public static Color DEVICE_APPLICATION_BUTTON_DISABLE_START = getColor("device_application_button_disable_start"); //$NON-NLS-1$\r
+ public static Color DEVICE_APPLICATION_BUTTON_DISABLE_END = getColor("device_application_button_disable_end"); //$NON-NLS-1$\r
+\r
+ public static Color DEVICE_APPLICATION_BUTTON_OUTLINE = getColor("device_application_button_outline"); //$NON-NLS-1$\r
+\r
+ /** device and application combo specific colors end **/\r
+\r
+ /*** common button colors ***/\r
+ public static Color BUTTON_DISABLE_COLOR_START = getColor("button_disable_color_start"); //$NON-NLS-1$\r
+ public static Color BUTTON_DISABLE_COLOR_END = getColor("button_disable_color_end"); //$NON-NLS-1$\r
+ public static Color BUTTON_NORMAL_COLOR_START = getColor("button_normal_color_start"); //$NON-NLS-1$\r
+ public static Color BUTTON_NORMAL_COLOR_END = getColor("button_normal_color_end"); //$NON-NLS-1$\r
+ public static Color BUTTON_HOVER_COLOR_START = getColor("button_hover_color_start"); //$NON-NLS-1$\r
+ public static Color BUTTON_HOVER_COLOR_END = getColor("button_hover_color_end"); //$NON-NLS-1$\r
+ public static Color BUTTON_PUSH_COLOR_START = getColor("button_push_color_start"); //$NON-NLS-1$\r
+ public static Color BUTTON_PUSH_COLOR_END = getColor("button_push_color_end"); //$NON-NLS-1$\r
+\r
+ public static Color BUTTON_OUTLINE_NORMAL_IN_COLOR = getColor("button_outline_normal_in_color"); //$NON-NLS-1$\r
+ public static Color BUTTON_OUTLINE_PUSH_IN_COLOR = getColor("button_outline_push_in_color"); //$NON-NLS-1$\r
+ public static Color BUTTON_OUTLINE_HOVER_IN_COLOR = getColor("button_outline_hover_in_color"); //$NON-NLS-1$\r
+ public static Color BUTTON_OUTLINE_DISABLE_IN_COLOR = getColor("button_outline_disable_in_color"); //$NON-NLS-1$\r
+\r
+ public static Color BUTTON_OUTLINE_NORMAL_COLOR = getColor("button_outline_normal_color"); //$NON-NLS-1$\r
+ public static Color BUTTON_OUTLINE_PUSH_COLOR = getColor("button_outline_push_color"); //$NON-NLS-1$\r
+ public static Color BUTTON_OUTLINE_HOVER_COLOR = getColor("button_outline_hover_color"); //$NON-NLS-1$\r
+ public static Color BUTTON_OUTLINE_DISABLE_COLOR = getColor("button_outline_disable_color"); //$NON-NLS-1$\r
+\r
+ public static Color BUTTON_NORMAL_FONT_COLOR = getColor("button_normal_font_color"); //$NON-NLS-1$\r
+ public static Color BUTTON_PUSH_FONT_COLOR = getColor("button_push_font_color"); //$NON-NLS-1$\r
+ public static Color BUTTON_HOVER_FONT_COLOR = getColor("button_hover_font_color"); //$NON-NLS-1$\r
+ public static Color BUTTON_DISABLE_FONT_COLOR = getColor("button_disable_font_color"); //$NON-NLS-1$\r
+\r
+ /** normal view layout colors start **/\r
+ public static Color NORMAL_VIEW_LAYOUT_OUTER = getColor("normal_view_layout_outer"); //$NON-NLS-1$\r
+ public static Color NORMAL_VIEW_LAYOUT_MIDDLE = getColor("normal_view_layout_middle"); //$NON-NLS-1$\r
+ public static Color NORMAL_VIEW_LAYOUT_INNER = getColor("normal_view_layout_inner"); //$NON-NLS-1$\r
+ /** normal view layout colors end **/\r
+\r
+ /** view colors start **/\r
+ public static Color SNAPSHOT_VIEW_OUTLINE = getColor("current_view_outline"); //$NON-NLS-1$\r
+ public static Color SNAPSHOT_VIEW_TITLE_TEXT = WHITE;\r
+ public static Color SNAPSHOT_VIEW_MIDDLE = NORMAL_VIEW_LAYOUT_MIDDLE;\r
+ public static Color SNAPSHOT_VIEW_INNER = NORMAL_VIEW_LAYOUT_INNER;\r
+\r
+ public static Color SNAPSHOT_VIEW_TABLE_TITLE_BG = getColor("current_view_table_title_bg"); //$NON-NLS-1$\r
+ public static Color SNAPSHOT_VIEW_TABLE_TITLE_TEXT = getColor("current_view_table_title_text"); //$NON-NLS-1$\r
+ public static Color SNAPSHOT_VIEW_TABLE_CONTENTS_BG = getColor("current_view_table_contents_bg"); //$NON-NLS-1$\r
+ public static Color SNAPSHOT_VIEW_TABLE_CONTENTS_TEXT = getColor("current_view_table_contents_text"); //$NON-NLS-1$\r
+ public static Color SNAPSHOT_VIEW_TABLE_LINE = getColor("current_view_table_line"); //$NON-NLS-1$\r
+\r
+ public static Color SNAPSHOT_VIEW_CPU_TEXT = getColor("current_view_cpu_text"); //$NON-NLS-1$\r
+ public static Color SNAPSHOT_VIEW_PROCESS_TEXT = getColor("current_view_process_text"); //$NON-NLS-1$\r
+ public static Color SNAPSHOT_VIEW_GRAPH_BG = getColor("current_view_graph_bg"); //$NON-NLS-1$\r
+ public static Color SNAPSHOT_VIEW_CPU_GRAPH = SNAPSHOT_VIEW_CPU_TEXT;\r
+ public static Color SNAPSHOT_VIEW_PROCESS_GRAPH = SNAPSHOT_VIEW_PROCESS_TEXT;\r
+ public static Color SNAPSHOT_VIEW_GRAPH_OUTLINE = getColor("current_view_graph_outline"); //$NON-NLS-1$\r
+ public static Color SNAPSHOT_VIEW_SNAPSHOT_OUTLINE = getColor("current_view_snapshot_outline"); //$NON-NLS-1$\r
+ public static Color SNAPSHOT_VIEW_LOCK_TEXT = getColor("current_view_lock_text"); //$NON-NLS-1$\r
+ /** current view colors end **/\r
+\r
+ /** common table colors start **/\r
+ public static Color TABLE_HEADER_BG = getColor("table_header_bg"); //$NON-NLS-1$\r
+ public static Color TABLE_LINE = getColor("table_line"); //$NON-NLS-1$\r
+ public static Color TABLE_CONTENTS_NORMAL = getColor("table_contents_normal"); //$NON-NLS-1$\r
+ public static Color TABLE_CONTENTS_HOVER = getColor("table_contents_hover"); //$NON-NLS-1$\r
+ public static Color TABLE_CONTENTS_SELECTED_START = getColor("table_contents_selected_start"); //$NON-NLS-1$\r
+ public static Color TABLE_CONTENTS_SELECTED_END = getColor("table_contents_selected_end"); //$NON-NLS-1$\r
+ public static Color TABLE_CONTENTS_SELECTED_FONT_COLOR = getColor("table_contents_selected_font_color"); //$NON-NLS-1$\r
+ public static Color TABLE_HEADER_FONT_COLOR = getColor("table_title_font_color"); //$NON-NLS-1$\r
+ public static Color TABLE_CONTENTS_FONT_COLOR = getColor("table_contents_font_color"); //$NON-NLS-1$\r
+ /** common table colors end **/\r
+ \r
+ /** range color **/\r
+ public static Color TABLE_RANGE_COLOR_RANGE = getColor("table_range_color_range"); //$NON-NLS-1$\r
+ public static Color TABLE_RANGE_COLOR_SECOND_SELECTION = getColor("table_range_color_second_selection"); //$NON-NLS-1$\r
+ public static Color TABLE_RANGE_COLOR_RANGE_SECOND = getColor("table_range_color_range_second"); //$NON-NLS-1$\r
+ /** renge color end **/\r
+\r
+ /** open trace popup colors **/\r
+ public static Color OPEN_TRACE_LABEL_COLOR = getColor("open_trace_label_color");//$NON-NLS-1$\r
+ public static Color OPEN_TRACE_SAVE_CONTENTS_COLOR = getColor("open_trace_save_contents_color");//$NON-NLS-1$\r
+ public static Color OPEN_TRACE_TEMP_CONTENTS_COLOR = getColor("open_trace_temp_contents_color");//$NON-NLS-1$\r
+ public static Color OPEN_TRACE_TABLE_OUTLINE_COLOR = getColor("open_trace_table_outline_color");//$NON-NLS-1$\r
+\r
+ public static Color OPEN_TRACE_TABLE_CONTENT_NORMAL_COLOR1 = getColor("open_trace_table_content_normal_color1");//$NON-NLS-1$\r
+ public static Color OPEN_TRACE_TABLE_CONTENT_HOVER_COLOR1 = getColor("open_trace_table_content_hover_color1");//$NON-NLS-1$\r
+ public static Color OPEN_TRACE_TABLE_CONTENT_SELECTED_START_COLOR1 = getColor("open_trace_table_content_selected_start_color1");//$NON-NLS-1$\r
+ public static Color OPEN_TRACE_TABLE_CONTENT_SELECTED_END_COLOR1 = getColor("open_trace_table_content_selected_end_color1");//$NON-NLS-1$\r
+\r
+ public static Color OPEN_TRACE_TABLE_CONTENT_NORMAL_COLOR2 = getColor("open_trace_table_content_normal_color2");//$NON-NLS-1$\r
+ public static Color OPEN_TRACE_TABLE_CONTENT_HOVER_COLOR2 = getColor("open_trace_table_content_hover_color2");//$NON-NLS-1$\r
+ public static Color OPEN_TRACE_TABLE_CONTENT_SELECTED_START_COLOR2 = getColor("open_trace_table_content_selected_start_color2");//$NON-NLS-1$\r
+ public static Color OPEN_TRACE_TABLE_CONTENT_SELECTED_END_COLOR2 = getColor("open_trace_table_content_selected_end_color2");//$NON-NLS-1$\r
+\r
+ public static Color OPEN_TRACE_BUTTON_COMPOSITE_BG_COLOR = getColor("open_trace_button_composite_bg_color");//$NON-NLS-1$\r
+\r
+ public static Color OPEN_TRACE_POPUP_CONTENTS_BG_COLOR = getColor("open_trace_popup_contents_bg_color"); //$NON-NLS-1$\r
+ public static Color OPEN_TRACE_POPUP_BOTTOM_BG_COLOR = getColor("open_trace_popup_bottom_bg_color"); //$NON-NLS-1$\r
+ public static Color OPEN_TRACE_TITLE_TEXT_COLOR = TITLEBAR_TEXT_COLOR;\r
+ public static Color OPEN_TRACE_INNERTITLE_TEXT_COLOR = WHITE;\r
+ public static Color OPEN_TRACE_BUTTON_TEXT_COLOR = WHITE;\r
+ // public static Color OPEN_TRACE_TABLE_OUTLINE_COLOR =\r
+ // SNAPSHOT_VIEW_TABLE_LINE;\r
+ public static Color OPEN_TRACE_TABLE_LINE1_NORMAL = getColor("open_trace_table_line1_normal"); //$NON-NLS-1$\r
+ public static Color OPEN_TRACE_TABLE_LINE1_HOVER = getColor("open_trace_table_line1_hover"); //$NON-NLS-1$\r
+ public static Color OPEN_TRACE_TABLE_LINE_SELECTED_START = getColor("open_trace_table_line_selected_start"); //$NON-NLS-1$\r
+ public static Color OPEN_TRACE_TABLE_LINE_SELECTED_END = getColor("open_trace_table_line_selected_end"); //$NON-NLS-1$\r
+ public static Color OPEN_TRACE_TABLE_LINE2_NORMAL = getColor("open_trace_table_line2_normal"); //$NON-NLS-1$\r
+ public static Color OPEN_TRACE_TABLE_LINE2_HOVER = getColor("open_trace_table_line2_hover"); //$NON-NLS-1$\r
+ public static Color OPEN_TRACE_TABLE2_FONT_COLOR = getColor("open_trace_table2_font_color"); //$NON-NLS-1$\r
+\r
+ /** tab widget colors **/\r
+ public static Color TAB_SELECTED_COLOR_START = getColor("tab_selected_color_start"); //$NON-NLS-1$\r
+ public static Color TAB_SELECTED_COLOR_END = getColor("tab_selected_color_end"); //$NON-NLS-1$\r
+ public static Color TAB_NORMAL_COLOR_START = getColor("tab_normal_color_start"); //$NON-NLS-1$\r
+ public static Color TAB_NORMAL_COLOR_END = getColor("tab_normal_color_end"); //$NON-NLS-1$\r
+ public static Color TAB_HOVER_COLOR_START = getColor("tab_hover_color_start"); //$NON-NLS-1$\r
+ public static Color TAB_HOVER_COLOR_END = getColor("tab_hover_color_end"); //$NON-NLS-1$\r
+ public static Color TAB_PUSH_COLOR_START = getColor("tab_push_color_start"); //$NON-NLS-1$\r
+ public static Color TAB_PUSH_COLOR_END = getColor("tab_push_color_end"); //$NON-NLS-1$\r
+\r
+ public static Color TAB_OUTLINE_NORMAL_COLOR = getColor("tab_outline_normal_color"); //$NON-NLS-1$\r
+ public static Color TAB_OUTLINE_PUSH_COLOR = getColor("tab_outline_push_color"); //$NON-NLS-1$\r
+ public static Color TAB_OUTLINE_HOVER_COLOR = getColor("tab_outline_hover_color"); //$NON-NLS-1$\r
+ public static Color TAB_OUTLINE_SELECTED_COLOR = getColor("tab_outline_selected_color"); //$NON-NLS-1$\r
+\r
+ public static Color TAB_SELECTED_FONT_COLOR = getColor("tab_selected_font_color"); //$NON-NLS-1$\r
+ public static Color TAB_NORMAL_FONT_COLOR = getColor("tab_normal_font_color"); //$NON-NLS-1$\r
+ public static Color TAB_HOVER_FONT_COLOR = getColor("tab_hover_font_color"); //$NON-NLS-1$\r
+ public static Color TAB_PUSH_FONT_COLOR = getColor("tab_push_font_color"); //$NON-NLS-1$\r
+\r
+ public static Color TAB_BG_COLOR_START = getColor("tab_bg_color_start"); //$NON-NLS-1$\r
+ public static Color TAB_BG_COLOR_END = getColor("tab_bg_color_end"); //$NON-NLS-1$\r
+ public static Color TAB_BG_OUTLINE_COLOR = getColor("tab_bg_outline_color"); //$NON-NLS-1$\r
+\r
+ /** Page chart colors **/\r
+ public static Color PAGE_CHART_HAEDER_BG = getColor("page_chart_header_bg"); //$NON-NLS-1$\r
+ public static Color PAGE_CHART_SELECTION_BG = getColor("page_chart_selection_bg"); //$NON-NLS-1$\r
+ public static Color PAGE_CHART_PARENT_BG = getColor("page_chart_parent_bg"); //$NON-NLS-1$\r
+ public static Color PAGE_CHART_CHILD_BG = getColor("page_chart_child_bg"); //$NON-NLS-1$\r
+ public static Color PAGE_OPEN_START_RUN = getColor("page_open_start_run"); //$NON-NLS-1$\r
+ public static Color PAGE_OPEN_END_RUN = getColor("page_open_end_run"); //$NON-NLS-1$\r
+ public static Color PAGE_OPEN_START_STOP = getColor("page_open_start_stop"); //$NON-NLS-1$\r
+ public static Color PAGE_OPEN_END_STOP = getColor("page_open_end_stop"); //$NON-NLS-1$\r
+ public static Color PAGE_CLOSED_START = getColor("page_closed_start"); //$NON-NLS-1$\r
+ public static Color PAGE_CLOSED_END = getColor("page_closed_end"); //$NON-NLS-1$\r
+ public static Color PAGE_USE_START = getColor("page_use_start"); //$NON-NLS-1$\r
+ public static Color PAGE_USE_END = getColor("page_use_end"); //$NON-NLS-1$\r
+\r
+ /** Thread chart colors **/\r
+ public static Color THREAD_OPEN_START_RUN = getColor("thread_open_start_run"); //$NON-NLS-1$\r
+ public static Color THREAD_OPEN_END_RUN = getColor("thread_open_end_run"); //$NON-NLS-1$\r
+ public static Color THREAD_OPEN_START_STOP = getColor("thread_open_start_stop"); //$NON-NLS-1$\r
+ public static Color THREAD_OPEN_END_STOP = getColor("thread_open_end_stop"); //$NON-NLS-1$\r
+ public static Color THREAD_CLOSED_START = getColor("thread_closed_start"); //$NON-NLS-1$\r
+ public static Color THREAD_CLOSED_END = getColor("thread_closed_end"); //$NON-NLS-1$\r
+ public static Color THREAD_SLEEP_START = getColor("thread_sleep_start"); //$NON-NLS-1$\r
+ public static Color THREAD_SLEEP_END = getColor("thread_sleep_end"); //$NON-NLS-1$\r
+\r
+ /** File chart colors **/ \r
+ public static Color FILE_API_USED = getColor("file_api_used"); //$NON-NLS-1$\r
+ public static Color FILE_API_FAILED = getColor("file_api_failed"); //$NON-NLS-1$\r
+ public static Color FILE_AREA_USED_START = getColor("file_area_used_start"); //$NON-NLS-1$\r
+ public static Color FILE_AREA_USED_END = getColor("file_area_used_end"); //$NON-NLS-1$\r
+ public static Color FILE_AREA_CLOSED_START = getColor("file_area_closed_start"); //$NON-NLS-1$\r
+ public static Color FILE_AREA_CLOSED_END = getColor("file_area_closed_end"); //$NON-NLS-1$\r
+ public static Color FILE_AREA_NOT_ACCESS_START = getColor("file_not_access_start"); //$NON-NLS-1$\r
+ public static Color FILE_AREA_NOT_ACCESS_END = getColor("file_not_access_end"); //$NON-NLS-1$\r
+ public static Color FILE_ACCESS_READ = getColor("file_access_read"); //$NON-NLS-1$\r
+ public static Color FILE_ACCESS_WRITE = getColor("file_access_write"); //$NON-NLS-1$\r
+\r
+ public static Color UNSELECTED_TAB_FIRST = getColor("unselected_tab_first"); //$NON-NLS-1$\r
+ public static Color UNSELECTED_TAB_SECOND = getColor("unselected_tab_second"); //$NON-NLS-1$\r
+ public static Color SELECTED_TAB_FIRST = getColor("selected_tab_first"); //$NON-NLS-1$\r
+ public static Color SELECTED_TAB_SECOND = getColor("selected_tab_second"); //$NON-NLS-1$\r
+\r
+ public static Color TOOLTIP = getColor("tooltip"); //$NON-NLS-1$\r
+\r
+ public static Color BAR_GRAY1 = getColor("barGRAY1"); //$NON-NLS-1$\r
+ public static Color BAR_GRAY2 = getColor("barGRAY2"); //$NON-NLS-1$\r
+ public static Color BAR_GRAY3 = getColor("barGRAY3"); //$NON-NLS-1$\r
+\r
+ /* Timeline */\r
+ public static Color ITEM_BLUE_BRIGHT = getColor("item blue right");//$NON-NLS-1$\r
+ public static Color ITEM_BLUE_DARK = getColor("item blue dark");//$NON-NLS-1$\r
+ public static Color ITEM_BG = getColor("item background");//$NON-NLS-1$\r
+ public static Color ITEM_BG_TOP = getColor("item_bg_top");//$NON-NLS-1$\r
+ public static Color ITEM_BG_Bottom = getColor("item_bg_bottom");//$NON-NLS-1$\r
+\r
+ public static Color TIMELINE_BG = getColor("timeline_bg"); //$NON-NLS-1$\r
+ public static Color TRANS = getColor("timeline_bg"); //$NON-NLS-1$\r
+ public static Color SNAPSHOT_CHART_FOREGROUND = BAR_GRAY1;\r
+ public static Color SNAPSHOT_CHART_BACKGROUND = getColor("snapshot_chart_bg"); //$NON-NLS-1$\r
+\r
+ public static Color GRAY_130 = getColor("GRAY_130"); //$NON-NLS-1$\r
+ public static Color GRAY_170 = getColor("GRAY_170"); //$NON-NLS-1$\r
+ public static Color GRAY_210 = getColor("GRAY_210"); //$NON-NLS-1$\r
+\r
+ public static Color DEFAULT_FOREGROUND = getColor("defaultForeground"); //$NON-NLS-1$\r
+ public static Color DEFAULT_BACKGROUND = getColor("defaultBackground"); //$NON-NLS-1$\r
+ public static Color DEFAULT_RED = getColor("defaultRed"); //$NON-NLS-1$\r
+\r
+ public static Color TIME_TICK_BG = getColor("time_tick_bg"); //$NON-NLS-1$\r
+ public static Color TIME_TICK_LINE = getColor("time_tick_line"); //$NON-NLS-1$\r
+\r
+ public static Color LIFECYCLE_INITIALIZING_TOP = getColor("lifecycle_initializing_top");//$NON-NLS-1$\r
+ public static Color LIFECYCLE_INITIALIZING_BOTTOM = getColor("lifecycle_initializing_bottom");//$NON-NLS-1$\r
+ public static Color LIFECYCLE_RUNNING_TOP = getColor("lifecycle_running_top");//$NON-NLS-1$\r
+ public static Color LIFECYCLE_RUNNING_BOTTOM = getColor("lifecycle_running_bottom");//$NON-NLS-1$\r
+ public static Color LIFECYCLE_PAUSING_TOP = getColor("lifecycle_pausing_top");//$NON-NLS-1$\r
+ public static Color LIFECYCLE_PAUSING_BOTTOM = getColor("lifecycle_pausing_bottom");//$NON-NLS-1$\r
+ public static Color LIFECYCLE_TERMINATING_TOP = getColor("lifecycle_terminating_top");//$NON-NLS-1$\r
+ public static Color LIFECYCLE_TERMINATING_BOTTOM = getColor("lifecycle_terminating_bottom");//$NON-NLS-1$\r
+\r
+ // circular graph\r
+ public static Color CPU_BAR_GRAPH_COLOR = getColor("cpu_bar_graph_color"); //$NON-NLS-1$\r
+ public static Color CPU_BAR_GRAPH_GRAY_COLOR = getColor("cpu_bar_graph_gray_color"); //$NON-NLS-1$\r
+ public static Color CPU_BAR_GRAPH_BG_COLOR = getColor("cpu_bar_graph_bg_color"); //$NON-NLS-1$\r
+\r
+ public static Color PROCESS_GRAPH_COLOR = getColor("process_bar_graph_color"); //$NON-NLS-1$\r
+ public static Color PROCESS_GRAPH_CENTER_COLOR = getColor("process_bar_graph_center_color"); //$NON-NLS-1$\r
+ public static Color PROCESS_GRAPH_BG_COLOR = getColor("process_bar_graph_bg_color"); //$NON-NLS-1$\r
+\r
+ public static Color PROFILING_GRAPH_COLOR_START = getColor("profiling_graph_color_start"); //$NON-NLS-1$\r
+ public static Color PROFILING_GRAPH_COLOR_END = getColor("profiling_graph_color_end"); //$NON-NLS-1$\r
+\r
+ public static Color PROFILING_GRAPH_SELECTION_COLOR_START = getColor("profiling_graph_selection_color_start"); //$NON-NLS-1$\r
+ public static Color PROFILING_GRAPH_SELECTION_COLOR_END = getColor("profiling_graph_selection_color_end"); //$NON-NLS-1$\r
+\r
+ // Add Chart\r
+ public static Color ADD_CHART_ENABLE_COLOR_START = getColor("add_chart_enable_color_start"); //$NON-NLS-1$\r
+ public static Color ADD_CHART_ENABLE_COLOR_END = getColor("add_chart_enable_color_end"); //$NON-NLS-1$\r
+ public static Color ADD_CHART_DISABLE_COLOR_START = getColor("add_chart_disable_color_start"); //$NON-NLS-1$\r
+ public static Color ADD_CHART_DISABLE_COLOR_END = getColor("add_chart_disable_color_end"); //$NON-NLS-1$\r
+\r
+ /** timeline chart **/\r
+ public static Color SERIESE_COLOR_CPU_SYSTEM = getColor("seriesColorCPUSystem"); //$NON-NLS-1$\r
+ public static Color SERIESE_COLOR_CPU_APP = getColor("seriesColorCPUApp"); //$NON-NLS-1$\r
+\r
+ public static Color SERIESE_COLOR_CPUCORE_CORE0 = getColor("seriesColorCPUCoreCore0"); //$NON-NLS-1$\r
+ public static Color SERIESE_COLOR_CPUCORE_CORE1 = getColor("seriesColorCPUCoreCore1"); //$NON-NLS-1$\r
+ public static Color SERIESE_COLOR_CPUCORE_CORE2 = getColor("seriesColorCPUCoreCore2"); //$NON-NLS-1$\r
+ public static Color SERIESE_COLOR_CPUCORE_CORE3 = getColor("seriesColorCPUCoreCore3"); //$NON-NLS-1$\r
+\r
+ public static Color SERIESE_COLOR_CPU_FREQ = getColor("seriesColorCPUFreq"); //$NON-NLS-1$\r
+\r
+ public static Color SERIESE_COLOR_HEAP_SYSTEM = getColor("seriesColorHeapSystem"); //$NON-NLS-1$\r
+ public static Color SERIESE_COLOR_HEAP_USER = getColor("seriesColorHeapApp"); //$NON-NLS-1$\r
+\r
+ public static Color SERIESE_COLOR_PROCESS_VSS = getColor("seriesColorProcessVSS"); //$NON-NLS-1$\r
+ public static Color SERIESE_COLOR_PROCESS_RSS = getColor("seriesColorProcessRSS"); //$NON-NLS-1$\r
+ public static Color SERIESE_COLOR_PROCESS_PSS = getColor("seriesColorProcessPSS"); //$NON-NLS-1$\r
+\r
+ public static Color SERIESE_COLOR_MEMORY_SYS_MAX = getColor("seriesColorMemorySysMax"); //$NON-NLS-1$\r
+ public static Color SERIESE_COLOR_MEMORY_SYS_USED = getColor("seriesColorMemorySysUsed"); //$NON-NLS-1$\r
+ public static Color SERIESE_COLOR_MEMORY_APP_USED = getColor("seriesColorMemoryAppUsed"); //$NON-NLS-1$\r
+\r
+ public static Color SERIESE_COLOR_FILE_READ = getColor("seriesColorFileRead"); //$NON-NLS-1$\r
+ public static Color SERIESE_COLOR_FILE_WRITE = getColor("seriesColorFileWrite"); //$NON-NLS-1$\r
+ public static Color SERIESE_COLOR_FILE_FD = getColor("seriesColorFileFD"); //$NON-NLS-1$\r
+\r
+ public static Color SERIES_COLOR_UI_EVENT_KEY = getColor("seriesColorUIEventKey");//$NON-NLS-1$\r
+ public static Color SERIES_COLOR_UI_EVENT_TOUCH = getColor("seriesColorUIEventTouch");//$NON-NLS-1$\r
+ public static Color SERIES_COLOR_UI_EVENT_GESTURE = getColor("seriesColorUIEventGesture");//$NON-NLS-1$\r
+ public static Color SERIES_COLOR_UI_EVENT_ORIENTATION = getColor("seriesColorUIEventOrientation");//$NON-NLS-1$\r
+ public static Color SERIES_COLOR_UI_EVENT_FRAMEWORK = getColor("seriesColorUIEventFramework");//$NON-NLS-1$\r
+\r
+ public static Color SELECTION_RANGE = getColor("selectionRange"); //$NON-NLS-1$\r
+ public static Color SELECTION_LINE = getColor("selectionLine"); //$NON-NLS-1$\r
+\r
+ // scale widget\r
+ public static Color SCALE_OUTLINE_COLOR = getColor("scale_outline_color"); //$NON-NLS-1$\r
+ public static Color SCALE_BG_COLOR_START = getColor("scale_bg_color_start"); //$NON-NLS-1$\r
+ public static Color SCALE_BG_COLOR_END = getColor("scale_bg_color_end"); //$NON-NLS-1$\r
+ public static Color SCALE_AREA_COLOR = getColor("scale_area_color"); //$NON-NLS-1$\r
+ public static Color SCALE_AREA_OUTLINE_COLOR = getColor("scale_area_outline_color"); //$NON-NLS-1$\r
+\r
+ // stop progress dialog\r
+// public static Color STOP_PROGRESS_LINE1_COLOR = getColor("stop_progress_line1_color"); //$NON-NLS-1$\r
+// public static Color STOP_PROGRESS_LINE2_COLOR = getColor("stop_progress_line2_color"); //$NON-NLS-1$\r
+// public static Color STOP_PROGRESS_BACKGROUND_COLOR = getColor("stop_progress_background_color"); //$NON-NLS-1$\r
+// public static Color STOP_PROGRESS_INFO_FONT_COLOR = getColor("stop_progress_info_font_color"); //$NON-NLS-1$\r
+// public static Color STOP_PROGRESS_BAR_START_COLOR = getColor("stop_progress_bar_start_color"); //$NON-NLS-1$\r
+// public static Color STOP_PROGRESS_BAR_END_COLOR = getColor("stop_progress_bar_end_color"); //$NON-NLS-1$\r
+// public static Color STOP_PROGRESS_BAR_BG_START_COLOR = getColor("stop_progress_bar_bg_start_color"); //$NON-NLS-1$\r
+// public static Color STOP_PROGRESS_BAR_BG_END_COLOR = getColor("stop_progress_bar_bg_end_color"); //$NON-NLS-1$\r
+// public static Color STOP_PROGRESS_BAR_OUTLINE_COLOR = getColor("stop_progress_bar_outline_color"); //$NON-NLS-1$\r
+\r
+ // thread graph\r
+ public static Color THREAD_GRAPH_CPU_LOAD_COLOR = getColor("thread_graph_cpu_load_color"); //$NON-NLS-1$\r
+ public static Color THREAD_GRAPH_CALLEE_COLOR = getColor("thread_graph_callee_color"); //$NON-NLS-1$\r
+ public static Color THREAD_GRAPH_LOCK_NEW_COLOR = getColor("thread_graph_lock_new_color"); //$NON-NLS-1$\r
+ public static Color THREAD_GRAPH_LOCK_WAIT_COLOR = getColor("thread_graph_lock_wait_color"); //$NON-NLS-1$\r
+ public static Color THREAD_GRAPH_LOCK_ACQUIRE_COLOR = getColor("thread_graph_lock_acquire_color"); //$NON-NLS-1$\r
+ public static Color THREAD_GRAPH_LOCK_RELEASE_COLOR = getColor("thread_graph_lock_release_color"); //$NON-NLS-1$\r
+\r
+ public static Color SNAPSHOT_VIEWER_BG_COLOR = getColor("snapshot_viewer_bg_color"); //$NON-NLS-1$\r
+ \r
+// public static Color CHECKBOX_DISABLED_FONT_COLOR = getColor("checkbox_disabled_font_color"); //$NON-NLS-1$\r
+\r
+ \r
+ // configuration\r
+ public static Color CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR = getColor("configufation_table_cover_background_color"); //$NON-NLS-1$\r
+ public static Color CONFIGURATION_TABLE_BACKGROUND_COLOR = getColor("configufation_table_background_color"); //$NON-NLS-1$\r
+ public static Color CONFIGURATION_BUTTON_COVER_BACKGROUND_COLOR = getColor("configufation_button_cover_background_color"); //$NON-NLS-1$\r
+ public static Color CONFIGURATION_SUNKEN_LINE_UP_COLOR = getColor("configufation_sunken_line_up_color"); //$NON-NLS-1$\r
+ public static Color CONFIGURATION_SUNKEN_LINE_DOWN_COLOR = getColor("configufation_sunken_line_down_color"); //$NON-NLS-1$\r
+\r
+ \r
+ public static void initColors() {\r
+ WINDOW_BG_COLOR = getColor("window_bg_color"); //$NON-NLS-1$\r
+\r
+ DIALOG_BG_UPPER = getColor("dialg_bg_upper");//$NON-NLS-1$\r
+ DIALOG_BG_LOWER = getColor("dialg_bg_lower");//$NON-NLS-1$\r
+ DIALOG_SUNKEN_1 = getColor("dialg_sunken_1");//$NON-NLS-1$\r
+ DIALOG_SUNKEN_2 = getColor("dialg_sunken_2");//$NON-NLS-1$\r
+\r
+ EDIT_CHART_DIALOG_UPPER = getColor("edit_chart_dialog_upper");//$NON-NLS-1$\r
+ EDIT_CHART_DIALOG_LOWER = getColor("edit_chart_dialog_lower");//$NON-NLS-1$\r
+\r
+ VIEW_BORDER = getColor("view_border"); //$NON-NLS-1$\r
+ VIEW_BG_COLOR = getColor("view_bg_color"); //$NON-NLS-1$\r
+ VIEW_TITLE_FONT_COLOR = getColor("view_title_font_color");//$NON-NLS-1$\r
+\r
+ /** title bar colors **/\r
+ TITLEBAR_TEXT_COLOR = getColor("titlebar_text_color"); //$NON-NLS-1$\r
+ TITLEBAR_BG_COLOR = getColor("titlebar_bg"); //$NON-NLS-1$\r
+ TITLEBAR_START_COLOR = getColor("titlebar_start_color"); //$NON-NLS-1$\r
+ TITLEBAR_END_COLOR = getColor("titlebar_end_color"); //$NON-NLS-1$\r
+\r
+ /** Coolbar bg color **/\r
+ COOLBAR_BG_COLOR = getColor("coolbar_bg_color"); //$NON-NLS-1$\r
+ DEFAULT_FONT_COLOR = getColor("default_font_color");//$NON-NLS-1$\r
+\r
+ /** device and application combo specific colors start **/\r
+ DEVICE_APPLICATION_ENABLE = getColor("device_application_enable_font"); //$NON-NLS-1$\r
+ DEVICE_APPLICATION_DISABLE = getColor("device_application_disable"); //$NON-NLS-1$\r
+ DEVICE_APPLICATION_POPUP_OUTER_1 = getColor("device_application_popup_outer_1"); //$NON-NLS-1$\r
+ DEVICE_APPLICATION_POPUP_OUTER_2 = getColor("device_application_popup_outer_2"); //$NON-NLS-1$\r
+ // DEVICE_APPLICATION_POPUP_OUTER_1 = RED;\r
+ DEVICE_APPLICATION_DROPDOWN_TEXT = getColor("device_application_enable_font"); //$NON-NLS-1$\r
+ DEVICE_APPLICATION_ITEM_NORMAL_TOP = getColor("device_application_item_normal_top"); //$NON-NLS-1$\r
+ DEVICE_APPLICATION_ITEM_NORMAL_INNER = getColor("device_application_item_normal_inner"); //$NON-NLS-1$\r
+ DEVICE_APPLICATION_ITEM_NORMAL_BOTTOM = getColor("device_application_item_normal_bottom"); //$NON-NLS-1$\r
+ DEVICE_APPLICATION_ITEM_SELECT_TOP = getColor(\r
+ "device_application_item_select_top", new RGB(76, 76, 77)); //$NON-NLS-1$\r
+ DEVICE_APPLICATION_ITEM_SELECT_INNER = getColor("device_application_item_select_inner"); //$NON-NLS-1$\r
+ DEVICE_APPLICATION_ITEM_SELECT_BOTTOM = getColor("device_application_item_select_bottom"); //$NON-NLS-1$\r
+\r
+ /*** combo button color ***/\r
+ DEVICE_APPLICATION_BUTTON_NORMAL_START = getColor("device_application_button_normal_start"); //$NON-NLS-1$\r
+ DEVICE_APPLICATION_BUTTON_NORMAL_END = getColor("device_application_button_normal_end"); //$NON-NLS-1$\r
+ DEVICE_APPLICATION_BUTTON_PUSH_START = getColor("device_application_button_push_start"); //$NON-NLS-1$\r
+ DEVICE_APPLICATION_BUTTON_PUSH_END = getColor("device_application_button_push_end"); //$NON-NLS-1$\r
+ DEVICE_APPLICATION_BUTTON_HOVER_START = getColor("device_application_button_hover_start"); //$NON-NLS-1$\r
+ DEVICE_APPLICATION_BUTTON_HOVER_END = getColor("device_application_button_hover_end"); //$NON-NLS-1$\r
+ DEVICE_APPLICATION_BUTTON_DISABLE_START = getColor("device_application_button_disable_start"); //$NON-NLS-1$\r
+ DEVICE_APPLICATION_BUTTON_DISABLE_END = getColor("device_application_button_disable_end"); //$NON-NLS-1$\r
+\r
+ DEVICE_APPLICATION_BUTTON_OUTLINE = getColor("device_application_button_outline"); //$NON-NLS-1$\r
+\r
+ /** device and application combo specific colors end **/\r
+\r
+ /*** common button colors ***/\r
+ BUTTON_DISABLE_COLOR_START = getColor("button_disable_color_start"); //$NON-NLS-1$\r
+ BUTTON_DISABLE_COLOR_END = getColor("button_disable_color_end"); //$NON-NLS-1$\r
+ BUTTON_NORMAL_COLOR_START = getColor("button_normal_color_start"); //$NON-NLS-1$\r
+ BUTTON_NORMAL_COLOR_END = getColor("button_normal_color_end"); //$NON-NLS-1$\r
+ BUTTON_HOVER_COLOR_START = getColor("button_hover_color_start"); //$NON-NLS-1$\r
+ BUTTON_HOVER_COLOR_END = getColor("button_hover_color_end"); //$NON-NLS-1$\r
+ BUTTON_PUSH_COLOR_START = getColor("button_push_color_start"); //$NON-NLS-1$\r
+ BUTTON_PUSH_COLOR_END = getColor("button_push_color_end"); //$NON-NLS-1$\r
+\r
+ BUTTON_OUTLINE_NORMAL_IN_COLOR = getColor("button_outline_normal_in_color"); //$NON-NLS-1$\r
+ BUTTON_OUTLINE_PUSH_IN_COLOR = getColor("button_outline_push_in_color"); //$NON-NLS-1$\r
+ BUTTON_OUTLINE_HOVER_IN_COLOR = getColor("button_outline_hover_in_color"); //$NON-NLS-1$\r
+ BUTTON_OUTLINE_DISABLE_IN_COLOR = getColor("button_outline_disable_in_color"); //$NON-NLS-1$\r
+\r
+ BUTTON_OUTLINE_NORMAL_COLOR = getColor("button_outline_normal_color"); //$NON-NLS-1$\r
+ BUTTON_OUTLINE_PUSH_COLOR = getColor("button_outline_push_color"); //$NON-NLS-1$\r
+ BUTTON_OUTLINE_HOVER_COLOR = getColor("button_outline_hover_color"); //$NON-NLS-1$\r
+ BUTTON_OUTLINE_DISABLE_COLOR = getColor("button_outline_disable_color"); //$NON-NLS-1$\r
+\r
+ BUTTON_NORMAL_FONT_COLOR = getColor("button_normal_font_color"); //$NON-NLS-1$\r
+ BUTTON_PUSH_FONT_COLOR = getColor("button_push_font_color"); //$NON-NLS-1$\r
+ BUTTON_HOVER_FONT_COLOR = getColor("button_hover_font_color"); //$NON-NLS-1$\r
+ BUTTON_DISABLE_FONT_COLOR = getColor("button_disable_font_color"); //$NON-NLS-1$\r
+\r
+ /** normal view layout colors start **/\r
+ NORMAL_VIEW_LAYOUT_OUTER = getColor("normal_view_layout_outer"); //$NON-NLS-1$\r
+ NORMAL_VIEW_LAYOUT_MIDDLE = getColor("normal_view_layout_middle"); //$NON-NLS-1$\r
+ NORMAL_VIEW_LAYOUT_INNER = getColor("normal_view_layout_inner"); //$NON-NLS-1$\r
+ /** normal view layout colors end **/\r
+\r
+ /** view colors start **/\r
+ SNAPSHOT_VIEW_OUTLINE = getColor("current_view_outline"); //$NON-NLS-1$\r
+ SNAPSHOT_VIEW_TITLE_TEXT = WHITE;\r
+ SNAPSHOT_VIEW_MIDDLE = NORMAL_VIEW_LAYOUT_MIDDLE;\r
+ SNAPSHOT_VIEW_INNER = NORMAL_VIEW_LAYOUT_INNER;\r
+\r
+ SNAPSHOT_VIEW_TABLE_TITLE_BG = getColor("current_view_table_title_bg"); //$NON-NLS-1$\r
+ SNAPSHOT_VIEW_TABLE_TITLE_TEXT = getColor("current_view_table_title_text"); //$NON-NLS-1$\r
+ SNAPSHOT_VIEW_TABLE_CONTENTS_BG = getColor("current_view_table_contents_bg"); //$NON-NLS-1$\r
+ SNAPSHOT_VIEW_TABLE_CONTENTS_TEXT = getColor("current_view_table_contents_text"); //$NON-NLS-1$\r
+ SNAPSHOT_VIEW_TABLE_LINE = getColor("current_view_table_line"); //$NON-NLS-1$\r
+\r
+ SNAPSHOT_VIEW_CPU_TEXT = getColor("current_view_cpu_text"); //$NON-NLS-1$\r
+ SNAPSHOT_VIEW_PROCESS_TEXT = getColor("current_view_process_text"); //$NON-NLS-1$\r
+ SNAPSHOT_VIEW_GRAPH_BG = getColor("current_view_graph_bg"); //$NON-NLS-1$\r
+ SNAPSHOT_VIEW_CPU_GRAPH = SNAPSHOT_VIEW_CPU_TEXT;\r
+ SNAPSHOT_VIEW_PROCESS_GRAPH = SNAPSHOT_VIEW_PROCESS_TEXT;\r
+ SNAPSHOT_VIEW_GRAPH_OUTLINE = getColor("current_view_graph_outline"); //$NON-NLS-1$\r
+ SNAPSHOT_VIEW_SNAPSHOT_OUTLINE = getColor("current_view_snapshot_outline"); //$NON-NLS-1$\r
+ \r
+ SNAPSHOT_VIEW_LOCK_TEXT = getColor("current_view_lock_text"); //$NON-NLS-1$\r
+ /** current view colors end **/\r
+\r
+ /** common table colors start **/\r
+ TABLE_HEADER_BG = getColor("table_header_bg"); //$NON-NLS-1$\r
+ TABLE_LINE = getColor("table_line"); //$NON-NLS-1$\r
+ TABLE_CONTENTS_NORMAL = getColor("table_contents_normal"); //$NON-NLS-1$\r
+ TABLE_CONTENTS_HOVER = getColor("table_contents_hover"); //$NON-NLS-1$\r
+ TABLE_CONTENTS_SELECTED_START = getColor("table_contents_selected_start"); //$NON-NLS-1$\r
+ TABLE_CONTENTS_SELECTED_END = getColor("table_contents_selected_end"); //$NON-NLS-1$\r
+ TABLE_CONTENTS_SELECTED_FONT_COLOR = getColor("table_contents_selected_font_color"); //$NON-NLS-1$\r
+ TABLE_HEADER_FONT_COLOR = getColor("table_title_font_color"); //$NON-NLS-1$\r
+ TABLE_CONTENTS_FONT_COLOR = getColor("table_contents_font_color"); //$NON-NLS-1$\r
+ /** common table colors end **/\r
+\r
+ /** open trace popup colors **/\r
+ OPEN_TRACE_LABEL_COLOR = getColor("open_trace_label_color");//$NON-NLS-1$\r
+ OPEN_TRACE_SAVE_CONTENTS_COLOR = getColor("open_trace_save_contents_color");//$NON-NLS-1$\r
+ OPEN_TRACE_TEMP_CONTENTS_COLOR = getColor("open_trace_temp_contents_color");//$NON-NLS-1$\r
+ OPEN_TRACE_TABLE_OUTLINE_COLOR = getColor("open_trace_table_outline_color");//$NON-NLS-1$\r
+\r
+ OPEN_TRACE_TABLE_CONTENT_NORMAL_COLOR1 = getColor("open_trace_table_content_normal_color1");//$NON-NLS-1$\r
+ OPEN_TRACE_TABLE_CONTENT_HOVER_COLOR1 = getColor("open_trace_table_content_hover_color1");//$NON-NLS-1$\r
+ OPEN_TRACE_TABLE_CONTENT_SELECTED_START_COLOR1 = getColor("open_trace_table_content_selected_start_color1");//$NON-NLS-1$\r
+ OPEN_TRACE_TABLE_CONTENT_SELECTED_END_COLOR1 = getColor("open_trace_table_content_selected_end_color1");//$NON-NLS-1$\r
+\r
+ OPEN_TRACE_TABLE_CONTENT_NORMAL_COLOR2 = getColor("open_trace_table_content_normal_color2");//$NON-NLS-1$\r
+ OPEN_TRACE_TABLE_CONTENT_HOVER_COLOR2 = getColor("open_trace_table_content_hover_color2");//$NON-NLS-1$\r
+ OPEN_TRACE_TABLE_CONTENT_SELECTED_START_COLOR2 = getColor("open_trace_table_content_selected_start_color2");//$NON-NLS-1$\r
+ OPEN_TRACE_TABLE_CONTENT_SELECTED_END_COLOR2 = getColor("open_trace_table_content_selected_end_color2");//$NON-NLS-1$\r
+\r
+ OPEN_TRACE_BUTTON_COMPOSITE_BG_COLOR = getColor("open_trace_button_composite_bg_color");//$NON-NLS-1$\r
+\r
+ OPEN_TRACE_POPUP_CONTENTS_BG_COLOR = getColor("open_trace_popup_contents_bg_color"); //$NON-NLS-1$\r
+ OPEN_TRACE_POPUP_BOTTOM_BG_COLOR = getColor("open_trace_popup_bottom_bg_color"); //$NON-NLS-1$\r
+ OPEN_TRACE_TITLE_TEXT_COLOR = TITLEBAR_TEXT_COLOR;\r
+ OPEN_TRACE_INNERTITLE_TEXT_COLOR = WHITE;\r
+ OPEN_TRACE_BUTTON_TEXT_COLOR = WHITE;\r
+ // OPEN_TRACE_TABLE_OUTLINE_COLOR =\r
+ // SNAPSHOT_VIEW_TABLE_LINE;\r
+ OPEN_TRACE_TABLE_LINE1_NORMAL = getColor("open_trace_table_line1_normal"); //$NON-NLS-1$\r
+ OPEN_TRACE_TABLE_LINE1_HOVER = getColor("open_trace_table_line1_hover"); //$NON-NLS-1$\r
+ OPEN_TRACE_TABLE_LINE_SELECTED_START = getColor("open_trace_table_line_selected_start"); //$NON-NLS-1$\r
+ OPEN_TRACE_TABLE_LINE_SELECTED_END = getColor("open_trace_table_line_selected_end"); //$NON-NLS-1$\r
+ OPEN_TRACE_TABLE_LINE2_NORMAL = getColor("open_trace_table_line2_normal"); //$NON-NLS-1$\r
+ OPEN_TRACE_TABLE_LINE2_HOVER = getColor("open_trace_table_line2_hover"); //$NON-NLS-1$\r
+ OPEN_TRACE_TABLE2_FONT_COLOR = getColor("open_trace_table2_font_color"); //$NON-NLS-1$\r
+\r
+ /** tab widget colors **/\r
+ TAB_SELECTED_COLOR_START = getColor("tab_selected_color_start"); //$NON-NLS-1$\r
+ TAB_SELECTED_COLOR_END = getColor("tab_selected_color_end"); //$NON-NLS-1$\r
+ TAB_NORMAL_COLOR_START = getColor("tab_normal_color_start"); //$NON-NLS-1$\r
+ TAB_NORMAL_COLOR_END = getColor("tab_normal_color_end"); //$NON-NLS-1$\r
+ TAB_HOVER_COLOR_START = getColor("tab_hover_color_start"); //$NON-NLS-1$\r
+ TAB_HOVER_COLOR_END = getColor("tab_hover_color_end"); //$NON-NLS-1$\r
+ TAB_PUSH_COLOR_START = getColor("tab_push_color_start"); //$NON-NLS-1$\r
+ TAB_PUSH_COLOR_END = getColor("tab_push_color_end"); //$NON-NLS-1$\r
+\r
+ TAB_OUTLINE_NORMAL_COLOR = getColor("tab_outline_normal_color"); //$NON-NLS-1$\r
+ TAB_OUTLINE_PUSH_COLOR = getColor("tab_outline_push_color"); //$NON-NLS-1$\r
+ TAB_OUTLINE_HOVER_COLOR = getColor("tab_outline_hover_color"); //$NON-NLS-1$\r
+ TAB_OUTLINE_SELECTED_COLOR = getColor("tab_outline_selected_color"); //$NON-NLS-1$\r
+\r
+ TAB_SELECTED_FONT_COLOR = getColor("tab_selected_font_color"); //$NON-NLS-1$\r
+ TAB_NORMAL_FONT_COLOR = getColor("tab_normal_font_color"); //$NON-NLS-1$\r
+ TAB_HOVER_FONT_COLOR = getColor("tab_hover_font_color"); //$NON-NLS-1$\r
+ TAB_PUSH_FONT_COLOR = getColor("tab_push_font_color"); //$NON-NLS-1$\r
+\r
+ TAB_BG_COLOR_START = getColor("tab_bg_color_start"); //$NON-NLS-1$\r
+ TAB_BG_COLOR_END = getColor("tab_bg_color_end"); //$NON-NLS-1$\r
+ TAB_BG_OUTLINE_COLOR = getColor("tab_bg_outline_color"); //$NON-NLS-1$\r
+\r
+ /** Page chart colors **/\r
+ PAGE_CHART_HAEDER_BG = getColor("page_chart_header_bg"); //$NON-NLS-1$\r
+ PAGE_CHART_SELECTION_BG = getColor("page_chart_selection_bg"); //$NON-NLS-1$\r
+ PAGE_CHART_PARENT_BG = getColor("page_chart_parent_bg"); //$NON-NLS-1$\r
+ PAGE_CHART_CHILD_BG = getColor("page_chart_child_bg"); //$NON-NLS-1$\r
+ PAGE_OPEN_START_RUN = getColor("page_open_start_run"); //$NON-NLS-1$\r
+ PAGE_OPEN_END_RUN = getColor("page_open_end_run"); //$NON-NLS-1$\r
+ PAGE_OPEN_START_STOP = getColor("page_open_start_stop"); //$NON-NLS-1$\r
+ PAGE_OPEN_END_STOP = getColor("page_open_end_stop"); //$NON-NLS-1$\r
+ PAGE_CLOSED_START = getColor("page_closed_start"); //$NON-NLS-1$\r
+ PAGE_CLOSED_END = getColor("page_closed_end"); //$NON-NLS-1$\r
+ PAGE_USE_START = getColor("page_use_start"); //$NON-NLS-1$\r
+ PAGE_USE_END = getColor("page_use_end"); //$NON-NLS-1$\r
+\r
+ /** Thread chart colors **/\r
+ THREAD_OPEN_START_RUN = getColor("thread_open_start_run"); //$NON-NLS-1$\r
+ THREAD_OPEN_END_RUN = getColor("thread_open_end_run"); //$NON-NLS-1$\r
+ THREAD_OPEN_START_STOP = getColor("thread_open_start_stop"); //$NON-NLS-1$\r
+ THREAD_OPEN_END_STOP = getColor("thread_open_end_stop"); //$NON-NLS-1$\r
+ THREAD_CLOSED_START = getColor("thread_closed_start"); //$NON-NLS-1$\r
+ THREAD_CLOSED_END = getColor("thread_closed_end"); //$NON-NLS-1$\r
+ THREAD_SLEEP_START = getColor("thread_sleep_start"); //$NON-NLS-1$\r
+ THREAD_SLEEP_END = getColor("thread_sleep_end"); //$NON-NLS-1$\r
+\r
+ /** File chart colors **/\r
+ FILE_API_USED = getColor("file_api_used"); //$NON-NLS-1$\r
+ FILE_API_FAILED = getColor("file_api_failed"); //$NON-NLS-1$\r
+ FILE_AREA_USED_START = getColor("file_area_used_start"); //$NON-NLS-1$\r
+ FILE_AREA_USED_END = getColor("file_area_used_end"); //$NON-NLS-1$\r
+ FILE_AREA_CLOSED_START = getColor("file_area_closed_start"); //$NON-NLS-1$\r
+ FILE_AREA_CLOSED_END = getColor("file_area_closed_end"); //$NON-NLS-1$\r
+ FILE_AREA_NOT_ACCESS_START = getColor("file_not_access_start"); //$NON-NLS-1$\r
+ FILE_AREA_NOT_ACCESS_END = getColor("file_not_access_end"); //$NON-NLS-1$\r
+ FILE_ACCESS_READ = getColor("file_access_read"); //$NON-NLS-1$\r
+ FILE_ACCESS_WRITE = getColor("file_access_write"); //$NON-NLS-1$\r
+\r
+ UNSELECTED_TAB_FIRST = getColor("unselected_tab_first"); //$NON-NLS-1$\r
+ UNSELECTED_TAB_SECOND = getColor("unselected_tab_second"); //$NON-NLS-1$\r
+ SELECTED_TAB_FIRST = getColor("selected_tab_first"); //$NON-NLS-1$\r
+ SELECTED_TAB_SECOND = getColor("selected_tab_second"); //$NON-NLS-1$\r
+\r
+ TOOLTIP = getColor("tooltip"); //$NON-NLS-1$\r
+\r
+ BAR_GRAY1 = getColor("barGRAY1"); //$NON-NLS-1$\r
+ BAR_GRAY2 = getColor("barGRAY2"); //$NON-NLS-1$\r
+ BAR_GRAY3 = getColor("barGRAY3"); //$NON-NLS-1$\r
+\r
+ /* Timeline */\r
+ ITEM_BLUE_BRIGHT = getColor("item blue right");//$NON-NLS-1$\r
+ ITEM_BLUE_DARK = getColor("item blue dark");//$NON-NLS-1$\r
+ ITEM_BG = getColor("item background");//$NON-NLS-1$\r
+\r
+ TRANS = getColor("timeline_bg"); //$NON-NLS-1$\r
+ SNAPSHOT_CHART_FOREGROUND = BAR_GRAY1;\r
+ SNAPSHOT_CHART_BACKGROUND = getColor("snapshot_chart_bg"); //$NON-NLS-1$\r
+\r
+ GRAY_130 = getColor("GRAY_130"); //$NON-NLS-1$\r
+ GRAY_170 = getColor("GRAY_170"); //$NON-NLS-1$\r
+ GRAY_210 = getColor("GRAY_210"); //$NON-NLS-1$\r
+\r
+ DEFAULT_FOREGROUND = getColor("defaultForeground"); //$NON-NLS-1$\r
+ DEFAULT_BACKGROUND = getColor("defaultBackground"); //$NON-NLS-1$\r
+ DEFAULT_RED = getColor("defaultRed"); //$NON-NLS-1$\r
+\r
+ // circular graph\r
+ CPU_BAR_GRAPH_COLOR = getColor("cpu_bar_graph_color"); //$NON-NLS-1$\r
+ CPU_BAR_GRAPH_GRAY_COLOR = getColor("cpu_bar_graph_gray_color"); //$NON-NLS-1$\r
+ CPU_BAR_GRAPH_BG_COLOR = getColor("cpu_bar_graph_bg_color"); //$NON-NLS-1$\r
+\r
+ PROCESS_GRAPH_COLOR = getColor("process_bar_graph_color"); //$NON-NLS-1$\r
+ PROCESS_GRAPH_CENTER_COLOR = getColor("process_bar_graph_center_color"); //$NON-NLS-1$\r
+ PROCESS_GRAPH_BG_COLOR = getColor("process_bar_graph_bg_color"); //$NON-NLS-1$\r
+\r
+ PROFILING_GRAPH_COLOR_START = getColor("profiling_graph_color_start"); //$NON-NLS-1$\r
+ PROFILING_GRAPH_COLOR_END = getColor("profiling_graph_color_end"); //$NON-NLS-1$\r
+\r
+ PROFILING_GRAPH_SELECTION_COLOR_START = getColor("profiling_graph_selection_color_start"); //$NON-NLS-1$\r
+ PROFILING_GRAPH_SELECTION_COLOR_END = getColor("profiling_graph_selection_color_end"); //$NON-NLS-1$\r
+\r
+ // Add Chart\r
+ ADD_CHART_ENABLE_COLOR_START = getColor("add_chart_enable_color_start"); //$NON-NLS-1$\r
+ ADD_CHART_ENABLE_COLOR_END = getColor("add_chart_enable_color_end"); //$NON-NLS-1$\r
+ ADD_CHART_DISABLE_COLOR_START = getColor("add_chart_disable_color_start"); //$NON-NLS-1$\r
+ ADD_CHART_DISABLE_COLOR_END = getColor("add_chart_disable_color_end"); //$NON-NLS-1$\r
+\r
+ /** timeline chart **/\r
+ SERIESE_COLOR_CPU_SYSTEM = getColor("seriesColorCPUSystem"); //$NON-NLS-1$\r
+ SERIESE_COLOR_CPU_APP = getColor("seriesColorCPUApp"); //$NON-NLS-1$\r
+\r
+ SERIESE_COLOR_CPUCORE_CORE0 = getColor("seriesColorCPUCoreCore0"); //$NON-NLS-1$\r
+ SERIESE_COLOR_CPUCORE_CORE1 = getColor("seriesColorCPUCoreCore1"); //$NON-NLS-1$\r
+ SERIESE_COLOR_CPUCORE_CORE2 = getColor("seriesColorCPUCoreCore2"); //$NON-NLS-1$\r
+ SERIESE_COLOR_CPUCORE_CORE3 = getColor("seriesColorCPUCoreCore3"); //$NON-NLS-1$\r
+\r
+ SERIESE_COLOR_CPU_FREQ = getColor("seriesColorCPUFreq"); //$NON-NLS-1$\r
+\r
+ SERIESE_COLOR_HEAP_SYSTEM = getColor("seriesColorHeapSystem"); //$NON-NLS-1$\r
+ SERIESE_COLOR_HEAP_USER = getColor("seriesColorHeapApp"); //$NON-NLS-1$\r
+\r
+ SERIESE_COLOR_PROCESS_VSS = getColor("seriesColorProcessVSS"); //$NON-NLS-1$\r
+ SERIESE_COLOR_PROCESS_RSS = getColor("seriesColorProcessRSS"); //$NON-NLS-1$\r
+ SERIESE_COLOR_PROCESS_PSS = getColor("seriesColorProcessPSS"); //$NON-NLS-1$\r
+\r
+ SERIESE_COLOR_MEMORY_SYS_MAX = getColor("seriesColorMemorySysMax"); //$NON-NLS-1$\r
+ SERIESE_COLOR_MEMORY_SYS_USED = getColor("seriesColorMemorySysUsed"); //$NON-NLS-1$\r
+ SERIESE_COLOR_MEMORY_APP_USED = getColor("seriesColorMemoryAppUsed"); //$NON-NLS-1$\r
+\r
+ SERIESE_COLOR_FILE_READ = getColor("seriesColorFileRead"); //$NON-NLS-1$\r
+ SERIESE_COLOR_FILE_WRITE = getColor("seriesColorFileWrite"); //$NON-NLS-1$\r
+ SERIESE_COLOR_FILE_FD = getColor("seriesColorFileFD"); //$NON-NLS-1$\r
+\r
+ SELECTION_RANGE = getColor("selectionRange"); //$NON-NLS-1$\r
+ SELECTION_LINE = getColor("selectionLine"); //$NON-NLS-1$\r
+\r
+ // scale widget\r
+ SCALE_OUTLINE_COLOR = getColor("scale_outline_color"); //$NON-NLS-1$\r
+ SCALE_BG_COLOR_START = getColor("scale_bg_color_start"); //$NON-NLS-1$\r
+ SCALE_BG_COLOR_END = getColor("scale_bg_color_end"); //$NON-NLS-1$\r
+ SCALE_AREA_COLOR = getColor("scale_area_color"); //$NON-NLS-1$\r
+ SCALE_AREA_OUTLINE_COLOR = getColor("scale_area_outline_color"); //$NON-NLS-1$\r
+\r
+ // stop progress dialog\r
+// STOP_PROGRESS_LINE1_COLOR = getColor("stop_progress_line1_color"); //$NON-NLS-1$\r
+// STOP_PROGRESS_LINE2_COLOR = getColor("stop_progress_line2_color"); //$NON-NLS-1$\r
+// STOP_PROGRESS_BACKGROUND_COLOR = getColor("stop_progress_background_color"); //$NON-NLS-1$\r
+// STOP_PROGRESS_INFO_FONT_COLOR = getColor("stop_progress_info_font_color"); //$NON-NLS-1$\r
+\r
+ // thread graph\r
+ THREAD_GRAPH_CPU_LOAD_COLOR = getColor("thread_graph_cpu_load_color"); //$NON-NLS-1$\r
+ THREAD_GRAPH_CALLEE_COLOR = getColor("thread_graph_callee_color"); //$NON-NLS-1$\r
+ THREAD_GRAPH_LOCK_NEW_COLOR = getColor("thread_graph_lock_new_color"); //$NON-NLS-1$\r
+ THREAD_GRAPH_LOCK_WAIT_COLOR = getColor("thread_graph_lock_wait_color"); //$NON-NLS-1$\r
+ THREAD_GRAPH_LOCK_ACQUIRE_COLOR = getColor("thread_graph_lock_acquire_color"); //$NON-NLS-1$\r
+ THREAD_GRAPH_LOCK_RELEASE_COLOR = getColor("thread_graph_lock_release_color"); //$NON-NLS-1$\r
+\r
+ // configuration \r
+ CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR = getColor("configufation_table_cover_background_color"); //$NON-NLS-1$\r
+ CONFIGURATION_TABLE_BACKGROUND_COLOR = getColor("configufation_table_background_color"); //$NON-NLS-1$\r
+ CONFIGURATION_BUTTON_COVER_BACKGROUND_COLOR = getColor("configufation_button_cover_background_color"); //$NON-NLS-1$\r
+ CONFIGURATION_SUNKEN_LINE_UP_COLOR = getColor("configufation_sunken_line_up_color"); //$NON-NLS-1$\r
+ CONFIGURATION_SUNKEN_LINE_DOWN_COLOR = getColor("configufation_sunken_line_down_color"); //$NON-NLS-1$\r
+ \r
+ }\r
+\r
+ private static Color getColor(String colorName, RGB rgb) {\r
+ return AnalyzerManager.getTheme().getColor(colorName, rgb);\r
+ }\r
+\r
+ private static Color getColor(String colorName) {\r
+ return AnalyzerManager.getTheme().getColor(colorName);\r
+ }\r
+}\r
--- /dev/null
+/*\r
+ * Dynamic Analyzer\r
+ *\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact: \r
+ * Jooyoul Lee <jy.exe.lee@samsung.com>\r
+ * Juyoung Kim <j0.kim@samsung.com>\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ * \r
+ */\r
+package org.tizen.dynamicanalyzer.resources;\r
+\r
+import org.eclipse.jface.resource.FontRegistry;\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.graphics.Font;\r
+import org.eclipse.swt.graphics.FontData;\r
+import org.eclipse.ui.PlatformUI;\r
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;\r
+\r
+public class FontResources {\r
+\r
+ private static FontRegistry fontRegistry = new FontRegistry();\r
+ private static final Font defaultFont = getDADefaultFont();\r
+\r
+ // * Toolbal Layout\r
+ // Combo botton text font\r
+ public static final Font COMBO = getFont("combo", resizeDefaultFont(9, 2));//$NON-NLS-1$\r
+ // mac 11\r
+\r
+ // Combo drop-down list text font\r
+ public static final Font DROPDOWN = getFont(\r
+ "dropdown", resizeDefaultFont(9, 2));//$NON-NLS-1$\r
+ // mac 11\r
+\r
+ // Timer\r
+ public static final Font TIMER = getFont("timer", resizeDefaultFont(12, 5));//$NON-NLS-1$\r
+ // mac version 17\r
+\r
+ // tab button font\r
+ public static final Font TAB_BUTTON_FONT = getFont(\r
+ "tab_button_font", resizeDefaultFont(8, 3));//$NON-NLS-1$\r
+ // mac 11\r
+\r
+ // * Time-Line Layout\r
+ // Time-line\r
+ public static final Font TIMELINE_TICK_FONT = getFont(\r
+ "time_tick", resizeDefaultFont(6, 0));//$NON-NLS-1$\r
+ // Edit Chart Dlg.\r
+ public static final Font ADDITEM_BUTTON_FONT = getFont(\r
+ "additem_button_font", resizeDefaultFont(8, 3));//$NON-NLS-1$\r
+ // mac 11\r
+\r
+ // Chart Name\r
+ public static final Font TIMELINE_FONT = getFont(\r
+ "table_font", resizeDefaultFont(8, 0));//$NON-NLS-1$\r
+\r
+ // View title text font\r
+ public static final Font VIEW_TITLE = getFont(\r
+ "view_title", resizeDefaultFont(10, 1));//$NON-NLS-1$\r
+ // mac 11\r
+\r
+ // ui event text font\r
+ public static final Font TIMELINE_UIEVENT_FONT = getFont(\r
+ "timeline_uievent_font", resizeDefaultFont(7, 0));//$NON-NLS-1$\r
+\r
+ // * Open Trace\r
+ // Inner title : saved file and temporary file\r
+ public static final Font OPEN_TRACE_INNER_TITLE = getFont(\r
+ "open_trace_inner_title", resizeDefaultFont(9, 2));//$NON-NLS-1$\r
+ // mac 11\r
+\r
+ // * Edit Chart\r
+ // Title\r
+ public static final Font EDIT_CHART_DLG_TITLE = getFont(\r
+ "edit_chart_dlg_title", resizeDefaultFont(9, 0));//$NON-NLS-1$\r
+ // Button\r
+ public static final Font EDIT_CHART_DLG_BUTTON = getFont(\r
+ "edit_chart_dlg_button", resizeDefaultFont(9, 2));//$NON-NLS-1$\r
+ // Item Name\r
+ public static final Font EDIT_CHART_DLG_ITEM_NAME = getFont(\r
+ "edit_chart_item_name", resizeDefaultFont(9, 2));//$NON-NLS-1$\r
+ // Item SubName\r
+ public static final Font EDIT_CHART_DLG_ITEM_SUB_NAME = getFont(\r
+ "edit_chart_item_sub_name", resizeDefaultFont(9, 2));//$NON-NLS-1$\r
+\r
+ // DA table header and header group font\r
+ public static final Font TABLE_HEADER_FONT = getFont(\r
+ "table_header_font", resizeDefaultFont(8, 3));//$NON-NLS-1$\r
+ // mac 11\r
+\r
+ // DA table cell font (contents font)\r
+ public static final Font TABLE_CELL_FONT = getFont(\r
+ "table_cell_font", resizeDefaultFont(8, 3));//$NON-NLS-1$\r
+ // mac 11\r
+\r
+ public static final Font DETAIL_INFO_FONT = getFont(\r
+ "detail_info_font", resizeDefaultFont(8, 3));//$NON-NLS-1$\r
+ // mac 11\r
+\r
+ // * About Dlg.\r
+ public static final Font ABOUT_TEXT = getFont(\r
+ "about_text", resizeDefaultFont(9, 2));//$NON-NLS-1$\r
+ // mac 11\r
+ public static final Font DIALOG_BUTTON_FONT = getFont(\r
+ "dialog_button_font", resizeDefaultFont(9, 2));//$NON-NLS-1$\r
+ // mac 11\r
+\r
+ // * stop progress dialog\r
+ public static final Font STOP_PROGRESS_FONT = getFont(\r
+ "stop_progress_font", resizeDefaultFont(8, 3));//$NON-NLS-1$\r
+ public static final Font PROGRESS_FONT = getFont(\r
+ "progress_font", resizeDefaultFont(9, 3));//$NON-NLS-1$\r
+\r
+ // * not support\r
+ public static final Font TOOLTIP = getFont(\r
+ "tooltip", resizeDefaultFont(10, 1));//$NON-NLS-1$\r
+ public static final Font CIRCULAR_GRAPH_VALUE_FONT = getFont(\r
+ "circular_graph_value_font", resizeDefaultFont(13, 5));//$NON-NLS-1$\r
+ // mac 18\r
+\r
+ public static final Font CIRCULAR_GRAPH_MEASURE_FONT = getFont(\r
+ "circular_graph_measure_font", resizeDefaultFont(8, 3));//$NON-NLS-1$\r
+ // mac 11\r
+\r
+ public static final Font CIRCULAR_LABEL_FONT = getFont(\r
+ "circular_label_font", resizeDefaultFont(8, 3));//$NON-NLS-1$\r
+ // mac 11\r
+\r
+ public static final Font BAR_GRAPH_LABEL_FONT = getFont(\r
+ "bar_graph_label_font", resizeDefaultFont(8, 3));//$NON-NLS-1$\r
+ // mac 11\r
+\r
+ public static final Font BAR_GRAPH_FONT = getFont(\r
+ "bar_graph_font", resizeDefaultFont(6, 5));//$NON-NLS-1$\r
+ // mac 11\r
+\r
+ public static final Font LOCK_LABEL_FONT = getFont(\r
+ "lock_label_font", resizeDefaultFont(8, 3));//$NON-NLS-1$\r
+\r
+ public static final Font SCORE_TITLE_FONT = getFont(\r
+ "score_title_font", setDefaultFontStyleAndSize(SWT.BOLD, 10));//$NON-NLS-1$\r
+\r
+ // * chart\r
+ public static final Font CHART_TOOLTIP_FONT = getFont(\r
+ "chart_tootip_font", resizeDefaultFont(8, 3));//$NON-NLS-1$\r
+\r
+ public static final Font CHART_AXIS_FONT = getFont(\r
+ "chart_axis_font", resizeDefaultFont(8, 3));//$NON-NLS-1$\r
+\r
+ public static final Font CHART_ARROW_TID_FONT = getFont(\r
+ "chart_arrow_tid_font", resizeDefaultFont(7, 3));//$NON-NLS-1$\r
+\r
+ // * chart board\r
+ public static final Font CHART_NAME_FONT = getFont(\r
+ "chart_name_font", resizeDefaultFont(8, 3));//$NON-NLS-1$\r
+\r
+ public static final Font CONTEXT_MENU_ITEM_FONT = getFont(\r
+ "context_menu_item_font", resizeDefaultFont(9, 3));//$NON-NLS-1$\r
+\r
+ // * configuration\r
+ public static final Font CONFIGURATION_TABLE_TITLE_FONT = getFont(\r
+ "configuration_table_title_font", resizeDefaultFont(9, 3));//$NON-NLS-1$\r
+\r
+ private static Font getFont(String fontName, FontData[] fontData) {\r
+ if (!fontRegistry.hasValueFor(fontName)) {\r
+ fontRegistry.put(fontName, fontData);\r
+ }\r
+ return fontRegistry.get(fontName);\r
+ }\r
+\r
+ public static FontData[] resizeDefaultFont(int size, int mac) {\r
+ if (AnalyzerUtil.isMac()) {\r
+ return resizeDefaultFont(size + mac);\r
+ }\r
+ return resizeDefaultFont(size);\r
+ }\r
+\r
+ public static FontData[] resizeDefaultFont(int size) {\r
+ FontData[] fontData = defaultFont.getFontData();\r
+ for (int i = 0; i < fontData.length; i++) {\r
+ fontData[i].setHeight(size);\r
+ }\r
+ return fontData;\r
+ }\r
+\r
+ public static FontData[] setDefaultFontStyle(int style) {\r
+ FontData[] fontData = defaultFont.getFontData();\r
+ for (int i = 0; i < fontData.length; i++) {\r
+ fontData[i].setStyle(style);\r
+ }\r
+ return fontData;\r
+ }\r
+\r
+ public static FontData[] setDefaultFontStyleAndSize(int style, int size) {\r
+ FontData[] fontData = defaultFont.getFontData();\r
+ for (int i = 0; i < fontData.length; i++) {\r
+ fontData[i].setStyle(style);\r
+ fontData[i].setHeight(size);\r
+ }\r
+ return fontData;\r
+ }\r
+\r
+ public static Font getDADefaultFont() {\r
+ String fontName = null;\r
+ if (AnalyzerUtil.isLinux()) {\r
+ fontName = "Dejavu Sans";//$NON-NLS-1$\r
+ } else if (AnalyzerUtil.isWin()) {\r
+ fontName = "Verdana";//$NON-NLS-1$\r
+ } else {\r
+ return PlatformUI.getWorkbench().getDisplay().getSystemFont();\r
+ }\r
+ return getFont(\r
+ "ex_font", new FontData[] { new FontData(fontName, 9, SWT.NORMAL) }); //$NON-NLS-1$\r
+ }\r
+}\r
--- /dev/null
+/*\r
+ * Dynamic Analyzer\r
+ *\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact: \r
+ * Jooyoul Lee <jy.exe.lee@samsung.com>\r
+ * Juyoung Kim <j0.kim@samsung.com>\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ * \r
+ */\r
+package org.tizen.dynamicanalyzer.resources;\r
+\r
+import java.io.File;\r
+\r
+import org.eclipse.jface.resource.ImageDescriptor;\r
+import org.eclipse.jface.resource.ImageRegistry;\r
+import org.eclipse.swt.graphics.Image;\r
+import org.eclipse.ui.plugin.AbstractUIPlugin;\r
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;\r
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;\r
+import org.tizen.dynamicanalyzer.common.CommonConstants;\r
+import org.tizen.dynamicanalyzer.theme.DATheme;\r
+\r
+public class ImageResources {\r
+\r
+ private static ImageRegistry imageRegistry = new ImageRegistry();\r
+\r
+ private static final String ID = "org.tizen.dynamicanalyzer"; //$NON-NLS-1$\r
+ private static final String WORKBENCH_ID = "org.tizen.dynamicanalyzer.workbench"; //$NON-NLS-1$\r
+\r
+ // Titlebar\r
+ public static final Image ICON = getImageFromWorkbench("alt_window_16"); //$NON-NLS-1$\r
+ public static final Image SEPARATOR = getPngImage("window_sunken_line"); //$NON-NLS-1$\r
+ public static final Image CATEGORY = getPngImage("window_context_down_normal"); //$NON-NLS-1$\r
+ public static final Image CATEGORY_PUSH = getPngImage("window_context_down_push"); //$NON-NLS-1$\r
+ public static final Image CATEGORY_HOVER = getPngImage("window_context_down_hover"); //$NON-NLS-1$\r
+ public static final Image CATEGORY_DISABLE = getPngImage("window_context_down_disable"); //$NON-NLS-1$\r
+ public static final Image MIN = getPngImage("window_control_min_nor"); //$NON-NLS-1$\r
+ public static final Image MIN_PUSH = getPngImage("window_control_min_push"); //$NON-NLS-1$\r
+ public static final Image MIN_HOVER = getPngImage("window_control_min_hover"); //$NON-NLS-1$\r
+ public static final Image MAX = getPngImage("window_control_max_nor"); //$NON-NLS-1$\r
+ public static final Image MAX_PUSH = getPngImage("window_control_max_push"); //$NON-NLS-1$\r
+ public static final Image MAX_HOVER = getPngImage("window_control_max_hover"); //$NON-NLS-1$\r
+ public static final Image RESTORE = getPngImage("window_control_prev_nor"); //$NON-NLS-1$\r
+ public static final Image RESTORE_PUSH = getPngImage("window_control_prev_push"); //$NON-NLS-1$\r
+ public static final Image RESTORE_HOVER = getPngImage("window_control_prev_hover"); //$NON-NLS-1$\r
+ public static final Image CLOSE = getPngImage("window_control_close_nor"); //$NON-NLS-1$\r
+ public static final Image CLOSE_PUSH = getPngImage("window_control_close_push"); //$NON-NLS-1$\r
+ public static final Image CLOSE_HOVER = getPngImage("window_control_close_hover"); //$NON-NLS-1$\r
+\r
+ // Toolbar\r
+ public static final Image BRACKET = getPngImage("toolbar_arrow"); //$NON-NLS-1$\r
+ public static final Image START = getPngImage("toolbar_play_nor"); //$NON-NLS-1$\r
+ public static final Image START_PUSH = getPngImage("toolbar_play_push"); //$NON-NLS-1$\r
+ public static final Image START_HOVER = getPngImage("toolbar_play_hover"); //$NON-NLS-1$\r
+ public static final Image START_DISABLE = getPngImage("toolbar_play_disable"); //$NON-NLS-1$\r
+ public static final Image STOP = getPngImage("toolbar_stop_nor"); //$NON-NLS-1$\r
+ public static final Image STOP_PUSH = getPngImage("toolbar_stop_push"); //$NON-NLS-1$\r
+ public static final Image STOP_HOVER = getPngImage("toolbar_stop_hover"); //$NON-NLS-1$\r
+ public static final Image TIMER = getPngImage("toolbar_time_bg"); //$NON-NLS-1$\r
+ public static final Image SAVE = getPngImage("toolbar_save_nor"); //$NON-NLS-1$\r
+ public static final Image SAVE_PUSH = getPngImage("toolbar_save_push"); //$NON-NLS-1$\r
+ public static final Image SAVE_HOVER = getPngImage("toolbar_save_hover"); //$NON-NLS-1$\r
+ public static final Image SAVE_DISABLE = getPngImage("toolbar_save_disable"); //$NON-NLS-1$\r
+ public static final Image OPEN = getPngImage("toolbar_open_nor"); //$NON-NLS-1$\r
+ public static final Image OPEN_PUSH = getPngImage("toolbar_open_push"); //$NON-NLS-1$\r
+ public static final Image OPEN_HOVER = getPngImage("toolbar_open_hover"); //$NON-NLS-1$\r
+ public static final Image OPEN_DISABLE = getPngImage("toolbar_open_disable"); //$NON-NLS-1$\r
+ public static final Image REPLAY = getPngImage("toolbar_replay_nor"); //$NON-NLS-1$\r
+ public static final Image REPLAY_PUSH = getPngImage("toolbar_replay_push"); //$NON-NLS-1$\r
+ public static final Image REPLAY_HOVER = getPngImage("toolbar_replay_hover"); //$NON-NLS-1$\r
+ public static final Image REPLAY_DISABLE = getPngImage("toolbar_replay_disable"); //$NON-NLS-1$\r
+\r
+ public static final Image SETTINGS = getPngImage("toolbar_settings_nor"); //$NON-NLS-1$\r
+ public static final Image SETTINGS_PUSH = getPngImage("toolbar_settings_push"); //$NON-NLS-1$\r
+ public static final Image SETTINGS_HOVER = getPngImage("toolbar_settings_hover"); //$NON-NLS-1$\r
+ public static final Image SETTINGS_DISABLE = getPngImage("toolbar_settings_disable"); //$NON-NLS-1$\r
+\r
+ public static final Image ABOUT = getPngImage("toolbar_about_nor"); //$NON-NLS-1$\r
+ public static final Image ABOUT_PUSH = getPngImage("toolbar_about_push"); //$NON-NLS-1$\r
+ public static final Image ABOUT_HOVER = getPngImage("toolbar_about_hover"); //$NON-NLS-1$\r
+ public static final Image ABOUT_DISABLE = getPngImage("toolbar_about_disable"); //$NON-NLS-1$\r
+\r
+ public static final Image VIEW_SOURCE_NORMAL = getPngImage("toolbar_source_view_nor"); //$NON-NLS-1$\r
+ public static final Image VIEW_SOURCE_PUSH = getPngImage("toolbar_source_view_push"); //$NON-NLS-1$\r
+ public static final Image VIEW_SOURCE_HOVER = getPngImage("toolbar_source_view_hover"); //$NON-NLS-1$\r
+ public static final Image VIEW_SOURCE_TOGGLE = getPngImage("toolbar_source_view_tog_nor"); //$NON-NLS-1$\r
+ public static final Image VIEW_SOURCE_TOGGLE_HOVER = getPngImage("toolbar_source_view_tog_hover"); //$NON-NLS-1$\r
+ public static final Image VIEW_SOURCE_TOGGLE_PUSH = getPngImage("toolbar_source_view_tog_push"); //$NON-NLS-1$\r
+ public static final Image VIEW_SOURCE_DISABLE = getPngImage("toolbar_source_view_disable"); //$NON-NLS-1$\r
+ public static final Image VIEW_SOURCE_CURSOR = getPngImage("source_view_cursor"); //$NON-NLS-1$\r
+\r
+ /* screen shot */\r
+ public static final Image SCREEN_SHOT_NORMAL = getPngImage("toolbar_screen_shot_nor"); //$NON-NLS-1$\r
+ public static final Image SCREEN_SHOT_PUSH = getPngImage("toolbar_screen_shot_push"); //$NON-NLS-1$\r
+ public static final Image SCREEN_SHOT_HOVER = getPngImage("toolbar_screen_shot_hover"); //$NON-NLS-1$\r
+ public static final Image SCREEN_SHOT_TOGGLE = getPngImage("toolbar_screen_shot_tog_nor"); //$NON-NLS-1$\r
+ public static final Image SCREEN_SHOT_TOGGLE_HOVER = getPngImage("toolbar_screen_shot_tog_hover"); //$NON-NLS-1$\r
+ public static final Image SCREEN_SHOT_TOGGLE_PUSH = getPngImage("toolbar_screen_shot_tog_push"); //$NON-NLS-1$\r
+ public static final Image SCREEN_SHOT_DISABLE = getPngImage("toolbar_screen_shot_disable"); //$NON-NLS-1$\r
+\r
+ /* range */\r
+ public static final Image RANGE_NORMAL = getPngImage("toolbar_range_nor"); //$NON-NLS-1$\r
+ public static final Image RANGE_PUSH = getPngImage("toolbar_range_push"); //$NON-NLS-1$\r
+ public static final Image RANGE_HOVER = getPngImage("toolbar_range_hover"); //$NON-NLS-1$\r
+ public static final Image RANGE_TOGGLE = getPngImage("toolbar_range_tog_nor"); //$NON-NLS-1$\r
+ public static final Image RANGE_TOGGLE_HOVER = getPngImage("toolbar_range_tog_hover"); //$NON-NLS-1$\r
+ public static final Image RANGE_TOGGLE_PUSH = getPngImage("toolbar_range_tog_push"); //$NON-NLS-1$\r
+ public static final Image RANGE_DISABLE = getPngImage("toolbar_range_disable"); //$NON-NLS-1$\r
+\r
+ // Tab\r
+ public static final Image TAB = getPngImage("tab_unselected"); //$NON-NLS-1$\r
+ public static final Image TAB_PUSH = getPngImage("tab_push"); //$NON-NLS-1$\r
+ public static final Image TAB_HOVER = getPngImage("tab_hover"); //$NON-NLS-1$\r
+ public static final Image TAB_DISABLE = getPngImage("tab_selected"); //$NON-NLS-1$\r
+\r
+ // Trim\r
+ public static final Image WINDOW_TOP = getPngImage("window_top_pattern_01"); //$NON-NLS-1$\r
+ public static final Image WINDOW_TOP2 = getPngImage("window_top_pattern_02"); //$NON-NLS-1$\r
+ public static final Image WINDOW_BOTTOM = getPngImage("window_bottom_pattern"); //$NON-NLS-1$\r
+ public static final Image WINDOW_LEFT = getPngImage("window_left_pattern"); //$NON-NLS-1$\r
+ public static final Image WINDOW_RIGHT = getPngImage("window_right_pattern"); //$NON-NLS-1$\r
+ public static final Image WINDOW_TOP_LEFT = getPngImage("window_top_left_nor_01"); //$NON-NLS-1$\r
+ public static final Image WINDOW_TOP_LEFT2 = getPngImage("window_top_left_nor_02"); //$NON-NLS-1$\r
+ public static final Image WINDOW_TOP_LEFT_MAX = getPngImage("window_top_left_full_01"); //$NON-NLS-1$\r
+ public static final Image WINDOW_TOP_RIGHT = getPngImage("window_top_right_nor_01"); //$NON-NLS-1$\r
+ public static final Image WINDOW_TOP_RIGHT2 = getPngImage("window_top_right_nor_02"); //$NON-NLS-1$\r
+ public static final Image WINDOW_TOP_RIGHT_MAX = getPngImage("window_top_right_full_01"); //$NON-NLS-1$\r
+ public static final Image WINDOW_BOTTOM_LEFT = getPngImage("window_bottom_left_nor"); //$NON-NLS-1$\r
+ public static final Image WINDOW_BOTTOM_LEFT_MAX = getPngImage("window_bottom_left_full"); //$NON-NLS-1$\r
+ public static final Image WINDOW_BOTTOM_RIGHT = getPngImage("window_bottom_right_nor"); //$NON-NLS-1$\r
+ public static final Image WINDOW_BOTTOM_RIGHT_MAX = getPngImage("window_bottom_right_full"); //$NON-NLS-1$\r
+ public static final Image WINDOW_RIGHT_GRAY = getPngImage("window_pattern_1"); //$NON-NLS-1$\r
+ public static final Image WINDOW_RIGHT_DARKGARY = getPngImage("window_pattern_2"); //$NON-NLS-1$\r
+ public static final Image WINDOW_RIGHT_BLACK = getPngImage("window_pattern_3"); //$NON-NLS-1$\r
+\r
+ // Dialog button\r
+ public static final Image DIALOG_HOVER = getPngImage("dialog_button_hover"); //$NON-NLS-1$\r
+ public static final Image DIALOG_NORMAL = getPngImage("dialog_button_normal"); //$NON-NLS-1$\r
+ public static final Image DIALOG_PUSH = getPngImage("dialog_button_push"); //$NON-NLS-1$\r
+ public static final Image DIALOG_CLOSE_HOVER = getPngImage("dialog_control_close_hover"); //$NON-NLS-1$\r
+ public static final Image DIALOG_CLOSE_NORMAL = getPngImage("dialog_control_close_normal"); //$NON-NLS-1$\r
+ public static final Image DIALOG_CLOSE_PUSH = getPngImage("dialog_control_close_push"); //$NON-NLS-1$\r
+\r
+ // text box\r
+ public static final Image TEXT_INPUT_CENTER = getPngImage("text_input_center"); //$NON-NLS-1$\r
+ public static final Image TEXT_INPUT_LEFT = getPngImage("text_input_left"); //$NON-NLS-1$\r
+ public static final Image TEXT_INPUT_RIGHT = getPngImage("text_input_right"); //$NON-NLS-1$\r
+\r
+ // radio button\r
+ public static final Image RADIO_SELECTED = getPngImage("radio_selected"); //$NON-NLS-1$\r
+ public static final Image RADIO_UNSELECTED = getPngImage("radio_unselected"); //$NON-NLS-1$\r
+ public static final Image RADIO_UNSELECTED_HOVER = getPngImage("radio_unselected_hover"); //$NON-NLS-1$\r
+\r
+ // check box\r
+ public static final Image CHECKBOX_SELECTED = getPngImage("checkbox_selected"); //$NON-NLS-1$\r
+ public static final Image CHECKBOX_UNSELECTED = getPngImage("checkbox_unselected"); //$NON-NLS-1$\r
+ public static final Image CHECKBOX_UNSELECTED_HOVER = getPngImage("checkbox_unselected_hover"); //$NON-NLS-1$\r
+ public static final Image CHECKBOX_UNSELECTED_DISABLE = getPngImage("checkbox_unselected_disable"); //$NON-NLS-1$\r
+ public static final Image CHECKBOX_SELECTED_DISABLE = getPngImage("checkbox_selected_disable"); //$NON-NLS-1$\r
+\r
+ // latest button\r
+ public static final Image LATEST_SNAPSHOT_NORMAL = getPngImage("latest_snapshot_normal"); //$NON-NLS-1$\r
+ public static final Image LATEST_SNAPSHOT_PUSH = getPngImage("latest_snapshot_push"); //$NON-NLS-1$\r
+ public static final Image LATEST_SNAPSHOT_HOVER = getPngImage("latest_snapshot_hover"); //$NON-NLS-1$\r
+ public static final Image LATEST_SNAPSHOT_DISABLE = getPngImage("latest_snapshot_disable"); //$NON-NLS-1$\r
+\r
+ // Dialog icon\r
+ public static final Image DIALOG_WARNING_ICON = getPngImage("dialog_warning"); //$NON-NLS-1$\r
+\r
+ // Diglog trim\r
+ public static final Image DIALOG_TOP = getPngImage("dialog_top_pattern"); //$NON-NLS-1$\r
+ public static final Image DIALOG_BOTTOM = getPngImage("dialog_bottom_pattern"); //$NON-NLS-1$\r
+ public static final Image DIALOG_BOTTOM_LINUX = getPngImage("dialog_bottom_pattern_linux"); //$NON-NLS-1$\r
+ public static final Image DIALOG_LEFT = getPngImage("dialog_left_pattern"); //$NON-NLS-1$\r
+ public static final Image DIALOG_RIGHT = getPngImage("dialog_right_pattern"); //$NON-NLS-1$\r
+ public static final Image DIALOG_TOP_LEFT = getPngImage("dialog_top_left"); //$NON-NLS-1$\r
+ public static final Image DIALOG_TOP_RIGHT = getPngImage("dialog_top_right"); //$NON-NLS-1$\r
+ public static final Image DIALOG_BOTTOM_LEFT = getPngImage("dialog_bottom_left"); //$NON-NLS-1$\r
+ public static final Image DIALOG_BOTTOM_RIGHT = getPngImage("dialog_bottom_right"); //$NON-NLS-1$\r
+\r
+ public static final Image COMBO_DROPDOWN_UP = getPngImage("dropdown_up"); //$NON-NLS-1$\r
+ public static final Image COMBO_DROPDOWN_DOWN = getPngImage("dropdown_down"); //$NON-NLS-1$\r
+\r
+ // On, Off button\r
+ public static final Image ON_HOVER = getPngImage("onoff_on_hover"); //$NON-NLS-1$\r
+ public static final Image ON_NORMAL = getPngImage("onoff_on_unselected"); //$NON-NLS-1$\r
+ public static final Image ON_PUSH = getPngImage("onoff_on_push"); //$NON-NLS-1$\r
+ public static final Image ON_DISABLE = getPngImage("onoff_on_selected"); //$NON-NLS-1$\r
+ public static final Image OFF_HOVER = getPngImage("onoff_off_hover"); //$NON-NLS-1$\r
+ public static final Image OFF_NORMAL = getPngImage("onoff_off_unselected"); //$NON-NLS-1$\r
+ public static final Image OFF_PUSH = getPngImage("onoff_off_push"); //$NON-NLS-1$\r
+ public static final Image OFF_DISABLE = getPngImage("onoff_off_selected"); //$NON-NLS-1$\r
+\r
+ // View title background\r
+ public static final Image VIEW_TITLE = getPngImage("title_bg"); //$NON-NLS-1$\r
+\r
+ /* snapshot */\r
+ public static final Image SNAPSHOT_LEFT_NORMAL = getPngImage("snapshot_arrow_left_nor"); //$NON-NLS-1$\r
+ public static final Image SNAPSHOT_LEFT_PUSH = getPngImage("snapshot_arrow_left_push"); //$NON-NLS-1$\r
+ public static final Image SNAPSHOT_LEFT_HOVER = getPngImage("snapshot_arrow_left_hover"); //$NON-NLS-1$\r
+ public static final Image SNAPSHOT_LEFT_DISABLE = getPngImage("snapshot_arrow_left_disable"); //$NON-NLS-1$\r
+ public static final Image SNAPSHOT_RIGHT_NORMAL = getPngImage("snapshot_arrow_right_nor"); //$NON-NLS-1$\r
+ public static final Image SNAPSHOT_RIGHT_PUSH = getPngImage("snapshot_arrow_right_push"); //$NON-NLS-1$\r
+ public static final Image SNAPSHOT_RIGHT_HOVER = getPngImage("snapshot_arrow_right_hover"); //$NON-NLS-1$\r
+ public static final Image SNAPSHOT_RIGHT_DISABLE = getPngImage("snapshot_arrow_right_disable"); //$NON-NLS-1$\r
+\r
+ /* about */\r
+ public static final Image DYNANMIC_ANALYZER_ICON = getPngImage("64_DA_icon"); //$NON-NLS-1$ \r
+ public static final Image ABOUT_TIZEN_SDK = getPngImage("about_Tizen_SDK");//$NON-NLS-1$\r
+ public static final Image LICENSE_TIZEN_SDK = getPngImage("license_banner");//$NON-NLS-1$\r
+ \r
+ /* configuration */\r
+ public static final Image WELCONE_BANNER_IMAGE = getPngImage("welcome_banner"); //$NON-NLS-1$\r
+ public static final Image CONFIGURATION_BANNER_IMAGE = getPngImage("settings_banner"); //$NON-NLS-1$\r
+ public static final Image CONFIGURATION_WHITE_IMAGE = getPngImage("theme_white"); //$NON-NLS-1$\r
+ public static final Image CONFIGURATION_BLACK_IMAGE = getPngImage("theme_black"); //$NON-NLS-1$\r
+ \r
+ /* Timeline */\r
+ public static final Image CHART_CPU = getPngImage("time_line_icon_cpu"); //$NON-NLS-1$\r
+ public static final Image CHART_CPU_CORE = getPngImage("time_line_icon_cpu_core"); //$NON-NLS-1$\r
+ public static final Image CHART_CPU_FREQUENCY = getPngImage("time_line_icon_cpu_frequency"); //$NON-NLS-1$\r
+ public static final Image CHART_HEAP = getPngImage("time_line_icon_memory_allocation"); //$NON-NLS-1$\r
+ public static final Image CHART_PROCESS_MEMORY = getPngImage("time_line_icon_memory_process"); //$NON-NLS-1$\r
+ public static final Image CHART_SYSTEM_MEMORY = getPngImage("time_line_icon_memory_system"); //$NON-NLS-1$\r
+ public static final Image CHART_FILE = getPngImage("time_line_icon_read_write"); //$NON-NLS-1$\r
+ public static final Image CHART_SCREENSHOT = getPngImage("time_line_icon_snapshot"); //$NON-NLS-1$\r
+ public static final Image CHART_UI_EVENT = getPngImage("time_line_icon_UI_events"); //$NON-NLS-1$\r
+ public static final Image FD_USAGE = getPngImage("time_line_icon_fd_usage"); //$NON-NLS-1$\r
+ public static final Image MEMORY = getPngImage("time_line_icon_memory"); //$NON-NLS-1$\r
+ public static final Image ADD_ITEMS_NORMAL = getPngImage("add_chart_nor"); //$NON-NLS-1$\r
+ public static final Image ADD_ITEMS_PUSH = getPngImage("add_chart_push"); //$NON-NLS-1$\r
+ public static final Image ADD_ITEMS_HOVER = getPngImage("add_chart_hover"); //$NON-NLS-1$\r
+ public static final Image ADD_ITEMS_BAR = getPngImage("AddItems"); //$NON-NLS-1$\r
+ public static final Image MIN_ITEMS = getPngImage("MinItems"); //$NON-NLS-1$\r
+ public static final Image BG_GRADIENT = getPngImage("timeline_right_bg_normal"); //$NON-NLS-1$\r
+ public static final Image BG_CHILD_GRADIENT = getPngImage("timeline_right_child_bg_normal"); //$NON-NLS-1$\r
+ public static final Image TIMLINE_FULL = getPngImage("timeline_left_full_nor"); //$NON-NLS-1$\r
+ public static final Image TIMLINE_RESTORE = getPngImage("timeline_left_restore_nor"); //$NON-NLS-1$\r
+ public static final Image TIMLINE_SIZE_MIN_NORMAL = getPngImage("time_line_size_min_normal"); //$NON-NLS-1$\r
+ public static final Image TIMLINE_SIZE_MIN_HOVER = getPngImage("time_line_size_min_hover"); //$NON-NLS-1$\r
+ public static final Image TIMLINE_SIZE_MIN_PUSH = getPngImage("time_line_size_min_push"); //$NON-NLS-1$\r
+ public static final Image ENERGY = getPngImage("time_line_icon_electric_current"); //$NON-NLS-1$\r
+ public static final Image CHART_DEVICES = getPngImage("time_line_icon_devices"); //$NON-NLS-1$\r
+ public static final Image UI_EVENT = getPngImage("time_line_icon_UI_events"); //$NON-NLS-1$\r
+ public static final Image CHART_CUSTOM = getPngImage("time_line_icon_custom"); //$NON-NLS-1$\r
+\r
+ /* Resource */\r
+ public static final Image TYPE_FILE = getPngImage("resource/resource_file"); //$NON-NLS-1$\r
+ public static final Image TYPE_SOCKET = getPngImage("resource/resource_socket"); //$NON-NLS-1$\r
+ public static final Image TYPE_GROUP_FILE = getPngImage("resource/resource_file_group"); //$NON-NLS-1$\r
+ public static final Image ARROW_CLOSE_NOR = getPngImage("resource/resource_group_close_nor"); //$NON-NLS-1$\r
+ public static final Image ARROW_CLOSE_HOVER = getPngImage("resource/resource_group_close_hover"); //$NON-NLS-1$\r
+ public static final Image ARROW_CLOSE_PUSH = getPngImage("resource/resource_group_close_push"); //$NON-NLS-1$\r
+ public static final Image ARROW_OPEN_NOR = getPngImage("resource/resource_group_open_nor"); //$NON-NLS-1$\r
+ public static final Image ARROW_OPEN_HOVER = getPngImage("resource/resource_group_open_hover"); //$NON-NLS-1$\r
+ public static final Image ARROW_OPEN_PUSH = getPngImage("resource/resource_group_open_push"); //$NON-NLS-1$\r
+ public static final Image TREE_LINE_MID = getPngImage("resource/resource_group_line_mid"); //$NON-NLS-1$\r
+ public static final Image TREE_LINE_BOTTOM = getPngImage("resource/resource_group_line_bottom"); //$NON-NLS-1$\r
+ public static final Image LIFECYCLE_FIRST_LAST_BALL = getPngImage("resource/resource_lifecycle_first_last_ball"); //$NON-NLS-1$\r
+ public static final Image LIFECYCLE_OPEN_CLOSE_BALL = getPngImage("resource/resource_lifecycle_open_close_ball"); //$NON-NLS-1$\r
+ public static final Image LIFECYCLE_ERROR_MARK = getPngImage("resource/resource_lifecycle_error_mark"); //$NON-NLS-1$\r
+\r
+ public static final Image COMBO_DISABLE = getPngImage("toolbar_dropdown_disable"); //$NON-NLS-1$\r
+ public static final Image COMBO_NORMAL = getPngImage("toolbar_dropdown_normal"); //$NON-NLS-1$\r
+ public static final Image COMBO_PUSH = getPngImage("toolbar_dropdown_push"); //$NON-NLS-1$\r
+ public static final Image COMBO_HOVER = getPngImage("toolbar_dropdown_hover"); //$NON-NLS-1$\r
+\r
+ public static final Image STATUS_BATTERY_OFF = getPngImage("status_battery_off"); //$NON-NLS-1$\r
+ public static final Image STATUS_BATTERY_ON = getPngImage("status_battery_on"); //$NON-NLS-1$\r
+\r
+ public static final Image STATUS_BLUETOOTH_ELSE = getPngImage("status_bluetooth_else"); //$NON-NLS-1$\r
+ public static final Image STATUS_BLUETOOTH_OFF = getPngImage("status_bluetooth_off"); //$NON-NLS-1$\r
+ public static final Image STATUS_BLUETOOTH_TRANSFER = getPngImage("status_bluetooth_transfer"); //$NON-NLS-1$\r
+\r
+ public static final Image STATUS_GPS_CONNECTED = getPngImage("status_gps_connected"); //$NON-NLS-1$\r
+ public static final Image STATUS_GPS_OFF = getPngImage("status_gps_off"); //$NON-NLS-1$\r
+ public static final Image STATUS_GPS_SEARCHING = getPngImage("status_gps_searching"); //$NON-NLS-1$\r
+\r
+ public static final Image STATUS_WIFI_CONNECTED = getPngImage("status_wifi_connected"); //$NON-NLS-1$\r
+ public static final Image STATUS_WIFI_OFF = getPngImage("status_wifi_off"); //$NON-NLS-1$\r
+ public static final Image STATUS_WIFI_TRANSFER = getPngImage("status_wifi_transfer"); //$NON-NLS-1$\r
+ public static final Image STATUS_WIFI_UNCONNECTED = getPngImage("status_wifi_unconnected"); //$NON-NLS-1$\r
+\r
+ public static final Image TREE_OPEN = getPngImage("tree_open"); //$NON-NLS-1$\r
+ public static final Image TREE_FOLD = getPngImage("tree_fold"); //$NON-NLS-1$\r
+ public static final Image NO_IMAGE = getPngImage("empty_snapshot"); //$NON-NLS-1$\r
+\r
+ /* score */\r
+ public static final Image SCORE_0 = getPngImage("score_0"); //$NON-NLS-1$\r
+ public static final Image SCORE_1 = getPngImage("score_1"); //$NON-NLS-1$\r
+ public static final Image SCORE_2 = getPngImage("score_2"); //$NON-NLS-1$\r
+ public static final Image SCORE_3 = getPngImage("score_3"); //$NON-NLS-1$\r
+ public static final Image SCORE_4 = getPngImage("score_4"); //$NON-NLS-1$\r
+ public static final Image SCORE_5 = getPngImage("score_5"); //$NON-NLS-1$\r
+ public static final Image SCORE_6 = getPngImage("score_6"); //$NON-NLS-1$\r
+ public static final Image SCORE_7 = getPngImage("score_7"); //$NON-NLS-1$\r
+ public static final Image SCORE_8 = getPngImage("score_8"); //$NON-NLS-1$\r
+ public static final Image SCORE_9 = getPngImage("score_9"); //$NON-NLS-1$\r
+\r
+ // Edit Chart\r
+ public static final Image ADD_CHART_OFF = getPngImage("dialog_edit_chart_off"); //$NON-NLS-1$\r
+ public static final Image ADD_CHART_ON = getPngImage("dialog_edit_chart_on"); //$NON-NLS-1$\r
+ public static final Image ADD_CHART_CPU = getPngImage("edit_chart_icon_cpu"); //$NON-NLS-1$\r
+ public static final Image ADD_CHART_CPU_CORE = getPngImage("edit_chart_icon_cpu_core"); //$NON-NLS-1$\r
+ public static final Image ADD_CHART_CPU_FREQUENCY = getPngImage("edit_chart_icon_cpu_frequency"); //$NON-NLS-1$\r
+ public static final Image ADD_CHART_HEAP = getPngImage("edit_chart_icon_memory_allocation"); //$NON-NLS-1$\r
+ public static final Image ADD_CHART_PROCESS_MEMORY = getPngImage("edit_chart_icon_memory_process"); //$NON-NLS-1$\r
+ public static final Image ADD_CHART_SYSTEM_MEMORY = getPngImage("edit_chart_icon_memory_system"); //$NON-NLS-1$\r
+ public static final Image ADD_CHART_FILE = getPngImage("edit_chart_icon_read_write"); //$NON-NLS-1$\r
+ public static final Image ADD_CHART_SCREENSHOT = getPngImage("edit_chart_icon_snapshot"); //$NON-NLS-1$\r
+ public static final Image ADD_CHART_UI_EVENT = getPngImage("edit_chart_icon_UI_events"); //$NON-NLS-1$\r
+ public static final Image ADD_CHART_DEVICE = getPngImage("edit_chart_icon_devices"); //$NON-NLS-1$\r
+ public static final Image ADD_CHART_ELECTRIC_CURRENT = getPngImage("edit_chart_icon_electric_current"); //$NON-NLS-1$\r
+ public static final Image ADD_CHART_FD_USAGE = getPngImage("edit_chart_icon_fd_usage"); //$NON-NLS-1$\r
+ public static final Image ADD_CHART_MEMORY_APPUSAGE = getPngImage("edit_chart_icon_memory_appusage"); //$NON-NLS-1$\r
+ public static final Image ADD_CHART_READ_WRITE_2 = getPngImage("edit_chart_icon_read_write_01"); //$NON-NLS-1$\r
+ public static final Image ADD_CHART_SOUND = getPngImage("edit_chart_icon_sound"); //$NON-NLS-1$\r
+ public static final Image ADD_CHART_VIBRATION = getPngImage("edit_chart_icon_vibration"); //$NON-NLS-1$\r
+ public static final Image ADD_CHART_CUSTOM = getPngImage("edit_chart_icon_custom"); //$NON-NLS-1$\r
+\r
+ /*** scale ***/\r
+ public static final Image SCALE_CONTROL_MINUS = getPngImage("scale_control_minus"); //$NON-NLS-1$\r
+ public static final Image SCALE_CONTROL_PLUS = getPngImage("scale_control_plus"); //$NON-NLS-1$\r
+ public static final Image SCALE_CONTROL_THUMB = getPngImage("scale_control_thumb"); //$NON-NLS-1$\r
+\r
+ /*** stop progress dialog ***/\r
+// public static final Image STOP_PROGRESS_LOADING_01 = getPngImage("loading_icon_01"); //$NON-NLS-1$\r
+// public static final Image STOP_PROGRESS_LOADING_02 = getPngImage("loading_icon_02"); //$NON-NLS-1$\r
+// public static final Image STOP_PROGRESS_LOADING_03 = getPngImage("loading_icon_03"); //$NON-NLS-1$\r
+// public static final Image STOP_PROGRESS_LOADING_04 = getPngImage("loading_icon_04"); //$NON-NLS-1$\r
+// public static final Image STOP_PROGRESS_LOADING_05 = getPngImage("loading_icon_05"); //$NON-NLS-1$\r
+// public static final Image STOP_PROGRESS_LOADING_06 = getPngImage("loading_icon_06"); //$NON-NLS-1$\r
+// public static final Image STOP_PROGRESS_LOADING_07 = getPngImage("loading_icon_07"); //$NON-NLS-1$\r
+// public static final Image STOP_PROGRESS_LOADING_08 = getPngImage("loading_icon_08"); //$NON-NLS-1$\r
+\r
+ /*** thread page ***/\r
+ public static final Image TIMELINE_DROPDOWN_NORMAL = getPngImage("time_line_dropdown_normal"); //$NON-NLS-1$\r
+ public static final Image TIMELINE_DROPDOWN_HOVER = getPngImage("time_line_dropdown_hover"); //$NON-NLS-1$\r
+ public static final Image TIMELINE_DROPDOWN_PUSH = getPngImage("time_line_dropdown_push"); //$NON-NLS-1$\r
+\r
+ private static Image getImage(String pluginId, String folderName,\r
+ String imageName, String extension) {\r
+ if (null == imageRegistry.get(imageName)\r
+ || imageRegistry.get(imageName).isDisposed()) {\r
+ ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(\r
+ pluginId, folderName + imageName + extension);\r
+ imageRegistry.put(imageName, desc);\r
+ }\r
+\r
+ return imageRegistry.get(imageName);\r
+ }\r
+\r
+ private static DATheme getTheme() {\r
+ return AnalyzerManager.getTheme();\r
+ }\r
+\r
+ private static Image getImage(String imageName, String extension) {\r
+ return getImage(ID, getTheme().getImagePath(), imageName, extension);\r
+ }\r
+\r
+ private static Image getImageFromWorkbench(String imageName) {\r
+ return getImage(WORKBENCH_ID,\r
+ AnalyzerConstants.ICON_WORKBENCH_FOLDER_NAME + File.separator,\r
+ imageName, CommonConstants.EXTENSION_PNG_IMAGE);\r
+ }\r
+\r
+ private static Image getPngImage(String imageName) {\r
+ return getImage(imageName, CommonConstants.EXTENSION_PNG_IMAGE);\r
+ }\r
+\r
+}\r
--- /dev/null
+/*\r
+ * Dynamic Analyzer\r
+ *\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact: \r
+ * Jooyoul Lee <jy.exe.lee@samsung.com>\r
+ * Juyoung Kim <j0.kim@samsung.com>\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ * \r
+ */\r
+\r
+package org.tizen.dynamicanalyzer.services;\r
+\r
+import java.util.HashMap;\r
+import java.util.Map;\r
+\r
+import org.eclipse.ui.AbstractSourceProvider;\r
+import org.eclipse.ui.ISources;\r
+\r
+public class RecordStateSourceProvider extends AbstractSourceProvider {\r
+\r
+ public static final String RECORD_DEFAULT = "default"; //$NON-NLS-1$\r
+ public static final String RECORD_READY = "ready"; //$NON-NLS-1$\r
+ public static final String RECORD_RECORDING = "recording"; //$NON-NLS-1$\r
+ public static final String RECORD_STATE = "org.tizen.dynamicanalyzer.record.state"; //$NON-NLS-1$\r
+\r
+ private String recordState = RECORD_DEFAULT;\r
+\r
+ @Override\r
+ public void dispose() {\r
+ }\r
+\r
+ @Override\r
+ public Map<String, String> getCurrentState() {\r
+ Map<String, String> currentState = new HashMap<String, String>(1);\r
+ currentState.put(RECORD_STATE, recordState);\r
+\r
+ return currentState;\r
+ }\r
+\r
+ @Override\r
+ public String[] getProvidedSourceNames() {\r
+ return new String[] { RECORD_STATE };\r
+ }\r
+\r
+ public void setState(String key, String state) {\r
+ if (recordState.equals(state)) {\r
+ return;\r
+ }\r
+\r
+ recordState = state;\r
+\r
+ fireSourceChanged(ISources.WORKBENCH, RECORD_STATE, state);\r
+ }\r
+}\r
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.sql;
+
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+
+public class DBTableInfo {
+ protected String tableName;
+ protected String[] columnNames;
+ protected String[] columnOptions;
+ protected String[] columnTypes;
+
+ public DBTableInfo(String tableName, String[] columnNames,
+ String[] columnOptions, String[] columnTypes) {
+ this.tableName = tableName;
+ this.columnNames = columnNames;
+ this.columnOptions = columnOptions;
+ this.columnTypes = columnTypes;
+ }
+
+ protected String getColumnString(int index) {
+ if (columnNames.length <= index) {
+ return null;
+ }
+ return columnNames[index] + CommonConstants.SPACE + columnTypes[index]
+ + CommonConstants.SPACE + columnOptions[index];
+ }
+
+ public String getTableName() {
+ return tableName;
+ }
+
+ public String createQuery() {
+ if (isValid()) {
+ StringBuffer strBuffer = new StringBuffer();
+ strBuffer.append("create table "); //$NON-NLS-1$
+ strBuffer.append(tableName);
+ strBuffer.append(" ( "); //$NON-NLS-1$
+
+ for (int i = 0; i < columnNames.length; i++) {
+ strBuffer.append(getColumnString(i));
+ if (i + 1 == columnNames.length) {
+ strBuffer.append(CommonConstants.CLOSE_BRACKET);
+ } else {
+ strBuffer.append(CommonConstants.COMMA);
+ }
+ }
+ strBuffer.append(CommonConstants.SEMICOLON);
+ return strBuffer.toString();
+ }
+ return null;
+ }
+
+ public String selectAllQuery() {
+ if (isValid()) {
+ StringBuffer strBuffer = new StringBuffer();
+ strBuffer.append("select "); //$NON-NLS-1$
+ for (int i = 0; i < columnNames.length; i++) {
+ strBuffer.append(columnNames[i]);
+ if (i + 1 != columnNames.length) {
+ strBuffer.append(CommonConstants.COMMA);
+ }
+ }
+ strBuffer.append(" from ");//$NON-NLS-1$
+ strBuffer.append(tableName);
+ strBuffer.append(CommonConstants.SEMICOLON);
+ return strBuffer.toString();
+ }
+ return null;
+ }
+
+ public String insertQuery() {
+ if (isValid()) {
+ StringBuffer strBuffer = new StringBuffer();
+ strBuffer.append("insert into "); //$NON-NLS-1$
+ strBuffer.append(tableName);
+ strBuffer.append(" values ( "); //$NON-NLS-1$
+
+ for (int i = 0; i < columnNames.length; i++) {
+ strBuffer.append("?"); //$NON-NLS-1$
+ if (i + 1 == columnNames.length) {
+ strBuffer.append(");"); //$NON-NLS-1$
+ break;
+ } else {
+ strBuffer.append(","); //$NON-NLS-1$
+ }
+ }
+ return strBuffer.toString();
+ }
+ return null;
+ }
+
+ protected boolean isValid() {
+ if (null == tableName || tableName.isEmpty()) {
+ return false;
+ }
+
+ if (null == columnNames || columnNames.length == 0) {
+ return false;
+ }
+
+ if (null == columnOptions || columnOptions.length == 0) {
+ return false;
+ }
+
+ if (null == columnTypes || columnTypes.length == 0) {
+ return false;
+ }
+
+ if (columnNames.length != columnOptions.length
+ || columnNames.length != columnTypes.length) {
+ return false;
+ }
+ return true;
+ }
+
+ public String[] getColumnNames() {
+ return columnNames;
+ }
+
+ public String[] getColumnOptions() {
+ return columnOptions;
+ }
+
+ public String[] getColumnTypes() {
+ return columnTypes;
+ }
+
+ public void setColumnNames(String[] columnNames) {
+ this.columnNames = columnNames;
+ }
+
+ public void setColumnOptions(String[] columnOptions) {
+ this.columnOptions = columnOptions;
+ }
+
+ public void setColumnTypes(String[] columnTypes) {
+ this.columnTypes = columnTypes;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.sql;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+
+public class DBTableManager {
+
+ public static DBTableManager instance = null;
+
+ private final String TABLE_NAME_APP_INFO = "AppInfo";//$NON-NLS-1$
+ private final String TABLE_NAME_CALLSTACK_UNITS = "CallstackUnits";//$NON-NLS-1$
+ private final String TABLE_NAME_CALLSTACK_DATA = "CallstackData";//$NON-NLS-1$
+ private final String TABLE_NAME_FAILED_DATA = "FailedData";//$NON-NLS-1$
+ private final String TABLE_NAME_LEAK_DATA = "LeakData";//$NON-NLS-1$
+ private final String TABLE_NAME_PROFILING_DATA = "ProfilingData";//$NON-NLS-1$
+ private final String TABLE_NAME_PROFILING_CHILD_DATA = "ProfilingChildData";//$NON-NLS-1$
+
+ private static List<DBTableInfo> tableInfos;
+
+ public static final int TABLE_INDEX_APP_INFO = 0;
+ public static final int TABLE_INDEX_CALLSTACK_UNITS = 1;
+ public static final int TABLE_INDEX_CALLSTACK_DATA = 2;
+ public static final int TABLE_INDEX_FAILED_DATA = 3;
+ public static final int TABLE_INDEX_LEAK_DATA = 4;
+ public static final int TABLE_INDEX_PROFILING_DATA = 5;
+ public static final int TABLE_INDEX_PROFILING_CHILD_DATA = 6;
+
+ public static final String EMPTY = CommonConstants.EMPTY;
+ public static final String TEXT = "TEXT";//$NON-NLS-1$
+ public static final String INTEGER = "INTEGER";//$NON-NLS-1$
+ public static final String NOT_NULL = "not null";//$NON-NLS-1$
+ public static final String PRIMARY_NOT_NULL = "primary key not null";//$NON-NLS-1$
+
+ public static final String COMMON_COLUMN_RID = "Rid";//$NON-NLS-1$
+ public static final String COMMON_COLUMN_ID = "Id";//$NON-NLS-1$
+ public static final String COMMON_COLUMN_SEQ_NUMBER = "SeqNumber";//$NON-NLS-1$
+ public static final String COMMON_COLUMN_API_NAME = "APINmae";//$NON-NLS-1$
+ public static final String COMMON_COLUMN_TIME = "Time";//$NON-NLS-1$
+ public static final String COMMON_COLUMN_PID = "Pid";//$NON-NLS-1$
+ public static final String COMMON_COLUMN_TID = "Tid";//$NON-NLS-1$
+ public static final String COMMON_COLUMN_INPUT_PARAM = "InputParm";//$NON-NLS-1$
+ public static final String COMMON_COLUMN_RETURN = "Return";//$NON-NLS-1$
+ public static final String COMMON_COLUMN_PCADDR = "PCAddr";//$NON-NLS-1$
+ public static final String COMMON_COLUMN_ERROR = "Error";//$NON-NLS-1$
+ public static final String COMMON_COLUMN_INTERNAL_CALL = "InternalCall";//$NON-NLS-1$
+ public static final String COMMON_COLUMN_CALLER_PCADDR = "CallerPCAddr";//$NON-NLS-1$
+ public static final String COMMON_COLUMN_RESERVED1 = "Reserved1";//$NON-NLS-1$
+ public static final String COMMON_COLUMN_RESERVED2 = "Reserved2";//$NON-NLS-1$
+ public static final String COMMON_COLUMN_RESERVED3 = "Reserved3";//$NON-NLS-1$
+ public static final String COMMON_COLUMN_RESERVED4 = "Reserved4";//$NON-NLS-1$
+ public static final String COMMON_COLUMN_RESERVED5 = "Reserved5";//$NON-NLS-1$
+ public static final String COMMON_COLUMN_RESERVED6 = "Reserved6";//$NON-NLS-1$
+ public static final String COMMON_COLUMN_RESERVED7 = "Reserved7";//$NON-NLS-1$
+
+ public static final String CUSTOM_COLUMN_INFO = "info";//$NON-NLS-1$
+ public static final String CUSTOM_COLUMN_ADDR = "addr";//$NON-NLS-1$
+ public static final String CUSTOM_COLUMN_SEQ = "seq";//$NON-NLS-1$
+ public static final String CUSTOM_COLUMN_API = "api";//$NON-NLS-1$
+ public static final String CUSTOM_COLUMN_CALLSTACK = "callstack";//$NON-NLS-1$
+ public static final String CUSTOM_COLUMN_NAME = "name";//$NON-NLS-1$
+ public static final String CUSTOM_COLUMN_EXCOUNT = "exCount";//$NON-NLS-1$
+ public static final String CUSTOM_COLUMN_INCOUNT = "inCount";//$NON-NLS-1$
+ public static final String CUSTOM_COLUMN_CALL_COUNT = "callCount";//$NON-NLS-1$
+ public static final String CUSTOM_COLUMN_PARENT = "parent";//$NON-NLS-1$
+ public static final String CUSTOM_COLUMN_KEY = "key";//$NON-NLS-1$
+ public static final String CUSTOM_COLUMN_INCL_EXETIME = "inclExeTime";//$NON-NLS-1$
+ public static final String CUSTOM_COLUMN_EXCL_EXETIME = "exclExeTime";//$NON-NLS-1$
+ public static final String CUSTOM_COLUMN_CHILD_LIST = "childList";//$NON-NLS-1$
+
+ public static int TABLE_COUNT = 7;
+
+ public static final String[] commonColumns = { COMMON_COLUMN_RID,
+ COMMON_COLUMN_ID, COMMON_COLUMN_SEQ_NUMBER, COMMON_COLUMN_API_NAME,
+ COMMON_COLUMN_TIME, COMMON_COLUMN_PID, COMMON_COLUMN_TID,
+ COMMON_COLUMN_INPUT_PARAM, COMMON_COLUMN_RETURN,
+ COMMON_COLUMN_PCADDR, COMMON_COLUMN_ERROR,
+ COMMON_COLUMN_INTERNAL_CALL, COMMON_COLUMN_CALLER_PCADDR,
+ COMMON_COLUMN_RESERVED1, COMMON_COLUMN_RESERVED2,
+ COMMON_COLUMN_RESERVED3, COMMON_COLUMN_RESERVED4,
+ COMMON_COLUMN_RESERVED5, COMMON_COLUMN_RESERVED6,
+ COMMON_COLUMN_RESERVED7 };
+ public static final String[] commonOptions = { EMPTY, EMPTY, EMPTY, EMPTY,
+ EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY,
+ EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY };
+ public static final String[] commonTypes = { TEXT, TEXT, TEXT, TEXT, TEXT,
+ TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT,
+ TEXT, TEXT, TEXT, TEXT };
+
+ public static DBTableManager getInstance() {
+ if (null == instance) {
+ instance = new DBTableManager();
+ instance.init();
+ }
+ return instance;
+ }
+
+ public List<DBTableInfo> getTableInfos() {
+ if (null == tableInfos) {
+ tableInfos = new ArrayList<DBTableInfo>();
+ for (int i = 0; i < TABLE_COUNT; i++) {
+ tableInfos.add(null);
+ }
+ }
+ return tableInfos;
+ }
+
+ private void init() {
+ // init tableInfo;
+ getTableInfos();
+
+ // "app info" table info block
+ {
+ String[] names = { CUSTOM_COLUMN_INFO };
+ String[] options = { EMPTY };
+ String[] types = { TEXT };
+ DBTableInfo appInfoTableInfo = new DBTableInfo(TABLE_NAME_APP_INFO,
+ names, options, types);
+ tableInfos.set(TABLE_INDEX_APP_INFO, appInfoTableInfo);
+ }
+
+ // "callstack units" table info block
+ {
+ String[] names = { CUSTOM_COLUMN_ADDR, CUSTOM_COLUMN_API };
+ String[] options = { PRIMARY_NOT_NULL, EMPTY };
+ String[] types = { INTEGER, TEXT };
+ DBTableInfo callstackUnitsTableInfo = new DBTableInfo(
+ TABLE_NAME_CALLSTACK_UNITS, names, options, types);
+ tableInfos
+ .set(TABLE_INDEX_CALLSTACK_UNITS, callstackUnitsTableInfo);
+ }
+
+ // "callstack data" table info block
+ {
+ String[] names = { CUSTOM_COLUMN_SEQ, CUSTOM_COLUMN_CALLSTACK };
+ String[] options = { NOT_NULL, EMPTY };
+ String[] types = { INTEGER, TEXT };
+ DBTableInfo callstackDataTableInfo = new DBTableInfo(
+ TABLE_NAME_CALLSTACK_DATA, names, options, types);
+ tableInfos.set(TABLE_INDEX_CALLSTACK_DATA, callstackDataTableInfo);
+ }
+
+ // "failed data" table info block
+ {
+ String[] names = commonColumns;
+ String[] options = commonOptions;
+ String[] types = commonTypes;
+ DBTableInfo failedDataTableInfo = new DBTableInfo(
+ TABLE_NAME_FAILED_DATA, names, options, types);
+ tableInfos.set(TABLE_INDEX_FAILED_DATA, failedDataTableInfo);
+ }
+
+ // "leak data" table info block
+ {
+ String[] names = commonColumns;
+ String[] options = commonOptions;
+ String[] types = commonTypes;
+ DBTableInfo leakDataTableInfo = new DBTableInfo(
+ TABLE_NAME_LEAK_DATA, names, options, types);
+ tableInfos.set(TABLE_INDEX_LEAK_DATA, leakDataTableInfo);
+ }
+
+ // "profiling data" table info block
+ {
+ String[] names = { CUSTOM_COLUMN_SEQ, CUSTOM_COLUMN_NAME,
+ CUSTOM_COLUMN_EXCOUNT, CUSTOM_COLUMN_INCOUNT,
+ CUSTOM_COLUMN_CALL_COUNT, CUSTOM_COLUMN_PARENT,
+ CUSTOM_COLUMN_KEY, CUSTOM_COLUMN_INCL_EXETIME,
+ CUSTOM_COLUMN_EXCL_EXETIME };
+ String[] options = { NOT_NULL, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY,
+ EMPTY, EMPTY, EMPTY };
+ String[] types = { TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT, TEXT,
+ TEXT };
+ DBTableInfo profilingDataTableInfo = new DBTableInfo(
+ TABLE_NAME_PROFILING_DATA, names, options, types);
+ tableInfos.set(TABLE_INDEX_PROFILING_DATA, profilingDataTableInfo);
+ }
+
+ // "profiling child data" table info block
+ {
+ String[] names = { CUSTOM_COLUMN_SEQ, CUSTOM_COLUMN_CHILD_LIST };
+ String[] options = { NOT_NULL, EMPTY };
+ String[] types = { TEXT, TEXT };
+ DBTableInfo profilingChildTableInfo = new DBTableInfo(
+ TABLE_NAME_PROFILING_CHILD_DATA, names, options, types);
+ tableInfos.set(TABLE_INDEX_PROFILING_CHILD_DATA,
+ profilingChildTableInfo);
+ }
+ }
+
+ public DBTableInfo getTableInfo(int tableInfoIndex) {
+ return getTableInfos().get(tableInfoIndex);
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * SangHyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.sql;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.concurrent.Semaphore;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.model.LogCenter;
+import org.tizen.dynamicanalyzer.project.Project;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackData;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit;
+import org.tizen.dynamicanalyzer.ui.summary.failed.FailedChecker;
+import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData;
+import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakData;
+import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakDetector;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfileDataMaker;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfilingChildData;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfilingData;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+
+public class SqlManager {
+ private final int PERMIT = 1;
+ private Semaphore semaphore = new Semaphore(PERMIT);
+ private static SqlManager instance = null;
+
+ private static Connection getConnection() {
+ Project project = AnalyzerManager.getProject();
+ if (null != project && !AnalyzerManager.isExit()) {
+ return project.getConnection();
+ }
+ return null;
+ }
+
+ public static SqlManager getInstance() {
+ if (null == instance) {
+ instance = new SqlManager();
+ }
+ return instance;
+ }
+
+ public void clear() {
+ semaphore = new Semaphore(PERMIT);
+ }
+
+ public synchronized void createTable(LogCenter lcenter) {
+ try {
+ semaphore.acquire();
+ Connection conn = getConnection();
+ if (null == conn) {
+ return;
+ }
+
+ Statement stat = conn.createStatement();
+ stat.executeUpdate(createDropTableQuery(lcenter.getName()));
+ stat.executeUpdate(createTableQuery(lcenter));
+ AnalyzerManager.getProject().closeConnection();
+ AnalyzerManager.getProject().closeConnection();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ semaphore.release();
+ }
+ }
+
+ public void createProjectTable(Project project) {
+ try {
+ semaphore.acquire();
+ Connection conn = getConnection();
+ if (null == conn) {
+ return;
+ }
+
+ Statement stat = conn.createStatement();
+ stat.executeUpdate(createDropTableQuery("project")); //$NON-NLS-1$
+ String query = "create table project (info TEXT not null)"; //$NON-NLS-1$
+ stat.executeUpdate(query);
+ // conn.close();
+ AnalyzerManager.getProject().closeConnection();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ semaphore.release();
+ }
+ }
+
+ public void insertProject() {
+ try {
+ semaphore.acquire();
+ Connection conn = getConnection();
+ if (null == conn) {
+ return;
+ }
+
+ String query = "insert into project values ( ? );"; //$NON-NLS-1$
+ List<LogCenter> logcs = AnalyzerManager.getLogCenters();
+
+ PreparedStatement prep = conn.prepareStatement(query);
+ int size = logcs.size();
+ Project project = AnalyzerManager.getProject();
+
+ /* project version index = 0 */
+ prep.setString(1, project.getVersion());
+ prep.addBatch();
+ /* project create time index = 1 */
+ prep.setString(1, project.getCreateTime());
+ prep.addBatch();
+ /* project application name index = 2 */
+ prep.setString(1, project.getAppName());
+ prep.addBatch();
+ /* project device index = 3 */
+ prep.setString(1, project.getDevice());
+ prep.addBatch();
+ /* project last log number index = 4 */
+ prep.setString(1, project.getLastLogNum());
+ prep.addBatch();
+ /* project last recording time index = 5 */
+ prep.setLong(1, project.getLastTime());
+ prep.addBatch();
+ /* project total sample count index = 6 */
+ prep.setInt(1, project.getTotalProfilingSampleCount());
+ prep.addBatch();
+ /* project package id index = 7 */
+ prep.setString(1, project.getPkgId());
+ prep.addBatch();
+ /* project stop time id index = 8 */
+ prep.setLong(1, project.getStopTime());
+ prep.addBatch();
+
+ /* project logcenters index = reminders */
+ for (int i = 0; i < size; i++) {
+ try {
+ prep.setString(1, logcs.get(i).getName());
+ prep.addBatch();
+ } catch (ArrayIndexOutOfBoundsException e) {
+ e.printStackTrace();
+ }
+ }
+
+ conn.setAutoCommit(false);
+ prep.executeBatch();
+ conn.setAutoCommit(true);
+ AnalyzerManager.getProject().closeConnection();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ semaphore.release();
+ }
+ }
+
+ private String createTableQuery(LogCenter lcenter) {
+ StringBuffer query = new StringBuffer();
+ query.append("create table "); //$NON-NLS-1$
+ query.append(lcenter.getName());
+ query.append(CommonConstants.SPACE + CommonConstants.OPEN_BRACKET);
+ List<String> columnName = lcenter.getColumnName();
+ List<String> columnType = lcenter.getType();
+ int size = lcenter.getTotalColumnCount();
+ for (int i = 0; i < size; i++) {
+ query.append(columnName.get(i) + CommonConstants.SPACE
+ + columnType.get(i));
+ if (i + 1 == size) {
+ query.append(CommonConstants.CLOSE_BRACKET
+ + CommonConstants.SEMICOLON);
+ break;
+ } else {
+ query.append(CommonConstants.COMMA);
+ }
+ }
+ return query.toString();
+ }
+
+ public String createDropTableQuery(String target) {
+ StringBuffer query = new StringBuffer();
+ query.append("drop table if exists "); //$NON-NLS-1$
+ query.append(target);
+ query.append(CommonConstants.SEMICOLON);
+ return query.toString();
+ }
+
+ public void insert(LogCenter logc, List<List<String>> input)
+ throws InterruptedException {
+
+ try {
+ semaphore.acquire();
+
+ Connection conn = getConnection();
+ if (null == conn) {
+ System.out.println("failed sql inset : "+input);
+ return;
+ }
+
+ String query = logc.getInsertQuery();
+ PreparedStatement prep = conn.prepareStatement(query);
+ int dataSize = input.size();
+ ;
+ for (int inputIndex = 0; inputIndex < dataSize; inputIndex++) {
+ List<String> log = input.get(inputIndex);
+ int size = logc.getTotalColumnCount();
+ prep.setInt(1, logc.getIndex());
+ for (int i = 0; i < size; i++) {
+ try {
+ if (i + 2 > size) {
+ break;
+ }
+ prep.setString(i + 2, log.get(i));
+ } catch (ArrayIndexOutOfBoundsException e) {
+ System.out.println("sql insert exception : index " + i); //$NON-NLS-1$
+ e.printStackTrace();
+ }
+ }
+ prep.addBatch();
+ logc.addIndex();
+ }
+ conn.setAutoCommit(false);
+ prep.executeBatch();
+ conn.setAutoCommit(true);
+ // conn.close();
+ AnalyzerManager.getProject().closeConnection();
+ } catch (InterruptedException e) {
+ // force exit
+ System.out.println("sempahore interrupted by abnormal EXIT!!");//$NON-NLS-1$
+ throw e;
+ } catch (SQLException e) {
+ // bug
+ e.printStackTrace();
+ return;
+ } finally {
+ semaphore.release();
+ }
+ }
+
+ public String createInsertQuery(LogCenter logcs) {
+ StringBuffer query = new StringBuffer();
+ query.append("insert into "); //$NON-NLS-1$
+ query.append(logcs.getName());
+ query.append(" values ("); //$NON-NLS-1$
+
+ int size = logcs.getTotalColumnCount();
+ for (int i = 0; i < size; i++) {
+ query.append("?"); //$NON-NLS-1$
+ if (i + 1 == size) {
+ query.append(CommonConstants.CLOSE_BRACKET
+ + CommonConstants.SEMICOLON);
+ break;
+ } else {
+ query.append(CommonConstants.COMMA);
+ }
+ }
+ return query.toString();
+ }
+
+ public ResultSet selectAllFromProject(Project p) {
+ try {
+ semaphore.acquire();
+ Connection conn = getConnection();
+ if (null == conn) {
+ return null;
+ }
+ Statement stat = conn.createStatement();
+ /** column name : info **/
+ String query = "select info from project"; //$NON-NLS-1$
+ ResultSet rs = stat.executeQuery(query);
+ // conn.close();
+ AnalyzerManager.getProject().closeConnection();
+ return rs;
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ semaphore.release();
+
+ }
+ return null;
+ }
+
+ private String getAllColumnsString(LogCenter center) {
+ StringBuffer retStr = new StringBuffer();
+ List<String> columnNames = center.getColumnName();
+ if (null == columnNames || columnNames.isEmpty()) {
+ return null;
+ }
+ int columnSize = columnNames.size();
+ for (int i = 0; i < columnSize; i++) {
+ retStr.append(columnNames.get(i));
+ if (i + 1 != columnSize) {
+ retStr.append(CommonConstants.COMMA);
+ }
+ }
+ return retStr.toString();
+ }
+
+ public List<List<String>> selectArea(LogCenter center, int from, int to) {
+ try {
+ semaphore.acquire();
+ Connection conn = getConnection();
+ if (null == conn) {
+ return null;
+ }
+ StringBuffer query = new StringBuffer();
+ query.append("select ");//$NON-NLS-1$
+
+ String allColumns = getAllColumnsString(center);
+ if (null == allColumns || allColumns.isEmpty()) {
+ return null;
+ }
+ query.append(allColumns);
+ query.append(" from "); //$NON-NLS-1$
+ query.append(center.getName());
+ query.append(" where SeqNumber >= "); //$NON-NLS-1$
+ query.append(from);
+ query.append(" and SeqNumber <= "); //$NON-NLS-1$
+ query.append(to);
+ query.append(CommonConstants.SEMICOLON);
+
+ List<List<String>> output = new ArrayList<List<String>>();
+ Statement stmt = conn.createStatement();
+ ResultSet rs = stmt.executeQuery(query.toString());
+ if (null != rs) {
+ try {
+ while (rs.next()) {
+ List<String> inner = new ArrayList<String>();
+ int size = center.getTotalColumnCount();
+ for (int i = 1; i <= size; i++) {
+ if (i + 1 > size) {
+ break;
+ }
+ inner.add(rs.getString(i + 1));
+ }
+ output.add(inner);
+ }
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ }
+ if (!rs.isClosed()) {
+ rs.close();
+ }
+ AnalyzerManager.getProject().closeConnection();
+ return output;
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+
+ semaphore.release();
+
+ }
+ return null;
+ }
+
+ public synchronized List<List<String>> selectRowId(LogCenter center,
+ int from, int to) {
+ try {
+ semaphore.acquire();
+
+ Connection conn = getConnection();
+ if (null == conn) {
+ return null;
+ }
+
+ StringBuffer query = new StringBuffer();
+
+ query.append("select ");//$NON-NLS-1$
+ String allColumns = getAllColumnsString(center);
+ if (null == allColumns || allColumns.isEmpty()) {
+ return null;
+ }
+ query.append(allColumns);
+ query.append(" from "); //$NON-NLS-1$
+ query.append(center.getName());
+ query.append(" where rid >= "); //$NON-NLS-1$
+ query.append(from);
+ query.append(" and rid < "); //$NON-NLS-1$
+ query.append(to);
+ query.append(CommonConstants.COMMA);
+
+ List<List<String>> output = new ArrayList<List<String>>();
+ Statement stmt = conn.createStatement();
+ ResultSet rs = stmt.executeQuery(query.toString());
+ if (null != rs) {
+ try {
+ while (rs.next()) {
+ List<String> inner = new ArrayList<String>();
+ int size = center.getTotalColumnCount();
+ for (int i = 1; i <= size; i++) {
+ inner.add(rs.getString(i));
+ }
+ output.add(inner);
+ }
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ }
+ if (!rs.isClosed()) {
+ rs.close();
+ }
+ AnalyzerManager.getProject().closeConnection();
+ return output;
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ semaphore.release();
+ }
+ return null;
+ }
+
+ public int selectCount(LogCenter logCenter) {
+ try {
+ semaphore.acquire();
+ Connection conn = getConnection();
+ if (null == conn) {
+ return 0;
+ }
+
+ Statement stat = conn.createStatement();
+ ResultSet rs = stat.executeQuery(logCenter.getSelectCountQuery());
+ if (rs.next()) {
+ int ret = Integer.parseInt(rs.getString(1));
+ if (!rs.isClosed()) {
+ rs.close();
+ }
+ AnalyzerManager.getProject().closeConnection();
+ return ret;
+ }
+ AnalyzerManager.getProject().closeConnection();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ semaphore.release();
+ }
+ return 0;
+ }
+
+ public int executeQueryMinMax(String query) {
+ try {
+ semaphore.acquire();
+ Connection conn = getConnection();
+ if (null == conn) {
+ return 0;
+ }
+
+ Statement stat = conn.createStatement();
+ ResultSet rs = stat.executeQuery(query);
+
+ if (rs.next()) {
+ if (null != rs.getString(1)) {
+ int ret = Integer.parseInt(rs.getString(1));
+ if (!rs.isClosed()) {
+ rs.close();
+ }
+ AnalyzerManager.getProject().closeConnection();
+ return ret;
+ }
+ }
+ AnalyzerManager.getProject().closeConnection();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ semaphore.release();
+ }
+ return -1;
+ }
+
+ public int executeSelectOperation(String query) {
+ try {
+ semaphore.acquire();
+ Connection conn = getConnection();
+ if (null == conn) {
+ return 0;
+ }
+
+ Statement stat = conn.createStatement();
+ ResultSet rs = stat.executeQuery(query);
+ if (rs.next()) {
+ String value = AnalyzerUtil.dotCutter(rs.getString(1));
+ int ret = 0;
+ if (null != value && !value.isEmpty()) {
+ ret = Integer.parseInt(value);
+ }
+ if (!rs.isClosed()) {
+ rs.close();
+ }
+ AnalyzerManager.getProject().closeConnection();
+ return ret;
+ }
+ AnalyzerManager.getProject().closeConnection();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ semaphore.release();
+ }
+ return 0;
+ }
+
+ public void saveLeakData() {
+ try {
+ semaphore.acquire();
+ Connection conn = getConnection();
+ if (null == conn) {
+ return;
+ }
+ LeakDetector leakDectector = AnalyzerManager.getLeakDetector();
+
+ DBTableInfo leakTableInfo = DBTableManager.getInstance()
+ .getTableInfo(DBTableManager.TABLE_INDEX_LEAK_DATA);
+ String insertQuery = leakTableInfo.insertQuery();
+ int size = leakTableInfo.getColumnNames().length;
+ PreparedStatement prep = conn.prepareStatement(insertQuery);
+
+ List<LeakData> leakList = leakDectector.getLeakDataList();
+ for (LeakData leakData : leakList) {
+ for (int ii = 0; ii < size; ii++) {
+ prep.setString(ii + 1, leakData.getData().get(ii));
+ }
+ prep.addBatch();
+
+ if (!leakData.getChildren().isEmpty()) {
+ List<LeakData> children = leakData.getChildren();
+ for (LeakData child : children) {
+ for (int ii = 0; ii < size; ii++) {
+ prep.setString(ii + 1, child.getData().get(ii));
+ }
+ prep.addBatch();
+ }
+ }
+ }
+ conn.setAutoCommit(false);
+ prep.executeBatch();
+ conn.setAutoCommit(true);
+ AnalyzerManager.getProject().closeConnection();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ semaphore.release();
+ }
+ }
+
+ public void saveFailedData() {
+ try {
+ semaphore.acquire();
+ Connection conn = getConnection();
+ if (null == conn) {
+ return;
+ }
+ FailedChecker failedChecker = AnalyzerManager.getFailedChecker();
+
+ List<FailedData> failedList = failedChecker.getFailedList();
+ DBTableInfo failedTableInfo = DBTableManager.getInstance()
+ .getTableInfo(DBTableManager.TABLE_INDEX_FAILED_DATA);
+ String insertQuery = failedTableInfo.insertQuery();
+ PreparedStatement prep = conn.prepareStatement(insertQuery);
+ String[] columns = DBTableManager.commonColumns;
+
+ int size = columns.length;
+ int count = failedList.size();
+ for (int i = 0; i < count; i++) {
+ FailedData failedData = failedList.get(i);
+ int dataSize = failedData.getData().size();
+ for (int ii = 0; ii < size; ii++) {
+ if (ii >= dataSize) {
+ prep.setString(ii + 1, CommonConstants.EMPTY);
+ } else {
+ prep.setString(ii + 1, failedData.getData().get(ii));
+ }
+ }
+ prep.addBatch();
+ }
+
+ conn.setAutoCommit(false);
+ prep.executeBatch();
+ conn.setAutoCommit(true);
+ AnalyzerManager.getProject().closeConnection();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ semaphore.release();
+ }
+ }
+
+ public void saveCallStackUnits() {
+ try {
+ semaphore.acquire();
+ Connection conn = getConnection();
+ if (null == conn) {
+ return;
+ }
+
+ DBTableInfo unitTableInfo = DBTableManager.getInstance()
+ .getTableInfo(DBTableManager.TABLE_INDEX_CALLSTACK_UNITS);
+ String insertQuery = unitTableInfo.insertQuery();
+ PreparedStatement prep = conn.prepareStatement(insertQuery);
+
+ HashMap<Long, CallStackUnit> callstackMap = CallStackManager
+ .getInstance().getCallStackApiByAddrMap();
+ List<CallStackUnit> callstackUnits = new ArrayList<CallStackUnit>();
+ callstackUnits.addAll(callstackMap.values());
+ int size = callstackUnits.size();
+ for (int i = 0; i < size; i++) {
+ try {
+ CallStackUnit saveData = callstackUnits.get(i);
+ prep.setLong(1, saveData.getAddr());
+ prep.setString(2, saveData.getSymbol());
+ // FIXME : do not delete !! to catch bug
+ // System.out.println("addr " + saveData.getAddr() +
+ // " api "
+ // + saveData.getSymbol());
+ prep.addBatch();
+ } catch (ArrayIndexOutOfBoundsException e) {
+ e.printStackTrace();
+ }
+ }
+ conn.setAutoCommit(false);
+ prep.executeBatch();
+ conn.setAutoCommit(true);
+ AnalyzerManager.getProject().closeConnection();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ semaphore.release();
+ }
+ }
+
+ public void saveCallStackData() {
+ try {
+ semaphore.acquire();
+ Connection conn = getConnection();
+ if (null == conn) {
+ return;
+ }
+
+ DBTableInfo callstackData = DBTableManager.getInstance()
+ .getTableInfo(DBTableManager.TABLE_INDEX_CALLSTACK_DATA);
+ String insertQuery = callstackData.insertQuery();
+ PreparedStatement prep = conn.prepareStatement(insertQuery);
+ Collection<CallStackData> col = CallStackManager.getInstance()
+ .getCallStackDataBySeqMap().values();
+ List<CallStackData> callstackDataList = new ArrayList<CallStackData>();
+ callstackDataList.addAll(col);
+ int size = callstackDataList.size();
+ for (int i = 0; i < size; i++) {
+ int seq = callstackDataList.get(i).getSeq();
+ String addrs = AnalyzerUtil
+ .makeLongList2String(callstackDataList.get(i)
+ .getAddrs());
+ try {
+ prep.setInt(1, seq);
+ prep.setString(2, addrs);
+ prep.addBatch();
+ } catch (ArrayIndexOutOfBoundsException e) {
+ e.printStackTrace();
+ }
+ }
+
+ conn.setAutoCommit(false);
+ prep.executeBatch();
+ conn.setAutoCommit(true);
+ AnalyzerManager.getProject().closeConnection();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ semaphore.release();
+ }
+ }
+
+ public void saveAppInfo() {
+ try {
+ semaphore.acquire();
+ Connection conn = getConnection();
+ if (null == conn) {
+ return;
+ }
+
+ DBTableInfo appInfoData = DBTableManager.getInstance()
+ .getTableInfo(DBTableManager.TABLE_INDEX_APP_INFO);
+ String insertQuery = appInfoData.insertQuery();
+ PreparedStatement prep = conn.prepareStatement(insertQuery);
+ List<String> info = AnalyzerManager.getProject().getAppInfo();
+ int size = info.size();
+ for (int i = 0; i < size; i++) {
+ prep.setString(1, info.get(i));
+ prep.addBatch();
+ }
+
+ conn.setAutoCommit(false);
+ prep.executeBatch();
+ conn.setAutoCommit(true);
+ AnalyzerManager.getProject().closeConnection();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ semaphore.release();
+ }
+ }
+
+ public void createTables() {
+ try {
+ semaphore.acquire();
+
+ Connection conn = getConnection();
+ if (null == conn) {
+ return;
+ }
+
+ DBTableManager dbManager = DBTableManager.getInstance();
+ Statement stat = conn.createStatement();
+ if (!executeUpdateCreateTable(stat,
+ dbManager.getTableInfo(DBTableManager.TABLE_INDEX_APP_INFO)
+ .createQuery())) {
+ return;
+ }
+ if (!executeUpdateCreateTable(
+ stat,
+ dbManager.getTableInfo(
+ DBTableManager.TABLE_INDEX_CALLSTACK_UNITS)
+ .createQuery())) {
+ return;
+ }
+ if (!executeUpdateCreateTable(
+ stat,
+ dbManager.getTableInfo(
+ DBTableManager.TABLE_INDEX_CALLSTACK_DATA)
+ .createQuery())) {
+ return;
+ }
+ if (!executeUpdateCreateTable(stat,
+ dbManager
+ .getTableInfo(DBTableManager.TABLE_INDEX_LEAK_DATA)
+ .createQuery())) {
+ return;
+ }
+ if (!executeUpdateCreateTable(
+ stat,
+ dbManager.getTableInfo(
+ DBTableManager.TABLE_INDEX_FAILED_DATA)
+ .createQuery())) {
+ return;
+ }
+ if (!executeUpdateCreateTable(
+ stat,
+ dbManager.getTableInfo(
+ DBTableManager.TABLE_INDEX_PROFILING_DATA)
+ .createQuery())) {
+ return;
+ }
+ if (!executeUpdateCreateTable(
+ stat,
+ dbManager.getTableInfo(
+ DBTableManager.TABLE_INDEX_PROFILING_CHILD_DATA)
+ .createQuery())) {
+ return;
+ }
+ AnalyzerManager.getProject().closeConnection();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ semaphore.release();
+ }
+ }
+
+ private boolean executeUpdateCreateTable(Statement stat, String query)
+ throws SQLException {
+ if (!AnalyzerManager.isExit()) {
+ stat.executeUpdate(query);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public ResultSet selectAllFromTable(int tableIndex) {
+ try {
+ semaphore.acquire();
+ Connection conn = getConnection();
+ if (null == conn) {
+ return null;
+ }
+
+ Statement stat = conn.createStatement();
+ DBTableManager dbManager = DBTableManager.getInstance();
+ String query = dbManager.getTableInfo(tableIndex).selectAllQuery();
+ ResultSet rs = stat.executeQuery(query);
+ AnalyzerManager.getProject().closeConnection();
+ return rs;
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ semaphore.release();
+
+ }
+ return null;
+ }
+
+ public List<String> executeSelectQuery(String query, int columnCount) {
+ try {
+ semaphore.acquire();
+ Connection conn = getConnection();
+ if (null == conn) {
+ return null;
+ }
+
+ List<String> output = null;
+ Statement stat = conn.createStatement();
+ ResultSet rs = stat.executeQuery(query);
+ if (rs.next()) {
+ output = new ArrayList<String>();
+ for (int i = 0; i < columnCount; i++) {
+ output.add(rs.getString(i + 1));
+ }
+ }
+ if (!rs.isClosed()) {
+ rs.close();
+ }
+ AnalyzerManager.getProject().closeConnection();
+ return output;
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ semaphore.release();
+ }
+ return null;
+ }
+
+ public String executeSelectQuery(String query) {
+ try {
+ semaphore.acquire();
+ Connection conn = getConnection();
+ if (null == conn) {
+ return null;
+ }
+
+ String output = null;
+ Statement stat = conn.createStatement();
+ ResultSet rs = stat.executeQuery(query);
+ if (rs.next()) {
+ output = rs.getString(1);
+ }
+ if (!rs.isClosed()) {
+ rs.close();
+ }
+ AnalyzerManager.getProject().closeConnection();
+ return output;
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ } finally {
+ semaphore.release();
+ }
+ return null;
+ }
+
+ public List<List<String>> executeSelectQueryFD(String query, int size) {
+ try {
+ semaphore.acquire();
+ Connection conn = getConnection();
+ if (null == conn) {
+ return null;
+ }
+
+ List<String> output = null;
+ List<List<String>> outputList = new ArrayList<List<String>>();
+ Statement stat = conn.createStatement();
+ ResultSet rs = stat.executeQuery(query);
+ while (rs.next()) {
+ output = new ArrayList<String>();
+ for (int i = 0; i < size; i++) {
+ output.add(rs.getString(i + 1));
+ }
+ outputList.add(output);
+ }
+ if (!rs.isClosed()) {
+ rs.close();
+ }
+ AnalyzerManager.getProject().closeConnection();
+ return outputList;
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ semaphore.release();
+ }
+ return null;
+ }
+
+ public List<List<String>> executeDeviceInfoQuery(String query) {
+ try {
+ semaphore.acquire();
+ Connection conn = getConnection();
+ if (null == conn) {
+ return null;
+ }
+
+ List<String> output = null;
+ List<List<String>> outputList = new ArrayList<List<String>>();
+ Statement stat = conn.createStatement();
+ ResultSet rs = stat.executeQuery(query);
+ while (rs.next()) {
+ output = new ArrayList<String>();
+ for (int i = 0; i < 2; i++) {
+ output.add(rs.getString(i + 1));
+ }
+ outputList.add(output);
+ }
+ if (!rs.isClosed()) {
+ rs.close();
+ }
+ AnalyzerManager.getProject().closeConnection();
+ return outputList;
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ semaphore.release();
+ }
+ return null;
+ }
+
+ public List<List<String>> executeSelectQueryImage(String query,
+ LogCenter logc) {
+ try {
+ semaphore.acquire();
+ Connection conn = getConnection();
+ if (null == conn) {
+ return null;
+ }
+
+ List<String> output = null;
+ List<List<String>> outputList = new ArrayList<List<String>>();
+ Statement stat = conn.createStatement();
+ ResultSet rs = stat.executeQuery(query);
+ int size = logc.getTotalColumnCount();
+ while (rs.next()) {
+ output = new ArrayList<String>();
+ for (int i = 0; i < size; i++) {
+ output.add(rs.getString(i + 1));
+ }
+ outputList.add(output);
+ }
+ if (!rs.isClosed()) {
+ rs.close();
+ }
+ AnalyzerManager.getProject().closeConnection();
+ return outputList;
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ semaphore.release();
+ }
+ return null;
+ }
+
+ public void saveProfilingData() {
+ try {
+ semaphore.acquire();
+ Connection conn = getConnection();
+ if (null == conn) {
+ return;
+ }
+ ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
+ .getProfileDataMaker();
+ HashMap<String, ProfilingData> profilingDataMap = profiler
+ .getProfilingDataMap();
+ List<ProfilingData> pDataList = new ArrayList<ProfilingData>();
+ pDataList.addAll(profilingDataMap.values());
+
+ DBTableInfo profilingData = DBTableManager.getInstance()
+ .getTableInfo(DBTableManager.TABLE_INDEX_PROFILING_DATA);
+ String insertQuery = profilingData.insertQuery();
+ PreparedStatement prep = conn.prepareStatement(insertQuery);
+
+ int size = profilingData.getColumnNames().length;
+ int count = pDataList.size();
+ for (int i = 0; i < count; i++) {
+ List<String> input = pDataList.get(i).getSaveData();
+ int dataSize = input.size();
+ for (int ii = 0; ii < size; ii++) {
+ if (ii >= dataSize) {
+ prep.setString(ii + 1, CommonConstants.EMPTY);
+ } else {
+ prep.setString(ii + 1, input.get(ii));
+ }
+ }
+ prep.addBatch();
+ }
+
+ conn.setAutoCommit(false);
+ prep.executeBatch();
+ conn.setAutoCommit(true);
+ AnalyzerManager.getProject().closeConnection();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ semaphore.release();
+
+ }
+ }
+
+ public void saveProfilingChildData() {
+ try {
+ semaphore.acquire();
+ Connection conn = getConnection();
+ if (null == conn) {
+ return;
+ }
+ ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
+ .getProfileDataMaker();
+ HashMap<String, ProfilingChildData> profilingDataMap = profiler
+ .getChildListMap();
+ List<ProfilingChildData> pDataList = new ArrayList<ProfilingChildData>();
+ pDataList.addAll(profilingDataMap.values());
+
+ DBTableInfo profilingChildData = DBTableManager.getInstance()
+ .getTableInfo(
+ DBTableManager.TABLE_INDEX_PROFILING_CHILD_DATA);
+ String insertQuery = profilingChildData.insertQuery();
+ PreparedStatement prep = conn.prepareStatement(insertQuery);
+
+ int count = pDataList.size();
+ for (int i = 0; i < count; i++) {
+ ProfilingChildData data = pDataList.get(i);
+ String seqStr = AnalyzerUtil.makeStringList2String(data
+ .getChildren());
+ if (null == seqStr || seqStr.isEmpty()) {
+ continue;
+ }
+ prep.setString(1, data.getSeq());
+ prep.setString(2, seqStr);
+ prep.addBatch();
+ }
+
+ conn.setAutoCommit(false);
+ prep.executeBatch();
+ conn.setAutoCommit(true);
+ AnalyzerManager.getProject().closeConnection();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ } finally {
+ semaphore.release();
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.theme;
+
+import java.io.File;
+
+import org.eclipse.jface.resource.ColorRegistry;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+
+public abstract class DATheme {
+ protected String name = "black";//$NON-NLS-1$
+ protected static ColorRegistry colorRegistry = new ColorRegistry();
+
+ public DATheme() {
+ setColor("white", new RGB(255, 255, 255)); //$NON-NLS-1$
+ setColor("black", new RGB(0, 0, 0)); //$NON-NLS-1$
+ setColor("blue", new RGB(0, 0, 255)); //$NON-NLS-1$
+ setColor("red", new RGB(255, 0, 0)); //$NON-NLS-1$
+ setColor("purple", new RGB(226, 101, 225)); //$NON-NLS-1$
+ }
+
+ public abstract Color getColor(String colorName, RGB rgb);
+
+ public abstract Color getColor(String colorName);
+
+ public abstract void setColor(String colorName, RGB rgb);
+
+ public String getThemePath() {
+ return "theme" + File.separator + name + File.separator;//$NON-NLS-1$
+ }
+
+ public String getImagePath() {
+ String path = getThemePath() + "img" + File.separator;//$NON-NLS-1$
+ return path;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.theme;
+
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+
+public class DAThemeBlack extends DATheme {
+ public static DAThemeBlack instance;
+
+ public static DAThemeBlack getInstance() {
+ if (null == instance) {
+ instance = new DAThemeBlack();
+ }
+ return instance;
+ }
+
+ DAThemeBlack() {
+ super();
+ name = "black";
+
+ // defaule
+ setColor("blue", new RGB(0, 102, 134));
+ setColor("green", new RGB(68, 98, 12));
+ setColor("yellow", new RGB(255, 210, 10));
+ setColor("purple", new RGB(139, 42, 118));
+ setColor("brown", new RGB(138, 83, 0));
+ setColor("navy", new RGB(57, 66, 161));
+ setColor("darkviolet", new RGB(105, 2, 126));
+ setColor("maroon", new RGB(126, 41, 2));
+ setColor("teal", new RGB(27, 110, 92));
+ setColor("indigo", new RGB(80, 26, 146));
+ setColor("goldenrod", new RGB(212, 150, 57));
+ setColor("turquoise", new RGB(72, 194, 168));
+ setColor("violet", new RGB(226, 109, 201));
+ setColor("slateblue", new RGB(122, 132, 238));
+ setColor("orange", new RGB(236, 107, 47));
+ setColor("yellowgreen", new RGB(129, 172, 50));
+ setColor("skyblue", new RGB(72, 185, 221));
+ setColor("orchid", new RGB(175, 49, 200));
+ setColor("sandybrown", new RGB(201, 168, 58));
+ setColor("mediumpurple", new RGB(160, 108, 224));
+
+ // shell window background color
+ setColor("window_bg_color", new RGB(51, 52, 53)); //$NON-NLS-1$
+ setColor("dialg_bg_upper", new RGB(51, 52, 53));
+ setColor("dialg_bg_lower", new RGB(0, 0, 0));
+ setColor("dialg_sunken_1", new RGB(39, 39, 40));
+ setColor("dialg_sunken_2", new RGB(39, 39, 40));
+ setColor("edit_chart_dialog_upper", new RGB(0, 0, 0));
+ setColor("edit_chart_dialog_lower", new RGB(39, 39, 40));
+
+ setColor("view_border", new RGB(74, 74, 74)); //$NON-NLS-1$
+ setColor("view_bg_color", new RGB(66, 66, 68)); //$NON-NLS-1$
+ getColor("view_title_font_color", new RGB(255, 255, 255));
+
+ setColor("coolbar_bg_color", new RGB(51, 52, 53)); //$NON-NLS-1$
+ setColor("default_font_color", new RGB(255, 255, 255));//$NON-NLS-1$
+
+ /** title bar colors **/
+ setColor("titlebar_text_color", new RGB(64, 208, 255)); //$NON-NLS-1$
+ setColor("titlebar_bg", new RGB(78, 79, 81)); //$NON-NLS-1$
+ setColor("titlebar_start_color", new RGB(103, 103, 104)); //$NON-NLS-1$
+ setColor("titlebar_end_color", new RGB(133, 133, 133)); //$NON-NLS-1$
+ setColor("titlebar_bottom_stroke_1", new RGB(0, 0, 0));
+ setColor("titlebar_bottom_stroke_2", new RGB(128, 128, 128));
+
+ /** device and application combo specific colors start **/
+ setColor("device_application_enable_font", new RGB(255, 255, 255)); //$NON-NLS-1$
+ setColor("device_application_disable_font", new RGB(128, 128, 128)); //$NON-NLS-1$
+ setColor("device_application_popup_outer_1", new RGB(31, 31, 31)); //$NON-NLS-1$
+ setColor("device_application_popup_outer_2", new RGB(31, 137, 163)); //$NON-NLS-1$
+ setColor("device_application_item_normal_top", new RGB(76, 76, 77)); //$NON-NLS-1$
+ setColor("device_application_item_normal_inner", new RGB(66, 66, 67)); //$NON-NLS-1$
+ setColor("device_application_item_normal_bottom", new RGB(56, 56, 60)); //$NON-NLS-1$
+ setColor("device_application_item_select_top", new RGB(76, 76, 77)); //$NON-NLS-1$
+ setColor("device_application_item_select_inner", new RGB(0, 151, 201)); //$NON-NLS-1$
+ setColor("device_application_item_select_bottom", new RGB(56, 56, 60)); //$NON-NLS-1$
+ /** device and application combo specific colors end **/
+
+ /*** combo button gradation ***/
+ setColor("device_application_button_normal_start", new RGB(72, 72, 73)); //$NON-NLS-1$
+ setColor("device_application_button_normal_end", new RGB(35, 35, 36)); //$NON-NLS-1$
+ setColor("device_application_button_push_start", new RGB(13, 75, 96)); //$NON-NLS-1$
+ setColor("device_application_button_push_end", new RGB(13, 75, 96)); //$NON-NLS-1$
+ setColor("device_application_button_hover_start", new RGB(0, 151, 201)); //$NON-NLS-1$
+ setColor("device_application_button_hover_end", new RGB(0, 151, 201)); //$NON-NLS-1$
+ setColor("device_application_button_disable_start", new RGB(51, 52, 53)); //$NON-NLS-1$
+ setColor("device_application_button_disable_end", new RGB(0, 0, 0)); //$NON-NLS-1$
+ setColor("device_application_button_outline", new RGB(0, 0, 0));
+
+ /*** common button colors ***/
+ setColor("button_normal_color_start", new RGB(103, 103, 104));
+ setColor("button_normal_color_end", new RGB(67, 67, 68));
+ setColor("button_push_color_start", new RGB(67, 67, 68));
+ setColor("button_push_color_end", new RGB(103, 103, 104));
+ setColor("button_hover_color_start", new RGB(103, 103, 104));
+ setColor("button_hover_color_end", new RGB(67, 67, 67));
+ setColor("button_disable_color_start", new RGB(74, 74, 74));
+ setColor("button_disable_color_end", new RGB(50, 50, 50));
+
+ setColor("button_outline_normal_in_color", new RGB(0, 0, 0));
+ setColor("button_outline_push_in_color", new RGB(0, 0, 0));
+ setColor("button_outline_hover_in_color", new RGB(0, 0, 0));
+ setColor("button_outline_disable_in_color", new RGB(0, 0, 0));
+
+ setColor("button_outline_normal_color", new RGB(67, 67, 68));
+ setColor("button_outline_push_color", new RGB(67, 67, 68));
+ setColor("button_outline_hover_color", new RGB(66, 158, 190));
+ setColor("button_outline_disable_color", new RGB(67, 67, 68));
+
+ setColor("button_normal_font_color", new RGB(255, 255, 255));
+ setColor("button_push_font_color", new RGB(255, 255, 255));
+ setColor("button_hover_font_color", new RGB(255, 255, 255));
+ setColor("button_disable_font_color", new RGB(0, 0, 0));
+
+ /** normal view layout colors start **/
+ setColor("normal_view_layout_outer", new RGB(160, 160, 160)); //$NON-NLS-1$
+ setColor("normal_view_layout_middle", new RGB(74, 74, 74)); //$NON-NLS-1$
+ setColor("normal_view_layout_inner", new RGB(66, 66, 68)); //$NON-NLS-1$
+ /** normal view layout colors end **/
+
+ /** current view colors start **/
+ setColor("current_view_outline", new RGB(160, 160, 160)); //$NON-NLS-1$
+
+ setColor("current_view_table_title_bg", new RGB(59, 59, 60)); //$NON-NLS-1$
+ setColor("current_view_table_title_text", new RGB(151, 230, 255)); //$NON-NLS-1$
+ setColor("current_view_table_contents_bg", new RGB(84, 85, 86)); //$NON-NLS-1$
+ setColor("current_view_table_contents_text", new RGB(216, 216, 216)); //$NON-NLS-1$
+ setColor("current_view_table_line", new RGB(136, 137, 138)); //$NON-NLS-1$
+
+ setColor("current_view_cpu_text", new RGB(2, 171, 208)); //$NON-NLS-1$
+ setColor("current_view_process_text", new RGB(114, 203, 8)); //$NON-NLS-1$
+ setColor("current_view_graph_bg", new RGB(79, 79, 81)); //$NON-NLS-1$
+ setColor("current_view_graph_outline", new RGB(43, 44, 45)); //$NON-NLS-1$
+ setColor("current_view_snapshot_outline", new RGB(49, 104, 127)); //$NON-NLS-1$
+ /** current view colors end **/
+
+ /** common table colors start **/
+ setColor("table_header_bg", new RGB(59, 59, 60)); //$NON-NLS-1$
+ setColor("table_line", new RGB(136, 137, 138)); //$NON-NLS-1$
+ setColor("table_contents_normal", new RGB(84, 85, 86)); //$NON-NLS-1$
+ setColor("table_contents_hover", new RGB(72, 98, 108)); //$NON-NLS-1$
+ setColor("table_contents_selected_start", new RGB(0, 146, 193)); //$NON-NLS-1$
+ setColor("table_contents_selected_end", new RGB(0, 60, 79)); //$NON-NLS-1$
+ setColor("table_contents_selected_font_color", new RGB(255, 255, 255)); //$NON-NLS-1$
+ setColor("table_title_font_color", new RGB(151, 230, 255)); //$NON-NLS-1$
+ setColor("table_contents_font_color", new RGB(216, 216, 216)); //$NON-NLS-1$
+ /** common table colors end **/
+
+ /** open trace popup colors **/
+ setColor("open_trace_label_color", new RGB(255, 255, 255));
+ setColor("open_trace_save_contents_color", new RGB(216, 216, 216));
+ setColor("open_trace_temp_contents_color", new RGB(255, 85, 57));
+ setColor("open_trace_table_outline_color", new RGB(123, 124, 124));
+
+ setColor("open_trace_table_content_normal_color1", new RGB(78, 78, 79));
+ setColor("open_trace_table_content_hover_color1", new RGB(72, 98, 108));
+ setColor("open_trace_table_content_selected_start_color1", new RGB(0,
+ 146, 193));
+ setColor("open_trace_table_content_selected_end_color1", new RGB(0, 60,
+ 79));
+
+ setColor("open_trace_table_content_normal_color2", new RGB(84, 85, 86));
+ setColor("open_trace_table_content_hover_color2", new RGB(72, 98, 108));
+ setColor("open_trace_table_content_selected_start_color2", new RGB(0,
+ 146, 193));
+ setColor("open_trace_table_content_selected_end_color2", new RGB(0, 60,
+ 79));
+
+ setColor("open_trace_button_composite_bg_color", new RGB(39, 39, 40));
+
+ setColor("open_trace_popup_contents_bg_color", new RGB(51, 52, 53)); //$NON-NLS-1$
+ setColor("open_trace_popup_bottom_bg_color", new RGB(39, 39, 40)); //$NON-NLS-1$
+
+ setColor("open_trace_table_line1_normal", new RGB(78, 78, 79)); //$NON-NLS-1$
+ setColor("open_trace_table_line1_hover", new RGB(72, 98, 108)); //$NON-NLS-1$
+ setColor("open_trace_table_line_selected_start", new RGB(0, 146, 193)); //$NON-NLS-1$
+ setColor("open_trace_table_line_selected_end", new RGB(0, 60, 79)); //$NON-NLS-1$
+
+ setColor("open_trace_table_line2_normal", new RGB(84, 85, 86)); //$NON-NLS-1$
+ setColor("open_trace_table_line2_hover", new RGB(72, 98, 108)); //$NON-NLS-1$
+
+ setColor("open_trace_table2_font_color", new RGB(255, 85, 57)); //$NON-NLS-1$
+
+ /** tab widget colors **/
+ setColor("tab_selected_color_start", new RGB(123, 123, 123));
+ setColor("tab_selected_color_end", new RGB(78, 78, 80));
+ setColor("tab_normal_color_start", new RGB(74, 74, 74));
+ setColor("tab_normal_color_end", new RGB(50, 50, 50));
+ setColor("tab_hover_color_start", new RGB(61, 67, 72));
+ setColor("tab_hover_color_end", new RGB(65, 77, 85));
+ setColor("tab_push_color_start", new RGB(35, 38, 41));
+ setColor("tab_push_color_end", new RGB(37, 44, 49));
+
+ setColor("tab_outline_normal_color", new RGB(115, 115, 115));
+ setColor("tab_outline_push_color", new RGB(115, 115, 115));
+ setColor("tab_outline_hover_color", new RGB(115, 115, 115));
+ setColor("tab_outline_selected_color", new RGB(160, 160, 160));
+
+ setColor("tab_selected_font_color", new RGB(255, 255, 255));
+ setColor("tab_normal_font_color", new RGB(255, 255, 255));
+ setColor("tab_hover_font_color", new RGB(255, 255, 255));
+ setColor("tab_push_font_color", new RGB(255, 255, 255));
+
+ setColor("tab_bg_color_start", new RGB(32, 32, 33));
+ setColor("tab_bg_color_end", new RGB(43, 43, 44));
+ setColor("tab_bg_outline_color", new RGB(81, 82, 83));
+
+ /** Page chart colors **/
+ setColor("page_chart_header_bg", new RGB(45, 45, 46)); //$NON-NLS-1$
+ setColor("page_chart_selection_bg", new RGB(0, 151, 201)); //$NON-NLS-1$
+ setColor("page_chart_parent_bg", new RGB(84, 85, 86)); //$NON-NLS-1$
+ setColor("page_chart_child_bg", new RGB(59, 59, 60)); //$NON-NLS-1$
+ setColor("page_open_start_run", new RGB(244, 252, 82)); //$NON-NLS-1$
+ setColor("page_open_end_run", new RGB(235, 231, 56)); //$NON-NLS-1$
+ setColor("page_open_start_stop", new RGB(255, 135, 82)); //$NON-NLS-1$
+ setColor("page_open_end_stop", new RGB(232, 73, 73)); //$NON-NLS-1$
+ setColor("page_closed_start", new RGB(168, 198, 71)); //$NON-NLS-1$
+ setColor("page_closed_end", new RGB(130, 152, 54)); //$NON-NLS-1$
+ setColor("page_use_start", new RGB(78, 176, 255)); //$NON-NLS-1$
+ setColor("page_use_end", new RGB(44, 104, 153)); //$NON-NLS-1$
+
+ /** Thread chart colors **/
+ setColor("thread_open_start_run", new RGB(244, 252, 82)); //$NON-NLS-1$
+ setColor("thread_open_end_run", new RGB(235, 231, 56)); //$NON-NLS-1$
+ setColor("thread_open_start_stop", new RGB(168, 198, 71)); //$NON-NLS-1$
+ setColor("thread_open_end_stop", new RGB(130, 152, 54)); //$NON-NLS-1$
+ setColor("thread_closed_start", new RGB(168, 198, 71)); //$NON-NLS-1$
+ setColor("thread_closed_end", new RGB(130, 152, 54)); //$NON-NLS-1$
+ setColor("thread_sleep_start", new RGB(215, 215, 215)); //$NON-NLS-1$
+ setColor("thread_sleep_end", new RGB(157, 166, 168)); //$NON-NLS-1$
+
+ /** File chart colors **/
+ setColor("file_api_used", new RGB(15, 153, 232)); //$NON-NLS-1$
+ setColor("file_api_failed", new RGB(226, 65, 73)); //$NON-NLS-1$
+ setColor("file_area_used_start", new RGB(255, 222, 125)); //$NON-NLS-1$
+ setColor("file_area_used_end", new RGB(255, 186, 29)); //$NON-NLS-1$
+ setColor("file_area_closed_start", new RGB(168, 198, 71)); //$NON-NLS-1$
+ setColor("file_area_closed_end", new RGB(130, 152, 54)); //$NON-NLS-1$
+ setColor("file_not_access_start", new RGB(178, 178, 178)); //$NON-NLS-1$
+ setColor("file_not_access_end", new RGB(106, 106, 106)); //$NON-NLS-1$
+ setColor("file_access_read", new RGB(64, 126, 18)); //$NON-NLS-1$
+ setColor("file_access_write", new RGB(147, 21, 173)); //$NON-NLS-1$
+
+ setColor("unselected_tab_first", new RGB(51, 51, 51)); //$NON-NLS-1$
+ setColor("unselected_tab_second", new RGB(42, 42, 42)); //$NON-NLS-1$
+ setColor("selected_tab_first", new RGB(74, 74, 74)); //$NON-NLS-1$
+ setColor("selected_tab_second", new RGB(128, 129, 130)); //$NON-NLS-1$
+
+ setColor("tooltip", new RGB(255, 255, 225)); //$NON-NLS-1$
+
+ setColor("barGRAY1", new RGB(177, 177, 177)); //$NON-NLS-1$
+ setColor("barGRAY2", new RGB(153, 153, 153)); //$NON-NLS-1$
+ setColor("barGRAY3", new RGB(216, 216, 216)); //$NON-NLS-1$
+
+ /* Timeline */
+ setColor("item blue right", new RGB(131, 196, 218));//$NON-NLS-1$
+ setColor("item blue dark", new RGB(38, 104, 138));//$NON-NLS-1$
+ setColor("item background", new RGB(50, 50, 50));//$NON-NLS-1$
+
+ setColor("timeline_bg", new RGB(50, 50, 50)); //$NON-NLS-1$
+ setColor("timeline_bg", new RGB(50, 50, 50)); //$NON-NLS-1$
+
+ setColor("snapshot_chart_bg", new RGB(50, 50, 50)); //$NON-NLS-1$
+
+ setColor("GRAY_130", new RGB(130, 130, 130)); //$NON-NLS-1$
+ setColor("GRAY_170", new RGB(170, 170, 170)); //$NON-NLS-1$
+ setColor("GRAY_210", new RGB(210, 210, 210)); //$NON-NLS-1$
+
+ setColor("defaultForeground", new RGB(0, 0, 0)); //$NON-NLS-1$
+ setColor("defaultBackground", new RGB(255, 255, 255)); //$NON-NLS-1$
+ setColor("defaultRed", new RGB(173, 13, 1)); //$NON-NLS-1$
+
+ // bar graph
+ setColor("cpu_bar_graph_color", new RGB(2, 171, 208)); //$NON-NLS-1$
+ setColor("cpu_bar_graph_gray_color", new RGB(79, 79, 81));
+ setColor("cpu_bar_graph_bg_color", new RGB(43, 44, 45));
+
+ setColor("process_bar_graph_color", new RGB(114, 203, 8)); //$NON-NLS-1$
+ setColor("process_bar_graph_center_color", new RGB(43, 44, 45)); //$NON-NLS-1$
+ setColor("process_bar_graph_bg_color", new RGB(79, 79, 81)); //$NON-NLS-1$
+
+ setColor("profiling_graph_color_start", new RGB(145, 190, 3)); //$NON-NLS-1$
+ setColor("profiling_graph_color_end", new RGB(114, 149, 1)); //$NON-NLS-1$
+
+ setColor("profiling_graph_selection_color_start", new RGB(255, 135, 82)); //$NON-NLS-1$
+ setColor("profiling_graph_selection_color_end", new RGB(232, 73, 73)); //$NON-NLS-1$
+
+ // Add Chart
+ setColor("add_chart_enable_color_start", new RGB(131, 196, 218)); //$NON-NLS-1$
+ setColor("add_chart_enable_color_end", new RGB(38, 104, 138)); //$NON-NLS-1$
+ setColor("add_chart_disable_color_start", new RGB(123, 124, 124)); //$NON-NLS-1$
+ setColor("add_chart_disable_color_end", new RGB(244, 244, 244)); //$NON-NLS-1$
+
+ /** Timeline chart **/
+ setColor("seriesColorCPUSystem", new RGB(212, 150, 57)); //$NON-NLS-1$
+ setColor("seriesColorCPUApp", new RGB(1, 102, 134)); //$NON-NLS-1$
+
+ setColor("seriesColorCPUCoreCore0", new RGB(72, 185, 221)); //$NON-NLS-1$
+ setColor("seriesColorCPUCoreCore1", new RGB(129, 172, 50)); //$NON-NLS-1$
+ setColor("seriesColorCPUCoreCore2", new RGB(226, 109, 201)); //$NON-NLS-1$
+ setColor("seriesColorCPUCoreCore3", new RGB(72, 194, 168)); //$NON-NLS-1$
+
+ setColor("seriesColorCPUFreq", new RGB(72, 185, 221)); //$NON-NLS-1$
+
+ setColor("seriesColorHeapSystem", new RGB(1, 102, 134)); //$NON-NLS-1$
+ setColor("seriesColorHeapApp", new RGB(72, 185, 221)); //$NON-NLS-1$
+
+ setColor("seriesColorProcessVSS", new RGB(1, 102, 134)); //$NON-NLS-1$
+ setColor("seriesColorProcessRSS", new RGB(111, 148, 43)); //$NON-NLS-1$
+ setColor("seriesColorProcessPSS", new RGB(201, 168, 58)); //$NON-NLS-1$
+
+ setColor("seriesColorMemorySysMax", new RGB(105, 2, 126)); //$NON-NLS-1$
+ setColor("seriesColorMemorySysUsed", new RGB(1, 102, 134)); //$NON-NLS-1$
+ setColor("seriesColorMemoryAppUsed", new RGB(111, 148, 43)); //$NON-NLS-1$
+
+ setColor("seriesColorFileRead", new RGB(126, 41, 2)); //$NON-NLS-1$
+ setColor("seriesColorFileWrite", new RGB(27, 110, 92)); //$NON-NLS-1$
+ setColor("seriesColorFileFD", new RGB(129, 172, 50)); //$NON-NLS-1$
+
+ setColor("seriesColorUIEventKey", new RGB(200, 0, 0)); //$NON-NLS-1$
+ setColor("seriesColorUIEventTouch", new RGB(200, 0, 0)); //$NON-NLS-1$
+ setColor("seriesColorUIEventGesture", new RGB(200, 0, 0)); //$NON-NLS-1$
+ setColor("seriesColorUIEventOrientation", new RGB(200, 0, 0)); //$NON-NLS-1$
+ setColor("seriesColorUIEventFramework", new RGB(200, 0, 0)); //$NON-NLS-1$
+
+ setColor("selectionRange", new RGB(193, 253, 255)); //$NON-NLS-1$
+ setColor("selectionLine", new RGB(193, 253, 255)); //$NON-NLS-1$
+
+ setColor("UIEventChartSeperateLine", new RGB(189, 207, 213)); //$NON-NLS-1$
+
+ /*** scale ***/
+ setColor("scale_outline_color", new RGB(31, 31, 31)); //$NON-NLS-1$
+ setColor("scale_bg_color_start", new RGB(177, 177, 177)); //$NON-NLS-1$
+ setColor("scale_bg_color_end", new RGB(99, 99, 99)); //$NON-NLS-1$
+ setColor("scale_area_color", new RGB(46, 46, 47)); //$NON-NLS-1$
+ setColor("scale_area_outline_color", new RGB(208, 208, 208)); //$NON-NLS-1$
+
+ /*** stop progress dialog ***/
+ setColor("stop_progress_line1_color", new RGB(2, 171, 208)); //$NON-NLS-1$
+ setColor("stop_progress_line2_color", new RGB(86, 86, 86)); //$NON-NLS-1$
+ setColor("stop_progress_background_color", new RGB(66, 66, 68)); //$NON-NLS-1$
+ setColor("stop_progress_info_font_color", new RGB(185, 185, 185)); //$NON-NLS-1$
+
+ /*** thread graph ***/
+ setColor("thread_graph_cpu_load_color", new RGB(0, 123, 169)); //$NON-NLS-1$
+ setColor("thread_graph_callee_color", new RGB(100, 21, 232)); //$NON-NLS-1$
+ setColor("thread_graph_lock_new_color", new RGB(129, 169, 0)); //$NON-NLS-1$
+ setColor("thread_graph_lock_wait_color", new RGB(96, 126, 131)); //$NON-NLS-1$
+ setColor("thread_graph_lock_acquire_color", new RGB(227, 123, 30)); //$NON-NLS-1$
+ setColor("thread_graph_lock_release_color", new RGB(255, 255, 255)); //$NON-NLS-1$
+
+ /*** configuration ***/
+ setColor("configufation_table_cover_background_color", new RGB(250, 250, 250)); //$NON-NLS-1$
+ setColor("configufation_table_background_color", new RGB(240, 240, 240)); //$NON-NLS-1$
+ setColor("configufation_button_cover_background_color", new RGB(240, 240, 240)); //$NON-NLS-1$
+ setColor("configufation_table_contentsbackground_color", new RGB(206, 206, 206)); //$NON-NLS-1$
+ setColor("configufation_sunken_line_up_color", new RGB(160, 160, 160)); //$NON-NLS-1$
+ setColor("configufation_sunken_line_down_color", new RGB(255, 255, 255)); //$NON-NLS-1$
+ }
+
+ public Color getColor(String colorName, RGB rgb) {
+ if (!colorRegistry.hasValueFor(colorName)) {
+ colorRegistry.put(colorName, rgb);
+ }
+ return colorRegistry.get(colorName);
+ }
+
+ public void setColor(String colorName, RGB rgb) {
+ colorRegistry.put(colorName, rgb);
+ }
+
+ @Override
+ public Color getColor(String colorName) {
+ return colorRegistry.get(colorName);
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.theme;
+
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+
+public class DAThemeWhite extends DATheme {
+ private static DAThemeWhite instance;
+
+ public static DAThemeWhite getInstance() {
+ if (instance == null) {
+ instance = new DAThemeWhite();
+ }
+ return instance;
+ }
+
+ DAThemeWhite() {
+ super();
+ name = "white";
+
+ // defaule
+ setColor("blue", new RGB(0, 102, 134));
+ setColor("green", new RGB(68, 98, 12));
+ setColor("yellow", new RGB(255, 210, 10));
+ setColor("purple", new RGB(139, 42, 118));
+ setColor("brown", new RGB(138, 83, 0));
+ setColor("navy", new RGB(57, 66, 161));
+ setColor("darkviolet", new RGB(105, 2, 126));
+ setColor("maroon", new RGB(126, 41, 2));
+ setColor("teal", new RGB(27, 110, 92));
+ setColor("indigo", new RGB(80, 26, 146));
+ setColor("goldenrod", new RGB(212, 150, 57));
+ setColor("turquoise", new RGB(72, 194, 168));
+ setColor("violet", new RGB(226, 109, 201));
+ setColor("slateblue", new RGB(122, 132, 238));
+ setColor("orange", new RGB(236, 107, 47));
+ setColor("yellowgreen", new RGB(129, 172, 50));
+ setColor("skyblue", new RGB(72, 185, 221));
+ setColor("orchid", new RGB(175, 49, 200));
+ setColor("sandybrown", new RGB(201, 168, 58));
+ setColor("mediumpurple", new RGB(160, 108, 224));
+ setColor("chocolate", new RGB(151, 124, 39));
+ setColor("magneta", new RGB(155, 20, 184));
+
+ // shell window background color
+ setColor("window_bg_color", new RGB(160, 160, 160)); //$NON-NLS-1$
+ setColor("dialg_bg_upper", new RGB(206, 206, 206));
+ setColor("dialg_bg_lower", new RGB(240, 240, 240));
+ setColor("dialg_sunken_1", new RGB(160, 160, 160));
+ setColor("dialg_sunken_2", new RGB(255, 255, 255));
+ setColor("edit_chart_dialog_upper", new RGB(255, 255, 255));
+ setColor("edit_chart_dialog_lower", new RGB(240, 240, 240));
+
+ setColor("view_border", new RGB(206, 206, 206)); //$NON-NLS-1$
+ setColor("view_bg_color", new RGB(230, 230, 230)); //$NON-NLS-1$
+ getColor("view_title_font_color", new RGB(0, 0, 0));
+
+ setColor("coolbar_bg_color", new RGB(228, 228, 228)); //$NON-NLS-1$
+ setColor("default_font_color", new RGB(0, 0, 0));//$NON-NLS-1$
+
+ /** title bar colors **/
+ setColor("titlebar_text_color", new RGB(64, 208, 255)); //$NON-NLS-1$
+ setColor("titlebar_bg", new RGB(78, 79, 81)); //$NON-NLS-1$
+ setColor("titlebar_start_color", new RGB(240, 240, 240)); //$NON-NLS-1$
+ setColor("titlebar_end_color", new RGB(165, 165, 165)); //$NON-NLS-1$
+ setColor("titlebar_bottom_stroke_1", new RGB(115, 115, 115));
+ setColor("titlebar_bottom_stroke_2", new RGB(160, 160, 160));
+
+ /** device and application combo specific colors start **/
+ setColor("device_application_enable_font", new RGB(0, 0, 0)); //$NON-NLS-1$
+ setColor("device_application_disable_font", new RGB(160, 160, 160)); //$NON-NLS-1$
+ setColor("device_application_popup_outer_1", new RGB(120, 120, 120)); //$NON-NLS-1$
+ setColor("device_application_popup_outer_2", new RGB(50, 185, 231)); //$NON-NLS-1$
+ setColor("device_application_item_normal_top", new RGB(255, 255, 255)); //$NON-NLS-1$
+ setColor("device_application_item_normal_inner", new RGB(230, 230, 230)); //$NON-NLS-1$
+ setColor(
+ "device_application_item_normal_bottom", new RGB(189, 189, 189)); //$NON-NLS-1$
+ setColor("device_application_item_select_top", new RGB(255, 255, 255)); //$NON-NLS-1$
+ setColor("device_application_item_select_inner", new RGB(50, 185, 231)); //$NON-NLS-1$
+ setColor(
+ "device_application_item_select_bottom", new RGB(189, 189, 189)); //$NON-NLS-1$
+ /** device and application combo specific colors end **/
+
+ /*** combo button gradation ***/
+ setColor(
+ "device_application_button_normal_start", new RGB(221, 221, 221)); //$NON-NLS-1$
+ setColor("device_application_button_normal_end", new RGB(157, 157, 157)); //$NON-NLS-1$
+ setColor("device_application_button_push_start", new RGB(24, 147, 189)); //$NON-NLS-1$
+ setColor("device_application_button_push_end", new RGB(24, 147, 189)); //$NON-NLS-1$
+ setColor("device_application_button_hover_start", new RGB(50, 185, 231)); //$NON-NLS-1$
+ setColor("device_application_button_hover_end", new RGB(50, 185, 231)); //$NON-NLS-1$
+ setColor(
+ "device_application_button_disable_start", new RGB(157, 157, 157)); //$NON-NLS-1$
+ setColor("device_application_button_disable_end", new RGB(78, 79, 81)); //$NON-NLS-1$
+ setColor("device_application_button_outline", new RGB(31, 31, 31));
+
+ /*** common button colors ***/
+ setColor("button_normal_color_start", new RGB(240, 240, 240));
+ setColor("button_normal_color_end", new RGB(163, 163, 163));
+ setColor("button_push_color_start", new RGB(163, 163, 163));
+ setColor("button_push_color_end", new RGB(240, 240, 240));
+ setColor("button_hover_color_start", new RGB(240, 240, 240));
+ setColor("button_hover_color_end", new RGB(163, 163, 163));
+ setColor("button_disable_color_start", new RGB(206, 206, 206));
+ setColor("button_disable_color_end", new RGB(163, 163, 163));
+
+ setColor("button_outline_normal_in_color", new RGB(120, 120, 120));
+ setColor("button_outline_push_in_color", new RGB(120, 120, 120));
+ setColor("button_outline_hover_in_color", new RGB(120, 120, 120));
+ setColor("button_outline_disable_in_color", new RGB(115, 115, 115));
+
+ setColor("button_outline_normal_color", new RGB(203, 230, 230));
+ setColor("button_outline_push_color", new RGB(203, 203, 203));
+ setColor("button_outline_hover_color", new RGB(50, 185, 231));
+ setColor("button_outline_disable_color", new RGB(115, 115, 115));
+
+ setColor("button_normal_font_color", new RGB(0, 0, 0));
+ setColor("button_push_font_color", new RGB(91, 91, 91));
+ setColor("button_hover_font_color", new RGB(91, 91, 91));
+ setColor("button_disable_font_color", new RGB(91, 91, 91));
+
+ /** normal view layout colors start **/
+ setColor("normal_view_layout_outer", new RGB(160, 160, 160)); //$NON-NLS-1$
+ setColor("normal_view_layout_middle", new RGB(74, 74, 74)); //$NON-NLS-1$
+ setColor("normal_view_layout_inner", new RGB(66, 66, 68)); //$NON-NLS-1$
+ /** normal view layout colors end **/
+
+ /** current view colors start **/
+ setColor("current_view_outline", new RGB(160, 160, 160)); //$NON-NLS-1$
+
+ setColor("current_view_table_title_bg", new RGB(59, 59, 60)); //$NON-NLS-1$
+ setColor("current_view_table_title_text", new RGB(151, 230, 255)); //$NON-NLS-1$
+ setColor("current_view_table_contents_bg", new RGB(84, 85, 86)); //$NON-NLS-1$
+ setColor("current_view_table_contents_text", new RGB(216, 216, 216)); //$NON-NLS-1$
+ setColor("current_view_table_line", new RGB(136, 137, 138)); //$NON-NLS-1$
+
+ setColor("current_view_cpu_text", new RGB(2, 171, 208)); //$NON-NLS-1$
+ setColor("current_view_process_text", new RGB(114, 203, 8)); //$NON-NLS-1$
+ setColor("current_view_graph_bg", new RGB(79, 79, 81)); //$NON-NLS-1$
+ setColor("current_view_graph_outline", new RGB(43, 44, 45)); //$NON-NLS-1$
+ setColor("current_view_snapshot_outline", new RGB(49, 104, 127)); //$NON-NLS-1$
+
+ setColor("current_view_lock_text", new RGB(188, 55, 38)); //$NON-NLS-1$
+ /** current view colors end **/
+
+ /** common table colors start **/
+ setColor("table_header_bg", new RGB(247, 247, 247)); //$NON-NLS-1$
+ setColor("table_line", new RGB(186, 186, 186)); //$NON-NLS-1$
+ setColor("table_contents_normal", new RGB(255, 255, 255)); //$NON-NLS-1$
+ setColor("table_contents_hover", new RGB(236, 235, 248)); //$NON-NLS-1$
+ setColor("table_contents_selected_start", new RGB(0, 146, 193)); //$NON-NLS-1$
+ setColor("table_contents_selected_end", new RGB(0, 60, 79)); //$NON-NLS-1$
+ setColor("table_contents_selected_font_color", new RGB(216, 216, 216)); //$NON-NLS-1$
+ setColor("table_title_font_color", new RGB(0, 45, 96)); //$NON-NLS-1$
+ setColor("table_contents_font_color", new RGB(70, 70, 70)); //$NON-NLS-1$
+ /** common table colors end **/
+
+ /** range color **/
+ setColor("table_range_color_range", new RGB(255, 246, 169)); //$NON-NLS-1$
+ setColor("table_range_color_second_selection", new RGB(170, 225, 248)); //$NON-NLS-1$
+ setColor("table_range_color_range_second", new RGB(154, 205, 60)); //$NON-NLS-1$
+ /** renge color end **/
+
+ /** open trace popup colors **/
+ setColor("open_trace_label_color", new RGB(0, 0, 0));
+ setColor("open_trace_save_contents_color", new RGB(70, 70, 70));
+ setColor("open_trace_temp_contents_color", new RGB(255, 87, 57));
+ setColor("open_trace_table_outline_color", new RGB(186, 186, 186));
+
+ setColor("open_trace_table_content_normal_color1", new RGB(255, 255,
+ 255));
+ setColor("open_trace_table_content_hover_color1",
+ new RGB(236, 235, 248));
+ setColor("open_trace_table_content_selected_start_color1", new RGB(227,
+ 248, 255));
+ setColor("open_trace_table_content_selected_end_color1", new RGB(162,
+ 231, 255));
+
+ setColor("open_trace_table_content_normal_color2", new RGB(234, 234,
+ 234));
+ setColor("open_trace_table_content_hover_color2",
+ new RGB(236, 236, 236));
+ setColor("open_trace_table_content_selected_start_color2", new RGB(227,
+ 248, 255));
+ setColor("open_trace_table_content_selected_end_color2", new RGB(162,
+ 231, 255));
+
+ setColor("open_trace_button_composite_bg_color", new RGB(240, 240, 240));
+
+ setColor("open_trace_popup_contents_bg_color", new RGB(51, 52, 53)); //$NON-NLS-1$
+ setColor("open_trace_popup_bottom_bg_color", new RGB(39, 39, 40)); //$NON-NLS-1$
+
+ setColor("open_trace_table_line1_normal", new RGB(78, 78, 79)); //$NON-NLS-1$
+ setColor("open_trace_table_line1_hover", new RGB(72, 98, 108)); //$NON-NLS-1$
+ setColor("open_trace_table_line_selected_start", new RGB(0, 146, 193)); //$NON-NLS-1$
+ setColor("open_trace_table_line_selected_end", new RGB(0, 60, 79)); //$NON-NLS-1$
+
+ setColor("open_trace_table_line2_normal", new RGB(84, 85, 86)); //$NON-NLS-1$
+ setColor("open_trace_table_line2_hover", new RGB(72, 98, 108)); //$NON-NLS-1$
+
+ setColor("open_trace_table2_font_color", new RGB(255, 85, 57)); //$NON-NLS-1$
+
+ /** tab widget colors **/
+ setColor("tab_selected_color_start", new RGB(255, 255, 255));
+ setColor("tab_selected_color_end", new RGB(178, 178, 178));
+ setColor("tab_normal_color_start", new RGB(206, 206, 206));
+ setColor("tab_normal_color_end", new RGB(163, 163, 163));
+ setColor("tab_hover_color_start", new RGB(206, 206, 206));
+ setColor("tab_hover_color_end", new RGB(163, 163, 163));
+ setColor("tab_push_color_start", new RGB(163, 163, 163));
+ setColor("tab_push_color_end", new RGB(206, 206, 206));
+
+ setColor("tab_outline_normal_color", new RGB(115, 115, 115));
+ setColor("tab_outline_push_color", new RGB(10, 113, 178));
+ setColor("tab_outline_hover_color", new RGB(10, 113, 178));
+ setColor("tab_outline_selected_color", new RGB(160, 160, 160));
+
+ setColor("tab_selected_font_color", new RGB(0, 0, 0));
+ setColor("tab_normal_font_color", new RGB(91, 91, 91));
+ setColor("tab_hover_font_color", new RGB(91, 91, 91));
+ setColor("tab_push_font_color", new RGB(91, 91, 91));
+
+ setColor("tab_bg_color_start", new RGB(205, 205, 205));
+ setColor("tab_bg_color_end", new RGB(216, 216, 216));
+ setColor("tab_bg_outline_color", new RGB(160, 160, 160));
+
+ /** Page chart colors **/
+ setColor("page_chart_header_bg", new RGB(45, 45, 46)); //$NON-NLS-1$
+ setColor("page_chart_selection_bg", new RGB(0, 151, 201)); //$NON-NLS-1$
+ setColor("page_chart_parent_bg", new RGB(84, 85, 86)); //$NON-NLS-1$
+ setColor("page_chart_child_bg", new RGB(59, 59, 60)); //$NON-NLS-1$
+ setColor("page_open_start_run", new RGB(244, 252, 82)); //$NON-NLS-1$
+ setColor("page_open_end_run", new RGB(235, 231, 56)); //$NON-NLS-1$
+ setColor("page_open_start_stop", new RGB(255, 135, 82)); //$NON-NLS-1$
+ setColor("page_open_end_stop", new RGB(232, 73, 73)); //$NON-NLS-1$
+ setColor("page_closed_start", new RGB(168, 198, 71)); //$NON-NLS-1$
+ setColor("page_closed_end", new RGB(130, 152, 54)); //$NON-NLS-1$
+ setColor("page_use_start", new RGB(78, 176, 255)); //$NON-NLS-1$
+ setColor("page_use_end", new RGB(44, 104, 153)); //$NON-NLS-1$
+
+ /** Thread chart colors **/
+ setColor("thread_open_start_run", new RGB(244, 252, 82)); //$NON-NLS-1$
+ setColor("thread_open_end_run", new RGB(235, 231, 56)); //$NON-NLS-1$
+ setColor("thread_open_start_stop", new RGB(168, 198, 71)); //$NON-NLS-1$
+ setColor("thread_open_end_stop", new RGB(130, 152, 54)); //$NON-NLS-1$
+ setColor("thread_closed_start", new RGB(168, 198, 71)); //$NON-NLS-1$
+ setColor("thread_closed_end", new RGB(130, 152, 54)); //$NON-NLS-1$
+ setColor("thread_sleep_start", new RGB(215, 215, 215)); //$NON-NLS-1$
+ setColor("thread_sleep_end", new RGB(157, 166, 168)); //$NON-NLS-1$
+
+ /** File chart colors **/
+
+ setColor("file_api_used", new RGB(15, 153, 232)); //$NON-NLS-1$
+ setColor("file_api_failed", new RGB(226, 65, 73)); //$NON-NLS-1$
+ setColor("file_area_used_start", new RGB(255, 222, 125)); //$NON-NLS-1$
+ setColor("file_area_used_end", new RGB(255, 186, 29)); //$NON-NLS-1$
+ setColor("file_area_closed_start", new RGB(168, 198, 71)); //$NON-NLS-1$
+ setColor("file_area_closed_end", new RGB(130, 152, 54)); //$NON-NLS-1$
+ setColor("file_not_access_start", new RGB(178, 178, 178)); //$NON-NLS-1$
+ setColor("file_not_access_end", new RGB(106, 106, 106)); //$NON-NLS-1$
+ setColor("file_access_read", new RGB(64, 126, 18)); //$NON-NLS-1$
+ setColor("file_access_write", new RGB(147, 21, 173)); //$NON-NLS-1$
+
+
+
+ setColor("unselected_tab_first", new RGB(51, 51, 51)); //$NON-NLS-1$
+ setColor("unselected_tab_second", new RGB(42, 42, 42)); //$NON-NLS-1$
+ setColor("selected_tab_first", new RGB(74, 74, 74)); //$NON-NLS-1$
+ setColor("selected_tab_second", new RGB(128, 129, 130)); //$NON-NLS-1$
+
+ setColor("tooltip", new RGB(255, 255, 225)); //$NON-NLS-1$
+
+ setColor("barGRAY1", new RGB(177, 177, 177)); //$NON-NLS-1$
+ setColor("barGRAY2", new RGB(153, 153, 153)); //$NON-NLS-1$
+ setColor("barGRAY3", new RGB(216, 216, 216)); //$NON-NLS-1$
+
+ /* Timeline */
+ setColor("item blue right", new RGB(131, 196, 218));//$NON-NLS-1$
+ setColor("item blue dark", new RGB(38, 104, 138));//$NON-NLS-1$
+ setColor("item background", new RGB(50, 50, 50));//$NON-NLS-1$
+ setColor("item_bg_top", new RGB(215, 215, 215)); //$NON-NLS-1$
+ setColor("item_bg_bottom", new RGB(157, 166, 168)); //$NON-NLS-1$
+
+ setColor("snapshot_chart_bg", new RGB(50, 50, 50)); //$NON-NLS-1$
+
+ setColor("GRAY_130", new RGB(130, 130, 130)); //$NON-NLS-1$
+ setColor("GRAY_170", new RGB(170, 170, 170)); //$NON-NLS-1$
+ setColor("GRAY_210", new RGB(210, 210, 210)); //$NON-NLS-1$
+
+ setColor("defaultForeground", new RGB(0, 0, 0)); //$NON-NLS-1$
+ setColor("defaultBackground", new RGB(255, 255, 255)); //$NON-NLS-1$
+ setColor("defaultRed", new RGB(173, 13, 1)); //$NON-NLS-1$
+ setColor("time_tick_bg", new RGB(247, 247, 247)); //$NON-NLS-1$
+ setColor("time_tick_line", new RGB(159, 159, 159)); //$NON-NLS-1$
+
+ setColor("lifecycle_initializing_top", new RGB(123, 182, 240)); //$NON-NLS-1$
+ setColor("lifecycle_initializing_bottom", new RGB(65, 141, 218)); //$NON-NLS-1$
+ setColor("lifecycle_running_top", new RGB(194, 238, 131)); //$NON-NLS-1$
+ setColor("lifecycle_running_bottom", new RGB(143, 198, 63)); //$NON-NLS-1$
+ setColor("lifecycle_pausing_top", new RGB(170, 170, 170)); //$NON-NLS-1$
+ setColor("lifecycle_pausing_bottom", new RGB(113, 113, 113)); //$NON-NLS-1$
+ setColor("lifecycle_terminating_top", new RGB(223, 143, 140)); //$NON-NLS-1$
+ setColor("lifecycle_terminating_bottom", new RGB(198, 82, 77)); //$NON-NLS-1$
+
+ setColor("lifecycle_initializing_top", new RGB(123, 182, 240)); //$NON-NLS-1$
+ setColor("lifecycle_initializing_bottom", new RGB(65, 141, 218)); //$NON-NLS-1$
+ setColor("lifecycle_running_top", new RGB(194, 238, 131)); //$NON-NLS-1$
+ setColor("lifecycle_running_bottom", new RGB(143, 198, 63)); //$NON-NLS-1$
+ setColor("lifecycle_pausing_top", new RGB(170, 170, 170)); //$NON-NLS-1$
+ setColor("lifecycle_pausing_bottom", new RGB(113, 113, 113)); //$NON-NLS-1$
+ setColor("lifecycle_terminating_top", new RGB(223, 143, 140)); //$NON-NLS-1$
+ setColor("lifecycle_terminating_bottom", new RGB(198, 82, 77)); //$NON-NLS-1$
+
+ // bar graph
+ setColor("cpu_bar_graph_color", new RGB(0, 122, 167)); //$NON-NLS-1$
+ setColor("cpu_bar_graph_gray_color", new RGB(222, 222, 222));
+ setColor("cpu_bar_graph_bg_color", new RGB(255, 255, 255));
+
+ setColor("process_bar_graph_color", new RGB(119, 163, 0)); //$NON-NLS-1$
+ setColor("process_bar_graph_center_color", new RGB(255, 255, 255)); //$NON-NLS-1$
+ setColor("process_bar_graph_bg_color", new RGB(193, 193, 193)); //$NON-NLS-1$
+
+ setColor("profiling_graph_color_start", new RGB(145, 190, 3)); //$NON-NLS-1$
+ setColor("profiling_graph_color_end", new RGB(114, 149, 1)); //$NON-NLS-1$
+
+ setColor("profiling_graph_selection_color_start", new RGB(255, 135, 82)); //$NON-NLS-1$
+ setColor("profiling_graph_selection_color_end", new RGB(232, 73, 73)); //$NON-NLS-1$
+
+ // Add Chart
+ setColor("add_chart_enable_color_start", new RGB(166, 232, 255)); //$NON-NLS-1$
+ setColor("add_chart_enable_color_end", new RGB(50, 185, 231)); //$NON-NLS-1$
+ setColor("add_chart_disable_color_start", new RGB(225, 225, 225)); //$NON-NLS-1$
+ setColor("add_chart_disable_color_end", new RGB(225, 225, 225)); //$NON-NLS-1$
+
+ /** Timeline chart **/
+ setColor("seriesColorCPUSystem", new RGB(111, 151, 39)); //$NON-NLS-1$
+ setColor("seriesColorCPUApp", new RGB(72, 185, 221)); //$NON-NLS-1$
+
+ setColor("seriesColorCPUCoreCore0", new RGB(17, 105, 192)); //$NON-NLS-1$
+ setColor("seriesColorCPUCoreCore1", new RGB(111, 151, 39)); //$NON-NLS-1$
+ setColor("seriesColorCPUCoreCore2", new RGB(187, 60, 159)); //$NON-NLS-1$
+ setColor("seriesColorCPUCoreCore3", new RGB(51, 160, 137)); //$NON-NLS-1$
+
+ setColor("seriesColorCPUFreq", new RGB(197, 124, 15)); //$NON-NLS-1$
+
+ setColor("seriesColorHeapSystem", new RGB(72, 185, 221)); //$NON-NLS-1$
+ setColor("seriesColorHeapApp", new RGB(70, 82, 207)); //$NON-NLS-1$
+
+ setColor("seriesColorProcessVSS", new RGB(72, 185, 221)); //$NON-NLS-1$
+ setColor("seriesColorProcessRSS", new RGB(111, 151, 39)); //$NON-NLS-1$
+ setColor("seriesColorProcessPSS", new RGB(201, 168, 58)); //$NON-NLS-1$
+
+ setColor("seriesColorMemorySysMax", new RGB(72, 185, 221)); //$NON-NLS-1$
+ setColor("seriesColorMemorySysUsed", new RGB(155, 20, 184)); //$NON-NLS-1$
+ setColor("seriesColorMemoryAppUsed", new RGB(111, 151, 39)); //$NON-NLS-1$
+
+ setColor("seriesColorFileRead", new RGB(226, 109, 201)); //$NON-NLS-1$
+ setColor("seriesColorFileWrite", new RGB(72, 185, 221)); //$NON-NLS-1$
+ setColor("seriesColorFileFD", new RGB(111, 151, 39)); //$NON-NLS-1$
+
+ setColor("seriesColorUIEventKey", new RGB(122, 132, 238)); //$NON-NLS-1$
+ setColor("seriesColorUIEventTouch", new RGB(129, 172, 50)); //$NON-NLS-1$
+ setColor("seriesColorUIEventGesture", new RGB(236, 107, 47)); //$NON-NLS-1$
+ setColor("seriesColorUIEventOrientation", new RGB(177, 202, 229)); //$NON-NLS-1$
+ setColor("seriesColorUIEventFramework", new RGB(212, 150, 57)); //$NON-NLS-1$
+
+ setColor("selectionRange", new RGB(23, 98, 132)); //$NON-NLS-1$
+ setColor("selectionLine", new RGB(23, 98, 132)); //$NON-NLS-1$
+
+ /*** scale ***/
+ setColor("scale_outline_color", new RGB(150, 150, 150)); //$NON-NLS-1$
+ setColor("scale_bg_color_start", new RGB(253, 253, 253)); //$NON-NLS-1$
+ setColor("scale_bg_color_end", new RGB(186, 186, 186)); //$NON-NLS-1$
+ setColor("scale_area_color", new RGB(103, 103, 103)); //$NON-NLS-1$
+ setColor("scale_area_outline_color", new RGB(250, 250, 250)); //$NON-NLS-1$
+
+ /*** stop progress dialog ***/
+ setColor("stop_progress_line1_color", new RGB(2, 171, 208)); //$NON-NLS-1$
+ setColor("stop_progress_line2_color", new RGB(86, 86, 86)); //$NON-NLS-1$
+ setColor("stop_progress_background_color", new RGB(230, 230, 230)); //$NON-NLS-1$
+ setColor("stop_progress_info_font_color", new RGB(70, 70, 70)); //$NON-NLS-1$
+ setColor("stop_progress_bar_start_color", new RGB(0, 181, 222)); //$NON-NLS-1$
+ setColor("stop_progress_bar_end_color", new RGB(4, 108, 143)); //$NON-NLS-1$
+ setColor("stop_progress_bar_bg_start_color", new RGB(204, 204, 204)); //$NON-NLS-1$
+ setColor("stop_progress_bar_bg_end_color", new RGB(212, 212, 212)); //$NON-NLS-1$
+ setColor("stop_progress_bar_outline_color", new RGB(150, 150, 150)); //$NON-NLS-1$
+
+ /*** thread graph ***/
+ setColor("thread_graph_cpu_load_color", new RGB(0, 123, 169)); //$NON-NLS-1$
+ setColor("thread_graph_callee_color", new RGB(100, 21, 232)); //$NON-NLS-1$
+ setColor("thread_graph_lock_new_color", new RGB(129, 169, 0)); //$NON-NLS-1$
+ setColor("thread_graph_lock_wait_color", new RGB(96, 126, 131)); //$NON-NLS-1$
+ setColor("thread_graph_lock_acquire_color", new RGB(227, 123, 30)); //$NON-NLS-1$
+ setColor("thread_graph_lock_release_color", new RGB(255, 255, 255)); //$NON-NLS-1$
+
+ setColor("snapshot_viewer_bg_color", new RGB(255, 255, 255)); //$NON-NLS-1$
+ setColor("checkbox_disabled_font_color", new RGB(135, 135, 135)); //$NON-NLS-1$
+
+ /*** configuration ***/
+ setColor("configufation_table_cover_background_color", new RGB(206, 206, 206)); //$NON-NLS-1$
+ setColor("configufation_table_background_color", new RGB(250, 250, 250)); //$NON-NLS-1$
+ setColor("configufation_button_cover_background_color", new RGB(240, 240, 240)); //$NON-NLS-1$
+ setColor("configufation_table_contentsbackground_color", new RGB(206, 206, 206)); //$NON-NLS-1$
+ setColor("configufation_sunken_line_up_color", new RGB(160, 160, 160)); //$NON-NLS-1$
+ setColor("configufation_sunken_line_down_color", new RGB(255, 255, 255)); //$NON-NLS-1$
+ }
+
+ public Color getColor(String colorName, RGB rgb) {
+ if (!colorRegistry.hasValueFor(colorName)) {
+ colorRegistry.put(colorName, rgb);
+ }
+ return colorRegistry.get(colorName);
+ }
+
+ public void setColor(String colorName, RGB rgb) {
+ colorRegistry.put(colorName, rgb);
+ }
+
+ @Override
+ public Color getColor(String colorName) {
+ return colorRegistry.get(colorName);
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.file;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.error.ErrorCodeManager;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.model.TableInput;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DAApiListTableComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
+import org.tizen.dynamicanalyzer.utils.Formatter;
+
+public class FileApiListTable extends DAApiListTableComposite {
+ public FileApiListTable(Composite parent, int compStyle, int tableStyle) {
+ super(parent, compStyle, tableStyle);
+ table.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+
+ GridItem[] items = table.getSelection();
+ if (null == items) {
+ return;
+ }
+ long startTime = 0;
+ long endTime = 0;
+
+ DATableDataFormat dataFormat;
+ String time;
+ for (int i = 0; i < items.length; i++) {
+ dataFormat = (DATableDataFormat) items[i].getData();
+ time = dataFormat.getData().get(
+ LogCenterConstants.TIME_INDEX);
+ long itemTime = Long.parseLong(time);
+ if (0 == startTime) {
+ startTime = itemTime;
+ }
+ if (startTime > itemTime) {
+ startTime = itemTime;
+ }
+ if (endTime < itemTime) {
+ endTime = itemTime;
+ }
+ }
+
+ DASelectionData selData = new DASelectionData(
+ FileApiListView.ID, startTime, endTime, items, table);
+ AnalyzerManager.getCurrentPage().updatePage(selData);
+ AnalyzerManager.getCurrentPage().controlSelection(
+ FileApiListView.ID);
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // TODO Auto-generated method stub
+ }
+ });
+ }
+
+ @Override
+ protected List<TableInput> makeTableInput() {
+ FileApiListView view = (FileApiListView) AnalyzerManager
+ .getCurrentPage().getViewMap().get(FileApiListView.ID);
+ if (!(view instanceof FileApiListView)) {
+ return null;
+ }
+ FileChartData data = view.getPageData();
+ if (null == data) {
+ return null;
+ }
+
+ long rangeStartTime = view.getRangeStartTime();
+ long rangeEndTime = view.getRangeEndTime();
+
+ List<TableInput> input = new ArrayList<TableInput>();
+ List<FileChartDataEvent> contents = data.getContents();
+ FileChartDataEvent content;
+ for (int i = 0; i < contents.size(); i++) {
+ content = contents.get(i);
+ List<String> contentTemp = content.getContents();
+ List<String> contentText = new ArrayList<String>();
+
+ String seq = contentTemp
+ .get(LogCenterConstants.SEQUENCE_NUMBER_INDEX);
+ contentText.add(0, seq);
+ contentText.add(Formatter.toTimeFormat(contentTemp
+ .get(LogCenterConstants.TIME_INDEX)));
+ contentText.add(contentTemp.get(LogCenterConstants.APINAME_INDEX));
+ contentText
+ .add(contentTemp.get(LogCenterConstants.INPUTPARM_INDEX));
+ contentText
+ .add(contentTemp.get(LogCenterConstants.THREAD_ID_INDEX));
+ contentText.add(contentTemp.get(LogCenterConstants.RETURN_INDEX));
+ String errMsg = ErrorCodeManager.getInatance().getErrorCode(
+ contentTemp.get(LogCenterConstants.ERROR_INDEX));
+ if (null == errMsg) {
+ errMsg = "undefined error code"; //$NON-NLS-1$
+ }
+ contentText.add(errMsg);
+ contentText.add(contentTemp
+ .get(LogCenterConstants.RESOURCE_FILE_SIZE_INDEX));
+
+ DATableDataFormat tableData = new DATableDataFormat(
+ contentTemp.get(LogCenterConstants.SEQUENCE_NUMBER_INDEX));
+ tableData.getData().addAll(contentTemp);
+ TableInput tableInput = new TableInput();
+ tableInput.setText(contentText);
+ tableInput.setData(tableData);
+ input.add(tableInput);
+
+ long time = Long.parseLong(contentTemp
+ .get(LogCenterConstants.TIME_INDEX));
+ if (time >= rangeStartTime && time <= rangeEndTime) {
+ tableInput.setInRange(true);
+ }
+ }
+
+ return input;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.file;
+
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.model.DAView;
+import org.tizen.dynamicanalyzer.nl.FilePageLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
+import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
+
+public class FileApiListView extends DAView {
+
+ public static final String ID = FileApiListView.class.getName();
+ private FileChartData data;
+ private long rangeStartTime = 0;
+ private long rangeEndTime = 0;
+ private long selectionStartTime = 0;
+ private long selectionEndTime = 0;
+ int[] innerMaxWeight = { 0, 100 };
+ int[] outerMaxWeight = { 100, 0 };
+
+ private String[] columnNames = { FilePageLabels.FILE_API_LIST_VIEW_INDEX,
+ FilePageLabels.FILE_API_LIST_VIEW_TIME,
+ FilePageLabels.FILE_API_LIST_VIEW_API,
+ FilePageLabels.FILE_API_LIST_VIEW_PARAMETER,
+ FilePageLabels.FILE_API_LIST_VIEW_THREAD_ID,
+ FilePageLabels.FILE_API_LIST_VIEW_RETURN,
+ FilePageLabels.FILE_API_LIST_VIEW_ERRNO };
+
+ private int[] columnSizes = { 35, 70, 120, 250, 0, 100, 100 };
+
+ int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NUM,
+ AnalyzerConstants.SORT_TYPE_NUM,
+ AnalyzerConstants.SORT_TYPE_STRING,
+ AnalyzerConstants.SORT_TYPE_STRING,
+ AnalyzerConstants.SORT_TYPE_NUM,
+ AnalyzerConstants.SORT_TYPE_STRING,
+ AnalyzerConstants.SORT_TYPE_STRING };
+
+ int[] sourceColumns = { LogCenterConstants.SEQUENCE_NUMBER_INDEX,
+ LogCenterConstants.TIME_INDEX, LogCenterConstants.APINAME_INDEX,
+ LogCenterConstants.INPUTPARM_INDEX,
+ LogCenterConstants.THREAD_ID_INDEX,
+ LogCenterConstants.RETURN_INDEX, LogCenterConstants.ERROR_INDEX };
+
+ FileApiListTable tableComp = null;
+
+ public FileApiListView(Composite parent, int style) {
+ super(parent, style);
+ this.setLayout(new FillLayout());
+
+ ViewContainer viewContainer = new ViewContainer(this, true);
+ viewContainer.setTitleText(FilePageLabels.FILE_API_LIST_VIEW_TITLE);
+ setMaxWeight(innerMaxWeight, outerMaxWeight);
+
+ Composite contents = viewContainer.getContentArea();
+ contents.setBackground(ColorResources.WINDOW_BG_COLOR);
+ contents.setLayout(new FillLayout());
+ tableComp = new FileApiListTable(contents, SWT.NONE, SWT.MULTI
+ | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
+ tableComp.setComparator(new DefaultTableComparator());
+ tableComp.setSortTypes(sortTypes);
+ tableComp.setSourceColumns(sourceColumns);
+ tableComp.setColumns(columnNames);
+ tableComp.setColumnSize(columnSizes);
+ tableComp.setTableName(FilePageLabels.FILE_API_LIST_VIEW_TITLE);
+ contents.addControlListener(new TableColumnSizePackListener(tableComp,
+ columnSizes));
+ }
+
+ @Override
+ public void updateView() {
+ if (null == data) {
+ return;
+ }
+
+ long newRangeStartTime = 0;
+ long newRangeEndTime = 0;
+
+ if (RangeDataManager.getInstance().isBeingAnalyzed()) {
+ newRangeStartTime = RangeDataManager.getInstance().getStartTime();
+ newRangeEndTime = RangeDataManager.getInstance().getEndTime();
+ } else {
+ newRangeStartTime = 0;
+ newRangeEndTime = 0;
+ }
+
+ if (newRangeStartTime != rangeStartTime
+ || newRangeEndTime != rangeEndTime) {
+ rangeStartTime = newRangeStartTime;
+ rangeEndTime = newRangeEndTime;
+ tableComp.updateTable();
+ return;
+ }
+
+ if (data.getContents().size() != tableComp.getTable().getItemCount()) {
+ tableComp.updateTable();
+ }
+
+ }
+
+ @Override
+ public void updateView(DASelectionData data) {
+ FileChartData pageData = (FileChartData) data.getData();
+
+ if (!(pageData instanceof FileChartData)) {
+ selectionStartTime = data.getStartTime();
+ selectionEndTime = data.getEndTime();
+ } else {
+ this.data = pageData;
+ }
+ tableComp.getTable().removeAll();
+ tableComp.updateTable();
+ tableComp.setSelectionByTime(selectionStartTime, selectionEndTime);
+
+ }
+
+ @Override
+ public void setSelection(List<String> data) {
+ if (null == data || data.isEmpty()) {
+ return;
+ }
+ String seq = data.get(LogCenterConstants.SEQUENCE_NUMBER_INDEX);
+ tableComp.updateTable();
+ int nSize = tableComp.getTable().getItemCount();
+ for (int ii = 0; ii < nSize; ii++) {
+ if (tableComp.getTable().getItem(ii).getText(0).equals(seq)) {
+ tableComp.getTable().setSelection(ii);
+ tableComp
+ .getTable()
+ .getVerticalBar()
+ .setSelection(
+ getScrollSelectionIndex(tableComp.getTable(),
+ ii));
+ tableComp.updateTable();
+ }
+ }
+ String logTime = data.get(LogCenterConstants.TIME_INDEX);
+ long selectedTime = Long.parseLong(logTime);
+ DASelectionData selData = new DASelectionData(FileApiListView.ID,
+ selectedTime, selectedTime,
+ tableComp.getTable().getSelection(), tableComp.getTable());
+ AnalyzerManager.getCurrentPage().updatePage(selData);
+ }
+
+ private int getScrollSelectionIndex(Grid table, int selection) {
+ int size = table.getVerticalBar().getThumb() / 2;
+ int output = selection - size;
+ output = (output < 0) ? 0 : output;
+ return output;
+ }
+
+ @Override
+ public Control getControl() {
+ return tableComp;
+ }
+
+ @Override
+ public void clear() {
+ tableComp.getTable().removeAll();
+ data = null;
+ }
+
+ public FileChartData getPageData() {
+ return data;
+ }
+
+ public long getRangeStartTime() {
+ return rangeStartTime;
+ }
+
+ public long getRangeEndTime() {
+ return rangeEndTime;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.file;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.nl.FilePageLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
+import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
+
+public class FileChartData {
+ private List<FileChartData> children = new ArrayList<FileChartData>();
+ private DAChartSeries apiSeries;
+ private DAChartSeries statueSeries;
+
+ private String fd = AnalyzerLabels.EMPTY_STRING;
+ private String filePath = AnalyzerLabels.EMPTY_STRING;
+ private boolean isClosedFile = true;
+ private boolean isFailedAPI = false;
+ // for Detail View Data
+ private List<FailedData> failedData = null;
+ private long fileSize = 0;
+ private long readSize = 0;
+ private long writeSize = 0;
+ private double fileOpendTime = 0;
+ private double fileClosedTime = 0;
+ private double fileLastUsedTime = 0;
+ private double fileTotalUsedTime = 0;
+
+ protected DAChartBoardItem item;
+ protected List<FileChartDataEvent> contents = new ArrayList<FileChartDataEvent>();
+ protected List<FileChartDataEvent> contentsQueue = new ArrayList<FileChartDataEvent>();
+
+ protected DAChart chart;
+ protected boolean hasUpdate = false;
+
+ public FileChartData(String filePath, String Fd, boolean isRoot) {
+ setFilePath(filePath);
+ setFD(Fd);
+ }
+
+ public void pushChild(FileChartData data) {
+ children.add(data);
+ hasUpdate = true;
+ }
+
+ public DAChartBoardItem getItem() {
+ return item;
+ }
+
+ public DAChart getChart() {
+ return chart;
+ }
+
+ public void setChart(DAChart chart) {
+ this.chart = chart;
+ }
+
+ public void pushEvent(FileChartDataEvent event) {
+ contentsQueue.add(event);
+ makeDetailViewData(event);
+ hasUpdate = true;
+ }
+
+ public void makeDetailViewData(FileChartDataEvent event) {
+ setFileSize(event.getFileSize());
+ setReadSize(event.getReadSize());
+ setWriteSize(event.getWriteSize());
+ if (event.getFailedData() != null) {
+ getFailedData().add(event.getFailedData());
+ }
+ }
+
+ public List<FailedData> getFailedData() {
+ if (null == failedData) {
+ failedData = new ArrayList<FailedData>();
+ }
+ return failedData;
+ }
+
+ public List<String> getFailedRelations() {
+ List<String> output = new ArrayList<String>();
+ int size = getFailedData().size();
+ for (int i = 0; i < size; i++) {
+ FailedData ffd = failedData.get(i);
+ String seq = ffd
+ .getLogData(LogCenterConstants.SEQUENCE_NUMBER_INDEX);
+ output.add(seq);
+ }
+ return output;
+ }
+
+ public void setHasUpdate() {
+ hasUpdate = true;
+ }
+
+ public List<FileChartDataEvent> getContents() {
+ return contents;
+ }
+
+ public int getChildCount() {
+ return children.size();
+ }
+
+ public List<FileChartData> getChild() {
+ return children;
+ }
+
+ public String getFD() {
+ return fd;
+ }
+
+ public void setFD(String data) {
+ this.fd = data;
+ }
+
+ public void setClosed(boolean data) {
+ this.isClosedFile = data;
+ }
+
+ public boolean isClosed(FileChartDataEvent event) {
+ if (event == null) {
+ return this.isClosedFile;
+ }
+ if (isParent()) {
+ this.isClosedFile = true;
+ for (int i = 0; i < children.size(); i++) {
+
+ double fileOpendTime = children.get(i).getFileOpendTime();
+ double fileClosedTime = children.get(i).getFileClosedTime();
+ if (event.getApiChartTime() == fileOpendTime) {
+ this.isClosedFile = true;
+ break;
+ }
+ if (event.getApiChartTime() < fileOpendTime) {
+ continue;
+ }
+ if ((event.getApiChartTime() > fileClosedTime)
+ && (fileClosedTime != 0)) {
+ continue;
+ }
+ if (fileClosedTime == 0) {
+ if (!children.get(i).isClosed(null)) {
+ this.isClosedFile = false;
+ break;
+ }
+ }
+ if (fileOpendTime < event.getApiChartTime()
+ && event.getApiChartTime() < fileClosedTime) {
+ this.isClosedFile = false;
+ break;
+ }
+ }
+ return this.isClosedFile;
+ }
+ return this.isClosedFile;
+ }
+
+ public boolean isFileOpenFailed() {
+ return isFailedAPI;
+ }
+
+ public void setFileOpenFailed(boolean data) {
+ this.isFailedAPI = data;
+ }
+
+ public void setFilePath(String name) {
+ this.filePath = name;
+ }
+
+ public String getFilePath() {
+ return filePath;
+ }
+
+ public String getFileName() {
+ String[] splitPath = this.filePath.split("\\/"); //$NON-NLS-1$
+ String fileName = new String(splitPath[splitPath.length - 1]);
+ return fileName;
+ }
+
+ public int getFailedApiCount() {
+ return getFailedData().size();
+ }
+
+ public int getApiCount() {
+ return getContents().size();
+ }
+
+ public void setFileSize(long data) {
+ if (data > 0) {
+ this.fileSize = data;
+ }
+ }
+
+ public long getFileSize() {
+ return this.fileSize;
+ }
+
+ public void setReadSize(long data) {
+ this.readSize += data;
+ }
+
+ public long getReadSize() {
+ return this.readSize;
+ }
+
+ public void setWriteSize(long data) {
+ this.writeSize += data;
+ }
+
+ public long getWriteSize() {
+ return this.writeSize;
+ }
+
+ private boolean isParent() {
+ boolean isParent = false;
+ if (children.size() > 0) {
+ isParent = true;
+ } else {
+ isParent = false;
+ }
+ return isParent;
+ }
+
+ public FileChartData findChildData(FileChartDataEvent event) {
+ int size = children.size();
+ FileChartData ret;
+ for (int i = 0; i < size; i++) {
+ ret = children.get(i);
+ if ((ret.getFD().trim().equals(event.getFd()))
+ && (ret.isClosed(event) == false)) {
+ return ret;
+ }
+ }
+ return null;
+ }
+
+ public void setItem(DAChartBoardItem item) {
+ this.item = item;
+ setChart(item.getChart());
+ apiSeries = chart.getSeries(FilePageLabels.FILE_CHART_API_FILE);
+ statueSeries = chart.getSeries(FilePageLabels.FILE_CHART_SERIES_FILE);
+ }
+
+ public void checkUpdate() {
+ if (false == hasUpdate
+ && AnalyzerUtil.getRecordState().equals(
+ RecordStateSourceProvider.RECORD_RECORDING)) {
+ return;
+ } else {
+ hasUpdate = false;
+ }
+
+ int size = contentsQueue.size();
+ FileChartDataEvent event = null;
+ if (size > 0) {
+ for (int i = 0; i < size; i++) {
+ event = contentsQueue.get(0);
+ setStatusColor(event);
+ getContents().add(event);
+ createChartItem(event);
+ contentsQueue.remove(0);
+ }
+ chart.redraw();
+ }
+
+ size = children.size();
+ if (size > 0) {
+ FileChartData data;
+ for (int i = 0; i < size; i++) {
+ data = children.get(i);
+ data.checkUpdate();
+ }
+ }
+
+ if (AnalyzerUtil.getRecordState().equals(
+ RecordStateSourceProvider.RECORD_READY)) {
+ if (isParent() && (event == null)) {
+ for (int i = 0; i < size; i++) {
+ if ((!children.get(i).isClosed(null))
+ && (!children.get(i).getFD().contains("-1"))) {
+ setNotAccessFileStatus();
+ break;
+ }
+ }
+ } else {
+ if (!isClosed(event)) {
+ setNotAccessFileStatus();
+ }
+ }
+ }
+ }
+
+ private void setStatusColor(FileChartDataEvent event) {
+ if ((isFileOpenFailed()) == true || (event.isFailedAPI() == true)) {
+ return;
+ }
+ if (event.getApiType() == LogCenterConstants.FD_API_TYPE_NUMBER_OPEN) {
+ if (isParent()) {
+ if (isClosed(event)) {
+ setOpendFileStatus(event);
+ }
+ } else {
+ setOpendFileStatus(event);
+ }
+ } else if (event.getApiType() == LogCenterConstants.FD_API_TYPE_NUMBER_CLOSE) {
+ if (isParent()) {
+ if (isClosed(event)) {
+ setClosedFileStatus(event);
+ }
+ } else {
+ setClosedFileStatus(event);
+ }
+ }
+ }
+
+ private void setOpendFileStatus(FileChartDataEvent event) {
+ DAChartSeriesItem seriesItem = new DAChartSeriesItem(
+ event.getApiChartTime(),
+ DAChartSeriesItem.SERIES_STATE_CONTINUE,
+ ColorResources.FILE_AREA_USED_END,
+ ColorResources.FILE_AREA_USED_START,
+ FilePageLabels.FILE_CHART_TOOLTIP_OPEND);
+ statueSeries.addSeriesItem(seriesItem);
+ }
+
+ private void setClosedFileStatus(FileChartDataEvent event) {
+ int nStatusLastIndex = statueSeries.getSeriesItemList().size() - 1;
+ if (nStatusLastIndex > -1) {
+ statueSeries.getSeriesItemList().get(nStatusLastIndex)
+ .setEventColor(ColorResources.FILE_AREA_CLOSED_END);
+ statueSeries
+ .getSeriesItemList()
+ .get(nStatusLastIndex)
+ .setEventGradationForegroundColor(
+ ColorResources.FILE_AREA_CLOSED_START);
+ DAChartSeriesItem seriesItem = new DAChartSeriesItem(
+ event.getApiChartTime(),
+ DAChartSeriesItem.SERIES_STATE_BAR,
+ ColorResources.FILE_AREA_CLOSED_END,
+ ColorResources.FILE_AREA_CLOSED_START,
+ FilePageLabels.FILE_CHART_TOOLTIP_CLOSED);
+ seriesItem.setBarWidth(0);
+ statueSeries.addSeriesItem(seriesItem);
+ statueSeries.getSeriesItemList().get(nStatusLastIndex)
+ .setTooltipText(FilePageLabels.FILE_CHART_TOOLTIP_CLOSED);
+ }
+ }
+
+ private void setNotAccessFileStatus() {
+ int nStatusLastIndex = statueSeries.getSeriesItemList().size() - 1;
+ if (nStatusLastIndex > -1) {
+ statueSeries.getSeriesItemList().get(nStatusLastIndex)
+ .setEventColor(ColorResources.FILE_AREA_NOT_ACCESS_END);
+ statueSeries
+ .getSeriesItemList()
+ .get(nStatusLastIndex)
+ .setEventGradationForegroundColor(
+ ColorResources.FILE_AREA_NOT_ACCESS_START);
+ statueSeries.getSeriesItemList().get(nStatusLastIndex)
+ .setTooltipText(FilePageLabels.FILE_CHART_TOOLTIP_CLOSED);
+ }
+ }
+
+ protected int createChartItem(FileChartDataEvent event) {
+ DAChartSeriesItem seriesItem = null;
+ int apiType = event.getApiType();
+ if (event.isFailedAPI() == true) {
+ seriesItem = new DAChartSeriesItem(event.getApiChartTime(),
+ DAChartSeriesItem.SERIES_STATE_BAR,
+ ColorResources.FILE_API_FAILED, event.getTooltipContent());
+ apiSeries.addSeriesItem(seriesItem);
+ return apiType;
+ }
+ switch (apiType) {
+ case LogCenterConstants.FD_API_TYPE_NUMBER_OPEN:
+ seriesItem = new DAChartSeriesItem(event.getApiChartTime(),
+ DAChartSeriesItem.SERIES_STATE_BAR,
+ ColorResources.FILE_API_USED, event.getTooltipContent());
+ break;
+ case LogCenterConstants.FD_API_TYPE_NUMBER_CLOSE:
+ seriesItem = new DAChartSeriesItem(event.getApiChartTime(),
+ DAChartSeriesItem.SERIES_STATE_BAR,
+ ColorResources.FILE_API_USED, event.getTooltipContent());
+ break;
+ case LogCenterConstants.FD_API_TYPE_NUMBER_READ:
+ seriesItem = new DAChartSeriesItem(event.getApiChartTime(),
+ DAChartSeriesItem.SERIES_STATE_BAR,
+ ColorResources.FILE_API_USED, event.getTooltipContent());
+ break;
+ case LogCenterConstants.FD_API_TYPE_NUMBER_WRITE:
+ seriesItem = new DAChartSeriesItem(event.getApiChartTime(),
+ DAChartSeriesItem.SERIES_STATE_BAR,
+ ColorResources.FILE_API_USED, event.getTooltipContent());
+ break;
+ case LogCenterConstants.FD_API_TYPE_NUMBER_OTHERS:
+ seriesItem = new DAChartSeriesItem(event.getApiChartTime(),
+ DAChartSeriesItem.SERIES_STATE_BAR,
+ ColorResources.FILE_API_USED, event.getTooltipContent());
+ break;
+ default:
+ System.out.println("createChartItem : no case FileChartDataEvent");
+ return -1;
+ }
+ apiSeries.addSeriesItem(seriesItem);
+
+ return apiType;
+ }
+
+ public void setFileOpendTime(double data) {
+ this.fileOpendTime = data;
+ }
+
+ public double getFileOpendTime() {
+ return this.fileOpendTime / TimelineConstants.MEGA;
+ }
+
+ public void setFileClosedTime(double data) {
+ fileClosedTime = data;
+ }
+
+ public double getFileClosedTime() {
+ return this.fileClosedTime / TimelineConstants.MEGA;
+ }
+
+ public void setFileLastUsedTime(double data) {
+ fileLastUsedTime = data;
+ }
+
+ public double getFileLastUsedTime() {
+ return this.fileLastUsedTime / TimelineConstants.MEGA;
+ }
+
+ public void setFileUsedTime(double data) {
+ if (this.fileOpendTime == 0) {
+ this.fileTotalUsedTime = 0;
+ } else {
+ this.fileTotalUsedTime = data - this.fileOpendTime;
+ }
+ setFileLastUsedTime(data);
+ }
+
+ private double parentTotalUsedTime() {
+ List<String> totalUsedTimeList = new ArrayList<String>();
+ ;
+ boolean firstInputData = false;
+ double fileTotalUsedTime = 0;
+ FileChartData fileData;
+ double firstUsedTime = 0;
+ double lastUsedTime = 0;
+ for (int i = 0; i < children.size(); i++) {
+ fileData = children.get(i);
+ firstUsedTime = fileData.getFileOpendTime()
+ * TimelineConstants.MEGA;
+ lastUsedTime = fileData.getFileLastUsedTime()
+ * TimelineConstants.MEGA;
+ if (lastUsedTime == 0) {
+ continue;
+ } else if (!fileData.isFileOpenFailed() && firstInputData == false) {
+ firstInputData = true;
+ totalUsedTimeList
+ .add(Double.toString(firstUsedTime)
+ + CommonConstants.COLON
+ + Double.toString(lastUsedTime));
+ }
+ int nLastIndex = totalUsedTimeList.size() - 1;
+ if (nLastIndex < 0) {
+ continue;
+ }
+ String data = totalUsedTimeList.get(nLastIndex);
+ String[] splitTimeDataList = data.split(CommonConstants.COLON);
+ double savedFirstUsedTime = Double
+ .parseDouble(splitTimeDataList[0]);
+ double savedLastUsedTime = Double.parseDouble(splitTimeDataList[1]);
+ if ((savedFirstUsedTime < firstUsedTime)
+ && (firstUsedTime < savedLastUsedTime)
+ && (savedFirstUsedTime < savedLastUsedTime)
+ && (savedLastUsedTime < lastUsedTime)) {
+ totalUsedTimeList.remove(nLastIndex);
+ totalUsedTimeList
+ .add(Double.toString(savedFirstUsedTime)
+ + CommonConstants.COLON
+ + Double.toString(lastUsedTime));
+ } else if ((savedLastUsedTime < firstUsedTime)
+ && (savedLastUsedTime < lastUsedTime)) {
+ totalUsedTimeList
+ .add(Double.toString(firstUsedTime)
+ + CommonConstants.COLON
+ + Double.toString(lastUsedTime));
+ } else if ((lastUsedTime < savedFirstUsedTime)
+ && (lastUsedTime < savedLastUsedTime)) {
+ totalUsedTimeList
+ .add(Double.toString(firstUsedTime)
+ + CommonConstants.COLON
+ + Double.toString(lastUsedTime));
+ }
+ }
+ int nSize = totalUsedTimeList.size();
+ for (int i = 0; i < nSize; i++) {
+ String data = totalUsedTimeList.get(i);
+ String[] splitTimeDataList = data.split(CommonConstants.COLON); //$NON-NLS-1$
+ double savedFirstUsedTime = Double
+ .parseDouble(splitTimeDataList[0]);
+ double savedLastUsedTime = Double.parseDouble(splitTimeDataList[1]);
+ fileTotalUsedTime += (savedLastUsedTime - savedFirstUsedTime);
+ }
+ return fileTotalUsedTime;
+ }
+
+ public double getFileTotalUseTime() {
+ if (isParent()) {
+ return parentTotalUsedTime();
+ }
+ if (isClosed(null) == true) {
+ return this.fileLastUsedTime - this.fileOpendTime;
+ } else {
+ return this.fileTotalUsedTime;
+ }
+ }
+
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.file;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+
+public class FileChartDataEvent {
+
+ private List<String> contents;
+ private FailedData failedData = null;
+
+ private String FD = AnalyzerLabels.EMPTY_STRING;
+ private String filePath = AnalyzerLabels.EMPTY_STRING;
+
+ private int apiType = -1;
+ private double logTime = -1;
+
+ private long fileSize = 0;
+ private long readSize = 0;
+ private long writeSize = 0;
+
+ private boolean isFailedAPI = false;
+
+ private String tooltip = null;
+
+ public FileChartDataEvent(String filePath, String Fd, double time,
+ String tooltip, List<String> contents) {
+ setFilePath(filePath);
+ setFd(Fd);
+ setLogTime(time);
+ setContents(contents);
+ setTooltipContent(tooltip);
+ }
+
+ public FileChartDataEvent(List<String> contents) {
+ setContents(contents);
+ }
+
+ public List<String> getContents() {
+ if (null == contents) {
+ contents = new ArrayList<String>();
+ }
+ return contents;
+ }
+
+ public void setContents(List<String> contents) {
+ this.contents = contents;
+ }
+
+ public String getFd() {
+ return FD;
+ }
+
+ public void setFd(String fd) {
+ this.FD = fd;
+ }
+
+ public boolean isFailedAPI() {
+ return isFailedAPI;
+ }
+
+ public void setFailedAPI() {
+ this.isFailedAPI = true;
+ }
+
+ public int getApiType() {
+ return apiType;
+ }
+
+ public void setApiType(int apiType) {
+ this.apiType = apiType;
+ }
+
+ public double getLogTime() {
+ return logTime;
+ }
+
+ public void setLogTime(double data) {
+ this.logTime = data;
+ }
+
+ public double getApiChartTime() {
+ return getLogTime() / TimelineConstants.MEGA;
+ }
+
+ public void setFilePath(String data) {
+ this.filePath = data;
+ }
+
+ public String getFilePath() {
+ return filePath;
+ }
+
+ public void setFileSize(long data) {
+ this.fileSize = data;
+ this.writeSize = data;
+ }
+
+ public long getFileSize() {
+ return this.fileSize;
+ }
+
+ public void setReadSize(long data) {
+ this.readSize = data;
+ }
+
+ public long getReadSize() {
+ return this.readSize;
+ }
+
+ public void setWriteSize(long data) {
+ this.writeSize = data;
+ }
+
+ public long getWriteSize() {
+ return this.writeSize;
+ }
+
+ public void setFailedData(FailedData data) {
+ failedData = data;
+ }
+
+ public FailedData getFailedData() {
+ return failedData;
+ }
+
+ public String getTooltipContent() {
+ return tooltip;
+ }
+
+ public void setTooltipContent(String tooltip) {
+ this.tooltip = tooltip;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.file;
+
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogListQueue;
+
+public class FileChartManager implements Runnable {
+
+ private LogListQueue logListQueue = null;
+ private Thread updateLogThread = null;
+
+ private FileDataMaker fileDataMaker = null;
+
+ private static FileChartManager instance = null;
+
+ public FileChartManager() {
+ fileDataMaker = new FileDataMaker(AnalyzerManager.getFailedChecker(),
+ AnalyzerManager.getLeakDetector(),
+ AnalyzerManager.getWarningChecker());
+ }
+
+ public static FileChartManager getInstance() {
+ if (null == instance) {
+ instance = new FileChartManager();
+ }
+ return instance;
+ }
+
+ public LogListQueue getLogListQueue() {
+ if (null == logListQueue) {
+ logListQueue = new LogListQueue();
+ }
+ return logListQueue;
+ }
+
+ public void startUpdateLogThread() {
+ if (null == updateLogThread || !updateLogThread.isAlive()) {
+ updateLogThread = new Thread(null, getInstance(),
+ AnalyzerConstants.FILE_CHART_MANAGER_THREAD);
+ updateLogThread.start();
+ }
+ }
+
+ public void stopUpdateLogThread() {
+ if (null != updateLogThread && updateLogThread.isAlive()) {
+ try {
+ sendNotify();
+ updateLogThread.join();
+ System.out.println("file chart manager joined!"); //$NON-NLS-1$
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public boolean isThreadAlive() {
+ if (null == updateLogThread || !updateLogThread.isAlive()) {
+ return false;
+ }
+ return true;
+ }
+
+ public FileDataMaker getFileDataMaker() {
+ return fileDataMaker;
+ }
+
+ /*** make file data thread ***/
+ @Override
+ public void run() {
+ LogListQueue logListQueue = getInstance().getLogListQueue();
+ while (!AnalyzerManager.isExit()) {
+ List<List<String>> logs = logListQueue.getFirst();
+ if (null == logs) {
+ break;
+ }
+ getInstance().getFileDataMaker().makeData(logs);
+ }
+
+ /* log for debug */
+ System.out.println("file manager thread end!!"); //$NON-NLS-1$
+ }
+
+ public void clear() {
+ instance = null;
+ fileDataMaker.clear();
+ }
+
+ public static void sendNotify() {
+ LogListQueue logListQueue = getInstance().getLogListQueue();
+ synchronized (logListQueue) {
+ logListQueue.notifyAll();
+ }
+ }
+
+ public int[] getParentChartIndex(String seq) {
+ int parentChartIndex = -1;
+ FileChartData chartData = null;
+ List<FileChartData> fileChartDataLow = FileChartManager.getInstance()
+ .getFileDataMaker().getFileChartLow();
+ for (int i = 0; i < fileChartDataLow.size(); i++) {
+ chartData = fileChartDataLow.get(i);
+ if (chartData.getChildCount() != 0) {
+ parentChartIndex++;
+ if (isEqulasSeq(chartData, seq)) {
+ return new int[] { parentChartIndex, i };
+ }
+ }
+ }
+ return new int[] { 0, 0 };
+ }
+
+ public int getChildChartIndex(int parentChartIndex, String seq) {
+ List<FileChartData> fileChartDataLow = FileChartManager.getInstance()
+ .getFileDataMaker().getFileChartLow();
+ List<FileChartData> childData = fileChartDataLow.get(parentChartIndex)
+ .getChild();
+ FileChartData childChartData = null;
+ for (int i = 0; i < childData.size(); i++) {
+ childChartData = childData.get(i);
+ if (isEqulasSeq(childChartData, seq)) {
+ return i;
+ }
+ }
+ return 0;
+ }
+
+ public boolean isEqulasSeq(FileChartData chartData, String seq) {
+ for (int j = 0; j < chartData.getContents().size(); j++) {
+ if (chartData.getContents().get(j).getContents()
+ .get(LogCenterConstants.SEQUENCE_NUMBER_INDEX).equals(seq)) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.file;
+
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StackLayout;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.logparser.Logs;
+import org.tizen.dynamicanalyzer.model.DAView;
+import org.tizen.dynamicanalyzer.nl.FilePageLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.ui.timeline.logparser.LifecycleLogParser;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.ui.widgets.TitleComboPopupRenderer;
+import org.tizen.dynamicanalyzer.ui.widgets.TitleComboRenderer;
+import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonRenderer;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardSelectionListener;
+import org.tizen.dynamicanalyzer.widgets.combo.DACustomCombo;
+
+public class FileChartView extends DAView {
+ public static final String ID = FileChartView.class.getName();
+ public final static int FILE_CHART_HEIGHT = 40;
+
+ private final Composite contents;
+ private DAChartBoard fileChart;
+ private DACustomCombo fileCombo;
+ private final StackLayout stackLayout;
+ private long rangeStartTime = -1;
+ private long rangeEndTime = -1;
+
+ private final RangeDataManager rangeDataManger = RangeDataManager
+ .getInstance();
+
+ public FileChartView(Composite parent, int style) {
+ super(parent, style);
+ this.setLayout(new FillLayout());
+
+ // TODO Auto-generated constructor stub
+ ViewContainer viewContainer = new ViewContainer(this, false);
+ viewContainer.setTitleText(FilePageLabels.FILE_CHART_FILE);
+
+ contents = viewContainer.getContentArea();
+ contents.setBackground(ColorResources.WINDOW_BG_COLOR);
+ stackLayout = new StackLayout();
+ contents.setLayout(stackLayout);
+ fileChart = new DAChartBoard(contents, FilePageLabels.FILE_CHART_FILE);
+ fileChart.setNameFont(FontResources.CHART_NAME_FONT);
+
+ fileChart.addSelectionListener(new DAChartBoardSelectionListener() {
+
+ @Override
+ public void handleSelectionEvent(DAChartBoardItem item) {
+ // TODO Auto-generated method stub
+ AnalyzerManager.getCurrentPage().updatePage(
+ new DASelectionData(FileChartView.ID, 0, 0, item
+ .getData(), null));
+ }
+ });
+
+ stackLayout.topControl = fileChart;
+ fileCombo = new DACustomCombo(fileChart.getTitleComp(), SWT.NONE);
+ fileCombo.setImages(ImageResources.TIMELINE_DROPDOWN_NORMAL,
+ ImageResources.TIMELINE_DROPDOWN_HOVER,
+ ImageResources.TIMELINE_DROPDOWN_PUSH,
+ ImageResources.TIMELINE_DROPDOWN_NORMAL);
+ fileCombo.add(FilePageLabels.FILE_CHART_FILE);
+ fileCombo.select(0);
+ fileCombo.setEnabled(false);
+ fileCombo.setComboRender(new TitleComboRenderer());
+ fileCombo.setComboPopupRender(new TitleComboPopupRenderer());
+ fileCombo.setButtonRenderer(new DACustomButtonRenderer());
+ LifecycleLogParser.getInstance().registerLifecycleBar(
+ fileChart.getLifecycleBar());
+ LifecycleLogParser.getInstance().registerTimeline(
+ fileChart.getTimeline());
+ }
+
+ @Override
+ public void updateView() {
+ FileChartManager.getInstance().getFileDataMaker().checkUpdate();
+ fileChart.setTotalEndTime(ToolbarArea.getInstance().getTime());
+
+ fileChart.setRangeStartTime(rangeDataManger.getStartTime()
+ / TimelineConstants.MEGA);
+ fileChart.setRangeEndTime(rangeDataManger.getEndTime()
+ / TimelineConstants.MEGA);
+
+ long newRangeStartTime = -1;
+ long newRangeEndTime = -1;
+
+ if (RangeDataManager.getInstance().isBeingAnalyzed()) {
+ newRangeStartTime = rangeDataManger.getStartTime();
+ newRangeEndTime = rangeDataManger.getEndTime();
+ }
+
+ if (newRangeStartTime != rangeStartTime
+ || newRangeEndTime != rangeEndTime) {
+ rangeStartTime = newRangeStartTime;
+ rangeEndTime = newRangeEndTime;
+ fileChart.setRange(rangeStartTime / TimelineConstants.MEGA,
+ rangeEndTime / TimelineConstants.MEGA);
+ }
+ }
+
+ @Override
+ public void updateView(DASelectionData selData) {
+ long start = selData.getStartTime();
+ long end = selData.getEndTime();
+
+ double startTime = (double) start / TimelineConstants.MEGA;
+ double endTime = (double) end / TimelineConstants.MEGA;
+ double middleTime = (startTime + endTime) / 2.0;
+ if (endTime == startTime) {
+ middleTime = startTime;
+ }
+
+ DAChartBoard chartBoard = (DAChartBoard) stackLayout.topControl;
+
+ chartBoard.setVisibleMiddleTime(middleTime);
+ DAChartPlotIntervalMarker intervalMarker = chartBoard
+ .getIntervalMarker();
+ intervalMarker.setStartVal(startTime);
+ intervalMarker.setEndVal(endTime);
+ }
+
+ @Override
+ public void setSelection(List<String> data) {
+ if (null == data || data.isEmpty()) {
+ return;
+ }
+ String seq = data.get(LogCenterConstants.SEQUENCE_NUMBER_INDEX);
+ int selectedIndex[] = FileChartManager.getInstance()
+ .getParentChartIndex(seq);
+ fileChart.selectItem(selectedIndex[0], FileChartManager.getInstance()
+ .getChildChartIndex(selectedIndex[1], seq));
+ }
+
+ @Override
+ public void updateLog(LogPackage logPack) {
+ Logs logs = logPack.getLogs(LogCenterConstants.LOG_RESOURCE);
+ if (null == logs || logs.getLogs().size() == 0) {
+ return;
+ }
+ List<List<String>> inputs = logs.getCloneLogs();
+ FileChartManager.getInstance().getLogListQueue().putLog(inputs);
+ }
+
+ @Override
+ public void clear() {
+ fileChart.clear();
+ FileChartManager.getInstance().getFileDataMaker().clear();
+ FileChartManager.getInstance().getFileDataMaker().setBoard(fileChart);
+ }
+
+ @Override
+ public Control getControl() {
+ return fileChart;
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.file;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.nl.FilePageLabels;
+import org.tizen.dynamicanalyzer.nl.ThreadPageLabels;
+import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.summary.failed.FailedChecker;
+import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData;
+import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakDetector;
+import org.tizen.dynamicanalyzer.ui.summary.warning.WarningCase;
+import org.tizen.dynamicanalyzer.ui.summary.warning.WarningChecker;
+import org.tizen.dynamicanalyzer.ui.summary.warning.WarningData;
+import org.tizen.dynamicanalyzer.ui.timeline.chart.FileChart;
+import org.tizen.dynamicanalyzer.ui.timeline.eventlistener.TimelineChartMouseAdapter;
+import org.tizen.dynamicanalyzer.ui.timeline.eventlistener.TimelineChartMouseMoveListener;
+import org.tizen.dynamicanalyzer.ui.timeline.eventlistener.TimelineChartMouseTrackAdapter;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotTooltip;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenu;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuItem;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuListener;
+
+public class FileDataMaker {
+ private DAChartBoard board;
+ private List<FileChartData> rows = new ArrayList<FileChartData>();
+ private List<FileChartDataEvent> fileEventQueue = new ArrayList<FileChartDataEvent>();
+ private List<FileChartDataEvent> fileEventWarningQueue = new ArrayList<FileChartDataEvent>();
+ private HashMap<String, String> findPathHashMap = new HashMap<String, String>();
+ private int timeLineFileChartFDCount = 0;
+ private FailedChecker failedChecker = null;
+ @SuppressWarnings("unused")
+ private LeakDetector leakDetector = null;
+ private WarningChecker warningChecker = null;
+
+ private RangeDataManager rangeDataManager = null;
+
+ public FileDataMaker(FailedChecker failedChecker,
+ LeakDetector leakDetector, WarningChecker warningChecker) {
+ this.failedChecker = failedChecker;
+ this.leakDetector = leakDetector;
+ this.warningChecker = warningChecker;
+ }
+
+ public void setBoard(DAChartBoard board) {
+ this.board = board;
+ }
+
+ public void clear() {
+ rows.clear();
+ fileEventQueue.clear();
+ fileEventWarningQueue.clear();
+ findPathHashMap.clear();
+ timeLineFileChartFDCount = 0;
+ }
+
+ public List<FileChartData> getFileChartLow() {
+ return rows;
+ }
+
+ private boolean isOpenMainLog(List<String> input) {
+ String filePath = input
+ .get(LogCenterConstants.RESOURCE_FILE_PATH_INDEX);
+ if (filePath.contains(CommonConstants.SLASH)) {
+ String[] splitApiFilePath = filePath.split(CommonConstants.SLASH);
+ String strApiFilePath = new String(
+ splitApiFilePath[splitApiFilePath.length - 1].trim());
+ if (AnalyzerManager.getProject().getPkgId().equals(strApiFilePath)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean isPrintLog(List<String> input) {
+ String apiName = input.get(LogCenterConstants.APINAME_INDEX);
+ if (apiName.contains("print")) {//$NON-NLS-1$
+ return true;
+ }
+ return false;
+ }
+
+ public void makeData(List<List<String>> inputs) {
+ int size = inputs.size();
+ for (int i = 0; i < size; i++) {
+ List<String> input = inputs.get(i);
+
+ if (AnalyzerUtil.isInternal(input, false)) {
+ continue;
+ }
+
+ if (isPrintLog(input)) {
+ continue;
+ }
+
+ if (isOpenMainLog(input)) {
+ continue;
+ }
+
+ String fdType = input.get(LogCenterConstants.RESOURCE_FDTYPE_INDEX);
+ // socket
+ int type = Integer.parseInt(fdType);
+ if (type == 1 || type == 2) {
+ continue;
+ }
+
+ String fdApiType = input
+ .get(LogCenterConstants.RESOURCE_FDAPITYPE_INDEX);
+ String path = input
+ .get(LogCenterConstants.RESOURCE_FILE_PATH_INDEX);
+ String fd = input.get(LogCenterConstants.RESOURCE_FDVALUE_INDEX);
+
+ String err = input.get(LogCenterConstants.ERROR_INDEX);
+ long errno = Long.parseLong(err);
+
+ String name = input.get(LogCenterConstants.APINAME_INDEX);
+ double time = Double.parseDouble(input
+ .get(LogCenterConstants.TIME_INDEX));
+ // wrong log
+ if (fd.trim().equals(AnalyzerLabels.EMPTY_STRING)) {
+ // System.out.println("wrong fd : " + fd + " input : " + input);
+ continue;
+ }
+ FileChartDataEvent event = new FileChartDataEvent(path, fd, time,
+ name, input);
+
+ // error check
+ if (errno != 0) {
+ FailedData ffd = new FailedData(input);
+ event.setFailedData(ffd);
+ this.failedChecker.getFailedList().add(ffd);
+ event.setFailedAPI();
+ } else if (name.equals("fdopen")) { //$NON-NLS-1$
+ System.out.println("fdopen");
+ continue;
+ }
+
+ if (fdApiType.equals(LogCenterConstants.FD_API_TYPE_OPEN)) {
+ event.setApiType(LogCenterConstants.FD_API_TYPE_NUMBER_OPEN);
+ checkDuplicateOpen(event);
+ if (errno == 0) {
+ timeLineFileChartFDCount++;
+ FileChart.getInstance().setFDCount(1, time);
+ }
+ } else if (fdApiType.equals(LogCenterConstants.FD_API_TYPE_CLOSE)) {
+ event.setApiType(LogCenterConstants.FD_API_TYPE_NUMBER_CLOSE);
+ if (errno == 0) {
+ timeLineFileChartFDCount--;
+ if (timeLineFileChartFDCount >= 0) {
+ FileChart.getInstance().setFDCount(-1, time);
+ } else {
+ timeLineFileChartFDCount = 0;
+ }
+ }
+
+ } else if (fdApiType.equals(LogCenterConstants.FD_API_TYPE_READ)
+ || fdApiType.equals(LogCenterConstants.FD_API_TYPE_WRITE)) {
+ String rwRetuenSize = input
+ .get(LogCenterConstants.RETURN_INDEX);
+ long rwRetrun = Long.parseLong(rwRetuenSize);
+ if (rwRetrun < 0) {
+ rwRetrun = 0;
+ }
+ if (fdApiType.equals(LogCenterConstants.FD_API_TYPE_READ)) {
+ event.setReadSize(rwRetrun);
+ event.setApiType(LogCenterConstants.FD_API_TYPE_NUMBER_READ);
+ FileChart.getInstance().setReadByte((int) rwRetrun, time);
+
+ } else if (fdApiType
+ .equals(LogCenterConstants.FD_API_TYPE_WRITE)) {
+
+ String strFileSize = input
+ .get(LogCenterConstants.RESOURCE_FILE_SIZE_INDEX);
+ if (strFileSize.equals("?") == false) {//$NON-NLS-1$
+ long fileSize = Long.parseLong(strFileSize);
+ event.setFileSize(fileSize);
+ }
+ event.setFileSize(rwRetrun);
+ event.setWriteSize(rwRetrun);
+ event.setApiType(LogCenterConstants.FD_API_TYPE_NUMBER_WRITE);
+ FileChart.getInstance().setWriteByte((int) rwRetrun, time);
+ }
+
+ } else {
+ event.setApiType(LogCenterConstants.FD_API_TYPE_NUMBER_OTHERS);
+ }
+ fileEventQueue.add(event);
+ fileEventWarningQueue.add(event);
+ if (fdApiType.equals(LogCenterConstants.FD_API_TYPE_CLOSE)) {
+ checkWithoutUsing(event);
+ }
+ }
+ }
+
+ private void checkDuplicateOpen(FileChartDataEvent data) {
+ if (data.isFailedAPI()) {
+ return;
+ }
+ for (int i = 0; i < fileEventWarningQueue.size(); i++) {
+ FileChartDataEvent event = fileEventWarningQueue.get(i);
+ if ((event.getFilePath().equals(data.getFilePath()))
+ && (event.getApiType() == LogCenterConstants.FD_API_TYPE_NUMBER_OPEN)) {
+ if (!warningChecker.isChecked(data.getFilePath(),
+ WarningCase.DUPLICATE_OPEN.getType())) {
+ WarningData wData = new WarningData(
+ LogCenterConstants.LOG_RESOURCE,
+ WarningCase.DUPLICATE_OPEN.getType(),
+ data.getContents(), data.getFilePath());
+ warningChecker.getWarningData().add(wData);
+ }
+ }
+ }
+ }
+
+ private void checkWithoutUsing(FileChartDataEvent data) {
+ int nAPICount = 0;
+ for (int i = 0; i < fileEventWarningQueue.size(); i++) {
+ FileChartDataEvent event = fileEventWarningQueue.get(i);
+ if ((event.getFd().equals(data.getFd()))) {
+ nAPICount++;
+ if (event.getApiType() == LogCenterConstants.FD_API_TYPE_NUMBER_OPEN) {
+ data.setFilePath(event.getFilePath());
+ }
+ fileEventWarningQueue.remove(i--);
+ }
+ }
+
+ if ((nAPICount < 3)
+ && (data.getFilePath().equals(AnalyzerLabels.EMPTY_STRING) == false)) { // open-close
+ if (!warningChecker.isChecked(data.getFilePath(),
+ WarningCase.WITHOUT_USING.getType())) {
+ WarningData wData = new WarningData(
+ LogCenterConstants.LOG_RESOURCE,
+ WarningCase.WITHOUT_USING.getType(),
+ data.getContents(), data.getFilePath());
+ warningChecker.getWarningData().add(wData);
+ }
+ }
+ }
+
+ private void initFileChart(DAChart chart, boolean isParent) {
+ if (null == chart) {
+ return;
+ }
+ rangeDataManager = RangeDataManager.getInstance();
+
+ DAChartSeries apiSeries = new DAChartSeries(
+ FilePageLabels.FILE_CHART_API_FILE,
+ DAChartSeries.SERIES_STYLE_EVENT, ColorResources.YELLOW);
+
+ DAChartSeries stateSeries = new DAChartSeries(
+ FilePageLabels.FILE_CHART_SERIES_FILE,
+ DAChartSeries.SERIES_STYLE_STATE, ColorResources.WHITE);
+
+ apiSeries.setSummarizeTooltipText(ThreadPageLabels.THREAD_TOOLTIP_APIS);
+
+ chart.addSeries(stateSeries);
+ chart.addSeries(apiSeries);
+
+ DAChartPlot plot = chart.getPlot();
+ if (null == plot) {
+ return;
+ }
+ if (true == isParent) {
+ plot.setBackgroundImage(ImageResources.BG_GRADIENT);
+ } else {
+ plot.setBackgroundImage(ImageResources.BG_CHILD_GRADIENT);
+ }
+ plot.setAutoHeightRange(false);
+ plot.setAxisFont(FontResources.CHART_AXIS_FONT);
+ plot.setAxisRangeY(0, 101);
+ plot.setAxisRangeX(board.getVisibleStartTime(),
+ board.getVisibleEndTime());
+ DAChartPlotTooltip tooltip = new DAChartPlotTooltip(-1);
+ tooltip.setFont(FontResources.CHART_TOOLTIP_FONT);
+ plot.setTooltip(tooltip);
+
+ DAContextMenu popupMenu = new DAContextMenu(chart);
+ final DAContextMenuItem startItem = new DAContextMenuItem(popupMenu);
+ startItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_START);
+ startItem.addClickListener(new DAContextMenuListener() {
+ @Override
+ public void widgetSelected(DAContextMenuItem menuItem) {
+ double startTime = startItem.getRangeTime();
+ board.setRangeStartTime(startTime);
+
+ rangeDataManager.setStartTime((long) (startTime * 1000000));
+ }
+ });
+
+ final DAContextMenuItem endItem = new DAContextMenuItem(popupMenu);
+ endItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_END);
+ endItem.addClickListener(new DAContextMenuListener() {
+
+ @Override
+ public void widgetSelected(DAContextMenuItem menuItem) {
+ double endTime = endItem.getRangeTime();
+ board.setRangeEndTime(endTime);
+
+ rangeDataManager.setEndTime((long) (endTime * 1000000));
+ }
+ });
+
+ DAContextMenuItem analysisItem = new DAContextMenuItem(popupMenu);
+ analysisItem.setText(TimelineChartLabels.RANGE_CONTEXT_ANALYSIS);
+ analysisItem.addClickListener(new DAContextMenuListener() {
+ @Override
+ public void widgetSelected(DAContextMenuItem menuItem) {
+ rangeDataManager.startRangeAnalysis();
+ }
+ });
+
+ DAContextMenuItem clearItem = new DAContextMenuItem(popupMenu);
+ clearItem.setText(TimelineChartLabels.RANGE_CONTEXT_CLEAR);
+ clearItem.addClickListener(new DAContextMenuListener() {
+ @Override
+ public void widgetSelected(DAContextMenuItem menuItem) {
+ board.setRangeStartTime(-1);
+ board.setRangeEndTime(-1);
+
+ rangeDataManager.initRange();
+ }
+ });
+
+ chart.addMouseListener(new TimelineChartMouseAdapter(popupMenu));
+ chart.addMouseMoveListener(new TimelineChartMouseMoveListener(board
+ .getTimeline()));
+ chart.addMouseTrackListener(new TimelineChartMouseTrackAdapter(board
+ .getTimeline()));
+ plot.setIntervalMarker(board.getIntervalMarker());
+ }
+
+ private boolean createFileBoardItem(FileChartData parent, FileChartData sync) {
+ DAChartBoardItem item;
+ DAChart chart;
+ if (null == parent) {
+ item = new DAChartBoardItem(board, sync.getFileName());
+ chart = item.getChart();
+ initFileChart(chart, true);
+ } else {
+ DAChartBoardItem parentItem = parent.getItem();
+ item = new DAChartBoardItem(parentItem, sync.getFD());
+ chart = item.getChart();
+ initFileChart(chart, false);
+ }
+ setChartStyle(chart);
+ sync.setItem(item);
+ item.setData(sync);
+ chart.setData(sync);
+ chart.redraw();
+ return true;
+ }
+
+ protected void setChartStyle(DAChart chart) {
+ if (null == chart) {
+ return;
+ }
+ DAChartPlot plot = chart.getPlot();
+ if (null == plot) {
+ return;
+ }
+ plot.setBackgroundImage(ImageResources.BG_GRADIENT);
+ plot.setAutoHeightRange(false);
+ DAChartPlotTooltip tooltip = new DAChartPlotTooltip(-1);
+ tooltip.setFont(FontResources.CHART_TOOLTIP_FONT);
+ plot.setTooltip(tooltip);
+ plot.setAxisFont(FontResources.CHART_AXIS_FONT);
+ plot.setAxisRangeY(0, 101);
+ plot.setAxisRangeX(board.getVisibleStartTime(),
+ board.getVisibleEndTime());
+ chart.addMouseMoveListener(new TimelineChartMouseMoveListener(board
+ .getTimeline()));
+ chart.addMouseTrackListener(new TimelineChartMouseTrackAdapter(board
+ .getTimeline()));
+ }
+
+ private FileChartData findParent(String filePath, String fd) {
+ filePath = findPathHashMap.get(fd);
+ int size = rows.size();
+ FileChartData returnData = null;
+ for (int i = 0; i < size; i++) {
+ returnData = rows.get(i);
+ if (returnData.getFilePath().equals(filePath) == true) {
+ return returnData;
+ } else if ((returnData.getFilePath()
+ .equals(FilePageLabels.FILE_CHART_UNKNOWN_FILE))
+ && (filePath == null)) {
+ return returnData;
+ }
+ }
+ return null;
+ }
+
+ public void checkUpdate() {
+ if (AnalyzerUtil.getRecordState().equals(
+ RecordStateSourceProvider.RECORD_READY)) {
+ int size = rows.size();
+ FileChartData data;
+ for (int i = 0; i < size; i++) {
+ data = rows.get(i);
+ data.checkUpdate();
+ }
+ }
+
+ int size = fileEventQueue.size();
+ if (size > 0) {
+ FileChartData parentChart;
+ FileChartData childChart;
+ FileChartDataEvent event;
+ for (int i = 0; i < size; i++) {
+ event = fileEventQueue.get(0);
+ int apiType = event.getApiType();
+ String filePath = AnalyzerLabels.EMPTY_STRING;
+ if (event.getFilePath().trim()
+ .equals(AnalyzerLabels.EMPTY_STRING)) {
+ filePath = FilePageLabels.FILE_CHART_UNKNOWN_FILE;
+ } else {
+ filePath = event.getFilePath();
+ }
+ if (apiType == LogCenterConstants.FD_API_TYPE_NUMBER_OPEN) {
+ findPathHashMap.put(event.getFd(), filePath);
+ }
+ parentChart = findParent(event.getFilePath(), event.getFd());
+ if (null == parentChart) {
+ findPathHashMap.put(event.getFd(), filePath);
+ parentChart = new FileChartData(filePath, event.getFd(),
+ true);
+ childChart = new FileChartData(filePath, event.getFd(),
+ false);
+ parentChart.setClosed(false);
+ childChart.setClosed(false);
+ if (event.isFailedAPI()) {
+ childChart.setFileOpenFailed(true);
+ parentChart.setFileOpenFailed(true);
+ } else if (filePath
+ .equals(FilePageLabels.FILE_CHART_UNKNOWN_FILE)) {
+ childChart.setFileOpenFailed(true);
+ parentChart.setFileOpenFailed(true);
+ } else {
+ childChart.setFileOpenFailed(false);
+ parentChart.setFileOpenFailed(false);
+ }
+
+ parentChart.pushChild(childChart);
+ createFileBoardItem(null, parentChart);
+ createFileBoardItem(parentChart, childChart);
+ if (!event.isFailedAPI()) {
+ parentChart.setFileOpendTime((long) event.getLogTime());
+ childChart.setFileOpendTime((long) event.getLogTime());
+ } else {
+ childChart.setFileOpenFailed(true);
+ parentChart.setFileOpenFailed(true);
+ }
+ parentChart.pushEvent(event);
+ childChart.pushEvent(event);
+ rows.add(parentChart);
+ rows.add(childChart);
+ } else if (null != parentChart) {
+ childChart = parentChart.findChildData(event);
+ if (null == childChart) {
+ childChart = new FileChartData(filePath, event.getFd(),
+ false);
+ childChart.setClosed(false);
+ if (event.isFailedAPI()) {
+ childChart.setFileOpenFailed(true);
+ parentChart.setFileOpenFailed(true);
+ } else if (filePath
+ .equals(FilePageLabels.FILE_CHART_UNKNOWN_FILE)) {
+ childChart.setFileOpenFailed(true);
+ parentChart.setFileOpenFailed(true);
+ } else {
+ childChart.setFileOpenFailed(false);
+ parentChart.setFileOpenFailed(false);
+ }
+ rows.add(childChart);
+ parentChart.pushChild(childChart);
+ createFileBoardItem(parentChart, childChart);
+ if (!event.isFailedAPI()) {
+ childChart.setFileOpendTime((long) event
+ .getLogTime());
+ } else {
+ childChart.setFileOpenFailed(true);
+ }
+ childChart.pushEvent(event);
+ } else if (null != childChart) {
+ if (apiType == LogCenterConstants.FD_API_TYPE_NUMBER_CLOSE) {
+ if (!event.isFailedAPI()) {
+ childChart.setClosed(true);
+ childChart.setFileClosedTime((long) event
+ .getLogTime());
+ } else {
+ childChart.setFileOpenFailed(true);
+ }
+
+ childChart.pushEvent(event);
+ findPathHashMap.remove(event.getFd());
+ } else {
+ childChart.pushEvent(event);
+ }
+ }
+ parentChart.pushEvent(event);
+ parentChart.setFileUsedTime(event.getLogTime());
+ childChart.setFileUsedTime(event.getLogTime());
+ }
+ fileEventQueue.remove(0);
+ }
+ }
+ size = rows.size();
+ if (size > 0) {
+ FileChartData data;
+ for (int i = 0; i < size; i++) {
+ data = rows.get(i);
+ data.checkUpdate();
+ }
+ }
+
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.file;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.model.DAView;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.nl.FilePageLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
+import org.tizen.dynamicanalyzer.utils.Formatter;
+
+public class FileDetailInfoView extends DAView {
+
+ public static final String ID = FileDetailInfoView.class.getName();
+
+ private Canvas canvas = null;
+ private String fileName = AnalyzerLabels.EMPTY_STRING;
+ private String filePath = AnalyzerLabels.EMPTY_STRING;
+ private long fileSize = 0;
+ private long readSize = 0;
+ private long writeSize = 0;
+ private long totalUseTime = 0;
+ private int apiCount = 0;
+ private int failedApiCount = 0;
+
+ int[] innerMaxWeight = { 0, 100 };
+ int[] outerMaxWeight = { 0, 100 };
+
+ private void init() {
+ fileName = AnalyzerLabels.EMPTY_STRING;
+ filePath = AnalyzerLabels.EMPTY_STRING;
+ fileSize = 0;
+ readSize = 0;
+ writeSize = 0;
+ totalUseTime = 0;
+ apiCount = 0;
+ failedApiCount = 0;
+ }
+
+ public FileDetailInfoView(Composite parent, int style) {
+ super(parent, style);
+ this.setLayout(new FillLayout());
+
+ ViewContainer viewContainer = new ViewContainer(this, true);
+ viewContainer.setTitleText(FilePageLabels.FILE_DETAILS_TITLE);
+ setMaxWeight(innerMaxWeight, outerMaxWeight);
+
+ Composite contents = viewContainer.getContentArea();
+ contents.setBackground(ColorResources.VIEW_BG_COLOR);
+ contents.setLayout(new FillLayout());
+ canvas = new Canvas(contents, SWT.TRANSPARENT);
+ canvas.addPaintListener(new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ int x = 0;
+ int y = 0;
+ Rectangle rect = canvas.getBounds();
+ e.gc.setBackground(ColorResources.VIEW_BG_COLOR);
+ e.gc.fillRectangle(rect.x, rect.y, rect.width, rect.height);
+ e.gc.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
+ e.gc.setFont(FontResources.DETAIL_INFO_FONT);
+
+ String fName = FilePageLabels.FILE_DETAILS_FILE_NAME + fileName;
+ Point textSize = e.gc.textExtent(fName, SWT.DRAW_MNEMONIC);
+ if (textSize.x > rect.width) {
+ fName = FilePageLabels.FILE_DETAILS_FILE_NAME_NEWLINE
+ + fileName;
+ }
+ int fontHeight = textSize.y + 5;
+ e.gc.drawString(fName, x += 10, y += fontHeight);
+
+ // file path bolck
+ {
+ String pathLabel = FilePageLabels.FILE_DETAILS_FILE_PATH;
+ e.gc.drawString(pathLabel, x, y + fontHeight);
+ Point pathSize = e.gc.textExtent(pathLabel,
+ SWT.DRAW_MNEMONIC);
+ int xPos = x + pathSize.x;
+ int width = rect.width - xPos;
+ String text = filePath;
+ if (text.length() > 0) {
+ while (text.length() > 0) {
+ Point tSize = e.gc.textExtent(text,
+ SWT.DRAW_MNEMONIC);
+ String inputText = AnalyzerLabels.EMPTY_STRING;
+ if (tSize.x > width) {
+ int strLen = (width * text.length()) / tSize.x;
+ inputText += text.substring(0, strLen - 1);
+ text = text.substring(strLen - 1, text.length());
+ } else {
+ inputText += text;
+ text = AnalyzerLabels.EMPTY_STRING;
+ }
+ e.gc.drawString(inputText, xPos, y += fontHeight);
+ }
+ } else {
+ y += fontHeight;
+ }
+ }
+
+ e.gc.drawString(FilePageLabels.FILE_DETAILS_TOTAL_SIZE
+ + Long.toString(fileSize), x, y += fontHeight);
+ e.gc.drawString(
+ FilePageLabels.FILE_DETAILS_READ_SIZE
+ + Long.toString(readSize), x,
+ y += fontHeight);
+ e.gc.drawString(FilePageLabels.FILE_DETAILS_WRITE_SIZE
+ + Long.toString(writeSize), x, y += fontHeight);
+ e.gc.drawString(FilePageLabels.FILE_DETAILS_TOTAL_USE_TIME
+ + Formatter.toTimeFormat(Long.toString(totalUseTime)),
+ x, y += fontHeight);
+ e.gc.drawString(
+ FilePageLabels.FILE_DETAILS_API_COUNT
+ + Integer.toString(apiCount), x,
+ y += fontHeight);
+ e.gc.drawString(FilePageLabels.FILE_DETAILS_FAILED_API_COUNT
+ + Integer.toString(failedApiCount), x, y += fontHeight);
+ }
+ });
+ }
+
+ @Override
+ public void updateView(DASelectionData data) {
+ updateData();
+ }
+
+ @Override
+ public void updateView() {
+ updateData();
+ }
+
+ private void updateData() {
+ FileApiListView view = (FileApiListView) AnalyzerManager
+ .getCurrentPage().getViewMap().get(FileApiListView.ID);
+ if (!(view instanceof FileApiListView)) {
+ return;
+ }
+ FileChartData selectData = view.getPageData();
+
+ if (null == selectData) {
+ return;
+ }
+
+ fileName = selectData.getFileName();
+ filePath = selectData.getFilePath();
+ fileSize = selectData.getFileSize();
+ readSize = selectData.getReadSize();
+ writeSize = selectData.getWriteSize();
+ totalUseTime = (long)selectData.getFileTotalUseTime();
+ apiCount = selectData.getApiCount();
+ failedApiCount = selectData.getFailedApiCount();
+ canvas.redraw();
+ }
+
+ @Override
+ public Control getControl() {
+ return canvas;
+ }
+
+ @Override
+ public void clear() {
+ init();
+ canvas.redraw();
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.file;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallstackView;
+import org.tizen.dynamicanalyzer.ui.info.snapshot.SnapshotView;
+import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
+
+public class FilePage extends DAPageComposite {
+ public static final String ID = FilePage.class.getName();
+ SashForm baseForm;
+ SashForm leftForm;
+ SashForm rightForm;
+
+ public FilePage(Composite parent, int style) {
+ super(parent, style);
+ name = AnalyzerLabels.COOLBAR_AREA_FILE;
+ this.setLayout(new FillLayout());
+
+ baseForm = new SashForm(this, SWT.HORIZONTAL);
+ baseForm.setLayout(new FillLayout());
+
+ leftForm = new SashForm(baseForm, SWT.VERTICAL);
+ FileChartView fileChartView = new FileChartView(leftForm, SWT.NONE);
+ addView(fileChartView);
+ FileApiListView fileApiListView = new FileApiListView(leftForm,
+ SWT.NONE);
+ addView(fileApiListView);
+
+ leftForm.setWeights(new int[] { 60, 40 });
+
+ rightForm = new SashForm(baseForm, SWT.VERTICAL);
+ DATabComposite tabView = new DATabComposite(rightForm, SWT.NONE);
+ addView(tabView);
+ {
+ SnapshotView snapshotView = new SnapshotView(
+ tabView.getContentComposite(), SWT.NONE, false);
+ snapshotView.setObservingViews(new String[] { FileApiListView.ID });
+ tabView.addView(snapshotView, false);
+
+ CallstackView callstack = new CallstackView(
+ tabView.getContentComposite(), SWT.NONE);
+ callstack.setObservingViews(new String[] { FileApiListView.ID });
+ tabView.addView(callstack, false);
+ }
+
+ // FILE_DETAIL = 3;
+ FileDetailInfoView detailInfo = new FileDetailInfoView(rightForm,
+ SWT.NONE);
+ addView(detailInfo);
+
+ rightForm.setWeights(new int[] { 50, 50 });
+ baseForm.setWeights(new int[] { 75, 25 });
+ }
+
+ @Override
+ protected void setFormWeights() {
+ baseForm.setWeights(new int[] { 100 - wRate, wRate });
+ rightForm.setWeights(new int[] { hRate, 100 - hRate });
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.info.callstack;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class CallStackData {
+ protected int seq;
+ protected List<Long> addrs;
+
+ public CallStackData(int seqNum) {
+ seq = seqNum;
+ }
+
+ public int getSeq() {
+ return seq;
+ }
+
+ public List<Long> getAddrs() {
+ if (null == addrs) {
+ addrs = new ArrayList<Long>();
+ }
+ return addrs;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * WooJin Jung <woojin2.jung@samsung.com>
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.info.callstack;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.SymbolManager;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogParser;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfileDataMaker;
+
+public class CallStackManager {
+ class DuplicateUserCall {
+ private CallStackUnit dupCallstackUnit = null;
+ private int dupCallcount = 0;
+
+ public DuplicateUserCall(CallStackUnit callStackUnit) {
+ dupCallstackUnit = callStackUnit;
+ dupCallcount = 1;
+ }
+
+ public CallStackUnit getDupCallstackUnit() {
+ return dupCallstackUnit;
+ }
+
+ public int getDupCallCount() {
+ return dupCallcount;
+ }
+
+ public void increaseDupCallCount() {
+ dupCallcount++;
+ }
+
+ public void decreaseDupCallCount() {
+ dupCallcount--;
+ }
+ }
+
+ private static CallStackManager instance;
+ private HashMap<Long, CallStackUnit> callstackApiByAddrMap;
+ private HashMap<Integer, CallStackData> callstackDataBySeqMap;
+ private String userFunctionBin = null;
+ private HashMap<Integer, List<CallStackUnit>> userCallstackByTidMap;
+ private HashMap<Integer, DuplicateUserCall> dupUserCallByTidMap;
+
+ public static CallStackManager getInstance() {
+ if (null == instance) {
+ instance = new CallStackManager();
+ }
+ return instance;
+ }
+
+ public void makeUserCallstack(String[] input, ProfileDataMaker profiler) {
+ HashMap<Long, CallStackUnit> addrMap = getCallStackApiByAddrMap();
+ boolean isPieBuild = AnalyzerManager.getProject().isPieBuild();
+ String baseAddr = AnalyzerManager.getProject().getBaseAddress();
+ String binPath = AnalyzerManager.getProject().getBinaryPath();
+ if (null == binPath || binPath.isEmpty()) {
+ return;
+ }
+ String strSelfAddr = input[LogCenterConstants.PCADDR_INDEX];
+ String strCallerAddr = input[LogCenterConstants.CALLER_PCADDR_INDEX];
+ String strSeq = input[LogCenterConstants.SEQUENCE_NUMBER_INDEX];
+ String strTid = input[LogCenterConstants.THREAD_ID_INDEX];
+
+ int seq = Integer.parseInt(strSeq);
+ int tid = Integer.parseInt(strTid);
+
+ long selfAddr = Long.parseLong(strSelfAddr);
+ long callerAddr = Long.parseLong(strCallerAddr);
+
+ CallStackData callstackData = new CallStackData(seq);
+ CallStackUnit selfCallstackUnit = addrMap.get(selfAddr);
+
+ if (null == selfCallstackUnit) {
+ String strSelfFuncName = SymbolManager.addr2func(binPath,
+ strSelfAddr, isPieBuild, baseAddr);
+ String strSelfSymbol = getUserFunctionPosition()
+ + AnalyzerConstants.CALLSTACK_API_TOKEN_STRING
+ + strSelfFuncName;
+ selfCallstackUnit = new CallStackUnit(selfAddr, strSelfSymbol);
+ addrMap.put(selfAddr, selfCallstackUnit);
+ }
+
+ // insert call count
+ profiler.makeFupDataForCallTrace(selfCallstackUnit, input);
+
+ List<CallStackUnit> userCallstack = getUserCallstack(tid);
+ int size = userCallstack.size();
+
+ CallStackUnit callerCallstackUnit = addrMap.get(callerAddr);
+ if (null == callerCallstackUnit) {
+ String strCallerFuncName = SymbolManager.addr2func(binPath,
+ strCallerAddr, isPieBuild, baseAddr);
+ String strCallerSymbol = getUserFunctionPosition()
+ + AnalyzerConstants.CALLSTACK_API_TOKEN_STRING
+ + strCallerFuncName;
+ callerCallstackUnit = new CallStackUnit(callerAddr, strCallerSymbol);
+ addrMap.put(callerAddr, callerCallstackUnit);
+ }
+
+ String strEventType = input[LogCenterConstants.USER_FUNCTION_TYPE_INDEX];
+ int eventType = Integer.parseInt(strEventType);
+
+ if (eventType == LogCenterConstants.USER_FUNCTION_EVENT_TYPE_ENTER) {
+ if (size == 0) {
+ userCallstack.add(selfCallstackUnit);
+ } else {
+ if (!AnalyzerManager.isInBinaryRange(strCallerAddr)) {
+ CallStackUnit callbackApi = new CallStackUnit(
+ LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_ADDR,
+ LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_SYMBOL);
+ userCallstack.add(callbackApi);
+ if (addrMap
+ .get(LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_ADDR) == null) {
+ CallStackUnit defaultCallstackUnit = new CallStackUnit(
+ LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_ADDR,
+ LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_SYMBOL);
+ addrMap.put(
+ LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_ADDR,
+ defaultCallstackUnit);
+ }
+ } else {
+ CallStackUnit callerCsa = addrMap.get(callerAddr);
+ if (null == callerCsa) {
+ callerCsa = userCallstack.get(size - 1);
+ callerCsa.setFunctionStartAddr(callerCsa.getAddr());
+ callerCsa.setAddr(callerAddr);
+ } else {
+ callerCsa.setFunctionStartAddr(userCallstack.get(
+ size - 1).getAddr());
+ userCallstack.set(size - 1, callerCsa);
+ }
+ }
+ userCallstack.add(selfCallstackUnit);
+ }
+ size = userCallstack.size();
+ for (int i = size - 1; i >= 0; i--) {
+ callstackData.getAddrs().add(userCallstack.get(i).getAddr());
+ }
+ getCallStackDataBySeqMap().put(seq, callstackData);
+ } else if (eventType == LogCenterConstants.USER_FUNCTION_EVENT_TYPE_EXIT) {
+ CallStackUnit removeCallStackUnit = userCallstack.get(size - 1);
+ if (selfCallstackUnit.getFunctionName().equals(
+ removeCallStackUnit.getFunctionName())) {
+ userCallstack.remove(size - 1);
+ if (size - 2 > 0) {
+ CallStackUnit checkCallStackUnit = userCallstack
+ .get(size - 2);
+ if (checkCallStackUnit.getFunctionName().equals(
+ LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC)) {
+ userCallstack.remove(size - 2);
+ }
+ }
+ size = userCallstack.size();
+ if (size > 0) {
+ CallStackUnit prevCallstackUnit = userCallstack
+ .get(size - 1);
+ long prevSelfAddr = prevCallstackUnit
+ .getFunctionStartAddr();
+ CallStackUnit callerCsa = addrMap.get(prevSelfAddr);
+ if (null == callerCsa) {
+ prevCallstackUnit.setAddr(prevSelfAddr);
+ } else {
+ userCallstack.set(size - 1, callerCsa);
+ }
+ }
+ }
+ if (AnalyzerManager.isOsp()) {
+ String apiName = input[LogCenterConstants.APINAME_INDEX];
+ if (apiName.equals("OspMain")) { //$NON-NLS-1$
+ LogParser.setDropCallTraceLog(true);
+ }
+ }
+ }
+ }
+
+ public void makeCallstackWithoutBacktrace(String[] input) {
+ HashMap<Long, CallStackUnit> addrMap = getCallStackApiByAddrMap();
+ boolean isPieBuild = AnalyzerManager.getProject().isPieBuild();
+ String baseAddr = AnalyzerManager.getProject().getBaseAddress();
+ String binPath = AnalyzerManager.getProject().getBinaryPath();
+ if (null == binPath || binPath.isEmpty()) {
+ return;
+ }
+ String strSeq = input[LogCenterConstants.SEQUENCE_NUMBER_INDEX];
+ String strTid = input[LogCenterConstants.THREAD_ID_INDEX];
+ String strCallerAddr = input[LogCenterConstants.CALLER_PCADDR_INDEX];
+
+ int seq = Integer.parseInt(strSeq);
+ int tid = Integer.parseInt(strTid);
+ long callerAddr = 0;
+ if (!strCallerAddr.isEmpty()) {
+ callerAddr = Long.parseLong(strCallerAddr);
+ } else {
+ CallStackData callstackData = new CallStackData(seq);
+ getCallStackDataBySeqMap().put(seq, callstackData);
+ return;
+ }
+
+ List<CallStackUnit> probeCallstack = new ArrayList<CallStackUnit>(
+ getUserCallstack(tid));
+ int size = probeCallstack.size();
+
+ CallStackData callstackData = new CallStackData(seq);
+
+ if ((size == 0) || (!AnalyzerManager.isInBinaryRange(strCallerAddr))) {
+ CallStackUnit callbackApi = new CallStackUnit(
+ LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_ADDR,
+ LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_SYMBOL);
+ probeCallstack.add(callbackApi);
+ if (addrMap
+ .get(LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_ADDR) == null) {
+ CallStackUnit defaultCallstackUnit = new CallStackUnit(
+ LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_ADDR,
+ LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_SYMBOL);
+ addrMap.put(
+ LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC_ADDR,
+ defaultCallstackUnit);
+ }
+ } else {
+ CallStackUnit callerCallstackUnit = addrMap.get(callerAddr);
+ if (null == callerCallstackUnit) {
+ String strCallerFuncName = SymbolManager.addr2func(binPath,
+ strCallerAddr, isPieBuild, baseAddr);
+ String strCallerSymbol = getUserFunctionPosition()
+ + AnalyzerConstants.CALLSTACK_API_TOKEN_STRING
+ + strCallerFuncName;
+ callerCallstackUnit = new CallStackUnit(callerAddr,
+ strCallerSymbol);
+ addrMap.put(callerAddr, callerCallstackUnit);
+ }
+
+ CallStackUnit topUserCallstack = probeCallstack.get(size - 1);
+ if (callerCallstackUnit.getFunctionName().equals(
+ topUserCallstack.getFunctionName())) {
+ probeCallstack.set(size - 1, callerCallstackUnit);
+ } else {
+ System.out
+ .println("bug : probe caller is not the same as top of user callstack"); //$NON-NLS-1$
+ }
+ }
+
+ size = probeCallstack.size();
+ for (int i = size - 1; i >= 0; i--) {
+ callstackData.getAddrs().add(probeCallstack.get(i).getAddr());
+ }
+ getCallStackDataBySeqMap().put(seq, callstackData);
+
+ }
+
+ // check irregular enter/exit log (multiple logs from 1 function call)
+ public boolean isIrregularUserCall(String[] input) {
+ HashMap<Long, CallStackUnit> addrMap = getCallStackApiByAddrMap();
+ HashMap<Integer, DuplicateUserCall> dupUserCallMap = getDupUserCallByTidMap();
+
+ boolean isPieBuild = AnalyzerManager.getProject().isPieBuild();
+ String baseAddr = AnalyzerManager.getProject().getBaseAddress();
+ String binPath = AnalyzerManager.getProject().getBinaryPath();
+ if (null == binPath || binPath.isEmpty()) {
+ return false;
+ }
+
+ String strSelfAddr = input[LogCenterConstants.PCADDR_INDEX];
+ String strTid = input[LogCenterConstants.THREAD_ID_INDEX];
+
+ int tid = Integer.parseInt(strTid);
+ long selfAddr = Long.parseLong(strSelfAddr);
+
+ CallStackUnit selfCallstackUnit = addrMap.get(selfAddr);
+
+ if (null == selfCallstackUnit) {
+ String strSelfFuncName = SymbolManager.addr2func(binPath,
+ strSelfAddr, isPieBuild, baseAddr);
+ String strSelfSymbol = getUserFunctionPosition()
+ + AnalyzerConstants.CALLSTACK_API_TOKEN_STRING
+ + strSelfFuncName;
+ selfCallstackUnit = new CallStackUnit(selfAddr, strSelfSymbol);
+ addrMap.put(selfAddr, selfCallstackUnit);
+ }
+
+ List<CallStackUnit> userCallstack = getUserCallstack(tid);
+ int size = userCallstack.size();
+
+ String strEventType = input[LogCenterConstants.USER_FUNCTION_TYPE_INDEX];
+ int eventType = Integer.parseInt(strEventType);
+
+ if (size > 0) {
+ if (eventType == LogCenterConstants.USER_FUNCTION_EVENT_TYPE_ENTER) {
+ CallStackUnit topCallstackUnit = userCallstack.get(size - 1);
+ if (topCallstackUnit.equals(selfCallstackUnit)) {
+ DuplicateUserCall dupUserCall = dupUserCallMap.get(tid);
+ if (null == dupUserCall) {
+ dupUserCall = new DuplicateUserCall(selfCallstackUnit);
+ dupUserCallMap.put(tid, dupUserCall);
+ } else {
+ if (dupUserCall.getDupCallstackUnit().equals(
+ selfCallstackUnit)) {
+ dupUserCall.increaseDupCallCount();
+ } else {
+ System.out
+ .println("makeUserCallstack : dup callstack check error"); //$NON-NLS-1$
+ }
+ }
+ return true;
+ }
+ } else if (eventType == LogCenterConstants.USER_FUNCTION_EVENT_TYPE_EXIT) {
+ DuplicateUserCall dupUserCall = dupUserCallMap.get(tid);
+ if (null != dupUserCall) {
+ if (dupUserCall.getDupCallstackUnit().equals(
+ selfCallstackUnit)) {
+ dupUserCall.decreaseDupCallCount();
+ if (0 == dupUserCall.getDupCallCount()) {
+ dupUserCallMap.remove(tid);
+ }
+ } else {
+ System.out
+ .println("makeUserCallstack : dup callstack check error"); //$NON-NLS-1$
+ }
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public HashMap<Long, CallStackUnit> getCallStackApiByAddrMap() {
+ if (null == callstackApiByAddrMap) {
+ callstackApiByAddrMap = new HashMap<Long, CallStackUnit>();
+ }
+ return callstackApiByAddrMap;
+ }
+
+ public HashMap<Integer, CallStackData> getCallStackDataBySeqMap() {
+ if (null == callstackDataBySeqMap) {
+ callstackDataBySeqMap = new HashMap<Integer, CallStackData>();
+ }
+ return callstackDataBySeqMap;
+ }
+
+ public HashMap<Integer, DuplicateUserCall> getDupUserCallByTidMap() {
+ if (null == dupUserCallByTidMap) {
+ dupUserCallByTidMap = new HashMap<Integer, DuplicateUserCall>();
+ }
+ return dupUserCallByTidMap;
+ }
+
+ public String getUserFunctionPosition() {
+ if (userFunctionBin == null || userFunctionBin.isEmpty()) {
+ if (AnalyzerManager.isOsp()) {
+ userFunctionBin = new String(DACommunicator.getSelectedApp()
+ .getExecPath() + ".exe"); //$NON-NLS-1$
+ } else {
+ userFunctionBin = new String(DACommunicator.getSelectedApp()
+ .getExecPath());
+ }
+ }
+ return userFunctionBin;
+ }
+
+ public List<CallStackUnit> getUserCallstack(int tid) {
+ if (null == userCallstackByTidMap) {
+ userCallstackByTidMap = new HashMap<Integer, List<CallStackUnit>>();
+ }
+ List<CallStackUnit> userCallstack = userCallstackByTidMap.get(tid);
+ if (null == userCallstack) {
+ userCallstack = new ArrayList<CallStackUnit>();
+ userCallstackByTidMap.put(tid, userCallstack);
+ }
+ return userCallstack;
+ }
+
+ public CallStackData getCallStack(String seqNum) {
+ int seq = Integer.parseInt(seqNum);
+ return getCallStackDataBySeqMap().get(seq);
+ }
+
+ public boolean checkUserCall(String input) {
+ if (input.contains(AnalyzerConstants.USER_BIN_POS)) {
+ return true;
+ }
+ return false;
+ }
+
+ public boolean isUserCall(String input) {
+ if (!input.contains(LogCenterConstants.USER_FUNCTION_CALLBACK_FUNC)) {
+ return true;
+ }
+ return false;
+ }
+
+ public String getPCAddrBySeq(int seq) {
+ HashMap<Integer, CallStackData> cdMap = getCallStackDataBySeqMap();
+ if (null == cdMap) {
+ return null;
+ }
+ CallStackData csd = cdMap.get(seq);
+ if (null == csd) {
+ return null;
+ }
+ List<Long> addrs = csd.getAddrs();
+ if (null == addrs || addrs.isEmpty()) {
+ return null;
+ }
+ return Long.toString(addrs.get(0));
+ }
+
+ public static void clear() {
+ instance = null;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * WooJin Jung <woojin2.jung@samsung.com>
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.info.callstack;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.common.SymbolManager;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
+import org.tizen.dynamicanalyzer.nl.InformationViewLabels;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;
+
+public class CallStackUnit {
+ private final String UNKNOWN_LIBRARY = InformationViewLabels.CALLSTACK_TABLE_UNKNOWN_LIBRARY;
+ private final String UNKNOWN_FUNCTION = InformationViewLabels.CALLSTACK_TABLE_UNKNOWN_FUNCTION;
+ private long address;
+ private long functionStartAddress;
+ private String originSymbol;
+ private String path;
+ private String functionName;
+ private String offset;
+ private String etc;
+
+ public CallStackUnit(long addr, String symbol) {
+ address = addr;
+ functionStartAddress = addr;
+ this.originSymbol = symbol;
+
+ functionName = ""; //$NON-NLS-1$
+ offset = ""; //$NON-NLS-1$
+ etc = ""; //$NON-NLS-1$
+ makeCallstackData();
+ }
+
+ private void makeCallstackData() {
+
+ String[] splitPath = originSymbol.split("\\("); //$NON-NLS-1$
+ path = splitPath[0];
+ if (!path.startsWith("/") && !path.contains(FunctionUsageProfiler.APPLICATION) //$NON-NLS-1$
+ && !path.contains(FunctionUsageProfiler.DEPENDENT_LIB)) {
+ path = UNKNOWN_LIBRARY;
+ }
+
+ if (splitPath.length < 2) {
+ boolean isPieBuild = AnalyzerManager.getProject().isPieBuild();
+ String baseAddr = AnalyzerManager.getProject().getBaseAddress();
+ String binPath = AnalyzerManager.getProject().getBinaryPath();
+
+ functionName = SymbolManager.addr2func(binPath,
+ Long.toString(address), isPieBuild, baseAddr);
+ // FIXME: hard coding
+ if (null == functionName || functionName.isEmpty()
+ || functionName.equals("_end")) { //$NON-NLS-1$
+ functionName = UNKNOWN_FUNCTION;
+ } else {
+ String prevFunctionName = functionName;
+ functionName = SymbolManager
+ .demanglingFunctionName(prevFunctionName);
+ }
+ } else {
+ if (DACommunicator.isDeviceConnected()
+ && path.equals(DACommunicator.getSelectedApp()
+ .getExecPath()) && AnalyzerManager.isOsp()) {
+ path += ".exe"; //$NON-NLS-1$
+ }
+
+ String[] splitFunc = splitPath[1].split("\\+"); //$NON-NLS-1$
+ if (splitFunc.length != 0) {
+ functionName = splitFunc[0];
+ if (functionName.isEmpty()) {
+ boolean isPieBuild = AnalyzerManager.getProject()
+ .isPieBuild();
+ String baseAddr = AnalyzerManager.getProject()
+ .getBaseAddress();
+ String binPath = AnalyzerManager.getProject()
+ .getBinaryPath();
+
+ functionName = SymbolManager.addr2func(binPath,
+ Long.toString(address), isPieBuild, baseAddr);
+ }
+ if (null == functionName || functionName.isEmpty()
+ || functionName.equals("_end")) { //$NON-NLS-1$
+ functionName = UNKNOWN_FUNCTION;
+ } else {
+ String prevFunctionName = functionName;
+ functionName = SymbolManager
+ .demanglingFunctionName(prevFunctionName);
+ }
+ }
+ }
+ }
+
+ public long getAddr() {
+ return address;
+ }
+
+ public long getFunctionStartAddr() {
+ return functionStartAddress;
+ }
+
+ public String getOriginSymbol() {
+ return originSymbol;
+ }
+
+ public String getSymbol() {
+ // if
+ // (functionName.equals(InformationViewLabels.CALLSTACK_TABLE_UNKNOWN))
+ // {
+ // return path;
+ // }
+ return path + CommonConstants.OPEN_BRACKET + functionName;
+ }
+
+ public void setAddr(long addr) {
+ address = addr;
+ }
+
+ public void setFunctionStartAddr(long addr) {
+ functionStartAddress = addr;
+ }
+
+ public String getFunctionName() {
+ return functionName;
+ }
+
+ public String getOffset() {
+ return offset;
+ }
+
+ public String getEtc() {
+ return etc;
+ }
+
+ public String getPath() {
+ return path;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.info.callstack;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.model.TableInput;
+import org.tizen.dynamicanalyzer.ui.file.FileChartView;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfilingView;
+import org.tizen.dynamicanalyzer.ui.userinterface.profiling.UIFunctionProfilingView;
+import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
+import org.tizen.dynamicanalyzer.utils.Formatter;
+
+public class CallstackTable extends DATableComposite {
+
+ public CallstackTable(Composite parent, int compStyle, int tableStyle) {
+ super(parent, compStyle, tableStyle);
+
+ table.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ AnalyzerManager.getCurrentPage().controlSelection(
+ DATabComposite.ID);
+ GridItem[] sels = table.getSelection();
+ if (sels.length < 0) {
+ return;
+ }
+ table.setFocusItem(sels[0]);
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+ });
+ }
+
+ @Override
+ public void updateTable() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void updateCallstackTable(DASelectionData selData) {
+ table.removeAll();
+ if (null == selData) {
+ return;
+ }
+ String viewId = selData.getViewId();
+ if (null == viewId || viewId.isEmpty()
+ || viewId.equals(FileChartView.ID)
+ || viewId.equals(UIFunctionProfilingView.ID)
+ || viewId.equals(FunctionUsageProfilingView.ID)) {
+ return;
+ }
+ Object obj = selData.getData();
+ if (obj instanceof GridItem[]) {
+ GridItem[] items = (GridItem[]) obj;
+ if (items.length <= 0) {
+ return;
+ }
+ DATableDataFormat tableData = (DATableDataFormat) items[0]
+ .getData();
+ List<String> logData = tableData.getData();
+ if (logData.size() <= LogCenterConstants.SEQUENCE_NUMBER_INDEX) {
+ return;
+ }
+ String seq = logData.get(LogCenterConstants.SEQUENCE_NUMBER_INDEX);
+ if (null != seq && !seq.isEmpty()) {
+ int seqNum = Integer.parseInt(seq);
+ HashMap<Integer, CallStackData> cdMap = CallStackManager.getInstance()
+ .getCallStackDataBySeqMap();
+ HashMap<Long, CallStackUnit> addrMap = CallStackManager.getInstance()
+ .getCallStackApiByAddrMap();
+ if (null == cdMap || null == addrMap) {
+ return;
+ }
+ CallStackData csd = cdMap.get(seqNum);
+ if (null == csd) {
+ return;
+ }
+
+ List<Long> addrs = csd.getAddrs();
+ int size = addrs.size();
+ for (int i = 0; i < size; i++) {
+ CallStackUnit api = addrMap.get(addrs.get(i));
+
+ String addr = Formatter
+ .toHexString(addrs.get(i).toString());
+ String path = api.getPath();
+ // if path has "da_probe.so" then reject
+ if (path.contains(AnalyzerConstants.PROBE_LIB_TIZEN)
+ || path.contains(AnalyzerConstants.PROBE_LIB_OSP)) {
+ return;
+ }
+ GridItem gridItem = new GridItem(table, SWT.NONE);
+
+ // setData block
+ {
+ String addrStr = Long.toString(addrs.get(i));
+ DATableDataFormat callstackTableData = new DATableDataFormat(
+ addrStr);
+ List<String> data = new ArrayList<String>();
+ // 99 means "table type callstack"
+ data.add("99"); //$NON-NLS-1$
+ callstackTableData.getData().addAll(data);
+ callstackTableData.setObject(addrStr);
+ gridItem.setData(callstackTableData);
+ }
+
+ String addrInput = (addrs.get(i) == 0) ? "" : addr; //$NON-NLS-1$
+ gridItem.setText(1, addrInput);
+
+// String fName = InformationViewLables.CALLSTACK_TABLE_UNKNOWN;
+ String fName = api.getFunctionName();
+// if (apiData.length > 1) {
+// fName = new String(apiData[1]);
+// } else {
+// String binPath = AnalyzerManager.getProject()
+// .getBinaryPath();
+// boolean isPieBuild = AnalyzerManager.getProject()
+// .isPieBuild();
+// String baseAddr = AnalyzerManager.getProject()
+// .getBaseAddress();
+// String addrStr = Long.toString(addrs.get(i));
+// if (AnalyzerManager.isInBinaryRange(addrStr)) {
+// fName = SymbolManager.addr2func(binPath, addrStr,
+// isPieBuild, baseAddr);
+// fName = SymbolNameDemangler.nameDemangle(fName);
+// }
+// }
+
+// if (CallStackManager.getInstance().checkUserCall(path)) {
+// gridItem.setForeground(ColorResources.TITLEBAR_TEXT_COLOR);
+// }
+
+ gridItem.setText(0, fName);
+ gridItem.setText(2, path);
+// apiData = null;
+ }
+ }
+ }
+
+ }
+
+ @Override
+ protected List<TableInput> makeTableInput() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.info.callstack;
+
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.model.DAView;
+import org.tizen.dynamicanalyzer.nl.InformationViewLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.ui.page.ViewAction;
+import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
+
+public class CallstackView extends DAView {
+ public static final String ID = CallstackView.class.getName();
+
+ private DATableComposite callstackTableComp = null;
+ private String[] columnNames = {
+ InformationViewLabels.CALLSTACK_VIEW_FUNCTION,
+ InformationViewLabels.CALLSTACK_VIEW_ADDRESS,
+ InformationViewLabels.CALLSTACK_VIEW_BINARY_PATH };
+ private int[] columnSizes = { 120, 70, 400 };
+ private boolean[] columnVisibility = { true, true, true };
+ private String[] observingViews = null;
+ Composite contents = null;
+
+ public CallstackView(Composite parent, int style) {
+ super(parent, style);
+ name = InformationViewLabels.CALLSTACK_VIEW_TITLE;
+ this.setLayout(new FillLayout());
+ ViewContainer viewContainer = new ViewContainer(this, false);
+ viewContainer.setTitleText(InformationViewLabels.CALLSTACK_VIEW_TITLE);
+
+ contents = viewContainer.getContentArea();
+ contents.setBackground(ColorResources.WINDOW_BG_COLOR);
+ contents.setLayout(new FillLayout());
+
+ callstackTableComp = new CallstackTable(contents, SWT.NONE, SWT.SINGLE
+ | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
+ callstackTableComp.setTableName("Callstack"); //$NON-NLS-1$
+ callstackTableComp.setColumns(columnNames);
+ callstackTableComp.setColumnSize(columnSizes);
+ callstackTableComp.setColumnVisibility(columnVisibility);
+
+ contents.addControlListener(new TableColumnSizePackListener(
+ callstackTableComp, columnSizes));
+ }
+
+ public void setObservingViews(String[] viewIds) {
+ observingViews = viewIds;
+ }
+
+ public String[] getObservingViews() {
+ return observingViews;
+ }
+
+ @Override
+ public void updateView() {
+ if (null == observingViews) {
+ return;
+ }
+ int size = observingViews.length;
+ for (int i = 0; i < size; i++) {
+ ViewAction view = AnalyzerManager.getCurrentPage().getView(
+ observingViews[i]);
+ Control control = view.getControl();
+ Grid table = null;
+ if (control instanceof DATableComposite) {
+ table = ((DATableComposite) control).getTable();
+ } else if (control instanceof DATreeComposite) {
+ table = ((DATreeComposite) control).getTable();
+ } else {
+ continue;
+ }
+ if (table.getSelectionCount() > 0) {
+ GridItem[] selection = table.getSelection();
+ List<String> startData = ((DATableDataFormat) selection[0]
+ .getData()).getData();
+ List<String> endData = ((DATableDataFormat) selection[selection.length - 1]
+ .getData()).getData();
+ long startTime = Long.parseLong(startData
+ .get(LogCenterConstants.TIME_INDEX));
+ long endTime = Long.parseLong(endData
+ .get(LogCenterConstants.TIME_INDEX));
+ DASelectionData data = new DASelectionData(observingViews[i],
+ startTime, endTime, selection, table);
+ updateView(data);
+ return;
+ }
+ }
+ clear();
+ }
+
+ @Override
+ public void updateView(DASelectionData data) {
+ ((CallstackTable) callstackTableComp).updateCallstackTable(data);
+ }
+
+ @Override
+ public void clear() {
+ callstackTableComp.clear();
+ }
+
+ @Override
+ public Control getControl() {
+ return callstackTableComp;
+ }
+
+ @Override
+ public void setSelection(List<String> data) {
+ updateView();
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.info.score;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.model.DAView;
+import org.tizen.dynamicanalyzer.nl.InformationViewLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
+
+public class ScoreView extends DAView {
+
+ public static final String ID = ScoreView.class.getName();
+
+ private Canvas scoreBoard = null;
+ private Canvas scoreInfo = null;
+
+ private int failCount = 0;
+ private int leakSize = 0;
+ private int warningSize = 0;
+ @SuppressWarnings("unused")
+ private int electricEnergy = 0;
+ private int score = 99;
+ // Score Image
+ private List<Image> scoreImage = null;
+ private List<String> columnString = null;
+ private List<Integer> columnValue = null;
+
+ public ScoreView(Composite parent, int style) {
+ super(parent, style);
+ this.setLayout(new FillLayout());
+
+ if (null == scoreImage) {
+ scoreImage = new ArrayList<Image>();
+ scoreImage.add(ImageResources.SCORE_0);
+ scoreImage.add(ImageResources.SCORE_1);
+ scoreImage.add(ImageResources.SCORE_2);
+ scoreImage.add(ImageResources.SCORE_3);
+ scoreImage.add(ImageResources.SCORE_4);
+ scoreImage.add(ImageResources.SCORE_5);
+ scoreImage.add(ImageResources.SCORE_6);
+ scoreImage.add(ImageResources.SCORE_7);
+ scoreImage.add(ImageResources.SCORE_8);
+ scoreImage.add(ImageResources.SCORE_9);
+ }
+ if (null == columnString) {
+ columnString = new ArrayList<String>();
+ columnString.add(InformationViewLabels.SCORE_VIEW_FAIL_COUNT);
+ columnString.add(InformationViewLabels.SCORE_VIEW_LEAK_SIZE);
+ columnString.add(InformationViewLabels.SCORE_VIEW_WARNING_COUNT);
+ columnString.add(InformationViewLabels.SCORE_VIEW_ELECTRIC_ENERGY);
+ }
+ if (null == columnValue) {
+ columnValue = new ArrayList<Integer>();
+ columnValue.add(0);
+ columnValue.add(0);
+ columnValue.add(0);
+ columnValue.add(0);
+ }
+
+ ViewContainer viewContainer = new ViewContainer(this, false);
+ viewContainer.setTitleText(InformationViewLabels.SCORE_VIEW_SCORE);
+ Composite contents = viewContainer.getContentArea();
+ contents.setBackground(ColorResources.TABLE_CONTENTS_NORMAL);
+ contents.setLayout(new FormLayout());
+ scoreBoard = new Canvas(contents, SWT.TRANSPARENT);
+ scoreBoard.addPaintListener(new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ int x = 0;
+ int y = 0;
+ Rectangle rect = scoreBoard.getBounds();
+ e.gc.setBackground(ColorResources.BLACK);
+ e.gc.fillRectangle(rect.x, rect.y, rect.width, rect.height);
+ e.gc.setForeground(ColorResources.TITLEBAR_TEXT_COLOR);
+ e.gc.setFont(FontResources.SCORE_TITLE_FONT);
+
+ Point textSize = e.gc.textExtent(
+ InformationViewLabels.SCORE_VIEW_SCORE,
+ SWT.DRAW_MNEMONIC);
+ x = (rect.width - textSize.x) / 2;
+
+ e.gc.drawString(InformationViewLabels.SCORE_VIEW_SCORE, x,
+ y += 5);
+ e.gc.drawLine(x = 1, y += 25, rect.width - 2, y);
+
+ // draw score
+ e.gc.drawImage(scoreImage.get(score / 100), x = 12, y += 18);
+ e.gc.drawImage(scoreImage.get((score / 10) % 10), x += 57, y);
+ e.gc.drawImage(scoreImage.get(score % 10), x += 57, y);
+ }
+ });
+
+ scoreInfo = new Canvas(contents, SWT.TRANSPARENT);
+ scoreInfo.addPaintListener(new PaintListener() {
+ @Override
+ public void paintControl(PaintEvent e) {
+ Rectangle colRect = new Rectangle(0, 0, 0, 30);
+ Point textSize;
+ int x, y;
+ for (int i = 0; i < 4; i++) {
+ colRect.width = 110;
+ e.gc.setBackground(ColorResources.SNAPSHOT_VIEW_TABLE_TITLE_BG);
+ e.gc.fillRectangle(colRect);
+ e.gc.setForeground(ColorResources.SNAPSHOT_VIEW_TABLE_LINE);
+ e.gc.drawRectangle(colRect);
+ e.gc.setForeground(ColorResources.SNAPSHOT_VIEW_TABLE_TITLE_TEXT);
+ e.gc.setFont(FontResources.TABLE_CELL_FONT);
+ textSize = e.gc.textExtent(columnString.get(i),
+ SWT.DRAW_MNEMONIC);
+ x = (colRect.width - textSize.x) / 2;
+ y = colRect.y + (colRect.height - textSize.y) / 2;
+ e.gc.drawString(columnString.get(i), x, y);
+
+ colRect.x += 110;
+ colRect.width = 84;
+ e.gc.setBackground(ColorResources.SNAPSHOT_VIEW_TABLE_CONTENTS_BG);
+ e.gc.fillRectangle(colRect);
+ e.gc.setForeground(ColorResources.SNAPSHOT_VIEW_TABLE_LINE);
+ e.gc.drawRectangle(colRect);
+ e.gc.setForeground(ColorResources.SNAPSHOT_VIEW_TABLE_CONTENTS_TEXT);
+ e.gc.setFont(FontResources.TABLE_CELL_FONT);
+ textSize = e.gc.textExtent(columnValue.get(i).toString(),
+ SWT.DRAW_MNEMONIC);
+ x = colRect.x + (colRect.width - textSize.x) / 2;
+ y = colRect.y + (colRect.height - textSize.y) / 2;
+ e.gc.drawString(columnValue.get(i).toString(), x, y);
+ colRect.y += 30;
+ colRect.x = 0;
+ }
+ // Rectangle colRect =
+ // height=30;
+ // y=0;
+ // for(int i=0; i<4; i++){
+ // x=0;
+ // width=110;
+ // for(int j=0; j<2; j++){
+ // e.gc.setBackground(ColorResources.SNAPSHOT_VIEW_TABLE_TITLE_BG);
+ // e.gc.fillRectangle(x, y, width, height);
+ // e.gc.setForeground(ColorResources.SNAPSHOT_VIEW_TABLE_LINE);
+ // e.gc.drawRectangle(x, y, width, height);
+ // x+=width;
+ // width=84;
+ // }
+ // y+=height;
+ // }
+ // e.gc.setForeground(ColorResources.SNAPSHOT_VIEW_TABLE_LINE);
+ // e.gc.setBackground(ColorResources.SNAPSHOT_VIEW_TABLE_TITLE_BG);
+ // e.gc.drawRectangle(rect.x, y=0, rect.width-2, 30);
+ // e.gc.drawRectangle(rect.x, y+=30, rect.width-2, 30);
+ // e.gc.drawRectangle(rect.x, y+=30, rect.width-2, 30);
+ // e.gc.drawRectangle(rect.x, y+=30, rect.width-2, 30);
+ // e.gc.setForeground(ColorResources.SNAPSHOT_VIEW_TABLE_TITLE_TEXT);
+ // e.gc.fillRectangle(x, y, x+=110, rect.height);
+ // e.gc.setBackground(ColorResources.SNAPSHOT_VIEW_TABLE_CONTENTS_BG);
+ // e.gc.setForeground(ColorResources.SNAPSHOT_VIEW_TABLE_CONTENTS_TEXT);
+ // e.gc.fillRectangle(x, y, 84, rect.height);
+ //
+ //
+ //
+ // e.gc.setFont(FontResources.SCORE_TITLE_FONT);
+ //
+ // Point textSize = e.gc.textExtent("Score", SWT.DRAW_MNEMONIC);
+ // x = (rect.width - textSize.x)/2;
+ //
+ // e.gc.drawString("Score", x, y += 5);
+ //
+ //
+ // //draw score
+ }
+ });
+
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.left = new FormAttachment(0, 1);
+ data.right = new FormAttachment(100, -1);
+
+ data.height = 132;
+ scoreBoard.setLayoutData(data);
+
+ data = new FormData();
+ data.top = new FormAttachment(scoreBoard, 13);
+ data.left = new FormAttachment(0, 1);
+ data.right = new FormAttachment(100, -1);
+ data.height = 122;
+
+ scoreInfo.setLayoutData(data);
+ }
+
+ @Override
+ public void updateView() {
+ failCount = AnalyzerManager.getFailedChecker().getFailedList().size();
+ leakSize = AnalyzerManager.getLeakDetector().getLeakDataList().size();
+ warningSize = AnalyzerManager.getWarningChecker().getWarningData().size();
+ columnValue.set(0, failCount);
+ columnValue.set(1, leakSize);
+ columnValue.set(2, warningSize);
+ scoreInfo.redraw();
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.info.snapshot;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+
+public class IconView extends Composite {
+
+ protected Canvas canvas = null;
+ protected List<Image> images = null;
+ protected String[] tooltips = null;
+ protected int imageCount = 0;
+ protected Image selectedImage = null;
+ protected Color bg = ColorResources.RED;
+
+ public IconView(Composite parent, int style) {
+ super(parent, style);
+ this.setLayout(new FormLayout());
+ canvas = new Canvas(this, SWT.TRANSPARENT | SWT.DOUBLE_BUFFERED);
+ canvas.addPaintListener(paintListener);
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.bottom = new FormAttachment(100, 0);
+ data.left = new FormAttachment(0, 0);
+ data.right = new FormAttachment(100, 0);
+ canvas.setLayoutData(data);
+ }
+
+ public List<Image> getImages() {
+ if (null == images) {
+ images = new ArrayList<Image>();
+ }
+ return images;
+ }
+
+ public void setTooltips(String[] strings) {
+ if (strings != null) {
+ tooltips = strings;
+ }
+ }
+
+ public void setImages(List<Image> input) {
+ getImages().addAll(input);
+ imageCount = input.size();
+ }
+
+ private PaintListener paintListener = new PaintListener() {
+ @Override
+ public void paintControl(PaintEvent e) {
+ Rectangle rect = canvas.getBounds();
+ if (selectedImage != null && !selectedImage.isDisposed()) {
+ e.gc.drawImage(selectedImage, rect.x, rect.y);
+ } else {
+ e.gc.setBackground(bg);
+ e.gc.fillRectangle(rect);
+ }
+ }
+ };
+
+ public void setSelection(int sel) {
+ if (imageCount > 0 && sel < imageCount) {
+ selectedImage = getImages().get(sel);
+ } else {
+ selectedImage = null;
+ }
+
+ if (null != tooltips && tooltips.length > sel) {
+ canvas.setToolTipText(tooltips[sel]);
+ } else {
+ canvas.setToolTipText(null);
+ }
+ }
+
+ public void clear() {
+ getImages().clear();
+ tooltips = null;
+ imageCount = getImages().size();
+ selectedImage = null;
+ canvas.redraw();
+ }
+
+ public void setBackgroundColor(Color color) {
+ bg = color;
+ }
+
+ public void update() {
+ canvas.redraw();
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.info.snapshot;
+
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Display;
+
+public class ImageSelectionListener implements SelectionListener {
+
+ @Override
+ public void widgetSelected(final SelectionEvent e) {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+
+// String[] data = null;
+// if (e.widget instanceof Grid) {
+// final Grid table = (Grid) e.widget;
+// GridItem[] ti = table.getSelection();
+// // get center id
+// if (null == ti || 0 == ti.length) {
+// return;
+// }
+// data = (String[]) ti[0].getData();
+// }
+
+ //TODO:implements action
+ }
+ });
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.info.snapshot;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.common.SnapshotConstants;
+import org.tizen.dynamicanalyzer.model.ImageInfo;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+
+public class ImageViewer extends Composite {
+
+ class ImageData {
+ public GC gc;
+ public int imgWidth;
+ public int imgHeight;
+ public int marginX;
+ public int marginY;
+ public int maxImageWidth;
+ public int maxImageHeight;
+ public int minImageWidth;
+ public int minImageHeight;
+ public double imgWidthRate;
+ public double imgHeightRate;
+
+ public ImageData(int type) {
+ gc = null;
+
+ if (type == SnapshotConstants.IMAGE_TYPE_WIDE) {
+ imgWidth = SnapshotConstants.DEFAULT_W_IMAGE_WIDTH;
+ imgHeight = SnapshotConstants.DEFAULT_W_IMAGE_HEIGHT;
+ marginX = SnapshotConstants.DEFAULT_IMAGE_MARGIN_X;
+ marginY = SnapshotConstants.DEFAULT_IMAGE_MARGIN_Y;
+ maxImageWidth = SnapshotConstants.MAX_W_IMAGE_WIDTH;
+ maxImageHeight = SnapshotConstants.MAX_W_IMAGE_HEIGHT;
+ minImageWidth = SnapshotConstants.MIN_W_IMAGE_WIDTH;
+ minImageHeight = SnapshotConstants.MIN_W_IMAGE_HEIGHT;
+ imgWidthRate = SnapshotConstants.W_IMAGE_WIDTH_RATE;
+ imgHeightRate = SnapshotConstants.W_IMAGE_HEIGHT_RATE;
+ } else {
+ imgWidth = SnapshotConstants.DEFAULT_IMAGE_WIDTH;
+ imgHeight = SnapshotConstants.DEFAULT_IMAGE_HEIGHT;
+ marginX = SnapshotConstants.DEFAULT_IMAGE_MARGIN_X;
+ marginY = SnapshotConstants.DEFAULT_IMAGE_MARGIN_Y;
+ maxImageWidth = SnapshotConstants.MAX_IMAGE_WIDTH;
+ maxImageHeight = SnapshotConstants.MAX_IMAGE_HEIGHT;
+ minImageWidth = SnapshotConstants.MIN_IMAGE_WIDTH;
+ minImageHeight = SnapshotConstants.MIN_IMAGE_HEIGHT;
+ imgWidthRate = SnapshotConstants.IMAGE_WIDTH_RATE;
+ imgHeightRate = SnapshotConstants.IMAGE_HEIGHT_RATE;
+ }
+ }
+ }
+
+ private final int MOUSE_EXIT = 0;
+ private final int MOUSE_HOVER = 1;
+ private final int MOUSE_LEFT = 2;
+ private final int MOUSE_RIGHT = 3;
+ private final int MOUSE_DOWN_LEFT = 4;
+ private final int MOUSE_DOWN_RIGHT = 5;
+
+ private Image image;
+ private Canvas canvas;
+ private Canvas popup;
+ private HashMap<String, ImageSelectionListener> listeners;
+ private Shell childShell;
+ private Composite parent;
+ int childShellWidth = 0;
+ int childShellHeight = 0;
+ private int state = MOUSE_EXIT;
+ private int imageState = SnapshotConstants.IMAGE_TYPE_NORMAL;
+ private boolean mouseDown = false;
+ private int currentImageIndex = 0;
+ private boolean leftEnable = false;
+ private boolean rightEnable = false;
+
+ // +2 means outer offset
+ private final int defaultShellMaxWidth = 480 / 2 + 2;
+ private final int defaultShellMaxHeight = 800 / 2 + 2;
+ private final int defaultChildWidth = 69;
+ private final int defaultChildHeight = 108;
+
+ private int shellMaxWidth = 0;
+ private int shellMaxHeight = 0;
+ private int childWidth = 0;
+ private int childHeight = 0;
+
+ private Timer timer = null;
+
+ public ImageViewer(Composite parent, int style) {
+ super(parent, style);
+ this.parent = parent;
+ this.setLayout(new FillLayout());
+
+ canvas = new Canvas(this, SWT.NONE);
+ setImage(ImageResources.NO_IMAGE);
+ canvas.addListener(SWT.MouseEnter, mouseListener);
+ canvas.addListener(SWT.MouseExit, mouseListener);
+ canvas.addListener(SWT.MouseUp, mouseListener);
+ canvas.addListener(SWT.MouseMove, mouseListener);
+ canvas.addListener(SWT.MouseDown, mouseListener);
+ canvas.addPaintListener(new PaintListener() {
+ @Override
+ public void paintControl(PaintEvent e) {
+ if (null == image || null == e.gc) {
+ return;
+ }
+ Canvas canvas = (Canvas) e.widget;
+ Rectangle rect = canvas.getBounds();
+ e.gc.setBackground(ColorResources.SNAPSHOT_VIEWER_BG_COLOR);
+ e.gc.fillRectangle(rect);
+ try {
+ Rectangle bounds = image.getBounds();
+ int iw = bounds.width;
+ int ih = bounds.height;
+
+ int imageType = iw > ih ? SnapshotConstants.IMAGE_TYPE_WIDE
+ : SnapshotConstants.IMAGE_TYPE_NORMAL;
+ ImageData imageData = new ImageData(imageType);
+
+ imageData.gc = e.gc;
+ imageData.imgWidth = iw;
+ imageData.imgHeight = ih;
+ drawThumbnail(imageData);
+ imageData.gc.dispose();
+ } catch (SWTException se) {
+ se.printStackTrace();
+ }
+ }
+ });
+
+ }
+
+ public void setEnable(boolean enabled) {
+ canvas.setEnabled(enabled);
+ }
+
+ public HashMap<String, ImageSelectionListener> getSelectionListeners() {
+ if (null == listeners) {
+ listeners = new HashMap<String, ImageSelectionListener>();
+ }
+ return listeners;
+ }
+
+ private void setImage(Image input) {
+ if (input == null) {
+ image = null;
+ return;
+ }
+
+ if (null != image && !image.isDisposed()
+ && !image.equals(ImageResources.NO_IMAGE)) {
+ image.dispose();
+ }
+ image = input;
+ }
+
+ public void clear() {
+ setImage(ImageResources.NO_IMAGE);
+ canvas.redraw();
+ currentImageIndex = 0;
+ }
+
+ private void drawThumbnail(ImageData imgData) {
+ Rectangle bounds = canvas.getClientArea();
+ Image buffer = new Image(Display.getDefault(), bounds);
+ GC gc = new GC(buffer);
+
+ int ix = 1, iy = 1;
+ int width = SnapshotConstants.MIN_IMAGE_WIDTH;
+ int height = SnapshotConstants.MIN_IMAGE_HEIGHT;
+
+ if (imgData.imgHeight > imgData.imgWidth) {
+ ix = (bounds.width - width) / 2;
+ } else {
+ width = SnapshotConstants.MIN_IMAGE_HEIGHT;
+ height = SnapshotConstants.MIN_IMAGE_WIDTH;
+ iy = (bounds.height - height) / 2;
+ }
+
+ gc.drawImage(image, 0, 0, imgData.imgWidth, imgData.imgHeight, ix, iy,
+ width, height);
+ if (state == MOUSE_LEFT && leftEnable) {
+ gc.drawImage(ImageResources.SNAPSHOT_LEFT_HOVER, 0, 0);
+ } else if (state == MOUSE_RIGHT && rightEnable) {
+ Rectangle rect = ImageResources.SNAPSHOT_RIGHT_HOVER.getBounds();
+ gc.drawImage(ImageResources.SNAPSHOT_RIGHT_HOVER, bounds.width
+ - rect.width, 0);
+ } else if (state == MOUSE_DOWN_LEFT && leftEnable) {
+ gc.drawImage(ImageResources.SNAPSHOT_LEFT_PUSH, 0, 0);
+ } else if (state == MOUSE_DOWN_RIGHT && rightEnable) {
+ Rectangle rect = ImageResources.SNAPSHOT_RIGHT_HOVER.getBounds();
+ gc.drawImage(ImageResources.SNAPSHOT_RIGHT_PUSH, bounds.width
+ - rect.width, 0);
+ } else if (state == MOUSE_HOVER) {
+ if (rightEnable) {
+ Rectangle rect = ImageResources.SNAPSHOT_RIGHT_HOVER
+ .getBounds();
+ gc.drawImage(ImageResources.SNAPSHOT_RIGHT_HOVER, bounds.width
+ - rect.width, 0);
+ }
+ if (leftEnable) {
+ gc.drawImage(ImageResources.SNAPSHOT_LEFT_HOVER, 0, 0);
+ }
+ }
+
+ imgData.gc.drawImage(buffer, 0, 0);
+ buffer.dispose();
+ gc.dispose();
+ }
+
+ public void drawSnapshot(String time) {
+ if (null != time && !time.isEmpty()) {
+ int index = AnalyzerManager.getImageIndexByTime(time);
+ ImageInfo imageInfo = AnalyzerManager.getImageInfoByTime(time);
+ if (null == imageInfo) {
+ return;
+ }
+ String path = null;
+ if (imageInfo.getSeq().equals("-1") || index < 0) { //$NON-NLS-1$
+ path = AnalyzerConstants.DEFAULT_IMAGE_NAME;
+ } else {
+ path = AnalyzerManager.getProject().getSavePath()
+ + File.separator + AnalyzerConstants.IMAGE_FOLDER_NAME
+ + File.separator + imageInfo.getSeq()
+ + CommonConstants.EXTENSION_PNG_IMAGE;
+ }
+ Image img = null;
+ if (path.equals(AnalyzerConstants.DEFAULT_IMAGE_NAME)) {
+ img = ImageResources.NO_IMAGE;
+ } else {
+ try {
+ img = new Image(Display.getDefault(), path);
+ } catch (SWTError err) {
+ err.printStackTrace();
+ img = ImageResources.NO_IMAGE;
+ } catch (Exception e) {
+ System.out.println("Wait for receiving image : " + path);//$NON-NLS-1$
+ img = ImageResources.NO_IMAGE;
+ }
+ if (img.isDisposed()) {
+ System.out.println("before set image : disposed"); //$NON-NLS-1$
+ }
+ }
+ setImage(img);
+ currentImageIndex = index;
+ canvas.redraw();
+ Rectangle rect = img.getBounds();
+ int imgType = SnapshotConstants.IMAGE_TYPE_NORMAL;
+ if (rect.width > rect.height) {
+ imgType = SnapshotConstants.IMAGE_TYPE_WIDE;
+ } else {
+ imgType = SnapshotConstants.IMAGE_TYPE_NORMAL;
+ }
+ if (childShell != null) {
+ if (imageState != imgType) {
+ childShell.close();
+ childShell = null;
+ if (imgType == SnapshotConstants.IMAGE_TYPE_WIDE) {
+ childShellWidth = defaultShellMaxHeight;
+ childShellHeight = defaultShellMaxWidth;
+ } else {
+ childShellWidth = defaultShellMaxWidth;
+ childShellHeight = defaultShellMaxHeight;
+ }
+ openChildShell(false);
+ imageState = imgType;
+ } else {
+ popup.redraw();
+ }
+ }
+ }
+ }
+
+ private Listener mouseListener = new Listener() {
+
+ @Override
+ public void handleEvent(Event event) {
+ if (event.type == SWT.MouseEnter) {
+ setButtonCondition();
+
+ if (childShell == null) {
+ openChildShell(true);
+ }
+ } else if (event.type == SWT.MouseExit) {
+ if (childShell != null) {
+ if (timer != null) {
+ timer.cancel();
+ timer = null;
+ }
+ childShell.close();
+ childShell = null;
+ }
+ state = MOUSE_EXIT;
+ canvas.redraw();
+ } else if (event.type == SWT.MouseMove) {
+ if (!mouseDown) {
+ Rectangle rect = canvas.getBounds();
+ Rectangle leftImageBounds = ImageResources.SNAPSHOT_LEFT_HOVER
+ .getBounds();
+ Rectangle rightImageBounds = ImageResources.SNAPSHOT_RIGHT_HOVER
+ .getBounds();
+ int prevState = state;
+ if (event.x < rect.x + leftImageBounds.width) {
+ state = MOUSE_LEFT;
+ } else if (event.x > rect.x
+ + (rect.width - rightImageBounds.width)) {
+ state = MOUSE_RIGHT;
+ } else if (event.x > rect.x
+ && event.x < event.x + rect.width) {
+ state = MOUSE_HOVER;
+ } else {
+ state = MOUSE_EXIT;
+ }
+
+ if (prevState != state) {
+ canvas.redraw();
+ }
+ }
+ } else if (event.type == SWT.MouseDown) {
+ mouseDown = true;
+ Rectangle rect = canvas.getBounds();
+ Rectangle leftImageBounds = ImageResources.SNAPSHOT_LEFT_HOVER
+ .getBounds();
+ Rectangle rightImageBounds = ImageResources.SNAPSHOT_RIGHT_HOVER
+ .getBounds();
+ int prevState = state;
+ if (event.x < rect.x + leftImageBounds.width) {
+ state = MOUSE_DOWN_LEFT;
+ } else if (event.x > rect.x
+ + (rect.width - rightImageBounds.width)) {
+ state = MOUSE_DOWN_RIGHT;
+ } else if (event.x > rect.x && event.x < event.x + rect.width) {
+ state = MOUSE_HOVER;
+ } else {
+ state = MOUSE_EXIT;
+ }
+
+ if (prevState != state) {
+ canvas.redraw();
+ }
+ } else if (event.type == SWT.MouseUp) {
+ mouseDown = false;
+ Rectangle rect = canvas.getBounds();
+ Rectangle leftImageBounds = ImageResources.SNAPSHOT_LEFT_HOVER
+ .getBounds();
+ Rectangle rightImageBounds = ImageResources.SNAPSHOT_RIGHT_HOVER
+ .getBounds();
+ int prevState = state;
+ if (event.x < rect.x + leftImageBounds.width) {
+ if (state == MOUSE_DOWN_LEFT && leftEnable) {
+ leftArrowAction();
+ setButtonCondition();
+ }
+ state = MOUSE_LEFT;
+ } else if (event.x > rect.x
+ + (rect.width - rightImageBounds.width)) {
+ if (state == MOUSE_DOWN_RIGHT && rightEnable) {
+ rightArrowAction();
+ setButtonCondition();
+ }
+ state = MOUSE_RIGHT;
+ } else if (event.x > rect.x && event.x < event.x + rect.width) {
+ state = MOUSE_HOVER;
+ } else {
+ state = MOUSE_EXIT;
+ }
+ if (prevState != state) {
+ canvas.redraw();
+ }
+ }
+ }
+ };
+
+ private void setButtonCondition() {
+ List<ImageInfo> imageList = AnalyzerManager.getImageList();
+ ImageInfo imgInfo = imageList.get(currentImageIndex);
+ drawSnapshot(imgInfo.getTime());
+ if (imageList.size() < 2) {
+ leftEnable = false;
+ rightEnable = false;
+ } else {
+ if (currentImageIndex == 0) {
+ leftEnable = false;
+ if (imageList.size() > 1) {
+ rightEnable = true;
+ } else {
+ rightEnable = false;
+ }
+ } else {
+ leftEnable = true;
+ if (imageList.size() - 1 == currentImageIndex) {
+ rightEnable = false;
+ } else {
+ rightEnable = true;
+ }
+ }
+ }
+ }
+
+ private void widgetSelected(String timeStr) {
+ long time = Long.parseLong(timeStr);
+ AnalyzerManager.getCurrentPage().updatePage(
+ new DASelectionData(SnapshotView.ID, time, time, null, null));
+ }
+
+ private void leftArrowAction() {
+ List<ImageInfo> imageList = AnalyzerManager.getImageList();
+ ImageInfo imgInfo = imageList.get(--currentImageIndex);
+ drawSnapshot(imgInfo.getTime());
+ widgetSelected(imgInfo.getTime());
+ }
+
+ private void rightArrowAction() {
+ List<ImageInfo> imageList = AnalyzerManager.getImageList();
+ if (imageList.size() <= currentImageIndex + 1) {
+ return;
+ }
+ ImageInfo imgInfo = imageList.get(++currentImageIndex);
+ drawSnapshot(imgInfo.getTime());
+ widgetSelected(imgInfo.getTime());
+ }
+
+ private void setShellSizes(int type) {
+ imageState = type;
+ if (type == SnapshotConstants.IMAGE_TYPE_WIDE) {
+ shellMaxHeight = defaultShellMaxWidth;
+ shellMaxWidth = defaultShellMaxHeight;
+ childWidth = defaultChildHeight;
+ childHeight = defaultChildWidth;
+ childShellWidth = defaultChildHeight;
+ childShellHeight = defaultChildWidth;
+ } else {
+ shellMaxHeight = defaultShellMaxHeight;
+ shellMaxWidth = defaultShellMaxWidth;
+ childWidth = defaultChildWidth;
+ childHeight = defaultChildHeight;
+ childShellWidth = defaultChildWidth;
+ childShellHeight = defaultChildHeight;
+ }
+ }
+
+ private void setChildShellSizes(int type) {
+ if (type == SnapshotConstants.IMAGE_TYPE_WIDE) {
+ shellMaxHeight = defaultShellMaxWidth;
+ shellMaxWidth = defaultShellMaxHeight;
+ childWidth = defaultChildHeight;
+ childHeight = defaultChildWidth;
+ } else {
+ shellMaxHeight = defaultShellMaxHeight;
+ shellMaxWidth = defaultShellMaxWidth;
+ childWidth = defaultChildWidth;
+ childHeight = defaultChildHeight;
+ }
+ }
+
+ private void openChildShell(boolean enableAnimation) {
+ if (null == image) {
+ return;
+ } else if (enableAnimation) {
+ Rectangle rect = image.getBounds();
+ if (rect.width > rect.height) {
+ setShellSizes(SnapshotConstants.IMAGE_TYPE_WIDE);
+ } else {
+ setShellSizes(SnapshotConstants.IMAGE_TYPE_NORMAL);
+ }
+ }
+ childShell = new Shell(parent.getShell(), SWT.ON_TOP);
+ childShell.setLayout(new FillLayout());
+ Point p = canvas.toDisplay(0, 0);
+
+ childShell.setSize(childShellWidth, childShellHeight);
+ childShell.setLocation(p.x - childShellWidth, p.y);
+
+ popup = new Canvas(childShell, SWT.DOUBLE_BUFFERED
+ | SWT.TRANSPARENCY_ALPHA);
+
+ popup.addPaintListener(new PaintListener() {
+ @Override
+ public void paintControl(PaintEvent e) {
+ if (null == image || null == e.gc) {
+ return;
+ }
+ try {
+ Rectangle bounds = image.getBounds();
+ int iw = bounds.width;
+ int ih = bounds.height;
+ int imageType = iw > ih ? SnapshotConstants.IMAGE_TYPE_WIDE
+ : SnapshotConstants.IMAGE_TYPE_NORMAL;
+ ImageData imageData = new ImageData(imageType);
+
+ imageData.gc = e.gc;
+ imageData.imgWidth = iw;
+ imageData.imgHeight = ih;
+
+ if (iw > ih) {
+ setChildShellSizes(SnapshotConstants.IMAGE_TYPE_WIDE);
+ } else {
+ setChildShellSizes(SnapshotConstants.IMAGE_TYPE_NORMAL);
+ }
+ Rectangle rects = popup.getBounds();
+ int cw = rects.width - 2;
+ int ch = rects.height - 2;
+
+ e.gc.setForeground(ColorResources.BLACK);
+ imageData.gc.drawRectangle(rects.x, rects.y,
+ rects.width - 1, rects.height - 1);
+
+ imageData.gc.drawImage(image, 0, 0, imageData.imgWidth,
+ imageData.imgHeight, 1, 1, cw, ch);
+
+ imageData.gc.dispose();
+ } catch (SWTException se) {
+ se.printStackTrace();
+ }
+ }
+ });
+ childShell.open();
+
+ if (enableAnimation) {
+ if (timer != null) {
+ timer.cancel();
+ timer = null;
+ }
+ timer = new Timer();
+ timer.schedule(new TimerTask() {
+ @Override
+ public void run() {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (null == childShell
+ || childShellWidth >= shellMaxWidth) {
+ if (timer != null) {
+ timer.cancel();
+ timer = null;
+ }
+ if (null != childShell
+ && !childShell.isDisposed()) {
+ childShell.redraw();
+ }
+ return;
+ }
+ int x = (shellMaxWidth - childWidth) / 3;
+ int y = (shellMaxHeight - childHeight) / 3;
+ childShellWidth += x;
+ childShellHeight += y;
+
+ childShellWidth = (childShellWidth > shellMaxWidth) ? shellMaxWidth
+ : childShellWidth;
+ childShellHeight = (childShellHeight > shellMaxHeight) ? shellMaxHeight
+ : childShellHeight;
+
+ childShell.setSize(childShellWidth,
+ childShellHeight);
+ Point p = canvas.toDisplay(0, 0);
+ childShell.setLocation(p.x - childShellWidth, p.y);
+ childShell.redraw();
+ }
+ });
+ }
+ }, 10, 10);
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.info.snapshot;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.logparser.Logs;
+import org.tizen.dynamicanalyzer.model.DAView;
+import org.tizen.dynamicanalyzer.nl.InformationViewLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.sql.SqlManager;
+import org.tizen.dynamicanalyzer.ui.page.ViewAction;
+import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.graph.bar.FourBarGraph;
+import org.tizen.dynamicanalyzer.widgets.graph.circular.CircularGraph;
+
+public class SnapshotView extends DAView {
+
+ public static final String ID = SnapshotView.class.getName();
+
+ private final int SNAPSHOT_SIZE = 218;
+ ImageViewer snapshot;
+ CircularGraph processGraph;
+ FourBarGraph cpuGrp;
+ private static String rss = CommonConstants.ZERO;
+ private String[] observingViews = null;
+ private Composite bottomComp = null;
+
+ private static List<Long> cpuUsage;
+ private static long maxCpuUsage = 100;
+ private static long maxMem = 100;
+ private static long processMem = 0;
+ private long startTime = 0;
+ private long lastStartTime = 0;
+ private long selectTime = -1;
+
+ private DACustomButton latestButton = null;
+
+ public SnapshotView(Composite parent, int style, boolean title) {
+ super(parent, style);
+ name = InformationViewLabels.SNAPSHOT_VIEW_TITLE;
+ this.setLayout(new FillLayout());
+
+ ViewContainer viewContainer = new ViewContainer(this, title);
+ viewContainer
+ .setTitleText(InformationViewLabels.SNAPSHOT_VIEW_CURRENT_VIEW);
+ Composite contents = viewContainer.getContentArea();
+ contents.setBackground(ColorResources.VIEW_BG_COLOR);
+
+ contents.addControlListener(new ControlListener() {
+
+ @Override
+ public void controlResized(ControlEvent e) {
+ FormData data = (FormData) snapshot.getLayoutData();
+ data.left = new FormAttachment(50, -SNAPSHOT_SIZE / 2);
+
+ data = (FormData) bottomComp.getLayoutData();
+ data.left = new FormAttachment(50, -SNAPSHOT_SIZE / 2);
+ data.right = new FormAttachment(50, SNAPSHOT_SIZE / 2);
+ }
+
+ @Override
+ public void controlMoved(ControlEvent e) {
+ }
+ });
+ snapshot = new ImageViewer(contents, SWT.NONE);
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 1);
+ data.left = new FormAttachment(0, 0);
+ data.width = SNAPSHOT_SIZE;
+ data.height = SNAPSHOT_SIZE;
+ snapshot.setLayoutData(data);
+ snapshot.setEnable(true);
+
+ bottomComp = new Composite(contents, SWT.NONE);
+ bottomComp.setLayout(new FormLayout());
+ data = new FormData();
+ data.top = new FormAttachment(snapshot, 3);
+ data.left = new FormAttachment(0, 0);
+ data.right = new FormAttachment(100, 0);
+ data.height = 90;
+ bottomComp.setLayoutData(data);
+
+ // process graph
+ Composite processComp = new Composite(bottomComp, SWT.NONE);
+ data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.right = new FormAttachment(100, 0);
+ data.width = 90;
+ data.height = 90;
+ processComp.setLayoutData(data);
+ processComp.setBackground(ColorResources.WHITE);
+ processComp.setLayout(new FillLayout());
+
+ processGraph = new CircularGraph(processComp, SWT.NONE,
+ CircularGraph.TYPE_CUSTOM);
+ processGraph.setGraphBgColor(ColorResources.PROCESS_GRAPH_BG_COLOR);
+ processGraph.setGraphColor(ColorResources.PROCESS_GRAPH_COLOR);
+ processGraph.setCenterColor(ColorResources.PROCESS_GRAPH_CENTER_COLOR);
+ processGraph.setMeasure(InformationViewLabels.SNAPSHOT_VIEW_BYTE);
+ processGraph.setGraphColor(ColorResources.PROCESS_GRAPH_COLOR);
+ processGraph.update(maxMem, processMem);
+ processGraph.setTextColor(ColorResources.PROCESS_GRAPH_COLOR);
+ processGraph.setText(InformationViewLabels.SNAPSHOT_VIEW_PROCESS);
+ processGraph.setLabelBg(ColorResources.VIEW_BG_COLOR);
+ processGraph.setFont(FontResources.CIRCULAR_LABEL_FONT);
+ processGraph.setMeasureFont(FontResources.CIRCULAR_GRAPH_MEASURE_FONT);
+ processGraph.setValueFont(FontResources.CIRCULAR_GRAPH_VALUE_FONT);
+
+ cpuGrp = new FourBarGraph(bottomComp, SWT.NONE,
+ FourBarGraph.TYPE_PERCENT);
+ data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.right = new FormAttachment(processComp, -3);
+ data.width = 90;
+ data.height = 90;
+ cpuGrp.setLayoutData(data);
+ cpuGrp.setBgColor(ColorResources.CPU_BAR_GRAPH_BG_COLOR);
+ cpuGrp.setTextBgColor(ColorResources.VIEW_BG_COLOR);
+ cpuGrp.setGraphColor(ColorResources.CPU_BAR_GRAPH_COLOR,
+ ColorResources.CPU_BAR_GRAPH_GRAY_COLOR,
+ ColorResources.CPU_BAR_GRAPH_COLOR);
+ cpuGrp.setTextColor(ColorResources.CPU_BAR_GRAPH_COLOR);
+ cpuGrp.setText(InformationViewLabels.SNAPSHOT_VIEW_CPU);
+ cpuUsage = new ArrayList<Long>();
+
+ cpuGrp.setFont(FontResources.BAR_GRAPH_LABEL_FONT);
+ cpuGrp.setGraphFont(FontResources.BAR_GRAPH_FONT);
+
+ Composite emptyComp = new Composite(bottomComp, SWT.NONE);
+ emptyComp.setLayout(new FormLayout());
+ emptyComp.setBackground(ColorResources.WHITE);
+ data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.right = new FormAttachment(cpuGrp, -3);
+ data.left = new FormAttachment(0, 0);
+ data.height = 90;
+ emptyComp.setLayoutData(data);
+ emptyComp.addPaintListener(new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ Composite comp = (Composite) e.widget;
+ Rectangle rect = comp.getBounds();
+ e.gc.setBackground(ColorResources.VIEW_BG_COLOR);
+ e.gc.fillRectangle(rect.x, 75, rect.width, 15);
+ String latest = InformationViewLabels.SNAPSHOT_VIEW_LATEST;
+ e.gc.setFont(FontResources.LOCK_LABEL_FONT);
+ Point strSize = e.gc.textExtent(latest, SWT.DRAW_MNEMONIC);
+ e.gc.setForeground(ColorResources.SNAPSHOT_VIEW_LOCK_TEXT);
+ e.gc.drawText(latest, (rect.width - strSize.x) / 2, 78);
+ }
+ });
+
+ latestButton = new DACustomButton(emptyComp,
+ ImageResources.LATEST_SNAPSHOT_NORMAL,
+ ImageResources.LATEST_SNAPSHOT_PUSH,
+ ImageResources.LATEST_SNAPSHOT_HOVER,
+ ImageResources.LATEST_SNAPSHOT_DISABLE);
+ setLatestButtonEnable(false);
+
+ data = new FormData();
+ data.top = new FormAttachment(0, 10);
+ data.left = new FormAttachment(0, 1);
+ data.right = new FormAttachment(100, -1);
+ data.height = 65;
+ latestButton.setLayoutData(data);
+
+ latestButton.addClickListener(new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ setLatestButtonEnable(false);
+ setSelectTime(lastStartTime);
+ updateView();
+ }
+ });
+
+ this.addListener(SWT.Hide, new Listener() {
+
+ @Override
+ public void handleEvent(Event event) {
+ setSelectTime(-1);
+ }
+ });
+
+ this.addListener(SWT.Show, new Listener() {
+
+ @Override
+ public void handleEvent(Event event) {
+ if (latestButton.isButtonEnabled()) {
+ setTimeFromObservingView(false);
+ } else {
+ if (AnalyzerManager.isRunning()) {
+ setStartTime(lastStartTime);
+ } else {
+ setTimeFromObservingView(true);
+ }
+ }
+ }
+ });
+ }
+
+ public void setObservingViews(String[] viewIds) {
+ observingViews = viewIds;
+ }
+
+ public String[] getObservingViews() {
+ return observingViews;
+ }
+
+ private void computeData() {
+ String query = "select SystemCpuUsage, ResidentMemory from system where time = (select max(time) from system where time <= " //$NON-NLS-1$
+ + startTime + ");"; //$NON-NLS-1$
+ List<String> input = SqlManager.getInstance().executeSelectQuery(query, 2);
+
+ if (null == input) {
+ query = "select SystemCpuUsage, ResidentMemory from system where time = (select min(time) from system);"; //$NON-NLS-1$
+ input = SqlManager.getInstance().executeSelectQuery(query, 2);
+ if (null == input) {
+ return;
+ }
+ }
+ String[] cpuRates = input.get(0).split(CommonConstants.COMMA);
+ cpuUsage.clear();
+ for (int i = 0; i < cpuRates.length - 1; i++) {
+ String cpu = cpuRates[i].trim();
+ long value = (long) Float.parseFloat(cpu);
+ cpuUsage.add(value);
+ }
+
+ rss = input.get(1);
+
+ long totalMem = AnalyzerManager.getProject().getSystemMemorySize();
+ maxMem = totalMem;
+ processMem = Long.parseLong(rss);
+ }
+
+ @Override
+ public void updateView(DASelectionData selData) {
+ setLatestButtonEnable(true);
+ long selStartTime = selData.getStartTime();
+ if (selData.getViewId().equals(SnapshotView.ID)) {
+ if (selStartTime < 0) {
+ selStartTime = 0;
+ }
+ setSelectTime(selStartTime);
+ setStartTime(selectTime);
+ updateView(false);
+ } else {
+ if (selStartTime > lastStartTime) {
+ selStartTime = lastStartTime;
+ }
+ setSelectTime(selStartTime);
+ setStartTime(selectTime);
+ updateView(true);
+ }
+ }
+
+ private void updateView(final boolean isSnapshot) {
+ computeData();
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ processGraph.update(maxMem, processMem);
+ cpuGrp.setMaxSize(maxCpuUsage);
+ cpuGrp.setCurrentValue(cpuUsage);
+ if (isSnapshot) {
+ snapshot.drawSnapshot(Long.toString(startTime));
+ }
+ }
+ });
+ }
+
+ @Override
+ public void updateView() {
+ if (!AnalyzerManager.isRunning() && latestButton.isButtonEnabled()) {
+ latestButton.setEnabled(false);
+ } else if (latestButton.isButtonEnabled()) {
+ setStartTime(selectTime);
+ }
+ computeData();
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ processGraph.update(maxMem, processMem);
+ cpuGrp.setMaxSize(maxCpuUsage);
+ cpuGrp.setCurrentValue(cpuUsage);
+ snapshot.drawSnapshot(Long.toString(startTime));
+ }
+ });
+ }
+
+ private void setTimeFromObservingView(boolean isStartTime) {
+ if (null == observingViews) {
+ return;
+ }
+ int size = observingViews.length;
+ for (int i = 0; i < size; i++) {
+ ViewAction view = AnalyzerManager.getCurrentPage().getView(
+ observingViews[i]);
+ Control control = view.getControl();
+ Grid table = null;
+
+ if (control instanceof DAChartBoard) {
+ DAChartBoard board = (DAChartBoard) control;
+ long time = (long) (board.getSelectionStartTime() * 1000000);
+ if (time < 0) {
+ continue;
+ }
+ if (isStartTime) {
+ setStartTime(time);
+ } else {
+ setSelectTime(time);
+ }
+ return;
+ } else if (control instanceof DATableComposite) {
+ table = ((DATableComposite) control).getTable();
+ } else if (control instanceof DATreeComposite) {
+ table = ((DATreeComposite) control).getTable();
+ } else {
+ continue;
+ }
+ if (table.getSelectionCount() > 0) {
+ GridItem[] selection = table.getSelection();
+ List<String> startData = ((DATableDataFormat) selection[0]
+ .getData()).getData();
+ long time = Long.parseLong(startData
+ .get(LogCenterConstants.TIME_INDEX));
+ if (isStartTime) {
+ setStartTime(time);
+ } else {
+ setSelectTime(time);
+ }
+ }
+ }
+ }
+
+ @Override
+ public void updateLog(LogPackage logPack) {
+ Logs logs = logPack.getLogs(LogCenterConstants.LOG_DEVICE);
+ if (null == logs || logs.getLogs().size() == 0) {
+ return;
+ }
+ List<List<String>> inputs = logs.getLogs();
+ int lastIndex = inputs.size() - 1;
+ List<String> input = inputs.get(lastIndex);
+
+ String[] cpuRates = input.get(
+ LogCenterConstants.DEVICE_SYSTEM_CPU_USAGE_INDEX).split(
+ CommonConstants.COMMA);
+ cpuUsage.clear();
+ for (int i = 0; i < cpuRates.length - 1; i++) {
+ String cpu = cpuRates[i].trim();
+ long value = (long) Float.parseFloat(cpu);
+ cpuUsage.add(value);
+ }
+
+ rss = input.get(LogCenterConstants.DEVICE_RSS_MEMORY_INDEX);
+ long totalMem = AnalyzerManager.getProject().getSystemMemorySize();
+ maxMem = totalMem;
+ processMem = Long.parseLong(rss);
+ String time = input.get(LogCenterConstants.TIME_INDEX);
+ lastStartTime = Long.parseLong(time);
+ setStartTime(lastStartTime);
+ }
+
+ @Override
+ public void clear() {
+ cpuUsage.clear();
+ maxMem = 100;
+ processMem = 0;
+ cpuGrp.clear();
+ updateView(true);
+ }
+
+ public void setStartTime(long start) {
+ startTime = start;
+ }
+
+ private void setSelectTime(long time) {
+ selectTime = time;
+ }
+
+ public void setLatestButtonEnable(boolean enabled) {
+ if (AnalyzerManager.isRunning()) {
+ latestButton.setEnabled(enabled);
+ } else {
+ latestButton.setEnabled(false);
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.page;
+
+import java.util.HashMap;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.part.ViewPart;
+import org.tizen.dynamicanalyzer.model.DAView;
+import org.tizen.dynamicanalyzer.ui.file.FilePage;
+import org.tizen.dynamicanalyzer.ui.summary.SummaryPage;
+import org.tizen.dynamicanalyzer.ui.thread.ThreadPage;
+import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIPage;
+import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
+
+public class BaseView extends ViewPart {
+
+ public static final String ID = BaseView.class.getName();
+ DAPageComposite topComposite = null;
+ DATabComposite tabView = null;
+
+ private HashMap<String, DAView> views = null;
+
+ @Override
+ public void createPartControl(Composite parent) {
+ tabView = new DATabComposite(parent, SWT.DOUBLE_BUFFERED);
+ tabView.setTabWidth(120);
+ {
+ Composite timelinePage = new TimelinePage(
+ tabView.getContentComposite(), SWT.NONE);
+ tabView.addView(timelinePage, false);
+ Composite filePage = new FilePage(tabView.getContentComposite(),
+ SWT.NONE);
+ tabView.addView(filePage, false);
+
+ Composite threadPage = new ThreadPage(
+ tabView.getContentComposite(), SWT.NONE);
+ tabView.addView(threadPage, false);
+
+ Composite uiPage = new UIPage(tabView.getContentComposite(),
+ SWT.NONE);
+ tabView.addView(uiPage, false);
+
+ Composite summaryPage = new SummaryPage(
+ tabView.getContentComposite(), SWT.NONE);
+ tabView.addView(summaryPage, false);
+ }
+ }
+
+ @Override
+ public void setFocus() {
+ // TODO Auto-generated method stub
+ }
+
+ public DATabComposite getMainTab() {
+ return tabView;
+ }
+
+ public DAPageComposite getTopComposite() {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ topComposite = (DAPageComposite) tabView.getTopComposite();
+ }
+ });
+ return topComposite;
+ }
+
+ public void clear() {
+ tabView.clear();
+ }
+
+ public HashMap<String, DAView> getAllViewHash() {
+ return views;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.page;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.common.DesignConstants;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+
+public class DAPageComposite extends Composite implements ViewAction {
+
+ private HashMap<String, ViewAction> viewMap = null;
+ private List<ViewAction> views = null;
+ protected String name = null;
+
+ private final double DEFAULT_WIDTH = DesignConstants.SNAPSHOT_VIEW_WIDTH + 10;
+ private final double DEFAULT_HEIGHT = DesignConstants.SNAPSHOT_VIEW_HEIGHT
+ + 10 + DesignConstants.VIEW_TITLEBAR_HEIGHT;
+
+ protected int wRate = 0;
+ protected int hRate = 0;
+
+ public DAPageComposite(Composite parent, int style) {
+ super(parent, style);
+ viewMap = new HashMap<String, ViewAction>();
+ views = new ArrayList<ViewAction>();
+ this.addControlListener(new ControlListener() {
+
+ @Override
+ public void controlResized(ControlEvent e) {
+ Composite composite = (Composite) e.widget;
+ Rectangle rect = composite.getBounds();
+ int pageWidth = rect.width;
+ int pageHeight = rect.height;
+
+ wRate = (int) (DEFAULT_WIDTH * 100 / pageWidth);
+ hRate = (int) (DEFAULT_HEIGHT * 100 / pageHeight);
+ wRate = (wRate >= 100) ? 100 : wRate;
+ hRate = (hRate >= 100) ? 100 : hRate;
+
+ if ((wRate >= (100 - 37)) || hRate >= 100) {
+ return;
+ }
+
+ setFormWeights();
+ }
+
+ @Override
+ public void controlMoved(ControlEvent e) {
+ }
+ });
+ }
+
+ public List<ViewAction> getViews() {
+ return views;
+ }
+
+ public HashMap<String, ViewAction> getViewMap() {
+ return viewMap;
+ }
+
+ public void updatePage() {
+ int size = views.size();
+ for (int i = 0; i < size; i++) {
+ if (null != views.get(i)) {
+ views.get(i).updateView();
+ }
+ }
+ }
+
+ public void updateLog(LogPackage logPack) {
+ int size = views.size();
+ for (int i = 0; i < size; i++) {
+ if (null != views.get(i)) {
+ views.get(i).updateLog(logPack);
+ }
+ }
+ }
+
+ public void clear() {
+ int size = views.size();
+ for (int i = 0; i < size; i++) {
+ if (null != views.get(i)) {
+ views.get(i).clear();
+ }
+ }
+ }
+
+ public void updatePage(final DASelectionData data) {
+ String viewId = data.getViewId();
+ int size = views.size();
+ for (int i = 0; i < size; i++) {
+ String key = views.get(i).getClass().getName();
+ if (key != null && !key.equals(viewId)) {
+ final ViewAction view = viewMap.get(key);
+ if (null != view) {
+ view.updateView(data);
+ }
+ }
+ }
+ }
+
+ public void updateSelectedViews(DASelectionData data, List<String> viewNames) {
+ int size = viewNames.size();
+ for (int i = 0; i < size; i++) {
+ viewMap.get(viewNames.get(i)).updateView(data);
+ }
+ }
+
+ public void addView(ViewAction view) {
+ viewMap.put(view.getClass().getName(), view);
+ views.add(view);
+ }
+
+ public void controlSelection(String viewId) {
+ int size = views.size();
+ for (int i = 0; i < size; i++) {
+ String key = views.get(i).getClass().getName();
+ if (key != null && !key.equals(viewId)) {
+ ViewAction view = viewMap.get(key);
+ if (null != view) {
+ view.otherViewSelectionOccured();
+ }
+ }
+ }
+ }
+
+ public ViewAction getView(String viewId) {
+ return viewMap.get(viewId);
+ }
+
+ @Override
+ public void updateView() {
+ updatePage();
+ }
+
+ @Override
+ public Control getControl() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void updateView(DASelectionData data) {
+ updatePage(data);
+ }
+
+ @Override
+ public void otherViewSelectionOccured() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public String getViewName() {
+ return name;
+ }
+
+ @Override
+ public void setSelection(List<String> data) {
+ int size = views.size();
+ for (int i = 0; i < size; i++) {
+ if (null != views.get(i)) {
+ views.get(i).setSelection(data);
+ }
+ }
+ }
+
+ protected void setFormWeights() {
+
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.page;
+
+import java.util.List;
+
+import org.eclipse.swt.widgets.Control;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+
+
+public interface ViewAction {
+
+ public void updateView();
+
+ public void updateLog(LogPackage logPack);
+
+ public void clear();
+
+ public Control getControl();
+
+ public void updateView(DASelectionData data);
+
+ public void otherViewSelectionOccured();
+
+ public String getViewName();
+
+ public void setSelection(List<String> data);
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.range;
+
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.logparser.Logs;
+import org.tizen.dynamicanalyzer.model.LogCenter;
+import org.tizen.dynamicanalyzer.sql.SqlManager;
+import org.tizen.dynamicanalyzer.ui.file.FileDataMaker;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager;
+import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
+import org.tizen.dynamicanalyzer.ui.summary.failed.FailedChecker;
+import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakDetector;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfileDataMaker;
+import org.tizen.dynamicanalyzer.ui.summary.warning.WarningChecker;
+import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
+import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+
+public class RangeDataManager implements Runnable {
+ private static RangeDataManager instance = null;
+ private Thread rangeThread = null;
+ private FailedChecker failedChecker = null;
+ private LeakDetector leakDetector = null;
+ private WarningChecker warningChecker = null;
+ private FileDataMaker fileDataMaker = null;
+ private ProfileDataMaker profileDataMaker = null;
+
+ private long startTime = -1;
+ private long endTime = -1;
+
+ private boolean isBeingAnalyzed = false;
+
+ private RangeDataManager() {
+ failedChecker = new FailedChecker();
+ leakDetector = new LeakDetector();
+ warningChecker = new WarningChecker();
+ profileDataMaker = new ProfileDataMaker();
+
+ fileDataMaker = new FileDataMaker(failedChecker, leakDetector,
+ warningChecker);
+ }
+
+ public void clearRange() {
+ failedChecker.clear();
+ leakDetector.clear();
+ warningChecker.clear();
+ profileDataMaker.clear();
+ }
+
+ public void initRange() {
+ clearRange();
+ startTime = -1;
+ endTime = -1;
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ isBeingAnalyzed = false;
+ DAPageComposite page = AnalyzerManager.getCurrentPage();
+ if (page instanceof RangePage) {
+ AnalyzerUtil.changePage(TimelinePage.ID);
+ }
+
+ DATabComposite mainTab = AnalyzerUtil.getMainTab();
+ if (null != mainTab.getTab(RangePage.ID)) {
+ mainTab.removeView(RangePage.ID, true);
+ }
+ }
+ });
+ }
+
+ public void startRangeThread() {
+ clearRange();
+ if (null == rangeThread || !rangeThread.isAlive()) {
+ rangeThread = new Thread(null, getInstance(),
+ "Range data manager thread"); //$NON-NLS-1$
+ rangeThread.start();
+
+ isBeingAnalyzed = true;
+ }
+ }
+
+ public void startRangeAnalysis() {
+ if (!isBeingAnalyzed) {
+ DATabComposite mainTab = AnalyzerUtil.getMainTab();
+ Composite rangePage = new RangePage(mainTab.getContentComposite(),
+ SWT.NONE);
+ mainTab.addView(rangePage, true);
+ startRangeThread();
+ } else {
+ startRangeThread();
+ }
+ }
+
+ public void stopUpdateLogThread() {
+ if (null != rangeThread && rangeThread.isAlive()) {
+ rangeThread.interrupt();
+ }
+ }
+
+ public static RangeDataManager getInstance() {
+ if (null == instance) {
+ instance = new RangeDataManager();
+ }
+ return instance;
+ }
+
+ public FailedChecker getFailedChecker() {
+ return failedChecker;
+ }
+
+ public void setFailedChecker(FailedChecker failedChecker) {
+ this.failedChecker = failedChecker;
+ }
+
+ public LeakDetector getLeakDetector() {
+ return leakDetector;
+ }
+
+ public void setLeakDetector(LeakDetector leakDetector) {
+ this.leakDetector = leakDetector;
+ }
+
+ public ProfileDataMaker getProfileDataMaker() {
+ return profileDataMaker;
+ }
+
+ public void setProfileDataMaker(ProfileDataMaker profileDataMaker) {
+ this.profileDataMaker = profileDataMaker;
+ }
+
+ public WarningChecker getWarningChecker() {
+ return warningChecker;
+ }
+
+ public void setWarningChecker(WarningChecker warningChecker) {
+ this.warningChecker = warningChecker;
+ }
+
+ public void setStartTime(long startTime) {
+ this.startTime = startTime;
+ if (endTime >= 0 && startTime >= endTime) {
+ endTime = -1;
+ }
+ }
+
+ public void setEndTime(long endTime) {
+ this.endTime = endTime;
+ if (endTime >= 0 && endTime <= startTime) {
+ startTime = -1;
+ }
+ }
+
+ public long getStartTime() {
+ return startTime;
+ }
+
+ public long getEndTime() {
+ return endTime;
+ }
+
+ public boolean isBeingAnalyzed() {
+ return isBeingAnalyzed;
+ }
+
+ public boolean isAnalyzable() {
+ if (startTime >= 0 && endTime >= 0) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public boolean isClearable() {
+ if (startTime >= 0 || endTime >= 0) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public void run() {
+ List<LogCenter> logCenters = AnalyzerManager.getLogCenters();
+ if (null == logCenters || logCenters.isEmpty()) {
+ return;
+ }
+ List<List<String>> input = null;
+ LogPackage logPackage = new LogPackage();
+ int size = logCenters.size();
+ String query = null;
+ int from = -1;
+ int last = -1;
+ for (int i = 0; i < size; i++) {
+ /* !! sample db table is null.. */
+ if (logCenters.get(i).getId() != LogCenterConstants.LOG_DEVICE
+ && logCenters.get(i).getId() != LogCenterConstants.LOG_PROFILING) {
+ query = "select min(seqnumber) from " //$NON-NLS-1$
+ + logCenters.get(i).getName() + " where time >= " //$NON-NLS-1$
+ + startTime;
+ int ret = SqlManager.getInstance().executeQueryMinMax(query);
+ if (ret >= 0) {
+ from = (from > 0 && from < ret) ? from : ret;
+ }
+
+ query = "select max(seqnumber) from " //$NON-NLS-1$
+ + logCenters.get(i).getName() + " where time <= " //$NON-NLS-1$
+ + endTime;
+ ret = SqlManager.getInstance().executeQueryMinMax(query);
+ if (ret >= 0) {
+ last = (last > 0 && last > ret) ? last : ret;
+ }
+ }
+ }
+
+ int to = from + AnalyzerConstants.DATABASE_READ_SIZE;
+
+ while (!Thread.interrupted()) {
+ if (to >= last) {
+ to = last;
+ }
+
+ for (int i = 0; i < size; i++) {
+ if (logCenters.get(i).getId() != LogCenterConstants.LOG_DEVICE
+ && logCenters.get(i).getId() != LogCenterConstants.LOG_PROFILING) {
+ Logs logs = new Logs(logCenters.get(i).getId());
+ input = SqlManager.getInstance().selectArea(logCenters.get(i), from, to);
+ logs.setLogs(input);
+ logPackage.setLogs(logCenters.get(i).getId(), logs);
+ }
+ } // for
+ makeRangeData(logPackage);
+ if (to == last) {
+ break;
+ }
+ from += AnalyzerConstants.DATABASE_READ_SIZE + 1;
+ to = from + AnalyzerConstants.DATABASE_READ_SIZE;
+ }
+
+ /** profiling data making!! **/
+ LogPackage profilePackage = new LogPackage();
+ from = -1;
+ last = -1;
+ for (int i = 0; i < size; i++) {
+ if (logCenters.get(i).getId() == LogCenterConstants.LOG_PROFILING) {
+ query = "select min(seqnumber) from " //$NON-NLS-1$
+ + logCenters.get(i).getName() + " where time >= " //$NON-NLS-1$
+ + startTime;
+ int ret = SqlManager.getInstance().executeQueryMinMax(query);
+ if (ret >= 0) {
+ from = (from > 0 && from < ret) ? from : ret;
+ }
+
+ query = "select max(seqnumber) from " //$NON-NLS-1$
+ + logCenters.get(i).getName() + " where time <= " //$NON-NLS-1$
+ + endTime;
+ ret = SqlManager.getInstance().executeQueryMinMax(query);
+ if (ret >= 0) {
+ last = (last > 0 && last > ret) ? last : ret;
+ }
+ }
+ }
+
+ to = from + AnalyzerConstants.DATABASE_READ_SIZE;
+
+ while (!Thread.interrupted()) {
+ if (to >= last) {
+ to = last;
+ }
+
+ for (int i = 0; i < size; i++) {
+ if (logCenters.get(i).getId() == LogCenterConstants.LOG_PROFILING) {
+ Logs logs = new Logs(logCenters.get(i).getId());
+ input = SqlManager.getInstance().selectArea(logCenters.get(i), from, to);
+ logs.setLogs(input);
+ profilePackage.setLogs(logCenters.get(i).getId(), logs);
+ }
+ } // for
+ makeRangeData(profilePackage);
+ if (to == last) {
+ break;
+ }
+ from += AnalyzerConstants.DATABASE_READ_SIZE + 1;
+ to = from + AnalyzerConstants.DATABASE_READ_SIZE;
+ }
+
+ // end
+ AnalyzerUtil.changePage(RangePage.ID);
+ final DAPageComposite page = AnalyzerManager.getCurrentPage();
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ page.updatePage();
+ }
+ });
+ }
+
+ private void makeRangeData(LogPackage logPack) {
+ Logs logs = logPack.getLogs(LogCenterConstants.LOG_RESOURCE);
+ if (null != logs) {
+ List<List<String>> resourceInputs = logs.getLogs();
+ /* make file failed data and warning data */
+ fileDataMaker.makeData(resourceInputs);
+ /* resource leak check */
+ int size = resourceInputs.size();
+ for (int i = 0; i < size; i++) {
+ List<String> input = resourceInputs.get(i);
+ String[] inputArray = new String[input.size()];
+ input.toArray(inputArray);
+ leakDetector.runLeakDectect(inputArray);
+ }
+ }
+
+ logs = logPack.getLogs(LogCenterConstants.LOG_MEMORY);
+ if (null != logs) {
+ List<List<String>> memoryInputs = logs.getLogs();
+ /* memory leak check */
+ int size = memoryInputs.size();
+ for (int i = 0; i < size; i++) {
+ List<String> input = memoryInputs.get(i);
+ String[] inputArray = new String[input.size()];
+ input.toArray(inputArray);
+ leakDetector.runLeakDectect(inputArray);
+ }
+ }
+
+ logs = logPack.getLogs(LogCenterConstants.LOG_PROFILING);
+ if (null != logs) {
+ List<List<String>> profilingInputs = logs.getLogs();
+ /* profiling data make */
+ int size = profilingInputs.size();
+ for (int i = 0; i < size; i++) {
+ List<String> input = profilingInputs.get(i);
+ String[] inputArray = new String[input.size()];
+ input.toArray(inputArray);
+ profileDataMaker.makeFunctionUsageProfileData(input);
+ }
+ }
+
+ logs = logPack.getLogs(LogCenterConstants.LOG_USER_FUNCTION);
+ if (null != logs) {
+ List<List<String>> userFunctions = logs.getLogs();
+ int size = userFunctions.size();
+ for (int i = 0; i < size; i++) {
+ String[] input = new String[userFunctions.get(i).size()];
+ userFunctions.get(i).toArray(input);
+ String start = input[LogCenterConstants.USER_FUNCTION_BINARY_RANGE_START_INDEX];
+ String end = input[LogCenterConstants.USER_FUNCTION_BINARY_RANGE_END_INDEX];
+ if (!start.isEmpty() && !end.isEmpty()
+ && !AnalyzerManager.isBinStartEndSet()) {
+ AnalyzerManager.setBinaryStartEndAddr(start, end);
+ }
+ CallStackManager.getInstance().makeUserCallstack(input,
+ profileDataMaker);
+ }
+ }
+ /* created failed and warning/leak data */
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.range;
+
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.nl.SummaryLabels;
+import org.tizen.dynamicanalyzer.ui.summary.failed.FailedApiListView;
+import org.tizen.dynamicanalyzer.ui.summary.failed.FailedApiTable;
+
+public class RangeFailedApiListView extends FailedApiListView {
+ public static final String ID = RangeFailedApiListView.class.getName();
+
+ public RangeFailedApiListView(Composite parent, int style) {
+ super(parent, style);
+ viewContainer.setTitleText(SummaryLabels.FAILED_API_LIST_VIEW_TITLE);
+ ((FailedApiTable) tableComp).setRangeTable(true);
+ tableComp.setTableName(SummaryLabels.RANGE_PAGE_FAILED_TABLE_NAME);
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.range;
+
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.nl.SummaryLabels;
+import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakTable;
+import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakView;
+
+public class RangeLeakView extends LeakView {
+
+ public static final String ID = RangeLeakView.class.getName();
+
+ public RangeLeakView(Composite parent, int style) {
+ super(parent, style);
+ viewContainer.setTitleText(SummaryLabels.LEAK_VIEW_TITLE_LEAK_CANDIDATE);
+ ((LeakTable) treeComp).setRangeTable(true);
+ treeComp.setTableName(SummaryLabels.RANGE_PAGE_LEAK_TABLE_NAME);
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.range;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallstackView;
+import org.tizen.dynamicanalyzer.ui.info.snapshot.SnapshotView;
+import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
+
+public class RangePage extends DAPageComposite {
+ public static final String ID = RangePage.class.getName();
+
+ SashForm upperForm;
+ SashForm bottomForm;
+ SashForm baseForm;
+ SashForm warningForm;
+
+ public RangePage(Composite parent, int style) {
+ super(parent, style);
+ name = AnalyzerLabels.COOLBAR_AREA_RANGE;
+ this.setLayout(new FillLayout());
+
+ baseForm = new SashForm(this, SWT.VERTICAL);
+ baseForm.setLayout(new FillLayout());
+
+ upperForm = new SashForm(baseForm, SWT.HORIZONTAL);
+
+ // FAILED_APILIST_VIEW_INDEX = 0;
+ RangeFailedApiListView failedApiListView = new RangeFailedApiListView(
+ upperForm, SWT.NONE);
+ ((DATableComposite) failedApiListView.getControl()).getTable()
+ .setSelectionEnabled(true);
+ addView(failedApiListView);
+
+ // LEAK_VIEW_INDEX = 1;
+ RangeLeakView leakView = new RangeLeakView(upperForm, SWT.NONE);
+ addView(leakView);
+
+ // INFO_VIEW_INDEX = 2;
+ DATabComposite tabView = new DATabComposite(upperForm, SWT.NONE);
+ addView(tabView);
+ {
+ SnapshotView currentView = new SnapshotView(
+ tabView.getContentComposite(), SWT.NONE, false);
+ tabView.addView(currentView, false);
+
+ CallstackView callstack = new CallstackView(
+ tabView.getContentComposite(), SWT.NONE);
+ callstack.setObservingViews(new String[] {
+ RangeFailedApiListView.ID, RangeLeakView.ID,
+ RangeWarningListView.ID });
+ tabView.addView(callstack, false);
+ }
+ upperForm.setWeights(new int[] { 37, 40, 23 });
+
+ bottomForm = new SashForm(baseForm, SWT.HORIZONTAL);
+ // FUNCTION_PROFILING_VIEW_INDEX = 3;
+ RangeProfilingView userFunctionProfilingView = new RangeProfilingView(
+ bottomForm, SWT.NONE);
+ addView(userFunctionProfilingView);
+
+ warningForm = new SashForm(bottomForm, SWT.VERTICAL);
+ bottomForm.setWeights(new int[] { 70, 30 });
+
+ // WARNING_VIEW_INDEX = 4;
+ RangeWarningListView warningListView = new RangeWarningListView(
+ warningForm, SWT.NONE);
+ addView(warningListView);
+
+ // WARNING_VIEW_DETAIL_INDEX = 5;
+ RangeWarningDetailView warningDetailView = new RangeWarningDetailView(
+ warningForm, SWT.NONE);
+ addView(warningDetailView);
+ warningForm.setWeights(new int[] { 70, 30 });
+ }
+
+ @Override
+ protected void setFormWeights() {
+ upperForm.setWeights(new int[] { 37, 100 - 37 - wRate, wRate });
+ baseForm.setWeights(new int[] { hRate, 100 - hRate });
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.range;
+
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.nl.SummaryLabels;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfilingView;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfilingTable;
+
+public class RangeProfilingView extends FunctionUsageProfilingView {
+
+ public static final String ID = RangeProfilingView.class.getName();
+
+ public RangeProfilingView(Composite parent, int style) {
+ super(parent, style);
+ viewContainer
+ .setTitleText(SummaryLabels.FUNCTION_USER_PROFILING_VIEW_TITLE);
+ ((ProfilingTable) treeComp).setRangeTable(true);
+ treeComp.setTableName(SummaryLabels.RANGE_PAGE_PROFILING_TABLE_NAME);
+ treeComp.setRangeTable(true);
+ }
+
+ @Override
+ public void updateLog(LogPackage logPack) {
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.range;
+
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.ui.summary.warning.WarningDetailView;
+
+public class RangeWarningDetailView extends WarningDetailView {
+ public static final String ID = RangeWarningDetailView.class.getName();
+
+ public RangeWarningDetailView(Composite parent, int style) {
+ super(parent, style);
+ selectionViewId = RangeWarningListView.ID;
+ isRange = true;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.range;
+
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.nl.SummaryLabels;
+import org.tizen.dynamicanalyzer.ui.summary.warning.WarningListView;
+import org.tizen.dynamicanalyzer.ui.summary.warning.WarningTable;
+
+public class RangeWarningListView extends WarningListView {
+ public static final String ID = RangeWarningListView.class.getName();
+
+ public RangeWarningListView(Composite parent, int style) {
+ super(parent, style);
+ viewContainer.setTitleText(SummaryLabels.WARNING_LIST_VIEW_TITLE);
+ ((WarningTable) tableComp).setRangeTable(true);
+ tableComp.setTableName(SummaryLabels.RANGE_PAGE_WARNING_TABLE_NAME);
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.summary;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallstackView;
+import org.tizen.dynamicanalyzer.ui.info.snapshot.SnapshotView;
+import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
+import org.tizen.dynamicanalyzer.ui.summary.failed.FailedApiListView;
+import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakView;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfilingView;
+import org.tizen.dynamicanalyzer.ui.summary.warning.WarningDetailView;
+import org.tizen.dynamicanalyzer.ui.summary.warning.WarningListView;
+import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
+
+public class SummaryPage extends DAPageComposite {
+ public static final String ID = SummaryPage.class.getName();
+ public final static int FAILED_APILIST_VIEW_INDEX = 0;
+ public final static int LEAK_VIEW_INDEX = 1;
+ public final static int INFO_VIEW_INDEX = 2;
+ public final static int FUNCTION_PROFILING_VIEW_INDEX = 3;
+ public final static int WARNING_VIEW_INDEX = 4;
+ public final static int WARNING_VIEW_DETAIL_INDEX = 5;
+
+ SashForm upperForm;
+ SashForm bottomForm;
+ SashForm baseForm;
+ SashForm warningForm;
+
+ public SummaryPage(Composite parent, int style) {
+ super(parent, style);
+ name = AnalyzerLabels.COOLBAR_AREA_SUMMARY;
+ this.setLayout(new FillLayout());
+
+ baseForm = new SashForm(this, SWT.VERTICAL);
+ baseForm.setLayout(new FillLayout());
+
+ upperForm = new SashForm(baseForm, SWT.HORIZONTAL);
+
+ // FAILED_APILIST_VIEW_INDEX = 0;
+ FailedApiListView failedApiListView = new FailedApiListView(upperForm,
+ SWT.NONE);
+ addView(failedApiListView);
+
+ // LEAK_VIEW_INDEX = 1;
+ LeakView leakView = new LeakView(upperForm, SWT.NONE);
+ addView(leakView);
+
+ // INFO_VIEW_INDEX = 2;
+ DATabComposite tabView = new DATabComposite(upperForm, SWT.NONE);
+ addView(tabView);
+ {
+ SnapshotView snapshotView = new SnapshotView(
+ tabView.getContentComposite(), SWT.NONE, false);
+ tabView.addView(snapshotView, false);
+ snapshotView.setObservingViews(new String[] { FailedApiListView.ID,
+ LeakView.ID, WarningListView.ID });
+
+ CallstackView callstack = new CallstackView(
+ tabView.getContentComposite(), SWT.NONE);
+ callstack.setObservingViews(new String[] { FailedApiListView.ID,
+ LeakView.ID, WarningListView.ID });
+ tabView.addView(callstack, false);
+ }
+ upperForm.setWeights(new int[] { 37, 40, 23 });
+
+ bottomForm = new SashForm(baseForm, SWT.HORIZONTAL);
+ // FUNCTION_PROFILING_VIEW_INDEX = 3;
+ FunctionUsageProfilingView userFunctionProfilingView = new FunctionUsageProfilingView(
+ bottomForm, SWT.NONE);
+ addView(userFunctionProfilingView);
+
+ warningForm = new SashForm(bottomForm, SWT.VERTICAL);
+ bottomForm.setWeights(new int[] { 70, 30 });
+
+ // WARNING_VIEW_INDEX = 4;
+ WarningListView warningListView = new WarningListView(warningForm,
+ SWT.NONE);
+ addView(warningListView);
+
+ // WARNING_VIEW_DETAIL_INDEX = 5;
+ WarningDetailView warningDetailView = new WarningDetailView(
+ warningForm, SWT.NONE);
+ addView(warningDetailView);
+ warningForm.setWeights(new int[] { 70, 30 });
+ }
+
+ @Override
+ protected void setFormWeights() {
+ upperForm.setWeights(new int[] { 37, 100 - 37 - wRate, wRate });
+ baseForm.setWeights(new int[] { hRate, 100 - hRate });
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.summary.failed;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.model.DAView;
+import org.tizen.dynamicanalyzer.nl.SummaryLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
+import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
+
+public class FailedApiListView extends DAView {
+ public static final String ID = FailedApiListView.class.getName();
+ protected DATableComposite tableComp = null;
+
+ protected int[] innerMaxWeight = { 100, 0, 0 };
+ protected int[] outerMaxWeight = { 100, 0 };
+
+ protected String[] columnNames = {
+ SummaryLabels.FAILED_API_LIST_VIEW_INDEX,
+ SummaryLabels.FAILED_API_LIST_VIEW_TIME,
+ SummaryLabels.FAILED_API_LIST_VIEW_NAME,
+ SummaryLabels.FAILED_API_LIST_VIEW_PARAMETER,
+ SummaryLabels.FAILED_API_LIST_VIEW_RETURN,
+ SummaryLabels.FAILED_API_LIST_VIEW_ERROR_CODE,
+ SummaryLabels.FAILED_API_LIST_VIEW_ERROR_DESCRIPTION };
+ protected int[] columnSizes = { 25, 60, 45, 125, 0, 70, 400 };
+ protected boolean[] columnVisibility = { false, true, true, true, true,
+ true, true };
+ protected int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NUM,
+ AnalyzerConstants.SORT_TYPE_NUM,
+ AnalyzerConstants.SORT_TYPE_STRING,
+ AnalyzerConstants.SORT_TYPE_STRING,
+ AnalyzerConstants.SORT_TYPE_STRING,
+ AnalyzerConstants.SORT_TYPE_GRID, AnalyzerConstants.SORT_TYPE_GRID };
+ protected int[] sourceColumns = { LogCenterConstants.SEQUENCE_NUMBER_INDEX,
+ LogCenterConstants.TIME_INDEX, LogCenterConstants.APINAME_INDEX,
+ LogCenterConstants.INPUTPARM_INDEX,
+ LogCenterConstants.RETURN_INDEX, LogCenterConstants.ERROR_INDEX,
+ LogCenterConstants.ERROR_INDEX };
+ protected ViewContainer viewContainer = null;
+
+ public FailedApiListView(Composite parent, int style) {
+ super(parent, style);
+ this.setLayout(new FillLayout());
+
+ viewContainer = new ViewContainer(this, true);
+ viewContainer.setTitleText(SummaryLabels.FAILED_API_LIST_VIEW_TITLE);
+ setMaxWeight(innerMaxWeight, outerMaxWeight);
+ Composite contents = viewContainer.getContentArea();
+ contents.setBackground(ColorResources.WINDOW_BG_COLOR);
+ contents.setLayout(new FillLayout());
+
+ tableComp = new FailedApiTable(contents, SWT.NONE, SWT.SINGLE
+ | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
+ tableComp.setTableName(SummaryLabels.FAILED_API_LIST_VIEW_TITLE);
+ tableComp.setComparator(new DefaultTableComparator());
+ tableComp.setSortTypes(sortTypes);
+ tableComp.setSourceColumns(sourceColumns);
+ tableComp.setColumns(columnNames);
+ tableComp.setColumnSize(columnSizes);
+ tableComp.setColumnVisibility(columnVisibility);
+ contents.addControlListener(new TableColumnSizePackListener(tableComp,
+ columnSizes));
+ }
+
+ @Override
+ public void updateView() {
+ tableComp.updateTable();
+ }
+
+ @Override
+ public void clear() {
+ // TODO Auto-generated method stub
+ tableComp.clear();
+ }
+
+ @Override
+ public Control getControl() {
+ return tableComp;
+ }
+
+ @Override
+ public void otherViewSelectionOccured() {
+ tableComp.deselectAll();
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.summary.failed;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.error.ErrorCodeManager;
+import org.tizen.dynamicanalyzer.listeners.SummaryMouseDoubleClickListener;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.model.TableInput;
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.range.RangeFailedApiListView;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
+import org.tizen.dynamicanalyzer.utils.Formatter;
+
+public class FailedApiTable extends DATableComposite {
+ private boolean isRange = false;
+
+ public FailedApiTable(Composite parent, int style, int tableStyle) {
+ super(parent, style, tableStyle);
+ setRangePopup();
+ table.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ GridItem[] items = table.getSelection();
+ DATableDataFormat dataFormat = (DATableDataFormat) items[0]
+ .getData();
+ String time = dataFormat.getData().get(
+ LogCenterConstants.TIME_INDEX);
+
+ String id = FailedApiListView.ID;
+ if (isRange) {
+ id = RangeFailedApiListView.ID;
+ }
+ DASelectionData selData = new DASelectionData(id, Long
+ .parseLong(time), 0, items, table);
+ AnalyzerManager.getCurrentPage().updatePage(selData);
+ AnalyzerManager.getCurrentPage().controlSelection(id);
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+ table.addMouseListener(new SummaryMouseDoubleClickListener());
+ }
+
+ public void setRangeTable(boolean isRange) {
+ this.isRange = isRange;
+ }
+
+ protected List<TableInput> makeTableInput() {
+ List<FailedData> failedList = null;
+ if (isRange) {
+ failedList = RangeDataManager.getInstance().getFailedChecker()
+ .getFailedList();
+ } else {
+ failedList = AnalyzerManager.getFailedChecker().getFailedList();
+ }
+
+ List<TableInput> input = new ArrayList<TableInput>();
+ int size = failedList.size();
+ for (int i = 0; i < size; i++) {
+ // create text
+ List<String> text = new ArrayList<String>();
+ List<String> failedData = failedList.get(i).getData();
+
+ text.add(failedData.get(LogCenterConstants.SEQUENCE_NUMBER_INDEX));
+ String time = Formatter.toTimeFormat(failedData
+ .get(LogCenterConstants.TIME_INDEX));
+ text.add(time);
+ text.add(failedData.get(LogCenterConstants.APINAME_INDEX));
+ text.add(failedData.get(LogCenterConstants.INPUTPARM_INDEX));
+ text.add(failedData.get(LogCenterConstants.RETURN_INDEX));
+ String errCode = ErrorCodeManager.getInatance().getErrorCode(
+ failedData.get(LogCenterConstants.ERROR_INDEX));
+ if (null == errCode) {
+ // FIXME : for debug
+ errCode = "undefined error number"; //$NON-NLS-1$
+ }
+ text.add(errCode);
+
+ String errMsg = ErrorCodeManager.getInatance().getErrorDescription(
+ failedData.get(LogCenterConstants.ERROR_INDEX));
+ if (null == errMsg) {
+ // FIXME : for debug
+ errMsg = "undefined error number"; //$NON-NLS-1$
+ }
+ text.add(errMsg);
+
+ // create images
+
+ // create DATableDataFormat
+ DATableDataFormat tableData = new DATableDataFormat(
+ failedData.get(LogCenterConstants.SEQUENCE_NUMBER_INDEX));
+ tableData.getData().addAll(failedData);
+
+ TableInput tableInput = new TableInput();
+ tableInput.setText(text);
+ tableInput.setData(tableData);
+ input.add(tableInput);
+
+ if (RangeDataManager.getInstance().isBeingAnalyzed()) {
+ long failedTime = Long.parseLong(failedData
+ .get(LogCenterConstants.TIME_INDEX));
+ long startTime = RangeDataManager.getInstance().getStartTime();
+ long endTime = RangeDataManager.getInstance().getEndTime();
+ if (failedTime >= startTime && failedTime <= endTime) {
+ tableInput.setInRange(true);
+ }
+ }
+ }
+ return input;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.summary.failed;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+
+public class FailedChecker {
+
+ List<FailedData> failedList;
+
+ public void check(String[] log) {
+ String logcId = log[LogCenterConstants.ID_INDEX];
+ int cid = Integer.parseInt(logcId);
+ if (cid == LogCenterConstants.LOG_MEMORY) {
+ if (AnalyzerUtil.isInternal(log)) {
+ return;
+ }
+ String addr = log[LogCenterConstants.MEMORY_ADDR_INDEX];
+ if (!addr.equals("0") && !addr.equals("0x0")) { //$NON-NLS-1$ //$NON-NLS-2$
+ return;
+ }
+ checkUserDefinedFunc(log);
+ }
+ if (cid == LogCenterConstants.LOG_RESOURCE) {
+ if (AnalyzerUtil.isInternal(log)) {
+ return;
+ }
+ String fdTypeStr = log[LogCenterConstants.RESOURCE_FDTYPE_INDEX];
+ String errnoStr = log[LogCenterConstants.ERROR_INDEX];
+ int fdType = Integer.parseInt(fdTypeStr);
+ long errno = Long.parseLong(errnoStr);
+ // file or (not error) - file error check file page
+ if (fdType == 0 || errno == 0) {
+ return;
+ }
+ checkUserDefinedFunc(log);
+ }
+ if (cid == LogCenterConstants.LOG_USER_FUNCTION) {
+ // TODO : check user function error???
+ return;
+ }
+ }
+
+ private void checkUserDefinedFunc(String[] input) {
+ if (AnalyzerConstants.USER_CALL == AnalyzerUtil.checkUserCall(input)) {
+ FailedData fd = new FailedData(input);
+ getFailedList().add(fd);
+ }
+ }
+
+ public List<FailedData> getFailedList() {
+ if (null == failedList) {
+ failedList = new ArrayList<FailedData>();
+ }
+ return failedList;
+ }
+
+ public void clear() {
+ getFailedList().clear();
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.summary.failed;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+
+public class FailedData {
+ public static final int KEY_INDEX = LogCenterConstants.SEQUENCE_NUMBER_INDEX;
+
+ private List<String> data;
+
+ public FailedData(String[] input) {
+ List<String> data = getData();
+ for (int i = 0; i < input.length; i++) {
+ data.add(input[i]);
+ }
+ }
+
+ public FailedData(List<String> input) {
+ if (null != input && !input.isEmpty()) {
+ getData().addAll(input);
+ }
+ }
+
+ public List<String> getData() {
+ if (null == data) {
+ data = new ArrayList<String>();
+ }
+ return data;
+ }
+
+ public String getLogData(int logIndex) {
+ if (!getData().isEmpty()) {
+ return data.get(logIndex);
+ }
+ return null;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.summary.leaks;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.nl.SummaryLabels;
+import org.tizen.dynamicanalyzer.sql.DBTableManager;
+
+public class LeakData {
+ public static final int KEY_INDEX = 18;
+ public static final int ADDR_INDEX = 14;
+ public static final int SEQUENCE_INDEX = LogCenterConstants.SEQUENCE_NUMBER_INDEX;
+ public static final int ID_INDEX = LogCenterConstants.ID_INDEX;
+ public static final int TIME_INDEX = LogCenterConstants.TIME_INDEX;
+ public static final int NAME_INDEX = LogCenterConstants.APINAME_INDEX;
+ public static final int PARAM_INDEX = LogCenterConstants.INPUTPARM_INDEX;
+ public static final int RETURN_INDEX = LogCenterConstants.RETURN_INDEX;
+ public static final int LEAK_SEQ_INDEX = 19;
+
+ private static final int PARENT_KEY_INDEX = 15;
+
+ protected List<String> data;
+ private List<LeakData> children;
+
+ public LeakData(String key, String[] log, LeakDetector leakDetector) {
+ List<String> data = getData();
+ for (int i = 0; i < log.length; i++) {
+ data.set(i, log[i]);
+ }
+ data.set(KEY_INDEX, key);
+
+ // LeakDetector ld = AnalyzerManager.getLeakDetector();
+ data.set(LEAK_SEQ_INDEX, Integer.toString(leakDetector.getLeakSeq()));
+ leakDetector.increaseLeakSeq();
+ setParentKey(CommonConstants.EMPTY);
+ }
+
+ // parent data
+ public LeakData(String key, String name, String id) {
+ List<String> data = getData();
+ data.set(KEY_INDEX, key);
+ data.set(ID_INDEX, id);
+ data.set(TIME_INDEX, SummaryLabels.LEAK_DATA_DEFAULT_FORMAT);
+ String[] splitName = name.split("\\("); //$NON-NLS-1$
+ if (splitName.length > 0) {
+ data.set(PARAM_INDEX, new String(splitName[0]));
+ if (splitName.length > 1) {
+ String[] funcName = splitName[1].split("\\+"); //$NON-NLS-1$
+ data.set(NAME_INDEX, new String(funcName[0]));
+ }
+ }
+ LeakDetector ld = AnalyzerManager.getLeakDetector();
+ data.set(LEAK_SEQ_INDEX, Integer.toString(ld.getLeakSeq()));
+ ld.increaseLeakSeq();
+ }
+
+ public LeakData(List<String> loadData) {
+ List<String> data = getData();
+ data.set(KEY_INDEX, loadData.get(KEY_INDEX));
+ data.set(SEQUENCE_INDEX, loadData.get(SEQUENCE_INDEX));
+ data.set(ID_INDEX, loadData.get(ID_INDEX));
+ data.set(TIME_INDEX, loadData.get(TIME_INDEX));
+ data.set(NAME_INDEX, loadData.get(NAME_INDEX));
+ data.set(PARAM_INDEX, loadData.get(PARAM_INDEX));
+ data.set(RETURN_INDEX, loadData.get(RETURN_INDEX));
+ data.set(LEAK_SEQ_INDEX, loadData.get(LEAK_SEQ_INDEX));
+ data.set(PARENT_KEY_INDEX, loadData.get(PARENT_KEY_INDEX));
+ }
+
+ public List<String> getData() {
+ if (null == data) {
+ data = new ArrayList<String>();
+ int size = DBTableManager.commonColumns.length;
+ for (int i = 0; i < size; i++) {
+ data.add(CommonConstants.EMPTY);
+ }
+ }
+ return data;
+ }
+
+ public String getAddr() {
+ return getData().get(ADDR_INDEX);
+ }
+
+ public String getKey() {
+ return getData().get(KEY_INDEX);
+ }
+
+ public String getSeq() {
+ return getData().get(SEQUENCE_INDEX);
+ }
+
+ public String getId() {
+ return getData().get(ID_INDEX);
+ }
+
+ public String getTime() {
+ return getData().get(TIME_INDEX);
+ }
+
+ public String getName() {
+ return getData().get(NAME_INDEX);
+ }
+
+ public String getParam() {
+ return getData().get(PARAM_INDEX);
+ }
+
+ public String getRet() {
+ return getData().get(RETURN_INDEX);
+ }
+
+ public List<LeakData> getChildren() {
+ if (null == children) {
+ children = new ArrayList<LeakData>();
+ }
+ return children;
+ }
+
+ public void addChild(LeakData child) {
+ getChildren().add(child);
+ }
+
+ public void removeChild(String key) {
+ int size = children.size();
+ for (int i = 0; i < size; i++) {
+ if (key.equals(children.get(i).getKey())) {
+ children.remove(i);
+ break;
+ }
+ }
+ }
+
+ public String getLeakSeq() {
+ return getData().get(LEAK_SEQ_INDEX);
+ }
+
+ public void setParentKey(String key) {
+ getData().set(PARENT_KEY_INDEX, key);
+ }
+
+ public String getParentKey() {
+ return getData().get(PARENT_KEY_INDEX);
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.summary.leaks;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.model.Check;
+import org.tizen.dynamicanalyzer.model.LeakCheckList;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackData;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit;
+
+public class LeakDetector {
+ public final static int API_TYPE_OPEN = 0;
+ public final static int API_TYPE_CLOSE = 1;
+ public final static int API_TYPE_REALLOC = 2;
+
+ HashMap<String, Check> leakCheckHash;
+ HashMap<String, LeakData> leakHash;
+ HashMap<String, LeakData> childHash;
+ private int leakSeq = 0;
+
+ public LeakDetector() {
+ LeakCheckList leakCheckList = AnalyzerManager.getLeakCheckList();
+ if (leakCheckList != null) {
+ leakCheckHash = new HashMap<String, Check>();
+
+ List<Check> checks = leakCheckList.getChecks();
+ int size = checks.size();
+ for (int i = 0; i < size; i++) {
+ leakCheckHash.put(checks.get(i).getName(), checks.get(i));
+ }
+ }
+ }
+
+ public List<LeakData> getLeakDataList() {
+ List<LeakData> leakList = new ArrayList<LeakData>();
+ leakList.addAll(getLeakHash().values());
+ return leakList;
+ }
+
+ public HashMap<String, LeakData> getLeakHash() {
+ if (null == leakHash) {
+ leakHash = new HashMap<String, LeakData>();
+ }
+ return leakHash;
+ }
+
+ public HashMap<String, LeakData> getChildHash() {
+ if (null == childHash) {
+ childHash = new HashMap<String, LeakData>();
+ }
+ return childHash;
+ }
+
+ public HashMap<String, Check> getLeakCheckHash() {
+ if (null == leakCheckHash) {
+ LeakCheckList leakCheckList = AnalyzerManager.getLeakCheckList();
+ leakCheckHash = new HashMap<String, Check>();
+ List<Check> checks = leakCheckList.getChecks();
+ int size = checks.size();
+ for (int i = 0; i < size; i++) {
+ leakCheckHash.put(checks.get(i).getName(), checks.get(i));
+ }
+ }
+ return leakCheckHash;
+ }
+
+ public void runLeakDectect(String[] input) {
+ if (null == input || 0 == input.length) {
+ return;
+ }
+
+ String apiName = input[LogCenterConstants.APINAME_INDEX];
+ String errorStr = input[LogCenterConstants.ERROR_INDEX];
+ long errno = Long.parseLong(errorStr);
+ if (0 != errno) {
+ return;
+ }
+ // step 1 : check "open" or "close"
+ Check chk; // 0: open , 1: close
+ if (null == getLeakCheckHash().get(apiName)) {
+ return;
+ } else {
+ chk = getLeakCheckHash().get(apiName);
+ }
+
+ HashMap<String, LeakData> leaks = getLeakHash();
+ if (chk.getType() == API_TYPE_OPEN) {
+ if (chk.isCheckUserCall()) {
+ checkUserFuncLeakData(input, chk);
+ } else {
+ LeakData newLeak = new LeakData(input[chk.getKeyIndex()],
+ input, this);
+ leaks.put(newLeak.getKey(), newLeak);
+ }
+ } else if (chk.getType() == API_TYPE_CLOSE) {
+ String key = null;
+ try {
+ key = input[chk.getKeyIndex()];
+ } catch (ArrayIndexOutOfBoundsException e) {
+ e.printStackTrace();
+ return;
+ }
+ if (null == key) {
+ System.out.println(input);
+ return;
+ }
+ LeakData freeData = getChildHash().get(key);
+ if (null != freeData) {
+ LeakData parent = leaks.get(freeData.getParentKey());
+ parent.removeChild(key);
+ getChildHash().remove(key);
+ if (parent.getChildren().isEmpty()) {
+ leaks.remove(parent.getKey());
+ }
+ } else {
+ // List<LeakData> leakDatas = new ArrayList<LeakData>();
+ // leakDatas.addAll(leaks.values());
+ // for (int i = 0; i < leakDatas.size(); i++) {
+ // System.out.println(leakDatas.get(i).getData());
+ // }
+ // freeData = leaks.get(key);
+ leaks.remove(key);
+ }
+
+ } else if (chk.getType() == API_TYPE_REALLOC) {
+ // System.out.println("realloc!! " + input);
+
+ // free index = input param 1st
+ String inputParam = input[LogCenterConstants.INPUTPARM_INDEX];
+ String[] splitInputParam = inputParam.split("\\,"); //$NON-NLS-1$
+ String rmKey = splitInputParam[0];
+ leaks.remove(rmKey);
+
+ // internal check
+ if (chk.isCheckUserCall()) {
+ checkUserFuncLeakData(input, chk);
+ } else {
+ String key = input[chk.getKeyIndex()];
+ leaks.put(key, new LeakData(key, input, this));
+ }
+ }
+ }
+
+ private void checkUserFuncLeakData(String[] input, Check chk) {
+ HashMap<Integer, CallStackData> cdMap = CallStackManager.getInstance()
+ .getCallStackDataBySeqMap();
+ // HashMap<Long, String> apiMap = LogSpliter.getCallStackApiByAddrMap();
+ HashMap<Long, CallStackUnit> addrMap = CallStackManager.getInstance()
+ .getCallStackApiByAddrMap();
+
+ if (null == cdMap || null == addrMap) {
+ return;
+ }
+
+ int seqNum = Integer
+ .parseInt(input[LogCenterConstants.SEQUENCE_NUMBER_INDEX]);
+ CallStackData csd = cdMap.get(seqNum);
+ if (null == csd) {
+ System.out.println("no callstack : "); //$NON-NLS-1$
+ for (int i = 0; i < input.length; i++)
+ System.out.print(input[i] + " "); //$NON-NLS-1$
+ System.out.println();
+ return;
+ }
+ List<Long> addrs = null;
+ addrs = csd.getAddrs();
+ if (addrs.isEmpty()) {
+ System.out.println("BUG: Callstack is empty!"); //$NON-NLS-1$
+ return;
+ }
+
+ CallStackUnit callerFunc = addrMap.get(addrs.get(0));
+
+ // user call
+ if (CallStackManager.getInstance().isUserCall(
+ callerFunc.getFunctionName())) {
+ HashMap<String, LeakData> leaks = getLeakHash();
+ LeakData newLeak = new LeakData(input[chk.getKeyIndex()], input,
+ this);
+ leaks.put(newLeak.getKey(), newLeak);
+ }
+ // for internal leak
+ // else {
+ // undefined internal call
+ // int size = addrs.size();
+ // for (int i = 1; i < size; i++) {
+ // callerFunc = addrMap.get(addrs.get(i));
+ // if (callerFunc.getFunctionName().contains("__dlog_print")) { //$NON-NLS-1$
+ // return;
+ // }
+ // if (CallStackManager.getInstance().isUserCall(
+ // callerFunc.getFunctionName())) {
+ // LeakData childData = new LeakData(input[chk.getKeyIndex()],
+ // input);
+ // String addr = Long.toString(addrs.get(i - 1));
+ // callerFunc = addrMap.get(addrs.get(i - 1));
+ // LeakData parentLeakData = getLeakHash().get(addr);
+ // if (null == parentLeakData) {
+ // parentLeakData = new LeakData(addr,
+ // callerFunc.getSymbol(),
+ // input[LogCenterConstants.ID_INDEX]);
+ // getLeakHash().put(addr, parentLeakData);
+ // }
+ // parentLeakData.addChild(childData);
+ // childData.setParentKey(parentLeakData.getKey());
+ // getChildHash().put(childData.getKey(), childData);
+ // break;
+ // }
+ // }
+ // }
+ }
+
+ public int getLeakSeq() {
+ return leakSeq;
+ }
+
+ public void increaseLeakSeq() {
+ leakSeq++;
+ }
+
+ public void resetLeakSeq() {
+ leakSeq = 0;
+ }
+
+ public void clear() {
+ getLeakHash().clear();
+ getChildHash().clear();
+ leakSeq = 0;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.summary.leaks;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.listeners.SummaryMouseDoubleClickListener;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.model.TreeInput;
+import org.tizen.dynamicanalyzer.nl.SummaryLabels;
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.range.RangeLeakView;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite;
+import org.tizen.dynamicanalyzer.utils.Formatter;
+
+public class LeakTable extends DATreeComposite {
+
+ private boolean isRange = false;
+
+ public LeakTable(Composite parent, int compStyle, int tableStyle) {
+ super(parent, compStyle, tableStyle);
+ setRangePopup();
+
+ table.addListener(SWT.Expand, new Listener() {
+
+ @Override
+ public void handleEvent(Event event) {
+ GridItem item = (GridItem) event.item;
+ setExpand(item, true);
+ }
+ });
+ table.addListener(SWT.Collapse, new Listener() {
+ @Override
+ public void handleEvent(Event event) {
+ GridItem item = (GridItem) event.item;
+ setExpand(item, false);
+ }
+ });
+
+ table.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ GridItem[] items = table.getSelection();
+
+ DATableDataFormat dataFormat = (DATableDataFormat) items[0]
+ .getData();
+ String time = dataFormat.getData().get(
+ LogCenterConstants.TIME_INDEX);
+
+ String id = LeakView.ID;
+ if (isRange) {
+ id = RangeLeakView.ID;
+ }
+ DASelectionData selData = new DASelectionData(id, Long
+ .parseLong(time), 0, items, table);
+ AnalyzerManager.getCurrentPage().updatePage(selData);
+ AnalyzerManager.getCurrentPage().controlSelection(id);
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+ });
+
+ table.addMouseListener(new SummaryMouseDoubleClickListener());
+ }
+
+ public void setRangeTable(boolean isRange) {
+ this.isRange = isRange;
+ }
+
+ // !! recursive!!
+ public void makeChildTree(List<LeakData> children, TreeInput parent,
+ String parentName) {
+ if (!children.isEmpty()) {
+ int size = children.size();
+ for (int i = 0; i < size; i++) {
+ LeakData data = children.get(i);
+ TreeInput input = makeInput(data);
+ parent.getChildren().add(input);
+ input.setParent(parentName);
+ }
+ }
+ }
+
+ @Override
+ public List<TreeInput> makeTreeInput() {
+ List<TreeInput> output = new ArrayList<TreeInput>();
+ HashMap<String, LeakData> leaks = null;
+ if (isRange) {
+ leaks = RangeDataManager.getInstance().getLeakDetector()
+ .getLeakHash();
+ } else {
+ leaks = AnalyzerManager.getLeakDetector().getLeakHash();
+ }
+ ArrayList<LeakData> leakList = new ArrayList<LeakData>();
+ leakList.addAll(leaks.values());
+
+ int size = leakList.size();
+ for (int i = 0; i < size; i++) {
+ LeakData leakData = leakList.get(i);
+ TreeInput leakInput = makeInput(leakData);
+ makeChildTree(leakData.getChildren(), leakInput,
+ leakData.getParentKey());
+ output.add(leakInput);
+ }
+ return output;
+ }
+
+ private TreeInput makeInput(LeakData leakData) {
+ List<String> data = leakData.getData();
+ DATableDataFormat tableData = new DATableDataFormat(
+ data.get(LeakData.LEAK_SEQ_INDEX));
+ tableData.getData().addAll(data);
+
+ List<String> text = new ArrayList<String>();
+ text.add(leakData.getName()); // 0 column empty value for tree
+ text.add(leakData.getSeq()); // 1
+
+ int type = Integer.parseInt(leakData.getId());
+ if (type == LogCenterConstants.LOG_MEMORY) {
+ text.add(SummaryLabels.LEAK_TABLE_MEMORY);
+ } else if (type == LogCenterConstants.LOG_RESOURCE) {
+ text.add(SummaryLabels.LEAK_TABLE_RESOURCE);
+ } else {
+ text.add(SummaryLabels.LEAK_TABLE_ETC);
+ } // 2
+
+ String time = leakData.getTime();
+ try {
+ text.add(Formatter.toTimeFormat(time));
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ text.add(time);
+ } // 3
+ tableData.setObject(leakData.getName()); // 4
+ text.add(leakData.getParam()); // 5
+ text.add(leakData.getRet()); // 6
+
+ TreeInput output = new TreeInput();
+ output.setText(text);
+ output.setData(tableData);
+ output.setParent(leakData.getParentKey());
+
+ if (RangeDataManager.getInstance().isBeingAnalyzed()) {
+ long leakTime = Long.parseLong(time);
+ long startTime = RangeDataManager.getInstance().getStartTime();
+ long endTime = RangeDataManager.getInstance().getEndTime();
+ if (leakTime >= startTime && leakTime <= endTime) {
+ output.setInRange(true);
+ }
+ }
+
+ return output;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.summary.leaks;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.model.DAView;
+import org.tizen.dynamicanalyzer.nl.SummaryLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
+import org.tizen.dynamicanalyzer.ui.widgets.table.TreeDataComparator;
+
+public class LeakView extends DAView {
+
+ public static final String ID = LeakView.class.getName();
+
+ protected int[] innerMaxWeight = { 0, 100, 0 };
+ protected int[] outerMaxWeight = { 100, 0 };
+
+ protected String[] columnNames = { SummaryLabels.LEAK_VIEW_NAME,
+ SummaryLabels.LEAK_VIEW_INDEX, SummaryLabels.LEAK_VIEW_TYPE,
+ SummaryLabels.LEAK_VIEW_TIME,
+ SummaryLabels.LEAK_VIEW_FILE_PARAMETER,
+ SummaryLabels.LEAK_VIEW_RETURN };
+ protected int[] columnSizes = { 60, 25, 60, 60, 100, 100 };
+ protected boolean[] columnVisibility = { true, false, true, true, true,
+ true };
+ protected int[] sortTypes = { AnalyzerConstants.SORT_TYPE_GRID,
+ AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_GRID,
+ AnalyzerConstants.SORT_TYPE_NUM,
+ AnalyzerConstants.SORT_TYPE_STRING,
+ AnalyzerConstants.SORT_TYPE_STRING };
+ protected int[] sourceColumns = { LeakData.SEQUENCE_INDEX,
+ LeakData.SEQUENCE_INDEX, LeakData.ID_INDEX, LeakData.TIME_INDEX,
+ LeakData.NAME_INDEX, LeakData.PARAM_INDEX, LeakData.RETURN_INDEX };
+
+ protected DATreeComposite treeComp = null;
+
+ protected ViewContainer viewContainer = null;
+
+ public LeakView(Composite parent, int style) {
+ super(parent, style);
+ this.setLayout(new FillLayout());
+
+ viewContainer = new ViewContainer(this, true);
+ viewContainer.setTitleText(SummaryLabels.LEAK_VIEW_TITLE_LEAK);
+ setMaxWeight(innerMaxWeight, outerMaxWeight);
+
+ Composite contents = viewContainer.getContentArea();
+ contents.setBackground(ColorResources.WINDOW_BG_COLOR);
+ contents.setLayout(new FillLayout());
+ treeComp = new LeakTable(contents, SWT.NONE, SWT.SINGLE | SWT.BORDER
+ | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
+
+ /*** setTree set first!!! ***/
+ treeComp.setTree(true);
+ treeComp.setSortTypes(sortTypes);
+ treeComp.setSourceColumns(sourceColumns);
+ treeComp.setComparator(new TreeDataComparator());
+ treeComp.setColumns(columnNames);
+ treeComp.setColumnSize(columnSizes);
+ treeComp.setColumnVisibility(columnVisibility);
+ treeComp.setTableName(SummaryLabels.LEAK_VIEW_TITLE_LEAK);
+
+ contents.addControlListener(new TableColumnSizePackListener(treeComp,
+ columnSizes));
+ }
+
+ @Override
+ public void updateView() {
+ treeComp.updateTree();
+ }
+
+ @Override
+ public void clear() {
+ treeComp.clear();
+ }
+
+ @Override
+ public Control getControl() {
+ return treeComp;
+ }
+
+ @Override
+ public void otherViewSelectionOccured() {
+ treeComp.deselectAll();
+ }
+
+ public void setViewTitle(String title) {
+ viewContainer.setTitleText(title);
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.summary.profiling;
+
+import org.eclipse.nebula.widgets.grid.GridColumnGroup;
+import org.eclipse.nebula.widgets.grid.internal.DefaultColumnGroupHeaderRenderer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+
+public class ColumnGroupRenderer extends DefaultColumnGroupHeaderRenderer {
+
+ int leftMargin = 6;
+
+ int rightMargin = 6;
+
+ int topMargin = 3;
+
+ int bottomMargin = 3;
+
+ int arrowMargin = 6;
+
+ int imageSpacing = 3;
+
+ @Override
+ public boolean notify(int arg0, Point arg1, Object arg2) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public void paint(GC gc, Object arg1) {
+ GridColumnGroup column = (GridColumnGroup) arg1;
+ gc.setBackground(ColorResources.TABLE_HEADER_BG);
+ Rectangle rect = getBounds();
+ gc.fillRectangle(rect.x, rect.y, rect.width, rect.height);
+ gc.setForeground(ColorResources.TABLE_LINE);
+ gc.drawLine(rect.x - 1, rect.y, rect.x - 1, rect.y + rect.height);
+ gc.drawLine(rect.x - 1, rect.y - 1 + rect.height, rect.x + rect.width,
+ rect.y - 1 + rect.height);
+
+ gc.setForeground(ColorResources.TABLE_HEADER_FONT_COLOR);
+ gc.setFont(FontResources.TABLE_HEADER_FONT);
+ String inputText = column.getText();
+ Point textSize = gc.textExtent(inputText, SWT.DRAW_MNEMONIC);
+ int textWidth = textSize.x;
+
+ int y = getBounds().y + getBounds().height - bottomMargin
+ - gc.getFontMetrics().getHeight();
+
+ int x = rect.x + (rect.width - textWidth) / 2;
+ gc.drawString(inputText, x, y, true);
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * WooJin Jung <woojin2.jung@samsung.com>
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.summary.profiling;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.logparser.LogParser;
+import org.tizen.dynamicanalyzer.nl.SummaryLabels;
+
+public class FunctionUsageProfiler implements Runnable {
+
+ // 0.01 second = 10 ms
+ public static final long SAMPLE_TIME = 10;
+ public static final String APPLICATION = SummaryLabels.FUNCTION_USAGE_PROFILER_APPLICATION;
+ public static final String DEPENDENT_LIB = SummaryLabels.FUNCTION_USAGE_PROFILER_DEPENDENT_LIB;
+ public static final String APPLICATION_KEY = "profiling_app_bin_key";//$NON-NLS-1$
+ public static final String DEPENDENT_LIB_KEY = "profiling_dependent_lib_key";//$NON-NLS-1$
+ public static final String UNKNOWN = "";//$NON-NLS-1$
+
+ private static FunctionUsageProfiler instance = null;
+
+ private ProfileDataMaker profileDataMaker = null;
+ /**
+ * key: symbol(child) or file path (parent) - value : sequence num of
+ * profiling data. all parent and child data is in
+ */
+ private static HashMap<String, String> symbolSeqHash = null;
+ private List<List<List<String>>> sampleInputs = null;
+ private static Thread profiler = null;
+
+ public FunctionUsageProfiler() {
+ profileDataMaker = new ProfileDataMaker();
+ }
+
+ public ProfileDataMaker getProfileDataMaker() {
+ return profileDataMaker;
+ }
+
+ public static FunctionUsageProfiler getInstance() {
+ if (null == instance) {
+ instance = new FunctionUsageProfiler();
+ }
+ return instance;
+ }
+
+ public static HashMap<String, String> getSymbolSeqHash() {
+ if (null == symbolSeqHash) {
+ symbolSeqHash = new HashMap<String, String>();
+ }
+ return symbolSeqHash;
+ }
+
+ private List<List<List<String>>> getSampleInputs() {
+ if (null == sampleInputs) {
+ sampleInputs = new ArrayList<List<List<String>>>();
+ }
+ return sampleInputs;
+ }
+
+ private synchronized List<List<String>> getFirstSample() {
+ while (isSampleInputEmpty()) {
+ if (LogParser.isLogParsingComplete()) {
+ return null;
+ }
+ try {
+ wait();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ continue;
+ }
+ }
+ List<List<String>> first = getSampleInputs().get(0);
+ getSampleInputs().remove(0);
+ notifyAll();
+ return first;
+ }
+
+ private boolean isSampleInputEmpty() {
+ return getSampleInputs().isEmpty();
+ }
+
+ private boolean isSampleInputFull() {
+ if (getSampleInputs().size() > 10000) {
+ return true;
+ }
+ return false;
+ }
+
+ public synchronized void pushSample(List<List<String>> sample) {
+ while (isSampleInputFull()) {
+ try {
+ wait();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ break;
+ }
+ }
+ getSampleInputs().add(sample);
+ notifyAll();
+ }
+
+ public static void startProfiler() {
+ if (null == profiler || !profiler.isAlive()) {
+ profiler = new Thread(null, getInstance(),
+ AnalyzerConstants.LOG_QUEUE_OBSERVING_THREAD);
+ profiler.start();
+ }
+ }
+
+ public static void stopProfiler() {
+ if (null != profiler && profiler.isAlive()) {
+ try {
+ sendNotify();
+ profiler.join();
+ System.out.println("profiling thread joined!"); //$NON-NLS-1$
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /*** profiling thread ***/
+ @Override
+ public void run() {
+ System.out.println("start profiling thread"); //$NON-NLS-1$
+ while (!AnalyzerManager.isExit()) {
+ List<List<String>> sample = getInstance().getFirstSample();
+ if (null == sample) {
+ break;
+ }
+ int size = sample.size();
+ for (int i = 0; i < size; i++) {
+ getInstance().getProfileDataMaker()
+ .makeFunctionUsageProfileData(sample.get(i));
+ }
+ }
+
+ /* log for debug */
+ System.out.println("profiling thread end!!"); //$NON-NLS-1$
+ }
+
+ public static void clear() {
+ instance = null;
+ }
+
+ public static void sendNotify() {
+ FunctionUsageProfiler p = getInstance();
+ synchronized (p) {
+ p.notifyAll();
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.summary.profiling;
+
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Rectangle;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableCellRenderer;
+
+public class FunctionUsageProfilingTableCellRenderer extends
+ DATableCellRenderer {
+
+ @Override
+ protected void drawPercentGraph(GC gc, boolean drawAsSelected, GridItem item) {
+ String rateStr = item.getText(getColumn());
+ if (rateStr.contains(CommonConstants.PERCENT)) {
+ if (drawAsSelected) {
+ gc.setForeground(ColorResources.PROFILING_GRAPH_SELECTION_COLOR_START);
+ gc.setBackground(ColorResources.PROFILING_GRAPH_SELECTION_COLOR_END);
+ } else {
+ gc.setForeground(ColorResources.PROFILING_GRAPH_COLOR_START);
+ gc.setBackground(ColorResources.PROFILING_GRAPH_COLOR_END);
+ }
+ String[] splitRateStr = rateStr.split(CommonConstants.PERCENT);
+ rateStr = new String(splitRateStr[0].trim());
+ if (!rateStr.equals(CommonConstants.DASH)) {
+ double rate = Double.parseDouble(rateStr);
+ Rectangle bounds = getBounds();
+ int rectWidth = (int) (bounds.width * (rate / 100));
+ gc.fillGradientRectangle(bounds.x + 1, bounds.y, rectWidth,
+ bounds.height, true);
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.summary.profiling;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.logparser.Logs;
+import org.tizen.dynamicanalyzer.model.ColumnData;
+import org.tizen.dynamicanalyzer.model.DAView;
+import org.tizen.dynamicanalyzer.nl.SummaryLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
+import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
+
+public class FunctionUsageProfilingView extends DAView {
+
+ public static final String ID = FunctionUsageProfilingView.class.getName();
+ protected ProfilingTable treeComp = null;
+ protected int[] innerMaxWeight = { 100, 0 };
+ protected int[] outerMaxWeight = { 0, 100 };
+ protected List<ColumnData> columnData = null;
+
+ protected String[] columnNames = {
+ SummaryLabels.FUNCTION_USER_PROFILING_VIEW_NAME,
+ SummaryLabels.FUNCTION_USER_PROFILING_VIEW_CPU_TIME,
+ SummaryLabels.FUNCTION_USER_PROFILING_VIEW_CPU_RATE,
+ SummaryLabels.FUNCTION_USER_PROFILING_VIEW_ELASPED_TIME,
+ SummaryLabels.FUNCTION_USER_PROFILING_VIEW_CPU_TIME,
+ SummaryLabels.FUNCTION_USER_PROFILING_VIEW_CPU_RATE,
+ SummaryLabels.FUNCTION_USER_PROFILING_VIEW_ELASPED_TIME,
+ SummaryLabels.FUNCTION_USER_PROFILING_VIEW_CALL_COUNT };
+ protected int[] columnSizes = { 260, 0, 0, 0, 0, 0, 0, 0 };
+ protected boolean[] columnVisibility = { true, true, true, true, true,
+ true, true, true };
+ protected int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NONE,
+ AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM,
+ AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM,
+ AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM,
+ AnalyzerConstants.SORT_TYPE_NUM };
+ protected int[] sourceColumns = { ProfilingData.NAME_INDEX,
+ ProfilingData.EXCOUNT_INDEX, ProfilingData.EXCOUNT_INDEX,
+ ProfilingData.EXCL_ELAPSED_TIME_INDEX, ProfilingData.INCOUNT_INDEX,
+ ProfilingData.INCOUNT_INDEX, ProfilingData.INCL_ELAPSED_TIME_INDEX,
+ ProfilingData.CALLCOUNT_INDEX };
+
+ protected ViewContainer viewContainer = null;
+
+ public FunctionUsageProfilingView(Composite parent, int style) {
+ super(parent, style);
+ this.setLayout(new FillLayout());
+
+ viewContainer = new ViewContainer(this, true);
+ viewContainer
+ .setTitleText(SummaryLabels.FUNCTION_USER_PROFILING_VIEW_TITLE);
+ setMaxWeight(innerMaxWeight, outerMaxWeight);
+ Composite contents = viewContainer.getContentArea();
+ contents.setBackground(ColorResources.WINDOW_BG_COLOR);
+ contents.setLayout(new FillLayout());
+ treeComp = new ProfilingTable(contents, SWT.NONE, SWT.SINGLE
+ | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
+ /*** setTree set first!!! ***/
+ treeComp.setTree(true);
+ treeComp.setSortTypes(sortTypes);
+ treeComp.setSourceColumns(sourceColumns);
+ createColumnData();
+ treeComp.setColumns(columnData);
+ treeComp.setColumnSize(columnSizes);
+ treeComp.setColumnVisibility(columnVisibility);
+ treeComp.setTableToolTipEnable(false);
+ treeComp.setTableName(SummaryLabels.FUNCTION_USER_PROFILING_VIEW_TITLE);
+ contents.addControlListener(new TableColumnSizePackListener(treeComp,
+ columnSizes));
+ }
+
+ private void createColumnData() {
+ int columnIndex = 0;
+ columnData = new ArrayList<ColumnData>();
+ ColumnData data0 = new ColumnData(columnNames[columnIndex++]);
+ columnData.add(data0);
+
+ ColumnData data1 = new ColumnData(
+ SummaryLabels.FUNCTION_USER_PROFILING_VIEW_EXCLUSIVE);
+ ColumnData data1Child1 = new ColumnData(columnNames[columnIndex++]);
+ ColumnData data1Child2 = new ColumnData(columnNames[columnIndex++]);
+ ColumnData data1Child3 = new ColumnData(columnNames[columnIndex++]);
+ data1.getChildren().add(data1Child1);
+ data1.getChildren().add(data1Child2);
+ data1.getChildren().add(data1Child3);
+ columnData.add(data1);
+
+ ColumnData data2 = new ColumnData(
+ SummaryLabels.FUNCTION_USER_PROFILING_VIEW_INCLUSIVE);
+ ColumnData data2Child1 = new ColumnData(columnNames[columnIndex++]);
+ ColumnData data2Child2 = new ColumnData(columnNames[columnIndex++]);
+ ColumnData data2Child3 = new ColumnData(columnNames[columnIndex++]);
+ data2.getChildren().add(data2Child1);
+ data2.getChildren().add(data2Child2);
+ data2.getChildren().add(data2Child3);
+ columnData.add(data2);
+
+ ColumnData data3 = new ColumnData(columnNames[columnIndex++]);
+ columnData.add(data3);
+ }
+
+ @Override
+ public void updateView() {
+ treeComp.updateTree();
+ }
+
+ @Override
+ public void clear() {
+ treeComp.clear();
+ }
+
+ @Override
+ public Control getControl() {
+ return treeComp;
+ }
+
+ @Override
+ public void otherViewSelectionOccured() {
+ treeComp.deselectAll();
+ }
+
+ @Override
+ public void updateLog(LogPackage logPack) {
+ Logs logs = logPack.getLogs(LogCenterConstants.LOG_PROFILING);
+ if (null == logs || logs.getLogs().size() == 0) {
+ return;
+ }
+ List<List<String>> inputs = logs.getCloneLogs();
+ FunctionUsageProfiler.getInstance().pushSample(inputs);
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * WooJin Jung <woojin2.jung@samsung.com>
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.summary.profiling;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerPaths;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit;
+import org.tizen.dynamicanalyzer.utils.Formatter;
+
+public class ProfileDataMaker {
+
+ class CallstackTree {
+ ProfilingData me;
+ CallstackTree parent;
+ List<CallstackTree> children = null;
+ int childExeTime = 0;
+
+ public CallstackTree(ProfilingData me, CallstackTree parent) {
+ this.me = me;
+ this.parent = parent;
+ children = new ArrayList<ProfileDataMaker.CallstackTree>();
+ }
+
+ public void addChild(CallstackTree child) {
+ children.add(child);
+ }
+
+ public void addChildExeTime(long time) {
+ childExeTime += time;
+ }
+
+ public long getInclusiveExeTime() {
+ return me.getLastElapsedTime() - childExeTime;
+ }
+
+ public ProfilingData getThis() {
+ return me;
+ }
+
+ public CallstackTree getParent() {
+ return parent;
+ }
+ }
+
+ private CallstackTree current = null;
+ private int totalSampleCount = 0;
+
+ /**
+ * key: seq - value : function usage profiling data hash map all function
+ * usage profiling data are in this hash map
+ **/
+ private HashMap<String, ProfilingData> profilingDataMap = null;
+
+ /**
+ * key : seq - value : child seq list // all child lists are in this hash
+ */
+ private HashMap<String, ProfilingChildData> childListMap = null;
+
+ private ProfilingData appBin = null;
+ private ProfilingData dependentLib = null;
+ private String appBinName = null;
+
+ public void clear() {
+ getProfilingDataMap().clear();
+ getChildListMap().clear();
+ appBin = null;
+ dependentLib = null;
+ appBinName = null;
+ totalSampleCount = 0;
+ }
+
+ public String getAppBinName() {
+ return appBinName;
+ }
+
+ public ProfilingData getAppBin() {
+ return appBin;
+ }
+
+ public ProfilingData getDependentLib() {
+ return dependentLib;
+ }
+
+ public void setAppBin(ProfilingData appBin) {
+ this.appBin = appBin;
+ }
+
+ public void setDependentLib(ProfilingData dependentLib) {
+ this.dependentLib = dependentLib;
+ }
+
+ public void setTotalSampleCount(int count) {
+ totalSampleCount = count;
+ }
+
+ public int getTotalSampleCount() {
+ return totalSampleCount;
+ }
+
+ public ProfilingData getProfilingDataByKey(String key) {
+ String seq = FunctionUsageProfiler.getSymbolSeqHash().get(key);
+ if (null == seq) {
+ return null;
+ }
+
+ return getProfilingDataMap().get(seq);
+ }
+
+ public HashMap<String, ProfilingData> getProfilingDataMap() {
+ if (null == profilingDataMap) {
+ profilingDataMap = new HashMap<String, ProfilingData>();
+ }
+ return profilingDataMap;
+ }
+
+ public HashMap<String, ProfilingChildData> getChildListMap() {
+ if (null == childListMap) {
+ childListMap = new HashMap<String, ProfilingChildData>();
+ }
+ return childListMap;
+ }
+
+ public String getCpuRate(ProfilingData data, boolean exclusive) {
+ int count = 0;
+ double rate = 0.;
+ if (exclusive) {
+ count = data.getExCount();
+ rate = count / (double) totalSampleCount * 100;
+ } else {
+ count = data.getInCount();
+ rate = count / (double) totalSampleCount * 100;
+ }
+
+ return Formatter.toDoubleFormat2(Double.toString(rate));
+ }
+
+ public String getCpuTime(ProfilingData data, boolean exclusive) {
+ int count = 0;
+ if (exclusive) {
+ count = data.getExCount();
+ } else {
+ count = data.getInCount();
+ }
+
+ return Long.toString(count * FunctionUsageProfiler.SAMPLE_TIME);
+ }
+
+ private void checkUserCall(CallStackUnit csa, ProfilingData parent,
+ ProfilingData pp) {
+ if (CallStackManager.getInstance().checkUserCall(csa.getPath())) {
+ if (null == appBin) {
+ CallStackUnit appBinCsa = new CallStackUnit(-1,
+ FunctionUsageProfiler.APPLICATION);
+ appBin = makeNewProfilingData(appBinCsa, true);
+ appBin.setKey(FunctionUsageProfiler.APPLICATION_KEY);
+ appBinName = csa.getPath();
+ }
+ parent.setParent(appBin.getName());
+ appBin.addChild(parent);
+ if (null != pp) {
+ pp = appBin;
+ }
+ } else {
+ if (null == dependentLib) {
+ CallStackUnit dependentLibBinCsa = new CallStackUnit(-2,
+ FunctionUsageProfiler.DEPENDENT_LIB);
+ dependentLib = makeNewProfilingData(dependentLibBinCsa, true);
+ dependentLib.setKey(FunctionUsageProfiler.DEPENDENT_LIB_KEY);
+ }
+ parent.setParent(dependentLib.getName());
+ dependentLib.addChild(parent);
+ if (null != pp) {
+ pp = dependentLib;
+ }
+ }
+ }
+
+ public void makeFunctionUsageProfileData(List<String> sampleLog) {
+ totalSampleCount++;
+ String callstack = sampleLog
+ .get(LogCenterConstants.PROFILING_LOG_CALLSTACK_INDEX);
+ String[] splitCallstack = callstack
+ .split(AnalyzerConstants.DATA_PARSING_TOKEN);
+
+ List<String> sampleCallstack = new ArrayList<String>();
+
+ for (int i = 0; i < splitCallstack.length; i++) {
+ sampleCallstack.add(new String(splitCallstack[i]));
+ }
+
+ List<Long> addrs = makeCallstackHashAndList(sampleCallstack);
+ HashMap<Long, CallStackUnit> addrMap = CallStackManager.getInstance()
+ .getCallStackApiByAddrMap();
+ String selfAddrStr = sampleLog
+ .get(LogCenterConstants.PROFILING_LOG_PCADDR_INDEX);
+ long selfAddr = Long.parseLong(selfAddrStr);
+ CallStackUnit inputData = addrMap.get(selfAddr);
+ if (null == inputData) {
+ return;
+ }
+
+ // drop samples of probe library
+ if (inputData.getPath().startsWith(AnalyzerPaths.DA_REMOTE_PROBE_PATH)) {
+ return;
+ }
+
+ String inputPath = inputData.getPath();
+ String inputFuncName = inputData.getFunctionName();
+
+ ProfilingData parent = getProfilingDataByKey(inputPath);
+ // exclusive cpu time
+ if (null == parent) {
+ parent = makeNewProfilingData(inputData, true);
+ checkUserCall(inputData, parent, null);
+ if (inputFuncName.equals(FunctionUsageProfiler.UNKNOWN)) {
+ parent.addExCount();
+ } else {
+ ProfilingData child = makeNewProfilingData(inputData, false);
+ parent.addChild(child);
+ child.addExCount();
+ child.setParent(parent.getName());
+ }
+ } else {
+ if (inputFuncName.isEmpty()) {
+ parent.addExCount();
+ } else {
+ ProfilingData child = getProfilingDataByKey(inputData
+ .getSymbol());
+ if (null == child) {
+ child = makeNewProfilingData(inputData, false);
+ parent.addChild(child);
+ child.setParent(parent.getName());
+ }
+ child.addExCount();
+ }
+ }
+
+ // inclusive cpu time
+ for (int i = 0; i < addrs.size(); i++) {
+ CallStackUnit callstackCsa = addrMap.get(addrs.get(i));
+ // disable inclusive cpu time of dependent library
+ if (!CallStackManager.getInstance().checkUserCall(
+ callstackCsa.getPath())) {
+ continue;
+ }
+
+ if (callstackCsa.getFunctionName().equals(
+ FunctionUsageProfiler.UNKNOWN)) {
+ ProfilingData inParent = getProfilingDataByKey(callstackCsa
+ .getPath());
+ ProfilingData pp = null;
+ if (null == inParent) {
+ inParent = makeNewProfilingData(callstackCsa, true);
+ checkUserCall(callstackCsa, inParent, pp);
+ }
+ inParent.addInCount(totalSampleCount);
+
+ if (null != inParent.getParent()) {
+ String pInParentName = inParent.getParent();
+ pp = getProfilingDataByKey(pInParentName);
+ pp.addInCount(totalSampleCount);
+ }
+ } else {
+ ProfilingData fupData = getProfilingDataByKey(callstackCsa
+ .getSymbol());
+ if (null == fupData) {
+ ProfilingData inParent = getProfilingDataByKey(callstackCsa
+ .getPath());
+ if (null == inParent) {
+ inParent = makeNewProfilingData(callstackCsa, true);
+ checkUserCall(callstackCsa, inParent, null);
+ }
+ fupData = makeNewProfilingData(callstackCsa, false);
+ fupData.setParent(inParent.getName());
+
+ inParent.addChild(fupData);
+ inParent.addInCount(totalSampleCount);
+ if (null != inParent.getParent()) {
+ String pInParentName = inParent.getParent();
+ ProfilingData pp = getProfilingDataByKey(pInParentName);
+ pp.addInCount(totalSampleCount);
+ }
+ } else {
+ String pName = fupData.getParent();
+ ProfilingData inParent = getProfilingDataByKey(pName);
+ inParent.addInCount(totalSampleCount);
+
+ if (null != inParent.getParent()) {
+ String pInParentName = inParent.getParent();
+ ProfilingData ppData = getProfilingDataByKey(pInParentName);
+ ppData.addInCount(totalSampleCount);
+ }
+ }
+ fupData.addInCount(totalSampleCount);
+ }
+ }
+ }
+
+ private List<Long> makeCallstackHashAndList(List<String> callstackLog) {
+ HashMap<Long, CallStackUnit> addrMap = CallStackManager.getInstance()
+ .getCallStackApiByAddrMap();
+ List<Long> addrs = new ArrayList<Long>();
+ int size = callstackLog.size();
+ for (int i = 1; i + 1 < size; i += 2) {
+ if (callstackLog.get(i).equals(AnalyzerConstants.CALLSTACK_END)
+ || callstackLog.get(i + 1).equals(
+ AnalyzerConstants.CALLSTACK_END)) {
+ break;
+ }
+ String addrStr = callstackLog.get(i);
+ if (addrStr.isEmpty()) {
+ return null;
+ }
+ long addr = 0;
+ try {
+ addr = Long.parseLong(addrStr);
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ return null;
+ }
+ addrs.add(addr);
+
+ CallStackUnit callstackUnit = addrMap.get(addr);
+ if (null == callstackUnit) {
+ String funcName = callstackLog.get(i + 1);
+ CallStackUnit newCallstackUnit = new CallStackUnit(addr,
+ funcName);
+ addrMap.put(addr, newCallstackUnit);
+ }
+ }
+ return addrs;
+ }
+
+ private ProfilingData makeNewProfilingData(CallStackUnit inputData,
+ boolean isParent) {
+ ProfilingData newProfilingData = new ProfilingData(inputData, isParent,
+ this);
+ getProfilingDataMap().put(newProfilingData.getSequence(),
+ newProfilingData);
+ if (isParent) {
+ FunctionUsageProfiler.getSymbolSeqHash().put(inputData.getPath(),
+ newProfilingData.getSequence());
+ } else {
+ FunctionUsageProfiler.getSymbolSeqHash().put(inputData.getSymbol(),
+ newProfilingData.getSequence());
+ }
+ return newProfilingData;
+ }
+
+ public void makeFupDataForCallTrace(CallStackUnit inputCallstackApiData,
+ String[] inputLog) {
+ long exeTime = 0;
+ String strType = inputLog[LogCenterConstants.USER_FUNCTION_TYPE_INDEX];
+ int type = Integer.parseInt(strType);
+ if (type == LogCenterConstants.USER_FUNCTION_EVENT_TYPE_EXIT) {
+ String strExeTime = inputLog[LogCenterConstants.USER_FUNCTION_ELAPSED_TIME_INDEX];
+ exeTime += Long.parseLong(strExeTime);
+ }
+
+ ProfilingData parent = getProfilingDataByKey(inputCallstackApiData
+ .getPath());
+ if (null == parent) {
+ parent = makeNewProfilingData(inputCallstackApiData, true);
+ checkUserCall(inputCallstackApiData, parent, null);
+
+ ProfilingData child = makeNewProfilingData(inputCallstackApiData,
+ false);
+ parent.addChild(child);
+ child.addExCount();
+ child.addElpasedTime(exeTime);
+ child.setParent(parent.getName());
+
+ if (type != LogCenterConstants.USER_FUNCTION_EVENT_TYPE_EXIT) {
+ child.addCallCount();
+ }
+ } else { // null != parent
+ ProfilingData child = getProfilingDataByKey(inputCallstackApiData
+ .getSymbol());
+ if (null == child) {
+ child = makeNewProfilingData(inputCallstackApiData, false);
+ parent.addChild(child);
+ child.setParent(parent.getName());
+ }
+ child.addElpasedTime(exeTime);
+ if (type != LogCenterConstants.USER_FUNCTION_EVENT_TYPE_EXIT) {
+ child.addCallCount();
+ }
+
+ // calculate internal time
+ if (type == LogCenterConstants.USER_FUNCTION_EVENT_TYPE_EXIT) {
+ if (null == current) {
+ // bug
+ System.out
+ .println("bug found!! must debug!!!" + inputCallstackApiData.getFunctionName()); //$NON-NLS-1$
+ } else {
+ CallstackTree parentCt = current.getParent();
+ if (null != parentCt) {
+ parentCt.addChildExeTime(current.getThis()
+ .getLastElapsedTime());
+ }
+ child.addExclusiveElapsedTime(current.getInclusiveExeTime());
+ current = current.getParent();
+ }
+ } else {
+ if (null == current) {
+ CallstackTree ct = new CallstackTree(child, null);
+ current = ct;
+ } else {
+ CallstackTree ct = new CallstackTree(child, current);
+ current.addChild(ct);
+ current = ct;
+ }
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.summary.profiling;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ProfilingChildData {
+ private String seq;
+ private List<String> children;
+
+ public ProfilingChildData(String seq) {
+ this.seq = seq;
+ }
+
+ public String getSeq() {
+ return seq;
+ }
+
+ public List<String> getChildren() {
+ if (null == children) {
+ children = new ArrayList<String>();
+ }
+ return children;
+ }
+
+ public boolean equals(ProfilingChildData input) {
+ if (!input.getSeq().equals(seq)) {
+ return false;
+ }
+
+ if (!children.containsAll(input.getChildren())
+ || !input.getChildren().containsAll(children)) {
+ return false;
+ }
+ return true;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * WooJin Jung <woojin2.jung@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.summary.profiling;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit;
+
+public class ProfilingData {
+ public static final int DATA_FIELD_SIZE = 9;
+ public static final int SEQUENCE_INDEX = 0;
+ public static final int NAME_INDEX = 1;
+ public static final int EXCOUNT_INDEX = 2;
+ public static final int INCOUNT_INDEX = 3;
+ public static final int CALLCOUNT_INDEX = 4;
+ public static final int PARENT_INDEX = 5;
+ public static final int KEY_INDEX = 6;
+ public static final int INCL_ELAPSED_TIME_INDEX = 7;
+ public static final int EXCL_ELAPSED_TIME_INDEX = 8;
+
+ private static int internalSeq = 0;
+ private int seq = -1;
+ private String name = null;
+ private int exCount = 0;
+ private int inCount = 0;
+ private int callCount = 0;
+ private String parent = null;
+ private String key = null;
+ private ProfilingChildData children = null;
+ private long inElapsedTime = 0;
+ private long lastExeTime = 0;
+ private long exElapsedTime = 0;
+ private int lastLogSeq = -1;
+
+ private ProfileDataMaker profiler = null;
+
+ public ProfilingData(CallStackUnit inputData, boolean isParent,
+ ProfileDataMaker profiler) {
+ if (isParent) {
+ this.name = inputData.getPath();
+ } else {
+ this.name = inputData.getFunctionName();
+ }
+
+ seq = internalSeq++;
+ this.key = inputData.getSymbol();
+ this.profiler = profiler;
+ }
+
+ public ProfilingChildData getChildData() {
+ if (null == children) {
+ children = new ProfilingChildData(Integer.toString(seq));
+ profiler.getChildListMap().put(Integer.toString(seq), children);
+ }
+ return children;
+ }
+
+ /** using open trace **/
+ public ProfilingData(List<String> input, ProfileDataMaker profiler) {
+ if (input.size() < DATA_FIELD_SIZE) {
+ return;
+ }
+ seq = Integer.parseInt(input.get(SEQUENCE_INDEX));
+ name = input.get(NAME_INDEX);
+ exCount = Integer.parseInt(input.get(EXCOUNT_INDEX));
+ inCount = Integer.parseInt(input.get(INCOUNT_INDEX));
+ callCount = Integer.parseInt(input.get(CALLCOUNT_INDEX));
+ parent = input.get(PARENT_INDEX);
+ key = input.get(KEY_INDEX);
+ if (!input.get(INCL_ELAPSED_TIME_INDEX).isEmpty()) {
+ inElapsedTime = Integer
+ .parseInt(input.get(INCL_ELAPSED_TIME_INDEX));
+ }
+ if (!input.get(EXCL_ELAPSED_TIME_INDEX).isEmpty()) {
+ exElapsedTime = Integer
+ .parseInt(input.get(EXCL_ELAPSED_TIME_INDEX));
+ }
+
+ this.profiler = profiler;
+ }
+
+ /** using save trace **/
+ public List<String> getSaveData() {
+ List<String> output = new ArrayList<String>();
+ for (int i = 0; i < DATA_FIELD_SIZE; i++) {
+ output.add(CommonConstants.EMPTY);
+ }
+ output.set(SEQUENCE_INDEX, Integer.toString(seq));
+ output.set(NAME_INDEX, name);
+ output.set(EXCOUNT_INDEX, Integer.toString(exCount));
+ output.set(INCOUNT_INDEX, Integer.toString(inCount));
+ output.set(CALLCOUNT_INDEX, Integer.toString(callCount));
+ output.set(PARENT_INDEX, parent);
+ output.set(KEY_INDEX, key);
+ output.set(INCL_ELAPSED_TIME_INDEX, Long.toString(inElapsedTime));
+ output.set(EXCL_ELAPSED_TIME_INDEX, Long.toString(exElapsedTime));
+ return output;
+ }
+
+ public void addChild(ProfilingData child) {
+ String seq = child.getSequence();
+ getChildData().getChildren().add(seq);
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+ public String getParent() {
+ return parent;
+ }
+
+ public void setParent(String parentKey) {
+ this.parent = parentKey;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public int getExCount() {
+ List<String> seqs = getChildData().getChildren();
+ if (seqs.isEmpty()) {
+ return exCount;
+ }
+
+ int size = seqs.size();
+ int count = 0;
+ for (int i = 0; i < size; i++) {
+ ProfilingData data = profiler.getProfilingDataMap()
+ .get(seqs.get(i));
+ if (null != data) {
+ count += data.getExCount();
+ }
+ }
+ return exCount + count;
+ }
+
+ public void addExCount() {
+ exCount++;
+ }
+
+ public int getInCount() {
+ return inCount;
+ }
+
+ public void addInCount(int seq) {
+ if (seq == lastLogSeq) {
+ return;
+ } else {
+ inCount++;
+ lastLogSeq = seq;
+ return;
+ }
+ }
+
+ public int getCallCount() {
+ return callCount;
+ }
+
+ public void addCallCount() {
+ callCount++;
+ }
+
+ public void addElpasedTime(long time) {
+ lastExeTime = time;
+ inElapsedTime += time;
+ }
+
+ public long getElapsedTime() {
+ return inElapsedTime;
+ }
+
+ public long getLastElapsedTime() {
+ return lastExeTime;
+ }
+
+ public void addExclusiveElapsedTime(long time) {
+ exElapsedTime += time;
+ }
+
+ public long getExclusiveElapsedTime() {
+ return exElapsedTime;
+ }
+
+ public boolean isParent() {
+ if (getChildData().getChildren().isEmpty()) {
+ return false;
+ }
+ return true;
+ }
+
+ public String getSequence() {
+ return Integer.toString(seq);
+ }
+
+ // use only opentrace
+ public void setSequence(String seq) {
+ this.seq = Integer.parseInt(seq);
+ }
+
+ public static void clear() {
+ internalSeq = 0;
+ }
+
+ public List<ProfilingData> getChildList() {
+ List<ProfilingData> output = new ArrayList<ProfilingData>();
+ List<String> seqs = getChildData().getChildren();
+
+ for (int i = 0; i < seqs.size(); i++) {
+ ProfilingData child = profiler.getProfilingDataMap().get(
+ seqs.get(i));
+ if (null != child) {
+ output.add(child);
+ }
+ }
+ return output;
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.summary.profiling;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.eclipse.nebula.widgets.grid.GridColumn;
+import org.eclipse.nebula.widgets.grid.GridColumnGroup;
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.model.ColumnData;
+import org.tizen.dynamicanalyzer.model.TreeInput;
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.range.RangeProfilingView;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableHeaderRenderer;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.TreeDataComparator;
+import org.tizen.dynamicanalyzer.utils.Formatter;
+
+public class ProfilingTable extends DATreeComposite {
+ public static final String ID = ProfilingTable.class.getName();
+ private boolean isRange = false;
+
+ public ProfilingTable(Composite parent, int compStyle, int tableStyle) {
+ super(parent, compStyle, tableStyle);
+ setComparator(new TreeDataComparator());
+
+ comparator.setType(AnalyzerConstants.SORT_TYPE_NUM);
+ comparator.setColumn(0);
+
+ table.addListener(SWT.Expand, new Listener() {
+
+ @Override
+ public void handleEvent(Event event) {
+ GridItem item = (GridItem) event.item;
+ setExpand(item, true);
+ }
+ });
+
+ table.addListener(SWT.Collapse, new Listener() {
+ @Override
+ public void handleEvent(Event event) {
+ GridItem item = (GridItem) event.item;
+ setExpand(item, false);
+ }
+ });
+
+ table.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ GridItem[] items = table.getSelection();
+
+ String id = FunctionUsageProfilingView.ID;
+ if (isRange) {
+ id = RangeProfilingView.ID;
+ }
+ DASelectionData selData = new DASelectionData(id, 0, 0, items,
+ table);
+ AnalyzerManager.getCurrentPage().updatePage(selData);
+ AnalyzerManager.getCurrentPage().controlSelection(id);
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+
+ table.addMouseListener(new MouseListener() {
+
+ @Override
+ public void mouseUp(MouseEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void mouseDown(MouseEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void mouseDoubleClick(MouseEvent e) {
+ GridItem[] items = (GridItem[]) table.getSelection();
+ if (null == items || items.length == 0) {
+ return;
+ }
+ GridItem item = items[0];
+ if (item.isExpanded()) {
+ setExpand(item, false);
+ } else {
+ setExpand(item, true);
+ }
+ updateTree();
+ }
+ });
+ }
+
+ public void setColumns(List<ColumnData> columnData) {
+ int size = columnData.size();
+ int index = 0;
+ for (int i = 0; i < size; i++) {
+ if (columnData.get(i).isParent()) {
+ GridColumnGroup columnGroup = new GridColumnGroup(table,
+ SWT.NONE);
+ columnGroup.setHeaderRenderer(new ColumnGroupRenderer());
+ columnGroup.setText(columnData.get(i).getText());
+ List<ColumnData> children = columnData.get(i).getChildren();
+ int childSize = children.size();
+ for (int ii = 0; ii < childSize; ii++) {
+ createColumn(columnGroup, children.get(ii), index++);
+ }
+ } else {
+ createColumn(table, columnData.get(i), index++);
+ }
+ }
+ }
+
+ private ProfileDataMaker getProfileDataMaker() {
+ if (isRange) {
+ return RangeDataManager.getInstance().getProfileDataMaker();
+ } else {
+ return FunctionUsageProfiler.getInstance().getProfileDataMaker();
+ }
+ }
+
+ private void createColumn(Object parent, ColumnData data, int index) {
+ GridColumn column = null;
+ if (parent instanceof GridColumnGroup) {
+ GridColumnGroup group = (GridColumnGroup) parent;
+ column = new GridColumn(group, SWT.NONE);
+ } else {
+ Grid table = (Grid) parent;
+ column = new GridColumn(table, SWT.NONE);
+ }
+
+ column.setCellRenderer(new FunctionUsageProfilingTableCellRenderer());
+ column.setHeaderRenderer(new DATableHeaderRenderer());
+ column.setText(data.getText());
+ if (data.getWidth() == 0) {
+ column.pack();
+ } else {
+ column.setWidth(data.getWidth());
+ }
+ if (isTree && index == 0) {
+ column.setTree(true);
+ }
+
+ if (null != comparator && null != sourceColumns && null != sortTypes) {
+ final int type = sortTypes[index];
+ final int sourceColumn = sourceColumns[index];
+ final int columnIndex = index;
+ column.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ comparator.setType(type);
+ comparator.setColumn(columnIndex);
+ comparator.setSourceColumn(sourceColumn);
+ comparator.reverseDirection();
+ updateTree();
+ }
+ });
+ }
+ }
+
+ private TreeInput makeInput(ProfilingData input, int inputType) {
+ // table data
+ DATableDataFormat tableData = new DATableDataFormat(input.getSequence());
+
+ // make input data
+ {
+ // text
+ List<String> inputData = new ArrayList<String>();
+ for (int i = 0; i < ProfilingData.DATA_FIELD_SIZE; i++) {
+ inputData.add(CommonConstants.EMPTY);
+ }
+ inputData.set(ProfilingData.SEQUENCE_INDEX, input.getSequence());
+ inputData.set(ProfilingData.NAME_INDEX, input.getName());
+ inputData.set(ProfilingData.EXCOUNT_INDEX,
+ Integer.toString(input.getExCount()));
+ inputData.set(ProfilingData.INCOUNT_INDEX,
+ Integer.toString(input.getInCount()));
+ inputData.set(ProfilingData.CALLCOUNT_INDEX,
+ Integer.toString(input.getCallCount()));
+ inputData.set(ProfilingData.PARENT_INDEX, input.getParent());
+ inputData.set(ProfilingData.KEY_INDEX, input.getKey());
+ inputData.set(ProfilingData.INCL_ELAPSED_TIME_INDEX,
+ Long.toString(input.getElapsedTime()));
+ inputData.set(ProfilingData.EXCL_ELAPSED_TIME_INDEX,
+ Long.toString(input.getExclusiveElapsedTime()));
+ tableData.getData().addAll(inputData);
+ }
+
+ tableData.setObject(input.getName());
+ ProfileDataMaker profiler = getProfileDataMaker();
+ String exTime = "0", exRate = "0.00", inTime = "0", inRate = "0.00", callCount = "0", exeTime = "0", inExeTime = "0"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
+
+ try {
+ exTime = profiler.getCpuTime(input, true);
+ exTime = Formatter.toTimeFormat2(exTime);
+ exRate = profiler.getCpuRate(input, true);
+ inTime = profiler.getCpuTime(input, false);
+ inTime = Formatter.toTimeFormat2(inTime);
+ inRate = profiler.getCpuRate(input, false);
+
+ if (0 == input.getCallCount()) {
+ callCount = CommonConstants.DASH;
+ } else {
+ callCount = Integer.toString(input.getCallCount());
+ }
+ if (0 == input.getExclusiveElapsedTime()) {
+ exeTime = CommonConstants.DASH;
+ } else {
+ exeTime = Long.toString(input.getExclusiveElapsedTime());
+ exeTime = Formatter.toTimeFormat(exeTime);
+ }
+
+ if (0 == input.getElapsedTime()) {
+ inExeTime = CommonConstants.DASH;
+ } else {
+ inExeTime = Long.toString(input.getElapsedTime());
+ inExeTime = Formatter.toTimeFormat(inExeTime);
+ }
+ } catch (NumberFormatException e) {
+ // FIXME
+ e.printStackTrace();
+ }
+
+ List<String> text = new ArrayList<String>();
+ text.add(input.getName()); // must add 0 column data empty
+ text.add(exTime);
+ text.add(exRate + CommonConstants.SPACE + CommonConstants.PERCENT);
+ text.add(exeTime);
+ if (inputType == AnalyzerConstants.FUPD_DEPENDENT_LIB) {
+ text.add(CommonConstants.DASH);
+ text.add(CommonConstants.DASH);
+ } else {
+ text.add(inTime);
+ text.add(inRate + CommonConstants.SPACE + CommonConstants.PERCENT);
+ }
+ text.add(inExeTime);
+ text.add(callCount);
+
+ TreeInput output = new TreeInput();
+ output.setText(text);
+ output.setData(tableData);
+ output.setParent(input.getParent());
+ return output;
+ }
+
+ // !! recursive!!
+ public void makeChildTree(List<ProfilingData> children, TreeInput parent,
+ String parentName, int type) {
+ if (!children.isEmpty()) {
+ int size = children.size();
+ for (int i = 0; i < size; i++) {
+ ProfilingData data = children.get(i);
+ TreeInput input = makeInput(data, type);
+ if (!data.getChildList().isEmpty()) {
+ makeChildTree(data.getChildList(), input, data.getName(),
+ type);
+ }
+ parent.getChildren().add(input);
+ input.setParent(parentName);
+ }
+ }
+ }
+
+ public void setRangeTable(boolean isRange) {
+ this.isRange = isRange;
+ }
+
+ @Override
+ public List<TreeInput> makeTreeInput() {
+ List<TreeInput> output = new ArrayList<TreeInput>();
+ ProfileDataMaker profiler = getProfileDataMaker();
+
+ ProfilingData appBin = profiler.getAppBin();
+ if (null != appBin) {
+ TreeInput appBinInput = makeInput(appBin,
+ AnalyzerConstants.FUPD_APPLICATION);
+ {
+ List<ProfilingData> children = appBin.getChildList();
+ makeChildTree(children, appBinInput, appBin.getName(),
+ AnalyzerConstants.FUPD_APPLICATION);
+ }
+ output.add(appBinInput);
+ }
+
+ ProfilingData depLib = profiler.getDependentLib();
+ if (null != depLib) {
+ TreeInput depLibInput = makeInput(depLib,
+ AnalyzerConstants.FUPD_DEPENDENT_LIB);
+ {
+ List<ProfilingData> children = depLib.getChildList();
+ makeChildTree(children, depLibInput, depLib.getName(),
+ AnalyzerConstants.FUPD_DEPENDENT_LIB);
+ }
+ output.add(depLibInput);
+ }
+
+ return output;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.summary.warning;
+
+import org.tizen.dynamicanalyzer.nl.SummaryLabels;
+
+public enum WarningCase {
+ DUPLICATE_OPEN(1, SummaryLabels.WARNING_CASE_PRE_FIX,
+ SummaryLabels.WARNING_CASE_POST_FIX_DUPLICATE,
+ SummaryLabels.WARNING_CASE_BRIEF_DUPLICATE),
+
+ WITHOUT_USING(2, SummaryLabels.WARNING_CASE_PRE_FIX,
+ SummaryLabels.WARNING_CASE_POST_FIX_NO_OPERATION,
+ SummaryLabels.WARNING_CASE_BRIEF_NO_OPERATION),
+
+ JOINABLE_LEAK(3, SummaryLabels.WARNING_CASE_PRE_FIX,
+ SummaryLabels.WARNING_CASE_POST_FIX_JOINABLE_LEAK,
+ SummaryLabels.WARNING_CASE_BRIEF_JOINABLE_LEAK);
+
+ private final int type;
+ private final String prefix;
+ private final String postfix;
+ private final String shortMsg;
+
+ private WarningCase(int type, String msgPrefix, String msgPostfix,
+ String shortMsg) {
+ this.type = type;
+ prefix = msgPrefix;
+ postfix = msgPostfix;
+ this.shortMsg = shortMsg;
+ }
+
+ public int getType() {
+ return type;
+ }
+
+ public String getMessage(String path) {
+ return prefix + path + postfix;
+ }
+
+ public String getShortMessage() {
+ return shortMsg;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.summary.warning;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+
+public class WarningChecker {
+ private List<WarningData> warningData = null;
+
+ public void clear() {
+ getWarningData().clear();
+ WarningData.resetSeq();
+ }
+
+ public List<WarningData> getWarningData() {
+ if (null == warningData) {
+ warningData = new ArrayList<WarningData>();
+ }
+ return warningData;
+ }
+
+ public WarningData getWarningDataByLogSeq(String seq) {
+ int size = getWarningData().size();
+ for (int i = 0; i < size; i++) {
+ WarningData data = getWarningData().get(i);
+ String logSeq = data.getData().get(
+ LogCenterConstants.SEQUENCE_NUMBER_INDEX);
+ if (null != logSeq && seq.equals(logSeq)) {
+ return data;
+ }
+ }
+ return null;
+ }
+
+ public boolean isChecked(String key, int type) {
+ int size = getWarningData().size();
+ for (int i = 0; i < size; i++) {
+ String fileKey = warningData.get(i).getKey();
+ int warningType = warningData.get(i).getWarningCase();
+ if (key.equals(fileKey) && warningType == type) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean removeData(String key, int type) {
+ int size = getWarningData().size();
+ for (int i = 0; i < size; i++) {
+ String fileKey = warningData.get(i).getKey();
+ int warningType = warningData.get(i).getWarningCase();
+ if (key.equals(fileKey) && warningType == type) {
+ warningData.remove(i);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static String messageMaker(WarningData warning, boolean isShort) {
+ int warningCase = warning.getWarningCase();
+ if (warningCase == WarningCase.DUPLICATE_OPEN.getType()) {
+ if (isShort) {
+ return WarningCase.DUPLICATE_OPEN.getShortMessage();
+ }
+ return WarningCase.DUPLICATE_OPEN.getMessage(warning.getKey());
+ } else if (warningCase == WarningCase.WITHOUT_USING.getType()) {
+ if (isShort) {
+ return WarningCase.WITHOUT_USING.getShortMessage();
+ }
+ return WarningCase.WITHOUT_USING.getMessage(warning.getKey());
+ } else if (warningCase == WarningCase.JOINABLE_LEAK.getType()) {
+ if (isShort) {
+ return WarningCase.JOINABLE_LEAK.getShortMessage();
+ }
+ return WarningCase.JOINABLE_LEAK.getMessage(warning.getKey());
+ }
+ return CommonConstants.EMPTY;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.summary.warning;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class WarningData {
+ private static int uNum = 1;
+ private int seq = 0;
+ private int category;
+ private int warningCase;
+ private List<String> data = null;
+ private String key = null;
+
+ public WarningData(int logId, int wCase, List<String> data, String key) {
+ seq = uNum++;
+ category = logId;
+ warningCase = wCase;
+ this.data = data;
+ this.key = key;
+ }
+
+ public List<String> getData() {
+ if (null == data) {
+ data = new ArrayList<String>();
+ }
+ return data;
+ }
+
+ public int getSeq() {
+ return seq;
+ }
+
+ public int getCategory() {
+ return category;
+ }
+
+ public int getWarningCase() {
+ return warningCase;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public static void resetSeq() {
+ uNum = 1;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.summary.warning;
+
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.model.DAView;
+import org.tizen.dynamicanalyzer.nl.SummaryLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
+
+public class WarningDetailView extends DAView {
+
+ public String ID = WarningDetailView.class.getName();
+
+ protected boolean isRange = false;
+
+ protected Canvas canvas = null;
+ protected String warningMessage = CommonConstants.EMPTY;
+ protected final String titleText = SummaryLabels.FILE_DETAILS_TITLE;
+ protected String selectionViewId = null;
+
+ public WarningDetailView(Composite parent, int style) {
+ super(parent, style);
+ this.setLayout(new FillLayout());
+ canvas = new Canvas(this, SWT.NONE);
+ canvas.addPaintListener(detailPaintListener);
+ canvas.setBackground(ColorResources.DIALOG_BG_UPPER);
+ selectionViewId = WarningListView.ID;
+ }
+
+ protected PaintListener detailPaintListener = new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ Rectangle rect = canvas.getBounds();
+ int width = rect.width - 20;
+ e.gc.setFont(FontResources.TABLE_CELL_FONT);
+ e.gc.setForeground(ColorResources.DEFAULT_FONT_COLOR);
+ String text = warningMessage;
+ Point titleSize = e.gc.textExtent(titleText, SWT.DRAW_MNEMONIC);
+ int fontHeight = titleSize.y + 5;
+ e.gc.drawText(titleText, 5, 0);
+
+ for (int i = 1; text.length() > 0; i++) {
+ Point textSize = e.gc.textExtent(text, SWT.DRAW_MNEMONIC);
+ String inputText = ""; //$NON-NLS-1$
+ if (textSize.x > width) {
+ int strLen = (width * text.length()) / textSize.x;
+ inputText += text.substring(0, strLen - 1);
+ text = text.substring(strLen - 1, text.length());
+ } else {
+ inputText += text;
+ text = CommonConstants.EMPTY;
+ }
+ e.gc.drawText(inputText, 10, fontHeight * i);
+ }
+ }
+ };
+
+ @Override
+ public void updateView(DASelectionData data) {
+ if (data.getViewId().equals(selectionViewId)) {
+ GridItem[] items = (GridItem[]) data.getData();
+ if (items.length <= 0) {
+ return;
+ }
+ GridItem item = items[0];
+ DATableDataFormat tableData = (DATableDataFormat) item.getData();
+ String seq = tableData.getData().get(
+ LogCenterConstants.SEQUENCE_NUMBER_INDEX);
+
+ WarningChecker warningChecker = null;
+ if (isRange) {
+ warningChecker = RangeDataManager.getInstance()
+ .getWarningChecker();
+ } else {
+ warningChecker = AnalyzerManager.getWarningChecker();
+ }
+ WarningData warning = warningChecker.getWarningDataByLogSeq(seq);
+ if (null == warning) {
+ warningMessage = CommonConstants.EMPTY;
+ } else {
+ warningMessage = WarningChecker.messageMaker(warning, false);
+ }
+ canvas.redraw();
+ }
+ }
+
+ @Override
+ public void clear() {
+ warningMessage = CommonConstants.EMPTY;
+ canvas.redraw();
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.summary.warning;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.model.DAView;
+import org.tizen.dynamicanalyzer.nl.SummaryLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
+import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
+
+public class WarningListView extends DAView {
+
+ public static final String ID = WarningListView.class.getName();
+
+ protected int[] innerMaxWeight = { 0, 100 };
+ protected int[] outerMaxWeight = { 0, 100 };
+
+ protected DATableComposite tableComp = null;
+ protected String[] columnNames = { SummaryLabels.WARNING_LIST_VIEW_INDEX,
+ SummaryLabels.WARNING_LIST_VIEW_CATEGORY,
+ SummaryLabels.WARNING_LIST_VIEW_WARNING_MESSAGE };
+ protected int[] columnSizes = { 25, 0, 240 };
+ protected boolean[] columnVisibility = { false, true, true };
+ protected int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NUM,
+ AnalyzerConstants.SORT_TYPE_GRID, AnalyzerConstants.SORT_TYPE_GRID };
+ protected int[] sourceColumns = { LogCenterConstants.SEQUENCE_NUMBER_INDEX,
+ LogCenterConstants.ID_INDEX, LogCenterConstants.APINAME_INDEX };
+ protected ViewContainer viewContainer = null;
+
+ public WarningListView(Composite parent, int style) {
+ super(parent, style);
+ this.setLayout(new FillLayout());
+
+ viewContainer = new ViewContainer(this, true);
+ viewContainer.setTitleText(SummaryLabels.WARNING_LIST_VIEW_TITLE);
+ setMaxWeight(innerMaxWeight, outerMaxWeight);
+
+ Composite contents = viewContainer.getContentArea();
+ contents.setBackground(ColorResources.VIEW_BG_COLOR);
+ contents.setLayout(new FillLayout());
+ tableComp = new WarningTable(contents, SWT.NONE, SWT.SINGLE
+ | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
+ tableComp.setComparator(new DefaultTableComparator());
+ tableComp.setSortTypes(sortTypes);
+ tableComp.setSourceColumns(sourceColumns);
+ tableComp.setColumns(columnNames);
+ tableComp.setColumnSize(columnSizes);
+ tableComp.setColumnVisibility(columnVisibility);
+ tableComp.setTableName(SummaryLabels.WARNING_LIST_VIEW_TITLE);
+ contents.addControlListener(new TableColumnSizePackListener(tableComp,
+ columnSizes));
+ }
+
+ @Override
+ public void updateView() {
+ tableComp.updateTable();
+ }
+
+ @Override
+ public void clear() {
+ tableComp.clear();
+ }
+
+ @Override
+ public Control getControl() {
+ return tableComp;
+ }
+
+ @Override
+ public void otherViewSelectionOccured() {
+ tableComp.deselectAll();
+ }
+
+ @Override
+ public void setMaxSize(boolean maximized) {
+
+ if (null == innerMaxWeight || null == outerMaxWeight) {
+ return;
+ }
+
+ Composite parent = getParent();
+ if (parent instanceof SashForm) {
+ parent = parent.getParent();
+ if (!(parent instanceof SashForm)) {
+ return;
+ }
+ }
+
+ Composite pParent = parent.getParent();
+ if (!(pParent instanceof SashForm)) {
+ return;
+ }
+
+ SashForm innerForm = (SashForm) parent;
+ SashForm outerForm = (SashForm) pParent;
+
+ if (maximized) {
+ oldInnerLayout = innerForm.getWeights();
+ oldOuterLayout = outerForm.getWeights();
+ innerForm.setWeights(innerMaxWeight);
+ outerForm.setWeights(outerMaxWeight);
+ } else {
+ innerForm.setWeights(oldInnerLayout);
+ outerForm.setWeights(oldOuterLayout);
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.summary.warning;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.listeners.SummaryMouseDoubleClickListener;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.model.TableInput;
+import org.tizen.dynamicanalyzer.nl.SummaryLabels;
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.range.RangeWarningListView;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
+
+public class WarningTable extends DATableComposite {
+ private boolean isRange = false;
+
+ public WarningTable(Composite parent, int compStyle, int tableStyle) {
+ super(parent, compStyle, tableStyle);
+ setRangePopup();
+ table.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ GridItem[] items = table.getSelection();
+
+ DATableDataFormat dataFormat = (DATableDataFormat) items[0]
+ .getData();
+ String time = dataFormat.getData().get(
+ LogCenterConstants.TIME_INDEX);
+
+ String id = WarningListView.ID;
+ if (isRange) {
+ id = RangeWarningListView.ID;
+ }
+ DASelectionData selData = new DASelectionData(id, Long
+ .parseLong(time), 0, items, table);
+ AnalyzerManager.getCurrentPage().updatePage(selData);
+ AnalyzerManager.getCurrentPage().controlSelection(id);
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+ });
+
+ table.addMouseListener(new SummaryMouseDoubleClickListener());
+ }
+
+ public void setRangeTable(boolean isRange) {
+ this.isRange = isRange;
+ }
+
+ protected List<TableInput> makeTableInput() {
+ List<WarningData> warningList = null;
+ if (isRange) {
+ warningList = RangeDataManager.getInstance().getWarningChecker()
+ .getWarningData();
+ } else {
+ warningList = AnalyzerManager.getWarningChecker().getWarningData();
+ }
+ List<TableInput> input = new ArrayList<TableInput>();
+ int size = warningList.size();
+ for (int i = 0; i < size; i++) {
+ // create text
+ List<String> text = new ArrayList<String>();
+ WarningData warningData = warningList.get(i);
+ List<String> warningInput = warningData.getData();
+
+ text.add(warningInput.get(LogCenterConstants.SEQUENCE_NUMBER_INDEX));
+ {
+ if (LogCenterConstants.LOG_RESOURCE == warningData
+ .getCategory()) {
+ String fdType = warningInput
+ .get(LogCenterConstants.RESOURCE_FDTYPE_INDEX);
+ int type = Integer.parseInt(fdType);
+ if (type == LogCenterConstants.FD_TYPE_FILE) {
+ text.add(SummaryLabels.WARNING_TABLE_FILE);
+ } else {
+ text.add(SummaryLabels.WARNING_TABLE_SOCKET);
+ }
+ } else {
+ text.add(LogCenterConstants
+ .getLogCenterNameFromId(warningData.getCategory()));
+ }
+ }
+ String message = WarningChecker.messageMaker(warningData, true);
+ text.add(message);
+ // create images
+
+ // create DATableDataFormat
+ DATableDataFormat tableData = new DATableDataFormat(
+ warningInput.get(LogCenterConstants.SEQUENCE_NUMBER_INDEX));
+ tableData.getData().addAll(warningData.getData());
+
+ TableInput tableInput = new TableInput();
+ tableInput.setText(text);
+ tableInput.setData(tableData);
+ input.add(tableInput);
+ }
+ return input;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.thread;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.error.ErrorCodeManager;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.model.TableInput;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DAApiListTableComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
+import org.tizen.dynamicanalyzer.utils.Formatter;
+
+public class ThreadAPIListTable extends DAApiListTableComposite {
+ public ThreadAPIListTable(Composite parent, int compStyle, int tableStyle) {
+ super(parent, compStyle, tableStyle);
+ table.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ GridItem[] items = table.getSelection();
+ if (null == items) {
+ return;
+ }
+ long startTime = 0;
+ long endTime = 0;
+
+ DATableDataFormat dataFormat;
+ String time;
+ for (int i = 0; i < items.length; i++) {
+ dataFormat = (DATableDataFormat) items[i].getData();
+ time = dataFormat.getData().get(
+ LogCenterConstants.TIME_INDEX);
+ long itemTime = Long.parseLong(time);
+ if (0 == startTime) {
+ startTime = itemTime;
+ }
+ if (startTime > itemTime) {
+ startTime = itemTime;
+ }
+ if (endTime < itemTime) {
+ endTime = itemTime;
+ }
+ }
+
+ DASelectionData selData = new DASelectionData(
+ ThreadAPIListView.ID, startTime, endTime, items, table);
+ AnalyzerManager.getCurrentPage().updatePage(selData);
+ AnalyzerManager.getCurrentPage().controlSelection(
+ ThreadAPIListView.ID);
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+ });
+ }
+
+ @Override
+ protected List<TableInput> makeTableInput() {
+ ThreadAPIListView view = (ThreadAPIListView) AnalyzerManager
+ .getCurrentPage().getViewMap().get(ThreadAPIListView.ID);
+
+ if (!(view instanceof ThreadAPIListView)) {
+ return null;
+ }
+ ThreadPageData data = view.getPageData();
+ long rangeStartTime = view.getRangeStartTime();
+ long rangeEndTime = view.getRangeEndTime();
+
+ if (null == data) {
+ return null;
+ }
+
+ List<TableInput> input = new ArrayList<TableInput>();
+
+ List<ThreadPageDataEvent> contents = data.getContents();
+
+ ThreadPageDataEvent content;
+ for (int i = 0; i < contents.size(); i++) {
+ content = contents.get(i);
+ List<String> contentTemp = content.getContents();
+ List<String> contentText = new ArrayList<String>();
+
+ String seq = contentTemp
+ .get(LogCenterConstants.SEQUENCE_NUMBER_INDEX);
+ contentText.add(0, seq);
+ contentText.add(Formatter.toTimeFormat(contentTemp
+ .get(LogCenterConstants.TIME_INDEX)));
+ contentText.add(contentTemp.get(LogCenterConstants.APINAME_INDEX));
+ contentText
+ .add(contentTemp.get(LogCenterConstants.INPUTPARM_INDEX));
+ contentText
+ .add(contentTemp.get(LogCenterConstants.THREAD_ID_INDEX));
+ contentText.add(contentTemp.get(LogCenterConstants.RETURN_INDEX));
+ String errMsg = ErrorCodeManager.getInatance().getErrorCode(
+ contentTemp.get(LogCenterConstants.ERROR_INDEX));
+ if (null == errMsg) {
+ errMsg = "undefined error code";
+ }
+ contentText.add(errMsg);
+
+ DATableDataFormat tableData = new DATableDataFormat(
+ contentTemp.get(LogCenterConstants.SEQUENCE_NUMBER_INDEX));
+ tableData.getData().addAll(contentTemp);
+ TableInput tableInput = new TableInput();
+ tableInput.setText(contentText);
+ tableInput.setData(tableData);
+ input.add(tableInput);
+
+ long time = Long.parseLong(contentTemp
+ .get(LogCenterConstants.TIME_INDEX));
+ if (time >= rangeStartTime && time <= rangeEndTime) {
+ tableInput.setInRange(true);
+ }
+ }
+
+ return input;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.thread;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.model.DAView;
+import org.tizen.dynamicanalyzer.nl.ThreadPageLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
+import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
+
+public class ThreadAPIListView extends DAView {
+
+ public static final String ID = ThreadAPIListView.class.getName();
+ private ThreadPageData data;
+ private long rangeStartTime = 0;
+ private long rangeEndTime = 0;
+ private long selectionStartTime = 0;
+ private long selectionEndTime = 0;
+ int[] innerMaxWeight = { 0, 100 };
+ int[] outerMaxWeight = { 100, 0 };
+
+ private String[] columnNames = {
+ ThreadPageLabels.THREAD_API_LIST_VIEW_INDEX,
+ ThreadPageLabels.THREAD_API_LIST_VIEW_TIME,
+ ThreadPageLabels.THREAD_API_LIST_VIEW_NAME,
+ ThreadPageLabels.THREAD_API_LIST_VIEW_PARAMETER,
+ ThreadPageLabels.THREAD_API_LIST_VIEW_THREAD_ID,
+ ThreadPageLabels.THREAD_API_LIST_VIEW_RETURN,
+ ThreadPageLabels.THREAD_API_LIST_VIEW_ERRNO };
+
+ private int[] columnSizes = { 35, 70, 120, 250, 0, 100, 100 };
+
+ int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NUM,
+ AnalyzerConstants.SORT_TYPE_NUM,
+ AnalyzerConstants.SORT_TYPE_STRING,
+ AnalyzerConstants.SORT_TYPE_STRING,
+ AnalyzerConstants.SORT_TYPE_NUM,
+ AnalyzerConstants.SORT_TYPE_STRING,
+ AnalyzerConstants.SORT_TYPE_STRING };
+
+ int[] sourceColumns = { LogCenterConstants.SEQUENCE_NUMBER_INDEX,
+ LogCenterConstants.TIME_INDEX, LogCenterConstants.APINAME_INDEX,
+ LogCenterConstants.INPUTPARM_INDEX,
+ LogCenterConstants.THREAD_ID_INDEX,
+ LogCenterConstants.RETURN_INDEX, LogCenterConstants.ERROR_INDEX };
+
+ ThreadAPIListTable tableComp = null;
+
+ public ThreadAPIListView(Composite parent, int style) {
+ super(parent, style);
+ this.setLayout(new FillLayout());
+
+ ViewContainer viewContainer = new ViewContainer(this, true);
+ viewContainer.setTitleText(ThreadPageLabels.THREAD_API_LIST_VEIW_TITLE);
+ setMaxWeight(innerMaxWeight, outerMaxWeight);
+
+ Composite contents = viewContainer.getContentArea();
+ contents.setBackground(ColorResources.WINDOW_BG_COLOR);
+ contents.setLayout(new FillLayout());
+ tableComp = new ThreadAPIListTable(contents, SWT.NONE, SWT.MULTI
+ | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
+ tableComp.setTableName("Thread API List");
+ tableComp.setComparator(new DefaultTableComparator());
+ tableComp.setSortTypes(sortTypes);
+ tableComp.setSourceColumns(sourceColumns);
+ tableComp.setColumns(columnNames);
+ tableComp.setColumnSize(columnSizes);
+
+ contents.addControlListener(new TableColumnSizePackListener(tableComp,
+ columnSizes));
+ }
+
+ @Override
+ public void updateView() {
+ if (null == data) {
+ return;
+ }
+
+ long newRangeStartTime = 0;
+ long newRangeEndTime = 0;
+
+ if (RangeDataManager.getInstance().isBeingAnalyzed()) {
+ newRangeStartTime = RangeDataManager.getInstance().getStartTime();
+ newRangeEndTime = RangeDataManager.getInstance().getEndTime();
+ } else {
+ newRangeStartTime = 0;
+ newRangeEndTime = 0;
+ }
+
+ if (newRangeStartTime != rangeStartTime
+ || newRangeEndTime != rangeEndTime) {
+ rangeStartTime = newRangeStartTime;
+ rangeEndTime = newRangeEndTime;
+ tableComp.updateTable();
+
+ return;
+ }
+
+ if (data.getContents().size() != tableComp.getTable().getItemCount()) {
+ tableComp.updateTable();
+ }
+ }
+
+ @Override
+ public void updateView(DASelectionData data) {
+ ThreadPageData pageData = (ThreadPageData) data.getData();
+
+ if (!(pageData instanceof ThreadPageData)) {
+ selectionStartTime = data.getStartTime();
+ selectionEndTime = data.getEndTime();
+ } else {
+ this.data = pageData;
+ }
+ tableComp.getTable().removeAll();
+ tableComp.updateTable();
+ tableComp.setSelectionByTime(selectionStartTime, selectionEndTime);
+ }
+
+ @Override
+ public Control getControl() {
+ return tableComp;
+ }
+
+ @Override
+ public void clear() {
+ tableComp.getTable().removeAll();
+ data = null;
+ }
+
+ public ThreadPageData getPageData() {
+ return data;
+ }
+
+ public long getRangeStartTime() {
+ return rangeStartTime;
+ }
+
+ public void setRangeStartTime(long rangeStartTime) {
+ this.rangeStartTime = rangeStartTime;
+ }
+
+ public long getRangeEndTime() {
+ return rangeEndTime;
+ }
+
+ public void setRangeEndTime(long rangeEndTime) {
+ this.rangeEndTime = rangeEndTime;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.thread;
+
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StackLayout;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.model.DAView;
+import org.tizen.dynamicanalyzer.nl.ThreadPageLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.thread.sync.ThreadPageSyncDataManager;
+import org.tizen.dynamicanalyzer.ui.thread.thread.ThreadPageThreadDataManager;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.ui.timeline.logparser.LifecycleLogParser;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.ui.widgets.TitleComboPopupRenderer;
+import org.tizen.dynamicanalyzer.ui.widgets.TitleComboRenderer;
+import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonRenderer;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardSelectionListener;
+import org.tizen.dynamicanalyzer.widgets.combo.DACustomCombo;
+import org.tizen.dynamicanalyzer.widgets.combo.DACustomComboSelectionListener;
+import org.tizen.dynamicanalyzer.widgets.timeline.DACustomTimeline;
+
+public class ThreadChartView extends DAView {
+ public static final String ID = ThreadChartView.class.getName();
+ public final static int THREAD_CHART_HEIGHT = 40;
+ public final static int THREAD_COMBO_ITEM_HEIGHT = 24;
+
+ private final Composite contents;
+ private DAChartBoard threadChart;
+ private DAChartBoard syncChart;
+ private DACustomCombo threadCombo;
+ private DACustomCombo syncCombo;
+ private final StackLayout stackLayout;
+
+ private long rangeStartTime = -1;
+ private long rangeEndTime = -1;
+
+ ThreadPageThreadDataManager tManager;
+ ThreadPageSyncDataManager sManager;
+
+ private final RangeDataManager rangeDataManger = RangeDataManager
+ .getInstance();
+
+ public ThreadChartView(Composite parent, int style) {
+ super(parent, style);
+ this.setLayout(new FillLayout());
+
+ // TODO Auto-generated constructor stub
+ ViewContainer viewContainer = new ViewContainer(this, false);
+ viewContainer.setTitleText(ThreadPageLabels.THREAD_CHART_TITLE);
+
+ contents = viewContainer.getContentArea();
+ contents.setBackground(ColorResources.WINDOW_BG_COLOR);
+
+ stackLayout = new StackLayout();
+ contents.setLayout(stackLayout);
+ threadChart = new DAChartBoard(contents,
+ ThreadPageLabels.THREAD_CHART_TITLE);
+ threadChart.setNameFont(FontResources.CHART_NAME_FONT);
+
+ threadChart.addSelectionListener(new DAChartBoardSelectionListener() {
+
+ @Override
+ public void handleSelectionEvent(DAChartBoardItem item) {
+ // TODO Auto-generated method stub
+ AnalyzerManager.getCurrentPage().updatePage(
+ new DASelectionData(ThreadChartView.ID, 0, 0, item
+ .getData(), null));
+ }
+ });
+ syncChart = new DAChartBoard(contents,
+ ThreadPageLabels.SYNC_CHART_TITLE);
+ syncChart.setNameFont(FontResources.CHART_NAME_FONT);
+
+ syncChart.addSelectionListener(new DAChartBoardSelectionListener() {
+
+ @Override
+ public void handleSelectionEvent(DAChartBoardItem item) {
+ // TODO Auto-generated method stub
+ AnalyzerManager.getCurrentPage().updatePage(
+ new DASelectionData(ThreadChartView.ID, 0, 0, item
+ .getData(), null));
+ }
+ });
+ stackLayout.topControl = threadChart;
+
+ threadCombo = new DACustomCombo(threadChart.getTitleComp(), SWT.NONE);
+
+ threadCombo.setImages(ImageResources.TIMELINE_DROPDOWN_NORMAL,
+ ImageResources.TIMELINE_DROPDOWN_HOVER,
+ ImageResources.TIMELINE_DROPDOWN_PUSH,
+ ImageResources.TIMELINE_DROPDOWN_NORMAL);
+ threadCombo.add("Thread");
+ threadCombo.add("Sync"); // FIXME
+ threadCombo.select(0);
+ threadCombo.setComboButtonGradation(
+ ColorResources.DEVICE_APPLICATION_BUTTON_NORMAL_START,
+ ColorResources.DEVICE_APPLICATION_BUTTON_NORMAL_END,
+ ColorResources.DEVICE_APPLICATION_BUTTON_PUSH_START,
+ ColorResources.DEVICE_APPLICATION_BUTTON_PUSH_END,
+ ColorResources.DEVICE_APPLICATION_BUTTON_HOVER_START,
+ ColorResources.DEVICE_APPLICATION_BUTTON_HOVER_END,
+ ColorResources.DEVICE_APPLICATION_BUTTON_DISABLE_START,
+ ColorResources.DEVICE_APPLICATION_BUTTON_DISABLE_END);
+ threadCombo.setButtonImages(ImageResources.COMBO_DROPDOWN_UP,
+ ImageResources.COMBO_DROPDOWN_DOWN);
+ threadCombo.setEnabled(true);
+ threadCombo.setItemHeight(THREAD_COMBO_ITEM_HEIGHT);
+ threadCombo.setComboRender(new TitleComboRenderer());
+ threadCombo.setComboPopupRender(new TitleComboPopupRenderer());
+ threadCombo.setButtonRenderer(new DACustomButtonRenderer());
+ threadCombo.addSelectionListener(new DACustomComboSelectionListener() {
+
+ @Override
+ public void selectionEvent(DACustomCombo combo) {
+ // TODO Auto-generated method stub
+ String selected = combo.getText();
+ if (null == selected || selected.isEmpty()) {
+ return;
+ }
+ if (selected.equals("Sync")) {
+ changeComboThreadToSync();
+ } else {
+ return;
+ }
+ }
+ });
+
+ syncCombo = new DACustomCombo(syncChart.getTitleComp(), SWT.NONE);
+
+ syncCombo.setImages(ImageResources.TIMELINE_DROPDOWN_NORMAL,
+ ImageResources.TIMELINE_DROPDOWN_HOVER,
+ ImageResources.TIMELINE_DROPDOWN_PUSH,
+ ImageResources.TIMELINE_DROPDOWN_NORMAL);
+ syncCombo.add("Thread");
+ syncCombo.add("Sync"); // FIXME
+ syncCombo.select(1);
+ syncCombo.setComboButtonGradation(
+ ColorResources.DEVICE_APPLICATION_BUTTON_NORMAL_START,
+ ColorResources.DEVICE_APPLICATION_BUTTON_NORMAL_END,
+ ColorResources.DEVICE_APPLICATION_BUTTON_PUSH_START,
+ ColorResources.DEVICE_APPLICATION_BUTTON_PUSH_END,
+ ColorResources.DEVICE_APPLICATION_BUTTON_HOVER_START,
+ ColorResources.DEVICE_APPLICATION_BUTTON_HOVER_END,
+ ColorResources.DEVICE_APPLICATION_BUTTON_DISABLE_START,
+ ColorResources.DEVICE_APPLICATION_BUTTON_DISABLE_END);
+ syncCombo.setButtonImages(ImageResources.COMBO_DROPDOWN_UP,
+ ImageResources.COMBO_DROPDOWN_DOWN);
+ syncCombo.setEnabled(true);
+ syncCombo.setItemHeight(THREAD_COMBO_ITEM_HEIGHT);
+ syncCombo.setComboRender(new TitleComboRenderer());
+ syncCombo.setComboPopupRender(new TitleComboPopupRenderer());
+ syncCombo.setButtonRenderer(new DACustomButtonRenderer());
+ syncCombo.addSelectionListener(new DACustomComboSelectionListener() {
+
+ @Override
+ public void selectionEvent(DACustomCombo combo) {
+ // TODO Auto-generated method stub
+ String selected = combo.getText();
+ if (null == selected || selected.isEmpty()) {
+ return;
+ }
+ if (selected.equals("Thread")) {
+ changeComboSyncToThread();
+ } else {
+ return;
+ }
+ }
+ });
+
+ LifecycleLogParser.getInstance().registerLifecycleBar(
+ threadChart.getLifecycleBar());
+ LifecycleLogParser.getInstance().registerTimeline(
+ threadChart.getTimeline());
+ LifecycleLogParser.getInstance().registerLifecycleBar(
+ syncChart.getLifecycleBar());
+ LifecycleLogParser.getInstance().registerTimeline(
+ syncChart.getTimeline());
+
+ setTimelineMouseListener(threadChart.getTimeline());
+ setTimelineMouseListener(syncChart.getTimeline());
+
+ tManager = new ThreadPageThreadDataManager(threadChart);
+ sManager = new ThreadPageSyncDataManager(syncChart);
+ }
+
+ private void changeComboSyncToThread() {
+ stackLayout.topControl = threadChart;
+ contents.layout();
+ threadCombo.setText("Thread");
+ threadChart.setScaleVal(syncChart.getScaleVal());
+ threadChart.setVisibleStart(syncChart.getVisibleStart());
+ threadChart.setZoomout(syncChart.isZoomout());
+ }
+
+ private void changeComboThreadToSync() {
+ stackLayout.topControl = syncChart;
+ contents.layout();
+ syncCombo.setText("Sync");
+ syncChart.setScaleVal(threadChart.getScaleVal());
+ syncChart.setVisibleStart(threadChart.getVisibleStart());
+ syncChart.setZoomout(threadChart.isZoomout());
+ }
+
+ private void setTimelineMouseListener(final DACustomTimeline timeline) {
+ timeline.addMouseListener((new MouseAdapter() {
+ public void mouseUp(MouseEvent e) {
+ rangeDataManger
+ .setStartTime((long) (timeline.getStartRangeMarker()
+ .getTime() * TimelineConstants.MEGA));
+ rangeDataManger.setEndTime((long) (timeline.getEndRangeMarker()
+ .getTime() * TimelineConstants.MEGA));
+ }
+ }));
+ }
+
+ @Override
+ public void updateView() {
+ threadChart.setTotalEndTime(ToolbarArea.getInstance().getTime());
+ syncChart.setTotalEndTime(ToolbarArea.getInstance().getTime());
+ tManager.checkUpdate();
+ sManager.checkUpdate();
+
+ threadChart.setRangeStartTime(rangeDataManger.getStartTime()
+ / TimelineConstants.MEGA);
+ threadChart.setRangeEndTime(rangeDataManger.getEndTime()
+ / TimelineConstants.MEGA);
+ syncChart.setRangeStartTime(rangeDataManger.getStartTime()
+ / TimelineConstants.MEGA);
+ syncChart.setRangeEndTime(rangeDataManger.getEndTime()
+ / TimelineConstants.MEGA);
+
+ long newRangeStartTime = -1;
+ long newRangeEndTime = -1;
+
+ if (RangeDataManager.getInstance().isBeingAnalyzed()) {
+ newRangeStartTime = rangeDataManger.getStartTime();
+ newRangeEndTime = rangeDataManger.getEndTime();
+ }
+
+ if (newRangeStartTime != rangeStartTime
+ || newRangeEndTime != rangeEndTime) {
+ rangeStartTime = newRangeStartTime;
+ rangeEndTime = newRangeEndTime;
+
+ threadChart.setRange(rangeStartTime / TimelineConstants.MEGA,
+ rangeEndTime / TimelineConstants.MEGA);
+ syncChart.setRange(rangeStartTime / TimelineConstants.MEGA,
+ rangeEndTime / TimelineConstants.MEGA);
+ }
+ }
+
+ @Override
+ public void updateView(DASelectionData selData) {
+ long start = selData.getStartTime();
+ long end = selData.getEndTime();
+
+ double startTime = (double) start / TimelineConstants.MEGA;
+ double endTime = (double) end / TimelineConstants.MEGA;
+ double middleTime = (startTime + endTime) / 2.0;
+ if (endTime == startTime) {
+ middleTime = startTime;
+ }
+
+ DAChartBoard chartBoard = (DAChartBoard) stackLayout.topControl;
+
+ chartBoard.setVisibleMiddleTime(middleTime);
+ DAChartPlotIntervalMarker intervalMarker = chartBoard
+ .getIntervalMarker();
+ intervalMarker.setStartVal(startTime);
+ intervalMarker.setEndVal(endTime);
+ }
+
+ @Override
+ public void updateLog(LogPackage logPack) {
+ tManager.parsePageData(logPack);
+ sManager.parsePageData(logPack);
+ }
+
+ @Override
+ public void clear() {
+ threadChart.clear();
+ syncChart.clear();
+ tManager.clear();
+ sManager.clear();
+ }
+
+ @Override
+ public Control getControl() {
+ return stackLayout.topControl;
+ // return threadChart;
+ }
+
+ @Override
+ public void setSelection(List<String> data) {
+ // TODO Auto-generated method stub
+ if (stackLayout.topControl.equals(syncChart)) {
+ changeComboSyncToThread();
+ }
+
+ String selectTid = data.get(LogCenterConstants.THREAD_ID_INDEX);
+ threadChart.selectItem(tManager.getItemIndexByTid(selectTid));
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.thread;
+
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.model.DAView;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.nl.ThreadPageLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.ui.thread.sync.ThreadPageSyncData;
+import org.tizen.dynamicanalyzer.ui.thread.thread.ThreadPageThreadData;
+import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
+
+public class ThreadDetailInfoView extends DAView {
+ public static final String ID = ThreadDetailInfoView.class.getName();
+ public static final int LEFT_MARGIN = 10;
+ public static final int HEIGHT_MARGIN = 20;
+
+ private Canvas canvas = null;
+ private String tid = AnalyzerLabels.EMPTY_STRING;
+ private String type = AnalyzerLabels.EMPTY_STRING;
+ private String startTime = AnalyzerLabels.EMPTY_STRING;
+ private String endTime = AnalyzerLabels.EMPTY_STRING;
+ private String attrType = AnalyzerLabels.EMPTY_STRING;
+ private ThreadPageData item = null;
+ private boolean select = false;
+
+ int[] innerMaxWeight = { 0, 100 };
+ int[] outerMaxWeight = { 0, 100 };
+
+ private void init() {
+ tid = AnalyzerLabels.EMPTY_STRING;
+ type = AnalyzerLabels.EMPTY_STRING;
+ startTime = AnalyzerLabels.EMPTY_STRING;
+ endTime = AnalyzerLabels.EMPTY_STRING;
+ attrType = AnalyzerLabels.EMPTY_STRING;
+ select = false;
+ }
+
+ public ThreadDetailInfoView(Composite parent, int style) {
+ super(parent, style);
+ this.setLayout(new FillLayout());
+
+ ViewContainer viewContainer = new ViewContainer(this, true);
+ viewContainer.setTitleText(ThreadPageLabels.THREAD_DETAILS_TITLE);
+ setMaxWeight(innerMaxWeight, outerMaxWeight);
+
+ Composite contents = viewContainer.getContentArea();
+ contents.setBackground(ColorResources.VIEW_BG_COLOR);
+ contents.setLayout(new FillLayout());
+ canvas = new Canvas(contents, SWT.TRANSPARENT);
+ canvas.addPaintListener(new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ Rectangle rect = canvas.getBounds();
+ e.gc.setBackground(ColorResources.VIEW_BG_COLOR);
+ e.gc.fillRectangle(rect.x, rect.y, rect.width, rect.height);
+ e.gc.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
+ e.gc.setFont(FontResources.DETAIL_INFO_FONT);
+
+ if (false == select) {
+ return;
+ }
+
+ int y = HEIGHT_MARGIN;
+ Point p = e.gc.textExtent(type, SWT.DRAW_MNEMONIC);
+ e.gc.drawText(ThreadPageLabels.THREAD_DETAILS_TTYPE + type,
+ LEFT_MARGIN, y);
+ y += (p.y + HEIGHT_MARGIN);
+
+ if (null != tid && !(tid.equals(CommonConstants.EMPTY))) {
+ e.gc.drawText(ThreadPageLabels.THREAD_DETAILS_TID + tid,
+ LEFT_MARGIN, y);
+ p = e.gc.textExtent(tid, SWT.DRAW_MNEMONIC);
+ y += (p.y + HEIGHT_MARGIN);
+ }
+
+ if (null != startTime
+ && !(startTime.equals(CommonConstants.EMPTY))) {
+ e.gc.drawText(ThreadPageLabels.THREAD_DETAILS_STARTTIME
+ + startTime, LEFT_MARGIN, y);
+ p = e.gc.textExtent(startTime, SWT.DRAW_MNEMONIC);
+ y += (p.y + HEIGHT_MARGIN);
+ }
+
+ if (null != endTime && !(endTime.equals(CommonConstants.EMPTY))) {
+ e.gc.drawText(ThreadPageLabels.THREAD_DETAILS_ENDTIME
+ + endTime, LEFT_MARGIN, y);
+ p = e.gc.textExtent(ThreadPageLabels.THREAD_DETAILS_ENDTIME
+ + endTime, SWT.DRAW_MNEMONIC);
+ y += (p.y + HEIGHT_MARGIN);
+ }
+
+ if (null != attrType
+ && !(attrType.equals(CommonConstants.EMPTY))) {
+ e.gc.drawText(ThreadPageLabels.THREAD_DETAILS_TATTRTYPE
+ + attrType, LEFT_MARGIN, y);
+ }
+ }
+ });
+ }
+
+ private void updateDetails() {
+ init();
+
+ String str;
+ if (item instanceof ThreadPageThreadData) {
+ tid = item.getTid();
+ type = item.getType();
+ str = ((ThreadPageThreadData) item).getStartTime();
+ if (null != str && !(str.equals(CommonConstants.EMPTY))) {
+ startTime = str;
+ }
+ str = ((ThreadPageThreadData) item).getEndTime();
+ if (null != str && !(str.equals(CommonConstants.EMPTY))) {
+ endTime = str;
+ }
+ str = item.getAttrType();
+ if (null != str && !(str.equals(CommonConstants.EMPTY))) {
+ attrType = str;
+ }
+ } else if (item instanceof ThreadPageSyncData) {
+ type = item.getType();
+ ThreadPageSyncData syncItem = (ThreadPageSyncData) item;
+ List<ThreadPageSyncData> children = syncItem.getChildren();
+ int childrenSize = children.size();
+ if (0 == childrenSize) {
+ tid = item.getTid();
+ }
+ str = item.getAttrType();
+ if (null != str && !(str.equals(CommonConstants.EMPTY))) {
+ attrType = str;
+ }
+ }
+ select = true;
+ canvas.redraw();
+ }
+
+ private boolean isChange() {
+ if (item instanceof ThreadPageThreadData) {
+ if (!tid.equals(item.getTid())) {
+ return true;
+ }
+ if (!type.equals(item.getType())) {
+ return true;
+ }
+ if (!startTime.equals(((ThreadPageThreadData) item).getStartTime())) {
+ return true;
+ }
+ if (!endTime.equals(((ThreadPageThreadData) item).getEndTime())) {
+ return true;
+ }
+ if (!attrType.equals(item.getAttrType())) {
+ return true;
+ }
+ } else if (item instanceof ThreadPageSyncData) {
+ if (!tid.equals(item.getTid())) {
+ return true;
+ }
+ if (!attrType.equals(item.getAttrType())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public void updateView() {
+ if (true == isChange()) {
+ updateDetails();
+ }
+ }
+
+ @Override
+ public void updateView(DASelectionData data) {
+ String id = data.getViewId();
+ if (!(id.equals(ThreadChartView.ID))) {
+ return;
+ }
+ item = (ThreadPageData) data.getData();
+ if (!(item instanceof ThreadPageData)) {
+ item = null;
+ return;
+ }
+
+ updateDetails();
+ }
+
+ @Override
+ public Control getControl() {
+ return canvas;
+ }
+
+ @Override
+ public void clear() {
+ init();
+ canvas.redraw();
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.thread;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallstackView;
+import org.tizen.dynamicanalyzer.ui.info.snapshot.SnapshotView;
+import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
+
+public class ThreadPage extends DAPageComposite {
+ public static final String ID = ThreadPage.class.getName();
+
+ SashForm baseForm;
+ SashForm leftForm;
+ SashForm rightForm;
+
+ public ThreadPage(Composite parent, int style) {
+ super(parent, style);
+ name = AnalyzerLabels.COOLBAR_AREA_THREAD;
+ this.setLayout(new FillLayout());
+
+ baseForm = new SashForm(this, SWT.HORIZONTAL);
+ baseForm.setLayout(new FillLayout());
+
+ leftForm = new SashForm(baseForm, SWT.VERTICAL);
+ ThreadChartView threadChartView = new ThreadChartView(leftForm,
+ SWT.NONE);
+ addView(threadChartView);
+
+ ThreadAPIListView threadAPIListView = new ThreadAPIListView(leftForm,
+ SWT.NONE);
+ addView(threadAPIListView);
+
+ leftForm.setWeights(new int[] { 60, 40 });
+
+ rightForm = new SashForm(baseForm, SWT.VERTICAL);
+ // INFO_VIEW_INDEX = 2;
+ DATabComposite tabView = new DATabComposite(rightForm, SWT.NONE);
+ addView(tabView);
+ {
+ SnapshotView snapshotView = new SnapshotView(
+ tabView.getContentComposite(), SWT.NONE, false);
+ snapshotView
+ .setObservingViews(new String[] { ThreadAPIListView.ID });
+ tabView.addView(snapshotView, false);
+
+ CallstackView callstack = new CallstackView(
+ tabView.getContentComposite(), SWT.NONE);
+ callstack.setObservingViews(new String[] { ThreadAPIListView.ID });
+ tabView.addView(callstack, false);
+ }
+
+ // FILE_DETAIL = 3;
+ ThreadDetailInfoView detailInfo = new ThreadDetailInfoView(rightForm,
+ SWT.NONE);
+ addView(detailInfo);
+
+ rightForm.setWeights(new int[] { 50, 50 });
+ baseForm.setWeights(new int[] { 75, 25 });
+ }
+
+ @Override
+ protected void setFormWeights() {
+ baseForm.setWeights(new int[] { 100 - wRate, wRate });
+ rightForm.setWeights(new int[] { hRate, 100 - hRate });
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.thread;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.nl.ThreadPageLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.ui.summary.failed.FailedData;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
+
+public abstract class ThreadPageData {
+ private String tid;
+ private String type;
+ private String key;
+ private String attrType;
+ protected DAChartBoardItem item;
+ protected List<ThreadPageDataEvent> contents = new ArrayList<ThreadPageDataEvent>();
+ protected List<ThreadPageDataEvent> contentsQueue = new ArrayList<ThreadPageDataEvent>();
+ protected DAChart chart;
+ protected boolean hasUpdate = false;
+
+ public ThreadPageData(String type, String name, String tid, String attrType) {
+ setType(type);
+ setKey(name);
+ setTid(tid);
+ setAttrType(attrType);
+ }
+
+ public String getTid() {
+ return tid;
+ }
+
+ public void setTid(String tid) {
+ this.tid = tid;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String name) {
+ this.key = name;
+ }
+
+ public DAChartBoardItem getItem() {
+ return item;
+ }
+
+ public DAChart getChart() {
+ return chart;
+ }
+
+ public void setChart(DAChart chart) {
+ this.chart = chart;
+ }
+
+ public void pushEvent(ThreadPageDataEvent event) {
+ contentsQueue.add(event);
+ hasUpdate = true;
+ }
+
+ public void setHasUpdate() {
+ hasUpdate = true;
+ }
+
+ public List<ThreadPageDataEvent> getContents() {
+ return contents;
+ }
+
+ protected abstract void checkUpdate();
+
+ public abstract void setItem(DAChartBoardItem item);
+
+ protected abstract int createChartItem(ThreadPageDataEvent event);
+
+ public String getAttrType() {
+ return attrType;
+ }
+
+ public void setAttrType(String attrType) {
+ this.attrType = attrType;
+ }
+
+ protected DAChartSeriesItem createApiItem(
+ ThreadPageDataEvent event, long errno) {
+ DAChartSeriesItem apiItem = null;
+ if (0 != errno) {
+ FailedData ffd = new FailedData(event.getContents());
+ AnalyzerManager.getFailedChecker().getFailedList().add(ffd);
+ apiItem = new DAChartSeriesItem(event.getTime(),
+ DAChartSeriesItem.SERIES_STATE_BAR,
+ ColorResources.RED, event.getTooltipContent()
+ + ThreadPageLabels.SYNC_CHART_ITEM_FAILED);
+ } else {
+ apiItem = new DAChartSeriesItem(event.getTime(),
+ DAChartSeriesItem.SERIES_STATE_BAR,
+ ColorResources.YELLOW, event.getTooltipContent());
+ }
+ return apiItem;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.thread;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public abstract class ThreadPageDataEvent {
+ private List<String> contents;
+ private double time = -1;
+ private String tid = null;
+ private int apiType = -1;
+ private String tooltip = null;
+ private long errorNum = -1;
+
+ public ThreadPageDataEvent(double time, String tid, int apiType,
+ String tooltip, long errorNum, List<String> contents) {
+ setTime(time);
+ setTid(tid);
+ setApiType(apiType);
+ setTooltipContent(tooltip);
+ setErrorNum(errorNum);
+ setContents(contents);
+ }
+
+ public List<String> getContents() {
+ if (null == contents) {
+ contents = new ArrayList<String>();
+ }
+ return contents;
+ }
+
+ public void setContents(List<String> contents) {
+ this.contents = contents;
+ }
+
+ public double getTime() {
+ return time;
+ }
+
+ public void setTime(double time) {
+ this.time = time;
+ }
+
+ public String getTid() {
+ return tid;
+ }
+
+ public void setTid(String tid) {
+ this.tid = tid;
+ }
+
+ public int getApiType() {
+ return apiType;
+ }
+
+ public void setApiType(int apiType) {
+ this.apiType = apiType;
+ }
+
+ public String getTooltipContent() {
+ return tooltip;
+ }
+
+ public void setTooltipContent(String tooltip) {
+ this.tooltip = tooltip;
+ }
+
+ public long getErrorNum() {
+ return errorNum;
+ }
+
+ public void setErrorNum(long errorNum) {
+ this.errorNum = errorNum;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.thread.sync;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.nl.ThreadPageLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.ui.thread.ThreadPageData;
+import org.tizen.dynamicanalyzer.ui.thread.ThreadPageDataEvent;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
+
+public class ThreadPageSyncData extends ThreadPageData {
+ private List<ThreadPageSyncData> children = new ArrayList<ThreadPageSyncData>();
+ private DAChartSeries apiSeries;
+ private DAChartSeries stateSeries;
+
+ public ThreadPageSyncData(String type, String name, String tid,
+ String attrType) {
+ super(type, name, tid, attrType);
+ }
+
+ protected void pushSync(ThreadPageSyncData sync) {
+ children.add(sync);
+ hasUpdate = true;
+ }
+
+ protected ThreadPageSyncData findChildData(String tId) {
+ int size = children.size();
+ ThreadPageSyncData ret;
+ for (int i = 0; i < size; i++) {
+ ret = children.get(i);
+ if (ret.getTid().equals(tId)) {
+ return ret;
+ }
+ }
+ return null;
+ }
+
+ public List<ThreadPageSyncData> getChildren() {
+ return children;
+ }
+
+ public void setItem(DAChartBoardItem item) {
+ this.item = item;
+ setChart(item.getChart());
+ stateSeries = chart
+ .getSeries(ThreadPageLabels.THREAD_SYNC_CHART_SERIES_STATE);
+ apiSeries = chart.getSeries(ThreadPageLabels.THREAD_CHART_SERIES_API);
+ }
+
+ private boolean isSyncApi(int apiType) {
+ if (apiType == LogCenterConstants.SYNC_API_TYPE_ACQUIRE_WAIT_END) {
+ return false;
+ }
+ if (apiType == LogCenterConstants.SYNC_API_TYPE_COND_WAIT_END) {
+ return false;
+ }
+ return true;
+ }
+
+ public void checkUpdate() {
+ if (false == hasUpdate) {
+ return;
+ } else {
+ hasUpdate = false;
+ }
+ int size = contentsQueue.size();
+ if (size > 0) {
+ ThreadPageDataEvent event;
+ for (int i = 0; i < size; i++) {
+ event = contentsQueue.get(0);
+ if (true == (isSyncApi(createChartItem(event)))) {
+ contents.add(event);
+ }
+
+ contentsQueue.remove(0);
+ }
+ chart.redraw();
+ }
+
+ size = children.size();
+ if (size > 0) {
+ ThreadPageSyncData sync;
+ for (int i = 0; i < size; i++) {
+ sync = children.get(i);
+ sync.checkUpdate();
+ }
+ }
+ }
+
+ protected int createChartItem(ThreadPageDataEvent event) {
+ DAChartSeriesItem stateItem = null;
+ DAChartSeriesItem apiItem = null;
+ ThreadPageSyncDataEvent syncEvent = (ThreadPageSyncDataEvent) event;
+ if (!(syncEvent instanceof ThreadPageSyncDataEvent)) {
+ System.out.println("error : createChartItem");
+ return -1;
+ }
+ int apiType = syncEvent.getApiType();
+ long errorNum = syncEvent.getErrorNum();
+ switch (apiType) {
+ case LogCenterConstants.SYNC_API_TYPE_NEW:
+ case LogCenterConstants.SYNC_API_TYPE_NOTIFY:
+ case LogCenterConstants.SYNC_API_TYPE_NOTIFY_ALL:
+ case LogCenterConstants.SYNC_API_TYPE_OTHER:
+ stateItem = new DAChartSeriesItem(syncEvent.getTime(),
+ DAChartSeriesItem.SERIES_STATE_CONNECTION,
+ ColorResources.THREAD_GRAPH_LOCK_RELEASE_COLOR,
+ ThreadPageLabels.SYNC_CHART_ITEM_UNUSED);
+
+ apiItem = createApiItem(syncEvent, errorNum);
+ stateSeries.addSeriesItem(stateItem);
+ apiSeries.addSeriesItem(apiItem);
+ break;
+ case LogCenterConstants.SYNC_API_TYPE_ACQUIRE_WAIT_START:
+ case LogCenterConstants.SYNC_API_TYPE_COND_WAIT_START:
+ stateItem = new DAChartSeriesItem(syncEvent.getTime(),
+ DAChartSeriesItem.SERIES_STATE_CONTINUE,
+ ColorResources.THREAD_GRAPH_LOCK_WAIT_COLOR,
+ ThreadPageLabels.SYNC_CHART_ITEM_WAITED);
+ apiItem = createApiItem(syncEvent, errorNum);
+ stateSeries.addSeriesItem(stateItem);
+ apiSeries.addSeriesItem(apiItem);
+ break;
+ case LogCenterConstants.SYNC_API_TYPE_RELEASE:
+ stateItem = new DAChartSeriesItem(syncEvent.getTime(),
+ DAChartSeriesItem.SERIES_STATE_CONNECTION,
+ ColorResources.THREAD_GRAPH_LOCK_RELEASE_COLOR,
+ ThreadPageLabels.SYNC_CHART_ITEM_UNUSED);
+ apiItem = createApiItem(syncEvent, errorNum);
+ stateSeries.addSeriesItem(stateItem);
+ apiSeries.addSeriesItem(apiItem);
+ break;
+ case LogCenterConstants.SYNC_API_TYPE_ACQUIRE_WAIT_END:
+ case LogCenterConstants.SYNC_API_TYPE_COND_WAIT_END:
+ stateItem = new DAChartSeriesItem(syncEvent.getTime(),
+ DAChartSeriesItem.SERIES_STATE_CONTINUE,
+ ColorResources.THREAD_GRAPH_LOCK_ACQUIRE_COLOR,
+ ThreadPageLabels.SYNC_CHART_ITEM_USED);
+ stateSeries.addSeriesItem(stateItem);
+ break;
+ case LogCenterConstants.SYNC_API_TYPE_TRY_ACQUIRE:
+ stateItem = new DAChartSeriesItem(syncEvent.getTime(),
+ DAChartSeriesItem.SERIES_STATE_CONTINUE,
+ ColorResources.THREAD_GRAPH_LOCK_ACQUIRE_COLOR,
+ ThreadPageLabels.SYNC_CHART_ITEM_USED);
+ apiItem = createApiItem(syncEvent, errorNum);
+ stateSeries.addSeriesItem(stateItem);
+ apiSeries.addSeriesItem(apiItem);
+ break;
+ default:
+ return -1;
+ }
+
+ return apiType;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.thread.sync;
+
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.ui.thread.ThreadPageDataEvent;
+
+public class ThreadPageSyncDataEvent extends ThreadPageDataEvent {
+ private String syncVal;
+ private int type = -1;
+
+ public ThreadPageSyncDataEvent(String syncVal, int type, int apiType,
+ double time, String tid, String tooltip, long errorNum,
+ List<String> contents) {
+ super(time, tid, apiType, tooltip, errorNum, contents);
+ setSyncVal(syncVal);
+ setType(type);
+ }
+
+ public String getSyncVal() {
+ return syncVal;
+ }
+
+ public void setSyncVal(String syncVal) {
+ this.syncVal = syncVal;
+ }
+
+ public int getType() {
+ return type;
+ }
+
+ public void setType(int type) {
+ this.type = type;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.thread.sync;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.logparser.Logs;
+import org.tizen.dynamicanalyzer.nl.ThreadPageLabels;
+import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.ui.timeline.eventlistener.TimelineChartMouseAdapter;
+import org.tizen.dynamicanalyzer.ui.timeline.eventlistener.TimelineChartMouseMoveListener;
+import org.tizen.dynamicanalyzer.ui.timeline.eventlistener.TimelineChartMouseTrackAdapter;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotTooltip;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenu;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuItem;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuListener;
+
+public class ThreadPageSyncDataManager {
+ private DAChartBoard board;
+ private List<ThreadPageSyncData> rows = new ArrayList<ThreadPageSyncData>();
+ private List<ThreadPageSyncDataEvent> syncEventQueue = new ArrayList<ThreadPageSyncDataEvent>();
+ private HashMap<String, Integer> syncAttrMap = new HashMap<String, Integer>();
+ public static final int PTHREAD_MUTEX_NORMAL = 0;
+ public static final int PTHREAD_MUTEX_RECURSIVE = 1;
+ public static final int PTHREAD_MUTEX_ERRORCHECK = 2;
+
+ private RangeDataManager rangeDataManager = RangeDataManager.getInstance();
+
+ public ThreadPageSyncDataManager(DAChartBoard board) {
+ this.setBoard(board);
+ }
+
+ protected DAChartBoard getBoard() {
+ return board;
+ }
+
+ private void setBoard(DAChartBoard board) {
+ this.board = board;
+ }
+
+ private void pushEvent(ThreadPageSyncDataEvent event) {
+ syncEventQueue.add(event);
+ }
+
+ private ThreadPageSyncData findParentData(String name) {
+ int size = rows.size();
+ ThreadPageSyncData ret;
+ for (int i = 0; i < size; i++) {
+ ret = rows.get(i);
+ if (ret.getKey().equals(name)) {
+ return ret;
+ }
+ }
+ return null;
+ }
+
+ public static String getAttrTypeByTypeInt(int typeInt) {
+ if (typeInt == PTHREAD_MUTEX_NORMAL) {
+ return ThreadPageLabels.SYNC_ATTR_TYPE_NORMAL;
+ } else if (typeInt == PTHREAD_MUTEX_RECURSIVE) {
+ return ThreadPageLabels.SYNC_ATTR_TYPE_RECURSIVE;
+ } else if (typeInt == PTHREAD_MUTEX_ERRORCHECK) {
+ return ThreadPageLabels.SYNC_ATTR_TYPE_ERRORCHECK;
+ } else {
+ return CommonConstants.EMPTY;
+ }
+ }
+
+ public static String getAttrTypeString(ThreadPageSyncDataEvent event) {
+ int type = event.getType();
+
+ if (type == LogCenterConstants.SYNC_TYPE_TIZEN_MUTEX) {
+ return ThreadPageLabels.SYNC_ATTR_TYPE_RECURSIVE;
+ } else if (type == LogCenterConstants.SYNC_TYPE_PTHREAD_MUTEX) {
+
+ return ThreadPageLabels.SYNC_ATTR_TYPE_DEFAULT;
+ }
+
+ return CommonConstants.EMPTY;
+ }
+
+ private void parseSync(List<List<String>> inputs) {
+ int size;
+ if (null == inputs || 0 == (size = inputs.size())) {
+ return;
+ }
+
+ List<String> input;
+
+ for (int i = 0; i < size; i++) {
+ input = inputs.get(i);
+ // System.out.println("input : " + input);
+ double time = Double.parseDouble(input
+ .get(LogCenterConstants.TIME_INDEX))
+ / TimelineConstants.MEGA;
+ String tid = input.get(LogCenterConstants.THREAD_ID_INDEX);
+
+ int type = Integer.parseInt(input
+ .get(LogCenterConstants.SYNC_TYPE_INDEX));
+ int apiType = Integer.parseInt(input
+ .get(LogCenterConstants.SYNC_API_TYPE_INDEX));
+ String apiName = input.get(LogCenterConstants.APINAME_INDEX);
+
+ String name = input.get(LogCenterConstants.SYNC_VAL_INDEX);
+
+ long errorNum = Long.parseLong(input
+ .get(LogCenterConstants.ERROR_INDEX));
+
+ ThreadPageSyncDataEvent event;
+ switch (type) {
+ case LogCenterConstants.SYNC_TYPE_TIZEN_MUTEX:
+ case LogCenterConstants.SYNC_TYPE_TIZEN_MONITOR:
+ case LogCenterConstants.SYNC_TYPE_TIZEN_SEMAPHORE:
+ event = new ThreadPageSyncDataEvent(name, type, apiType, time,
+ tid, apiName, errorNum, input);
+ pushEvent(event);
+ // parseTIZENSync(input, type);
+ break;
+ case LogCenterConstants.SYNC_TYPE_PTHREAD_MUTEX:
+ case LogCenterConstants.SYNC_TYPE_PTHREAD_COND_VARIABLE:
+ if (apiName
+ .equals(ThreadPageLabels.SYNC_API_PTHREAD_MUTEXATTR_INIT)) {
+ syncAttrMap.put(
+ input.get(LogCenterConstants.INPUTPARM_INDEX), -1);
+ } else if (apiName
+ .equals(ThreadPageLabels.SYNC_API_PTHREAD_MUTEXATTR_SETTYPE)) {
+ checkMutexAttrType(input
+ .get(LogCenterConstants.INPUTPARM_INDEX));
+ } else {
+ if (apiName
+ .equals(ThreadPageLabels.SYNC_API_PTHREAD_MUTEX_INIT)) {
+ checkMutexType(input
+ .get(LogCenterConstants.INPUTPARM_INDEX));
+ }
+ event = new ThreadPageSyncDataEvent(name, type, apiType,
+ time, tid, apiName, errorNum, input);
+ pushEvent(event);
+ }
+ break;
+ case LogCenterConstants.SYNC_TYPE_PTHREAD_RWLOCK:
+ case LogCenterConstants.SYNC_TYPE_PTHREAD_SPINLOCK:
+ case LogCenterConstants.SYNC_TYPE_PTHREAD_BARRIER:
+ event = new ThreadPageSyncDataEvent(name, type, apiType, time,
+ tid, apiName, errorNum, input);
+ pushEvent(event);
+ System.out.println("error : sync parse - type = " + type);
+ break;
+ default:
+ System.out.println("error : sync parse unknown - type = "
+ + type);
+ }
+ }
+ }
+
+ private void checkMutexAttrType(String input) {
+ String[] temp = input.split(",");
+ if (temp.length != 2) {
+ return;
+ }
+ String obj = temp[0];
+ String type = temp[1];
+
+ if (syncAttrMap.get(obj) == -1) {
+ syncAttrMap.put(obj, Integer.valueOf(type));
+ }
+ }
+
+ private void checkMutexType(String input) {
+ String[] temp = input.split(",");
+ if (temp.length != 2) {
+ return;
+ }
+ String obj = temp[0];
+ String attrObj = temp[1];
+
+ Integer attrType = syncAttrMap.get(attrObj);
+ if (attrType != null) {
+ syncAttrMap.put(obj, attrType);
+ syncAttrMap.remove(attrObj);
+ }
+ }
+
+ public List<List<String>> getLogsFromLogPackage(LogPackage logPack,
+ int logCenterConstants) {
+ Logs logs = logPack.getLogs(logCenterConstants);
+ if (null == logs || logs.getLogs().size() == 0) {
+ return null;
+ }
+ List<List<String>> ret = logs.getLogs();
+ return ret;
+ }
+
+ public void parsePageData(LogPackage logPack) {
+ List<List<String>> inputs = getLogsFromLogPackage(logPack,
+ LogCenterConstants.LOG_SYNC);
+ parseSync(inputs);
+ }
+
+ private String getSyncTypeString(int syncType) {
+ switch (syncType) {
+ case LogCenterConstants.SYNC_TYPE_TIZEN_MUTEX:
+ return ThreadPageLabels.SYNC_TYPE_TIZEN_MUTEX;
+ case LogCenterConstants.SYNC_TYPE_TIZEN_MONITOR:
+ return ThreadPageLabels.SYNC_TYPE_TIZEN_MONITOR;
+ case LogCenterConstants.SYNC_TYPE_TIZEN_SEMAPHORE:
+ return ThreadPageLabels.SYNC_TYPE_TIZEN_SEMAPHORE;
+ case LogCenterConstants.SYNC_TYPE_PTHREAD_MUTEX:
+ return ThreadPageLabels.SYNC_TYPE_PTHREAD_MUTEX;
+ case LogCenterConstants.SYNC_TYPE_PTHREAD_COND_VARIABLE:
+ return ThreadPageLabels.SYNC_TYPE_PTHREAD_COND_VARIABLE;
+ case LogCenterConstants.SYNC_TYPE_PTHREAD_RWLOCK:
+ return ThreadPageLabels.SYNC_TYPE_PTHREAD_RWLOCK;
+ case LogCenterConstants.SYNC_TYPE_PTHREAD_SPINLOCK:
+ return ThreadPageLabels.SYNC_TYPE_PTHREAD_SPINLOCK;
+ case LogCenterConstants.SYNC_TYPE_PTHREAD_BARRIER:
+ return ThreadPageLabels.SYNC_TYPE_PTHREAD_BARRIER;
+ default:
+ return CommonConstants.EMPTY;
+ }
+ }
+
+ private void initSyncChart(DAChart chart, boolean isParent) {
+ if (null == chart) {
+ return;
+ }
+
+ DAChartSeries apiSeries = new DAChartSeries(
+ ThreadPageLabels.THREAD_CHART_SERIES_API,
+ DAChartSeries.SERIES_STYLE_EVENT, ColorResources.YELLOW);
+
+ DAChartSeries stateSeries = new DAChartSeries(
+ ThreadPageLabels.THREAD_SYNC_CHART_SERIES_STATE,
+ DAChartSeries.SERIES_STYLE_STATE, ColorResources.WHITE);
+
+ apiSeries.setSummarizeTooltipText(ThreadPageLabels.THREAD_TOOLTIP_APIS);
+
+ chart.addSeries(stateSeries);
+ chart.addSeries(apiSeries);
+
+ DAChartPlot plot = chart.getPlot();
+ if (null == plot) {
+ return;
+ }
+ if (true == isParent) {
+ plot.setBackgroundImage(ImageResources.BG_GRADIENT);
+ } else {
+ plot.setBackgroundImage(ImageResources.BG_CHILD_GRADIENT);
+ }
+ plot.setAutoHeightRange(false);
+ plot.setAxisFont(FontResources.CHART_AXIS_FONT);
+ plot.setAxisRangeY(0, 101);
+ plot.setAxisRangeX(board.getVisibleStartTime(),
+ board.getVisibleEndTime());
+ DAChartPlotTooltip tooltip = new DAChartPlotTooltip(-1);
+ tooltip.setFont(FontResources.CHART_TOOLTIP_FONT);
+ plot.setTooltip(tooltip);
+
+ DAContextMenu popupMenu = new DAContextMenu(chart);
+
+ final DAContextMenuItem startItem = new DAContextMenuItem(popupMenu);
+ startItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_START);
+ startItem.addClickListener(new DAContextMenuListener() {
+ public void widgetSelected(DAContextMenuItem menuItem) {
+ double startTime = startItem.getRangeTime();
+ board.setRangeStartTime(startTime);
+
+ rangeDataManager.setStartTime((long) (startTime * 1000000));
+ }
+ });
+
+ final DAContextMenuItem endItem = new DAContextMenuItem(popupMenu);
+ endItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_END);
+ endItem.addClickListener(new DAContextMenuListener() {
+ public void widgetSelected(DAContextMenuItem menuItem) {
+ double endTime = endItem.getRangeTime();
+ board.setRangeEndTime(endTime);
+
+ rangeDataManager.setEndTime((long) (endTime * 1000000));
+ }
+ });
+
+ DAContextMenuItem analysisItem = new DAContextMenuItem(popupMenu);
+ analysisItem.setText(TimelineChartLabels.RANGE_CONTEXT_ANALYSIS);
+ analysisItem.addClickListener(new DAContextMenuListener() {
+ @Override
+ public void widgetSelected(DAContextMenuItem menuItem) {
+ rangeDataManager.startRangeAnalysis();
+ }
+ });
+
+ DAContextMenuItem clearItem = new DAContextMenuItem(popupMenu);
+ clearItem.setText(TimelineChartLabels.RANGE_CONTEXT_CLEAR);
+ clearItem.addClickListener(new DAContextMenuListener() {
+ public void widgetSelected(DAContextMenuItem menuItem) {
+ board.setRangeStartTime(-1);
+ board.setRangeEndTime(-1);
+
+ rangeDataManager.initRange();
+ }
+ });
+
+ chart.addMouseListener(new TimelineChartMouseAdapter(popupMenu));
+ chart.addMouseMoveListener(new TimelineChartMouseMoveListener(board
+ .getTimeline()));
+ chart.addMouseTrackListener(new TimelineChartMouseTrackAdapter(board
+ .getTimeline()));
+ plot.setIntervalMarker(board.getIntervalMarker());
+
+ }
+
+ private boolean createSyncBoardItem(ThreadPageSyncData parent,
+ ThreadPageSyncData sync) {
+ DAChartBoardItem item;
+ DAChart chart;
+
+ if (null == parent) {
+ item = new DAChartBoardItem(board, sync.getType()
+ + ThreadPageLabels.THREAD_CHART_NAME_PREFIX
+ + ThreadPageLabels.THREAD_CHART_NAME_OBJ + sync.getKey()
+ + ThreadPageLabels.THREAD_CHART_NAME_POSTFIX);
+ item.useExpand(true);
+ chart = item.getChart();
+ initSyncChart(chart, true);
+ } else {
+ DAChartBoardItem parentItem = parent.getItem();
+ item = new DAChartBoardItem(parentItem,
+ ThreadPageLabels.THREAD_CHART_NAME_TID + sync.getTid());
+ item.useExpand(true);
+ chart = item.getChart();
+ initSyncChart(chart, false);
+ }
+
+ sync.setItem(item);
+ item.setData(sync);
+ chart.setData(sync);
+ chart.redraw();
+ return true;
+ }
+
+ public void checkUpdate() {
+ int size = syncEventQueue.size();
+ if (size > 0) {
+ ThreadPageSyncData parent;
+ ThreadPageSyncData data;
+ ThreadPageSyncDataEvent event;
+ for (int i = 0; i < size; i++) {
+ event = syncEventQueue.get(0);
+ String syncVal = event.getSyncVal();
+ parent = findParentData(syncVal);
+ // parent
+ if (null == parent) {
+ Integer syncAttrTypeInt = syncAttrMap.get(syncVal);
+ String syncAttrType;
+
+ if (null != syncAttrTypeInt) {
+ syncAttrType = getAttrTypeByTypeInt(syncAttrTypeInt);
+ } else {
+ syncAttrType = getAttrTypeString(event);
+ }
+
+ parent = new ThreadPageSyncData(
+ getSyncTypeString(event.getType()),
+ event.getSyncVal(), event.getTid(), syncAttrType);
+ rows.add(parent);
+ createSyncBoardItem(null, parent);
+ }
+ parent.pushEvent(event);
+ // child
+ data = parent.findChildData(event.getTid());
+ if (null == data) {
+ String attrType = parent.getAttrType();
+ data = new ThreadPageSyncData(
+ getSyncTypeString(event.getType()),
+ event.getSyncVal(), event.getTid(), attrType);
+ parent.pushSync(data);
+ createSyncBoardItem(parent, data);
+ }
+ data.pushEvent(event);
+ syncEventQueue.remove(0);
+ }
+ }
+ size = rows.size();
+ if (size > 0) {
+ ThreadPageSyncData data;
+ for (int i = 0; i < size; i++) {
+ data = rows.get(i);
+ data.checkUpdate();
+ }
+ }
+ }
+
+ public void clear() {
+ rows.clear(); // FIXME : clear chart
+ syncEventQueue.clear();
+ syncAttrMap.clear();
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.thread.thread;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.nl.ThreadPageLabels;
+import org.tizen.dynamicanalyzer.ui.summary.warning.WarningCase;
+import org.tizen.dynamicanalyzer.ui.summary.warning.WarningData;
+import org.tizen.dynamicanalyzer.ui.thread.ThreadPageData;
+import org.tizen.dynamicanalyzer.ui.thread.ThreadPageDataEvent;
+import org.tizen.dynamicanalyzer.ui.thread.sync.ThreadPageSyncData;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
+
+public class ThreadPageThreadData extends ThreadPageData {
+ private List<ThreadPageSyncData> syncs = new ArrayList<ThreadPageSyncData>();
+ private String StartTime;
+ private String EndTime;
+ private DAChartSeries loadSeries;
+ private DAChartSeries eventSeries;
+ private DAChartSeries apiSeries;
+
+ public ThreadPageThreadData(String type, String tid, String attrType) {
+ super(type, String.valueOf(tid), tid, attrType);
+ }
+
+ public void addDataEvent(ThreadPageThreadDataEvent dataEvent) {
+ contentsQueue.add(dataEvent);
+ }
+
+ public void setItem(DAChartBoardItem item) {
+ this.item = item;
+ chart = item.getChart();
+ loadSeries = chart.getSeries(ThreadPageLabels.THREAD_CHART_SERIES_LOAD);
+ eventSeries = chart
+ .getSeries(ThreadPageLabels.THREAD_CHART_SERIES_EVENT);
+ apiSeries = chart.getSeries(ThreadPageLabels.THREAD_CHART_SERIES_API);
+ }
+
+ protected int createChartItem(ThreadPageDataEvent event) {
+ int ret = -1;
+ ThreadPageThreadDataEvent threadEvent = (ThreadPageThreadDataEvent) event;
+ if (!(threadEvent instanceof ThreadPageThreadDataEvent)) {
+ System.out.println("error : createChartItem");
+ return ret;
+ }
+ DAChartSeriesItem seriesItem;
+
+ switch (threadEvent.getEventType()) {
+ case ThreadPageThreadDataEvent.TYPE_LOAD:
+ ret = ThreadPageThreadDataEvent.TYPE_LOAD;
+ if (null == loadSeries) {
+ return ret;
+ }
+
+ seriesItem = new DAChartSeriesItem(threadEvent.getTime(),
+ (double) (threadEvent.getThreadType() * 2.55),
+ threadEvent.getTooltipContent());
+
+ loadSeries.addSeriesItem(seriesItem);
+ break;
+ case ThreadPageThreadDataEvent.TYPE_EVENT:
+ ret = ThreadPageThreadDataEvent.TYPE_EVENT;
+ if (null == eventSeries) {
+ return ret;
+ }
+
+ int eventApiType = threadEvent.getApiType();
+ if (eventApiType == LogCenterConstants.THREAD_API_TYPE_INTERNAL_START) {
+ seriesItem = new DAChartSeriesItem(threadEvent.getTime(),
+ DAChartSeriesItem.SERIES_ARROW_LEFT,
+ threadEvent.getTooltipContent());
+ seriesItem.setBarWidth(Double.parseDouble(threadEvent
+ .getCallerTid()));
+ setStartTime(String.valueOf(threadEvent.getTime()));
+ } else if (eventApiType == LogCenterConstants.THREAD_API_TYPE_WAIT_END) {
+ if (threadEvent.getContents()
+ .get(LogCenterConstants.APINAME_INDEX)
+ .equals(ThreadPageLabels.THREAD_API_TIZEN_JOIN)) {
+ seriesItem = new DAChartSeriesItem(
+ threadEvent.getTime(),
+ DAChartSeriesItem.SERIES_ARROW_LEFT,
+ ThreadPageLabels.THREAD_CHART_ITEM_JOINED);
+ seriesItem.setBarWidth(Double.parseDouble(threadEvent
+ .getCallerTid()));
+ // join, delete warning
+ AnalyzerManager.getWarningChecker().removeData(
+ ThreadPageLabels.THREAD_CHART_NAME_TID
+ + threadEvent.getCallerTid(),
+ WarningCase.JOINABLE_LEAK.getType());
+ } else {
+ seriesItem = new DAChartSeriesItem(
+ threadEvent.getTime(),
+ DAChartSeriesItem.SERIES_ARROW_NONE,
+ threadEvent.getTooltipContent());
+ }
+ } else if (eventApiType == LogCenterConstants.THREAD_API_TYPE_INTERNAL_STOP) {
+ if (null != threadEvent.getCallerTid()) {
+ seriesItem = new DAChartSeriesItem(
+ threadEvent.getTime(),
+ DAChartSeriesItem.SERIES_ARROW_RIGHT,
+ threadEvent.getTooltipContent());
+ seriesItem.setBarWidth(Double.parseDouble(threadEvent
+ .getCallerTid()));
+ } else {
+ if (getAttrType().equals(
+ ThreadPageLabels.THREAD_ATTR_TYPE_JOINABLE)) {
+ // warningData
+ WarningData wData = new WarningData(
+ LogCenterConstants.LOG_THREAD,
+ WarningCase.JOINABLE_LEAK.getType(),
+ threadEvent.getContents(),
+ ThreadPageLabels.THREAD_CHART_NAME_TID
+ + threadEvent.getTid());
+ AnalyzerManager.getWarningChecker().getWarningData()
+ .add(wData);
+ }
+ seriesItem = new DAChartSeriesItem(
+ threadEvent.getTime(),
+ DAChartSeriesItem.SERIES_ARROW_NONE,
+ threadEvent.getTooltipContent());
+ }
+ setEndTime(String.valueOf(threadEvent.getTime()));
+ } else {
+ seriesItem = new DAChartSeriesItem(threadEvent.getTime(),
+ DAChartSeriesItem.SERIES_ARROW_NONE,
+ threadEvent.getTooltipContent());
+ }
+
+ eventSeries.addSeriesItem(seriesItem);
+ break;
+ case ThreadPageThreadDataEvent.TYPE_API:
+ ret = ThreadPageThreadDataEvent.TYPE_API;
+ if (null == apiSeries) {
+ return ret;
+ }
+
+ long errorNum = threadEvent.getErrorNum();
+ seriesItem = createApiItem(threadEvent, errorNum);
+
+ apiSeries.addSeriesItem(seriesItem);
+ break;
+ default:
+ return ret;
+ }
+ threadEvent.setChartItem(seriesItem);
+ return ret;
+ }
+
+ protected void checkUpdate() {
+ if (false == hasUpdate) {
+ return;
+ } else {
+ hasUpdate = false;
+ }
+
+ int size = contentsQueue.size();
+ if (size > 0) {
+ ThreadPageThreadDataEvent event;
+ for (int i = 0; i < size; i++) {
+ event = (ThreadPageThreadDataEvent) contentsQueue.get(0);
+ if ((event instanceof ThreadPageThreadDataEvent)) {
+ if (ThreadPageThreadDataEvent.TYPE_API == createChartItem(event)) {
+ contents.add(event);
+ }
+ }
+ contentsQueue.remove(0);
+ }
+ chart.redraw();
+ }
+
+ size = syncs.size();
+ if (size > 0) {
+ ThreadPageSyncData sync;
+ for (int i = 0; i < size; i++) {
+ sync = syncs.get(i);
+ sync.checkUpdate();
+ }
+ }
+ }
+
+ protected void pushSync(ThreadPageSyncData sync) {
+ syncs.add(sync);
+ hasUpdate = true;
+ }
+
+ protected ThreadPageSyncData findSyncData(String syncVal) {
+ int size = syncs.size();
+ ThreadPageSyncData sync;
+ for (int i = 0; i < size; i++) {
+ sync = syncs.get(i);
+ if (sync.getKey().equals(syncVal)) {
+ return sync;
+ }
+ }
+ return null;
+ }
+
+ public String getStartTime() {
+ return StartTime;
+ }
+
+ public void setStartTime(String startTime) {
+ StartTime = startTime;
+ }
+
+ public String getEndTime() {
+ return EndTime;
+ }
+
+ public void setEndTime(String endTime) {
+ EndTime = endTime;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.thread.thread;
+
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.ui.thread.ThreadPageDataEvent;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
+
+public class ThreadPageThreadDataEvent extends ThreadPageDataEvent {
+ public static final int TYPE_API = 0;
+ public static final int TYPE_EVENT = 1;
+ public static final int TYPE_LOAD = 2;
+ private ThreadPageThreadData data;
+ private int eventType = -1;
+ private int threadType = -1;
+ private DAChartSeriesItem chartItem;
+ private String callID = null;
+ private String callerTid = null;
+
+ public ThreadPageThreadDataEvent(int eventType, int threadType,
+ int apiType, double time, String tid, String tooltip, long errorNum,
+ List<String> contents) {
+ super(time, tid, apiType, tooltip, errorNum, contents);
+ setEventType(eventType);
+ setThreadType(threadType);
+ }
+
+ public int getEventType() {
+ return eventType;
+ }
+
+ public void setEventType(int eventType) {
+ this.eventType = eventType;
+ }
+
+ public DAChartSeriesItem getChartItem() {
+ return chartItem;
+ }
+
+ public void setChartItem(DAChartSeriesItem chartItem) {
+ this.chartItem = chartItem;
+ }
+
+ public ThreadPageThreadData getData() {
+ return data;
+ }
+
+ public int getThreadType() {
+ return threadType;
+ }
+
+ public void setThreadType(int threadType) {
+ this.threadType = threadType;
+ }
+
+ public String getCallID() {
+ return callID;
+ }
+
+ public void setCallID(String callID) {
+ this.callID = callID;
+ }
+
+ public String getCallerTid() {
+ return callerTid;
+ }
+
+ public void setCallerTid(String callerTid) {
+ this.callerTid = callerTid;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.thread.thread;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.logparser.Logs;
+import org.tizen.dynamicanalyzer.nl.ThreadPageLabels;
+import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
+import org.tizen.dynamicanalyzer.project.Project;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.summary.warning.WarningCase;
+import org.tizen.dynamicanalyzer.ui.thread.sync.ThreadPageSyncData;
+import org.tizen.dynamicanalyzer.ui.thread.sync.ThreadPageSyncDataEvent;
+import org.tizen.dynamicanalyzer.ui.thread.sync.ThreadPageSyncDataManager;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.ui.timeline.eventlistener.TimelineChartMouseAdapter;
+import org.tizen.dynamicanalyzer.ui.timeline.eventlistener.TimelineChartMouseMoveListener;
+import org.tizen.dynamicanalyzer.ui.timeline.eventlistener.TimelineChartMouseTrackAdapter;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotTooltip;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenu;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuItem;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuListener;
+
+public class ThreadPageThreadDataManager {
+ private DAChartBoard board;
+ // ThreadChartView view;
+ private boolean isStart = false;
+ private boolean hasUpdate = false;
+ private List<ThreadPageThreadData> rows = new ArrayList<ThreadPageThreadData>();
+ private List<ThreadPageThreadData> rowsQueue = new ArrayList<ThreadPageThreadData>();
+ private List<ThreadPageSyncDataEvent> syncEventQueue = new ArrayList<ThreadPageSyncDataEvent>();
+ private List<ThreadPageThreadDataEvent> eventQueue = new ArrayList<ThreadPageThreadDataEvent>();
+ private List<ThreadPageThreadDataEvent> callEventQueue = new ArrayList<ThreadPageThreadDataEvent>();
+ private HashMap<String, Integer> syncAttrMap = new HashMap<String, Integer>();
+
+ private RangeDataManager rangeDataManager = RangeDataManager.getInstance();
+
+ public ThreadPageThreadDataManager(DAChartBoard board) {
+ this.setBoard(board);
+ }
+
+ private void pushRow(ThreadPageThreadData data) {
+ rowsQueue.add(data);
+ hasUpdate = true;
+ }
+
+ private void pushEvent(ThreadPageThreadDataEvent event) {
+ eventQueue.add(event);
+ hasUpdate = true;
+ }
+
+ private void pushCallEvent(ThreadPageThreadDataEvent event) {
+ callEventQueue.add(event);
+ }
+
+ private void pushSyncEvent(ThreadPageSyncDataEvent syncEvent) {
+ syncEventQueue.add(syncEvent);
+ hasUpdate = true;
+ }
+
+ private void createBoardItem(ThreadPageThreadData data) {
+ // DACustomChartBoardItem item = new DACustomChartBoardItem(board,
+ // data.getName());
+
+ DAChartBoardItem item = new DAChartBoardItem(board, data.getType()
+ + ThreadPageLabels.THREAD_CHART_NAME_PREFIX
+ + ThreadPageLabels.THREAD_CHART_NAME_TID + data.getKey()
+ + ThreadPageLabels.THREAD_CHART_NAME_POSTFIX);
+ item.useExpand(true);
+ DAChart chart = item.getChart();
+ setChartSeries(chart);
+ setChartStyle(chart);
+ data.setItem(item);
+ item.setData(data);
+ chart.setData(data);
+ chart.redraw();
+ }
+
+ private void initSyncChart(DAChart chart) {
+ if (null == chart) {
+ return;
+ }
+
+ DAChartSeries apiSeries = new DAChartSeries(
+ ThreadPageLabels.THREAD_CHART_SERIES_API,
+ DAChartSeries.SERIES_STYLE_STATE, ColorResources.YELLOW);
+ DAChartSeries stateSeries = new DAChartSeries(
+ ThreadPageLabels.THREAD_SYNC_CHART_SERIES_STATE,
+ DAChartSeries.SERIES_STYLE_STATE, ColorResources.WHITE);
+
+ chart.addSeries(stateSeries);
+ chart.addSeries(apiSeries);
+
+ DAChartPlot plot = chart.getPlot();
+ if (null == plot) {
+ return;
+ }
+ plot.setBackgroundImage(ImageResources.BG_CHILD_GRADIENT);
+ plot.setAutoHeightRange(false);
+ plot.setAxisFont(FontResources.CHART_AXIS_FONT);
+ plot.setAxisRangeY(0, 101);
+ plot.setAxisRangeX(board.getVisibleStartTime(),
+ board.getVisibleEndTime());
+ DAChartPlotTooltip tooltip = new DAChartPlotTooltip(-1);
+ tooltip.setFont(FontResources.CHART_TOOLTIP_FONT);
+ plot.setTooltip(tooltip);
+
+ DAContextMenu popupMenu = new DAContextMenu(chart);
+ final DAContextMenuItem startItem = new DAContextMenuItem(popupMenu);
+ startItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_START);
+ startItem.addClickListener(new DAContextMenuListener() {
+ @Override
+ public void widgetSelected(DAContextMenuItem menuItem) {
+ double startTime = startItem.getRangeTime();
+ board.setRangeStartTime(startTime);
+
+ rangeDataManager.setStartTime((long) (startTime * 1000000));
+ }
+ });
+
+ final DAContextMenuItem endItem = new DAContextMenuItem(popupMenu);
+ endItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_END);
+ endItem.addClickListener(new DAContextMenuListener() {
+ @Override
+ public void widgetSelected(DAContextMenuItem menuItem) {
+ double endTime = endItem.getRangeTime();
+ board.setRangeEndTime(endTime);
+
+ rangeDataManager.setEndTime((long) (endTime * 1000000));
+ }
+ });
+
+ DAContextMenuItem analysisItem = new DAContextMenuItem(popupMenu);
+ analysisItem.setText(TimelineChartLabels.RANGE_CONTEXT_ANALYSIS);
+ analysisItem.addClickListener(new DAContextMenuListener() {
+ @Override
+ public void widgetSelected(DAContextMenuItem menuItem) {
+ rangeDataManager.startRangeAnalysis();
+ }
+ });
+
+ DAContextMenuItem clearItem = new DAContextMenuItem(popupMenu);
+ clearItem.setText(TimelineChartLabels.RANGE_CONTEXT_CLEAR);
+ clearItem.addClickListener(new DAContextMenuListener() {
+ @Override
+ public void widgetSelected(DAContextMenuItem menuItem) {
+ board.setRangeStartTime(-1);
+ board.setRangeEndTime(-1);
+
+ rangeDataManager.initRange();
+ }
+ });
+
+ chart.addMouseListener(new TimelineChartMouseAdapter(popupMenu));
+ chart.addMouseMoveListener(new TimelineChartMouseMoveListener(board
+ .getTimeline()));
+ chart.addMouseTrackListener(new TimelineChartMouseTrackAdapter(board
+ .getTimeline()));
+ plot.setIntervalMarker(board.getIntervalMarker());
+
+ }
+
+ private boolean createSyncBoardItem(ThreadPageThreadData data,
+ ThreadPageSyncData sync) {
+ DAChartBoardItem parent = data.getItem();
+ if (null == parent) {
+ return false;
+ }
+
+ DAChartBoardItem item = new DAChartBoardItem(parent, sync.getType()
+ + ThreadPageLabels.THREAD_CHART_NAME_PREFIX
+ + ThreadPageLabels.THREAD_CHART_NAME_OBJ + sync.getKey()
+ + ThreadPageLabels.THREAD_CHART_NAME_POSTFIX);
+ item.useExpand(true);
+ DAChart chart = item.getChart();
+ initSyncChart(chart);
+
+ sync.setItem(item);
+ item.setData(sync);
+ chart.setData(sync);
+ chart.redraw();
+ return true;
+ }
+
+ protected void setChartStyle(DAChart chart) {
+ if (null == chart) {
+ return;
+ }
+
+ DAChartPlot plot = chart.getPlot();
+ if (null == plot) {
+ return;
+ }
+ plot.setBackgroundImage(ImageResources.BG_GRADIENT);
+ plot.setAutoHeightRange(false);
+ DAChartPlotTooltip tooltip = new DAChartPlotTooltip(-1);
+ tooltip.setFont(FontResources.CHART_TOOLTIP_FONT);
+ plot.setTooltip(tooltip);
+ plot.setAxisFont(FontResources.CHART_AXIS_FONT);
+ plot.setAxisRangeY(0, 101);
+ plot.setAxisRangeX(board.getVisibleStartTime(),
+ board.getVisibleEndTime());
+
+ DAContextMenu popupMenu = new DAContextMenu(chart);
+ final DAContextMenuItem startItem = new DAContextMenuItem(popupMenu);
+ startItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_START);
+ startItem.addClickListener(new DAContextMenuListener() {
+ @Override
+ public void widgetSelected(DAContextMenuItem menuItem) {
+ double startTime = startItem.getRangeTime();
+
+ board.setRangeStartTime(startTime);
+ rangeDataManager.setStartTime((long) (startTime * 1000000));
+ }
+ });
+
+ final DAContextMenuItem endItem = new DAContextMenuItem(popupMenu);
+ endItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_END);
+ endItem.addClickListener(new DAContextMenuListener() {
+ @Override
+ public void widgetSelected(DAContextMenuItem menuItem) {
+ double endTime = endItem.getRangeTime();
+
+ board.setRangeEndTime(endTime);
+ rangeDataManager.setEndTime((long) (endTime * 1000000));
+ }
+ });
+
+ DAContextMenuItem analysisItem = new DAContextMenuItem(popupMenu);
+ analysisItem.setText(TimelineChartLabels.RANGE_CONTEXT_ANALYSIS);
+ analysisItem.addClickListener(new DAContextMenuListener() {
+ @Override
+ public void widgetSelected(DAContextMenuItem menuItem) {
+ rangeDataManager.startRangeAnalysis();
+ }
+ });
+
+ DAContextMenuItem clearItem = new DAContextMenuItem(popupMenu);
+ clearItem.setText(TimelineChartLabels.RANGE_CONTEXT_CLEAR);
+ clearItem.addClickListener(new DAContextMenuListener() {
+ @Override
+ public void widgetSelected(DAContextMenuItem menuItem) {
+ board.setRangeStartTime(-1);
+ board.setRangeEndTime(-1);
+
+ rangeDataManager.initRange();
+ }
+ });
+
+ chart.addMouseListener(new TimelineChartMouseAdapter(popupMenu));
+ chart.addMouseMoveListener(new TimelineChartMouseMoveListener(board
+ .getTimeline()));
+ chart.addMouseTrackListener(new TimelineChartMouseTrackAdapter(board
+ .getTimeline()));
+ plot.setIntervalMarker(board.getIntervalMarker());
+
+ }
+
+ private void setChartSeries(DAChart chart) {
+ DAChartSeries loadSeries = new DAChartSeries(
+ ThreadPageLabels.THREAD_CHART_SERIES_LOAD,
+ DAChartSeries.SERIES_STYLE_LOAD,
+ ColorResources.THREAD_GRAPH_CPU_LOAD_COLOR);
+ loadSeries.setBarWidth(1);
+
+ DAChartSeries apiSeries = new DAChartSeries(
+ ThreadPageLabels.THREAD_CHART_SERIES_API,
+ DAChartSeries.SERIES_STYLE_EVENT, ColorResources.YELLOW);
+
+ DAChartSeries eventSeries = new DAChartSeries(
+ ThreadPageLabels.THREAD_CHART_SERIES_EVENT,
+ DAChartSeries.SERIES_STYLE_ARROW,
+ ColorResources.THREAD_GRAPH_CALLEE_COLOR);
+
+ apiSeries.setSummarizeTooltipText(ThreadPageLabels.THREAD_TOOLTIP_APIS);
+ eventSeries.setFont(FontResources.CHART_ARROW_TID_FONT);
+
+ chart.addSeries(loadSeries);
+ chart.addSeries(apiSeries);
+ chart.addSeries(eventSeries);
+
+ chart.redraw();
+ }
+
+ private void createMainThreadItem() {
+ isStart = true;
+ Project project = AnalyzerManager.getProject();
+ int tid = project.getPID();
+
+ if (0 == tid) {
+ isStart = false;
+ return;
+ }
+
+ ThreadPageThreadData mainData = new ThreadPageThreadData(
+ ThreadPageLabels.THREAD_ITEM_TYPE_MAIN, String.valueOf(tid),
+ CommonConstants.EMPTY);
+ pushRow(mainData);
+ }
+
+ public List<List<String>> getLogsFromLogPackage(LogPackage logPack,
+ int logCenterConstants) {
+ if (false == isStart) {
+ createMainThreadItem();
+ }
+
+ Logs logs = logPack.getLogs(logCenterConstants);
+ if (null == logs || logs.getLogs().size() == 0) {
+ return null;
+ }
+ List<List<String>> ret = logs.getLogs();
+ return ret;
+ }
+
+ private void parseLoad(LogPackage logPack) {
+ List<List<String>> inputs = getLogsFromLogPackage(logPack,
+ LogCenterConstants.LOG_DEVICE);
+ int size;
+ if (null == inputs || 0 == (size = inputs.size())) {
+ return;
+ }
+ List<String> input;
+
+ String loads;
+ String tid;
+ int load;
+ for (int i = 0; i < size; i++) {
+ input = inputs.get(i);
+ loads = input.get(LogCenterConstants.DEVICE_THREAD_LOAD_INDEX);
+ String[] temp = loads.split(",");
+ int tempSize = temp.length;
+ double time;
+ for (int j = 0; j + 1 < tempSize; j += 2) {
+ try {
+ tid = temp[j];
+ } catch (NumberFormatException nfe) {
+ System.out.println("error : parseLoad - tid parsing");
+ break;
+ }
+ // if (null == findParentData(tid)) {
+ // continue;
+ // }
+
+ load = (int) (Double.parseDouble(temp[j + 1]));
+ time = Double.parseDouble(input
+ .get(LogCenterConstants.DEVICE_TIME_INDEX))
+ / TimelineConstants.MEGA;
+ ThreadPageThreadDataEvent event = new ThreadPageThreadDataEvent(
+ ThreadPageThreadDataEvent.TYPE_LOAD, load, -1, time,
+ tid, String.valueOf(load)
+ + ThreadPageLabels.THREAD_CHART_ITEM_PERCENT,
+ -1, null);
+ pushEvent(event);
+ }
+ }
+ }
+
+ private void parsePthread(List<String> input) {
+ double time = Double.parseDouble(input
+ .get(LogCenterConstants.TIME_INDEX)) / TimelineConstants.MEGA;
+ String tid = input.get(LogCenterConstants.THREAD_ID_INDEX);
+ int apiType = Integer.parseInt(input
+ .get(LogCenterConstants.THREAD_API_TYPE_INDEX));
+ String apiName = input.get(LogCenterConstants.APINAME_INDEX);
+ long errorNum = Long.parseLong(input
+ .get(LogCenterConstants.ERROR_INDEX));
+ ThreadPageThreadDataEvent event;
+ switch (apiType) {
+ case LogCenterConstants.THREAD_API_TYPE_NEW:
+ case LogCenterConstants.THREAD_API_TYPE_STOP:
+ case LogCenterConstants.THREAD_API_TYPE_EXIT:
+ case LogCenterConstants.THREAD_API_TYPE_WAIT_START:
+ case LogCenterConstants.THREAD_API_TYPE_OTHER:
+ event = new ThreadPageThreadDataEvent(
+ ThreadPageThreadDataEvent.TYPE_API,
+ LogCenterConstants.THREAD_TYPE_PTHREAD, apiType, time, tid,
+ apiName, errorNum, input);
+ pushEvent(event);
+ break;
+ case LogCenterConstants.THREAD_API_TYPE_START:
+ event = new ThreadPageThreadDataEvent(
+ ThreadPageThreadDataEvent.TYPE_API,
+ LogCenterConstants.THREAD_TYPE_PTHREAD, apiType, time, tid,
+ apiName, errorNum, input);
+ event.setCallID(input
+ .get(LogCenterConstants.THREAD_PTHREAD_ID_INDEX));
+ pushEvent(event);
+ pushCallEvent(event);
+ break;
+ case LogCenterConstants.THREAD_API_TYPE_WAIT_END:
+ event = new ThreadPageThreadDataEvent(
+ ThreadPageThreadDataEvent.TYPE_EVENT,
+ LogCenterConstants.THREAD_TYPE_PTHREAD, apiType, time, tid,
+ apiName, errorNum, input);
+ pushEvent(event);
+ break;
+ case LogCenterConstants.THREAD_API_TYPE_INTERNAL_STOP:
+ event = new ThreadPageThreadDataEvent(
+ ThreadPageThreadDataEvent.TYPE_EVENT,
+ LogCenterConstants.THREAD_TYPE_PTHREAD, apiType, time, tid,
+ ThreadPageLabels.THREAD_CHART_ITEM_EXITED, errorNum, input);
+ event.setCallID(input
+ .get(LogCenterConstants.THREAD_PTHREAD_ID_INDEX));
+ pushEvent(event);
+ pushCallEvent(event);
+ break;
+ case LogCenterConstants.THREAD_API_TYPE_INTERNAL_START:
+ ThreadPageThreadData data = new ThreadPageThreadData(
+ ThreadPageLabels.THREAD_ITEM_TYPE_PTHREAD, tid,
+ ThreadPageLabels.THREAD_ATTR_TYPE_JOINABLE);
+ pushRow(data);
+ event = new ThreadPageThreadDataEvent(
+ ThreadPageThreadDataEvent.TYPE_EVENT,
+ LogCenterConstants.THREAD_TYPE_PTHREAD, apiType, time, tid,
+ ThreadPageLabels.THREAD_CHART_ITEM_CREATED, errorNum, input);
+ pushEvent(event);
+ break;
+ default:
+ System.out.println("thread page err: unknown thread api type");
+ }
+ }
+
+ private void parseTIZEN(List<String> input) {
+ double time = Double.parseDouble(input
+ .get(LogCenterConstants.TIME_INDEX)) / TimelineConstants.MEGA;
+ String tid = input.get(LogCenterConstants.THREAD_ID_INDEX);
+ int apiType = Integer.parseInt(input
+ .get(LogCenterConstants.THREAD_API_TYPE_INDEX));
+ String apiName = input.get(LogCenterConstants.APINAME_INDEX);
+ ThreadPageThreadDataEvent event;
+ long errorNum = Long.parseLong(input
+ .get(LogCenterConstants.ERROR_INDEX));
+ // System.out.println("input : " + input);
+ switch (apiType) {
+ case LogCenterConstants.THREAD_API_TYPE_NEW:
+ case LogCenterConstants.THREAD_API_TYPE_STOP:
+ case LogCenterConstants.THREAD_API_TYPE_EXIT:
+ case LogCenterConstants.THREAD_API_TYPE_WAIT_START:
+ case LogCenterConstants.THREAD_API_TYPE_OTHER:
+ event = new ThreadPageThreadDataEvent(
+ ThreadPageThreadDataEvent.TYPE_API,
+ LogCenterConstants.THREAD_TYPE_TIZEN, apiType, time, tid,
+ apiName, errorNum, input);
+ pushEvent(event);
+ break;
+ case LogCenterConstants.THREAD_API_TYPE_START:
+ event = new ThreadPageThreadDataEvent(
+ ThreadPageThreadDataEvent.TYPE_API,
+ LogCenterConstants.THREAD_TYPE_TIZEN, apiType, time, tid,
+ apiName, errorNum, input);
+ event.setCallID(input
+ .get(LogCenterConstants.THREAD_TIZENTHREAD_ID_INDEX));
+ pushEvent(event);
+ pushCallEvent(event);
+ break;
+ case LogCenterConstants.THREAD_API_TYPE_WAIT_END:
+ if (input.get(LogCenterConstants.APINAME_INDEX).equals(
+ ThreadPageLabels.THREAD_API_TIZEN_JOIN)) {
+ event = new ThreadPageThreadDataEvent(
+ ThreadPageThreadDataEvent.TYPE_EVENT,
+ LogCenterConstants.THREAD_TYPE_TIZEN, apiType, time,
+ tid, apiName, errorNum, input);
+ pushEvent(event);
+ } // FIXME : do not shows sleep's wait end
+
+ break;
+ case LogCenterConstants.THREAD_API_TYPE_INTERNAL_STOP:
+ event = new ThreadPageThreadDataEvent(
+ ThreadPageThreadDataEvent.TYPE_EVENT,
+ LogCenterConstants.THREAD_TYPE_TIZEN, apiType, time, tid,
+ ThreadPageLabels.THREAD_CHART_ITEM_EXITED, errorNum, input);
+ event.setCallID(input
+ .get(LogCenterConstants.THREAD_TIZENTHREAD_ID_INDEX));
+ pushEvent(event);
+ pushCallEvent(event);
+ break;
+ case LogCenterConstants.THREAD_API_TYPE_INTERNAL_START:
+ ThreadPageThreadData data = new ThreadPageThreadData(
+ ThreadPageLabels.THREAD_ITEM_TYPE_TIZEN, tid,
+ ThreadPageLabels.THREAD_ATTR_TYPE_JOINABLE);
+ pushRow(data);
+ event = new ThreadPageThreadDataEvent(
+ ThreadPageThreadDataEvent.TYPE_EVENT,
+ LogCenterConstants.THREAD_TYPE_TIZEN, apiType, time, tid,
+ ThreadPageLabels.THREAD_CHART_ITEM_CREATED, errorNum, input);
+ pushEvent(event);
+ break;
+ default:
+ System.out.println("thread page err: unknown thread api type");
+ }
+ }
+
+ private void parseAPI(LogPackage logPack) {
+ List<List<String>> inputs = getLogsFromLogPackage(logPack,
+ LogCenterConstants.LOG_THREAD);
+ int size;
+ if (null == inputs || 0 == (size = inputs.size())) {
+ return;
+ }
+ List<String> input;
+ for (int i = 0; i < size; i++) {
+ input = inputs.get(i);
+ // System.out.println("input : " + input);
+ int threadType = Integer.parseInt(input
+ .get(LogCenterConstants.THREAD_TYPE_INDEX));
+
+ switch (threadType) {
+ case LogCenterConstants.THREAD_TYPE_PTHREAD:
+ parsePthread(input);
+ break;
+ case LogCenterConstants.THREAD_TYPE_TIZEN:
+ parseTIZEN(input);
+ break;
+ default:
+ System.out.println("thread page err: unknown thread type");
+ }
+ }
+ }
+
+ private void parseSync(LogPackage logPack) {
+ List<List<String>> inputs = getLogsFromLogPackage(logPack,
+ LogCenterConstants.LOG_SYNC);
+ int size;
+ if (null == inputs || 0 == (size = inputs.size())) {
+ return;
+ }
+ List<String> input;
+ for (int i = 0; i < size; i++) {
+ input = inputs.get(i);
+ double time = Double.parseDouble(input
+ .get(LogCenterConstants.TIME_INDEX))
+ / TimelineConstants.MEGA;
+ String tid = input.get(LogCenterConstants.THREAD_ID_INDEX);
+
+ // FIXME
+ int type = Integer.parseInt(input
+ .get(LogCenterConstants.SYNC_TYPE_INDEX));
+ int apiType = Integer.parseInt(input
+ .get(LogCenterConstants.SYNC_API_TYPE_INDEX));
+ String apiName = input.get(LogCenterConstants.APINAME_INDEX);
+
+ String name = input.get(LogCenterConstants.SYNC_VAL_INDEX);
+ long errorNum = Long.parseLong(input
+ .get(LogCenterConstants.ERROR_INDEX));
+ ThreadPageSyncDataEvent event;
+ switch (type) {
+ case LogCenterConstants.SYNC_TYPE_TIZEN_MUTEX:
+ case LogCenterConstants.SYNC_TYPE_TIZEN_MONITOR:
+ case LogCenterConstants.SYNC_TYPE_TIZEN_SEMAPHORE:
+ event = new ThreadPageSyncDataEvent(name, type, apiType, time,
+ tid, apiName, errorNum, input);
+ pushSyncEvent(event);
+ // parseTIZENSync(input, type);
+ break;
+ case LogCenterConstants.SYNC_TYPE_PTHREAD_MUTEX:
+ case LogCenterConstants.SYNC_TYPE_PTHREAD_COND_VARIABLE:
+ if (apiName
+ .equals(ThreadPageLabels.SYNC_API_PTHREAD_MUTEXATTR_INIT)) {
+ syncAttrMap.put(
+ input.get(LogCenterConstants.INPUTPARM_INDEX), -1);
+ } else if (apiName
+ .equals(ThreadPageLabels.SYNC_API_PTHREAD_MUTEXATTR_SETTYPE)) {
+ checkMutexAttrType(input
+ .get(LogCenterConstants.INPUTPARM_INDEX));
+ } else {
+ if (apiName
+ .equals(ThreadPageLabels.SYNC_API_PTHREAD_MUTEX_INIT)) {
+ checkMutexType(input
+ .get(LogCenterConstants.INPUTPARM_INDEX));
+ }
+ event = new ThreadPageSyncDataEvent(name, type, apiType,
+ time, tid, apiName, errorNum, input);
+ pushSyncEvent(event);
+ }
+ break;
+ case LogCenterConstants.SYNC_TYPE_PTHREAD_RWLOCK:
+ case LogCenterConstants.SYNC_TYPE_PTHREAD_SPINLOCK:
+ case LogCenterConstants.SYNC_TYPE_PTHREAD_BARRIER:
+ event = new ThreadPageSyncDataEvent(name, type, apiType, time,
+ tid, apiName, errorNum, input);
+ pushSyncEvent(event);
+ System.out.println("error : sync parse - type = " + type);
+ break;
+ default:
+ System.out.println("error : sync parse unknown - type = "
+ + type);
+ }
+ }
+ }
+
+ public void parsePageData(LogPackage logPack) {
+ parseLoad(logPack);
+ parseAPI(logPack);
+ parseSync(logPack);
+ hasUpdate = true;
+ }
+
+ private void checkMutexAttrType(String input) {
+ String[] temp = input.split(",");
+ if (temp.length != 2) {
+ return;
+ }
+ String obj = temp[0];
+ String type = temp[1];
+
+ if (syncAttrMap.get(obj) == -1) {
+ syncAttrMap.put(obj, Integer.valueOf(type));
+ }
+ }
+
+ private void checkMutexType(String input) {
+ String[] temp = input.split(",");
+ if (temp.length != 2) {
+ return;
+ }
+ String obj = temp[0];
+ String attrObj = temp[1];
+
+ Integer attrType = syncAttrMap.get(attrObj);
+ if (attrType != null) {
+ syncAttrMap.put(obj, attrType);
+ syncAttrMap.remove(attrObj);
+ }
+ }
+
+ protected DAChartBoard getBoard() {
+ return board;
+ }
+
+ private void setBoard(DAChartBoard board) {
+ this.board = board;
+ }
+
+ private boolean checkPairEvent(ThreadPageThreadDataEvent event) {
+ if (event.getEventType() != ThreadPageThreadDataEvent.TYPE_EVENT) {
+ return true;
+ }
+ int apiType = event.getApiType();
+ int threadType = event.getThreadType();
+ if (LogCenterConstants.THREAD_API_TYPE_INTERNAL_START == apiType) {
+ int callEventQueueSize = callEventQueue.size();
+ ThreadPageThreadDataEvent callEvent;
+ for (int i = 0; i < callEventQueueSize; i++) {
+ callEvent = callEventQueue.get(i);
+ if (callEvent.getApiType() != LogCenterConstants.THREAD_API_TYPE_START) {
+ continue;
+ } else if (callEvent.getThreadType() != threadType) {
+ continue;
+ } else {
+ if (threadType == LogCenterConstants.THREAD_TYPE_TIZEN) {
+ String callerTizenID = callEvent.getCallID();
+ String eventTizenID = event.getContents().get(
+ LogCenterConstants.THREAD_TIZENTHREAD_ID_INDEX);
+ if (eventTizenID.equals(callerTizenID)) {
+ event.setCallerTid(callEvent.getTid());
+ callEventQueue.remove(i);
+ return true;
+ }
+ } else {
+ String callerPthreadID = callEvent.getCallID();
+ String eventPthreadID = event.getContents().get(
+ LogCenterConstants.THREAD_PTHREAD_ID_INDEX);
+ if (eventPthreadID.equals(callerPthreadID)) {
+ event.setCallerTid(callEvent.getTid());
+ callEventQueue.remove(i);
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ } else if (LogCenterConstants.THREAD_API_TYPE_WAIT_END == apiType) {
+ if (!event.getContents().get(LogCenterConstants.APINAME_INDEX)
+ .equals(ThreadPageLabels.THREAD_API_TIZEN_JOIN)) {
+ return true;
+ }
+
+ int callEventQueueSize = callEventQueue.size();
+ ThreadPageThreadDataEvent callEvent;
+ for (int i = 0; i < callEventQueueSize; i++) {
+ callEvent = callEventQueue.get(i);
+ if (callEvent.getApiType() != LogCenterConstants.THREAD_API_TYPE_INTERNAL_STOP) {
+ continue;
+ } else if (callEvent.getThreadType() != threadType) {
+ continue;
+ } else {
+ if (threadType == LogCenterConstants.THREAD_TYPE_TIZEN) {
+ String callerTizenID = callEvent.getCallID();
+ String eventTizenID = event.getContents().get(
+ LogCenterConstants.THREAD_TIZENTHREAD_ID_INDEX);
+ if (eventTizenID.equals(callerTizenID)) {
+ event.setCallerTid(callEvent.getTid());
+ if (null == callEvent.getChartItem()) {
+ callEvent.setCallerTid(event.getTid());
+ } else {
+ // join, delete warning
+ AnalyzerManager.getWarningChecker().removeData(
+ ThreadPageLabels.THREAD_CHART_NAME_TID
+ + callEvent.getTid(),
+ WarningCase.JOINABLE_LEAK.getType());
+ callEvent.getChartItem().setY(
+ DAChartSeriesItem.SERIES_ARROW_RIGHT);
+ callEvent.getChartItem().setBarWidth(
+ Double.parseDouble(event.getTid()));
+ }
+ callEventQueue.remove(i);
+ return true;
+ }
+ } else {
+ String callerPthreadID = callEvent.getCallID();
+ String eventPthreadID = event.getContents().get(
+ LogCenterConstants.THREAD_PTHREAD_ID_INDEX);
+ if (eventPthreadID.equals(callerPthreadID)) {
+ event.setCallerTid(callEvent.getTid());
+ if (null == callEvent.getChartItem()) {
+ callEvent.setCallerTid(event.getTid());
+ } else {
+ callEvent.getChartItem().setY(
+ DAChartSeriesItem.SERIES_ARROW_RIGHT);
+ callEvent.getChartItem().setBarWidth(
+ Double.parseDouble(event.getTid()));
+ }
+ callEventQueue.remove(i);
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+ private ThreadPageThreadData findParentData(String tid) {
+ int size = rows.size();
+ ThreadPageThreadData ret;
+ for (int i = 0; i < size; i++) {
+ ret = rows.get(i);
+ if (ret.getTid().equals(tid)) {
+ return ret;
+ }
+ }
+ return null;
+ }
+
+ private String getSyncTypeString(int syncType) {
+ switch (syncType) {
+ case LogCenterConstants.SYNC_TYPE_TIZEN_MUTEX:
+ return ThreadPageLabels.SYNC_TYPE_TIZEN_MUTEX;
+ case LogCenterConstants.SYNC_TYPE_TIZEN_MONITOR:
+ return ThreadPageLabels.SYNC_TYPE_TIZEN_MONITOR;
+ case LogCenterConstants.SYNC_TYPE_TIZEN_SEMAPHORE:
+ return ThreadPageLabels.SYNC_TYPE_TIZEN_SEMAPHORE;
+ case LogCenterConstants.SYNC_TYPE_PTHREAD_MUTEX:
+ return ThreadPageLabels.SYNC_TYPE_PTHREAD_MUTEX;
+ case LogCenterConstants.SYNC_TYPE_PTHREAD_COND_VARIABLE:
+ return ThreadPageLabels.SYNC_TYPE_PTHREAD_COND_VARIABLE;
+ case LogCenterConstants.SYNC_TYPE_PTHREAD_RWLOCK:
+ return ThreadPageLabels.SYNC_TYPE_PTHREAD_RWLOCK;
+ case LogCenterConstants.SYNC_TYPE_PTHREAD_SPINLOCK:
+ return ThreadPageLabels.SYNC_TYPE_PTHREAD_SPINLOCK;
+ case LogCenterConstants.SYNC_TYPE_PTHREAD_BARRIER:
+ return ThreadPageLabels.SYNC_TYPE_PTHREAD_BARRIER;
+ default:
+ return CommonConstants.EMPTY;
+ }
+ }
+
+ public void checkUpdate() {
+ if (false == hasUpdate) {
+ return;
+ } else {
+ hasUpdate = false;
+ }
+ int size = rowsQueue.size();
+ if (size > 0) {
+ ThreadPageThreadData data;
+ for (int i = 0; i < size; i++) {
+ data = rowsQueue.get(0);
+ createBoardItem(data);
+ rows.add(data);
+ rowsQueue.remove(0);
+ }
+ }
+ size = eventQueue.size();
+ if (size > 0) {
+ ThreadPageThreadData data;
+ ThreadPageThreadDataEvent event;
+ int remainCalleeEventCount = 0;
+ for (int i = 0; i < size; i++) {
+ event = eventQueue.get(remainCalleeEventCount);
+ if (false == checkPairEvent(event)) {
+ remainCalleeEventCount++;
+ } else {
+ data = findParentData(event.getTid());
+ if (null != data) {
+ data.pushEvent(event);
+ }
+ eventQueue.remove(remainCalleeEventCount);
+ }
+ }
+ }
+
+ size = syncEventQueue.size();
+ if (size > 0) {
+ ThreadPageThreadData data;
+ ThreadPageSyncDataEvent event;
+ ThreadPageSyncData sync;
+ for (int i = 0; i < size; i++) {
+ event = syncEventQueue.get(0);
+ data = findParentData(event.getTid());
+ if (null != data) {
+ String syncVal = event.getSyncVal();
+ sync = data.findSyncData(syncVal);
+ if (null == sync) {
+ Integer syncAttrTypeInt = syncAttrMap.get(syncVal);
+ String syncAttrType;
+ if (null != syncAttrTypeInt) {
+ syncAttrType = ThreadPageSyncDataManager
+ .getAttrTypeByTypeInt(syncAttrTypeInt);
+ } else {
+ syncAttrType = ThreadPageSyncDataManager
+ .getAttrTypeString(event);
+ }
+
+ sync = new ThreadPageSyncData(
+ getSyncTypeString(event.getType()),
+ event.getSyncVal(), event.getTid(),
+ syncAttrType);
+ createSyncBoardItem(data, sync);
+ data.pushSync(sync);
+ }
+ sync.pushEvent(event);
+ data.setHasUpdate();
+ }
+ syncEventQueue.remove(0);
+ }
+ }
+
+ size = rows.size();
+ if (size > 0) {
+ ThreadPageThreadData data;
+ for (int i = 0; i < size; i++) {
+ data = rows.get(i);
+ data.checkUpdate();
+ }
+ }
+ }
+
+ public int getItemIndexByTid(String tid) {
+ int itemSize = rows.size();
+ for (int i = 0; i < itemSize; i++) {
+ if (rows.get(i).getTid().equals(tid)) {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ public void clear() {
+ isStart = false;
+ rows.clear(); // FIXME : clear chart
+ rowsQueue.clear();
+ eventQueue.clear();
+ callEventQueue.clear();
+ syncAttrMap.clear();
+ hasUpdate = false;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.timeline;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallstackView;
+import org.tizen.dynamicanalyzer.ui.info.snapshot.SnapshotView;
+import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
+import org.tizen.dynamicanalyzer.ui.timeline.calltrace.CallTraceView;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineView;
+import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
+
+public class TimelinePage extends DAPageComposite {
+ public static final String ID = TimelinePage.class.getName();
+
+ SashForm leftForm;
+ SashForm rightForm;
+
+ public TimelinePage(Composite parent, int style) {
+ super(parent, style);
+ name = AnalyzerLabels.COOLBAR_AREA_TIMELINE;
+ this.setLayout(new FillLayout());
+
+ leftForm = new SashForm(this, SWT.HORIZONTAL);
+ // index 0 : TIMELINE_INDEX
+ TimelineView timelineComp = new TimelineView(leftForm, SWT.NONE);
+ addView(timelineComp);
+
+ rightForm = new SashForm(leftForm, SWT.VERTICAL);
+
+ // index 1 : INFO_INDEX
+ DATabComposite tabView = new DATabComposite(rightForm, SWT.NONE);
+ addView(tabView);
+ {
+ SnapshotView snapshotView = new SnapshotView(
+ tabView.getContentComposite(), SWT.NONE, false);
+ snapshotView.setObservingViews(new String[] { TimelineView.ID });
+ tabView.addView(snapshotView, false);
+
+ CallstackView callstack = new CallstackView(
+ tabView.getContentComposite(), SWT.NONE);
+ callstack.setObservingViews(new String[] { CallTraceView.ID });
+ tabView.addView(callstack, false);
+ }
+
+ // index 2 : APILIST_INDEX
+ CallTraceView apiListView = new CallTraceView(rightForm, SWT.NONE);
+ addView(apiListView);
+
+ leftForm.setWeights(new int[] { 75, 25 });
+ rightForm.setWeights(new int[] { 50, 50 });
+ }
+
+ @Override
+ protected void setFormWeights() {
+ leftForm.setWeights(new int[] { 100 - wRate, wRate });
+ rightForm.setWeights(new int[] { hRate, 100 - hRate });
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.timeline.calltrace;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.model.TableInput;
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
+import org.tizen.dynamicanalyzer.utils.Formatter;
+
+public class CallTraceTable extends DATableComposite {
+
+ public CallTraceTable(Composite parent, int compStyle, int tableStyle) {
+ super(parent, compStyle, tableStyle);
+ setRangePopup();
+
+ table.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ GridItem[] ti = ((Grid) e.widget).getSelection();
+ if (null == ti || ti.length == 0) {
+ return;
+ }
+ int size = ti.length;
+ List<String> startData = ((DATableDataFormat) ti[0].getData())
+ .getData();
+ List<String> endData = ((DATableDataFormat) ti[size - 1]
+ .getData()).getData();
+ long startTime = Long.parseLong(startData
+ .get(LogCenterConstants.TIME_INDEX));
+ long endTime = Long.parseLong(endData
+ .get(LogCenterConstants.TIME_INDEX));
+
+ DASelectionData data = new DASelectionData(CallTraceView.ID,
+ startTime, endTime, ti, table);
+ AnalyzerManager.getCurrentPage().updatePage(data);
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+
+ }
+
+ protected List<TableInput> makeTableInput() {
+ List<List<String>> userLog = UserFunctionManager.getInstance().getLog();
+ List<TableInput> input = new ArrayList<TableInput>();
+ int size = userLog.size();
+ for (int i = 0; i < size; i++) {
+ // create text
+ List<String> text = new ArrayList<String>();
+ String time = Formatter.toTimeFormat(userLog.get(i).get(
+ LogCenterConstants.TIME_INDEX));
+ text.add(time);
+ text.add(userLog.get(i).get(LogCenterConstants.THREAD_ID_INDEX));
+ text.add(new String(userLog.get(i).get(
+ LogCenterConstants.APINAME_INDEX)));
+
+ // create images
+
+ // create DATableDataFormat
+ DATableDataFormat tableData = new DATableDataFormat(userLog.get(i)
+ .get(LogCenterConstants.SEQUENCE_NUMBER_INDEX));
+ tableData.getData().addAll(userLog.get(i));
+
+ TableInput tableInput = new TableInput();
+ tableInput.setText(text);
+ tableInput.setData(tableData);
+ input.add(tableInput);
+
+ if (RangeDataManager.getInstance().isBeingAnalyzed()) {
+ long logTime = Long.parseLong(userLog.get(i).get(
+ LogCenterConstants.TIME_INDEX));
+ long startTime = RangeDataManager.getInstance().getStartTime();
+ long endTime = RangeDataManager.getInstance().getEndTime();
+ if (logTime >= startTime && logTime <= endTime) {
+ tableInput.setInRange(true);
+ }
+ }
+
+ }
+ return input;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.timeline.calltrace;
+
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.logparser.Logs;
+import org.tizen.dynamicanalyzer.model.DAView;
+import org.tizen.dynamicanalyzer.nl.TimelinePageLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.sql.SqlManager;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallstackView;
+import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineView;
+import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+
+public class CallTraceView extends DAView {
+ public static final String ID = CallTraceView.class.getName();
+ private DATableComposite tableComp;
+
+ private String[] columnNames = { TimelinePageLabels.CALL_TRACE_VIEW_TIME,
+ TimelinePageLabels.CALL_TRACE_VIEW_TID,
+ TimelinePageLabels.CALL_TRACE_VIEW_NAME };
+ private int[] columnSizes = { 60, 35, 180 };
+ private boolean[] columnVisibility = { true, true, true };
+ int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NUM,
+ AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_STRING };
+ int[] sourceColumns = { LogCenterConstants.TIME_INDEX,
+ LogCenterConstants.THREAD_ID_INDEX,
+ LogCenterConstants.APINAME_INDEX };
+ int[] innerMaxWeight = { 0, 100 };
+ int[] outerMaxWeight = { 0, 100 };
+
+ public CallTraceView(Composite parent, int style) {
+ super(parent, style);
+ this.setLayout(new FillLayout());
+
+ ViewContainer viewContainer = new ViewContainer(this, true);
+ viewContainer.setTitleText(TimelinePageLabels.CALL_TRACE_VIEW_TITLE);
+
+ Composite contents = viewContainer.getContentArea();
+ contents.setBackground(ColorResources.WINDOW_BG_COLOR);
+ contents.setLayout(new FillLayout());
+ tableComp = new CallTraceTable(contents, SWT.NONE, SWT.MULTI
+ | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
+ tableComp.setTableName(TimelinePageLabels.CALL_TRACE_VIEW_TITLE);
+ tableComp.setSortTypes(sortTypes);
+ tableComp.setSourceColumns(sourceColumns);
+ tableComp.setColumns(columnNames);
+ tableComp.setColumnSize(columnSizes);
+ tableComp.setColumnVisibility(columnVisibility);
+ contents.addControlListener(new TableColumnSizePackListener(tableComp,
+ columnSizes));
+
+ setMaxWeight(innerMaxWeight, outerMaxWeight);
+ }
+
+ @Override
+ public void updateView(DASelectionData selData) {
+ long start = selData.getStartTime();
+ long end = selData.getEndTime();
+
+ String query = "select count(time) from user_function where time < " //$NON-NLS-1$
+ + start
+ + " and type = " + LogCenterConstants.USER_FUNCTION_EVENT_TYPE_ENTER + ";"; //$NON-NLS-1$ //$NON-NLS-2$
+ int selectionIndex = SqlManager.getInstance().executeSelectOperation(query);
+
+ String countQuery = "select count(time) from user_function where time >" //$NON-NLS-1$
+ + start
+ + " and time <= " + end + " and type = " + LogCenterConstants.USER_FUNCTION_EVENT_TYPE_ENTER + ";"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ int selectionCount = SqlManager.getInstance().executeSelectOperation(countQuery);
+
+ selectionIndex = ((selectionIndex < 0) && (selectionCount > 0)) ? 0
+ : selectionIndex;
+ tableComp.getTable().getVerticalBar().setSelection(selectionIndex);
+ updateView();
+
+ Grid table = tableComp.getTable();
+ if (selectionIndex >= 0) {
+ if (selectionCount > 0) {
+ int selections[] = new int[selectionCount];
+ for (int i = 0; i < selectionCount; i++) {
+ selections[i] = selectionIndex + i;
+ }
+ table.setSelection(selections);
+ } else {
+ int selections[] = new int[0];
+ table.setSelection(selections);
+ int itemCount = table.getItemCount();
+ if (selectionIndex >= itemCount) {
+ selectionIndex = itemCount - 1;
+ }
+ table.setSelection(selectionIndex);
+ }
+ }
+ /* only callstack update */
+ // timeline view and tabcomp top view : callstack
+ if (selData.getViewId().equals(TimelineView.ID)) {
+ DATabComposite tabView = (DATabComposite) AnalyzerUtil.getView(
+ TimelinePage.ID, DATabComposite.ID);
+ Composite comp = tabView.getTopComposite();
+ if (comp instanceof CallstackView) {
+ ((CallstackView) comp).updateView();
+ }
+ }
+ }
+
+ @Override
+ public void updateView() {
+ tableComp.updateTable();
+ }
+
+ @Override
+ public void clear() {
+ tableComp.getTable().removeAll();
+ }
+
+ @Override
+ public Control getControl() {
+ return tableComp;
+ }
+
+ @Override
+ public void updateLog(LogPackage logPack) {
+ Logs logs = logPack.getLogs(LogCenterConstants.LOG_USER_FUNCTION);
+ if (null == logs || logs.getLogs().size() == 0) {
+ return;
+ }
+ List<List<String>> inputs = logs.getLogs();
+
+ List<List<String>> userLog = UserFunctionManager.getInstance().getLog();
+
+ int size = inputs.size();
+ for (int i = 0; i < size; i++) {
+ List<String> input = inputs.get(i);
+ int type = Integer.parseInt(input
+ .get(LogCenterConstants.USER_FUNCTION_TYPE_INDEX));
+ if (type == LogCenterConstants.USER_FUNCTION_EVENT_TYPE_ENTER) {
+ userLog.add(input);
+ }
+ }
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * WooJin Jung <woojin2.jung@samsung.com>
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.timeline.calltrace;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class UserFunctionManager {
+ private List<List<String>> log = null;
+ private static UserFunctionManager instance = null;
+
+ public static UserFunctionManager getInstance() {
+ if (null == instance) {
+ instance = new UserFunctionManager();
+ }
+ return instance;
+ }
+
+ public void clear() {
+ instance = null;
+ }
+
+ public UserFunctionManager() {
+ log = new ArrayList<List<String>>();
+ }
+
+ public List<List<String>> getLog() {
+ if (null == log) {
+ log = new ArrayList<List<String>>();
+ }
+ return log;
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.timeline.chart;
+
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.logparser.Logs;
+import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.utils.Formatter;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
+
+public class CPUChart extends TimelineChart {
+ private static CPUChart instance = null;
+
+ private DAChartSeries appLoadSeries;
+ private DAChartSeries totalLoadSeries;
+
+ public static CPUChart getInstance() {
+ if (instance == null) {
+ instance = new CPUChart();
+ }
+
+ return instance;
+ }
+
+ private CPUChart() {
+ chartType = TimelineConstants.CHART_TYPE_CPU;
+ probeType = LogCenterConstants.LOG_DEVICE;
+ chartName = TimelineChartLabels.CPU_CHART_TITLE;
+ chartIcon = ImageResources.CHART_CPU;
+ addIcon = ImageResources.ADD_CHART_CPU;
+
+ appLoadSeries = new DAChartSeries(
+ TimelineChartLabels.CPU_CHART_SERIES_NAME_APP_LOAD,
+ DAChartSeries.SERIES_STYLE_AREA,
+ ColorResources.SERIESE_COLOR_CPU_SYSTEM);
+ totalLoadSeries = new DAChartSeries(
+ TimelineChartLabels.CPU_CHART_SERIES_NAME_TOTAL_LOAD,
+ DAChartSeries.SERIES_STYLE_AREA,
+ ColorResources.SERIESE_COLOR_CPU_APP);
+ }
+
+ @Override
+ public DAChartBoardItem createBoardItem(DAChartBoard board) {
+ DAChartBoardItem item = super.createBoardItem(board);
+
+ chart.addSeries(totalLoadSeries);
+ chart.addSeries(appLoadSeries);
+
+ chart.getPlot().setAutoHeightRange(false);
+ chart.getPlot().setAxisRangeY(0, 100);
+ chart.getPlot().setAxisUnit("%");
+ chart.getPlot().setShowAxis(true);
+
+ return item;
+ }
+
+ @Override
+ public void parseLogPackage(LogPackage logPack) {
+ Logs logs = logPack.getLogs(probeType);
+ List<List<String>> logList = logs.getLogs();
+ for (List<String> log : logList) {
+ parsingLog(log);
+ }
+ }
+
+ private void parsingLog(List<String> log) {
+ if (null == log || 0 > log.size()) {
+ return;
+ }
+
+ /* app load */
+ if (!log.get(LogCenterConstants.DEVICE_APP_CPU_USAGE_INDEX).isEmpty()) {
+ try {
+ double time = Double.parseDouble(log
+ .get(LogCenterConstants.DEVICE_TIME_INDEX))
+ / TimelineConstants.MEGA;
+ double appCpuRate = Double.parseDouble(log
+ .get(LogCenterConstants.DEVICE_APP_CPU_USAGE_INDEX));
+ appLoadSeries.addSeriesItem(new DAChartSeriesItem(time,
+ appCpuRate, Formatter.toPercentageFormat(appCpuRate)));
+ } catch (NumberFormatException ne) {
+ ne.printStackTrace();
+ }
+ }
+
+ /* total load */
+ if (!log.get(LogCenterConstants.DEVICE_SYSTEM_CPU_USAGE_INDEX)
+ .isEmpty()) {
+ double time = 0;
+ double systemAvgLoad = 0;
+
+ try {
+ time = Double.parseDouble(log
+ .get(LogCenterConstants.DEVICE_TIME_INDEX))
+ / TimelineConstants.MEGA;
+ String[] cpuRates = log.get(
+ LogCenterConstants.DEVICE_SYSTEM_CPU_USAGE_INDEX)
+ .split(","); //$NON-NLS-1$
+ systemAvgLoad = Double
+ .parseDouble(cpuRates[cpuRates.length - 1]);
+ totalLoadSeries.addSeriesItem(new DAChartSeriesItem(time,
+ systemAvgLoad, Formatter
+ .toPercentageFormat(systemAvgLoad)));
+ } catch (NumberFormatException ne) {
+ ne.printStackTrace();
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.timeline.chart;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.logparser.Logs;
+import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.utils.Formatter;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
+
+public class CPUCoreChart extends TimelineChart {
+ private static CPUCoreChart instance = null;
+ private static int DEFAULT_CORE_SIZE = 4;
+ private int coreSize = TimelineConstants.NOT_INITED;
+
+ private List<DAChartSeries> coreChartSeriesList = new ArrayList<DAChartSeries>();
+
+ public static CPUCoreChart getInstance() {
+ if (null == instance) {
+ instance = new CPUCoreChart();
+ }
+ return instance;
+ }
+
+ public CPUCoreChart() {
+ chartType = TimelineConstants.CHART_TYPE_CPU_CORE;
+ probeType = LogCenterConstants.LOG_DEVICE;
+ chartName = TimelineChartLabels.CPU_CORE_CHART_TITLE;
+ chartIcon = ImageResources.CHART_CPU_CORE;
+ addIcon = ImageResources.ADD_CHART_CPU_CORE;
+
+ /* core 0 */
+ coreChartSeriesList.add(new DAChartSeries(
+ TimelineChartLabels.CPU_CORE_CHART_SERIES_NAME_CORE0,
+ DAChartSeries.SERIES_STYLE_LINE,
+ ColorResources.SERIESE_COLOR_CPUCORE_CORE0));
+ /* core 1 */
+ coreChartSeriesList.add(new DAChartSeries(
+ TimelineChartLabels.CPU_CORE_CHART_SERIES_NAME_CORE1,
+ DAChartSeries.SERIES_STYLE_LINE,
+ ColorResources.SERIESE_COLOR_CPUCORE_CORE1));
+ /* core 2 */
+ coreChartSeriesList.add(new DAChartSeries(
+ TimelineChartLabels.CPU_CORE_CHART_SERIES_NAME_CORE2,
+ DAChartSeries.SERIES_STYLE_LINE,
+ ColorResources.SERIESE_COLOR_CPUCORE_CORE2));
+ /* core 3 */
+ coreChartSeriesList.add(new DAChartSeries(
+ TimelineChartLabels.CPU_CORE_CHART_SERIES_NAME_CORE3,
+ DAChartSeries.SERIES_STYLE_LINE,
+ ColorResources.SERIESE_COLOR_CPUCORE_CORE3));
+ }
+
+ @Override
+ public DAChartBoardItem createBoardItem(DAChartBoard board) {
+ DAChartBoardItem item = super.createBoardItem(board);
+
+ if (null == coreChartSeriesList
+ || coreChartSeriesList.size() != DEFAULT_CORE_SIZE) {
+ return null;
+ }
+
+ for (int i = 0; i < DEFAULT_CORE_SIZE; i++) {
+ chart.addSeries(coreChartSeriesList.get(i));
+ }
+
+ chart.getPlot().setAutoHeightRange(false);
+ chart.getPlot().setAxisRangeY(0, 100);
+ chart.getPlot().setAxisUnit("%");
+ chart.getPlot().setShowAxis(true);
+
+ return item;
+ }
+
+ private void parsingLog(List<String> log) {
+ if (null == log || 0 > log.size()) {
+ return;
+ }
+
+ if (!log.get(LogCenterConstants.DEVICE_SYSTEM_CPU_USAGE_INDEX)
+ .isEmpty()) {
+ try {
+ double time = Double.parseDouble(log
+ .get(LogCenterConstants.DEVICE_TIME_INDEX))
+ / TimelineConstants.MEGA;
+ String[] cpuRates = log.get(
+ LogCenterConstants.DEVICE_SYSTEM_CPU_USAGE_INDEX)
+ .split(","); //$NON-NLS-1$
+ double value = 0;
+ if (coreSize == TimelineConstants.NOT_INITED) {
+ coreSize = cpuRates.length - 1;
+ }
+
+ for (int i = 0; i < coreSize; i++) {
+ value = Double.parseDouble(cpuRates[i]);
+ coreChartSeriesList.get(i).addSeriesItem(
+ new DAChartSeriesItem(time, value, Formatter
+ .toPercentageFormat(value)));
+ }
+ } catch (NumberFormatException ne) {
+ ne.printStackTrace();
+ }
+ }
+ }
+
+ @Override
+ public void parseLogPackage(LogPackage logPack) {
+ Logs logs = logPack.getLogs(probeType);
+ List<List<String>> logList = logs.getLogs();
+
+ for (List<String> log : logList) {
+ parsingLog(log);
+ }
+ }
+
+ public int getCoreSize() {
+ return coreSize;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.timeline.chart;
+
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.logparser.Logs;
+import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.utils.Formatter;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
+
+public class CPUFrequencyChart extends TimelineChart {
+ private static CPUFrequencyChart instance = null;
+ private DAChartSeries frequencySeries;
+
+ public static CPUFrequencyChart getInstance() {
+ if (instance == null) {
+ instance = new CPUFrequencyChart();
+ }
+
+ return instance;
+ }
+
+ private CPUFrequencyChart() {
+ chartType = TimelineConstants.CHART_TYPE_CPU_FREQUENCY;
+ probeType = LogCenterConstants.LOG_DEVICE;
+ chartName = TimelineChartLabels.CPU_FREQUENCY_CHART_TITLE;
+ chartIcon = ImageResources.CHART_CPU_FREQUENCY;
+ addIcon = ImageResources.ADD_CHART_CPU_FREQUENCY;
+
+ frequencySeries = new DAChartSeries(
+ TimelineChartLabels.CPU_FREQUENCY_CHART_FREQUENCY,
+ DAChartSeries.SERIES_STYLE_LINE,
+ ColorResources.SERIESE_COLOR_CPU_FREQ);
+ }
+
+ @Override
+ public DAChartBoardItem createBoardItem(DAChartBoard board) {
+ DAChartBoardItem item = super.createBoardItem(board);
+
+ chart.addSeries(frequencySeries);
+
+ chart.getPlot().setAxisUnit("GHz");
+ chart.getPlot().setShowAxis(true);
+
+ return item;
+ }
+
+ @Override
+ public void parseLogPackage(LogPackage logPack) {
+ Logs logs = logPack.getLogs(probeType);
+ List<List<String>> logList = logs.getLogs();
+
+ for (List<String> log : logList) {
+ parsingLog(log);
+ }
+ }
+
+ private void parsingLog(List<String> log) {
+ if (null == log || 0 > log.size()) {
+ return;
+ }
+
+ if (!log.get(LogCenterConstants.DEVICE_CPU_FREQUENCY_INDEX).isEmpty()) {
+ try {
+ double time = Double.parseDouble(log
+ .get(LogCenterConstants.DEVICE_TIME_INDEX))
+ / TimelineConstants.MEGA;
+ String[] cpuFreqs = log.get(
+ LogCenterConstants.DEVICE_CPU_FREQUENCY_INDEX).split(
+ ","); //$NON-NLS-1$
+
+ double freq0 = Double.parseDouble(cpuFreqs[0]) * (double) 1000;
+ frequencySeries.addSeriesItem(new DAChartSeriesItem(time,
+ freq0, Formatter.toHzFormat(freq0)));
+ } catch (NumberFormatException ne) {
+ ne.printStackTrace();
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.timeline.chart;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.logparser.Logs;
+import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.utils.Formatter;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
+
+public class FileChart extends TimelineChart {
+ private class FDCountData {
+ private int type;
+ private double time;
+ private long data;
+
+ private FDCountData(int type, double time, long data) {
+ this.type = type;
+ this.time = time;
+ this.data = data;
+ }
+ }
+
+ private static FileChart instance = null;
+
+ private final int MIN_FDCOUNT = 5;
+ private final int MIN_READ_WRITE_BYTE = 5;
+
+ private final int TYPE_FDCOUNT = 0;
+ private final int TYPE_READ = 1;
+ private final int TYPE_WRITE = 2;
+
+ private long maxFDCount = MIN_FDCOUNT;
+ private double maxReadWrite = MIN_READ_WRITE_BYTE;
+ private int fdCount = 0;
+
+ private List<Double> deviceLogTimeList = new ArrayList<Double>();
+ private Map<Double, Integer> fdCountSeriesItemIndexMap = new HashMap<Double, Integer>();
+ private Map<Double, Integer> deviceTimeIndexMap = new HashMap<Double, Integer>();
+ private List<FDCountData> fileDataQ = new ArrayList<FDCountData>();
+
+ private DAChartSeries readSeries;
+ private DAChartSeries writeSeries;
+ private DAChartSeries fdCountSeries;
+
+ public static FileChart getInstance() {
+ if (instance == null) {
+ instance = new FileChart();
+ }
+
+ return instance;
+ }
+
+ private FileChart() {
+ chartType = TimelineConstants.CHART_TYPE_FILE;
+ probeType = LogCenterConstants.LOG_DEVICE;
+ chartName = TimelineChartLabels.FILE_CHART_TITLE;
+ chartIcon = ImageResources.CHART_FILE;
+ addIcon = ImageResources.ADD_CHART_FILE;
+
+ readSeries = new DAChartSeries(
+ TimelineChartLabels.FILE_CHART_SERIES_NAME_READ,
+ DAChartSeries.SERIES_STYLE_BAR,
+ ColorResources.SERIESE_COLOR_FILE_READ);
+ writeSeries = new DAChartSeries(
+ TimelineChartLabels.FILE_CHART_SERIES_NAME_WRITE,
+ DAChartSeries.SERIES_STYLE_BAR,
+ ColorResources.SERIESE_COLOR_FILE_WRITE);
+ fdCountSeries = new DAChartSeries(
+ TimelineChartLabels.FILE_CHART_SERIES_NAME_FD_COUNT,
+ DAChartSeries.SERIES_STYLE_STEP,
+ ColorResources.SERIESE_COLOR_FILE_FD);
+
+ }
+
+ @Override
+ public DAChartBoardItem createBoardItem(DAChartBoard board) {
+ DAChartBoardItem item = super.createBoardItem(board);
+
+ chart.addSeries(readSeries);
+ chart.addSeries(writeSeries);
+ chart.addSeries(fdCountSeries);
+
+ chart.getPlot().setAutoHeightRange(false);
+ chart.getPlot().setSeriesHeightRange(true);
+ chart.getPlot().setShowAxis(true);
+
+ fdCountSeries.setEndY(maxFDCount);
+ readSeries.setEndY(maxReadWrite);
+ writeSeries.setEndY(maxReadWrite);
+
+ return item;
+ }
+
+ @Override
+ public void clear() {
+ super.clear();
+ fdCount = 0;
+ maxFDCount = MIN_FDCOUNT;
+ maxReadWrite = MIN_READ_WRITE_BYTE;
+ deviceLogTimeList.clear();
+ fdCountSeriesItemIndexMap.clear();
+ deviceTimeIndexMap.clear();
+ fileDataQ.clear();
+
+ fdCountSeries.addSeriesItem(new DAChartSeriesItem(0, 0, "0"));
+ }
+
+ @Override
+ public void parseLogPackage(LogPackage logPack) {
+ Logs logs = logPack.getLogs(probeType);
+ List<List<String>> logList = logs.getLogs();
+ for (List<String> log : logList) {
+ double time = Double.parseDouble(log
+ .get(LogCenterConstants.TIME_INDEX));
+
+ int size = deviceLogTimeList.size();
+ int index = (int) (time / TimelineConstants.MEGA);
+
+ if (size <= index) {
+ for (int i = size; i <= index; i++) {
+ deviceLogTimeList.add(Double.NaN);
+ }
+ }
+ deviceLogTimeList.set(index, time);
+
+ updateRW(time);
+ }
+ }
+
+ private void updateRW(double time) {
+ readSeries.addSeriesItem(new DAChartSeriesItem(time
+ / TimelineConstants.MEGA, 0, Formatter.toByteFormat(0)));
+ writeSeries.addSeriesItem(new DAChartSeriesItem(time
+ / TimelineConstants.MEGA, 0, Formatter.toByteFormat(0)));
+
+ deviceTimeIndexMap.put(time, readSeries.getSeriesItemList().size() - 1);
+
+ doQJob();
+ }
+
+ private void doQJob() {
+ while (fileDataQ.size() != 0) {
+ int deviceTimeIndex = getDeviceTimeIndexByTime(fileDataQ.get(0).time
+ / TimelineConstants.MEGA);
+
+ if (deviceTimeIndex == -1) {
+ break;
+ } else {
+ double deviceTime = deviceLogTimeList.get(deviceTimeIndex);
+
+ switch (fileDataQ.get(0).type) {
+ case TYPE_FDCOUNT:
+ fdCount += fileDataQ.get(0).data;
+
+ Integer fdCountSeriesItemIndex = fdCountSeriesItemIndexMap
+ .get(deviceTime);
+ if (fdCountSeriesItemIndex == null) {
+ fdCountSeries.addSeriesItem(new DAChartSeriesItem(
+ deviceTime / TimelineConstants.MEGA, fdCount,
+ String.valueOf(fdCount)));
+ fdCountSeriesItemIndexMap.put(deviceTime, fdCountSeries
+ .getSeriesItemList().size() - 1);
+ } else {
+ DAChartSeriesItem item = fdCountSeries
+ .getSeriesItemList()
+ .get(fdCountSeriesItemIndex);
+ item.setY(fdCount);
+ item.setTooltipText(String.valueOf(fdCount));
+ }
+
+ if (fdCount > maxFDCount) {
+ maxFDCount = fdCount;
+ fdCountSeries.setEndY(maxFDCount * 1.1 + 1);
+ }
+ break;
+ case TYPE_READ:
+ DAChartSeriesItem readItem = readSeries.getSeriesItemList()
+ .get(deviceTimeIndexMap.get(deviceTime));
+ double readSum = readItem.getY() + fileDataQ.get(0).data;
+ readItem.setY(readSum);
+ readItem.setTooltipText(Formatter.toByteFormat(readSum));
+ if (readSum > maxReadWrite) {
+ maxReadWrite = readSum;
+ readSeries.setEndY(maxReadWrite * 1.1);
+ writeSeries.setEndY(maxReadWrite * 1.1);
+ }
+ break;
+ case TYPE_WRITE:
+ DAChartSeriesItem writeItem = writeSeries
+ .getSeriesItemList().get(
+ deviceTimeIndexMap.get(deviceTime));
+ double writeSum = writeItem.getY() + fileDataQ.get(0).data;
+ writeItem.setY(writeSum);
+ writeItem.setTooltipText(Formatter.toByteFormat(writeSum));
+ if (writeSum > maxReadWrite) {
+ maxReadWrite = writeSum;
+ readSeries.setEndY(maxReadWrite * 1.1);
+ writeSeries.setEndY(maxReadWrite * 1.1);
+ }
+ break;
+ }
+
+ fileDataQ.remove(0);
+ }
+ }
+ }
+
+ public void setFDCount(int count, double time) {
+ fileDataQ.add(new FDCountData(TYPE_FDCOUNT, time, count));
+ doQJob();
+ }
+
+ public void setReadByte(long size, double time) {
+ fileDataQ.add(new FDCountData(TYPE_READ, time, size));
+ doQJob();
+ }
+
+ public void setWriteByte(long size, double time) {
+ fileDataQ.add(new FDCountData(TYPE_WRITE, time, size));
+ doQJob();
+ }
+
+ private int getDeviceTimeIndexByTime(double time) {
+ int flat = (int) time;
+
+ int i;
+ for (i = flat; i < deviceLogTimeList.size(); i++) {
+ Double deviceLogTime = deviceLogTimeList.get(i);
+ if (deviceLogTime == Double.NaN || deviceLogTime < time) {
+ continue;
+ }
+
+ return i;
+ }
+
+ return -1;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.timeline.chart;
+
+import java.util.HashMap;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.logparser.Logs;
+import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.utils.Formatter;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
+
+public class HeapChart extends TimelineChart {
+ private final int MEM_API_TYPE_ALLOC = 0;
+ private final int MEM_API_TYPE_FREE = 1;
+ private final int MEM_API_TYPE_MANAGE = 2;
+ private final int MEM_USER = 2;
+
+ private static HeapChart instance = null;
+ private final String NIL = "(nil)"; //$NON-NLS-1$
+
+ private DAChartSeries totalAllocationSeries;
+ private DAChartSeries userAllocationSeries;
+ private double allocByte = 0;
+ private HashMap<String, Double> allocationSeriesDataSetMap = new HashMap<String, Double>();
+
+ public static HeapChart getInstance() {
+ if (instance == null) {
+ instance = new HeapChart();
+ }
+
+ return instance;
+ }
+
+ private HeapChart() {
+ chartType = TimelineConstants.CHART_TYPE_HEAP;
+ probeType = LogCenterConstants.LOG_DEVICE;
+ chartName = TimelineChartLabels.HEAP_CHART_TITLE;
+ chartIcon = ImageResources.CHART_HEAP;
+ addIcon = ImageResources.ADD_CHART_HEAP;
+
+ totalAllocationSeries = new DAChartSeries(
+ TimelineChartLabels.HEAP_CHART_SERIES_NAME_PLATFORM_ALLOCATION,
+ DAChartSeries.SERIES_STYLE_AREA,
+ ColorResources.SERIESE_COLOR_HEAP_SYSTEM);
+ userAllocationSeries = new DAChartSeries(
+ TimelineChartLabels.HEAP_CHART_SERIES_NAME_USER_ALLOCATION,
+ DAChartSeries.SERIES_STYLE_AREA,
+ ColorResources.SERIESE_COLOR_HEAP_USER);
+ }
+
+ @Override
+ public DAChartBoardItem createBoardItem(DAChartBoard board) {
+ DAChartBoardItem item = super.createBoardItem(board);
+
+ chart.addSeries(totalAllocationSeries);
+ chart.addSeries(userAllocationSeries);
+
+ chart.getPlot().setAxisUnit("B");
+ chart.getPlot().setShowAxis(true);
+
+ return item;
+ }
+
+ @Override
+ public void parseLogPackage(LogPackage logPack) {
+ Logs memoryLogs = logPack.getLogs(LogCenterConstants.LOG_MEMORY);
+ Logs deviceLogs = logPack.getLogs(LogCenterConstants.LOG_DEVICE);
+
+ List<List<String>> memoryLogList = memoryLogs == null ? null
+ : memoryLogs.getLogs();
+ List<List<String>> deviceLogList = deviceLogs == null ? null
+ : deviceLogs.getLogs();
+
+ parsingLog(memoryLogList, deviceLogList);
+ }
+
+ private void parsingLog(List<List<String>> memoryLogList,
+ List<List<String>> deviceLogList) {
+ boolean isUserAllocUpdated = false;
+
+ /* user alloc */
+ try {
+ if (memoryLogList != null) {
+ int size = memoryLogList.size();
+ for (int i = 0; i < size; i++) {
+ List<String> log = memoryLogList.get(i);
+ if (log != null && log.size() > 0) {
+ int memApiType = Integer.parseInt(log
+ .get(LogCenterConstants.MEMORY_APITYPE_INDEX));
+ int internalFlag = Integer.parseInt(log
+ .get(LogCenterConstants.INTERNAL_FLAG_INDEX));
+ long errorNo = Long.parseLong(log
+ .get(LogCenterConstants.ERROR_INDEX));
+
+ if (errorNo == 0 && MEM_USER == internalFlag) {
+ if (MEM_API_TYPE_ALLOC == memApiType
+ || MEM_API_TYPE_FREE == memApiType
+ || MEM_API_TYPE_MANAGE == memApiType) {
+ double time = 0;
+ time = Double.parseDouble(log
+ .get(LogCenterConstants.TIME_INDEX))
+ / TimelineConstants.MEGA;
+
+ isUserAllocUpdated = addNewSeriesUserAllocData(
+ memApiType, time, log);
+ }
+ }
+ }
+ }
+ }
+ } catch (NumberFormatException ne) {
+ ne.printStackTrace();
+ }
+
+ /* total alloc */
+ try {
+ if (deviceLogList != null) {
+ int size = deviceLogList.size();
+ for (int i = 0; i < size; i++) {
+ List<String> log = deviceLogList.get(i);
+ if (log != null && log.size() > 0) {
+ if (!log.get(
+ LogCenterConstants.DEVICE_ALLOCATION_SIZE_INDEX)
+ .isEmpty()) {
+
+ double time = Double.parseDouble(log
+ .get(LogCenterConstants.TIME_INDEX))
+ / TimelineConstants.MEGA;
+ double value = Double
+ .parseDouble(log
+ .get(LogCenterConstants.DEVICE_ALLOCATION_SIZE_INDEX))
+ - allocByte;
+ totalAllocationSeries
+ .addSeriesItem(new DAChartSeriesItem(
+ time, value, Formatter
+ .toByteFormat(value)));
+
+ if (!isUserAllocUpdated) {
+ userAllocationSeries
+ .addSeriesItem(new DAChartSeriesItem(
+ time,
+ allocByte,
+ Formatter
+ .toByteFormat(allocByte)));
+ }
+ }
+ }
+ }
+ }
+ } catch (NumberFormatException ne) {
+ ne.printStackTrace();
+ }
+ }
+
+ private boolean addNewSeriesUserAllocData(int fdApiType, double time,
+ List<String> log) {
+ double size = 0;
+
+ String addressString = log.get(LogCenterConstants.MEMORY_ADDR_INDEX);
+ if (addressString.equals(NIL)) {
+ return false;
+ }
+
+ if (MEM_API_TYPE_ALLOC == fdApiType) {
+ if (log.get(LogCenterConstants.MEMORY_SIZE_INDEX).isEmpty()) {
+ return false;
+ }
+
+ try {
+ size = Double.parseDouble(log
+ .get(LogCenterConstants.MEMORY_SIZE_INDEX));
+
+ allocByte += size;
+ allocationSeriesDataSetMap.put(addressString, size);
+ } catch (NumberFormatException ne) {
+ ne.printStackTrace();
+ }
+ } else if (MEM_API_TYPE_FREE == fdApiType) {
+ if (!allocationSeriesDataSetMap.containsKey(addressString)) {
+ return false;
+ }
+ size = allocationSeriesDataSetMap.get(addressString);
+
+ allocByte -= size;
+ }
+ userAllocationSeries.addSeriesItem(new DAChartSeriesItem(time,
+ allocByte, Formatter.toByteFormat(allocByte)));
+
+ return true;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.timeline.chart;
+
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.logparser.Logs;
+import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.utils.Formatter;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
+
+public class ProcessMemoryChart extends TimelineChart {
+ private static ProcessMemoryChart instance = null;
+
+ private DAChartSeries VSSMemorySeries;
+ private DAChartSeries RSSMemorySeries;
+ private DAChartSeries PSSMemorySeries;
+
+ public static ProcessMemoryChart getInstance() {
+ if (instance == null) {
+ instance = new ProcessMemoryChart();
+ }
+
+ return instance;
+ }
+
+ private ProcessMemoryChart() {
+ chartType = TimelineConstants.CHART_TYPE_PROCESS_MEMORY;
+ probeType = LogCenterConstants.LOG_DEVICE;
+ chartName = TimelineChartLabels.PROCESS_MEMORY_CHART_TITLE;
+ chartIcon = ImageResources.CHART_PROCESS_MEMORY;
+ addIcon = ImageResources.ADD_CHART_PROCESS_MEMORY;
+
+ VSSMemorySeries = new DAChartSeries(
+ TimelineChartLabels.PROCESS_MEMORY_CHART_VSS,
+ DAChartSeries.SERIES_STYLE_AREA,
+ ColorResources.SERIESE_COLOR_PROCESS_VSS);
+ RSSMemorySeries = new DAChartSeries(
+ TimelineChartLabels.PROCESS_MEMORY_CHART_RSS,
+ DAChartSeries.SERIES_STYLE_AREA,
+ ColorResources.SERIESE_COLOR_PROCESS_RSS);
+ PSSMemorySeries = new DAChartSeries(
+ TimelineChartLabels.PROCESS_MEMORY_CHART_PSS,
+ DAChartSeries.SERIES_STYLE_AREA,
+ ColorResources.SERIESE_COLOR_PROCESS_PSS);
+ }
+
+ @Override
+ public DAChartBoardItem createBoardItem(DAChartBoard board) {
+ DAChartBoardItem item = super.createBoardItem(board);
+
+ chart.addSeries(VSSMemorySeries);
+ chart.addSeries(RSSMemorySeries);
+ chart.addSeries(PSSMemorySeries);
+
+ chart.getPlot().setAxisUnit("B");
+ chart.getPlot().setShowAxis(true);
+
+ return item;
+ }
+
+ @Override
+ public void parseLogPackage(LogPackage logPack) {
+ Logs logs = logPack.getLogs(probeType);
+ List<List<String>> logList = logs.getLogs();
+
+ for (List<String> log : logList) {
+ parsingLog(log);
+ }
+ }
+
+ private void parsingLog(List<String> log) {
+ /* VSS */
+ if (!log.get(LogCenterConstants.DEVICE_VSS_MEMORY_INDEX).isEmpty()) {
+ try {
+ double time = Double.parseDouble(log
+ .get(LogCenterConstants.DEVICE_TIME_INDEX))
+ / TimelineConstants.MEGA;
+ double value = Double.parseDouble(log
+ .get(LogCenterConstants.DEVICE_VSS_MEMORY_INDEX));
+
+ VSSMemorySeries.addSeriesItem(new DAChartSeriesItem(time,
+ value, Formatter.toByteFormat(value)));
+ } catch (NumberFormatException ne) {
+ ne.printStackTrace();
+ }
+ }
+
+ /* RSS */
+ if (!log.get(LogCenterConstants.DEVICE_RSS_MEMORY_INDEX).isEmpty()) {
+ try {
+ double time = Double.parseDouble(log
+ .get(LogCenterConstants.DEVICE_TIME_INDEX))
+ / TimelineConstants.MEGA;
+ double value = Double.parseDouble(log
+ .get(LogCenterConstants.DEVICE_RSS_MEMORY_INDEX));
+
+ RSSMemorySeries.addSeriesItem(new DAChartSeriesItem(time,
+ value, Formatter.toByteFormat(value)));
+ } catch (NumberFormatException ne) {
+ ne.printStackTrace();
+ }
+ }
+
+ /* PSS */
+ if (!log.get(LogCenterConstants.DEVICE_PSS_MEMORY_INDEX).isEmpty()) {
+ try {
+ double time = Double.parseDouble(log
+ .get(LogCenterConstants.DEVICE_TIME_INDEX))
+ / TimelineConstants.MEGA;
+ double value = Double.parseDouble(log
+ .get(LogCenterConstants.DEVICE_PSS_MEMORY_INDEX));
+
+ PSSMemorySeries.addSeriesItem(new DAChartSeriesItem(time,
+ value, Formatter.toByteFormat(value)));
+ } catch (NumberFormatException ne) {
+ ne.printStackTrace();
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.timeline.chart;
+
+import java.io.File;
+import java.util.List;
+
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.logparser.Logs;
+import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
+
+public class ScreenshotChart extends TimelineChart {
+ public static ScreenshotChart instance = null;
+
+ private DAChartSeries screenshotSeries;
+
+ public static ScreenshotChart getInstance() {
+ if (instance == null) {
+ instance = new ScreenshotChart();
+ }
+
+ return instance;
+ }
+
+ private ScreenshotChart() {
+ chartType = TimelineConstants.CHART_TYPE_SCREENSHOT;
+ chartStyle = DAChart.CHART_STYLE_SCREENSHOT;
+ probeType = LogCenterConstants.LOG_SCREENSHOT;
+ chartName = TimelineChartLabels.SCREENSHOT_CHART_TITLE;
+ chartIcon = ImageResources.CHART_SCREENSHOT;
+ addIcon = ImageResources.ADD_CHART_SCREENSHOT;
+
+ screenshotSeries = new DAChartSeries(
+ TimelineChartLabels.SCREENSHOT_CHART_TITLE,
+ DAChartSeries.SERIES_STYLE_IMAGE);
+ }
+
+ @Override
+ public DAChartBoardItem createBoardItem(DAChartBoard board) {
+ DAChartBoardItem item = super.createBoardItem(board);
+ item.useExpand(false);
+
+ chart.addSeries(screenshotSeries);
+
+ setChartStyle();
+
+ return item;
+ }
+
+ public DAChart getChart() {
+ return chart;
+ }
+
+ @Override
+ public void parseLogPackage(LogPackage logPack) {
+ Logs logs = logPack.getLogs(probeType);
+ List<List<String>> logList = logs.getLogs();
+
+ for (List<String> log : logList) {
+ parsingLog(log);
+ }
+ }
+
+ private void parsingLog(List<String> log) {
+ try {
+ double time = Double.parseDouble(log
+ .get(LogCenterConstants.TIME_INDEX))
+ / TimelineConstants.MEGA;
+
+ String imagePath = AnalyzerManager.getProject().getSavePath()
+ + File.separator + AnalyzerConstants.IMAGE_FOLDER_NAME
+ + File.separator
+ + AnalyzerConstants.SMALL_IMAGE_FOLDER_NAME;
+ String imagePathLog = log
+ .get(LogCenterConstants.SNAPSHOT_IMAGE_PATH_INDEX);
+ String[] splitedImagePathLog = imagePathLog.split("/"); //$NON-NLS-1$
+ String fileName = splitedImagePathLog[splitedImagePathLog.length - 1];
+ imagePath += File.separator + fileName;
+
+ String orientation = log
+ .get(LogCenterConstants.SNAPSHOT_ROTATE_INDEX);
+ int yPostion;
+ if (orientation.equals("0") || orientation.equals("180")) { //$NON-NLS-1$ //$NON-NLS-2$
+ yPostion = 10;
+ } else {
+ yPostion = 23;
+ }
+
+ new CreateImageThread(imagePath, time, yPostion).run();
+ } catch (NumberFormatException ne) {
+ ne.printStackTrace();
+ }
+ }
+
+ private class CreateImageThread extends Thread {
+ private String imagePath;
+ private double time;
+ private int yPosition;
+
+ private CreateImageThread(String imagePath, double time, int yPostion) {
+ this.imagePath = imagePath;
+ this.time = time;
+ this.yPosition = yPostion;
+ }
+
+ public void run() {
+ Image image = null;
+
+ while (true) {
+ try {
+ image = new Image(Display.getDefault(), imagePath);
+ } catch (SWTException se) {
+ try {
+ Thread.sleep(1000);
+ continue;
+ } catch (InterruptedException ie) {
+ continue;
+ }
+ }
+
+ break;
+ }
+
+ screenshotSeries.addSeriesItem(new DAChartSeriesItem(time,
+ yPosition, image));
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.timeline.chart;
+
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.logparser.Logs;
+import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.utils.Formatter;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
+
+public class SystemMemoryChart extends TimelineChart {
+ private static SystemMemoryChart instance = null;
+
+ private DAChartSeries processSeries;
+ private DAChartSeries systemSeries;
+ private DAChartSeries totalSeries;
+
+ public static SystemMemoryChart getInstance() {
+ if (instance == null) {
+ instance = new SystemMemoryChart();
+ }
+
+ return instance;
+ }
+
+ private SystemMemoryChart() {
+ chartType = TimelineConstants.CHART_TYPE_SYSTEM_MEMORY;
+ probeType = LogCenterConstants.LOG_DEVICE;
+ chartName = TimelineChartLabels.SYSTEM_MEMORY_CHART_TITLE;
+ chartIcon = ImageResources.CHART_SYSTEM_MEMORY;
+ addIcon = ImageResources.ADD_CHART_SYSTEM_MEMORY;
+
+ processSeries = new DAChartSeries(
+ TimelineChartLabels.SYSTEM_MEMORY_CHART_SERIES_NAME_PROC_RESIDENT,
+ DAChartSeries.SERIES_STYLE_AREA,
+ ColorResources.SERIESE_COLOR_MEMORY_APP_USED);
+ systemSeries = new DAChartSeries(
+ TimelineChartLabels.SYSTEM_MEMORY_CHART_SERIES_NAME_SYSTEM,
+ DAChartSeries.SERIES_STYLE_AREA,
+ ColorResources.SERIESE_COLOR_MEMORY_SYS_USED);
+ totalSeries = new DAChartSeries(
+ TimelineChartLabels.SYSTEM_MEMORY_CHART_SERIES_NAME_TOTAL,
+ DAChartSeries.SERIES_STYLE_AREA,
+ ColorResources.SERIESE_COLOR_MEMORY_SYS_MAX);
+ }
+
+ @Override
+ public DAChartBoardItem createBoardItem(DAChartBoard board) {
+ DAChartBoardItem item = super.createBoardItem(board);
+
+ chart.addSeries(totalSeries);
+ chart.addSeries(systemSeries);
+ chart.addSeries(processSeries);
+
+ chart.getPlot().setAxisUnit("B");
+ chart.getPlot().setShowAxis(true);
+
+ return item;
+ }
+
+ @Override
+ public void parseLogPackage(LogPackage logPack) {
+ Logs logs = logPack.getLogs(probeType);
+ List<List<String>> logList = logs.getLogs();
+
+ for (List<String> log : logList) {
+ parsingLog(log);
+ }
+ }
+
+ private void parsingLog(List<String> log) {
+ if (null == log || 0 > log.size()) {
+ return;
+ }
+
+ /* process */
+ if (!log.get(LogCenterConstants.DEVICE_RSS_MEMORY_INDEX).isEmpty()) {
+ try {
+ double time = Double.parseDouble(log
+ .get(LogCenterConstants.DEVICE_TIME_INDEX))
+ / TimelineConstants.MEGA;
+ double usage = Double.parseDouble(log
+ .get(LogCenterConstants.DEVICE_RSS_MEMORY_INDEX));
+ processSeries.addSeriesItem(new DAChartSeriesItem(time, usage,
+ Formatter.toByteFormat(usage)));
+ } catch (NumberFormatException ne) {
+ ne.printStackTrace();
+ }
+ }
+
+ /* system & total */
+ if (!log.get(LogCenterConstants.DEVICE_SYSTEM_USED_MEMORY_INDEX)
+ .isEmpty()) {
+ try {
+ double time = Double.parseDouble(log
+ .get(LogCenterConstants.DEVICE_TIME_INDEX))
+ / TimelineConstants.MEGA;
+
+ double usage = Double
+ .parseDouble(log
+ .get(LogCenterConstants.DEVICE_SYSTEM_USED_MEMORY_INDEX));
+ double total = (double) AnalyzerManager.getProject()
+ .getSystemMemorySize();
+
+ systemSeries.addSeriesItem(new DAChartSeriesItem(time, usage,
+ Formatter.toByteFormat(usage)));
+ totalSeries.addSeriesItem(new DAChartSeriesItem(time, total,
+ Formatter.toByteFormat(total)));
+ } catch (NumberFormatException ne) {
+ ne.printStackTrace();
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.timeline.chart;
+
+import java.util.List;
+
+import org.eclipse.swt.graphics.Image;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotTooltip;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenu;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuItem;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuListener;
+
+public abstract class TimelineChart {
+ protected DAChart chart;
+ protected int chartType;
+ protected int chartStyle = DAChart.CHART_STYLE_NORMAL;
+ protected int probeType;
+ protected String chartName;
+ protected Image chartIcon;
+ protected Image addIcon;
+ protected DAContextMenu popupMenu;
+
+ private RangeDataManager rangeDataManager = RangeDataManager.getInstance();
+
+ public abstract void parseLogPackage(LogPackage logPack);
+
+ public DAChartBoardItem createBoardItem(final DAChartBoard chartBoard) {
+ DAChartBoardItem item = new DAChartBoardItem(chartBoard, chartName,
+ chartIcon, chartStyle);
+ chart = item.getChart();
+
+ setChartStyle();
+
+ popupMenu = new DAContextMenu(chart);
+ final DAContextMenuItem startItem = new DAContextMenuItem(popupMenu);
+ startItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_START);
+ startItem.addClickListener(new DAContextMenuListener() {
+ @Override
+ public void widgetSelected(DAContextMenuItem menuItem) {
+ double startTime = startItem.getRangeTime();
+
+ chartBoard.setRangeStartTime(startTime);
+ rangeDataManager.setStartTime((long) (startTime * 1000000));
+ }
+ });
+
+ final DAContextMenuItem endItem = new DAContextMenuItem(popupMenu);
+ endItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_END);
+ endItem.addClickListener(new DAContextMenuListener() {
+ @Override
+ public void widgetSelected(DAContextMenuItem menuItem) {
+ double endTime = endItem.getRangeTime();
+
+ chartBoard.setRangeEndTime(endTime);
+ rangeDataManager.setEndTime((long) (endTime * 1000000));
+ }
+ });
+
+ DAContextMenuItem analysisItem = new DAContextMenuItem(popupMenu);
+ analysisItem.setText(TimelineChartLabels.RANGE_CONTEXT_ANALYSIS);
+ analysisItem.addClickListener(new DAContextMenuListener() {
+ @Override
+ public void widgetSelected(DAContextMenuItem menuItem) {
+ rangeDataManager.startRangeAnalysis();
+ }
+ });
+
+ DAContextMenuItem clearItem = new DAContextMenuItem(popupMenu);
+ clearItem.setText(TimelineChartLabels.RANGE_CONTEXT_CLEAR);
+ clearItem.addClickListener(new DAContextMenuListener() {
+ @Override
+ public void widgetSelected(DAContextMenuItem menuItem) {
+ chartBoard.setRangeStartTime(-1);
+ chartBoard.setRangeEndTime(-1);
+
+ rangeDataManager.initRange();
+ }
+ });
+
+ return item;
+ }
+
+ public void clear() {
+ List<DAChartSeries> seriesList = chart.getSeriesList();
+ for (DAChartSeries series : seriesList) {
+ series.clear();
+ }
+ }
+
+ public List<DAChartSeries> getBaseDASeriesList() {
+ return chart.getSeriesList();
+ }
+
+ protected void setChartStyle() {
+ DAChartPlot plot = chart.getPlot();
+ if (null == plot) {
+ return;
+ }
+ plot.setBackgroundImage(ImageResources.BG_GRADIENT);
+ plot.setAutoHeightRange(true);
+ DAChartPlotTooltip tooltip = new DAChartPlotTooltip(-1);
+ tooltip.setFont(FontResources.CHART_TOOLTIP_FONT);
+ plot.setTooltip(tooltip);
+ plot.setAxisFont(FontResources.CHART_AXIS_FONT);
+ }
+
+ public void update() {
+ if (chart != null && !chart.isDisposed()) {
+ chart.redraw();
+ }
+ }
+
+ public int getChartType() {
+ return chartType;
+ }
+
+ public String getChartName() {
+ return chartName;
+ }
+
+ public Image getChartIcon() {
+ return chartIcon;
+ }
+
+ public Image getAddIcon() {
+ return addIcon;
+ }
+
+ public int getProbeType() {
+ return probeType;
+ }
+
+ public DAContextMenu getPopupMenu() {
+ return popupMenu;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.timeline.chart;
+
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.logparser.Logs;
+import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuItem;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuListener;
+
+public class UIEventChart extends TimelineChart {
+ private static UIEventChart instance = null;
+
+ private DAChartSeries keyEventSeries;
+ private DAChartSeries touchEventSeries;
+ private DAChartSeries gestureEventSeries;
+ private DAChartSeries orientationEventSeries;
+
+ private final int TYPE_KEY = 1;
+ private final int TYPE_TOUCH = 2;
+ private final int TYPE_GESTURE = 3;
+ private final int TYPE_ORIENTATION = 4;
+
+ private final int GESTURE_TYPE_FLICK = 0;
+ private final int GESTURE_TYPE_LONG_PRESS = 1;
+ private final int GESTURE_TYPE_PANNING = 2;
+ private final int GESTURE_TYPE_PINCH = 3;
+ private final int GESTURE_TYPE_ROTATION = 4;
+ private final int GESTURE_TYPE_TAP = 5;
+
+ private final String NEW_LINE = CommonConstants.NEW_LINE;
+ private final String KEY_UP = "up"; //$NON-NLS-1$
+ private final String KEY_DOWN = "down"; //$NON-NLS-1$
+
+ public static UIEventChart getInstance() {
+ if (instance == null) {
+ instance = new UIEventChart();
+ }
+
+ return instance;
+ }
+
+ private UIEventChart() {
+ chartType = TimelineConstants.CHART_TYPE_UIEVENT;
+ chartStyle = DAChart.CHART_STYLE_MULTI;
+ probeType = LogCenterConstants.LOG_RECODER;
+ chartName = TimelineChartLabels.UI_EVENT_CHART_TITLE;
+ chartIcon = ImageResources.CHART_UI_EVENT;
+ addIcon = ImageResources.ADD_CHART_UI_EVENT;
+
+ keyEventSeries = new DAChartSeries(
+ TimelineChartLabels.UI_EVENT_CHART_SERIES_NAME_KEY,
+ DAChartSeries.SERIES_STYLE_MULTY_CHECK_BAR,
+ ColorResources.SERIES_COLOR_UI_EVENT_KEY);
+ touchEventSeries = new DAChartSeries(
+ TimelineChartLabels.UI_EVENT_CHART_SERIES_NAME_TOUCH,
+ DAChartSeries.SERIES_STYLE_MULTY_CHECK_BAR,
+ ColorResources.SERIES_COLOR_UI_EVENT_TOUCH);
+ gestureEventSeries = new DAChartSeries(
+ TimelineChartLabels.UI_EVENT_CHART_SERIES_NAME_GESTURE,
+ DAChartSeries.SERIES_STYLE_MULTY_CHECK_BAR,
+ ColorResources.SERIES_COLOR_UI_EVENT_GESTURE);
+ orientationEventSeries = new DAChartSeries(
+ TimelineChartLabels.UI_EVENT_CHART_SERIES_NAME_ORIENTATION,
+ DAChartSeries.SERIES_STYLE_MULTY_CHECK_BAR,
+ ColorResources.SERIES_COLOR_UI_EVENT_ORIENTATION);
+
+ keyEventSeries.setFont(FontResources.TIMELINE_UIEVENT_FONT);
+ touchEventSeries.setFont(FontResources.TIMELINE_UIEVENT_FONT);
+ gestureEventSeries.setFont(FontResources.TIMELINE_UIEVENT_FONT);
+ orientationEventSeries.setFont(FontResources.TIMELINE_UIEVENT_FONT);
+ }
+
+ @Override
+ public DAChartBoardItem createBoardItem(DAChartBoard board) {
+ DAChartBoardItem item = super.createBoardItem(board);
+
+ final DAContextMenuItem eventListItem = new DAContextMenuItem(popupMenu);
+ eventListItem.setText(TimelineChartLabels.RANGE_CONTEXT_EVENT_LIST);
+ eventListItem.addClickListener(new DAContextMenuListener() {
+ @Override
+ public void widgetSelected(DAContextMenuItem menuItem) {
+ // TODO show eventList
+ int startIndex = eventListItem.getEventListStartintdex();
+ int endIndex = eventListItem.getEventListStartintdex();
+ int seriseIndex = eventListItem.getSeriesIndex();
+
+ if (startIndex < 0 || endIndex < 0 || seriseIndex < 0) {
+ return;
+ }
+
+ DAChartSeries series = chart.getSeries(seriseIndex);
+ series.getSeriesItemList().subList(startIndex, endIndex);
+ }
+ });
+ item.useExpand(false);
+
+ chart.addSeries(keyEventSeries);
+ chart.addSeries(touchEventSeries);
+ chart.addSeries(gestureEventSeries);
+ chart.addSeries(orientationEventSeries);
+
+ setChartStyle();
+
+ return item;
+ }
+
+ @Override
+ public void parseLogPackage(LogPackage logPack) {
+ Logs logs = logPack.getLogs(probeType);
+ List<List<String>> logList = logs.getLogs();
+
+ for (List<String> log : logList) {
+ parsingLog(log);
+ }
+ }
+
+ private void parsingLog(List<String> log) {
+ try {
+ double time = Double.parseDouble(log
+ .get(LogCenterConstants.TIME_INDEX))
+ / TimelineConstants.MEGA;
+ int detailType;
+ int type = Integer.parseInt(log
+ .get(LogCenterConstants.UI_EVENT_EVENT_TYPE));
+ String info;
+ switch (type) {
+ case TYPE_KEY:
+ String keyStatus;
+ String keyName = log.get(LogCenterConstants.UI_EVENT_INFO1);
+ detailType = Integer.parseInt(log
+ .get(LogCenterConstants.UI_EVENT_DETAIL_TYPE));
+ if (detailType == 0) {
+ keyStatus = KEY_DOWN;
+ } else {
+ keyStatus = KEY_UP;
+ }
+ keyEventSeries.addSeriesItem(new DAChartSeriesItem(time, 0,
+ keyName + CommonConstants.SPACE + keyStatus));
+ break;
+ case TYPE_TOUCH:
+ detailType = Integer.parseInt(log
+ .get(LogCenterConstants.UI_EVENT_DETAIL_TYPE));
+ info = EnumTouchStatus.values()[detailType].getStatus()
+ + NEW_LINE + "X : "//$NON-NLS-1$
+ + log.get(LogCenterConstants.UI_EVENT_X) + " Y : "//$NON-NLS-1$
+ + log.get(LogCenterConstants.UI_EVENT_Y);
+ touchEventSeries.addSeriesItem(new DAChartSeriesItem(time, 0,
+ info));
+ break;
+ case TYPE_GESTURE:
+ detailType = Integer.parseInt(log
+ .get(LogCenterConstants.UI_EVENT_DETAIL_TYPE));
+ gestureEventSeries.addSeriesItem(new DAChartSeriesItem(time, 0,
+ getGestureInfo(detailType, log)));
+ break;
+ case TYPE_ORIENTATION:
+ int status = Integer.parseInt(log
+ .get(LogCenterConstants.UI_EVENT_INFO1));
+ orientationEventSeries.addSeriesItem(new DAChartSeriesItem(
+ time, 0, TimelineChartLabels.UIEVENT_ORIENTATION
+ + " "//$NON-NLS-1$
+ + EnumOrientationStatus.values()[status]
+ .getStatus()));
+ break;
+ default:
+ System.out.println("UIEventChart.java : event type error");//$NON-NLS-1$
+ return;
+ }
+ } catch (NumberFormatException ne) {
+ ne.printStackTrace();
+ }
+ }
+
+ private enum EnumTouchStatus {
+ PRESSED(TimelineChartLabels.UIEVENT_TOUCH_LONG_PRESSED), LONG_PRESSED(
+ TimelineChartLabels.UIEVENT_TOUCH_LONG_PRESSED), RELEASED(
+ TimelineChartLabels.UIEVENT_TOUCH_RELEASED), MOVED(
+ TimelineChartLabels.UIEVENT_TOUCH_MOVED), DOUBLE_PRESSED(
+ TimelineChartLabels.UIEVENT_TOUCH_DOUBLE_PRESSED), FOCUS_IN(
+ TimelineChartLabels.UIEVENT_TOUCH_FOCUS_IN), FOCUS_OUT(
+ TimelineChartLabels.UIEVENT_TOUCH_FOCUS_OUT), CANCELED(
+ TimelineChartLabels.UIEVENT_TOUCH_CANCELED);
+
+ private String status;
+
+ private EnumTouchStatus(String status) {
+ this.status = status;
+ }
+
+ private String getStatus() {
+ return status;
+ }
+ }
+
+ private enum EnumOrientationStatus {
+ NONE(TimelineChartLabels.UIEVENT_ORIENTATION_NONE), PORTRAIT(
+ TimelineChartLabels.UIEVENT_ORIENTATION_PORTRAIT), LANDSCAPE(
+ TimelineChartLabels.UIEVENT_ORIENTATION_LANDSCAPE), PORTRAIT_REVERSE(
+ TimelineChartLabels.UIEVENT_ORIENTATION_PORTRAIT_REVERSE), LANDSCAPE_REVERSE(
+ TimelineChartLabels.UIEVENT_ORIENTATION_LANDSCAPE_REVERSE);
+
+ private String status;
+
+ private EnumOrientationStatus(String status) {
+ this.status = status;
+ }
+
+ private String getStatus() {
+ return status;
+ }
+ }
+
+ private String getGestureInfo(int detailType, List<String> log) {
+ String info = CommonConstants.EMPTY;
+ switch (detailType) {
+ case GESTURE_TYPE_FLICK:
+ info = TimelineChartLabels.UIEVENT_GESTURE_FLICK
+ + " "//$NON-NLS-1$
+ + getFlickDirection(Integer.parseInt(log
+ .get(LogCenterConstants.UI_EVENT_INFO2)))
+ + NEW_LINE
+ + TimelineChartLabels.UIEVENT_INFO_DISTANCE
+ + " X : "//$NON-NLS-1$
+ + log.get(LogCenterConstants.UI_EVENT_X) + NEW_LINE
+ + TimelineChartLabels.UIEVENT_INFO_DISTANCE
+ + " Y : "//$NON-NLS-1$
+ + log.get(LogCenterConstants.UI_EVENT_Y) + NEW_LINE
+ + TimelineChartLabels.UIEVENT_INFO_DURATION + " : " //$NON-NLS-1$
+ + log.get(LogCenterConstants.UI_EVENT_INFO1);
+ break;
+ case GESTURE_TYPE_LONG_PRESS:
+ info = TimelineChartLabels.UIEVENT_GESTURE_LONG_PRESS
+ + " "//$NON-NLS-1$
+ + NEW_LINE
+ + TimelineChartLabels.UIEVENT_INFO_MOVE_ALLOWANCE
+ + " : "//$NON-NLS-1$
+ + log.get(LogCenterConstants.UI_EVENT_X) + NEW_LINE
+ + TimelineChartLabels.UIEVENT_INFO_TOUCH_COUNT
+ + " : "//$NON-NLS-1$
+ + log.get(LogCenterConstants.UI_EVENT_INFO2) + NEW_LINE
+ + TimelineChartLabels.UIEVENT_INFO_DURATION + " : " //$NON-NLS-1$
+ + log.get(LogCenterConstants.UI_EVENT_INFO1);
+ break;
+ case GESTURE_TYPE_PANNING:
+ info = TimelineChartLabels.UIEVENT_GESTURE_PANNING + NEW_LINE
+ + TimelineChartLabels.UIEVENT_INFO_TOUCH_COUNT + " : "//$NON-NLS-1$
+ + log.get(LogCenterConstants.UI_EVENT_INFO2);
+ break;
+ case GESTURE_TYPE_PINCH:
+ info = TimelineChartLabels.UIEVENT_GESTURE_PINCH
+ + NEW_LINE
+ + TimelineChartLabels.UIEVENT_INFO_CENTER
+ + " X : "//$NON-NLS-1$
+ + log.get(LogCenterConstants.UI_EVENT_X) + NEW_LINE
+ + TimelineChartLabels.UIEVENT_INFO_CENTER
+ + " Y : "//$NON-NLS-1$
+ + log.get(LogCenterConstants.UI_EVENT_Y) + NEW_LINE
+ + TimelineChartLabels.UIEVENT_INFO_DISTANCE + " : "//$NON-NLS-1$
+ + log.get(LogCenterConstants.UI_EVENT_INFO1);
+ break;
+ case GESTURE_TYPE_ROTATION:
+ info = TimelineChartLabels.UIEVENT_GESTURE_ROTATION + NEW_LINE
+ + TimelineChartLabels.UIEVENT_INFO_DISTANCE
+ + " : "//$NON-NLS-1$
+ + log.get(LogCenterConstants.UI_EVENT_INFO1)
+ + TimelineChartLabels.UIEVENT_INFO_ANGLE + " : "//$NON-NLS-1$
+ + log.get(LogCenterConstants.UI_EVENT_INFO2);
+ break;
+ case GESTURE_TYPE_TAP:
+ info = TimelineChartLabels.UIEVENT_GESTURE_TAP
+ + " "//$NON-NLS-1$
+ + TimelineChartLabels.UIEVENT_INFO_COUNT
+ + " : "//$NON-NLS-1$
+ + log.get(LogCenterConstants.UI_EVENT_Y)
+ + NEW_LINE
+ + TimelineChartLabels.UIEVENT_INFO_MOVE_ALLOWANCE
+ + " : "//$NON-NLS-1$
+ + log.get(LogCenterConstants.UI_EVENT_X) + NEW_LINE
+ + TimelineChartLabels.UIEVENT_INFO_TAP_INTERVAL
+ + " : "//$NON-NLS-1$
+ + log.get(LogCenterConstants.UI_EVENT_INFO1) + NEW_LINE
+ + TimelineChartLabels.UIEVENT_INFO_TOUCH_COUNT + " : "//$NON-NLS-1$
+ + log.get(LogCenterConstants.UI_EVENT_INFO2);
+ break;
+ default:
+ System.out.println("UIEventChart.java wrong gesture type");//$NON-NLS-1$
+ }
+
+ return info;
+ }
+
+ private String getFlickDirection(int num) {
+ String info2;
+ switch (num) {
+ case 0:
+ info2 = TimelineChartLabels.UIEVENT_FLICK_DIRECTION_RIGHT;
+ break;
+ case 1:
+ info2 = TimelineChartLabels.UIEVENT_FLICK_DIRECTION_UP;
+ break;
+ case 2:
+ info2 = TimelineChartLabels.UIEVENT_FLICK_DIRECTION_LEFT;
+ break;
+ case 3:
+ info2 = TimelineChartLabels.UIEVENT_FLICK_DIRECTION_DOWN;
+ break;
+ default:
+ info2 = CommonConstants.EMPTY;
+ }
+
+ return info2;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.timeline.chart;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.logparser.Logs;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
+
+public class UserCustomChart extends TimelineChart {
+ private ArrayList<DAChartSeries> tempSeriesList;
+ private boolean[] usedColor;
+
+ public UserCustomChart(int chartType, String chartName) {
+ this.chartType = chartType;
+ this.chartName = chartName;
+ chartIcon = ImageResources.CHART_CUSTOM;
+ addIcon = ImageResources.ADD_CHART_CUSTOM;
+
+ tempSeriesList = new ArrayList<DAChartSeries>();
+ usedColor = new boolean[11];
+ }
+
+ @Override
+ public DAChartBoardItem createBoardItem(DAChartBoard board) {
+ List<DAChartSeries> seriesList = null;
+ if (chart != null) {
+ seriesList = chart.getSeriesList();
+ }
+
+ DAChartBoardItem item = super.createBoardItem(board);
+
+ if (seriesList != null) {
+ for (DAChartSeries series : seriesList) {
+ chart.addSeries(series);
+ }
+ }
+
+ return item;
+ }
+
+ @Override
+ public void parseLogPackage(LogPackage logPack) {
+ Logs logList = logPack.getLogs(LogCenterConstants.LOG_DEVICE);
+ List<List<String>> logs = logList.getLogs();
+
+ if (logs.size() <= 0) {
+ return;
+ }
+ parsingLog(logs.get(logs.size() - 1));
+ }
+
+ private void parsingLog(List<String> log) {
+ try {
+ double time = Double.parseDouble(log
+ .get(LogCenterConstants.DEVICE_TIME_INDEX))
+ / TimelineConstants.MEGA;
+ chart.getPlot().setValidEndX(time);
+ } catch (NumberFormatException ne) {
+ ne.printStackTrace();
+ }
+ }
+
+ public void addSeries(DAChartSeries series) {
+ chart.addSeries(series);
+ }
+
+ public void addTempSeries(DAChartSeries series, int colorIndex) {
+ tempSeriesList.add(series);
+ usedColor[colorIndex] = true;
+ }
+
+ public ArrayList<DAChartSeries> getTempSeries() {
+ return tempSeriesList;
+ }
+
+ public int getSeriesNum() {
+ return chart.getSeriesList().size();
+ }
+
+ @Override
+ public List<DAChartSeries> getBaseDASeriesList() {
+ if (chart != null) {
+ return chart.getSeriesList();
+ }
+
+ return null;
+ }
+
+ public DAChart getChart() {
+ return chart;
+ }
+
+ public int getUnusedColorIndex() {
+ for (int i = 1; i < usedColor.length; i++) {
+ boolean status = usedColor[i];
+ if (!status) {
+ return i;
+ }
+ }
+
+ return 0;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.timeline.common;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
+
+public class AddChartMenuComposite extends Composite {
+ private DACustomButton addItems;
+
+ public AddChartMenuComposite(Composite parent) {
+ super(parent, SWT.NONE);
+
+ createAddMenuComp();
+ }
+
+ private DACustomButtonClickEventListener addItemListButtonListener = new DACustomButtonClickEventListener() {
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
+ TimelineEditItemsDialog dialog = new TimelineEditItemsDialog(shell,
+ SWT.None);
+ if (dialog.isRunningDialog() == false) {
+ dialog.open();
+ }
+ }
+ };
+
+ private void createAddMenuComp() {
+ setBackground(ColorResources.VIEW_BG_COLOR);
+
+ GridLayout gLayout = new GridLayout(3, false);
+ gLayout.marginWidth = 0;
+ gLayout.marginHeight = 0;
+ gLayout.horizontalSpacing = 0;
+ gLayout.verticalSpacing = 0;
+ setLayout(gLayout);
+
+ /* Add Chart Button */
+ createAddButton();
+ }
+
+ private void createAddButton() {
+ Composite addItemComp = new Composite(this, SWT.None);
+ GridLayout gLayout = new GridLayout(2, false);
+ gLayout.marginWidth = 0;
+ gLayout.marginHeight = 0;
+ gLayout.horizontalSpacing = 0;
+ gLayout.verticalSpacing = 0;
+ addItemComp.setLayout(gLayout);
+ addItemComp.setBackground(ColorResources.VIEW_BG_COLOR);
+
+ addItems = new DACustomButton(addItemComp,
+ ImageResources.ADD_ITEMS_NORMAL, ImageResources.ADD_ITEMS_PUSH,
+ ImageResources.ADD_ITEMS_HOVER, null);
+ addItems.setTitle(TimelineChartLabels.TIMELINE_TICK_ADD);
+ addItems.setFontPoint(new Point(45, 4));
+ addItems.setFontColors(ColorResources.DEFAULT_FONT_COLOR,
+ ColorResources.DEFAULT_FONT_COLOR,
+ ColorResources.DEFAULT_FONT_COLOR,
+ ColorResources.DEFAULT_FONT_COLOR);
+ addItems.setFont(FontResources.ADDITEM_BUTTON_FONT);
+
+ GridData gDataAddBtn = new GridData();
+ gDataAddBtn.horizontalAlignment = GridData.FILL;
+ gDataAddBtn.grabExcessHorizontalSpace = true;
+ gDataAddBtn.verticalAlignment = GridData.FILL;
+ gDataAddBtn.grabExcessVerticalSpace = true;
+ addItems.setLayoutData(gDataAddBtn);
+ addItems.addClickListener(addItemListButtonListener);
+
+ GridData gDataInfo = new GridData();
+ gDataInfo.widthHint = TimelineConstants.TIMELINE_ITEM_INFO_WIDTH;
+ gDataInfo.verticalAlignment = GridData.FILL;
+ gDataInfo.grabExcessVerticalSpace = true;
+ addItemComp.setLayoutData(gDataInfo);
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.timeline.common;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
+import org.tizen.dynamicanalyzer.ui.timeline.chart.CPUChart;
+import org.tizen.dynamicanalyzer.ui.timeline.chart.CPUCoreChart;
+import org.tizen.dynamicanalyzer.ui.timeline.chart.CPUFrequencyChart;
+import org.tizen.dynamicanalyzer.ui.timeline.chart.FileChart;
+import org.tizen.dynamicanalyzer.ui.timeline.chart.HeapChart;
+import org.tizen.dynamicanalyzer.ui.timeline.chart.ProcessMemoryChart;
+import org.tizen.dynamicanalyzer.ui.timeline.chart.ScreenshotChart;
+import org.tizen.dynamicanalyzer.ui.timeline.chart.SystemMemoryChart;
+import org.tizen.dynamicanalyzer.ui.timeline.chart.TimelineChart;
+import org.tizen.dynamicanalyzer.ui.timeline.chart.UIEventChart;
+import org.tizen.dynamicanalyzer.ui.timeline.chart.UserCustomChart;
+import org.tizen.dynamicanalyzer.ui.timeline.eventlistener.TimelineChartMouseAdapter;
+import org.tizen.dynamicanalyzer.ui.timeline.eventlistener.TimelineChartMouseMoveListener;
+import org.tizen.dynamicanalyzer.ui.timeline.eventlistener.TimelineChartMouseTrackAdapter;
+import org.tizen.dynamicanalyzer.ui.toolbar.ConfigureManager;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
+
+public class TimelineChartManager {
+ private static TimelineChartManager instance = null;
+
+ private boolean newCustomChart = false;
+ private List<TimelineChart> chartList;
+ private ArrayList<TimelineChart> newChartList;
+ private List<TimelineChart> selectedChartList;
+ private HashMap<Integer, UserCustomChart> customChartMap;
+ private DAChartBoard chartBoard = null;
+
+ public static TimelineChartManager getInstance() {
+ if (instance == null) {
+ instance = new TimelineChartManager();
+ }
+ return instance;
+ }
+
+ private TimelineChartManager() {
+ chartList = new ArrayList<TimelineChart>();
+ newChartList = new ArrayList<TimelineChart>();
+ selectedChartList = new ArrayList<TimelineChart>();
+ customChartMap = new HashMap<Integer, UserCustomChart>();
+
+ loadSavedChartList();
+ loadSelectedChartList();
+ }
+
+ public void setChartTimelineChartBoard(DAChartBoard board) {
+ chartBoard = board;
+ }
+
+ private void loadSavedChartList() {
+ String savedChartNameList = ConfigureManager.getInstance().getValue(
+ ConfigureLabels.CONFIGUREMANAGER_CHART_AVAILABLE_ITEM_LIST);
+ String[] chartNameList = savedChartNameList.split(","); //$NON-NLS-1$
+ int size = chartNameList.length;
+
+ if (size > 1) {
+ for (int i = 0; i < size; i++) {
+ TimelineChart chart = getChartInstance(chartNameList[i]);
+ if (chart != null) {
+ chartList.add(chart);
+ }
+ }
+ } else {
+ chartList.add(CPUChart.getInstance());
+ chartList.add(CPUCoreChart.getInstance());
+ chartList.add(CPUFrequencyChart.getInstance());
+ chartList.add(HeapChart.getInstance());
+ chartList.add(ProcessMemoryChart.getInstance());
+ chartList.add(SystemMemoryChart.getInstance());
+ chartList.add(FileChart.getInstance());
+ chartList.add(ScreenshotChart.getInstance());
+ chartList.add(UIEventChart.getInstance());
+ }
+ }
+
+ private void loadSelectedChartList() {
+ String strSaveSelectedItems = ConfigureManager.getInstance().getValue(
+ ConfigureLabels.CONFIGUREMANAGER_CHART_SELECTED_ITEM_LIST);
+ if (strSaveSelectedItems.equalsIgnoreCase("")) {//$NON-NLS-1$
+ selectedChartList.addAll(chartList);
+ } else {
+ String[] savedSelectedChartNameList = strSaveSelectedItems
+ .split(","); //$NON-NLS-1$
+ int size = savedSelectedChartNameList.length;
+ if (size != 0) {
+ for (int i = 0; i < size; i++) {
+ TimelineChart chart = getChartInstance(savedSelectedChartNameList[i]);
+ if (chart != null) {
+ selectedChartList.add(chart);
+ }
+ }
+ }
+ }
+ }
+
+ public void setChartList(List<TimelineChart> chartList) {
+ this.chartList.clear();
+ this.chartList.addAll(chartList);
+ }
+
+ public void setSelectedChartList(List<TimelineChart> chartList) {
+ this.selectedChartList.clear();
+ this.selectedChartList.addAll(chartList);
+ }
+
+ public List<TimelineChart> getChartList() {
+ return chartList;
+ }
+
+ public List<TimelineChart> getSelectedChartList() {
+ return selectedChartList;
+ }
+
+ private int getChartType(String string) {
+ if (string.equals(getChartName(TimelineConstants.CHART_TYPE_CPU))) {
+ return TimelineConstants.CHART_TYPE_CPU;
+ } else if (string
+ .equals(getChartName(TimelineConstants.CHART_TYPE_CPU_CORE))) {
+ return TimelineConstants.CHART_TYPE_CPU_CORE;
+ } else if (string
+ .equals(getChartName(TimelineConstants.CHART_TYPE_CPU_FREQUENCY))) {
+ return TimelineConstants.CHART_TYPE_CPU_FREQUENCY;
+ } else if (string
+ .equals(getChartName(TimelineConstants.CHART_TYPE_HEAP))) {
+ return TimelineConstants.CHART_TYPE_HEAP;
+ } else if (string
+ .equals(getChartName(TimelineConstants.CHART_TYPE_PROCESS_MEMORY))) {
+ return TimelineConstants.CHART_TYPE_PROCESS_MEMORY;
+ } else if (string
+ .equals(getChartName(TimelineConstants.CHART_TYPE_SYSTEM_MEMORY))) {
+ return TimelineConstants.CHART_TYPE_SYSTEM_MEMORY;
+ } else if (string
+ .equals(getChartName(TimelineConstants.CHART_TYPE_FILE))) {
+ return TimelineConstants.CHART_TYPE_FILE;
+ } else if (string
+ .equals(getChartName(TimelineConstants.CHART_TYPE_SCREENSHOT))) {
+ return TimelineConstants.CHART_TYPE_SCREENSHOT;
+ } else if (string
+ .equals(getChartName(TimelineConstants.CHART_TYPE_UIEVENT))) {
+ return TimelineConstants.CHART_TYPE_UIEVENT;
+ } else {
+ return TimelineConstants.NOT_DEFAULT_CHART;
+ }
+ }
+
+ private String getChartName(int chartType) {
+ return getChartInstance(chartType).getChartName();
+ }
+
+ private TimelineChart getChartInstance(String chartName) {
+ return getChartInstance(getChartType(chartName));
+ }
+
+ public TimelineChart getChartInstance(int chartType) {
+ switch (chartType) {
+ case TimelineConstants.NOT_DEFAULT_CHART:
+ return null;
+ case TimelineConstants.CHART_TYPE_CPU:
+ return CPUChart.getInstance();
+ case TimelineConstants.CHART_TYPE_CPU_CORE:
+ return CPUCoreChart.getInstance();
+ case TimelineConstants.CHART_TYPE_CPU_FREQUENCY:
+ return CPUFrequencyChart.getInstance();
+ case TimelineConstants.CHART_TYPE_HEAP:
+ return HeapChart.getInstance();
+ case TimelineConstants.CHART_TYPE_PROCESS_MEMORY:
+ return ProcessMemoryChart.getInstance();
+ case TimelineConstants.CHART_TYPE_SYSTEM_MEMORY:
+ return SystemMemoryChart.getInstance();
+ case TimelineConstants.CHART_TYPE_FILE:
+ return FileChart.getInstance();
+ case TimelineConstants.CHART_TYPE_SCREENSHOT:
+ return ScreenshotChart.getInstance();
+ case TimelineConstants.CHART_TYPE_UIEVENT:
+ return UIEventChart.getInstance();
+ default:
+ return customChartMap.get(chartType);
+ }
+ }
+
+ public void addCustomChart(UserCustomChart customChart) {
+ int chartType = customChart.getChartType();
+ if (!customChartMap.containsKey(chartType)) {
+ customChartMap.put(chartType, customChart);
+ chartList.add(customChart);
+ if (!newCustomChart) {
+ newChartList.clear();
+ }
+ newChartList.add(customChart);
+ newCustomChart = true;
+
+ StringBuffer strSaveChartNameList = new StringBuffer(""); //$NON-NLS-1$
+
+ for (int i = 0; i < chartList.size(); i++) {
+ strSaveChartNameList.append(chartList.get(i).getChartName());
+ strSaveChartNameList.append(","); //$NON-NLS-1$
+ }
+
+ ConfigureManager.getInstance().setValue(
+ ConfigureLabels.CONFIGUREMANAGER_CHART_AVAILABLE_ITEM_LIST,
+ strSaveChartNameList.toString());
+ }
+ }
+
+ public List<DAChartSeries> getDAChartSeriesList(int chartType) {
+ return getChartInstance(chartType).getBaseDASeriesList();
+ }
+
+ @SuppressWarnings("unchecked")
+ public void addNewCustomChart() {
+ if (newCustomChart) {
+ List<TimelineChart> newChartList = (List<TimelineChart>) this.newChartList
+ .clone();
+ this.newChartList.clear();
+ newCustomChart = false;
+ for (TimelineChart chart : newChartList) {
+ selectedChartList.add(chart);
+ DAChartBoardItem item = chart.createBoardItem(chartBoard);
+ DAChartPlotIntervalMarker intervalMarker = chartBoard
+ .getIntervalMarker();
+
+ DAChart chartWidget = item.getChart();
+ chartWidget.getPlot().setAxisRangeX(
+ chartBoard.getVisibleStartTime(),
+ chartBoard.getVisibleEndTime());
+
+ chartWidget.getPlot().setIntervalMarker(intervalMarker);
+ chartWidget.addMouseListener(new TimelineChartMouseAdapter(chart.getPopupMenu()));
+ chartWidget
+ .addMouseMoveListener(new TimelineChartMouseMoveListener(
+ chartBoard.getTimeline()));
+ chartWidget
+ .addMouseTrackListener(new TimelineChartMouseTrackAdapter(
+ chartBoard.getTimeline()));
+ }
+
+ StringBuffer selectedChartNameList = new StringBuffer(""); //$NON-NLS-1$
+ for (TimelineChart selectedChart : selectedChartList) {
+ selectedChartNameList.append(selectedChart.getChartName());
+ selectedChartNameList.append(","); //$NON-NLS-1$
+ }
+ ConfigureManager.getInstance().setValue(
+ ConfigureLabels.CONFIGUREMANAGER_CHART_SELECTED_ITEM_LIST,
+ selectedChartNameList.toString());
+
+ // AnalyzerUtil.getTimelineComposite().resetItems();
+ }
+
+ for (TimelineChart timelineChart : chartList) {
+ if (timelineChart instanceof UserCustomChart) {
+ UserCustomChart customChart = (UserCustomChart) timelineChart;
+ ArrayList<DAChartSeries> tempSeriesList = (ArrayList<DAChartSeries>) customChart
+ .getTempSeries().clone();
+ ((UserCustomChart) timelineChart).getTempSeries().clear();
+ for (DAChartSeries series : tempSeriesList) {
+ customChart.addSeries(series);
+ }
+ }
+
+ timelineChart.update();
+ }
+ }
+
+ public void clear() {
+ if (null == chartList || 0 == chartList.size()) {
+ return;
+ }
+
+ for (TimelineChart timelineChart : chartList) {
+ timelineChart.clear();
+ }
+
+ chartList.clear();
+ selectedChartList.clear();
+ loadSavedChartList();
+ loadSelectedChartList();
+ customChartMap.clear();
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.timeline.common;
+
+public class TimelineConstants {
+ /* timeline Item type */
+ public static final int NOT_DEFAULT_CHART = -100;
+ public static final int CHART_TYPE_CPU = -101;
+ public static final int CHART_TYPE_CPU_CORE = -102;
+ public static final int CHART_TYPE_CPU_FREQUENCY = -103;
+ public static final int CHART_TYPE_HEAP = -104;
+ public static final int CHART_TYPE_PROCESS_MEMORY = -105;
+ public static final int CHART_TYPE_SYSTEM_MEMORY = -106;
+ public static final int CHART_TYPE_FILE = -107;
+ public static final int CHART_TYPE_SCREENSHOT = -108;
+ public static final int CHART_TYPE_UIEVENT = -109;
+
+ /* range selector */
+ public static final int TIMELINE_ITEM_INFO_WIDTH = 99;
+
+ public static final double MEGA = 1000000;
+
+ public static final int NOT_INITED = -1;
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.timeline.common;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DragSource;
+import org.eclipse.swt.dnd.DragSourceAdapter;
+import org.eclipse.swt.dnd.DragSourceEvent;
+import org.eclipse.swt.dnd.DropTarget;
+import org.eclipse.swt.dnd.DropTargetAdapter;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.ShellEvent;
+import org.eclipse.swt.events.ShellListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.tizen.dynamicanalyzer.common.DesignConstants;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
+import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.timeline.chart.TimelineChart;
+import org.tizen.dynamicanalyzer.ui.toolbar.ConfigureManager;
+import org.tizen.dynamicanalyzer.ui.widgets.DAButton;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
+
+public class TimelineEditItemsDialog extends Dialog {
+
+ private Shell parent = null;
+ private Shell shell = null;
+ private TableViewer chartTableViewer;
+ private boolean chartChangeSatus = true;
+
+ private TimelineChartManager chartManager = TimelineChartManager
+ .getInstance();
+
+ private boolean DragItemStartPlg = true;
+ private int SwapItemIndexA = 0;
+ private int SwapItemIndexB = 0;
+ private int ChangeDragItemIndex = 0;
+
+ private final String strEnableChart = "selected enable"; //$NON-NLS-1$
+ private final String strDisableChart = "selected disable"; //$NON-NLS-1$
+
+ private static boolean RunningDialog = false;
+
+ public TimelineEditItemsDialog(Shell parent, int style) {
+ super(parent);
+ this.parent = parent;
+ setShellStyle(getShellStyle() | SWT.MAX | SWT.RESIZE);
+ }
+ public boolean isRunningDialog(){
+ return RunningDialog;
+ }
+
+ private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ TableItem[] tableitems = chartTableViewer.getTable().getItems();
+ ArrayList<Integer> order = new ArrayList<Integer>();
+ ArrayList<Boolean> showInfo = new ArrayList<Boolean>();
+
+ List<TimelineChart> chartList = new ArrayList<TimelineChart>();
+ List<TimelineChart> selectedChartList = new ArrayList<TimelineChart>();
+
+ StringBuffer strSaveChartNameList = new StringBuffer(""); //$NON-NLS-1$
+ StringBuffer strSaveSelectedChartNameList = new StringBuffer(""); //$NON-NLS-1$
+
+ for (TableItem item : tableitems) {
+ int chartType = Integer.parseInt(item.getText(0));
+ chartList.add(chartManager.getChartInstance(chartType));
+
+ strSaveChartNameList.append(item.getText(2));
+ strSaveChartNameList.append(","); //$NON-NLS-1$
+
+ if (item.getText(3).equals(strEnableChart)) {
+ selectedChartList.add(chartManager
+ .getChartInstance(chartType));
+ strSaveSelectedChartNameList.append(item.getText(2));
+ strSaveSelectedChartNameList.append(","); //$NON-NLS-1$
+ showInfo.add(true);
+ } else {
+ showInfo.add(false);
+ }
+
+ order.add(Integer.parseInt(item.getText(4)));
+ }
+
+ for(int i = tableitems.length; i < chartManager.getChartList().size(); i++) {
+ chartList.add(chartManager.getChartList().get(i));
+ selectedChartList.add(chartManager.getChartList().get(i));
+ }
+
+ chartManager.setChartList(chartList);
+ chartManager.setSelectedChartList(selectedChartList);
+ AnalyzerUtil.getTimelineComposite().reArrangeChart(order, showInfo);
+
+ ConfigureManager.getInstance().setValue(
+ ConfigureLabels.CONFIGUREMANAGER_CHART_AVAILABLE_ITEM_LIST,
+ strSaveChartNameList.toString());
+ ConfigureManager.getInstance().setValue(
+ ConfigureLabels.CONFIGUREMANAGER_CHART_SELECTED_ITEM_LIST,
+ strSaveSelectedChartNameList.toString());
+ shell.dispose();
+ RunningDialog = false;
+ }
+ };
+
+ private DACustomButtonClickEventListener cancelButtonListener = new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ shell.dispose();
+ RunningDialog = false;
+ }
+ };
+
+ private ShellListener shellListener = new ShellListener() {
+
+ @Override
+ public void shellActivated(ShellEvent e) {
+ }
+
+ @Override
+ public void shellClosed(ShellEvent e) {
+ RunningDialog = false;
+ }
+
+ @Override
+ public void shellDeactivated(ShellEvent e) {
+ }
+
+ @Override
+ public void shellDeiconified(ShellEvent e) {
+ }
+
+ @Override
+ public void shellIconified(ShellEvent e) {
+ }
+
+ };
+
+ @Override
+ public int open() {
+ shell = new Shell(parent, SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM );
+ shell.setText(TimelineChartLabels.EDIT_CHART_DLG_TITLE);
+ shell.setBackground(ColorResources.WINDOW_BG_COLOR);
+ shell.setSize(446, 450);
+ shell.setLayout(new FormLayout());
+
+ GridLayout editoeLayout = new GridLayout();
+ Composite editorContainer = new Composite(shell, SWT.NONE);
+
+ editorContainer.setLayout(editoeLayout);
+
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.bottom = new FormAttachment(100, -49);
+ data.left = new FormAttachment(0, 0);
+ data.right = new FormAttachment(100, 0);
+ editorContainer.setLayoutData(data);
+ editorContainer.setBackground(ColorResources.EDIT_CHART_DIALOG_UPPER);
+ chartTableViewer = new TableViewer(editorContainer, SWT.MULTI
+ | SWT.FULL_SELECTION);
+ GridData tableGridData = new GridData(GridData.FILL_BOTH);
+ chartTableViewer.getTable().setLayoutData(tableGridData);
+ chartTableViewer.getTable().setLinesVisible(true);
+
+ new TableColumn(chartTableViewer.getTable(), SWT.NONE).setWidth(82);
+ new TableColumn(chartTableViewer.getTable(), SWT.NONE).setWidth(330);
+ new TableColumn(chartTableViewer.getTable(), SWT.NONE).setWidth(0);
+ new TableColumn(chartTableViewer.getTable(), SWT.NONE).setWidth(0);
+ new TableColumn(chartTableViewer.getTable(), SWT.NONE).setWidth(0);
+
+ final List<TimelineChart> chartList = chartManager.getChartList();
+ int chartListSize = chartList.size();
+ List<TimelineChart> selectedChartList = chartManager
+ .getSelectedChartList();
+
+ final TableItem[] items = new TableItem[chartListSize];
+ for (int i = 0; i < chartListSize; i++) {
+ items[i] = new TableItem(chartTableViewer.getTable(), SWT.NONE, i);
+ items[i].setText(0, String.valueOf(chartList.get(i).getChartType()));
+ items[i].setFont(FontResources.EDIT_CHART_DLG_ITEM_NAME);
+ items[i].setImage(0, ImageResources.ADD_CHART_CPU);
+ items[i].setText(1, " "); //$NON-NLS-1$
+ items[i].setText(2, chartList.get(i).getChartName());
+ items[i].setText(3, strDisableChart);
+ items[i].setText(4, String.valueOf(i));
+
+ for (int j = 0; j < selectedChartList.size(); j++) {
+ if (chartList.get(i).getChartType() == selectedChartList.get(j)
+ .getChartType()) {
+ items[i].setText(3, strEnableChart);
+ break;
+ }
+ }
+ }
+
+ Listener paintListener = new Listener() {
+ public void handleEvent(Event event) {
+ switch (event.type) {
+ case SWT.MeasureItem: {
+ TableItem item = (TableItem) event.item;
+ String text = item.getText(event.index + 1);
+ Point size = event.gc.textExtent(text);
+ event.width = size.x;
+ event.height = Math.max(event.height, size.y);
+
+ break;
+ }
+ case SWT.PaintItem: {
+ int width = chartTableViewer.getTable().getClientArea().width;
+
+ TableItem item = (TableItem) event.item;
+
+ String itemName = item.getText(event.index + 1);
+ Point size = event.gc.textExtent(itemName);
+ int offset2 = event.index == 0 ? Math.max(0,
+ (event.height - size.y) / 2) : 0;
+
+ String itemExplan = ""; //$NON-NLS-1$
+ size = event.gc.textExtent(itemExplan);
+ offset2 = event.index == 0 ? Math.max(0,
+ (event.height - size.y) / 2) : 0;
+
+ String strItemStatus = item.getText(3);
+
+ GC gc = event.gc;
+ event.gc.setAdvanced(true);
+ Rectangle rect = event.getBounds();
+ Color foreground = gc.getForeground();
+ Color background = gc.getBackground();
+ if (strItemStatus.equals(strEnableChart)) {
+ event.gc.setForeground(ColorResources.ADD_CHART_ENABLE_COLOR_START);
+ event.gc.setBackground(ColorResources.ADD_CHART_ENABLE_COLOR_END);
+ } else {
+ event.gc.setForeground(ColorResources.ADD_CHART_DISABLE_COLOR_START);
+ event.gc.setBackground(ColorResources.ADD_CHART_DISABLE_COLOR_END);
+
+ }
+
+ event.gc.fillGradientRectangle(0, rect.y, width, 66, true);
+ gc.setForeground(foreground);
+ gc.setBackground(background);
+ event.detail &= ~SWT.SELECTED;
+
+ if (strItemStatus.equals(strEnableChart)
+ && event.index == 1) {
+ event.gc.drawImage(ImageResources.ADD_CHART_ON, 374,
+ event.y + 6);
+ } else {
+ event.gc.drawImage(ImageResources.ADD_CHART_OFF, 374,
+ event.y + 6);
+ }
+
+ if (event.index == 0) {
+
+ if (strItemStatus.equals(strDisableChart)) {
+ event.gc.setAlpha(150);
+ }
+
+ Image addIcon = chartManager.getChartInstance(
+ Integer.parseInt(item.getText(0))).getAddIcon();
+ event.gc.drawImage(addIcon, 3, event.y);
+
+ } else if (event.index == 1) {
+ event.gc.drawText(itemName, event.x + 20, event.y
+ + offset2 + 24, true);
+ event.gc.setForeground(ColorResources.BLACK);
+ }
+
+ break;
+ }
+ case SWT.EraseItem: {
+ event.detail &= ~SWT.FOREGROUND;
+ break;
+ }
+ default:
+ break;
+ }
+ }
+ };
+ chartTableViewer.getTable().addListener(SWT.MeasureItem, paintListener);
+ chartTableViewer.getTable().addListener(SWT.PaintItem, paintListener);
+ chartTableViewer.getTable().addListener(SWT.EraseItem, paintListener);
+ chartTableViewer.getTable().addMouseListener(itemZoomMouseListener);
+
+ Transfer[] types = new Transfer[] { TextTransfer.getInstance() };
+ DragSource source = new DragSource(chartTableViewer.getTable(),
+ DND.DROP_MOVE | DND.DROP_COPY);
+ source.setTransfer(types);
+ source.addDragListener(new DragSourceAdapter() {
+ public void dragSetData(DragSourceEvent event) {
+ DragSource ds = (DragSource) event.widget;
+ Table table = (Table) ds.getControl();
+ TableItem[] selection = table.getSelection();
+ StringBuffer buff = new StringBuffer();
+ for (int i = 0, n = selection.length; i < n; i++) {
+ buff.append(selection[i].getText());
+ }
+ event.data = buff.toString();
+
+ chartChangeSatus = false;
+ }
+ });
+
+ DropTarget target = new DropTarget(chartTableViewer.getTable(),
+ DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_DEFAULT);
+ target.setTransfer(types);
+ target.addDropListener(new DropTargetAdapter() {
+ public void dragEnter(DropTargetEvent event) {
+
+ if (DragItemStartPlg == true) {
+ SwapItemIndexA = chartTableViewer.getTable()
+ .getSelectionIndex();
+ DragItemStartPlg = false;
+ }
+
+ if (event.detail == DND.DROP_DEFAULT) {
+ event.detail = (event.operations & DND.DROP_COPY) != 0 ? DND.DROP_COPY
+ : DND.DROP_NONE;
+ }
+ for (int i = 0, n = event.dataTypes.length; i < n; i++) {
+ if (TextTransfer.getInstance().isSupportedType(
+ event.dataTypes[i])) {
+ event.currentDataType = event.dataTypes[i];
+ }
+ }
+ }
+
+ public void dragOver(DropTargetEvent event) {
+ event.feedback = DND.FEEDBACK_SELECT | DND.FEEDBACK_SCROLL;
+
+ DropTarget target = (DropTarget) event.widget;
+ Table table = (Table) target.getControl();
+
+ Point point = shell.getDisplay().map(null, table, event.x,
+ event.y);
+ TableItem tblItemTarget = table.getItem(point);
+ if (tblItemTarget == null) {
+ return;
+ }
+
+ SwapItemIndexB = table.indexOf(tblItemTarget);
+
+ if (ChangeDragItemIndex != SwapItemIndexB) {
+ TableItem[] chartTableItems = chartTableViewer.getTable()
+ .getItems();
+
+ String strIndexA = null;
+ String strIndexB = null;
+
+ strIndexA = chartTableItems[SwapItemIndexA].getText(0);
+ strIndexB = chartTableItems[SwapItemIndexB].getText(0);
+
+ chartTableItems[SwapItemIndexB].setText(0, strIndexA);
+ chartTableItems[SwapItemIndexA].setText(0, strIndexB);
+
+ strIndexA = chartTableItems[SwapItemIndexA].getText(2);
+ strIndexB = chartTableItems[SwapItemIndexB].getText(2);
+
+ chartTableItems[SwapItemIndexB].setText(2, strIndexA);
+ chartTableItems[SwapItemIndexA].setText(2, strIndexB);
+
+ strIndexA = chartTableItems[SwapItemIndexA].getText(3);
+ strIndexB = chartTableItems[SwapItemIndexB].getText(3);
+
+ chartTableItems[SwapItemIndexB].setText(3, strIndexA);
+ chartTableItems[SwapItemIndexA].setText(3, strIndexB);
+
+ strIndexA = chartTableItems[SwapItemIndexA].getText(4);
+ strIndexB = chartTableItems[SwapItemIndexB].getText(4);
+
+ chartTableItems[SwapItemIndexB].setText(4, strIndexA);
+ chartTableItems[SwapItemIndexA].setText(4, strIndexB);
+
+ chartTableViewer.getTable().setDragDetect(true);
+ chartTableViewer.getTable().redraw();
+
+ int tempIndex = 0;
+ tempIndex = SwapItemIndexA;
+ SwapItemIndexA = SwapItemIndexB;
+ SwapItemIndexB = tempIndex;
+
+ }
+ ChangeDragItemIndex = SwapItemIndexB;
+ }
+
+ public void drop(DropTargetEvent event) {
+ DragItemStartPlg = true;
+ }
+ });
+
+ Composite buttonComp = new Composite(shell, SWT.NONE);
+ buttonComp.setBackground(ColorResources.EDIT_CHART_DIALOG_LOWER);
+ buttonComp.setLayout(new FormLayout());
+ data = new FormData();
+ data.top = new FormAttachment(editorContainer, 0);
+ data.bottom = new FormAttachment(100, 0);
+ data.left = new FormAttachment(0, 0);
+ data.right = new FormAttachment(100, 0);
+ buttonComp.setLayoutData(data);
+
+ DAButton okButton = new DAButton(buttonComp, SWT.PUSH);
+ okButton.addClickListener(okButtonListener);
+ okButton.setText(AnalyzerLabels.OK);
+ okButton.setFont(FontResources.EDIT_CHART_DLG_BUTTON);
+ data = new FormData();
+ data.top = new FormAttachment(0, 8);
+ data.left = new FormAttachment(0, 119);
+ data.width = DesignConstants.DA_BUTTON_WIDTH;
+ data.height = DesignConstants.DA_BUTTON_HEIGHT;
+ okButton.setLayoutData(data);
+
+ DAButton cancelButton = new DAButton(buttonComp, SWT.PUSH);
+ cancelButton.addClickListener(cancelButtonListener);
+ cancelButton.setText(AnalyzerLabels.CANCEL);
+ cancelButton.setFont(FontResources.EDIT_CHART_DLG_BUTTON);
+ data = new FormData();
+ data.top = new FormAttachment(0, 8);
+ data.left = new FormAttachment(okButton, 8);
+ data.width = DesignConstants.DA_BUTTON_WIDTH;
+ data.height = DesignConstants.DA_BUTTON_HEIGHT;
+ cancelButton.setLayoutData(data);
+
+ buttonComp.addPaintListener(new PaintListener() {
+ @Override
+ public void paintControl(PaintEvent e) {
+ Composite comp = (Composite) e.widget;
+ Rectangle rect = comp.getClientArea();
+ e.gc.setForeground(ColorResources.DIALOG_SUNKEN_1);
+ e.gc.drawLine(rect.x, rect.y, rect.x + rect.width, rect.y);
+ e.gc.setForeground(ColorResources.DIALOG_SUNKEN_2);
+ e.gc.drawLine(rect.x, rect.y + 1, rect.x + rect.width,
+ rect.y + 1);
+ }
+ });
+
+ // Adds listeners.
+ RunningDialog = true;
+ shell.addShellListener(shellListener);
+ shell.open();
+
+ return 0;
+ }
+
+ private MouseListener itemZoomMouseListener = new MouseAdapter() {
+ public void mouseUp(MouseEvent event) {
+ if (chartChangeSatus == true) {
+ Table table = chartTableViewer.getTable();
+ int selectItemIndex = table.getSelectionIndex();
+ TableItem[] chartTableItems = chartTableViewer.getTable()
+ .getItems();
+ if (chartTableItems[selectItemIndex].getText(3).equals(
+ strEnableChart)) {
+ chartTableItems[selectItemIndex]
+ .setText(3, strDisableChart);
+ } else if (chartTableItems[selectItemIndex].getText(3).equals(
+ strDisableChart)) {
+ chartTableItems[selectItemIndex].setText(3, strEnableChart);
+ }
+ chartTableViewer.getTable().redraw();
+ }
+ chartChangeSatus = true;
+ }
+ };
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.timeline.common;
+
+import java.util.List;
+
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.logparser.Logs;
+import org.tizen.dynamicanalyzer.model.DAView;
+import org.tizen.dynamicanalyzer.model.SnapshotData;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.timeline.chart.ScreenshotChart;
+import org.tizen.dynamicanalyzer.ui.timeline.chart.TimelineChart;
+import org.tizen.dynamicanalyzer.ui.timeline.chart.UIEventChart;
+import org.tizen.dynamicanalyzer.ui.timeline.eventlistener.TimelineChartMouseAdapter;
+import org.tizen.dynamicanalyzer.ui.timeline.eventlistener.TimelineChartMouseMoveListener;
+import org.tizen.dynamicanalyzer.ui.timeline.eventlistener.TimelineChartMouseTrackAdapter;
+import org.tizen.dynamicanalyzer.ui.timeline.logparser.CustomLogParser;
+import org.tizen.dynamicanalyzer.ui.timeline.logparser.DeviceLogParser;
+import org.tizen.dynamicanalyzer.ui.timeline.logparser.LifecycleLogParser;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
+import org.tizen.dynamicanalyzer.widgets.timeline.DACustomTimeline;
+
+public class TimelineView extends DAView {
+ public static final String ID = TimelineView.class.getName();
+
+ private final DAChartBoard chartBoard;
+
+ private final TimelineChartManager timelineChartManager = TimelineChartManager
+ .getInstance();
+ private final RangeDataManager rangeDataManger = RangeDataManager
+ .getInstance();
+
+ private final DeviceLogParser deviceLogParser = new DeviceLogParser();
+ private final CustomLogParser customLogParser = new CustomLogParser();
+ private final LifecycleLogParser lifecycleLogParser = LifecycleLogParser
+ .getInstance();
+
+ public TimelineView(Composite parent, int style) {
+ super(parent, style);
+ setLayout(new FillLayout());
+
+ chartBoard = new DAChartBoard(this, "Timeline"); //$NON-NLS-1$
+ chartBoard.setNameFont(FontResources.CHART_NAME_FONT);
+ timelineChartManager.setChartTimelineChartBoard(chartBoard);
+ chartBoard.setSelection(false);
+
+ initializeCharts();
+
+ new AddChartMenuComposite(chartBoard.getTitleComp());
+
+ setBackground(ColorResources.VIEW_BG_COLOR);
+
+ lifecycleLogParser.registerLifecycleBar(chartBoard.getLifecycleBar());
+ lifecycleLogParser.registerTimeline(chartBoard.getTimeline());
+ AnalyzerUtil.setTimelineComposite(this);
+
+ final DACustomTimeline timeline = chartBoard.getTimeline();
+ timeline.addMouseListener((new MouseAdapter() {
+ public void mouseUp(MouseEvent e) {
+ rangeDataManger
+ .setStartTime((long) (timeline.getStartRangeMarker()
+ .getTime() * TimelineConstants.MEGA));
+ rangeDataManger.setEndTime((long) (timeline.getEndRangeMarker()
+ .getTime() * TimelineConstants.MEGA));
+ }
+ }));
+ }
+
+ public void reArrangeChart(List<Integer> order, List<Boolean> showInfo) {
+ chartBoard.reArrangeItem(order.toArray(new Integer[order.size()]));
+ for (int i = 0; i < showInfo.size(); i++) {
+ if (showInfo.get(i)) {
+ chartBoard.showItem(i);
+ } else {
+ chartBoard.hideItem(i);
+ }
+ }
+ }
+
+ @Override
+ public void updateView(DASelectionData selData) {
+ long start = selData.getStartTime();
+ long end = selData.getEndTime();
+
+ double startTime = (double) start / TimelineConstants.MEGA;
+ double endTime = (double) end / TimelineConstants.MEGA;
+ double middleTime = (startTime + endTime) / 2.0;
+ if (endTime == startTime) {
+ middleTime = startTime;
+ }
+
+ chartBoard.setVisibleMiddleTime(middleTime);
+ DAChartPlotIntervalMarker intervalMarker = chartBoard
+ .getIntervalMarker();
+ intervalMarker.setStartVal(startTime);
+ intervalMarker.setEndVal(endTime);
+ }
+
+ @Override
+ public void updateView() {
+ timelineChartManager.addNewCustomChart();
+ chartBoard.setTotalEndTime(ToolbarArea.getInstance().getTime());
+
+ chartBoard.setRangeStartTime(rangeDataManger.getStartTime()
+ / TimelineConstants.MEGA);
+ chartBoard.setRangeEndTime(rangeDataManger.getEndTime()
+ / TimelineConstants.MEGA);
+
+ if (RangeDataManager.getInstance().isBeingAnalyzed()) {
+ chartBoard.setRange(rangeDataManger.getStartTime()
+ / TimelineConstants.MEGA, rangeDataManger.getEndTime()
+ / TimelineConstants.MEGA);
+ } else {
+ chartBoard.setRange(-1, -1);
+ }
+ }
+
+ @Override
+ public void updateLog(LogPackage logPack) {
+ if (null == logPack) {
+ return;
+ }
+
+ Logs deviceLogs = logPack.getLogs(LogCenterConstants.LOG_DEVICE);
+ if (deviceLogs != null && deviceLogs.getLogs() != null
+ && deviceLogs.getLogs().size() > 0) {
+ deviceLogParser.parseLogPackage(logPack);
+ }
+
+ Logs recorderLogs = logPack.getLogs(LogCenterConstants.LOG_RECODER);
+ if (recorderLogs != null && recorderLogs.getLogs() != null
+ && recorderLogs.getLogs().size() > 0) {
+ UIEventChart.getInstance().parseLogPackage(logPack);
+ }
+
+ Logs customLogs = logPack.getLogs(LogCenterConstants.LOG_CUSTOM_CHART);
+ if (customLogs != null && customLogs.getLogs() != null
+ && customLogs.getLogs().size() > 0) {
+ customLogParser.parseLogPackage(logPack);
+ }
+
+ Logs lifecycleLogs = logPack.getLogs(LogCenterConstants.LOG_LIFECYCLE);
+ if (lifecycleLogs != null && lifecycleLogs.getLogs() != null
+ && lifecycleLogs.getLogs().size() > 0) {
+ lifecycleLogParser.parseLogPackage(logPack);
+ }
+
+ Logs screenShotLogs = logPack
+ .getLogs(LogCenterConstants.LOG_SCREENSHOT);
+ if (screenShotLogs != null && screenShotLogs.getLogs() != null
+ && screenShotLogs.getLogs().size() > 0) {
+ ScreenshotChart.getInstance().parseLogPackage(logPack);
+ }
+ }
+
+ @Override
+ public void clear() {
+ chartBoard.contentsClear();
+ chartBoard.clear();
+ timelineChartManager.clear();
+ customLogParser.clear();
+ SnapshotData.getInstance().clear();
+ initializeCharts();
+ }
+
+ private void initializeCharts() {
+ DAChartPlotIntervalMarker intervalMarker = chartBoard
+ .getIntervalMarker();
+
+ List<TimelineChart> chartList = timelineChartManager.getChartList();
+ List<TimelineChart> selectedChartList = timelineChartManager
+ .getSelectedChartList();
+
+ for (int i = 0; i < chartList.size(); i++) {
+ TimelineChart timelineChart = chartList.get(i);
+
+ DAChartBoardItem item = timelineChart.createBoardItem(chartBoard);
+ DAChart chartWidget = item.getChart();
+
+ chartWidget.getPlot().setAxisRangeX(
+ chartBoard.getVisibleStartTime(),
+ chartBoard.getVisibleEndTime());
+
+ chartWidget.getPlot().setIntervalMarker(intervalMarker);
+ chartWidget.addMouseListener(new TimelineChartMouseAdapter(timelineChart.getPopupMenu()));
+ chartWidget
+ .addMouseMoveListener(new TimelineChartMouseMoveListener(
+ chartBoard.getTimeline()));
+ chartWidget
+ .addMouseTrackListener(new TimelineChartMouseTrackAdapter(
+ chartBoard.getTimeline()));
+
+ if (selectedChartList.contains(timelineChart)) {
+ chartBoard.showItem(i);
+ } else {
+ chartBoard.hideItem(i);
+ }
+ }
+ }
+
+ public Control getControl() {
+ return chartBoard;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.timeline.eventlistener;
+
+import java.util.List;
+
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.widgets.Canvas;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.timeline.chart.ScreenshotChart;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineView;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotTooltip;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
+import org.tizen.dynamicanalyzer.widgets.chart.DAScreenshotChartPlot;
+import org.tizen.dynamicanalyzer.widgets.chart.DAUIEventChartPlot;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenu;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuItem;
+
+public class TimelineChartMouseAdapter extends MouseAdapter {
+ private RangeDataManager rangeDataManager = RangeDataManager.getInstance();
+ private DAContextMenu menu;
+
+ public TimelineChartMouseAdapter(DAContextMenu menu) {
+ this.menu = menu;
+ }
+
+ @Override
+ public void mouseDown(MouseEvent e) {
+ DAChart chart = (DAChart) e.widget;
+ DAChartPlot plot = chart.getPlot();
+ DAChartPlotIntervalMarker intervalMarker = plot.getIntervalMarker();
+
+ double eventTime = plot.getXFromXPixcel(e.x);
+
+ if (e.button == 3) {
+ List<DAContextMenuItem> itemList = menu.getItems();
+ DAContextMenuItem startItem = itemList.get(0);
+ DAContextMenuItem endItem = itemList.get(1);
+ DAContextMenuItem analysisItem = itemList.get(2);
+ DAContextMenuItem clearItem = itemList.get(3);
+
+ if (RangeDataManager.getInstance().isBeingAnalyzed()
+ || AnalyzerManager.isRunning()) {
+ startItem.setEnabled(false);
+ endItem.setEnabled(false);
+ analysisItem.setEnabled(false);
+ clearItem.setEnabled(true);
+ } else {
+ if (eventTime * TimelineConstants.MEGA <= ToolbarArea
+ .getInstance().getTime()) {
+ startItem.setEnabled(true);
+ endItem.setEnabled(true);
+ analysisItem.setEnabled(rangeDataManager.isAnalyzable());
+ clearItem.setEnabled(rangeDataManager.isClearable());
+
+ startItem.setRangeTime(eventTime);
+ endItem.setRangeTime(eventTime);
+ } else {
+ startItem.setEnabled(false);
+ endItem.setEnabled(false);
+ analysisItem.setEnabled(rangeDataManager.isAnalyzable());
+ clearItem.setEnabled(rangeDataManager.isClearable());
+ }
+ }
+
+ if (plot instanceof DAUIEventChartPlot) {
+ double newYPosRatio = (double) e.y
+ / ((Canvas) e.widget).getSize().y;
+ int seriesIndex = (int) (newYPosRatio * chart.getSeriesList()
+ .size());
+ int startIndex = chart.getSeriesList().get(seriesIndex)
+ .getPrevIndexByXvalue(intervalMarker.getStartVal()) + 1;
+ int endIndex = chart.getSeriesList().get(seriesIndex)
+ .getPrevIndexByXvalue(intervalMarker.getEndVal());
+
+ DAContextMenuItem eventListItem = menu.getItems().get(
+ menu.getItems().size() - 1);
+ eventListItem.setSeriesIndex(seriesIndex);
+ eventListItem.setEventListStartIndex(startIndex);
+ eventListItem.setEventListEndIndex(endIndex);
+
+ eventListItem.setEnabled(true);
+ }
+
+ return;
+ }
+
+ if (plot instanceof DAScreenshotChartPlot) {
+ DAChartSeries series = chart.getSeries(0);
+ int index = series.getPrevIndexByXvalue(eventTime);
+ if (index >= 0 && index < series.getSeriesItemList().size()) {
+ DAChartSeriesItem item = series.getSeriesItemList().get(index);
+ double itemTime = item.getX();
+ int imageWidth = item.getImage().getBounds().width;
+ double imageRightTime = itemTime
+ + plot.getXFromXPixcel(imageWidth)
+ - plot.getVisibleStartX();
+
+ if (eventTime > itemTime && eventTime < imageRightTime) {
+ if (e.button == 3) {
+ intervalMarker.setInterval(itemTime, itemTime);
+ } else {
+ intervalMarker.setInterval(itemTime, eventTime);
+ }
+ } else {
+ intervalMarker.setInterval(eventTime, eventTime);
+ }
+ } else {
+ intervalMarker.setInterval(eventTime, eventTime);
+ }
+ } else {
+ intervalMarker.setInterval(eventTime, eventTime);
+ }
+
+ DAChart chartWidget = ScreenshotChart.getInstance().getChart();
+ DAScreenshotChartPlot screenshotChartPlot = (DAScreenshotChartPlot) chartWidget
+ .getPlot();
+ screenshotChartPlot.setSelectedImageIndex(getHighlightedImageIndex(
+ screenshotChartPlot, chartWidget.getSeriesList(), e.x));
+ chart.redraw();
+ }
+
+ @Override
+ public void mouseUp(MouseEvent e) {
+ if (e.button == 3) {
+ return;
+ }
+
+ DAChart chart = (DAChart) e.widget;
+ DAChartPlot plot = chart.getPlot();
+ DAChartPlotIntervalMarker intervalMarker = plot.getIntervalMarker();
+ DAChartPlotTooltip tooltip = plot.getTooltip();
+
+ if (null == tooltip) {
+ return;
+ }
+
+ double oldYPosRatio = tooltip.getYPosRatio();
+ double newYPosRatio = (double) e.y / ((Canvas) e.widget).getSize().y;
+
+ if (oldYPosRatio != newYPosRatio) {
+ tooltip.setYPosRatio(newYPosRatio);
+ }
+
+ tooltip.setStartVal(getTooltipStartX(plot, chart.getSeriesList(), e.x,
+ newYPosRatio));
+ tooltip.setTooltip(true);
+
+ double eventTime = plot.getXFromXPixcel(e.x);
+
+ double markerStartTime = intervalMarker.getStartVal();
+ double markerEndTime = eventTime;
+
+ if (markerStartTime > markerEndTime) {
+ double temp = markerStartTime;
+ markerStartTime = markerEndTime;
+ markerEndTime = temp;
+ }
+
+ double toolbarTime = ToolbarArea.getInstance().getTime()
+ / TimelineConstants.MEGA;
+ if (markerStartTime < 0) {
+ markerStartTime = 0;
+ } else if (markerStartTime > toolbarTime) {
+ markerStartTime = toolbarTime;
+ }
+
+ if (markerEndTime > toolbarTime) {
+ markerEndTime = toolbarTime;
+ } else if (markerEndTime < 0) {
+ markerEndTime = 0;
+ }
+
+ if (plot instanceof DAScreenshotChartPlot) {
+ DAChartSeries series = chart.getSeries(0);
+ int index = series.getPrevIndexByXvalue(plot.getXFromXPixcel(e.x));
+ if (index >= 0 && index < series.getSeriesItemList().size()) {
+ DAChartSeriesItem item = series.getSeriesItemList().get(index);
+ double itemTime = item.getX();
+ int imageWidth = item.getImage().getBounds().width;
+ double imageRightTime = itemTime
+ + plot.getXFromXPixcel(imageWidth)
+ - plot.getVisibleStartX();
+
+ if (markerEndTime > itemTime && markerEndTime < imageRightTime) {
+ intervalMarker.setInterval(markerStartTime, itemTime);
+ } else {
+ if (markerEndTime <= plot.getVisibleEndX()) {
+ intervalMarker.setInterval(markerStartTime,
+ markerEndTime);
+ } else {
+ intervalMarker.setInterval(markerStartTime,
+ plot.getVisibleEndX());
+ }
+ }
+ } else {
+ if (markerEndTime <= plot.getVisibleEndX()) {
+ intervalMarker.setInterval(markerStartTime, markerEndTime);
+ } else {
+ intervalMarker.setInterval(markerStartTime,
+ plot.getVisibleEndX());
+ }
+ }
+ } else {
+ if (markerEndTime <= plot.getVisibleEndX()) {
+ intervalMarker.setInterval(markerStartTime, markerEndTime);
+ } else {
+ intervalMarker.setInterval(markerStartTime,
+ plot.getVisibleEndX());
+ }
+ }
+
+ sendSelectionTimes(intervalMarker.getStartVal(),
+ intervalMarker.getEndVal());
+ }
+
+ private double getTooltipStartX(DAChartPlot plot,
+ List<DAChartSeries> seriesList, int x, double yPosRatio) {
+ double ret = -1;
+ for (int i = 0; i < seriesList.size(); i++) {
+ if (plot instanceof DAUIEventChartPlot) {
+ i = (int) (seriesList.size() * yPosRatio);
+ if (i < 0 || i > 4) {
+ System.out.println(yPosRatio + " " + i);//$NON-NLS-1$
+ }
+ }
+ DAChartSeries series = seriesList.get(i);
+ int index = series.getPrevIndexByXvalue(plot.getXFromXPixcel(x));
+ if (-1 == index) {
+ if (plot instanceof DAUIEventChartPlot) {
+ break;
+ }
+ continue;
+ }
+ double startVal = series.getSeriesItemList().get(index).getX();
+ if (ret < startVal) {
+ ret = startVal;
+ }
+
+ if (plot instanceof DAUIEventChartPlot) {
+ break;
+ }
+ }
+ return ret;
+ }
+
+ private void sendSelectionTimes(double start, double end) {
+ long startTime = (long) (start * TimelineConstants.MEGA);
+ long endTime = (long) (end * TimelineConstants.MEGA);
+ if (endTime < startTime) {
+ long temp = startTime;
+ startTime = endTime;
+ endTime = temp;
+ }
+ if (startTime < 0) {
+ startTime = 0;
+ }
+ AnalyzerManager.getCurrentPage().updatePage(
+ new DASelectionData(TimelineView.ID, startTime, endTime, null,
+ null));
+ }
+
+ private int getHighlightedImageIndex(DAChartPlot plot,
+ List<DAChartSeries> seriesList, int x) {
+ if (plot instanceof DAScreenshotChartPlot) {
+ DAChartSeries series = seriesList.get(0);
+
+ return series.getPrevIndexByXvalue(plot.getXFromXPixcel(x));
+ } else {
+ return TimelineConstants.NOT_INITED;
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.timeline.eventlistener;
+
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseMoveListener;
+import org.eclipse.swt.widgets.Canvas;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotTooltip;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
+import org.tizen.dynamicanalyzer.widgets.chart.DAScreenshotChartPlot;
+import org.tizen.dynamicanalyzer.widgets.chart.DAUIEventChartPlot;
+import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
+import org.tizen.dynamicanalyzer.widgets.timeline.DACustomTimeline;
+
+public class TimelineChartMouseMoveListener implements MouseMoveListener {
+ private DACustomTimeline timeline;
+
+ public TimelineChartMouseMoveListener(DACustomTimeline timeline) {
+ this.timeline = timeline;
+ }
+
+ @Override
+ public void mouseMove(MouseEvent e) {
+ DAChart chart = (DAChart) e.widget;
+ DAChartPlot plot = chart.getPlot();
+ DAChartPlotIntervalMarker intervalMarker = plot.getIntervalMarker();
+ DAChartPlotTooltip tooltip;
+
+ if ((e.stateMask & SWT.BUTTON1) != 0) {
+ if (null == intervalMarker) {
+ return;
+ }
+ intervalMarker.setEndVal(plot.getXFromXPixcel(e.x));
+ }
+ tooltip = plot.getTooltip();
+ if (null == tooltip) {
+ return;
+ }
+
+ double oldYPosRatio = tooltip.getYPosRatio();
+ double newYPosRatio = (double) e.y / ((Canvas) e.widget).getSize().y;
+
+ if (oldYPosRatio != newYPosRatio) {
+ if (newYPosRatio < 0) {
+ newYPosRatio = 0.01;
+ } else if (newYPosRatio >= 1) {
+ newYPosRatio = 0.99;
+ }
+
+ tooltip.setYPosRatio(newYPosRatio);
+ }
+
+ double oldStartVal = tooltip.getStartVal();
+ double newStartVal = getTooltipStartX(plot, chart.getSeriesList(), e.x,
+ newYPosRatio);
+
+ if (oldStartVal != newStartVal) {
+ tooltip.setStartVal(newStartVal);
+ }
+
+ if (plot instanceof DAScreenshotChartPlot) {
+ ((DAScreenshotChartPlot) plot)
+ .setHighlightedImageIndex(getHighlightedImageIndex(e));
+ chart.redraw();
+ } else if (plot instanceof DAUIEventChartPlot) {
+ DAUIEventChartPlot uiEventChartPlot = (DAUIEventChartPlot) plot;
+ int seriesIndex = (int) (newYPosRatio * chart.getSeriesList()
+ .size());
+
+ uiEventChartPlot.setHighlightedEventIndexX(chart.getSeriesList()
+ .get(seriesIndex)
+ .getPrevIndexByXvalue(plot.getXFromXPixcel(e.x)));
+ uiEventChartPlot.setHighlightedEventIndexY(seriesIndex);
+ chart.redraw();
+ }
+
+ timeline.setDetailedTime(plot.getXFromXPixcel(e.x));
+ timeline.setDetailedTimePosition(e.x);
+ timeline.setDrawDetailedTime(true);
+ timeline.redraw();
+ }
+
+ private double getTooltipStartX(DAChartPlot plot,
+ List<DAChartSeries> seriesList, int x, double yPosRatio) {
+ double ret = -1;
+ for (int i = 0; i < seriesList.size(); i++) {
+ if (plot instanceof DAUIEventChartPlot) {
+ i = (int) (seriesList.size() * yPosRatio);
+ if (i < 0 || i > 4) {
+ System.out.println(yPosRatio + " " + i);//$NON-NLS-1$
+ }
+ }
+ DAChartSeries series = seriesList.get(i);
+ int index = series.getPrevIndexByXvalue(plot.getXFromXPixcel(x));
+ if (-1 == index) {
+ if (plot instanceof DAUIEventChartPlot) {
+ break;
+ }
+ continue;
+ }
+ double startVal = series.getSeriesItemList().get(index).getX();
+ if (ret < startVal) {
+ ret = startVal;
+ }
+
+ if (plot instanceof DAUIEventChartPlot) {
+ break;
+ }
+ }
+ return ret;
+ }
+
+ private int getHighlightedImageIndex(MouseEvent e) {
+ DAChart chart = (DAChart) e.widget;
+ DAChartPlot plot = chart.getPlot();
+ DAChartSeries series = chart.getSeriesList().get(0);
+
+ int index = series.getPrevIndexByXvalue(plot.getXFromXPixcel(e.x));
+ if (index < 0) {
+ return -1;
+ }
+
+ DAChartSeriesItem item = series.getSeriesItemList().get(index);
+ int screenshotWidth = item.getImage().getBounds().width;
+ if (chart.getBounds().height != DAChartBoard.DEFAULT_CHART_ZOOMIN_HEIGHT - 1) {
+ screenshotWidth /= 2;
+ }
+
+ if (e.x < plot.getXPixcelFromX(item.getX()) + screenshotWidth
+ && e.x >= plot.getXPixcelFromX(item.getX())) {
+ return index;
+ } else {
+ return -1;
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.timeline.eventlistener;
+
+import java.util.List;
+
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseTrackAdapter;
+import org.eclipse.swt.widgets.Canvas;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotTooltip;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chart.DAScreenshotChartPlot;
+import org.tizen.dynamicanalyzer.widgets.chart.DAUIEventChartPlot;
+import org.tizen.dynamicanalyzer.widgets.timeline.DACustomTimeline;
+
+public class TimelineChartMouseTrackAdapter extends MouseTrackAdapter {
+ private DACustomTimeline timeline;
+
+ public TimelineChartMouseTrackAdapter(DACustomTimeline timeline) {
+ this.timeline = timeline;
+ }
+
+ @Override
+ public void mouseEnter(MouseEvent e) {
+ DAChart chart = (DAChart) e.widget;
+ DAChartPlot plot = chart.getPlot();
+ DAChartPlotTooltip tooltip = plot.getTooltip();
+
+ if (null == tooltip) {
+ return;
+ }
+
+ double oldYPosRatio = tooltip.getYPosRatio();
+ double newYPosRatio = (double) e.y / ((Canvas) e.widget).getSize().y;
+
+ if (oldYPosRatio != newYPosRatio) {
+ tooltip.setYPosRatio(newYPosRatio);
+ }
+
+ tooltip.setStartVal(getTooltipStartX(plot, chart.getSeriesList(), e.x,
+ newYPosRatio));
+ tooltip.setTooltip(true);
+ }
+
+ @Override
+ public void mouseExit(MouseEvent e) {
+ DAChart chart = (DAChart) e.widget;
+ DAChartPlot plot = chart.getPlot();
+ DAChartPlotTooltip tooltip = plot.getTooltip();
+
+ if (null == tooltip) {
+ return;
+ }
+ tooltip.setTooltip(false);
+
+ if (plot instanceof DAScreenshotChartPlot) {
+ ((DAScreenshotChartPlot) plot)
+ .setHighlightedImageIndex(TimelineConstants.NOT_INITED);
+ chart.redraw();
+ } else if (plot instanceof DAUIEventChartPlot) {
+ ((DAUIEventChartPlot) plot).setHighlightedEventIndexX(-1);
+ }
+
+ timeline.setDrawDetailedTime(false);
+ timeline.redraw();
+ }
+
+ private double getTooltipStartX(DAChartPlot plot,
+ List<DAChartSeries> seriesList, int x, double yPosRatio) {
+ double ret = -1;
+ for (int i = 0; i < seriesList.size(); i++) {
+ if (plot instanceof DAUIEventChartPlot) {
+ i = (int) (seriesList.size() * yPosRatio);
+ if (i < 0 || i > 4) {
+ System.out.println(yPosRatio + " " + i);//$NON-NLS-1$
+ }
+ }
+ DAChartSeries series = seriesList.get(i);
+ int index = series.getPrevIndexByXvalue(plot.getXFromXPixcel(x));
+ if (-1 == index) {
+ if (plot instanceof DAUIEventChartPlot) {
+ break;
+ }
+ continue;
+ }
+ double startVal = series.getSeriesItemList().get(index).getX();
+ if (ret < startVal) {
+ ret = startVal;
+ }
+
+ if (plot instanceof DAUIEventChartPlot) {
+ break;
+ }
+ }
+ return ret;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.timeline.logparser;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.swt.graphics.Color;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.logparser.Logs;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.ui.timeline.chart.UserCustomChart;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineChartManager;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
+import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
+
+public class CustomLogParser {
+ private final String API_NAME_CREATE_CHART = "da_create_chart"; //$NON-NLS-1$
+ private final String API_NAME_CREATE_SERIES = "da_create_series"; //$NON-NLS-1$
+ private final String API_NAME_CREATE_DEFAULT_SERIES = "da_create_default_series"; //$NON-NLS-1$
+ private final String API_NAME_DA_LOG= "da_log"; //$NON-NLS-1$
+// private final String API_NAME_DA_MARK = "da_mark"; //$NON-NLS-1$
+ private final String API_NAME_TIMER_THREAD = "timerThread"; //$NON-NLS-1$
+
+ private final int CUSTOM_COLOR_AUTO = 0;
+ private final int CUSTOM_COLOR_BLUE = 1;
+ private final int CUSTOM_COLOR_GREEN = 2;
+ private final int CUSTOM_COLOR_RED = 3;
+ private final int CUSTOM_COLOR_BROWN = 4;
+ private final int CUSTOM_COLOR_PURPLE = 5;
+ private final int CUSTOM_COLOR_NAVY = 6;
+ private final int CUSTOM_COLOR_CHOCOLATE = 7;
+ private final int CUSTOM_COLOR_INDIGO = 8;
+ private final int CUSTOM_COLOR_MAGNETA = 9;
+ private final int CUSTOM_COLOR_TEAL = 10;
+
+
+ private TimelineChartManager chartManager = TimelineChartManager.getInstance();
+ private Map<Integer, DAChartSeries> customChartSeriesMap = new HashMap<Integer, DAChartSeries>();
+
+ public void parseLogPackage(LogPackage logPack) {
+ Logs logs = logPack.getLogs(LogCenterConstants.LOG_CUSTOM_CHART);
+ List<List<String>> logList = logs.getLogs();
+
+ for(List<String> log : logList) {
+ parsingLog(log);
+ }
+ }
+
+ private void parsingLog(List<String> log) {
+ String apiName = log.get(LogCenterConstants.APINAME_INDEX);
+
+ if(apiName.equals(API_NAME_CREATE_CHART)) {
+ int chartHandle = Integer.parseInt(log.get(LogCenterConstants.RETURN_INDEX));
+ String chartName = log.get(LogCenterConstants.CUSTOM_CHART_TEXT);
+ chartManager.addCustomChart(new UserCustomChart(chartHandle, chartName));
+ } else if(apiName.equals(API_NAME_CREATE_SERIES)) {
+ int chartType = Integer.parseInt(log.get(LogCenterConstants.CUSTOM_CHART_HANDLE));
+ UserCustomChart chart = (UserCustomChart)chartManager.getChartInstance(chartType);
+ if(chart == null) {
+ System.out.println("CustomLogParser.java : unrecognized chart handle"); //$NON-NLS-1$
+ return;
+ }
+
+ int seriesHandle = Integer.parseInt(log.get(LogCenterConstants.RETURN_INDEX));
+ int seriesStyle = Integer.parseInt(log.get(LogCenterConstants.CUSTOM_CHART_TYPE));
+ String seriesName = log.get(LogCenterConstants.CUSTOM_CHART_TEXT);
+ int colorIndex = Integer.parseInt(log.get(LogCenterConstants.CUSTOM_CHART_COLOR));
+ if(colorIndex == CUSTOM_COLOR_AUTO) {
+ colorIndex = chart.getUnusedColorIndex();
+ }
+ Color seriesColor = getCustomColor(colorIndex);
+ if(seriesColor == null) {
+ System.out.println("CustomLogParser.java : undefined custom color"); //$NON-NLS-1$
+ return;
+ }
+
+ DAChartSeries series = new DAChartSeries(seriesName, seriesStyle, seriesColor);
+ chart.addTempSeries(series, colorIndex);
+ customChartSeriesMap.put(seriesHandle, series);
+ } else if(apiName.equals(API_NAME_CREATE_DEFAULT_SERIES)) {
+ int chartType = Integer.parseInt(log.get(LogCenterConstants.CUSTOM_CHART_HANDLE));
+ UserCustomChart chart = (UserCustomChart)chartManager.getChartInstance(chartType);
+ if(chart == null) {
+ System.out.println("unrecognized chart handle"); //$NON-NLS-1$
+ return;
+ }
+
+ int seriesHandle = Integer.parseInt(log.get(LogCenterConstants.RETURN_INDEX));
+ int colorIndex = chart.getUnusedColorIndex();
+ String seriesName = log.get(LogCenterConstants.CUSTOM_CHART_TEXT);
+
+ DAChartSeries series = new DAChartSeries(seriesName, DAChartSeries.SERIES_STYLE_LINE, getCustomColor(colorIndex));
+ chart.addTempSeries(series, colorIndex);
+ customChartSeriesMap.put(seriesHandle, series);
+ } else if(apiName.equals(API_NAME_DA_LOG) || apiName.equals(API_NAME_TIMER_THREAD)) {
+ int seriesHandle = Integer.parseInt(log.get(LogCenterConstants.CUSTOM_CHART_HANDLE));
+ double time = Double.parseDouble(log.get(LogCenterConstants.TIME_INDEX))
+ / TimelineConstants.MEGA;
+ double value = Double.parseDouble(log.get(LogCenterConstants.CUSTOM_CHART_VALUE));
+ DAChartSeries series = customChartSeriesMap.get(seriesHandle);
+ series.addSeriesItem(new DAChartSeriesItem(time, value, String.valueOf(value)));
+ }
+ }
+
+ public void clear() {
+ customChartSeriesMap.clear();
+ }
+
+ private Color getCustomColor(int colorType) {
+ switch(colorType) {
+ case CUSTOM_COLOR_BLUE:
+ return ColorResources.BLUE;
+ case CUSTOM_COLOR_GREEN:
+ return ColorResources.GREEN;
+ case CUSTOM_COLOR_RED:
+ return ColorResources.RED;
+ case CUSTOM_COLOR_BROWN:
+ return ColorResources.BROWN;
+ case CUSTOM_COLOR_PURPLE:
+ return ColorResources.PURPLE;
+ case CUSTOM_COLOR_NAVY:
+ return ColorResources.NAVY;
+ case CUSTOM_COLOR_CHOCOLATE:
+ return ColorResources.CHOCOLATE;
+ case CUSTOM_COLOR_INDIGO:
+ return ColorResources.INDIGO;
+ case CUSTOM_COLOR_MAGNETA:
+ return ColorResources.MAGNETA;
+ case CUSTOM_COLOR_TEAL:
+ return ColorResources.TEAL;
+ default:
+ return null;
+ }
+ }
+}
--- /dev/null
+package org.tizen.dynamicanalyzer.ui.timeline.logparser;
+
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.logparser.Logs;
+import org.tizen.dynamicanalyzer.ui.timeline.chart.TimelineChart;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineChartManager;
+
+public class DeviceLogParser {
+ public void parseLogPackage(LogPackage logPack) {
+ Logs deviceLogs = logPack.getLogs(LogCenterConstants.LOG_DEVICE);
+ if (deviceLogs != null && deviceLogs.getLogs() != null
+ && deviceLogs.getLogs().size() > 0) {
+ List<TimelineChart> chartList = TimelineChartManager.getInstance()
+ .getChartList();
+ for (TimelineChart chart : chartList) {
+ if (chart.getProbeType() == LogCenterConstants.LOG_DEVICE) {
+ chart.parseLogPackage(logPack);
+ }
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sanghyun Lee <sanghyunnim.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.timeline.logparser;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.graphics.Color;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.logparser.Logs;
+import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+import org.tizen.dynamicanalyzer.widgets.lifecycle.LifecycleBar;
+import org.tizen.dynamicanalyzer.widgets.lifecycle.LifecycleData;
+import org.tizen.dynamicanalyzer.widgets.timeline.DACustomTimeline;
+
+public class LifecycleLogParser {
+ private static LifecycleLogParser instance = null;
+
+ private final String API_NAME_INITIALIZING = "INITIALIZING";//$NON-NLS-1$
+ private final String API_NAME_RUNNING = "RUNNING";//$NON-NLS-1$
+ private final String API_NAME_PAUSING = "PAUSING";//$NON-NLS-1$
+ private final String API_NAME_TERMINATING = "TERMINATING";//$NON-NLS-1$
+
+ private List<LifecycleBar> lifecycleBarList = new ArrayList<LifecycleBar>();
+ private List<DACustomTimeline> timelineList = new ArrayList<DACustomTimeline>();
+
+ public static LifecycleLogParser getInstance() {
+ if (instance == null) {
+ instance = new LifecycleLogParser();
+ }
+ return instance;
+ }
+
+ private LifecycleLogParser() {
+ }
+
+ public void parseLogPackage(LogPackage logPack) {
+ Logs logs = logPack.getLogs(LogCenterConstants.LOG_LIFECYCLE);
+ List<List<String>> logList = logs.getLogs();
+
+ for (List<String> log : logList) {
+ parsingLog(log);
+ }
+ }
+
+ private void parsingLog(List<String> log) {
+ String apiName = log.get(LogCenterConstants.APINAME_INDEX);
+ Color colorTop;
+ Color colorBottom;
+ String text;
+
+ if (apiName.equals(API_NAME_INITIALIZING)) {
+ colorTop = ColorResources.LIFECYCLE_INITIALIZING_TOP;
+ colorBottom = ColorResources.LIFECYCLE_INITIALIZING_BOTTOM;
+ text = TimelineChartLabels.LIFECYCLE_INITIALIZING;
+ } else if (apiName.equals(API_NAME_RUNNING)) {
+ colorTop = ColorResources.LIFECYCLE_RUNNING_TOP;
+ colorBottom = ColorResources.LIFECYCLE_RUNNING_BOTTOM;
+ text = TimelineChartLabels.LIFECYCLE_RUNNING;
+ } else if (apiName.equals(API_NAME_PAUSING)) {
+ colorTop = ColorResources.LIFECYCLE_PAUSING_TOP;
+ colorBottom = ColorResources.LIFECYCLE_PAUSING_BOTTOM;
+ text = TimelineChartLabels.LIFECYCLE_PAUSING;
+ } else if (apiName.equals(API_NAME_TERMINATING)) {
+ colorTop = ColorResources.LIFECYCLE_TERMINATING_TOP;
+ colorBottom = ColorResources.LIFECYCLE_TERMINATING_BOTTOM;
+ text = TimelineChartLabels.LIFECYCLE_TERMINATING;
+ } else {
+ System.out.println("LifecycleLogParser.java : lifecycle log error"); //$NON-NLS-1$
+ return;
+ }
+
+ double startTime = Double.parseDouble(log
+ .get(LogCenterConstants.TIME_INDEX)) / TimelineConstants.MEGA;
+
+ LifecycleData lifecycleData = new LifecycleData(startTime, colorTop,
+ colorBottom, text);
+ for (LifecycleBar lifecycleBar : lifecycleBarList) {
+ lifecycleBar.addLifecycleData(lifecycleData);
+ }
+
+ for (DACustomTimeline timeline : timelineList) {
+ timeline.addStickyTime(startTime);
+ }
+ }
+
+ public void registerLifecycleBar(LifecycleBar lifecycleBar) {
+ lifecycleBarList.add(lifecycleBar);
+ }
+
+ public void registerTimeline(DACustomTimeline timeline) {
+ timelineList.add(timeline);
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.toolbar;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.tizen.dynamicanalyzer.common.AnalyzerPaths;
+import org.tizen.dynamicanalyzer.common.DesignConstants;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.widgets.DAButton;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
+
+public class AboutDialog {
+ private Shell parent = null;
+ private Shell shell = null;
+ private DACustomButton licenseButton = null;
+ private DACustomButton okButton = null;
+ private File SDKAboutFile = null;
+
+ private final Image iconImage = ImageResources.ABOUT_TIZEN_SDK;
+
+ public AboutDialog(Shell parent, int style) {
+ this.parent = parent;
+ }
+
+ private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ shell.dispose();
+ }
+ };
+
+ private DACustomButtonClickEventListener licenseButtonListener = new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
+ LicenseDialog dialog = new LicenseDialog(shell, SWT.NONE); // FIXME
+ dialog.open();
+ }
+ };
+
+ public int open() {
+ shell = new Shell(parent, SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM);
+ shell.setSize(446, 254);
+ shell.setLayout(new FormLayout());
+ shell.setText(AnalyzerLabels.ABOUT);
+
+ Composite base = new Composite(shell, SWT.NONE);
+ base.setLayout(new FormLayout());
+ FormData baseData = new FormData();
+ baseData.top = new FormAttachment(0, 0);
+ baseData.left = new FormAttachment(0, 0);
+ baseData.right = new FormAttachment(100, 0);
+ baseData.height = 180;
+ base.setLayoutData(baseData);
+ base.setVisible(true);
+ base.setBackground(ColorResources.DIALOG_BG_UPPER);
+
+ // Icon
+ Label icon = new Label(base, SWT.TRANSPARENT);
+ icon.setBackground(ColorResources.WINDOW_BG_COLOR);
+ icon.setImage(iconImage);
+
+ // Contents
+ Label titleText = new Label(base, SWT.TRANSPARENT);
+ titleText.setBackground(ColorResources.DIALOG_BG_UPPER);
+ titleText.setAlignment(SWT.LEFT);
+ titleText.setForeground(ColorResources.DEFAULT_FONT_COLOR);
+ titleText.setText(AnalyzerLabels.ABOUT_DIALOG_TITLE);
+
+ Label version = new Label(base, SWT.TRANSPARENT);
+ // version.setText(AnalyzerLabels.ABOUT_DIALOG_VERSION_TAB
+ // + ConfigureManager.getInstance().getValue(
+ // AnalyzerLabels.ABOUT_DIALOG_VERSION));
+ String versionString = getVersion();// FIXME
+ version.setText(AnalyzerLabels.ABOUT_DIALOG_VERSION_TAB + versionString);
+ version.setBackground(ColorResources.DIALOG_BG_UPPER);
+ version.setAlignment(SWT.LEFT);
+ version.setForeground(ColorResources.DEFAULT_FONT_COLOR);
+ version.setFont(FontResources.ABOUT_TEXT);
+
+ Label buildTime = new Label(base, SWT.TRANSPARENT);
+
+ // buildTime.setText("Build time : "+new
+ // SimpleDateFormat("MM/dd/yyyy HH:mm").format(new Date())); //FIXME :
+ // time
+ // buildTime.setText(AnalyzerLabels.ABOUT_DIALOG_BUILD_TIME_TAB
+ // + ConfigureManager.getInstance().getValue(
+ // AnalyzerLabels.ABOUT_DIALOG_BUILD_TIME)); //$NON-NLS-1$
+ String buildTimeString = getBuildTime();// FIXME
+ buildTime.setText(AnalyzerLabels.ABOUT_DIALOG_BUILD_TIME_TAB
+ + buildTimeString);
+ buildTime.setBackground(ColorResources.DIALOG_BG_UPPER);
+ buildTime.setAlignment(SWT.LEFT);
+ buildTime.setForeground(ColorResources.DEFAULT_FONT_COLOR);
+ buildTime.setFont(FontResources.ABOUT_TEXT);
+
+ FormData labelData = new FormData();
+ labelData.left = new FormAttachment(0, 0);
+ labelData.top = new FormAttachment(0, 0);
+ labelData.width = 149;
+ labelData.height = 180;
+ icon.setLayoutData(labelData);
+
+ int textPos = 17;
+ labelData = new FormData();
+ labelData.left = new FormAttachment(0, 155);
+ labelData.right = new FormAttachment(100, 0);
+ labelData.top = new FormAttachment(0, textPos);
+ labelData.height = 17;
+ titleText.setLayoutData(labelData);
+
+ labelData = new FormData();
+ labelData.left = new FormAttachment(0, 155);
+ labelData.right = new FormAttachment(100, 0);
+ labelData.top = new FormAttachment(0, textPos += (17 + 15));
+ labelData.height = 17;
+ version.setLayoutData(labelData);
+
+ labelData = new FormData();
+ labelData.left = new FormAttachment(0, 155);
+ labelData.right = new FormAttachment(100, 0);
+ labelData.top = new FormAttachment(0, textPos += 17);
+ labelData.height = 17;
+ buildTime.setLayoutData(labelData);
+
+ Composite buttonComp = new Composite(shell, SWT.NONE);
+ buttonComp.setLayout(new FormLayout());
+ buttonComp.setBackground(ColorResources.DIALOG_BG_LOWER);
+
+ buttonComp.addPaintListener(new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ Composite comp = (Composite) e.widget;
+ Rectangle rect = comp.getClientArea();
+ e.gc.setForeground(ColorResources.DIALOG_SUNKEN_1);
+ e.gc.drawLine(rect.x, rect.y, rect.x + rect.width, rect.y);
+ e.gc.setForeground(ColorResources.DIALOG_SUNKEN_2);
+ e.gc.drawLine(rect.x, rect.y + 1, rect.x + rect.width,
+ rect.y + 1);
+ }
+ });
+
+ FormData compData = new FormData();
+ compData.top = new FormAttachment(base, 0);
+ compData.left = new FormAttachment(0, 0);
+ compData.right = new FormAttachment(100, 0);
+ // compData.height = 51;
+ compData.bottom = new FormAttachment(100, 0);
+ buttonComp.setLayoutData(compData);
+
+ okButton = new DAButton(buttonComp, SWT.NONE);
+ okButton.addClickListener(okButtonListener);
+ okButton.setText(AnalyzerLabels.OK);
+ okButton.setFont(FontResources.DIALOG_BUTTON_FONT);
+
+ FormData okData = new FormData();
+ okData.top = new FormAttachment(0, 9);
+ okData.right = new FormAttachment(100, -9);
+ okData.width = DesignConstants.DA_BUTTON_WIDTH;
+ okData.height = DesignConstants.DA_BUTTON_HEIGHT;
+ okButton.setLayoutData(okData);
+
+ licenseButton = new DAButton(buttonComp, SWT.NONE);
+ licenseButton.addClickListener(licenseButtonListener);
+ licenseButton.setText(AnalyzerLabels.ABOUT_DIALOG_LICENSE);
+ licenseButton.setFont(FontResources.DIALOG_BUTTON_FONT);
+
+ FormData licenceData = new FormData();
+ licenceData.top = new FormAttachment(0, 9);
+ licenceData.right = new FormAttachment(okButton, -10);
+ licenceData.width = DesignConstants.DA_BUTTON_WIDTH;
+ licenceData.height = DesignConstants.DA_BUTTON_HEIGHT;
+ licenseButton.setLayoutData(licenceData);
+
+ shell.open();
+
+ Display display = PlatformUI.createDisplay();
+
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+
+ shell.dispose();
+
+ return 0;
+ }
+
+ private String parseBuildTime(String readData) {
+ String[] splitData = readData.split("2="); //$NON-NLS-1$
+ int size = splitData.length;
+
+ if (2 != size) {
+ return null;
+ }
+ return splitData[1];
+ }
+
+ private String parseVersion(String readData) {
+ String[] splitData = readData.split("1="); //$NON-NLS-1$
+ int size = splitData.length;
+
+ if (2 != size) {
+ return null;
+ }
+ return splitData[1];
+ }
+
+ private String getBuildTime() {
+ String buildTime;
+ if (null == SDKAboutFile) {
+ SDKAboutFile = new File(AnalyzerPaths.ABOUT_FILE_PATH);
+ }
+
+ BufferedReader in;
+ String content;
+ try {
+ in = new BufferedReader(new FileReader(SDKAboutFile));
+ while (null != (content = in.readLine())) {
+ buildTime = parseBuildTime(content);
+ if (buildTime != null) {
+ return buildTime;
+ }
+ }
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ return null;
+ }
+
+ private String getVersion() {
+ String version;
+ if (null == SDKAboutFile) {
+ SDKAboutFile = new File(AnalyzerPaths.ABOUT_FILE_PATH);
+ }
+
+ BufferedReader in;
+ String content;
+ try {
+ in = new BufferedReader(new FileReader(SDKAboutFile));
+ while (null != (content = in.readLine())) {
+ version = parseVersion(content);
+ if (version != null) {
+ return version;
+ }
+ }
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ return null;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * YeongTaik Byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.toolbar;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerPaths;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.common.PathManager;
+import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
+import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
+
+public class ConfigureManager {
+
+ // default value
+ private static final String DEFAULT_INTERNALCALL = ConfigureLabels.OFF;
+ private static final String DEFAULT_RANGEAUTOSELECT = ConfigureLabels.ON;
+ private static final String DEFAULT_SNAPSHOT = ConfigureLabels.ON;
+
+ private static final String DEFAULT_FUNCTIONPROFILING = ConfigureLabels.ON;
+ private static final String DEFAULT_ALLOCATION = ConfigureLabels.ON;
+ private static final String DEFAULT_FILE = ConfigureLabels.ON;
+ private static final String DEFAULT_THREAD = ConfigureLabels.ON;
+ private static final String DEFAULT_USERINTERFACE = ConfigureLabels.ON;
+ private static final String DEFAULT_EVENT = ConfigureLabels.ON;
+ private static final String DEFAULT_RECORDING = ConfigureLabels.ON;
+ private static final String DEFAULT_THEME = ConfigureLabels.ON;
+ private static final String DEFAULT_SHOWWELCOME = ConfigureLabels.OFF;
+ private static final String DEFAULT_AUTOREPLAY = ConfigureLabels.ON;
+
+ // default value Chart
+ public static final String CONFIGUREMANAGER_CHART_AVAILABLE_ITEM_LISTS = TimelineChartLabels.CPU_CHART_TITLE
+ + CommonConstants.COMMA
+ + TimelineChartLabels.CPU_CORE_CHART_TITLE
+ + CommonConstants.COMMA
+ + TimelineChartLabels.CPU_FREQUENCY_CHART_TITLE
+ + CommonConstants.COMMA
+ + TimelineChartLabels.HEAP_CHART_TITLE
+ + CommonConstants.COMMA
+ + TimelineChartLabels.PROCESS_MEMORY_CHART_TITLE
+ + CommonConstants.COMMA
+ + TimelineChartLabels.SYSTEM_MEMORY_CHART_TITLE
+ + CommonConstants.COMMA + TimelineChartLabels.FILE_CHART_TITLE;
+ public static final String CONFIGUREMANAGER_CHART_SELECTED_ITEM_LISTS = TimelineChartLabels.CPU_CHART_TITLE
+ + CommonConstants.COMMA
+ + TimelineChartLabels.CPU_CORE_CHART_TITLE
+ + CommonConstants.COMMA
+ + TimelineChartLabels.CPU_FREQUENCY_CHART_TITLE
+ + CommonConstants.COMMA
+ + TimelineChartLabels.HEAP_CHART_TITLE
+ + CommonConstants.COMMA
+ + TimelineChartLabels.PROCESS_MEMORY_CHART_TITLE
+ + CommonConstants.COMMA
+ + TimelineChartLabels.SYSTEM_MEMORY_CHART_TITLE
+ + CommonConstants.COMMA + TimelineChartLabels.FILE_CHART_TITLE;
+
+ private static ConfigureManager instance = new ConfigureManager();
+ private Map<String, String> data = new HashMap<String, String>();
+
+ private ConfigureManager() {
+ initConfigDataFromFile();
+ }
+
+ public static ConfigureManager getInstance() {
+ if (instance == null) {
+ instance = new ConfigureManager();
+ }
+ return instance;
+ }
+
+ private void parseReadedFileData(String readData) {
+ String[] splitData = readData.split(CommonConstants.EQUAL);
+ int size = splitData.length;
+
+ if (2 != size) {
+ return;
+ }
+ data.put(splitData[0], splitData[1]);
+ }
+
+ private void setCheckDefaultConfigData() {
+ if (null == data.get(ConfigureLabels.INTERNALCALL)) {
+ data.put(ConfigureLabels.INTERNALCALL, DEFAULT_INTERNALCALL);
+ }
+ if (null == data.get(ConfigureLabels.RANGEAUTOSELECT)) {
+ data.put(ConfigureLabels.RANGEAUTOSELECT, DEFAULT_RANGEAUTOSELECT);
+ }
+ if (null == data.get(ConfigureLabels.SNAPSHOT)) {
+ data.put(ConfigureLabels.SNAPSHOT, DEFAULT_SNAPSHOT);
+ }
+ if (null == data
+ .get(ConfigureLabels.CONFIGUREMANAGER_CHART_AVAILABLE_ITEM_LIST)) {
+ data.put(
+ ConfigureLabels.CONFIGUREMANAGER_CHART_AVAILABLE_ITEM_LIST,
+ CONFIGUREMANAGER_CHART_AVAILABLE_ITEM_LISTS);
+ }
+ if (null == data
+ .get(ConfigureLabels.CONFIGUREMANAGER_CHART_SELECTED_ITEM_LIST)) {
+ data.put(ConfigureLabels.CONFIGUREMANAGER_CHART_SELECTED_ITEM_LIST,
+ CONFIGUREMANAGER_CHART_SELECTED_ITEM_LISTS);
+ }
+ if (null == data.get(ConfigureLabels.SINGLETON_FOCUS_DA_PID)) {
+ data.put(ConfigureLabels.SINGLETON_FOCUS_DA_PID,
+ CommonConstants.SPACE);
+ }
+
+ if (null == data.get(ConfigureLabels.FUNCTIONPROFILING)) {
+ data.put(ConfigureLabels.FUNCTIONPROFILING,
+ DEFAULT_FUNCTIONPROFILING);
+ }
+ if (null == data.get(ConfigureLabels.ALLOCATION)) {
+ data.put(ConfigureLabels.ALLOCATION, DEFAULT_ALLOCATION);
+ }
+ if (null == data.get(ConfigureLabels.FILE)) {
+ data.put(ConfigureLabels.FILE, DEFAULT_FILE);
+ }
+ if (null == data.get(ConfigureLabels.THREAD)) {
+ data.put(ConfigureLabels.THREAD, DEFAULT_THREAD);
+ }
+ if (null == data.get(ConfigureLabels.USERINTERFACE)) {
+ data.put(ConfigureLabels.USERINTERFACE, DEFAULT_USERINTERFACE);
+ }
+ if (null == data.get(ConfigureLabels.SNAPSHOT)) {
+ data.put(ConfigureLabels.SNAPSHOT, DEFAULT_SNAPSHOT);
+ }
+ if (null == data.get(ConfigureLabels.EVENT)) {
+ data.put(ConfigureLabels.EVENT, DEFAULT_EVENT);
+ }
+ if (null == data.get(ConfigureLabels.RECORDING)) {
+ data.put(ConfigureLabels.RECORDING, DEFAULT_RECORDING);
+ }
+
+ if (null == data.get(ConfigureLabels.THEME)) {
+ data.put(ConfigureLabels.THEME, DEFAULT_THEME);
+ }
+
+ if (null == data.get(ConfigureLabels.SHOW_INITIAL)) {
+ data.put(ConfigureLabels.SHOW_INITIAL, DEFAULT_SHOWWELCOME);
+ }
+
+ if (null == data.get(ConfigureLabels.AUTO_STOP)) {
+ data.put(ConfigureLabels.AUTO_STOP, DEFAULT_AUTOREPLAY);
+ }
+
+ }
+
+ private void initConfigDataFromFile() {
+ if (null == AnalyzerPaths.CONFIG_FOLDER_PATH) {
+ return;
+ }
+
+ File configFolder = new File(AnalyzerPaths.CONFIG_FOLDER_PATH);
+ if (!configFolder.isDirectory()) {
+ configFolder.mkdirs();
+ }
+
+ File configFile = new File(configFolder,
+ AnalyzerConstants.CONFIG_FILE_NAME);
+ if (!configFile.isFile()) {
+ try {
+ configFile.createNewFile();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ } else {
+ BufferedReader in;
+ String content;
+ try {
+ in = new BufferedReader(new FileReader(configFile));
+ while (null != (content = in.readLine())) {
+ parseReadedFileData(content);
+ }
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ setCheckDefaultConfigData();
+ setConfigDataToFile();
+ }
+
+ private void setConfigDataToFile() {
+ String configFilePath = PathManager.getConfigFilePath();
+ if (null == configFilePath) {
+ return;
+ }
+
+ File configFile = new File(configFilePath);
+ FileWriter fileWriter;
+ BufferedWriter buffWriter;
+ PrintWriter printWriter;
+ try {
+ fileWriter = new FileWriter(configFile);
+ buffWriter = new BufferedWriter(fileWriter);
+ printWriter = new PrintWriter(buffWriter);
+
+ Iterator<String> iter = data.keySet().iterator();
+
+ while (iter.hasNext()) {
+ String key = (String) iter.next();
+ String val = data.get(key);
+ printWriter.println(key + CommonConstants.EQUAL + val);
+ printWriter.checkError();
+
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public String getValue(String key) {
+ if (data == null) {
+ data = new HashMap<String, String>();
+ return CommonConstants.EMPTY;
+ }
+ String ret = data.get(key);
+ if (null == ret) {
+ return CommonConstants.EMPTY;
+ } else {
+ return ret;
+ }
+ }
+
+ public int getValueBinary(String key) {
+ if (data == null) {
+ data = new HashMap<String, String>();
+ return 0;
+ }
+ String valuestr = data.get(key);
+ if (valuestr.equalsIgnoreCase(ConfigureLabels.ON)) {
+ return 1;
+ } else {
+ return 0;
+ }
+ }
+
+ public int getValueInt(String key) {
+ if (data == null) {
+ data = new HashMap<String, String>();
+ return 0;
+ }
+ String valuestr = data.get(key);
+ int intValue = 0;
+ try {
+ intValue = Integer.parseInt(valuestr);
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ }
+ return intValue;
+ }
+
+ public void setValue(String key, String val) {
+ if (data == null) {
+ data = new HashMap<String, String>();
+ } else {
+ if (null != data.get(key)) {
+ if (false == data.get(key).equals(val)) {
+ data.put(key, val);
+ setConfigDataToFile();
+ }
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.toolbar;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerPaths;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.common.DesignConstants;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.widgets.DAButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
+
+public class LicenseDialog extends Window {
+ private Shell parent = null;
+ private Shell shell = null;
+ private DACustomButton okButton = null;
+
+ public LicenseDialog(Shell parent, int style) {
+ super(parent);
+ this.parent = parent;
+ }
+
+ private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ shell.dispose();
+ }
+ };
+
+ private String getLicenseString() {
+ String configFileName = AnalyzerConstants.LICENSE_FILE_NAME;
+ StringBuffer ret = new StringBuffer(CommonConstants.EMPTY);
+ File configFolder = new File(AnalyzerPaths.CONFIG_FOLDER_PATH);
+ if (!configFolder.isDirectory()) {
+ return AnalyzerLabels.LICENSE_DIALOG_NOT_FOUND;
+ }
+
+ File configFile = new File(configFolder, configFileName);
+ if (!configFile.isFile()) {
+ return AnalyzerLabels.LICENSE_DIALOG_NOT_FOUND;
+ } else {
+ BufferedReader in;
+ String content;
+ try {
+ in = new BufferedReader(new FileReader(configFile));
+ while (null != (content = in.readLine())) {
+ ret.append(content);
+ ret.append(CommonConstants.NEW_LINE);
+ }
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ return ret.toString();
+ }
+
+ @Override
+ public int open() {
+ shell = new Shell(parent, SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM);
+ shell.setSize(608, 476 + 22);
+ FormLayout shellLayout = new FormLayout();
+ shell.setLayout(shellLayout);
+ shell.setText(AnalyzerLabels.LICENSE);
+ shell.setBackground(ColorResources.DIALOG_BG_UPPER);
+
+ Composite base = new Composite(shell.getShell(), SWT.NONE);
+ base.setLayout(new FormLayout());
+ base.setVisible(true);
+ base.setBackground(ColorResources.DIALOG_BG_UPPER);
+
+ FormData baseData = new FormData();
+ baseData.top = new FormAttachment(0, 0);
+ baseData.left = new FormAttachment(0, 0);
+ baseData.right = new FormAttachment(100, 0);
+ baseData.bottom = new FormAttachment(100, 0);
+ base.setLayoutData(baseData);
+
+ Label icon = new Label(base, SWT.TRANSPARENT);
+ icon.setImage(ImageResources.LICENSE_TIZEN_SDK);
+
+ FormData layoutData = new FormData();
+ layoutData.left = new FormAttachment(0, 0);
+ layoutData.right = new FormAttachment(100, 0);
+ layoutData.top = new FormAttachment(0, 0);
+ layoutData.height = 80;
+ icon.setLayoutData(layoutData);
+
+ // Contents
+ Text contents = new Text(base, SWT.MULTI | SWT.WRAP | SWT.READ_ONLY);
+ contents.setForeground(ColorResources.DEFAULT_FONT_COLOR);
+ contents.setBackground(ColorResources.DIALOG_BG_UPPER);
+ contents.setFont(FontResources.getDADefaultFont());
+ contents.setText(getLicenseString());
+
+ layoutData = new FormData();
+ layoutData.left = new FormAttachment(0, 18);
+ layoutData.right = new FormAttachment(100, -18);
+ layoutData.top = new FormAttachment(icon, 18);
+ layoutData.height = 327;
+ contents.setLayoutData(layoutData);
+
+ Composite buttonComp = new Composite(base, SWT.NONE);
+ FormLayout compLayout = new FormLayout();
+ buttonComp.setLayout(compLayout);
+ buttonComp.setBackground(ColorResources.DIALOG_BG_LOWER);
+ buttonComp.addPaintListener(new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ Composite comp = (Composite) e.widget;
+ Rectangle rect = comp.getClientArea();
+ e.gc.setForeground(ColorResources.DIALOG_SUNKEN_1);
+ e.gc.drawLine(rect.x, rect.y, rect.x + rect.width, rect.y);
+ e.gc.setForeground(ColorResources.DIALOG_SUNKEN_2);
+ e.gc.drawLine(rect.x, rect.y + 1, rect.x + rect.width,
+ rect.y + 1);
+ }
+ });
+ FormData compData = new FormData();
+ compData.top = new FormAttachment(contents, 0);
+ compData.left = new FormAttachment(0, 0);
+ compData.right = new FormAttachment(100, 0);
+ compData.bottom = new FormAttachment(100, 0);
+ buttonComp.setLayoutData(compData);
+
+ okButton = new DAButton(buttonComp, SWT.NONE);
+ okButton.addClickListener(okButtonListener);
+ okButton.setText(AnalyzerLabels.OK);
+ okButton.setFont(FontResources.DIALOG_BUTTON_FONT);
+
+ FormData okData = new FormData();
+ okData.top = new FormAttachment(0, 8);
+ okData.right = new FormAttachment(100, -9);
+ okData.width = DesignConstants.DA_BUTTON_WIDTH;
+ okData.height = DesignConstants.DA_BUTTON_HEIGHT;
+ okButton.setLayoutData(okData);
+
+ shell.open();
+ return 0;
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.toolbar;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.common.PathManager;
+import org.tizen.dynamicanalyzer.communicator.ResourceCommunicator;
+import org.tizen.dynamicanalyzer.handlers.ReplayTraceHandler;
+import org.tizen.dynamicanalyzer.logparser.LogParser;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
+import org.tizen.dynamicanalyzer.ui.file.FileChartManager;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
+import org.tizen.dynamicanalyzer.ui.widgets.DADialog;
+import org.tizen.dynamicanalyzer.uirecorder.UIRecorderTool;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.utils.UpdateViewTimer;
+
+public class RecordStartStopThread implements Runnable {
+ private static Thread startStopThread = null;
+ private static int count = 0;
+
+ public static void runStartStopThread() {
+ if (count == 0) {
+ count++;
+ startStopThread = new Thread(null, new RecordStartStopThread(),
+ AnalyzerConstants.START_STOP_THREAD);
+ startStopThread.start();
+ }
+ }
+
+ @Override
+ public void run() {
+ String state = AnalyzerUtil.getRecordState();
+ if (state.equals(RecordStateSourceProvider.RECORD_RECORDING)) {
+ boolean isStarted = recordStart();
+ if (isStarted) {
+ if (ReplayTraceHandler.isReplay) {
+ ReplayTraceHandler.setStopAlarm();
+ }
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ ToolbarArea.getInstance()
+ .setStartButtonEnablement(true);
+ ToolbarArea.getInstance().setStartButtonToolTipText(
+ AnalyzerLabels.STOP_TRACE);
+ ToolbarArea.getInstance().setSnapshotButtonEnablement(
+ true);
+ }
+ });
+ } else {
+ AnalyzerUtil
+ .setRecordState(RecordStateSourceProvider.RECORD_READY);
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ final Shell shell = AnalyzerUtil.getWorkbenchWindow()
+ .getShell();
+ DADialog dialog = new DADialog(shell, SWT.NONE);
+ dialog.setIcon(ImageResources.DIALOG_WARNING_ICON);
+ dialog.setMessage(AnalyzerLabels.START_TRACE_ERROR
+ + PathManager.getLogPath());
+ dialog.open();
+
+ ToolbarArea.getInstance().setToolbarState(
+ ToolbarArea.TOOLBAR_STATE_READY);
+ ToolbarArea.getInstance()
+ .setStartButtonEnablement(true);
+ }
+ });
+ }
+ } else {
+ recordStop();
+ }
+ count--;
+ }
+
+ private boolean recordStart() {
+
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ ToolbarArea.getInstance().setToolbarState(
+ ToolbarArea.TOOLBAR_STATE_RECORDING);
+ ToolbarArea.getInstance().setStartButtonEnablement(false);
+ }
+ });
+
+ AnalyzerManager.initRecordStart();
+ if (!ResourceCommunicator.connect()) {
+ System.out.println("failed to connect the device.");//$NON-NLS-1$
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ ToolbarArea.getInstance().setStartButtonEnablement(true);
+ ToolbarArea.getInstance().setSnapshotButtonEnablement(true);
+ }
+ });
+ return false;
+ }
+ if (!AnalyzerManager.isExit()) {
+ UIRecorderTool.getInstance().startRecorder();
+ ResourceCommunicator.sendStartMessage();
+ ToolbarArea.getInstance().startTimer();
+ LogParser.startLogParser();
+ FileChartManager.getInstance().startUpdateLogThread();
+ UIDataManager.getInstance().startUpdateLogThread();
+ FunctionUsageProfiler.startProfiler();
+
+ /* Timeline */
+ UpdateViewTimer.start();
+ return true;
+ }
+
+ return false;
+ }
+
+ private void recordStop() {
+ AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_READY);
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ ToolbarArea.getInstance().setToolbarState(
+ ToolbarArea.TOOLBAR_STATE_READY);
+ ToolbarArea.getInstance().setStartButtonEnablement(false);
+ StopProcessManager.getInstance().stopProcessStart(
+ AnalyzerLabels.STOP_PROCESS_DLG_SUMMARIZING_DATA);
+ }
+ });
+
+ if (ResourceCommunicator.isRunning()) {
+ ResourceCommunicator
+ .sendMessage(AnalyzerConstants.MSG_STOP
+ + CommonConstants.CMD_SPLIT + 0
+ + CommonConstants.CMD_SPLIT);
+ System.out.println("stop send message :"
+ + AnalyzerConstants.MSG_STOP + CommonConstants.CMD_SPLIT
+ + 0 + CommonConstants.CMD_SPLIT);
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.toolbar;
+
+import java.io.File;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.AnalyzerPaths;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.common.DesignConstants;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.project.Project;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.widgets.DAButton;
+import org.tizen.dynamicanalyzer.ui.widgets.DADialog;
+import org.tizen.dynamicanalyzer.ui.widgets.DAMessageBox;
+import org.tizen.dynamicanalyzer.uirecorder.RecorderXml;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
+
+public class SaveAsDialog extends DAMessageBox {
+
+ private Text textBox = null;
+ private String saveFileName = null;
+ private DAButton okButton = null;
+ private DAButton cancelButton = null;
+
+ public SaveAsDialog(Shell parentShell) {
+ super(parentShell);
+ }
+
+ protected int run() {
+ shell.setLayout(new FormLayout());
+ shell.setSize(446, 127 + 22);
+ shell.setBackground(ColorResources.DIALOG_BG_UPPER);
+
+ Label label = new Label(shell, SWT.TRANSPARENT);
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 11);
+ data.left = new FormAttachment(0, 12);
+ data.height = 15;
+ data.width = 150;
+ label.setLayoutData(data);
+ label.setForeground(ColorResources.BLACK);
+ label.setText(AnalyzerLabels.SAVE_TRACE_DLG_SAVE_FILE_NAME);
+ label.setBackground(ColorResources.DIALOG_BG_UPPER);
+
+ textBox = new Text(shell, SWT.SINGLE);
+ data = new FormData();
+ data.top = new FormAttachment(label, 10);
+ data.left = new FormAttachment(0, 9);
+ data.height = 26;
+ data.width = 410;
+ textBox.setLayoutData(data);
+ textBox.setBackground(ColorResources.VIEW_BG_COLOR);
+ textBox.addKeyListener(keyListener);
+
+ Composite buttonComp = new Composite(shell, SWT.NONE);
+ buttonComp.setLayout(new FormLayout());
+ buttonComp.setBackground(ColorResources.DIALOG_BG_LOWER);
+
+ buttonComp.addPaintListener(new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ Composite comp = (Composite) e.widget;
+ Rectangle rect = comp.getClientArea();
+ e.gc.setForeground(ColorResources.DIALOG_SUNKEN_1);
+ e.gc.drawLine(rect.x, rect.y, rect.x + rect.width, rect.y);
+ e.gc.setForeground(ColorResources.DIALOG_SUNKEN_2);
+ e.gc.drawLine(rect.x, rect.y + 1, rect.x + rect.width,
+ rect.y + 1);
+ }
+ });
+
+ FormData compData = new FormData();
+ compData.top = new FormAttachment(0, 76);
+ compData.left = new FormAttachment(0, 0);
+ compData.right = new FormAttachment(100, 0);
+ compData.bottom = new FormAttachment(100, 0);
+ buttonComp.setLayoutData(compData);
+
+ okButton = new DAButton(buttonComp, SWT.NONE);
+ data = new FormData();
+ data.top = new FormAttachment(0, 11);
+ data.left = new FormAttachment(50, -DesignConstants.DA_BUTTON_WIDTH - 4);
+ data.height = DesignConstants.DA_BUTTON_HEIGHT;
+ data.width = DesignConstants.DA_BUTTON_WIDTH;
+ okButton.setLayoutData(data);
+ okButton.setText(AnalyzerLabels.OK);
+ okButton.addClickListener(okButtonListener);
+
+ cancelButton = new DAButton(buttonComp, SWT.NONE);
+ data = new FormData();
+ data.top = new FormAttachment(0, 11);
+ data.left = new FormAttachment(50, 4);
+ data.height = DesignConstants.DA_BUTTON_HEIGHT;
+ data.width = DesignConstants.DA_BUTTON_WIDTH;
+ cancelButton.setLayoutData(data);
+ cancelButton.setText(AnalyzerLabels.CANCEL);
+ cancelButton.addClickListener(cancelButtonListener);
+
+ saveFileName = getSaveFileName();
+ if (null == saveFileName) {
+ // create warning message box
+ return result;
+ } else {
+ textBox.setText(saveFileName);
+ String textString = textBox.getText();
+ textBox.setSelection(0, textString.length());
+ }
+
+ return result;
+ }
+
+ private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ saveFileName = textBox.getText();
+ if (executeSaveTrace()) {
+ result = AnalyzerConstants.SUCCESS;
+ }
+ shell.dispose();
+ }
+ };
+
+ private DACustomButtonClickEventListener cancelButtonListener = new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ shell.dispose();
+ }
+ };
+ private KeyListener keyListener = new KeyListener() {
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ if (!checkValidFileName(textBox.getText())) {
+ okButton.setEnabled(false);
+ } else {
+ okButton.setEnabled(true);
+ }
+ }
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+
+ }
+ };
+
+ private String getSaveFileName() {
+ Project project = AnalyzerManager.getProject();
+ String sourcePath = project.getSavePath();
+ String[] splitSourcePath = null;
+ if (AnalyzerUtil.isWin()) {
+ splitSourcePath = sourcePath.split("\\\\"); //$NON-NLS-1$
+ } else if (AnalyzerUtil.isMac()) {
+ splitSourcePath = sourcePath.split("\\/"); //$NON-NLS-1$
+ } else if (AnalyzerUtil.isLinux()) {
+ splitSourcePath = sourcePath.split("\\/"); //$NON-NLS-1$
+ } else {
+ final Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
+ DADialog dialog = new DADialog(shell, SWT.NONE); // FIXME
+ dialog.setIcon(ImageResources.DIALOG_WARNING_ICON);
+ dialog.setMessage(AnalyzerLabels.OS_WARNING);
+ if (dialog.open() == true) {
+ System.exit(-1);
+ }
+ }
+
+ String saveFileName = new String(
+ splitSourcePath[splitSourcePath.length - 1]);
+ if (null == saveFileName || saveFileName.isEmpty()) {
+ return null;
+ }
+ return saveFileName;
+ }
+
+ private boolean executeSaveTrace() {
+ Project project = AnalyzerManager.getProject();
+ String sourcePath = project.getSavePath();
+
+ String targetPath = AnalyzerPaths.DYNAMIC_ANALYZER_SAVE_PATH
+ + File.separator + saveFileName;
+ String targetImagePath = targetPath + File.separator
+ + AnalyzerConstants.IMAGE_FOLDER_NAME;
+
+ File targetFolder = new File(targetImagePath);
+ if (!targetFolder.isDirectory()) {
+ targetFolder.mkdirs();
+ }
+ String targetFilePath = targetPath + File.separator
+ + AnalyzerConstants.DATABASE_NAME;
+ String sourceFilePath = sourcePath + File.separator
+ + AnalyzerConstants.DATABASE_NAME;
+ AnalyzerUtil.copyFile(sourceFilePath, targetFilePath);
+
+ String sourceUIRecorderPath = sourcePath + File.separator
+ + RecorderXml.xmlFileName;
+ String targetUIRecorderPath = targetPath + File.separator
+ + RecorderXml.xmlFileName;
+ if (new File(sourceUIRecorderPath).exists()) {
+ AnalyzerUtil.copyFile(sourceUIRecorderPath, targetUIRecorderPath);
+ }
+
+ project.setSavePath(targetPath);
+
+ // delete source file and folder
+ // save trace callstack
+ String sourceImgFolder = sourcePath + File.separator
+ + AnalyzerConstants.IMAGE_FOLDER_NAME;
+ AnalyzerUtil.saveTraceImage(sourceImgFolder, targetImagePath);
+ // small images
+ File smallFolder = new File(targetImagePath + File.separator
+ + AnalyzerConstants.SMALL_IMAGE_FOLDER_NAME);
+ if (!smallFolder.isDirectory()) {
+ smallFolder.mkdirs();
+ }
+
+ AnalyzerUtil.saveTraceImage(sourceImgFolder + File.separator
+ + AnalyzerConstants.SMALL_IMAGE_FOLDER_NAME, targetImagePath
+ + File.separator + AnalyzerConstants.SMALL_IMAGE_FOLDER_NAME);
+ project.closeConnection();
+ boolean success = AnalyzerUtil.deleteFile(new File(sourcePath));
+ AnalyzerManager.removeFromProjectList(sourcePath);
+ if (success) {
+ // add snapshot model update
+ System.out.println("save complete!!"); //$NON-NLS-1$
+ } else {
+ System.out.println("save fail..."); //$NON-NLS-1$
+ return false;
+ }
+ return true;
+ }
+
+ private boolean checkValidFileName(String str) {
+ if (str == null
+ || str.isEmpty()
+ || str.contains("\\") //$NON-NLS-1$
+ || str.contains(CommonConstants.SLASH)
+ || str.contains(CommonConstants.COLON)
+ || str.contains(CommonConstants.ASTERISK)
+ || str.contains("\\?") || str.contains("\"") //$NON-NLS-1$ //$NON-NLS-2$
+ || str.contains("<") || str.contains(">") //$NON-NLS-1$ //$NON-NLS-2$
+ || str.contains(CommonConstants.CMD_SPLIT)) {
+ return false;
+ }
+ return true;
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.toolbar;
+
+import org.eclipse.swt.widgets.Display;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.logparser.LogInserter;
+import org.tizen.dynamicanalyzer.logparser.LogParser;
+import org.tizen.dynamicanalyzer.project.Project;
+import org.tizen.dynamicanalyzer.sql.SqlManager;
+import org.tizen.dynamicanalyzer.ui.file.FileChartManager;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
+import org.tizen.dynamicanalyzer.utils.UpdateViewTimer;
+
+public class StopLogProcessor implements Runnable {
+ private static Thread stopLogProcessThread = null;
+
+ private static int count = 0;
+
+ public static void runStopLogProcessThread() {
+ if (count <= 0) {
+ count = 1;
+ stopLogProcessThread = new Thread(null, new StopLogProcessor(),
+ AnalyzerConstants.STOP_LOG_THREAD);
+ stopLogProcessThread.start();
+ }
+ }
+
+ public static void stopStopLogProcessThread() {
+ if (null != stopLogProcessThread && stopLogProcessThread.isAlive()) {
+ stopLogProcessThread.interrupt();
+ }
+ }
+
+ public static void clear() {
+ count = 0;
+ stopStopLogProcessThread();
+ }
+
+ @Override
+ public void run() {
+ Project project = AnalyzerManager.getProject();
+ int percent = 0;
+
+ LogParser.stopLogParser();
+ percent += 10;
+ StopProcessManager.getInstance().setValue(percent);
+
+ LogInserter.stopInsertLogThread();
+ percent += 10;
+ StopProcessManager.getInstance().setValue(percent);
+ FileChartManager.getInstance().stopUpdateLogThread();
+ percent += 10;
+ StopProcessManager.getInstance().setValue(percent);
+
+ FunctionUsageProfiler.stopProfiler();
+ percent += 10;
+ StopProcessManager.getInstance().setValue(percent);
+
+ LogInserter.stopInsertLogThread();
+ percent += 10;
+ StopProcessManager.getInstance().setValue(percent);
+
+ UIDataManager.getInstance().stopUpdateLogThread();
+ percent += 10;
+ StopProcessManager.getInstance().setValue(percent);
+
+ UpdateViewTimer.stop();
+ percent += 10;
+ StopProcessManager.getInstance().setValue(percent);
+
+ /* save Project */
+ System.out.println(" save project and others..."); //$NON-NLS-1$
+
+ if (null == project || !project.isValid()) {
+ System.out
+ .println("project temp save is fail : project is not valid"); //$NON-NLS-1$
+ } else {
+ project.setLastTime(ToolbarArea.getInstance().getTime());
+ SqlManager.getInstance().insertProject();
+ SqlManager.getInstance().saveLeakData();
+ SqlManager.getInstance().saveFailedData();
+ SqlManager.getInstance().saveCallStackData();
+ SqlManager.getInstance().saveCallStackUnits();
+ SqlManager.getInstance().saveAppInfo();
+ SqlManager.getInstance().saveProfilingData();
+ SqlManager.getInstance().saveProfilingChildData();
+
+ System.out.println("insert to db complete..."); //$NON-NLS-1$
+ percent += 10;
+ StopProcessManager.getInstance().setValue(percent);
+ }
+
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ StopProcessManager.getInstance().stopTrace();
+ }
+ });
+
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ ToolbarArea.getInstance().setStartButtonEnablement(true);
+ ToolbarArea.getInstance().setMainControlEnablement(true);
+ }
+ });
+ count--;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.toolbar;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
+import org.tizen.dynamicanalyzer.ui.summary.SummaryPage;
+import org.tizen.dynamicanalyzer.ui.widgets.ProgressDialog;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+
+public class StopProcessManager {
+ public static final int INIT = 0;
+ public static final int STOP_PROCESS_START = 1;
+ public static final int STOP_PROCESS_END = 2;
+
+ private static int state = INIT;
+ private ProgressDialog dialog = null;
+
+ private static StopProcessManager instance = new StopProcessManager();
+
+ public static StopProcessManager getInstance() {
+ return instance;
+ }
+
+ public void stopProcessStart(String EndMessage) {
+ if (state == STOP_PROCESS_START || state == STOP_PROCESS_END) {
+ return;
+ }
+ state = STOP_PROCESS_START;
+ AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_READY);
+ Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
+ dialog = new ProgressDialog(shell, SWT.APPLICATION_MODAL);
+ if (null != dialog) {
+ dialog.open();
+ dialog.setProgressMessage(EndMessage);
+ dialog.setProgressInfo(AnalyzerLabels.STOP_PROCESS_DLG_PLEASE_WAIT);
+ }
+ }
+
+ public void setValue(final int nSelect) {
+
+ if (null != dialog) {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ dialog.setValue(nSelect);
+ }
+ });
+ }
+ }
+
+ public void stopTrace() {
+ if (null != dialog) {
+ dialog.setValue(100);
+ AnalyzerUtil.changePage(SummaryPage.ID);
+ dialog.close();
+ state = STOP_PROCESS_END;
+ }
+ }
+
+ public int getState() {
+ return state;
+ }
+
+ public static void clear() {
+ state = INIT;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * YeongTaik Byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.toolbar;
+
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.common.DesignConstants;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
+import org.tizen.dynamicanalyzer.communicator.ResourceCommunicator;
+import org.tizen.dynamicanalyzer.handlers.ReplayTraceHandler;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
+import org.tizen.dynamicanalyzer.project.AppDesktopInfo;
+import org.tizen.dynamicanalyzer.project.Project;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
+import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
+import org.tizen.dynamicanalyzer.ui.toolbar.configuration.ConfigurationDialog;
+import org.tizen.dynamicanalyzer.ui.toolbar.opentrace.OpenTraceDialog;
+import org.tizen.dynamicanalyzer.ui.widgets.DADialog;
+import org.tizen.dynamicanalyzer.ui.widgets.TitleComboPopupRenderer;
+import org.tizen.dynamicanalyzer.ui.widgets.TitleComboRenderer;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonRenderer;
+import org.tizen.dynamicanalyzer.widgets.button.toggle.DACustomToggleButton;
+import org.tizen.dynamicanalyzer.widgets.combo.DACustomCombo;
+import org.tizen.dynamicanalyzer.widgets.combo.DACustomComboSelectionListener;
+import org.tizen.dynamicanalyzer.widgets.timer.TimerClock;
+
+public class ToolbarArea {
+ String selectedDevice = null;
+ AppDesktopInfo selectedApp = null;
+
+ private Shell shell;
+ private static ToolbarArea coolbarArea;
+
+ // Base Composite
+ private Composite baseComposite;
+
+ // Toolbar
+ private Composite toolbarComposite;
+ private DACustomCombo deviceCombo;
+ private DACustomCombo appCombo;
+
+ private DACustomButton startButton;
+ private TimerClock timerClock;
+ private DACustomButton saveTraceButton;
+ private DACustomButton openTraceButton;
+ private DACustomButton replayButton;
+ private DACustomButton settingsButton;
+ private DACustomButton aboutButton;
+
+ private DACustomToggleButton snapshotButton;
+ private DACustomToggleButton viewSourceButton;
+
+ private Cursor cursor;
+
+ private static final int TIMER_WIDTH = 121;
+ private static int COMBO_FIRST_INDEX = 0;
+
+ public static boolean bThreadPageWork = false; // FIXME
+ public static boolean bUIPageWork = false; // FIXME
+
+ public static final int TOOLBAR_STATE_RECORDING = 0;
+ public static final int TOOLBAR_STATE_READY = 1;
+
+ public String getSelectedDevice() {
+ return selectedDevice;
+ }
+
+ public void setSelectedDevice(String selectedDevice) {
+ this.selectedDevice = selectedDevice;
+ }
+
+ public AppDesktopInfo getSelectedApp() {
+ return selectedApp;
+ }
+
+ public void setSelectedApp(AppDesktopInfo selectedApp) {
+ this.selectedApp = selectedApp;
+ }
+
+ public static void createInstance(IWorkbenchWindowConfigurer configurer,
+ Shell shell) {
+ if (null == coolbarArea) {
+ coolbarArea = new ToolbarArea(configurer, shell);
+ }
+ }
+
+ public static ToolbarArea getInstance() {
+ if (null != coolbarArea) {
+ return coolbarArea;
+ } else {
+ return null;
+ }
+ }
+
+ public DACustomCombo getDeviceCombo() {
+ return deviceCombo;
+ }
+
+ public DACustomCombo getAppCombo() {
+ return appCombo;
+ }
+
+ public int setCursor(int oldStyle, int newStyle) {
+ if (oldStyle == newStyle)
+ return newStyle;
+ if (null != cursor)
+ cursor.dispose();
+ cursor = new Cursor(null, newStyle);
+ shell.setCursor(cursor);
+ return newStyle;
+ }
+
+ private ToolbarArea(IWorkbenchWindowConfigurer configurer, Shell sh) {
+ shell = sh;
+
+ // Sets shell layout.
+ final FillLayout shellLayout = new FillLayout();
+ shellLayout.marginHeight = 0;
+ shellLayout.marginWidth = 1;
+ shell.setLayout(shellLayout);
+
+ // Creates base composite
+ baseComposite = new Composite(shell, SWT.NONE);
+ baseComposite.setLayout(new FormLayout());
+
+ // Creates toolbar.
+ toolbarComposite = new Composite(baseComposite, SWT.NONE);
+ toolbarComposite.setLayout(new FormLayout());
+ toolbarComposite.setBackground(ColorResources.COOLBAR_BG_COLOR);
+
+ createToolbar(toolbarComposite);
+
+ Control page = configurer.createPageComposite(baseComposite);
+
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.left = new FormAttachment(0, 0);
+ data.right = new FormAttachment(100, 0);
+ data.height = 38;
+ toolbarComposite.setLayoutData(data);
+
+ data = new FormData();
+ data.top = new FormAttachment(toolbarComposite, 0, SWT.BOTTOM);
+ data.left = new FormAttachment(0, 0);
+ data.right = new FormAttachment(100, 0);
+ data.bottom = new FormAttachment(100, 0);
+ page.setLayoutData(data);
+
+ configurer.getWindow().getShell().layout(true);
+ if (null != page) {
+ ((Composite) page).layout(true);
+ }
+ }
+
+ public void setRepalyButtonEnable(final boolean enabled) {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ Project p = AnalyzerManager.getProject();
+ if (null == p || !enabled) {
+ replayButton.setEnabled(false);
+ return;
+ }
+
+ String appName = p.getAppName();
+ String text = appCombo.getText();
+ if (null != appName && !appName.isEmpty() && !text.isEmpty()
+ && appName.equals(text)) {
+ replayButton.setEnabled(true);
+ return;
+ }
+
+ replayButton.setEnabled(false);
+ }
+ });
+ }
+
+ private void addToolbarListeners() {
+ deviceCombo.addSelectionListener(new DACustomComboSelectionListener() {
+
+ @Override
+ public void selectionEvent(DACustomCombo combo) {
+ String serial = combo.getText();
+ DACommunicator.setSelectedDeviceBySerial(serial);
+ setSelectedDevice(serial);
+ if (null != serial && !serial.isEmpty()) {
+ initAppCombo();
+ }
+ setRepalyButtonEnable(true);
+ }
+ });
+
+ appCombo.addSelectionListener(new DACustomComboSelectionListener() {
+
+ @Override
+ public void selectionEvent(DACustomCombo combo) {
+ String appName = combo.getText();
+ if (null != appName && !appName.isEmpty()) {
+ AppDesktopInfo selectedApp = DACommunicator
+ .getAppDesktopInfoByName(appName);
+
+ if (null != selectedApp) {
+ DACommunicator.setSelectedApp(selectedApp);
+ setSelectedApp(selectedApp);
+ DACommunicator.getSelectedDevice().setSelectedAppName(
+ selectedApp.getName());
+ }
+
+ if (null != DACommunicator.getSelectedDevice()) {
+ AnalyzerUtil
+ .setRecordState(RecordStateSourceProvider.RECORD_READY);
+ startButton.setEnabled(true);
+ setRepalyButtonEnable(true);
+ }
+ }
+
+ }
+ });
+
+ appCombo.addListener(SWT.MouseUp, new Listener() {
+
+ @Override
+ public void handleEvent(Event event) {
+ if (!appCombo.isChildShellOpened()) {
+ List<AppDesktopInfo> apps = DACommunicator
+ .getAppListFromTarget();
+ if (apps.isEmpty()) {
+ return;
+ }
+ String selectedApp = appCombo.getText();
+ appCombo.initCombo();
+ int size = apps.size();
+ for (int i = 0; i < size; i++) {
+ appCombo.add(apps.get(i).getName());
+ }
+ appCombo.setText(selectedApp);
+ }
+ }
+ });
+
+ startButton.addClickListener(new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ if (checkValidApplication()) {
+ String state = AnalyzerUtil.getRecordState();
+ if (state.equals(RecordStateSourceProvider.RECORD_READY)) {
+ startTrace();
+ } else {
+ stopTrace();
+ }
+ } else {
+ // fail message box
+ Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
+ DADialog warning = new DADialog(shell, SWT.NONE);
+ warning.setMessage(AnalyzerLabels.INVALID_APPLICATION);
+ warning.setIcon(ImageResources.DIALOG_WARNING_ICON);
+ warning.open();
+ }
+ }
+ });
+
+ saveTraceButton
+ .addClickListener(new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ Shell shell = AnalyzerUtil.getWorkbenchWindow()
+ .getShell();
+ SaveAsDialog dialog = new SaveAsDialog(shell);
+ int result = dialog.open();
+ if (AnalyzerConstants.SUCCESS == result) {
+ button.setEnabled(false);
+ }
+ }
+ });
+
+ openTraceButton
+ .addClickListener(new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ Shell shell = AnalyzerUtil.getWorkbenchWindow()
+ .getShell();
+ OpenTraceDialog dialog = new OpenTraceDialog(shell);
+ dialog.open();
+ }
+ });
+
+ replayButton.addClickListener(new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ String state = AnalyzerUtil.getRecordState();
+ if (state.equals(RecordStateSourceProvider.RECORD_READY)) {
+ if (AnalyzerUtil.executeCommand(ReplayTraceHandler.ID) != ReplayTraceHandler.FAILED) {
+ startTrace();
+ }
+ }
+ }
+ });
+
+ settingsButton.addClickListener(new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
+ ConfigurationDialog dialog = new ConfigurationDialog(shell,
+ SWT.NONE); // FIXME
+ dialog.open();
+ }
+ });
+
+ aboutButton.addClickListener(new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
+ AboutDialog dialog = new AboutDialog(shell, SWT.NONE); // FIXME
+ dialog.open();
+ }
+ });
+
+ viewSourceButton
+ .addClickListener(new DACustomButtonClickEventListener() {
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ // TODO : use for test code...
+
+ /** for disconnect test **/
+ // DACommunicator.testDisConnected();
+
+ /** for theme test **/
+ // if (toggle.isToggled()) {
+ // AnalyzerManager.setTheme(DAThemeBlack.getInstance());
+ // } else {
+ // AnalyzerManager.setTheme(DAThemeWhite.getInstance());
+ // }
+ // BaseView view = (BaseView)
+ // AnalyzerUtil.getView(BaseView.ID);
+ // FilePage filePage = new
+ // FilePage(view.getMainTab().getContentComposite(),
+ // SWT.NONE);
+ // view.getMainTab().addView(filePage,
+ // AnalyzerLabels.COOLBAR_AREA_FILE);
+ }
+ });
+
+ snapshotButton.addClickListener(new DACustomButtonClickEventListener() {
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+// if (snapshotButton.isToggled()) {
+// ResourceCommunicator
+// .sendSnapshotMessage(AnalyzerConstants.OPT_SNAPSHOT);
+// ConfigureManager.getInstance().setValue(
+// ConfigureLabels.SNAPSHOT, CommonConstants.ON);
+// } else {
+// ResourceCommunicator
+// .sendSnapshotMessage(AnalyzerConstants.OPTION_OFF);
+// ConfigureManager.getInstance().setValue(
+// ConfigureLabels.SNAPSHOT, CommonConstants.OFF);
+// }
+ }
+ });
+ }
+
+ public void setStartButtonToolTipText(final String text) {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ startButton.setToolTipText(text);
+ }
+ });
+
+ }
+
+ public void startTrace() {
+ AnalyzerUtil.changePage(TimelinePage.ID);
+ AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_RECORDING);
+ RecordStartStopThread.runStartStopThread();
+ }
+
+ public void stopTrace() {
+ AnalyzerManager.getProject().setStopTime(getTime());
+ AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_READY);
+ RecordStartStopThread.runStartStopThread();
+ }
+
+ private void createToolbar(Composite parent) {
+
+ /** Creates control composite **/
+ /** which contains start, TimerClock, save, open and replay buttons. */
+
+ // Creates start button.
+ startButton = new DACustomButton(parent, ImageResources.START,
+ ImageResources.START_PUSH, ImageResources.START_HOVER,
+ ImageResources.START_DISABLE);
+ startButton.setEnabled(false);
+ startButton.setToolTipText(AnalyzerLabels.START_TRACE);
+
+ // Creates TimerClock widget.
+ timerClock = new TimerClock(parent, SWT.NONE);
+ timerClock.setBgImage(ImageResources.TIMER);
+ timerClock.setFont(FontResources.TIMER);
+
+ // // Creates save trace button.
+ saveTraceButton = new DACustomButton(parent, ImageResources.SAVE,
+ ImageResources.SAVE_PUSH, ImageResources.SAVE_HOVER,
+ ImageResources.SAVE_DISABLE);
+ saveTraceButton.setEnabled(false);
+ saveTraceButton.setToolTipText(AnalyzerLabels.SAVE_TRACE);
+
+ // // Creates open trace button.
+ openTraceButton = new DACustomButton(parent, ImageResources.OPEN,
+ ImageResources.OPEN_PUSH, ImageResources.OPEN_HOVER,
+ ImageResources.OPEN_DISABLE);
+ openTraceButton.setToolTipText(AnalyzerLabels.OPEN_TRACE);
+
+ // Creates replay button.
+ replayButton = new DACustomButton(parent, ImageResources.REPLAY,
+ ImageResources.REPLAY_PUSH, ImageResources.REPLAY_HOVER,
+ ImageResources.REPLAY_DISABLE);
+ replayButton.setToolTipText(AnalyzerLabels.REPLAY);
+
+ // Creates setting button
+ settingsButton = new DACustomButton(parent, ImageResources.SETTINGS,
+ ImageResources.SETTINGS_PUSH, ImageResources.SETTINGS_HOVER,
+ ImageResources.SETTINGS_DISABLE);
+ settingsButton.setToolTipText(AnalyzerLabels.SETTING);
+
+ // Creates about button.
+ aboutButton = new DACustomButton(parent, ImageResources.ABOUT,
+ ImageResources.ABOUT_PUSH, ImageResources.ABOUT_HOVER,
+ ImageResources.ABOUT_DISABLE);
+ aboutButton.setToolTipText(AnalyzerLabels.ABOUT);
+
+ // Creates view source button.
+ viewSourceButton = new DACustomToggleButton(parent,
+ ImageResources.VIEW_SOURCE_NORMAL,
+ ImageResources.VIEW_SOURCE_PUSH,
+ ImageResources.VIEW_SOURCE_HOVER,
+ ImageResources.VIEW_SOURCE_DISABLE,
+ ImageResources.VIEW_SOURCE_TOGGLE,
+ ImageResources.VIEW_SOURCE_TOGGLE_HOVER,
+ ImageResources.VIEW_SOURCE_TOGGLE_PUSH);
+ viewSourceButton.setToolTipText(AnalyzerLabels.VIEW_SOURCE);
+
+ // Creates snapshot on/off button.
+ snapshotButton = new DACustomToggleButton(parent,
+ ImageResources.SCREEN_SHOT_NORMAL,
+ ImageResources.SCREEN_SHOT_PUSH,
+ ImageResources.SCREEN_SHOT_HOVER,
+ ImageResources.SCREEN_SHOT_DISABLE,
+ ImageResources.SCREEN_SHOT_TOGGLE,
+ ImageResources.SCREEN_SHOT_TOGGLE_HOVER,
+ ImageResources.SCREEN_SHOT_TOGGLE_PUSH);
+ snapshotButton.setToolTipText(AnalyzerLabels.SNAPSHOT_ENABLE);
+ setSnapshotButtonEnablement(true);
+
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 4);
+ data.left = new FormAttachment(0, 345);
+ data.width = 32;
+ data.height = 30;
+ startButton.setLayoutData(data);
+
+ data = new FormData();
+ data.top = new FormAttachment(0, 4);
+ data.left = new FormAttachment(startButton, 0);
+ data.width = TIMER_WIDTH;
+ data.height = 30;
+ timerClock.setLayoutData(data);
+
+ data = new FormData();
+ data.top = new FormAttachment(0, 4);
+ data.left = new FormAttachment(timerClock, 0, SWT.RIGHT);
+ data.width = 31;
+ data.height = 30;
+ saveTraceButton.setLayoutData(data);
+
+ data = new FormData();
+ data.top = new FormAttachment(0, 4);
+ data.left = new FormAttachment(saveTraceButton, 0, SWT.RIGHT);
+ data.width = 31;
+ data.height = 30;
+ openTraceButton.setLayoutData(data);
+
+ data = new FormData();
+ data.top = new FormAttachment(0, 4);
+ data.left = new FormAttachment(openTraceButton, 0, SWT.RIGHT);
+ data.width = 31;
+ data.height = 30;
+ replayButton.setLayoutData(data);
+
+ data = new FormData();
+ data.top = new FormAttachment(0, 4);
+ data.right = new FormAttachment(100, -4);
+ data.width = 34;
+ data.height = 30;
+ aboutButton.setLayoutData(data);
+
+ data = new FormData();
+ data.top = new FormAttachment(0, 4);
+ data.right = new FormAttachment(aboutButton, 0);
+ data.width = 34;
+ data.height = 30;
+ settingsButton.setLayoutData(data);
+
+ data = new FormData();
+ data.top = new FormAttachment(0, 4);
+ data.right = new FormAttachment(settingsButton, -5);
+ data.width = 32;
+ data.height = 30;
+ viewSourceButton.setLayoutData(data);
+
+ data = new FormData();
+ data.top = new FormAttachment(0, 4);
+ data.right = new FormAttachment(viewSourceButton, 0);
+ data.width = 0;
+ data.height = 0;
+ snapshotButton.setLayoutData(data);
+
+
+
+
+
+ /** device and application combo */
+ // Creates device combo.
+ deviceCombo = new DACustomCombo(parent, SWT.NONE);
+ deviceCombo.setImages(ImageResources.COMBO_NORMAL,
+ ImageResources.COMBO_HOVER, ImageResources.COMBO_PUSH,
+ ImageResources.COMBO_DISABLE);
+ deviceCombo.setComboButtonGradation(
+ ColorResources.DEVICE_APPLICATION_BUTTON_NORMAL_START,
+ ColorResources.DEVICE_APPLICATION_BUTTON_NORMAL_END,
+ ColorResources.DEVICE_APPLICATION_BUTTON_PUSH_START,
+ ColorResources.DEVICE_APPLICATION_BUTTON_PUSH_END,
+ ColorResources.DEVICE_APPLICATION_BUTTON_HOVER_START,
+ ColorResources.DEVICE_APPLICATION_BUTTON_HOVER_END,
+ ColorResources.DEVICE_APPLICATION_BUTTON_DISABLE_START,
+ ColorResources.DEVICE_APPLICATION_BUTTON_DISABLE_END);
+ deviceCombo.setButtonImages(ImageResources.COMBO_DROPDOWN_UP,
+ ImageResources.COMBO_DROPDOWN_DOWN);
+ deviceCombo.setEnabled(true);
+ deviceCombo.setItemHeight(DesignConstants.COMBO_DEVICE_HEIGHT);
+ deviceCombo.setComboRender(new TitleComboRenderer());
+ deviceCombo.setComboPopupRender(new TitleComboPopupRenderer());
+ deviceCombo.setButtonRenderer(new DACustomButtonRenderer());
+
+ Label bracketLabel = new Label(parent, SWT.CENTER | SWT.TRANSPARENT);
+ bracketLabel.setImage(ImageResources.BRACKET);
+
+ // Creates application combo.
+ appCombo = new DACustomCombo(parent, SWT.NONE);
+ appCombo.setImages(ImageResources.COMBO_NORMAL,
+ ImageResources.COMBO_HOVER, ImageResources.COMBO_PUSH,
+ ImageResources.COMBO_DISABLE);
+ appCombo.setComboButtonGradation(
+ ColorResources.DEVICE_APPLICATION_BUTTON_NORMAL_START,
+ ColorResources.DEVICE_APPLICATION_BUTTON_NORMAL_END,
+ ColorResources.DEVICE_APPLICATION_BUTTON_PUSH_START,
+ ColorResources.DEVICE_APPLICATION_BUTTON_PUSH_END,
+ ColorResources.DEVICE_APPLICATION_BUTTON_HOVER_START,
+ ColorResources.DEVICE_APPLICATION_BUTTON_HOVER_END,
+ ColorResources.DEVICE_APPLICATION_BUTTON_DISABLE_START,
+ ColorResources.DEVICE_APPLICATION_BUTTON_DISABLE_END);
+ appCombo.setButtonImages(ImageResources.COMBO_DROPDOWN_UP,
+ ImageResources.COMBO_DROPDOWN_DOWN);
+ appCombo.setEnabled(false);
+ appCombo.setItemHeight(DesignConstants.COMBO_APP_HEIGHT);
+ appCombo.setComboRender(new TitleComboRenderer());
+ appCombo.setComboPopupRender(new TitleComboPopupRenderer());
+ appCombo.setButtonRenderer(new DACustomButtonRenderer());
+
+ // Sets layout data.
+ data = new FormData();
+ data.top = new FormAttachment(0, DesignConstants.COMBO_DEVICE_TOP);
+ data.left = new FormAttachment(0, DesignConstants.COMBO_DEVICE_LEFT);
+ data.width = DesignConstants.COMBO_DEVICE_WIDTH;
+ data.height = DesignConstants.COMBO_DEVICE_HEIGHT;
+ deviceCombo.setLayoutData(data);
+
+ data = new FormData();
+ data.top = new FormAttachment(0, DesignConstants.COMBO_DEVICE_TOP);
+ data.left = new FormAttachment(deviceCombo, 0, SWT.RIGHT);
+ data.width = 18;
+ data.height = 24;
+ bracketLabel.setLayoutData(data);
+
+ data = new FormData();
+ data.top = new FormAttachment(0, DesignConstants.COMBO_APP_TOP);
+ data.left = new FormAttachment(bracketLabel, 0, SWT.RIGHT);
+ data.width = DesignConstants.COMBO_APP_WIDTH;
+ data.height = DesignConstants.COMBO_APP_HEIGHT;
+ appCombo.setLayoutData(data);
+
+ // Adds toolbar listeners.
+ addToolbarListeners();
+ }
+
+ public void dispose() {
+ if (null != cursor) {
+ cursor.dispose();
+ }
+ }
+
+ public long getTime() {
+ return timerClock.getTimeInMicroseconds();
+ }
+
+ public void setTime(final long time) {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ timerClock.setTime(time);
+ }
+ });
+ }
+
+ public TimerClock getTimer() {
+ return timerClock;
+ }
+
+ private void initAppCombo() {
+ String device = deviceCombo.getText();
+ if (device.isEmpty()) {
+ appCombo.setEnabled(false);
+ return;
+ }
+ appCombo.setEnabled(true);
+ List<AppDesktopInfo> apps = DACommunicator.getAppListFromTarget();
+ if (apps.isEmpty()) {
+ return;
+ }
+
+ appCombo.initCombo();
+ int size = apps.size();
+ for (int i = 0; i < size; i++) {
+ appCombo.add(apps.get(i).getName());
+ }
+ if (size > 0) {
+ String appName = DACommunicator.getSelectedDevice()
+ .getSelectedAppName();
+ if (null == appName) {
+ appCombo.select(0);
+ setSelectedApp(apps.get(0));
+ DACommunicator.setSelectedApp(apps.get(0));
+ DACommunicator.getSelectedDevice().setSelectedAppName(
+ apps.get(0).getName());
+ } else {
+ AppDesktopInfo appInfo = DACommunicator
+ .getAppDesktopInfoByName(appName);
+ appCombo.setText(appName);
+ setSelectedApp(appInfo);
+ DACommunicator.setSelectedApp(appInfo);
+ }
+ startButton.setEnabled(true);
+
+ } else {
+ appCombo.add(CommonConstants.EMPTY);
+ }
+ }
+
+ public void initToolbarEnablement() {
+ deviceCombo.initCombo();
+ appCombo.initCombo();
+ startButton.setEnabled(false);
+ replayButton.setEnabled(false);
+ saveTraceButton.setEnabled(false);
+ }
+
+ public void setDeviceComboItems(List<String> items) {
+ deviceCombo.initCombo();
+ if (null == items || items.isEmpty()) {
+ deviceCombo.add(CommonConstants.EMPTY);
+ deviceCombo.select(0);
+ appCombo.initCombo();
+ appCombo.setEnabled(false);
+ setRepalyButtonEnable(false);
+ setStartButtonEnablement(false);
+ return;
+ } else {
+ int size = items.size();
+ int selIndex = 0;
+ String selDevice = getSelectedDevice();
+ for (int i = 0; i < size; i++) {
+ deviceCombo.add(items.get(i));
+ if (items.get(i).equals(selDevice)) {
+ selIndex = i;
+ }
+ }
+ deviceCombo.select(selIndex);
+ setSelectedDevice(items.get(selIndex));
+ deviceCombo.setToolTipText(items.get(selIndex));
+ initAppCombo();
+ appCombo.setEnabled(true);
+ setRepalyButtonEnable(true);
+ setStartButtonEnablement(true);
+ }
+ }
+
+ public void setAppComboItems(List<String> items) {
+ appCombo.initCombo();
+
+ if (null == items) {
+ return;
+ }
+
+ int itemsSize = items.size();
+ if (0 != itemsSize) {
+ appCombo.initCombo();
+ for (int i = 0; i < itemsSize; i++) {
+ appCombo.add(items.get(i));
+ }
+ appCombo.select(COMBO_FIRST_INDEX);
+ AppDesktopInfo appInfo = DACommunicator
+ .getAppDesktopInfoByName(items.get(0));
+ DACommunicator.setSelectedApp(appInfo);
+ DACommunicator.getSelectedDevice().setSelectedAppName(
+ appInfo.getName());
+ appCombo.setToolTipText(appCombo.getItem(0));
+ startButton.setEnabled(true);
+ } else {
+ appCombo.add(CommonConstants.EMPTY);
+ }
+ }
+
+ public void setAppComboText(final String text) {
+ AppDesktopInfo appInfo = DACommunicator.getAppDesktopInfoByName(text);
+ if (null != appInfo) {
+ DACommunicator.setSelectedApp(appInfo);
+ DACommunicator.getSelectedDevice().setSelectedAppName(
+ appInfo.getName());
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ appCombo.setText(text);
+ }
+ });
+ }
+ }
+
+ public void setAppComboTextByAppId(String id) {
+ AppDesktopInfo appInfo = DACommunicator.getAppDesktopInfoByAppId(id);
+ if (null != appInfo) {
+ DACommunicator.setSelectedApp(appInfo);
+ DACommunicator.getSelectedDevice().setSelectedAppName(
+ appInfo.getName());
+ appCombo.setText(appInfo.getName());
+ }
+ }
+
+ public void setDeviceComboText(String text) {
+ DACommunicator.setSelectedDeviceBySerial(text);
+ deviceCombo.setText(text);
+ initAppCombo();
+ }
+
+ public boolean isSourceViewEnabled() {
+ return viewSourceButton.isToggled();
+ }
+
+ public void setStartButtonEnablement(boolean enabled) {
+ startButton.setEnabled(enabled);
+ }
+
+ private void setStartButtonImagesToStop(boolean isStarted) {
+ if (isStarted) {
+ startButton.setImages(ImageResources.STOP,
+ ImageResources.STOP_PUSH, ImageResources.STOP_HOVER,
+ ImageResources.START_DISABLE);
+ startButton.setToolTipText(AnalyzerLabels.STOP_TRACE);
+ } else {
+ startButton.setImages(ImageResources.START,
+ ImageResources.START_PUSH, ImageResources.START_HOVER,
+ ImageResources.START_DISABLE);
+ startButton.setToolTipText(AnalyzerLabels.START_TRACE);
+ }
+ }
+
+ public void setMainControlEnablement(boolean enabled) {
+ deviceCombo.setEnabled(enabled);
+ appCombo.setEnabled(enabled);
+ saveTraceButton.setEnabled(enabled);
+ openTraceButton.setEnabled(enabled);
+ setRepalyButtonEnable(enabled);
+ }
+
+ public void setSnapshotButtonEnablement(boolean enabled) {
+ snapshotButton.setEnabled(enabled);
+ if (enabled) {
+ String snapshotEnable = ConfigureManager.getInstance().getValue(
+ ConfigureLabels.SNAPSHOT);
+ if (null != snapshotEnable && !snapshotEnable.isEmpty()
+ && snapshotEnable.equals(CommonConstants.ON)) {
+ snapshotButton.setToggled(true);
+ } else {
+ snapshotButton.setToggled(false);
+ }
+ }
+ }
+
+ public void startTimer() {
+ timerClock.start();
+ }
+
+ public void stopTimer() {
+ timerClock.stop();
+ }
+
+ public void clearTimer() {
+ timerClock.clear();
+ }
+
+ public void setSourceViewEnable(final boolean enabled) {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ viewSourceButton.setEnabled(enabled);
+ }
+ });
+ }
+
+ public void setSourceViewState(final boolean enabled) {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ viewSourceButton.setToggled(enabled);
+ }
+ });
+ }
+
+ public boolean getSourceViewEnable() {
+ int state = viewSourceButton.getState();
+ if (state == DACustomButton.STATE_DISABLE) {
+ return false;
+ }
+ return true;
+ }
+
+ public void setSaveButtonEnable(boolean enabled) {
+ saveTraceButton.setEnabled(enabled);
+ }
+
+ public void setSourceViewTooltip(final String tooltip) {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ viewSourceButton.setToolTipText(tooltip);
+ }
+ });
+ }
+
+ public void setToolbarState(int state) {
+ if (state == TOOLBAR_STATE_RECORDING) {
+ setStartButtonImagesToStop(true);
+ setMainControlEnablement(false);
+ startButton.setEnabled(false);
+ setSnapshotButtonEnablement(false);
+ } else {
+ setStartButtonImagesToStop(false);
+ setMainControlEnablement(true);
+ startButton.setEnabled(true);
+ }
+ }
+
+ private boolean checkValidApplication() {
+ List<AppDesktopInfo> apps = DACommunicator.getAppListFromTarget();
+ if (apps.isEmpty()) {
+ return false;
+ }
+ String selectedApp = appCombo.getText();
+ appCombo.initCombo();
+ int size = apps.size();
+ for (int i = 0; i < size; i++) {
+ appCombo.add(apps.get(i).getName());
+ }
+ int index = appCombo.getItems().indexOf(selectedApp);
+ if (index >= 0) {
+ appCombo.setText(selectedApp);
+ return true;
+ } else {
+ appCombo.setText(CommonConstants.EMPTY);
+ return false;
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.toolbar;
+
+import java.util.TimerTask;
+
+import org.eclipse.swt.widgets.Display;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
+
+
+public class UpdateTimerTask extends TimerTask {
+
+ @Override
+ public void run() {
+
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ DAPageComposite page = AnalyzerManager.getCurrentPage();
+ page.updatePage();
+ }
+ });
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * HyunJong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.toolbar.configuration;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.communicator.ResourceCommunicator;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.DAButton;
+import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
+
+public class ConfigurationDialog {
+ private Shell parent = null;
+ private Shell window = null;
+ private DACustomButton applyButton = null;
+ private DACustomButton okButton = null;
+ private DACustomButton cancelButton = null;
+ DAPageComposite topComposite = null;
+ DATabComposite tabView = null;
+
+
+ public ConfigurationDialog(Shell parent, int style) {
+ this.parent = parent;
+ ConfigurationDialogValues.getInstance().setSettingValueFromConfigFile();
+ }
+
+ private DACustomButtonClickEventListener applyButtonListener = new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ doApply();
+ }
+ };
+
+ private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ doApply();
+ window.dispose();
+ }
+ };
+ private DACustomButtonClickEventListener cancelButtonListener = new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ doBack();
+ window.dispose();
+ }
+ };
+
+ private void doApply() {
+ ConfigurationDialogValues.getInstance().applySettingValueToConfigFile();
+ ResourceCommunicator.sendSnapshotMessage(ResourceCommunicator.getConfiguration());
+ }
+
+ private void doBack() {
+ ConfigurationDialogValues.getInstance().setSettingValueFromConfigFile();
+ }
+
+ public int open() {
+ window = new Shell(parent, SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM);
+ window.setSize(608, 480);
+ window.setLayout(new FormLayout());
+ window.setText(AnalyzerLabels.CONFIGURATION);
+
+ //banner
+ Label banner = new Label(window, SWT.TRANSPARENT);
+ banner.setBackground(ColorResources.WINDOW_BG_COLOR);
+ banner.setImage(ImageResources.CONFIGURATION_BANNER_IMAGE);
+
+ FormData labelData = new FormData();
+ labelData.top = new FormAttachment(0, 0);
+ labelData.left = new FormAttachment(0, 0);
+ labelData.right = new FormAttachment(100, 0);
+ labelData.height = 80;
+ banner.setLayoutData(labelData);
+
+ Composite tabContentsComp = new Composite(window, SWT.NONE);
+ FormLayout compLayout = new FormLayout();
+ tabContentsComp.setLayout(compLayout);
+ tabContentsComp.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
+
+ FormData compData = new FormData();
+ compData = new FormData();
+ compData.top = new FormAttachment(banner, 0);
+ compData.left = new FormAttachment(0, 0);
+ compData.right = new FormAttachment(100, 0);
+ compData.bottom = new FormAttachment(100, -50);
+ tabContentsComp.setLayoutData(compData);
+
+ //tab
+ tabView = new DATabComposite(tabContentsComp, SWT.DOUBLE_BUFFERED);
+ tabView.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
+ tabView.setTabWidth(120);
+ compData = new FormData();
+ compData = new FormData();
+ compData.top = new FormAttachment(0, 0);
+ compData.left = new FormAttachment(0, 0);
+ compData.right = new FormAttachment(100, 0);
+ compData.bottom = new FormAttachment(100, 0);
+ tabView.setLayoutData(compData);
+
+ Composite featuresPage = new ConfigurationDialogFeaturesPage(tabView.getContentComposite(), SWT.NONE);
+ tabView.addView(featuresPage, false);
+
+ Composite settingPage = new ConfigurationDialogSettingPage(tabView.getContentComposite(), SWT.NONE);
+ tabView.addView(settingPage, false);
+
+ // button
+ Composite buttonContentsComp = new Composite(window, SWT.NONE);
+ buttonContentsComp.addPaintListener(new PaintListener() {
+ @Override
+ public void paintControl(PaintEvent e) {
+ Composite composite = (Composite) e.widget;
+ Rectangle rect = composite.getClientArea();
+ e.gc.setForeground(ColorResources.CONFIGURATION_SUNKEN_LINE_UP_COLOR);
+ e.gc.drawLine(0, 0, rect.x+ rect.width, 0);
+ }
+ });
+ compLayout = new FormLayout();
+ buttonContentsComp.setLayout(compLayout);
+ buttonContentsComp.setBackground(ColorResources.CONFIGURATION_BUTTON_COVER_BACKGROUND_COLOR);
+
+ compData = new FormData();
+ compData.top = new FormAttachment(tabContentsComp, 0);
+ compData.left = new FormAttachment(0, 0);
+ compData.right = new FormAttachment(100, 0);
+ compData.bottom = new FormAttachment(100, 0);
+ buttonContentsComp.setLayoutData(compData);
+
+ cancelButton = new DAButton(buttonContentsComp, SWT.NONE);
+ cancelButton.addClickListener(cancelButtonListener);
+ cancelButton.setText(AnalyzerLabels.CANCEL);
+ cancelButton.setFont(FontResources.DIALOG_BUTTON_FONT);
+ FormData buttonData = new FormData();
+ buttonData.right = new FormAttachment(100, -9);
+ buttonData.top = new FormAttachment(0, 11);
+ buttonData.width = 100;
+ buttonData.height = 28;
+ cancelButton.setLayoutData(buttonData);
+
+ okButton = new DAButton(buttonContentsComp, SWT.NONE);
+ okButton.addClickListener(okButtonListener);
+ okButton.setText(AnalyzerLabels.OK);
+ okButton.setFont(FontResources.DIALOG_BUTTON_FONT);
+ buttonData = new FormData();
+ buttonData.right = new FormAttachment(cancelButton, -8);
+ buttonData.top = new FormAttachment(0, 11);
+ buttonData.width = 100;
+ buttonData.height = 28;
+ okButton.setLayoutData(buttonData);
+
+ applyButton = new DAButton(buttonContentsComp, SWT.NONE);
+ applyButton.addClickListener(applyButtonListener);
+ applyButton.setText(AnalyzerLabels.APPLY);
+ applyButton.setFont(FontResources.DIALOG_BUTTON_FONT);
+ buttonData = new FormData();
+ buttonData.right = new FormAttachment(okButton, -8);
+ buttonData.top = new FormAttachment(0, 11);
+ buttonData.width = 100;
+ buttonData.height = 28;
+ applyButton.setLayoutData(buttonData);
+
+ window.open();
+ return 0;
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.toolbar.configuration;
+
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
+
+public class ConfigurationDialogFeaturesPage extends DAPageComposite {
+ public static final String ID = ConfigurationDialogFeaturesPage.class.getName();
+ private DATableComposite featuresTable = null;
+ private Canvas detail = null;
+
+ int[] sortTypes = { AnalyzerConstants.SORT_TYPE_GRID,
+ AnalyzerConstants.SORT_TYPE_GRID };
+ int[] sourceColumns = { 0, 0 };
+ private String[] columnNames = {
+ ConfigureLabels.FEATURE_TABLE_FEATURE_EMPTY,
+ ConfigureLabels.FEATURE_TABLE_FEATURE_NAME };
+ private int[] columnSizes = { 30, 541 };
+ private boolean[] columnVisibility = { true, true };
+
+ private String detaillMsg = CommonConstants.EMPTY;
+
+ public ConfigurationDialogFeaturesPage(Composite parent, int style) {
+ super(parent, style);
+ name = AnalyzerLabels.COOLBAR_AREA_CONFIGURATION_FEATURES;
+ this.setLayout(new FormLayout());
+ this.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
+
+ //Title
+ Label tableTitle = new Label(this, SWT.TRANSPARENT);
+ tableTitle.setText(ConfigureLabels.FEATURE_TABLE_TITLE);
+ tableTitle.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
+ tableTitle.setForeground(ColorResources.DEFAULT_FONT_COLOR);
+ tableTitle.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
+
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 10);
+ data.left = new FormAttachment(0, 8);
+ tableTitle.setLayoutData(data);
+
+
+ Composite tableComp = new Composite(this, SWT.NONE);
+ tableComp.setLayout(new FormLayout());
+ data = new FormData();
+ data.top = new FormAttachment(0, 30);
+ data.left= new FormAttachment(0, 5);
+ data.height = 183;
+ tableComp.setLayoutData(data);
+ tableComp.setBackground(ColorResources.DIALOG_BG_UPPER);
+
+ //Table
+ featuresTable = new ConfigurationDialogFeaturesTable(tableComp, SWT.BORDER | SWT.V_SCROLL| SWT.SINGLE);
+ featuresTable.setTableName(ConfigureLabels.FEATURE_TABLE_TITLE);
+ featuresTable.setComparator(new DefaultTableComparator());
+ featuresTable.setSortTypes(sortTypes);
+ featuresTable.setSourceColumns(sourceColumns);
+ featuresTable.setColumns(columnNames);
+ featuresTable.setColumnSize(columnSizes);
+ featuresTable.setColumnVisibility(columnVisibility);
+ featuresTable.setTableToolTipEnable(false);
+ featuresTable.getTable().addSelectionListener(featureTableSelectionListener);
+ featuresTable.getTable().addMouseListener(mouseListener);
+ featuresTable.getTable().addKeyListener(keyListener);
+ data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.left = new FormAttachment(0, 0);
+ data.bottom= new FormAttachment(100, 0);
+ featuresTable.setLayoutData(data);
+
+ //Details Title
+ Label detailLabel = new Label(this, SWT.TRANSPARENT);
+ detailLabel.setText(ConfigureLabels.FEATURE_DETAIL_TITLE);
+ detailLabel.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
+ detailLabel.setForeground(ColorResources.DEFAULT_FONT_COLOR);
+ detailLabel.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
+ data = new FormData();
+ data.top = new FormAttachment(tableComp, 20);
+ data.left = new FormAttachment(0, 8);
+ detailLabel.setLayoutData(data);
+
+ detail = new Canvas(this, SWT.NONE);
+ detail.addPaintListener(detailPaintListener);
+ data = new FormData();
+ data.top = new FormAttachment(detailLabel, 6);
+ data.left = new FormAttachment(0, 5);
+ data.height = 35;
+ data.width = 592;
+ detail.setLayoutData(data);
+
+ featuresTable.updateTable();
+ }
+
+ private SelectionListener featureTableSelectionListener = new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ updateDetails();
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // TODO Auto-generated method stub
+ }
+ };
+
+ private MouseListener mouseListener = new MouseListener() {
+
+ @Override
+ public void mouseUp(MouseEvent e) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void mouseDown(MouseEvent e) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void mouseDoubleClick(MouseEvent e) {
+ updateDetails();
+ }
+ };
+
+ private KeyListener keyListener = new KeyListener() {
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ if (e.keyCode == SWT.DEL) {
+ // TODO Auto-generated method stub
+ }
+ }
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+ // TODO Auto-generated method stub
+ }
+ };
+
+ private void updateDetails() {
+ GridItem[] items = featuresTable.getTable().getSelection();
+ if (items.length == 0) {
+ return;
+ }
+ GridItem item = items[0];
+ for (String featueName : ConfigurationDialogValues.getInstance().getFeature()) {
+ if( featueName.equals(item.getText(1))){
+ if( featueName.equals(ConfigureLabels.FUNCTIONPROFILING)){
+ detaillMsg = ConfigureLabels.DETAIL_FUNCTIONPROFILING;
+ }else if( featueName.equals(ConfigureLabels.ALLOCATION)){
+ detaillMsg = ConfigureLabels.DETAIL_ALLOCATION;
+ }else if( featueName.equals(ConfigureLabels.FILE)){
+ detaillMsg = ConfigureLabels.DETAIL_FILE;
+ }else if( featueName.equals(ConfigureLabels.THREAD)){
+ detaillMsg = ConfigureLabels.DETAIL_THREAD;
+ }else if( featueName.equals(ConfigureLabels.USERINTERFACE)){
+ detaillMsg = ConfigureLabels.DETAIL_USERINTERFACE;
+ }else if( featueName.equals(ConfigureLabels.SNAPSHOT)){
+ detaillMsg = ConfigureLabels.DETAIL_SNAPSHOT;
+ }else if( featueName.equals(ConfigureLabels.EVENT)){
+ detaillMsg = ConfigureLabels.DETAIL_EVENT;
+ }else if( featueName.equals(ConfigureLabels.RECORDING)){
+ detaillMsg = ConfigureLabels.DETAIL_RECORDING;
+ }else{
+ System.out.println("failed undefine features");
+ }
+ }
+ }
+ detail.redraw();
+ }
+
+ private PaintListener detailPaintListener = new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ Canvas canvas = (Canvas) e.widget;
+ Rectangle rect = canvas.getClientArea();
+ e.gc.setBackground(ColorResources.WHITE);
+ e.gc.fillRectangle(rect);
+ e.gc.setForeground(ColorResources.OPEN_TRACE_TABLE_OUTLINE_COLOR);
+ e.gc.drawRectangle(rect.x, rect.y, rect.width - 1, rect.height - 1);
+ e.gc.setFont(FontResources.TABLE_CELL_FONT);
+ int x = rect.x + 7;
+ int y = rect.y + 4;
+ e.gc.setForeground(ColorResources.OPEN_TRACE_SAVE_CONTENTS_COLOR);
+ e.gc.drawText(detaillMsg, x, y);
+
+ }
+ };
+
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * HyunJong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.toolbar.configuration;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.GridColumn;
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.model.TableInput;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableHeaderRenderer;
+
+public class ConfigurationDialogFeaturesTable extends DATableComposite {
+
+ private final String TRUE = "true"; //$NON-NLS-1$
+ private final String FALSE = "false";//$NON-NLS-1$
+
+ public ConfigurationDialogFeaturesTable(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ @Override
+ protected List<TableInput> makeTableInput() {
+ List<TableInput> input = new ArrayList<TableInput>();
+ for (String featueName : ConfigurationDialogValues.getInstance()
+ .getFeature()) {
+ List<String> text = new ArrayList<String>();
+ text.add(isCheckFeatue(featueName));
+ text.add(featueName);
+ TableInput tableInput = new TableInput();
+ tableInput.setText(text);
+ input.add(tableInput);
+ }
+ return input;
+ }
+
+ @Override
+ public void updateTable() {
+ table.removeAll();
+ List<TableInput> input = makeTableInput();
+ if (null == input) {
+ return;
+ }
+
+ int size = input.size();
+ for (int i = 0; i < size; i++) {
+ List<String> text = input.get(i).getText();
+ GridItem gridItem = new GridItem(table, SWT.NONE);
+ if (text.get(0).equals(TRUE)) {
+ gridItem.setChecked(true);
+ } else {
+ gridItem.setChecked(false);
+ }
+ gridItem.setText(1, text.get(1));
+ }
+ table.update();
+ }
+
+ @Override
+ public void setColumns(String[] columnNames) {
+ int size = columnNames.length;
+ for (int i = 0; i < size; i++) {
+ GridColumn column = new GridColumn(table, SWT.NONE);
+ column.setText(columnNames[i]);
+ column.setCellRenderer(new ConfigurationDialogFeaturesTableCellRenderer());
+ column.setHeaderRenderer(new DATableHeaderRenderer());
+ column.pack();
+
+ }
+ }
+
+ private String isCheckFeatue(String featueName) {
+ if (AnalyzerConstants.OPT_OFF != ConfigurationDialogValues
+ .getInstance().isFeaturesChecked(featueName)) {
+ return TRUE;
+ } else if (AnalyzerConstants.OPT_OFF == ConfigurationDialogValues
+ .getInstance().isFeaturesChecked(featueName)) {
+ return FALSE;
+ } else // -1
+ {
+ System.out.println(" check error!!");
+ return FALSE;
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.toolbar.configuration;
+
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.nebula.widgets.grid.IInternalWidget;
+import org.eclipse.nebula.widgets.grid.internal.DefaultCellRenderer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
+
+public class ConfigurationDialogFeaturesTableCellRenderer extends
+ DefaultCellRenderer {
+ int leftMargin = 4;
+ int rightMargin = 4;
+ int topMargin = 0;
+ int bottomMargin = 0;
+ int textTopMargin = 1;
+ int textBottomMargin = 2;
+ int insideMargin = 3;
+
+ public Image checkImg = null;
+
+ @Override
+ public void paint(GC gc, Object value) {
+ GridItem item = (GridItem) value;
+ gc.setFont(item.getFont(getColumn()));
+
+ boolean drawAsSelected = isSelected();
+ boolean drawBackground = true;
+
+ if (isCellSelected()) {
+ drawAsSelected = true;
+ }
+ if (drawAsSelected) {
+ gc.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_START);
+ gc.setBackground(ColorResources.TABLE_CONTENTS_SELECTED_END);
+ } else {
+ if (item.getParent().isEnabled()) {
+ Color bg = item.getBackground();
+ if (bg != null) {
+ gc.setBackground(bg);
+ } else {
+ drawBackground = false;
+ }
+ } else {
+ gc.setBackground(getDisplay().getSystemColor(
+ SWT.COLOR_WIDGET_BACKGROUND));
+ }
+ }
+
+ if (drawBackground && drawAsSelected) {
+ gc.fillGradientRectangle(getBounds().x, getBounds().y,
+ getBounds().width, getBounds().height, true);
+ } else if (drawBackground) {
+ gc.fillRectangle(getBounds().x, getBounds().y + 1,
+ getBounds().width, getBounds().height);
+ }
+
+ int x = leftMargin;
+ if (getColumn() == 0) {
+ if (item.getChecked(getColumn())) {
+ checkImg = ImageResources.CHECKBOX_SELECTED;
+ } else
+ checkImg = ImageResources.CHECKBOX_UNSELECTED;
+ gc.drawImage(checkImg, 6, getBounds().y + 1);
+ }
+
+ Image image = item.getImage(getColumn());
+ if (image != null) {
+ int y = getBounds().y;
+ y += (getBounds().height - image.getBounds().height) / 2;
+ gc.drawImage(image, getBounds().x + x, y);
+ x += image.getBounds().width + insideMargin;
+ }
+
+ int width = getBounds().width - x - rightMargin;
+ String text = item.getText(getColumn());
+
+ if (getAlignment() == SWT.RIGHT) {
+ int len = gc.stringExtent(text).x;
+ if (len < width) {
+ x += width - len;
+ }
+ } else if (getAlignment() == SWT.CENTER) {
+ int len = gc.stringExtent(text).x;
+ if (len < width) {
+ x += (width - len) / 2;
+ }
+ }
+
+ if (drawAsSelected) {
+ gc.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_FONT_COLOR);
+ } else {
+ Color fontColor = item.getForeground();
+ if (null != fontColor) {
+ gc.setForeground(item.getForeground());
+ } else {
+ gc.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
+ }
+ }
+
+ gc.setFont(FontResources.TABLE_CELL_FONT);
+
+ if (getColumn() != 0) {
+ gc.drawText(text, getBounds().x + x, getBounds().y + textTopMargin,
+ true);
+ }
+ if (item.getParent().getLinesVisible()) {
+ if (isCellSelected()) {
+ gc.setForeground(ColorResources.TABLE_LINE);
+ } else {
+ gc.setForeground(ColorResources.TABLE_LINE);
+ }
+ gc.drawLine(getBounds().x, getBounds().y + getBounds().height,
+ getBounds().x + getBounds().width - 1, getBounds().y
+ + getBounds().height);
+ gc.drawLine(getBounds().x + getBounds().width - 1, getBounds().y,
+ getBounds().x + getBounds().width - 1, getBounds().y
+ + getBounds().height);
+ }
+ if (isCellFocus()) {
+ Rectangle focusRect = new Rectangle(getBounds().x - 1,
+ getBounds().y - 1, getBounds().width,
+ getBounds().height + 1);
+ gc.setForeground(ColorResources.RED);
+ gc.drawRectangle(focusRect);
+ if (isFocus()) {
+ focusRect.x++;
+ focusRect.width -= 2;
+ focusRect.y++;
+ focusRect.height -= 2;
+ gc.drawRectangle(focusRect);
+ }
+ }
+ }
+
+ public boolean notify(int event, Point point, Object value) {
+ if (getColumn() != 0) {
+ return false;
+ }
+ GridItem item = (GridItem) value;
+ if (event == IInternalWidget.LeftMouseButtonDown) {
+ if (overCheck(item, point)) {
+ if (item.getChecked() == true) {
+ item.setChecked(false);
+ } else {
+ item.setChecked(true);
+ }
+ ConfigurationDialogValues.getInstance().setFeaturesChecked(
+ item.getText(1), item.getChecked());
+ item.getParent().redraw();
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean overCheck(GridItem item, Point point) {
+ point = new Point(point.x, point.y);
+ point.x -= getBounds().x - 1;
+ point.y -= getBounds().y - 1;
+ if ((checkImg.getBounds().x <= point.x)
+ && (point.x <= checkImg.getBounds().x
+ + checkImg.getBounds().width + 10)
+ && (checkImg.getBounds().y <= point.y)
+ && (point.y <= checkImg.getBounds().y
+ + checkImg.getBounds().height)) {
+ return true;
+ }
+ return false;
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.toolbar.configuration;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.tizen.dynamicanalyzer.common.DesignConstants;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
+import org.tizen.dynamicanalyzer.widgets.button.checkbox.DACheckBox;
+import org.tizen.dynamicanalyzer.widgets.button.checkbox.DACheckboxSelectionListener;
+
+public class ConfigurationDialogSettingPage extends DAPageComposite {
+ public static final String ID = ConfigurationDialogSettingPage.class.getName();
+
+ private final Image whiteImage = ImageResources.CONFIGURATION_WHITE_IMAGE;
+ private final Image blackImage = ImageResources.CONFIGURATION_BLACK_IMAGE;
+
+ private DACheckBox whiteRadioButton = null;
+ private DACheckBox blackRadioButton = null;
+ private DACheckBox showInitialRadioButton = null;
+ private DACheckBox autoStopRadioButton = null;
+
+ public ConfigurationDialogSettingPage(Composite parent, int style) {
+
+ super(parent, style);
+ name = AnalyzerLabels.COOLBAR_AREA_CONFIGURATION_SETTING;
+ this.setLayout(new FormLayout());
+ this.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
+
+ //Appearance
+ Label tableTitle = new Label(this, SWT.TRANSPARENT);
+ tableTitle.setText(ConfigureLabels.SETTING_TABLE_TITLE);
+ tableTitle.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
+ tableTitle.setForeground(ColorResources.DEFAULT_FONT_COLOR);
+ tableTitle.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
+
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 10);
+ data.left = new FormAttachment(0, 8);
+ tableTitle.setLayoutData(data);
+
+ //white image
+ Label white = new Label(this, SWT.TRANSPARENT);
+ white.setBackground(ColorResources.WINDOW_BG_COLOR);
+ white.setImage(whiteImage);
+ data = new FormData();
+ data.top = new FormAttachment(0, 45);
+ data.left = new FormAttachment(0, 60);
+ data.width = 204;
+ data.height = 150;
+ white.setLayoutData(data);
+
+ //black image
+ Label black = new Label(this, SWT.TRANSPARENT);
+ black.setBackground(ColorResources.WINDOW_BG_COLOR);
+ black.setImage(blackImage);
+ data = new FormData();
+ data.top = new FormAttachment(0, 45);
+ data.left = new FormAttachment(0, 325);
+ data.width = 204;
+ data.height = 150;
+ black.setLayoutData(data);
+
+ // white image
+ whiteRadioButton = new DACheckBox(this, SWT.NONE);
+ data = new FormData();
+ data.top = new FormAttachment(0, 200);
+ data.left = new FormAttachment(0, 148);
+ data.height = 20;
+ data.width = DesignConstants.DA_BUTTON_WIDTH + 10;
+ whiteRadioButton.setLayoutData(data);
+ whiteRadioButton.setForeground(ColorResources.BLACK);
+ whiteRadioButton.setBackground(ColorResources.DIALOG_BG_UPPER);
+ whiteRadioButton.setText(ConfigureLabels.SETTING_WHITE);
+ whiteRadioButton.addSelectionListener(whiteRadioButtonListener);
+ whiteRadioButton.setChecked(ConfigurationDialogValues.getInstance().isWhiteTheme());
+
+ // black image
+ blackRadioButton = new DACheckBox(this, SWT.NONE);
+ data = new FormData();
+ data.top = new FormAttachment(0, 200);
+ data.left = new FormAttachment(0, 418);
+ data.height = 20;
+ data.width = DesignConstants.DA_BUTTON_WIDTH + 10;
+ blackRadioButton.setLayoutData(data);
+ blackRadioButton.setForeground(ColorResources.BLACK);
+ blackRadioButton.setBackground(ColorResources.DIALOG_BG_UPPER);
+ blackRadioButton.setText(ConfigureLabels.SETTING_BLACK);
+ blackRadioButton.addSelectionListener(blackRadioButtonListener);
+ blackRadioButton.setChecked(ConfigurationDialogValues.getInstance().isBlackTheme());
+ blackRadioButton.setEnabled(false);
+
+ // Configuration Setting
+ Label settingLabel = new Label(this, SWT.TRANSPARENT);
+ settingLabel.setText(ConfigureLabels.SETTING_CONFIGURATION_TITLE);
+ settingLabel.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
+ settingLabel.setForeground(ColorResources.DEFAULT_FONT_COLOR);
+ settingLabel.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
+ data = new FormData();
+ data.top = new FormAttachment(0, 230);
+ data.left = new FormAttachment(0, 5);
+ settingLabel.setLayoutData(data);
+
+ // SHOW_INITIAL_FEATURE_SETTING
+ showInitialRadioButton = new DACheckBox(this, SWT.NONE);
+ data = new FormData();
+ data.top = new FormAttachment(0, 250);
+ data.left = new FormAttachment(0, 22);
+ data.height = 20;
+ data.width = 20;
+ showInitialRadioButton.setLayoutData(data);
+ showInitialRadioButton.setForeground(ColorResources.BLACK);
+ showInitialRadioButton.setBackground(ColorResources.DIALOG_BG_UPPER);
+ showInitialRadioButton.setText(ConfigureLabels.SHOW_INITIAL);
+ showInitialRadioButton.addSelectionListener(showInitiaRadioButtonListener);
+ showInitialRadioButton.setChecked(ConfigurationDialogValues.getInstance().isShowInitia());
+
+ Label showInitalLabel = new Label(this, SWT.TRANSPARENT);
+ showInitalLabel.setText(ConfigureLabels.SHOW_INITIAL);
+ showInitalLabel.setBackground(ColorResources.DIALOG_BG_UPPER);
+ showInitalLabel.setForeground(ColorResources.BLACK);
+ showInitalLabel.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
+ data = new FormData();
+ data.top = new FormAttachment(0, 252);
+ data.left = new FormAttachment(0, 42);
+ showInitalLabel.setLayoutData(data);
+
+
+ // SHOW_INITIAL_FEATURE_SETTING
+ autoStopRadioButton = new DACheckBox(this, SWT.NONE);
+ data = new FormData();
+ data.top = new FormAttachment(0, 272);
+ data.left = new FormAttachment(0, 22);
+ data.height = 20;
+ data.width = 20;
+ autoStopRadioButton.setLayoutData(data);
+ autoStopRadioButton.setForeground(ColorResources.BLACK);
+ autoStopRadioButton.setBackground(ColorResources.DIALOG_BG_UPPER);
+ autoStopRadioButton.setText(ConfigureLabels.AUTO_STOP);
+ autoStopRadioButton.addSelectionListener(autoStopRadioButtonListener);
+ autoStopRadioButton.setChecked(ConfigurationDialogValues.getInstance().isAutoStop());
+
+ Label autoStopLabel = new Label(this, SWT.TRANSPARENT);
+ autoStopLabel.setText(ConfigureLabels.AUTO_STOP);
+ autoStopLabel.setBackground(ColorResources.DIALOG_BG_UPPER);
+ autoStopLabel.setForeground(ColorResources.BLACK);
+ autoStopLabel.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
+ data = new FormData();
+ data.top = new FormAttachment(0, 274);
+ data.left = new FormAttachment(0, 42);
+ autoStopLabel.setLayoutData(data);
+ }
+
+ private DACheckboxSelectionListener whiteRadioButtonListener = new DACheckboxSelectionListener() {
+
+ @Override
+ public void handleSelectionEvent(DACheckBox checkbox) {
+ whiteRadioButton.setChecked(true);
+ }
+ };
+
+ private DACheckboxSelectionListener blackRadioButtonListener = new DACheckboxSelectionListener() {
+
+ @Override
+ public void handleSelectionEvent(DACheckBox checkbox) {
+ blackRadioButton.setChecked(false);
+ }
+ };
+
+ private DACheckboxSelectionListener showInitiaRadioButtonListener = new DACheckboxSelectionListener() {
+ @Override
+ public void handleSelectionEvent(DACheckBox checkbox) {
+ ConfigurationDialogValues.getInstance().setShowInitia(!ConfigurationDialogValues.getInstance().isShowInitia());
+ showInitialRadioButton.setChecked(ConfigurationDialogValues.getInstance().isShowInitia());
+ }
+ };
+
+ private DACheckboxSelectionListener autoStopRadioButtonListener = new DACheckboxSelectionListener() {
+ @Override
+ public void handleSelectionEvent(DACheckBox checkbox) {
+ ConfigurationDialogValues.getInstance().setAutoStop(!ConfigurationDialogValues.getInstance().isAutoStop());
+ autoStopRadioButton.setChecked(ConfigurationDialogValues.getInstance().isAutoStop());
+ }
+ };
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * HyunJong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.toolbar.configuration;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
+import org.tizen.dynamicanalyzer.ui.toolbar.ConfigureManager;
+
+public class ConfigurationDialogValues {
+ private static ConfigurationDialogValues instance = null;
+
+ // Features
+ private static String[] featuresName = null;
+ private int bFunctionProfilingCall = AnalyzerConstants.OPT_OFF;
+ private int bAllocationCall = AnalyzerConstants.OPT_ALLOC;
+ private int bFileCall = AnalyzerConstants.OPT_FILE;
+ private int bThreadCall = AnalyzerConstants.OPT_THREAD;
+ private int bUserInterfaceCall = AnalyzerConstants.OPT_UI;
+ private int bSnapshotCall = AnalyzerConstants.OPT_OFF;
+ private int bEventCall = AnalyzerConstants.OPT_EVENT;
+ private int bRecordingCall = AnalyzerConstants.OPT_RECORD;
+
+ // Configuration
+ private boolean whiteTheme = true;
+ private boolean blackTheme = false;
+
+ private boolean showInitia = false;
+ private boolean autoStop = false;
+
+ private static ConfigureManager mConfig;
+ private static final String ON = ConfigureLabels.ON;
+ private static final String OFF = ConfigureLabels.OFF;
+
+ String[] returnStr = null;
+ String strPid = ConfigureManager.getInstance().getValue(
+ ConfigureLabels.SINGLETON_FOCUS_DA_PID);
+
+ public static ConfigurationDialogValues getInstance() {
+ if (null == instance) {
+ instance = new ConfigurationDialogValues();
+ featuresName = new String[] { ConfigureLabels.FUNCTIONPROFILING,
+ ConfigureLabels.ALLOCATION, ConfigureLabels.FILE,
+ ConfigureLabels.THREAD, ConfigureLabels.USERINTERFACE,
+ ConfigureLabels.SNAPSHOT, ConfigureLabels.EVENT,
+ ConfigureLabels.RECORDING };
+ mConfig = ConfigureManager.getInstance();
+ }
+ return instance;
+ }
+
+ // Features
+ public String[] getFeature() {
+ return featuresName;
+ }
+
+ public int isFeaturesChecked(String featues) {
+ for (String featueName : ConfigurationDialogValues.getInstance()
+ .getFeature()) {
+ if (featueName.equals(featues)) {
+ if (featueName.equals(ConfigureLabels.FUNCTIONPROFILING)) {
+ return isFunctionProfilingCall();
+ } else if (featueName.equals(ConfigureLabels.ALLOCATION)) {
+ return isbAllocationCall();
+ } else if (featueName.equals(ConfigureLabels.FILE)) {
+ return isbFileCall();
+ } else if (featueName.equals(ConfigureLabels.THREAD)) {
+ return isbThreadCall();
+ } else if (featueName.equals(ConfigureLabels.USERINTERFACE)) {
+ return isbUserInterfaceCall();
+ } else if (featueName.equals(ConfigureLabels.SNAPSHOT)) {
+ return isbSnapshotCall();
+ } else if (featueName.equals(ConfigureLabels.EVENT)) {
+ return isbEventCall();
+ } else if (featueName.equals(ConfigureLabels.RECORDING)) {
+ return isbRecordingCall();
+ } else {
+ System.out.println("failed undefine features");
+ }
+ }
+ }
+ return -1;
+ }
+
+ public void setFeaturesChecked(String featues, boolean status) {
+ for (String featueName : ConfigurationDialogValues.getInstance()
+ .getFeature()) {
+ if (featueName.equals(featues)) {
+ int value = AnalyzerConstants.OPT_OFF;
+ if (featueName.equals(ConfigureLabels.FUNCTIONPROFILING)) {
+ if (status) {
+ value = AnalyzerConstants.OPT_FUNC;
+ }
+ setbFunctionProfilingCall(value);
+ } else if (featueName.equals(ConfigureLabels.ALLOCATION)) {
+ if (status) {
+ value = AnalyzerConstants.OPT_ALLOC;
+ }
+ setbAllocationCall(value);
+ } else if (featueName.equals(ConfigureLabels.FILE)) {
+ if (status) {
+ value = AnalyzerConstants.OPT_FILE;
+ }
+ setbFileCall(value);
+ } else if (featueName.equals(ConfigureLabels.THREAD)) {
+ if (status) {
+ value = AnalyzerConstants.OPT_THREAD;
+ }
+ setbThreadCall(value);
+ } else if (featueName.equals(ConfigureLabels.USERINTERFACE)) {
+ if (status) {
+ value = AnalyzerConstants.OPT_UI;
+ }
+ setbUserInterfaceCall(value);
+ } else if (featueName.equals(ConfigureLabels.SNAPSHOT)) {
+ if (status) {
+ value = AnalyzerConstants.OPT_FUNC;
+ }
+ setbSnapshotCall(value);
+ } else if (featueName.equals(ConfigureLabels.EVENT)) {
+ if (status) {
+ value = AnalyzerConstants.OPT_SNAPSHOT;
+ }
+ setbEventCall(value);
+ } else if (featueName.equals(ConfigureLabels.RECORDING)) {
+ if (status) {
+ value = AnalyzerConstants.OPT_RECORD;
+ }
+ setbRecordingCall(value);
+ } else {
+ System.out.println("failed undefine features");
+ }
+ }
+ }
+ }
+
+ public void setSettingValueFromConfigFile() {
+
+ // Table Feature
+
+ for (String featureName : ConfigurationDialogValues.getInstance()
+ .getFeature()) {
+ // boolean featuresStatus = true;
+
+ int featuresStatus = Integer.parseInt(mConfig.getValue(featureName));
+ // if (mConfig.getValue(featureName).equals(ON)) {
+ // featuresStatus = true;
+ // } else {
+ // featuresStatus = false;
+ // }
+ if (featureName.equals(ConfigureLabels.FUNCTIONPROFILING)) {
+ setbFunctionProfilingCall(featuresStatus);
+ } else if (featureName.equals(ConfigureLabels.ALLOCATION)) {
+ setbAllocationCall(featuresStatus);
+ } else if (featureName.equals(ConfigureLabels.FILE)) {
+ setbFileCall(featuresStatus);
+ } else if (featureName.equals(ConfigureLabels.THREAD)) {
+ setbThreadCall(featuresStatus);
+ } else if (featureName.equals(ConfigureLabels.USERINTERFACE)) {
+ setbUserInterfaceCall(featuresStatus);
+ } else if (featureName.equals(ConfigureLabels.SNAPSHOT)) {
+ setbSnapshotCall(featuresStatus);
+ } else if (featureName.equals(ConfigureLabels.EVENT)) {
+ setbEventCall(featuresStatus);
+ } else if (featureName.equals(ConfigureLabels.RECORDING)) {
+ setbRecordingCall(featuresStatus);
+ } else {
+ System.out.println("failed undefine features");
+ }
+ }
+
+ // Setting
+ if (mConfig.getValue(ConfigureLabels.SHOW_INITIAL).equals(ON)) {
+ setShowInitia(true);
+ } else {
+ setShowInitia(false);
+ }
+ if (mConfig.getValue(ConfigureLabels.AUTO_STOP).equals(ON)) {
+ setAutoStop(true);
+ } else {
+ setAutoStop(false);
+ }
+ }
+
+ private void setConfig(boolean featureStatus, String featureName) {
+ String applyStatus = CommonConstants.EMPTY;
+ if (featureStatus) {
+ applyStatus = ON;
+ } else {
+ applyStatus = OFF;
+ }
+ String preStatus = mConfig.getValue(featureName);
+ if (applyStatus.equals(preStatus) == false) {
+ if (true == featureStatus) {
+ mConfig.setValue(featureName, ON);
+ } else {
+ mConfig.setValue(featureName, OFF);
+ }
+ }
+ }
+
+ private void setConfig(int featureStatus, String featureName) {
+ mConfig.setValue(featureName, Integer.toString(featureStatus));
+ }
+
+ public void applySettingValueToConfigFile() {
+
+ applySettingValueToDA();
+
+ // Table Feature
+ for (String featueName : ConfigurationDialogValues.getInstance()
+ .getFeature()) {
+ if (featueName.equals(ConfigureLabels.FUNCTIONPROFILING)) {
+ setConfig(isFunctionProfilingCall(), featueName);
+ } else if (featueName.equals(ConfigureLabels.ALLOCATION)) {
+ setConfig(isbAllocationCall(), featueName);
+ } else if (featueName.equals(ConfigureLabels.FILE)) {
+ setConfig(isbFileCall(), featueName);
+ } else if (featueName.equals(ConfigureLabels.THREAD)) {
+ setConfig(isbThreadCall(), featueName);
+ } else if (featueName.equals(ConfigureLabels.USERINTERFACE)) {
+ setConfig(isbUserInterfaceCall(), featueName);
+ } else if (featueName.equals(ConfigureLabels.SNAPSHOT)) {
+ setConfig(isbSnapshotCall(), featueName);
+ } else if (featueName.equals(ConfigureLabels.EVENT)) {
+ setConfig(isbEventCall(), featueName);
+ } else if (featueName.equals(ConfigureLabels.RECORDING)) {
+ setConfig(isbRecordingCall(), featueName);
+ } else {
+ System.out.println("failed undefine features");
+ }
+ }
+ // Setting
+ setConfig(isShowInitia(), ConfigureLabels.SHOW_INITIAL);
+ setConfig(isAutoStop(), ConfigureLabels.AUTO_STOP);
+ }
+
+ private boolean isChangeFeatuesValues(boolean featureStatus,
+ String featureName) {
+ String applyStatus = CommonConstants.EMPTY;
+ if (featureStatus) {
+ applyStatus = ON;
+ } else {
+ applyStatus = OFF;
+ }
+ String preStatus = mConfig.getValue(featureName);
+ if (applyStatus.equals(preStatus) == false) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public void applySettingValueToDA() {
+
+ // Table Feature
+ // for (String featueName : ConfigurationDialogValues.getInstance()
+ // .getFeature()) {
+ // if (featueName.equals(ConfigureLabels.FUNCTIONPROFILING)) {
+ // if (isChangeFeatuesValues(isbFunctionProfilingCall(),
+ // featueName)) {
+ // System.out.println("change valuse FUNCTIONPROFILING");
+ // }
+ // } else if (featueName.equals(ConfigureLabels.ALLOCATION)) {
+ // if (isChangeFeatuesValues(isbAllocationCall(), featueName)) {
+ // System.out.println("change valuse ALLOCATION");
+ // }
+ // } else if (featueName.equals(ConfigureLabels.FILE)) {
+ // if (isChangeFeatuesValues(isbFileCall(), featueName)) {
+ // System.out.println("change valuse FILE");
+ // }
+ // } else if (featueName.equals(ConfigureLabels.THREAD)) {
+ // if (isChangeFeatuesValues(isbThreadCall(), featueName)) {
+ // System.out.println("change valuse THREAD");
+ // }
+ // } else if (featueName.equals(ConfigureLabels.USERINTERFACE)) {
+ // if (isChangeFeatuesValues(isbUserInterfaceCall(), featueName)) {
+ // System.out.println("change valuse USERINTERFACE");
+ // }
+ // } else if (featueName.equals(ConfigureLabels.SNAPSHOT)) {
+ // if (isChangeFeatuesValues(isbSnapshotCall(), featueName)) {
+ // System.out.println("change valuse SNAPSHOT");
+ // }
+ // } else if (featueName.equals(ConfigureLabels.EVENT)) {
+ // if (isChangeFeatuesValues(isbEventCall(), featueName)) {
+ // System.out.println("change valuse EVENT");
+ // }
+ // } else if (featueName.equals(ConfigureLabels.RECORDING)) {
+ // if (isChangeFeatuesValues(isbRecordingCall(), featueName)) {
+ // System.out.println("change valuse RECORDING");
+ // }
+ // } else {
+ // System.out.println("failed undefine features");
+ // }
+ // }
+ // Setting
+ // if (isChangeFeatuesValues(isShowInitia(),
+ // ConfigureLabels.SHOW_INITIAL)) {
+ // System.out.println("change valuse SHOW_INITIAL");
+ // }
+ // if (isChangeFeatuesValues(isAutoStop(), ConfigureLabels.AUTO_STOP)) {
+ // System.out.println("change valuse AUTO_STOP");
+ // }
+ }
+
+ public int isFunctionProfilingCall() {
+ return bFunctionProfilingCall;
+ }
+
+ public void setbFunctionProfilingCall(int bFunctionProfilingCall) {
+ this.bFunctionProfilingCall = bFunctionProfilingCall;
+ }
+
+ public int isbAllocationCall() {
+ return bAllocationCall;
+ }
+
+ public void setbAllocationCall(int bAllocationCall) {
+ this.bAllocationCall = bAllocationCall;
+ }
+
+ public int isbFileCall() {
+ return bFileCall;
+ }
+
+ public void setbFileCall(int bFileCall) {
+ this.bFileCall = bFileCall;
+ }
+
+ public int isbThreadCall() {
+ return bThreadCall;
+ }
+
+ public void setbThreadCall(int bThreadCall) {
+ this.bThreadCall = bThreadCall;
+ }
+
+ public int isbUserInterfaceCall() {
+ return bUserInterfaceCall;
+ }
+
+ public void setbUserInterfaceCall(int bUserInterfaceCall) {
+ this.bUserInterfaceCall = bUserInterfaceCall;
+ }
+
+ public int isbSnapshotCall() {
+ return bSnapshotCall;
+ }
+
+ public void setbSnapshotCall(int bSnapshotCall) {
+ this.bSnapshotCall = bSnapshotCall;
+ }
+
+ public int isbEventCall() {
+ return bEventCall;
+ }
+
+ public void setbEventCall(int bEventCall) {
+ this.bEventCall = bEventCall;
+ }
+
+ public int isbRecordingCall() {
+ return bRecordingCall;
+ }
+
+ public void setbRecordingCall(int bRecordingCall) {
+ this.bRecordingCall = bRecordingCall;
+ }
+
+ // Configuration
+ public boolean isWhiteTheme() {
+ return whiteTheme;
+ }
+
+ public void setWhiteTheme(boolean whiteTheme) {
+ this.whiteTheme = whiteTheme;
+ }
+
+ public boolean isBlackTheme() {
+ return blackTheme;
+ }
+
+ public void setBlackTheme(boolean blackTheme) {
+ this.blackTheme = blackTheme;
+ }
+
+ public boolean isShowInitia() {
+ return showInitia;
+ }
+
+ public void setShowInitia(boolean showInitia) {
+ this.showInitia = showInitia;
+ }
+
+ public boolean isAutoStop() {
+ return autoStop;
+ }
+
+ public void setAutoStop(boolean autoStop) {
+ this.autoStop = autoStop;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * HyunJong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.toolbar.configuration;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.DAButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
+import org.tizen.dynamicanalyzer.widgets.button.checkbox.DACheckBox;
+import org.tizen.dynamicanalyzer.widgets.button.checkbox.DACheckboxSelectionListener;
+
+public class WelcomeDialog {
+ private Shell parent = null;
+ private Shell window = null;
+ private DACustomButton okButton = null;
+ private DACustomButton cancelButton = null;
+ DAPageComposite topComposite = null;
+ private DACheckBox useAgainCheckButton = null;
+ private boolean returnType = false;
+
+ public WelcomeDialog(Shell parent, int style) {
+ this.parent = parent;
+ ConfigurationDialogValues.getInstance().setSettingValueFromConfigFile();
+ }
+
+ private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ doApply();
+ window.dispose();
+ }
+ };
+ private DACustomButtonClickEventListener cancelButtonListener = new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ doBack();
+ window.dispose();
+ }
+ };
+
+ private void doApply() {
+ returnType = true;
+ ConfigurationDialogValues.getInstance().applySettingValueToConfigFile();
+ }
+
+ private void doBack() {
+ ConfigurationDialogValues.getInstance().setSettingValueFromConfigFile();
+ }
+
+ public boolean open() {
+ window = new Shell(parent, SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM);
+ window.setSize(608, 460);
+ window.setLayout(new FormLayout());
+ window.setText(AnalyzerLabels.CONFIGURATION);
+
+ //banner
+ Label banner = new Label(window, SWT.TRANSPARENT);
+ banner.setBackground(ColorResources.WINDOW_BG_COLOR);
+ banner.setImage(ImageResources.WELCONE_BANNER_IMAGE);
+
+ FormData labelData = new FormData();
+ labelData.top = new FormAttachment(0, 0);
+ labelData.left = new FormAttachment(0, 0);
+ labelData.right = new FormAttachment(100, 0);
+ labelData.height = 80;
+ banner.setLayoutData(labelData);
+
+
+ Composite contentsComp = new Composite(window, SWT.NONE);
+ FormLayout compLayout = new FormLayout();
+ contentsComp.setLayout(compLayout);
+ contentsComp.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
+
+ FormData compData = new FormData();
+ compData = new FormData();
+ compData.top = new FormAttachment(banner, 0);
+ compData.left = new FormAttachment(0, 0);
+ compData.right = new FormAttachment(100, 0);
+ compData.bottom = new FormAttachment(100, -51);
+ contentsComp.setLayoutData(compData);
+
+ new ConfigurationDialogFeaturesPage(contentsComp, SWT.NONE);
+
+ // button
+ Composite buttonContentsComp = new Composite(window, SWT.NONE);
+ buttonContentsComp.addPaintListener(new PaintListener() {
+ @Override
+ public void paintControl(PaintEvent e) {
+ Composite composite = (Composite) e.widget;
+ Rectangle rect = composite.getClientArea();
+ e.gc.setForeground(ColorResources.CONFIGURATION_SUNKEN_LINE_UP_COLOR);
+ e.gc.drawLine(0, 0, rect.x+ rect.width, 0);
+ }
+ });
+ compLayout = new FormLayout();
+ buttonContentsComp.setLayout(compLayout);
+ buttonContentsComp.setBackground(ColorResources.CONFIGURATION_BUTTON_COVER_BACKGROUND_COLOR);
+
+ compData = new FormData();
+ compData.top = new FormAttachment(contentsComp, 0);
+ compData.left = new FormAttachment(0, 0);
+ compData.right = new FormAttachment(100, 0);
+ compData.bottom = new FormAttachment(100, 0);
+ buttonContentsComp.setLayoutData(compData);
+
+ // ask use again image
+ useAgainCheckButton = new DACheckBox(buttonContentsComp, SWT.NONE);
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 15);
+ data.left = new FormAttachment(0, 10);
+ data.height = 20;
+ data.width = 20;
+ useAgainCheckButton.setLayoutData(data);
+ useAgainCheckButton.setForeground(ColorResources.BLACK);
+ useAgainCheckButton.setBackground(ColorResources.CONFIGURATION_BUTTON_COVER_BACKGROUND_COLOR);
+ useAgainCheckButton.setText(ConfigureLabels.WELCONE_ASK_USE_AGAIN);
+ useAgainCheckButton.addSelectionListener(useAgainCheckbuttonListener);
+ useAgainCheckButton.setChecked(ConfigurationDialogValues.getInstance().isShowInitia());
+
+ Label useAgainLabel = new Label(buttonContentsComp, SWT.TRANSPARENT);
+ useAgainLabel.setText(ConfigureLabels.WELCONE_ASK_USE_AGAIN);
+ useAgainLabel.setBackground(ColorResources.CONFIGURATION_BUTTON_COVER_BACKGROUND_COLOR);
+ useAgainLabel.setForeground(ColorResources.BLACK);
+ useAgainLabel.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
+ data = new FormData();
+ data.top = new FormAttachment(0, 17);
+ data.left = new FormAttachment(0, 30);
+ useAgainLabel.setLayoutData(data);
+
+ cancelButton = new DAButton(buttonContentsComp, SWT.NONE);
+ cancelButton.addClickListener(cancelButtonListener);
+ cancelButton.setText(AnalyzerLabels.CANCEL);
+ cancelButton.setFont(FontResources.DIALOG_BUTTON_FONT);
+ FormData buttonData = new FormData();
+ buttonData.right = new FormAttachment(100, -9);
+ buttonData.top = new FormAttachment(0, 11);
+ buttonData.width = 100;
+ buttonData.height = 28;
+ cancelButton.setLayoutData(buttonData);
+
+ okButton = new DAButton(buttonContentsComp, SWT.NONE);
+ okButton.addClickListener(okButtonListener);
+ okButton.setText(AnalyzerLabels.OK);
+ okButton.setFont(FontResources.DIALOG_BUTTON_FONT);
+ buttonData = new FormData();
+ buttonData.right = new FormAttachment(cancelButton, -8);
+ buttonData.top = new FormAttachment(0, 11);
+ buttonData.width = 100;
+ buttonData.height = 28;
+ okButton.setLayoutData(buttonData);
+
+ window.open();
+
+ Display display = PlatformUI.createDisplay();
+
+ while (!window.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ window.dispose();
+ return returnType;
+ }
+
+ private DACheckboxSelectionListener useAgainCheckbuttonListener = new DACheckboxSelectionListener() {
+ @Override
+ public void handleSelectionEvent(DACheckBox checkbox) {
+ ConfigurationDialogValues.getInstance().setShowInitia(!ConfigurationDialogValues.getInstance().isShowInitia());
+ useAgainCheckButton.setChecked(ConfigurationDialogValues.getInstance().isShowInitia());
+ }
+ };
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.toolbar.opentrace;
+
+import java.io.File;
+
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerPaths;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.common.DesignConstants;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.ui.widgets.DAButton;
+import org.tizen.dynamicanalyzer.ui.widgets.DAMessageBox;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.utils.Formatter;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
+
+public class OpenTraceDialog extends DAMessageBox {
+ private static boolean opened = false;
+ public static int SAVE_FOLDER = 0;
+ public static int TEMP_FOLDER = 1;
+
+ public static String VERSION_KEY = "version"; //$NON-NLS-1$
+ public static int VERSION_INVALID = 0;
+ public static int VERSION_VALID = 1;
+
+ public static String CURRENT_KEY = "current"; //$NON-NLS-1$
+ public static int CURRENT = 0;
+ public static int OTHERS = 1;
+
+ private DATableComposite saveTable = null;
+ private DATableComposite tempTable = null;
+ private Canvas detail = null;
+ private Grid selectedTable = null;
+ private DACustomButton okButton = null;
+ private DACustomButton cancelButton = null;
+
+ /* for details */
+ private String createTime = CommonConstants.EMPTY;
+ private String device = CommonConstants.EMPTY;
+ private String application = CommonConstants.EMPTY;
+ private String elapsedTime = CommonConstants.ZERO;
+
+ private String[] columnNames = {
+ AnalyzerLabels.OPEN_TRACE_DLG_TRACE_FILE_NAME,
+ AnalyzerLabels.OPEN_TRACE_DLG_TRACE_DATE };
+ private int[] columnSizes = { 190, 200 };
+ private boolean[] columnVisibility = { true, true };
+ int[] sortTypes = { AnalyzerConstants.SORT_TYPE_GRID,
+ AnalyzerConstants.SORT_TYPE_GRID };
+ int[] sourceColumns = { 0, 0 };
+
+ public OpenTraceDialog(Shell parent) {
+ super(parent);
+ }
+
+ protected int run() {
+ if (opened) {
+ result = -1;
+ return result;
+ }
+ shell.setLayout(new FormLayout());
+ shell.setSize(400, 410);
+ shell.setText(AnalyzerLabels.OPEN_TRACE);
+
+ shell.addDisposeListener(new DisposeListener() {
+
+ @Override
+ public void widgetDisposed(DisposeEvent e) {
+ System.out.println("shell disposed!"); //$NON-NLS-1$
+ opened = false;
+ }
+ });
+
+ Composite tableComp = new Composite(shell, SWT.NONE);
+ tableComp.setLayout(new FormLayout());
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.left = new FormAttachment(0, 0);
+ data.right = new FormAttachment(100, 0);
+ data.height = 337;
+ tableComp.setLayoutData(data);
+ tableComp.setBackground(ColorResources.DIALOG_BG_UPPER);
+
+ Label saveFile = new Label(tableComp, SWT.TRANSPARENT);
+ saveFile.setText(AnalyzerLabels.OPEN_TRACE_DLG_SAVED_FILE);
+ saveFile.setBackground(ColorResources.DIALOG_BG_UPPER);
+ saveFile.setAlignment(SWT.LEFT);
+ saveFile.setForeground(ColorResources.OPEN_TRACE_LABEL_COLOR);
+ saveFile.setFont(FontResources.OPEN_TRACE_INNER_TITLE);
+
+ saveTable = new SaveFilesTable(tableComp, SWT.BORDER | SWT.V_SCROLL
+ | SWT.SINGLE);
+ saveTable.setTableName(AnalyzerLabels.OPEN_TRACE_DLG_SAVE_TABLE_NAME);
+ saveTable.setComparator(new DefaultTableComparator());
+ saveTable.setSortTypes(sortTypes);
+ saveTable.setSourceColumns(sourceColumns);
+ saveTable.setColumns(columnNames);
+ saveTable.setColumnSize(columnSizes);
+ saveTable.setColumnVisibility(columnVisibility);
+ saveTable.setTableToolTipEnable(false);
+
+ saveTable.getTable().addSelectionListener(saveTableSelectionListener);
+ saveTable.getTable().addMouseListener(mouseListener);
+ saveTable.getTable().addKeyListener(keyListener);
+
+ Label tempFile = new Label(tableComp, SWT.TRANSPARENT);
+ tempFile.setText(AnalyzerLabels.OPEN_TRACE_DLG_TEMP_FILE);
+ tempFile.setBackground(ColorResources.DIALOG_BG_UPPER);
+ tempFile.setAlignment(SWT.LEFT);
+ tempFile.setForeground(ColorResources.OPEN_TRACE_LABEL_COLOR);
+ tempFile.setFont(FontResources.OPEN_TRACE_INNER_TITLE);
+
+ tempTable = new TempFilesTable(tableComp, SWT.BORDER | SWT.V_SCROLL
+ | SWT.SINGLE);
+ tempTable.setTableName(AnalyzerLabels.OPEN_TRACE_DLG_TEMP_TABLE_NAME);
+ tempTable.setComparator(new DefaultTableComparator());
+ tempTable.setSortTypes(sortTypes);
+ tempTable.setSourceColumns(sourceColumns);
+ tempTable.setColumns(columnNames);
+ tempTable.setColumnSize(columnSizes);
+ tempTable.setColumnVisibility(columnVisibility);
+ tempTable.getTable().addSelectionListener(tempTableSelectionListener);
+ tempTable.getTable().addMouseListener(mouseListener);
+ tempTable.getTable().addKeyListener(keyListener);
+ tempTable.setTableToolTipEnable(false);
+
+ Label detailLabel = new Label(tableComp, SWT.TRANSPARENT);
+ detailLabel.setText(AnalyzerLabels.OPEN_TRACE_DLG_DETAILS_TITLE);
+ detailLabel.setBackground(ColorResources.DIALOG_BG_UPPER);
+ detailLabel.setAlignment(SWT.LEFT);
+ detailLabel.setForeground(ColorResources.OPEN_TRACE_LABEL_COLOR);
+ detailLabel.setFont(FontResources.OPEN_TRACE_INNER_TITLE);
+
+ detail = new Canvas(tableComp, SWT.NONE);
+ detail.addPaintListener(detailPaintListener);
+
+ data = new FormData();
+ data.top = new FormAttachment(0, 5);
+ data.left = new FormAttachment(0, 7);
+ data.height = 18;
+ saveFile.setLayoutData(data);
+
+ data = new FormData();
+ data.top = new FormAttachment(saveFile, 0);
+ data.left = new FormAttachment(0, 6);
+ data.right = new FormAttachment(100, -6);
+ data.height = 100;
+ saveTable.setLayoutData(data);
+
+ data = new FormData();
+ data.top = new FormAttachment(saveTable, 10);
+ data.left = new FormAttachment(0, 6);
+ data.height = 18;
+ tempFile.setLayoutData(data);
+
+ data = new FormData();
+ data.top = new FormAttachment(tempFile, 0);
+ data.left = new FormAttachment(0, 6);
+ data.right = new FormAttachment(100, -6);
+ data.height = 100;
+ tempTable.setLayoutData(data);
+
+ data = new FormData();
+ data.top = new FormAttachment(tempTable, 10);
+ data.left = new FormAttachment(0, 6);
+ data.height = 18;
+ detailLabel.setLayoutData(data);
+
+ data = new FormData();
+ data.top = new FormAttachment(detailLabel, 0);
+ data.left = new FormAttachment(0, 6);
+ data.right = new FormAttachment(100, -6);
+ data.height = 50;
+ detail.setLayoutData(data);
+
+ Composite buttonComp = new Composite(shell, SWT.NONE);
+ FormLayout compLayout = new FormLayout();
+ buttonComp.setLayout(compLayout);
+ buttonComp
+ .setBackground(ColorResources.OPEN_TRACE_BUTTON_COMPOSITE_BG_COLOR);
+
+ FormData compData = new FormData();
+ compData.top = new FormAttachment(tableComp, 0);
+ compData.left = new FormAttachment(0, 0);
+ compData.right = new FormAttachment(100, 0);
+ compData.height = 51;
+ buttonComp.setLayoutData(compData);
+
+ buttonComp.addPaintListener(new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ Composite comp = (Composite) e.widget;
+ Rectangle rect = comp.getClientArea();
+ e.gc.setForeground(ColorResources.DIALOG_SUNKEN_1);
+ e.gc.drawLine(rect.x, rect.y, rect.x + rect.width, rect.y);
+ e.gc.setForeground(ColorResources.DIALOG_SUNKEN_2);
+ e.gc.drawLine(rect.x, rect.y + 1, rect.x + rect.width,
+ rect.y + 1);
+ }
+ });
+ okButton = new DAButton(buttonComp, SWT.NONE);
+ okButton.addClickListener(okButtonListener);
+ okButton.setText(AnalyzerLabels.OPEN);
+ okButton.setFont(FontResources.DIALOG_BUTTON_FONT);
+ FormData okData = new FormData();
+ okData.top = new FormAttachment(0, 7);
+ okData.left = new FormAttachment(50,
+ -(DesignConstants.DA_BUTTON_WIDTH + 4));
+ okData.width = DesignConstants.DA_BUTTON_WIDTH;
+ okData.height = DesignConstants.DA_BUTTON_HEIGHT;
+ okButton.setLayoutData(okData);
+
+ cancelButton = new DAButton(buttonComp, SWT.NONE);
+ cancelButton.addClickListener(cancelButtonListener);
+ cancelButton.setText(AnalyzerLabels.CLOSE);
+ cancelButton.setFont(FontResources.DIALOG_BUTTON_FONT);
+ FormData cancelData = new FormData();
+ cancelData.top = new FormAttachment(0, 7);
+ cancelData.left = new FormAttachment(50, 4);
+ cancelData.width = DesignConstants.DA_BUTTON_WIDTH;
+ cancelData.height = DesignConstants.DA_BUTTON_HEIGHT;
+ cancelButton.setLayoutData(cancelData);
+
+ saveTable.updateTable();
+ tempTable.updateTable();
+ opened = true;
+ return result;
+ }
+
+ private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ if (null != selectedTable) {
+ GridItem[] selections = selectedTable.getSelection();
+ if (null == selections || 0 == selections.length) {
+ return;
+ }
+ GridItem selection = selections[0];
+ String openPath = null;
+ if ((Integer) selection.getData() == TEMP_FOLDER) {
+ openPath = AnalyzerPaths.TEMP_FOLDER_PATH + File.separator
+ + selection.getText();
+ } else if ((Integer) selection.getData() == SAVE_FOLDER) {
+ openPath = AnalyzerPaths.DYNAMIC_ANALYZER_SAVE_PATH
+ + File.separator + selection.getText();
+ } else {
+ return;
+ }
+ OpenTraceProgressManager.getInstance().setSavePath(openPath);
+ OpenTraceProgressManager.getInstance().startOpenTraceThread();
+ shell.dispose();
+ }
+ }
+ };
+
+ private DACustomButtonClickEventListener cancelButtonListener = new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ shell.dispose();
+ }
+ };
+
+ private SelectionListener saveTableSelectionListener = new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ selectedTable = saveTable.getTable();
+ int[] sel = new int[0];
+ tempTable.getTable().setSelection(sel);
+ updateDetails();
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+
+ }
+ };
+
+ private SelectionListener tempTableSelectionListener = new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ selectedTable = tempTable.getTable();
+ int[] sel = new int[0];
+ saveTable.getTable().setSelection(sel);
+ updateDetails();
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+ };
+
+ private MouseListener mouseListener = new MouseListener() {
+
+ @Override
+ public void mouseUp(MouseEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void mouseDown(MouseEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void mouseDoubleClick(MouseEvent e) {
+ Grid grid = (Grid) e.widget;
+ GridItem[] items = grid.getSelection();
+ if (0 == items.length) {
+ return;
+ }
+
+ GridItem item = items[0];
+ String openPath = null;
+ if ((Integer) item.getData() == TEMP_FOLDER) {
+ openPath = AnalyzerPaths.TEMP_FOLDER_PATH + File.separator
+ + item.getText();
+ } else if ((Integer) item.getData() == SAVE_FOLDER) {
+ openPath = AnalyzerPaths.DYNAMIC_ANALYZER_SAVE_PATH
+ + File.separator + item.getText();
+ } else {
+ return;
+ }
+ OpenTraceProgressManager.getInstance().setSavePath(openPath);
+ OpenTraceProgressManager.getInstance().startOpenTraceThread();
+ shell.dispose();
+ }
+ };
+
+ private KeyListener keyListener = new KeyListener() {
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ if (e.keyCode == SWT.DEL) {
+ Grid grid = (Grid) e.widget;
+ GridItem[] items = grid.getSelection();
+ if (0 == items.length) {
+ return;
+ }
+ int index = grid.getSelectionIndex();
+ GridItem item = items[0];
+
+ if ((Integer) item.getData(CURRENT_KEY) == CURRENT) {
+ return;
+ }
+
+ String openPath = null;
+ if ((Integer) item.getData() == TEMP_FOLDER) {
+ openPath = AnalyzerPaths.TEMP_FOLDER_PATH + File.separator
+ + item.getText();
+ } else if ((Integer) item.getData() == SAVE_FOLDER) {
+ openPath = AnalyzerPaths.DYNAMIC_ANALYZER_SAVE_PATH
+ + File.separator + item.getText();
+ } else {
+ return;
+ }
+ if (AnalyzerUtil.deleteFile(new File(openPath))) {
+ grid.remove(index);
+ } else {
+ // log for debug
+ System.out.println("delete save file failed..."); //$NON-NLS-1$
+ }
+ }
+
+ }
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+ };
+
+ private PaintListener detailPaintListener = new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ Canvas canvas = (Canvas) e.widget;
+ Rectangle rect = canvas.getClientArea();
+
+ e.gc.setBackground(ColorResources.WHITE);
+ e.gc.fillRectangle(rect);
+ e.gc.setForeground(ColorResources.OPEN_TRACE_TABLE_OUTLINE_COLOR);
+ e.gc.drawRectangle(rect.x, rect.y, rect.width - 1, rect.height - 1);
+
+ if (!application.isEmpty() && !device.isEmpty()) {
+ e.gc.setFont(FontResources.TABLE_CELL_FONT);
+ String inputText = AnalyzerLabels.OPEN_TRACE_DLG_DETAILS_APPLICATION
+ + application;
+ Point textSize = e.gc.textExtent(inputText, SWT.DRAW_MNEMONIC);
+ int fontHeight = textSize.y + 3;
+
+ int x = rect.x + 7;
+ int y = rect.y + 4;
+
+ e.gc.setForeground(ColorResources.OPEN_TRACE_SAVE_CONTENTS_COLOR);
+ e.gc.drawText(inputText, x, y);
+
+ inputText = AnalyzerLabels.OPEN_TRACE_DLG_DETAILS_DEVICE
+ + device;
+ e.gc.drawText(inputText, x + (rect.width - 4) / 2, y);
+ y += fontHeight;
+
+ inputText = AnalyzerLabels.OPEN_TRACE_DLG_DETAILS_CREATE_TIME
+ + createTime;
+ e.gc.drawText(inputText, x, y);
+ y += fontHeight;
+
+ inputText = AnalyzerLabels.OPEN_TRACE_DLG_DETAILS_RECORDING_TIME
+ + Formatter.toTimeFormat(elapsedTime);
+ e.gc.drawText(inputText, x, y);
+ }
+ }
+ };
+
+ private void updateDetails() {
+ GridItem[] items = selectedTable.getSelection();
+ if (items.length == 0) {
+ return;
+ }
+
+ GridItem item = items[0];
+
+ String path = null;
+ if ((Integer) item.getData() == TEMP_FOLDER) {
+ path = AnalyzerPaths.TEMP_FOLDER_PATH + File.separator
+ + item.getText(0);
+ } else if ((Integer) item.getData() == SAVE_FOLDER) {
+ path = AnalyzerPaths.DYNAMIC_ANALYZER_SAVE_PATH + File.separator
+ + item.getText(0);
+ } else {
+ return;
+ }
+ int validCheck = (Integer) item.getData(VERSION_KEY);
+ if ((validCheck == VERSION_INVALID) || !setDetailsInfo(path)) {
+ createTime = CommonConstants.EMPTY;
+ device = CommonConstants.EMPTY;
+ application = CommonConstants.EMPTY;
+ elapsedTime = CommonConstants.ZERO;
+ }
+ detail.redraw();
+ }
+
+ private boolean setDetailsInfo(String path) {
+ boolean isSuccess = true;
+// try {
+// Connection conn = SqlManager.getInstance().getConnection(path);
+// Statement stat = conn.createStatement();
+// String query = "select info from project"; //$NON-NLS-1$
+// ResultSet rs = stat.executeQuery(query);
+//
+// List<String> pInfo = new ArrayList<String>();
+// while (rs.next()) {
+// pInfo.add(rs.getString("info")); //$NON-NLS-1$
+// }
+// rs.close();
+// conn.close();
+//
+// createTime = pInfo.get(AnalyzerConstants.PROJECT_CREATE_TIME_INDEX);
+// device = pInfo.get(AnalyzerConstants.PROJECT_DEVICE_INDEX);
+// application = pInfo.get(AnalyzerConstants.PROJECT_APPNAME_INDEX);
+// elapsedTime = pInfo.get(AnalyzerConstants.PROJECT_LAST_TIME_INDEX);
+// } catch (SQLException e) {
+// e.printStackTrace();
+// isSuccess = false;
+// }
+ return isSuccess;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.toolbar.opentrace;
+
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.logparser.LogParser;
+import org.tizen.dynamicanalyzer.logparser.Logs;
+import org.tizen.dynamicanalyzer.model.LogCenter;
+import org.tizen.dynamicanalyzer.project.Project;
+import org.tizen.dynamicanalyzer.sql.SqlManager;
+import org.tizen.dynamicanalyzer.ui.page.BaseView;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+
+public class OpenTraceInputReader implements Runnable {
+
+ private static Thread openTraceInputThread = null;
+
+ public static void startOpenTraceInputReader() {
+ if (null == openTraceInputThread || !openTraceInputThread.isAlive()) {
+ openTraceInputThread = new Thread(null, new OpenTraceInputReader(),
+ AnalyzerConstants.OPEN_TRACE_THREAD);
+ openTraceInputThread.start();
+ }
+ }
+
+ public static void stopOpenTraceInputReader() {
+ if (null != openTraceInputThread && openTraceInputThread.isAlive()) {
+ try {
+ openTraceInputThread.join();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public static boolean isThreadAlive() {
+ if (null == openTraceInputThread || !openTraceInputThread.isAlive()) {
+ return false;
+ }
+ return true;
+ }
+
+ public static void clear() {
+ stopOpenTraceInputReader();
+ }
+
+ @Override
+ public void run() {
+ LogParser.setLogParsingComplete(false);
+ Project p = AnalyzerManager.getProject();
+ List<LogCenter> logCenters = AnalyzerManager.getLogCenters();
+ List<List<String>> input = null;
+ LogPackage logPackage = new LogPackage();
+ int last = Integer.parseInt(p.getLastLogNum());
+ int from = 0;
+ int to = AnalyzerConstants.DATABASE_READ_SIZE;
+ while (!Thread.interrupted()) {
+ if (to >= last) {
+ to = last;
+ }
+ int size = logCenters.size();
+ for (int i = 0; i < size; i++) {
+ Logs logs = new Logs(logCenters.get(i).getId());
+ input = SqlManager.getInstance().selectArea(logCenters.get(i), from, to);
+ logs.setLogs(input);
+ logPackage.setLogs(logCenters.get(i).getId(), logs);
+ } // for
+ updateLog(logPackage);
+ if (to == last) {
+ break;
+ }
+ from += AnalyzerConstants.DATABASE_READ_SIZE + 1;
+ to = from + AnalyzerConstants.DATABASE_READ_SIZE;
+ }
+ System.out.println("input reader complete"); //$NON-NLS-1$
+ LogParser.setLogParsingComplete(true);
+ // end
+ }
+
+ private void updateLog(LogPackage logPack) {
+ if (null == logPack || logPack.isEmpty()) {
+ return;
+ }
+
+ BaseView bv = (BaseView) AnalyzerUtil.getViewPart(BaseView.ID);
+ bv.getMainTab().updateLog(logPack);
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.toolbar.opentrace;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.handlers.ClearHandler;
+import org.tizen.dynamicanalyzer.handlers.OpenTraceCompleteHandler;
+import org.tizen.dynamicanalyzer.handlers.OpenTraceHandler;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.project.Project;
+import org.tizen.dynamicanalyzer.ui.file.FileChartManager;
+import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
+import org.tizen.dynamicanalyzer.ui.widgets.ProgressDialog;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+
+public class OpenTraceProgressManager implements Runnable {
+ public static final int INIT = 0;
+ public static final int OPEN_TRACE_PROCESS_START = 1;
+ public static final int OPEN_TRACE_PROCESS_END = 2;
+ private int state = INIT;
+ private ProgressDialog dialog = null;
+ private String savePath = null;
+
+ private int percent = 0;
+
+ private static OpenTraceProgressManager instance = new OpenTraceProgressManager();
+ private Thread openTraceThread = null;
+
+ public void startOpenTraceThread() {
+ if (null == openTraceThread || !openTraceThread.isAlive()) {
+ openTraceThread = new Thread(null, new OpenTraceProgressManager(),
+ AnalyzerConstants.OPEN_TRACE_THREAD);
+ openTraceThread.start();
+ }
+ }
+
+ public void stopOpenTraceThread() {
+ if (null != openTraceThread && openTraceThread.isAlive()) {
+ openTraceThread.interrupt();
+ }
+ }
+
+ public int getPercent() {
+ return percent;
+ }
+
+ public void setSavePath(String path) {
+ savePath = path;
+ }
+
+ public String getSavePath() {
+ return savePath;
+ }
+
+ public static OpenTraceProgressManager getInstance() {
+ return instance;
+ }
+
+ public void openTracePrgressStart(final String EndMessage) {
+ if (state == OPEN_TRACE_PROCESS_START) {
+ return;
+ }
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ state = OPEN_TRACE_PROCESS_START;
+ Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
+ dialog = new ProgressDialog(shell, SWT.APPLICATION_MODAL);
+ if (null != dialog) {
+ dialog.open();
+ dialog.setProgressMessage(EndMessage);
+ dialog.setProgressInfo(AnalyzerLabels.STOP_PROCESS_DLG_PLEASE_WAIT);
+ }
+ }
+ });
+ }
+
+ public void setProgressPercent(final String message, final int percent) {
+
+ if (null != dialog) {
+ this.percent = percent;
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ dialog.setValue(percent);
+ dialog.setProgressMessage(message);
+ }
+ });
+ }
+ }
+
+ public void setValue(final int percent) {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ dialog.setValue(percent);
+ }
+ });
+ }
+
+ public void openTraceComplete() {
+ if (null != dialog) {
+ waitingThreads();
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ AnalyzerUtil.changePage(TimelinePage.ID);
+ dialog.setValue(100);
+ dialog.close();
+
+ }
+ });
+ state = OPEN_TRACE_PROCESS_END;
+ AnalyzerUtil.executeCommand(OpenTraceCompleteHandler.ID);
+ percent = 0;
+ }
+ }
+
+ public void closeOpenTraceDialog(final String errMsg) {
+ try {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ dialog.errorOccurred(errMsg,
+ AnalyzerLabels.OPEN_TRACE_PROGRESS_ERROR);
+ dialog.setValue(50);
+ }
+ });
+
+ Thread.sleep(500);
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ dialog.setValue(100);
+ }
+ });
+
+ Thread.sleep(300);
+
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ dialog.close();
+ }
+ });
+ state = OPEN_TRACE_PROCESS_END;
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public int getState() {
+ return state;
+ }
+
+ public void runThreads() {
+ OpenTraceInputReader.startOpenTraceInputReader();
+ FileChartManager.getInstance().startUpdateLogThread();
+ UIDataManager.getInstance().startUpdateLogThread();
+ }
+
+ private void waitingThreads() {
+ while (!AnalyzerManager.isExit()) {
+ OpenTraceInputReader.stopOpenTraceInputReader();
+ FileChartManager.getInstance().stopUpdateLogThread();
+ UIDataManager.getInstance().stopUpdateLogThread();
+ try {
+ if (!UIDataManager.getInstance().isThreadAlive()) {
+ break;
+ } else {
+ Thread.sleep(AnalyzerConstants.LOG_CHECK_INTERVAL);
+ }
+ } catch (InterruptedException e) {
+ /** thread stop by interrupt */
+ break;
+ }
+ }
+ }
+
+ @Override
+ public void run() {
+ AnalyzerUtil.executeCommand(ClearHandler.ID);
+ Project project = new Project();
+ AnalyzerManager.setProjectNoRegist(project);
+ project.setSavePath(getInstance().getSavePath());
+
+ AnalyzerUtil.executeCommand(OpenTraceHandler.ID);
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.toolbar.opentrace;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.AnalyzerPaths;
+import org.tizen.dynamicanalyzer.model.TableInput;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.project.Project;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+
+public class SaveFilesTable extends DATableComposite {
+ private boolean isVaildVersion = true;
+ private final int TRACE_NAME_INDEX = 0;
+ private final int DATE_INDEX = 1;
+ private final int VALIDATE_INDEX = 2;
+ private final int COLUMN_COUNT = 2;
+
+ public SaveFilesTable(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ @Override
+ protected List<TableInput> makeTableInput() {
+ List<String> saveFileList = AnalyzerUtil
+ .getDirs(AnalyzerPaths.DYNAMIC_ANALYZER_SAVE_PATH);
+ List<TableInput> input = new ArrayList<TableInput>();
+ int size = saveFileList.size();
+ for (int i = 0; i < size; i++) {
+ // create text
+ List<String> text = new ArrayList<String>();
+ if (!saveFileList.get(i).equals(AnalyzerConstants.TEMP_FOLDER_NAME)) {
+ String path = AnalyzerPaths.DYNAMIC_ANALYZER_SAVE_PATH
+ + File.separator + saveFileList.get(i);
+ String inputText1 = saveFileList.get(i);
+ String inputText2 = getCreateTime(path);
+
+ if (inputText1.isEmpty() || null == inputText2
+ || inputText2.isEmpty()) {
+ continue;
+ }
+
+ text.add(inputText1);
+ text.add(inputText2);
+ if (isVaildVersion) {
+ text.add("Y"); //$NON-NLS-1$
+ } else {
+ text.add("N"); //$NON-NLS-1$
+ }
+ TableInput tableInput = new TableInput();
+ tableInput.setText(text);
+ input.add(tableInput);
+ }
+ }
+ return input;
+ }
+
+ @Override
+ public void updateTable() {
+ table.removeAll();
+ List<TableInput> input = makeTableInput();
+ if (null == input) {
+ return;
+ }
+ if (null != comparator) {
+ Collections.sort(input, comparator);
+ }
+ int size = input.size();
+ for (int i = 0; i < size; i++) {
+ List<String> text = input.get(i).getText();
+ if (text.size() < COLUMN_COUNT
+ || text.get(TRACE_NAME_INDEX).isEmpty()
+ || null == text.get(DATE_INDEX)
+ || text.get(DATE_INDEX).isEmpty()) {
+ continue;
+ }
+ GridItem gridItem = new GridItem(table, SWT.NONE);
+ gridItem.setData(OpenTraceDialog.SAVE_FOLDER);
+ gridItem.setData(OpenTraceDialog.CURRENT_KEY,
+ OpenTraceDialog.OTHERS);
+
+ for (int index = 0; index < COLUMN_COUNT; index++) {
+ String inputText = text.get(index);
+ gridItem.setText(index, inputText);
+ }
+ if (text.get(VALIDATE_INDEX).equals("N")) { //$NON-NLS-1$
+ gridItem.setForeground(ColorResources.ORANGE);
+ gridItem.setData(OpenTraceDialog.VERSION_KEY,
+ OpenTraceDialog.VERSION_INVALID);
+ gridItem.setData(OpenTraceDialog.CURRENT_KEY,
+ OpenTraceDialog.OTHERS);
+ gridItem.setToolTipText(TRACE_NAME_INDEX,
+ AnalyzerLabels.OPEN_TRACE_DLG_OLD_VERSION);
+ gridItem.setToolTipText(DATE_INDEX,
+ AnalyzerLabels.OPEN_TRACE_DLG_OLD_VERSION);
+ } else {
+ gridItem.setData(OpenTraceDialog.VERSION_KEY,
+ OpenTraceDialog.VERSION_VALID);
+ String path = AnalyzerPaths.DYNAMIC_ANALYZER_SAVE_PATH
+ + File.separator + text.get(TRACE_NAME_INDEX);
+
+ Project project = AnalyzerManager.getProject();
+ if (null != project) {
+ String projectPath = project.getSavePath();
+ if (path.equals(projectPath)) {
+ gridItem.setForeground(ColorResources.BLUE);
+ gridItem.setData(OpenTraceDialog.CURRENT_KEY,
+ OpenTraceDialog.CURRENT);
+ gridItem.setToolTipText(TRACE_NAME_INDEX,
+ AnalyzerLabels.OPEN_TRACE_DLG_CURRENT_TRACE);
+ gridItem.setToolTipText(DATE_INDEX,
+ AnalyzerLabels.OPEN_TRACE_DLG_CURRENT_TRACE);
+ }
+ }
+ }
+ }
+ table.update();
+ }
+
+ private String getCreateTime(String savePath) {
+ isVaildVersion = true;
+// try {
+// Connection conn = SqlManager.getInstance().getConnection(savePath);
+// Statement stat = conn.createStatement();
+// String query = "select info from project"; //$NON-NLS-1$
+// ResultSet rs = stat.executeQuery(query);
+//
+// List<String> pInfo = new ArrayList<String>();
+// while (rs.next()) {
+// pInfo.add(rs.getString("info")); //$NON-NLS-1$
+// }
+// rs.close();
+// conn.close();
+//
+// String version = pInfo.get(AnalyzerConstants.PROJECT_VERSION_INDEX);
+// if (version.isEmpty()
+// || !version.equals(AnalyzerConstants.SAVE_DATA_VERSION)) {
+// isVaildVersion = false;
+// }
+// return pInfo.get(AnalyzerConstants.PROJECT_CREATE_TIME_INDEX);
+// } catch (SQLException e) {
+// isVaildVersion = false;
+// }
+ return null;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.toolbar.opentrace;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.AnalyzerPaths;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.model.TableInput;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.project.Project;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+
+public class TempFilesTable extends DATableComposite {
+ private final int TRACE_NAME_INDEX = 0;
+ private final int DATE_INDEX = 1;
+
+ public TempFilesTable(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ @Override
+ protected List<TableInput> makeTableInput() {
+ List<String> tempFileList = AnalyzerUtil
+ .getDirs(AnalyzerPaths.TEMP_FOLDER_PATH);
+ List<TableInput> input = new ArrayList<TableInput>();
+ int size = tempFileList.size();
+ for (int i = 0; i < size; i++) {
+ // create text
+ List<String> text = new ArrayList<String>();
+ if (!tempFileList.get(i).equals(AnalyzerConstants.TEMP_FOLDER_NAME)) {
+ String path = AnalyzerPaths.TEMP_FOLDER_PATH + File.separator
+ + tempFileList.get(i);
+ text.add(tempFileList.get(i));
+ text.add(getCreateTime(path));
+ TableInput tableInput = new TableInput();
+ tableInput.setText(text);
+ input.add(tableInput);
+ }
+ }
+ return input;
+ }
+
+ @Override
+ public void updateTable() {
+ table.removeAll();
+ List<TableInput> input = makeTableInput();
+ if (null == input) {
+ return;
+ }
+ if (null != comparator) {
+ Collections.sort(input, comparator);
+ }
+ int size = input.size();
+ for (int i = 0; i < size; i++) {
+ GridItem gridItem = new GridItem(table, SWT.NONE);
+ gridItem.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
+ gridItem.setData(OpenTraceDialog.TEMP_FOLDER);
+ gridItem.setData(OpenTraceDialog.VERSION_KEY,
+ OpenTraceDialog.VERSION_VALID);
+ gridItem.setData(OpenTraceDialog.CURRENT_KEY,
+ OpenTraceDialog.OTHERS);
+
+ List<String> text = input.get(i).getText();
+ int columnCount = text.size();
+ for (int index = 0; index < columnCount; index++) {
+ String data = text.get(index);
+ if (null == data) {
+ data = CommonConstants.EMPTY;
+ }
+ gridItem.setText(index, data);
+ }
+
+ String path = AnalyzerPaths.TEMP_FOLDER_PATH + File.separator
+ + text.get(TRACE_NAME_INDEX);
+ Project project = AnalyzerManager.getProject();
+ if (null != project) {
+ String projectPath = project.getSavePath();
+ if (path.equals(projectPath)) {
+ gridItem.setForeground(ColorResources.BLUE);
+ gridItem.setData(OpenTraceDialog.CURRENT_KEY,
+ OpenTraceDialog.CURRENT);
+ gridItem.setToolTipText(TRACE_NAME_INDEX,
+ AnalyzerLabels.OPEN_TRACE_DLG_CURRENT_TRACE);
+ gridItem.setToolTipText(DATE_INDEX,
+ AnalyzerLabels.OPEN_TRACE_DLG_CURRENT_TRACE);
+ }
+ }
+ }
+ table.update();
+ }
+
+ private String getCreateTime(String savePath) {
+// try {
+// Connection conn = SqlManager.getInstance().getConnection(savePath);
+// Statement stat = conn.createStatement();
+// String query = "select info from project"; //$NON-NLS-1$
+// ResultSet rs = stat.executeQuery(query);
+//
+// List<String> pInfo = new ArrayList<String>();
+// while (rs.next()) {
+// pInfo.add(rs.getString("info")); //$NON-NLS-1$
+// }
+// rs.close();
+// conn.close();
+// if (!pInfo.isEmpty()) {
+// return pInfo.get(AnalyzerConstants.PROJECT_CREATE_TIME_INDEX);
+// }
+// } catch (SQLException e) {
+// e.printStackTrace();
+// }
+ return null;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.userinterface;
+
+import java.util.HashMap;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.logparser.LogListQueue;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.logparser.Logs;
+import org.tizen.dynamicanalyzer.ui.userinterface.control.UIControlListDataChecker;
+import org.tizen.dynamicanalyzer.ui.userinterface.profiling.UIFunctionProfilingDataChecker;
+import org.tizen.dynamicanalyzer.ui.userinterface.scene.UISceneDataChecker;
+
+public class UIDataManager implements Runnable {
+
+ private static UIDataManager instance = null;
+
+ private static UIControlListDataChecker controlListDataChecker = null;
+ private static UISceneDataChecker sceneTransformDataChecker = null;
+ private static UIFunctionProfilingDataChecker functionProfilingDataChecker = null;
+ private HashMap<String, String> findSnapshotViewHashMap = new HashMap<String, String>();
+
+ private Thread updateLogThread = null;
+ private String strTableSeleteClassName = null;
+ private LogListQueue logListQueue = null;
+
+ int testcode = 0;
+
+ public static UIDataManager getInstance() {
+ if (null == instance) {
+ instance = new UIDataManager();
+ }
+ return instance;
+ }
+
+ private UIDataManager() {
+ }
+
+ public void startUpdateLogThread() {
+ if (null == updateLogThread || !updateLogThread.isAlive()) {
+ updateLogThread = new Thread(null, new UIDataManager(),
+ AnalyzerConstants.USER_INTERFACE_PAGE_MANAGER_THREAD);
+ updateLogThread.start();
+ }
+ }
+
+ public void stopUpdateLogThread() {
+ if (null != updateLogThread && updateLogThread.isAlive()) {
+ try {
+ sendNotify();
+ updateLogThread.join();
+ System.out.println("ui data manager joined!");
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public boolean isThreadAlive() {
+ if (null == updateLogThread || !updateLogThread.isAlive()) {
+ return false;
+ }
+ return true;
+ }
+
+ public LogListQueue getLogListQueue() {
+ if (null == logListQueue) {
+ logListQueue = new LogListQueue();
+ }
+ return logListQueue;
+ }
+
+ @Override
+ public void run() {
+ LogListQueue logListQueue = getInstance().getLogListQueue();
+ while (!AnalyzerManager.isExit()) {
+ List<List<String>> logs = logListQueue.getFirst();
+ if (null == logs) {
+ break;
+ }
+ int size = logs.size();
+ for (int i = 0; i < size; i++) {
+ String logType = logs.get(i).get(LogCenterConstants.ID_INDEX);
+ int nLogType = Integer.parseInt(logType);
+ if (nLogType == LogCenterConstants.LOG_CONTROL) {
+ getInstance().getControlDataChecker()
+ .parserLog(logs.get(i));
+ } else {
+ getInstance().getSceneTransformDataChecker().parserLog(
+ logs.get(i));
+ }
+ }
+ }
+ /* log for debug */
+ System.out.println("ui data manager thread end!!"); //$NON-NLS-1$
+ }
+
+ public void parsePageData(LogPackage logPack) {
+ setSceneTransformDataTFromLogPackage(logPack);
+ setControlDataTFromLogPackage(logPack);
+ UIDataManager.getInstance().getfunctionProfilingDataChecker()
+ .updateUIApiTreeSet();
+ }
+
+ public void setControlDataTFromLogPackage(LogPackage logPack) {
+ Logs logs = logPack.getLogs(LogCenterConstants.LOG_CONTROL);
+ if (null == logs || logs.getLogs().size() == 0) {
+ return;
+ }
+ List<List<String>> inputs = logs.getCloneLogs();
+ getLogListQueue().putLog(inputs);
+ }
+
+ public void setSceneTransformDataTFromLogPackage(LogPackage logPack) {
+ Logs logs = logPack.getLogs(LogCenterConstants.LOG_SCENE);
+ if (null == logs || logs.getLogs().size() == 0) {
+ return;
+ }
+ List<List<String>> inputs = logs.getCloneLogs();
+ getLogListQueue().putLog(inputs);
+ }
+
+ public void clear() {
+ controlListDataChecker = null;
+ sceneTransformDataChecker = null;
+ functionProfilingDataChecker = null;
+ strTableSeleteClassName = null;
+ findSnapshotViewHashMap.clear();
+ }
+
+ public UIControlListDataChecker getControlDataChecker() {
+ if (null == controlListDataChecker) {
+ controlListDataChecker = new UIControlListDataChecker();
+ }
+ return controlListDataChecker;
+ }
+
+ public UISceneDataChecker getSceneTransformDataChecker() {
+ if (null == sceneTransformDataChecker) {
+ sceneTransformDataChecker = new UISceneDataChecker();
+ }
+ return sceneTransformDataChecker;
+ }
+
+ public UIFunctionProfilingDataChecker getfunctionProfilingDataChecker() {
+ if (null == functionProfilingDataChecker) {
+ functionProfilingDataChecker = new UIFunctionProfilingDataChecker();
+ }
+ return functionProfilingDataChecker;
+ }
+
+ public void setTableSeleteClassName(String data) {
+ strTableSeleteClassName = data;
+ }
+
+ public String getTableSeleteClassName() {
+ if (strTableSeleteClassName == null) {
+ strTableSeleteClassName = CommonConstants.ZERO;
+ }
+ return strTableSeleteClassName;
+ }
+
+ public static void sendNotify() {
+ LogListQueue logListQueue = getInstance().getLogListQueue();
+ synchronized (logListQueue) {
+ logListQueue.notifyAll();
+ }
+ }
+
+ public HashMap<String, String> getFindSnapshotViewHashMap() {
+ return findSnapshotViewHashMap;
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.userinterface;
+
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.nebula.widgets.grid.IInternalWidget;
+import org.eclipse.nebula.widgets.grid.internal.CheckBoxRenderer;
+import org.eclipse.nebula.widgets.grid.internal.DefaultCellRenderer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableToggleRenderer;
+
+public class UIListTableCellRenderer extends DefaultCellRenderer {
+ int leftMargin = 4;
+ int rightMargin = 4;
+ int topMargin = 0;
+ int bottomMargin = 0;
+ int textTopMargin = 1;
+ int textBottomMargin = 2;
+ int insideMargin = 3;
+ int treeIndent = 20;
+
+ private DATableToggleRenderer toggleRenderer;
+ private CheckBoxRenderer checkRenderer;
+
+ @Override
+ public void paint(GC uiGC, Object value) {
+ GridItem item = (GridItem) value;
+ uiGC.setFont(item.getFont(getColumn()));
+
+ boolean drawAsSelected = isSelected();
+ boolean drawBackground = true;
+
+ if (isCellSelected()) {
+ drawAsSelected = true;
+ }
+ if (drawAsSelected) {
+ uiGC.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_START);
+ uiGC.setBackground(ColorResources.TABLE_CONTENTS_SELECTED_END);
+ } else {
+
+ if (item.getParent().isEnabled()) {
+ Color bg = item.getBackground();
+ if (bg != null) {
+ uiGC.setBackground(bg);
+ } else {
+ drawBackground = false;
+ }
+ } else {
+ uiGC.setBackground(getDisplay().getSystemColor(
+ SWT.COLOR_WIDGET_BACKGROUND));
+ }
+ }
+
+ if (drawBackground && drawAsSelected) {
+ uiGC.fillGradientRectangle(getBounds().x, getBounds().y,
+ getBounds().width, getBounds().height, true);
+ } else if (drawBackground) {
+ uiGC.fillRectangle(getBounds().x, getBounds().y + 1,
+ getBounds().width, getBounds().height);
+ }
+
+ int x = leftMargin;
+
+ if (isTree()) {
+ x += getToggleIndent(item);
+ if (drawAsSelected) {
+ toggleRenderer.setSelected(true);
+ } else {
+ toggleRenderer.setSelected(false);
+ }
+ toggleRenderer.setExpanded(item.isExpanded());
+ toggleRenderer.setHover(getHoverDetail().equals("toggle")); //$NON-NLS-1$
+ toggleRenderer.setLocation(getBounds().x + x,
+ (getBounds().height - toggleRenderer.getBounds().height)
+ / 2 + getBounds().y);
+ toggleRenderer.paint(uiGC, item);
+ x += toggleRenderer.getBounds().width + insideMargin;
+
+ }
+
+ if (isCheck()) {
+
+ checkRenderer.setChecked(item.getChecked(getColumn()));
+ checkRenderer.setGrayed(item.getGrayed(getColumn()));
+ if (!item.getParent().isEnabled()) {
+ checkRenderer.setGrayed(true);
+ }
+ checkRenderer.setHover(getHoverDetail().equals("check")); //$NON-NLS-1$
+ checkRenderer.setBounds(getBounds().x + x,
+ (getBounds().height - checkRenderer.getBounds().height) / 2
+ + getBounds().y, checkRenderer.getBounds().width,
+ checkRenderer.getBounds().height);
+ checkRenderer.paint(uiGC, null);
+ x += checkRenderer.getBounds().width + insideMargin;
+ }
+
+ Image image = item.getImage(getColumn());
+ if (image != null) {
+ int y = getBounds().y;
+ y += (getBounds().height - image.getBounds().height) / 2;
+ uiGC.drawImage(image, getBounds().x + x, y);
+ x += image.getBounds().width + insideMargin;
+ }
+
+ int width = getBounds().width - x - rightMargin;
+ String uiText = item.getText(getColumn());
+
+ if (getAlignment() == SWT.RIGHT) {
+ int len = uiGC.stringExtent(uiText).x;
+ if (len < width) {
+ x += width - len;
+ }
+ } else if (getAlignment() == SWT.CENTER) {
+ int len = uiGC.stringExtent(uiText).x;
+ if (len < width) {
+ x += (width - len) / 2;
+ }
+ }
+
+ if (drawAsSelected) {
+ uiGC.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_FONT_COLOR);
+ } else {
+ Color fontColor = item.getForeground();
+ if (null != fontColor) {
+ uiGC.setForeground(item.getForeground());
+ } else {
+ uiGC.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
+ }
+ }
+
+ uiGC.setFont(FontResources.TABLE_CELL_FONT);
+
+ if (getColumn() != 0) {
+ uiGC.drawText(uiText, getBounds().x + x, getBounds().y + textTopMargin,
+ true);
+ }
+ if (item.getParent().getLinesVisible()) {
+ if (isCellSelected()) {
+ uiGC.setForeground(ColorResources.TABLE_LINE);
+ } else {
+ uiGC.setForeground(ColorResources.TABLE_LINE);
+ }
+ uiGC.drawLine(getBounds().x, getBounds().y + getBounds().height,
+ getBounds().x + getBounds().width - 1, getBounds().y
+ + getBounds().height);
+ uiGC.drawLine(getBounds().x + getBounds().width - 1, getBounds().y,
+ getBounds().x + getBounds().width - 1, getBounds().y
+ + getBounds().height);
+ }
+ if (isCellFocus()) {
+ Rectangle focusRect = new Rectangle(getBounds().x - 1,
+ getBounds().y - 1, getBounds().width,
+ getBounds().height + 1);
+ uiGC.setForeground(ColorResources.RED);
+ uiGC.drawRectangle(focusRect);
+ if (isFocus()) {
+ focusRect.x++;
+ focusRect.width -= 2;
+ focusRect.y++;
+ focusRect.height -= 2;
+ uiGC.drawRectangle(focusRect);
+ }
+ }
+ }
+
+ private int getToggleIndent(GridItem item) {
+ return item.getLevel() * 20;
+ }
+
+ public void setTree(boolean treeData) {
+ super.setTree(treeData);
+ if (treeData) {
+ toggleRenderer = new DATableToggleRenderer();
+ toggleRenderer.setDisplay(getDisplay());
+ }
+ }
+
+ public Point computeSize(GC gc, int wHint, int hHint, Object value) {
+ GridItem item = (GridItem) value;
+ gc.setFont(item.getFont(getColumn()));
+ int x = 0;
+
+ x += leftMargin;
+
+ if (isTree()) {
+ x += getToggleIndent(item);
+ x += toggleRenderer.getBounds().width + insideMargin;
+ }
+ if (isCheck()) {
+ x += checkRenderer.getBounds().width + insideMargin;
+ }
+
+ int y = 0;
+ Image image = item.getImage(getColumn());
+ if (image != null) {
+ y = topMargin + image.getBounds().height + bottomMargin;
+
+ x += image.getBounds().width + insideMargin;
+ }
+ x += gc.stringExtent(item.getText(getColumn())).x + rightMargin;
+ y = Math.max(y, topMargin + gc.getFontMetrics().getHeight()
+ + bottomMargin);
+ return new Point(x, y);
+ }
+
+ public boolean notify(int event, Point point, Object value) {
+ GridItem item = (GridItem) value;
+ if (isCheck()) {
+ if (event == IInternalWidget.MouseMove) {
+ if (overCheck(item, point)) {
+ setHoverDetail("check"); //$NON-NLS-1$
+ return true;
+ }
+ }
+
+ if (event == IInternalWidget.LeftMouseButtonDown) {
+ if (overCheck(item, point)) {
+ item.setChecked(getColumn(), !item.getChecked(getColumn()));
+ item.getParent().redraw();
+ item.fireCheckEvent(getColumn());
+ return true;
+ }
+ }
+ }
+
+ if (isTree() && item.hasChildren()) {
+ if (event == IInternalWidget.MouseMove) {
+ if (overToggle(item, point)) {
+ setHoverDetail("toggle"); //$NON-NLS-1$
+ return true;
+ }
+ }
+ if (event == IInternalWidget.LeftMouseButtonDown) {
+ if (overToggle(item, point)) {
+ item.setExpanded(!item.isExpanded());
+ item.getParent().redraw();
+ if (item.isExpanded()) {
+ item.fireEvent(SWT.Expand);
+ } else {
+ item.fireEvent(SWT.Collapse);
+ }
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ private boolean overCheck(GridItem item, Point point) {
+ point = new Point(point.x, point.y);
+ point.x -= getBounds().x - 1;
+ point.y -= getBounds().y - 1;
+
+ int x = leftMargin;
+ if (isTree()) {
+ x += getToggleIndent(item);
+ x += toggleRenderer.getSize().x + insideMargin;
+ }
+ if (point.x >= x && point.x < (x + checkRenderer.getSize().x)) {
+ int yStart = ((getBounds().height - checkRenderer.getBounds().height) / 2);
+ if (point.y >= yStart
+ && point.y < yStart + checkRenderer.getSize().y) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean overToggle(GridItem item, Point point) {
+ point = new Point(point.x, point.y);
+ point.x -= getBounds().x - 1;
+ point.y -= getBounds().y - 1;
+
+ int x = leftMargin;
+ x += getToggleIndent(item);
+
+ if (point.x >= x && point.x < (x + toggleRenderer.getSize().x)) {
+ // return true;
+ int yStart = ((getBounds().height - toggleRenderer.getBounds().height) / 2);
+ if (point.y >= yStart
+ && point.y < yStart + toggleRenderer.getSize().y) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void setCheck(boolean check) {
+ super.setCheck(check);
+
+ if (check) {
+ checkRenderer = new CheckBoxRenderer();
+ checkRenderer.setDisplay(getDisplay());
+ } else {
+ checkRenderer = null;
+ }
+ }
+
+ public Rectangle getTextBounds(GridItem item, boolean preferred) {
+ int x = leftMargin;
+ if (isTree()) {
+ x += getToggleIndent(item);
+
+ x += toggleRenderer.getBounds().width + insideMargin;
+ }
+ if (isCheck()) {
+ x += checkRenderer.getBounds().width + insideMargin;
+ }
+
+ Image image = item.getImage(getColumn());
+ if (image != null) {
+ x += image.getBounds().width + insideMargin;
+ }
+
+ Rectangle bounds = new Rectangle(x, topMargin, 0, 0);
+
+ GC gc = new GC(item.getParent());
+ gc.setFont(item.getFont(getColumn()));
+ Point size = gc.stringExtent(item.getText(getColumn()));
+
+ bounds.height = size.y;
+
+ if (preferred) {
+ bounds.width = size.x;
+ } else {
+ bounds.width = getBounds().width - x - rightMargin;
+ }
+
+ gc.dispose();
+
+ return bounds;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.userinterface;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallstackView;
+import org.tizen.dynamicanalyzer.ui.info.snapshot.SnapshotView;
+import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
+import org.tizen.dynamicanalyzer.ui.userinterface.control.UIControlListView;
+import org.tizen.dynamicanalyzer.ui.userinterface.profiling.UIFunctionProfilingView;
+import org.tizen.dynamicanalyzer.ui.userinterface.scene.UISceneListView;
+import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
+
+public class UIPage extends DAPageComposite {
+ SashForm baseForm;
+ SashForm upperForm;
+ SashForm bottomForm;
+ public static final String ID = UIPage.class.getName();
+
+ public UIPage(Composite parent, int style) {
+ super(parent, style);
+ name = AnalyzerLabels.COOLBAR_AREA_UI;
+ this.setLayout(new FillLayout());
+ baseForm = new SashForm(this, SWT.VERTICAL);
+ baseForm.setLayout(new FillLayout());
+
+ upperForm = new SashForm(baseForm, SWT.HORIZONTAL);
+
+ UIControlListView topLeftFirst = new UIControlListView(upperForm,
+ SWT.NONE);
+ addView(topLeftFirst);
+
+ UISceneListView topLeftSencond = new UISceneListView(upperForm,
+ SWT.NONE);
+ addView(topLeftSencond);
+
+ DATabComposite tabView = new DATabComposite(upperForm, SWT.NONE);
+ addView(tabView);
+ {
+ SnapshotView currentView = new SnapshotView(
+ tabView.getContentComposite(), SWT.NONE, false);
+ currentView.setObservingViews(new String[] { UISceneListView.ID,
+ UIControlListView.ID });
+ tabView.addView(currentView, false);
+ CallstackView callstackView = new CallstackView(
+ tabView.getContentComposite(), SWT.NONE);
+ callstackView.setObservingViews(new String[] { UISceneListView.ID,
+ UIControlListView.ID });
+ tabView.addView(callstackView, false);
+ }
+
+ upperForm.setWeights(new int[] { 37, 40, 23 });
+
+ bottomForm = new SashForm(baseForm, SWT.HORIZONTAL);
+ UIFunctionProfilingView bottomLeftFirst = new UIFunctionProfilingView(
+ bottomForm, SWT.NONE);
+ addView(bottomLeftFirst);
+ bottomForm.setWeights(new int[] { 100 });
+ }
+
+ @Override
+ protected void setFormWeights() {
+ upperForm.setWeights(new int[] { 37, 100 - 37 - wRate, wRate });
+ baseForm.setWeights(new int[] { hRate, 100 - hRate });
+ }
+
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.userinterface.control;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+
+public class UIControlListData {
+ public static final int KEY_INDEX = LogCenterConstants.SEQUENCE_NUMBER_INDEX;
+
+ public static final int USER_INTERFACE_CONTROL_LIST_CONTROL = 0;
+ public static final int USER_INTERFACE_CONTROL_LIST_CLASS_NAME = 1;
+ public static final int USER_INTERFACE_CONTROL_LIST_INITIALIZER_TIME = 2;
+ public static final int USER_INTERFACE_CONTROL_LIST_TERMININATE_TIME = 3;
+ public static final int USER_INTERFACE_CONTROL_LIST_DATABLEDATAFORMAT_CLASSNAME_INDEX = 20;
+
+ private String strCalssKeyName = null;
+ private String strSequence = null;
+ private String strTime = null;
+ private String strAPIName = null;
+ private String strInitializeTime = null;
+ private String strTerminateTime = null;
+
+ private String strParentName = null;
+ private String strParentClassName = null;
+ private String strParentPointer = null;
+ private String strChildName = null;
+ private String strChildClassName = null;
+ private String strChildPointer = null;
+ private String strControlType = null;
+
+ private List<String> data;
+
+ public UIControlListData(String[] input) {
+ List<String> data = getData();
+ for (int i = 0; i < input.length; i++) {
+ data.add(input[i]);
+ }
+ }
+
+ public UIControlListData(List<String> input) {
+ if (null != input && !input.isEmpty()) {
+ getData().addAll(input);
+ }
+ }
+
+ public List<String> getData() {
+ if (null == data) {
+ data = new ArrayList<String>();
+ }
+ return data;
+ }
+
+ public String getLogData(int logIndex) {
+ if (!getData().isEmpty()) {
+ return data.get(logIndex);
+ }
+ return null;
+ }
+
+ public void setSequence(String data) {
+ strSequence = data;
+ }
+
+ public String getSequence() {
+ if (strSequence == null) {
+ strSequence = CommonConstants.EMPTY;
+ }
+ return strSequence;
+ }
+
+ public void setCalssKeyName(String data) {
+ strCalssKeyName = data;
+ }
+
+ public String getCalssKeyName() {
+ if (strCalssKeyName == null) {
+ strCalssKeyName = CommonConstants.EMPTY;
+ }
+ return strCalssKeyName;
+ }
+
+ public void setTime(String data) {
+ strTime = data;
+ }
+
+ public String getTime() {
+ if (strTime == null) {
+ strTime = CommonConstants.EMPTY;
+ }
+ return strTime;
+ }
+
+ public void setControlType(String data) {
+ strControlType = data;
+ }
+
+ public String getControlType() {
+ if (strControlType == null) {
+ strControlType = CommonConstants.DASH;
+ }
+ return strControlType;
+ }
+
+ public void setAPIName(String data) {
+ strAPIName = data;
+ }
+
+ public String getAPIName() {
+ if (strAPIName == null) {
+ strAPIName = CommonConstants.EMPTY;
+ }
+ return strAPIName;
+ }
+
+ public void setInitializeTime(String data) {
+ strInitializeTime = data;
+ }
+
+ public String getInitializeTime() {
+ if (strInitializeTime == null) {
+ strInitializeTime = CommonConstants.EMPTY;
+ }
+ return strInitializeTime;
+ }
+
+ public void setTerminateTime(String data) {
+ strTerminateTime = data;
+ }
+
+ public String getTerminateTime() {
+ if (strTerminateTime == null) {
+ strTerminateTime = CommonConstants.EMPTY;
+ }
+ return strTerminateTime;
+ }
+
+ public void setParentPointer(String data) {
+ strParentPointer = data;
+ }
+
+ public String getParentPointer() {
+ if (strParentPointer == null) {
+ strParentPointer = CommonConstants.EMPTY;
+ }
+ return strParentPointer;
+ }
+
+ public void setParentName(String data) {
+ strParentName = data;
+ }
+
+ public String getParentName() {
+ if (strParentName == null) {
+ strParentName = CommonConstants.EMPTY;
+ }
+ return strParentName;
+ }
+
+ public void setParentClassName(String data) {
+ strParentClassName = data;
+ }
+
+ public String getParentClassName() {
+ if (strParentClassName == null) {
+ strParentClassName = CommonConstants.EMPTY;
+ }
+ return strParentClassName;
+ }
+
+ public void setChildName(String data) {
+ strChildName = data;
+ }
+
+ public String getChildName() {
+ if (strChildName == null) {
+ strChildName = CommonConstants.EMPTY;
+ }
+ return strChildName;
+ }
+
+ public void setChildClassName(String data) {
+ strChildClassName = data;
+ }
+
+ public String getChildClassName() {
+ if (strChildClassName == null) {
+ strChildClassName = CommonConstants.EMPTY;
+ }
+ return strChildClassName;
+ }
+
+ public void setChildPointer(String data) {
+ strChildPointer = data;
+ }
+
+ public String getChildPointer() {
+ if (strChildPointer == null) {
+ strChildPointer = CommonConstants.EMPTY;
+ }
+ return strChildPointer;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.userinterface.control;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.common.SymbolManager;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
+import org.tizen.dynamicanalyzer.ui.userinterface.profiling.UIFunctionProfilingData;
+
+public class UIControlListDataChecker {
+
+ private List<UIControlListData> controlList = null;
+ private List<String> removeCallControlList = null;
+ private String preSeq = CommonConstants.EMPTY;
+
+ public void parserLog(List<String> input) {
+
+ String stClassName = getClassName(
+ input.get(LogCenterConstants.APINAME_INDEX)).trim();
+ if (stClassName.equals("AddFrame") || stClassName.equals("AddControl")) {//$NON-NLS-1$ //$NON-NLS-2$
+ if (isExistData(
+ input.get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_PARENT_CLASS_NAME_INDEX),
+ input.get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_CHILD_CLASS_NAME_INDEX)) == true) {
+ return;
+ }
+ if (preSeq.equals(input
+ .get(LogCenterConstants.SEQUENCE_NUMBER_INDEX))) {
+ return;
+ }
+
+ UIControlListData controlData = new UIControlListData(input);
+
+ controlData.setSequence(input
+ .get(LogCenterConstants.SEQUENCE_NUMBER_INDEX));
+
+ controlData.setTime(input.get(LogCenterConstants.TIME_INDEX));
+
+ controlData.setAPIName(stClassName);
+
+ controlData.setInitializeTime(CommonConstants.DASH);
+ controlData.setTerminateTime(CommonConstants.DASH);
+
+ controlData
+ .setParentName(input
+ .get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_PARENT_NAME_INDEX));
+ controlData
+ .setParentClassName(input
+ .get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_PARENT_CLASS_NAME_INDEX));
+ controlData
+ .setParentPointer(input
+ .get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_PARENT_POINTER_INDEX));
+
+ controlData
+ .setChildName(input
+ .get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_CHILD_NAME_INDEX));
+
+ StringBuilder childClassNameDemangling = new StringBuilder(
+ input.get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_CHILD_CLASS_NAME_INDEX));
+
+ childClassNameDemangling.insert(0, "_Z");//$NON-NLS-1$
+ String childClassName = SymbolManager
+ .demanglingFunctionName(childClassNameDemangling.toString());
+
+ controlData.setChildClassName(childClassName);
+ controlData
+ .setChildPointer(input
+ .get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_CHILD_POINTER_INDEX));
+
+ controlData
+ .setControlType(input
+ .get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_CHILD_NAME_INDEX));
+
+ controlData.setCalssKeyName(getClassName(input));
+
+ addSortData(controlData);
+ setUIControlListTimeData();
+
+ preSeq = input.get(LogCenterConstants.SEQUENCE_NUMBER_INDEX);
+
+ } else if (stClassName.trim().equals("RemoveControl")) {//$NON-NLS-1$
+ getRemoveCallControlList()
+ .add(input
+ .get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_CHILD_CLASS_NAME_INDEX));
+ } else if (stClassName.trim().equals("SetName")//$NON-NLS-1$
+ || stClassName.equals("RemoveFrame")//$NON-NLS-1$
+ || stClassName.equals("RemoveAllControl")) {//$NON-NLS-1$
+ return;
+ } else {
+ System.out.println("wrong type log : " + stClassName.trim());
+ }
+ }
+
+ private boolean isExistData(String parentClassNam, String childClassName) {
+ if (getRemoveCallControlList() == null) {
+ return false;
+ } else {
+ int nSize = getRemoveCallControlList().size();
+ for (int i = 0; i < nSize; i++) {
+ if (getRemoveCallControlList().get(i).equals(parentClassNam)
+ || getRemoveCallControlList().get(i).equals(
+ childClassName)) {
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+
+ private void addSortData(UIControlListData data) {
+ int nSize = getDataList().size();
+ for (int i = 0; i < nSize; i++) {
+ if (data.getParentPointer().trim().equals(CommonConstants.EMPTY)) {
+ getDataList().add(0, data);
+ return;
+ } else if (getDataList().get(i).getChildPointer()
+ .equals(data.getParentPointer())) {
+ getDataList().add(i + 1, data);
+ return;
+ } else if (getDataList().get(i).getParentPointer()
+ .equals(data.getChildPointer())) {
+ int insertIndex = 0;
+ if (i - 1 < 0) {
+ insertIndex = 0;
+ } else {
+ insertIndex = i - 1;
+ }
+ getDataList().add(insertIndex, data);
+ return;
+ }
+ }
+ getDataList().add(data);
+ }
+
+ private String getClassName(String apiName) {
+ String[] splitApiNameList = apiName.split(CommonConstants.DOUBLE_COLON);
+ String strApiName = new String(splitApiNameList[0].trim());
+ return strApiName;
+ }
+
+ public void notificationFromUserInterfaceFunctionProfilingDataChecker() {
+ if (controlList != null) {
+ setUIControlListTimeData();
+ }
+ }
+
+ private void setUIControlListTimeData() {
+ UIDataManager uiManager = UIDataManager.getInstance();
+ List<UIFunctionProfilingData> controlList = uiManager
+ .getfunctionProfilingDataChecker().getDataList();
+ for (int i = 0; i < controlList.size(); i++) {
+ String[] splitProfilingList = controlList.get(i).getAPIName()
+ .split(CommonConstants.DOUBLE_COLON);
+ String strProfilingClassName = new String(
+ splitProfilingList[0].trim());
+ String strProfilingAPIName = new String(
+ splitProfilingList[splitProfilingList.length - 1].trim());
+ for (int j = 0; j < getDataList().size(); j++) {
+ if (getDataList().get(j).getChildClassName().trim()
+ .contains(strProfilingClassName)) {
+ if (strProfilingAPIName.trim().contains("OnInitializing")) { //$NON-NLS-1$
+ getDataList().get(j).setInitializeTime(
+ controlList.get(i).getExclEsapsedTime());
+ } else if (strProfilingAPIName.trim().contains(
+ "OnTerminating")) { //$NON-NLS-1${
+ getDataList().get(j).setTerminateTime(
+ controlList.get(i).getExclEsapsedTime());
+ }
+ }
+ }
+ }
+ }
+
+ private String getDemanglingName(String uiClassName){
+ String demangleName = CommonConstants.EMPTY;
+ StringBuilder childClassNameDemangling = new StringBuilder(uiClassName);
+ if (childClassNameDemangling.indexOf("_Z") != 0){//$NON-NLS-1$
+ childClassNameDemangling.insert(0, "_Z");//$NON-NLS-1$
+ demangleName = SymbolManager
+ .demanglingFunctionName(childClassNameDemangling.toString());
+ }
+ return demangleName;
+ }
+
+ private String getClassName(List<String> dataFormat) {
+ String apiName = dataFormat.get(LogCenterConstants.APINAME_INDEX);
+ if (apiName.contains("AddFrame")) {//$NON-NLS-1$
+ String className = dataFormat.get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_CHILD_CLASS_NAME_INDEX);
+ return getDemanglingName(className);
+ }
+ String controlTyp = dataFormat
+ .get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_CHILD_NAME_INDEX);
+
+ String className = CommonConstants.EMPTY;
+ if (controlTyp.contains("Panel") || controlTyp.contains("Form")) {//$NON-NLS-1$//$NON-NLS-2$
+ className = dataFormat
+ .get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_CHILD_CLASS_NAME_INDEX);
+ } else {
+ className = dataFormat
+ .get(LogCenterConstants.USER_INTERFACE_CONTROL_LIST_PARENT_CLASS_NAME_INDEX);
+ }
+ return getDemanglingName(className);
+ }
+
+ public List<UIControlListData> getDataList() {
+ if (null == controlList) {
+ controlList = new ArrayList<UIControlListData>();
+ }
+ return controlList;
+ }
+
+ public List<String> getRemoveCallControlList() {
+ if (null == removeCallControlList) {
+ removeCallControlList = new ArrayList<String>();
+ }
+ return removeCallControlList;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.userinterface.control;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.GridColumn;
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.model.TreeInput;
+import org.tizen.dynamicanalyzer.sql.SqlManager;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfilingData;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIListTableCellRenderer;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableHeaderRenderer;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.TreeDataComparator;
+
+public class UIControlListTable extends DATreeComposite {
+ public static final String ID = UIControlListTable.class.getName();
+ public boolean selfUpdate = false;
+
+ public UIControlListTable(Composite parent, int compStyle, int tableStyle) {
+ super(parent, compStyle, tableStyle);
+ setComparator(new TreeDataComparator());
+
+ comparator.setType(AnalyzerConstants.SORT_TYPE_NUM);
+ comparator.setColumn(2);
+ comparator.reverseDirection();
+
+ table.addListener(SWT.Expand, new Listener() {
+
+ @Override
+ public void handleEvent(Event event) {
+ GridItem item = (GridItem) event.item;
+ setExpand(item, true);
+ }
+ });
+
+ table.addListener(SWT.Collapse, new Listener() {
+ @Override
+ public void handleEvent(Event event) {
+ GridItem item = (GridItem) event.item;
+ setExpand(item, false);
+ }
+ });
+
+ table.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ GridItem[] items = table.getSelection();
+ if (items.length <= 0) {
+ return;
+ }
+ DATableDataFormat dataFormat = (DATableDataFormat) items[0]
+ .getData();
+ String className = dataFormat.getData().get(
+ dataFormat.getData().size() - 1);
+ UIDataManager.getInstance().setTableSeleteClassName(className);
+ String time = getSnapsotForScene(className, dataFormat
+ .getData().get(LogCenterConstants.TIME_INDEX));
+
+ DASelectionData selData = new DASelectionData(
+ UIControlListView.ID, Long.parseLong(time), 0, items,
+ table);
+
+ AnalyzerManager.getCurrentPage().controlSelection(
+ UIControlListView.ID);
+ AnalyzerManager.getCurrentPage().updatePage(selData);
+
+ setSelfUpdate(true);
+ updateTree();
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // TODO Auto-generated method stub
+ }
+ });
+
+ table.addMouseListener(new MouseListener() {
+
+ @Override
+ public void mouseUp(MouseEvent e) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void mouseDown(MouseEvent e) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void mouseDoubleClick(MouseEvent e) {
+ GridItem[] items = (GridItem[]) table.getSelection();
+ if (null == items || items.length == 0) {
+ return;
+ }
+ GridItem item = items[0];
+ if (item.isExpanded()) {
+ setExpand(item, false);
+ } else {
+ setExpand(item, true);
+ }
+ setSelfUpdate(true);
+ updateTree();
+ }
+ });
+ }
+
+ private String getSnapsotForScene(String className, String strTime) {
+ String time = UIDataManager.getInstance().getFindSnapshotViewHashMap()
+ .get(className);
+ if (time == null) {
+ time = strTime;
+ }
+ String query = "select min(time) from screenshot where time >="//$NON-NLS-1$
+ + time + ";";//$NON-NLS-1$
+ System.out.println("getSnapsotForScene");
+ String result = SqlManager.getInstance().executeSelectQuery(query);
+ if (result == null) {
+ result = strTime;
+ }
+ return result;
+ }
+
+ @Override
+ public void setColumns(String[] columnNames) {
+ int size = columnNames.length;
+ for (int i = 0; i < size; i++) {
+ GridColumn column = new GridColumn(table, SWT.NONE);
+ column.setText(columnNames[i]);
+ if (isTree && i == 0) {
+ column.setTree(true);
+ }
+ column.setCellRenderer(new UIListTableCellRenderer());
+ column.setHeaderRenderer(new DATableHeaderRenderer());
+ column.pack();
+
+ if (null != comparator && null != sourceColumns
+ && null != sortTypes) {
+ final int type = sortTypes[i];
+ final int sourceColumn = sourceColumns[i];
+ final int columnIndex = i;
+ column.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ comparator.setType(type);
+ comparator.setColumn(columnIndex);
+ comparator.setSourceColumn(sourceColumn);
+ comparator.reverseDirection();
+ updateTree();
+ }
+ });
+ }
+ }
+ }
+
+ public List<ProfilingData> difference(ArrayList<ProfilingData> base,
+ ArrayList<ProfilingData> target) {
+ @SuppressWarnings("unchecked")
+ ArrayList<ProfilingData> result = (ArrayList<ProfilingData>) base
+ .clone();
+ result.removeAll(target);
+ return result;
+ }
+
+ private TreeInput makeInput(UIControlListData input) {
+
+ DATableDataFormat tableData = new DATableDataFormat(input.getSequence());
+ List<String> inputData = new ArrayList<String>();
+
+ // make input data
+ int nSize = input.getData().size();
+ for (int j = 0; j < nSize; j++) {
+ inputData.add(input.getData().get(j));
+ }
+ inputData.add(input.getCalssKeyName());
+ tableData.getData().addAll(inputData);
+
+ tableData.setObject(input.getChildClassName());
+ List<String> text = new ArrayList<String>();
+ text.add(input.getChildClassName());
+ text.add(input.getInitializeTime());
+ text.add(input.getTerminateTime());
+ text.add(input.getControlType());
+
+ TreeInput output = new TreeInput();
+ output.setText(text);
+ output.setData(tableData);
+
+ output.setParent(input.getParentPointer());
+ output.setChild(input.getChildPointer());
+
+ String strSelectedClassname = UIDataManager.getInstance()
+ .getTableSeleteClassName();
+ boolean isUpdate = true;
+
+ if ((isSelfUpdate() == true)
+ && (input.getControlType().trim().equals("Frame") == false)//$NON-NLS-1$
+ && (input.getControlType().trim().equals("Form") == false)//$NON-NLS-1$
+ && (input.getControlType().trim().equals("Panel") == false)) {//$NON-NLS-1$
+ isUpdate = false;
+ }
+ if (strSelectedClassname.equals(input.getCalssKeyName())
+ && (isUpdate == true)) {
+ output.setSecondSelection(true);
+ }
+ return output;
+ }
+
+ // !! recursive!!
+ public boolean makeChildTree(TreeInput nodeParent, TreeInput currentNode,
+ int nNodeDepth) {
+ if (nodeParent.getChild().trim().equals(currentNode.getParent().trim())) {
+ nodeParent.getChildren().add(currentNode);
+ return true;
+ } else {
+ for (int i = 0; i < nodeParent.getChildren().size(); i++) {
+ if (makeChildTree(nodeParent.getChildren().get(i), currentNode,
+ nNodeDepth++) == true) {
+ break;
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public List<TreeInput> makeTreeInput() {
+ List<UIControlListData> controlList = UIDataManager.getInstance()
+ .getControlDataChecker().getDataList();
+ List<TreeInput> output = new ArrayList<TreeInput>();
+ int size = controlList.size();
+ int nNodeDepth = 0;
+ for (int i = 0; i < size; i++) {
+ // System.out.println("sort "+i+" "+controlList.get(i).getData());
+ TreeInput currentNode = makeInput(controlList.get(i));
+ if (i == 0) {
+ output.add(currentNode);
+ } else { // first Parent Node, Last Child Node
+ for (int j = 0; j < output.size(); j++) {
+ if (makeChildTree(output.get(j), currentNode, nNodeDepth++) == true) {
+ break;
+ }
+ }
+ }
+ }
+ return output;
+
+ }
+
+ public boolean isSelfUpdate() {
+ return selfUpdate;
+ }
+
+ public void setSelfUpdate(boolean update) {
+ selfUpdate = update;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.userinterface.control;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.model.DAView;
+import org.tizen.dynamicanalyzer.nl.UserInterfacePageLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
+import org.tizen.dynamicanalyzer.ui.userinterface.profiling.UIFunctionProfilingView;
+import org.tizen.dynamicanalyzer.ui.userinterface.scene.UISceneListView;
+import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
+import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
+
+public class UIControlListView extends DAView {
+
+ public static final String ID = UIControlListView.class.getName();
+
+ int[] innerMaxWeight = { 100, 0, 0 };
+ int[] outerMaxWeight = { 100, 0 };
+
+ UIDataManager tManager = UIDataManager.getInstance();
+
+ private String[] columnNames = {
+ UserInterfacePageLabels.USERINTERFACE_CONTROL_LIST_VIEW_COLUMN_0,
+ UserInterfacePageLabels.USERINTERFACE_CONTROL_LIST_VIEW_COLUMN_1,
+ UserInterfacePageLabels.USERINTERFACE_CONTROL_LIST_VIEW_COLUMN_2,
+ UserInterfacePageLabels.USERINTERFACE_CONTROL_LIST_VIEW_COLUMN_3 };
+ private int[] columnSizes = { 250, 0, 0, 0 };
+
+ UIControlListTable treeComp = null;
+ private boolean[] columnVisibility = { true, true, true, true, true };
+ int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NONE,
+ AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM,
+ AnalyzerConstants.SORT_TYPE_NUM };
+ int[] sourceColumns = {
+ UIControlListData.USER_INTERFACE_CONTROL_LIST_CONTROL,
+ UIControlListData.USER_INTERFACE_CONTROL_LIST_CLASS_NAME,
+ UIControlListData.USER_INTERFACE_CONTROL_LIST_INITIALIZER_TIME,
+ UIControlListData.USER_INTERFACE_CONTROL_LIST_TERMININATE_TIME };
+
+ public UIControlListView(Composite parent, int style) {
+ super(parent, style);
+ this.setLayout(new FillLayout());
+
+ ViewContainer viewContainer = new ViewContainer(this, true);
+ viewContainer
+ .setTitleText(UserInterfacePageLabels.USERINTERFACE_CONTROL_LIST_VIEW_NAME);
+
+ setMaxWeight(innerMaxWeight, outerMaxWeight);
+
+ Composite contents = viewContainer.getContentArea();
+ contents.setBackground(ColorResources.WINDOW_BG_COLOR);
+ contents.setLayout(new FillLayout());
+ treeComp = new UIControlListTable(contents, SWT.NONE, SWT.SINGLE
+ | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
+ /*** setTree set first!!! ***/
+ treeComp.setTableName(UserInterfacePageLabels.USERINTERFACE_CONTROL_LIST_VIEW_NAME);
+ treeComp.setTree(true);
+ treeComp.setSortTypes(sortTypes);
+ treeComp.setSourceColumns(sourceColumns);
+ treeComp.setColumns(columnNames);
+ treeComp.setColumnSize(columnSizes);
+ treeComp.setColumnVisibility(columnVisibility);
+ treeComp.setTableToolTipEnable(false);
+ treeComp.setTableToolTipListener(null);
+
+ contents.addControlListener(new TableColumnSizePackListener(treeComp,
+ columnSizes));
+ }
+
+ @Override
+ public void updateView() {
+ treeComp.updateTree();
+ }
+
+ public void updateView(DASelectionData selData) {
+ /* only ui page update */
+ if (selData.getViewId().equals(UIFunctionProfilingView.ID)
+ || selData.getViewId().equals(UISceneListView.ID)) {
+ treeComp.setSelfUpdate(false);
+ treeComp.updateTree();
+ }
+ }
+
+ @Override
+ public void clear() {
+ treeComp.clear();
+ UIDataManager.getInstance().clear();
+ }
+
+ @Override
+ public Control getControl() {
+ return treeComp;
+ }
+
+ @Override
+ public void updateLog(LogPackage logPack) {
+ tManager.parsePageData(logPack);
+ }
+
+ @Override
+ public void otherViewSelectionOccured() {
+ treeComp.deselectAll();
+ }
+
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.userinterface.profiling;
+
+import org.eclipse.nebula.widgets.grid.GridColumnGroup;
+import org.eclipse.nebula.widgets.grid.internal.DefaultColumnGroupHeaderRenderer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+
+public class UIFunctionProfilingColumnGroupRenderer extends
+ DefaultColumnGroupHeaderRenderer {
+
+ int bottomMargin = 4;
+
+ @Override
+ public boolean notify(int arg0, Point arg1, Object arg2) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public void paint(GC gc, Object arg1) {
+ GridColumnGroup column = (GridColumnGroup) arg1;
+ gc.setBackground(ColorResources.TABLE_HEADER_BG);
+ Rectangle rect = getBounds();
+ gc.fillRectangle(rect.x, rect.y, rect.width, rect.height);
+ gc.setForeground(ColorResources.TABLE_LINE);
+ gc.drawLine(rect.x - 1, rect.y, rect.x - 1, rect.y + rect.height);
+ gc.drawLine(rect.x - 1, rect.y - 1 + rect.height, rect.x + rect.width,
+ rect.y - 1 + rect.height);
+ gc.setForeground(ColorResources.TABLE_HEADER_FONT_COLOR);
+ gc.setFont(FontResources.TABLE_HEADER_FONT);
+ String inputText = column.getText();
+ Point textSize = gc.textExtent(inputText, SWT.DRAW_MNEMONIC);
+ int textWidth = textSize.x;
+ int y = getBounds().y + getBounds().height - bottomMargin
+ - gc.getFontMetrics().getHeight();
+ int x = rect.x + (rect.width - textWidth) / 2;
+ gc.drawString(inputText, x, y, true);
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.userinterface.profiling;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfilingData;
+import org.tizen.dynamicanalyzer.utils.Formatter;
+
+public class UIFunctionProfilingData {
+ public static final int KEY_INDEX = LogCenterConstants.SEQUENCE_NUMBER_INDEX;
+
+ public static final int USER_INTERFACE_PROFILING_LIST_API_NAME = 0;
+ public static final int USER_INTERFACE_PROFILING_LIST_EXCL_CPU_TIME = 1;
+ public static final int USER_INTERFACE_PROFILING_LIST_INCL_CPU_TIME = 2;
+ public static final int USER_INTERFACE_PROFILING_LIST_INCL_ESAPSED_TIME = 3;
+ public static final int USER_INTERFACE_PROFILING_LIST_EXCL_ESAPSED_TIME = 4;
+ public static final int USER_INTERFACE_PROFILING_LIST_EXCL_CPU_AVG_TIME = 5;
+ public static final int USER_INTERFACE_PROFILING_LIST_INCL_CPU_AVG_TIME = 6;
+ public static final int USER_INTERFACE_PROFILING_LIST_INCL_ESAPSED_AVG_TIME = 7;
+ public static final int USER_INTERFACE_PROFILING_LIST_EXCL_ESAPSED_AVG_TIME = 8;
+ public static final int USER_INTERFACE_PROFILING_DATABLEDATAFORMAT_CLASSNAME_INDEX = 10;
+
+ private String strCalssKeyName = null;
+ private String strSequence = null;
+ private String strTime = null;
+ private String strKey = null;
+
+ private String strAPIName = null;
+ private String strExclCPUTime = null;
+ private String strInclCPUTime = null;
+ private String strInclEsapsedTime = null;
+ private String strExclEsapsedTime = null;
+ private String strExclCPUAvgTime = null;
+ private String strInclCPUAvgTime = null;
+ private String strInclEsapsedAvgTime = null;
+ private String strExclEsapsedAvgTime = null;
+
+ private String strParent = null;
+ private String strTreeKey = null;
+
+ private List<String> data = null;
+
+ private ArrayList<ProfilingData> profilingData = null;
+
+ public UIFunctionProfilingData(String[] input) {
+ List<String> data = getData();
+ for (int i = 0; i < input.length; i++) {
+ data.add(input[i]);
+ }
+ }
+
+ public UIFunctionProfilingData(List<String> input) {
+ if (null != input && !input.isEmpty()) {
+ getData().addAll(input);
+ }
+ }
+
+ public UIFunctionProfilingData(ProfilingData input) {
+ if (null != input) {
+ profilingData.add(input);
+ }
+ }
+
+ public UIFunctionProfilingData() {
+ }
+
+ public List<String> getData() {
+ if (null == data) {
+ data = new ArrayList<String>();
+ }
+ return data;
+ }
+
+ public String getLogData(int logIndex) {
+ if (!getData().isEmpty()) {
+ return data.get(logIndex);
+ }
+ return null;
+ }
+
+ public void setSequence(String data) {
+ strSequence = data;
+ }
+
+ public String getSequence() {
+ return strSequence;
+ }
+
+ public void setCalssKeyName(String data) {
+ strCalssKeyName = data;
+ }
+
+ public String getCalssKeyName() {
+ if (strCalssKeyName == null) {
+ strCalssKeyName = CommonConstants.EMPTY;
+ }
+ return strCalssKeyName;
+ }
+
+ public void setKey(String data) {
+ strKey = data;
+ }
+
+ public String getKey() {
+ if (strKey == null) {
+ strKey = CommonConstants.EMPTY;
+ }
+ return strKey;
+ }
+
+ public void setTime(String data) {
+ strTime = data;
+ }
+
+ public String getTime() {
+ if (strTime == null) {
+ return strTime = CommonConstants.EMPTY;
+ }
+ return Formatter.toTimeFormat(strTime);
+ }
+
+ public void setParent(String data) {
+ strParent = data;
+ }
+
+ public String getParent() {
+ if (strParent == null) {
+ strParent = CommonConstants.EMPTY;
+ }
+ return strParent;
+ }
+
+ public void setTreeKey(String data) {
+ strTreeKey = data;
+ }
+
+ public String getTreeKey() {
+ if (strTreeKey == null) {
+ strTreeKey = CommonConstants.EMPTY;
+ }
+ return strTreeKey;
+ }
+
+ public void setAPINamee(String data) {
+ strAPIName = data;
+ }
+
+ public String getAPIName() {
+ if (strAPIName == null) {
+ strAPIName = CommonConstants.EMPTY;
+ }
+ return strAPIName;
+ }
+
+ public void setExclCPUTime(String data) {
+ strExclCPUTime = data;
+ }
+
+ public String getExclCPUTime() {
+ if (strExclCPUTime == null) {
+ strExclCPUTime = CommonConstants.EMPTY;
+ }
+ return strExclCPUTime;
+ }
+
+ public void setExclCPUAvgTime(String data) {
+ strExclCPUAvgTime = data;
+ }
+
+ public String getExclCPUAvgTime() {
+ if (strExclCPUAvgTime == null) {
+ strExclCPUAvgTime = CommonConstants.EMPTY;
+ }
+ return strExclCPUAvgTime;
+ }
+
+ public void setInclCPUTime(String data) {
+ strInclCPUTime = data;
+ }
+
+ public String getInclCPUTime() {
+ if (strInclCPUTime == null) {
+ strInclCPUTime = CommonConstants.EMPTY;
+ }
+ return strInclCPUTime;
+ }
+
+ public void setInclCPUAvgTime(String data) {
+ strInclCPUAvgTime = data;
+ }
+
+ public String getInclCPUAvgTime() {
+ if (strInclCPUAvgTime == null) {
+ strInclCPUAvgTime = CommonConstants.EMPTY;
+ }
+ return strInclCPUAvgTime;
+ }
+
+ public void setInclEsapsedTime(String data) {
+ strInclEsapsedTime = data;
+ }
+
+ public String getInclEsapsedTime() {
+ if (strInclEsapsedTime == null) {
+ strInclEsapsedTime = CommonConstants.EMPTY;
+ }
+ return strInclEsapsedTime;
+ }
+
+ public void setInclEsapsedAvgTime(String data) {
+ strInclEsapsedAvgTime = data;
+ }
+
+ public String getInclEsapsedAvgTime() {
+ if (strInclEsapsedAvgTime == null) {
+ strInclEsapsedAvgTime = CommonConstants.EMPTY;
+ }
+ return strInclEsapsedAvgTime;
+ }
+
+ public void setExclEsapsedTime(String data) {
+ strExclEsapsedTime = data;
+ }
+
+ public String getExclEsapsedTime() {
+ if (strExclEsapsedTime == null) {
+ strExclEsapsedTime = CommonConstants.EMPTY;
+ }
+ return strExclEsapsedTime;
+ }
+
+ public void setExclEsapsedAvgTime(String data) {
+ strExclEsapsedAvgTime = data;
+ }
+
+ public String getExclEsapsedAvgTime() {
+ if (strExclEsapsedAvgTime == null) {
+ strExclEsapsedAvgTime = CommonConstants.EMPTY;
+ }
+ return strExclEsapsedAvgTime;
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.userinterface.profiling;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.TreeSet;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerPaths;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfileDataMaker;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfilingData;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.utils.Formatter;
+
+public class UIFunctionProfilingDataChecker {
+
+ List<UIFunctionProfilingData> profilingList;
+ static private TreeSet<UIFunctionProfilingTreeSetData> userInterfaceFunctionTree = new TreeSet<UIFunctionProfilingTreeSetData>();
+
+ static boolean InitUIApiList = false;
+ static List<String> isUiApiCheckList = new ArrayList<String>();
+ final String UI_API_TRUE = "true";//$NON-NLS-1$
+ final String UI_API_FALSE = "false";//$NON-NLS-1$
+ static int nUserProfilingDataCount = 0;
+
+ public boolean addProfilingData(ProfilingData input) {
+
+ getUIApiListFile();
+ boolean bTreeSearch = userInterfaceFunctionTree
+ .contains(makeTreeSetData(input.getName()));
+ if (bTreeSearch) { // Find Same Api name
+
+ int nChangedIndex = 0;
+ boolean bUpdateData = false;
+
+ if (getDataList().size() == 0) {
+ makeRootParentData(input);
+ }
+
+ int nListSize = getDataList().size();
+ for (int i = 0; i < nListSize; i++) {
+ if (getDataList().get(i).getSequence()
+ .equals(input.getSequence())) {
+ getDataList().remove(i);
+ nChangedIndex = i;
+ bUpdateData = true;
+ break;
+ }
+ }
+ UIFunctionProfilingData pd = new UIFunctionProfilingData();
+ ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
+ .getProfileDataMaker();
+ String exTime = CommonConstants.DASH, inTime = CommonConstants.DASH, exeTime = CommonConstants.DASH, inExeTime = CommonConstants.DASH, exAvgTime = CommonConstants.DASH, inAvgTime = CommonConstants.DASH, exeAvgTime = CommonConstants.DASH, inExeAvgTime = CommonConstants.DASH;
+ try {
+ exTime = profiler.getCpuTime(input, true);
+ exAvgTime = getAvgTime(Integer.parseInt(exTime),
+ input.getCallCount(), 2);
+ exTime = Formatter.toTimeFormat2(exTime);
+
+ inTime = profiler.getCpuTime(input, false);
+ inAvgTime = getAvgTime(Integer.parseInt(inTime),
+ input.getCallCount(), 2);
+ inTime = Formatter.toTimeFormat2(inTime);
+ exeTime = Long.toString(input.getElapsedTime());
+ exeTime = Formatter.toTimeFormat(exeTime);
+ exeAvgTime = getAvgTime(input.getElapsedTime(),
+ input.getCallCount(), 1);
+ inExeTime = Long.toString(input.getExclusiveElapsedTime());
+ inExeTime = Formatter.toTimeFormat(inExeTime);
+ inExeAvgTime = getAvgTime(input.getExclusiveElapsedTime(),
+ input.getCallCount(), 1);
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ }
+
+ pd.setSequence(input.getSequence());
+ pd.setKey(input.getKey());
+ pd.setAPINamee(input.getName());
+ pd.setExclCPUTime(exTime);
+ pd.setInclCPUTime(inTime);
+ pd.setInclEsapsedTime(exeTime);
+ pd.setExclEsapsedTime(inExeTime);
+ pd.setExclCPUAvgTime(exAvgTime);
+ pd.setInclCPUAvgTime(inAvgTime);
+ pd.setInclEsapsedAvgTime(exeAvgTime);
+ pd.setExclEsapsedAvgTime(inExeAvgTime);
+ pd.setParent(input.getParent());
+ pd.setCalssKeyName(getClassName(input.getSaveData())); // index 10;
+
+ if (bUpdateData == true) {
+ getDataList().add(nChangedIndex, pd);
+ } else {
+ nChangedIndex = nListSize;
+ getDataList().add(pd);
+ }
+ return true;
+ } else {
+ return false;
+ }
+
+ }
+
+ public UIFunctionProfilingDataChecker() {
+ getUIApiListFile();
+ }
+
+ public List<UIFunctionProfilingData> getDataList() {
+ if (null == profilingList) {
+ profilingList = new ArrayList<UIFunctionProfilingData>();
+ }
+ return profilingList;
+ }
+
+ public void updateUIApiTreeSet() {
+
+ ProfileDataMaker profiler = FunctionUsageProfiler.getInstance()
+ .getProfileDataMaker();
+ if (profiler.getAppBin() == null) {
+ return;
+ }
+ List<ProfilingData> children = profiler.getAppBin().getChildList()
+ .get(0).getChildList();
+ int size = children.size();
+ if (nUserProfilingDataCount == size) {
+ return;
+ }
+ nUserProfilingDataCount = size;
+ getUIApiListFile();
+ for (int i = 0; i < size; i++) {
+ if (i >= isUiApiCheckList.size()) {
+ isUiApiCheckList.add(i, UI_API_TRUE);
+ }
+ if (isUiApiCheckList.get(i).equals(UI_API_TRUE)) {
+ ProfilingData data = children.get(i);
+ if (addProfilingData(data)) {
+ isUiApiCheckList.add(i, UI_API_TRUE);
+ } else {
+ isUiApiCheckList.add(i, UI_API_FALSE);
+ }
+ }
+ }
+ UIDataManager tManager = UIDataManager.getInstance();
+ tManager.getControlDataChecker()
+ .notificationFromUserInterfaceFunctionProfilingDataChecker();
+ }
+
+ public void cleanUIProfilingMemberData() {
+ isUiApiCheckList = null;
+ isUiApiCheckList = new ArrayList<String>();
+ nUserProfilingDataCount = 0;
+ }
+
+ private String getAvgTime(long nTime, int nCount, int nType) {
+ String strRetrun = "00.000";//$NON-NLS-1$
+ if (nTime == 0) {
+ return strRetrun;
+ } else if (nCount == 0) {
+ strRetrun = Long.toString(nTime);
+ } else {
+ long nAvgExeTime = (nTime / nCount);
+ strRetrun = Long.toString(nAvgExeTime);
+ }
+ if (nType == 1) {
+ strRetrun = Formatter.toTimeFormat(strRetrun);
+ } else {
+ strRetrun = Formatter.toTimeFormat2(strRetrun);
+ }
+ return strRetrun;
+ }
+
+ private void makeRootParentData(ProfilingData input) {
+ UIFunctionProfilingData pd = new UIFunctionProfilingData();
+ String exTime = CommonConstants.DASH, inTime = CommonConstants.DASH, exeTime = CommonConstants.DASH, inExeTime = CommonConstants.DASH, exAvgTime = CommonConstants.DASH, inAvgTime = CommonConstants.DASH, exeAvgTime = CommonConstants.DASH, inExeAvgTime = CommonConstants.DASH;
+ pd.setSequence(CommonConstants.ZERO);
+ pd.setKey(input.getKey());
+ pd.setAPINamee(input.getParent());
+ pd.setExclCPUTime(exTime);
+ pd.setInclCPUTime(inTime);
+ pd.setInclEsapsedTime(exeTime);
+ pd.setExclEsapsedTime(inExeTime);
+ pd.setExclCPUAvgTime(exAvgTime);
+ pd.setInclCPUAvgTime(inAvgTime);
+ pd.setInclEsapsedAvgTime(exeAvgTime);
+ pd.setExclEsapsedAvgTime(inExeAvgTime);
+ getDataList().add(pd);
+ }
+
+ private UIFunctionProfilingTreeSetData makeTreeSetData(String inputData) {
+ UIFunctionProfilingTreeSetData returnData = null;
+ if (inputData.contains(CommonConstants.OPEN_BRACKET)) {
+ String[] splitInpuDataList = inputData.split("\\("); //$NON-NLS-1$
+ String strApiName = null;
+
+ String[] splitApiNameAndReturnValues = splitInpuDataList[0]
+ .split(CommonConstants.SPACE);
+
+ if (splitApiNameAndReturnValues[splitApiNameAndReturnValues.length - 1]
+ .contains(CommonConstants.DOUBLE_COLON)) {
+
+ String[] apiNameList = splitApiNameAndReturnValues[splitApiNameAndReturnValues.length - 1]
+ .split(CommonConstants.DOUBLE_COLON);
+ strApiName = new String(
+ apiNameList[apiNameList.length - 1].trim());
+ } else {
+ strApiName = new String(
+ splitApiNameAndReturnValues[splitApiNameAndReturnValues.length - 1]
+ .trim());
+ }
+ String strParameter = new String(
+ splitInpuDataList[splitInpuDataList.length - 1].trim());
+ if (strParameter.contains(CommonConstants.COMMA)) {
+ String[] splitParameterList = strParameter
+ .split(CommonConstants.COMMA);
+ returnData = new UIFunctionProfilingTreeSetData(strApiName,
+ splitParameterList);
+ } else {
+ String[] splitParameterList = strParameter.split("\\)"); //$NON-NLS-1$
+ if (strParameter.contains("void")) {//$NON-NLS-1$
+ returnData = new UIFunctionProfilingTreeSetData(strApiName,
+ null);
+ } else if (splitParameterList.length == 0) {
+ returnData = new UIFunctionProfilingTreeSetData(strApiName,
+ null);
+ } else {
+ returnData = new UIFunctionProfilingTreeSetData(strApiName,
+ splitParameterList);
+ }
+ }
+ } else {
+ returnData = new UIFunctionProfilingTreeSetData(inputData, null);
+ }
+ return returnData;
+ }
+
+ private void getUIApiListFile() {
+ if (InitUIApiList == false) {
+ InitUIApiList = true;
+ } else {
+ return;
+ }
+ String sourcePath = null;
+ if (DACommunicator.isTargetEmulator()) {
+ sourcePath = AnalyzerPaths.DA_EMULATOR_SOUECE_PATH;
+ } else {
+ sourcePath = AnalyzerPaths.DA_DEVICE_SOUECE_PATH;
+ }
+ File configFolder = new File(sourcePath);
+ if (!configFolder.isDirectory()) {
+ System.out.println("Not Exist UI API Header List Path ");
+ return;
+ }
+ String uiFileOptionList = null;
+ String uiApiOptionList = null;
+ String uiOptionList = getUIApiOptionList();
+ if (uiOptionList.contains(CommonConstants.SEMICOLON) == false) {
+ return;
+ }
+ String[] splitInpuDataList = uiOptionList
+ .split(CommonConstants.SEMICOLON);
+ for (int i = 0; i < splitInpuDataList.length; i++) {
+ if (splitInpuDataList[i].contains("file")) {//$NON-NLS-1$
+ if (splitInpuDataList[i].contains(CommonConstants.DOUBLE_COLON) == false) {
+ return;
+ }
+ String[] splitDataList = splitInpuDataList[i]
+ .split(CommonConstants.DOUBLE_COLON);
+ uiFileOptionList = splitDataList[splitDataList.length - 1];
+ } else {
+ if (splitInpuDataList[i].contains(CommonConstants.DOUBLE_COLON) == false) {
+ return;
+ }
+ String[] splitDataList = splitInpuDataList[i]
+ .split(CommonConstants.DOUBLE_COLON);
+ uiApiOptionList = splitDataList[splitDataList.length - 1];
+ }
+ }
+
+ if (uiFileOptionList.contains(AnalyzerConstants.DATA_PARSING_TOKEN) == false) {
+ return;
+ }
+ String[] splitUiFileOptionList = uiFileOptionList
+ .split(AnalyzerConstants.DATA_PARSING_TOKEN);
+ if (uiApiOptionList.contains(AnalyzerConstants.DATA_PARSING_TOKEN) == false) {
+ return;
+ }
+ String[] splitUiApiOptionList = uiApiOptionList
+ .split(AnalyzerConstants.DATA_PARSING_TOKEN);
+
+ File file = new File(sourcePath);
+ File[] files = file.listFiles();
+ String filename = null;
+ int filelength = files.length;
+ for (int i = 0; i < filelength; i++) {
+ filename = files[i].getName();
+ if (isOptionValue(splitUiFileOptionList, filename)) {
+ // System.out.println("ui filename : "+filename);
+ BufferedReader in = null;
+ String content;
+ try {
+ in = new BufferedReader(new FileReader(files[i]));
+ String strInputData;
+ while (null != (content = in.readLine())) {
+ if (!content.equals(CommonConstants.EMPTY)) {
+ strInputData = content.trim();
+ if (strInputData.startsWith("virtual")) {//$NON-NLS-1$
+ if (isOptionValue(splitUiApiOptionList,
+ strInputData)) {
+ userInterfaceFunctionTree
+ .add(makeTreeSetData(strInputData));
+ // System.out.println("- ui header : "+strInputData);
+ }
+ }
+ }
+ }
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ } finally {
+ AnalyzerUtil.tryClose(in);
+ }
+ }
+ }
+ }
+
+ private boolean isOptionValue(String[] optionList, String strCmp) {
+ boolean bSucces = true;
+ for (int j = 0; j < optionList.length; j++) {
+ if (optionList[j].contains(CommonConstants.PLUS)) {
+ int chartIndex = optionList[j].indexOf(CommonConstants.PLUS);
+ String uiAddOption = optionList[j].substring(chartIndex + 1)
+ .trim();
+ if (strCmp.contains(uiAddOption)) {
+ bSucces = true;
+ } else {
+ bSucces = false;
+ break;
+ }
+ } else {
+ int chartIndex = optionList[j].indexOf(CommonConstants.DASH);
+ String uiMinusOption = optionList[j].substring(chartIndex + 1)
+ .trim();
+ if (strCmp.contains(uiMinusOption)) {
+ bSucces = false;
+ }
+ }
+ }
+ return bSucces;
+ }
+
+ private String getUIApiOptionList() {
+ String uiApiOptionList = new String();
+ String configFileName = AnalyzerConstants.USER_INTERFACE_API_LIST_FILE_NAME;
+ File configFolder = new File(AnalyzerPaths.CONFIG_FOLDER_PATH);
+ if (!configFolder.isDirectory()) {
+ System.out.println("Not Exist UI API List Option Path ");
+ return CommonConstants.EMPTY;
+ }
+ File apiListFile = new File(configFolder, configFileName);
+ if (!apiListFile.isFile()) {
+ System.out.println("Not Exist UI API List Option File");
+ return CommonConstants.EMPTY;
+ } else {
+ BufferedReader in = null;
+ String content;
+ try {
+ in = new BufferedReader(new FileReader(apiListFile));
+ StringBuffer inputData = new StringBuffer();
+ while (null != (content = in.readLine())) {
+ if (!content.equals(CommonConstants.EMPTY)) {
+ inputData.append(content);
+ }
+ }
+ uiApiOptionList = inputData.toString();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ } finally {
+ AnalyzerUtil.tryClose(in);
+ }
+ }
+ return uiApiOptionList;
+ }
+
+ private String getClassName(List<String> dataFormat) {
+ String[] splitApiNameList = dataFormat.get(1).split(
+ CommonConstants.DOUBLE_COLON);
+ if (splitApiNameList.length - 2 < 0) {
+ return CommonConstants.EMPTY;
+ }
+ String className = new String(
+ splitApiNameList[splitApiNameList.length - 2].trim());
+ return className;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.userinterface.profiling;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.eclipse.nebula.widgets.grid.GridColumn;
+import org.eclipse.nebula.widgets.grid.GridColumnGroup;
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.model.ColumnData;
+import org.tizen.dynamicanalyzer.model.TreeInput;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfilingData;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIListTableCellRenderer;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableHeaderRenderer;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.TreeDataComparator;
+
+public class UIFunctionProfilingTable extends DATreeComposite {
+ public UIFunctionProfilingTable(Composite parent, int compStyle,
+ int tableStyle) {
+ super(parent, compStyle, tableStyle);
+ setComparator(new TreeDataComparator());
+
+ comparator.setType(AnalyzerConstants.SORT_TYPE_NUM);
+ comparator.setColumn(2);
+ comparator.reverseDirection();
+
+ table.addListener(SWT.Expand, new Listener() {
+
+ @Override
+ public void handleEvent(Event event) {
+ GridItem item = (GridItem) event.item;
+ setExpand(item, true);
+ }
+ });
+
+ table.addListener(SWT.Collapse, new Listener() {
+ @Override
+ public void handleEvent(Event event) {
+ GridItem item = (GridItem) event.item;
+ setExpand(item, false);
+ }
+ });
+
+ table.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ GridItem[] items = table.getSelection();
+ if (items.length <= 0) {
+ return;
+ }
+ DATableDataFormat dataFormat = (DATableDataFormat) items[0]
+ .getData();
+ UIDataManager.getInstance().setTableSeleteClassName(
+ dataFormat.getData().get(
+ dataFormat.getData().size() - 1));
+
+ DASelectionData selData = new DASelectionData(
+ UIFunctionProfilingView.ID, 0, 0, items, table);
+ AnalyzerManager.getCurrentPage().updatePage(selData);
+ AnalyzerManager.getCurrentPage().controlSelection(
+ UIFunctionProfilingView.ID);
+ updateTree();
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // TODO Auto-generated method stub
+ }
+ });
+
+ table.addMouseListener(new MouseListener() {
+
+ @Override
+ public void mouseUp(MouseEvent e) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void mouseDown(MouseEvent e) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void mouseDoubleClick(MouseEvent e) {
+ GridItem[] items = (GridItem[]) table.getSelection();
+ if (null == items || items.length == 0) {
+ return;
+ }
+ GridItem item = items[0];
+ if (item.isExpanded()) {
+ setExpand(item, false);
+ } else {
+ setExpand(item, true);
+ }
+ updateTree();
+ }
+ });
+ }
+
+ public void setColumns(List<ColumnData> columnData) {
+ int size = columnData.size();
+ int index = 0;
+ for (int i = 0; i < size; i++) {
+ if (columnData.get(i).isParent()) {
+ GridColumnGroup columnGroup = new GridColumnGroup(table,
+ SWT.NONE);
+ columnGroup
+ .setHeaderRenderer(new UIFunctionProfilingColumnGroupRenderer());
+ columnGroup.setText(columnData.get(i).getText());
+ List<ColumnData> children = columnData.get(i).getChildren();
+ int childSize = children.size();
+ for (int ii = 0; ii < childSize; ii++) {
+ createColumn(columnGroup, children.get(ii), index++);
+ }
+ } else {
+ createColumn(table, columnData.get(i), index++);
+ }
+ }
+ }
+
+ private void createColumn(Object parent, ColumnData columnData, int index) {
+ GridColumn column = null;
+ if (parent instanceof GridColumnGroup) {
+ GridColumnGroup group = (GridColumnGroup) parent;
+ column = new GridColumn(group, SWT.NONE);
+ } else {
+ Grid table = (Grid) parent;
+ column = new GridColumn(table, SWT.NONE);
+ }
+
+ column.setCellRenderer(new UIListTableCellRenderer());
+ column.setHeaderRenderer(new DATableHeaderRenderer());
+ column.setText(columnData.getText());
+ if (columnData.getWidth() == 0) {
+ column.pack();
+ } else {
+ column.setWidth(columnData.getWidth());
+ }
+ if (isTree && index == 0) {
+ column.setTree(true);
+ }
+
+ if (null != comparator && null != sourceColumns && null != sortTypes) {
+ final int type = sortTypes[index];
+ final int sourceColumn = sourceColumns[index];
+ final int columnIndex = index;
+ column.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ comparator.setType(type);
+ comparator.setColumn(columnIndex);
+ comparator.setSourceColumn(sourceColumn);
+ comparator.reverseDirection();
+ updateTree();
+ }
+ });
+ }
+ }
+
+ public List<ProfilingData> difference(ArrayList<ProfilingData> base,
+ ArrayList<ProfilingData> target) {
+ @SuppressWarnings("unchecked")
+ ArrayList<ProfilingData> result = (ArrayList<ProfilingData>) base
+ .clone();
+ result.removeAll(target);
+ return result;
+ }
+
+ private TreeInput makeInput(UIFunctionProfilingData input) {
+
+ DATableDataFormat tableData = new DATableDataFormat(input.getSequence());
+ List<String> inputData = new ArrayList<String>();
+
+ // make input data
+ inputData.add(input.getSequence());
+ inputData.add(input.getAPIName());
+ inputData.add(input.getInclEsapsedTime());
+ inputData.add(input.getInclEsapsedAvgTime());
+ inputData.add(input.getExclEsapsedTime());
+ inputData.add(input.getExclEsapsedAvgTime());
+ inputData.add(input.getInclCPUTime());
+ inputData.add(input.getInclCPUAvgTime());
+ inputData.add(input.getExclCPUTime());
+ inputData.add(input.getExclCPUAvgTime());
+ inputData.add(input.getCalssKeyName());
+
+ tableData.getData().addAll(inputData);
+ tableData.setObject(input.getAPIName());
+
+ List<String> text = new ArrayList<String>();
+ text.add(input.getAPIName());
+ text.add(input.getInclEsapsedTime());
+ text.add(input.getInclEsapsedAvgTime());
+ text.add(input.getExclEsapsedTime());
+ text.add(input.getExclEsapsedAvgTime());
+ text.add(input.getInclCPUTime());
+ text.add(input.getInclCPUAvgTime());
+ text.add(input.getExclCPUTime());
+ text.add(input.getExclCPUAvgTime());
+
+ TreeInput output = new TreeInput();
+ output.setText(text);
+ output.setData(tableData);
+
+ String strSelectedClassname = UIDataManager.getInstance()
+ .getTableSeleteClassName();
+ if (strSelectedClassname.equals(input.getCalssKeyName())) {
+ output.setSecondSelection(true);
+ }
+ return output;
+ }
+
+ // !! recursive!!
+ public boolean makeChildTree(TreeInput nodeParent, TreeInput currentNode,
+ int nNodeDepth) {
+ String strParentName = nodeParent.getText().get(
+ UIFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_API_NAME);
+ if (currentNode.getParent().trim().equals(strParentName)) {
+ nodeParent.getChildren().add(currentNode);
+ return true;
+ } else {
+ for (int i = 0; i < nodeParent.getChildren().size(); i++) {
+ if (makeChildTree(nodeParent.getChildren().get(i), currentNode,
+ nNodeDepth++) == true) {
+ break;
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public List<TreeInput> makeTreeInput() {
+ UIDataManager tManager = UIDataManager.getInstance();
+ List<UIFunctionProfilingData> controlList = tManager
+ .getfunctionProfilingDataChecker().getDataList();
+ List<TreeInput> output = new ArrayList<TreeInput>();
+ int size = controlList.size();
+ int nNodeDepth = 0;
+ for (int i = 0; i < size; i++) {
+ TreeInput currentNode = makeInput(controlList.get(i));
+ currentNode.setParent(controlList.get(i).getParent());
+ if (controlList.get(i).getParent().equals(CommonConstants.EMPTY)) { // Current
+ // Node
+ // is
+ // parent
+ // node.
+ output.add(currentNode);
+ } else {
+ for (int j = 0; j < output.size(); j++) {
+ if (makeChildTree(output.get(j), currentNode, nNodeDepth++) == true) {
+ break;
+ }
+ }
+ }
+ }
+ return output;
+
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.userinterface.profiling;
+
+public class UIFunctionProfilingTreeSetData implements
+ Comparable<UIFunctionProfilingTreeSetData> {
+ private String apiName = null;
+ private String[] parameter = null;
+ private int nParameterlength = 0;
+
+ public UIFunctionProfilingTreeSetData(String apiName, String[] parameter) {
+ this.apiName = apiName;
+ if (parameter == null) {
+ this.parameter = null;
+ this.nParameterlength = 0;
+ } else {
+ this.parameter = parameter;
+ this.nParameterlength = parameter.length;
+ }
+ }
+
+ @SuppressWarnings("unused")
+ @Override
+ public int compareTo(UIFunctionProfilingTreeSetData op) {
+ // System.out.println("op.apiName.trim() : " + op.apiName.trim());
+ if (apiName.trim().equals(op.apiName.trim())) {
+ if (nParameterlength == op.nParameterlength) {
+ for (int i = 0; i < nParameterlength; i++) {
+ if (parameter[i].trim().equals(op.parameter[i].trim())) {
+ return 0;
+ } else {
+ return 1;
+ }
+ }
+ } else {
+ if (nParameterlength > op.nParameterlength) {
+ return 1;
+ } else {
+ return -1;
+ }
+ }
+ }
+ return apiName.trim().compareTo(op.apiName.trim());
+ }
+
+ @Override
+ public String toString() {
+ return String.format("%s|%d", apiName, nParameterlength);
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.userinterface.profiling;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.model.ColumnData;
+import org.tizen.dynamicanalyzer.model.DAView;
+import org.tizen.dynamicanalyzer.nl.UserInterfacePageLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
+import org.tizen.dynamicanalyzer.ui.userinterface.control.UIControlListView;
+import org.tizen.dynamicanalyzer.ui.userinterface.scene.UISceneListView;
+import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
+import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
+
+public class UIFunctionProfilingView extends DAView {
+
+ public static final String ID = UIFunctionProfilingView.class.getName();
+
+ int[] innerMaxWeight = { 100 };
+ int[] outerMaxWeight = { 0, 100 };
+ List<ColumnData> columnData = null;
+
+ private String[] columnNames = {
+ UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_0,
+ UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_1,
+ UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_2,
+ UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_3,
+ UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_4,
+ UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_5,
+ UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_6,
+ UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_7,
+ UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_8 };
+ private int[] columnSizes = { 355, 80, 80, 80, 80, 80, 80, 80, 80 };
+ UIFunctionProfilingTable treeComp = null;
+ private boolean[] columnVisibility = { true, true, true, true, true, true,
+ true, true, true };
+ int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NONE,
+ AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM,
+ AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM,
+ AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM,
+ AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM };
+ int[] sourceColumns = {
+ UIFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_API_NAME,
+ UIFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_EXCL_CPU_TIME,
+ UIFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_EXCL_CPU_AVG_TIME,
+ UIFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_EXCL_ESAPSED_TIME,
+ UIFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_EXCL_ESAPSED_AVG_TIME,
+ UIFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_INCL_CPU_TIME,
+ UIFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_INCL_CPU_AVG_TIME,
+ UIFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_INCL_ESAPSED_TIME,
+ UIFunctionProfilingData.USER_INTERFACE_PROFILING_LIST_INCL_ESAPSED_AVG_TIME };
+
+ public UIFunctionProfilingView(Composite parent, int style) {
+ super(parent, style);
+ this.setLayout(new FillLayout());
+
+ ViewContainer viewContainer = new ViewContainer(this, true);
+ viewContainer
+ .setTitleText(UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_NAME);
+ setMaxWeight(innerMaxWeight, outerMaxWeight);
+ Composite contents = viewContainer.getContentArea();
+ contents.setBackground(ColorResources.WINDOW_BG_COLOR);
+ contents.setLayout(new FillLayout());
+ treeComp = new UIFunctionProfilingTable(contents, SWT.NONE, SWT.SINGLE
+ | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
+ /*** setTree set first!!! ***/
+ treeComp.setTree(true);
+ treeComp.setSortTypes(sortTypes);
+ treeComp.setSourceColumns(sourceColumns);
+ createColumnData();
+ treeComp.setColumns(columnData);
+ // treeComp.setColumns(columnNames);
+ treeComp.setColumnSize(columnSizes);
+ treeComp.setColumnVisibility(columnVisibility);
+ treeComp.setTableToolTipEnable(false);
+ treeComp.setTableName(UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_NAME);
+ contents.addControlListener(new TableColumnSizePackListener(treeComp,
+ columnSizes));
+ }
+
+ private void createColumnData() {
+ int columnIndex = 0;
+ columnData = new ArrayList<ColumnData>();
+ ColumnData data0 = new ColumnData(columnNames[columnIndex++]);
+ columnData.add(data0);
+
+ ColumnData dataInc1 = new ColumnData(
+ UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_INCLUSIVE_ELAPSED_TIME);
+ ColumnData dataInc1Child1 = new ColumnData(columnNames[columnIndex++]);
+ ColumnData dataInc1Child2 = new ColumnData(columnNames[columnIndex++]);
+ dataInc1.getChildren().add(dataInc1Child1);
+ dataInc1.getChildren().add(dataInc1Child2);
+ columnData.add(dataInc1);
+
+ ColumnData dataExc1 = new ColumnData(
+ UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_EXCLUSIVE_ELAPSED_TIME);
+ ColumnData dataExc1Child1 = new ColumnData(columnNames[columnIndex++]);
+ ColumnData dataExc1Child2 = new ColumnData(columnNames[columnIndex++]);
+ dataExc1.getChildren().add(dataExc1Child1);
+ dataExc1.getChildren().add(dataExc1Child2);
+ columnData.add(dataExc1);
+
+ ColumnData dataInc2 = new ColumnData(
+ UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_INCLUSIVE_CPU_TIME);
+ ColumnData dataInc2Child1 = new ColumnData(columnNames[columnIndex++]);
+ ColumnData dataInc2Child2 = new ColumnData(columnNames[columnIndex++]);
+ dataInc2.getChildren().add(dataInc2Child1);
+ dataInc2.getChildren().add(dataInc2Child2);
+ columnData.add(dataInc2);
+
+ ColumnData dataExc2 = new ColumnData(
+ UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_EXCLUSIVE_CPU_TIME);
+ ColumnData dataExc2Child1 = new ColumnData(columnNames[columnIndex++]);
+ ColumnData dataExc2Child2 = new ColumnData(columnNames[columnIndex++]);
+ dataExc2.getChildren().add(dataExc2Child1);
+ dataExc2.getChildren().add(dataExc2Child2);
+ columnData.add(dataExc2);
+ }
+
+ @Override
+ public void updateView() {
+ treeComp.updateTree();
+ }
+
+ public void updateView(DASelectionData selData) {
+ /* only ui page update */
+ if (selData.getViewId().equals(UIControlListView.ID)
+ || selData.getViewId().equals(UISceneListView.ID)) {
+ treeComp.updateTree();
+ }
+ }
+
+ @Override
+ public void clear() {
+ treeComp.clear();
+ UIDataManager.getInstance().getfunctionProfilingDataChecker()
+ .cleanUIProfilingMemberData();
+ }
+
+ @Override
+ public Control getControl() {
+ return treeComp;
+ }
+
+ @Override
+ public void otherViewSelectionOccured() {
+ treeComp.deselectAll();
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.userinterface.scene;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.utils.Formatter;
+
+public class UISceneData {
+ public static final int KEY_INDEX = LogCenterConstants.SEQUENCE_NUMBER_INDEX;
+
+ public static final int USER_INTERFACE_SCENE_TRANSFORMS_LISTL_SCENE_NAME = 0;
+ public static final int USER_INTERFACE_SCENE_TRANSFORMS_LIST_TIME = 1;
+ public static final int USER_INTERFACE_SCENE_TRANSFORMS_LIST_FORM_NAME = 2;
+ public static final int USER_INTERFACE_SCENE_TRANSFORMS_LIST_PANEL_NAME = 3;
+ public static final int USER_INTERFACE_SCENE_TRANSFORMS_LIST_TRANSFORM_TIME = 4;
+ public static final int USER_INTERFACE_SCENE_TRANSFORMS_LIST_DATABLEDATAFORMAT_CLASSNAME_INDEX = 21;
+
+ private String strCalssKeyName = null;
+ private String strSequence = null;
+ private String strTime = null;
+ private String strSceneName = null;
+ private String strTransformTime = null;
+ private String strFormName = null;
+ private String strPanelName = null;
+
+ private List<String> data;
+
+ public UISceneData(String[] input) {
+ List<String> data = getData();
+ for (int i = 0; i < input.length; i++) {
+ data.add(input[i]);
+ }
+ }
+
+ public UISceneData(List<String> sceneLoginput) {
+ if (null != sceneLoginput && !sceneLoginput.isEmpty()) {
+ getData().addAll(sceneLoginput);
+ }
+ }
+
+ public List<String> getData() {
+ if (null == data) {
+ data = new ArrayList<String>();
+ }
+ return data;
+ }
+
+ public String getLogData(int logIndex) {
+ if (!getData().isEmpty()) {
+ return data.get(logIndex);
+ }
+ return null;
+ }
+
+ public void setSequence(String data) {
+ strSequence = data;
+ }
+
+ public String getSequence() {
+ if (strSequence == null) {
+ strSequence = CommonConstants.EMPTY;
+ }
+ return strSequence;
+ }
+
+ public void setCalssKeyName(String data) {
+ strCalssKeyName = data;
+ }
+
+ public String getCalssKeyName() {
+ if (strCalssKeyName == null) {
+ strCalssKeyName = CommonConstants.EMPTY;
+ }
+ return strCalssKeyName;
+ }
+
+ public void setTime(String data) {
+ strTime = data;
+ }
+
+ public String getTime() {
+ if (strTime == null) {
+ return strTime = CommonConstants.EMPTY;
+ }
+ return Formatter.toTimeFormat(strTime);
+ }
+
+ public void setSceneName(String data) {
+ strSceneName = data;
+ }
+
+ public String getSceneName() {
+ if (strSceneName == null
+ || strSceneName.trim().equals(CommonConstants.EMPTY)) {
+ strSceneName = CommonConstants.DASH;
+ }
+ return strSceneName;
+ }
+
+ public void setTransformTime(String data) {
+ strTransformTime = data;
+ }
+
+ public String getTransformTime() {
+ if (strTransformTime == null) {
+ strTransformTime = CommonConstants.EMPTY;
+ }
+ return strTransformTime;
+ }
+
+ public void setFormName(String data) {
+ strFormName = data;
+ }
+
+ public String getFormName() {
+ if (strFormName == null
+ || strFormName.trim().equals(CommonConstants.EMPTY)) {
+ strFormName = CommonConstants.DASH;
+ }
+ return strFormName;
+ }
+
+ public void setPanelName(String data) {
+ strPanelName = data;
+ }
+
+ public String getPanelName() {
+ if (strPanelName == null
+ || strPanelName.trim().equals(CommonConstants.EMPTY)) {
+ strPanelName = CommonConstants.DASH;
+ }
+ return strPanelName;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.userinterface.scene;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.common.SymbolManager;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
+import org.tizen.dynamicanalyzer.utils.Formatter;
+
+public class UISceneDataChecker {
+
+ List<UISceneData> transfomSceneList;
+
+ public void parserLog(List<String> input) {
+ UISceneData sceneData = new UISceneData(input);
+ sceneData.setSequence(input
+ .get(LogCenterConstants.SEQUENCE_NUMBER_INDEX));
+ sceneData.setTime(input.get(LogCenterConstants.TIME_INDEX));
+ sceneData
+ .setSceneName(input
+ .get(LogCenterConstants.USER_INTERFACE_SCENE_TRANSFORMS_LIST_SCENE_NAME_INDEX));
+ sceneData
+ .setFormName(input
+ .get(LogCenterConstants.USER_INTERFACE_SCENE_TRANSFORMS_LIST_FORM_NAME_INDEX));
+ sceneData
+ .setPanelName(input
+ .get(LogCenterConstants.USER_INTERFACE_SCENE_TRANSFORMS_LIST_PANEL_NAME_INDEX));
+ sceneData.setCalssKeyName(getClassName(input));
+
+ sceneData
+ .setTransformTime(getTransitionTime(input
+ .get(LogCenterConstants.USER_INTERFACE_SCENE_TRANSFORMS_LIST_TRANSITION_INDEX)));
+
+ getDataList().add(sceneData);
+ UIDataManager
+ .getInstance()
+ .getFindSnapshotViewHashMap()
+ .put(getClassName(input),
+ input.get(LogCenterConstants.TIME_INDEX));
+ }
+
+ public List<UISceneData> getDataList() {
+ if (null == transfomSceneList) {
+ transfomSceneList = new ArrayList<UISceneData>();
+ }
+ return transfomSceneList;
+ }
+
+ private String getTransitionTime(String time) {
+ if (time.trim().equals(CommonConstants.EMPTY)) {
+ return time = "00:00.000";//$NON-NLS-1$
+ }
+ time = time + "00";//$NON-NLS-1$
+ return Formatter.toTimeFormat(time);
+ }
+
+ public String getClassName(List<String> dataFormat) {
+ String className = CommonConstants.EMPTY;
+ String panelName = dataFormat
+ .get(LogCenterConstants.USER_INTERFACE_SCENE_TRANSFORMS_LIST_PANEL_POINTER_INDEX);
+ if (panelName.equals(CommonConstants.EMPTY)) { //
+ className = dataFormat
+ .get(LogCenterConstants.USER_INTERFACE_SCENE_TRANSFORMS_LIST_FORM_POINTER_INDEX);
+ } else {
+ className = panelName;
+ }
+ StringBuilder childClassNameDemangling = new StringBuilder(className);
+ childClassNameDemangling.insert(0, "_Z");//$NON-NLS-1$
+ className = SymbolManager
+ .demanglingFunctionName(childClassNameDemangling.toString());
+ return className;
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.userinterface.scene;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.model.TableInput;
+import org.tizen.dynamicanalyzer.sql.SqlManager;
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
+
+public class UISceneListTable extends DATableComposite {
+
+ public UISceneListTable(Composite parent, int style, int tableStyle) {
+ super(parent, style, tableStyle);
+ setRangePopup();
+ table.addSelectionListener(new SelectionListener() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ GridItem[] items = table.getSelection();
+ if (items.length <= 0) {
+ return;
+ }
+ DATableDataFormat dataFormat = (DATableDataFormat) items[0]
+ .getData();
+ UIDataManager.getInstance().setTableSeleteClassName(
+ dataFormat.getData().get(
+ dataFormat.getData().size() - 1));
+ String time = getSnapsotForScene(dataFormat.getData().get(
+ LogCenterConstants.TIME_INDEX));
+ DASelectionData selData = new DASelectionData(
+ UISceneListView.ID, Long.parseLong(time), 0, items,
+ table);
+ AnalyzerManager.getCurrentPage().updatePage(selData);
+ AnalyzerManager.getCurrentPage().controlSelection(
+ UISceneListView.ID);
+ updateTable();
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+ }
+
+ private String getSnapsotForScene(String strTime) {
+ StringBuilder query = new StringBuilder(128);
+ query.append("select min(time) from screenshot where time >=").append(strTime).append(CommonConstants.SEMICOLON);//$NON-NLS-1$
+ System.out.println("getSnapsotForScene");
+ String result = SqlManager.getInstance().executeSelectQuery(query.toString());
+ if (result == null) {
+ result = strTime;
+ }
+ return result;
+ }
+
+ protected List<TableInput> makeTableInput() {
+ List<UISceneData> transfomSceneList = UIDataManager.getInstance()
+ .getSceneTransformDataChecker().getDataList();
+
+ List<TableInput> input = new ArrayList<TableInput>();
+ int size = transfomSceneList.size();
+ for (int i = 0; i < size; i++) {
+
+ List<String> text = new ArrayList<String>();
+ UISceneData sceneTransformsData = transfomSceneList.get(i);
+ List<String> inputData = new ArrayList<String>();
+ int nSize = sceneTransformsData.getData().size();
+ for (int j = 0; j < nSize; j++) {
+ inputData.add(sceneTransformsData.getData().get(j));
+ }
+ inputData.add(sceneTransformsData.getCalssKeyName());
+ DATableDataFormat tableData = new DATableDataFormat(
+ sceneTransformsData.getSequence());
+ tableData.getData().addAll(inputData);
+ text.add(sceneTransformsData.getTime()); // Time
+ text.add(sceneTransformsData.getSceneName()); // Scene Name
+ text.add(sceneTransformsData.getFormName()); // Form Name
+ text.add(sceneTransformsData.getPanelName()); // Panel Name
+ text.add(sceneTransformsData.getTransformTime()); // Panel Name
+
+ TableInput tableInput = new TableInput();
+ tableInput.setText(text);
+ tableInput.setData(tableData);
+ input.add(tableInput);
+
+ String strSelectedClassname = UIDataManager.getInstance()
+ .getTableSeleteClassName();
+ if (strSelectedClassname.equals(sceneTransformsData
+ .getCalssKeyName())) {
+ tableInput.setSecondSelection(true);
+ }
+
+ if (RangeDataManager.getInstance().isBeingAnalyzed()) {
+ long time = Long.parseLong(tableData.getData().get(
+ LogCenterConstants.TIME_INDEX));
+ long startTime = RangeDataManager.getInstance().getStartTime();
+ long endTime = RangeDataManager.getInstance().getEndTime();
+ if (time >= startTime && time <= endTime) {
+ tableInput.setInRange(true);
+ }
+ }
+ }
+ return input;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjong Park <phjwithyou.park@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.userinterface.scene;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.model.DAView;
+import org.tizen.dynamicanalyzer.nl.UserInterfacePageLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.ui.userinterface.control.UIControlListView;
+import org.tizen.dynamicanalyzer.ui.userinterface.profiling.UIFunctionProfilingView;
+import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
+
+public class UISceneListView extends DAView {
+ public static final String ID = UISceneListView.class.getName();
+ DATableComposite tableComp = null;
+
+ int[] innerMaxWeight = { 0, 100, 0 };
+ int[] outerMaxWeight = { 100, 0 };
+ private int[] columnSizes = { 75, 120, 120, 120, 120 };
+ private boolean[] columnVisibility = { true, true, true, true, true };
+
+ private String[] columnNames = {
+ UserInterfacePageLabels.USERINTERFACE_SCENETRANSFORM_LIST_VIEW_COLUMN_0,
+ UserInterfacePageLabels.USERINTERFACE_SCENETRANSFORM_LIST_VIEW_COLUMN_1,
+ UserInterfacePageLabels.USERINTERFACE_SCENETRANSFORM_LIST_VIEW_COLUMN_2,
+ UserInterfacePageLabels.USERINTERFACE_SCENETRANSFORM_LIST_VIEW_COLUMN_3,
+ UserInterfacePageLabels.USERINTERFACE_SCENETRANSFORM_LIST_VIEW_COLUMN_4 };
+
+ int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NUM,
+ AnalyzerConstants.SORT_TYPE_STRING,
+ AnalyzerConstants.SORT_TYPE_STRING,
+ AnalyzerConstants.SORT_TYPE_STRING,
+ AnalyzerConstants.SORT_TYPE_STRING };
+
+ int[] sourceColumns = {
+ UISceneData.USER_INTERFACE_SCENE_TRANSFORMS_LIST_TIME,
+ UISceneData.USER_INTERFACE_SCENE_TRANSFORMS_LISTL_SCENE_NAME,
+ UISceneData.USER_INTERFACE_SCENE_TRANSFORMS_LIST_FORM_NAME,
+ UISceneData.USER_INTERFACE_SCENE_TRANSFORMS_LIST_PANEL_NAME,
+ UISceneData.USER_INTERFACE_SCENE_TRANSFORMS_LIST_TRANSFORM_TIME };
+
+ public UISceneListView(Composite parent, int style) {
+ super(parent, style);
+ this.setLayout(new FillLayout());
+
+ ViewContainer viewContainer = new ViewContainer(this, true);
+ viewContainer
+ .setTitleText(UserInterfacePageLabels.USERINTERFACE_SCENETRANSFORM_LIST_VIEW_NAME);
+
+ Composite contents = viewContainer.getContentArea();
+ contents.setBackground(ColorResources.WINDOW_BG_COLOR);
+ contents.setLayout(new FillLayout());
+ tableComp = new UISceneListTable(contents, SWT.NONE, SWT.MULTI
+ | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
+ tableComp
+ .setTableName(UserInterfacePageLabels.USERINTERFACE_SCENETRANSFORM_LIST_VIEW_NAME);
+ tableComp.setSortTypes(sortTypes);
+ tableComp.setSourceColumns(sourceColumns);
+ tableComp.setColumns(columnNames);
+ tableComp.setColumnSize(columnSizes);
+ tableComp.setColumnVisibility(columnVisibility);
+ tableComp.setTableToolTipEnable(false);
+ setMaxWeight(innerMaxWeight, outerMaxWeight);
+
+ contents.addControlListener(new TableColumnSizePackListener(tableComp,
+ columnSizes));
+
+ }
+
+ @Override
+ public void updateView() {
+ tableComp.updateTable();
+ }
+
+ @Override
+ public void updateView(DASelectionData selData) {
+ /* only ui page update */
+ if (selData.getViewId().equals(UIControlListView.ID)
+ || selData.getViewId().equals(UIFunctionProfilingView.ID)
+ || selData.getViewId().equals(UISceneListView.ID)) {
+ tableComp.updateTable();
+ }
+ }
+
+ @Override
+ public void clear() {
+ // TODO Auto-generated method stub
+ tableComp.clear();
+ }
+
+ @Override
+ public Control getControl() {
+ return tableComp;
+ }
+
+ @Override
+ public void otherViewSelectionOccured() {
+ tableComp.deselectAll();
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.widgets;
+
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonRenderer;
+
+public class DAButton extends DACustomButton {
+
+ public DAButton(Composite parent, int style) {
+ super(parent, style);
+ setGradation(ColorResources.BUTTON_NORMAL_COLOR_START,
+ ColorResources.BUTTON_NORMAL_COLOR_END,
+ ColorResources.BUTTON_PUSH_COLOR_START,
+ ColorResources.BUTTON_PUSH_COLOR_END,
+ ColorResources.BUTTON_HOVER_COLOR_START,
+ ColorResources.BUTTON_HOVER_COLOR_END,
+ ColorResources.BUTTON_DISABLE_COLOR_START,
+ ColorResources.BUTTON_DISABLE_COLOR_END);
+ setFontColors(ColorResources.BUTTON_NORMAL_FONT_COLOR,
+ ColorResources.BUTTON_PUSH_FONT_COLOR,
+ ColorResources.BUTTON_HOVER_FONT_COLOR,
+ ColorResources.BUTTON_DISABLE_FONT_COLOR);
+ setOutlineColors(ColorResources.BUTTON_OUTLINE_NORMAL_COLOR,
+ ColorResources.BUTTON_OUTLINE_PUSH_COLOR,
+ ColorResources.BUTTON_OUTLINE_HOVER_COLOR,
+ ColorResources.BUTTON_OUTLINE_DISABLE_COLOR);
+ setOutlineInColors(ColorResources.BUTTON_OUTLINE_NORMAL_IN_COLOR,
+ ColorResources.BUTTON_OUTLINE_PUSH_IN_COLOR,
+ ColorResources.BUTTON_OUTLINE_HOVER_IN_COLOR,
+ ColorResources.BUTTON_OUTLINE_DISABLE_IN_COLOR);
+ setFont(FontResources.DIALOG_BUTTON_FONT);
+ this.setRenderer(new DACustomButtonRenderer());
+ }
+
+ public void updateTheme() {
+ setGradation(ColorResources.BUTTON_NORMAL_COLOR_START,
+ ColorResources.BUTTON_NORMAL_COLOR_END,
+ ColorResources.BUTTON_PUSH_COLOR_START,
+ ColorResources.BUTTON_PUSH_COLOR_END,
+ ColorResources.BUTTON_HOVER_COLOR_START,
+ ColorResources.BUTTON_HOVER_COLOR_END,
+ ColorResources.BUTTON_DISABLE_COLOR_START,
+ ColorResources.BUTTON_DISABLE_COLOR_END);
+ setFontColors(ColorResources.BUTTON_NORMAL_FONT_COLOR,
+ ColorResources.BUTTON_PUSH_FONT_COLOR,
+ ColorResources.BUTTON_HOVER_FONT_COLOR,
+ ColorResources.BUTTON_DISABLE_FONT_COLOR);
+ setOutlineColors(ColorResources.BUTTON_OUTLINE_NORMAL_COLOR,
+ ColorResources.BUTTON_OUTLINE_PUSH_COLOR,
+ ColorResources.BUTTON_OUTLINE_HOVER_COLOR,
+ ColorResources.BUTTON_OUTLINE_DISABLE_COLOR);
+ setOutlineInColors(ColorResources.BUTTON_OUTLINE_NORMAL_IN_COLOR,
+ ColorResources.BUTTON_OUTLINE_PUSH_IN_COLOR,
+ ColorResources.BUTTON_OUTLINE_HOVER_IN_COLOR,
+ ColorResources.BUTTON_OUTLINE_DISABLE_IN_COLOR);
+ setFont(FontResources.DIALOG_BUTTON_FONT);
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.widgets;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.tizen.dynamicanalyzer.common.DesignConstants;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
+
+public class DADialog {
+
+ private Shell parent = null;
+ private Shell shell = null;
+ private DACustomButton okButton = null;
+ // private DACustomButton cancelButton = null;
+ private String message = null;
+ private boolean returnType = false;
+ private String titleText = AnalyzerLabels.DA_WARNING;
+
+ private Image iconImage = ImageResources.DYNANMIC_ANALYZER_ICON;
+
+ private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ returnType = true;
+ shell.dispose();
+ }
+ };
+
+ // private DACustomButtonClickEventListener cancelButtonListener = new
+ // DACustomButtonClickEventListener() {
+ //
+ // @Override
+ // public void handleClickEvent(DACustomButton button) {
+ // returnType = false;
+ // shell.dispose();
+ // }
+ // };
+
+ public DADialog(Shell parent, int style) {
+ this.parent = parent;
+ }
+
+ public boolean open() {
+ shell = new Shell(parent, SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM);
+ shell.setSize(446, 153);
+ shell.setLayout(new FormLayout());
+ shell.setText(titleText);
+
+ Composite base = new Composite(shell, SWT.NONE);
+ base.setLayout(new FormLayout());
+ FormData baseData = new FormData();
+ baseData.top = new FormAttachment(0, 0);
+ baseData.left = new FormAttachment(0, 0);
+ baseData.right = new FormAttachment(100, 0);
+ baseData.height = 76;
+ base.setLayoutData(baseData);
+ base.setVisible(true);
+ base.setBackground(ColorResources.DIALOG_BG_UPPER);
+
+ // Icon
+ Label icon = new Label(base, SWT.TRANSPARENT);
+ icon.setBackground(ColorResources.DIALOG_BG_UPPER);
+ icon.setImage(iconImage);
+
+ // Contents
+ Label strMessage = new Label(base, SWT.TRANSPARENT);
+ strMessage.setText(message);
+ strMessage.setBackground(ColorResources.DIALOG_BG_UPPER);
+ strMessage.setAlignment(SWT.LEFT);
+ strMessage.setForeground(ColorResources.DEFAULT_FONT_COLOR);
+ strMessage.setFont(FontResources.ABOUT_TEXT);
+
+ FormData labelData = new FormData();
+ labelData.left = new FormAttachment(0, 15);
+ labelData.top = new FormAttachment(0, 6);
+ labelData.height = 64;
+ labelData.width = 64;
+ icon.setLayoutData(labelData);
+
+ labelData = new FormData();
+ labelData.left = new FormAttachment(0, 95);
+ labelData.right = new FormAttachment(100, 0);
+ labelData.top = new FormAttachment(0, 25);
+ labelData.height = 40;
+ strMessage.setLayoutData(labelData);
+
+ Composite buttonComp = new Composite(shell, SWT.NONE);
+ FormLayout compLayout = new FormLayout();
+ buttonComp.setLayout(compLayout);
+ buttonComp.setBackground(ColorResources.DIALOG_BG_LOWER);
+
+ buttonComp.addPaintListener(new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ Composite comp = (Composite) e.widget;
+ Rectangle rect = comp.getClientArea();
+ e.gc.setForeground(ColorResources.DIALOG_SUNKEN_1);
+ e.gc.drawLine(rect.x, rect.y, rect.x + rect.width, rect.y);
+ e.gc.setForeground(ColorResources.DIALOG_SUNKEN_2);
+ e.gc.drawLine(rect.x, rect.y + 1, rect.x + rect.width,
+ rect.y + 1);
+ }
+ });
+
+ FormData compData = new FormData();
+ compData.top = new FormAttachment(base, 0);
+ compData.left = new FormAttachment(0, 0);
+ compData.right = new FormAttachment(100, 0);
+ compData.bottom = new FormAttachment(100, 0);
+ buttonComp.setLayoutData(compData);
+
+ okButton = new DAButton(buttonComp, SWT.NONE);
+ okButton.addClickListener(okButtonListener);
+ okButton.setText(AnalyzerLabels.OK);
+ okButton.setFont(FontResources.DIALOG_BUTTON_FONT);
+
+ FormData okData = new FormData();
+ okData.top = new FormAttachment(0, 12);
+ okData.right = new FormAttachment(100, -9);
+ okData.width = DesignConstants.DA_BUTTON_WIDTH;
+ okData.height = DesignConstants.DA_BUTTON_HEIGHT;
+ okButton.setLayoutData(okData);
+
+ // cancelButton = new DAButton(buttonComp, SWT.NONE);
+ // cancelButton.addClickListener(cancelButtonListener);
+ // cancelButton.setText(AnalyzerLabels.CANCEL); //$NON-NLS-1$
+ // cancelButton.setFont(FontResources.DIALOG_BUTTON_FONT);
+ // okData = new FormData();
+ // okData.top = new FormAttachment(0, 12);
+ // okData.right = new FormAttachment(okButton, -10);
+ // okData.width = 100;
+ // okData.height = 34;
+ // cancelButton.setLayoutData(okData);
+
+ shell.open();
+
+ Display display = PlatformUI.createDisplay();
+
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+
+ shell.dispose();
+ return returnType;
+ }
+
+ public void setMessage(String msg) {
+ message = msg;
+ }
+
+ public void setIcon(Image img) {
+ iconImage = img;
+ }
+
+ public void setTitleText(String title) {
+ titleText = title;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.widgets;
+
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.eclipse.nebula.widgets.grid.GridColumn;
+import org.eclipse.nebula.widgets.grid.GridColumnGroup;
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Composite;
+
+public class DAGrid extends Grid {
+
+ public DAGrid(Composite parent, int style) {
+ super(parent, style);
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ protected void showToolTip(GridItem item, GridColumn column,
+ GridColumnGroup group, Point location) {
+ return;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.widgets;
+
+import org.eclipse.jface.window.Window.IExceptionHandler;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+public class DAMessageBox {
+ protected int result = 0;
+ protected Shell shell = null;
+ protected boolean block = false;
+
+ private static IExceptionHandler exceptionHandler = new DefaultExceptionHandler();
+
+ public DAMessageBox(Shell parentShell) {
+ shell = new Shell(parentShell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
+ }
+
+ public int open() {
+ block = true;
+ result = run();
+ if (result >= 0) {
+ shell.open();
+ if (block) {
+ runEventLoop(shell);
+ }
+ }
+ shell.dispose();
+ return result;
+ }
+
+ protected int run() {
+ return result;
+ }
+
+ private void runEventLoop(Shell loopShell) {
+
+ // Use the display provided by the shell if possible
+ Display display;
+ if (shell == null) {
+ display = Display.getCurrent();
+ } else {
+ display = loopShell.getDisplay();
+ }
+
+ while (loopShell != null && !loopShell.isDisposed()) {
+ try {
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
+ } catch (SWTException e) {
+ exceptionHandler.handleException(e);
+ }
+ }
+ if (!display.isDisposed())
+ display.update();
+ }
+
+ private static class DefaultExceptionHandler implements IExceptionHandler {
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.window.Window.IExceptionHandler#handleException
+ * (java.lang.Throwable)
+ */
+ public void handleException(Throwable t) {
+ if (t instanceof ThreadDeath) {
+ // Don't catch ThreadDeath as this is a normal occurrence when
+ // the thread dies
+ throw (ThreadDeath) t;
+ }
+ // Try to keep running.
+ t.printStackTrace();
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.widgets;
+
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.widgets.scale.DAScaleAttribute;
+import org.tizen.dynamicanalyzer.widgets.scale.DAScaleDefaultRenderer;
+
+public class DAScaleRenderer extends DAScaleDefaultRenderer {
+
+ @Override
+ public void draw(GC gc, Canvas canvas, DAScaleAttribute attr) {
+ Rectangle rect = canvas.getClientArea();
+ gc.setForeground(ColorResources.SCALE_BG_COLOR_START);
+ gc.setBackground(ColorResources.SCALE_BG_COLOR_END);
+ gc.fillGradientRectangle(rect.x, rect.y, rect.width, rect.height, true);
+ gc.setForeground(ColorResources.SCALE_OUTLINE_COLOR);
+ gc.drawRectangle(rect.x, rect.y, rect.width - 1, rect.height - 1);
+
+ if (null != attr.getLeftImage() && null != attr.getRightImage()) {
+ gc.drawImage(attr.getLeftImage(), attr.getLeftRect().x,
+ attr.getLeftRect().y);
+ gc.drawImage(attr.getRightImage(), attr.getRightRect().x,
+ attr.getRightRect().y);
+ }
+
+ gc.setBackground(ColorResources.SCALE_AREA_COLOR);
+ gc.fillRectangle(attr.getAreaRect());
+ gc.setForeground(ColorResources.SCALE_AREA_OUTLINE_COLOR);
+ gc.drawRectangle(attr.getAreaRect());
+
+ if (null != attr.getThumbImage()) {
+ gc.drawImage(attr.getThumbImage(), attr.getThumbRect().x,
+ attr.getThumbRect().y);
+ } else {
+ gc.setBackground(ColorResources.RED);
+ gc.fillOval(attr.getThumbRect().x, attr.getThumbRect().y,
+ attr.getThumbRect().width, attr.getThumbRect().height);
+ }
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.widgets;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StackLayout;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.common.DesignConstants;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.model.DAView;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.ui.page.ViewAction;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
+
+public class DATabComposite extends DAView {
+
+ public static final String ID = DATabComposite.class.getName();
+ public static final int LONG_TAB_WIDTH = 70;
+ public static final int SHORT_TAB_WIDTH = 70;
+
+ // flag for animation
+ public static boolean showState = false;
+
+ private List<DACustomButton> buttons = null;
+ private List<Composite> children = null;
+ private HashMap<String, Composite> childrenMap = null;
+ private HashMap<String, DACustomButton> buttonMap = null;
+
+ private Composite tabComposite = null;
+ private Composite contentsComposite = null;
+ private StackLayout stackLayout = null;
+
+ private int tabWidth = LONG_TAB_WIDTH;
+
+ public DATabComposite(Composite parent, int style) {
+ super(parent, style);
+ childrenMap = new HashMap<String, Composite>();
+ buttonMap = new HashMap<String, DACustomButton>();
+
+ tabComposite = new Composite(this, SWT.DOUBLE_BUFFERED);
+ tabComposite.setLayout(new FormLayout());
+ contentsComposite = new Composite(this, SWT.DOUBLE_BUFFERED);
+ stackLayout = new StackLayout();
+ contentsComposite.setLayout(stackLayout);
+ this.setLayout(new FormLayout());
+
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.left = new FormAttachment(0, 0);
+ data.right = new FormAttachment(100, 0);
+ data.height = DesignConstants.VIEW_TITLEBAR_HEIGHT;
+ tabComposite.setLayoutData(data);
+ tabComposite.addPaintListener(tabCompositePaintListener);
+
+ data = new FormData();
+ data.top = new FormAttachment(tabComposite, 0);
+ data.left = new FormAttachment(0, 0);
+ data.right = new FormAttachment(100, 0);
+ data.bottom = new FormAttachment(100, 0);
+ contentsComposite.setLayoutData(data);
+ }
+
+ public void addView(Composite child, boolean usingAnimation) {
+ if (!(child instanceof ViewAction)) {
+ return;
+ }
+
+ String ID = child.getClass().getName();
+ String title = ((ViewAction) child).getViewName();
+
+ final DACustomButton tabButton = new DACustomButton(tabComposite,
+ ColorResources.TAB_NORMAL_COLOR_START,
+ ColorResources.TAB_NORMAL_COLOR_END,
+ ColorResources.TAB_PUSH_COLOR_START,
+ ColorResources.TAB_PUSH_COLOR_END,
+ ColorResources.TAB_HOVER_COLOR_START,
+ ColorResources.TAB_HOVER_COLOR_END,
+ ColorResources.TAB_SELECTED_COLOR_START,
+ ColorResources.TAB_SELECTED_COLOR_END);
+ tabButton.setFontColors(ColorResources.TAB_NORMAL_FONT_COLOR,
+ ColorResources.TAB_PUSH_FONT_COLOR,
+ ColorResources.TAB_HOVER_FONT_COLOR,
+ ColorResources.TAB_SELECTED_FONT_COLOR);
+ tabButton.setOutlineColors(ColorResources.TAB_OUTLINE_NORMAL_COLOR,
+ ColorResources.TAB_OUTLINE_PUSH_COLOR,
+ ColorResources.TAB_OUTLINE_HOVER_COLOR,
+ ColorResources.TAB_OUTLINE_SELECTED_COLOR);
+ tabButton.setRenderer(new TabButtonRenderer());
+ tabButton.setEnabled(true);
+ tabButton.setFont(FontResources.TAB_BUTTON_FONT);
+ tabButton.setText(title);
+ tabButton.setToolTipText(title);
+
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.bottom = new FormAttachment(100, 0);
+
+ if (getButtons().size() > 0) {
+ DACustomButton button1 = getButtons().get(getButtons().size() - 1);
+ data.left = new FormAttachment(button1, 0);
+ if (!usingAnimation) {
+ data.width = tabWidth; // short
+ }
+ } else {
+ data.left = new FormAttachment(0, 0);
+ if (!usingAnimation) {
+ data.width = tabWidth; // long
+ }
+ }
+ tabButton.setLayoutData(data);
+
+ final Composite tempChild = child;
+ DACustomButtonClickEventListener buttonListener = new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ stackLayout.topControl = tempChild;
+ changeButtonState(tabButton);
+ tabComposite.layout();
+ contentsComposite.layout();
+ ((ViewAction) tempChild).updateView();
+ }
+ };
+ tabButton.addClickListener(buttonListener);
+
+ childrenMap.put(ID, child);
+ buttonMap.put(ID, tabButton);
+ getButtons().add(tabButton); // TODO : think about button map??
+ getTabChildren().add(child);
+
+ // default focus set
+ if (getTabChildren().size() == 1) {
+ stackLayout.topControl = child;
+ contentsComposite.layout();
+ tabButton.setGradationColor(DACustomButton.STATE_DISABLE,
+ ColorResources.TAB_SELECTED_COLOR_START,
+ ColorResources.TAB_SELECTED_COLOR_END);
+ tabButton.setEnabled(false);
+ tabButton.setRenderer(new TabButtonRenderer());
+ }
+
+ if (usingAnimation) {
+ data.width = 1;
+ tabAnimation(tabButton, true);
+ } else {
+ tabComposite.layout();
+ }
+ }
+
+ public void removeView(final String ID, boolean usingAnimation) {
+ Composite child = childrenMap.get(ID);
+ getTabChildren().remove(child);
+ childrenMap.remove(ID);
+ final DACustomButton button = buttonMap.get(ID);
+ if (!usingAnimation) {
+ button.setLayoutData(null);
+ getButtons().remove(button);
+ buttonMap.remove(ID);
+ tabComposite.layout();
+ } else {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ getButtons().remove(button);
+ buttonMap.remove(ID);
+ button.setGradationColor(DAButton.STATE_DISABLE,
+ ColorResources.TAB_NORMAL_COLOR_START,
+ ColorResources.TAB_NORMAL_COLOR_END);
+ button.setEnabled(false);
+ tabAnimation(button, false);
+ }
+ });
+ }
+ }
+
+ private void tabAnimation(final DACustomButton button, final boolean isShow) {
+ showState = isShow;
+ Timer timer = new Timer();
+ timer.schedule(new TimerTask() {
+ @Override
+ public void run() {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (null != button && !button.isDisposed()) {
+ FormData data = (FormData) button.getLayoutData();
+ if (showState == isShow && isShow) {
+ data.width += (tabWidth / 10);
+ if (data.width > tabWidth) {
+ data.width = tabWidth;
+ tabComposite.layout();
+ cancel();
+ } else {
+ tabComposite.layout();
+ }
+ } else {
+ data.width -= (tabWidth / 10);
+ tabComposite.layout();
+ if (data.width <= 0) {
+ cancel();
+ }
+ }
+ } else {
+ cancel();
+ }
+ }
+ });
+ }
+ }, 10, 50);
+ }
+
+ private void changeButtonState(DACustomButton button) {
+ int size = getButtons().size();
+ if (size > 1) {
+ for (int i = 0; i < size; i++) {
+ DACustomButton sample = getButtons().get(i);
+ if (sample.equals(button)) {
+ button.setGradationColor(DACustomButton.STATE_DISABLE,
+ ColorResources.TAB_SELECTED_COLOR_START,
+ ColorResources.TAB_SELECTED_COLOR_END);
+ button.setEnabled(false);
+ } else {
+ sample.setEnabled(true);
+ }
+ }
+ }
+ }
+
+ private List<Composite> getTabChildren() {
+ if (null == children) {
+ children = new ArrayList<Composite>();
+ }
+ return children;
+ }
+
+ private List<DACustomButton> getButtons() {
+ if (null == buttons) {
+ buttons = new ArrayList<DACustomButton>();
+ }
+ return buttons;
+ }
+
+ public Composite getContentComposite() {
+ return contentsComposite;
+ }
+
+ public void setSelectTab(String ID) {
+ Composite tab = childrenMap.get(ID);
+ DACustomButton button = buttonMap.get(ID);
+ if (null == tab || null == button) {
+ System.out.println("tab create bug!!"); // for log //$NON-NLS-1$
+ return;
+ }
+
+ changeButtonState(button);
+ stackLayout.topControl = tab;
+ ((ViewAction) tab).updateView();
+ contentsComposite.layout();
+ }
+
+ @Override
+ public void updateView() {
+ ((ViewAction) stackLayout.topControl).updateView();
+ }
+
+ @Override
+ public void updateLog(LogPackage logPack) {
+ int size = getTabChildren().size();
+ for (int i = 0; i < size; i++) {
+ ((ViewAction) getTabChildren().get(i)).updateLog(logPack);
+ }
+ }
+
+ @Override
+ public void clear() {
+ int size = getTabChildren().size();
+ for (int i = 0; i < size; i++) {
+ ((ViewAction) getTabChildren().get(i)).clear();
+ }
+ }
+
+ @Override
+ public void updateView(DASelectionData data) {
+ ((ViewAction) getTopComposite()).updateView(data);
+ }
+
+ public Composite getTopComposite() {
+ return (Composite) stackLayout.topControl;
+ }
+
+ public void setTabWidth(int size) {
+ tabWidth = size;
+ }
+
+ private PaintListener tabCompositePaintListener = new PaintListener() {
+
+ @Override
+ public void paintControl(PaintEvent e) {
+ Composite comp = (Composite) e.widget;
+ Rectangle rect = comp.getClientArea();
+ e.gc.setForeground(ColorResources.TAB_BG_COLOR_START);
+ e.gc.setBackground(ColorResources.TAB_BG_COLOR_END);
+ e.gc.fillGradientRectangle(rect.x, rect.y, rect.width, rect.height,
+ true);
+ e.gc.setForeground(ColorResources.TAB_BG_OUTLINE_COLOR);
+ e.gc.drawRectangle(rect);
+ }
+ };
+
+ public Composite getTab(String ID) {
+ return childrenMap.get(ID);
+ }
+
+ @Override
+ public void setSelection(List<String> data) {
+ int size = getTabChildren().size();
+ for (int i = 0; i < size; i++) {
+ ((ViewAction) getTabChildren().get(i)).setSelection(data);
+ }
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.widgets;
+
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.DesignConstants;
+import org.tizen.dynamicanalyzer.model.FindProperty;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
+import org.tizen.dynamicanalyzer.widgets.button.checkbox.DACheckBox;
+import org.tizen.dynamicanalyzer.widgets.button.checkbox.DACheckboxSelectionListener;
+import org.tizen.dynamicanalyzer.widgets.button.radio.DARadioButton;
+import org.tizen.dynamicanalyzer.widgets.button.radio.DARadioGroup;
+import org.tizen.dynamicanalyzer.widgets.button.radio.DARadioSelectionListener;
+
+public class FindDialog extends DAMessageBox {
+
+ private final int ENTER_KEY_CODE = 13;
+
+ private Text textBox = null;
+ private DAButton findButton = null;
+ private DARadioButton forwardButton = null;
+ private DARadioButton backwardButton = null;
+ private DACheckBox caseButton = null;
+ private DACheckBox wholeWordButton = null;
+
+ private FindProperty findProperty = null;
+
+ private Grid table = null;
+ private String viewName = null;
+ private Composite composite = null;
+
+ public FindDialog(Shell parentShell, Composite comp) {
+ super(parentShell);
+ if (comp instanceof DATableComposite) {
+ this.table = ((DATableComposite) comp).getTable();
+ viewName = ((DATableComposite) comp).getTableName();
+ } else if (comp instanceof DATreeComposite) {
+ this.table = ((DATreeComposite) comp).getTable();
+ viewName = ((DATreeComposite) comp).getTableName();
+ } else {
+ table = null;
+ }
+ this.composite = comp;
+ findProperty = DATableComposite.getFindProferty();
+ findProperty.setIndex(table.getSelectionIndex());
+ }
+
+ protected int run() {
+ if (null == table) {
+ return AnalyzerConstants.FAIL;
+ }
+ shell.setLayout(new FormLayout());
+ shell.setSize(340, 130);
+ shell.setBackground(ColorResources.DIALOG_BG_UPPER);
+ shell.setText(AnalyzerLabels.FIND_DLG_TITLE_PREFIX + viewName
+ + AnalyzerLabels.FIND_DLG_TITLE_POSTFIX);
+
+ textBox = new Text(shell, SWT.SINGLE);
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 11);
+ data.left = new FormAttachment(0, 9);
+ data.height = 22;
+ data.width = 200;
+ textBox.setLayoutData(data);
+ textBox.setBackground(ColorResources.VIEW_BG_COLOR);
+ textBox.addKeyListener(keyListener);
+ textBox.setText(findProperty.getLastSearch());
+ textBox.setSelection(0, findProperty.getLastSearch().length());
+
+ findButton = new DAButton(shell, SWT.NONE);
+ data = new FormData();
+ data.top = new FormAttachment(0, 11);
+ data.left = new FormAttachment(textBox, 9);
+ data.height = 25;
+ data.width = DesignConstants.DA_BUTTON_WIDTH;
+ findButton.setLayoutData(data);
+ findButton.setText(AnalyzerLabels.FIND_DLG_FIND_BUTTON);
+ findButton.addClickListener(fnidButtonListener);
+
+ Label directionLabel = new Label(shell, SWT.TRANSPARENT);
+ data = new FormData();
+ data.top = new FormAttachment(textBox, 11);
+ data.left = new FormAttachment(0, 15);
+ data.height = 20;
+ data.width = DesignConstants.DA_BUTTON_WIDTH - 10;
+ directionLabel.setLayoutData(data);
+ directionLabel.setForeground(ColorResources.BLACK);
+ directionLabel.setText(AnalyzerLabels.FIND_DLG_DIRECTION);
+ directionLabel.setBackground(ColorResources.DIALOG_BG_UPPER);
+
+ DARadioGroup radioGroup = new DARadioGroup();
+ forwardButton = new DARadioButton(shell, SWT.NONE);
+ data = new FormData();
+ data.top = new FormAttachment(textBox, 10);
+ data.left = new FormAttachment(directionLabel, 0);
+ data.height = 20;
+ data.width = DesignConstants.DA_BUTTON_WIDTH + 10;
+ forwardButton.setLayoutData(data);
+ forwardButton.setForeground(ColorResources.BLACK);
+ forwardButton.setBackground(ColorResources.DIALOG_BG_UPPER);
+ forwardButton.setText(AnalyzerLabels.FIND_DLG_DIRECTION_FORWARD);
+ forwardButton.addSelectionListener(forwardButtonListener);
+ radioGroup.addChild(forwardButton);
+
+ backwardButton = new DARadioButton(shell, SWT.NONE);
+ data = new FormData();
+ data.top = new FormAttachment(textBox, 10);
+ data.left = new FormAttachment(forwardButton, 1);
+ data.height = 20;
+ data.width = DesignConstants.DA_BUTTON_WIDTH;
+ backwardButton.setLayoutData(data);
+ backwardButton.setForeground(ColorResources.BLACK);
+ backwardButton.setBackground(ColorResources.DIALOG_BG_UPPER);
+ backwardButton.setText(AnalyzerLabels.FIND_DLG_DIRECTION_BACKWARD);
+ backwardButton.addSelectionListener(backwardButtonListener);
+ radioGroup.addChild(backwardButton);
+
+ Label optionLabel = new Label(shell, SWT.TRANSPARENT);
+ data = new FormData();
+ data.top = new FormAttachment(directionLabel, 5);
+ data.left = new FormAttachment(0, 15);
+ data.height = 20;
+ data.width = DesignConstants.DA_BUTTON_WIDTH - 10;
+ optionLabel.setLayoutData(data);
+ optionLabel.setForeground(ColorResources.BLACK);
+ optionLabel.setText(AnalyzerLabels.FIND_DLG_OPTION);
+ optionLabel.setBackground(ColorResources.DIALOG_BG_UPPER);
+
+ caseButton = new DACheckBox(shell, SWT.NONE);
+ data = new FormData();
+ data.top = new FormAttachment(forwardButton, 5);
+ data.left = new FormAttachment(optionLabel, 0);
+ data.height = 20;
+ data.width = DesignConstants.DA_BUTTON_WIDTH + 10;
+ caseButton.setLayoutData(data);
+ caseButton.setForeground(ColorResources.BLACK);
+ caseButton.setBackground(ColorResources.DIALOG_BG_UPPER);
+ caseButton.setText(AnalyzerLabels.FIND_DLG_CASE_SENSITIVE);
+ caseButton.addSelectionListener(caseButtonListener);
+ caseButton.setChecked(findProperty.isCaseSensitive());
+
+ wholeWordButton = new DACheckBox(shell, SWT.NONE);
+ data = new FormData();
+ data.top = new FormAttachment(forwardButton, 5);
+ data.left = new FormAttachment(caseButton, 1);
+ data.height = 20;
+ data.width = DesignConstants.DA_BUTTON_WIDTH;
+ wholeWordButton.setLayoutData(data);
+ wholeWordButton.setForeground(ColorResources.BLACK);
+ wholeWordButton.setBackground(ColorResources.DIALOG_BG_UPPER);
+ wholeWordButton.setText(AnalyzerLabels.FIND_DLG_WHOLE_WORD);
+ wholeWordButton.addSelectionListener(wholeWordButtonListener);
+ wholeWordButton.setChecked(findProperty.isWholeWord());
+
+ return result;
+ }
+
+ private DACustomButtonClickEventListener fnidButtonListener = new DACustomButtonClickEventListener() {
+
+ @Override
+ public void handleClickEvent(DACustomButton button) {
+ findProperty.setLastSearch(textBox.getText());
+ executeFindCommand();
+ }
+ };
+
+ private KeyListener keyListener = new KeyListener() {
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ if (null != textBox.getText() && !textBox.getText().isEmpty()) {
+ findButton.setEnabled(true);
+
+ if (e.keyCode == ENTER_KEY_CODE) {
+ findProperty.setLastSearch(textBox.getText());
+ executeFindCommand();
+ }
+ } else {
+ findButton.setEnabled(false);
+ }
+ }
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+ }
+ };
+
+ private DARadioSelectionListener forwardButtonListener = new DARadioSelectionListener() {
+
+ @Override
+ public void handleSelectionEvent(DARadioButton radio) {
+ findProperty.setBackward(false);
+ if (!backwardButton.isEnabled()) {
+ backwardButton.setEnabled(true);
+ }
+ forwardButton.setEnabled(false);
+ }
+ };
+
+ private DARadioSelectionListener backwardButtonListener = new DARadioSelectionListener() {
+
+ @Override
+ public void handleSelectionEvent(DARadioButton radio) {
+ findProperty.setBackward(true);
+ if (!forwardButton.isEnabled()) {
+ forwardButton.setEnabled(true);
+ }
+ backwardButton.setEnabled(false);
+ }
+ };
+
+ private DACheckboxSelectionListener caseButtonListener = new DACheckboxSelectionListener() {
+
+ @Override
+ public void handleSelectionEvent(DACheckBox checkbox) {
+ findProperty.setCaseSensitive(!findProperty.isCaseSensitive());
+ caseButton.setChecked(findProperty.isCaseSensitive());
+ }
+ };
+
+ private DACheckboxSelectionListener wholeWordButtonListener = new DACheckboxSelectionListener() {
+
+ @Override
+ public void handleSelectionEvent(DACheckBox checkbox) {
+ findProperty.setWholeWord(!findProperty.isWholeWord());
+ wholeWordButton.setChecked(findProperty.isWholeWord());
+ }
+ };
+
+ private boolean executeFindCommand() {
+
+ int index = findProperty.getIndex();
+ GridItem[] items = table.getItems();
+ int itemCount = items.length;
+
+ if (itemCount != 0) {
+ if (findProperty.isBackward()) {
+ index = (index - 1 < 0) ? itemCount - 1 : index - 1;
+ } else {
+ index = (index + 1 > itemCount - 1) ? 0 : index + 1;
+ }
+ int findIndex = -1;
+ findProperty.setIndex(index);
+ if (composite instanceof DATableComposite) {
+ findIndex = ((DATableComposite) composite)
+ .searchString(findProperty);
+ } else if (composite instanceof DATreeComposite) {
+ findIndex = ((DATreeComposite) composite)
+ .searchString(findProperty);
+ } else {
+ return false;
+ }
+ findProperty.setIndex(findIndex);
+ return true;
+ }
+ return false;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.ui.widgets;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
+import org.tizen.dynamicanalyzer.widgets.helper.FontResources;
+import org.tizen.dynamicanalyzer.widgets.helper.WidgetUtils;
+import org.tizen.dynamicanalyzer.widgets.progress.Progress;
+
+public class ProgressDialog {
+ private Shell shell = null;
+ private Progress progress = null;
+
+ public ProgressDialog(Shell parent, int style) {
+ shell = new Shell(parent, style);
+ shell.setSize(300, 100);
+ shell.setLayout(new FillLayout());
+
+ progress = new Progress(shell, SWT.NONE, Progress.PROGRESS_STYLE_ALL);
+
+ progress.setBarStartColor(ColorResources.STOP_PROGRESS_BAR_START_COLOR);
+ progress.setBarEndColor(ColorResources.STOP_PROGRESS_BAR_END_COLOR);
+ progress.setBarStartBackgroundColor(ColorResources.STOP_PROGRESS_BAR_BG_START_COLOR);
+ progress.setBarEndBackgroundColor(ColorResources.STOP_PROGRESS_BAR_BG_END_COLOR);
+ progress.setBarOutlineColor(ColorResources.STOP_PROGRESS_BAR_OUTLINE_COLOR);
+ progress.setDialogOutlineColor1(ColorResources.STOP_PROGRESS_LINE1_COLOR);
+ progress.setDialogOutlineColor2(ColorResources.STOP_PROGRESS_LINE2_COLOR);
+ progress.setProgressUpperFont(FontResources.STOP_PROGRESS_FONT);
+ progress.setProgressLowerFont(FontResources.PROGRESS_FONT);
+ progress.setProgressUpperFontColor(ColorResources.BLACK);
+ progress.setProgressLowerFontColor(ColorResources.STOP_PROGRESS_INFO_FONT_COLOR);
+ progress.setBarBackgroundColor(ColorResources.STOP_PROGRESS_BACKGROUND_COLOR);
+
+ WidgetUtils.setCenter(shell);
+ }
+
+ public void open() {
+ shell.open();
+ }
+
+ public void close() {
+ if (null != progress) {
+ if (!progress.isDisposed()) {
+ progress.close();
+ progress.dispose();
+ }
+ progress = null;
+ }
+ if (null != shell) {
+ if (!shell.isDisposed()) {
+ shell.dispose();
+ }
+ shell = null;
+ }
+ }
+
+ public void setProgressMessage(String message) {
+ progress.setUpperText(message);
+ }
+
+ public void setProgressInfo(String infoMessage) {
+ progress.setBottomText(infoMessage);
+ }
+
+ public void setValue(int value) {
+ progress.setValue(value);
+ }
+
+ public void setValues(String progressMessage, int value) {
+ progress.setUpperText(progressMessage);
+ progress.setValue(value);
+ }
+
+ public void errorOccurred(String message, String bottomMessage) {
+ progress.errorOccured(message, bottomMessage);
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.widgets;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Display;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.IDACustomButtonRenderer;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonAttribute;
+
+public class TabButtonRenderer implements IDACustomButtonRenderer {
+
+ @Override
+ public void draw(GC gc, Canvas canvas, int state,
+ DACustomButtonAttribute attr) {
+ Rectangle rect = canvas.getClientArea();
+
+ if (attr.getDrawType() == DACustomButton.TYPE_IMAGE) {
+ Image image = attr.getImage(state);
+ if (null == image) {
+ return;
+ }
+
+ gc.drawImage(image, rect.x, rect.y);
+ drawButtonText(gc, rect, state, attr);
+ } else if (attr.getDrawType() == DACustomButton.TYPE_COLOR
+ || attr.getDrawType() == DACustomButton.TYPE_GRADATION) {
+ drawButton(gc, rect, state, attr);
+ }
+ drawButtonImage(gc, rect, attr);
+ }
+
+ public int computeFontSize(Rectangle rect) {
+ if (rect.height > 20)
+ return 10;
+ else
+ return 8;
+ }
+
+ public void drawButton(GC gc, Rectangle rect, int state,
+ DACustomButtonAttribute attr) {
+ if (attr.getDrawType() == DACustomButton.TYPE_COLOR) {
+ gc.setBackground(attr.getColor(state));
+ gc.fillRectangle(rect);
+ } else {
+ int index = state * 2;
+ gc.setForeground(attr.getColor(index));
+ gc.setBackground(attr.getColor(index + 1));
+ gc.fillGradientRectangle(rect.x, rect.y, rect.width, rect.height,
+ true);
+ }
+
+ Rectangle r = new Rectangle(0, 0, rect.width - 1, rect.height - 1);
+ if (attr.getButtonImage() == null) {
+ drawButtonText(gc, r, state, attr);
+ }
+ Color c = gc.getForeground();
+ Color outline = attr.getOutlineColor(state);
+ gc.setForeground((outline == null) ? c : outline);
+ gc.drawRectangle(r);
+ gc.setForeground(c);
+ }
+
+ protected void drawButtonImage(GC gc, Rectangle rect,
+ DACustomButtonAttribute attr) {
+ if (attr != null && attr.getButtonImage() != null) {
+ Image img = attr.getButtonImage();
+ Rectangle imgRect = img.getBounds();
+ int width = rect.width - imgRect.width;
+ int height = rect.height - imgRect.height;
+ int x = 0, y = 0;
+ if (width > 0) {
+ x = width / 2;
+ }
+
+ if (height > 0) {
+ y = height / 2;
+ }
+ gc.drawImage(img, x, y);
+ }
+ }
+
+ protected void drawButtonText(GC gc, Rectangle rect, int state,
+ DACustomButtonAttribute attr) {
+ String s = null;
+ Font f = null;
+ Point p = null;
+ if (null != (s = attr.getText())) {
+ if (null == (f = attr.getFont())) {
+ f = new Font(Display.getCurrent(), "Arial", //$NON-NLS-1$
+ computeFontSize(rect), SWT.BOLD);
+ attr.setFont(f);
+ }
+ gc.setFont(f);
+
+ int x = 0, y = 0;
+ int offset = 0;
+ if (null == (p = attr.getFontPoint())) {
+ p = gc.textExtent(s, SWT.DRAW_MNEMONIC);
+ x = (rect.width - p.x) / 2;
+ y = (rect.height - p.y) / 2;
+ x = (x < 0) ? 0 : x;
+ // rect size < text length -> insert offset
+ offset = ((x - rect.x) < 4) ? 4 : 0;
+ } else {
+ x = p.x;
+ y = p.y;
+ }
+ Color fontColor = attr.getFontColor(state);
+ if (fontColor == null) {
+ fontColor = ColorResources.WHITE;
+ }
+ gc.setForeground(fontColor);
+ if (state == DACustomButton.STATE_PUSH) {
+ x += 1;
+ y += 1;
+ }
+ gc.drawString(s, x + offset, y, true);
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.widgets;
+
+import java.util.List;
+
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.widgets.combo.DACustomComboPopupRenderer;
+
+
+public class TitleComboPopupRenderer extends DACustomComboPopupRenderer {
+
+ @Override
+ public void draw(GC gc, Canvas canvas, int state, List<Rectangle> rects,
+ int selection, List<String> items) {
+ int size = rects.size();
+ for (int i = 0; i < size; i++) {
+ Rectangle r = rects.get(i);
+ if (selection == i) {
+ gc.setBackground(ColorResources.DEVICE_APPLICATION_ITEM_SELECT_INNER);
+ gc.fillRectangle(r);
+
+ gc.setForeground(ColorResources.DEVICE_APPLICATION_ITEM_SELECT_TOP);
+ gc.drawLine(r.x, r.y, r.x + r.width, r.y);
+ gc.setForeground(ColorResources.DEVICE_APPLICATION_ITEM_SELECT_BOTTOM);
+ gc.drawLine(r.x, r.y + r.height - 1, r.x + r.width, r.y
+ + r.height - 1);
+ } else {
+ gc.setBackground(ColorResources.DEVICE_APPLICATION_ITEM_NORMAL_INNER);
+ gc.fillRectangle(r);
+ gc.setForeground(ColorResources.DEVICE_APPLICATION_ITEM_NORMAL_TOP);
+ gc.drawLine(r.x, r.y, r.x + r.width, r.y);
+ gc.setForeground(ColorResources.DEVICE_APPLICATION_ITEM_NORMAL_BOTTOM);
+ gc.drawLine(r.x, r.y + r.height - 1, r.x + r.width, r.y
+ + r.height - 1);
+ }
+ gc.setForeground(ColorResources.DEVICE_APPLICATION_DROPDOWN_TEXT);
+ gc.setFont(FontResources.DROPDOWN);
+ // Point p = gc.textExtent(items.get(i), SWT.DRAW_MNEMONIC);
+ // gc.drawString(items.get(i), 5, (r.height - p.y) / 2 + i *
+ // r.height,
+ // true);
+ gc.drawString(items.get(i), 5, 6 + i * r.height, true);
+
+ Rectangle rect = canvas.getClientArea();
+ gc.setForeground(ColorResources.DEVICE_APPLICATION_POPUP_OUTER_1);
+ gc.drawRectangle(rect);
+ gc.setForeground(ColorResources.DEVICE_APPLICATION_POPUP_OUTER_2);
+ gc.drawRectangle(rect.x + 1, rect.y + 1, rect.width - 2,
+ rect.height - 2);
+ }
+ }
+
+ @Override
+ public void drawPattern(GC gc, Canvas canvas, Image patternImage,
+ int state, List<Rectangle> rects, int selection, List<String> items) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void drawImage(GC gc, Canvas canvas, Image image, int state,
+ List<Rectangle> rects, int selection, List<String> items) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.widgets;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.widgets.combo.DACustomCombo;
+import org.tizen.dynamicanalyzer.widgets.combo.DACustomComboRenderer;
+
+public class TitleComboRenderer extends DACustomComboRenderer {
+
+ @Override
+ public void draw(GC gc, Canvas canvas, String text, int state) {
+ Rectangle rect = canvas.getClientArea();
+ setColors(state, gc);
+ gc.fillGradientRectangle(rect.x, rect.y, rect.width, rect.height, true);
+ gc.setForeground(ColorResources.BLACK);
+ gc.drawRectangle(rect.x, rect.y, rect.width - 20, rect.height - 1);
+
+ if (null == text) {
+ text = CommonConstants.EMPTY;
+ }
+ gc.setFont(FontResources.COMBO);
+ Point p = gc.textExtent(text, SWT.DRAW_MNEMONIC);
+ gc.setForeground(ColorResources.DEVICE_APPLICATION_ENABLE);
+ gc.drawString(text, 5, (rect.height - p.y) / 2, true);
+
+ setColors(state, gc);
+ gc.fillGradientRectangle(rect.x + rect.width - 20, rect.y, 19,
+ rect.height - 1, true);
+ gc.setForeground(ColorResources.BLACK);
+ gc.drawRectangle(rect.x + rect.width - 20, rect.y, 19, rect.height - 1);
+ }
+
+ @Override
+ public void drawPattern(GC gc, Canvas canvas, Image patternImage,
+ String text, int state) {
+
+ }
+
+ @Override
+ public void drawImage(GC gc, Canvas canvas, Image image, String text,
+ int state) {
+ Rectangle rect = canvas.getClientArea();
+ gc.drawImage(image, rect.x, rect.y);
+ gc.setFont(FontResources.COMBO);
+ gc.setForeground(ColorResources.DEVICE_APPLICATION_ENABLE);
+ Point p = gc.textExtent(text, SWT.DRAW_MNEMONIC);
+ gc.drawString(text, 5, (rect.height - p.y) / 2, true);
+ Rectangle clipping = new Rectangle(rect.x + rect.width - 19, rect.y,
+ 19, rect.height);
+ gc.setClipping(clipping);
+ gc.drawImage(image, rect.x, rect.y);
+ }
+
+ private void setColors(int state, GC gc) {
+ if (state == DACustomCombo.STATE_NORMAL) {
+ gc.setForeground(ColorResources.BAR_GRAY2);
+ gc.setBackground(ColorResources.WINDOW_BG_COLOR);
+ } else if (state == DACustomCombo.STATE_HOVER) {
+ gc.setForeground(ColorResources.BAR_GRAY2);
+ gc.setBackground(ColorResources.ITEM_BLUE_DARK);
+ } else if (state == DACustomCombo.STATE_PUSH) {
+ gc.setForeground(ColorResources.BAR_GRAY2);
+ gc.setBackground(ColorResources.BLUE);
+ } else if (state == DACustomCombo.STATE_DISABLE) {
+ gc.setForeground(ColorResources.BAR_GRAY2);
+ gc.setBackground(ColorResources.BAR_GRAY1);
+ }
+ }
+
+}
--- /dev/null
+/*\r
+ * Dynamic Analyzer\r
+ *\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact: \r
+ * Jooyoul Lee <jy.exe.lee@samsung.com>\r
+ * Juyoung Kim <j0.kim@samsung.com>\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * \r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ * \r
+ */\r
+\r
+package org.tizen.dynamicanalyzer.ui.widgets;\r
+\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.events.PaintEvent;\r
+import org.eclipse.swt.events.PaintListener;\r
+import org.eclipse.swt.graphics.Color;\r
+import org.eclipse.swt.graphics.GC;\r
+import org.eclipse.swt.graphics.Point;\r
+import org.eclipse.swt.graphics.Rectangle;\r
+import org.eclipse.swt.layout.FormAttachment;\r
+import org.eclipse.swt.layout.FormData;\r
+import org.eclipse.swt.layout.FormLayout;\r
+import org.eclipse.swt.widgets.Canvas;\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.swt.widgets.Event;\r
+import org.eclipse.swt.widgets.Listener;\r
+import org.tizen.dynamicanalyzer.common.CommonConstants;\r
+import org.tizen.dynamicanalyzer.common.DesignConstants;\r
+import org.tizen.dynamicanalyzer.model.DAView;\r
+import org.tizen.dynamicanalyzer.resources.ColorResources;\r
+import org.tizen.dynamicanalyzer.resources.FontResources;\r
+\r
+public class ViewContainer {\r
+\r
+ private Canvas titleBar;\r
+ private Composite contentArea;\r
+ private String title = CommonConstants.EMPTY;\r
+ private Color titleFontColor = ColorResources.VIEW_TITLE_FONT_COLOR;\r
+ private static final int OFFSET = 5;\r
+ private Composite parent = null;\r
+ private boolean isMaximized = false;\r
+\r
+ public ViewContainer(Composite parent, boolean titleVisibility) {\r
+ final Composite composite = new Composite(parent, SWT.NONE);\r
+ composite.setLayout(new FormLayout());\r
+ this.parent = parent;\r
+ // Creates title bar.\r
+ titleBar = new Canvas(composite, SWT.DOUBLE_BUFFERED);\r
+ titleBar.addPaintListener(titlePaintListener);\r
+ titleBar.addListener(SWT.MouseDoubleClick, titleMouseListener);\r
+\r
+ // Creates border area.\r
+ Composite borderArea = new Composite(composite, SWT.NONE);\r
+ borderArea.setLayout(new FormLayout());\r
+ borderArea.setBackground(ColorResources.VIEW_BORDER);\r
+\r
+ // Creates content area.\r
+ contentArea = new Composite(borderArea, SWT.NONE);\r
+ contentArea.setLayout(new FormLayout());\r
+ contentArea.setBackground(ColorResources.VIEW_BG_COLOR);\r
+\r
+ // Sets layout data.\r
+ FormData data = new FormData();\r
+ data.left = new FormAttachment(0, 0);\r
+ data.right = new FormAttachment(100, 0);\r
+ if (titleVisibility) {\r
+ data.height = DesignConstants.VIEW_TITLEBAR_HEIGHT;\r
+ } else {\r
+ data.height = 0;\r
+ }\r
+ titleBar.setLayoutData(data);\r
+\r
+ data = new FormData();\r
+ data.top = new FormAttachment(titleBar, 0);\r
+ data.left = new FormAttachment(0, 0);\r
+ data.right = new FormAttachment(100, 0);\r
+ data.bottom = new FormAttachment(100, 0);\r
+ borderArea.setLayoutData(data);\r
+\r
+ data = new FormData();\r
+ data.top = new FormAttachment(0, 3);\r
+ data.left = new FormAttachment(0, 2);\r
+ data.right = new FormAttachment(100, -2);\r
+ data.bottom = new FormAttachment(100, -2);\r
+ contentArea.setLayoutData(data);\r
+ }\r
+\r
+ public Composite getContentArea() {\r
+ return contentArea;\r
+ }\r
+\r
+ public void setTitleText(String title) {\r
+ this.title = title;\r
+ titleBar.setToolTipText(title);\r
+ titleBar.redraw();\r
+ }\r
+\r
+ public String getTitleText() {\r
+ return this.title;\r
+ }\r
+\r
+ public void setTitleFontColor(Color color) {\r
+ titleFontColor = color;\r
+ }\r
+\r
+ private PaintListener titlePaintListener = new PaintListener() {\r
+\r
+ @Override\r
+ public void paintControl(PaintEvent e) {\r
+ GC gc = e.gc;\r
+\r
+ Rectangle bounds = titleBar.getBounds();\r
+ int width = bounds.width;\r
+ int height = bounds.height - 2;\r
+\r
+ // Draws background.\r
+ gc.setForeground(ColorResources.TITLEBAR_START_COLOR);\r
+ gc.setBackground(ColorResources.TITLEBAR_END_COLOR);\r
+ gc.fillGradientRectangle(bounds.x, bounds.y, width, height, true);\r
+ gc.setForeground(ColorResources.TITLEBAR_BOTTOM_STROKE_1);\r
+ gc.drawLine(bounds.x, bounds.y + height + 1, bounds.x + width,\r
+ bounds.y + height + 1);\r
+ gc.setForeground(ColorResources.TITLEBAR_BOTTOM_STROKE_2);\r
+ gc.drawLine(bounds.x, bounds.y + height + 2, bounds.x + width,\r
+ bounds.y + height + 2);\r
+\r
+ // Draws text.\r
+ gc.setFont(FontResources.VIEW_TITLE);\r
+ gc.setForeground(titleFontColor);\r
+ Point textSize = gc.textExtent(title, SWT.DRAW_MNEMONIC);\r
+ gc.drawText(title, (width - textSize.x) / 2 - OFFSET,\r
+ (height - textSize.y) / 2, true);\r
+ }\r
+ };\r
+\r
+ private Listener titleMouseListener = new Listener() {\r
+\r
+ @Override\r
+ public void handleEvent(Event event) {\r
+ if (parent instanceof DAView) {\r
+ isMaximized = !isMaximized;\r
+ ((DAView) parent).setMaxSize(isMaximized);\r
+ }\r
+ }\r
+ };\r
+\r
+}\r
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * yeongtaik byeon <yeongtaik.byeon@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.widgets.table;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.model.TableInput;
+
+public class DAApiListTableComposite extends DATableComposite {
+
+ public DAApiListTableComposite(Composite parent, int compStyle,
+ int tableStyle) {
+ super(parent, compStyle, tableStyle);
+ setRangePopup();
+ }
+
+ @Override
+ protected List<TableInput> makeTableInput() {
+ return null;
+ }
+
+ public void setSelectionByTime(long startTime, long endTime) {
+ GridItem[] items = table.getItems();
+ int size = items.length;
+ List<Integer> selectionArray = new ArrayList<Integer>();
+ int topIndex = 0;
+ long topIndexTime = 0;
+
+ for (int i = 0; i < size; i++) {
+ DATableDataFormat dataFormat = (DATableDataFormat) items[i]
+ .getData();
+ String timeStr = dataFormat.getData().get(
+ LogCenterConstants.TIME_INDEX);
+ long time = Long.valueOf(timeStr);
+
+ if (time < startTime) {
+ if (time > topIndexTime) {
+ topIndexTime = time;
+ topIndex = i;
+ }
+ } else if (time <= endTime) {
+ if (topIndexTime < startTime) {
+ topIndexTime = time;
+ topIndex = i;
+ } else {
+ if (topIndexTime > time) {
+ topIndexTime = time;
+ topIndex = i;
+ }
+ }
+ selectionArray.add(i);
+ } else {
+ break;
+ }
+ }
+
+ int[] sel = new int[selectionArray.size()];
+ for (int i = 0; i < sel.length; i++) {
+ sel[i] = selectionArray.get(i).intValue();
+ }
+ table.setSelection(sel);
+ table.setTopIndex(topIndex);
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.widgets.table;
+
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.nebula.widgets.grid.IInternalWidget;
+import org.eclipse.nebula.widgets.grid.internal.CheckBoxRenderer;
+import org.eclipse.nebula.widgets.grid.internal.DefaultCellRenderer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+
+public class DATableCellRenderer extends DefaultCellRenderer {
+ int leftMargin = 4;
+ int rightMargin = 4;
+ int topMargin = 0;
+ int bottomMargin = 0;
+ int textTopMargin = 1;
+ int textBottomMargin = 2;
+ int insideMargin = 3;
+ int treeIndent = 20;
+
+ protected DATableToggleRenderer toggleRenderer;
+ protected CheckBoxRenderer checkRenderer;
+
+ @Override
+ public void paint(GC gc, Object value) {
+ GridItem item = (GridItem) value;
+
+ gc.setFont(item.getFont(getColumn()));
+
+ boolean drawAsSelected = isSelected();
+
+ boolean drawBackground = true;
+
+ if (isCellSelected()) {
+ drawAsSelected = true;// (!isCellFocus());
+ }
+
+ if (drawAsSelected) {
+ gc.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_START);
+ gc.setBackground(ColorResources.TABLE_CONTENTS_SELECTED_END);
+ } else {
+ if (item.getParent().isEnabled()) {
+ Color bg = item.getBackground();
+ if (bg != null) {
+ gc.setBackground(bg);
+ } else {
+ drawBackground = false;
+ }
+ } else {
+ gc.setBackground(getDisplay().getSystemColor(
+ SWT.COLOR_WIDGET_BACKGROUND));
+ }
+ }
+
+ if (drawBackground && drawAsSelected) {
+ gc.fillGradientRectangle(getBounds().x, getBounds().y,
+ getBounds().width, getBounds().height, true);
+ } else if (drawBackground) {
+ gc.fillRectangle(getBounds().x, getBounds().y + 1,
+ getBounds().width, getBounds().height);
+ }
+
+ int x = leftMargin;
+
+ if (isTree()) {
+ x += getToggleIndent(item);
+
+ if (drawAsSelected) {
+ toggleRenderer.setSelected(true);
+ } else {
+ toggleRenderer.setSelected(false);
+ }
+ toggleRenderer.setExpanded(item.isExpanded());
+
+ toggleRenderer.setHover(getHoverDetail().equals("toggle")); //$NON-NLS-1$
+
+ toggleRenderer.setLocation(getBounds().x + x,
+ (getBounds().height - toggleRenderer.getBounds().height)
+ / 2 + getBounds().y);
+ toggleRenderer.paint(gc, item);
+
+ x += toggleRenderer.getBounds().width + insideMargin;
+ }
+
+ if (isCheck()) {
+
+ checkRenderer.setChecked(item.getChecked(getColumn()));
+ checkRenderer.setGrayed(item.getGrayed(getColumn()));
+ if (!item.getParent().isEnabled()) {
+ checkRenderer.setGrayed(true);
+ }
+ checkRenderer.setHover(getHoverDetail().equals("check")); //$NON-NLS-1$
+
+ checkRenderer.setBounds(getBounds().x + x,
+ (getBounds().height - checkRenderer.getBounds().height) / 2
+ + getBounds().y, checkRenderer.getBounds().width,
+ checkRenderer.getBounds().height);
+ checkRenderer.paint(gc, null);
+
+ x += checkRenderer.getBounds().width + insideMargin;
+ }
+
+ Image image = item.getImage(getColumn());
+ if (image != null) {
+ int y = getBounds().y;
+ y += (getBounds().height - image.getBounds().height) / 2;
+ gc.drawImage(image, getBounds().x + x, y);
+ x += image.getBounds().width + insideMargin;
+ }
+
+ int width = getBounds().width - x - rightMargin;
+
+ String text = item.getText(getColumn());
+
+ if (getAlignment() == SWT.RIGHT) {
+ int len = gc.stringExtent(text).x;
+ if (len < width) {
+ x += width - len;
+ }
+ } else if (getAlignment() == SWT.CENTER) {
+ int len = gc.stringExtent(text).x;
+ if (len < width) {
+ x += (width - len) / 2;
+ }
+ }
+
+ drawPercentGraph(gc, drawAsSelected, item);
+ if (drawAsSelected) {
+ gc.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_FONT_COLOR);
+ } else {
+ Color fontColor = item.getForeground();
+ if (null != fontColor) {
+ gc.setForeground(item.getForeground());
+ } else {
+ gc.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
+ }
+ }
+
+ gc.setFont(FontResources.TABLE_CELL_FONT);
+ if (!isTree() || getColumn() != 0) {
+ gc.drawText(text, getBounds().x + x, getBounds().y + textTopMargin,
+ true);
+ }
+
+ if (item.getParent().getLinesVisible()) {
+ if (isCellSelected()) {
+ gc.setForeground(ColorResources.TABLE_LINE);
+ } else {
+ gc.setForeground(ColorResources.TABLE_LINE);
+ }
+ gc.drawLine(getBounds().x, getBounds().y + getBounds().height,
+ getBounds().x + getBounds().width - 1, getBounds().y
+ + getBounds().height);
+ gc.drawLine(getBounds().x + getBounds().width - 1, getBounds().y,
+ getBounds().x + getBounds().width - 1, getBounds().y
+ + getBounds().height);
+ }
+
+ if (isCellFocus()) {
+ Rectangle focusRect = new Rectangle(getBounds().x - 1,
+ getBounds().y - 1, getBounds().width,
+ getBounds().height + 1);
+
+ gc.setForeground(ColorResources.RED);
+ gc.drawRectangle(focusRect);
+
+ if (isFocus()) {
+ focusRect.x++;
+ focusRect.width -= 2;
+ focusRect.y++;
+ focusRect.height -= 2;
+
+ gc.drawRectangle(focusRect);
+ }
+ }
+ }
+
+ protected void drawPercentGraph(GC gc, boolean drawAsSelected, GridItem item) {
+
+ }
+
+ protected int getToggleIndent(GridItem item) {
+ return item.getLevel() * 20;
+ }
+
+ public void setTree(boolean tree) {
+ super.setTree(tree);
+
+ if (tree) {
+ toggleRenderer = new DATableToggleRenderer();
+ toggleRenderer.setDisplay(getDisplay());
+ }
+ }
+
+ public Point computeSize(GC gc, int wHint, int hHint, Object value) {
+ GridItem item = (GridItem) value;
+ gc.setFont(item.getFont(getColumn()));
+ int x = 0;
+
+ x += leftMargin;
+
+ if (isTree()) {
+ x += getToggleIndent(item);
+ x += toggleRenderer.getBounds().width + insideMargin;
+ }
+
+ if (isCheck()) {
+ x += checkRenderer.getBounds().width + insideMargin;
+ }
+
+ int y = 0;
+ Image image = item.getImage(getColumn());
+ if (image != null) {
+ y = topMargin + image.getBounds().height + bottomMargin;
+
+ x += image.getBounds().width + insideMargin;
+ }
+
+ x += gc.stringExtent(item.getText(getColumn())).x + rightMargin;
+ y = Math.max(y, topMargin + gc.getFontMetrics().getHeight()
+ + bottomMargin);
+
+ return new Point(x, y);
+ }
+
+ public boolean notify(int event, Point point, Object value) {
+ GridItem item = (GridItem) value;
+ if (isCheck()) {
+ if (event == IInternalWidget.MouseMove) {
+ if (overCheck(item, point)) {
+ setHoverDetail("check"); //$NON-NLS-1$
+ return true;
+ }
+ }
+
+ if (event == IInternalWidget.LeftMouseButtonDown) {
+ if (overCheck(item, point)) {
+ item.setChecked(getColumn(), !item.getChecked(getColumn()));
+ item.getParent().redraw();
+ item.fireCheckEvent(getColumn());
+
+ return true;
+ }
+ }
+ }
+
+ if (isTree() && item.hasChildren()) {
+ if (event == IInternalWidget.MouseMove) {
+ if (overToggle(item, point)) {
+ setHoverDetail("toggle"); //$NON-NLS-1$
+ return true;
+ }
+ }
+
+ if (event == IInternalWidget.LeftMouseButtonDown) {
+ if (overToggle(item, point)) {
+ item.setExpanded(!item.isExpanded());
+ item.getParent().redraw();
+
+ if (item.isExpanded()) {
+ item.fireEvent(SWT.Expand);
+ } else {
+ item.fireEvent(SWT.Collapse);
+ }
+
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ private boolean overCheck(GridItem item, Point point) {
+ point = new Point(point.x, point.y);
+ point.x -= getBounds().x - 1;
+ point.y -= getBounds().y - 1;
+
+ int x = leftMargin;
+ if (isTree()) {
+ x += getToggleIndent(item);
+ x += toggleRenderer.getSize().x + insideMargin;
+ }
+
+ if (point.x >= x && point.x < (x + checkRenderer.getSize().x)) {
+ int yStart = ((getBounds().height - checkRenderer.getBounds().height) / 2);
+ if (point.y >= yStart
+ && point.y < yStart + checkRenderer.getSize().y) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private boolean overToggle(GridItem item, Point point) {
+ point = new Point(point.x, point.y);
+ point.x -= getBounds().x - 1;
+ point.y -= getBounds().y - 1;
+
+ int x = leftMargin;
+ x += getToggleIndent(item);
+
+ if (point.x >= x && point.x < (x + toggleRenderer.getSize().x)) {
+ // return true;
+ int yStart = ((getBounds().height - toggleRenderer.getBounds().height) / 2);
+ if (point.y >= yStart
+ && point.y < yStart + toggleRenderer.getSize().y) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public void setCheck(boolean check) {
+ super.setCheck(check);
+
+ if (check) {
+ checkRenderer = new CheckBoxRenderer();
+ checkRenderer.setDisplay(getDisplay());
+ } else {
+ checkRenderer = null;
+ }
+ }
+
+ public Rectangle getTextBounds(GridItem item, boolean preferred) {
+ int x = leftMargin;
+
+ if (isTree()) {
+ x += getToggleIndent(item);
+
+ x += toggleRenderer.getBounds().width + insideMargin;
+
+ }
+
+ if (isCheck()) {
+ x += checkRenderer.getBounds().width + insideMargin;
+ }
+
+ Image image = item.getImage(getColumn());
+ if (image != null) {
+ x += image.getBounds().width + insideMargin;
+ }
+
+ Rectangle bounds = new Rectangle(x, topMargin, 0, 0);
+
+ GC gc = new GC(item.getParent());
+ gc.setFont(item.getFont(getColumn()));
+ Point size = gc.stringExtent(item.getText(getColumn()));
+
+ bounds.height = size.y;
+
+ if (preferred) {
+ bounds.width = size.x;
+ } else {
+ bounds.width = getBounds().width - x - rightMargin;
+ }
+
+ gc.dispose();
+
+ return bounds;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.widgets.table;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.eclipse.nebula.widgets.grid.GridColumn;
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.listeners.TableTooltipListener;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.model.FindProperty;
+import org.tizen.dynamicanalyzer.model.TableInput;
+import org.tizen.dynamicanalyzer.nl.TimelineChartLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.widgets.DAGrid;
+import org.tizen.dynamicanalyzer.ui.widgets.FindDialog;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenu;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuItem;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuListener;
+
+public abstract class DATableComposite extends Composite {
+
+ // for find
+ protected String tableName = CommonConstants.EMPTY;
+ protected DATableComposite me = null;
+ protected static FindProperty findProferty;
+ protected boolean ctrlPressed = false;
+
+ protected Grid table;
+ protected int itemCount = 0;
+ protected List<Integer> selectionIndex;
+ protected HashMap<String, String> selection;
+ protected TableTooltipListener tableListener;
+ protected boolean isTree = false;
+ protected String focusSeq = null;
+
+ protected Color rangeColor = ColorResources.TABLE_RANGE_COLOR_RANGE;
+ protected Color secondSelectionColor = ColorResources.TABLE_RANGE_COLOR_SECOND_SELECTION;
+ protected Color intersectColor = ColorResources.TABLE_RANGE_COLOR_RANGE_SECOND;
+
+ protected DefaultTableComparator comparator = null;
+ protected int[] sortTypes = null;
+ protected int[] sourceColumns = null;
+ protected boolean findEnabled = true;
+
+ protected boolean autoColumnPack = true;
+
+ private DAContextMenu popupMenu = null;
+
+ private Point mousePoint = new Point(0, 0);
+
+ private RangeDataManager rangeDataManager = RangeDataManager.getInstance();
+
+ public DATableComposite(Composite parent, int style) {
+ this(parent, SWT.NONE, style);
+ }
+
+ public DATableComposite(Composite parent, int compStyle, int tableStyle) {
+ super(parent, compStyle);
+ this.setLayout(new FillLayout());
+ this.setBackground(ColorResources.TABLE_CONTENTS_NORMAL);
+
+ table = new DAGrid(this, tableStyle);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+ table.setLineColor(ColorResources.TABLE_LINE);
+ table.setBackground(ColorResources.TABLE_CONTENTS_NORMAL);
+ table.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
+ table.setFont(FontResources.TABLE_CELL_FONT);
+
+ table.setEmptyColumnHeaderRenderer(new DATableEmptyColumnHeaderRenderer());
+ table.setEmptyCellRenderer(new DATableEmptyCellRenderer());
+ table.setItemHeight(16);
+
+ table.addListener(SWT.MouseMove, new Listener() {
+
+ @Override
+ public void handleEvent(Event event) {
+ mousePoint.x = event.x;
+ mousePoint.y = event.y;
+ }
+ });
+
+ table.addSelectionListener(new SelectionListener() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ GridItem[] ti = ((Grid) e.widget).getSelection();
+ if (null == ti || ti.length == 0
+ || !(ti[0].getData() instanceof DATableDataFormat)) {
+ return;
+ }
+ GridItem focusedItem = ((Grid) e.widget).getFocusItem();
+ if (null != focusedItem) {
+ if (!(focusedItem.getData() instanceof DATableDataFormat)) {
+ return;
+ }
+ DATableDataFormat td = (DATableDataFormat) focusedItem
+ .getData();
+ if (null == td) {
+ return;
+ }
+ focusSeq = td.getSelectionKey();
+ }
+
+ int size = ti.length;
+ HashMap<String, String> sel = getSelections();
+ sel.clear();
+ for (int i = 0; i < size; i++) {
+ DATableDataFormat tableData = (DATableDataFormat) ti[i]
+ .getData();
+ if (null != tableData) {
+ String seq = tableData.getSelectionKey();
+ if (null != seq && !seq.isEmpty()) {
+ sel.put(seq, seq);
+ }
+ }
+ }
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+
+ table.addKeyListener(new KeyListener() {
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+
+ if (SWT.CTRL == e.keyCode) {
+ ctrlPressed = false;
+ }
+ }
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+ if (SWT.CTRL == e.keyCode) {
+ ctrlPressed = true;
+ } else if (e.keyCode == 102) { // f
+ if (ctrlPressed) {
+ ctrlPressed = false;
+ if (findEnabled) {
+ Shell shell = AnalyzerUtil.getWorkbenchWindow()
+ .getShell();
+ FindDialog dialog = new FindDialog(shell, me);
+ dialog.open();
+ }
+ }
+ }
+ }
+ });
+
+ me = this;
+ setTableToolTipListener(new TableTooltipListener(table));
+
+ table.addControlListener(new ControlListener() {
+
+ @Override
+ public void controlResized(ControlEvent e) {
+
+ if (null != popupMenu) {
+ Rectangle rect = table.getClientArea();
+ int h = table.getHeaderHeight();
+ Rectangle contentsRect = new Rectangle(rect.x, rect.y + h,
+ rect.width, rect.height - h);
+ popupMenu.setParentArea(contentsRect);
+ }
+ }
+
+ @Override
+ public void controlMoved(ControlEvent e) {
+ }
+ });
+ }
+
+ public void setTree(boolean tree) {
+ isTree = tree;
+ }
+
+ public void setFindEnabled(boolean enabled) {
+ findEnabled = enabled;
+ }
+
+ public void setTableToolTipListener(TableTooltipListener tableListener) {
+ this.tableListener = tableListener;
+ if (null == tableListener) {
+ return;
+ }
+ table.addListener(SWT.Dispose, tableListener);
+ table.addListener(SWT.KeyDown, tableListener);
+ table.addListener(SWT.KeyUp, tableListener);
+ table.addListener(SWT.MouseEnter, tableListener);
+ table.addListener(SWT.MouseExit, tableListener);
+ table.addListener(SWT.MouseMove, tableListener);
+ table.addListener(SWT.MouseHover, tableListener);
+ table.addListener(SWT.MouseUp, tableListener);
+ table.addListener(SWT.MouseDoubleClick, tableListener);
+ }
+
+ public void setTableToolTipEnable(boolean enabled) {
+ tableListener.setEnable(enabled);
+ }
+
+ public void setRangeColor(Color color) {
+ rangeColor = color;
+ }
+
+ public void setSecondSelectionColor(Color color) {
+ secondSelectionColor = color;
+ }
+
+ public void setIntersectColor(Color color) {
+ intersectColor = color;
+ }
+
+ public void setColumns(String[] columnNames) {
+ int size = columnNames.length;
+ for (int i = 0; i < size; i++) {
+ GridColumn column = new GridColumn(table, SWT.NONE);
+ column.setText(columnNames[i]);
+ if (isTree && i == 0) {
+ column.setTree(true);
+ }
+ column.setCellRenderer(new DATableCellRenderer());
+ column.setHeaderRenderer(new DATableHeaderRenderer());
+ column.pack();
+
+ if (null != comparator && null != sourceColumns
+ && null != sortTypes) {
+ final int type = sortTypes[i];
+ final int sourceColumn = sourceColumns[i];
+ final int columnIndex = i;
+
+ column.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ comparator.setType(type);
+ comparator.setColumn(columnIndex);
+ comparator.setSourceColumn(sourceColumn);
+ comparator.reverseDirection();
+ updateTable();
+ }
+ });
+ }
+ }
+ }
+
+ public void setColumnVisibility(boolean[] columnVisibility) {
+ if (null == table || null == columnVisibility) {
+ return;
+ }
+
+ int size = columnVisibility.length;
+ GridColumn[] columns = table.getColumns();
+ if (size != columns.length) {
+ return;
+ }
+ for (int i = 0; i < size; i++) {
+ columns[i].setVisible(columnVisibility[i]);
+ }
+ }
+
+ public void setColumnSize(int[] columnSizes) {
+ if (null == table || null == columnSizes) {
+ return;
+ }
+
+ int size = columnSizes.length;
+ GridColumn[] columns = table.getColumns();
+ if (size != columns.length) {
+ return;
+ }
+
+ for (int i = 0; i < size; i++) {
+ if (columnSizes[i] == 0) {
+ columns[i].pack();
+ } else {
+ columns[i].setWidth(columnSizes[i]);
+ }
+ }
+ }
+
+ public Grid getTable() {
+ return table;
+ }
+
+ public void updateTable() {
+ GridItem[] selections = table.getSelection();
+ List<String> selSeqs = new ArrayList<String>();
+ for (int i = 0; i < selections.length; i++) {
+ DATableDataFormat tableData = (DATableDataFormat) selections[i]
+ .getData();
+ List<String> data = tableData.getData();
+ selSeqs.add(data.get(LogCenterConstants.SEQUENCE_NUMBER_INDEX));
+ }
+ table.removeAll();
+
+ List<TableInput> input = makeTableInput();
+ if (null == input) {
+ return;
+ }
+ if (null != comparator) {
+ Collections.sort(input, comparator);
+ }
+ int[] sels = new int[selSeqs.size()];
+ int iii = 0;
+ int focusIndex = -1;
+ int size = input.size();
+ for (int i = 0; i < size; i++) {
+ GridItem gridItem = new GridItem(table, SWT.NONE);
+ DATableDataFormat gridData = (DATableDataFormat) input.get(i)
+ .getData();
+ gridItem.setData(gridData);
+
+ List<String> text = input.get(i).getText();
+ List<Image> images = input.get(i).getImages();
+ int columnCount = text.size();
+ for (int index = 0; index < columnCount; index++) {
+ gridItem.setText(index, text.get(index));
+
+ if (null != images && !images.isEmpty()) {
+ gridItem.setImage(index, images.get(index));
+ }
+ }
+
+ if (input.get(i).isInRange() && input.get(i).isSecondSelection()) {
+ gridItem.setBackground(intersectColor);
+ } else if (input.get(i).isSecondSelection()) {
+ gridItem.setBackground(secondSelectionColor);
+ } else if (input.get(i).isInRange()) {
+ gridItem.setBackground(rangeColor);
+ }
+
+ String seqNum = gridData.getSelectionKey();
+ for (int ii = 0; ii < selSeqs.size(); ii++) {
+ if (seqNum.equals(selSeqs.get(ii))) {
+ sels[iii++] = i;
+ selSeqs.remove(ii);
+ }
+ }
+ if (null != focusSeq && seqNum.equals(focusSeq)) {
+ focusIndex = i;
+ }
+ }
+ table.setSelection(sels);
+ if (table.isFocusControl() && focusIndex > 0) {
+ table.setFocusItem(table.getItem(focusIndex));
+ }
+ table.update();
+ }
+
+ protected abstract List<TableInput> makeTableInput();
+
+ public HashMap<String, String> getSelections() {
+ if (null == selection) {
+ selection = new HashMap<String, String>();
+ }
+ return selection;
+ }
+
+ public List<Integer> getSelectionIndex() {
+ if (null == selectionIndex) {
+ selectionIndex = new ArrayList<Integer>();
+ }
+ return selectionIndex;
+ }
+
+ public void clear() {
+ table.removeAll();
+ getSelectionIndex().clear();
+ getSelections().clear();
+ }
+
+ public void setComparator(DefaultTableComparator comparator) {
+ this.comparator = comparator;
+ }
+
+ public void setSortTypes(int[] types) {
+ sortTypes = types;
+ }
+
+ public void setSourceColumns(int[] columns) {
+ sourceColumns = columns;
+ }
+
+ public void deselectAll() {
+ getSelectionIndex().clear();
+ getSelections().clear();
+ table.deselectAll();
+ }
+
+ private int getScrollSelectionIndex(int selection) {
+ int size = table.getVerticalBar().getThumb() / 2;
+ int output = selection - size;
+
+ output = (output < 0) ? 0 : output;
+ return output;
+ }
+
+ public int searchString(FindProperty findProperty) {
+ GridItem[] items = table.getItems();
+ int size = items.length;
+ boolean next = !findProperty.isBackward();
+ int start = findProperty.getIndex();
+ setFindProferty(findProperty);
+
+ // forward
+ if (next) {
+ for (int i = start; i < size; i++) {
+ if (checkText(findProperty, items[i])) {
+ table.getVerticalBar().setSelection(
+ getScrollSelectionIndex(i));
+ table.setSelection(i);
+ updateTable();
+ return i;
+ }
+ }
+ // can't find
+ for (int i = 0; i < start; i++) {
+ if (checkText(findProperty, items[i])) {
+ table.getVerticalBar().setSelection(
+ getScrollSelectionIndex(i));
+ table.setSelection(i);
+ updateTable();
+ return i;
+ }
+ }
+ } else { // back
+ for (int i = start; i >= 0; i--) {
+ if (checkText(findProperty, items[i])) {
+ table.getVerticalBar().setSelection(
+ getScrollSelectionIndex(i));
+ table.setSelection(i);
+ updateTable();
+ return i;
+ }
+ }
+
+ for (int i = size - 1; i > start; i--) {
+ if (checkText(findProperty, items[i])) {
+ table.getVerticalBar().setSelection(
+ getScrollSelectionIndex(i));
+ table.setSelection(i);
+ updateTable();
+ return i;
+ }
+ }
+ }
+ table.deselectAll();
+ return -1;
+ }
+
+ private boolean checkText(FindProperty findProperty, GridItem items) {
+ GridColumn[] columns = table.getColumns();
+ int columnSize = columns.length;
+ String input = findProperty.getLastSearch();
+ boolean wholeWord = findProperty.isWholeWord();
+ boolean caseSensitive = findProperty.isCaseSensitive();
+
+ for (int ii = 0; ii < columnSize; ii++) {
+ String text = items.getText(ii);
+
+ if (!caseSensitive) {
+ text = text.toUpperCase();
+ input = input.toUpperCase();
+ }
+
+ if (!wholeWord) {
+ if (text.contains(input)) {
+ return true;
+ }
+ } else {
+ if (0 == input.compareTo(text)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public void setTableName(String name) {
+ tableName = name;
+ }
+
+ public String getTableName() {
+ return tableName;
+ }
+
+ public static FindProperty getFindProferty() {
+ if (null == findProferty) {
+ findProferty = new FindProperty();
+ }
+ return findProferty;
+ }
+
+ public static void setFindProferty(FindProperty findProferty) {
+ DATableComposite.findProferty = findProferty;
+ }
+
+ public void setRangePopup() {
+ popupMenu = new DAContextMenu(table);
+ DAContextMenuItem startItem = new DAContextMenuItem(popupMenu);
+ startItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_START);
+ startItem.addClickListener(new DAContextMenuListener() {
+ @Override
+ public void widgetSelected(DAContextMenuItem menuItem) {
+ GridItem item = table.getItem(mousePoint);
+ if (null != item) {
+ List<String> startData = ((DATableDataFormat) item
+ .getData()).getData();
+ String time = startData.get(LogCenterConstants.TIME_INDEX);
+ System.out.println("start time : " + time);
+ long startTime = -1;
+ try {
+ startTime = Long.parseLong(time);
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ return;
+ }
+ rangeDataManager.setStartTime(startTime);
+ }
+ }
+ });
+
+ DAContextMenuItem endItem = new DAContextMenuItem(popupMenu);
+ endItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_END);
+ endItem.addClickListener(new DAContextMenuListener() {
+
+ @Override
+ public void widgetSelected(DAContextMenuItem menuItem) {
+ GridItem item = table.getItem(mousePoint);
+ if (null != item) {
+ List<String> startData = ((DATableDataFormat) item
+ .getData()).getData();
+ String time = startData.get(LogCenterConstants.TIME_INDEX);
+ System.out.println("end time : " + time);
+ long endTime = -1;
+ try {
+ endTime = Long.parseLong(time);
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ return;
+ }
+ rangeDataManager.setEndTime(endTime);
+ }
+ }
+ });
+
+ DAContextMenuItem analysisItem = new DAContextMenuItem(popupMenu);
+ analysisItem.setText(TimelineChartLabels.RANGE_CONTEXT_ANALYSIS);
+ analysisItem.addClickListener(new DAContextMenuListener() {
+ @Override
+ public void widgetSelected(DAContextMenuItem menuItem) {
+ rangeDataManager.startRangeAnalysis();
+ }
+ });
+
+ DAContextMenuItem clearItem = new DAContextMenuItem(popupMenu);
+ clearItem.setText(TimelineChartLabels.RANGE_CONTEXT_CLEAR);
+ clearItem.addClickListener(new DAContextMenuListener() {
+ @Override
+ public void widgetSelected(DAContextMenuItem menuItem) {
+ rangeDataManager.initRange();
+ }
+ });
+
+ table.addListener(SWT.MouseUp, new Listener() {
+
+ @Override
+ public void handleEvent(Event event) {
+ if (event.button == 3)
+ {
+ List<DAContextMenuItem> menuItems = popupMenu.getItems();
+ int size = menuItems.size();
+ GridItem item = table.getItem(mousePoint);
+ long start = RangeDataManager.getInstance().getStartTime();
+ long end = RangeDataManager.getInstance().getEndTime();
+ for (int i = 0; i < size; i++) {
+ if (i == 0 || i == 1) {
+ if (null != item) {
+ if (!menuItems.get(i).isButtonEnabled()) {
+ menuItems.get(i).setEnabled(true);
+ }
+ } else {
+ if (menuItems.get(i).isButtonEnabled()) {
+ menuItems.get(i).setEnabled(false);
+ }
+ }
+ } else if (i == 2) {
+ if ((start >= 0 && end >= 0) && (start <= end)) {
+ menuItems.get(i).setEnabled(true);
+ } else {
+ menuItems.get(i).setEnabled(false);
+ }
+ } else if (i == 3) {
+ if (start >= 0 || end >= 0) {
+ menuItems.get(i).setEnabled(true);
+ } else {
+ menuItems.get(i).setEnabled(false);
+ }
+ }
+ }
+ }
+ }
+ });
+ }
+
+ public void setAutoColumnPackEnabled(boolean enabled) {
+ autoColumnPack = enabled;
+ }
+
+ public boolean isAutoColumnPackEnabled() {
+ return autoColumnPack;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.widgets.table;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class DATableDataFormat {
+ protected List<String> data = null;
+ protected Object obj = null;
+ protected String selectionKey = null;
+
+ public DATableDataFormat(String selectionKey) {
+ this.selectionKey = selectionKey;
+ }
+
+ public List<String> getData() {
+ if (null == data) {
+ data = new ArrayList<String>();
+ }
+ return data;
+ }
+
+ public Object getObject() {
+ return obj;
+ }
+
+ public void setObject(Object obj) {
+ this.obj = obj;
+ }
+
+ public String getSelectionKey() {
+ return selectionKey;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.widgets.table;
+
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.eclipse.nebula.widgets.grid.GridCellRenderer;
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+
+public class DATableEmptyCellRenderer extends GridCellRenderer {
+
+ public void paint(GC gc, Object value) {
+
+ Grid table = null;
+ if (value instanceof Grid)
+ table = (Grid) value;
+
+ GridItem item = null;
+ if (value instanceof GridItem) {
+ item = (GridItem) value;
+ table = item.getParent();
+ }
+
+ boolean drawBackground = true;
+
+ if (isSelected()) {
+ gc.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_START);
+ gc.setBackground(ColorResources.TABLE_CONTENTS_SELECTED_END);
+ } else {
+ if (table.isEnabled() && null != item) {
+ Color bg = item.getBackground();
+ if (bg != null) {
+ gc.setBackground(bg);
+ } else {
+ drawBackground = false;
+ }
+ } else {
+ gc.setBackground(getDisplay().getSystemColor(
+ SWT.COLOR_WIDGET_BACKGROUND));
+ }
+ gc.setForeground(table.getForeground());
+ }
+
+ if (drawBackground && isSelected()) {
+ gc.fillGradientRectangle(getBounds().x, getBounds().y + 1,
+ getBounds().width, getBounds().height, true);
+ } else if (drawBackground) {
+ gc.fillRectangle(getBounds().x, getBounds().y + 1,
+ getBounds().width, getBounds().height);
+ }
+
+ if (table.getLinesVisible()) {
+ if (isCellSelected()) {
+ gc.setForeground(ColorResources.TABLE_LINE);
+ } else {
+ gc.setForeground(ColorResources.TABLE_LINE);
+ }
+ gc.drawLine(getBounds().x, getBounds().y + getBounds().height,
+ getBounds().x + getBounds().width - 1, getBounds().y
+ + getBounds().height);
+ gc.drawLine(getBounds().x + getBounds().width - 1, getBounds().y,
+ getBounds().x + getBounds().width - 1, getBounds().y
+ + getBounds().height);
+ }
+
+ }
+
+ public Point computeSize(GC gc, int wHint, int hHint, Object value) {
+ return new Point(wHint, hHint);
+ }
+
+ public boolean notify(int event, Point point, Object value) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.widgets.table;
+
+import org.eclipse.nebula.widgets.grid.AbstractRenderer;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+
+
+public class DATableEmptyColumnHeaderRenderer extends AbstractRenderer {
+
+ public DATableEmptyColumnHeaderRenderer() {
+ super();
+ }
+
+ public Point computeSize(GC gc, int wHint, int hHint, Object value) {
+ return new Point(wHint, hHint);
+ }
+
+ public void paint(GC gc, Object value) {
+ gc.setBackground(ColorResources.TABLE_HEADER_BG);
+
+ Rectangle r = getBounds();
+ gc.fillRectangle(r.x, r.y, r.width, r.height);
+ gc.setForeground(ColorResources.TABLE_LINE);
+ gc.drawLine(r.x -1, r.y, r.x -1, r.y + r.height);
+ gc.drawLine(r.x -1, r.y + r.height, r.x + r.width, r.y + r.height);
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.widgets.table;
+
+import org.eclipse.nebula.widgets.grid.GridColumn;
+import org.eclipse.nebula.widgets.grid.internal.DefaultColumnHeaderRenderer;
+import org.eclipse.nebula.widgets.grid.internal.SortArrowRenderer;
+import org.eclipse.nebula.widgets.grid.internal.TextUtils;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Display;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+
+public class DATableHeaderRenderer extends DefaultColumnHeaderRenderer {
+
+ int leftMargin = 6;
+
+ int rightMargin = 6;
+
+ int topMargin = 3;
+
+ int bottomMargin = 3;
+
+ int arrowMargin = 6;
+
+ int imageSpacing = 3;
+
+ private SortArrowRenderer arrowRenderer = new SortArrowRenderer();
+
+ public void setDisplay(Display display) {
+ super.setDisplay(display);
+ arrowRenderer.setDisplay(display);
+ }
+
+ @Override
+ public void paint(GC gc, Object value) {
+ paint(gc, (GridColumn) value);
+ }
+
+ public void paint(GC gc, GridColumn column) {
+
+ boolean flat = (column.getParent().getCellSelectionEnabled() && !column
+ .getMoveable());
+
+ boolean drawSelected = ((isMouseDown() && isHover()));
+
+ // column bg color
+ gc.setBackground(ColorResources.TABLE_HEADER_BG);
+
+ if (flat && isSelected()) {
+ gc.setBackground(column.getParent()
+ .getCellHeaderSelectionBackground());
+ }
+
+ Rectangle r = getBounds();
+ gc.fillRectangle(r.x, r.y, r.width, r.height);
+ gc.setForeground(ColorResources.TABLE_LINE);
+ gc.drawLine(r.x - 1, r.y, r.x - 1, r.y + r.height);
+ gc.drawLine(r.x - 1, r.y + r.height, r.x + r.width, r.y + r.height);
+
+ int pushedDrawingOffset = 0;
+ if (drawSelected) {
+ pushedDrawingOffset = 1;
+ }
+
+ int x = leftMargin;
+
+ if (column.getImage() != null) {
+ gc.drawImage(column.getImage(), getBounds().x + x
+ + pushedDrawingOffset, getBounds().y + topMargin
+ + pushedDrawingOffset);
+ x += column.getImage().getBounds().width + imageSpacing;
+ }
+
+ int width = getBounds().width - x;
+
+ if (column.getSort() == SWT.NONE) {
+ width -= rightMargin;
+ } else {
+ width -= arrowMargin + arrowRenderer.getSize().x + arrowMargin;
+ }
+
+ // font color
+ gc.setForeground(ColorResources.TABLE_HEADER_FONT_COLOR);
+ gc.setFont(FontResources.TABLE_HEADER_FONT);
+ String inputText = TextUtils
+ .getShortString(gc, column.getText(), width);
+ Point textSize = gc.textExtent(inputText, SWT.DRAW_MNEMONIC);
+
+ int textX = r.x + (r.width - textSize.x) / 2;
+ int y = getBounds().y + (getBounds().height - textSize.y) / 2;
+
+ gc.drawString(TextUtils.getShortString(gc, column.getText(), width),
+ textX + pushedDrawingOffset, y + pushedDrawingOffset, true);
+
+ if (column.getSort() != SWT.NONE) {
+ arrowRenderer.setSelected(column.getSort() == SWT.UP);
+ if (drawSelected) {
+ arrowRenderer.setLocation(
+ getBounds().x + getBounds().width - arrowMargin
+ - arrowRenderer.getBounds().width + 1,
+ getBounds().y
+ + ((getBounds().height - arrowRenderer
+ .getBounds().height) / 2) + 1);
+ } else {
+ arrowRenderer.setLocation(
+ getBounds().x + getBounds().width - arrowMargin
+ - arrowRenderer.getBounds().width,
+ getBounds().y
+ + ((getBounds().height - arrowRenderer
+ .getBounds().height) / 2));
+ }
+ arrowRenderer.paint(gc, null);
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.widgets.table;
+
+import org.eclipse.nebula.widgets.grid.AbstractRenderer;
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+
+
+public class DATableToggleRenderer extends AbstractRenderer {
+
+ public DATableToggleRenderer() {
+ super();
+ setSize(11, 9);
+ }
+
+ public void paint(GC gc, Object value) {
+ GridItem item = (GridItem) value;
+ DATableDataFormat tableData = (DATableDataFormat) item.getData();
+
+ String text = ""; //$NON-NLS-1$
+ Font font = item.getFont(0);
+ if (null == font) {
+ gc.setFont(FontResources.TABLE_CELL_FONT);
+ } else {
+ gc.setFont(font);
+ }
+
+ String data = (String) tableData.getObject();
+ text += data;
+
+ if (item.hasChildren()) {
+ if (isExpanded()) {
+ Rectangle r = ImageResources.TREE_OPEN.getBounds();
+ int offset = (getBounds().width - r.width) / 2;
+ int x = getBounds().x + offset;
+ gc.drawImage(ImageResources.TREE_OPEN, x, getBounds().y);
+ x += r.width + 5;
+ if (isSelected()) {
+ gc.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_FONT_COLOR);
+ } else {
+ gc.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
+ }
+ gc.drawText(text, x, getBounds().y, true);
+ } else {
+ Rectangle r = ImageResources.TREE_FOLD.getBounds();
+ int offset = (getBounds().width - r.width) / 2;
+ int x = getBounds().x + offset;
+ gc.drawImage(ImageResources.TREE_FOLD, getBounds().x + offset, getBounds().y);
+ x += r.width + 5;
+ if (isSelected()) {
+ gc.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_FONT_COLOR);
+ } else {
+ gc.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
+ }
+ gc.drawText(text, x, getBounds().y, true);
+ }
+ } else {
+ Rectangle r = ImageResources.TREE_OPEN.getBounds();
+ int offset = (getBounds().width - r.width) / 2;
+ int x = getBounds().x + offset;
+ x += r.width;
+ if (isSelected()) {
+ gc.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_FONT_COLOR);
+ } else {
+ gc.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
+ }
+ gc.drawText(text, x, getBounds().y, true);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Point computeSize(GC gc, int wHint, int hHint, Object value) {
+ return new Point(11, 9);
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.widgets.table;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.model.TableInput;
+import org.tizen.dynamicanalyzer.model.TreeInput;
+
+public abstract class DATreeComposite extends DATableComposite {
+ // for selection control
+ List<String> selSeqs = null;
+ GridItem[] selections = null;
+ int[] sels = null;
+ int gridItemCount = -1;
+ int selIndex = 0;
+ int focusIndex = -1;
+
+ protected HashMap<Integer, Boolean> expandMap = null;
+ protected HashMap<String, GridItem> gridMap = null;
+
+ public DATreeComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ public DATreeComposite(Composite parent, int compStyle, int tableStyle) {
+ super(parent, compStyle, tableStyle);
+ }
+
+ private HashMap<Integer, Boolean> getExpandMap() {
+ if (null == expandMap) {
+ expandMap = new HashMap<Integer, Boolean>();
+ }
+ return expandMap;
+ }
+
+ public void setExpand(GridItem item, boolean expand) {
+ DATableDataFormat tableData = (DATableDataFormat) item.getData();
+ String seq = tableData.getSelectionKey();
+ int seqNum = Integer.parseInt(seq);
+ getExpandMap().remove(seqNum);
+ getExpandMap().put(seqNum, expand);
+ }
+
+ public HashMap<String, GridItem> getGridMap() {
+ if (null == gridMap) {
+ gridMap = new HashMap<String, GridItem>();
+ }
+ return gridMap;
+ }
+
+ private GridItem makeTreeItem(Object parent, TreeInput input) {
+ GridItem gridItem = null;
+ if (parent instanceof Grid) {
+ gridItem = new GridItem((Grid) parent, SWT.NONE);
+ } else if (parent instanceof GridItem) {
+ gridItem = new GridItem((GridItem) parent, SWT.NONE);
+ } else {
+ System.out.println("it is bug!! need debug - DATreeComposite makeTreeItem");//$NON-NLS-1$
+ }
+ // data
+ DATableDataFormat gridData = (DATableDataFormat) input.getData();
+ gridItem.setData(gridData);
+
+ // text
+ List<String> text = input.getText();
+ List<Image> images = input.getImages();
+ int size = text.size();
+ for (int i = 0; i < size; i++) {
+ gridItem.setText(i, text.get(i));
+
+ if (null != images && !images.isEmpty()) {
+ gridItem.setImage(i, images.get(i));
+ }
+ }
+
+ if (input.isInRange() && input.isSecondSelection()) {
+ gridItem.setBackground(intersectColor);
+ } else if (input.isSecondSelection()) {
+ gridItem.setBackground(secondSelectionColor);
+ } else if (input.isInRange()) {
+ gridItem.setBackground(rangeColor);
+ }
+
+ // check selection
+ gridItemCount++;
+ for (int ii = 0; ii < selSeqs.size(); ii++) {
+ if (gridData.getSelectionKey().equals(selSeqs.get(ii))) {
+ sels[selIndex++] = gridItemCount;
+ selSeqs.remove(ii);
+ }
+ }
+
+ if (null != focusSeq && gridData.getSelectionKey().equals(focusSeq)) {
+ focusIndex = gridItemCount;
+ }
+
+ // check expand
+ int seq = Integer.parseInt(gridData.getSelectionKey());
+ Object expand = getExpandMap().get(seq);
+ if (null == expand) {
+ expandMap.put(seq, true);
+ } else {
+ gridItem.setExpanded((Boolean) expand);
+ }
+ return gridItem;
+ }
+
+ // !! recursive
+ private void createTree(List<TreeInput> input, Object parent) {
+ if (null != comparator) {
+ Collections.sort(input, comparator);
+ }
+ int rootSize = input.size();
+ // -- loop?
+ for (int i = 0; i < rootSize; i++) {
+ TreeInput treeInput = input.get(i);
+ GridItem gridItem = makeTreeItem(parent, treeInput);
+ List<TreeInput> children = treeInput.getChildren();
+ if (!children.isEmpty()) {
+ createTree(children, gridItem);
+ }
+ }
+ }
+
+ @Override
+ public void updateTable() {
+ updateTree();
+ }
+
+ public void updateTree() {
+ selections = table.getSelection();
+ selSeqs = new ArrayList<String>();
+ for (int i = 0; i < selections.length; i++) {
+ DATableDataFormat tableData = (DATableDataFormat) selections[i]
+ .getData();
+ selSeqs.add(tableData.getSelectionKey());
+ }
+ table.removeAll();
+
+ List<TreeInput> input = makeTreeInput();
+
+ if (null == input) {
+ return;
+ }
+
+ sels = new int[selSeqs.size()];
+ gridItemCount = -1;
+ selIndex = 0;
+
+ createTree(input, table);
+
+ table.setSelection(sels);
+ if (table.isFocusControl() && focusIndex > 0) {
+ table.setFocusItem(table.getItem(focusIndex));
+ }
+ }
+
+ @Override
+ protected List<TableInput> makeTableInput() {
+ return null;
+ }
+
+ public abstract List<TreeInput> makeTreeInput();
+
+ @Override
+ public void clear() {
+ super.clear();
+ getExpandMap().clear();
+ getGridMap().clear();
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.widgets.table;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.eclipse.nebula.widgets.grid.GridColumn;
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.ScrollBar;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.listeners.TableTooltipListener;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.model.LogCenter;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.sql.SqlManager;
+import org.tizen.dynamicanalyzer.utils.Formatter;
+
+
+public class DAWindowingTableComposite extends Composite {
+
+ protected Grid table;
+ protected Composite scrollComp;
+ protected ScrollBar scrollbar;
+ private int itemCount = 0;
+ protected List<Integer> selectionIndex;
+ protected HashMap<String, String> selection;
+ protected int id = -1;
+ protected LogCenter logc;
+ private TableTooltipListener tableListener;
+ private boolean treeTable = false;
+
+ public DAWindowingTableComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ public DAWindowingTableComposite(Composite parent, int compStyle,
+ int tableStyle) {
+ super(parent, compStyle);
+ this.setLayout(new FillLayout());
+ this.setBackground(ColorResources.TABLE_CONTENTS_NORMAL);
+
+ scrollComp = new Composite(this, SWT.V_SCROLL);
+ scrollComp.setBackground(ColorResources.TABLE_CONTENTS_NORMAL);
+ scrollComp.setLayout(new FillLayout());
+
+ scrollbar = scrollComp.getVerticalBar();
+ scrollbar.setMaximum(100);
+ scrollbar.setMinimum(0);
+ scrollbar.setVisible(true);
+ scrollbar.addSelectionListener(scrollbarSelectionListener);
+
+ table = new Grid(scrollComp, tableStyle);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+ table.setLineColor(ColorResources.TABLE_LINE);
+ table.setBackground(ColorResources.TABLE_CONTENTS_NORMAL);
+ table.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
+ table.setFont(FontResources.TABLE_CELL_FONT);
+
+ table.setEmptyColumnHeaderRenderer(new DATableEmptyColumnHeaderRenderer());
+ table.setEmptyCellRenderer(new DATableEmptyCellRenderer());
+ setTableToolTipListener(tableListener);
+
+ table.setItemHeight(16);
+ // table.setItemHeight(AnalyzerUtil.getTableItemHeight(table));
+ table.addControlListener(new ControlListener() {
+
+ @Override
+ public void controlResized(ControlEvent e) {
+ itemCount = 0;
+ }
+
+ @Override
+ public void controlMoved(ControlEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+ });
+
+ table.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ GridItem[] ti = ((Grid) e.widget).getSelection();
+ if (null == ti || ti.length == 0) {
+ return;
+ }
+ int size = ti.length;
+ HashMap<String, String> sel = getSelections();
+ sel.clear();
+ for (int i = 0; i < size; i++) {
+ DATableDataFormat data = (DATableDataFormat) ti[i].getData();
+// String[] data = (String[]) ti[i].getData();
+// String seq = data[LogCenterConstants.SEQUENCE_NUMBER_INDEX];
+ String seq = data.getSelectionKey();
+ if (null != seq && !seq.isEmpty()) {
+ sel.put(seq, seq);
+ }
+ }
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+ });
+ }
+
+ public void setId(int logId) {
+ id = logId;
+ }
+
+ public void setTree(boolean tree) {
+ treeTable = tree;
+ }
+
+ public void setTableToolTipListener(TableTooltipListener tableListener) {
+ table.addListener(SWT.Dispose, tableListener);
+ table.addListener(SWT.KeyDown, tableListener);
+ table.addListener(SWT.KeyUp, tableListener);
+ table.addListener(SWT.MouseEnter, tableListener);
+ table.addListener(SWT.MouseExit, tableListener);
+ table.addListener(SWT.MouseMove, tableListener);
+ table.addListener(SWT.MouseHover, tableListener);
+ table.addListener(SWT.MouseDoubleClick, tableListener);
+ }
+
+ public void setColumns(String[] columnNames) {
+ int size = columnNames.length;
+ for (int i = 0; i < size; i++) {
+ GridColumn column = new GridColumn(table, SWT.NONE);
+ column.setText(columnNames[i]);
+ if (treeTable && i == 0) {
+ column.setTree(true);
+ }
+ column.setCellRenderer(new DATableCellRenderer());
+ column.setHeaderRenderer(new DATableHeaderRenderer());
+ column.pack();
+ }
+ }
+
+ public void setColumnVisibility(boolean[] columnVisibility) {
+ if (null == table || null == columnVisibility) {
+ return;
+ }
+
+ int size = columnVisibility.length;
+ GridColumn[] columns = table.getColumns();
+ if (size != columns.length) {
+ return;
+ }
+ for (int i = 0; i < size; i++) {
+ columns[i].setVisible(columnVisibility[i]);
+
+ }
+ }
+
+ public void setColumnSize(int[] columnSizes) {
+ if (null == table || null == columnSizes) {
+ return;
+ }
+
+ int size = columnSizes.length;
+ GridColumn[] columns = table.getColumns();
+ if (size != columns.length) {
+ return;
+ }
+
+ for (int i = 0; i < size; i++) {
+ if (columnSizes[i] == 0) {
+ columns[i].pack();
+ } else {
+ columns[i].setWidth(columnSizes[i]);
+ }
+ }
+ }
+
+ public Grid getTable() {
+ return table;
+ }
+
+ public ScrollBar getScrollBar() {
+ return scrollbar;
+ }
+
+ public void setSourceViewEnable(boolean enable) {
+
+ }
+
+ public void updateTable() {
+ LogCenter logc = AnalyzerManager.getLogCenterById(id);
+ if (null == logc) {
+ return;
+ }
+ List<Integer> order = logc.getColumnOrder();
+
+ int maxItemCount = logc.getDataSize();
+ int itemCount = getItemCount();
+ int count = (maxItemCount > itemCount) ? itemCount : maxItemCount;
+ table.setItemCount(count);
+
+ scrollbar.setMaximum(maxItemCount);
+ scrollbar.setThumb(itemCount);
+ int selection = scrollbar.getSelection();
+ int tableItemIndex = 0;
+ int tableRowSize = table.getItemCount();
+
+ List<List<String>> output = SqlManager.getInstance().selectRowId(logc, selection,
+ selection + itemCount + 1);
+ if (null == output) {
+ return;
+ }
+
+ if (null != output && !output.isEmpty()) {
+ getSelectionIndex().clear();
+ for (int i = 0; i < itemCount && tableItemIndex < tableRowSize; i++, tableItemIndex++) {
+ List<String> outputList = output.get(i);
+ int arraySize = outputList.size();
+
+ String[] inputText = new String[arraySize];
+ outputList.toArray(inputText);
+
+// String[] inputData = new String[arraySize];
+ List<String> inputData = new ArrayList<String>();
+ int size = outputList.size();
+ for (int ii = 0; ii < size; ii++) {
+ if (ii + 1 == size) {
+ inputData.add(outputList.get(0));
+ } else {
+ inputData.add(outputList.get(ii + 1));
+ }
+ }
+ DATableDataFormat tableData = new DATableDataFormat(inputData.get(LogCenterConstants.SEQUENCE_NUMBER_INDEX));
+ tableData.getData().addAll(inputData);
+ // outputList.toArray(inputData);
+
+ GridItem ti = table.getItem(tableItemIndex);
+ ti.setData(tableData);
+ Formatter.tableItemTimeFormatting(inputText);
+ String reorder[] = new String[inputText.length];
+
+ int columnCount = table.getColumnCount();
+ for (int index = 0; index < inputText.length
+ && index < columnCount; index++) {
+ reorder[index] = inputText[order.get(index)];
+ }
+ int inputSize = reorder.length;
+
+ for (int ii = 0; ii < inputSize && ii < columnCount; ii++) {
+ if (reorder[ii] == null) {
+ ti.setText(ii, ""); //$NON-NLS-1$
+ } else {
+ ti.setText(ii, reorder[ii]);
+ }
+ }
+
+ String seq = tableData.getSelectionKey();
+// String seq = inputData[LogCenterConstants.SEQUENCE_NUMBER_INDEX];
+ if (null != getSelections().get(seq)) {
+ getSelectionIndex().add(tableItemIndex);
+ }
+ }
+
+ if (!selectionIndex.isEmpty()) {
+ int[] sels = new int[selectionIndex.size()];
+ for (int i = 0; i < selectionIndex.size(); i++) {
+ sels[i] = selectionIndex.get(i);
+ }
+ table.setSelection(sels);
+ } else {
+ table.deselectAll();
+ }
+ }
+
+ }
+
+ public HashMap<String, String> getSelections() {
+ if (null == selection) {
+ selection = new HashMap<String, String>();
+ }
+ return selection;
+ }
+
+ public List<Integer> getSelectionIndex() {
+ if (null == selectionIndex) {
+ selectionIndex = new ArrayList<Integer>();
+ }
+ return selectionIndex;
+ }
+
+ public int getItemCount() {
+ if (0 == itemCount) {
+ Rectangle rect = table.getClientArea();
+ int itemHeight = table.getItemHeight();
+ itemCount = (rect.height - table.getHeaderHeight()) / itemHeight
+ - 1;
+ }
+ return itemCount;
+ }
+
+ private SelectionListener scrollbarSelectionListener = new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ updateTable();
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+ };
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.widgets.table;
+
+import java.util.Comparator;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.model.TableInput;
+
+public class DefaultTableComparator implements Comparator<Object> {
+
+ protected int type = AnalyzerConstants.SORT_TYPE_GRID;
+ protected int column = 0;
+ protected boolean dirUp = true;
+ protected int sourceColumn = 0;
+
+ public void setType(int type) {
+ this.type = type;
+ }
+
+ public void setColumn(int column) {
+ this.column = column;
+ }
+
+ public void setDirection(boolean dirUp) {
+ this.dirUp = dirUp;
+ }
+
+ public void reverseDirection() {
+ this.dirUp = !dirUp;
+ }
+
+ public void setSourceColumn(int i) {
+ sourceColumn = i;
+ }
+
+ @Override
+ public int compare(Object arg0, Object arg1) {
+ return userCompare(arg0, arg1);
+ }
+
+ protected int compareItem(TableInput item1, TableInput item2) {
+ String str1 = null;
+ String str2 = null;
+ int rc = 0;
+
+ if (type != AnalyzerConstants.SORT_TYPE_GRID) {
+ DATableDataFormat tableData1 = (DATableDataFormat) item1.getData();
+ DATableDataFormat tableData2 = (DATableDataFormat) item2.getData();
+
+ List<String> data1 = tableData1.getData();
+ List<String> data2 = tableData2.getData();
+
+ str1 = data1.get(sourceColumn);
+ str2 = data2.get(sourceColumn);
+ } else {
+ List<String> text1 = item1.getText();
+ List<String> text2 = item2.getText();
+
+ str1 = text1.get(column);
+ str2 = text2.get(column);
+ }
+
+ switch (type) {
+ case AnalyzerConstants.SORT_TYPE_NUM:
+ try {
+ rc = Integer.parseInt(str1) - Integer.parseInt(str2);
+ break;
+ } catch (NumberFormatException e) {
+ break;
+ }
+ case AnalyzerConstants.SORT_TYPE_STRING:
+ case AnalyzerConstants.SORT_TYPE_GRID:
+ rc = str1.compareTo(str2);
+ break;
+ default:
+ return rc;
+ }
+
+ if (!dirUp) {
+ rc = -rc;
+ }
+ return rc;
+ }
+
+ public int userCompare(Object obj1, Object obj2) {
+ TableInput input1 = (TableInput) obj1;
+ TableInput input2 = (TableInput) obj2;
+
+ return compareItem(input1, input2);
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.widgets.table;
+
+import org.eclipse.nebula.widgets.grid.GridColumn;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+
+public class TableColumnSizePackListener implements ControlListener {
+ DATableComposite tableComp = null;
+ private int[] defaultColumnSizes = null;
+
+ public TableColumnSizePackListener(DATableComposite table, int[] defaultSize) {
+ this.tableComp = table;
+ defaultColumnSizes = defaultSize;
+ }
+
+ @Override
+ public void controlMoved(ControlEvent e) {
+
+ }
+
+ @Override
+ public void controlResized(ControlEvent e) {
+ Composite contents = (Composite) e.widget;
+ Rectangle rect = contents.getClientArea();
+ int width = 0;
+ GridColumn[] columns = tableComp.getTable().getColumns();
+ int size = columns.length;
+ int[] columnSizes = new int[size];
+
+ for (int i = 0; i < size; i++) {
+ columnSizes[i] = columns[i].getWidth();
+ if (columns[i].isVisible()) {
+ width += columns[i].getWidth();
+ }
+ }
+
+ int index = -1;
+ for (int i = size - 1; i >= 0; i--) {
+ if (columns[i].isVisible()) {
+ index = i;
+ break;
+ }
+ }
+ if (index < 0) {
+ return;
+ }
+
+ if (rect.width - width > 0) {
+ columnSizes[index] += rect.width - width;
+ } else {
+ width = 0;
+ for (int i = 0; i < size; i++) {
+ if (columns[i].isVisible()) {
+ if (defaultColumnSizes[i] == 0) {
+ columns[i].pack();
+ width += columns[i].getWidth();
+ } else {
+ width += defaultColumnSizes[i];
+ }
+ }
+ }
+
+ int columnSize = 0;
+ if (defaultColumnSizes[index] == 0) {
+ columnSize = columns[index].getWidth();
+ } else {
+ columnSize = defaultColumnSizes[index];
+ }
+
+ if (rect.width - width > 0) {
+ columnSizes[index] = rect.width - width + columnSize;
+ } else {
+ columnSizes[index] = columnSize;
+ }
+ }
+ tableComp.setColumnSize(columnSizes);
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.widgets.table;
+
+import org.tizen.dynamicanalyzer.model.TreeInput;
+
+public class TreeDataComparator extends DefaultTableComparator {
+
+ @Override
+ public int userCompare(Object obj1, Object obj2) {
+ TreeInput item1 = (TreeInput) obj1;
+ TreeInput item2 = (TreeInput) obj2;
+
+ String parent1 = item1.getParent();
+ String parent2 = item2.getParent();
+
+ if ((null == parent1 && null != parent2)
+ || (null != parent1 && null == parent2)) {
+ return 0;
+ }
+
+ if (null != parent1 && null != parent2) {
+ if (!parent1.equals(parent2)) {
+ return 0;
+ }
+ }
+
+ return compareItem(item1, item2);
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.ui.widgets.table;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.eclipse.nebula.widgets.grid.GridColumn;
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.ScrollBar;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.model.LogCenter;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.sql.SqlManager;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.utils.Formatter;
+
+
+public class WindowingTable extends Composite {
+
+ protected Grid table = null;
+ protected Composite comp = null;
+ protected int itemCount = 0;
+ protected int type = 0;
+ protected List<Integer> columnSize;
+// private TableTooltipListener tableListener;
+ protected HashMap<String, String> selection;
+ protected List<Integer> selectionIndex;
+
+ public void clear() {
+ table.removeAll();
+ itemCount = 0;
+ comp.getVerticalBar().setThumb(0);
+ }
+
+ public WindowingTable(Composite parent, int style) {
+ super(parent, style);
+ // this.setBackground(ColorResources.TABLE_BG_COLOR);
+ GridLayout layout = new GridLayout();
+ layout.horizontalSpacing = 0;
+ layout.verticalSpacing = 0;
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ this.setLayout(layout);
+ this.setLayoutData(new GridData(GridData.FILL_BOTH));
+ // setColumnSize();
+ initBaseComposite();
+ initTable();
+ }
+
+ private void initBaseComposite() {
+ comp = new Composite(this, SWT.V_SCROLL);
+ comp.setBackground(ColorResources.WHITE);
+ comp.setLayoutData(new GridData(GridData.FILL_BOTH));
+ GridLayout baseLayout = new GridLayout();
+ baseLayout.marginWidth = 0;
+ baseLayout.marginHeight = 0;
+ comp.setLayout(baseLayout);
+ comp.setBackground(ColorResources.TABLE_CONTENTS_NORMAL);
+
+ final ScrollBar compositScrollBar = comp.getVerticalBar();
+ compositScrollBar.setMaximum(100);
+ compositScrollBar.setMinimum(0);
+ compositScrollBar.setVisible(true);
+ }
+
+ private void initTable() {
+ table = new Grid(comp, SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION
+ | SWT.H_SCROLL);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+ table.setLineColor(ColorResources.TABLE_LINE);
+ table.setEmptyColumnHeaderRenderer(new DATableEmptyColumnHeaderRenderer());
+ table.setEmptyCellRenderer(new DATableEmptyCellRenderer());
+ GridData gd = new GridData();
+ gd.horizontalAlignment = GridData.FILL;
+ gd.verticalAlignment = GridData.FILL;
+ gd.grabExcessHorizontalSpace = true;
+ gd.grabExcessVerticalSpace = true;
+ table.setLayoutData(gd);
+ table.setBackground(ColorResources.TABLE_CONTENTS_NORMAL);
+ table.setForeground(ColorResources.WHITE);
+ table.setFont(FontResources.TABLE_HEADER_FONT);
+ table.addSelectionListener(new SelectionListener() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ GridItem[] ti = ((Grid) e.widget).getSelection();
+ if (null == ti || ti.length == 0) {
+ return;
+ }
+ int size = ti.length;
+ HashMap<String, String> sel = getSelections();
+ sel.clear();
+ for (int i = 0; i < size; i++) {
+ String[] data = (String[]) ti[i].getData();
+ String seq = data[LogCenterConstants.SEQUENCE_NUMBER_INDEX + 1];
+ if (null != seq && !seq.isEmpty()) {
+ sel.put(seq, seq);
+ }
+ }
+
+ //FIXME not used
+// String[] data = (String[]) ti[0].getData();
+//
+// Long selUsec = Long
+// .parseLong(data[LogCenterConstants.TIME_INDEX + 1]);
+
+// Long selMsec = selUsec / TimelineConstants.TIME_US_TO_MS;
+// TimelineComposite timelineComposite = AnalyzerUtil
+// .getTimelineComposite();
+// if (null != timelineComposite) {
+// timelineComposite.setDownTimeSelection(selMsec, false);
+// }
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+
+ // Creates table listener.
+// tableListener = new TableTooltipListener(table, false);
+// // Adds table listener.
+// table.addListener(SWT.Dispose, tableListener);
+// table.addListener(SWT.KeyDown, tableListener);
+// table.addListener(SWT.KeyUp, tableListener);
+// table.addListener(SWT.MouseEnter, tableListener);
+// table.addListener(SWT.MouseExit, tableListener);
+// table.addListener(SWT.MouseMove, tableListener);
+// table.addListener(SWT.MouseHover, tableListener);
+// table.addListener(SWT.MouseDoubleClick, tableListener);
+
+ table.setItemHeight(AnalyzerUtil.getTableItemHeight(table));
+ }
+
+ private void setColumnSize(LogCenter logc) {
+ columnSize = new ArrayList<Integer>();
+ if (!logc.isCustomColumn()) {
+ columnSize.add(LogCenterConstants.COMMON_COLUMN_SIZE_RID);
+ columnSize.add(LogCenterConstants.COMMON_COLUMN_SIZE_ID);
+ columnSize.add(LogCenterConstants.COMMON_COLUMN_SIZE_SEQNUMBER);
+ columnSize.add(LogCenterConstants.COMMON_COLUMN_SIZE_APINAME);
+ columnSize.add(LogCenterConstants.COMMON_COLUMN_SIZE_TIME);
+ columnSize.add(LogCenterConstants.COMMON_COLUMN_SIZE_PID);
+ columnSize.add(LogCenterConstants.COMMON_COLUMN_SIZE_TID);
+ columnSize.add(LogCenterConstants.COMMON_COLUMN_SIZE_INPUTPARAM);
+ columnSize.add(LogCenterConstants.COMMON_COLUMN_SIZE_RETURN);
+ columnSize.add(LogCenterConstants.COMMON_COLUMN_SIZE_PCADDR);
+ columnSize.add(LogCenterConstants.COMMON_COLUMN_SIZE_ERROR);
+ } else {
+ columnSize.addAll(logc.getColumnSize());
+ }
+ }
+
+ public void setColumnSizes(int id) {
+ LogCenter logc = AnalyzerManager.getLogCenterById(id);
+ setColumnSize(logc);
+ if (null != logc) {
+ List<Integer> cols = logc.getColumnSize();
+ int size = logc.getTotalColumnCount() - columnSize.size();
+ int colsSize = cols.size();
+ for (int i = 0; i < size; i++) {
+ if (i >= colsSize) {
+ columnSize.add(0);
+ } else {
+ columnSize.add(cols.get(i));
+ }
+ }
+ }
+ }
+
+ public void setColumns(LogCenter logc) {
+ List<String> columnNames = logc.getTableColumnName();
+ List<Boolean> columnVisibility = logc.getColumnVisibility();
+ List<Integer> order = logc.getColumnOrder();
+ int size = columnNames.size();
+ int sSize = columnSize.size();
+ for (int i = 0; i < size; i++) {
+
+ GridColumn tableColumn = new GridColumn(table, SWT.NONE);
+ tableColumn.setText(columnNames.get(order.get(i)));
+ tableColumn.setCellRenderer(new DATableCellRenderer());
+ tableColumn.setHeaderRenderer(new DATableHeaderRenderer());
+ if (!columnVisibility.get(order.get(i))) {
+ tableColumn.setWidth(0);
+ } else if (i >= sSize || columnSize.get(order.get(i)) == 0) {
+ tableColumn.pack();
+ } else {
+ tableColumn.setWidth(columnSize.get(order.get(i)));
+ }
+ }
+ }
+
+ public void setItemCount(int count) {
+ itemCount = count;
+ }
+
+ public Grid getTable() {
+ return table;
+ }
+
+ public Composite getComposite() {
+ return comp;
+ }
+
+ public HashMap<String, String> getSelections() {
+ if (null == selection) {
+ selection = new HashMap<String, String>();
+ }
+ return selection;
+ }
+
+ public void setType(int t) {
+ type = t;
+ }
+
+ public int getType() {
+ return type;
+ }
+
+ public int getItemCount() {
+ if (0 == itemCount) {
+ Rectangle rect = table.getClientArea();
+ int itemHeight = table.getItemHeight();
+ itemCount = (rect.height - table.getHeaderHeight()) / itemHeight
+ - 1;
+ }
+ return itemCount;
+ }
+
+ public List<Integer> getSelectionIndex() {
+ if (null == selectionIndex) {
+ selectionIndex = new ArrayList<Integer>();
+ }
+ return selectionIndex;
+ }
+
+ public void reDrawLogTable() {
+ LogCenter logc = AnalyzerManager.getLogCenterById(getType());
+
+ if (null == logc) {
+ return;
+ }
+
+ List<Integer> order = logc.getColumnOrder();
+
+ if (0 == table.getColumnCount()) {
+ setColumns(logc);
+ }
+
+ ScrollBar compositeScrollBar = comp.getVerticalBar();
+ int itemCount = getItemCount();
+ int maxItemCount = logc.getDataSize();
+ if (maxItemCount > itemCount) {
+ table.setItemCount(itemCount);
+ } else {
+ table.setItemCount(maxItemCount);
+ }
+
+ compositeScrollBar.setMaximum(maxItemCount);
+ compositeScrollBar.setThumb(itemCount);
+ int selection = compositeScrollBar.getSelection();
+ int tableItemIndex = 0;
+ int tableRowSize = table.getItemCount();
+
+ if (null == AnalyzerManager.getProject()) {
+ return;
+ }
+
+ List<List<String>> output;
+ output = SqlManager.getInstance().selectRowId(logc, selection, selection + itemCount
+ + 1);
+ if (null != output && !output.isEmpty()) {
+ int size = output.size();
+ getSelectionIndex().clear();
+ for (int i = 0; i < size && tableItemIndex < tableRowSize; i++, tableItemIndex++) {
+ List<String> outputList = output.get(i);
+ int arraySize = outputList.size();
+ /* text */
+ String[] inputText = new String[arraySize];
+ outputList.toArray(inputText);
+
+ String[] inputData = new String[arraySize];
+ outputList.toArray(inputData);
+
+ GridItem ti = table.getItem(tableItemIndex);
+ ti.setData(inputData);
+ Formatter.tableItemTimeFormatting(inputText);
+ String reorder[] = new String[inputText.length];
+
+ for (int index = 0; index < inputText.length; index++) {
+ reorder[index] = inputText[order.get(index)];
+ }
+ int inputSize = reorder.length;
+ for (int ii = 0; ii < inputSize; ii++) {
+ ti.setText(ii, reorder[ii]);
+ }
+ // ti.setText(reorder);
+ String seq = inputData[LogCenterConstants.SEQUENCE_NUMBER_INDEX + 1];
+ if (null != getSelections().get(seq)) {
+ getSelectionIndex().add(tableItemIndex);
+ }
+ }
+ if (selectionIndex.size() != 0) {
+ int[] sels = new int[selectionIndex.size()];
+ for (int i = 0; i < selectionIndex.size(); i++) {
+ sels[i] = selectionIndex.get(i);
+ }
+ table.setSelection(sels);
+ } else {
+ table.deselectAll();
+ }
+ }
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Gun Kim <gune.kim@samsung.com>
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * JuYoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.uirecorder;
+
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.TransformerFactoryConfigurationError;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+public class RecorderXml {
+ private ArrayList<XmlData> recordDatas;
+ private ArrayList<XmlData> playDatas;
+
+ public static final String xmlFileName = "/uirecorder.xml"; //$NON-NLS-1$
+ static final String StrUIRecord = "UIRecord"; //$NON-NLS-1$
+ static final String StrTarget = "target"; //$NON-NLS-1$
+ static final String StrEventData = "eventData"; //$NON-NLS-1$
+ static final String StrEventType = "eventType"; //$NON-NLS-1$
+ static final String StrNodeName = "nodeName"; //$NON-NLS-1$
+ static final String StrTime = "time"; //$NON-NLS-1$
+ static final String StrInputEvent = "inputEvent"; //$NON-NLS-1$
+ static final String StrType = "type"; //$NON-NLS-1$
+ static final String StrCode = "code"; //$NON-NLS-1$
+ static final String StrValue = "value"; //$NON-NLS-1$
+ static final String TOKEN = " "; //$NON-NLS-1$
+
+ public RecorderXml() {
+ recordDatas = new ArrayList<XmlData>();
+ playDatas = new ArrayList<XmlData>();
+ }
+
+ public void createXml(String fileName) {
+ FileWriter fileWriter = null;
+ try {
+ DocumentBuilder builder = DocumentBuilderFactory.newInstance()
+ .newDocumentBuilder();
+ Document doc = builder.newDocument();
+ Transformer trans = TransformerFactory.newInstance()
+ .newTransformer();
+ trans.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
+ trans.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
+ trans.setOutputProperty(OutputKeys.ENCODING, "euc-kr"); //$NON-NLS-1$
+
+ Element uiRecord = doc.createElement(StrUIRecord);
+ doc.appendChild(uiRecord);
+
+ for (XmlData data : recordDatas) {
+ uiRecord.appendChild(createTopElement(data, doc));
+ }
+ recordDatas = new ArrayList<XmlData>();
+
+ fileWriter = new FileWriter(fileName + xmlFileName, false);
+ trans.transform(new DOMSource(doc), new StreamResult(fileWriter));
+ } catch (ParserConfigurationException e) {
+ e.printStackTrace();
+ } catch (TransformerConfigurationException e) {
+ e.printStackTrace();
+ } catch (TransformerFactoryConfigurationError e) {
+ System.out.println(e.getMessage());
+ } catch (TransformerException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ } finally {
+ AnalyzerUtil.tryClose(fileWriter);
+ }
+ }
+
+ public Element createTopElement(XmlData data, Document doc) {
+ Element eventData = doc.createElement(StrEventData);
+ Element eventType = doc.createElement(StrEventType);
+ eventType.setTextContent(data.eventType.toString());
+ eventData.appendChild(eventType);
+ Element nodeName = doc.createElement(StrNodeName);
+ nodeName.setTextContent(data.nodeName);
+ eventData.appendChild(nodeName);
+ Element time = doc.createElement(StrTime);
+ time.setTextContent(data.time);
+ eventData.appendChild(time);
+ Element type = doc.createElement(StrType);
+ type.setTextContent(data.event_type);
+ eventData.appendChild(type);
+ Element code = doc.createElement(StrCode);
+ code.setTextContent(data.event_code);
+ eventData.appendChild(code);
+ Element value = doc.createElement(StrValue);
+ value.setTextContent(data.event_value);
+ eventData.appendChild(value);
+
+ return eventData;
+ }
+
+ private XmlData getEventDataFromFile(NodeList nl) {
+ XmlData returnData = new XmlData();
+ int nodeListLength = nl.getLength();
+ Node node;
+ String nodeName = null;
+ String nodeValue = null;
+
+ for (int i = 0; i < nodeListLength; i++) {
+ node = nl.item(i);
+ nodeName = node.getNodeName();
+ nodeValue = node.getTextContent();
+
+ if (nodeName.equals(StrEventType)) {
+ returnData.eventType = nodeValue;
+ } else if (nodeName.equals(StrNodeName)) {
+ returnData.nodeName = nodeValue;
+ } else if (nodeName.equals(StrTime)) {
+ returnData.time = nodeValue;
+ } else if (nodeName.equals(StrType)) {
+ returnData.event_type = nodeValue;
+ } else if (nodeName.equals(StrCode)) {
+ returnData.event_code = nodeValue;
+ } else if (nodeName.equals(StrValue)) {
+ returnData.event_value = nodeValue;
+ }
+
+ }
+ return returnData;
+ }
+
+ public ArrayList<XmlData> getPlayDatas(String file) {
+ setPlayDatas(file);
+ return playDatas;
+ }
+
+ public XmlData setPlayDatas(String file) {
+ XmlData returnData = null;
+ String fileName = file;
+ DocumentBuilder builder = null;
+ Document doc = null;
+
+ try {
+ builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ doc = builder.parse(fileName);
+ } catch (ParserConfigurationException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (SAXException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ NodeList eventDatas = doc.getElementsByTagName(StrEventData);
+ Node eventData = null;
+ int eventDataLength = eventDatas.getLength();
+
+ for (int i = 0; i < eventDataLength; i++) {
+ eventData = eventDatas.item(i);
+ playDatas.add(getEventDataFromFile(eventData.getChildNodes()));
+ }
+ return returnData;
+ }
+
+ public XmlData setEvent(String line, long time) {
+ XmlData eventData = new XmlData();
+ String[] eventDatas = line.trim().split(TOKEN);
+
+ if (eventDatas.length < 7) {
+ return null;
+ }
+ eventData.eventType = eventDatas[0];
+ eventData.nodeName = eventDatas[1];
+ eventData.time = Long.toString(time);
+ eventData.event_type = eventDatas[4];
+ eventData.event_code = eventDatas[5];
+ eventData.event_value = eventDatas[6];
+
+ recordDatas.add(eventData);
+
+ return eventData;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Gun Kim <gune.kim@samsung.com>
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.uirecorder;
+
+import java.io.BufferedOutputStream;
+import java.io.PrintStream;
+import java.sql.Time;
+import java.util.ArrayList;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+
+public class UIRecorderPlayThread extends Thread {
+ String[] commands;
+ String command;
+ PrintStream pout;
+ Time startTime;
+ Process process = null;
+ Time stopTime;
+ long pauseTime;
+ private static UIRecorderPlayThread instance = null;
+ private String xmlFileName;
+
+ boolean end = false;
+
+ String fileName;
+
+ public UIRecorderPlayThread(Process process) {
+ this.process = process;
+ this.xmlFileName = null;
+ }
+
+ public static UIRecorderPlayThread getInstance() {
+ return instance;
+ }
+
+ public void setXmlFile(String file) {
+ xmlFileName = file;
+ }
+
+ public void run() {
+ long preTime = 0;
+ long nowTime = 0;
+ pauseTime = 0;
+ RecorderXml xml = new RecorderXml();
+ XmlData oldData = new XmlData();
+ oldData.event_code = CommonConstants.ZERO;
+ oldData.event_type = CommonConstants.ZERO;
+ oldData.event_value = CommonConstants.ZERO;
+ ArrayList<XmlData> playDatas = xml.getPlayDatas(xmlFileName);
+ BufferedOutputStream out;
+
+ startTime = new Time(System.currentTimeMillis());
+
+ out = new BufferedOutputStream(process.getOutputStream());
+
+ pout = new PrintStream(out, true);
+ for (XmlData data : playDatas) {
+ if (AnalyzerManager.isExit()) {
+ AnalyzerUtil.tryClose(pout);
+ return;
+ }
+ try {
+ nowTime = Long.parseLong(data.time);
+ sleep(nowTime - preTime);
+ } catch (NumberFormatException e1) {
+ e1.printStackTrace();
+ } catch (InterruptedException e1) {
+ e1.printStackTrace();
+ }
+
+ pout.println(new String(
+ data.eventType
+ + " " + data.event_type + " " + data.event_code + " " + data.event_value + " ")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+
+ oldData = data;
+ preTime = nowTime;
+ }
+ }
+
+ public void end() {
+ if (process != null) {
+ process.destroy();
+ process = null;
+ }
+ AnalyzerUtil.tryClose(pout);
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Gun Kim <gune.kim@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.uirecorder;
+
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.sql.Time;
+import java.util.ArrayList;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+
+public class UIRecorderRecordThread extends Thread {
+ String[] command;
+ BufferedInputStream in;
+ Time startTime;
+ Time stopTime;
+ ArrayList<XmlData> recordDatas;
+
+ boolean end = false;
+ Process process = null;
+
+ public UIRecorderRecordThread(Process process) {
+ this.process = process;
+ }
+
+ public void run() {
+ recordDatas = new ArrayList<XmlData>();
+ XmlData recordData = null;
+ RecorderXml xml = new RecorderXml();
+ ToolbarArea coolbarArea = ToolbarArea.getInstance();
+
+ startTime = new Time(System.currentTimeMillis());
+
+ in = new BufferedInputStream(process.getInputStream());
+
+ byte[] buf = new byte[1024];
+ String[] lines;
+ String strBuffer = new String();
+ int byteReads = 0;
+ try {
+ while ((byteReads = in.read(buf)) > 0) {
+ strBuffer += new String(buf, 0, byteReads);
+ if (strBuffer.length() - 1 != strBuffer.lastIndexOf("\n")) { //$NON-NLS-1$
+ continue;
+ }
+ lines = strBuffer.split("\n"); //$NON-NLS-1$
+ for (int i = 0; i < lines.length; i++) {
+ if (lines[i].isEmpty()
+ || lines[i]
+ .contains(AnalyzerConstants.TOOL_RECORDER_NAME)) {
+ continue;
+ }
+
+ recordData = xml.setEvent(lines[i],
+ coolbarArea.getTime() / 1000);
+ if (null != recordData) {
+ recordDatas.add(recordData);
+ if (recordData.event_type.equals("0") && recordData.event_code.equals("0") && recordData.event_value.equals("0")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ recordDatas = new ArrayList<XmlData>();
+ }
+ }
+ }
+ strBuffer = new String();
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ xml.createXml(AnalyzerManager.getProject().getSavePath());
+ end = true;
+ }
+
+ public void end() {
+ if (process != null) {
+ process.destroy();
+ process = null;
+ }
+ AnalyzerUtil.tryClose(in);
+ }
+
+ public boolean isEnd() {
+ return end;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Gun Kim <gune.kim@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.uirecorder;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.AnalyzerPaths;
+import org.tizen.dynamicanalyzer.common.AnalyzerShellCommands;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
+import org.tizen.sdblib.MultiLineReceiver;
+import org.tizen.sdblib.SyncService;
+import org.tizen.sdblib.SyncService.SyncResult;
+
+public class UIRecorderTool extends DACommunicator {
+ private static UIRecorderTool instance;
+ public static String RECORD_MODE = " -r"; //$NON-NLS-1$
+ public static String PLAY_MODE = " -s"; //$NON-NLS-1$
+ public static String PLAY_STATE = "play"; //$NON-NLS-1$
+ public static String RECORD_STATE = "record"; //$NON-NLS-1$
+ public static String STOP_STATE = "stop"; //$NON-NLS-1$
+ private UIRecorderRecordThread recordThread;
+ private UIRecorderPlayThread playThread;
+ private Boolean isReplay = false;
+ private String xmlFileStr = null;
+ private String executeResult = null;
+ private String state = STOP_STATE;
+
+ private UIRecorderTool() {
+ xmlFileStr = null;
+ state = STOP_STATE;
+ }
+
+ public static UIRecorderTool getInstance() {
+ if (instance == null) {
+ instance = new UIRecorderTool();
+ }
+ return instance;
+ }
+
+ public void setXmlPath(String str) {
+ xmlFileStr = str;
+ }
+
+ public void setReplayFlag(boolean flag) {
+ isReplay = flag;
+ }
+
+ public void startRecorder() {
+ Process runProcess = null;
+ if (isReplay) {
+ /* recored */
+ runProcess = execute(RECORD_MODE);
+ if (runProcess != null) {
+ recordThread = new UIRecorderRecordThread(runProcess);
+ recordThread.start();
+ }
+ /* play */
+ runProcess = execute(PLAY_MODE);
+ if (runProcess != null) {
+ playThread = new UIRecorderPlayThread(runProcess);
+ playThread.setXmlFile(xmlFileStr);
+ playThread.start();
+ }
+ isReplay = false;
+ } else {
+ /* play */
+ runProcess = execute(RECORD_MODE);
+ if (runProcess != null) {
+ recordThread = new UIRecorderRecordThread(runProcess);
+ recordThread.start();
+ }
+ }
+ }
+
+ public void stop() {
+ if (recordThread != null) {
+ recordThread.end();
+ recordThread = null;
+ }
+ if (playThread != null) {
+ playThread.end();
+ playThread = null;
+ }
+
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ public boolean upload(boolean overwrite) {
+ try {
+ if (overwrite == false) {
+ if (isToolExist() == true) {
+ return true;
+ } else {
+ uploadEventUtil();
+ }
+ } else {
+ uploadEventUtil();
+ }
+ } catch (IOException e) {
+ return false;
+ }
+ return true;
+ }
+
+ public Process execute(String mode) {
+
+ Process runProcess = null;
+
+ if (null == getSelectedDevice()) {
+ return null;
+ }
+
+ try {
+ addExecutePermission();
+ runProcess = execCommand(AnalyzerShellCommands.CMD_EXE_PERMISSION
+ + CommonConstants.SPACE
+ + AnalyzerPaths.TOOL_REMOTE_RECORDER_BINARY_PATH + " && "//$NON-NLS-1$
+ + AnalyzerPaths.TOOL_REMOTE_RECORDER_BINARY_PATH + mode);
+ // runProcess = currentDevice.executeShellCommand("top");
+ } catch (IOException e) {
+ return null;
+ }
+
+ return runProcess;
+ }
+
+ private void uploadEventUtil() throws IOException {
+ String recorderToolName = AnalyzerPaths.TARGET_PATH;
+ if (isCurrentDeviceArmArch()) {
+ recorderToolName += CommonConstants.ARM_ARCH;
+ } else {
+ recorderToolName += CommonConstants.X86_ARCH;
+ }
+
+ recorderToolName += File.separator
+ + AnalyzerConstants.TOOL_RECORDER_NAME;
+
+ SyncResult result = push(recorderToolName,
+ AnalyzerPaths.TOOL_REMOTE_RECORDER_BINARY_PATH);
+ if (null != result && SyncService.RESULT_OK == result.getCode()) {
+ addExecutePermission();
+ }
+ }
+
+ private void addExecutePermission() throws IOException {
+ execShellCommand(AnalyzerShellCommands.CMD_EXE_PERMISSION
+ + CommonConstants.SPACE
+ + AnalyzerPaths.TOOL_REMOTE_RECORDER_BINARY_PATH);
+ }
+
+ public boolean isToolExist() throws IOException {
+ execShellCommand(AnalyzerShellCommands.CMD_GET_LIST
+ + AnalyzerPaths.TOOL_REMOTE_RECORDER_BINARY_PATH,
+ new MultiLineReceiver() {
+ @Override
+ public void processNewLines(String[] lines) {
+ executeResult = lines[0];
+ }
+ });
+
+ if (executeResult.startsWith(AnalyzerShellCommands.CMD_NO_LIST)) {
+ return false;
+ }
+
+ if (executeResult
+ .equals(AnalyzerPaths.TOOL_REMOTE_RECORDER_BINARY_PATH)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Gun Kim <gune.kim@samsung.com>
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * JuYoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.uirecorder;
+
+public class XmlData {
+ public String eventType;
+ public String nodeName;
+ public String time;
+ public String event_type;
+ public String event_code;
+ public String event_value;
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.utils;
+
+import java.io.Closeable;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.NotEnabledException;
+import org.eclipse.core.commands.NotHandledException;
+import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.handlers.IHandlerService;
+import org.eclipse.ui.part.ViewPart;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.handlers.RealtimePerspectiveHandler;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackData;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit;
+import org.tizen.dynamicanalyzer.ui.page.BaseView;
+import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
+import org.tizen.dynamicanalyzer.ui.page.ViewAction;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineView;
+import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
+
+public class AnalyzerUtil {
+ private static IWorkbenchWindow window = null;
+ private static String recordState = RecordStateSourceProvider.RECORD_READY;
+ public static Color red, black, blue, white;
+ private static final int ENLARGED_LENGTH = 12;
+
+ // FIXME start
+ private static TimelineView timelineComposite;
+
+ public static TimelineView getTimelineComposite() {
+ return timelineComposite;
+ }
+
+ public static void setTimelineComposite(TimelineView timelineComposite) {
+ AnalyzerUtil.timelineComposite = timelineComposite;
+ }
+
+ // FIXME end
+
+ public static void copyFile(String srcPath, String destPath) {
+ File src = new File(srcPath);
+ File dest = new File(destPath);
+ FileInputStream fi = null;
+ FileOutputStream fo = null;
+ try {
+ fi = new FileInputStream(src);
+ fo = new FileOutputStream(dest);
+ byte[] buffer = new byte[1024];
+ int readCount = 0;
+ while ((readCount = fi.read(buffer)) != -1) {
+ fo.write(buffer, 0, readCount);
+ }
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ } finally {
+ tryClose(fi, fo);
+ }
+ }
+
+ public static String dotCutter(String input) {
+ if (null == input || input.isEmpty()) {
+ return null;
+ }
+ String[] split = input.split(CommonConstants.BSLASH
+ + CommonConstants.DOT);
+ return new String(split[0]);
+ }
+
+ public static Integer executeCommand(String commandId) {
+ IHandlerService handlerService = (IHandlerService) PlatformUI
+ .getWorkbench().getService(IHandlerService.class);
+ try {
+ return (Integer) handlerService.executeCommand(commandId,
+ new Event());
+ } catch (ExecutionException e) {
+ e.printStackTrace();
+ } catch (NotEnabledException e) {
+ e.printStackTrace();
+ } catch (NotHandledException e) {
+ e.printStackTrace();
+ } catch (NotDefinedException e) {
+ e.printStackTrace();
+ }
+ return -1;
+ }
+
+ public static List<String> getDirs(String path) {
+ File file = new File(path);
+ if (!file.isDirectory()) {
+ return null;
+ }
+ String[] fileList = file.list();
+ List<String> list = new ArrayList<String>();
+ int fileListLength = fileList.length;
+ for (int i = 0; i < fileListLength; i++) {
+ File dir = new File(path + File.separator + fileList[i]);
+ if (dir.isDirectory()) {
+ list.add(fileList[i]);
+ }
+ }
+
+ return list;
+ }
+
+ public static String getEnlargedText(String text) {
+ return getEnlargedText(text, ENLARGED_LENGTH);
+ }
+
+ public static String getEnlargedText(String text, int enlargedLength) {
+ StringBuilder str = new StringBuilder(CommonConstants.EMPTY);
+ int lengthOfBlank = enlargedLength - text.length();
+
+ boolean isEven = false;
+ if (0 == lengthOfBlank % 2) {
+ isEven = true;
+ } else {
+ isEven = false;
+ }
+
+ int size = lengthOfBlank / 2;
+ for (int i = 0; i < size; i++) {
+ str.append(CommonConstants.SPACE);
+ }
+
+ str.append(text);
+
+ if (isEven) {
+ for (int i = 0; i < size; i++) {
+ str.append(CommonConstants.SPACE);
+ }
+ } else {
+ for (int i = 0; i < size + 1; i++) {
+ str.append(CommonConstants.SPACE);
+ }
+ }
+
+ return str.toString();
+ }
+
+ public static List<String> getFiles(String path, String filterString) {
+ File file = new File(path);
+ if (!file.isDirectory()) {
+ return null;
+ }
+ String[] fileList = file.list();
+ List<String> list = new ArrayList<String>();
+ int fileListLength = fileList.length;
+ for (int i = 0; i < fileListLength; i++) {
+ if (fileList[i].endsWith(filterString)) {
+ list.add(fileList[i]);
+ }
+ }
+
+ return list;
+ }
+
+ private static String getOS() {
+ return System.getProperty(CommonConstants.OS_KEY).toLowerCase();
+ }
+
+ public static String getPerspectiveId() {
+ IWorkbenchWindow window = AnalyzerUtil.getWorkbenchWindow();
+ if (null != window) {
+ return window.getActivePage().getPerspective().getId();
+ }
+
+ return CommonConstants.EMPTY;
+ }
+
+ public static String getRecordState() {
+ return recordState;
+ }
+
+ public static ViewPart getViewPart(String id) {
+ IWorkbenchPage page = getWorkbenchWindow().getActivePage();
+
+ if (null == page) {
+ return null;
+ }
+
+ return (ViewPart) page.findView(id);
+ }
+
+ public static IWorkbenchWindow getWorkbenchWindow() {
+ if (null == window) {
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ window = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow();
+ }
+ });
+ }
+ return window;
+ }
+
+ public static boolean isLinux() {
+ return getOS().indexOf(CommonConstants.LINUX) >= 0;
+ }
+
+ public static boolean isMac() {
+ return getOS().indexOf(CommonConstants.MAC) >= 0;
+ }
+
+ public static boolean isRealtimePerspective() {
+ boolean retVal = getPerspectiveId().equals(
+ RealtimePerspectiveHandler.PERSPECTIVE_ID);
+ return retVal;
+ }
+
+ public static boolean isWin() {
+ return getOS().indexOf(CommonConstants.WIN) >= 0;
+ }
+
+ public static void saveTraceImage(String sourceFolderPath,
+ String targetFolderPath) {
+ List<String> imageFileList = AnalyzerUtil.getFiles(sourceFolderPath,
+ CommonConstants.EXTENSION_PNG_IMAGE);
+ if (null != imageFileList && 0 != imageFileList.size()) {
+ String srcName = null;
+ String destName = null;
+ int imageFileListSize = imageFileList.size();
+ for (int i = 0; i < imageFileListSize; i++) {
+ srcName = sourceFolderPath + File.separator
+ + imageFileList.get(i);
+ destName = targetFolderPath + File.separator
+ + imageFileList.get(i);
+ AnalyzerUtil.copyFile(srcName, destName);
+ }
+ }
+ }
+
+ public static void setFontSize(Label label, int size) {
+ Display display = PlatformUI.getWorkbench().getDisplay();
+ if (null == display || null == label) {
+ return;
+ }
+ FontData[] fd = label.getFont().getFontData();
+ for (int i = 0; i < fd.length; i++) {
+ fd[i].setHeight(size);
+ }
+ final Font newFont = new Font(display, fd);
+ label.setFont(newFont);
+ label.addDisposeListener(new DisposeListener() {
+ @Override
+ public void widgetDisposed(DisposeEvent e) {
+ newFont.dispose();
+ }
+ });
+ }
+
+ public static void setRecordState(final String state) {
+ recordState = state;
+ }
+
+ public static int getTableItemHeight(Grid table) {
+ GC gc = new GC(table);
+ gc.setFont(table.getFont());
+ return Math.max(0, gc.getFontMetrics().getHeight());
+ }
+
+ public static boolean isInternal(String[] input) {
+ if (AnalyzerConstants.CHECK_INTERNAL) {
+ try {
+ int flag = Integer
+ .parseInt(input[LogCenterConstants.INTERNAL_FLAG_INDEX]);
+ if (flag == LogCenterConstants.INTERNAL_CALL) {
+ return true;
+ } else {
+ return false;
+ }
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ public static boolean isInternal(List<String> input, boolean isDB) {
+ if (AnalyzerConstants.CHECK_INTERNAL) {
+ int index = LogCenterConstants.INTERNAL_FLAG_INDEX;
+ if (isDB) {
+ index++;
+ }
+ int flag = Integer.parseInt(input.get(index));
+ if (flag == LogCenterConstants.INTERNAL_CALL) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ public static String makeLongList2String(List<Long> input) {
+ if (null == input || input.isEmpty()) {
+ return null;
+ }
+
+ int size = input.size();
+ StringBuffer str = new StringBuffer();
+ for (int i = 0; i < size; i++) {
+ try {
+ str.append(input.get(i));
+ } catch (OutOfMemoryError e) {
+ e.printStackTrace();
+ }
+ if (i + 1 == size) {
+ break;
+ } else {
+ str.append(CommonConstants.SLASH);
+ }
+ }
+ return str.toString();
+ }
+
+ public static String makeStringList2String(List<String> input) {
+ if (null == input || input.isEmpty()) {
+ return null;
+ }
+
+ int size = input.size();
+ StringBuffer str = new StringBuffer();
+ for (int i = 0; i < size; i++) {
+ str.append(input.get(i));
+ if (i + 1 == size) {
+ break;
+ } else {
+ str.append(CommonConstants.SLASH);
+ }
+ }
+ return str.toString();
+ }
+
+ public static int checkUserCall(String[] input) {
+ String internalCall = input[LogCenterConstants.LOG_USER_FUNCTION];
+ if (null != internalCall && !internalCall.isEmpty()) {
+ int internalValue = Integer.parseInt(internalCall);
+
+ if (internalValue == AnalyzerConstants.USER_CALL) {
+ return AnalyzerConstants.USER_CALL;
+ } else if (internalValue == AnalyzerConstants.INTERNAL_CALL) {
+ return AnalyzerConstants.INTERNAL_CALL;
+ }
+ }
+
+ HashMap<Integer, CallStackData> cdMap = CallStackManager.getInstance()
+ .getCallStackDataBySeqMap();
+ HashMap<Long, CallStackUnit> addrMap = CallStackManager.getInstance()
+ .getCallStackApiByAddrMap();
+
+ if (null == cdMap || null == addrMap) {
+ return AnalyzerConstants.USER_CALL_CHECK_ERROR;
+ }
+ int seqNum = Integer
+ .parseInt(input[LogCenterConstants.SEQUENCE_NUMBER_INDEX]);
+ CallStackData csd = cdMap.get(seqNum);
+ List<Long> addrs = csd.getAddrs();
+ if (addrs.isEmpty() || addrs.size() < 3) {
+ // FIXME
+ return AnalyzerConstants.USER_CALL_CHECK_ERROR;
+ }
+
+ String funcName = addrMap.get(addrs.get(0)).getFunctionName();
+ if (CallStackManager.getInstance().checkUserCall(funcName)) {
+ return AnalyzerConstants.USER_CALL;
+ }
+ return AnalyzerConstants.INTERNAL_CALL;
+ }
+
+ public static boolean deleteFile(File file) {
+ if (file.isDirectory()) {
+ String[] children = file.list();
+ for (int i = 0; i < children.length; i++) {
+ boolean success = deleteFile(new File(file, children[i]));
+ if (!success) {
+ return false;
+ }
+ }
+ }
+ // Directory is empty so delete
+ return file.delete();
+ }
+
+ // use : no title bar window
+ public static void setCenter(Shell shell) {
+ Shell parent = shell.getParent().getShell();
+
+ Rectangle pRect = parent.getBounds();
+ Rectangle pChild = shell.getBounds();
+
+ int deltaX = pRect.width - pChild.width;
+ int deltaY = pRect.height - pChild.height;
+
+ int childX = pRect.x + deltaX / 2;
+ int childY = pRect.y + deltaY / 2;
+
+ shell.setLocation(childX, childY);
+ }
+
+ /** stop trace -> change page to summary **/
+ public static void changePage(final String pageId) {
+ final BaseView baseView = (BaseView) AnalyzerUtil
+ .getViewPart(BaseView.ID);
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ DATabComposite tabView = baseView.getMainTab();
+ tabView.setSelectTab(pageId);
+ }
+ });
+ }
+
+ public static Composite getTabPage(String pageId) {
+ return getMainTab().getTab(pageId);
+ }
+
+ public static DATabComposite getMainTab() {
+ BaseView baseView = (BaseView) AnalyzerUtil.getViewPart(BaseView.ID);
+ return baseView.getMainTab();
+ }
+
+ public static ViewAction getView(String pageId, String viewId) {
+ DAPageComposite page = (DAPageComposite) getTabPage(pageId);
+ return page.getView(viewId);
+ }
+
+ public static void tryClose(final Object... closeables) {
+ if (null == closeables) {
+ return;
+ }
+
+ for (Object obj : closeables) {
+ if (null == obj) {
+ continue;
+ }
+ try {
+ if (obj instanceof Closeable) {
+ ((Closeable) obj).close();
+ } else if (obj instanceof Socket) {
+ ((Socket) obj).close();
+ } else if (obj instanceof ServerSocket) {
+ ((ServerSocket) obj).close();
+ }
+ } catch (final IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.utils;
+
+import java.util.Comparator;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+
+
+public class DefaultComparator implements Comparator<List<String>> {
+
+ @Override
+ public int compare(List<String> arg0, List<String> arg1) {
+ String one = arg0.get(LogCenterConstants.SEQUENCE_NUMBER_INDEX);
+ String two = arg1.get(LogCenterConstants.SEQUENCE_NUMBER_INDEX);
+ int intOne = Integer.parseInt(one);
+ int intTwo = Integer.parseInt(two);
+
+ if (intOne > intTwo) {
+ return 1;
+ } else if (intOne < intTwo) {
+ return -1;
+ }
+
+ return 0;
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.utils;
+
+import java.io.File;
+import java.io.FilenameFilter;
+
+public class ExtensionFilter implements FilenameFilter {
+
+ private String extension;
+
+ public ExtensionFilter(String extension) {
+ this.extension = extension;
+ }
+
+ @Override
+ public boolean accept(File dir, String name) {
+ return name.endsWith(extension);
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.utils;
+
+import java.text.DecimalFormat;
+
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
+
+public class Formatter {
+
+ public static String toHexString(String decimal) {
+ if (null == decimal || decimal.isEmpty()) {
+ return null;
+ }
+
+ try {
+ if (decimal.isEmpty()) {
+ return null;
+ } else {
+ long data = 0;
+ data = Long.parseLong(decimal);
+ return String.format("0x%08X", data); //$NON-NLS-1$
+ }
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ return decimal;
+ }
+ }
+
+ public static String toDoubleFormat1(String value) {
+ if (null == value || value.isEmpty()) {
+ return null;
+ }
+
+ try {
+ double data = Double.parseDouble(value);
+ return String.format("%.1f", data); //$NON-NLS-1$
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ return value;
+ }
+ }
+
+ public static String toByteToMbNumberFormat2(String value) {
+ if (null == value || value.isEmpty()) {
+ return null;
+ }
+ try {
+ long num = Long.parseLong(value);
+ num /= 1024; // KB
+ double kb = num / 1024.;
+
+ String str = Formatter.toDoubleFormat2(Double.toString(kb));
+ return str;
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ return "0"; //$NON-NLS-1$
+ }
+ }
+
+ public static String toDoubleFormat2(String value) {
+ if (null == value || value.isEmpty()) {
+ return null;
+ }
+
+ try {
+ double data = Double.parseDouble(value);
+ return String.format("%.2f", data); //$NON-NLS-1$
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ return value;
+ }
+ }
+
+ public static void tableItemTimeFormatting(String[] input) {
+ String time = input[LogCenterConstants.TIME_INDEX + 1];
+ String output = toTimeFormat(time);
+ input[LogCenterConstants.TIME_INDEX + 1] = output;
+ }
+
+ public static String toTimeFormat(String time) {
+ long longTime = Long.parseLong(time);
+ longTime /= 1000;
+ long ms = longTime % 1000;
+ longTime /= 1000;
+ long second = longTime % 60;
+ longTime /= 60;
+ long minute = longTime % 60;
+ String strMinute = Long.toString(minute);
+ if (strMinute.length() < 2) {
+ strMinute = "0" + strMinute; //$NON-NLS-1$
+ }
+
+ String strSecond = Long.toString(second);
+ if (strSecond.length() < 2) {
+ strSecond = "0" + strSecond; //$NON-NLS-1$
+ }
+
+ String strMs = Long.toString(ms);
+ if (strMs.length() == 2) {
+ strMs = "0" + strMs; //$NON-NLS-1$
+ } else if (strMs.length() == 1) {
+ strMs = "00" + strMs; //$NON-NLS-1$
+ }
+
+ String output = strMinute + ":" + strSecond + "." + strMs; //$NON-NLS-1$ //$NON-NLS-2$
+ return output;
+ }
+
+ public static String toTimeFormat2(String msTime) {
+ long longTime = Long.parseLong(msTime);
+ long ms = longTime % 1000;
+ longTime /= 1000;
+ long second = longTime % 60;
+
+ String strSecond = Long.toString(second);
+ if (strSecond.length() < 2) {
+ strSecond = "0" + strSecond; //$NON-NLS-1$
+ }
+
+ String strMs = Long.toString(ms);
+ if (strMs.length() == 2) {
+ strMs = "0" + strMs; //$NON-NLS-1$
+ } else if (strMs.length() == 1) {
+ strMs = "00" + strMs; //$NON-NLS-1$
+ }
+
+ String output = strSecond + "." + strMs; //$NON-NLS-1$
+ return output;
+ }
+
+ public static String toTimeFormat3(String time) {
+ long longTime = Long.parseLong(time);
+ longTime /= 1000000;
+ long second = longTime % 60;
+ longTime /= 60;
+ long minute = longTime % 60;
+ String strMinute = Long.toString(minute);
+ if (strMinute.length() < 2) {
+ strMinute = "0" + strMinute; //$NON-NLS-1$
+ }
+
+ String strSecond = Long.toString(second);
+ if (strSecond.length() < 2) {
+ strSecond = "0" + strSecond; //$NON-NLS-1$
+ }
+
+ String output = strMinute + ":" + strSecond; //$NON-NLS-1$ //$NON-NLS-2$
+ return output;
+ }
+
+ public static String toPercentageFormat(Double input) {
+ String ret = String.format("%.2f", input); //$NON-NLS-1$
+ ret += " %"; //$NON-NLS-1$
+ return ret;
+ }
+
+ public static String toDoubleFormat(Double input){
+ return String.format("%.2f", input); //$NON-NLS-1$
+ }
+
+ // 1000 to 1,000
+ public static String toNumberFormat(long input) {
+ int reminder = 0;
+ long quotient = input;
+ String output = ""; //$NON-NLS-1$
+
+ while (true) {
+ reminder = (int) (quotient % 1000);
+ quotient = quotient / 1000;
+ String value = Integer.toString(reminder);
+ if (quotient > 0) {
+ if (value.length() < 2) {
+ value = "00" + value; //$NON-NLS-1$
+ } else if (value.length() < 3) {
+ value = "0" + value; //$NON-NLS-1$
+ }
+ output = value + output;
+ output = "," + output; //$NON-NLS-1$
+ } else {
+ output = value + output;
+ break;
+ }
+ }
+ return output;
+ }
+
+ public static String toNumberFormat(double input) {
+ return toNumberFormat((long) input);
+ }
+
+ public static String toByteFormat(long input) {
+ int reminder = 0;
+ long quotient = input;
+ int count = 0;
+ String value = ""; //$NON-NLS-1$
+
+ while (true) {
+ if (quotient >= 1024) {
+ reminder = (int) (quotient % 1024);
+ quotient = quotient / 1024;
+ count++;
+ continue;
+ } else {
+ value = Long.toString(quotient);
+ String remStr = Integer.toString(reminder);
+ if (count > 0) {
+ if (remStr.length() < 3) {
+ value += ".0"; //$NON-NLS-1$
+ } else {
+ value += "." + remStr.substring(0, 1); //$NON-NLS-1$
+ }
+ }
+ value += " " + getMeasure(count); //$NON-NLS-1$
+ break;
+ }
+ }
+ return value;
+ }
+
+ public static String toByteFormat(double input) {
+ return toByteFormat((long) input);
+ }
+
+ public static String toHzFormat(long input) {
+ int reminder = 0;
+ long quotient = input;
+ int count = 0;
+ String value = ""; //$NON-NLS-1$
+
+ while (true) {
+ if (quotient >= 1024) {
+ reminder = (int) (quotient % 1024);
+ quotient = quotient / 1024;
+ count++;
+ continue;
+ } else {
+ value = Long.toString(quotient);
+ String remStr = Integer.toString(reminder);
+ if (count > 0) {
+ if (remStr.length() < 3) {
+ value += ".0"; //$NON-NLS-1$
+ } else {
+ value += "." + remStr.substring(0, 1); //$NON-NLS-1$
+ }
+ }
+ value += " " + getHzMeasure(count); //$NON-NLS-1$
+ break;
+ }
+ }
+ return value;
+ }
+
+ public static String toHzFormat(double input) {
+ return toHzFormat((long) input);
+ }
+
+ public static String toBpsFormat(long nByte, long startTime, long endTime) {
+ String value = ""; //$NON-NLS-1$
+ DecimalFormat df1 = new DecimalFormat("#,##0.00"); //$NON-NLS-1$
+ double Bps = nByte;
+
+ if (endTime - startTime >= 1000000) {
+ Bps = ((double) nByte * ((double) 1000000 / (double) (endTime - startTime)));
+ }
+
+ value += df1.format(Bps) + " Bps"; //$NON-NLS-1$
+ return value;
+ }
+
+ public static String toBpsFormat(double nByte, long startTime, long endTime) {
+ return toBpsFormat((long) nByte, startTime, endTime);
+ }
+
+ private static String getMeasure(int count) {
+ if (count == 4) {
+ return "TB"; //$NON-NLS-1$
+ } else if (count == 3) {
+ return "GB"; //$NON-NLS-1$
+ } else if (count == 2) {
+ return "MB"; //$NON-NLS-1$
+ } else if (count == 1) {
+ return "KB"; //$NON-NLS-1$
+ } else {
+ return "Byte"; //$NON-NLS-1$
+ }
+ }
+
+ private static String getHzMeasure(int count) {
+ if (count == 4) {
+ return "THz"; //$NON-NLS-1$
+ } else if (count == 3) {
+ return "GHz"; //$NON-NLS-1$
+ } else if (count == 2) {
+ return "MHz"; //$NON-NLS-1$
+ } else if (count == 1) {
+ return "KHz"; //$NON-NLS-1$
+ } else {
+ return "Hz"; //$NON-NLS-1$
+ }
+ }
+
+ // only return value
+ public static String toByteFormatValue(long input) {
+ int reminder = 0;
+ long quotient = input;
+ int count = 0;
+ String value = ""; //$NON-NLS-1$
+
+ while (true) {
+ if (quotient >= 1024) {
+ reminder = (int) (quotient % 1024);
+ quotient = quotient / 1024;
+ count++;
+ continue;
+ } else {
+ value = Long.toString(quotient);
+ String remStr = Integer.toString(reminder);
+ if (count > 0) {
+ if (remStr.length() < 3) {
+ value += ".0"; //$NON-NLS-1$
+ } else {
+ value += "." + remStr.substring(0, 1); //$NON-NLS-1$
+ }
+ }
+ // value += " " + getMeasure(count); //$NON-NLS-1$
+ break;
+ }
+ }
+ return value;
+ }
+
+ // only return measure
+ public static String toByteFormatMeasure(long input) {
+ long quotient = input;
+ int count = 0;
+ String value = null;
+
+ while (true) {
+ if (quotient >= 1024) {
+ quotient = quotient / 1024;
+ count++;
+ continue;
+ } else {
+ value = getMeasure(count); //$NON-NLS-1$
+ break;
+ }
+ }
+ return value;
+ }
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.utils;
+
+import java.util.Comparator;
+
+import org.tizen.dynamicanalyzer.model.ImageInfo;
+
+
+public class ImageListSortComparator implements Comparator<ImageInfo> {
+
+ @Override
+ public int compare(ImageInfo one, ImageInfo two) {
+ long time1 = Long.parseLong(one.getTime());
+ long time2 = Long.parseLong(two.getTime());
+
+ if (time1 > time2) {
+ return 1;
+ } else if (time1 < time2) {
+ return -1;
+ }
+
+ return 0;
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.utils;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+
+import javax.imageio.ImageIO;
+
+public class ImageUtil {
+
+ public static void resize(String originFilePath, String newFilePath,
+ int width, int height) {
+ resize(originFilePath, newFilePath, width, height, null);
+ }
+
+ public static void resize(String originFilePath, String newFilePath,
+ int width, int height, Color color) {
+ BufferedImage bufferedImage = null;
+ BufferedImage targetBufferedImage = null;
+
+ File image = new File(originFilePath);
+ File destImage = new File(newFilePath);
+
+ try {
+ bufferedImage = ImageIO.read(image);
+
+ if (null == bufferedImage) {
+ return;
+ }
+ bufferedImage.getGraphics();
+
+ Image scaledImage = bufferedImage.getScaledInstance(width, height,
+ Image.SCALE_DEFAULT);
+
+ targetBufferedImage = new BufferedImage(width, height,
+ BufferedImage.TYPE_INT_RGB);
+ Graphics g = targetBufferedImage.getGraphics();
+ g.drawImage(scaledImage, 0, 0, null);
+
+ // color is outline
+ if (null != color) {
+ g.setColor(color);
+ g.drawLine(0, 0, 0, 49);
+ g.drawLine(0, 0, 49, 0);
+ g.drawLine(49, 0, 49, 49);
+ g.drawLine(0, 49, 49, 49);
+ }
+ g.dispose();
+
+ ImageIO.write(targetBufferedImage, "PNG", destImage); //$NON-NLS-1$
+ } catch (IOException io) {
+ io.printStackTrace();
+ }
+ }
+
+ public static void transform(String originFilePath, String newFilePath,
+ int width, int height, int angle) {
+ BufferedImage bufferedImage = null;
+ BufferedImage targetBufferedImage = null;
+
+ File image = new File(originFilePath);
+ File destImage = new File(newFilePath);
+
+ try {
+ bufferedImage = ImageIO.read(image);
+ if (null == bufferedImage) {
+ return;
+ }
+ bufferedImage.getGraphics();
+
+ Image scaledImage = bufferedImage.getScaledInstance(width, height,
+ Image.SCALE_DEFAULT);
+
+ targetBufferedImage = new BufferedImage(width, height,
+ BufferedImage.TYPE_INT_RGB);
+ Graphics g = targetBufferedImage.getGraphics();
+ g.drawImage(scaledImage, 0, 0, null);
+ g.dispose();
+
+ BufferedImage outputBufferedImage = targetBufferedImage;
+ if (angle == 90) {
+ outputBufferedImage = rotateRight(targetBufferedImage);
+ } else if (angle == 270) {
+ outputBufferedImage = rotateLeft(targetBufferedImage);
+ } else if (angle == 180) {
+ outputBufferedImage = rotateRight(targetBufferedImage);
+ outputBufferedImage = rotateRight(outputBufferedImage);
+ }
+ ImageIO.write(outputBufferedImage, "PNG", destImage); //$NON-NLS-1$
+ } catch (IOException io) {
+ io.printStackTrace();
+ }
+ }
+
+ // FIXME : refactoring
+ public static BufferedImage rotateRight(BufferedImage input) {
+ int width = input.getWidth();
+ int height = input.getHeight();
+ BufferedImage output = new BufferedImage(height, width, input.getType());
+ for (int i = 0; i < width; i++) {
+ for (int ii = 0; ii < height; ii++) {
+ output.setRGB(height - ii - 1, i, input.getRGB(i, ii));
+ }
+ }
+ return output;
+ }
+
+ public static BufferedImage rotateLeft(BufferedImage input) {
+ int width = input.getWidth();
+ int height = input.getHeight();
+ BufferedImage output = new BufferedImage(height, width, input.getType());
+ for (int i = 0; i < width; i++) {
+ for (int ii = 0; ii < height; ii++) {
+ output.setRGB(ii, width - i - 1, input.getRGB(i, ii));
+ }
+ }
+ return output;
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.utils;
+
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.logparser.Logs;
+import org.tizen.dynamicanalyzer.model.LogCenter;
+
+
+public class LogParsingTest {
+
+ public void postUpdateLog(LogPackage logPack) {
+
+ List<LogCenter> logcs = AnalyzerManager.getLogCenters();
+ int size = logcs.size();
+ for (int index = 0; index < size; index++)
+ {
+ Logs log1 = logPack.getLogs(logcs.get(index).getId());
+
+ if (log1 == null)
+ {
+ continue;
+ }
+ int size1 = log1.getLogs().size();
+ int size2 = logcs.get(index).getTotalColumnCount();
+ StringBuffer sb = new StringBuffer();
+ try {
+ for (int i = 0; i < size1; i++) {
+ List<String> str = log1.getLogs().get(i);
+ for (int j = 0; j < size2; j++) {
+ sb.append("|" + str.get(j)); //$NON-NLS-1$
+ }
+ System.out.println(sb.toString());
+ sb.delete(0, sb.length());
+ }
+ } catch (ArrayIndexOutOfBoundsException e) {
+ System.out.println("exception :" + sb.toString()); //$NON-NLS-1$
+ e.printStackTrace();
+ }
+ System.out.println();
+ }
+ }
+
+}
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.dynamicanalyzer.utils;
+
+import java.util.Timer;
+
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.ui.toolbar.UpdateTimerTask;
+
+public class UpdateViewTimer {
+
+ private static Timer timer = null;
+ private static boolean bOpentrace = false;
+ private static boolean bStartRecord = false;
+
+ public static boolean isNewProject() {
+ return bStartRecord;
+ }
+
+ public static boolean isTrace() {
+ return bOpentrace;
+ }
+
+ public static void setOpenTraceState(boolean state) {
+ bOpentrace = state;
+ }
+
+ public static void setStartRecordState(boolean state) {
+ bStartRecord = state;
+ }
+
+ public static void start() {
+ if (null != timer) {
+ timer.cancel();
+ timer = null;
+ }
+ timer = new Timer();
+ timer.schedule(new UpdateTimerTask(),
+ AnalyzerConstants.TIMER_START_TIME_DEFAULT,
+ AnalyzerConstants.TIMER_INTERVAL_DEFAULT);
+ }
+
+ public static void stop() {
+ if (null != timer) {
+ timer.cancel();
+ timer = null;
+ System.out.println("update timer stop"); //$NON-NLS-1$
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Dynamic Analyzer
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jooyoul Lee <jy.exe.lee@samsung.com>
+ * Juyoung Kim <j0.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.dynamicanalyzer.utils;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+
+public class XMLManager {
+ private static final String DATA_MODEL_NAME_SPACE = "org.tizen.dynamicanalyzer.model"; //$NON-NLS-1$
+
+ @SuppressWarnings("static-access")
+ public static void marshal(Object obj, File path) {
+ if (null == path || null == obj) {
+ return;
+ }
+
+ try {
+ JAXBContext jc = JAXBContext.newInstance(DATA_MODEL_NAME_SPACE);
+ Marshaller marshaller = jc.createMarshaller();
+ marshaller.setProperty(marshaller.JAXB_FORMATTED_OUTPUT,
+ Boolean.TRUE);
+ marshaller.marshal(obj, new FileOutputStream(path));
+ } catch (JAXBException e) {
+ e.printStackTrace();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static Object unmarshal(File path) {
+ if (null == path) {
+ return null;
+ }
+
+ try {
+ JAXBContext jc = JAXBContext.newInstance(DATA_MODEL_NAME_SPACE);
+ Unmarshaller u = jc.createUnmarshaller();
+ return u.unmarshal(new FileInputStream(path));
+ } catch (JAXBException e) {
+ e.printStackTrace();
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+}