Bundle-Activator: org.tizen.dynamicanalyzer.appearance.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.tizen.dynamicanalyzer.common;bundle-version="1.0.0",
- org.tizen.dynamicanalyzer.widgets;bundle-version="1.0.0"
+ org.tizen.dynamicanalyzer.common;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Export-Package: org.tizen.dynamicanalyzer.appearance,
org.tizen.dynamicanalyzer.nl,
- org.tizen.dynamicanalyzer.resources,
- org.tizen.dynamicanalyzer.widgets.da.base,
- org.tizen.dynamicanalyzer.widgets.da.view
+ org.tizen.dynamicanalyzer.resources
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
- * HyunJong Park <phjwithyou.park@samsung.com>
+ * HyunJong Park <phjwithyou.park@samsung.com>
* Jooyoul Lee <jy.exe.lee@samsung.com>
* Juyoung Kim <j0.kim@samsung.com>
*
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
+ *
* Contributors:
* - S-Core Co., Ltd
- *
+ *
*/
package org.tizen.dynamicanalyzer.resources;
-import java.io.File;
-
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.theme.DATheme;
import org.tizen.dynamicanalyzer.theme.DAThemeFlat;
+import org.tizen.dynamicanalyzer.util.Logger;
public class ImageResources {
private static ImageRegistry imageRegistry = new ImageRegistry();
private static final String ID = "org.tizen.dynamicanalyzer.appearance"; //$NON-NLS-1$
- private static final String WORKBENCH_ID = "org.tizen.dynamicanalyzer.workbench"; //$NON-NLS-1$
- private static final String ICON_WORKBENCH_FOLDER_NAME = "icons"; //$NON-NLS-1$
-
- // Titlebar
- public static final Image ICON = getImageFromWorkbench("alt_window_16"); //$NON-NLS-1$
- public static final Image SEPARATOR = getPngImage("window_sunken_line"); //$NON-NLS-1$
- public static final Image CATEGORY = getPngImage("window_context_down_normal"); //$NON-NLS-1$
- public static final Image CATEGORY_PUSH = getPngImage("window_context_down_push"); //$NON-NLS-1$
- public static final Image CATEGORY_HOVER = getPngImage("window_context_down_hover"); //$NON-NLS-1$
- public static final Image CATEGORY_DISABLE = getPngImage("window_context_down_disable"); //$NON-NLS-1$
- public static final Image MIN = getPngImage("window_control_min_nor"); //$NON-NLS-1$
- public static final Image MIN_PUSH = getPngImage("window_control_min_push"); //$NON-NLS-1$
- public static final Image MIN_HOVER = getPngImage("window_control_min_hover"); //$NON-NLS-1$
- public static final Image MAX = getPngImage("window_control_max_nor"); //$NON-NLS-1$
- public static final Image MAX_PUSH = getPngImage("window_control_max_push"); //$NON-NLS-1$
- public static final Image MAX_HOVER = getPngImage("window_control_max_hover"); //$NON-NLS-1$
- public static final Image RESTORE = getPngImage("window_control_prev_nor"); //$NON-NLS-1$
- public static final Image RESTORE_PUSH = getPngImage("window_control_prev_push"); //$NON-NLS-1$
- public static final Image RESTORE_HOVER = getPngImage("window_control_prev_hover"); //$NON-NLS-1$
- public static final Image CLOSE = getPngImage("window_control_close_nor"); //$NON-NLS-1$
- public static final Image CLOSE_PUSH = getPngImage("window_control_close_push"); //$NON-NLS-1$
- public static final Image CLOSE_HOVER = getPngImage("window_control_close_hover"); //$NON-NLS-1$
// Toolbar
- public static final Image BRACKET = getPngImage("toolbar_arrow"); //$NON-NLS-1$
public static final Image START = getPngImage("da_btn_timer_start_nor"); //$NON-NLS-1$
public static final Image START_PUSH = getPngImage("da_btn_timer_start_press"); //$NON-NLS-1$
public static final Image START_HOVER = getPngImage("da_btn_timer_start_over"); //$NON-NLS-1$
public static final Image OPEN_HOVER = getPngImage("toolbar_open_hover"); //$NON-NLS-1$
public static final Image OPEN_DISABLE = getPngImage("toolbar_open_disable"); //$NON-NLS-1$
- public static final Image REPLAY = getPngImage("toolbar_replay_nor"); //$NON-NLS-1$
- public static final Image REPLAY_PUSH = getPngImage("toolbar_replay_push"); //$NON-NLS-1$
- public static final Image REPLAY_HOVER = getPngImage("toolbar_replay_hover"); //$NON-NLS-1$
- public static final Image REPLAY_DISABLE = getPngImage("toolbar_replay_disable"); //$NON-NLS-1$
-
- public static final Image REPLAY_EDIT = getPngImage("toolbar_replayedit_nor"); //$NON-NLS-1$
- public static final Image REPLAY_EDIT_PUSH = getPngImage("toolbar_replayedit_push"); //$NON-NLS-1$
- public static final Image REPLAY_EDIT_HOVER = getPngImage("toolbar_replayedit_hover"); //$NON-NLS-1$
- public static final Image REPLAY_EDIT_DISABLE = getPngImage("toolbar_replayedit_disable"); //$NON-NLS-1$
- public static final Image REPLAY_EDIT_BANNER_IMAGE = getPngImage("replay_edit_banner"); //$NON-NLS-1$
-
- public static final Image SETTINGS_NORMAL = getPngImage("toolbar_settings_nor"); //$NON-NLS-1$
- public static final Image SETTINGS_PUSH = getPngImage("toolbar_settings_push"); //$NON-NLS-1$
- public static final Image SETTINGS_HOVER = getPngImage("toolbar_settings_hover"); //$NON-NLS-1$
- public static final Image SETTINGS_DISABLE = getPngImage("toolbar_settings_disable"); //$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_NORMAL = 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_PUSH = getPngImage("toolbar_source_view_tog_push"); //$NON-NLS-1$
public static final Image VIEW_SOURCE_DISABLE = getPngImage("toolbar_source_view_disable"); //$NON-NLS-1$
public static final Image VIEW_SOURCE_CURSOR = getPngImage("source_view_cursor"); //$NON-NLS-1$
-
+
public static final Image SEARCH = getPngImage("da_search_ic_nor"); //$NON-NLS-1$
public static final Image SEARCH_PUSH = getPngImage("da_search_ic_sel"); //$NON-NLS-1$
public static final Image SEARCH_HOVER = getPngImage("da_search_ic_over"); //$NON-NLS-1$
public static final Image SEARCH_DISABLE = getPngImage("da_search_ic_dim"); //$NON-NLS-1$
+
/* combo */
- public static final Image TOOLBAR_COMBO_BUTTON_NORMAL = getPngImage("dropdown_arrow_normal"); //$NON-NLS-1$
- public static final Image TOOLBAR_COMBO_BUTTON_DISABLE = getPngImage("dropdown_arrow_disable"); //$NON-NLS-1$
- public static final Image TOOLBAR_COMBO_BUTTON_DROP = getPngImage("drop_arrow_up_norl");
public static final Image TAB_COMBO_BUTTON_DOWN = getPngImage("dropbox_down"); //$NON-NLS-1$
- /* range */
- public static final Image RANGE_NORMAL = getPngImage("toolbar_range_nor"); //$NON-NLS-1$
- public static final Image RANGE_PUSH = getPngImage("toolbar_range_push"); //$NON-NLS-1$
- public static final Image RANGE_HOVER = getPngImage("toolbar_range_hover"); //$NON-NLS-1$
- public static final Image RANGE_TOGGLE = getPngImage("toolbar_range_tog_nor"); //$NON-NLS-1$
- public static final Image RANGE_TOGGLE_HOVER = getPngImage("toolbar_range_tog_hover"); //$NON-NLS-1$
- public static final Image RANGE_TOGGLE_PUSH = getPngImage("toolbar_range_tog_push"); //$NON-NLS-1$
- public static final Image RANGE_DISABLE = getPngImage("toolbar_range_disable"); //$NON-NLS-1$
-
// Tab
- public static final Image TAB = getPngImage("tab_unselected"); //$NON-NLS-1$
public static final Image TAB_NORMAL = getPngImage("tab_normal"); //$NON-NLS-1$
public static final Image TAB_PUSH = getPngImage("tab_push"); //$NON-NLS-1$
- public static final Image TAB_HOVER = getPngImage("tab_hover"); //$NON-NLS-1$
+ public static final Image TAB_HOVER = getPngImage("tab_push"); //$NON-NLS-1$
public static final Image TAB_SELECTED = getPngImage("tab_selected"); //$NON-NLS-1$
- public static final Image TAB_DRAG = getPngImage("tab_dag"); //$NON-NLS-1$
public static final Image DRAG_TAB_32 = getPngImage("drag_tab_32"); //$NON-NLS-1$
- // Trim
- public static final Image WINDOW_TOP = getPngImage("window_top_pattern_01"); //$NON-NLS-1$
- public static final Image WINDOW_TOP2 = getPngImage("window_top_pattern_02"); //$NON-NLS-1$
- public static final Image WINDOW_BOTTOM = getPngImage("window_bottom_pattern"); //$NON-NLS-1$
- public static final Image WINDOW_LEFT = getPngImage("window_left_pattern"); //$NON-NLS-1$
- public static final Image WINDOW_RIGHT = getPngImage("window_right_pattern"); //$NON-NLS-1$
- public static final Image WINDOW_TOP_LEFT = getPngImage("window_top_left_nor_01"); //$NON-NLS-1$
- public static final Image WINDOW_TOP_LEFT2 = getPngImage("window_top_left_nor_02"); //$NON-NLS-1$
- public static final Image WINDOW_TOP_LEFT_MAX = getPngImage("window_top_left_full_01"); //$NON-NLS-1$
- public static final Image WINDOW_TOP_RIGHT = getPngImage("window_top_right_nor_01"); //$NON-NLS-1$
- public static final Image WINDOW_TOP_RIGHT2 = getPngImage("window_top_right_nor_02"); //$NON-NLS-1$
- public static final Image WINDOW_TOP_RIGHT_MAX = getPngImage("window_top_right_full_01"); //$NON-NLS-1$
- public static final Image WINDOW_BOTTOM_LEFT = getPngImage("window_bottom_left_nor"); //$NON-NLS-1$
- public static final Image WINDOW_BOTTOM_LEFT_MAX = getPngImage("window_bottom_left_full"); //$NON-NLS-1$
- public static final Image WINDOW_BOTTOM_RIGHT = getPngImage("window_bottom_right_nor"); //$NON-NLS-1$
- public static final Image WINDOW_BOTTOM_RIGHT_MAX = getPngImage("window_bottom_right_full"); //$NON-NLS-1$
- public static final Image WINDOW_RIGHT_GRAY = getPngImage("window_pattern_1"); //$NON-NLS-1$
- public static final Image WINDOW_RIGHT_DARKGARY = getPngImage("window_pattern_2"); //$NON-NLS-1$
- public static final Image WINDOW_RIGHT_BLACK = getPngImage("window_pattern_3"); //$NON-NLS-1$
-
- // Dialog button
- public static final Image DIALOG_HOVER = getPngImage("dialog_button_hover"); //$NON-NLS-1$
- public static final Image DIALOG_NORMAL = getPngImage("dialog_button_normal"); //$NON-NLS-1$
- public static final Image DIALOG_PUSH = getPngImage("dialog_button_push"); //$NON-NLS-1$
- public static final Image DIALOG_CLOSE_HOVER = getPngImage("dialog_control_close_hover"); //$NON-NLS-1$
- public static final Image DIALOG_CLOSE_NORMAL = getPngImage("dialog_control_close_normal"); //$NON-NLS-1$
- public static final Image DIALOG_CLOSE_PUSH = getPngImage("dialog_control_close_push"); //$NON-NLS-1$
-
- // text box
- public static final Image TEXT_INPUT_CENTER = getPngImage("text_input_center"); //$NON-NLS-1$
- public static final Image TEXT_INPUT_LEFT = getPngImage("text_input_left"); //$NON-NLS-1$
- public static final Image TEXT_INPUT_RIGHT = getPngImage("text_input_right"); //$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$
-
// check box
public static final Image CHECKBOX_SELECTED = getPngImage("checkbox_selected"); //$NON-NLS-1$
public static final Image CHECKBOX_SELECTED_PART = getPngImage("checkbox_selected_part"); //$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$
// Failed API icon in table
public static final Image FAILED_API_ICON_TABLE = getPngImage("fail_api"); //$NON-NLS-1$
public static final Image OPENGL_SHOW_ONLY_CHANGED_SELECTED = getPngImage("show_only_changed_push"); //$NON-NLS-1$
public static final Image OPENGL_SHOW_ONLY_CHANGED_UNSELECTED = getPngImage("show_only_changed_normal"); //$NON-NLS-1$
- // Diglog trim
- public static final Image DIALOG_TOP = getPngImage("dialog_top_pattern"); //$NON-NLS-1$
- public static final Image DIALOG_BOTTOM = getPngImage("dialog_bottom_pattern"); //$NON-NLS-1$
- public static final Image DIALOG_BOTTOM_LINUX = getPngImage("dialog_bottom_pattern_linux"); //$NON-NLS-1$
- public static final Image DIALOG_LEFT = getPngImage("dialog_left_pattern"); //$NON-NLS-1$
- public static final Image DIALOG_RIGHT = getPngImage("dialog_right_pattern"); //$NON-NLS-1$
- public static final Image DIALOG_TOP_LEFT = getPngImage("dialog_top_left"); //$NON-NLS-1$
- public static final Image DIALOG_TOP_RIGHT = getPngImage("dialog_top_right"); //$NON-NLS-1$
- public static final Image DIALOG_BOTTOM_LEFT = getPngImage("dialog_bottom_left"); //$NON-NLS-1$
- public static final Image DIALOG_BOTTOM_RIGHT = getPngImage("dialog_bottom_right"); //$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$
- public static final Image REPLAY_EDIT_DROPDOWN_DOWN = getPngImage("toolbar_dropdown_normal_a"); //$NON-NLS-1$
- public static final Image REPLAY_EDIT_SNAPSHOT_DOWN = getPngImage("btn_touchevent_position"); //$NON-NLS-1$
-
- // On, Off button
- public static final Image ON_HOVER = getPngImage("onoff_on_hover"); //$NON-NLS-1$
- public static final Image ON_NORMAL = getPngImage("onoff_on_unselected"); //$NON-NLS-1$
- public static final Image ON_PUSH = getPngImage("onoff_on_push"); //$NON-NLS-1$
- public static final Image ON_DISABLE = getPngImage("onoff_on_selected"); //$NON-NLS-1$
- public static final Image OFF_HOVER = getPngImage("onoff_off_hover"); //$NON-NLS-1$
- public static final Image OFF_NORMAL = getPngImage("onoff_off_unselected"); //$NON-NLS-1$
- public static final Image OFF_PUSH = getPngImage("onoff_off_push"); //$NON-NLS-1$
- public static final Image OFF_DISABLE = getPngImage("onoff_off_selected"); //$NON-NLS-1$
-
- // View title background
- public static final Image VIEW_TITLE = getPngImage("title_bg"); //$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$
/* about */
- public static final Image DYNANMIC_ANALYZER_ICON = getPngImage("64_DA_icon"); //$NON-NLS-1$
- public static final Image ABOUT_TIZEN_SDK = getPngImage("about_Tizen_SDK");//$NON-NLS-1$
+ public static final Image DYNANMIC_ANALYZER_ICON = getPngImage("64_DA_icon"); //$NON-NLS-1$
public static final Image LICENSE_TIZEN_SDK = getPngImage("license_banner");//$NON-NLS-1$
/* OpenGL */
- public static final Image OPEN_GL_PRE_NAVI_HOVER = getPngImage("btn_nav_r_hover"); //$NON-NLS-1$
+ public static final Image OPEN_GL_PRE_NAVI_HOVER = getPngImage("btn_nav_r_hover"); //$NON-NLS-1$
public static final Image OPEN_GL_PRE_NAVI_NORMAL = getPngImage("btn_nav_r_normal"); //$NON-NLS-1$
public static final Image OPEN_GL_PRE_NAVI_PUSH = getPngImage("btn_nav_r_push"); //$NON-NLS-1$
- public static final Image OPEN_GL_NEXT_NAVI_HOVER = getPngImage("btn_nav_f_hover"); //$NON-NLS-1$
+ public static final Image OPEN_GL_NEXT_NAVI_HOVER = getPngImage("btn_nav_f_hover"); //$NON-NLS-1$
public static final Image OPEN_GL_NEXT_NAVI_NORMAL = getPngImage("btn_nav_f_normal"); //$NON-NLS-1$
public static final Image OPEN_GL_NEXT_NAVI_PUSH = getPngImage("btn_nav_f_push"); //$NON-NLS-1$
/* configuration */
public static final Image WELCONE_BANNER_IMAGE = getPngImage("welcome_banner"); //$NON-NLS-1$
- public static final Image CONFIGURATION_BANNER_IMAGE = getPngImage("settings_banner"); //$NON-NLS-1$
- public static final Image CONFIGURATION_WHITE_IMAGE = getPngImage("theme_white"); //$NON-NLS-1$
- public static final Image CONFIGURATION_BLACK_IMAGE = getPngImage("theme_black"); //$NON-NLS-1$
/* Timeline */
public static final Image ADD_CHART_ICON = getPngImage("add_chart_icon"); //$NON-NLS-1$
- public static final Image CHART_CPU = getPngImage("time_line_icon_cpu"); //$NON-NLS-1$
- public static final Image CHART_CPU_CORE = getPngImage("time_line_icon_cpu_core"); //$NON-NLS-1$
- public static final Image CHART_CPU_FREQUENCY = getPngImage("time_line_icon_cpu_frequency"); //$NON-NLS-1$
- public static final Image CHART_HEAP = getPngImage("time_line_icon_memory_allocation"); //$NON-NLS-1$
- public static final Image CHART_HEAP_SMALL = getPngImage("time_line_icon_memory_allocation_small"); //$NON-NLS-1$
- public static final Image CHART_PROCESS_MEMORY = getPngImage("time_line_icon_memory_process"); //$NON-NLS-1$
- public static final Image CHART_PROCESS_MEMORY_SMALL = getPngImage("time_line_icon_memory_process_small"); //$NON-NLS-1$
- public static final Image CHART_SYSTEM_MEMORY = getPngImage("time_line_icon_memory_system"); //$NON-NLS-1$
- public static final Image CHART_FILE = getPngImage("time_line_icon_read_write"); //$NON-NLS-1$
- public static final Image CHART_SCREENSHOT = getPngImage("time_line_icon_snapshot"); //$NON-NLS-1$
- public static final Image CHART_UI_EVENT = getPngImage("time_line_icon_UI_events"); //$NON-NLS-1$
- public static final Image CHART_DISK_IO = getPngImage("time_line_icon_disk_io"); //$NON-NLS-1$
- public static final Image CHART_NETWORK_IO = getPngImage("time_line_icon_network_io"); //$NON-NLS-1$
- public static final Image CHART_DEVICE = getPngImage("time_line_icon_devices"); //$NON-NLS-1$
- public static final Image CHART_ENERGY = getPngImage("time_line_icon_energy"); //$NON-NLS-1$
- public static final Image FD_USAGE = getPngImage("time_line_icon_fd_usage"); //$NON-NLS-1$
- public static final Image MEMORY = getPngImage("time_line_icon_memory"); //$NON-NLS-1$
- public static final Image ADD_ITEMS_BAR = getPngImage("AddItems"); //$NON-NLS-1$
- public static final Image MIN_ITEMS = getPngImage("MinItems"); //$NON-NLS-1$
public static final Image BG_GRADIENT = getPngImage("timeline_right_bg_normal"); //$NON-NLS-1$
public static final Image BG_CHILD_GRADIENT = getPngImage("timeline_right_child_bg_normal"); //$NON-NLS-1$
- public static final Image TIMELINE_FULL = getPngImage("timeline_left_full_nor"); //$NON-NLS-1$
- public static final Image TIMELINE_RESTORE = getPngImage("timeline_left_restore_nor"); //$NON-NLS-1$
- public static final Image TIMELINE_SIZE_MIN_NORMAL = getPngImage("time_line_size_min_normal"); //$NON-NLS-1$
- public static final Image TIMELINE_SIZE_MIN_HOVER = getPngImage("time_line_size_min_hover"); //$NON-NLS-1$
- public static final Image TIMELINE_SIZE_MIN_PUSH = getPngImage("time_line_size_min_push"); //$NON-NLS-1$
- public static final Image ENERGY = getPngImage("time_line_icon_electric_current"); //$NON-NLS-1$
- public static final Image UI_EVENT = getPngImage("time_line_icon_UI_events"); //$NON-NLS-1$
public static final Image CHART_CUSTOM = getPngImage("time_line_icon_custom"); //$NON-NLS-1$
- public static final Image CHART_NETWORK = getPngImage("time_line_icon_traffic"); //$NON-NLS-1$
-
- /* graphics */
- public static final Image CHART_FPS = getPngImage("time_line_icon_fps"); //$NON-NLS-1$
- public static final Image CHART_FRAME_TIME = getPngImage("time_line_icon_frame_time"); //$NON-NLS-1$
- public static final Image CHART_FRAME_RATE = getPngImage("time_line_icon_frame_rate"); //$NON-NLS-1$
/* Resource */
- public static final Image TYPE_FILE = getPngImage("resource/resource_file"); //$NON-NLS-1$
- public static final Image TYPE_SOCKET = getPngImage("resource/resource_socket"); //$NON-NLS-1$
- public static final Image TYPE_GROUP_FILE = getPngImage("resource/resource_file_group"); //$NON-NLS-1$
- public static final Image ARROW_CLOSE_NOR = getPngImage("resource/resource_group_close_nor"); //$NON-NLS-1$
- public static final Image ARROW_CLOSE_HOVER = getPngImage("resource/resource_group_close_hover"); //$NON-NLS-1$
- public static final Image ARROW_CLOSE_PUSH = getPngImage("resource/resource_group_close_push"); //$NON-NLS-1$
- public static final Image ARROW_OPEN_NOR = getPngImage("resource/resource_group_open_nor"); //$NON-NLS-1$
- public static final Image ARROW_OPEN_HOVER = getPngImage("resource/resource_group_open_hover"); //$NON-NLS-1$
- public static final Image ARROW_OPEN_PUSH = getPngImage("resource/resource_group_open_push"); //$NON-NLS-1$
- public static final Image TREE_LINE_MID = getPngImage("resource/resource_group_line_mid"); //$NON-NLS-1$
- public static final Image TREE_LINE_BOTTOM = getPngImage("resource/resource_group_line_bottom"); //$NON-NLS-1$
- public static final Image LIFECYCLE_FIRST_LAST_BALL = getPngImage("resource/resource_lifecycle_first_last_ball"); //$NON-NLS-1$
- public static final Image LIFECYCLE_OPEN_CLOSE_BALL = getPngImage("resource/resource_lifecycle_open_close_ball"); //$NON-NLS-1$
- public static final Image LIFECYCLE_ERROR_MARK = getPngImage("resource/resource_lifecycle_error_mark"); //$NON-NLS-1$
-
- public static final Image COMBO_DISABLE = getPngImage("toolbar_dropdown_disable"); //$NON-NLS-1$
- public static final Image COMBO_NORMAL = getPngImage("toolbar_dropdown_normal"); //$NON-NLS-1$
- public static final Image COMBO_PUSH = getPngImage("toolbar_dropdown_push"); //$NON-NLS-1$
- public static final Image COMBO_HOVER = getPngImage("toolbar_dropdown_hover"); //$NON-NLS-1$
-
- public static final Image STATUS_BATTERY_OFF = getPngImage("status_battery_off"); //$NON-NLS-1$
- public static final Image STATUS_BATTERY_ON = getPngImage("status_battery_on"); //$NON-NLS-1$
-
- public static final Image STATUS_BLUETOOTH_ELSE = getPngImage("status_bluetooth_else"); //$NON-NLS-1$
- public static final Image STATUS_BLUETOOTH_OFF = getPngImage("status_bluetooth_off"); //$NON-NLS-1$
- public static final Image STATUS_BLUETOOTH_TRANSFER = getPngImage("status_bluetooth_transfer"); //$NON-NLS-1$
-
- public static final Image STATUS_GPS_CONNECTED = getPngImage("status_gps_connected"); //$NON-NLS-1$
- public static final Image STATUS_GPS_OFF = getPngImage("status_gps_off"); //$NON-NLS-1$
- public static final Image STATUS_GPS_SEARCHING = getPngImage("status_gps_searching"); //$NON-NLS-1$
-
- public static final Image STATUS_WIFI_CONNECTED = getPngImage("status_wifi_connected"); //$NON-NLS-1$
- public static final Image STATUS_WIFI_OFF = getPngImage("status_wifi_off"); //$NON-NLS-1$
- public static final Image STATUS_WIFI_TRANSFER = getPngImage("status_wifi_transfer"); //$NON-NLS-1$
- public static final Image STATUS_WIFI_UNCONNECTED = getPngImage("status_wifi_unconnected"); //$NON-NLS-1$
-
+ public static final Image NO_IMAGE = getPngImage("empty_snapshot"); //$NON-NLS-1$
public static final Image TREE_OPEN = getPngImage("tree_open"); //$NON-NLS-1$
public static final Image TREE_FOLD = getPngImage("tree_fold"); //$NON-NLS-1$
- public static final Image NO_IMAGE = getPngImage("empty_snapshot"); //$NON-NLS-1$
- public static final Image NO_IMAGE_SMALL = getPngImage("empty_snapshot_small"); //$NON-NLS-1$
-
- /*** context child arrow ***/
- public static final Image CONTEXT_OPEN = getPngImage("context_menu_child_arrow"); //$NON-NLS-1$
/* score */
public static final Image SCORE_0 = getPngImage("score_0"); //$NON-NLS-1$
// Edit Chart
public static final Image ADD_CHART_OFF = getPngImage("dialog_edit_chart_off"); //$NON-NLS-1$
public static final Image ADD_CHART_ON = getPngImage("dialog_edit_chart_on"); //$NON-NLS-1$
- public static final Image ADD_CHART_CPU = getPngImage("edit_chart_icon_cpu"); //$NON-NLS-1$
- public static final Image ADD_CHART_CPU_CORE = getPngImage("edit_chart_icon_cpu_core"); //$NON-NLS-1$
- public static final Image ADD_CHART_CPU_FREQUENCY = getPngImage("edit_chart_icon_cpu_frequency"); //$NON-NLS-1$
- public static final Image ADD_CHART_HEAP = getPngImage("edit_chart_icon_memory_allocation"); //$NON-NLS-1$
- public static final Image ADD_CHART_PROCESS_MEMORY = getPngImage("edit_chart_icon_memory_process"); //$NON-NLS-1$
- public static final Image ADD_CHART_SYSTEM_MEMORY = getPngImage("edit_chart_icon_memory_system"); //$NON-NLS-1$
- public static final Image ADD_CHART_FILE = getPngImage("edit_chart_icon_read_write"); //$NON-NLS-1$
- public static final Image ADD_CHART_SCREENSHOT = getPngImage("edit_chart_icon_snapshot"); //$NON-NLS-1$
- public static final Image ADD_CHART_UI_EVENT = getPngImage("edit_chart_icon_UI_events"); //$NON-NLS-1$
- public static final Image ADD_CHART_DEVICE = getPngImage("edit_chart_icon_devices"); //$NON-NLS-1$
- public static final Image ADD_CHART_ENERGY = getPngImage("edit_chart_icon_energy"); //$NON-NLS-1$
- public static final Image ADD_CHART_ELECTRIC_CURRENT = getPngImage("edit_chart_icon_electric_current"); //$NON-NLS-1$
- public static final Image ADD_CHART_FD_USAGE = getPngImage("edit_chart_icon_fd_usage"); //$NON-NLS-1$
- public static final Image ADD_CHART_MEMORY_APPUSAGE = getPngImage("edit_chart_icon_memory_appusage"); //$NON-NLS-1$
- public static final Image ADD_CHART_READ_WRITE_2 = getPngImage("edit_chart_icon_read_write_01"); //$NON-NLS-1$
- public static final Image ADD_CHART_SOUND = getPngImage("edit_chart_icon_sound"); //$NON-NLS-1$
- public static final Image ADD_CHART_VIBRATION = getPngImage("edit_chart_icon_vibration"); //$NON-NLS-1$
- public static final Image ADD_CHART_CUSTOM = getPngImage("edit_chart_icon_custom"); //$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$
- /*** thread page ***/
- public static final Image TIMELINE_DROPDOWN_NORMAL = getPngImage("time_line_dropdown_normal"); //$NON-NLS-1$
- public static final Image TIMELINE_DROPDOWN_HOVER = getPngImage("time_line_dropdown_hover"); //$NON-NLS-1$
- public static final Image TIMELINE_DROPDOWN_PUSH = getPngImage("time_line_dropdown_push"); //$NON-NLS-1$
-
public static final Image CLOSE_BOX_NORMAL = getPngImage("close_box_normal"); //$NON-NLS-1$
public static final Image CLOSE_BOX_PUSH = getPngImage("close_box_push"); //$NON-NLS-1$
public static final Image CLOSE_BOX_HOVER = getPngImage("close_box_hover"); //$NON-NLS-1$
public static final Image CLOSE_BOX_DISABLE = getPngImage("close_box_disable"); //$NON-NLS-1$
- public static final Image TAB_ICON_TIMELINE = getPngImage("tab_icon_timeline"); //$NON-NLS-1$
- public static final Image TAB_ICON_FILE = getPngImage("tab_icon_file"); //$NON-NLS-1$
- public static final Image TAB_ICON_THREAD = getPngImage("tab_icon_thread"); //$NON-NLS-1$
- public static final Image TAB_ICON_UI = getPngImage("tab_icon_userinterface"); //$NON-NLS-1$
- public static final Image TAB_ICON_SUMMARY = getPngImage("tab_icon_summary"); //$NON-NLS-1$
- public static final Image TAB_ICON_RANGE = getPngImage("tab_icon_range"); //$NON-NLS-1$
-
- /* gl */
- public static final Image GL_DROP_LEFT_ARROW = getPngImage("arrow_full_left"); //$NON-NLS-1$
- public static final Image GL_DROP_DOWN_ARROW = getPngImage("arrow_full_down"); //$NON-NLS-1$
-
- public static final Image ICON_FILE = getGifImage("file"); //$NON-NLS-1$
- public static final Image ICON_FILE_LINK = getGifImage("file_link"); //$NON-NLS-1$
- public static final Image ICON_DIR = getGifImage("directory"); //$NON-NLS-1$
- public static final Image ICON_DIR_LINK = getGifImage("directory_link"); //$NON-NLS-1$
- public static final Image ICON_EMULATOR = getGifImage("emulator"); //$NON-NLS-1$
- public static final Image ICON_DEVICE = getGifImage("device"); //$NON-NLS-1$
- public static final Image ICON_OTHER = getGifImage("file"); //$NON-NLS-1$
-
/** Binary Settings page desing images */
public static final Image DELETE_BUTTON_NORMAL = getPngImage("btn_delete_normal"); //$NON-NLS-1$
public static final Image DELETE_BUTTON_PUSH = getPngImage("btn_delete_push"); //$NON-NLS-1$
public static final Image FILE_TYPE_FILE = getPngImage("file_type_file"); //$NON-NLS-1$
public static final Image FILE_TYPE_FILE_LINK = getPngImage("file_type_file_link"); //$NON-NLS-1$
- public static final Image SCREEN_SHOT_NORMAL = getPngImage("toolbar_screen_shot_nor"); //$NON-NLS-1$
- public static final Image SCREEN_SHOT_PUSH = getPngImage("toolbar_screen_shot_push"); //$NON-NLS-1$
- public static final Image SCREEN_SHOT_HOVER = getPngImage("toolbar_screen_shot_hover"); //$NON-NLS-1$
- public static final Image SCREEN_SHOT_DISABLE = getPngImage("toolbar_screen_shot_disable"); //$NON-NLS-1$
-
/* setting */
public static final Image TARGET_NAME_MOBILE = getPngImage("feature_target_mobile"); //$NON-NLS-1$
public static final Image TARGET_NAME_TV = getPngImage("feature_target_tv"); //$NON-NLS-1$
public static final Image TARGET_NAME_FLAT_TV_NORMAL = getPngImage("device_tv_nor"); //$NON-NLS-1$
public static final Image TARGET_NAME_FLAT_TV_OVER = getPngImage("device_tv_over"); //$NON-NLS-1$
public static final Image TARGET_NAME_FLAT_TV_SEL = getPngImage("device_tv_sel"); //$NON-NLS-1$
- // DEPRECATED, Please use _SEL, Change '*_foc' to '*_sel' forcely.
- public static final Image TARGET_NAME_FLAT_MOBILE_FOCUS = getPngImage("device_mobile_sel"); //$NON-NLS-1$
- public static final Image TARGET_NAME_FLAT_WEARABLE_FOCUS = getPngImage("device_wearable_sel"); //$NON-NLS-1$
- public static final Image TARGET_NAME_FLAT_TV_FOCUS = getPngImage("device_tv_sel"); //$NON-NLS-1$
+
public static final Image TEMPLATE_BOTTLENECK_ANALYSIS = getPngImage("feature_template_bottleneck"); //$NON-NLS-1$
public static final Image TEMPLATE_MEMORY_LEAK = getPngImage("feature_template_memoryleaks"); //$NON-NLS-1$
public static final Image TEMPLATE_PROCESS_ACTIVITY = getPngImage("feature_template_processactivity"); //$NON-NLS-1$
public static final Image TEMPLATE_ENERGY = getPngImage("feature_template_energy"); //$NON-NLS-1$
public static final Image TEMPLATE_UI_HIERARCHY_ANALYSIS = getPngImage("feature_template_hierarchyviewer"); //$NON-NLS-1$
public static final Image TEMPLATE_CUSTOM = getPngImage("feature_template_custom"); //$NON-NLS-1$
-
+
public static final Image OVERHEAD_BAR = getPngImage("overhead_bar"); //$NON-NLS-1$
public static final Image OVERHEAD_BAR_BG = getPngImage("overhead_bar_bg"); //$NON-NLS-1$
public static final Image FEATURE_DEVICE_NORMAL = getPngImage("feature_device_nor");
public static final Image FEATURE_DISKIO_FOCUS = getPngImage("feature_disk_io_foc");
public static final Image FEATURE_DISKIO_NORMAL = getPngImage("feature_disk_io_nor");
- public static final Image FEATURE_ENERGY_FOCUS = getPngImage("feature_energy_foc");
- public static final Image FEATURE_ENERGY_NORMAL = getPngImage("feature_energy_nor");
public static final Image FEATURE_FILE_FOCUS = getPngImage("feature_file_foc");
public static final Image FEATURE_FILE_NORMAL = getPngImage("feature_file_nor");
- public static final Image FEATURE_FRAMERATE_FOCUS = getPngImage("feature_frame-rate_foc");
- public static final Image FEATURE_FRAMERATE_NORMAL = getPngImage("feature_frame-rate_nor");
- public static final Image FEATURE_FRAMETIME_FOCUS = getPngImage("feature_frame-rate_foc");
- public static final Image FEATURE_FRAMETIME_NORMAL = getPngImage("feature_frame-rate_nor");
public static final Image FEATURE_HEAPALLOC_FOCUS = getPngImage("feature_heap-allocation_foc");
public static final Image FEATURE_HEAPALLOC_NORMAL = getPngImage("feature_heap-allocation_nor");
public static final Image FEATURE_MEM_PROCESS_FOCUS = getPngImage("feature_memory_process_foc");
public static final Image FEATURE_NETWORKIO_NORMAL = getPngImage("feature_network_io_nor");
public static final Image FEATURE_OPENGL_FOCUS = getPngImage("feature_open-gl_foc");
public static final Image FEATURE_OPENGL_NORMAL = getPngImage("feature_open-gl_nor");
- public static final Image FEATURE_READWRITE_FOCUS = getPngImage("feature_read_write_foc");
- public static final Image FEATURE_READWRITE_NORMAL = getPngImage("feature_read_write_nor");
public static final Image FEATURE_SNAPSHOT_FOCUS = getPngImage("feature_snapshot_foc");
public static final Image FEATURE_SNAPSHOT_NORMAL = getPngImage("feature_snapshot_nor");
- public static final Image FEATURE_SYNC_FOCUS = getPngImage("feature_sync_foc");
- public static final Image FEATURE_SYNC_NORMAL = getPngImage("feature_sync_nor");
public static final Image FEATURE_THREADACTIVITY_FOCUS = getPngImage("feature_thread-activity_foc");
public static final Image FEATURE_THREADACTIVITY_NORMAL = getPngImage("feature_thread-activity_nor");
public static final Image FEATURE_NETWORKTRAFFIC_FOCUS = getPngImage("feature_traffic_foc");
public static final Image FEATURE_NETWORKTRAFFIC_NORMAL = getPngImage("feature_traffic_nor");
public static final Image FEATURE_UIEVENT_FOCUS = getPngImage("feature_UI-event_foc");
public static final Image FEATURE_UIEVENT_NORMAL = getPngImage("feature_UI-event_nor");
- public static final Image FEATURE_VULKAN_FOCUS = getPngImage("feature_vulkan_foc");
- public static final Image FEATURE_VULKAN_NORMAL = getPngImage("feature_vulkan_nor");
- public static final Image FEATURE_LOCATION_FOCUS = getPngImage("feature_location_foc"); //$NON-NLS-1$
- public static final Image FEATURE_LOCATION_NORMAL = getPngImage("feature_location_nor"); //$NON-NLS-1$
public static final Image FEATURE_UIHV_FOCUS = getPngImage("feature_hierarchyview_sel"); //$NON-NLS-1$
public static final Image FEATURE_UIHV_NORMAL = getPngImage("feature_hierarchyview_nor"); //$NON-NLS-1$
public static final Image FEATURE_DEVICE_OVER = getPngImage("feature_device_over");
public static final Image FEATURE_DISKIO_DIM = getPngImage("feature_disk_io_dim");
public static final Image FEATURE_DISKIO_OVER = getPngImage("feature_disk_io_over");
- public static final Image FEATURE_ENERGY_DIM = getPngImage("feature_energy_dim");
- public static final Image FEATURE_ENERGY_OVER = getPngImage("feature_energy_over");
public static final Image FEATURE_FILE_DIM = getPngImage("feature_file_dim");
public static final Image FEATURE_FILE_OVER = getPngImage("feature_file_over");
- public static final Image FEATURE_FRAMERATE_DIM = getPngImage("feature_frame-rate_dim");
- public static final Image FEATURE_FRAMERATE_OVER = getPngImage("feature_frame-rate_over");
- public static final Image FEATURE_FRAMETIME_DIM = getPngImage("feature_frame-rate_dim");
- public static final Image FEATURE_FRAMETIME_OVER = getPngImage("feature_frame-rate_over");
public static final Image FEATURE_HEAPALLOC_DIM = getPngImage("feature_heap-allocation_dim");
public static final Image FEATURE_HEAPALLOC_OVER = getPngImage("feature_heap-allocation_over");
public static final Image FEATURE_MEM_PROCESS_DIM = getPngImage("feature_memory_process_dim");
public static final Image FEATURE_NETWORKIO_OVER = getPngImage("feature_network_io_over");
public static final Image FEATURE_OPENGL_DIM = getPngImage("feature_open-gl_dim");
public static final Image FEATURE_OPENGL_OVER = getPngImage("feature_open-gl_over");
- public static final Image FEATURE_READWRITE_DIM = getPngImage("feature_read_write_dim");
- public static final Image FEATURE_READWRITE_OVER = getPngImage("feature_read_write_over");
public static final Image FEATURE_SNAPSHOT_DIM = getPngImage("feature_snapshot_dim");
public static final Image FEATURE_SNAPSHOT_OVER = getPngImage("feature_snapshot_over");
- public static final Image FEATURE_SYNC_DIM = getPngImage("feature_sync_dim");
- public static final Image FEATURE_SYNC_OVER = getPngImage("feature_sync_over");
public static final Image FEATURE_THREADACTIVITY_DIM = getPngImage("feature_thread-activity_dim");
public static final Image FEATURE_THREADACTIVITY_OVER = getPngImage("feature_thread-activity_over");
public static final Image FEATURE_NETWORKTRAFFIC_DIM = getPngImage("feature_traffic_dim");
public static final Image FEATURE_NETWORKTRAFFIC_OVER = getPngImage("feature_traffic_over");
public static final Image FEATURE_UIEVENT_DIM = getPngImage("feature_UI-event_dim");
public static final Image FEATURE_UIEVENT_OVER = getPngImage("feature_UI-event_over");
- public static final Image FEATURE_VULKAN_DIM = getPngImage("feature_vulkan_dim");
- public static final Image FEATURE_VULKAN_OVER = getPngImage("feature_vulkan_over");
- public static final Image FEATURE_LOCATION_DIM = getPngImage("feature_location_DIM"); //$NON-NLS-1$
- public static final Image FEATURE_LOCATION_OVER = getPngImage("feature_location_OVER"); //$NON-NLS-1$
public static final Image FEATURE_UIHV_DIM = getPngImage("feature_hierarchyview_dim"); //$NON-NLS-1$
public static final Image FEATURE_UIHV_OVER = getPngImage("feature_hierarchyview_over"); //$NON-NLS-1$
/*** Feature dialog, small icons 40 x 40 ***/
- // DEPRECATED, Please use _DIM, _NOR, _OVER, _SEL
- // Change '*_s' icon to '*_s_dim' forcely.
- public static final Image FEATURE_CPU_SMALL = getPngImage("feature_cpu_s_dim");
- public static final Image FEATURE_CPUCORE_SMALL = getPngImage("feature_cpu-core_s_dim");
- public static final Image FEATURE_CPUFREQ_SMALL = getPngImage("feature_cpu-frequency_s_dim");
- public static final Image FEATURE_CURRENT_SMALL = getPngImage("feature_current_s_dim");
- public static final Image FEATURE_DEVICE_SMALL = getPngImage("feature_device_s_dim");
- public static final Image FEATURE_DISKIO_SMALL = getPngImage("feature_disk_io_s_dim");
- public static final Image FEATURE_ENERGY_SMALL = getPngImage("feature_energy_s_dim");
- public static final Image FEATURE_FILE_SMALL = getPngImage("feature_file_s_dim");
- public static final Image FEATURE_FRAMERATE_SMALL = getPngImage("feature_frame-rate_s_dim");
- public static final Image FEATURE_FRAMETIME_SMALL = getPngImage("feature_frame-rate_s_dim");
public static final Image FEATURE_HEAPALLOC_SMALL = getPngImage("feature_heap-allocation_s_dim");
- public static final Image FEATURE_MEM_PROCESS_SMALL = getPngImage("feature_memory_process_s_dim");
public static final Image FEATURE_MEM_SYSTEM_SMALL = getPngImage("feature_memory_system_s_dim");
- public static final Image FEATURE_NETWORKIO_SMALL = getPngImage("feature_network_io_s_dim");
- public static final Image FEATURE_OPENGL_SMALL = getPngImage("feature_open-gl_s_dim");
- public static final Image FEATURE_READWRITE_SMALL = getPngImage("feature_read_write_s_dim");
- public static final Image FEATURE_SNAPSHOT_SMALL = getPngImage("feature_snapshot_s_dim");
- public static final Image FEATURE_SYNC_SMALL = getPngImage("feature_sync_s_dim");
- public static final Image FEATURE_THREADACTIVITY_SMALL = getPngImage("feature_thread-activity_s_dim");
- public static final Image FEATURE_NETWORKTRAFFIC_SMALL = getPngImage("feature_traffic_s_dim");
- public static final Image FEATURE_UIEVENT_SMALL = getPngImage("feature_UI-event_s_dim");
- public static final Image FEATURE_VULKAN_SMALL = getPngImage("feature_vulkan_s_dim");
- public static final Image FEATURE_LOCATION_SMALL = getPngImage("feature_location_s_dim");
- public static final Image FEATURE_UIHV_SMALL = getPngImage("feature_hierarchyview_s_nor"); //$NON-NLS-1$
-
- // dimmed
- public static final Image FEATURE_CPU_SMALL_DIM = getPngImage("feature_cpu_s_dim");
- public static final Image FEATURE_CPUCORE_SMALL_DIM = getPngImage("feature_cpu-core_s_dim");
- public static final Image FEATURE_CPUFREQ_SMALL_DIM = getPngImage("feature_cpu-frequency_s_dim");
- public static final Image FEATURE_CURRENT_SMALL_DIM = getPngImage("feature_current_s_dim");
- public static final Image FEATURE_DEVICE_SMALL_DIM = getPngImage("feature_device_s_dim");
- public static final Image FEATURE_DISKIO_SMALL_DIM = getPngImage("feature_disk_io_s_dim");
- public static final Image FEATURE_ENERGY_SMALL_DIM = getPngImage("feature_energy_s_dim");
- public static final Image FEATURE_FILE_SMALL_DIM = getPngImage("feature_file_s_dim");
- public static final Image FEATURE_FRAMERATE_SMALL_DIM = getPngImage("feature_frame-rate_s_dim");
- public static final Image FEATURE_FRAMETIME_SMALL_DIM = getPngImage("feature_frame-rate_s_dim");
- public static final Image FEATURE_HEAPALLOC_SMALL_DIM = getPngImage("feature_heap-allocation_s_dim");
- public static final Image FEATURE_MEM_PROCESS_SMALL_DIM = getPngImage("feature_memory_process_s_dim");
- public static final Image FEATURE_MEM_SYSTEM_SMALL_DIM = getPngImage("feature_memory_system_s_dim");
- public static final Image FEATURE_NETWORKIO_SMALL_DIM = getPngImage("feature_network_io_s_dim");
- public static final Image FEATURE_OPENGL_SMALL_DIM = getPngImage("feature_open-gl_s_dim");
- public static final Image FEATURE_READWRITE_SMALL_DIM = getPngImage("feature_read_write_s_dim");
- public static final Image FEATURE_SNAPSHOT_SMALL_DIM = getPngImage("feature_snapshot_s_dim");
- public static final Image FEATURE_SYNC_SMALL_DIM = getPngImage("feature_sync_s_dim");
- public static final Image FEATURE_THREADACTIVITY_SMALL_DIM = getPngImage("feature_thread-activity_s_dim");
- public static final Image FEATURE_NETWORKTRAFFIC_SMALL_DIM = getPngImage("feature_traffic_s_dim");
- public static final Image FEATURE_UIEVENT_SMALL_DIM = getPngImage("feature_UI-event_s_dim");
- public static final Image FEATURE_VULKAN_SMALL_DIM = getPngImage("feature_vulkan_s_dim");
- public static final Image FEATURE_LOCATION_SMALL_DIM = getPngImage("feature_location_s_dim");
- public static final Image FEATURE_UIHV_SMALL_DIM = getPngImage("feature_hierarchyview_s_dim"); //$NON-NLS-1$
+
+ /** Small dimmed icons removed **/
// normal
public static final Image FEATURE_CPU_SMALL_NOR = getPngImage("feature_cpu_s_nor");
public static final Image FEATURE_CPUCORE_SMALL_NOR = getPngImage("feature_cpu-core_s_nor");
public static final Image FEATURE_CPUFREQ_SMALL_NOR = getPngImage("feature_cpu-frequency_s_nor");
- public static final Image FEATURE_CURRENT_SMALL_NOR = getPngImage("feature_current_s_nor");
public static final Image FEATURE_DEVICE_SMALL_NOR = getPngImage("feature_device_s_nor");
public static final Image FEATURE_DISKIO_SMALL_NOR= getPngImage("feature_disk_io_s_nor");
public static final Image FEATURE_ENERGY_SMALL_NOR= getPngImage("feature_energy_s_nor");
- public static final Image FEATURE_FILE_SMALL_NOR= getPngImage("feature_file_s_nor");
public static final Image FEATURE_FRAMERATE_SMALL_NOR= getPngImage("feature_frame-rate_s_nor");
public static final Image FEATURE_FRAMETIME_SMALL_NOR= getPngImage("feature_frame-rate_s_nor");
public static final Image FEATURE_HEAPALLOC_SMALL_NOR= getPngImage("feature_heap-allocation_s_nor");
public static final Image FEATURE_MEM_PROCESS_SMALL_NOR= getPngImage("feature_memory_process_s_nor");
public static final Image FEATURE_MEM_SYSTEM_SMALL_NOR= getPngImage("feature_memory_system_s_nor");
public static final Image FEATURE_NETWORKIO_SMALL_NOR= getPngImage("feature_network_io_s_nor");
- public static final Image FEATURE_OPENGL_SMALL_NOR= getPngImage("feature_open-gl_s_nor");
- public static final Image FEATURE_READWRITE_SMALL_NOR= getPngImage("feature_read_write_s_nor");
public static final Image FEATURE_SNAPSHOT_SMALL_NOR= getPngImage("feature_snapshot_s_nor");
- public static final Image FEATURE_SYNC_SMALL_NOR= getPngImage("feature_sync_s_nor");
- public static final Image FEATURE_THREADACTIVITY_SMALL_NOR= getPngImage("feature_thread-activity_s_nor");
- public static final Image FEATURE_NETWORKTRAFFIC_SMALL_NOR= getPngImage("feature_traffic_s_nor");
public static final Image FEATURE_UIEVENT_SMALL_NOR= getPngImage("feature_UI-event_s_nor");
- public static final Image FEATURE_VULKAN_SMALL_NOR= getPngImage("feature_vulkan_s_nor");
- public static final Image FEATURE_LOCATION_SMALL_NOR = getPngImage("feature_location_s_nor");
- public static final Image FEATURE_UIHV_SMALL_NOR= getPngImage("feature_hierarchyview_s_nor"); //$NON-NLS-1$
-
- // mouse over
- public static final Image FEATURE_CPU_SMALL_OVER = getPngImage("feature_cpu_s_over");
- public static final Image FEATURE_CPUCORE_SMALL_OVER = getPngImage("feature_cpu-core_s_over");
- public static final Image FEATURE_CPUFREQ_SMALL_OVER = getPngImage("feature_cpu-frequency_s_over");
- public static final Image FEATURE_CURRENT_SMALL_OVER = getPngImage("feature_current_s_over");
- public static final Image FEATURE_DEVICE_SMALL_OVER = getPngImage("feature_device_s_over");
- public static final Image FEATURE_DISKIO_SMALL_OVER = getPngImage("feature_disk_io_s_over");
- public static final Image FEATURE_ENERGY_SMALL_OVER = getPngImage("feature_energy_s_over");
- public static final Image FEATURE_FILE_SMALL_OVER = getPngImage("feature_file_s_over");
- public static final Image FEATURE_FRAMERATE_SMALL_OVER = getPngImage("feature_frame-rate_s_over");
- public static final Image FEATURE_FRAMETIME_SMALL_OVER = getPngImage("feature_frame-rate_s_over");
- public static final Image FEATURE_HEAPALLOC_SMALL_OVER = getPngImage("feature_heap-allocation_s_over");
- public static final Image FEATURE_MEM_PROCESS_SMALL_OVER = getPngImage("feature_memory_process_s_over");
- public static final Image FEATURE_MEM_SYSTEM_SMALL_OVER = getPngImage("feature_memory_system_s_over");
- public static final Image FEATURE_NETWORKIO_SMALL_OVER = getPngImage("feature_network_io_s_over");
- public static final Image FEATURE_OPENGL_SMALL_OVER = getPngImage("feature_open-gl_s_over");
- public static final Image FEATURE_READWRITE_SMALL_OVER = getPngImage("feature_read_write_s_over");
- public static final Image FEATURE_SNAPSHOT_SMALL_OVER = getPngImage("feature_snapshot_s_over");
- public static final Image FEATURE_SYNC_SMALL_OVER = getPngImage("feature_sync_s_over");
- public static final Image FEATURE_THREADACTIVITY_SMALL_OVER = getPngImage("feature_thread-activity_s_over");
- public static final Image FEATURE_NETWORKTRAFFIC_SMALL_OVER = getPngImage("feature_traffic_s_over");
- public static final Image FEATURE_UIEVENT_SMALL_OVER = getPngImage("feature_UI-event_s_over");
- public static final Image FEATURE_VULKAN_SMALL_OVER = getPngImage("feature_vulkan_s_over");
- public static final Image FEATURE_LOCATION_SMALL_OVER = getPngImage("feature_location_s_over");
- public static final Image FEATURE_UIHV_SMALL_OVER = getPngImage("feature_hierarchyview_s_over"); //$NON-NLS-1$
-
+
// selected
public static final Image FEATURE_CPU_SMALL_SEL = getPngImage("feature_cpu_s_sel");
public static final Image FEATURE_CPUCORE_SMALL_SEL = getPngImage("feature_cpu-core_s_sel");
public static final Image FEATURE_CURRENT_SMALL_SEL = getPngImage("feature_current_s_sel");
public static final Image FEATURE_DEVICE_SMALL_SEL = getPngImage("feature_device_s_sel");
public static final Image FEATURE_DISKIO_SMALL_SEL = getPngImage("feature_disk_io_s_sel");
- public static final Image FEATURE_ENERGY_SMALL_SEL = getPngImage("feature_energy_s_sel");
public static final Image FEATURE_FILE_SMALL_SEL = getPngImage("feature_file_s_sel");
- public static final Image FEATURE_FRAMERATE_SMALL_SEL = getPngImage("feature_frame-rate_s_sel");
- public static final Image FEATURE_FRAMETIME_SMALL_SEL = getPngImage("feature_frame-rate_s_sel");
public static final Image FEATURE_HEAPALLOC_SMALL_SEL = getPngImage("feature_heap-allocation_s_sel");
public static final Image FEATURE_MEM_PROCESS_SMALL_SEL = getPngImage("feature_memory_process_s_sel");
public static final Image FEATURE_MEM_SYSTEM_SMALL_SEL = getPngImage("feature_memory_system_s_sel");
public static final Image FEATURE_NETWORKIO_SMALL_SEL = getPngImage("feature_network_io_s_sel");
public static final Image FEATURE_OPENGL_SMALL_SEL = getPngImage("feature_open-gl_s_sel");
- public static final Image FEATURE_READWRITE_SMALL_SEL = getPngImage("feature_read_write_s_sel");
public static final Image FEATURE_SNAPSHOT_SMALL_SEL = getPngImage("feature_snapshot_s_sel");
- public static final Image FEATURE_SYNC_SMALL_SEL = getPngImage("feature_sync_s_sel");
public static final Image FEATURE_THREADACTIVITY_SMALL_SEL = getPngImage("feature_thread-activity_s_sel");
public static final Image FEATURE_NETWORKTRAFFIC_SMALL_SEL = getPngImage("feature_traffic_s_sel");
public static final Image FEATURE_UIEVENT_SMALL_SEL = getPngImage("feature_UI-event_s_sel");
- public static final Image FEATURE_VULKAN_SMALL_SEL = getPngImage("feature_vulkan_s_sel");
- public static final Image FEATURE_LOCATION_SMALL_SEL = getPngImage("feature_location_s_sel");
public static final Image FEATURE_UIHV_SMALL_SEL = getPngImage("feature_hierarchyview_s_sel"); //$NON-NLS-1$
/*** stop progress dialog ***/
/** advanced view button **/
public static final Image ADVANCED_MENU_BUTTON_NORMAL = getPngImage("btn_title_dropdown_normal"); //$NON-NLS-1$
-
+
/** table filtering **/
public static final Image COLUMN_FILTER_NORMAL = getPngImage("column_filter_normal"); //$NON-NLS-1$
-
+
public static final Image FILTER_DIALOG_DELETE_FILTER_NORMAL = getPngImage("btn_delete_filter_normal"); //$NON-NLS-1$
public static final Image FILTER_DIALOG_DELETE_FILTER_HOVER = getPngImage("btn_delete_filter_hover"); //$NON-NLS-1$
public static final Image FILTER_DIALOG_DELETE_FILTER_PUSH = getPngImage("btn_delete_filter_push"); //$NON-NLS-1$
/** etc **/
public static final Image DELETE = getPngImage("delete");
-
-
+
/** new timeline **/
public static final Image APP_NOR = getPngImage("app_nor");
public static final Image APP_OVER = getPngImage("app_over");
public static final Image APP_SEL = getPngImage("app_sel");
- public static final Image BOX_TIME_NOW = getPngImage("box_time_now");
- public static final Image BTN_IC_CONNECT_ICON = getPngImage("btn_ic_connect_icon");
- public static final Image CAPTURE_POINT = getPngImage("capture_point");
public static final Image DA_IMAGEVIEWER_ARROW_L_DIM = getPngImage("da_imageviewer_arrow_l_dim");
public static final Image DA_IMAGEVIEWER_ARROW_L_NOR = getPngImage("da_imageviewer_arrow_l_nor");
public static final Image DA_IMAGEVIEWER_ARROW_L_SEL = getPngImage("da_imageviewer_arrow_l_sel");
public static final Image DA_SCREENSHOT_ICON_NOR = getPngImage("da_screenshot_icon_nor");
public static final Image DA_SCREENSHOT_ICON_OVER = getPngImage("da_screenshot_icon_over");
public static final Image DIMENSION_IC_NOR = getPngImage("dimension_ic_nor");
- public static final Image DIMENSION_IC_OVER = getPngImage("dimension_ic_over");
public static final Image DIMENSION_IC_SEL = getPngImage("dimension_ic_sel");
- public static final Image DROP_ARROW_DOWN_HOVER = getPngImage("drop_arrow_down_edit");
+ public static final Image DROP_ARROW_DOWN_HOVER = getPngImage("drop_arrow_down_sel");
public static final Image DROP_ARROW_DOWN_NOR = getPngImage("drop_arrow_down_nor");
public static final Image DROP_ARROW_DOWN_DIM = getPngImage("drop_arrow_down_dim");
public static final Image DROP_ARROW_DOWN_SEL = getPngImage("drop_arrow_down_sel");
public static final Image DROP_ARROW_UP_NORL = getPngImage("drop_arrow_up_nor");
- public static final Image DROP_ARROW_UP_SEL = getPngImage("drop_arrow_up_sel");
public static final Image BIG_RIGHT_ARROW = getPngImage("da_drop_arrow_nor");
- public static final Image DVICE_MOBILE_NOR = getPngImage("dvice_mobile_nor");
- public static final Image DVICE_MOBILE_OVER = getPngImage("dvice_mobile_over");
- public static final Image DVICE_MOBILE_SEL = getPngImage("dvice_mobile_sel");
- public static final Image DVICE_TV_NOR = getPngImage("dvice_tv_nor");
- public static final Image DVICE_TV_OVER = getPngImage("dvice_tv_over");
- public static final Image DVICE_TV_SEL = getPngImage("dvice_tv_sel");
- public static final Image DVICE_WEARABLE_NOR = getPngImage("dvice_wearable_nor");
- public static final Image DVICE_WEARABLE_OVER = getPngImage("dvice_wearable_over");
- public static final Image DVICE_WEARABLE_SEL = getPngImage("dvice_wearable_sel");
public static final Image EMULATOR_TITLE_BG_02 = getPngImage("emulator_title_bg_02");
- public static final Image END_MARKER = getPngImage("end_marker");
- public static final Image IC_ZOOM = getPngImage("ic_zoom");
- public static final Image IC_ZOOM_OUT = getPngImage("ic_zoom_out");
- public static final Image MARKER = getPngImage("marker");
- public static final Image P_ARROW_B = getPngImage("p_arrow_b");
- public static final Image P_ARROW_R = getPngImage("p_arrow_r");
- public static final Image START_MARKER = getPngImage("start_marker");
- public static final Image TIP_BOX_ARROW = getPngImage("tip_box_arrow");
public static final Image TOGGLE_OFF = getPngImage("toggle_off");
public static final Image TOGGLE_ON = getPngImage("toggle_on");
public static final Image TOGGLE_OFF_DIM = getPngImage("toggle_off_dim");
public static final Image TOGGLE_ON_DIM = getPngImage("toggle_on_dim");
- public static final Image TOOLTIP_ICON_FOC = getPngImage("tooltip_icon_foc");
- public static final Image TOOLTIP_ICON_NOR = getPngImage("tooltip_icon_nor");
- public static final Image ZOOM_IN_ICON = getPngImage("zoom_in_icon");
- public static final Image ZOOM_IN_ICON_MV = getPngImage("zoom_in_icon_mv");
- public static final Image ZOOM_OUT_ICON = getPngImage("zoom_out_icon");
- public static final Image ZOOM_OUT_ICON_MV = getPngImage("zoom_out_icon_mv");
-
+
/** target dialog **/
public static final Image CONNECT_BTN_NOR = getPngImage("btn_connect_nor");
public static final Image CONNECT_BTN_OVER = getPngImage("btn_connect_over");
public static final Image CONNECT_BTN_SEL = getPngImage("btn_connect_sel");
+
+ /**
+ * Next resources migrated from org.tizen.dynamicanalyzer.widgets plugin.
+ */
+
+ /* timeline */
+ public static final Image TIMELINE_DETAILED_TIME_BALLOON = getPngImage("timeline_mouse_x"); //$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_ALL_SIZE_RESTORE = getPngImage("time_line_size_restore"); //$NON-NLS-1$
+ public static final Image CHART_ALL_SIZE_MIN = getPngImage("time_line_size_min"); //$NON-NLS-1$
+
+ //[UX] 05 Feature list - B
+ public static final Image CHART_FULL_NORMAL = getPngImage("ic_zoom"); //$NON-NLS-1$
+ public static final Image CHART_FULL_PUSH = getPngImage("ic_zoom"); //$NON-NLS-1$
+ public static final Image CHART_FULL_HOVER = getPngImage("ic_zoom"); //$NON-NLS-1$
+ public static final Image CHART_RESTORE_NORMAL = getPngImage("ic_zoom_out"); //$NON-NLS-1$
+ public static final Image CHART_RESTORE_PUSH = getPngImage("ic_zoom_out"); //$NON-NLS-1$
+ public static final Image CHART_RESTORE_HOVER = getPngImage("ic_zoom_out"); //$NON-NLS-1$
+
+ public static final Image CHART_INFO = getPngImage("process_info"); //$NON-NLS-1$
+
+ /*** context child arrow ***/
+ public static final Image CONTEXT_OPEN = getPngImage("context_menu_child_arrow"); //$NON-NLS-1$
+
+ // check box
+ 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$
+
+ public static final Image MARKER = getPngImage("marker");
+ public static final Image MARKER_NOR = getPngImage("marker_nor");
+ public static final Image ZOOM_IN_ICON = getPngImage("zoom_in_icon");
+ public static final Image ZOOM_OUT_ICON = getPngImage("zoom_out_icon");
+ public static final Image ZOOM_CONTROL = getPngImage("zoom_control");
+ public static final Image CHILD_CHART_FOLD = getPngImage("child_chart_fold");
+ public static final Image CHILD_CHART_FOLD_HOVER = getPngImage("child_chart_fold_hover");
+ public static final Image CHILD_CHART_UNFOLD = getPngImage("child_chart_unfold");
+ public static final Image CHILD_CHART_UNFOLD_HOVER = getPngImage("child_chart_unfold_hover");
+
private static Image getImage(String pluginId, String folderName,
String imageName, String extension) {
if (null == imageRegistry.get(imageName)
|| imageRegistry.get(imageName).isDisposed()) {
ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(
pluginId, folderName + imageName + extension);
+ if (desc == null) {
+ Logger.warning("Image resource not found: %s", folderName + imageName + extension);
+ }
imageRegistry.put(imageName, desc);
}
return getImage(ID, getTheme().getImagePath(), imageName, extension);
}
- private static Image getImageFromWorkbench(String imageName) {
- return getImage(WORKBENCH_ID, ICON_WORKBENCH_FOLDER_NAME
- + File.separator, imageName,
- CommonConstants.EXTENSION_PNG_IMAGE);
- }
-
private static Image getPngImage(String imageName) {
return getImage(imageName, CommonConstants.EXTENSION_PNG_IMAGE);
}
-
- private static Image getGifImage(String imageName) {
- return getImage(imageName, CommonConstants.EXTENSION_GIF_IMAGE);
- }
}
+++ /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.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("dark_yellow", new RGB(147, 120, 0));
- 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 end **/
-
- /*** 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$
- setColor("table_contents_failed_bacgound_color", new RGB(244,199,197)); //$NON-NLS-1$
- setColor("table_contents_failed_font_color", new RGB(212,75,69)); //$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(84,113,119));
- 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$
-
- /** Network chart colors **/
- setColor("network_api_used", new RGB(15, 153, 232)); //$NON-NLS-1$
- setColor("network_api_failed", new RGB(226, 65, 73)); //$NON-NLS-1$
- setColor("network_area_fd_used_start", new RGB(255,222,125)); //$NON-NLS-1$
- setColor("network_area_fd_used_end", new RGB(255,186,29)); //$NON-NLS-1$
- setColor("network_area_closed_start", new RGB(168, 198, 71)); //$NON-NLS-1$
- setColor("network_area_closed_end", new RGB(130, 152, 54)); //$NON-NLS-1$
- setColor("network_area_not_closed_start", new RGB(178, 178, 178)); //$NON-NLS-1$
- setColor("network_area_not_closed_end", new RGB(106, 106, 106)); //$NON-NLS-1$
- setColor("network_area_connected_start", new RGB(123,182,240)); //$NON-NLS-1$
- setColor("network_area_connected_end", new RGB(65,141,218)); //$NON-NLS-1$
- setColor("network_access_recv", new RGB(64, 126, 18)); //$NON-NLS-1$
- setColor("network_access_send", new RGB(147, 21, 173)); //$NON-NLS-1$
- setColor("network_access_wait", new RGB(190,190,190)); //$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$
-
- /*** contextMenu ***/
- setColor("context_menu_title_background_color", new RGB(247, 247, 247)); //$NON-NLS-1$
- setColor("context_menu_title_font_color", new RGB(0, 45, 96)); //$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>
- * 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("dark_yellow", new RGB(147, 120, 0));
- 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));
-
- setColor("point", new RGB(0, 138, 238));
-
- // shell window background color
- setColor("window_bg_color", new RGB(160, 160, 160)); //$NON-NLS-1$
- setColor("dialg_bg_upper", new RGB(232, 234, 235));
- 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(232, 234, 235));
- setColor("edit_chart_dialog_lower", new RGB(240, 240, 240));
- setColor("edit_chart_table_separate_color", new RGB(136, 137, 138));
- setColor("edit_chart_button_normal_color_start", new RGB(231, 231, 231)); //$NON-NLS-1$
- setColor("edit_chart_button_normal_color_end", new RGB(177, 177, 177)); //$NON-NLS-1$
- setColor("edit_chart_button_hover_color_start", new RGB(231, 231, 231)); //$NON-NLS-1$
- setColor("edit_chart_button_hover_color_end", new RGB(177, 177, 177)); //$NON-NLS-1$
- setColor("edit_chart_button_push_color_start", new RGB(177, 177, 177)); //$NON-NLS-1$
- setColor("edit_chart_button_push_color_end", new RGB(231, 231, 231)); //$NON-NLS-1$
- setColor(
- "edit_chart_button_outline_normal_color", new RGB(154, 154, 154)); //$NON-NLS-1$
- setColor("edit_chart_button_outline_hover_color", new RGB(45, 180, 200)); //$NON-NLS-1$
- setColor("edit_chart_button_outline_push_color", new RGB(154, 154, 154)); //$NON-NLS-1$
- setColor(
- "edit_chart_button_inline_normal_color", new RGB(255, 255, 255)); //$NON-NLS-1$
- setColor("edit_chart_button_inline_hover_color", new RGB(255, 255, 255)); //$NON-NLS-1$
- setColor("edit_chart_button_inline_push_color", new RGB(255, 255, 255)); //$NON-NLS-1$
-
- setColor("view_border", new RGB(206, 206, 206)); //$NON-NLS-1$
- setColor("view_border_1", new RGB(160, 160, 160)); //$NON-NLS-1$
- setColor("view_border_2", new RGB(232, 234, 235)); //$NON-NLS-1$
- setColor("view_border_3", new RGB(186, 186, 186)); //$NON-NLS-1$
- setColor("view_bg_color", new RGB(230, 230, 230)); //$NON-NLS-1$
- getColor("view_title_font_color", new RGB(255, 255, 255));
-
- setColor("coolbar_bg_color", new RGB(45, 180, 200)); //$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(104, 156, 166)); //$NON-NLS-1$
- setColor("titlebar_end_color", new RGB(55, 105, 114)); //$NON-NLS-1$
- setColor("titlebar_bottom_stroke_1", new RGB(115, 115, 115));
- setColor("titlebar_bottom_stroke_2", new RGB(160, 160, 160));
-
-
- /*** combo button gradation ***/
- setColor("toolbar_combo_normal_start", new RGB(63,180,198)); //$NON-NLS-1$
- setColor("toolbar_combo_normal_end", new RGB(26,128,144)); //$NON-NLS-1$
- setColor("toolbar_combo_hover_start", new RGB(63,180,198)); //$NON-NLS-1$
- setColor("toolbar_combo_hover_end", new RGB(26,128,144)); //$NON-NLS-1$
- setColor("toolbar_combo_push_start", new RGB(26,128,144)); //$NON-NLS-1$
- setColor("toolbar_combo_push_end", new RGB(63,185,198)); //$NON-NLS-1$
- setColor("toolbar_combo_disable_start", new RGB(50,171,189)); //$NON-NLS-1$
- setColor("toolbar_combo_disable_end", new RGB(50,171,189)); //$NON-NLS-1$
-
- setColor("toolbar_combo_outline_normal_in_color", new RGB(240,240,240)); //$NON-NLS-1$
- setColor("toolbar_combo_outline_hover_in_color", new RGB(0,38,45)); //$NON-NLS-1$
- setColor("toolbar_combo_outline_push_in_color", new RGB(240,240,240)); //$NON-NLS-1$
- setColor("toolbar_combo_outline_disable_in_color", new RGB(119,223,238)); //$NON-NLS-1$
-
- setColor("toolbar_combo_button_normal_color", new RGB(206,206,206)); //$NON-NLS-1$
- setColor("toolbar_combo_button_hover_color", new RGB(45,180,200)); //$NON-NLS-1$
- setColor("toolbar_combo_button_push_color", new RGB(24,147,189)); //$NON-NLS-1$
- setColor("toolbar_combo_button_disable_color", new RGB(206,206,206)); //$NON-NLS-1$
-
- setColor("toolbar_combo_arrow_outline_color", new RGB(47,85,92)); //$NON-NLS-1$
- setColor("toolbar_combo_font_normal_color", new RGB(255,255,255)); //$NON-NLS-1$
- setColor("toolbar_combo_font_disable_color", new RGB(119,223,238)); //$NON-NLS-1$
-
- /** title tab combo color **/
- setColor("tab_combo_normal_start", new RGB(251, 251, 251));
- setColor("tab_combo_normal_end", new RGB(207, 207, 207));
- setColor("tab_combo_normal_stroke", new RGB(168, 168, 168));
- setColor("tab_combo_hover_start", new RGB(251, 251, 251));
- setColor("tab_combo_hover_end", new RGB(207, 207, 207));
- setColor("tab_combo_hover_stroke", new RGB(47, 180, 200));
- setColor("tab_combo_push_start", new RGB(207, 207, 207));
- setColor("tab_combo_push_end", new RGB(251, 251, 251));
- setColor("tab_combo_push_stroke", new RGB(47, 180, 200));
-
- /*** title combo color ***/
- setColor("frame_rate_combo_normal_start", new RGB(251, 251, 251));
- setColor("frame_rate_combo_normal_end", new RGB(207, 207, 207));
- setColor("frame_rate_combo_push_start", new RGB(207, 207, 207));
- setColor("frame_rate_combo_push_end", new RGB(251, 251, 251));
- setColor("frame_rate_combo_hover_start", new RGB(251, 251, 251));
- setColor("frame_rate_combo_hover_end", new RGB(207, 207, 207));
- setColor("frame_rate_combo_disable_start", new RGB(251, 251, 251));
- setColor("frame_rate_combo_disable_end", new RGB(207, 207, 207));
-
- setColor("frame_rate_combo_outline_disable", new RGB(168, 168, 168));
- setColor("frame_rate_combo_outline_normal", new RGB(168, 168, 168));
- setColor("frame_rate_combo_outline_hover", new RGB(47, 85, 92));
- setColor("frame_rate_combo_outline_push", new RGB(168, 168, 168));
-
- /*** combo arrow button color ***/
- setColor("device_application_button_normal", new RGB(206, 206, 206)); //$NON-NLS-1$
- setColor("device_application_button_push", new RGB(24, 147, 189)); //$NON-NLS-1$
- setColor("device_application_button_hover", new RGB(45, 180, 200)); //$NON-NLS-1$
- setColor("device_application_button_disable", new RGB(206, 206, 206)); //$NON-NLS-1$
- setColor("device_application_button_outline", new RGB(47, 85, 92));
-
- /*** 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$
- setColor("table_contents_failed_bacgound_color", new RGB(244, 199, 197)); //$NON-NLS-1$
- setColor("table_contents_failed_font_color", new RGB(212, 75, 69)); //$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(232, 234, 235));
- setColor("tab_selected_color_end", new RGB(232, 234, 235));
- setColor("tab_normal_color_start", new RGB(84, 113, 119));
- setColor("tab_normal_color_end", new RGB(39, 75, 82));
- setColor("tab_hover_color_start", new RGB(39, 81, 89));
- setColor("tab_hover_color_end", new RGB(15, 45, 50));
- setColor("tab_push_color_start", new RGB(15, 45, 50));
- setColor("tab_push_color_end", new RGB(39, 81, 89));
-
- setColor("tab_outline_normal_color", new RGB(0, 0, 0));
- setColor("tab_outline_push_color", new RGB(106, 154, 163));
- setColor("tab_outline_hover_color", new RGB(106, 154, 163));
- setColor("tab_outline_selected_color", new RGB(232, 234, 235));
-
-// setColor("tab_selected_font_color", new RGB(50, 55, 60));
- setColor("tab_selected_font_color", new RGB(0, 162, 232));
- setColor("tab_normal_font_color", new RGB(228, 228, 228));
- setColor("tab_hover_font_color", new RGB(228, 228, 228));
- setColor("tab_push_font_color", new RGB(228, 228, 228));
-
-
- setColor("tab_bg_color", new RGB(63,180,198));
- setColor("tab_bg_color_start", new RGB(21, 38, 41));
- setColor("tab_bg_color_end", new RGB(27, 70, 78));
- setColor("tab_bg_outline_color", new RGB(63,180,198));
-
- /** 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(131, 207, 232)); //$NON-NLS-1$
- setColor("file_access_write",new RGB(131, 207, 232)); //$NON-NLS-1$
- setColor("file_access_concurrent_read", new RGB(40, 160, 198)); //$NON-NLS-1$
- setColor("file_access_concurrent_write", new RGB(40, 160, 198)); //$NON-NLS-1$
- setColor("file_lock", new RGB(229, 123, 206)); //$NON-NLS-1$
- setColor("file_unlock", new RGB(125, 61, 204)); //$NON-NLS-1$
- setColor("file_lock_waiting", new RGB(194, 79, 167)); //$NON-NLS-1$
- setColor("file_other_operation", new RGB(173, 173, 173)); //$NON-NLS-1$
- setColor("file_other_operation", new RGB(173, 173, 173)); //$NON-NLS-1$
- setColor("file_opened", new RGB(90, 200, 177)); //$NON-NLS-1$
- setColor("file_duplicate_opened", new RGB(71, 169, 149)); //$NON-NLS-1$
-
- /** Network chart colors **/
- setColor("network_api_used", new RGB(15, 153, 232)); //$NON-NLS-1$
- setColor("network_api_failed", new RGB(226, 65, 73)); //$NON-NLS-1$
- setColor("network_area_fd_used_start", new RGB(255, 222, 125)); //$NON-NLS-1$
- setColor("network_area_fd_used_end", new RGB(255, 186, 29)); //$NON-NLS-1$
- setColor("network_area_closed_start", new RGB(168, 198, 71)); //$NON-NLS-1$
- setColor("network_area_closed_end", new RGB(130, 152, 54)); //$NON-NLS-1$
- setColor("network_area_not_closed_start", new RGB(178, 178, 178)); //$NON-NLS-1$
- setColor("network_area_not_closed_end", new RGB(106, 106, 106)); //$NON-NLS-1$
- setColor("network_area_connected_start", new RGB(123, 182, 240)); //$NON-NLS-1$
- setColor("network_area_connected_end", new RGB(65, 141, 218)); //$NON-NLS-1$
- setColor("network_access_recv", new RGB(64, 126, 18)); //$NON-NLS-1$
- setColor("network_access_send", new RGB(147, 21, 173)); //$NON-NLS-1$
- setColor("network_access_wait", new RGB(190, 190, 190)); //$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("GRAY_220", new RGB(220, 220, 220)); //$NON-NLS-1$
- setColor("GRAY_230", new RGB(230, 230, 230)); //$NON-NLS-1$
- setColor("GRAY_245", new RGB(245, 245, 245)); //$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", new RGB(123, 182, 240)); //$NON-NLS-1$
- setColor("lifecycle_running", new RGB(194, 238, 131)); //$NON-NLS-1$
- setColor("lifecycle_pausing", new RGB(190, 190, 190)); //$NON-NLS-1$
- setColor("lifecycle_terminating", new RGB(223, 143, 140)); //$NON-NLS-1$
-
- setColor("add_chart_normal_stroke", new RGB(168, 168, 168)); //$NON-NLS-1$
- setColor("add_chart_hover_stroke", new RGB(47, 85, 92)); //$NON-NLS-1$
- setColor("add_chart_push_stroke", new RGB(168, 168, 168)); //$NON-NLS-1$
-
- setColor("add_chart_normal_start", new RGB(251, 251, 251)); //$NON-NLS-1$
- setColor("add_chart_normal_end", new RGB(207, 207, 207)); //$NON-NLS-1$
- setColor("add_chart_hover_start", new RGB(251, 251, 251)); //$NON-NLS-1$
- setColor("add_chart_hover_end", new RGB(207, 207, 207)); //$NON-NLS-1$
- setColor("add_chart_push_start", new RGB(207, 207, 207)); //$NON-NLS-1$
- setColor("add_chart_push_end", new RGB(251, 251, 251)); //$NON-NLS-1$
- setColor("add_chart_font_color", new RGB(71, 71, 71)); //$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", new RGB(163, 243, 255)); //$NON-NLS-1$
- setColor("add_chart_disable_color", new RGB(240, 240, 240)); //$NON-NLS-1$
- setColor("add_chart_enable_title_color", new RGB(0, 0, 0)); //$NON-NLS-1$
- setColor("add_chart_disable_title_color", new RGB(153, 153, 153)); //$NON-NLS-1$
- setColor("add_chart_enable_descript_color", new RGB(0, 0, 0)); //$NON-NLS-1$
- setColor("add_chart_disable_descript_color", new RGB(163, 163, 163)); //$NON-NLS-1$
- setColor("add_chart_enable_hover_color", new RGB(122, 218, 233)); //$NON-NLS-1$
- setColor("add_chart_disable_hover_color", new RGB(216, 216, 216)); //$NON-NLS-1$
- setColor("add_chart_drag_color", new RGB(222, 222, 222)); //$NON-NLS-1$
-
- /** Timeline chart **/
- setColor("seriesColorCPUSystem", new RGB(131, 207, 232)); //$NON-NLS-1$
- setColor("seriesColorCPUApp", new RGB(125, 161, 60)); //$NON-NLS-1$
-
- setColor("seriesColorCPUCoreCore0", new RGB(40, 160, 198)); //$NON-NLS-1$
- setColor("seriesColorCPUCoreCore1", new RGB(125, 161, 60)); //$NON-NLS-1$
- setColor("seriesColorCPUCoreCore2", new RGB(194, 79, 167)); //$NON-NLS-1$
- setColor("seriesColorCPUCoreCore3", new RGB(71, 169, 149)); //$NON-NLS-1$
- setColor("seriesColorCPUCoreCore4", new RGB(203, 136, 39)); //$NON-NLS-1$
- setColor("seriesColorCPUCoreCore5", new RGB(88, 99, 212)); //$NON-NLS-1$
- setColor("seriesColorCPUCoreCore6", new RGB(164, 43, 191)); //$NON-NLS-1$
- setColor("seriesColorCPUCoreCore7", new RGB(191, 89, 43)); //$NON-NLS-1$
-
- setColor("seriesColorHeapSystem", new RGB(131, 207, 232)); //$NON-NLS-1$
- setColor("seriesColorHeapApp", new RGB(88, 99, 212)); //$NON-NLS-1$
-
- setColor("seriesColorProcessVSS", new RGB(131, 207, 232)); //$NON-NLS-1$
- setColor("seriesColorProcessRSS", new RGB(164, 43, 191)); //$NON-NLS-1$
- setColor("seriesColorProcessPSS", new RGB(206, 177, 77)); //$NON-NLS-1$
-
- setColor("seriesColorMemorySysMax", new RGB(90, 200, 177)); //$NON-NLS-1$
- setColor("seriesColorMemorySysUsed", new RGB(88, 99, 212)); //$NON-NLS-1$
- setColor("seriesColorMemoryAppUsed", new RGB(229, 123, 206)); //$NON-NLS-1$
-
- setColor("seriesColorNetworkIOSend", new RGB(194, 79, 167)); //$NON-NLS-1$
- setColor("seriesColorNetworkIOReceive", new RGB(88, 99, 212)); //$NON-NLS-1$
-
- setColor("seriesColorDiskIOReadByte", new RGB(164, 43, 191)); //$NON-NLS-1$
- setColor("seriesColorDiskIOWriteByte", new RGB(194, 79, 167)); //$NON-NLS-1$
- setColor("seriesColorDiskIOReadSector", new RGB(131, 207, 232)); //$NON-NLS-1$
- setColor("seriesColorDiskIOWriteSector", new RGB(229, 123, 206)); //$NON-NLS-1$
-
- setColor("seriesColorDeviceWifi", new RGB(164, 43, 191)); //$NON-NLS-1$
- setColor("seriesColorDeviceBluetooth", new RGB(88, 99, 212)); //$NON-NLS-1$
- setColor("seriesColorDeviceGPS", new RGB(203, 136, 39)); //$NON-NLS-1$
- setColor("seriesColorDeviceDNet", new RGB(161, 137, 60)); //$NON-NLS-1$
- setColor("seriesColorDeviceCamera", new RGB(229, 123, 206)); //$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(216, 160, 76)); //$NON-NLS-1$
-
- setColor("seriesColorInteractiveBefore", new RGB(129, 172, 50)); //$NON-NLS-1$
- setColor("seriesColorInteractiveAfter", new RGB(194, 79, 167)); //$NON-NLS-1$
-
- setColor("selectionRange", new RGB(43, 80, 201)); //$NON-NLS-1$
- setColor("selectionLine", new RGB(43, 80, 201)); //$NON-NLS-1$
-
- /** UI Hierarchy */
- setColor("treeviewBg", new RGB(78, 84, 93));
- setColor("treeviewLine", new RGB(181, 181, 181));
- setColor("treeviewNormalNodeBgStart", new RGB(134, 141, 152));
- setColor("treeviewNormalNodeBgEnd", new RGB(106, 112, 121));
- setColor("treeviewSearchNodeBgStart", new RGB(42, 168, 186));
- setColor("treeviewSearchNodeBgEnd", new RGB(33, 143, 159));
- setColor("treeviewNodeHoverOutline", new RGB(34, 227, 255));
- setColor("treeviewNodeSelectOutline", new RGB(255, 186, 0));
- setColor("treeviewNodeTypeName", new RGB(255, 255, 255));
- setColor("treeviewNodeRenderTime", new RGB(45, 45, 45));
- setColor("treeviewNodeInfoBG", new RGB(216, 223, 235));
- setColor("treeviewNodeInfoName", new RGB(0, 0, 0));
- setColor("treeviewNodeInfoDescript", new RGB(80, 80, 80));
- setColor("treeviewNodeInfoError", new RGB(39, 153, 118));
- setColor("treeviewTopToolbarBG", new RGB(130, 130, 130));
- setColor("treeviewTopToolbarSunken", new RGB(199, 199, 199));
- setColor("treeviewToolbarText", new RGB(255, 255, 255));
- setColor("treeviewBottomToolbarBG", new RGB(232, 234, 235));
- setColor("filterComboText", new RGB(0, 0, 0));
- setColor("searchText", new RGB(160, 160, 160));
- setColor("zoomBarText", new RGB(78, 84, 93));
- setColor("layoutviewNormalStroke", new RGB(181, 181, 181));
- setColor("layoutviewSelectedStroke", new RGB(255, 186, 0));
-
- /*** 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_min_cpu_load_color", new RGB(179, 236, 255)); //$NON-NLS-1$
- setColor("thread_graph_max_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(0, 148, 170)); //$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(232, 234, 235)); //$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$
-
- /*** contextMenu ***/
- setColor("context_menu_title_background_color", new RGB(247, 247, 247)); //$NON-NLS-1$
- setColor("context_menu_title_font_color", new RGB(0, 45, 96)); //$NON-NLS-1$
-
- /*** binary settings ***/
- setColor("binary_settings_input_box_color", new RGB(223, 223, 223)); //$NON-NLS-1$
- setColor("binary_settings_label_color", new RGB(122, 122, 122)); //$NON-NLS-1$
-
- /*** file explorer ***/
- setColor("explorer_select_start_color", new RGB(201, 242, 255)); //$NON-NLS-1$
- setColor("explorer_select_end_color", new RGB(109, 219, 255)); //$NON-NLS-1$
- setColor("explorer_cell_bg_color", new RGB(250, 250, 250)); //$NON-NLS-1$
- setColor("explorer_cell_line_color", new RGB(186, 186, 186)); //$NON-NLS-1$
-
-
- /*** setting ***/
- setColor("setting_stroke", new RGB(186, 186, 186)); //$NON-NLS-1$
- setColor("setting_sunken_line_1", new RGB(160, 160, 160)); //$NON-NLS-1$
- setColor("setting_sunken_line_2", new RGB(255, 255, 255)); //$NON-NLS-1$
- setColor("setting_title_background", new RGB(235, 252, 254)); //$NON-NLS-1$
- setColor("setting_overhead_background", new RGB(230, 230, 230)); //$NON-NLS-1$
-
- setColor("setting_button_normal_color", new RGB(255, 255, 255)); //$NON-NLS-1$
- setColor("setting_button_hover_color", new RGB(197, 231, 235)); //$NON-NLS-1$
- setColor("setting_button_push_color", new RGB(197, 231, 235)); //$NON-NLS-1$
- setColor("setting_button_disable_color", new RGB(255, 255, 255)); //$NON-NLS-1$
- setColor("setting_button_toggle_normal_color", new RGB(117, 223, 235)); //$NON-NLS-1$
- setColor("setting_button_toggle_hover_color", new RGB(197, 231, 235)); //$NON-NLS-1$
- setColor("setting_button_toggle_push_color", new RGB(197, 231, 235)); //$NON-NLS-1$
-
- setColor("setting_font_color", new RGB(80, 80, 80)); //$NON-NLS-1$
- setColor("setting_warning_font_color", new RGB(208, 79, 15)); //$NON-NLS-1$
-
- /** setting table colors start **/
- setColor("setting_table_header_bg", new RGB(235, 252, 254)); //$NON-NLS-1$
- setColor("setting_table_contents_normal_odd", new RGB(255, 255, 255)); //$NON-NLS-1$
- setColor("setting_table_contents_normal_even", new RGB(240, 240, 240)); //$NON-NLS-1$
- setColor("setting_table_contents_hover", new RGB(197, 231, 235)); //$NON-NLS-1$
- setColor("setting_table_contents_selected", new RGB(117, 223, 235)); //$NON-NLS-1$
- setColor("setting_table_contents_parent", new RGB(240, 242, 245)); //$NON-NLS-1$
- setColor("setting_table_contents_child", new RGB(255, 255, 255)); //$NON-NLS-1$
- setColor("setting_table_contents_selected_font_color", new RGB(80, 80, 80)); //$NON-NLS-1$
- setColor("setting_table_title_font_color", new RGB(0, 0, 0)); //$NON-NLS-1$
- setColor("setting_table_contents_font_color", new RGB(80, 80, 80)); //$NON-NLS-1$
- /** setting table colors end **/
-
- setColor("feature_overhead_ranking_normal", new RGB(50, 50, 50)); //$NON-NLS-1$
- setColor("feature_overhead_ranking_middle", new RGB(208, 79, 15)); //$NON-NLS-1$
- setColor("feature_overhead_ranking_high", new RGB(255, 0, 0)); //$NON-NLS-1$
-
- /** filter dialog **/
- setColor("filter_dialog_default_background_color", new RGB(232, 234, 235)); //$NON-NLS-1$
- setColor("filter_dialog_white_background_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);
- }
-
-}
import org.tizen.dynamicanalyzer.cli.commands.ExitCode;
import org.tizen.dynamicanalyzer.cli.commands.StartCommand;
import org.tizen.dynamicanalyzer.cli.commands.StopCommand;
+import org.tizen.dynamicanalyzer.cli.commands.VersionCommand;
/**
* Main CLI front-end class
new DevicesCommand(),
new AppsCommand(),
new StartCommand(),
- new StopCommand() };
+ new StopCommand(),
+ new VersionCommand() };
/**
* Prints help message.
UILayoutDataManager.INSTANCE.addSelectedChart(feature.getChart());
}
+ SettingDataManager.INSTANCE.setPreferenceSelected(FlatPreferences.LEAK_SANITIZER,
+ args.getLSanPreference());
+
return true;
}
TargetData target = SettingDataManager.INSTANCE.getTarget(null);
target.addSelectedFlatFeature(ConfigureLabels.FEATURE_NAME_SCREENSHOT);
if (onSceneTransition) {
- SettingDataManager.INSTANCE.addOptionsSelectedPreference(
+ SettingDataManager.INSTANCE.setPreferenceValue(
FlatPreferences.SCREENSHOT_ON_SCENE_TRANSITION, 1);
Logger.debug("Screenshots are captured on scene transition.");
} else {
SettingDataManager.INSTANCE
- .deleteOptionsSelectedPreference(FlatPreferences.SCREENSHOT_ON_SCENE_TRANSITION);
+ .deletePreference(FlatPreferences.SCREENSHOT_ON_SCENE_TRANSITION);
}
if (period > 0){
- SettingDataManager.INSTANCE.addOptionsSelectedPreference(
+ SettingDataManager.INSTANCE.setPreferenceValue(
FlatPreferences.SCREENSHOT_PERIODICALLY, period);
Logger.debug("Screenshots are captured every " + period + " sec.");
} else {
SettingDataManager.INSTANCE
- .deleteOptionsSelectedPreference(FlatPreferences.SCREENSHOT_PERIODICALLY);
+ .deletePreference(FlatPreferences.SCREENSHOT_PERIODICALLY);
}
UILayoutDataManager.INSTANCE
.addSelectedChart(TimelineChartLabels.SCREENSHOT_CHART_TITLE);
--- /dev/null
+package org.tizen.dynamicanalyzer.cli.commands;
+
+import org.tizen.dynamicanalyzer.common.AboutInfo;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+
+/**
+ * Class representing 'version' command.
+ */
+public class VersionCommand extends Command {
+
+ /**
+ * Default constructor.
+ */
+ public VersionCommand() {
+ super("version", 0, "print information about version");
+ }
+
+ @Override
+ public ExitCode processCommand(String[] args) {
+ String format = "%s\t%s";
+ AboutInfo info = AboutInfo.getInstance();
+
+ String version = String.format(format, AnalyzerLabels.ABOUT_DIALOG_DA_VERSION, info.getDAVersion());
+ System.out.println(version);
+
+ String buildId = String.format(format, AnalyzerLabels.ABOUT_DIALOG_BUILD_TIME, info.getDABuildID());
+ System.out.println(buildId);
+
+ String tizenSite = String.format(format, AnalyzerLabels.ABOUT_DIALOG_TIZEN_SITE, info.getTizenSite());
+ System.out.println(tizenSite);
+
+ String releaseNote = String.format(format, AnalyzerLabels.ABOUT_DIALOG_RELEASE_NOTE, info.getReleaseNote());
+ System.out.println(releaseNote);
+
+ return ExitCode.EX_SUCCESS;
+ }
+}
Logger.info("Starting Process Manager Agent.");
// set JVM shutdown hook
- Runtime.getRuntime().addShutdownHook(new Thread(){
+ Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
@Override
public void run() {
// Stop all tracing processes
ProcessManagerHolder.INSTANCE.stopAll();
}
- });
+ }, "PM Shutdown Hook"));
try {
startProcessManager();
package org.tizen.dynamicanalyzer.cli.manager;
-import java.io.BufferedWriter;
import java.io.File;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
-import java.io.OutputStreamWriter;
import java.lang.ProcessBuilder.Redirect;
import java.net.ServerSocket;
import java.net.Socket;
-import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
}
/**
- * pipe to TracingProcess to send port
- */
- static BufferedWriter bw;
-
- /**
* Execute new tracing process with specified arguments and wrap it with {@link TracingProcessManager}.
*
* @param args tracing arguments
args.setOutput(output);
}
+ ServerSocket ss = getServerSocket();
+ commandLine.add(Integer.toString(ss.getLocalPort()));
+
// add tracing arguments
commandLine.addAll(Arrays.asList(TracingArgumentsParser.toStringArray(args)));
// actually start separate tracing process
Process process = pBuilder.start();
// send communication port number to tracing process
- bw = new BufferedWriter(new OutputStreamWriter(
- process.getOutputStream(), StandardCharsets.UTF_8));
- ServerSocket ss = getServerSocket();
- try {
- bw.write(Integer.toString(ss.getLocalPort()));
- bw.newLine();
- bw.flush();
- } catch (IOException e2) {
+ TracingProcessManager tpManager = new TracingProcessManager(args,
+ process, ss);
+ if (!tpManager.communicationProcessor.isInitSuccessful()) {
+ tpManager.forceStopTracing();
+ throw new IOException("Tracing process was not started successfully");
}
-
- return new TracingProcessManager(args, process, ss);
+ return tpManager;
}
/**
private long durationSec; // tracing duration in seconds (0 is for unlimited duration)
private int screenshotPeriod = 0; // Screenshot period in seconds
private boolean screenshotOnSceneTransition = false;// take screenshots on scene transition or not
+ private boolean lsanSelected = false; // whether LSan analysis is selected
private String errMessage; // contains message about all found errors during validation ( isValid() )
if (featuresSet.isEmpty()) {
result = false;
msg += " * At least one feature for tracing must be selected%n";
+ } else if (lsanSelected) {
+ if (!featuresSet.contains(PrimitiveFeature.MEMORY_ALLOC)) {
+ result = false;
+ msg += " * LeakSanitizer works only with Heap Allocation feature%n";
+ }
+
+ if (featuresSet.contains(PrimitiveFeature.THREAD_ANALYSIS)) {
+ result = false;
+ msg += " * LeakSanitizer does not work with Thread Analysis feature%n";
+ }
}
errMessage = result ? "" : String.format(msg).trim();
}
/**
+ * @return <code>true</code> if LeakSanitizer analysis is selected.
+ */
+ public boolean getLSanPreference() {
+ return lsanSelected;
+ }
+
+ /**
+ * @param selected whether LeakSanitizer analysis should be selected
+ * @return this object to allow chained methods execution
+ */
+ public TracingArguments setLSanPreference(boolean selected) {
+ lsanSelected = selected;
+ return this;
+ }
+
+ /**
* @return the featuresList list of features selected for tracing
*/
public Set<PrimitiveFeature> getFeatures() {
import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
+import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.util.Logger;
/**
.desc("Enable screenshots capturing on scene transition")
.build();
+ private static Option lsan = Option.builder("L")
+ .longOpt("leak-sanitizer")
+ .desc("select LeakSanitizer analysis tracing" + CommonConstants.NEW_LINE
+ + "Works only if 'heap' memory tracing is selected and does not work with thread analysis tracing")
+ .build();
+
private static Options opts = new Options();
static {
}
opts.addOption(screenshotPeriod);
opts.addOption(screenshotTransition);
+ opts.addOption(lsan);
}
/**
result.setScreenshotPeriod(periodInt);
}catch(NumberFormatException nfe){
throw new ParseException(
- " * Screenshot period is not numeric%n");
+ "Screenshot period is not numeric" + CommonConstants.NEW_LINE);
}
}
}
// Get features
TracingFeatureArgument.parseFeatureOptions(result, cmdline);
+ // Parse LSan option
+ result.setLSanPreference(cmdline.hasOption(lsan.getOpt()));
+
// Check if there are any extra arguments
if (cmdline.getArgList() != null && !cmdline.getArgList().isEmpty())
throw new ParseException("Too many arguments");
result.add(Integer.toString(period));
}
+ // lsan
+ if (args.getLSanPreference())
+ result.add('-' + lsan.getOpt());
+
// Features
result.addAll(TracingFeatureArgument.toStringArrayList(args));
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.ParseException;
+import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.setting.PrimitiveFeature;
/**
* @param longName long name of CLI option
*/
private TracingFeatureArgument(String name, String longName) {
- String desc = "select " + longName.replace("-", " ") + " tracing\n"
+ String desc = "select " + longName.replace("-", " ") + " tracing" + CommonConstants.NEW_LINE
+ "Possible arguments: ";
this.option = Option.builder(name).longOpt(longName).hasArgs()
.valueSeparator(',').optionalArg(true)
// remove last ',' symbol
defDesc = defDesc.substring(0, defDesc.length()-1);
}
- option.setDescription(desc + "\n" + defDesc + "' is selected");
+ option.setDescription(desc + CommonConstants.NEW_LINE + defDesc + "' is selected");
}
/**
package org.tizen.dynamicanalyzer.cli.tracing;
-import java.io.BufferedReader;
import java.io.IOException;
-import java.io.InputStreamReader;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.InetAddress;
import java.net.Socket;
-import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import org.apache.commons.cli.ParseException;
import org.tizen.dynamicanalyzer.cli.CliInternals;
-import org.tizen.dynamicanalyzer.cli.commands.ExitCode;
import org.tizen.dynamicanalyzer.cli.utils.Communicator;
import org.tizen.dynamicanalyzer.cli.utils.ProcessCommunicationProcessor;
import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode;
*/
public synchronized void stopTrace() {
tracingTime = System.nanoTime() / 1000 - startTime;
+ if (Global.getProject() == null) {
+ communicationProcessor.errorOccured(ErrorCode.ERR_TRACING_NOT_RUNNING.getErrorNumber());
+ return;
+ }
Global.getProject().setTotalStopTime(tracingTime);
CliInternals.stopTracing();
}
* {@link ErrorCode#ERR_EXCEPTION_OCCURRED} if critical or
* unexpected error occurred.
*/
- private static ErrorCode performAllTasks(String[] args, int port) {
+ private static ErrorCode performAllTasks(String[] args) {
Logger.init(InternalLogger.WARNING);
+ int port = Integer.parseInt(args[0]);
+
TracingArguments argsParsed = null;
+ args = Arrays.copyOfRange(args, 1, args.length);
try {
argsParsed = TracingArgumentsParser.parse(args);
socket.getInputStream());
ObjectOutputStream oos = new ObjectOutputStream(
socket.getOutputStream());
- ProcessCommunicationProcessor communicationProcessor = new ProcessCommunicationProcessor(
+ oos.flush();
+ tracingProcess.communicationProcessor = new ProcessCommunicationProcessor(
new Communicator(ois, oos), tracingProcess);
- commThread = new Thread(communicationProcessor);
+ commThread = new Thread(tracingProcess.communicationProcessor,
+ ProcessCommunicationProcessor.class.getSimpleName());
commThread.start();
} catch (IOException ioe) {
Logger.error("IOException in socket connection.");
return tracingProcess.getStatus();
}
- private static int getPort() {
- BufferedReader br = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8));
- // Reading of unique number of communication port
- try {
- return Integer.parseInt(br.readLine());
- } catch (NumberFormatException | IOException e) {
- System.exit(ExitCode.EX_CONNECTION_ERROR.getCode());
- }
- // unreachable instruction
- return 0;
- }
-
/**
* Entry point for tracing process.
* @param args input parameters for application
*/
public static void main(String[] args) {
- ErrorCode exitCode = performAllTasks(args, getPort());
+ ErrorCode exitCode = performAllTasks(args);
SystemExit.exit(exitCode.getErrorNumber());
}
* @throws IOException in case of {@link IOException} occurred
*/
public synchronized void sendMessage(Message message) throws IOException {
+ Logger.debug("sending " + message.getMessageType());
oos.writeObject(message);
oos.flush();
+ Logger.debug("sent " + message.getMessageType());
}
/**
switch (message.getMessageType()) {
case REQUEST__STOP_TRACING:
case REQUEST__TRACING_TIME:
+ case REQUEST__IS_ALIVE:
Logger.error("Wrong message for Manager");
break;
case SIGNAL__ERROR_OCCURED:
reportError(message);
break;
default:
+ Logger.debug("Got Message " + message.getMessageType());
responsePool.put(message.getTid(), message);
requestsPool.remove(message.getTid()).release();
break;
public void closeConnection() {
comm.stop();
}
+
+ public boolean isInitSuccessful() {
+ Thread t = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ Logger.debug("Sending REQUEST__IS_ALIVE");
+ long threadIndex = Thread.currentThread().getId();
+ Logger.debug("Curren thread is " + threadIndex);
+ getResponse(threadIndex, new Message(threadIndex,
+ MessageType.REQUEST__IS_ALIVE));
+ Logger.debug("Got Response__ALIVE");
+ }
+ });
+ t.start();
+ try {
+ t.join(10000);
+ if (t.isAlive()) {
+ Logger.debug("Tracing process does not answer.");
+ t.interrupt();
+ return false;
+ }
+ return true;
+ } catch (InterruptedException e) {
+ Logger.debug("Interrupted");
+ return false;
+ }
+ }
}
\ No newline at end of file
*/
REQUEST__TRACING_TIME,
/**
+ * Request process for it's status. Command have no arguments. Can be
+ * performed at any moment, but designed to be performed at very
+ * beginning.
+ */
+ REQUEST__IS_ALIVE,
+ /**
* Message is sent from process in response on command
* {@link REQUEST__STOP_TRACING}, have no arguments, sent right before
* process termination.
*/
RESPONSE__TRACING_TIME,
/**
+ * Message is sent from process in response on {@link REQUEST__IS_ALIVE},
+ * have no arguments, sent right after receiving of
+ * {@link REQUEST__IS_ALIVE} message.
+ */
+ RESPONSE__ALIVE,
+ /**
* Message sent from process to inform manager that in process occurred
* error that can not be ignored, and process failed.
*/
import org.tizen.dynamicanalyzer.cli.tracing.TracingProcess;
import org.tizen.dynamicanalyzer.cli.utils.Message.MessageType;
+import org.tizen.dynamicanalyzer.common.DAState;
import org.tizen.dynamicanalyzer.util.Logger;
/**
switch (message.getMessageType()) {
case RESPONSE__STOP_DONE:
case RESPONSE__TRACING_TIME:
+ case RESPONSE__ALIVE:
case SIGNAL__ERROR_OCCURED:
Logger.error("Wrong message for Process");
break;
Logger.error(e);
}
break;
+ case REQUEST__IS_ALIVE:
+ try {
+ Logger.debug("REQUEST__IS_ALIVE message got");
+ Logger.debug("TID = " + message.getTid());
+ Logger.debug("DAState is " + DAState.getCurrentState());
+ DAState.waitRunning();
+ if (DAState.isRunning()) {
+ comm.sendMessage(message.getTid(),
+ MessageType.RESPONSE__ALIVE);
+ }
+ Logger.debug("New DAState is " + DAState.getCurrentState());
+ Logger.debug("RESPONSE__ALIVE message sent");
+ } catch (Exception e) {
+ Logger.error(e);
+ }
+ break;
+ default:
+ Logger.error("Unknown message type.");
}
}
}
*/
public class TracingArgumentsParserTest {
+ // @formatter:off
private final static String device = "device";
private final static String application = "application";
private final static String applicationOpt = "-a";
private final static String featureOptCPU = "-C=usage";
private final static PrimitiveFeature memory1 = PrimitiveFeature.SYSTEM_MEMORY;
private final static PrimitiveFeature memory2 = PrimitiveFeature.PROCESS_MEMORY;
+ private final static PrimitiveFeature memory3 = PrimitiveFeature.MEMORY_ALLOC;
// Command line option for Memory feature group
private final static String featureOptMEMORY = "-M";
+ private final static String featureOptMEMORYHeap = "-M=heap";
private final static PrimitiveFeature file1 = PrimitiveFeature.DISK_IO;
private final static PrimitiveFeature file2 = PrimitiveFeature.FILE_ANALYSIS;
// Command line option for File feature group
private final static String outputOpt = "-o";
private final static long duration = 12345;
private final static String durationOpt = "-i";
+ private final static String lsanOpt = "-L";
+ private final static String featureOptTHREAD = "-T";
+ private final static PrimitiveFeature thread = PrimitiveFeature.THREAD_ANALYSIS;
+ // @formatter:on
@Before
public void setUp() {
assertNull(result);
}
+ @Test
+ public void parse_lsanWithHeapAlloc() throws Exception {
+ TracingArguments result = TracingArgumentsParser.parse(
+ new String[]{device, applicationOpt, application, featureOptMEMORYHeap, lsanOpt});
+ assertNotNull(result);
+ assertTrue(result.isValid());
+ assertTrue(result.getFeatures().contains(memory3));
+ assertTrue(result.getLSanPreference());
+ }
+
+ @Test(expected = ParseException.class)
+ public void parse_lsanWithoutHeapAlloc() throws Exception {
+ TracingArguments result = TracingArgumentsParser
+ .parse(new String[]{device, applicationOpt, application, lsanOpt});
+ assertNull(result);
+ }
+
+ @Test(expected = ParseException.class)
+ public void parse_lsanWithHeapAllocAndThread() throws Exception {
+ TracingArguments result = TracingArgumentsParser.parse(
+ new String[]{device, applicationOpt, application, featureOptMEMORYHeap, lsanOpt,
+ featureOptTHREAD});
+ assertNull(result);
+ }
+
/**
* Tests for TracingArgumentsParser.toStringArray()
*/
String[] result = TracingArgumentsParser.toStringArray(args);
assertNull(result);
}
+
+ @Test
+ public void toStringArray_lsanWithHeap() {
+ TracingArguments args = new TracingArguments().setDevice(device).setApplication(application)
+ .addFeature(memory3).setLSanPreference(true);
+ List<String> result = Arrays.asList(TracingArgumentsParser.toStringArray(args));
+ assertNotNull(result);
+ assertEquals(6, result.size());
+ assertTrue(result.contains(featureOptMEMORY));
+
+ int index = result.indexOf(featureOptMEMORY) + 1;
+ assertEquals("heap", result.get(index));
+
+ assertTrue(result.contains(lsanOpt));
+ }
+
+ @Test
+ public void toStringArray_lsanWithoutHeap() {
+ TracingArguments args = new TracingArguments().setDevice(device).addFeature(memory1)
+ .setLSanPreference(true);
+ String[] result = TracingArgumentsParser.toStringArray(args);
+ assertNull(result);
+ }
+
+ @Test
+ public void toStringArray_lsanWithHeapAndThread() {
+ TracingArguments args = new TracingArguments().setDevice(device).addFeature(memory3)
+ .addFeature(thread).setLSanPreference(true);
+ String[] result = TracingArgumentsParser.toStringArray(args);
+ assertNull(result);
+ }
}
assertTrue(args.isValid());
}
+ @Test
+ public void isValid_lsanWithoutHeapAlloc() {
+ TracingArguments args = new TracingArguments().setDevice(device).setApplication(application)
+ .addFeature(feature).setLSanPreference(true);
+ assertFalse(args.isValid());
+ }
+
+ @Test
+ public void isValid_lsanWithHeapAlloc() {
+ TracingArguments args = new TracingArguments().setDevice(device).setApplication(application)
+ .addFeature(PrimitiveFeature.MEMORY_ALLOC).setLSanPreference(true);
+ assertTrue(args.isValid());
+ }
+
+ @Test
+ public void isValid_lsanWithHeapAllocAndThread() {
+ TracingArguments args = new TracingArguments().setDevice(device).setApplication(application)
+ .addFeature(PrimitiveFeature.MEMORY_ALLOC)
+ .addFeature(PrimitiveFeature.THREAD_ANALYSIS).setLSanPreference(true);
+ assertFalse(args.isValid());
+ }
}
import java.net.Socket;
import org.junit.Before;
+import org.junit.BeforeClass;
import org.junit.Test;
import org.tizen.dynamicanalyzer.cli.utils.Message.MessageType;
+import org.tizen.dynamicanalyzer.util.InternalLogger;
+import org.tizen.dynamicanalyzer.util.Logger;
/**
* Test for {@link Communicator} class.
Message sentMessage = null;
+ @BeforeClass
+ public static void setUp() {
+ Logger.init(InternalLogger.DEBUG);
+ }
+
@Before
public void prepare() {
sentMessage = null;
assertEquals(2000L, time);
time = 0;
}
+
+ /**
+ * Test that communicator can correctly works with two tracing processes
+ * simultaneously.
+ *
+ * @throws Exception
+ */
+ @Test
+ public void test_2Processes() throws Exception {
+ ServerSocket socket = OppositeCommSide.getServerSocket();
+ OppositeCommSide opp = new OppositeCommSide(socket.getLocalPort());
+ Thread oppThread = new Thread(opp);
+ oppThread.start();
+ Socket sock = socket.accept();
+ socket.close();
+ ObjectOutputStream oos = new ObjectOutputStream(sock.getOutputStream());
+ oos.flush();
+ ObjectInputStream ois = new ObjectInputStream(sock.getInputStream());
+ Communicator comm = new Communicator(ois, oos);
+
+ TracingArguments args = new TracingArguments();
+ args.setDevice("DEV");
+ args.setApplication("APP");
+ args.setDuration(0);
+ args.addFeature(PrimitiveFeature.CPU_USAGE);
+ TracingProcessContext context = new TracingProcessContext(args);
+
+ final ManagerCommunicationProcessor cP = new ManagerCommunicationProcessor(
+ comm, context);
+ Thread comThread = new Thread(cP);
+ comThread.start();
+
+ time = 0L;
+ Thread worker = new Thread(new Runnable() {
+
+ @Override
+ public void run() {
+ time = cP.getTracingTime();
+ }
+
+ });
+ Thread worker2 = new Thread(new Runnable() {
+
+ @Override
+ public void run() {
+ time = comProcessor.getTracingTime();
+ }
+
+ });
+
+ worker.start();
+ Message mes = opp.get_message();
+ opp.sendMessage(new Message(mes.getTid(),
+ MessageType.RESPONSE__TRACING_TIME, Long.toString(2000L)));
+ worker.join();
+ assertEquals(2000L, time);
+
+ worker2.start();
+ mes = opposite.get_message();
+ opposite.sendMessage(new Message(worker2.getId(),
+ MessageType.RESPONSE__TRACING_TIME, Long.toString(1000)));
+ worker2.join();
+ assertEquals(1000L, time);
+ time = 0L;
+ }
}
\ No newline at end of file
<parent>
<artifactId>dynamic-analyzer</artifactId>
<groupId>org.tizen.dynamicanalyzer</groupId>
- <version>2.3.21-SNAPSHOT</version>
+ <version>2.4.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<groupId>org.tizen.dynamicanalyzer</groupId>
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 DOUBLE_NEW_LINE = "\n\n"; //$NON-NLS-1$
+ public static final String NEW_LINE_CHAR = "%%n"; //$NON-NLS-1$
+ public static final String NEW_LINE = String.format("%n"); //$NON-NLS-1$
+ public static final String DOUBLE_NEW_LINE = NEW_LINE + NEW_LINE; // $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 QUESION_MARK = "?"; //$NON-NLS-1$
public static final String DISABLE = "DISABLE"; //$NON-NLS-1$
public static final String ENABLE = "ENABLE"; //$NON-NLS-1$
+ public static final String YES = "Yes"; //$NON-NLS-1$
+ public static final String NO = "No"; //$NON-NLS-1$
public static final String EOS = "\0";//$NON-NLS-1$
public static final String HEX_PREFIX = "0x";//$NON-NLS-1$
private List<String> outputArray = null;
protected StreamReader(InputStream is, List<String> outputArray) {
+ super(StreamReader.class.getSimpleName() + is.getClass().getSimpleName());
+
this.is = is;
this.outputArray = outputArray;
}
if (msg instanceof Throwable) {
Throwable e = (Throwable)msg;
StringBuilder exceptionMsg = new StringBuilder();
- String className = e.getClass().getName();
- if (className == null) {
- System.err.println("Throwable class name is null !!");
- return;
+
+ while (e != null) {
+ String className = e.getClass().getName();
+ if (className == null) {
+ className = "<unknown class>";
+ }
+ exceptionMsg.append(className + SEPARATOR_COLON);
+ exceptionMsg.append(e.getMessage() + CommonConstants.NEW_LINE);
+ exceptionMsg.append(getCallstackInfo(e));
+
+ e = e.getCause();
+ if (e != null) {
+ exceptionMsg.append("Caused by :" + CommonConstants.NEW_LINE);
+ }
}
- exceptionMsg.append(className + SEPARATOR_COLON);
- exceptionMsg.append(e.getMessage() + CommonConstants.NEW_LINE);
- exceptionMsg.append(getCallstackInfo(e));
-
+
System.err.println(exceptionMsg);
} else {
if (logType == PERFORMANCE) {
<parent>
<artifactId>dynamic-analyzer</artifactId>
<groupId>org.tizen.dynamicanalyzer</groupId>
- <version>2.3.21-SNAPSHOT</version>
+ <version>2.4.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<groupId>org.tizen.dynamicanalyzer</groupId>
+++ /dev/null
-1|System|0|||||||
-2|System cpu|1|1|Timeline|CPU||||
-3|System process|1|1|Timeline|Process Size-Memory-Heap allocation||||
-4|System memory|1|1|Timeline|Process Size-Memory-Heap allocation||||
-5|System processes|1|1|Timeline|CPU||||
-6|System disk|1|1|Timeline|Disk IO||||
-7|System network|1|1|Timeline|Network IO||||
-8|System device|1|1|Timeline|Device||||
-9|System energy|1|1|Timeline|Energy||||
-100|Function profiling|0||Timeline-Summary|||||
-101|Function sampling|0||Summary|||||
-102|Memory allocation|0||Timeline-Summary|Heap allocation||||
-103|Application startup|0||Timeline|||||
-200|File analysis|0||File|||||
-201|Thread analysis|0||Thread|||||
-202|Network analysis|0||Network|||||
-203|OpenGL ES analysis|0||OpenGL|||||3
-204|UI event|0||Timeline|UI event||||
-205|Context switch|0||Kernel|||||2
-300|Inside the platform|0|||||||3
-301|Inside the platform memory|1|300|Timeline-Summary|Heap allocation||||3
-302|Inside the platform file|1|300|File|||||
-303|Inside the platform thread|1|300|Thread|||||3
-304|Inside the platform network|1|300|Network|||||
-305|Inside the platform openGL|1|300|OpenGL|||||
-500|System call|0|||||||2
-501|System call file|1|500|Timeline|||||2
-502|System call ipc|1|500|Timeline|||||2
-503|System call process|1|500|Timeline|||||2
-504|System call signal|1|500|Timeline|||||2
-505|System call network|1|500|Timeline|||||2
-506|System call desc|1|500|Timeline|||||2
-1000|System information sampling periodic|2|1|||100|1000|1000|
-1001|Function profiling sampling periodic|2|101|||1|100|10|
-5000|On scene transition|0||Timeline|Screenshot||||
-5001|periodically|0||Timeline|Screenshot|10|100|10|
-5002|Recording|0|||||||
-5003|Auto Stop|0|||||||
Debug Print|Y
Available Target List|mobile|wearable
Selected Target|mobile
-Default Feature List|2|3|103
Total Overhead Range|1000000|3000000|7000000|15000000
-Options Selected Feature List|5002:0
Selected Preferences|2001
mobile|Protocol Version|4.0
-mobile|Available Template List|1|2|3|4|5|6|7|8|9|10|11
-mobile|Selected Template|1
-mobile|Available Feature List|1|1000|4|5|6|7|8|9|100|101|1001|301|200|201|202|203|204|206
mobile|Available FlatFeature List|101|102|103|201|202|203|301|302|401|501|502|601|602|603|701|801|802
-mobile|Selected Feature List|1|5|1000:1000|100|101|1001:10
mobile|Selected FlatFeature List|101|102
mobile|Available Chart List|CPU Usage|Core Usage|Core Frequency|System Memory|Process Memory|Heap Allocation|Screenshot|UI Event|Disk IO|Network IO|Peripheral Status|Power Estimation
wearable|Protocol Version|3.0
-wearable|Available Template List|1|2|3|4|5|6|7|8|9|10|11
-wearable|Selected Template|1
-wearable|Available Feature List|1|1000|4|5|6|7|8|9|100|101|1001|301|200|201|202|203|204|206
wearable|Available FlatFeature List|101|102|103|201|202|203|301|302|401|501|502|601|602|603|701|801|802
-wearable|Selected Feature List|1|5|1000:1000|100|101|1001:10
wearable|Selected FlatFeature List|
-wearable|Available Chart List|CPU Usage|Core Usage|Core Frequency|System Memory|Process Memory|Heap Allocation|Screenshot|UI Event|Disk IO|Network IO|Peripheral Status|Power Estimation
\ No newline at end of file
+wearable|Available Chart List|CPU Usage|Core Usage|Core Frequency|System Memory|Process Memory|Heap Allocation|Screenshot|UI Event|Disk IO|Network IO|Peripheral Status|Power Estimation
+++ /dev/null
-1|Bottleneck|1|5|1000:1000|100|101|1001:10
-2|Memory Leaks|102|1|4|1000:1000|100
-3|Process Activity|1|5|4|1000:1000|100|101|1001:10
-4|File|1|6|1000:1000|200
-5|Thread Activity|1|5|1000:1000|201
-6|Wait Status|1|5|7|6|1000:1000|201|202|200
-7|Network|1|7|1000:1000|202
-8|OpenGL|1|5|1000:1000|100|203
-9|Energy|1|5|4|9|1000:1000
-10|Custom
--- /dev/null
+package org.tizen.dynamicanakyzer.project.callstack;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Mockito.mock;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Matchers;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.modules.junit4.PowerMockRunner;
+import org.powermock.reflect.Whitebox;
+import org.tizen.dynamicanalyzer.common.Global;
+import org.tizen.dynamicanalyzer.common.UIMode;
+import org.tizen.dynamicanalyzer.project.AppInfo;
+import org.tizen.dynamicanalyzer.project.BinaryInfo;
+import org.tizen.dynamicanalyzer.project.DeviceStatusInfo;
+import org.tizen.dynamicanalyzer.project.ProcessInformation;
+import org.tizen.dynamicanalyzer.project.Project;
+import org.tizen.dynamicanalyzer.project.callstack.RuntimeCallstackManager;
+import org.tizen.dynamicanalyzer.protocol.ProtocolConstants;
+import org.tizen.dynamicanalyzer.setting.PrimitiveFeature;
+import org.tizen.dynamicanalyzer.setting.SettingConstants;
+import org.tizen.dynamicanalyzer.setting.SettingDataManager;
+import org.tizen.dynamicanalyzer.swap.model.data.ProbeCommonData;
+import org.tizen.dynamicanalyzer.swap.model.data.ProfileData;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackData;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackInserter;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfileDataMaker;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.RuntimeProfileDataMaker;
+import org.tizen.dynamicanalyzer.util.InternalLogger;
+import org.tizen.dynamicanalyzer.util.Logger;
+
+/**
+ * Class introduced to test that Map callstackDataBySeqMap corresponds to really
+ * occurred callstacks.
+ */
+@RunWith(PowerMockRunner.class)
+public class BaseCallstackManagerTest {
+ static RuntimeCallstackManager callstackManager;
+
+ static CallStackData csd;
+ int pid = 3045;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ SettingConstants.SettingFilePath = System.getProperty("user.dir")
+ + "/resources/";
+ callstackManager = new RuntimeCallstackManager();
+ List<Long> addrs = new ArrayList<Long>();
+ addrs.add(100000L);
+ csd = new CallStackData(3L, addrs);
+ callstackManager.getCallStackDataBySeqMap().put(3L, csd);
+
+ AppInfo aInfo = mock(AppInfo.class);
+ BinaryInfo bInfo = mock(BinaryInfo.class);
+ DeviceStatusInfo dsi = mock(DeviceStatusInfo.class);
+ ProcessInformation process = mock(ProcessInformation.class);
+ PowerMockito.when(dsi, "getBinaryInfo", Matchers.any(String.class))
+ .thenReturn(bInfo);
+ PowerMockito.when(dsi, "getBinaryInfo", Matchers.anyInt()).thenReturn(bInfo);
+ Project project = mock(Project.class);
+ PowerMockito.when(project, "getRuntimeCallstackManager").thenReturn(callstackManager);
+ PowerMockito.when(project, "getDeviceStatusInfo").thenReturn(dsi);
+ PowerMockito.when(project, "getProcessInformation", Matchers.anyInt())
+ .thenReturn(process);
+ PowerMockito.when(project, "getApplicationInfo").thenReturn(aInfo);
+ Global.setProject(project);
+ }
+
+ // ==================RuntimeCallstackDataManager==================
+ /**
+ * Test that RuntimeCallstackDataManager.getCallstackAddrListFromSeq() does
+ * not change callstackDataBySeqMap.
+ */
+ @Test
+ public void testGetCallstackAddrListFromSeq() {
+ Map<Long, CallStackData> initialMapState = Whitebox.getInternalState(
+ callstackManager, "callstackDataBySeqMap");
+
+ assertEquals(csd.getAddrs(),
+ callstackManager.getCallstackAddrListFromSeq(3L));
+
+ Map<Long, CallStackData> newMapState = Whitebox.getInternalState(
+ callstackManager, "callstackDataBySeqMap");
+ assertEquals(initialMapState.size(), newMapState.size());
+ for (Map.Entry<Long, CallStackData> entry : initialMapState.entrySet()) {
+ assertEquals(entry.getValue(), newMapState.get(entry.getKey()));
+ }
+ }
+
+ /**
+ * Test that RuntimeCallstackDataManager.makeCallstackWithoutBacktrace()
+ * simply adds one entry to callstackDataBySeqMap and does nothing more with
+ * this map.
+ */
+ @Test
+ public void testMakeCallstackWithoutBacktrace() {
+ Map<Long, CallStackData> initialMapState = new HashMap<Long, CallStackData>();
+ initialMapState.putAll(((Map<Long, CallStackData>) Whitebox
+ .getInternalState(callstackManager, "callstackDataBySeqMap")));
+
+ // add log data with caller address
+ ProbeCommonData inputData = new ProbeCommonData(6L, 12134L, 3, pid,
+ pid, "", "", 0);
+
+ callstackManager.makeCallstackWithoutBacktrace(inputData);
+
+ Map<Long, CallStackData> newMapState = Whitebox.getInternalState(
+ callstackManager, "callstackDataBySeqMap");
+ assertEquals(initialMapState.size() + 1, newMapState.size());
+ for (Map.Entry<Long, CallStackData> entry : initialMapState.entrySet()) {
+ assertEquals(entry.getValue(), newMapState.get(entry.getKey()));
+ }
+ assertNotNull(newMapState.get(6L));
+ initialMapState.clear();
+ initialMapState.putAll(newMapState);
+
+ // add log data without caller address
+ inputData = new ProbeCommonData(9L, 12134L, 3, pid, pid, "", "", 0);
+ inputData.setCallerAddress(-1L);
+ callstackManager.makeCallstackWithoutBacktrace(inputData);
+
+ newMapState = Whitebox.getInternalState(
+ callstackManager, "callstackDataBySeqMap");
+ assertEquals(initialMapState.size() + 1, newMapState.size());
+ for (Map.Entry<Long, CallStackData> entry : newMapState.entrySet()) {
+ assertEquals(entry.getValue(), newMapState.get(entry.getKey()));
+ }
+ assertNotNull(newMapState.get(9L));
+ }
+
+ /**
+ * Test that RuntimeCallstackDataManager.proceedEntry() simply adds one
+ * entry to callstackDataBySeqMap and does nothing more with this map.
+ */
+ @Test
+ public void testProceedEntry() throws Exception {
+ Map<Long, CallStackData> initialMapState = new HashMap<Long, CallStackData>();
+ initialMapState.putAll(((Map<Long, CallStackData>) Whitebox
+ .getInternalState(callstackManager, "callstackDataBySeqMap")));
+
+ RuntimeProfileDataMaker profileDataMaker = mock(RuntimeProfileDataMaker.class);
+ profileDataMaker.setPid(pid);
+ ProfileData inputData = new ProfileData(
+ ProtocolConstants.MSG_FUNCTION_ENTRY, 8L, pid, pid, 0, 0,
+ 12167L, 100000L, 300100L);
+ Method proceedEntry = Whitebox.getMethod(RuntimeCallstackManager.class,
+ "proceedEntry", ProfileData.class, CallStackUnit.class,
+ Map.class);
+ proceedEntry.invoke(callstackManager, inputData,
+ mock(CallStackUnit.class), new HashMap<Long, CallStackData>());
+
+ Map<Long, CallStackData> newMapState = Whitebox.getInternalState(
+ callstackManager, "callstackDataBySeqMap");
+ assertEquals(initialMapState.size() + 1, newMapState.size());
+ for (Map.Entry<Long, CallStackData> entry : initialMapState.entrySet()) {
+ assertEquals(entry.getValue(), newMapState.get(entry.getKey()));
+ }
+ assertNotNull(newMapState.get(8L));
+ }
+
+ /**
+ * Test that RuntimeCallstackDataManager.proceedExit() simply adds one entry
+ * to callstackDataBySeqMap and does nothing more with this map.
+ */
+ @Test
+ public void testProceedExit() throws Exception {
+ Map<Long, CallStackData> initialMapState = new HashMap<Long, CallStackData>();
+ initialMapState.putAll(((Map<Long, CallStackData>) Whitebox
+ .getInternalState(callstackManager, "callstackDataBySeqMap")));
+
+ RuntimeProfileDataMaker profileDataMaker = mock(RuntimeProfileDataMaker.class);
+ profileDataMaker.setPid(pid);
+ ProfileData inputData = new ProfileData(
+ ProtocolConstants.MSG_FUNCTION_EXIT, 12L, pid, pid, 0, 0,
+ 12169L, 300100L, 500100L);
+ Method proceedExit = Whitebox.getMethod(RuntimeCallstackManager.class,
+ "proceedExit", ProfileData.class, CallStackUnit.class,
+ Map.class);
+ proceedExit.invoke(callstackManager, inputData,
+ mock(CallStackUnit.class), new HashMap<Long, CallStackData>());
+
+ Map<Long, CallStackData> newMapState = Whitebox.getInternalState(
+ callstackManager, "callstackDataBySeqMap");
+ assertEquals(initialMapState.size() + 1, newMapState.size());
+ for (Map.Entry<Long, CallStackData> entry : initialMapState.entrySet()) {
+ assertEquals(entry.getValue(), newMapState.get(entry.getKey()));
+ }
+ assertNotNull(newMapState.get(12L));
+ }
+
+ // ==================RuntimeProfileDataMaker======================
+ /**
+ * Test that RuntimeProfileDataMaker.makeFunctionUsageProfileData() does not
+ * change callstackDataBySeqMap.
+ */
+ @Test
+ public void testMakeFunctionUsageProfileData() {
+ // Test that it does not change map
+ Map<Long, CallStackData> initialMapState = new HashMap<Long, CallStackData>();
+ initialMapState.putAll(((Map<Long, CallStackData>) Whitebox
+ .getInternalState(callstackManager, "callstackDataBySeqMap")));
+
+ Logger.init(InternalLogger.ERROR);
+ ProfileDataMaker maker = new RuntimeProfileDataMaker();
+ maker.makeFunctionUsageProfileData(new ProfileData(
+ ProtocolConstants.MSG_FUNCTION_EXIT, 12L, pid, pid, 0, 0,
+ 12169L, 300100L, 500100L));
+
+ Map<Long, CallStackData> newMapState = Whitebox.getInternalState(
+ callstackManager, "callstackDataBySeqMap");
+ assertEquals(initialMapState.size(), newMapState.size());
+ for (Map.Entry<Long, CallStackData> entry : initialMapState.entrySet()) {
+ assertEquals(entry.getValue(), newMapState.get(entry.getKey()));
+ }
+ }
+
+ // ==================CallStackInserter============================
+ /**
+ * Test that CallStackInserter.saveCallStackData() does not change
+ * callstackDataBySeqMap if Persistent Allocations feature selected.
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testSaveCallStackData() throws Exception {
+ Map<Long, CallStackData> initialMapState = new HashMap<Long, CallStackData>();
+ initialMapState.putAll(((Map<Long, CallStackData>) Whitebox
+ .getInternalState(callstackManager, "callstackDataBySeqMap")));
+
+ Global.setCurrentUIMode(UIMode.CLI);
+ SettingDataManager.INSTANCE.getConnectedTargetOrSelected()
+ .addSelectedFlatFeature(PrimitiveFeature.MEMORY_ALLOC.getName());
+ CallStackInserter csi = CallStackInserter.getInstance();
+ Method save = Whitebox.getMethod(CallStackInserter.class,
+ "saveCallStackData", List.class);
+ List<CallStackData> csdList = new ArrayList<CallStackData>();
+ csdList.add(new CallStackData(3L));
+ save.invoke(csi, csdList);
+
+ Map<Long, CallStackData> newMapState = Whitebox.getInternalState(
+ callstackManager, "callstackDataBySeqMap");
+ assertEquals(initialMapState.size(), newMapState.size());
+ for (Map.Entry<Long, CallStackData> entry : initialMapState.entrySet()) {
+ assertEquals(entry.getValue(), newMapState.get(entry.getKey()));
+ }
+ }
+}
--- /dev/null
+package org.tizen.dynamicanalyzer.swap.logparser;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.tizen.dynamicanalyzer.common.Global;
+import org.tizen.dynamicanalyzer.model.DATime;
+import org.tizen.dynamicanalyzer.project.Project;
+import org.tizen.dynamicanalyzer.protocol.ProtocolConstants;
+import org.tizen.dynamicanalyzer.swap.model.data.LSanData;
+import org.tizen.dynamicanalyzer.swap.model.data.LSanData.LSanStatus;
+import org.tizen.dynamicanalyzer.util.InternalLogger;
+import org.tizen.dynamicanalyzer.util.Logger;
+
+/**
+ * Tests for {@link MessageParser}.
+ */
+public class MessageParserTest {
+
+ private int PROCESS_MSG_TIMEOUT = 200;
+ private MessageParser parser;
+
+ @BeforeClass
+ public static void init() {
+ Logger.init(InternalLogger.DEBUG);
+
+ // Needed for correct work of MessageParser
+ Project project = new Project();
+ project.setProfilingStartTime(new DATime(0, 0));
+ Global.setProject(project);
+ }
+
+ @Before
+ public void setUp() {
+ Global.setLSanInitialized(false);
+ parser = new MessageParser();
+ parser.start();
+ }
+
+ /**
+ * Constructs new {@link LSanData} mock object with given {@code status}.
+ *
+ * @param status status of created data
+ * @return created instance of {@link LSanData}
+ */
+ private LSanData createLSanDataMock(LSanStatus status) {
+ LSanData data = Mockito.mock(LSanData.class);
+ data.setMsgID(ProtocolConstants.MSG_LSAN);
+ when(data.getData()).thenReturn("");
+ when(data.getStatus()).thenReturn(status);
+ when(data.parsePublic(Global.getProject().getProfilingStartTime())).thenReturn(true);
+ return data;
+ }
+
+ @Test
+ public void processLSanMessage_correctOrder() throws Exception {
+ parser.pushData(createLSanDataMock(LSanStatus.INITIALIZED));
+ Thread.sleep(PROCESS_MSG_TIMEOUT);
+ assertTrue(Global.isLSanInitialized());
+
+ parser.pushData(createLSanDataMock(LSanStatus.REPORT));
+ Thread.sleep(PROCESS_MSG_TIMEOUT);
+ assertFalse(Global.isLSanInitialized());
+ }
+
+ @Test
+ public void processLSanMessage_incorrectOrder() throws Exception {
+ parser.pushData(createLSanDataMock(LSanStatus.REPORT));
+ Thread.sleep(PROCESS_MSG_TIMEOUT);
+ assertFalse(Global.isLSanInitialized());
+
+ parser.pushData(createLSanDataMock(LSanStatus.INITIALIZED));
+ Thread.sleep(PROCESS_MSG_TIMEOUT);
+ assertTrue(Global.isLSanInitialized());
+ }
+
+ @Test
+ public void processLSanMessage_repeatInit() throws Exception {
+ LSanData data = createLSanDataMock(LSanStatus.INITIALIZED);
+ parser.pushData(data);
+ Thread.sleep(PROCESS_MSG_TIMEOUT);
+ assertTrue(Global.isLSanInitialized());
+
+ parser.pushData(data);
+ Thread.sleep(PROCESS_MSG_TIMEOUT);
+ assertTrue(Global.isLSanInitialized());
+ }
+
+ @Test
+ public void processLSanMessage_repeatReport() throws Exception {
+ parser.pushData(createLSanDataMock(LSanStatus.INITIALIZED));
+ Thread.sleep(PROCESS_MSG_TIMEOUT);
+ assertTrue(Global.isLSanInitialized());
+
+ LSanData data = createLSanDataMock(LSanStatus.REPORT);
+ parser.pushData(data);
+ Thread.sleep(PROCESS_MSG_TIMEOUT);
+ assertFalse(Global.isLSanInitialized());
+
+ parser.pushData(data);
+ Thread.sleep(PROCESS_MSG_TIMEOUT);
+ assertFalse(Global.isLSanInitialized());
+ }
+
+ @Test
+ public void processLSanMessage_error() throws Exception {
+ LSanData data = createLSanDataMock(LSanStatus.ERROR);
+ parser.pushData(data);
+ Thread.sleep(PROCESS_MSG_TIMEOUT);
+ assertFalse(Global.isLSanInitialized());
+
+ Global.setLSanInitialized(true);
+ parser.pushData(data);
+ Thread.sleep(PROCESS_MSG_TIMEOUT);
+ assertTrue(Global.isLSanInitialized());
+ }
+
+ @After
+ public void tearDown() {
+ parser.stopForced();
+ }
+}
--- /dev/null
+package org.tizen.dynamicanalyzer.ui.memory.data;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.File;
+import java.io.PrintWriter;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.After;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.mockito.internal.util.reflection.Whitebox;
+import org.powermock.reflect.internal.WhiteboxImpl;
+import org.tizen.dynamicanalyzer.common.Global;
+import org.tizen.dynamicanalyzer.project.Project;
+import org.tizen.dynamicanalyzer.swap.model.data.MemoryData;
+import org.tizen.dynamicanalyzer.util.InternalLogger;
+import org.tizen.dynamicanalyzer.util.Logger;
+
+/**
+ * Tests for {@link HeapDataManager}.
+ */
+public class HeapDataManagerTest {
+
+ private final static String lsanReport = "lsan.test.log";
+ private final static String lsanReportFormat = "%d %d %d\n";
+ private PrintWriter lsanReportWriter;
+ private HeapDataManager manager = Mockito.spy(HeapDataManager.getInstance());
+
+ @BeforeClass
+ public static void init() {
+ Logger.init(InternalLogger.DEBUG);
+ }
+
+ /**
+ * Helper method for writing LSan report file and parsing it by
+ * {@link HeapDataManager#parseReportFile(String)}.
+ *
+ * @param content content of report file
+ * @return list of data from parsed LSan report file
+ * @throws Exception
+ */
+ private List<List<Object>> parseReport(String content) throws Exception {
+ lsanReportWriter = new PrintWriter(lsanReport, StandardCharsets.US_ASCII.name());
+ lsanReportWriter.write(content);
+ lsanReportWriter.flush();
+ lsanReportWriter.close();
+
+ manager.parseReportFile(lsanReport);
+
+ return getLSanData();
+ }
+
+ /**
+ * Gets list of data from parsed LSan report file.
+ *
+ * @return value of 'lsanDataList' private field of {@link HeapDataManager}
+ */
+ @SuppressWarnings("unchecked")
+ private List<List<Object>> getLSanData() {
+ return (List<List<Object>>) Whitebox.getInternalState(manager, "lsanDataList");
+ }
+
+ @Test
+ public void parseReportFile_correctFormat() throws Exception {
+ List<List<Object>> expected = new ArrayList<List<Object>>();
+ StringBuffer report = new StringBuffer();
+
+ List<Object> row = new ArrayList<Object>();
+ expected.add(row);
+ row.add(0L);
+ row.add(1L);
+ row.add(2L);
+ report.append(String.format(lsanReportFormat, (Long) row.get(0), (Long) row.get(1), (Long) row.get(2)));
+
+ row = new ArrayList<Object>();
+ expected.add(row);
+ row.add(3L);
+ row.add(4L);
+ row.add(5L);
+ report.append(String.format(lsanReportFormat, (Long) row.get(0), (Long) row.get(1), (Long) row.get(2)));
+
+ assertEquals(expected, parseReport(report.toString()));
+ }
+
+ @Test
+ public void parseReportFile_partlyCorrectFormat() throws Exception {
+ List<List<Object>> expected = new ArrayList<List<Object>>();
+ StringBuffer report = new StringBuffer();
+
+ // correct line
+ List<Object> row = new ArrayList<Object>();
+ expected.add(row);
+ row.add(0L);
+ row.add(1L);
+ row.add(2L);
+ report.append(String.format(lsanReportFormat, (Long) row.get(0), (Long) row.get(1), (Long) row.get(2)));
+
+ // incorrect line
+ report.append("test");
+
+ assertEquals(expected, parseReport(String.format(lsanReportFormat, 0, 1, 2) + "test"));
+ }
+
+ @Test
+ public void parseReportFile_nonExistentReport() {
+ manager.parseReportFile("non-existent/report.file");
+ assertEquals(0, getLSanData().size());
+ }
+
+ @Test
+ public void parseReportFile_nonDigits() throws Exception {
+ List<List<Object>> data = parseReport("a b c");
+ assertEquals(0, data.size());
+ }
+
+ @Test
+ public void parseReportFile_tooFewFields() throws Exception {
+ List<List<Object>> data = parseReport("0 1");
+ assertEquals(0, data.size());
+ }
+
+ @Test
+ public void parseReportFile_tooManyFields() throws Exception {
+ List<List<Object>> data = parseReport("0 1 2 3");
+ assertEquals(0, data.size());
+ }
+
+ @Test
+ public void parseReportFile_empty() throws Exception {
+ List<List<Object>> data = parseReport("");
+ assertEquals(0, data.size());
+ }
+
+ @Test
+ public void testGetAllocatorAddress32() throws Exception {
+ setProtocolVersion("4.2");
+ MemoryData logData = new MemoryData();
+ int addr32 = 0x12345678;
+ logData.setReserved1(addr32);
+ logData.setReserved2(0);
+ long res = WhiteboxImpl.invokeMethod(manager, "getAllocatorAddress", logData);
+ assertEquals((long) addr32, res);
+ }
+
+ @Test
+ public void testGetAllocatorAddress64() throws Exception {
+ setProtocolVersion("4.2");
+ MemoryData logData = new MemoryData();
+ int addr32_hi = 0x12345678;
+ int addr32_lo = 0x9abcdef0;
+ logData.setReserved1(addr32_lo);
+ logData.setReserved2(addr32_hi);
+ long res = WhiteboxImpl.invokeMethod(manager, "getAllocatorAddress", logData);
+ assertEquals(Integer.toHexString(addr32_hi) + Integer.toHexString(addr32_lo), Long.toHexString(res));
+ }
+
+ @Test
+ public void testGetAllocatorAddress_protocol41() throws Exception {
+ setProtocolVersion("4.1");
+ MemoryData logData = new MemoryData();
+ logData.setReserved1(0x12345678);
+ logData.setReserved2(0x9abcdef0);
+ long res = WhiteboxImpl.invokeMethod(manager, "getAllocatorAddress", logData);
+ assertEquals(0, res);
+ }
+
+ private void setProtocolVersion(String version) {
+ Project p = new Project();
+ p.setProtocolVersion(version);
+ Global.setProject(p);
+ }
+
+ @After
+ public void tearDown() {
+ File lsanReportFile = new File(lsanReport);
+ if (lsanReportFile.exists())
+ lsanReportFile.delete();
+ }
+
+}
--- /dev/null
+package org.tizen.dynamicanalyzer.ui.memory.table;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Matchers;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor;
+import org.powermock.modules.junit4.PowerMockRunner;
+import org.powermock.reflect.Whitebox;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.model.TableInput;
+import org.tizen.dynamicanalyzer.setting.SettingConstants;
+import org.tizen.dynamicanalyzer.ui.memory.MemoryPage;
+import org.tizen.dynamicanalyzer.ui.memory.data.HeapDataManager;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
+
+@RunWith(PowerMockRunner.class)
+@SuppressStaticInitializationFor({
+ "org.tizen.dynamicanalyzer.resources.ImageResources",
+ "org.eclipse.nebula.widgets.grid.GridItem",
+ "org.eclipse.swt.widgets.Widget"})
+public class MemoryCallStackTableTest {
+
+ static List<Object> memAllocationData;
+ static DATableDataFormat tableData;
+ static DASelectionData selData;
+ static Grid table;
+ static MemoryCallStackTable memTable;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ SettingConstants.SettingFilePath = System.getProperty("user.dir")
+ + "/resources/";
+ PowerMockito.whenNew(ImageRegistry.class).withNoArguments()
+ .thenReturn(null);
+ table = mock(Grid.class);
+ memTable = mock(MemoryCallStackTable.class);
+
+ memAllocationData = new ArrayList<Object>();
+ memAllocationData.add(10L); // SEQ
+ memAllocationData.add(4338); // PID
+ memAllocationData.add(4338); // TID
+ memAllocationData.add(1); // API_ID
+ memAllocationData.add("calloc"); // API_TYPE (does not matter)
+ memAllocationData.add(3024333952L); // ALLOCATED ADDRESS
+ memAllocationData.add(1000L); // TIME
+ memAllocationData.add(3024373978L); // CALLER ADDRESS (does not matter)
+ memAllocationData.add(3); // CALLER LIBRARY ID
+ memAllocationData.add(10); // MESSAGE ID(does not matter)
+ memAllocationData.add(128L); // ALLOCATED SIZE
+
+ TableInput input = HeapDataManager.getInstance()
+ .makeTreeInputForLeakData(memAllocationData, 10);
+ ((DATableDataFormat)input.getData()).setType(AnalyzerConstants.TYPE_TABLE_MEM_ALLOCATEDTRACE);
+
+ GridItem gridItem = mock(GridItem.class);
+ tableData = (DATableDataFormat) input.getData();
+ gridItem.setData(tableData);
+
+ List<String> text = input.getText();
+ int columnCount = text.size();
+ for (int i = 0; i < columnCount; i++) {
+ gridItem.setText(i, text.get(i));
+ }
+
+ GridItem[] items = new GridItem[1];
+ items[0] = gridItem;
+ selData = spy(new DASelectionData(MemoryPage.allocationtraceViewID,
+ 1000L, 1000L, items, table));
+
+ PowerMockito.when(selData, "getData").thenReturn(items);
+ PowerMockito.when(gridItem, "getData").thenReturn(tableData);
+ PowerMockito.whenNew(GridItem.class)
+ .withParameterTypes(Grid.class, int.class)
+ .withArguments(Matchers.any(Grid.class), Matchers.anyInt())
+ .thenReturn(mock(GridItem.class));
+ }
+
+ @Before
+ public void reset() {
+ tableData.getData().set(0, 10L);
+ tableData.getData().set(1, 1000L);
+ tableData.getData().set(2, 4338);
+ tableData.getData().set(6, "glibc.so");
+ }
+
+ @Test
+ public void testIsSelectionValid() throws Exception {
+ Method check = Whitebox.getMethod(MemoryCallStackTable.class,
+ "isSelectionValid",
+ DASelectionData.class);
+ assertFalse((Boolean) check.invoke(memTable, (DASelectionData) null));
+
+ DASelectionData badSelData = new DASelectionData(
+ MemoryPage.chartViewID, 1000L, 1000L,
+ selData.getData(), table);
+ assertFalse((Boolean) check.invoke(memTable, badSelData));
+
+ badSelData = new DASelectionData(
+ MemoryPage.allocationtraceViewID, 1000L, 1000L, null, table);
+ assertFalse((Boolean) check.invoke(memTable, badSelData));
+
+ badSelData = new DASelectionData(MemoryPage.allocationtraceViewID,
+ 1000L, 1000L, new GridItem[0], table);
+ assertFalse((Boolean) check.invoke(memTable, badSelData));
+
+ ((DATableDataFormat) ((GridItem[]) selData.getData())[0].getData())
+ .setType(AnalyzerConstants.TYPE_TABLE_APP_STARTUP);
+ badSelData = new DASelectionData(MemoryPage.allocationtraceViewID,
+ 1000L, 1000L, selData.getData(), table);
+ assertFalse((Boolean) check.invoke(memTable, badSelData));
+ ((DATableDataFormat) ((GridItem[]) selData.getData())[0].getData())
+ .setType(AnalyzerConstants.TYPE_TABLE_MEM_ALLOCATEDTRACE);
+
+ assertTrue((Boolean) check.invoke(memTable, selData));
+ }
+
+ @Test
+ public void testGetSeq() throws Exception {
+ Method getSeq = Whitebox.getMethod(MemoryCallStackTable.class,
+ "getMemAllocationDataByColumnIndex", List.class, int.class);
+ int index = MemoryPersistentAllocationsTableIndex.SEQ.getIndex();
+ assertEquals(10L, getSeq.invoke(memTable, tableData.getData(), index));
+ assertEquals(null, getSeq.invoke(memTable, (List) null, index));
+ tableData.getData().set(0, null);
+ assertEquals(null, getSeq.invoke(memTable, tableData.getData(), index));
+ }
+
+ @Test
+ public void testGetTime() throws Exception {
+ Method getTime = Whitebox.getMethod(MemoryCallStackTable.class,
+ "getMemAllocationDataByColumnIndex", List.class, int.class);
+ int index = MemoryPersistentAllocationsTableIndex.TIMESTAMP.getIndex();
+ assertEquals(1000L,
+ getTime.invoke(memTable, tableData.getData(), index));
+ assertEquals(null, getTime.invoke(memTable, (List) null, index));
+ tableData.getData().set(1, null);
+ assertEquals(null, getTime.invoke(memTable, tableData.getData(), index));
+ }
+
+ @Test
+ public void testGetPid() throws Exception {
+ Method getPid = Whitebox.getMethod(MemoryCallStackTable.class,
+ "getMemAllocationDataByColumnIndex", List.class, int.class);
+ int index = MemoryPersistentAllocationsTableIndex.PID.getIndex();
+ assertEquals(4338, getPid.invoke(memTable, tableData.getData(), index));
+ assertEquals(null, getPid.invoke(memTable, (List) null, index));
+ tableData.getData().set(2, null);
+ assertEquals(null, getPid.invoke(memTable, tableData.getData(), index));
+ }
+
+ @Test
+ public void testGetAllocPath() throws Exception {
+ Method getAllocPath = Whitebox.getMethod(MemoryCallStackTable.class,
+ "getMemAllocationDataByColumnIndex", List.class, int.class);
+ int index = MemoryPersistentAllocationsTableIndex.LIBRARY.getIndex();
+ assertEquals("glibc.so",
+ getAllocPath.invoke(memTable, tableData.getData(), index));
+ assertEquals(null, getAllocPath.invoke(memTable, (List) null, index));
+ tableData.getData().set(6, null);
+ assertEquals(null,
+ getAllocPath.invoke(memTable, tableData.getData(), index));
+ }
+}
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
-import org.junit.Ignore;
import org.junit.Test;
import org.powermock.reflect.Whitebox;
import org.tizen.dynamicanalyzer.common.Global;
import org.tizen.dynamicanalyzer.common.UIMode;
-import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
-import org.tizen.dynamicanalyzer.setting.Feature;
-import org.tizen.dynamicanalyzer.setting.FeatureData;
-import org.tizen.dynamicanalyzer.setting.FeatureValueData;
+import org.tizen.dynamicanalyzer.setting.FlatFeature;
import org.tizen.dynamicanalyzer.setting.FlatPreferences;
+import org.tizen.dynamicanalyzer.setting.PrimitiveFeature;
import org.tizen.dynamicanalyzer.setting.SettingConstants;
import org.tizen.dynamicanalyzer.setting.SettingDataManager;
import org.tizen.dynamicanalyzer.setting.TargetData;
-import org.tizen.dynamicanalyzer.setting.Template;
-import org.tizen.dynamicanalyzer.setting.TemplateData;
import org.tizen.dynamicanalyzer.setting.UILayoutDataManager;
import org.tizen.dynamicanalyzer.util.InternalLogger;
import org.tizen.dynamicanalyzer.util.Logger;
@SuppressWarnings("unused")
UILayoutDataManager l = UILayoutDataManager.INSTANCE;
}
-
+
@Before
public void set_up(){
// revert setting Preferences
public static void tesApplySettingData() {
// change selected target, options feature
SettingDataManager.INSTANCE.setSelectedTarget("wearable");
- SettingDataManager.INSTANCE.addOptionsSelectedPreference(
+ SettingDataManager.INSTANCE.setPreferenceValue(
FlatPreferences.SCREENSHOT_PERIODICALLY, 50);
assertTrue(SettingDataManager.INSTANCE.changedFeatures());
assertEquals(-1, initOptionsSelectedPreferenceList.get(0).getValue());
}
- @Ignore
- // Tests feature internal data, but Feature is outdated.
- // TODO: mind about redesign this for FlatFeature.
- // TODO: There are inner fields in FlatFeature, so, here is quite good place
- // to test it.
- @Test
- public void testInitFeatureData() {
- FeatureData feature = Feature.SYSTEM_SAMPLING_RATE.getData();
- assertEquals(ConfigureLabels.FEATURE_DETAIL_VALUE_SYSTEM_SAMPLING_RATE,
- feature.getFeatureName());
- assertEquals(Feature.SYSTEM.getIndex(), feature.getParentIndex());
- assertEquals(100, feature.getMinValue());
- assertEquals(1000, feature.getMaxValue());
- assertEquals(1000, feature.getDefaultValue());
-
- feature = Feature.OPENGL_ANALYSIS.getData();
- assertEquals(3, feature.getOverheadRanking());
- }
-
- @Ignore
- // Tests template internal data, but Template is outdated.
- @Test
- public void testInitTemplateData() {
- TemplateData template = Template.TEMPLATE_BOTTLENECK.getData();
- assertEquals(ConfigureLabels.TEMPLATE_NAME_BOTTLENECK, template.getTemplateName());
- assertEquals(ConfigureLabels.TEMPLATE_DESCRIPTION_BOTTLENECK, template.getDescription());
- }
-
@Test
public void testInitSettingData() {
// check Available Target List
assertEquals(1, chartSet.size());
assertTrue(chartSet.contains("Core Usage"));
- // check Default Protocol List
- List<Feature> defaultFeatureList = setting.getDefaultFeatureList();
- assertEquals(3, defaultFeatureList.size());
- assertEquals(2, defaultFeatureList.get(0).getIndex());
- assertEquals(3, defaultFeatureList.get(1).getIndex());
-
// check Total Overhead Range
assertEquals(5, setting.getTotalOverheadRangeCount());
List<Long> totalOverheadRange = setting.getTotalOverheadRange();
assertEquals(15000000, totalOverheadRange.get(3).longValue());
// check Options Selected Feature List
- List<FlatPreferences> flatPreferenceList = setting.getOptionsSelectedPreferencesList();
+ List<FlatPreferences> flatPreferenceList = setting.getSelectedPreferencesList();
assertEquals(1, flatPreferenceList.size());
assertEquals(FlatPreferences.SOURCE_VIEW, flatPreferenceList.get(0));
assertEquals(-1, flatPreferenceList.get(0).getValue());
flatPreferenceList = Whitebox.getInternalState(setting, "initOptionsSelectedPreferenceList");
assertEquals(1, flatPreferenceList.size());
assertEquals(FlatPreferences.SOURCE_VIEW, flatPreferenceList.get(0));
+ assertEquals(-1, flatPreferenceList.get(0).getValue());
+ }
+
+ @Test
+ public void testGetPreferenceSet() {
+ Set<FlatPreferences> preferenceSet = setting.getSelectedPreferenceSet();
+ // check that preference set includes selected features
+ assertTrue(preferenceSet.containsAll(setting.getSelectedPreferencesList()));
+ // check that preference set includes default features
+ assertTrue(preferenceSet.contains(FlatPreferences.FUNCTION_PROFILING));
+ assertTrue(preferenceSet.contains(FlatPreferences.APP_STARTUP));
+ assertTrue(preferenceSet.contains(FlatPreferences.SYSTEM_ALL_PROCESSES));
+ assertTrue(preferenceSet.contains(FlatPreferences.PROCESS_MEMORY));
+ assertTrue(preferenceSet.contains(FlatPreferences.FUNCTION_SAMPLING_RATE));
}
@Test
}
@Test
- public void testWriteIndexList() {
- try {
- String result = Whitebox.invokeMethod(setting, "writeDefaultFeatureList",
- SettingConstants.KEY_DEFAULT_FEATURE_LIST);
- assertEquals("Default Feature List|2|3|103", result);
- } catch (Exception e) {
- Logger.exception(e);
- }
- }
-
- @Test
public void testWriteOverheadRangeList() {
try {
String result = Whitebox.invokeMethod(setting, "writeCollection",
}
@Test
- public void testFeatureOperation() {
- try {
- String featureName = Feature.SYSTEM_ENERGY.getName();
- assertEquals(ConfigureLabels.FEATURE_NAME_SYSTEM_ENERGY, featureName);
-
- assertNull(Feature.getFeature(10000));
-
- int featureIndex = Feature.getFeature(ConfigureLabels.FEATURE_NAME_THREAD).getIndex();
- assertEquals(Feature.THREAD_ANALYSIS.getIndex(), featureIndex);
-
- assertNull(Feature.getFeature("testFeatureName"));
-
- FeatureData feature = Feature.FILE_ANALYSIS.getData();
- assertEquals(ConfigureLabels.FEATURE_NAME_FILE, feature.getFeatureName());
-
- feature = Feature.getFeature(ConfigureLabels.FEATURE_NAME_THREAD).getData();
- assertEquals(Feature.THREAD_ANALYSIS.getIndex(), feature.getFeatureIndex());
-
- // copyFeatureList()
- List<FeatureValueData> source = new ArrayList<FeatureValueData>();
- List<FeatureValueData> dest = new ArrayList<FeatureValueData>();
- assertEquals(0, dest.size());
- } catch (Exception e) {
- Logger.exception(e);
- }
- }
-
- @Test
- public void testTemplateOperation() {
- String templateName = Template.TEMPLATE_WAIT_STATUS.getName();
- assertEquals(ConfigureLabels.TEMPLATE_NAME_WAIT_STATUS, templateName);
-
- assertNull(Template.getTemplate(10000));
-
- int templateIndex = Template.getTemplate(ConfigureLabels.TEMPLATE_NAME_PROCESS_ACTIVITY)
- .getIndex();
- assertEquals(Template.TEMPLATE_PROCESS_ACTIVITY.getIndex(), templateIndex);
-
- assertNull(Template.getTemplate("testTemplateName"));
-
- TemplateData template = Template.TEMPLATE_MEMORY_LEAKS.getData();
- assertEquals(ConfigureLabels.TEMPLATE_DESCRIPTION_MEMORY_LEAKS, template.getDescription());
- }
-
- @Test
public void testSettingOperation() {
TargetData target = setting.getTarget("not-wearable");
assertNull(target);
setting.setSelectedTarget("mobile");
// change options feature
- setting.addOptionsSelectedPreference(FlatPreferences.SCREENSHOT_PERIODICALLY, 50);
+ int preferenceSize = setting.getSelectedPreferenceSet().size();
+ setting.setPreferenceValue(FlatPreferences.SCREENSHOT_PERIODICALLY, 50);
assertTrue(setting.changedFeatures());
+ assertEquals(preferenceSize + 1, setting.getSelectedPreferenceSet().size());
+ assertTrue(setting
+ .isPreferenceSelected(FlatPreferences.SCREENSHOT_PERIODICALLY));
+ assertFalse(setting
+ .isPreferenceSelected(FlatPreferences.SCREENSHOT_ON_SCENE_TRANSITION));
+ assertEquals(50, setting.getPreferenceValue(FlatPreferences.SCREENSHOT_PERIODICALLY));
// same size
- setting.deleteOptionsSelectedPreference(FlatPreferences.RECORDING);
+ setting.deletePreference(FlatPreferences.RECORDING);
assertTrue(setting.changedFeatures());
// different input value
- setting.deleteOptionsSelectedPreference(FlatPreferences.SCREENSHOT_PERIODICALLY);
- setting.addOptionsSelectedPreference(FlatPreferences.RECORDING, 50);
+ setting.deletePreference(FlatPreferences.SCREENSHOT_PERIODICALLY);
+ setting.setPreferenceValue(FlatPreferences.RECORDING, 50);
assertTrue(setting.changedFeatures());
}
public void testRevertSettingData() {
// change selected target, options feature
setting.setSelectedTarget("wearable");
- setting.addOptionsSelectedFeature(Feature.SCREENSHOT_PERIODICALLY, 50);
assertTrue(setting.changedFeatures());
// revert selected target, options feature
assertEquals("mobile", setting.getSelectedTarget());
// check selected options feature
- List<FlatPreferences> flatPreferencesList = setting.getOptionsSelectedPreferencesList();
+ List<FlatPreferences> flatPreferencesList = setting.getSelectedPreferencesList();
assertEquals(1, flatPreferencesList.size());
assertEquals(2001, flatPreferencesList.get(0).getIndex());
assertEquals(-1, flatPreferencesList.get(0).getValue());
assertFalse(setting.changedFeatures());
}
+
+ @Test
+ public void testRevertSettedFlatFeatures() {
+ // change selected target, options feature
+ setting.setSelectedTarget("wearable");
+ assertTrue(setting.changedFeatures());
+
+ setting.getTarget(null).addSelectedFlatFeature(
+ PrimitiveFeature.DISK_IO.getName());
+ assertEquals(1, setting.getSelectedFlatFeatureSet().size());
+ assertTrue(setting.isFlatFeatureSelected(FlatFeature.DISK_IO));
+
+ // revert selected target, options feature
+ setting.revertSettingData();
+
+ // check selected target
+ assertEquals("mobile", setting.getSelectedTarget());
+ assertEquals(2, setting.getSelectedFlatFeatureSet()
+ .size());
+ assertFalse(setting.isFlatFeatureSelected(FlatFeature.DISK_IO));
+
+ // check selected options feature
+ List<FlatPreferences> flatPreferencesList = setting
+ .getSelectedPreferencesList();
+ assertEquals(1, flatPreferencesList.size());
+ assertEquals(2001, flatPreferencesList.get(0).getIndex());
+ assertEquals(-1, flatPreferencesList.get(0).getValue());
+
+ assertFalse(setting.changedFeatures());
+ }
+
+ @Test
+ public void testConnectedTarget() {
+ assertNull(setting.getConnectedTargetOrNull());
+ assertEquals("mobile", setting.getConnectedTargetOrSelected().getTargetName());
+ }
}
Bundle-Activator: org.tizen.dynamicanalyzer.widgets.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.tizen.dynamicanalyzer.common;bundle-version="1.0.0"
+ org.tizen.dynamicanalyzer.common;bundle-version="1.0.0",
+ org.tizen.dynamicanalyzer.appearance;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Export-Package: org.tizen.dynamicanalyzer.widgets,
org.tizen.dynamicanalyzer.widgets.chart,
org.tizen.dynamicanalyzer.widgets.chartBoard,
org.tizen.dynamicanalyzer.widgets.combo,
+ org.tizen.dynamicanalyzer.widgets.da.base,
+ org.tizen.dynamicanalyzer.widgets.da.view,
org.tizen.dynamicanalyzer.widgets.graph.bar,
org.tizen.dynamicanalyzer.widgets.graph.circular,
org.tizen.dynamicanalyzer.widgets.helper,
source.. = src/
bin.includes = .,\
- Images/,\
META-INF/,\
.project,\
.classpath,\
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
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;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.widgets.DAWidgetConstants;
import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
-import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
public class DARadioButton extends Canvas {
private static int radioSeq = 0;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Display;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.util.Logger;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot.AutoRangeType;
import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
import org.tizen.dynamicanalyzer.widgets.helper.FontResources;
import org.tizen.dynamicanalyzer.widgets.helper.Formatter;
-import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
import org.tizen.dynamicanalyzer.widgets.timeline.MarkerManager;
public class DAChartRenderer {
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.ScrollBar;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.util.CommonUtil;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotMarker;
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.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
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;
public class DAChartBoardItemCell extends Composite {
private final static int DEFAULT_FOLD_TOGGLE_BUTTON_SIZE = 9; //[UX] 05 Feature list - C
import org.tizen.dynamicanalyzer.constant.CommonConstants;\r
import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;\r
\r
+/**\r
+ * Base class for composites of DA. Include method declaration, but methods\r
+ * should be specified in child classes.\r
+ */\r
public abstract class DABaseComposite extends Composite {\r
protected String ID = null;\r
protected String title = CommonConstants.EMPTY;\r
this.ID = id;\r
}\r
\r
- public abstract void clear();\r
+ public void clear() {\r
+ }\r
\r
- public abstract void updateView();\r
+ public void updateView() {\r
+ }\r
\r
- public abstract void updateView(DAViewData data);\r
- \r
- protected abstract boolean isContainer();\r
- \r
- public abstract DABaseComposite getView(String viewid);\r
- \r
- public abstract void callUpdatePage(DAChartBoardItem selectedItem);\r
+ public void updateView(DAViewData data) {\r
+ }\r
+\r
+ protected boolean isContainer(){\r
+ return false;\r
+ };\r
+\r
+ public DABaseComposite getView(String viewId) {\r
+ return null;\r
+ }\r
+\r
+ public void callUpdatePage(DAChartBoardItem selectedItem) {\r
+ }\r
}\r
import org.eclipse.swt.widgets.Composite;\r
import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;\r
\r
-/* page composite represent a page.\r
- * page composite cannot be used for the other purpose. \r
- */\r
\r
// abstract view class cannot have ID\r
-\r
-public abstract class DAPageComposite extends DABaseComposite {\r
+/**\r
+ * Represents Composite that contains composites.\r
+ */\r
+public abstract class DAContainerComposite extends DABaseComposite {\r
public static final String KEY_TOOLTIP = "tooltip";\r
+ public final static int SASH_WIDTH = 2;\r
\r
protected HashMap<String, DABaseComposite> childMap = null;\r
private DAViewData selection = null;\r
private boolean isToplevel = true;\r
\r
- public DAPageComposite(Composite parent, int style) {\r
+ /**\r
+ * Active {@link DATabComposite} for page (if any exists).\r
+ */\r
+ protected DATabComposite activeTabComposite = null;\r
+\r
+ public DAContainerComposite(Composite parent, int style) {\r
super(parent, style);\r
construct();\r
}\r
\r
- public DAPageComposite(Composite parent, int style, boolean istoplevel) {\r
+ public DAContainerComposite(Composite parent, int style, boolean istoplevel) {\r
super(parent, style);\r
this.isToplevel = istoplevel;\r
construct();\r
return isToplevel;\r
}\r
\r
- public Composite getTopTable() {\r
- return null;\r
- }\r
-\r
@Override\r
public void updateView() {\r
for (Map.Entry<String, DABaseComposite> entry : childMap.entrySet()) {\r
entry.getValue().updateView(data);\r
}\r
}\r
- \r
+\r
@Override\r
public void callUpdatePage(DAChartBoardItem selectedItem) {\r
for (Map.Entry<String, DABaseComposite> entry : childMap.entrySet()) {\r
protected boolean isContainer() {\r
return true;\r
}\r
+\r
+ public Composite getActiveTable() {\r
+ return childMap.values().iterator().next();\r
+ }\r
+\r
+ /**\r
+ * Set new active {@link DATabComposite} for page.\r
+ *\r
+ * @param activeTabComposite tab composite to set as active\r
+ */\r
+ public void setActiveTabComposite(DATabComposite activeTabComposite) {\r
+ this.activeTabComposite = activeTabComposite;\r
+ }\r
+\r
+ /**\r
+ * Get active {@link DATabComposite} for page.\r
+ */\r
+ public DATabComposite getActiveTabComposite() {\r
+ return activeTabComposite;\r
+ }\r
+\r
}\r
--- /dev/null
+package org.tizen.dynamicanalyzer.widgets.da.view;
+
+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.Label;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+
+/**
+ * {@link DAViewComposite} that has 2 states: 'shown' and 'hidden'. In 'hidden'
+ * state widget is replaced by label with specified text.
+ */
+public class DAHidableViewComposite extends DAViewComposite {
+ private Label hiddenStateLabel;
+ private StackLayout layout = new StackLayout();
+ private Composite dataComp;
+ private Composite baseComp;
+
+ /**
+ * Constructs with specified text shown in 'hidden' state.
+ *
+ * @param parent parent {@link Composite}
+ * @param style {@link Composite} style
+ * @param titleVisibility whether view title should visible
+ * @param hiddenStateText text to be shown in 'hidden' state
+ */
+ public DAHidableViewComposite(Composite parent, int style, boolean titleVisibilty,
+ String hiddenStateText) {
+ super(parent, style, titleVisibilty);
+ setLayout(new FillLayout());
+
+ // Center label
+ contentArea.setLayout(new FillLayout());
+
+ // Insert new composite between parent and hidableComp
+ baseComp = new Composite(contentArea, SWT.NONE);
+ baseComp.setLayout(layout);
+ baseComp.setBackgroundMode(SWT.INHERIT_DEFAULT);
+ baseComp.setBackground(ColorResources.WHITE);
+
+ // Initialize label
+ hiddenStateLabel = new Label(baseComp, SWT.NONE);
+ hiddenStateLabel.setText(hiddenStateText);
+ hiddenStateLabel.setFont(FontResources.TABLE_HEADER_FONT);
+ hiddenStateLabel.setForeground(ColorResources.TABLE_HEADER_FONT_COLOR);
+ hiddenStateLabel.setAlignment(SWT.CENTER);
+
+ // Show label as hiddenComp is null yet
+ layout.topControl = hiddenStateLabel;
+ }
+
+ @Override
+ public Composite getContentArea() {
+ return baseComp;
+ }
+
+ public void setDataComposite(Composite dataComp) {
+ this.dataComp = dataComp;
+ }
+
+ /**
+ * Hides composite.
+ *
+ * @param hide whether composite should hidden
+ */
+ public void hide(boolean hide) {
+ layout.topControl = hide ? hiddenStateLabel : dataComp;
+ baseComp.layout();
+ }
+
+ /**
+ * Shows composite.
+ */
+ public void show() {
+ hide(false);
+ }
+
+ /**
+ * Hides composite.
+ */
+ public void hide() {
+ hide(true);
+ }
+
+ /**
+ * Checks whether composite is hidden.
+ *
+ * @return {@code true} if composite is hidden
+ */
+ public boolean isHidden() {
+ return layout.topControl == hiddenStateLabel;
+ }
+
+ /**
+ * Sets text shown 'hidden' state.
+ *
+ * @param text a text to be displayed
+ */
+ public void setLabelText(String text) {
+ hiddenStateLabel.setText(text);
+ }
+}
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
import org.tizen.dynamicanalyzer.widgets.da.base.DAButton;
+import org.tizen.dynamicanalyzer.widgets.helper.WidgetUtils;
public class DATabComposite extends DABaseComposite {
public static final int LONG_TAB_WIDTH = 190;
data.right = new FormAttachment(100, 0);
data.bottom = new FormAttachment(100, 0);
contentsComposite.setLayoutData(data);
+
+ // set this composite as active tab composite in the parent if it's not set yet
+ DAContainerComposite parentPage = WidgetUtils.getParentOfType(this,
+ DAContainerComposite.class);
+ if (parentPage != null && parentPage.getActiveTabComposite() == null) {
+ parentPage.setActiveTabComposite(this);
+ }
}
private PaintListener tabCompositePaintListener = new PaintListener() {
finalChild.update();
finalChild.updateView();
+ activateTab();
break;
case SWT.MouseMove:
if (drag) {
public List<DATabButton> getTabButtons() {
return buttons;
}
+
+ /**
+ * Propagate tab activation to the parent {@link DAContainerComposite}.
+ */
+ public void activateTab() {
+ DAContainerComposite parentPage = WidgetUtils.getParentOfType(this,
+ DAContainerComposite.class);
+ if (parentPage != null) {
+ parentPage.setActiveTabComposite(this);
+ }
+ }
+
+ /**
+ * Calculate size of buttons for tables.
+ *
+ * @param width new width of composite.
+ */
+ public void resizeTableButton(int width) {
+ int tabCount = buttons.size();
+
+ int newWidth = (width / tabCount > LONG_TAB_WIDTH)
+ ? LONG_TAB_WIDTH
+ : width / tabCount;
+ updateTabButtonsWidth(newWidth);
+ }
+
}
Control current = this;\r
Composite parent = getParent();\r
while (parent != null) {\r
- if ((parent instanceof DAPageComposite)\r
- && ((DAPageComposite) parent).isToplevel())\r
+ if ((parent instanceof DAContainerComposite)\r
+ && ((DAContainerComposite) parent).isToplevel())\r
break;\r
\r
if (parent instanceof SashForm) {\r
+++ /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.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$
- public static final Image TIMELINE_SIZE_RESTORE = getPngImage("time_line_size_restore"); //$NON-NLS-1$
- public static final Image TIMELINE_SIZE_MIN = getPngImage("time_line_size_min"); //$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_RESTORE = getPngImage("time_line_size_restore"); //$NON-NLS-1$
- public static final Image CHART_ALL_SIZE_MIN = getPngImage("time_line_size_min"); //$NON-NLS-1$
-
- //[UX] 05 Feature list - B
- public static final Image CHART_FULL_NORMAL = getPngImage("ic_zoom"); //$NON-NLS-1$
- public static final Image CHART_FULL_PUSH = getPngImage("ic_zoom"); //$NON-NLS-1$
- public static final Image CHART_FULL_HOVER = getPngImage("ic_zoom"); //$NON-NLS-1$
- public static final Image CHART_RESTORE_NORMAL = getPngImage("ic_zoom_out"); //$NON-NLS-1$
- public static final Image CHART_RESTORE_PUSH = getPngImage("ic_zoom_out"); //$NON-NLS-1$
- public static final Image CHART_RESTORE_HOVER = getPngImage("ic_zoom_out"); //$NON-NLS-1$
-
- public static final Image CHART_INFO = getPngImage("process_info"); //$NON-NLS-1$
-
- /* range */
- public static final Image MARKER_START_NORMAL = getPngImage("marker_start_nor");
- public static final Image MARKER_START_HOVER = getPngImage("marker_start_hover");
- public static final Image MARKER_START_PUSH = getPngImage("marker_start_push");
- public static final Image MARKER_END_NORMAL = getPngImage("marker_end_nor");
- public static final Image MARKER_END_HOVER = getPngImage("marker_end_hover");
- public static final Image MARKER_END_PUSH = getPngImage("marker_end_push");
-
- /*** 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$
-
- /*** context child arrow ***/
- public static final Image CONTEXT_OPEN = getPngImage("context_menu_child_arrow"); //$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$
-
- // ui event dialog
- public static final Image UIEVENT_DIALOG_START_NORMAL = getPngImage("event_list_start_normal"); //$NON-NLS-1$
- public static final Image UIEVENT_DIALOG_START_HOVER = getPngImage("event_list_start_hover"); //$NON-NLS-1$
- public static final Image UIEVENT_DIALOG_START_SELECTED_NORMAL = getPngImage("event_list_start_selected_normal"); //$NON-NLS-1$
- public static final Image UIEVENT_DIALOG_START_SELECTED_HOVER = getPngImage("event_list_start_selected_hover"); //$NON-NLS-1$
- public static final Image UIEVENT_DIALOG_END_NORMAL = getPngImage("event_list_end_normal"); //$NON-NLS-1$
- public static final Image UIEVENT_DIALOG_END_HOVER = getPngImage("event_list_end_hover"); //$NON-NLS-1$
- public static final Image UIEVENT_DIALOG_END_SELECTED_NORMAL = getPngImage("event_list_end_selected_normal"); //$NON-NLS-1$
- public static final Image UIEVENT_DIALOG_END_SELECTED_HOVER = getPngImage("event_list_end_selected_hover"); //$NON-NLS-1$
-
-
- /** new timeline **/
- public static final Image APP_NOR = getPngImage("app_nor");
- public static final Image APP_OVER = getPngImage("app_over");
- public static final Image APP_SEL = getPngImage("app_sel");
- public static final Image BOX_TIME_NOW = getPngImage("box_time_now");
- public static final Image BTN_IC_CONNECT_ICON = getPngImage("btn_ic_connect_icon");
- public static final Image CAPTURE_POINT = getPngImage("capture_point");
- public static final Image DA_INFO_ICON_DIM = getPngImage("da_info_icon_dim");
- public static final Image DA_INFO_ICON_NOR = getPngImage("da_info_icon_nor");
- public static final Image DA_INFO_ICON_OVER = getPngImage("da_info_icon_over");
- public static final Image DA_INFO_ICON_SEL = getPngImage("da_info_icon_sel");
- public static final Image DA_PREFERENCES_ICON_DIM = getPngImage("da_preferences_icon_dim");
- public static final Image DA_PREFERENCES_ICON_NOR = getPngImage("da_preferences_icon_nor");
- public static final Image DA_PREFERENCES_ICON_OVER = getPngImage("da_preferences_icon_over");
- public static final Image DA_PREFERENCES_ICON_SEL = getPngImage("da_preferences_icon_sel");
- public static final Image DA_SCREENSHOT_ICON_DIM = getPngImage("da_screenshot_icon_dim");
- public static final Image DA_SCREENSHOT_ICON_FOC = getPngImage("da_screenshot_icon_foc");
- public static final Image DA_SCREENSHOT_ICON_NOR = getPngImage("da_screenshot_icon_nor");
- public static final Image DA_SCREENSHOT_ICON_OVER = getPngImage("da_screenshot_icon_over");
- public static final Image DROP_ARROW_DOWN_EDIT = getPngImage("drop_arrow_down_edit");
- public static final Image DROP_ARROW_DOWN_NOR = getPngImage("drop_arrow_down_nor");
- public static final Image DROP_ARROW_UP_NORL = getPngImage("drop_arrow_up_norl");
- public static final Image DROP_ARROW_UP_SEL = getPngImage("drop_arrow_up_sel");
- public static final Image DVICE_MOBILE_NOR = getPngImage("dvice_mobile_nor");
- public static final Image DVICE_MOBILE_OVER = getPngImage("dvice_mobile_over");
- public static final Image DVICE_MOBILE_SEL = getPngImage("dvice_mobile_sel");
- public static final Image DVICE_TV_NOR = getPngImage("dvice_tv_nor");
- public static final Image DVICE_TV_OVER = getPngImage("dvice_tv_over");
- public static final Image DVICE_TV_SEL = getPngImage("dvice_tv_sel");
- public static final Image DVICE_WEARABLE_NOR = getPngImage("dvice_wearable_nor");
- public static final Image DVICE_WEARABLE_OVER = getPngImage("dvice_wearable_over");
- public static final Image DVICE_WEARABLE_SEL = getPngImage("dvice_wearable_sel");
- public static final Image EMULATOR_TITLE_BG_02 = getPngImage("emulator_title_bg_02");
- public static final Image END_MARKER = getPngImage("end_marker");
- public static final Image IC_ZOOM = getPngImage("ic_zoom");
- public static final Image IC_ZOOM_OUT = getPngImage("ic_zoom_out");
- public static final Image MARKER = getPngImage("marker");
- public static final Image MARKER_NOR = getPngImage("marker_nor");
- public static final Image P_ARROW_B = getPngImage("p_arrow_b");
- public static final Image P_ARROW_R = getPngImage("p_arrow_r");
- public static final Image START_MARKER = getPngImage("start_marker");
- public static final Image TIP_BOX_ARROW = getPngImage("tip_box_arrow");
- public static final Image TOGGLE_OFF = getPngImage("toggle_off");
- public static final Image TOGGLE_ON = getPngImage("toggle_on");
- public static final Image TOOLTIP_ICON_FOC = getPngImage("tooltip_icon_foc");
- public static final Image TOOLTIP_ICON_NOR = getPngImage("tooltip_icon_nor");
- public static final Image ZOOM_IN_ICON = getPngImage("zoom_in_icon");
- public static final Image ZOOM_IN_ICON_MV = getPngImage("zoom_in_icon_mv");
- public static final Image ZOOM_OUT_ICON = getPngImage("zoom_out_icon");
- public static final Image ZOOM_OUT_ICON_MV = getPngImage("zoom_out_icon_mv");
- public static final Image ZOOM_CONTROL = getPngImage("zoom_control");
- public static final Image CHILD_CHART_FOLD = getPngImage("child_chart_fold");
- public static final Image CHILD_CHART_FOLD_HOVER = getPngImage("child_chart_fold_hover");
- public static final Image CHILD_CHART_UNFOLD = getPngImage("child_chart_unfold");
- public static final Image CHILD_CHART_UNFOLD_HOVER = getPngImage("child_chart_unfold_hover");
-
-
- 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
- // Logger.exception(e);
- // }
- // 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);
- }
-}
package org.tizen.dynamicanalyzer.widgets.helper;
import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
public class WidgetUtils {
shell.setLocation(childX, childY);
}
+
+ /**
+ * Search parent of specified type in SWT composites hierarchy.
+ *
+ * @param composite composite to start search from
+ * @param type parent class type to look for
+ * @return parent which is instance of <code>type</code> class
+ * or <code>null</code> if there is no parent of such type in hierarchy
+ */
+ public static <T> T getParentOfType(Composite composite, Class<T> type) {
+ Composite result = composite.getParent();
+ while (result != null && !(type.isInstance(result))) {
+ result = result.getParent();
+ }
+ return (T) result;
+ }
}
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
-import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
public class DAPopupMenu {
private Composite parent;
return;
}
DACustomButton button = (DACustomButton) obj;
+ if (button.isDisposed())
+ return;
obj = button.getData();
if (!(obj instanceof DAPopupMenuItem)) {
return;
}
DAPopupMenuItem item = (DAPopupMenuItem) obj;
widgetSelected(item);
+ item.closeParent();
}
/**
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
-import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
public class DATimelineFrameRenderer extends DATimelineRenderer {
public static final int DEFAULT_INTERVAL = 1;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
import org.tizen.dynamicanalyzer.widgets.helper.FontResources;
import org.tizen.dynamicanalyzer.widgets.helper.Formatter;
-import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
public class DATimelineTimeRenderer extends DATimelineRenderer {
protected final Image balloon = ImageResources.TIMELINE_DETAILED_TIME_BALLOON;
import java.util.ArrayList;
import java.util.List;
-import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.widgets.timeline.markers.IEventListener;
import org.tizen.dynamicanalyzer.widgets.timeline.markers.MarkerAddEvent;
import org.tizen.dynamicanalyzer.widgets.timeline.markers.MarkerEvent;
<?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="2.3.21.qualifier" useFeatures="true" includeLaunchers="true">
+<product name="%DynamicAnalyzer" uid="org.tizen.dynamicanalyzer.workbench.product" id="org.tizen.dynamicanalyzer.workbench.product" application="org.tizen.dynamicanalyzer.workbench.application" version="2.4.0.qualifier" useFeatures="true" includeLaunchers="true">
<aboutInfo>
<image path="icons/about_tizen_sdk.png"/>
<parent>
<artifactId>dynamic-analyzer</artifactId>
<groupId>org.tizen.dynamicanalyzer</groupId>
- <version>2.3.21-SNAPSHOT</version>
+ <version>2.4.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<groupId>org.tizen.dynamicanalyzer</groupId>
<artifactId>org.tizen.dynamicanalyzer.workbench.product</artifactId>
- <version>2.3.21-SNAPSHOT</version>
+ <version>2.4.0-SNAPSHOT</version>
<packaging>eclipse-repository</packaging>
<properties>
+++ /dev/null
-1|System|0|||CPU Usage||||
-2|System cpu|1|1|Timeline|Core Usage||||
-3|System process|1|1|Timeline|Process Memory-Heap Allocation||||
-4|System memory|1|1|Timeline|System Memory-Heap Allocation||||
-5|System processes|1|1|Timeline|CPU Usage||||
-6|System disk|1|1|Timeline|Disk IO||||
-7|System network|1|1|Timeline|Network IO||||
-8|System device|1|1|Timeline|Device||||
-9|System energy|1|1|Timeline|Power Estimation||||
-100|Function profiling|0||Timeline-Summary|||||
-101|Function sampling|0||Summary|||||
-301|Memory allocation|0||Memory|Heap allocation||||3
-103|Application startup|0||Timeline|||||
-200|File analysis|0||File|File Analysis||||
-201|Thread analysis|0||Thread|Thread||||
-202|Network analysis|0||Network|Network IO||||
-203|OpenGL ES analysis|0||OpenGL|Frame rate||||3
-204|UI event|0||Timeline|UI event||||
-205|Context switch|0||Kernel|||||2
-206|UI Hierarchy analysis|0||UI Hierarchy|UI Hierarchy||||
-300|Inside the platform|0|||||||3
-302|Inside the platform file|1|300|File|||||
-303|Inside the platform thread|1|300|Thread|||||3
-304|Inside the platform network|1|300|Network|||||
-305|Inside the platform openGL|1|300|OpenGL|||||
-500|System call|0|||||||2
-501|System call file|1|500|Timeline|||||2
-502|System call ipc|1|500|Timeline|||||2
-503|System call process|1|500|Timeline|||||2
-504|System call signal|1|500|Timeline|||||2
-505|System call network|1|500|Timeline|||||2
-506|System call desc|1|500|Timeline|||||2
-1000|System information sampling periodic|2|1|||100|1000|1000|
-1001|Function profiling sampling periodic|2|101|||1|100|10|
-5000|On scene transition|0||Timeline|Screenshot||||
-5001|periodically|0||Timeline|Screenshot|10|100|10|
-5002|Recording|0|||||||
-5003|Auto Stop|0|||||||
Debug Print|Y
Available Target List|mobile|wearable
Selected Target|mobile
-Default Feature List|2|3|103
Total Overhead Range|1000000|3000000|7000000|15000000
-Options Selected Feature List|5002:0
Selected Preferences|2001
mobile|Protocol Version|4.0
-mobile|Available Template List|1|2|3|4|5|6|7|8|9|10|11
-mobile|Selected Template|1
-mobile|Available Feature List|1|1000|4|5|6|7|8|9|100|101|1001|301|200|201|202|203|204|206
mobile|Available FlatFeature List|101|102|103|201|202|203|301|302|401|501|502|601|602|603|701|801|802
-mobile|Selected Feature List|1|5|1000:1000|100|101|1001:10
mobile|Selected FlatFeature List|
mobile|Available Chart List|CPU Usage|Core Usage|Core Frequency|System Memory|Process Memory|Heap Allocation|Screenshot|UI Event|Disk IO|Network IO|Peripheral Status|Power Estimation
wearable|Protocol Version|3.0
-wearable|Available Template List|1|2|3|4|5|6|7|8|9|10|11
-wearable|Selected Template|1
-wearable|Available Feature List|1|1000|4|5|6|7|8|9|100|101|1001|301|200|201|202|203|204|206
wearable|Available FlatFeature List|101|102|103|201|202|203|301|302|401|501|502|601|602|603|701|801|802
-wearable|Selected Feature List|1|5|1000:1000|100|101|1001:10
wearable|Selected FlatFeature List|
wearable|Available Chart List|CPU Usage|Core Usage|Core Frequency|System Memory|Process Memory|Heap Allocation|Screenshot|UI Event|Disk IO|Network IO|Peripheral Status|Power Estimation
tv|Protocol Version|3.0
-tv|Available Template List|1|2|3|4|5|6|7|8|10
-tv|Selected Template|1
-tv|Available Feature List|1|1000|4|5|6|7|100|101|1001|102|200|201|202|203
tv|Available FlatFeature List|101|102|103|201|202|203|301|302|401|501|502|601|602|603|701|801|802
-tv|Selected Feature List|1|5|1000:1000|100|101|1001:10
+tv|Selected FlatFeature List|
tv|Available Chart List|CPU|CPU core|CPU frequency|Heap allocation|Process Size|Memory|Screenshot|Disk IO|Network IO
+++ /dev/null
-1|Bottleneck|1|5|1000:1000|100|101|1001:10
-2|Memory Leaks|301|1|4|1000:1000|100
-3|Process Activity|1|5|4|1000:1000|100|101|1001:10
-4|File|1|6|1000:1000|200
-5|Thread Activity|1|5|1000:1000|201
-6|Wait Status|1|5|7|6|1000:1000|201|202|200
-7|Network|1|7|1000:1000|202
-8|OpenGL|1|5|1000:1000|100|203
-9|Energy|1|5|4|9|1000:1000
-10|UI Hierarchy|206
-11|Custom
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui,
org.tizen.dynamicanalyzer.common;bundle-version="1.0.0",
- org.tizen.dynamicanalyzer.appearance;bundle-version="1.0.0"
+ org.tizen.dynamicanalyzer.appearance;bundle-version="1.0.0",
+ org.tizen.dynamicanalyzer.widgets
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Export-Package: org.tizen.dynamicanalyzer.common.path,
org.tizen.dynamicanalyzer.util,
IExtension ext = null;
for (IActionSetDescriptor actionSet : actionSets) {
for (String element : actionSetId) {
- System.out.println(element);
-
if (element.equals(actionSet.getId())) {
ext = actionSet.getConfigurationElement().getDeclaringExtension();
asr.removeExtension(ext, new Object[] { actionSet });
\r
#Command name\r
StartStopTrace=Start Stop Trace\r
-Replay=Replay\r
\r
#Command name, Command label, Toolbar tooltip\r
SaveTrace=Save Trace\r
contextId="org.eclipse.ui.contexts.window"
schemeId="myscheme"
sequence="M1+E">
- </key>
+ </key>
+ <key
+ commandId="Shortcut"
+ contextId="org.eclipse.ui.contexts.window"
+ schemeId="myscheme"
+ sequence="M1+F">
+ </key>
</extension>
</plugin>
--- /dev/null
+package org.tizen.dynamicanalyzer.common;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.nio.charset.StandardCharsets;
+
+import org.tizen.dynamicanalyzer.common.path.PathManager;
+import org.tizen.dynamicanalyzer.constant.CommonConstants;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.util.CommonUtil;
+import org.tizen.dynamicanalyzer.util.Logger;
+
+/**
+ * Singleton representing product information to be displayed in 'About' dialog.
+ *
+ * It provides following information:
+ * 1) SDK build information
+ * 2) DA build ID
+ * 3) DA version
+ * 4) Tizen site URL
+ * 5) Release note
+ */
+public class AboutInfo {
+
+ private final static String daAboutFilePath = PathManager.getWorkbenchPluginPath() + File.separator + "about.mappings";
+ private final static String daVersionFilePath = PathManager.DA_INSTALL_PATH + File.separator + "version";
+ private final static String sdkVersionFilePath = PathManager.TIZEN_SDK_INSTALL_PATH + File.separator + "sdk.version";
+
+ private String sdkBuildVersionInfo = CommonConstants.EMPTY;
+ private String daBuildIDInfo = CommonConstants.EMPTY;
+ private String daVersionInfo = CommonConstants.EMPTY;
+ private String tizenSite = CommonConstants.EMPTY;
+ private String releaseNote = CommonConstants.EMPTY;
+
+ private static AboutInfo instance = new AboutInfo();
+
+ /**
+ * Constructs instance of this class parsing files with build information.
+ */
+ private AboutInfo() {
+ updateDABuildInfo();
+ sdkBuildVersionInfo = parseSdkVersionFile();
+ tizenSite = AnalyzerLabels.TIZEN_SITE_LINK;
+ releaseNote = AnalyzerLabels.RELEASE_NOTE_LINK;
+ }
+
+ public static AboutInfo getInstance() {
+ return instance;
+ }
+
+ public String getSDKVersion() {
+ return sdkBuildVersionInfo;
+ }
+
+ public String getDABuildID() {
+ return daBuildIDInfo;
+ }
+
+ public String getDAVersion() {
+ return daVersionInfo;
+ }
+
+ public String getTizenSite() {
+ return tizenSite;
+ }
+
+ public String getReleaseNote() {
+ return releaseNote;
+ }
+
+ /**
+ * Parses build version parameter in about.mappings file.
+ *
+ * @param readData string to parse
+ * @return build version string representation
+ */
+ private String parseBuildVersion(String readData) {
+ String[] splitData = readData.split("0="); //$NON-NLS-1$
+ int size = splitData.length;
+ if (2 != size) {
+ return null;
+ }
+ return splitData[1];
+ }
+
+ /**
+ * Parses build time parameter in about.mappings file.
+ *
+ * @param readData string to parse
+ * @return build time string representation
+ */
+ private static String parseBuildTime(String readData) {
+ String[] splitData = readData.split("1="); //$NON-NLS-1$
+ int size = splitData.length;
+ if (2 != size) {
+ return null;
+ }
+ return splitData[1];
+ }
+
+ /**
+ * Parses file with SDK version information.
+ *
+ * @return SDK version string representation
+ */
+ private String parseSdkVersionFile() {
+ File file = new File(sdkVersionFilePath);
+ if (!file.exists()) {
+ Logger.warning("File does not exist: " + sdkVersionFilePath);
+ return CommonConstants.EMPTY;
+ }
+ BufferedReader in = null;
+ String content;
+ try {
+ Reader reader = new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8);
+ in = new BufferedReader(reader);
+ while (null != (content = in.readLine())) {
+ String[] splitData = content.split("TIZEN_SDK_VERSION="); //$NON-NLS-1$
+ int size = splitData.length;
+ if (2 == size) {
+ return splitData[1];
+ }
+ }
+ } catch (FileNotFoundException e) {
+ Logger.exception(e);
+ } catch (IOException e) {
+ Logger.exception(e);
+ } finally {
+ CommonUtil.tryClose(in);
+ }
+ return CommonConstants.EMPTY;
+ }
+
+ /**
+ * Parses files with build version information.
+ */
+ private void updateDABuildInfo() {
+ String buildVersion;
+ String buildTime;
+ File SDKAboutFile = new File(daAboutFilePath);
+ if (!SDKAboutFile.exists()) {
+ Logger.warning("File does not exist: " + daAboutFilePath);
+ return;
+ }
+
+ BufferedReader in = null;
+ String content;
+ try {
+ Reader reader = new InputStreamReader(new FileInputStream(SDKAboutFile), StandardCharsets.UTF_8);
+ in = new BufferedReader(reader);
+ while (null != (content = in.readLine())) {
+ buildVersion = parseBuildVersion(content);
+ if (buildVersion != null) {
+ sdkBuildVersionInfo = buildVersion;
+ }
+ buildTime = parseBuildTime(content);
+ if (buildTime != null) {
+ daBuildIDInfo = buildTime;
+ }
+ }
+ } catch (FileNotFoundException e) {
+ Logger.exception(e);
+ } catch (IOException e) {
+ Logger.exception(e);
+ } finally {
+ CommonUtil.tryClose(in);
+ }
+
+ File DAVersionFile = new File(daVersionFilePath);
+ if (!DAVersionFile.exists()) {
+ Logger.warning("File does not exist: " + daAboutFilePath);
+ return;
+ }
+
+ String daversion = "";
+ try {
+ Reader reader = new InputStreamReader(new FileInputStream(DAVersionFile), StandardCharsets.UTF_8);
+ in = new BufferedReader(reader);
+ while (null != (daversion = in.readLine())) {
+ daVersionInfo = daversion;
+ }
+ } catch (FileNotFoundException e) {
+ Logger.exception(e);
+ } catch (IOException e) {
+ Logger.exception(e);
+ } finally {
+ CommonUtil.tryClose(in);
+ }
+ }
+}
// file constants
public final static int F_SETLKW = 7;
- public final static int SASH_WIDTH = 2;
-
// events
public final static int TREE_SORT_EVENT = 1001;
}
import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSelectionData;
import org.tizen.dynamicanalyzer.ui.page.BaseView;
import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
-import org.tizen.dynamicanalyzer.ui.summary.leaks.NewLeakDetector;
import org.tizen.dynamicanalyzer.ui.summary.warning.WarningChecker;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
import org.tizen.dynamicanalyzer.widgets.da.view.DABaseComposite;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAContainerComposite;
public class AnalyzerManager {
public static final Object waitStartAck = new Object();
private static boolean dataSocketClosed = false; // set by data channel thread
private static boolean stopAckArrived = false; // set by control channel
- private static NewLeakDetector newLeakDetector = new NewLeakDetector();
private static WarningChecker warningChecker = new WarningChecker();
public static boolean isPlatformSDK() {
stopAckArrived = arrived;
}
- public static NewLeakDetector getNewLeakDetector() {
- return newLeakDetector;
- }
-
public static WarningChecker getWarningChecker() {
return warningChecker;
}
terminateMsgArrived = false;
stopAckArrived = false;
- newLeakDetector.clear();
warningChecker.clear();
if (Global.isGUIMode()) {
}
@UIMethod
- public static DAPageComposite getCurrentPage() {
+ public static DAContainerComposite getCurrentPage() {
BaseView bv = (BaseView) WorkbenchUtil.getViewPart(BaseView.ID);
return bv.getTopComposite();
}
\r
@Override\r
public void start(BundleContext context) throws Exception {\r
+ Logger.info(">>> DA version: " + AboutInfo.getInstance().getDABuildID() + ", SDK version: "\r
+ + AboutInfo.getInstance().getSDKVersion() + " <<<");\r
+\r
super.start(context);\r
plugin = this;\r
\r
// trace Application
public static void autoStartApplication(String[] message) {
strMsg = message;
- Thread thread = new Thread(new AutoStartManager());
+ Thread thread = new Thread(new AutoStartManager(), AutoStartManager.class.getSimpleName());
thread.start();
}
}
}
+ /**
+ * Blocks caller thread until DA state doesn't become Running or Done.
+ *
+ * @throws InterruptedException if waiting was interrupted
+ */
+ public static void waitRunning() throws InterruptedException {
+ stateLock.lock();
+ try {
+ while (!isRunning() && currentState != DONE) {
+ preparedCondition.await();
+ }
+ } finally {
+ stateLock.unlock();
+ }
+ }
+
public static boolean isRunning() {
return (currentState == RUNNING);
}
import org.tizen.dynamicanalyzer.project.PackageInfo;
import org.tizen.dynamicanalyzer.project.Project;
import org.tizen.dynamicanalyzer.project.callstack.RuntimeCallstackManager;
+import org.tizen.dynamicanalyzer.protocol.Protocol;
import org.tizen.dynamicanalyzer.util.Logger;
// This class is for global information that can be accessed from anywhere in dynamic analyzer code.
private static PackageInfo currentApplication = null;
private static Project currentProject = null;
private static RuntimeCallstackManager temporaryCallstackManager = new RuntimeCallstackManager();
+ private static boolean lsanInitSucceeded = false;
+
+ public static boolean isLSanInitialized() {
+ return lsanInitSucceeded;
+ }
+
+ public static void setLSanInitialized(boolean initSucceeded) {
+ lsanInitSucceeded = initSucceeded;
+ }
public static UIMode getCurrentUIMode() {
return currentUIMode;
Global.currentProject = p;
}
+ /**
+ * Get version of used protocol from current project if any
+ * or from currently connected device
+ * @return {@link Protocol} enum value
+ */
+ public static Protocol getCurrentProtocol() {
+ if (currentProject != null && currentProject.getProtocolVersion() != null)
+ return Protocol.getVersion(currentProject.getProtocolVersion());
+ else if (currentDevice != null
+ && currentDevice.getCommunicator().getProtocolVersion() != null)
+ return Protocol.getVersion(currentDevice.getCommunicator().getProtocolVersion());
+ return Protocol.VERSION_UNKNOWN;
+ }
+
public static String getFunctionName(int id) {
if (currentProject != null) {
return currentProject.getFunctionName(id);
import org.eclipse.swt.widgets.Shell;
import org.tizen.dynamicanalyzer.callback.IExecutionCallback;
import org.tizen.dynamicanalyzer.ui.toolbar.setting.FlatFeatureDialog;
-import org.tizen.dynamicanalyzer.ui.toolbar.setting.SettingDialog;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
public class PostWindowOpenCallback implements IExecutionCallback {
public void run() {
CommunicatorUtils.unforward(device.getIDevice(), localPort, remotePort);
}
- });
+ }, "UnforwardThread");
UnforwardThread.start();
}
SEND_STARTMSG(15),
WAIT_PROCINFO(20),
START_CLOCK(2),
- CREATE_REPLAY_TIMER(2),
CREATE_SCREENSHOT_TIMER(2),
CREATE_UPDATE_TIMER(2),
STOP_RESOURCE_MONITOR(2),
STOP_CLOCK(2),
- STOP_REPLAY_TIMER(2),
STOP_SCREENSHOT_TIMER(2),
STOP_UPDATE_TIMER(2),
SEND_STOPMSG(15),
STAGE.RESET_UI, STAGE.CREATE_DATATHREAD, STAGE.CREATE_MESSAGEPARSER,
STAGE.CREATE_LOGPARSER, STAGE.CREATE_PAGEMANAGER, STAGE.CREATE_CALLSTACK_INSERTER,
STAGE.START_RESOURCE_MONITOR, STAGE.SEND_STARTMSG, STAGE.WAIT_PROCINFO,
- STAGE.START_CLOCK, STAGE.CREATE_REPLAY_TIMER, STAGE.CREATE_SCREENSHOT_TIMER,
- STAGE.CREATE_UPDATE_TIMER, STAGE.FINAL };
+ STAGE.START_CLOCK, STAGE.CREATE_SCREENSHOT_TIMER, STAGE.CREATE_UPDATE_TIMER, STAGE.FINAL };
private static STAGE[] cancelTraceStartProgress = new STAGE[] { STAGE.CREATE_UPDATE_TIMER,
- STAGE.CREATE_SCREENSHOT_TIMER, STAGE.CREATE_REPLAY_TIMER, STAGE.START_CLOCK,
- STAGE.SEND_STARTMSG, STAGE.START_RESOURCE_MONITOR, STAGE.CREATE_CALLSTACK_INSERTER,
+ STAGE.CREATE_SCREENSHOT_TIMER, STAGE.START_CLOCK, STAGE.SEND_STARTMSG,
+ STAGE.START_RESOURCE_MONITOR, STAGE.CREATE_CALLSTACK_INSERTER,
STAGE.CREATE_PAGEMANAGER, STAGE.CREATE_LOGPARSER, STAGE.CREATE_MESSAGEPARSER,
STAGE.CREATE_DATATHREAD, STAGE.CREATE_PROJECT, STAGE.FINAL };
private static STAGE[] traceEndProgress = new STAGE[] { STAGE.STOP_RESOURCE_MONITOR,
- STAGE.SEND_STOPMSG, STAGE.STOP_CLOCK, STAGE.STOP_REPLAY_TIMER,
- STAGE.STOP_SCREENSHOT_TIMER, STAGE.STOP_UPDATE_TIMER, STAGE.STOP_DATATHREADS,
- STAGE.SUMMARIZE_UI, STAGE.FINAL };
+ STAGE.SEND_STOPMSG, STAGE.STOP_CLOCK, STAGE.STOP_SCREENSHOT_TIMER,
+ STAGE.STOP_UPDATE_TIMER, STAGE.STOP_DATATHREADS,STAGE.SUMMARIZE_UI, STAGE.FINAL };
private static STAGE[] rangeAnalysisProgress = new STAGE[] { STAGE.FINAL };
public static int getPercent(PHASE phase, STAGE stage) {
import org.tizen.dynamicanalyzer.control.ProgressTable.PHASE;
import org.tizen.dynamicanalyzer.control.ProgressTable.STAGE;
import org.tizen.dynamicanalyzer.handlers.CommonAction;
-import org.tizen.dynamicanalyzer.handlers.ReplayManager;
import org.tizen.dynamicanalyzer.handlers.UIActionHolder;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.nl.MenuBarLabels;
if (Global.isGUIMode()) {
Display.getDefault().syncExec(new Runnable() {
@Override
- public void run() {
- MenuBar.getInstance().setMenuItemEnable(MenuBarLabels.ANALYZE_SCREENSHOT, true);
+ public void run() {
MenuBar.getInstance().setMenuItemEnable(MenuBarLabels.FILE_NEW, false);
MenuBar.getInstance().setMenuItemEnable(MenuBarLabels.FILE_LOAD, false);
}
// start toolbar clock
setStageComplete(STAGE.START_CLOCK);
- // if it is replay mode, set stop alarm
- ReplayManager.setStopAlarm();
- setStageComplete(STAGE.CREATE_REPLAY_TIMER);
-
// start screenshot timer
FlatPreferences feature = FlatPreferences.SCREENSHOT_PERIODICALLY;
- int value = SettingDataManager.INSTANCE.getOptionsPreferencesValue(feature);
+ int value = SettingDataManager.INSTANCE.getPreferenceValue(feature);
if (SettingDataManager.INSTANCE.getSelectedFlatFeatureSet().contains(FlatFeature.SCREENSHOT)
&& value > 0) {
ScreenshotTimer.start(value);
case CREATE_SCREENSHOT_TIMER:
ScreenshotTimer.stop();
setCancelProgress(STAGE.CREATE_SCREENSHOT_TIMER);
- case CREATE_REPLAY_TIMER:
- ReplayManager.resetStopAlarm();
- setCancelProgress(STAGE.CREATE_REPLAY_TIMER);
case START_CLOCK:
setCancelProgress(STAGE.START_CLOCK);
case WAIT_PROCINFO:
public void run() {
DLogDataManager.getInstance().startDlog();
}
- });
+ }, "StartDlogThread");
DlogThread.start();
}
}
*/
package org.tizen.dynamicanalyzer.control;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Condition;
+
import org.eclipse.swt.widgets.Display;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.common.DAResult;
import org.tizen.dynamicanalyzer.common.DAState;
import org.tizen.dynamicanalyzer.common.Global;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
-import org.tizen.dynamicanalyzer.handlers.ReplayManager;
import org.tizen.dynamicanalyzer.handlers.UIActionHolder;
import org.tizen.dynamicanalyzer.nl.MenuBarLabels;
import org.tizen.dynamicanalyzer.project.Project;
-import org.tizen.dynamicanalyzer.setting.Feature;
+import org.tizen.dynamicanalyzer.setting.FlatFeature;
import org.tizen.dynamicanalyzer.setting.SettingDataManager;
import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
import org.tizen.dynamicanalyzer.swap.communicator.DataChannelThread;
import org.tizen.dynamicanalyzer.ui.toolbar.Toolbar;
import org.tizen.dynamicanalyzer.util.Logger;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
public class StopTraceManager implements Runnable {
+ // timeout in nanoseconds
+ private static final long LSAN_MESSAGE_TIMEOUT = TimeUnit.SECONDS.toNanos(30);
private DAResult error;
private boolean stopFromTarget = false;
}
private static class ForcedStopThread extends Thread {
+ public ForcedStopThread() {
+ super(ForcedStopThread.class.getSimpleName());
+ }
+
public void run() {
// stop data channel
DataChannelThread.getInstance().stopForced();
}
private static class NormalStopThread extends Thread {
+ public NormalStopThread() {
+ super(NormalStopThread.class.getSimpleName());
+ }
+
public void run() {
// stop data channel
DataChannelThread.getInstance().stopNormal();
if (Global.isGUIMode()) {
Toolbar.INSTANCE.stopTimer();
}
- // stop replay timer
- ReplayManager.resetStopAlarm();
// stop screenshot timer
ScreenshotTimer.stop();
// stop update timer
UpdateViewTimer.stop();
}
- });
+ }, "StopTimersThread");
stopTimers.start();
+ // if LSan is initialized wait for 2nd message for some time
+ AnalyzerUtil.getLSanLock().lock();
+ if (Global.isLSanInitialized()) {
+ try {
+ long remainedTime = LSAN_MESSAGE_TIMEOUT;
+ Condition cond = AnalyzerUtil.getLSanCondition();
+ while (Global.isLSanInitialized()) {
+ if (remainedTime <= 0) {
+ Logger.warning("LeakSanitizer message timeout!");
+ break;
+ }
+
+ remainedTime = cond.awaitNanos(remainedTime);
+ }
+ } catch (InterruptedException e) {
+ Logger.warning("Interrupted while waiting for message from LeakSanitizer");
+ } finally {
+ Global.setLSanInitialized(false);
+ }
+ }
+ AnalyzerUtil.getLSanLock().unlock();
+
// if error code equals with canceling then stop threads by force
if (error.equals(DAResult.ErrorCode.ERR_BY_USER_CANCEL)) {
stopThread = new ForcedStopThread();
} finally {
+ updateDAState();
+ // we must wait for all data threads to join before updating heap tables.
if (Global.isGUIMode()) {
startUpdateHeapDataManager();
}
- updateDAState();
}
}
* Calculate allocation data in HeapDataManager.
*/
private void startUpdateHeapDataManager() {
- if(SettingDataManager.INSTANCE.getSelectedFeatureSet().contains(Feature.INTERNAL_PROBE_MEMORY)) {
+ if(SettingDataManager.INSTANCE.getSelectedFlatFeatureSet().contains(FlatFeature.MEMORY_ALLOC)) {
Thread calculateAllocData = new Thread(new Runnable() {
public void run() {
Logger.info("Run : HeapDataManager for calculating alloc data");
}
});
}
- });
+ }, "CalculateAllocDataThread");
calculateAllocData.start();
}
}
@Override
public void run() {
MenuBar.getInstance().setMenuItemEnable(MenuBarLabels.FILE_SAVE, true);
- MenuBar.getInstance().setMenuItemEnable(MenuBarLabels.ANALYZE_SCREENSHOT, false);
MenuBar.getInstance().setMenuItemEnable(MenuBarLabels.FILE_NEW, true);
MenuBar.getInstance().setMenuItemEnable(MenuBarLabels.FILE_LOAD, true);
AnalyzerManager.getCurrentPage().updateView();
// execute prepared with data
SqlConnectionManager.executePreparedWithInterface(query.toString(), data, this);
+ postProcess(data);
}
}
+ /**
+ * Process data after the insertion into database.
+ *
+ * @param data list of rows have been inserted into database
+ */
+ protected void postProcess(List<List<Object>> data) {
+ // do nothing by default
+ }
+
public final boolean createIndexTable() {
int size = columns.size();
StringBuffer indexColumns = new StringBuffer();
"PROFILINGDATA : CALLCOUNT > CALL_COUNT",
"PROFILINGDATA : INCLEXETIME > INCLUSIVE_EXECUTION_TIME",
"PROFILINGDATA : EXCLEXETIME > EXCLUSIVE_EXECUTION_TIME",
- "REPLAY : SEQ > SEQUENCE_NUMBER",
"SYNCAPI : SEQNUMBER > SEQUENCE_NUMBER",
"SYNCAPI : APICALLTIME > CALL_TIME",
"SYNCAPI : APIID > API_ID",
}
// make thread to prepare start
- Thread thread = new Thread(new StartTraceManager());
+ Thread thread = new Thread(new StartTraceManager(),
+ StartTraceManager.class.getSimpleName());
thread.start();
}
}
// make thread to prepare start
- Thread thread = new Thread(new StopTraceManager(error, stopFromTarget));
+ Thread thread = new Thread(new StopTraceManager(error, stopFromTarget),
+ StopTraceManager.class.getSimpleName());
thread.start();
}
private static void updateUiOnStopTrace() {
Toolbar.INSTANCE.changeUIState(DAState.PREPARE_STOP);
ShortCutManager.getInstance().setEnabled(false);
- Global.getProject().setReplayStopTime(Toolbar.INSTANCE.getTime());
}
}
Set<String> targetChartList = SettingDataManager.INSTANCE.getSelectedChartSet(target
.getTargetName());
selectedChartSet.addAll(targetChartList);
- selectedChartSet.addAll(SettingDataManager.INSTANCE.getOptionsSelectedFeatureChartSet());
Logger.debug(selectedChartSet);
Display.getDefault().syncExec(new Runnable() {
import org.tizen.dynamicanalyzer.util.Logger;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
import org.tizen.dynamicanalyzer.widgets.combo.DACustomCombo;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAContainerComposite;
public class OpenTraceHandler extends AbstractHandler {
public static final String ID = OpenTraceHandler.class.getName();
// change page
if (RangeDataManager.getInstance().isBeingAnalyzed()) {
- DAPageComposite page = AnalyzerManager.getCurrentPage();
+ DAContainerComposite page = AnalyzerManager.getCurrentPage();
if (page instanceof RangePage) {
AnalyzerUtil.changePage(TimelinePage.pageID);
}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Jaewon Lim <jaewon81.lim@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.tizen.dynamicanalyzer.common.DAResult;
-import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode;
-import org.tizen.dynamicanalyzer.common.Global;
-import org.tizen.dynamicanalyzer.model.DATime;
-import org.tizen.dynamicanalyzer.setting.FlatPreferences;
-import org.tizen.dynamicanalyzer.setting.SettingDataManager;
-import org.tizen.dynamicanalyzer.swap.model.data.ReplayData;
-import org.tizen.dynamicanalyzer.ui.toolbar.Toolbar;
-import org.tizen.dynamicanalyzer.ui.toolbar.replay.data.ReplayDataManager;
-import org.tizen.dynamicanalyzer.widgets.timer.IAlarm;
-
-public class ReplayManager {
-
- private static boolean isReplay = false;
- private static DATime startTime = null;
- private static long stopTime = -1;
- private static ReplayData replayData = null;
-
- public static boolean init() {
- isReplay = true;
- stopTime = Global.getProject().getReplayStopTime();
- startTime = Global.getProject().getProfilingStartTime();
- replayData = ReplayDataManager.getInstance().getReplayDBManager()
- .getReplayLogs();
-
- return true;
- }
-
- public static void setStopAlarm() {
- if (isReplay && SettingDataManager.INSTANCE.isOptionsSelectedPrefereces(FlatPreferences.AUTO_STOP)) {
-
- Toolbar.INSTANCE.setTimerAlarm(stopTime, new IAlarm() {
- @Override
- public void action() {
- CommandAction.stopTrace(new DAResult(ErrorCode.SUCCESS), false);
- reset();
- }
- });
- }
- }
-
- public static void resetStopAlarm() {
- if (Global.isGUIMode()) {
- Toolbar.INSTANCE.removeTimerAlarm();
- }
- reset();
- }
-
- public static DATime getStartTime() {
- return startTime;
- }
-
- public static ReplayData getReplayData() {
- return replayData;
- }
-
- public static boolean isReplayMode() {
- return isReplay;
- }
-
- public static void reset() {
- isReplay = false;
- }
-}
}
});
}
- });
+ }, "DeviceInitThread");
deviceinitthread.start();
// initialize binary setting
import org.tizen.dynamicanalyzer.ui.thread.ThreadPage;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAContainerComposite;
public class SummaryMouseDoubleClickListener implements MouseListener {
doubleClicked = false;
if (null != pageId && null != data) {
AnalyzerUtil.changePage(pageId);
- DAPageComposite page = (DAPageComposite) AnalyzerUtil
+ DAContainerComposite page = (DAContainerComposite) AnalyzerUtil
.getTabPage(pageId);
page.updateView(new DASelectionData(sourceViewID, data));
}
public static String SAVE_TRACE_TITLE;
public static String OPEN_TRACE;
public static String OPEN_TRACE_TITLE;
- public static String REPLAY;
- public static String REPLAY_EDIT;
// Toolbar button tooltip for mac
public static String START_TRACE_MAC;
public static String STOP_TRACE_MAC;
public static String SAVE_TRACE_MAC;
public static String OPEN_TRACE_MAC;
- public static String REPLAY_MAC;
- public static String REPLAY_EDIT_MAC;
- public static String RANGE_PAGE;
- public static String SNAPSHOT_ENABLE;
-
// string for dialog by toolbar combobox
public static String SELECT_PROCESS;
public static String REMOTE_DEVICE;
public static String IP;
public static String PORT;
- public static String CONNECT;
public static String CONNECTING;
// tooltip text
public static String VIEW_SOURCE_MAC;
// popup window title text
- public static String ABOUT_TITLE;
public static String LICENSE;
- public static String CONFIGURATION;
- public static String REPLAYEDIT;
- public static String WELCOME;
public static String SETTING_TITLE;
// Source tooltip
- public static String SOURCE_NOT_EXIST;
public static String IDE_NOT_LAUNCHED;
- // 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 COOLBAR_AREA_MEMORY_TOOLTIP_MAC;
public static String COOLBAR_AREA_CONFIGURATION_FEATURES;
- public static String COOLBAR_AREA_CONFIGURATION_SETTING;
public static String COOLBAR_AREA_CONFIGURATION_OPTION;
public static String LICENSE_DIALOG_NOT_FOUND;
public static String ABOUT_DIALOG_TIZEN;
public static String ABOUT_DIALOG_DA;
- public static String ABOUT_DIALOG_SDK_VERSION;
public static String ABOUT_DIALOG_DA_VERSION;
public static String ABOUT_DIALOG_BUILD_TIME;
public static String ABOUT_DIALOG_TIZEN_SITE;
- public static String ABOUT_DIALOG_TIZEN_SITE_LINK;
public static String ABOUT_DIALOG_RELEASE_NOTE;
- public static String ABOUT_DIALOG_RELEASE_NOTE_LINK;
- public static String ABOUT_DIALOG_TIZEN_DEVELOP_SITE_LINK;
- public static String ABOUT_DIALOG_DEVELOPER_TIZEN_ADDR;
- public static String ABOUT_DIALOG_TIZEN_COMMUNITY_ADDR;
- public static String ABOUT_DIALOG_TIZEN_PERF_DESK_ADDR;
-
- 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_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 SAVE_FAILED;
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;
// dialog text
public static String DLG_PREPARE_TRACE;
public static String DLG_PLEASE_WAIT;
- public static String DLG_SUMMARIZING_DATA;
- public static String DLG_DEVICE_DISCONNECTED;
public static String DLG_COPYING_BINARY;
public static String TABLE_COLUMN_LIBNAME;
- public static String TABLE_COLUMN_PARAMETERS;
- public static String TABLE_COLUMN_RETURN;
public static String HEAP_MEMORY_WARNING_PRE;
public static String HEAP_MEMORY_WARNING_POST;
- public static String TIME_MS;
-
- public static String DETAIL_INFORMATION_PACKAGE_NAME;
- public static String DETAIL_INFORMATION_PACKAGE_VERSION;
- public static String DETAIL_INFORMATION_PACKAGE_INSTALL_TIME;
- public static String DETAIL_INFORMATION_APPLICATION_NAME;
- public static String DETAIL_INFORMATION_APPLICATION_EXEC_PATH;
-
// advanced menu text
public static String ADVANCED_MENU_SEARCH;
public static String ADVANCED_MENU_FILTER;
- // Search dialog
- public static String SEARCH_DROPDOWN_TITLE;
- public static String SEARCH_DROPDOWN_PID;
+ // links
+ public static String TIZEN_SITE_LINK;
+ public static String RELEASE_NOTE_LINK;
+ public static String TIZEN_DEVELOP_SITE_LINK;
+ public static String HOWTO_LINK;
+ public static String BUGREPORT_LINK;
static {
NLS.initializeMessages(BUNDLE_NAME, AnalyzerLabels.class);
SAVE_TRACE_TITLE=Save trace
OPEN_TRACE=Open trace
OPEN_TRACE_TITLE=Open trace
-REPLAY=Replay
-REPLAY_EDIT=Replay Edit
START_TRACE_MAC=Start trace
STOP_TRACE_MAC=Stop trace
SAVE_TRACE_MAC=Save trace
OPEN_TRACE_MAC=Open trace
-REPLAY_MAC=Replay
-REPLAY_EDIT_MAC=Replay Edit
-
-RANGE_PAGE=Range page
-SNAPSHOT_ENABLE=Take snapshot
#String for dialog by toolbar combobox
SELECT_PROCESS=Select Process
REMOTE_DEVICE=Connect Device
IP=IP address
PORT=Port number
-CONNECT=Connect
CONNECTING=Connecting
#Setting menu
SETTING_MAC=Preferences
VIEW_SOURCE_MAC=View source
-#ABOUT_MAC=About Dynamic Analyzer;
-ABOUT_TITLE=About Dynamic Analyzer
LICENSE=License
-CONFIGURATION=Configuration
-WELCOME=Welcome
SETTING_TITLE=Select feature to analyze
# SingletonInfoDlg.
-REPLAYEDIT=Replay Editor
#Source tooltip
-SOURCE_NOT_EXIST=Source file does not exist.
IDE_NOT_LAUNCHED=Tizen IDE is not launched.
-#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.
COOLBAR_AREA_MEMORY_TOOLTIP_MAC=Memory
COOLBAR_AREA_CONFIGURATION_FEATURES=Features
-COOLBAR_AREA_CONFIGURATION_SETTING=Configuration
COOLBAR_AREA_CONFIGURATION_OPTION=Options
LICENSE_DIALOG_NOT_FOUND=License file not found
ABOUT_DIALOG_TITLE=About Dynamic Analyzer
ABOUT_DIALOG_TIZEN=TIZEN STUDIO
ABOUT_DIALOG_DA=Dynamic Analyzer
-ABOUT_DIALOG_SDK_VERSION=SDK Version
ABOUT_DIALOG_DA_VERSION=DA Version
ABOUT_DIALOG_BUILD_TIME=Build Time
ABOUT_DIALOG_TIZEN_SITE=Tizen Site
-ABOUT_DIALOG_TIZEN_SITE_LINK=http://www.tizen.org
-ABOUT_DIALOG_TIZEN_DEVELOP_SITE_LINK=http://developer.tizen.org
ABOUT_DIALOG_RELEASE_NOTE=Release Note
-ABOUT_DIALOG_RELEASE_NOTE_LINK=https://developer.tizen.org/development/tools/download/release-notes
-ABOUT_DIALOG_DEVELOPER_TIZEN_ADDR=http://developer.tizen.org/forums/sdk-ide
-ABOUT_DIALOG_TIZEN_COMMUNITY_ADDR=http://mosaic.sec.samsung.net/club/club.main.index.screen?p_club_id=30689
-ABOUT_DIALOG_TIZEN_PERF_DESK_ADDR=http://mosaic.sec.samsung.net/club/swc_perfdesk.club
-
-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_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
SAVE_TRACE_DLG_SAVE_FILE_NAME=Enter save file name
SAVE_FAILED=Failed to save the tracing result
-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.
-INVALID_APPLICATION=Invalid Application
DLG_PREPARE_TRACE=Preparing to trace
DLG_PLEASE_WAIT=Please wait
-DLG_SUMMARIZING_DATA=Summarizing collected data
-DLG_DEVICE_DISCONNECTED=Device disconnected
DLG_COPYING_BINARY=Copying binary
TABLE_COLUMN_LIBNAME=Library
-TABLE_COLUMN_PARAMETERS=Parameters
-TABLE_COLUMN_RETURN=Return
HEAP_MEMORY_WARNING_PRE=If you want to use more memory, increase the -Xmx value in the
HEAP_MEMORY_WARNING_POST=/dynamic-analyzer.ini file.
-TIME_MS=ms
-
-DETAIL_INFORMATION_PACKAGE_NAME=Package Name :
-DETAIL_INFORMATION_PACKAGE_VERSION=Package Version :
-DETAIL_INFORMATION_PACKAGE_INSTALL_TIME=Package Installed Time :
-DETAIL_INFORMATION_APPLICATION_NAME=Application Name :
-DETAIL_INFORMATION_APPLICATION_EXEC_PATH=Application Exec Path :
-
ADVANCED_MENU_SEARCH=Search
ADVANCED_MENU_FILTER=Filter
-SEARCH_DROPDOWN_TITLE=All
-SEARCH_DROPDOWN_PID=Pid
+TIZEN_SITE_LINK=http://www.tizen.org
+TIZEN_DEVELOP_SITE_LINK=http://developer.tizen.org
+RELEASE_NOTE_LINK=https://developer.tizen.org/development/tizen-studio/download/release-notes
+HOWTO_LINK=https://developer.tizen.org/development/tizen-studio/native-tools/debugging-your-app/dynamic-analyzer
+BUGREPORT_LINK=https://developer.tizen.org/forums/sdk-ide/active
\ No newline at end of file
public static String SETTING_DIALOG_OVERHEAD;
public static String SETTING_DIALOG_OVERHEAD_DESCRIPTION;
- public static String SETTING_DIALOG_RECORDING_REPLAY;
public static String SETTING_DIALOG_SCREENSHOT;
public static String FEATURE_DIALOG_HEADER_TITLE;
public static String SETTING_OPTION_TAB_DESCRIPTION;
public static String SETTING_OPTION_SHOW_INITIAL;
- public static String SETTING_OPTION_AUTO_STOP;
public static String FEATURE_OVERHEAD_RANKING_NORMAL;
public static String FEATURE_OVERHEAD_RANKING_MIDDLE;
SETTING_DIALOG_OVERHEAD=Overhead :
SETTING_DIALOG_OVERHEAD_DESCRIPTION=An estimation of the runtime overhead
FEATURE_DIALOG_FEATURE_TABLE_COLUMN_NAME=Features
-SETTING_DIALOG_RECORDING_REPLAY=Recording and replay
SETTING_DIALOG_SCREENSHOT=Screenshot
TARGET_NAME_MOBILE=Mobile
FEATURE_DETAIL_VALUE_WARNING_FOR_OUT_OF_RANGE=value should be in range from minValue to maxValue
FEATURE_DETAIL_VALUE_WARNING_FOR_HAVE_TO_SET_MULTIPLE_OF_10MS_IN_SYSTEM_SAMPLING_RATE=you have to set multiple of 10ms
SETTING_OPTION_SHOW_INITIAL=Use this as the default and do not ask again.
-SETTING_OPTION_AUTO_STOP=Auto-stop while replaying
FEATURE_OVERHEAD_RANKING_NORMAL=Overhead level: Normal
FEATURE_OVERHEAD_RANKING_MIDDLE=Overhead level: Middle
public static String MEMORY_ALLOCATION_TRACE_VIEW_SIZE;
public static String MEMORY_ALLOCATION_TRACE_VIEW_LIBRARY;
public static String MEMORY_ALLOCATION_TRACE_VIEW_CALLED_FUNCTION;
+ public static String MEMORY_ALLOCATION_TRACE_VIEW_LEAK;
public static String MEMORY_CHART_HEAP_MEMORY;
public static String MEMORY_CHART_PROCESS_MEMORY;
public static String MEMORY_MEMORYMAP_SIZE;
public static String MEMORY_MEMORYMAP_TYPE;
+ public static String STREAMING_NOT_SUPPORTED;
+
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, MemoryPageLabels.class);
MEMORY_ALLOCATION_TRACE_VIEW_SIZE=Size\r
MEMORY_ALLOCATION_TRACE_VIEW_LIBRARY=Path\r
MEMORY_ALLOCATION_TRACE_VIEW_CALLED_FUNCTION=Called Function\r
+MEMORY_ALLOCATION_TRACE_VIEW_LEAK=Leak\r
\r
MEMORY_MEMORYMAP_LIBNAME=Name\r
MEMORY_MEMORYMAP_ADDRESS_LOW=Low-address\r
\r
MEMORY_CHART_HEAP_MEMORY=Heap Allocation\r
MEMORY_CHART_PROCESS_MEMORY=Process Memory\r
-MEMORY_CHART_SYSTEM_MEMORY=System Memory
\ No newline at end of file
+MEMORY_CHART_SYSTEM_MEMORY=System Memory\r
+\r
+STREAMING_NOT_SUPPORTED=Streaming is not supported. Please select range or stop tracing\r
public static String ANALYZE;
public static String ANALYZE_SEARCH;
public static String ANALYZE_TARGET;
- public static String ANALYZE_SCREENSHOT;
public static String ANALYZE_PREFENCES;
public static String ANALYZE_SET_AS_DEFAULT;
public static String HELP_BUGREPORT;
public static String HELP_ABOUT;
- public static String HELP_HOWTO_LINK;
- public static String HELP_BUGREPORT_LINK;
-
static {
NLS.initializeMessages(BUNDLE_NAME, MenuBarLabels.class);
}
ANALYZE=Analyze
ANALYZE_SEARCH=Search
ANALYZE_TARGET=Target
-ANALYZE_SCREENSHOT=Screenshot
ANALYZE_PREFENCES=Preferences
ANALYZE_SET_AS_DEFAULT=Set as default features
HELP_HOWTO=How to use Dynamic Analyzer
HELP_BUGREPORT=Bug Report
HELP_ABOUT=About
-
-HELP_HOWTO_LINK=https://developer.tizen.org/development/tizen-studio/native-tools/debugging-your-app/dynamic-analyzer
-HELP_BUGREPORT_LINK=https://developer.tizen.org/forums/sdk-ide/active
\ No newline at end of file
public static String FUNCION_SAMPLIING_RATE;
public static String RECORDING;
- public static String AUTOSTOP_WHILE_REPLAYING;
public static String SCREENSHOT;
public static String ON_SCENE_TRANSITION;
public static String SYSTEM_ALL_PROCESSES;
public static String PROCESS_MEMORY;
+ public static String HEAP_ALLOCATION;
+ public static String LEAK_SANITIZER;
+ public static String LEAK_SANITIZER_TOOLTIP;
+
static {
NLS.initializeMessages(BUNDLE_NAME, PreferencesDialogLabels.class);
}
#RECORING
RECORDING=Recording
-AUTOSTOP_WHILE_REPLAYING=Auto-stop while replaying
#SCREENSHOT
SCREENSHOT=Screenshot feature
WEB_FUNCTION_PROFILING=Web Call Trace
WEBAPP_STARTUP=Web Start up
SYSTEM_ALL_PROCESSES=Processes
-PROCESS_MEMORY=Process Memory
\ No newline at end of file
+PROCESS_MEMORY=Process Memory
+
+#HEAP ALLOCATION
+HEAP_ALLOCATION=Heap Allocation feature
+LEAK_SANITIZER=Leak Sanitizer
+LEAK_SANITIZER_TOOLTIP=Works only with Tizen 3.0 and does not work with Thread Analysis feature
+++ /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.nl;
-
-import org.eclipse.osgi.util.NLS;
-
-public class ReplayEditLabels extends NLS {
- private static final String BUNDLE_NAME = "org.tizen.dynamicanalyzer.nl.ReplayEditLabels"; //$NON-NLS-1$
-
- public static String REPLAY_EDIT_TITLE;
- public static String TABLE_PAGE_TITLE;
- public static String TABLE_TITLE;
- public static String TABLE_COLUMN_SEQ;
- public static String TABLE_COLUMN_MOUSE_DOWN_TIME;
- public static String TABLE_COLUMN_MOUSE_UP_TIME;
- public static String TABLE_COLUMN_TYPE;
- public static String TABLE_COLUMN_VALUE1;
- public static String TABLE_COLUMN_VALUE2;
- public static String TABLE_FEATURE_EMPTY;
- public static String TABLE_FEATURE_NAME;
- public static String DETAIL_TITLE;
-
- public static String CONTEXT_CUT;
- public static String CONTEXT_COPY;
- public static String CONTEXT_INSERT;
- public static String CONTEXT_PASTE;
- public static String CONTEXT_DELETE;
-
- public static String CONTEXT_TOUCH;
- public static String CONTEXT_KEY;
- public static String CONTEXT_DRAG;
-
- public static String CONTEXT_KEY_MENU;
- public static String CONTEXT_KEY_HOME;
- public static String CONTEXT_KEY_BACK;
- public static String CONTEXT_KEY_POWER;
- public static String CONTEXT_KEY_VOLUME_UP;
- public static String CONTEXT_KEY_VOLUME_DOWN;
-
- public static String CONTEXT_VALUE_X;
- public static String CONTEXT_VALUE_Y;
- public static String CONTEXT_VALUE_S;
-
- public static String SAVE;
- public static String OK;
- public static String CANCEL;
-
- public static String REPLAY_EDIT_SNAPSHOT_TABLE_TITLE;
-
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, ReplayEditLabels.class);
- }
-
- private ReplayEditLabels() {
- }
-}
+++ /dev/null
-REPLAY_EDIT_TITLE =Replay Edit
-TABLE_PAGE_TITLE=Table
-TABLE_TITLE=Table
-TABLE_FEATURE_EMPTY=
-TABLE_FEATURE_NAME=Name
-DETAIL_TITLE=Details
-TABLE_COLUMN_SEQ = Sequence
-TABLE_COLUMN_MOUSE_DOWN_TIME = MouseDownTime
-TABLE_COLUMN_MOUSE_UP_TIME = MouseUpTime
-TABLE_COLUMN_TYPE = Type
-TABLE_COLUMN_VALUE1 = Value1
-TABLE_COLUMN_VALUE2 = Value2
-
-CONTEXT_CUT =Cut
-CONTEXT_COPY= Copy
-CONTEXT_INSERT=Insert
-CONTEXT_PASTE=Paste
-CONTEXT_DELETE=Delete
-
-CONTEXT_TOUCH=TOUCH
-CONTEXT_KEY=KEY
-CONTEXT_DRAG=DRAG
-
-CONTEXT_KEY_MENU=MENU
-CONTEXT_KEY_HOME=HOME
-CONTEXT_KEY_BACK=BACK
-CONTEXT_KEY_POWER=POWER
-CONTEXT_KEY_VOLUME_UP=VOLUME +
-CONTEXT_KEY_VOLUME_DOWN=VOLUME -
-
-CONTEXT_VALUE_X =x :
-CONTEXT_VALUE_Y =y :
-CONTEXT_VALUE_S=s
-
-SAVE = Save
-OK =Ok
-CANCEL=Cancel
-
-REPLAY_EDIT_SNAPSHOT_TABLE_TITLE=Snapshot
\ No newline at end of file
UI_EVENT_LIST_DETAIL=Detail
APPSTARTUP_NOT_SUPPORTED_LABEL_UIHV=Startup info cannot be collected when UI Hierarchy Analysis is selected.
-APPSTARTUP_NOT_SUPPORTED_LABEL_TARGET=Startup info cannot be collected on your target platform:
\ No newline at end of file
+APPSTARTUP_NOT_SUPPORTED_LABEL_TARGET=Startup info cannot be collected on your target platform
\ No newline at end of file
import org.tizen.dynamicanalyzer.project.data.FunctionNameDBTable;
import org.tizen.dynamicanalyzer.project.data.MemoryMapDBTable;
import org.tizen.dynamicanalyzer.project.data.ProcessInfoDBTable;
+import org.tizen.dynamicanalyzer.setting.FlatPreferences;
import org.tizen.dynamicanalyzer.setting.SettingConstants;
+import org.tizen.dynamicanalyzer.setting.SettingDataManager;
import org.tizen.dynamicanalyzer.setting.UILayoutDataManager;
import org.tizen.dynamicanalyzer.ui.file.data.FileApiDB;
import org.tizen.dynamicanalyzer.ui.info.screenshot.ScreenShotDBTable;
private static final String PROFILE_START_TIME = "profilingStartTime";
private static final String PAGE_TAB_LIST = "pageTabList";
private static final String TIMELINE_CHART_LIST = "timelineChartList";
+ private static final String LSAN_PREFERENCE = "lsanPreference";
private static final String MEMPS_DATA_AVAILABLE = "availableMemps";
private static final String DA_START_TIME = "daStartTime";
writer.write(CommonConstants.NEW_LINE);
writer.write(DA_START_TIME + CommonConstants.EQUAL + getDAStartTime());
writer.write(CommonConstants.NEW_LINE);
- writer.write(MEMPS_DATA_AVAILABLE + CommonConstants.EQUAL + (getMempsAvailable() ? "true" : "false"));
+ writer.write(MEMPS_DATA_AVAILABLE + CommonConstants.EQUAL + getMempsAvailable());
writer.write(CommonConstants.NEW_LINE);
writer.write(REPLAY_STOP_TIME + CommonConstants.EQUAL + getReplayStopTime());
writer.write(CommonConstants.NEW_LINE);
+ StringUtil.concatenate(UILayoutDataManager.INSTANCE.getSelectedChartSet(),
CommonConstants.COMMA));
writer.write(CommonConstants.NEW_LINE);
+ writer.write(LSAN_PREFERENCE + CommonConstants.EQUAL + SettingDataManager.INSTANCE
+ .isPreferenceSelected(FlatPreferences.LEAK_SANITIZER));
+ writer.write(CommonConstants.NEW_LINE);
writer.write(CommonConstants.NEW_LINE);
writer.flush();
} else if (infoKey.equals(TIMELINE_CHART_LIST)) {
timelineChartList = val.split(CommonConstants.COMMA);
} else if (infoKey.equals(MEMPS_DATA_AVAILABLE)) {
- if(val.equals("true")) {
- setMempsAvailable(true);
- }
- else {
- setMempsAvailable(false);
- }
+ setMempsAvailable(Boolean.parseBoolean(val));
} else if (infoKey.equals(DA_START_TIME)) {
setDAStartTime(val);
+ } else if (infoKey.equals(LSAN_PREFERENCE)) {
+ SettingDataManager.INSTANCE.setPreferenceSelected(
+ FlatPreferences.LEAK_SANITIZER, Boolean.parseBoolean(val));
}
}
} else {
}
String apiName = Global.getFunctionName(log.getApiId());
- if (apiName.equals("main")) { //$NON-NLS-1$
+ if ((null != apiName) && (apiName.equals("main"))) { //$NON-NLS-1$
ProcessInformation process = Global.getProject()
.getProcessInformation(log.getPid());
process.setDropLog(true);
*/
package org.tizen.dynamicanalyzer.protocol;
-import org.tizen.dynamicanalyzer.setting.Feature;
-
public interface IProtocolConfig {
public int getShift();
- public int getOverhead();
-
- public int getCallcount();
-
- public Feature getFeatureForFrequency();
-
}
import org.tizen.dynamicanalyzer.protocol.p30_uihv.ProtocolConfig30_UIHV;
import org.tizen.dynamicanalyzer.protocol.p40.ProtocolConfig40;
import org.tizen.dynamicanalyzer.protocol.p41.ProtocolConfig41;
-import org.tizen.dynamicanalyzer.setting.Feature;
+import org.tizen.dynamicanalyzer.setting.FlatFeature;
public enum Protocol {
VERSION_UNKNOWN(CommonConstants.EMPTY, 0.0),
tempMap.put(0x001A, "MSG_WEB_APP_STARTUP");
tempMap.put(0x0020, "MSG_FBI");
tempMap.put(0x0021, "MSG_UI_HIERARCHY");
+ tempMap.put(0x0022, "MSG_LSAN");
// data probe message id
tempMap.put(0x0101, "MSG_PROBE_MEMORY");
return Protocol.VERSION_UNKNOWN; // not found
}
- public static IProtocolConfig[] getProtocolConfig(Protocol protocolVersion, Feature feature)
+ public static IProtocolConfig[] getProtocolConfig(Protocol protocolVersion, FlatFeature feature)
throws UnknownProtocolException {
IProtocolConfig[] configs = null;
public final static int MSG_WEB_APP_STARTUP = 0x001A;
public final static int MSG_FUNCTION_BODY = 0x0020;
public final static int MSG_UI_HIERARCHY = 0x0021;
+ public static final int MSG_LSAN = 0x0022;
// data probe message id
public static final int MSG_PROBE_MIN = 0x0101;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.control.ApplistManager;
import org.tizen.dynamicanalyzer.control.IProgress;
-import org.tizen.dynamicanalyzer.handlers.ReplayManager;
import org.tizen.dynamicanalyzer.model.AddrSymbolPair;
import org.tizen.dynamicanalyzer.model.DATime;
import org.tizen.dynamicanalyzer.nl.UserErrorWarningLabels;
import org.tizen.dynamicanalyzer.setting.FlatPreferences;
import org.tizen.dynamicanalyzer.setting.SettingDataManager;
import org.tizen.dynamicanalyzer.swap.communicator.SwapErrorCode;
-import org.tizen.dynamicanalyzer.swap.model.data.RecordEventObject;
-import org.tizen.dynamicanalyzer.swap.model.data.ReplayData;
import org.tizen.dynamicanalyzer.util.ByteUtil;
import org.tizen.dynamicanalyzer.util.CommonUtil;
import org.tizen.dynamicanalyzer.util.Logger;
Logger.debug(selectedFeatures);
// set sampling period value
- int systemPeriod = SettingDataManager.INSTANCE.getOptionsPreferencesValue(FlatPreferences.SYSTEM_SAMPLING_RATE);
+ int systemPeriod = SettingDataManager.INSTANCE.getPreferenceValue(FlatPreferences.SYSTEM_SAMPLING_RATE);
int samplingPeriod = SettingDataManager.INSTANCE
- .getOptionsPreferencesValue(FlatPreferences.FUNCTION_SAMPLING_RATE);
+ .getPreferenceValue(FlatPreferences.FUNCTION_SAMPLING_RATE);
ps.putInt(systemPeriod);
ps.putInt(samplingPeriod);
return new DAResult(ErrorCode.ERR_MSG_START_FAIL);
}
- // serialize the replay data
- serializeReplayEvent(ps);
+ // Add value illustrating that replay is disabled.
+ // It is required to hold message format.
+ ps.putInt(ProtocolConstant30.REPLAY_OFF);
byte[] msg = ps.toByteArray();
return functionInstList;
}
- protected boolean serializeReplayEvent(ProtocolSerializer ps) {
- // make replay event
- // on/off, replay start time, count, event objects
- if (ReplayManager.isReplayMode()) {
- ps.putInt(ProtocolConstant30.REPLAY_ON);
-
- DATime replayStartTime = ReplayManager.getStartTime();
- ps.putInt(replayStartTime.getSec());
- ps.putInt(replayStartTime.getNano());
-
- ReplayData replayData = ReplayManager.getReplayData();
- if (null != replayData) {
- List<RecordEventObject> recordEventList = replayData.getRecordEvent();
- int eventCount = recordEventList.size();
- ps.putInt(eventCount);
- for (int i = 0; i < eventCount; i++) {
- RecordEventObject event = recordEventList.get(i);
- ps.putInt(event.getEventTime().getSec());
- ps.putInt(event.getEventTime().getNano());
- ps.putInt(event.getEventId());
- ps.putInt(event.getEventType());
- ps.putInt(event.getEventCode());
- ps.putInt(event.getEventValue());
- }
- } else {
- ps.putInt(0); // count of replay event
- Logger.debug("Count of replay event is 0");
- }
- } else {
- ps.putInt(ProtocolConstant30.REPLAY_OFF);
- }
-
- return true;
- }
-
@Override
public DAResult sendTraceStopMessage(IProgress progress) {
ProtocolSerializer ps = new ProtocolSerializer();
import java.util.Set;
import org.tizen.dynamicanalyzer.protocol.IProtocolConfig;
-import org.tizen.dynamicanalyzer.setting.Feature;
import org.tizen.dynamicanalyzer.setting.FlatFeature;
import org.tizen.dynamicanalyzer.setting.FlatPreferences;
import org.tizen.dynamicanalyzer.util.ByteUtil;
import org.tizen.dynamicanalyzer.util.Logger;
public enum ProtocolConfig30 implements IProtocolConfig {
- RESERVED1(0, 0, 0, null),
- RESERVED2(1, 0, 0, null),
- FUNCTION_PROFILING(2, 36, 5000, null),
- MEMORY_ALLOC_PROBE(3, 40, 623, null),
- FILE_API_PROBE(4, 26, 918, null),
- THREAD_API_PROBE(5, 0, 106, null),
- OSPUI_API_PROBE(6, 0, 0, null),
- SCREENSHOT(7, 62, 10, null),
- USER_EVENT(8, 0, 45, null),
- RECORDING(9, 996, 17, null),
- SYSCALL_FILE(10, 14, 0, null),
- SYSCALL_IPC(11, 14, 0, null),
- SYSCALL_PROCESS(12, 14, 0, null),
- SYSCALL_SIGNAL(13, 14, 0, null),
- SYSCALL_NETWORK(14, 14, 0, null),
- SYSCALL_DESC(15, 14, 0, null),
- CONTEXT_SWITCH(16, 14, 0, null),
- NETWORK_API_PROBE(17, 38, 10021, null),
- OPENGL_API_PROBE(18, 16, 50000, null),
- FUNCTION_SAMPLING(19, 68, 0, Feature.FUNCTION_SAMPLING_RATE),
-
- INTERNAL_MEMORY_ALLOC(28, 40, 0, null),
- INTERNAL_FILE_API(29, 26, 0, null),
- INTERNAL_THREAD_API(30, 0, 0, null),
- INTERNAL_OSPUI_API(31, 0, 0, null),
- INTERNAL_NETWORK_API(32, 38, 0, null),
- INTERNAL_OPENGL_API(33, 16, 0, null),
-
- SYSTEM_CPU(36, 2438, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_MEMORY(37, 2282, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_PROCESS(38, 2568, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_THREAD_LOAD(39, 2344, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_PROCESSES_LOAD(40, 2504, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_DISK(41, 1222, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_NETWORK(42, 162, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_DEVICE(43, 756, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_ENERGY(44, 452, 0, Feature.SYSTEM_SAMPLING_RATE);
-
- private static final Map<Feature, IProtocolConfig[]> featureProtocolMap;
-
- static {
- Map<Feature, IProtocolConfig[]> tempMap = new EnumMap<Feature, IProtocolConfig[]>(
- Feature.class);
- tempMap.put(Feature.SYSTEM_CPU, new ProtocolConfig30[] { SYSTEM_CPU });
- tempMap.put(Feature.SYSTEM_PROCESS, new ProtocolConfig30[] { SYSTEM_PROCESS });
- tempMap.put(Feature.SYSTEM_MEMORY, new ProtocolConfig30[] { SYSTEM_MEMORY });
- tempMap.put(Feature.SYSTEM_ALL_PROCESSES, new ProtocolConfig30[] { SYSTEM_PROCESSES_LOAD });
- tempMap.put(Feature.SYSTEM_DISK, new ProtocolConfig30[] { SYSTEM_DISK });
- tempMap.put(Feature.SYSTEM_NETWORK, new ProtocolConfig30[] { SYSTEM_NETWORK });
- tempMap.put(Feature.SYSTEM_DEVICE, new ProtocolConfig30[] { SYSTEM_DEVICE });
- tempMap.put(Feature.SYSTEM_ENERGY, new ProtocolConfig30[] { SYSTEM_ENERGY });
- tempMap.put(Feature.FUNCTION_PROFILING, new ProtocolConfig30[] { FUNCTION_PROFILING });
- tempMap.put(Feature.FUNCTION_SAMPLING, new ProtocolConfig30[] { FUNCTION_SAMPLING });
- tempMap.put(Feature.MEMORY_ALLOCATION, new ProtocolConfig30[] { MEMORY_ALLOC_PROBE });
- tempMap.put(Feature.FILE_ANALYSIS, new ProtocolConfig30[] { FILE_API_PROBE, SYSCALL_FILE });
- tempMap.put(Feature.THREAD_ANALYSIS, new ProtocolConfig30[] { THREAD_API_PROBE,
- SYSTEM_THREAD_LOAD });
- tempMap.put(Feature.NETWORK_ANALYSIS, new ProtocolConfig30[] { NETWORK_API_PROBE });
- tempMap.put(Feature.OPENGL_ANALYSIS, new ProtocolConfig30[] { OPENGL_API_PROBE });
- tempMap.put(Feature.UI_EVENT_ANALYSIS, new ProtocolConfig30[] { USER_EVENT });
- tempMap.put(Feature.CONTEXT_SWITCH_ANALYSIS, new ProtocolConfig30[] { CONTEXT_SWITCH });
- tempMap.put(Feature.INTERNAL_PROBE_MEMORY, new ProtocolConfig30[] { INTERNAL_MEMORY_ALLOC });
- tempMap.put(Feature.INTERNAL_PROBE_FILE, new ProtocolConfig30[] { INTERNAL_FILE_API });
- tempMap.put(Feature.INTERNAL_PROBE_THREAD, new ProtocolConfig30[] { INTERNAL_THREAD_API });
- tempMap.put(Feature.INTERNAL_PROBE_NETWORK, new ProtocolConfig30[] { INTERNAL_NETWORK_API });
- tempMap.put(Feature.INTERNAL_PROBE_OPENGL, new ProtocolConfig30[] { INTERNAL_OPENGL_API });
- tempMap.put(Feature.SYSCALL_FILE, new ProtocolConfig30[] { SYSCALL_FILE });
- tempMap.put(Feature.SYSCALL_IPC, new ProtocolConfig30[] { SYSCALL_IPC });
- tempMap.put(Feature.SYSCALL_PROCESS, new ProtocolConfig30[] { SYSCALL_PROCESS });
- tempMap.put(Feature.SYSCALL_SIGNAL, new ProtocolConfig30[] { SYSCALL_SIGNAL });
- tempMap.put(Feature.SYSCALL_NETWORK, new ProtocolConfig30[] { SYSCALL_NETWORK });
- tempMap.put(Feature.SYSCALL_DESC, new ProtocolConfig30[] { SYSCALL_DESC });
- tempMap.put(Feature.SCREENSHOT_ON_SCENE_TRANSITION, new ProtocolConfig30[] { SCREENSHOT });
- tempMap.put(Feature.RECORDING, new ProtocolConfig30[] { RECORDING });
- featureProtocolMap = Collections.unmodifiableMap(tempMap);
- }
+ RESERVED1(0),
+ RESERVED2(1),
+ FUNCTION_PROFILING(2),
+ MEMORY_ALLOC_PROBE(3),
+ FILE_API_PROBE(4),
+ THREAD_API_PROBE(5),
+ OSPUI_API_PROBE(6),
+ SCREENSHOT(7),
+ USER_EVENT(8),
+ RECORDING(9),
+ SYSCALL_FILE(10),
+ SYSCALL_IPC(11),
+ SYSCALL_PROCESS(12),
+ SYSCALL_SIGNAL(13),
+ SYSCALL_NETWORK(14),
+ SYSCALL_DESC(15 ),
+ CONTEXT_SWITCH(16),
+ NETWORK_API_PROBE(17),
+ OPENGL_API_PROBE(18),
+ FUNCTION_SAMPLING(19),
+
+ INTERNAL_MEMORY_ALLOC(28),
+ INTERNAL_FILE_API(29),
+ INTERNAL_THREAD_API(30),
+ INTERNAL_OSPUI_API(31),
+ INTERNAL_NETWORK_API(32),
+ INTERNAL_OPENGL_API(33),
+
+ SYSTEM_CPU(36),
+ SYSTEM_MEMORY(37),
+ SYSTEM_PROCESS(38),
+ SYSTEM_THREAD_LOAD(39),
+ SYSTEM_PROCESSES_LOAD(40),
+ SYSTEM_DISK(41),
+ SYSTEM_NETWORK(42),
+ SYSTEM_DEVICE(43),
+ SYSTEM_ENERGY(44);
private static final Map<FlatFeature, IProtocolConfig[]> flatFeatureProtocolMap;
tempMap.put(FlatFeature.NETWORK_IO, new ProtocolConfig30[] { SYSTEM_NETWORK });
tempMap.put(FlatFeature.NETWORK_ANALYSIS, new ProtocolConfig30[] { NETWORK_API_PROBE });
tempMap.put(FlatFeature.UI_EVENT, new ProtocolConfig30[] { USER_EVENT });
- //tempMap.put(FlatFeature.UI_HIERARCHY_ANALYSIS, new ProtocolConfig30[] { UIHV });
tempMap.put(FlatFeature.THREAD_ANALYSIS, new ProtocolConfig30[] { THREAD_API_PROBE, SYSTEM_THREAD_LOAD });
tempMap.put(FlatFeature.PERIPHERAL_STATUS, new ProtocolConfig30[] { SYSTEM_DEVICE });
tempMap.put(FlatFeature.POWER_ESTIMATION, new ProtocolConfig30[] { SYSTEM_ENERGY });
}
private int bitShift;
- private int overheadValue;
- private int callCount;
- private Feature featureForFrequency;
- private ProtocolConfig30(int bitshift, int overhead, int callcount, Feature frequency) {
+ private ProtocolConfig30(int bitshift) {
this.bitShift = bitshift;
- this.overheadValue = overhead;
- this.callCount = callcount;
- this.featureForFrequency = frequency;
}
public int getShift() {
return bitShift;
}
- public int getOverhead() {
- return overheadValue;
- }
-
- public int getCallcount() {
- return callCount;
- }
-
- public Feature getFeatureForFrequency() {
- return featureForFrequency;
- }
-
- public static byte[] getFeatureFlagValue(Set<Feature> features) {
- long lowValue = 0;
- long highValue = 0;
- if (features != null) {
- for (Feature feature : features) {
- IProtocolConfig[] configs = featureProtocolMap.get(feature);
- if (configs != null) {
- for (int i = 0; i < configs.length; i++) {
- int bitshift = configs[i].getShift();
- if (bitshift >= 64) { // high 8byte bit
- highValue |= (0x1L << (bitshift - 64));
- } else { // low 8byte bit
- lowValue |= (0x1L << bitshift);
- }
- }
- }
- }
- }
-
- byte[] lowbyte = ByteUtil.toBytes(lowValue);
- byte[] highbyte = ByteUtil.toBytes(highValue);
- byte[] ret = new byte[16];
-
- System.arraycopy(lowbyte, 0, ret, 0, 8);
- System.arraycopy(highbyte, 0, ret, 8, 8);
-
- return ret;
- }
-
public static byte[] getFlatFeatureFlagValue(Set<FlatFeature> flatFeatures, Set<FlatPreferences> selectedPreferences) {
long lowValue = 0;
long highValue = 0;
return ret;
}
-
- public static IProtocolConfig[] getProtocolConfig(Feature feature) {
- return featureProtocolMap.get(feature);
- }
public static IProtocolConfig[] getProtocolConfig(FlatFeature feature) {
return flatFeatureProtocolMap.get(feature);
/**************************************************************
* flags
**************************************************************/
-
// replay on / off
+ @Deprecated
public static final int REPLAY_OFF = 0;
+ @Deprecated
public static final int REPLAY_ON = 1;
// binary type
Logger.debug(selectedFeatures);
// set sampling period value
- int systemPeriod = SettingDataManager.INSTANCE.getOptionsPreferencesValue(FlatPreferences.SYSTEM_SAMPLING_RATE);
+ int systemPeriod = SettingDataManager.INSTANCE.getPreferenceValue(FlatPreferences.SYSTEM_SAMPLING_RATE);
int samplingPeriod = SettingDataManager.INSTANCE
- .getOptionsPreferencesValue(FlatPreferences.FUNCTION_SAMPLING_RATE);
+ .getPreferenceValue(FlatPreferences.FUNCTION_SAMPLING_RATE);
ps.putInt(systemPeriod);
ps.putInt(samplingPeriod);
import java.util.Set;
import org.tizen.dynamicanalyzer.protocol.IProtocolConfig;
-import org.tizen.dynamicanalyzer.protocol.p30.ProtocolConfig30;
-import org.tizen.dynamicanalyzer.setting.Feature;
import org.tizen.dynamicanalyzer.setting.FlatFeature;
import org.tizen.dynamicanalyzer.setting.FlatPreferences;
import org.tizen.dynamicanalyzer.util.ByteUtil;
import org.tizen.dynamicanalyzer.util.Logger;
public enum ProtocolConfig30_UIHV implements IProtocolConfig {
- RESERVED1(0, 0, 0, null),
- RESERVED2(1, 0, 0, null),
- FUNCTION_PROFILING(2, 36, 5000, null),
- MEMORY_ALLOC_PROBE(3, 40, 623, null),
- FILE_API_PROBE(4, 26, 918, null),
- THREAD_API_PROBE(5, 0, 106, null),
- OSPUI_API_PROBE(6, 0, 0, null),
- SCREENSHOT(7, 62, 10, null),
- USER_EVENT(8, 0, 45, null),
- RECORDING(9, 996, 17, null),
- SYSCALL_FILE(10, 14, 0, null),
- SYSCALL_IPC(11, 14, 0, null),
- SYSCALL_PROCESS(12, 14, 0, null),
- SYSCALL_SIGNAL(13, 14, 0, null),
- SYSCALL_NETWORK(14, 14, 0, null),
- SYSCALL_DESC(15, 14, 0, null),
- CONTEXT_SWITCH(16, 14, 0, null),
- NETWORK_API_PROBE(17, 38, 10021, null),
- OPENGL_API_PROBE(18, 16, 50000, null),
- FUNCTION_SAMPLING(19, 68, 0, Feature.FUNCTION_SAMPLING_RATE),
-
- INTERNAL_MEMORY_ALLOC(28, 40, 0, null),
- INTERNAL_FILE_API(29, 26, 0, null),
- INTERNAL_THREAD_API(30, 0, 0, null),
- INTERNAL_OSPUI_API(31, 0, 0, null),
- INTERNAL_NETWORK_API(32, 38, 0, null),
- INTERNAL_OPENGL_API(33, 16, 0, null),
-
- SYSTEM_CPU(36, 2438, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_MEMORY(37, 2282, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_PROCESS(38, 2568, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_THREAD_LOAD(39, 2344, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_PROCESSES_LOAD(40, 2504, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_DISK(41, 1222, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_NETWORK(42, 162, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_DEVICE(43, 756, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_ENERGY(44, 452, 0, Feature.SYSTEM_SAMPLING_RATE),
+ RESERVED1(0),
+ RESERVED2(1),
+ FUNCTION_PROFILING(2),
+ MEMORY_ALLOC_PROBE(3),
+ FILE_API_PROBE(4),
+ THREAD_API_PROBE(5),
+ OSPUI_API_PROBE(6),
+ SCREENSHOT(7),
+ USER_EVENT(8),
+ RECORDING(9),
+ SYSCALL_FILE(10),
+ SYSCALL_IPC(11),
+ SYSCALL_PROCESS(12),
+ SYSCALL_SIGNAL(13),
+ SYSCALL_NETWORK(14),
+ SYSCALL_DESC(15),
+ CONTEXT_SWITCH(16),
+ NETWORK_API_PROBE(17),
+ OPENGL_API_PROBE(18),
+ FUNCTION_SAMPLING(19),
+
+ INTERNAL_MEMORY_ALLOC(28),
+ INTERNAL_FILE_API(29),
+ INTERNAL_THREAD_API(30),
+ INTERNAL_OSPUI_API(31),
+ INTERNAL_NETWORK_API(32),
+ INTERNAL_OPENGL_API(33),
+
+ SYSTEM_CPU(36),
+ SYSTEM_MEMORY(37),
+ SYSTEM_PROCESS(38),
+ SYSTEM_THREAD_LOAD(39),
+ SYSTEM_PROCESSES_LOAD(40),
+ SYSTEM_DISK(41),
+ SYSTEM_NETWORK(42),
+ SYSTEM_DEVICE(43),
+ SYSTEM_ENERGY(44),
// added for UI Hierarchy analysis
- UI_HIERARCHY(49, 0, 45, null);
-
- private static final Map<Feature, IProtocolConfig[]> featureProtocolMap;
-
- static {
- Map<Feature, IProtocolConfig[]> tempMap = new EnumMap<Feature, IProtocolConfig[]>(
- Feature.class);
- tempMap.put(Feature.SYSTEM_CPU, new ProtocolConfig30_UIHV[] { SYSTEM_CPU });
- tempMap.put(Feature.SYSTEM_PROCESS, new ProtocolConfig30_UIHV[] { SYSTEM_PROCESS });
- tempMap.put(Feature.SYSTEM_MEMORY, new ProtocolConfig30_UIHV[] { SYSTEM_MEMORY });
- tempMap.put(Feature.SYSTEM_ALL_PROCESSES, new ProtocolConfig30_UIHV[] { SYSTEM_PROCESSES_LOAD });
- tempMap.put(Feature.SYSTEM_DISK, new ProtocolConfig30_UIHV[] { SYSTEM_DISK });
- tempMap.put(Feature.SYSTEM_NETWORK, new ProtocolConfig30_UIHV[] { SYSTEM_NETWORK });
- tempMap.put(Feature.SYSTEM_DEVICE, new ProtocolConfig30_UIHV[] { SYSTEM_DEVICE });
- tempMap.put(Feature.SYSTEM_ENERGY, new ProtocolConfig30_UIHV[] { SYSTEM_ENERGY });
- tempMap.put(Feature.FUNCTION_PROFILING, new ProtocolConfig30_UIHV[] { FUNCTION_PROFILING });
- tempMap.put(Feature.FUNCTION_SAMPLING, new ProtocolConfig30_UIHV[] { FUNCTION_SAMPLING });
- tempMap.put(Feature.MEMORY_ALLOCATION, new ProtocolConfig30_UIHV[] { MEMORY_ALLOC_PROBE });
- tempMap.put(Feature.FILE_ANALYSIS, new ProtocolConfig30_UIHV[] { FILE_API_PROBE, SYSCALL_FILE });
- tempMap.put(Feature.THREAD_ANALYSIS, new ProtocolConfig30_UIHV[] { THREAD_API_PROBE,
- SYSTEM_THREAD_LOAD });
- tempMap.put(Feature.NETWORK_ANALYSIS, new ProtocolConfig30_UIHV[] { NETWORK_API_PROBE });
- tempMap.put(Feature.OPENGL_ANALYSIS, new ProtocolConfig30_UIHV[] { OPENGL_API_PROBE });
- tempMap.put(Feature.UI_EVENT_ANALYSIS, new ProtocolConfig30_UIHV[] { USER_EVENT });
- tempMap.put(Feature.CONTEXT_SWITCH_ANALYSIS, new ProtocolConfig30_UIHV[] { CONTEXT_SWITCH });
- tempMap.put(Feature.INTERNAL_PROBE_MEMORY, new ProtocolConfig30_UIHV[] { INTERNAL_MEMORY_ALLOC });
- tempMap.put(Feature.INTERNAL_PROBE_FILE, new ProtocolConfig30_UIHV[] { INTERNAL_FILE_API });
- tempMap.put(Feature.INTERNAL_PROBE_THREAD, new ProtocolConfig30_UIHV[] { INTERNAL_THREAD_API });
- tempMap.put(Feature.INTERNAL_PROBE_NETWORK, new ProtocolConfig30_UIHV[] { INTERNAL_NETWORK_API });
- tempMap.put(Feature.INTERNAL_PROBE_OPENGL, new ProtocolConfig30_UIHV[] { INTERNAL_OPENGL_API });
- tempMap.put(Feature.SYSCALL_FILE, new ProtocolConfig30_UIHV[] { SYSCALL_FILE });
- tempMap.put(Feature.SYSCALL_IPC, new ProtocolConfig30_UIHV[] { SYSCALL_IPC });
- tempMap.put(Feature.SYSCALL_PROCESS, new ProtocolConfig30_UIHV[] { SYSCALL_PROCESS });
- tempMap.put(Feature.SYSCALL_SIGNAL, new ProtocolConfig30_UIHV[] { SYSCALL_SIGNAL });
- tempMap.put(Feature.SYSCALL_NETWORK, new ProtocolConfig30_UIHV[] { SYSCALL_NETWORK });
- tempMap.put(Feature.SYSCALL_DESC, new ProtocolConfig30_UIHV[] { SYSCALL_DESC });
- tempMap.put(Feature.SCREENSHOT_ON_SCENE_TRANSITION, new ProtocolConfig30_UIHV[] { SCREENSHOT });
- tempMap.put(Feature.RECORDING, new ProtocolConfig30_UIHV[] { RECORDING });
- tempMap.put(Feature.UI_HIERARCHY_ANALYSIS, new ProtocolConfig30_UIHV[] { UI_HIERARCHY });
- featureProtocolMap = Collections.unmodifiableMap(tempMap);
- }
+ UI_HIERARCHY(49);
private static final Map<FlatFeature, IProtocolConfig[]> flatFeatureProtocolMap;
}
private int bitShift;
- private int overheadValue;
- private int callCount;
- private Feature featureForFrequency;
- private ProtocolConfig30_UIHV(int bitshift, int overhead, int callcount, Feature frequency) {
+ private ProtocolConfig30_UIHV(int bitshift) {
this.bitShift = bitshift;
- this.overheadValue = overhead;
- this.callCount = callcount;
- this.featureForFrequency = frequency;
}
public int getShift() {
return bitShift;
}
- public int getOverhead() {
- return overheadValue;
- }
-
- public int getCallcount() {
- return callCount;
- }
-
- public Feature getFeatureForFrequency() {
- return featureForFrequency;
- }
-
- public static byte[] getFeatureFlagValue(Set<Feature> features) {
- long lowValue = 0;
- long highValue = 0;
- if (features != null) {
- for (Feature feature : features) {
- IProtocolConfig[] configs = featureProtocolMap.get(feature);
- if (configs != null) {
- for (int i = 0; i < configs.length; i++) {
- int bitshift = configs[i].getShift();
- if (bitshift >= 64) { // high 8byte bit
- highValue |= (0x1L << (bitshift - 64));
- } else { // low 8byte bit
- lowValue |= (0x1L << bitshift);
- }
- }
- }
- }
- }
-
- byte[] lowbyte = ByteUtil.toBytes(lowValue);
- byte[] highbyte = ByteUtil.toBytes(highValue);
- byte[] ret = new byte[16];
-
- System.arraycopy(lowbyte, 0, ret, 0, 8);
- System.arraycopy(highbyte, 0, ret, 8, 8);
-
- return ret;
- }
-
public static byte[] getFlatFeatureFlagValue(Set<FlatFeature> flatFeatures, Set<FlatPreferences> selectedPreferences) {
long lowValue = 0;
long highValue = 0;
return ret;
}
-
- public static IProtocolConfig[] getProtocolConfig(Feature feature) {
- return featureProtocolMap.get(feature);
- }
public static IProtocolConfig[] getProtocolConfig(FlatFeature feature) {
return flatFeatureProtocolMap.get(feature);
ps.putByteArray(featureFlag);
// set sampling period value
- int systemPeriod = SettingDataManager.INSTANCE.getOptionsPreferencesValue(FlatPreferences.SYSTEM_SAMPLING_RATE);
+ int systemPeriod = SettingDataManager.INSTANCE.getPreferenceValue(FlatPreferences.SYSTEM_SAMPLING_RATE);
int samplingPeriod = SettingDataManager.INSTANCE
- .getOptionsPreferencesValue(FlatPreferences.FUNCTION_SAMPLING_RATE);
+ .getPreferenceValue(FlatPreferences.FUNCTION_SAMPLING_RATE);
ps.putInt(systemPeriod);
ps.putInt(samplingPeriod);
import java.util.Set;
import org.tizen.dynamicanalyzer.protocol.IProtocolConfig;
-import org.tizen.dynamicanalyzer.setting.Feature;
import org.tizen.dynamicanalyzer.setting.FlatFeature;
import org.tizen.dynamicanalyzer.setting.FlatPreferences;
import org.tizen.dynamicanalyzer.util.ByteUtil;
import org.tizen.dynamicanalyzer.util.Logger;
public enum ProtocolConfig40 implements IProtocolConfig {
- RESERVED1(0, 0, 0, null),
- RESERVED2(1, 0, 0, null),
- FUNCTION_PROFILING(2, 36, 5000, null),
- MEMORY_ALLOC_PROBE(3, 1500, 623, null),
- FILE_API_PROBE(4, 26, 918, null),
- THREAD_API_PROBE(5, 0, 106, null),
- OSPUI_API_PROBE(6, 0, 0, null),
- SCREENSHOT(7, 62, 10, null),
- USER_EVENT(8, 0, 45, null),
- RECORDING(9, 996, 17, null),
- SYSCALL_FILE(10, 14, 0, null),
- SYSCALL_IPC(11, 14, 0, null),
- SYSCALL_PROCESS(12, 14, 0, null),
- SYSCALL_SIGNAL(13, 14, 0, null),
- SYSCALL_NETWORK(14, 14, 0, null),
- SYSCALL_DESC(15, 14, 0, null),
- CONTEXT_SWITCH(16, 14, 0, null),
- NETWORK_API_PROBE(17, 38, 10021, null),
- OPENGL_API_PROBE(18, 16, 50000, null),
- FUNCTION_SAMPLING(19, 68, 0, Feature.FUNCTION_SAMPLING_RATE),
-
- INTERNAL_MEMORY_ALLOC(28, 40, 0, null),
- INTERNAL_FILE_API(29, 26, 0, null),
- INTERNAL_THREAD_API(30, 0, 0, null),
- INTERNAL_OSPUI_API(31, 0, 0, null),
- INTERNAL_NETWORK_API(32, 38, 0, null),
- INTERNAL_OPENGL_API(33, 16, 0, null),
-
- SYSTEM_CPU(36, 2438, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_MEMORY(37, 2282, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_PROCESS(38, 2568, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_THREAD_LOAD(39, 2344, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_PROCESSES_LOAD(40, 2504, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_DISK(41, 1222, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_NETWORK(42, 162, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_DEVICE(43, 756, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_ENERGY(44, 452, 0, Feature.SYSTEM_SAMPLING_RATE),
+ RESERVED1(0),
+ RESERVED2(1),
+ FUNCTION_PROFILING(2),
+ MEMORY_ALLOC_PROBE(3),
+ FILE_API_PROBE(4),
+ THREAD_API_PROBE(5),
+ OSPUI_API_PROBE(6),
+ SCREENSHOT(7),
+ USER_EVENT(8),
+ RECORDING(9),
+ SYSCALL_FILE(10),
+ SYSCALL_IPC(11),
+ SYSCALL_PROCESS(12),
+ SYSCALL_SIGNAL(13),
+ SYSCALL_NETWORK(14),
+ SYSCALL_DESC(15),
+ CONTEXT_SWITCH(16),
+ NETWORK_API_PROBE(17),
+ OPENGL_API_PROBE(18),
+ FUNCTION_SAMPLING(19),
+
+ INTERNAL_MEMORY_ALLOC(28),
+ INTERNAL_FILE_API(29),
+ INTERNAL_THREAD_API(30),
+ INTERNAL_OSPUI_API(31),
+ INTERNAL_NETWORK_API(32),
+ INTERNAL_OPENGL_API(33),
+
+ SYSTEM_CPU(36),
+ SYSTEM_MEMORY(37),
+ SYSTEM_PROCESS(38),
+ SYSTEM_THREAD_LOAD(39),
+ SYSTEM_PROCESSES_LOAD(40),
+ SYSTEM_DISK(41),
+ SYSTEM_NETWORK(42),
+ SYSTEM_DEVICE(43),
+ SYSTEM_ENERGY(44),
// added for protocol 4.0
- APP_STARTUP(45, 0, 0, null),
- WEB_FUNCTION_PROFILING(46, 0, 0, null),
- WEBAPP_STARTUP(47, 0, 0, null),
- NONTARGET_FILE_ACTIVITY(48, 0, 0, null);
-
- private static final Map<Feature, ProtocolConfig40[]> featureProtocolMap;
-
- static {
- Map<Feature, ProtocolConfig40[]> tempMap = new EnumMap<Feature, ProtocolConfig40[]>(
- Feature.class);
- tempMap.put(Feature.SYSTEM_CPU, new ProtocolConfig40[] { SYSTEM_CPU });
- tempMap.put(Feature.SYSTEM_PROCESS, new ProtocolConfig40[] { SYSTEM_PROCESS });
- tempMap.put(Feature.SYSTEM_MEMORY, new ProtocolConfig40[] { SYSTEM_MEMORY });
- tempMap.put(Feature.SYSTEM_ALL_PROCESSES, new ProtocolConfig40[] { SYSTEM_PROCESSES_LOAD });
- tempMap.put(Feature.SYSTEM_DISK, new ProtocolConfig40[] { SYSTEM_DISK });
- tempMap.put(Feature.SYSTEM_NETWORK, new ProtocolConfig40[] { SYSTEM_NETWORK });
- tempMap.put(Feature.SYSTEM_DEVICE, new ProtocolConfig40[] { SYSTEM_DEVICE });
- tempMap.put(Feature.SYSTEM_ENERGY, new ProtocolConfig40[] { SYSTEM_ENERGY });
- tempMap.put(Feature.FUNCTION_PROFILING, new ProtocolConfig40[] { FUNCTION_PROFILING,
- WEB_FUNCTION_PROFILING });
- tempMap.put(Feature.FUNCTION_SAMPLING, new ProtocolConfig40[] { FUNCTION_SAMPLING });
- tempMap.put(Feature.MEMORY_ALLOCATION, new ProtocolConfig40[] { MEMORY_ALLOC_PROBE });
- tempMap.put(Feature.APPLICATION_STARTUP, new ProtocolConfig40[] { APP_STARTUP,
- WEBAPP_STARTUP });
- tempMap.put(Feature.FILE_ANALYSIS, new ProtocolConfig40[] { FILE_API_PROBE,
- NONTARGET_FILE_ACTIVITY });
- tempMap.put(Feature.THREAD_ANALYSIS, new ProtocolConfig40[] { THREAD_API_PROBE,
- SYSTEM_THREAD_LOAD });
- tempMap.put(Feature.NETWORK_ANALYSIS, new ProtocolConfig40[] { NETWORK_API_PROBE });
- tempMap.put(Feature.OPENGL_ANALYSIS, new ProtocolConfig40[] { OPENGL_API_PROBE });
- tempMap.put(Feature.UI_EVENT_ANALYSIS, new ProtocolConfig40[] { USER_EVENT });
- tempMap.put(Feature.CONTEXT_SWITCH_ANALYSIS, new ProtocolConfig40[] { CONTEXT_SWITCH });
- tempMap.put(Feature.INTERNAL_PROBE_MEMORY, new ProtocolConfig40[] { INTERNAL_MEMORY_ALLOC });
- tempMap.put(Feature.INTERNAL_PROBE_FILE, new ProtocolConfig40[] { INTERNAL_FILE_API });
- tempMap.put(Feature.INTERNAL_PROBE_THREAD, new ProtocolConfig40[] { INTERNAL_THREAD_API });
- tempMap.put(Feature.INTERNAL_PROBE_NETWORK, new ProtocolConfig40[] { INTERNAL_NETWORK_API });
- tempMap.put(Feature.INTERNAL_PROBE_OPENGL, new ProtocolConfig40[] { INTERNAL_OPENGL_API });
- tempMap.put(Feature.SYSCALL_FILE, new ProtocolConfig40[] { SYSCALL_FILE });
- tempMap.put(Feature.SYSCALL_IPC, new ProtocolConfig40[] { SYSCALL_IPC });
- tempMap.put(Feature.SYSCALL_PROCESS, new ProtocolConfig40[] { SYSCALL_PROCESS });
- tempMap.put(Feature.SYSCALL_SIGNAL, new ProtocolConfig40[] { SYSCALL_SIGNAL });
- tempMap.put(Feature.SYSCALL_NETWORK, new ProtocolConfig40[] { SYSCALL_NETWORK });
- tempMap.put(Feature.SYSCALL_DESC, new ProtocolConfig40[] { SYSCALL_DESC });
- tempMap.put(Feature.SCREENSHOT_ON_SCENE_TRANSITION, new ProtocolConfig40[] { SCREENSHOT });
- tempMap.put(Feature.RECORDING, new ProtocolConfig40[] { RECORDING });
- featureProtocolMap = Collections.unmodifiableMap(tempMap);
- }
+ APP_STARTUP(45),
+ WEB_FUNCTION_PROFILING(46),
+ WEBAPP_STARTUP(47),
+ NONTARGET_FILE_ACTIVITY(48);
private static final Map<FlatPreferences, ProtocolConfig40[]> preferencesProtocolMap;
tempMap.put(FlatFeature.NETWORK_IO, new ProtocolConfig40[] { SYSTEM_NETWORK });
tempMap.put(FlatFeature.NETWORK_ANALYSIS, new ProtocolConfig40[] { NETWORK_API_PROBE });
tempMap.put(FlatFeature.UI_EVENT, new ProtocolConfig40[] { USER_EVENT });
- //tempMap.put(FlatFeature.UI_HIERARCHY_ANALYSIS, new ProtocolConfig40[] { UIHV });
tempMap.put(FlatFeature.THREAD_ANALYSIS, new ProtocolConfig40[] { THREAD_API_PROBE, SYSTEM_THREAD_LOAD });
tempMap.put(FlatFeature.PERIPHERAL_STATUS, new ProtocolConfig40[] { SYSTEM_DEVICE });
tempMap.put(FlatFeature.POWER_ESTIMATION, new ProtocolConfig40[] { SYSTEM_ENERGY });
}
private int bitShift;
- private int overheadValue;
- private int callCount;
- private Feature featureForFrequency;
- private ProtocolConfig40(int bitshift, int overhead, int callcount, Feature frequency) {
+ private ProtocolConfig40(int bitshift) {
this.bitShift = bitshift;
- this.overheadValue = overhead;
- this.callCount = callcount;
- this.featureForFrequency = frequency;
}
public int getShift() {
return bitShift;
}
-
- public int getOverhead() {
- return overheadValue;
- }
-
- public int getCallcount() {
- return callCount;
- }
-
- public Feature getFeatureForFrequency() {
- return featureForFrequency;
- }
-
- public static byte[] getFeatureFlagValue(Set<Feature> features) {
- long lowValue = 0;
- long highValue = 0;
- if (features != null) {
- for (Feature feature : features) {
- ProtocolConfig40[] configs = featureProtocolMap.get(feature);
- if (configs != null) {
- for (int i = 0; i < configs.length; i++) {
- int bitshift = configs[i].getShift();
- if (bitshift >= 64) { // high 8byte bit
- highValue |= (0x1L << (bitshift - 64));
- } else { // low 8byte bit
- lowValue |= (0x1L << bitshift);
- }
- }
- }
- }
- }
-
- byte[] lowbyte = ByteUtil.toBytes(lowValue);
- byte[] highbyte = ByteUtil.toBytes(highValue);
- byte[] ret = new byte[16];
-
- System.arraycopy(lowbyte, 0, ret, 0, 8);
- System.arraycopy(highbyte, 0, ret, 8, 8);
-
- return ret;
- }
public static byte[] getFlatFeatureFlagValue(Set<FlatFeature> flatFeatures, Set<FlatPreferences> selectedPreferences) {
long lowValue = 0;
return ret;
}
-
- public static IProtocolConfig[] getProtocolConfig(Feature feature) {
- return featureProtocolMap.get(feature);
- }
public static IProtocolConfig[] getProtocolConfig(FlatFeature feature) {
return flatFeatureProtocolMap.get(feature);
// set sampling period value
int systemPeriod = SettingDataManager.INSTANCE
- .getOptionsPreferencesValue(FlatPreferences.SYSTEM_SAMPLING_RATE);
+ .getPreferenceValue(FlatPreferences.SYSTEM_SAMPLING_RATE);
int samplingPeriod = SettingDataManager.INSTANCE
- .getOptionsPreferencesValue(FlatPreferences.FUNCTION_SAMPLING_RATE);
+ .getPreferenceValue(FlatPreferences.FUNCTION_SAMPLING_RATE);
ps.putInt(systemPeriod);
ps.putInt(samplingPeriod);
import java.util.Set;
import org.tizen.dynamicanalyzer.protocol.IProtocolConfig;
-import org.tizen.dynamicanalyzer.setting.Feature;
import org.tizen.dynamicanalyzer.setting.FlatFeature;
import org.tizen.dynamicanalyzer.setting.FlatPreferences;
import org.tizen.dynamicanalyzer.util.ByteUtil;
-import org.tizen.dynamicanalyzer.util.Logger;
public enum ProtocolConfig41 implements IProtocolConfig {
- RESERVED1(0, 0, 0, null),
- RESERVED2(1, 0, 0, null),
- FUNCTION_PROFILING(2, 36, 5000, null),
- MEMORY_ALLOC_PROBE(3, 40, 623, null),
- FILE_API_PROBE(4, 26, 918, null),
- THREAD_API_PROBE(5, 0, 106, null),
- OSPUI_API_PROBE(6, 0, 0, null),
- SCREENSHOT(7, 62, 10, null),
- USER_EVENT(8, 0, 45, null),
- RECORDING(9, 996, 17, null),
- SYSCALL_FILE(10, 14, 0, null),
- SYSCALL_IPC(11, 14, 0, null),
- SYSCALL_PROCESS(12, 14, 0, null),
- SYSCALL_SIGNAL(13, 14, 0, null),
- SYSCALL_NETWORK(14, 14, 0, null),
- SYSCALL_DESC(15, 14, 0, null),
- CONTEXT_SWITCH(16, 14, 0, null),
- NETWORK_API_PROBE(17, 38, 10021, null),
- OPENGL_API_PROBE(18, 16, 50000, null),
- FUNCTION_SAMPLING(19, 68, 0, Feature.FUNCTION_SAMPLING_RATE),
-
- INTERNAL_MEMORY_ALLOC(28, 40, 0, null),
- INTERNAL_FILE_API(29, 26, 0, null),
- INTERNAL_THREAD_API(30, 0, 0, null),
- INTERNAL_OSPUI_API(31, 0, 0, null),
- INTERNAL_NETWORK_API(32, 38, 0, null),
- INTERNAL_OPENGL_API(33, 16, 0, null),
-
- SYSTEM_CPU(36, 2438, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_MEMORY(37, 2282, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_PROCESS(38, 2568, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_THREAD_LOAD(39, 2344, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_PROCESSES_LOAD(40, 2504, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_DISK(41, 1222, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_NETWORK(42, 162, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_DEVICE(43, 756, 0, Feature.SYSTEM_SAMPLING_RATE),
- SYSTEM_ENERGY(44, 452, 0, Feature.SYSTEM_SAMPLING_RATE),
+ RESERVED1(0),
+ RESERVED2(1),
+ FUNCTION_PROFILING(2),
+ MEMORY_ALLOC_PROBE(3),
+ FILE_API_PROBE(4),
+ THREAD_API_PROBE(5),
+ OSPUI_API_PROBE(6),
+ SCREENSHOT(7),
+ USER_EVENT(8),
+ RECORDING(9),
+ SYSCALL_FILE(10),
+ SYSCALL_IPC(11),
+ SYSCALL_PROCESS(12),
+ SYSCALL_SIGNAL(13),
+ SYSCALL_NETWORK(14),
+ SYSCALL_DESC(15),
+ CONTEXT_SWITCH(16),
+ NETWORK_API_PROBE(17),
+ OPENGL_API_PROBE(18),
+ FUNCTION_SAMPLING(19),
+
+ INTERNAL_MEMORY_ALLOC(28),
+ INTERNAL_FILE_API(29),
+ INTERNAL_THREAD_API(30),
+ INTERNAL_OSPUI_API(31),
+ INTERNAL_NETWORK_API(32),
+ INTERNAL_OPENGL_API(33),
+
+ SYSTEM_CPU(36),
+ SYSTEM_MEMORY(37),
+ SYSTEM_PROCESS(38),
+ SYSTEM_THREAD_LOAD(39),
+ SYSTEM_PROCESSES_LOAD(40),
+ SYSTEM_DISK(41),
+ SYSTEM_NETWORK(42),
+ SYSTEM_DEVICE(43),
+ SYSTEM_ENERGY(44),
// added for protocol 4.0
- APP_STARTUP(45, 0, 0, null),
- WEB_FUNCTION_PROFILING(46, 0, 0, null),
- WEBAPP_STARTUP(47, 0, 0, null),
- NONTARGET_FILE_ACTIVITY(48, 0, 0, null),
+ APP_STARTUP(45),
+ WEB_FUNCTION_PROFILING(46),
+ WEBAPP_STARTUP(47),
+ NONTARGET_FILE_ACTIVITY(48),
// added for protocol 4.1
- UI_HIERARCHY(49, 0, 45, null);
-
- private static final Map<Feature, ProtocolConfig41[]> featureProtocolMap;
-
- static {
- Map<Feature, ProtocolConfig41[]> tempMap = new EnumMap<Feature, ProtocolConfig41[]>(
- Feature.class);
- tempMap.put(Feature.SYSTEM_CPU, new ProtocolConfig41[] { SYSTEM_CPU });
- tempMap.put(Feature.SYSTEM_PROCESS, new ProtocolConfig41[] { SYSTEM_PROCESS });
- tempMap.put(Feature.SYSTEM_MEMORY, new ProtocolConfig41[] { SYSTEM_MEMORY });
- tempMap.put(Feature.SYSTEM_ALL_PROCESSES, new ProtocolConfig41[] { SYSTEM_PROCESSES_LOAD });
- tempMap.put(Feature.SYSTEM_DISK, new ProtocolConfig41[] { SYSTEM_DISK });
- tempMap.put(Feature.SYSTEM_NETWORK, new ProtocolConfig41[] { SYSTEM_NETWORK });
- tempMap.put(Feature.SYSTEM_DEVICE, new ProtocolConfig41[] { SYSTEM_DEVICE });
- tempMap.put(Feature.SYSTEM_ENERGY, new ProtocolConfig41[] { SYSTEM_ENERGY });
- tempMap.put(Feature.FUNCTION_PROFILING, new ProtocolConfig41[] { FUNCTION_PROFILING,
- WEB_FUNCTION_PROFILING });
- tempMap.put(Feature.FUNCTION_SAMPLING, new ProtocolConfig41[] { FUNCTION_SAMPLING });
- tempMap.put(Feature.MEMORY_ALLOCATION, new ProtocolConfig41[] { MEMORY_ALLOC_PROBE });
- tempMap.put(Feature.APPLICATION_STARTUP, new ProtocolConfig41[] { APP_STARTUP,
- WEBAPP_STARTUP });
- tempMap.put(Feature.FILE_ANALYSIS, new ProtocolConfig41[] { FILE_API_PROBE,
- NONTARGET_FILE_ACTIVITY });
- tempMap.put(Feature.THREAD_ANALYSIS, new ProtocolConfig41[] { THREAD_API_PROBE,
- SYSTEM_THREAD_LOAD });
- tempMap.put(Feature.NETWORK_ANALYSIS, new ProtocolConfig41[] { NETWORK_API_PROBE });
- tempMap.put(Feature.OPENGL_ANALYSIS, new ProtocolConfig41[] { OPENGL_API_PROBE });
- tempMap.put(Feature.UI_EVENT_ANALYSIS, new ProtocolConfig41[] { USER_EVENT });
- tempMap.put(Feature.UI_HIERARCHY_ANALYSIS, new ProtocolConfig41[] { UI_HIERARCHY });
- tempMap.put(Feature.CONTEXT_SWITCH_ANALYSIS, new ProtocolConfig41[] { CONTEXT_SWITCH });
- tempMap.put(Feature.INTERNAL_PROBE_MEMORY, new ProtocolConfig41[] { INTERNAL_MEMORY_ALLOC });
- tempMap.put(Feature.INTERNAL_PROBE_FILE, new ProtocolConfig41[] { INTERNAL_FILE_API });
- tempMap.put(Feature.INTERNAL_PROBE_THREAD, new ProtocolConfig41[] { INTERNAL_THREAD_API });
- tempMap.put(Feature.INTERNAL_PROBE_NETWORK, new ProtocolConfig41[] { INTERNAL_NETWORK_API });
- tempMap.put(Feature.INTERNAL_PROBE_OPENGL, new ProtocolConfig41[] { INTERNAL_OPENGL_API });
- tempMap.put(Feature.SYSCALL_FILE, new ProtocolConfig41[] { SYSCALL_FILE });
- tempMap.put(Feature.SYSCALL_IPC, new ProtocolConfig41[] { SYSCALL_IPC });
- tempMap.put(Feature.SYSCALL_PROCESS, new ProtocolConfig41[] { SYSCALL_PROCESS });
- tempMap.put(Feature.SYSCALL_SIGNAL, new ProtocolConfig41[] { SYSCALL_SIGNAL });
- tempMap.put(Feature.SYSCALL_NETWORK, new ProtocolConfig41[] { SYSCALL_NETWORK });
- tempMap.put(Feature.SYSCALL_DESC, new ProtocolConfig41[] { SYSCALL_DESC });
- tempMap.put(Feature.SCREENSHOT_ON_SCENE_TRANSITION, new ProtocolConfig41[] { SCREENSHOT });
- tempMap.put(Feature.RECORDING, new ProtocolConfig41[] { RECORDING });
- featureProtocolMap = Collections.unmodifiableMap(tempMap);
- }
+ UI_HIERARCHY(49),
+ LEAK_SANITIZER(50);
private static final Map<FlatPreferences, ProtocolConfig41[]> preferencesProtocolMap;
tempMap.put(FlatPreferences.SYSTEM_ALL_PROCESSES, new ProtocolConfig41[] { SYSTEM_PROCESSES_LOAD });
tempMap.put(FlatPreferences.PROCESS_MEMORY, new ProtocolConfig41[] { SYSTEM_PROCESS });
tempMap.put(FlatPreferences.SCREENSHOT_ON_SCENE_TRANSITION, new ProtocolConfig41[] { SCREENSHOT });
+ tempMap.put(FlatPreferences.LEAK_SANITIZER, new ProtocolConfig41[] { LEAK_SANITIZER });
preferencesProtocolMap = Collections.unmodifiableMap(tempMap);
}
}
private int bitShift;
- private int overheadValue;
- private int callCount;
- private Feature featureForFrequency;
- private ProtocolConfig41(int bitshift, int overhead, int callcount, Feature frequency) {
+ private ProtocolConfig41(int bitshift) {
this.bitShift = bitshift;
- this.overheadValue = overhead;
- this.callCount = callcount;
- this.featureForFrequency = frequency;
}
public int getShift() {
return bitShift;
}
- public int getOverhead() {
- return overheadValue;
- }
-
- public int getCallcount() {
- return callCount;
- }
-
- public Feature getFeatureForFrequency() {
- return featureForFrequency;
- }
-
- public static byte[] getFeatureFlagValue(Set<Feature> features) {
- long lowValue = 0;
- long highValue = 0;
- if (features != null) {
- for (Feature feature : features) {
- ProtocolConfig41[] configs = featureProtocolMap.get(feature);
- if (configs != null) {
- for (int i = 0; i < configs.length; i++) {
- int bitshift = configs[i].getShift();
- if (bitshift >= 64) { // high 8byte bit
- highValue |= (0x1L << (bitshift - 64));
- } else { // low 8byte bit
- lowValue |= (0x1L << bitshift);
- }
- }
- }
- }
- }
-
- byte[] lowbyte = ByteUtil.toBytes(lowValue);
- byte[] highbyte = ByteUtil.toBytes(highValue);
- byte[] ret = new byte[16];
-
- System.arraycopy(lowbyte, 0, ret, 0, 8);
- System.arraycopy(highbyte, 0, ret, 8, 8);
-
- return ret;
- }
-
public static byte[] getFlatFeatureFlagValue(Set<FlatFeature> flatFeatures, Set<FlatPreferences> selectedPreferences) {
long lowValue = 0;
long highValue = 0;
return ret;
}
-
- public static IProtocolConfig[] getProtocolConfig(Feature feature) {
- return featureProtocolMap.get(feature);
- }
public static IProtocolConfig[] getProtocolConfig(FlatFeature feature) {
return flatFeatureProtocolMap.get(feature);
SCREENSHOT_ON_SCENE_TRANSITION(5000,
ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_ON_SCENE_TRANSITION),
SCREENSHOT_PERIODICALLY(5001, ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_PERIODICALLY),
- RECORDING(5002, ConfigureLabels.FEATURE_NAME_RECORDING),
- AUTO_STOP(5003, ConfigureLabels.SETTING_OPTION_AUTO_STOP);
+ RECORDING(5002, ConfigureLabels.FEATURE_NAME_RECORDING);
private static final Map<Integer, Feature> featureByIndex = new HashMap<Integer, Feature>();
private static final Map<String, Feature> featureByName = new HashMap<String, Feature>();
SYSTEM_SAMPLING_RATE(2002, 1000,PreferencesDialogLabels.SYSTEM_SAMPLIING_RATE),
FUNCTION_SAMPLING_RATE(2003, 10, PreferencesDialogLabels.FUNCION_SAMPLIING_RATE),
RECORDING(2004, 1, PreferencesDialogLabels.RECORDING),
- AUTO_STOP(2005, 0, PreferencesDialogLabels.AUTOSTOP_WHILE_REPLAYING),
SCREENSHOT_PERIODICALLY(2006, 0, PreferencesDialogLabels.PERIODICALLY),
SCREENSHOT_ON_SCENE_TRANSITION(2007, 1, PreferencesDialogLabels.ON_SCENE_TRANSITION),
FUNCTION_PROFILING(3001, 1, PreferencesDialogLabels.FUNCTION_PROFILING),
WEB_FUNCTION_PROFILING(3003, 1, PreferencesDialogLabels.WEB_FUNCTION_PROFILING),
WEBAPP_STARTUP(3004, 1, PreferencesDialogLabels.WEBAPP_STARTUP),
SYSTEM_ALL_PROCESSES(3005, 1, PreferencesDialogLabels.WEBAPP_STARTUP),
- PROCESS_MEMORY(3006, 1, PreferencesDialogLabels.PROCESS_MEMORY);
+ PROCESS_MEMORY(3006, 1, PreferencesDialogLabels.PROCESS_MEMORY),
+ LEAK_SANITIZER(4001, 0, PreferencesDialogLabels.LEAK_SANITIZER);
private static final Map<Integer, FlatPreferences> featureByIndex = new HashMap<Integer, FlatPreferences>();
private static final Map<String, FlatPreferences> featureByName = new HashMap<String, FlatPreferences>();
} // else : used in the unit test
readFlatFeatureFile();
- readFeatureFile();
- readTemplateFile();
readSettingFile();
}
}
}
- private void readFeatureFile() {
- File csv = new File(SettingConstants.SettingFilePath + SettingConstants.FEATURE_FILE_NAME);
- BufferedReader in = null;
- String content = null;
- try {
- in = new BufferedReader(new FileReader(csv));
- while (null != (content = in.readLine())) {
- String list[] = content.split(SettingConstants.READ_CSV_SEPARATOR, -1);
- if (list != null) {
- int index = Integer.parseInt(list[SettingConstants.FEATURE_KEY_FEATURE_INDEX]);
- Feature feature = Feature.getFeature(index);
-
- // search feature
- if (null == feature) {
- Logger.error("unknown feature : "
- + list[SettingConstants.FEATURE_KEY_FEATURE_INDEX] + ", "
- + list[SettingConstants.FEATURE_KEY_FEATURE_NAME]);
- continue;
- }
-
- FeatureData featureData = feature.getData();
- featureData.setFeatureType(Integer
- .parseInt(list[SettingConstants.FEATURE_KEY_FEATURE_TYPE]));
-
- // set parentIndex
- if ((null != list[SettingConstants.FEATURE_KEY_PARENT_INDEX])
- && (!(list[SettingConstants.FEATURE_KEY_PARENT_INDEX]).isEmpty())) {
- int parentIndex = Integer
- .parseInt(list[SettingConstants.FEATURE_KEY_PARENT_INDEX]);
- if (Feature.getFeature(parentIndex) != null) {
- featureData.setParentIndex(parentIndex);
- }
- } // else : main feature
-
- featureData.makePageList(list[SettingConstants.FEATURE_KEY_PAGE_LIST]);
- featureData.makeChartList(list[SettingConstants.FEATURE_KEY_CHART_LIST]);
- featureData.setMinValue(list[SettingConstants.FEATURE_KEY_MIN_VALUE]);
- featureData.setMaxValue(list[SettingConstants.FEATURE_KEY_MAX_VALUE]);
- featureData.setDefaultValue(list[SettingConstants.FEATURE_KEY_DEFAULT_VALUE]);
- featureData
- .setOverheadRanking(list[SettingConstants.FEATURE_KEY_OVERHEAD_RANKING]);
- }
- }
- } catch (FileNotFoundException e) {
- parsingSuccess = false;
- Logger.exception(e);
- } catch (IOException e) {
- Logger.exception(e);
- } finally {
- CommonUtil.tryClose(in);
- }
- }
-
- private void readTemplateFile() {
- File csv = new File(SettingConstants.SettingFilePath + SettingConstants.TEMPLATE_FILE_NAME);
- BufferedReader in = null;
- String content = null;
- try {
- in = new BufferedReader(new FileReader(csv));
- while (null != (content = in.readLine())) {
- String list[] = content.split(SettingConstants.READ_CSV_SEPARATOR, -1);
- if (list != null) {
- int index = Integer
- .parseInt(list[SettingConstants.TEMPLATE_KEY_TEMPLATE_INDEX]);
- Template template = Template.getTemplate(index);
-
- // search template
- if (null == template) {
- Logger.error("unknown template : "
- + list[SettingConstants.TEMPLATE_KEY_TEMPLATE_INDEX] + ", "
- + list[SettingConstants.TEMPLATE_KEY_TEMPLATE_NAME]);
- continue;
- }
-
- TemplateData templateDate = template.getData();
-
- // make feature list
- for (int i = 2; i < list.length; i++) {
- templateDate.makeFeatureList(list[i]);
- }
- } // else do nothing
- }
- } catch (FileNotFoundException e) {
- parsingSuccess = false;
- Logger.exception(e);
- } catch (IOException e) {
- Logger.exception(e);
- } finally {
- CommonUtil.tryClose(in);
- }
- }
-
private void readSettingFile() {
File csv = new File(SettingConstants.SettingFilePath + SettingConstants.SETTING_FILE_NAME);
BufferedReader in = null;
} else if (list[0].equals(SettingConstants.KEY_SELECTED_TARGET)) {
selectedTarget = list[1];
initTarget = new String(list[1]);
- } else if (list[0].equals(SettingConstants.KEY_DEFAULT_FEATURE_LIST)) {
- for (int i = 1; i < list.length; i++) {
- defaultFeatureList.add(Feature.getFeature(Integer.parseInt(list[i])));
- }
} else if (list[0].equals(SettingConstants.KEY_TOTAL_OVERHEAD_RANGE)) {
for (int i = 1; i < list.length; i++) {
totalOverheadRange.add(Long.parseLong(list[i]));
}
- } else if (list[0].equals(SettingConstants.KEY_OPTIONS_SELECTED_FEATURE_LIST)) {
- // do nothing
} else if (list[0].equals(SettingConstants.KEY_SELECTED_PREFERENCES)) {
for (int i = 1; i < list.length; i++) {
String valueList[] = list[i].split(CommonConstants.COLON);
printWriter.println(writeTargetData()); // write available target list
printWriter.println(SettingConstants.KEY_SELECTED_TARGET
+ SettingConstants.WRITE_CSV_SEPARATOR + selectedTarget);
- printWriter.println(writeDefaultFeatureList(SettingConstants.KEY_DEFAULT_FEATURE_LIST));
printWriter.println(writeCollection(totalOverheadRange,
SettingConstants.KEY_TOTAL_OVERHEAD_RANGE));
printWriter.println(SettingConstants.KEY_SELECTED_PREFERENCES
return buffer.toString();
}
- private String writeDefaultFeatureList(String key) {
- StringBuffer buffer = new StringBuffer();
- buffer.append(key + SettingConstants.WRITE_CSV_SEPARATOR);
-
- for (int i = 0; i < defaultFeatureList.size(); i++) {
- if (i < defaultFeatureList.size() - 1) {
- buffer.append(defaultFeatureList.get(i).getIndex()
- + SettingConstants.WRITE_CSV_SEPARATOR);
- } else {
- buffer.append(defaultFeatureList.get(i).getIndex());
- }
- }
- return buffer.toString();
- }
-
private <T> String writeCollection(Collection<T> collection, String key) {
StringBuffer subBuffer = new StringBuffer();
for (T element : collection) {
/********************************** chart set manipulation ***************************/
- @Deprecated
- public Set<String> getOptionsSelectedFeatureChartSet() {
- return new HashSet<String>();
- }
/**
* Get chart information shown on the screen.
*
}
/********************************** Feature manipulation ******************************/
- @Deprecated
- public List<Feature> getDefaultFeatureList() {
- return Collections.unmodifiableList(defaultFeatureList);
- }
-
- @Deprecated
- public List<FeatureValueData> getOptionsSelectedFeatureList() {
- return new ArrayList<FeatureValueData>();
- }
-
- public List<FlatPreferences> getOptionsSelectedPreferencesList() {
+ public List<FlatPreferences> getSelectedPreferencesList() {
return Collections.unmodifiableList(optionsSelectedPreferenceList);
}
- @Deprecated
- public void addOptionsSelectedFeature(Feature feature, int featureValue) {
- }
-
- public void addOptionsSelectedPreference(FlatPreferences feature, int featureValue) {
- int index = getFlatPreferences(optionsSelectedPreferenceList, feature);
- // create FeatureValueData
- if (index == -1) {
- FlatPreferences featureData = FlatPreferences.getFlatPreferences(feature.getIndex());
- featureData.setValue(featureValue);
- optionsSelectedPreferenceList.add(featureData);
- }
- else {
- optionsSelectedPreferenceList.get(index).setValue(featureValue);
- }
- }
+ /**
+ * Sets {@code value} to specified {@code preference}. If {@code preference}
+ * is not selected yet, then it will be added to a list of selected
+ * preferences.
+ *
+ * @param preference {@link FlatPreferences} enum value
+ * @param value integer value to be set
+ */
+ public void setPreferenceValue(FlatPreferences preference, int value) {
+ if (preference == null)
+ return;
- @Deprecated
- public void deleteOptionsSelectedFeature(Feature feature) {
- }
-
- public void deleteOptionsSelectedPreference(FlatPreferences feature) {
- for (int i = 0; i < optionsSelectedPreferenceList.size(); i++) {
- if (optionsSelectedPreferenceList.get(i) == feature) {
- optionsSelectedPreferenceList.remove(i);
- break;
- } // else : do nothing
- }
- }
+ if (!isPreferenceSelected(preference))
+ addPreference(preference);
- @Deprecated
- public boolean isOptionsSelectedFeature(Feature feature) {
- return false;
- }
-
- public boolean isOptionsSelectedPrefereces(FlatPreferences feature) {
- int index = getFlatPreferences(optionsSelectedPreferenceList, feature);
- if (index != -1) {
- return true;
- } else {
- return false;
- }
+ preference.setValue(value);
}
/**
- * Get selection state of specified feature.
+ * Gets value of specified {@code preference}.
*
- * @param feature feature to check selection
- * @return <code>true</code> if feature selected,
- * <code>false</code> otherwise
+ * @param preference {@link FlatPreferences} enum value
+ * @return value of {@code preference} if it is selected or its default
+ * value, if {@code preference} is {@code null} then {@code -1} is
+ * returned
*/
- public boolean isFlatFeatureSelected(FlatFeature feature) {
- return getSelectedFlatFeatureSet().contains(feature);
+ public int getPreferenceValue(FlatPreferences preference) {
+ if (preference == null)
+ return -1;
+
+ return isPreferenceSelected(preference)
+ ? preference.getValue()
+ : preference.getDefaultValue();
}
- @Deprecated
- public int getOptionsFeatureValue(Feature feature) {
- return -1;
+ /**
+ * Adds given {@code preference} to a list of selected preferences.
+ *
+ * @param preference {@link FlatPreferences} enum value
+ */
+ public void addPreference(FlatPreferences preference) {
+ if (preference != null && !optionsSelectedPreferenceList.contains(preference))
+ optionsSelectedPreferenceList.add(preference);
}
-
- public int getOptionsPreferencesValue(FlatPreferences feature) {
- int value = 0;
- int index = getFlatPreferences(optionsSelectedPreferenceList, feature);
- // check selected feature
- if (index != -1) {
- value = optionsSelectedPreferenceList.get(index).getValue();
- } else {
- // get default value
- value = FlatPreferences.getFlatPreferences(feature.getIndex()).getDefaultValue();
- }
+ /**
+ * Removes given {@code preference} from a list of selected preferences.
+ *
+ * @param preference {@link FlatPreferences} enum value
+ */
+ public void deletePreference(FlatPreferences preference) {
+ if (preference == null)
+ return;
- return value;
+ optionsSelectedPreferenceList.remove(preference);
}
- @Deprecated
- public int getOptionsFeaturInitValue(Feature feature) {
- return -1;
+ /**
+ * Checks whether given {@code preference} is selected.
+ *
+ * @param preference {@link FlatPreferences} enum value
+ * @return {@code true} if {@code preference} is selected
+ */
+ public boolean isPreferenceSelected(FlatPreferences preference) {
+ return optionsSelectedPreferenceList.contains(preference);
}
- private int getFlatPreferences(List<FlatPreferences> featureList, FlatPreferences feature) {
- if ((featureList == null) || (feature == null)) {
- return -1;
- }
+ /**
+ * Sets specified {@code preference} as selected.
+ *
+ * @param preference {@link FlatPreferences} object
+ * @param selected whether preference should be selected
+ */
+ public void setPreferenceSelected(FlatPreferences preference, boolean selected) {
+ if (selected)
+ addPreference(preference);
+ else
+ deletePreference(preference);
+ }
- for (int i = 0; i < featureList.size(); i++) {
- if (featureList.get(i).getIndex() == feature.getIndex()) {
- return i;
- }
- }
- return -1;
+ /**
+ * Get selection state of specified feature.
+ *
+ * @param feature feature to check selection
+ * @return <code>true</code> if feature selected, <code>false</code>
+ * otherwise
+ */
+ public boolean isFlatFeatureSelected(FlatFeature feature) {
+ return getSelectedFlatFeatureSet().contains(feature);
}
/******************************* Overhead manipulation *********************************/
/******************************* miscellaneous **********************************/
public boolean changedFeatures() {
// check target
- if (initTarget.equals(selectedTarget) == false) {
+ if (!initTarget.equals(selectedTarget)) {
return true;
}
- //check options FlatPreferences
+ // check selected FlatPreferences
if (optionsSelectedPreferenceList.size() != initOptionsSelectedPreferenceList.size()) {
return true;
}
- for (int i = 0; i < optionsSelectedPreferenceList.size(); i++) {
- // check preferenceName
- FlatPreferences preference = optionsSelectedPreferenceList.get(i);
- int initPreferenceIndex = getFlatPreferences(initOptionsSelectedPreferenceList, preference);
- if (initPreferenceIndex < 0) {
+ for (FlatPreferences preference : optionsSelectedPreferenceList)
+ if (!initOptionsSelectedPreferenceList.contains(preference))
return true;
- } else {
- // check value
- if (preference.getValue() != initOptionsSelectedPreferenceList.get(initPreferenceIndex).getValue()) {
- return true;
- } // else : return false;
- }
- }
// check selected FlatFeatures
for (Map.Entry<String, TargetData> entry : targetListMap.entrySet()) {
TargetData target = entry.getValue();
- if (target.changedFlatFeatures()) {
+ if (target.changedFlatFeatures())
return true;
- }
}
+
return false;
}
writeSettingFile();
}
- @Deprecated
- public Set<Feature> getSelectedFeatureSet() {
- return new HashSet<Feature>();
- }
-
public Set<FlatPreferences> getSelectedPreferenceSet() {
List<FlatFeature> featureSet = getConnectedTargetOrSelected()
.getSelectedFlatFeatures();
selectedFeatures.addAll(optionsSelectedPreferenceList);
// add default preferences
- if (!isOptionsSelectedPrefereces(FlatPreferences.FUNCTION_PROFILING)) {
+ if (!isPreferenceSelected(FlatPreferences.FUNCTION_PROFILING)) {
selectedFeatures.add(FlatPreferences.FUNCTION_PROFILING);
}
- if (!isOptionsSelectedPrefereces(FlatPreferences.APP_STARTUP)) {
+ if (!isPreferenceSelected(FlatPreferences.APP_STARTUP)) {
selectedFeatures.add(FlatPreferences.APP_STARTUP);
}
- if (!isOptionsSelectedPrefereces(FlatPreferences.SYSTEM_ALL_PROCESSES)) {
+ if (!isPreferenceSelected(FlatPreferences.SYSTEM_ALL_PROCESSES)) {
selectedFeatures.add(FlatPreferences.SYSTEM_ALL_PROCESSES);
}
if (!featureSet.contains(FlatFeature.PROCESS_MEMORY)
- && !isOptionsSelectedPrefereces(FlatPreferences.PROCESS_MEMORY)) {
+ && !isPreferenceSelected(FlatPreferences.PROCESS_MEMORY)) {
selectedFeatures.add(FlatPreferences.PROCESS_MEMORY);
}
- if (!isOptionsSelectedPrefereces(FlatPreferences.FUNCTION_SAMPLING_RATE)) {
+ if (!isPreferenceSelected(FlatPreferences.FUNCTION_SAMPLING_RATE)) {
selectedFeatures.add(FlatPreferences.FUNCTION_SAMPLING_RATE);
}
}
// TODO : another function is implemented, will be deleted.
+ // It looks like it's ANOTHER function is somewhere inside
+ // Global.getDeviceInfo
@Deprecated
public String getPlatform() {
// if (null == platform || platform.isEmpty() ||
if (!selectedFlatFeatures.contains(feature))
selectedFlatFeatures.add(feature);
if (feature == FlatFeature.SCREENSHOT)
- SettingDataManager.INSTANCE.addOptionsSelectedPreference(FlatPreferences.SCREENSHOT_ON_SCENE_TRANSITION, 1);
+ SettingDataManager.INSTANCE.setPreferenceSelected(
+ FlatPreferences.SCREENSHOT_ON_SCENE_TRANSITION, true);
+ else if (feature == FlatFeature.THREAD_ANALYSIS)
+ SettingDataManager.INSTANCE.deletePreference(FlatPreferences.LEAK_SANITIZER);
}
}
if (null != feature) {
selectedFlatFeatures.remove(feature);
if (feature == FlatFeature.SCREENSHOT) {
- SettingDataManager.INSTANCE.deleteOptionsSelectedPreference(FlatPreferences.SCREENSHOT_ON_SCENE_TRANSITION);
- SettingDataManager.INSTANCE.deleteOptionsSelectedPreference(FlatPreferences.SCREENSHOT_PERIODICALLY);
+ SettingDataManager.INSTANCE.deletePreference(FlatPreferences.SCREENSHOT_ON_SCENE_TRANSITION);
+ SettingDataManager.INSTANCE.deletePreference(FlatPreferences.SCREENSHOT_PERIODICALLY);
}
+
+ if (feature == FlatFeature.MEMORY_ALLOC)
+ SettingDataManager.INSTANCE.deletePreference(FlatPreferences.LEAK_SANITIZER);
}
}
return Collections.unmodifiableList(selectedFlatFeatures);
}
- @Deprecated
- public boolean isSelectedFeature(Feature feature) {
- return false;
- }
-
public boolean isSelectedFlatFeature(String name) {
FlatFeature feature = FlatFeature.getFlatFeature(name);
return selectedFlatFeatures.contains(feature);
import org.tizen.dynamicanalyzer.nl.MenuBarLabels;
import org.tizen.dynamicanalyzer.ui.page.MenuBar;
import org.tizen.dynamicanalyzer.ui.toolbar.AboutDialog;
+import org.tizen.dynamicanalyzer.ui.widgets.SearchDialog;
import org.tizen.dynamicanalyzer.util.CommonUtil;
import org.tizen.dynamicanalyzer.util.Logger;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
} else if (e.stateMask == CTRL_STATE_MASK && e.keyCode == 's') {
if (MenuBar.getInstance().isMenuItemEnabled(MenuBarLabels.FILE_SAVE))
MenuBar.getInstance().showSaveDialog();
+ } else if (e.stateMask == CTRL_STATE_MASK && e.keyCode == 'f') {
+ SearchDialog dialog = new SearchDialog();
+ dialog.open();
}
/*
else if (e.keyCode == SWT.F2) {
public static String STOP_TRACE = null;
public static String SAVE_TRACE = null;
public static String OPEN_TRACE = null;
- public static String REPLAY = null;
- public static String REPLAY_EDIT = null;
public static String COOLBAR_AREA_FILE_TOOLTIP = null;
public static String COOLBAR_AREA_SUMMARY_TOOLTIP = null;
public static String COOLBAR_AREA_THREAD_TOOLTIP = null;
STOP_TRACE = AnalyzerLabels.STOP_TRACE_MAC;
SAVE_TRACE = AnalyzerLabels.SAVE_TRACE_MAC;
OPEN_TRACE = AnalyzerLabels.OPEN_TRACE_MAC;
- REPLAY = AnalyzerLabels.REPLAY_MAC;
- REPLAY_EDIT = AnalyzerLabels.REPLAY_EDIT_MAC;
COOLBAR_AREA_FILE_TOOLTIP = AnalyzerLabels.COOLBAR_AREA_FILE_TOOLTIP_MAC;
COOLBAR_AREA_SUMMARY_TOOLTIP = AnalyzerLabels.COOLBAR_AREA_SUMMARY_TOOLTIP_MAC;
COOLBAR_AREA_THREAD_TOOLTIP = AnalyzerLabels.COOLBAR_AREA_THREAD_TOOLTIP_MAC;
STOP_TRACE = AnalyzerLabels.STOP_TRACE;
SAVE_TRACE = AnalyzerLabels.SAVE_TRACE;
OPEN_TRACE = AnalyzerLabels.OPEN_TRACE;
- REPLAY = AnalyzerLabels.REPLAY;
- REPLAY_EDIT = AnalyzerLabels.REPLAY_EDIT;
COOLBAR_AREA_FILE_TOOLTIP = AnalyzerLabels.COOLBAR_AREA_FILE_TOOLTIP;
COOLBAR_AREA_SUMMARY_TOOLTIP = AnalyzerLabels.COOLBAR_AREA_SUMMARY_TOOLTIP;
COOLBAR_AREA_THREAD_TOOLTIP = AnalyzerLabels.COOLBAR_AREA_THREAD_TOOLTIP;
throw new InterruptedIOException();
}
- // check if stop ack arrived
- if (AnalyzerManager.isStopAckArrived()) {
+ // check if stop ack arrived and if LSan is not initialized
+ if (AnalyzerManager.isStopAckArrived() && !Global.isLSanInitialized()) {
if (stopControlChannel) {
throw new EndOfTraceException();
} else {
Set<PageDataManager> managers = PageInfoRegistry
.getUnregisteredDataManagers(pageName, dataManagers);
for (PageDataManager mgr : managers) {
- Logger.debug("Registering data manager: " + mgr.getName());
registerPageDataManager(mgr);
}
}
*/
package org.tizen.dynamicanalyzer.swap.logparser;
+import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Timer;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.DAResult;
import org.tizen.dynamicanalyzer.common.Global;
+import org.tizen.dynamicanalyzer.common.path.PathManager;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.control.DataThread;
import org.tizen.dynamicanalyzer.project.BinaryInfo;
import org.tizen.dynamicanalyzer.project.LibraryObject;
import org.tizen.dynamicanalyzer.project.Project;
import org.tizen.dynamicanalyzer.protocol.DebugLog;
import org.tizen.dynamicanalyzer.protocol.ProtocolConstants;
+import org.tizen.dynamicanalyzer.swap.model.data.LSanData;
import org.tizen.dynamicanalyzer.swap.model.data.LogData;
import org.tizen.dynamicanalyzer.swap.model.data.MemoryMapData;
import org.tizen.dynamicanalyzer.swap.model.data.ProcessAddInfoData;
import org.tizen.dynamicanalyzer.swap.model.data.ProcessInfoData;
+import org.tizen.dynamicanalyzer.ui.memory.data.HeapDataManager;
import org.tizen.dynamicanalyzer.ui.thread.data.ThreadDataManager;
import org.tizen.dynamicanalyzer.util.Logger;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
public class MessageParser extends DataThread<LogData> {
private static MessageParser instance = new MessageParser();
case ProtocolConstants.MSG_DATA_IMAGE:
// process image message
break;
+ case ProtocolConstants.MSG_LSAN:
+ AnalyzerUtil.getLSanLock().lock();
+ try {
+ processLSanMessage(log);
+ } finally {
+ AnalyzerUtil.getLSanLock().unlock();
+ }
+ break;
default:
if (msgID != ProtocolConstants.MSG_UNKNOWN) {
if (AnalyzerManager.isProcessInfoArrived()) {
return bret;
}
+ /**
+ * Processes MSG_PROBE_LSAN type of messages.
+ *
+ * @param log message data in form of {@link LSanData}
+ */
+ private void processLSanMessage(LogData log) {
+ LSanData data = (LSanData) log;
+
+ switch (data.getStatus()) {
+ case INITIALIZED:
+ if (Global.isLSanInitialized()) {
+ Logger.warning("LeakSanitizer is already initialized");
+ return;
+ }
+
+ Global.setLSanInitialized(true);
+ break;
+
+ case REPORT:
+ // Signal to StopTraceManager that report message was received
+ AnalyzerUtil.getLSanCondition().signal();
+
+ if (!Global.isLSanInitialized()) {
+ Logger.error("LeakSanitizer is not initialized");
+ return;
+ }
+
+ Global.setLSanInitialized(false);
+
+ // Get filepath
+ String source = data.getData();
+ if (source.isEmpty()) {
+ Logger.warning("Empty LeakSanitizer report file path: nothing to parse");
+ return;
+ }
+
+ // Construct path for local file
+ String destination;
+ int index = source.lastIndexOf('/') + 1;
+ if (index > 0 && index < source.length())
+ destination = PathManager.DA_TEMP_FOLDER_PATH + File.separator + source.substring(index);
+ else
+ destination = PathManager.DA_TEMP_FOLDER_PATH + File.separator + source;
+
+ // Pull LSan report file
+ DAResult result = DACommunicator.pull(source, destination);
+ if (!result.isSuccess()) {
+ Logger.error("Failed to pull LeakSanitizer report file: " + source);
+ return;
+ }
+
+ Logger.debug("Pulled LeakSanitizer report file: " + source);
+
+ // Pass pulled file to HeapDataManager
+ HeapDataManager.getInstance().parseReportFile(destination);
+ break;
+
+ case ERROR:
+ Logger.error("LeakSanitizer has exited with error: " + data.getData());
+ break;
+ }
+ }
+
private void processProcessInfo(LogData plog) {
Project project = Global.getProject();
ProcessInfoData log = (ProcessInfoData) plog;
--- /dev/null
+package org.tizen.dynamicanalyzer.swap.model.data;
+
+import org.tizen.dynamicanalyzer.model.DATime;
+
+/**
+ * Protocol 4.1: Data message from LeakSanitizer.
+ */
+public class LSanData extends LogData {
+ private LSanStatus status;
+ private int pid;
+ private String data;
+
+ /**
+ * Enum representing possible status values sent by LeakSanitizer.
+ */
+ public enum LSanStatus {
+ ERROR(0), // Error has occurred during LSan analysis
+ REPORT(2), // LeakSanitizer report information was sent
+ INITIALIZED(5); // LeakSanitized is initialized
+
+ private final int status;
+
+ private LSanStatus(int status) {
+ this.status = status;
+ }
+
+ /**
+ * Gets status {@code int} representation.
+ *
+ * @return {@code int} value of status
+ */
+ public int getStatus() {
+ return status;
+ }
+
+ /**
+ * Parses given {@code int} value as {@code LSanStatus}.
+ *
+ * @param status value to parse
+ * @return corresponding {@link LSanStatus} value on success and
+ * {@code null} otherwise
+ */
+ public static LSanStatus parse(int status) {
+ for (LSanStatus value : LSanStatus.values())
+ if (status == value.getStatus())
+ return value;
+
+ return null;
+ }
+ }
+
+ @Override
+ public LSanData clone() throws CloneNotSupportedException {
+ throw new CloneNotSupportedException();
+ }
+
+ @Override
+ protected boolean parse(DATime startTime) {
+ super.parse(startTime);
+
+ int statusVal = getInt();
+
+ status = LSanStatus.parse(statusVal);
+ if (status != null) {
+ pid = getInt();
+ data = parseArgs();
+ } else {
+ status = LSanStatus.ERROR;
+ data = String.format("Not recognized LeakSanitizer status: %d(0b%s)", statusVal,
+ Integer.toBinaryString(statusVal));
+ }
+
+ return true;
+ }
+
+ public LSanStatus getStatus() {
+ return status;
+ }
+
+ public int getPid() {
+ return pid;
+ }
+
+ public String getData() {
+ return data;
+ }
+}
case ProtocolConstants.MSG_UI_HIERARCHY: // protocol 4.0
output = new UIHierarchyData();
break;
+ case ProtocolConstants.MSG_LSAN: // protocol 4.1
+ output = new LSanData();
+ break;
default: // unknown message
Logger.error("Unknown message ID(%d)", msgID);
break;
case ProtocolConstants.MSG_FILE_FUNCTION_EXIT: // protocol 4.0
formatName = "FileUsage";
break;
+ case ProtocolConstants.MSG_LSAN: // protocol 4.1
+ formatName = "LeakSanitizer";
+ break;
default:
break;
}
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.path.PathManager;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
-import org.tizen.dynamicanalyzer.setting.SettingDataManager;
import org.tizen.dynamicanalyzer.util.FileUtil;
import org.tizen.dynamicanalyzer.util.Logger;
import org.tizen.dynamicanalyzer.utils.RpmUtil;
// private Map<String, BinaryInfo> targetBinaryInfoMap = new HashMap<String,
// BinaryInfo>();
- private String debugRoot = PathManager.getRootstrapsPath(SettingDataManager.INSTANCE
- .getPlatform());
-
public static synchronized BinarySettingManager getInstance() {
if (null == instance) {
instance = new BinarySettingManager();
return Collections.unmodifiableList(targetBinaryList);
}
- public String getDebugRoot() {
- return debugRoot;
- }
-
- public void setDebugRoot(String debugRoot) {
- this.debugRoot = debugRoot;
- }
-
public void saveData(BufferedWriter writer) {
int size = targetBinaryList.size();
for (int i = 0; i < size; i++) {
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Jaewon Lim <jaewon81.lim@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Contributors:
- * - S-Core Co., Ltd
- *
- */
-
-package org.tizen.dynamicanalyzer.swap.platform.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.swt.widgets.Display;
-import org.tizen.dynamicanalyzer.common.DAResult;
-import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode;
-import org.tizen.dynamicanalyzer.common.Global;
-import org.tizen.dynamicanalyzer.communicator.DACommunicator;
-import org.tizen.dynamicanalyzer.communicator.UnsupportedProtocolException;
-import org.tizen.dynamicanalyzer.handlers.UIActionHolder;
-import org.tizen.dynamicanalyzer.project.BinaryInfo;
-import org.tizen.dynamicanalyzer.project.DeviceStatusInfo;
-import org.tizen.dynamicanalyzer.swap.platform.BinarySettingData;
-import org.tizen.dynamicanalyzer.swap.platform.BinarySettingManager;
-import org.tizen.dynamicanalyzer.ui.toolbar.setting.SettingDialogBinarySettingsPage;
-import org.tizen.dynamicanalyzer.util.Logger;
-import org.tizen.sdblib.service.FileEntry;
-
-public class BinarySettingProcessor implements Runnable {
- private static final int TYPE_ADD = 1;
- private static final int TYPE_LOAD = 2;
- private static final int TYPE_UPDATE = 3;
-
- private static Thread binaryThread = null;
-
- private static Object result = null;
- private static SettingDialogBinarySettingsPage page = null;
-
- private static int type = TYPE_ADD;
-
- public static void runAddThread(Object input, SettingDialogBinarySettingsPage inputPage) {
- page = inputPage;
- result = input;
- type = TYPE_ADD;
- binaryThread = new Thread(null, new BinarySettingProcessor(), "Binary add thread");
- binaryThread.start();
- }
-
- public static void runLoadingThread(SettingDialogBinarySettingsPage inputPage) {
- page = inputPage;
- type = TYPE_LOAD;
- binaryThread = new Thread(null, new BinarySettingProcessor(), "Binary loading thread");
- binaryThread.start();
- }
-
- public static void runUpdateDebugRoot(SettingDialogBinarySettingsPage inputPage) {
- page = inputPage;
- type = TYPE_UPDATE;
- binaryThread = new Thread(null, new BinarySettingProcessor(), "update debug root thread");
- binaryThread.start();
- }
-
- public static void stopThread() {
- if (null != binaryThread && binaryThread.isAlive()) {
- binaryThread.interrupt();
- }
- }
-
- public static void clear() {
- stopThread();
- result = null;
- }
-
- @Override
- public void run() {
- if (type == TYPE_ADD) {
- @SuppressWarnings("unchecked")
- List<FileEntry> entries = (List<FileEntry>) result;
-
- List<String> binPaths = new ArrayList<String>();
- for (FileEntry entry : entries) {
- if (entry.isDirectory() || entry.isRoot()) {
- continue;
- }
-
- binPaths.add(entry.getFullPath());
- }
- BinarySettingProgressManager.getInstance().setValue(5);
-
- // get binary info
- DAResult result = new DAResult(ErrorCode.ERR_BIN_INFO_GET_FAIL);
- if (binPaths.size() > 0) {
- try {
- result = DACommunicator.getBinaryInformation(binPaths);
- } catch (InterruptedException e) {
- Logger.warning("Interrupted during get binary info");
- } catch (UnsupportedProtocolException e) {
- Logger.warning("Getting binary info is not supported by communicator");
- }
-
- if (!result.isSuccess()) {
- UIActionHolder.getUIAction().showWarning(result);
- }
- }
- BinarySettingProgressManager.getInstance().setValue(50);
-
- // make binary setting data
- List<String> addBinPaths = new ArrayList<String>();
- List<BinarySettingData> addBinData = new ArrayList<BinarySettingData>();
- if (result.isSuccess()) {
- DeviceStatusInfo sinfo = Global.getCurrentDeviceInfo().getDeviceStatusInfo();
- for (String path : binPaths) {
- BinaryInfo bininfo = sinfo.getBinaryInfo(path);
- if (bininfo != null && bininfo.getTempBinaryPath() != null) {
- BinarySettingData binaryData = new BinarySettingData();
- binaryData.setBinaryPath(path);
- binaryData.setDebugRpmPath(BinarySettingManager.getInstance()
- .getDebugRpmPath(path, page.getDebugRootPath()));
- addBinPaths.add(path);
- addBinData.add(binaryData);
- }
- }
- }
- BinarySettingProgressManager.getInstance().setValue(60);
-
- if (addBinData.size() > 0) {
- BinarySettingManager.getInstance().addBinarySettingData(addBinData);
- BinarySettingProgressManager.getInstance().setValue(70);
-
- BinarySettingManager.getInstance().checkSourcePath(addBinData);
- BinarySettingProgressManager.getInstance().setValue(80);
-
- try {
- DACommunicator.addInstrumentation(addBinPaths);
- } catch (InterruptedException e) {
- Logger.warning("Interrupted during send add instrumetation message");
- } catch (UnsupportedProtocolException e) {
- Logger.warning("Message to add instrumentation is not supported by communicator");
- }
- BinarySettingProgressManager.getInstance().setValue(90);
-
- Display.getDefault().syncExec(new Runnable() {
- @Override
- public void run() {
- page.initInputRows();
- }
- });
- }
- BinarySettingProgressManager.getInstance().setValue(100);
- } else if (type == TYPE_LOAD) {
- BinarySettingProgressManager.getInstance().setValue(30);
- List<BinarySettingData> binarySettings = BinarySettingManager.getInstance()
- .getBinarySettingList();
- BinarySettingProgressManager.getInstance().setValue(50);
-
- List<String> paths = new ArrayList<String>();
- for (BinarySettingData data : binarySettings) {
- paths.add(data.getBinaryPath());
- }
-
- if (paths.size() > 0) {
- DAResult result = new DAResult(ErrorCode.ERR_BIN_INFO_GET_FAIL);
- try {
- result = DACommunicator.getBinaryInformation(paths);
- } catch (InterruptedException e) {
- Logger.warning("Interrupted during get binary info");
- } catch (UnsupportedProtocolException e) {
- Logger.warning("Getting binary info is not supported by communicator");
- }
-
- if (!result.isSuccess()) {
- UIActionHolder.getUIAction().showWarning(result);
- }
- }
-
- DeviceStatusInfo sinfo = Global.getCurrentDeviceInfo().getDeviceStatusInfo();
- for (String path : paths) {
- BinaryInfo bininfo = sinfo.getBinaryInfo(path);
- if (bininfo == null || bininfo.getTempBinaryPath() == null) {
- BinarySettingManager.getInstance().removeBinarySettingData(path);
- }
- }
-
- BinarySettingProgressManager.getInstance().setValue(80);
-
- paths.clear(); // reuse array list
- List<BinarySettingData> binDatas = BinarySettingManager.getInstance()
- .getBinarySettingList();
- for (BinarySettingData data : binDatas) {
- paths.add(data.getBinaryPath());
- }
-
- try {
- DACommunicator.addInstrumentation(paths);
- } catch (InterruptedException e) {
- Logger.warning("Interrupted during send add instrumentation message");
- } catch (UnsupportedProtocolException e) {
- Logger.warning("Message to add instrumentation is not supported by communicator");
- }
- BinarySettingProgressManager.getInstance().setValue(95);
-
- Display.getDefault().syncExec(new Runnable() {
- @Override
- public void run() {
- page.updateLayout();
- }
- });
- } else {
- BinarySettingProgressManager.getInstance().setValue(30);
- List<BinarySettingData> binarySettings = BinarySettingManager.getInstance()
- .getBinarySettingList();
- BinarySettingProgressManager.getInstance().setValue(40);
- int count = 41;
- for (BinarySettingData binData : binarySettings) {
- if (count < 90) {
- BinarySettingProgressManager.getInstance().setValue(count++);
- }
- if (null == binData.getDebugRpmPath() || binData.getDebugRpmPath().isEmpty()) {
- String debugPath = BinarySettingManager.getInstance().getDebugRpmPath(
- binData.getBinaryPath(), page.getDebugRootPath());
- binData.setDebugRpmPath(debugPath);
- }
- }
- BinarySettingProgressManager.getInstance().setValue(50);
- BinarySettingManager.getInstance().checkSourcePath(binarySettings);
- BinarySettingProgressManager.getInstance().setValue(70);
-
- Display.getDefault().syncExec(new Runnable() {
- @Override
- public void run() {
- page.initInputRows();
- }
- });
- BinarySettingProgressManager.getInstance().setValue(95);
- }
- BinarySettingProgressManager.getInstance().stopProgress();
- }
-}
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;\r
import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;\r
import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardManager;\r
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;\r
+import org.tizen.dynamicanalyzer.widgets.da.view.DAContainerComposite;\r
import org.tizen.dynamicanalyzer.widgets.scale.DAScale;\r
\r
public class TimeLineChartKeyListener extends KeyAdapter implements KeyListener{\r
Display.getDefault().syncExec(new Runnable() {\r
@Override\r
public void run() {\r
- DAPageComposite page = AnalyzerManager.getCurrentPage();\r
+ DAContainerComposite page = AnalyzerManager.getCurrentPage();\r
page.updateView();\r
}\r
});\r
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Jaewon Lim <jaewon81.lim@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.common.explorer;
-
-import java.util.HashMap;
-
-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.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.tizen.dynamicanalyzer.common.Global;
-import org.tizen.dynamicanalyzer.communicator.DeviceInfo;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.resources.FontResources;
-import org.tizen.dynamicanalyzer.ui.widgets.DAGrid;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DATableEmptyCellRenderer;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DATableHeaderRenderer;
-import org.tizen.sdblib.IDevice;
-import org.tizen.sdblib.service.FileEntry;
-import org.tizen.sdblib.service.FileEntryType;
-
-public class DAFileTreeExplorer extends Composite {
- protected Grid table;
- private HashMap<String, Boolean> checkedChild = new HashMap<String, Boolean>();
-
- public DAFileTreeExplorer(Composite parent) {
- super(parent, SWT.NONE);
- this.setLayout(new FillLayout());
- table = new DAGrid(this, SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL
- | SWT.H_SCROLL);
- table.setLinesVisible(false);
- table.setBackground(ColorResources.TABLE_CONTENTS_NORMAL);
- table.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
- table.setFont(FontResources.TABLE_CELL_FONT);
- setColumns();
- table.setEmptyCellRenderer(new DATableEmptyCellRenderer());
-
- table.setItemHeight(18);
-
- table.addListener(SWT.Expand, new Listener() {
-
- @Override
- public void handleEvent(Event event) {
- GridItem item = (GridItem) event.item;
- FileEntry entry = (FileEntry) item.getData();
- if (entry == null) {
- return;
- }
- String path = entry.getFullPath();
- if (null == checkedChild.get(path)) {
- FileEntry[] children = entry.getChildren();
- if (children.length > 0) {
- for (int i = 0; i < children.length; i++) {
- FileEntry child = children[i];
- if (child.getType() != FileEntryType.Link
- && child.getType() != FileEntryType.DirectoryLink) {
- GridItem childItem = new GridItem(item,
- SWT.NONE);
- childItem.setText(child.getName());
- childItem.setData(child);
- }
- }
- }
- checkedChild.put(path, true);
- // table.update();
- }
- }
- });
-
- table.addListener(SWT.Collapse, new Listener() {
- @Override
- public void handleEvent(Event event) {
- GridItem item = (GridItem) event.item;
- item.hasChildren();
- // TODO : remove children
- }
- });
- }
-
- public void setColumns() {
- GridColumn column = new GridColumn(table, SWT.NONE);
- column.setCellRenderer(new DAFileTreeExplorerRenderer());
- column.setHeaderRenderer(new DATableHeaderRenderer());
- column.setText("Node");
- column.setWidth(500);
- column.setTree(true);
- }
-
- public void makeTree() {
- DeviceInfo selectedDevice = Global.getCurrentDeviceInfo();
- if (null == selectedDevice) {
- return;
- }
- IDevice device = Global.getCurrentDeviceInfo().getIDevice();
-
- FileEntry root = device.getRoot();
- GridItem item = new GridItem(table, SWT.NONE);
-
- String name = getDeviceSerialWithName(root);
- item.setText(name);
- item.setData(root);
- table.update();
- }
-
- public static String getDeviceSerialWithName(FileEntry entry) {
- return combineSerialWithName(entry.getDevice().getSerialNumber(), entry
- .getDevice().getDeviceName());
- }
-
- private static String combineSerialWithName(String serial, String name) {
- return String.format("%s (%s)", serial, name);
- }
-
- public FileEntry getSelection() {
- GridItem[] selections = table.getSelection();
- if (selections.length > 0) {
- GridItem selection = selections[0];
- FileEntry entry = (FileEntry) selection.getData();
- if (!entry.isDirectory() && !entry.isRoot()) {
- return entry;
- } else {
- return null;
- }
- } else {
- return null;
- }
- }
-
- public Grid getTree() {
- return table;
- }
-}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Jaewon Lim <jaewon81.lim@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.common.explorer;
-
-import org.eclipse.nebula.widgets.grid.GridItem;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DATableCellRenderer;
-import org.tizen.sdblib.service.FileEntry;
-
-public class DAFileTreeExplorerRenderer extends DATableCellRenderer {
- @Override
- public void setTree(boolean tree) {
- super.setTree(tree);
-
- if (tree) {
- toggleRenderer = new DAFileTreeExplorerToggleRenderer();
- toggleRenderer.setDisplay(getDisplay());
- }
- }
-
- @Override
- protected boolean hasChildren(GridItem item) {
- FileEntry entry = (FileEntry) item.getData();
- boolean ret = false;
- if (entry != null && entry.getChildren().length > 0) {
- FileEntry[] children = entry.getChildren();
- for (FileEntry child : children) {
- switch (child.getType()) {
- case File:
- case Directory:
- case RootEmulator:
- case RootDevice:
- ret = true;
- break;
- default:
- } // switch
- if (ret) {
- break;
- }
- }
- }
- return ret;
- }
-}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Jaewon Lim <jaewon81.lim@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.common.explorer;
-
-import org.eclipse.nebula.widgets.grid.GridItem;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.resources.FontResources;
-import org.tizen.dynamicanalyzer.resources.ImageResources;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DATableToggleRenderer;
-import org.tizen.sdblib.service.FileEntry;
-
-public class DAFileTreeExplorerToggleRenderer extends DATableToggleRenderer {
-
- public void paint(GC gc, Object value) {
- GridItem item = (GridItem) value;
-
- Font font = item.getFont(0);
- if (null == font) {
- gc.setFont(FontResources.TABLE_CELL_FONT);
- } else {
- gc.setFont(font);
- }
-
- String text = item.getText();
- FileEntry entry = (FileEntry) item.getData();
- Image icon = getIcon(entry);
-
- if (hasChildren(entry)) {
- 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;
-
- r = icon.getBounds();
- gc.drawImage(icon, x, getBounds().y);
- x += r.width + 1;
-
- if (isSelected()) {
- gc.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_FONT_COLOR);
- } else {
- gc.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
- }
- gc.drawText(text, x, getBounds().y + 2, 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;
-
- r = icon.getBounds();
- gc.drawImage(icon, x, getBounds().y);
- x += r.width + 1;
-
- if (isSelected()) {
- gc.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_FONT_COLOR);
- } else {
- gc.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
- }
- gc.drawText(text, x, getBounds().y + 2, true);
- }
- } else {
- Rectangle r = ImageResources.TREE_OPEN.getBounds();
- int offset = (getBounds().width - r.width) / 2;
- int x = getBounds().x + offset;
- x += r.width + 5;
-
- r = icon.getBounds();
- gc.drawImage(icon, x, getBounds().y);
- x += r.width + 1;
-
- 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);
- }
- }
-
- private Image getIcon(FileEntry entry) {
-
- switch (entry.getType()) {
- case File:
- return ImageResources.ICON_FILE;
- case Link:
- return ImageResources.ICON_FILE_LINK;
- case Directory:
- return ImageResources.ICON_DIR;
- case DirectoryLink:
- return ImageResources.ICON_DIR_LINK;
- case RootEmulator:
- return ImageResources.ICON_EMULATOR;
- case RootDevice:
- return ImageResources.ICON_DEVICE;
- default:
- return ImageResources.ICON_OTHER;
- }
- }
-
- private boolean hasChildren(FileEntry entry) {
- if (entry != null && entry.getChildren().length > 0) {
- switch (entry.getType()) {
- case File:
- return false;
- case Link:
- return false;
- case Directory:
- return true;
- case DirectoryLink:
- return false;
- case RootEmulator:
- return true;
- case RootDevice:
- return true;
- default:
- return false;
- }
- }
- return false;
- }
-}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Jaewon Lim <jaewon81.lim@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.common.explorer;
-
-import org.eclipse.nebula.widgets.grid.Grid;
-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.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Shell;
-import org.tizen.dynamicanalyzer.nl.WidgetLabels;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
-import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
-import org.tizen.dynamicanalyzer.widgets.da.base.DAButton;
-import org.tizen.dynamicanalyzer.widgets.da.base.DAMessageBox;
-import org.tizen.sdblib.service.FileEntry;
-
-public class FileTreeExplorerDialog extends DAMessageBox {
- private DAFileTreeExplorer explorerTree = null;
- private DACustomButton okButton = null;
- private DACustomButton cancelButton = null;
-
- public FileTreeExplorerDialog(Shell parentShell) {
- super(parentShell);
- shell.setLayout(new FormLayout());
- shell.setSize(500, 600);
- shell.setBackground(ColorResources.DIALOG_BG_UPPER);
- shell.setText("Select binary");
-
- explorerTree = new DAFileTreeExplorer(shell);
- FormData data = new FormData();
- data.top = new FormAttachment(0, 15);
- data.left = new FormAttachment(0, 20);
- data.height = 510;
- data.width = 460;
- explorerTree.setLayoutData(data);
- explorerTree.makeTree();
-
- cancelButton = new DAButton(shell, SWT.NONE);
- data = new FormData();
- data.top = new FormAttachment(explorerTree, 10);
- data.right = new FormAttachment(100, -15);
- data.height = 25;
- data.width = 100;
- cancelButton.setLayoutData(data);
- cancelButton.setText(WidgetLabels.CANCEL);
- cancelButton.addClickListener(new DACustomButtonClickEventListener() {
-
- @Override
- public void handleClickEvent(DACustomButton button) {
- shell.dispose();
- }
- });
-
- okButton = new DAButton(shell, SWT.NONE);
- data = new FormData();
- data.top = new FormAttachment(explorerTree, 10);
- data.right = new FormAttachment(cancelButton, -5);
- data.height = 25;
- data.width = 100;
- okButton.setLayoutData(data);
- okButton.setText(WidgetLabels.OK);
- okButton.addClickListener(new DACustomButtonClickEventListener() {
-
- @Override
- public void handleClickEvent(DACustomButton button) {
- setResult(explorerTree.getSelection());
- shell.dispose();
- }
- });
-
- explorerTree.getTree().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) {
- Grid table = (Grid) e.widget;
- GridItem[] items = (GridItem[]) table.getSelection();
- if (null == items || items.length == 0) {
- return;
- }
- GridItem item = items[0];
- FileEntry entry = (FileEntry) item.getData();
-
- if (entry.isDirectory() || entry.isRoot()) {
- if (item.isExpanded()) {
- item.fireEvent(SWT.Collapse);
- } else {
- item.fireEvent(SWT.Expand);
- }
- } else {
- setResult(entry);
- shell.dispose();
- }
-
- }
- });
- }
-
-}
import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
import org.tizen.dynamicanalyzer.ui.toolbar.Toolbar;
import org.tizen.dynamicanalyzer.ui.widgets.DAAdvancedViewComposite;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
public class FileApiListView extends DAAdvancedViewComposite {
tableComp.setColumns(columnNames);
tableComp.setColumnSize(columnSizes);
tableComp.setTableName(FilePageLabels.FILE_API_LIST_VIEW_TITLE);
- contents.addControlListener(new TableColumnSizePackListener(tableComp,
- columnSizes));
setTable(tableComp);
}
package org.tizen.dynamicanalyzer.ui.file;
-import java.util.Map;
-
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.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Sash;
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.setting.SettingDataManager;
import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
-import org.tizen.dynamicanalyzer.swap.logparser.DataManagerRegistry;
import org.tizen.dynamicanalyzer.ui.file.manager.FileDataManager;
-import org.tizen.dynamicanalyzer.ui.page.BaseView;
-import org.tizen.dynamicanalyzer.ui.page.PageInfoRegistry;
-import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineTableView;
-import org.tizen.dynamicanalyzer.util.Logger;
-import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
-import org.tizen.dynamicanalyzer.widgets.da.view.DABaseComposite;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DABaseDataPageComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DATabComposite;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
-public class FilePage extends DAPageComposite {
+public class FilePage extends DABaseDataPageComposite {
// page and view IDs
public static final String pageID = FilePage.class.getName();
public static final String chartViewID = FileChartView.class.getName();
public static final String apilistViewID = FileApiListView.class.getName();
public static final String detailViewID = FileDetailInfoView.class.getName();
- SashForm baseForm;
- SashForm topForm;
- SashForm bottomForm;
-
private DATabComposite fileAPITableView = null;
private DATabComposite fileDetailTableView = null;
-
- boolean isDetailMode = true;
-
- int tableHeight = -1;
- int tableWeight = 65;
-
- boolean wasSashCreated = false;
public FilePage(Composite parent, int style) {
super(parent, style);
setTitle(AnalyzerLabels.COOLBAR_AREA_FILE);
- this.setData(DAPageComposite.KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_FILE_TOOLTIP);
+ this.setData(KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_FILE_TOOLTIP);
this.setBackground(ColorResources.WHITE);
this.setLayout(new FillLayout());
- baseForm = new SashForm(this, SWT.VERTICAL);
- baseForm.setLayout(new FillLayout());
- baseForm.setForeground(ColorResources.WHITE);
- baseForm.setBackground(ColorResources.WHITE);
// ((FillLayout) getLayout()).marginHeight = 0;
// ((FillLayout) getLayout()).marginWidth = 0;
- topForm = new SashForm(baseForm, SWT.VERTICAL);
FileChartView fileChartView = new FileChartView(topForm, SWT.NONE);
addView(fileChartView);
- bottomForm = new SashForm(baseForm, SWT.HORIZONTAL);
-
- SashForm bottomLeftForm = new SashForm(bottomForm, SWT.NONE);
- bottomLeftForm.setForeground(ColorResources.TAB_SELECTED_COLOR_START);
- bottomLeftForm.setLayout(new FillLayout());
-
- SashForm bottomRightForm = new SashForm(bottomForm, SWT.NONE);
- bottomRightForm.setForeground(ColorResources.TAB_SELECTED_COLOR_START);
- bottomRightForm.setLayout(new FillLayout());
-
fileAPITableView = new DATabComposite(bottomLeftForm, SWT.NONE, false, true);
{
FileApiListView fileApiListView = new FileApiListView(fileAPITableView.getContentComposite(), SWT.NONE);
addView(fileDetailInfoView);
}
addView(fileDetailTableView);
-
- topForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- bottomForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- bottomLeftForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- bottomRightForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
-
- bottomForm.setWeights(new int[] { tableWeight, 100 - tableWeight });
-
- addTableWeightListener();
- }
-
- private void addHeightWeightListener() {
- if(baseForm.getChildren().length > 2) {
- ((Sash)baseForm.getChildren()[2]).addListener(SWT.MouseUp, new Listener() {
- @Override
- public void handleEvent(Event event) {
- tableHeight = (int)((double)baseForm.getWeights()[0] / baseForm.getWeights()[0] + baseForm.getWeights()[1]) * baseForm.getSize().y * 1/1000;
- }
- });
-
- wasSashCreated = true;
- }
- }
-
- private void addTableWeightListener() {
- ((SashForm)bottomForm.getChildren()[0]).addListener(SWT.Resize, new Listener(){
- @Override
- public void handleEvent(Event event) {
- resizeTableButton();
- }
- });
- }
-
-
- @Override
- public Composite getTopTable() {
- DAViewComposite view = (DAViewComposite)this.fileAPITableView.getTopComposite();
- Composite comp = (Composite)view.getControl();
- Logger.debug(comp.toString());
- return comp;
- }
-
- public SashForm getBaseForm() {
- return baseForm;
- }
-
- public void setDetailMode(boolean mode) {
- isDetailMode = mode;
}
@Override
- protected void onResized(int width, int height) {
- if(!wasSashCreated) { // This variable needs to check whether a Sash was created to calculate height ratio between chart area and table area
- addHeightWeightListener();
- }
-
- resizePageButton();
- resizeTableButton();
-
- if(!isDetailMode) {
- baseForm.setWeights(new int[] { 100, 0 });
- } else {
- int hrate = (tableHeight == -1) ? (int) (TimelineTableView.DEFAULT_TABLE_VIEW_HEIGHT * 100 / height) :
- (int) (tableHeight * 100 / height);
-
- if(hrate > 100) {
- return;
- }
-
- baseForm.setWeights(new int[] { 100 - hrate, hrate });
- }
- }
-
- private void resizePageButton() {
- int width = WorkbenchUtil.getWorkbenchWindow().getShell().getBounds().width;
- int pageCount = PageInfoRegistry.getPageNamesByTarget(SettingDataManager.INSTANCE.getConnectedTargetOrSelected().getTargetName()).size();
-
- int newWidth = (width/pageCount > DATabComposite.LONG_TAB_WIDTH) ? DATabComposite.LONG_TAB_WIDTH : width/pageCount;
- ((BaseView)WorkbenchUtil.getViewPart(BaseView.ID)).getMainTab().updateTabButtonsWidth(newWidth);
- }
-
- private void resizeTableButton() {
- double weight = (double) bottomForm.getWeights()[0] / 1000;
- int width = (int) (WorkbenchUtil.getWorkbenchWindow().getShell().getBounds().width * weight);
- int tabCount = fileAPITableView.getTabButtons().size();
-
- int newWidth = (width/tabCount > DATabComposite.LONG_TAB_WIDTH) ? DATabComposite.LONG_TAB_WIDTH : width/tabCount;
- fileAPITableView.updateTabButtonsWidth(newWidth);
- }
-
- @Override
public void clear() {
super.clear();
FileDataManager.getInstance().clear();
}
- @Override
- public void updateView() {
- for (Map.Entry<String, DABaseComposite> entry : childMap.entrySet()) {
- entry.getValue().updateView();
- }
- if(!isDetailMode) {
- if(baseForm.getChildren().length > 2) {
- ((Sash)baseForm.getChildren()[2]).setVisible(false);
- }
- } else {
- if(baseForm.getChildren().length > 2) {
- ((Sash)baseForm.getChildren()[2]).setVisible(true);
- }
- }
- }
+
}
import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
import org.tizen.dynamicanalyzer.nl.FilePageLabels;
import org.tizen.dynamicanalyzer.protocol.ProtocolConstants;
-import org.tizen.dynamicanalyzer.setting.Feature;
+import org.tizen.dynamicanalyzer.setting.FlatFeature;
import org.tizen.dynamicanalyzer.setting.SettingDataManager;
import org.tizen.dynamicanalyzer.setting.TargetData;
import org.tizen.dynamicanalyzer.swap.logparser.LogPackage;
// check if the inside call is set or not
TargetData target = SettingDataManager.INSTANCE.getConnectedTargetOrSelected();
- if (target.isSelectedFeature(Feature.INTERNAL_PROBE_FILE)) {
+ if (target.isSelectedFlatFeature(FlatFeature.FILE_ANALYSIS.getName())) {
isInculdeInsideCall = true;
}
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.ui.hierarchy.layout.HierarchyLayoutView;
import org.tizen.dynamicanalyzer.ui.hierarchy.properties.HierarchyPropertiesView;
import org.tizen.dynamicanalyzer.ui.hierarchy.tree.HierarchyTreeView;
import org.tizen.dynamicanalyzer.ui.hierarchy.tree.overview.HierarchyTreeOverView;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAContainerComposite;
-public class HierarchyPage extends DAPageComposite {
+public class HierarchyPage extends DAContainerComposite {
public static final String pageID = HierarchyPage.class.getName();
public static final String treeViewID = HierarchyTreeView.class.getName();
public static final String treeOverViewID = HierarchyTreeOverView.class.getName();
rightForm.setWeights(new int[] { 30, 70 });
baseForm.setWeights(new int[] { 75, 25 });
- baseForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- leftForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- rightForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
+ baseForm.setSashWidth(SASH_WIDTH);
+ leftForm.setSashWidth(SASH_WIDTH);
+ rightForm.setSashWidth(SASH_WIDTH);
}
@Override
import org.tizen.dynamicanalyzer.nl.UIHierarchyPageLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.ui.hierarchy.HierarchyViewCommunication;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
propertiesTable.setColumnVisibility(columnVisibility);
propertiesTable.setTableToolTipEnable(false);
propertiesTable.setTableName(UIHierarchyPageLabels.UIHIERARCHY_PROPERTIES_VIEW_TITLE);
- contents.addControlListener(new TableColumnSizePackListener(propertiesTable, columnSizes));
}
@Override
private String exportPath;
private ExportImageThread(IFigure treeView, String currentExportDir, String exportPath) {
+ super(ExportImageThread.class.getSimpleName());
+
this.treeView = treeView;
this.currentExportDir = currentExportDir;
this.exportPath = exportPath;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
import org.tizen.dynamicanalyzer.utils.Formatter;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
setColumns(columnNames);
setColumnSize(columnSizes);
setColumnVisibility(columnVisibility);
- parent.addControlListener(new TableColumnSizePackListener(
- this, columnSizes));
table.addSelectionListener(new SelectionListener() {
package org.tizen.dynamicanalyzer.ui.info.appStartup;
import java.util.Arrays;
-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.eclipse.swt.widgets.Label;
import org.tizen.dynamicanalyzer.common.DASelectionData;
import org.tizen.dynamicanalyzer.common.Global;
import org.tizen.dynamicanalyzer.nl.InformationViewLabels;
import org.tizen.dynamicanalyzer.nl.TimelinePageLabels;
import org.tizen.dynamicanalyzer.project.Project;
import org.tizen.dynamicanalyzer.protocol.Protocol;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.resources.FontResources;
import org.tizen.dynamicanalyzer.setting.FlatFeature;
import org.tizen.dynamicanalyzer.setting.SettingConstants;
import org.tizen.dynamicanalyzer.setting.SettingDataManager;
-import org.tizen.dynamicanalyzer.setting.TargetData;
import org.tizen.dynamicanalyzer.swap.logparser.DataManagerRegistry;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAHidableViewComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
-public class AppStartupView extends DAViewComposite {
- private final static List<Protocol> notSupportedVersions = Arrays
- .asList(new Protocol[] { Protocol.VERSION_30, Protocol.VERSION_30_UIHV, Protocol.VERSION_30A });
-
+public class AppStartupView extends DAHidableViewComposite {
private String[] observingViews = null;
- Composite contents = null;
// native and web table
private StackLayout stackLayout;
private AppStartupTable nativeTable = null;
private WebAppStartupTable webTable = null;
- /**
- * Stub to display when data is not collected.
- */
- private Label startUpNotSupportedLabel;
-
public AppStartupView(Composite parent, int style) {
- super(parent, style, false);
+ super(parent, style, false, "");
this.setLayout(new FillLayout());
setTitle(InformationViewLabels.APP_STARTUP_VIEW_TITLE);
- contents = getContentArea();
- contents.setBackground(ColorResources.TABLE_HEADER_BG);
stackLayout = new StackLayout();
- contents.setLayout(stackLayout);
+ Composite dataComp = new Composite(getContentArea(), SWT.NONE);
+ dataComp.setLayout(stackLayout);
+ setDataComposite(dataComp);
- nativeTable = new AppStartupTable(contents, SWT.NONE, SWT.MULTI
+ nativeTable = new AppStartupTable(dataComp, SWT.NONE, SWT.MULTI
| SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
- webTable = new WebAppStartupTable(contents, SWT.NONE, SWT.MULTI
+ webTable = new WebAppStartupTable(dataComp, SWT.NONE, SWT.MULTI
| SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
-
- // create stub label
- startUpNotSupportedLabel = new Label(contents,
- SWT.NONE | SWT.WRAP | SWT.BORDER);
- startUpNotSupportedLabel.setFont(FontResources.TABLE_HEADER_FONT);
- startUpNotSupportedLabel.setForeground(ColorResources.TABLE_HEADER_FONT_COLOR);
- startUpNotSupportedLabel.setAlignment(SWT.CENTER);
if (!hideIfNotSupported()) {
// select native or web table
} else {
stackLayout.topControl = nativeTable;
}
- contents.layout();
+ getContentArea().layout();
}
@Override
}
private boolean hideIfNotSupported() {
- boolean hide = false;
+ boolean hide = true;
+
+ if (isUIHVSelected())
+ setLabelText(TimelinePageLabels.APPSTARTUP_NOT_SUPPORTED_LABEL_UIHV);
+ else if (isNotSupportedProtocol())
+ setLabelText(TimelinePageLabels.APPSTARTUP_NOT_SUPPORTED_LABEL_TARGET);
+ else
+ hide = false;
+
+ hide(hide);
+ return hide;
+ }
+
+ /**
+ * Checks whether UIHV feature is selected.
+ *
+ * @return {@code true} if UIHV is selected
+ */
+ private boolean isUIHVSelected() {
// Check recently created/opened project
Project curProject = Global.getProject();
if (null != curProject && null != curProject.getPageTabList())
- hide = Arrays.asList(curProject.getPageTabList())
+ return Arrays.asList(curProject.getPageTabList())
.contains(SettingConstants.PAGE_NAME_HIERARCHY);
// If no project set yet - check current tracing settings
else
- hide = SettingDataManager.INSTANCE.getSelectedFlatFeatureSet()
- .contains(FlatFeature.UI_HIERARCHY_ANALYSIS);
-
- if (!hide) {
- // Check if Application Startup feature is not supported by protocol
- TargetData target = SettingDataManager.INSTANCE.getConnectedTargetOrNull();
- hide = target != null && notSupportedVersions.contains(target.getProtocolVersion());
-
- if (hide)
- startUpNotSupportedLabel
- .setText(TimelinePageLabels.APPSTARTUP_NOT_SUPPORTED_LABEL_TARGET + target.getTargetName());
- } else {
- startUpNotSupportedLabel.setText(TimelinePageLabels.APPSTARTUP_NOT_SUPPORTED_LABEL_UIHV);
- }
+ return SettingDataManager.INSTANCE
+ .isFlatFeatureSelected(FlatFeature.UI_HIERARCHY_ANALYSIS);
+ }
- stackLayout.topControl = hide ? startUpNotSupportedLabel : stackLayout.topControl;
- return hide;
+ /**
+ * Checks whether Application Startup feature is not supported by used
+ * protocol.
+ *
+ * @return {@code true} if feature is not supported
+ */
+ private boolean isNotSupportedProtocol() {
+ Protocol usedProtocol = Global.getCurrentProtocol();
+ return usedProtocol != null
+ && usedProtocol.getVersionNum() < Protocol.VERSION_41.getVersionNum();
}
-
+
@Override
public void clear() {
nativeTable.clear();
*/
package org.tizen.dynamicanalyzer.ui.info.appStartup;
+import static org.tizen.dynamicanalyzer.swap.model.data.WebAppStartupData.WSP_DRAW_BEGIN;
+import static org.tizen.dynamicanalyzer.swap.model.data.WebAppStartupData.WSP_DRAW_END;
import static org.tizen.dynamicanalyzer.swap.model.data.WebAppStartupData.WSP_RES_LOAD_BEGIN;
import static org.tizen.dynamicanalyzer.swap.model.data.WebAppStartupData.WSP_RES_LOAD_END;
-import static org.tizen.dynamicanalyzer.swap.model.data.WebAppStartupData.WSP_RES_PROC_BEGIN;
import static org.tizen.dynamicanalyzer.swap.model.data.WebAppStartupData.WSP_RES_PROCE_END;
-import static org.tizen.dynamicanalyzer.swap.model.data.WebAppStartupData.WSP_DRAW_BEGIN;
-import static org.tizen.dynamicanalyzer.swap.model.data.WebAppStartupData.WSP_DRAW_END;
+import static org.tizen.dynamicanalyzer.swap.model.data.WebAppStartupData.WSP_RES_PROC_BEGIN;
import java.util.ArrayList;
import java.util.HashMap;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
import org.tizen.dynamicanalyzer.util.Logger;
import org.tizen.dynamicanalyzer.utils.Formatter;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
setColumns(columnNames);
setColumnSize(columnSizes);
setColumnVisibility(columnVisibility);
- parent.addControlListener(new TableColumnSizePackListener(
- this, columnSizes));
table.addSelectionListener(new SelectionListener() {
if (!SettingDataManager.INSTANCE.getSelectedFlatFeatureSet().contains(FlatFeature.MEMORY_ALLOC))
{
// remove unnecessary callstackdata from memory
- if (SettingDataManager.INSTANCE.getOptionsPreferencesValue(FlatPreferences.FUNCTION_SAMPLING_RATE) > 0) {
+ if (SettingDataManager.INSTANCE.getPreferenceValue(FlatPreferences.FUNCTION_SAMPLING_RATE) > 0) {
// sample feature is on
long lastSampleSeq = FunctionUsageProfiler.getInstance().getLastSampleSeq();
if (lastSampleSeq != -1) {
import org.tizen.dynamicanalyzer.nl.InformationViewLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
callstackTableComp.setColumnSize(columnSizes);
callstackTableComp.setColumnVisibility(columnVisibility);
- contents.addControlListener(new TableColumnSizePackListener(callstackTableComp, columnSizes));
// setView(this);
}
public void updateView() {
failCount = SummaryDataManager.getInstance().getFailedApiDataMaker()
.getFailedApiDataFromDB(Toolbar.INSTANCE.getSelectedPid(), null).size();
- leakSize = AnalyzerManager.getNewLeakDetector().getLeakHash().size();
warningSize = AnalyzerManager.getWarningChecker().getWarningData().size();
columnValue.set(0, failCount);
columnValue.set(1, leakSize);
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.swap.logparser.DataManagerRegistry;
import org.tizen.dynamicanalyzer.ui.interactive.chart.InteractiveChartView;
import org.tizen.dynamicanalyzer.ui.interactive.data.InteractiveDataManager;
import org.tizen.dynamicanalyzer.ui.interactive.table.InteractiveTableView;
import org.tizen.dynamicanalyzer.ui.timeline.calltrace.CallTraceView;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineTableView;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAContainerComposite;
-public class InteractivePage extends DAPageComposite {
+public class InteractivePage extends DAContainerComposite {
public static final String pageID = InteractivePage.class.getName();
public static final String chartViewID = InteractiveChartView.class.getName();
public static final String listViewID = InteractiveTableView.class.getName();
rightForm.setWeights(new int[] { 50, 50 });
baseForm.setWeights(new int[] { 75, 25 });
- baseForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- leftForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- rightForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
+ baseForm.setSashWidth(SASH_WIDTH);
+ leftForm.setSashWidth(SASH_WIDTH);
+ rightForm.setSashWidth(SASH_WIDTH);
DataManagerRegistry.registerPageDataManager(InteractiveDataManager.getInstance());
}
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Rectangle;
import org.tizen.dynamicanalyzer.nl.InteractivePageLabels;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotTooltip;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartRenderer;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem;
import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
import org.tizen.dynamicanalyzer.widgets.helper.FontResources;
-import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
public class InteractiveChartRenderer extends DAChartRenderer {
private final int SERIES_DISTANCE_MARGIN = 20;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.ui.interactive.model.InteractiveInfo;
import org.tizen.dynamicanalyzer.ui.widgets.DAAdvancedViewComposite;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
public class InteractiveTableView extends DAAdvancedViewComposite {
treeComp.setColumnSize(columnSizes);
treeComp.setColumnVisibility(columnVisibility);
treeComp.setTableToolTipEnable(false);
- contents.addControlListener(new TableColumnSizePackListener(treeComp,
- columnSizes));
setTable(treeComp);
}
import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
import org.tizen.dynamicanalyzer.ui.kernel.data.KernelDataManager;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineTableView;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAContainerComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DATabComposite;
-public class KernelPage extends DAPageComposite {
+public class KernelPage extends DAContainerComposite {
public static final String pageID = KernelPage.class.getName();
public static final String contextViewID = ContextSwitchingChartView.class.getName();
public static final String callflowTabID = "CallFlowTab.id";
super(parent, style);
setTitle(AnalyzerLabels.COOLBAR_AREA_KERNEL);
- this.setData(DAPageComposite.KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_KERNEL_TOOLTIP);
+ this.setData(DAContainerComposite.KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_KERNEL_TOOLTIP);
this.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
this.setLayout(new FillLayout());
this.setFont(FontResources.TABLE_HEADER_FONT);
memoryTable = new MemoryStatisticsTable(this, SWT.NONE, SWT.MULTI
- | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
+ | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL);
- memoryTable.setColumnVisibilityState(true);
memoryTable.setDefaultExpansionState(false);
this.marginHeight = TOP_MARGIN_HEIGHT;
import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackInserter;
import org.tizen.dynamicanalyzer.ui.memory.table.MemoryCallStackTable;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
callstackTableComp.setColumnSize(columnSizes);
callstackTableComp.setColumnVisibility(columnVisibility);
- contents.addControlListener(new TableColumnSizePackListener(callstackTableComp, columnSizes));
}
@Override
package org.tizen.dynamicanalyzer.ui.memory;
-import java.util.Map;
-
import org.eclipse.nebula.widgets.grid.Grid;
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.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Sash;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.setting.SettingDataManager;
import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
import org.tizen.dynamicanalyzer.ui.memory.chart.MemoryChartBoard;
import org.tizen.dynamicanalyzer.ui.memory.data.HeapDataManager;
import org.tizen.dynamicanalyzer.ui.memory.data.MemoryDataManager;
import org.tizen.dynamicanalyzer.ui.memory.table.MemoryPersistentAllocationsTable;
import org.tizen.dynamicanalyzer.ui.memory.table.MemoryStatisticsTable;
-import org.tizen.dynamicanalyzer.ui.page.BaseView;
-import org.tizen.dynamicanalyzer.ui.page.PageInfoRegistry;
-import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineTableView;
-import org.tizen.dynamicanalyzer.util.Logger;
-import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
-import org.tizen.dynamicanalyzer.widgets.da.view.DABaseComposite;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DABaseDataPageComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DATabComposite;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
-public class MemoryPage extends DAPageComposite {
+public class MemoryPage extends DABaseDataPageComposite {
public static final String pageID = MemoryPage.class.getName();
public static final String chartViewID = MemoryChartView.class.getName();
public static final String detailsViewID = MemoryDetailsTableView.class.getName();
public static final String mapViewID = MemoryMapView.class.getName();
public static final String allocationtraceViewID = MemoryPersistentAllocationsTableView.class.getName();
- SashForm baseForm;
- SashForm topForm;
- SashForm bottomForm;
- SashForm bottomRightForm;
- SashForm bottomLeftForm;
-
private DATabComposite memoryTabView = null;
MemoryChartView memoryChartView;
MemoryMapView memoryMapView;
MemoryCallStackView memoryCallStackView;
- boolean isDetailMode = true;
-
- int tableHeight = -1;
- int tableWeight = 65;
-
- boolean wasSashCreated = false;
-
public MemoryPage(Composite parent, int style) {
super(parent, style);
setTitle(AnalyzerLabels.COOLBAR_AREA_MEMORY);
- this.setData(DAPageComposite.KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_MEMORY_TOOLTIP);
+ this.setData(KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_MEMORY_TOOLTIP);
this.setBackground(ColorResources.WHITE);
this.setLayout(new FillLayout());
- baseForm = new SashForm(this, SWT.VERTICAL);
- baseForm.setLayout(new FillLayout());
- baseForm.setForeground(ColorResources.WHITE);
- baseForm.setBackground(ColorResources.WHITE);
-
- topForm = new SashForm(baseForm, SWT.VERTICAL);
memoryChartView = new MemoryChartView(topForm, SWT.NONE);
addView(memoryChartView);
- bottomForm = new SashForm(baseForm, SWT.HORIZONTAL);
-
- bottomLeftForm = new SashForm(bottomForm, SWT.NONE);
- bottomLeftForm.setForeground(ColorResources.TAB_SELECTED_COLOR_START);
- bottomLeftForm.setLayout(new FillLayout());
-
- bottomRightForm = new SashForm(bottomForm, SWT.NONE);
- bottomRightForm.setForeground(ColorResources.TAB_SELECTED_COLOR_START);
- bottomRightForm.setLayout(new FillLayout());
- memoryTabView = new DATabComposite(bottomLeftForm, SWT.NONE, false, true);
+ memoryTabView = new DATabComposite(bottomLeftForm, SWT.NONE,
+ false, true);
{
memoryDetailsTableView = new MemoryDetailsTableView(memoryTabView.getContentComposite(), SWT.NONE);
memoryTabView.addView(memoryDetailsTableView, false);
}
addView(memoryRightTabView);
-
- baseForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- bottomForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- bottomLeftForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- bottomRightForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
-
- bottomForm.setWeights(new int[] { tableWeight, 100 - tableWeight });
-
- addTableWeightListener();
-
MemoryChartBoard chartBoard = (MemoryChartBoard) memoryChartView.getChartBoard();
Grid statisticsGrid = ((MemoryStatisticsTable) memoryStatisticsTableView.getControl()).getTable();
MemoryStatisticsTable statisticsTable = (MemoryStatisticsTable) memoryStatisticsTableView.getControl();
memoryRangeAnalysisView.setStatisticsSelectionListener(statisticsSelectionListener);
memoryRangeAnalysisView.setStatisticsSortListener(statisticsSortListener);
}
-
- private void addHeightWeightListener() {
- if(baseForm.getChildren().length > 2) {
- ((Sash)baseForm.getChildren()[2]).addListener(SWT.MouseUp, new Listener() {
- @Override
- public void handleEvent(Event event) {
- tableHeight = (int)((double)baseForm.getWeights()[0] / baseForm.getWeights()[0] + baseForm.getWeights()[1]) * baseForm.getSize().y * 1/1000;
- }
- });
-
- wasSashCreated = true;
- }
- }
-
- private void addTableWeightListener() {
- ((SashForm)bottomForm.getChildren()[0]).addListener(SWT.Resize, new Listener(){
- @Override
- public void handleEvent(Event event) {
- resizeTableButton();
- }
- });
- }
-
- @Override
- public Composite getTopTable() {
- DAViewComposite view = (DAViewComposite)this.memoryTabView.getTopComposite();
- Composite comp = (Composite)view.getControl();
- Logger.debug(comp.toString());
- return comp;
- }
-
- public SashForm getBaseForm() {
- return baseForm;
- }
-
- public void setDetailMode(boolean mode) {
- isDetailMode = mode;
- }
@Override
- protected void onResized(int width, int height) {
- if(!wasSashCreated) { // This variable needs to check whether a Sash was created to calculate height ratio between chart area and table area
- addHeightWeightListener();
- }
-
- resizePageButton();
- resizeTableButton();
-
- if(!isDetailMode) {
- baseForm.setWeights(new int[] { 100, 0 });
- } else {
- int hrate = (tableHeight == -1) ? (int) (TimelineTableView.DEFAULT_TABLE_VIEW_HEIGHT * 100 / height) :
- (int) (tableHeight * 100 / height);
-
- if(hrate > 100) {
- return;
- }
-
- baseForm.setWeights(new int[] { 100 - hrate, hrate });
- }
- }
-
- private void resizePageButton() {
- int width = WorkbenchUtil.getWorkbenchWindow().getShell().getBounds().width;
- int pageCount = PageInfoRegistry.getPageNamesByTarget(SettingDataManager.INSTANCE.getConnectedTargetOrSelected().getTargetName()).size();
-
- int newWidth = (width/pageCount > DATabComposite.LONG_TAB_WIDTH) ? DATabComposite.LONG_TAB_WIDTH : width/pageCount;
- ((BaseView)WorkbenchUtil.getViewPart(BaseView.ID)).getMainTab().updateTabButtonsWidth(newWidth);
- }
-
- private void resizeTableButton() {
- double weight = (double) bottomForm.getWeights()[0] / 1000;
- int width = (int) (WorkbenchUtil.getWorkbenchWindow().getShell().getBounds().width * weight);
- int tabCount = memoryTabView.getTabButtons().size();
-
- int newWidth = (width/tabCount > DATabComposite.LONG_TAB_WIDTH) ? DATabComposite.LONG_TAB_WIDTH : width/tabCount;
- memoryTabView.updateTabButtonsWidth(newWidth);
- }
-
- @Override
public void clear() {
super.clear();
MemoryDataManager.getInstance().clear();
HeapDataManager.getInstance().clear();
}
-
- @Override
- public void updateView() {
- for (Map.Entry<String, DABaseComposite> entry : childMap.entrySet()) {
- entry.getValue().updateView();
- }
- if(!isDetailMode) {
- if(baseForm.getChildren().length > 2) {
- ((Sash)baseForm.getChildren()[2]).setVisible(false);
- }
- } else {
- if(baseForm.getChildren().length > 2) {
- ((Sash)baseForm.getChildren()[2]).setVisible(true);
- }
- }
- }
}
package org.tizen.dynamicanalyzer.ui.memory;
+import org.eclipse.nebula.widgets.grid.GridColumn;
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.eclipse.swt.widgets.Display;
import org.tizen.dynamicanalyzer.common.DASelectionData;
import org.tizen.dynamicanalyzer.common.DAState;
import org.tizen.dynamicanalyzer.nl.MemoryPageLabels;
+import org.tizen.dynamicanalyzer.setting.FlatPreferences;
+import org.tizen.dynamicanalyzer.setting.SettingDataManager;
import org.tizen.dynamicanalyzer.ui.memory.table.MemoryPersistentAllocationsTable;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
+import org.tizen.dynamicanalyzer.ui.memory.table.MemoryPersistentAllocationsTableIndex;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAHidableViewComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
-public class MemoryPersistentAllocationsTableView extends DAViewComposite {
+public class MemoryPersistentAllocationsTableView extends DAHidableViewComposite {
public static final String ID = MemoryPersistentAllocationsTableView.class.getName();
- public static final int SEC_TABLE_INDEX = 0;
- public static final int TIMESTAMP_TABLE_INDEX = 1;
- public static final int LIVE_TABLE_INDEX = 2;
- public static final int ADDRESS_TABLE_INDEX = 3;
- public static final int SIZE_TABLE_INDEX = 4;
- public static final int LIBRARY_TABLE_INDEX = 5;
- public static final int CALLER_FUNCTION_TABLE_INDEX = 6;
-
private MemoryPersistentAllocationsTable tableComp = null;
-
- private boolean firstUpdate;
- private boolean tableVisible;
-
- private boolean[] columnVisibilityEnable = { false, true, true, true, true, true, true, true, true, false };
- private boolean[] columnVisibilityDisable = { false, false, false, false, false, false, false, false, false, true };
-
+
public MemoryPersistentAllocationsTableView(Composite parent, int style) {
- super(parent, style, false);
- this.setLayout(new FillLayout());
+ super(parent, style, false, MemoryPageLabels.STREAMING_NOT_SUPPORTED);
+
setTitle(MemoryPageLabels.MEMORY_ALLOCATION_TRACE_VIEW_TITLE);
- Composite contents = getContentArea();
- contents.setLayout(new FillLayout());
-
- tableVisible = false;
- firstUpdate = true;
-
- tableComp = new MemoryPersistentAllocationsTable(contents, SWT.NONE, SWT.BORDER
- | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
-
- tableComp.setColumnVisibility(columnVisibilityEnable);
+
+ tableComp = new MemoryPersistentAllocationsTable(getContentArea(), SWT.NONE,
+ SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
+ setDataComposite(tableComp);
+ setLeakColumnVisible(SettingDataManager.INSTANCE
+ .isPreferenceSelected(FlatPreferences.LEAK_SANITIZER));
}
@Override
public void updateView() {
- if (!AnalyzerManager.isVisibleView(this.getID())) {
- return;
- }
- if (null == tableComp) {
- return;
- }
-
- if(DAState.isRunning() == false) {
- if(firstUpdate == true) {
- firstUpdate = false;
- tableVisible = true;
+ if (DAState.isRunning()) {
+ if (!this.isHidden()) {
+ if (!tableComp.isSelectionPerformed())
+ hide();
+ }
+ } else {
+ if (this.isHidden()) {
+ show();
+ setLeakColumnVisible(SettingDataManager.INSTANCE
+ .isPreferenceSelected(FlatPreferences.LEAK_SANITIZER));
+ tableComp.updateTable();
}
}
-
- if(tableVisible == true) {
- tableComp.setColumnVisibility(columnVisibilityEnable);
- }
- else {
- tableComp.clear();
- tableComp.setColumnVisibility(columnVisibilityDisable);
- }
-
- tableComp.updateTable();
}
-
- @Override
- public void updateView(DAViewData vdata) {
- if (vdata instanceof DASelectionData == false) {
- return;
- }
- DASelectionData selData = (DASelectionData) vdata;
-
- if(selData.getStartTime() == selData.getEndTime()) {
- tableComp.setSelectionRange((long)0, (long)0);
-
- if(DAState.isRunning()) {
- tableVisible = false;
- tableComp.setColumnVisibility(columnVisibilityDisable);
- return;
+ @Override
+ public void updateView(final DAViewData vdata) {
+ tableComp.taskQueueSize++;
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ subRun();
+ tableComp.taskQueueSize--;
}
- }
- else {
- tableComp.setSelectionRange(selData.getStartTime(), selData.getEndTime());
- tableVisible = true;
- }
-
- if (!AnalyzerManager.isVisibleView(this.getID())) {
- return;
- }
- if(tableVisible == true) {
- tableComp.setColumnVisibility(columnVisibilityEnable);
- }
- else {
- tableComp.clear();
- tableComp.setColumnVisibility(columnVisibilityDisable);
- }
+ /**
+ * Perform update of view and then return control.
+ */
+ private void subRun() {
+ if (vdata instanceof DASelectionData == false) {
+ return;
+ }
+
+ DASelectionData selData = (DASelectionData) vdata;
+
+ if (selData.getStartTime() == selData.getEndTime()) {
+ tableComp.setSelectionRange((long) 0, (long) 0);
+
+ if (DAState.isRunning()) {
+ hide();
+ tableComp.clear();
+ return;
+ }
+ show();
+ } else {
+ tableComp.setSelectionRange(selData.getStartTime(), selData.getEndTime());
+ show();
+ }
+
+ setLeakColumnVisible(SettingDataManager.INSTANCE
+ .isPreferenceSelected(FlatPreferences.LEAK_SANITIZER));
+
+ tableComp.updateTable();
+ }
+ });
+ }
- tableComp.updateTable();
+ /**
+ * Changes visibility of 'Leak' column.
+ *
+ * @param visible whether column should be visible
+ */
+ private void setLeakColumnVisible(boolean visible) {
+ GridColumn col = tableComp.getTable()
+ .getColumn(MemoryPersistentAllocationsTableIndex.LEAK.getIndex());
+ col.setVisible(visible);
}
@Override
public void clear() {
tableComp.clear();
-
- firstUpdate = true;
- tableVisible = false;
}
@Override
import org.eclipse.nebula.widgets.grid.Grid;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.layout.FillLayout;
+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.Composite;
import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.ui.forms.events.ExpansionAdapter;
import org.eclipse.ui.forms.events.ExpansionEvent;
import org.tizen.dynamicanalyzer.common.DAState;
import org.tizen.dynamicanalyzer.nl.MemoryPageLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.resources.FontResources;
import org.tizen.dynamicanalyzer.ui.memory.table.MemoryStatisticsTable;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAHidableViewComposite;
import org.tizen.dynamicanalyzer.widgets.timeline.MarkerManager;
import org.tizen.dynamicanalyzer.widgets.timeline.markers.IEventListener;
import org.tizen.dynamicanalyzer.widgets.timeline.markers.MarkerAddEvent;
* ranges between timeline markers. Number of ranges is always greater by one
* than number of markers.
*/
-public class MemoryRangeAnalysisView extends DAViewComposite {
+public class MemoryRangeAnalysisView extends DAHidableViewComposite {
public static final String ID = MemoryRangeAnalysisView.class.getName();
private static int childCompositeStyle = SWT.NONE | SWT.BORDER;
private ExpandableMemoryRangeComposite focusedComposite = null;
/**
- * Stub to display when there are no markers exist.
- */
- private Label noRangesLabel;
-
- /**
* Listener for selection events of child statistics tables.
*/
private StatisticsSelectionListener statisticsSelectionListener;
table.addListener(AnalyzerConstants.TREE_SORT_EVENT,
statisticsSortListener);
}
+
+ // setup listener for mouse wheel scroll event
+ final Grid memoryTableGrid = table.getTable();
+ memoryTableGrid.addListener(SWT.MouseVerticalWheel, new Listener() {
+ @Override
+ public void handleEvent(Event event) {
+ Point origin = scrolledComposite.getOrigin();
+ scrolledComposite.setOrigin(origin.x,
+ origin.y - memoryTableGrid.getItemHeight() * event.count);
+ event.doit = false;
+ }
+ });
}
/**
next.updateRange();
updateLayoutData(pos);
- noRangesLabel.setVisible(false);
+ show();
focusRangeComposite(newComposite);
}
lastRangeComposite.setIndex(0);
lastRangeComposite.updateRange();
- noRangesLabel.setVisible(true);
+ hide();
focusedComposite = null;
}
updateLayoutData(pos);
if (rangeComposites.size() == 1) {
- noRangesLabel.setVisible(true);
+ hide();
}
// if next composite is last
* @param style SWT composite style
*/
public MemoryRangeAnalysisView(Composite parent, int style) {
- super(parent, style, false);
+ super(parent, style, false, MemoryPageLabels.MEMORY_RANGE_ANALYSIS_VIEW_NO_RANGES_LABEL);
MarkerManager.INSTANCE.addEventListener(new MarkerEventsListener());
- setLayout(new FillLayout(SWT.VERTICAL));
setTitle(MemoryPageLabels.MEMORY_RANGE_ANALYSIS_VIEW_TITLE);
- // setup content area
- final Composite viewContentArea = getContentArea();
- viewContentArea.setLayout(new FillLayout(SWT.VERTICAL));
-
- scrolledComposite = new ScrolledComposite(viewContentArea, SWT.V_SCROLL);
+ scrolledComposite = new ScrolledComposite(getContentArea(), SWT.V_SCROLL);
scrolledComposite.setBackgroundMode(SWT.INHERIT_DEFAULT);
scrolledComposite.setBackground(ColorResources.WHITE);
content = new Composite(scrolledComposite, SWT.NONE);
}
});
+ setDataComposite(scrolledComposite);
+
// create persistent composite
lastRangeComposite = new ExpandableMemoryRangeComposite(content,
childCompositeStyle);
rangeComposites.add(lastRangeComposite);
setupChildCompositeListeners(lastRangeComposite);
hideRangeComposite(0);
-
- // create stub label
- noRangesLabel = new Label(content, SWT.NONE);
- noRangesLabel.setText(
- MemoryPageLabels.MEMORY_RANGE_ANALYSIS_VIEW_NO_RANGES_LABEL);
- noRangesLabel.setFont(FontResources.TABLE_HEADER_FONT);
-
- FormData labelData = new FormData();
- labelData.top = new FormAttachment(0, CHILD_MARGIN_HEIGHT);
- labelData.left = new FormAttachment(0, CHILD_MARGIN_HEIGHT);
- labelData.right = new FormAttachment(100);
- noRangesLabel.setLayoutData(labelData);
}
@Override
hideRangeComposite(rangeComposites.size() - 1);
// show label if no other ranges exist
- noRangesLabel.setVisible(rangeComposites.size() == 1);
+ hide(rangeComposites.size() == 1);
} else {
lastRangeComposite.setIndex(rangeComposites.size() - 1);
lastRangeComposite.updateRange();
showRangeComposite(rangeComposites.size() - 1);
- noRangesLabel.setVisible(false);
+ show();
}
recalculateScrollArea();
package org.tizen.dynamicanalyzer.ui.memory;
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.eclipse.swt.widgets.Display;
import org.tizen.dynamicanalyzer.common.DASelectionData;
import org.tizen.dynamicanalyzer.common.DAState;
import org.tizen.dynamicanalyzer.nl.MemoryPageLabels;
import org.tizen.dynamicanalyzer.ui.memory.table.MemoryStatisticsTable;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAHidableViewComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
-public class MemoryStatisticsTableView extends DAViewComposite {
+public class MemoryStatisticsTableView extends DAHidableViewComposite {
public static final String ID = MemoryStatisticsTableView.class.getName();
public static final int FREED_TABLE_INDEX = 0;
public static final int TOTAL_BYTE_TABLE_INDEX = 0;
public static final int TOTAL_TABLE_INDEX = 0;
-
- private boolean tableUpdate;
- private boolean firstUpdate;
- private boolean tableVisible;
private MemoryStatisticsTable tableComp = null;
public MemoryStatisticsTableView(Composite parent, int style) {
- super(parent, style, false);
- this.setLayout(new FillLayout());
+ super(parent, style, false, MemoryPageLabels.STREAMING_NOT_SUPPORTED);
+
setTitle(MemoryPageLabels.MEMORY_STATISTICS_VIEW_TITLE);
- Composite contents = getContentArea();
- contents.setLayout(new FillLayout());
-
- tableComp = new MemoryStatisticsTable(contents, SWT.NONE, SWT.MULTI | SWT.BORDER
- | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
-
-
- tableComp.setColumnVisibilityState(true);
-
- tableUpdate = false;
- tableVisible = false;
- firstUpdate = true;
+
+ tableComp = new MemoryStatisticsTable(getContentArea(), SWT.NONE,
+ SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
+ setDataComposite(tableComp);
}
@Override
public void updateView() {
- if (!AnalyzerManager.isVisibleView(this.getID())) {
- return;
- }
- if (null == tableComp) {
- return;
- }
-
- if(DAState.isRunning() == false) {
- if(firstUpdate == true) {
- firstUpdate = false;
- tableUpdate = true;
- tableVisible = true;
+ if (DAState.isRunning()) {
+ if (!this.isHidden()) {
+ if (!tableComp.isSelectionPerformed())
+ hide();
+ }
+ } else {
+ if (this.isHidden()) {
+ show();
+ tableComp.updateTable();
}
- }
-
- if(tableVisible == true) {
- tableComp.setColumnVisibilityState(true);
- }
- else {
- tableComp.clear();
- tableComp.setColumnVisibilityState(false);
- }
-
- if(tableUpdate == true) {
- tableComp.updateTable();
- tableUpdate = false;
}
}
-
- @Override
- public void updateView(DAViewData vdata) {
- if (vdata instanceof DASelectionData == false) {
- return;
- }
- DASelectionData selData = (DASelectionData) vdata;
-
- if(selData.getStartTime() == selData.getEndTime()) {
- tableComp.setSelectionRange((long)0, (long)0);
- tableUpdate = !DAState.isRunning();
-
- if(DAState.isRunning()) {
- tableVisible = false;
- tableComp.setColumnVisibilityState(false);
- return;
+ @Override
+ public void updateView(final DAViewData vdata) {
+ tableComp.taskQueueSize++;
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ subRun();
+ tableComp.taskQueueSize--;
}
- }
- else {
- tableComp.setSelectionRange(selData.getStartTime(), selData.getEndTime());
- tableUpdate = true;
- tableVisible = true;
- }
-
- if (!AnalyzerManager.isVisibleView(this.getID())) {
- return;
- }
- if(tableVisible == true) {
- tableComp.setColumnVisibilityState(true);
- }
- else {
- tableComp.clear();
- tableComp.setColumnVisibilityState(false);
- }
+ /**
+ * Perform update of view and then return control.
+ */
+ private void subRun() {
+ if (vdata instanceof DASelectionData == false) {
+ return;
+ }
+
+ DASelectionData selData = (DASelectionData) vdata;
+
+ if (selData.getStartTime() == selData.getEndTime()) {
+ tableComp.setSelectionRange((long) 0, (long) 0);
- tableComp.updateTable();
- tableUpdate = false;
+ if (DAState.isRunning()) {
+ hide();
+ tableComp.clear();
+ return;
+ }
+ show();
+ } else {
+ tableComp.setSelectionRange(selData.getStartTime(),
+ selData.getEndTime());
+ show();
+ }
+
+ tableComp.updateTable();
+ }
+ });
}
@Override
public void clear() {
tableComp.clear();
-
- tableUpdate = false;
- firstUpdate = true;
- tableVisible = false;
}
@Override
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.tizen.dynamicanalyzer.ui.memory.chart.MemoryChartBoard;
-import org.tizen.dynamicanalyzer.ui.memory.table.MemoryPersistentAllocationsTable.MemoryPersistentAllocationsTableIndex;
+import org.tizen.dynamicanalyzer.ui.memory.table.MemoryPersistentAllocationsTableIndex;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
// for each row in data\r
for (List<Object> row : data) {\r
// get time in seconds (microseconds / 1000000.0)\r
- double time = (long) row.get(MemAllocDBTable.COLUMN.ALLOCATED_TIME.index) / TimelineConstants.MEGA_DOUBLE;\r
- long size = (long) row.get(MemAllocDBTable.COLUMN.ALLOCATED_MEMORY_SIZE.index);\r
- int libId = (int) row.get(MemAllocDBTable.COLUMN.CALLER_LIBRARY_ID.index);\r
- int pid = (int) row.get(MemAllocDBTable.COLUMN.PID.index);\r
+ double time = (long) row.get(MemAllocDBTable.BASIC_COLUMN.ALLOCATED_TIME.index) / TimelineConstants.MEGA_DOUBLE;\r
+ long size = (long) row.get(MemAllocDBTable.BASIC_COLUMN.ALLOCATED_MEMORY_SIZE.index);\r
+ int libId = (int) row.get(MemAllocDBTable.BASIC_COLUMN.CALLER_LIBRARY_ID.index);\r
+ int pid = (int) row.get(MemAllocDBTable.BASIC_COLUMN.PID.index);\r
\r
String entryName = Global.getLibraryName(libId);\r
if (entryName.equals(Global.getProject().getApplicationInfo().getExecPath()))\r
package org.tizen.dynamicanalyzer.ui.memory.data;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.nio.charset.StandardCharsets;
+import java.sql.ResultSet;
+import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Scanner;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.DAState;
import org.tizen.dynamicanalyzer.common.Global;
+import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.database.DBInserter;
+import org.tizen.dynamicanalyzer.database.IResultSet;
import org.tizen.dynamicanalyzer.model.TableInput;
import org.tizen.dynamicanalyzer.model.TreeInput;
import org.tizen.dynamicanalyzer.nl.MemoryPageLabels;
+import org.tizen.dynamicanalyzer.protocol.Protocol;
import org.tizen.dynamicanalyzer.protocol.ProtocolConstants;
+import org.tizen.dynamicanalyzer.setting.FlatPreferences;
+import org.tizen.dynamicanalyzer.setting.SettingDataManager;
import org.tizen.dynamicanalyzer.swap.logparser.LogPackage;
import org.tizen.dynamicanalyzer.swap.logparser.Logs;
import org.tizen.dynamicanalyzer.swap.logparser.PageDataManager;
private MemAllocDBTable allocateDBTable = null;
private MemFreeDBTable freeDBTable = null;
+ private MemLSanTable lsanDBTable = null;
private DBInserter allocateDBInserter = null;
private DBInserter freeDBInserter = null;
+ private DBInserter lsanDBInserter = null;
private ArrayList<List<Object>> memoryAllocDataList = new ArrayList<List<Object>> ();
private ArrayList<List<Object>> memoryfreeDataList = new ArrayList<List<Object>> ();
private List<List<Object>> preAllocDataList = new ArrayList<List<Object>>();
private List<List<Object>> preFreeDataList = new ArrayList<List<Object>>();
+ private List<List<Object>> lsanDataList = new ArrayList<List<Object>>();
private HashSet<Long> addressMap = new HashSet<Long> ();
private HeapDataManager() {
allocateDBTable = new MemAllocDBTable();
freeDBTable = new MemFreeDBTable();
+ lsanDBTable = new MemLSanTable();
allocateDBInserter = makeInserter(allocateDBTable);
freeDBInserter = makeInserter(freeDBTable);
+ lsanDBInserter = makeInserter(lsanDBTable);
// 0 : start time
// 1 : end time
preAllocDataList.clear();
preFreeDataList.clear();
-
+ lsanDataList.clear();
+
preQueryTime.clear();
// 0 : start time
* @return Row data if exist and unique, or null otherwise
*/
public List<Object> getAllocationRowBySeqFromDB(long seqNum) {
-
String where = "WHERE SEQUENCE_NUMBER = " + Long.toString(seqNum);
- List<List<Object>> queryResult = allocateDBTable
- .selectAllColumnData(where);
+ List<List<Object>> queryResult = allocateDBTable.selectRequiredColumns(where);
if (queryResult.size() != 1) {
Logger.error("Stored data was corrupted!");
return null;
return queryResult.get(0);
}
+ /**
+ * Request MEM_ALLOC_DB for ALLOCATOR_ADDRESS value from row with specified sequence number
+ * @param seqNum requested sequence number
+ * @return allocator's address as Long value or 0 is address couldn't be read from table
+ */
+ public Long getAllocatorAddrBySeqFromDB(long seqNum) {
+ if (!isAllocatorAddrSupported()) return 0L;
+ String where = "WHERE SEQUENCE_NUMBER = " + Long.toString(seqNum);
+ final String columnName = MemAllocDBTable.COLUMN.ALLOCATOR_ADDRESS.name;
+ List<List<Object>> queryResult = allocateDBTable.selectData(
+ new ArrayList<String>(Arrays.asList(columnName)), where,
+ new IResultSet() {
+ @Override
+ public List<Object> extractDataFromResultSet(ResultSet rs) {
+ List<Object> row = new ArrayList<Object>();
+ try {
+ if (rs.getMetaData().getColumnCount() > 0)
+ row.add(Long.valueOf(rs.getLong(1)));
+ else
+ row.add(Long.valueOf(0));
+ } catch (SQLException e) {
+ Logger.exception(e);
+ }
+ return row;
+ }
+ });
+ if (queryResult.size() != 1) {
+ Logger.warning("Could't extract " + columnName + " for seq#" + seqNum + " from "
+ + MemAllocDBTable.TABLENAME);
+ return 0L;
+ }
+ return (Long) queryResult.get(0).get(0);
+ }
+
private List<List<Object>> getAllocationDataFromDB(long start, long end, String targetPIDs) {
List<List<Object>> allocatedResult = new ArrayList<List<Object>> ();
String where = getTimeWhereQuery(start, end, targetPIDs, MemAllocDBTable.COLUMN.ALLOCATED_TIME.name);
where += " ORDER BY " + MemAllocDBTable.COLUMN.SEQUENCE_NUMBER.name;
- List<List<Object>> queryResult = allocateDBTable.selectAllColumnData(where);
+ List<List<Object>> queryResult = allocateDBTable.selectBasicColumns(where);
if (queryResult == null) {
return allocatedResult;
}
String where = getTimeWhereQuery(start, end, targetPIDs, MemFreeDBTable.COLUMN.FREE_TIME.name);
where += " ORDER BY " + MemFreeDBTable.COLUMN.SEQUENCE_NUMBER.name;
- List<List<Object>> queryResult = freeDBTable.selectAllColumnData(where);
+ List<List<Object>> queryResult = freeDBTable.selectBasicColumns(where);
if (queryResult == null) {
return freeResult;
}
}
}
- public List<TableInput> getWholeAllocationTraceTreeInput (){
+ public List<TableInput> getWholeAllocationTraceTreeInput() {
List<TableInput> output = null;
synchronized(lockAllocationCal) {
for (int j = 0; j < allocDataSize; j++) {
List<Object> iAllocData = allocData.get(j);
- long address = (Long) iAllocData.get(MemAllocDBTable.COLUMN.ALLOCATED_ADDRESS.index);
- long alloctime = (Long) iAllocData.get(MemAllocDBTable.COLUMN.ALLOCATED_TIME.index);
- long allocSize = (Long) iAllocData.get(MemAllocDBTable.COLUMN.ALLOCATED_MEMORY_SIZE.index);
- int binaryId = (Integer) iAllocData.get(MemAllocDBTable.COLUMN.CALLER_LIBRARY_ID.index);
- int pid = (Integer) iAllocData.get(MemAllocDBTable.COLUMN.PID.index);
+ long address = (Long) iAllocData.get(MemAllocDBTable.BASIC_COLUMN.ALLOCATED_ADDRESS.index);
+ long alloctime = (Long) iAllocData.get(MemAllocDBTable.BASIC_COLUMN.ALLOCATED_TIME.index);
+ long allocSize = (Long) iAllocData.get(MemAllocDBTable.BASIC_COLUMN.ALLOCATED_MEMORY_SIZE.index);
+ int binaryId = (Integer) iAllocData.get(MemAllocDBTable.BASIC_COLUMN.CALLER_LIBRARY_ID.index);
+ int pid = (Integer) iAllocData.get(MemAllocDBTable.BASIC_COLUMN.PID.index);
if(!addressMap.containsKey(address)) {
List<List<Object>> newlist = new ArrayList<List<Object>>();
for (int i = 0; i < freeData.size(); i++) {
List<Object> iFreeData = freeData.get(i);
- long address = (Long) iFreeData.get(MemFreeDBTable.COLUMN.ALLOCATED_ADDRESS.index);
- long freetime = (Long) iFreeData.get(MemFreeDBTable.COLUMN.FREE_TIME.index);
- int pid = (int) iFreeData.get(MemFreeDBTable.COLUMN.PID.index);
+ long address = (Long) iFreeData.get(MemFreeDBTable.BASIC_COLUMN.ALLOCATED_ADDRESS.index);
+ long freetime = (Long) iFreeData.get(MemFreeDBTable.BASIC_COLUMN.FREE_TIME.index);
+ int pid = (int) iFreeData.get(MemFreeDBTable.BASIC_COLUMN.PID.index);
Map<Integer, List<Object>> libStatisticMapPid = pidStatisticMap.get(pid);
if(addressMap.containsKey(address)) {
for (int i = 0; i < freeData.size(); i++) {
List<Object> iFreeData = freeData.get(i);
- long freetime = (Long) iFreeData.get(MemFreeDBTable.COLUMN.FREE_TIME.index);
- long address = (Long) iFreeData.get(MemFreeDBTable.COLUMN.ALLOCATED_ADDRESS.index);
+ long freetime = (Long) iFreeData.get(MemFreeDBTable.BASIC_COLUMN.FREE_TIME.index);
+ long address = (Long) iFreeData.get(MemFreeDBTable.BASIC_COLUMN.ALLOCATED_ADDRESS.index);
if(!addressMap.containsKey(address)) {
List<Long> newlist = new ArrayList<Long>();
for (int i = 0; i < allocDataSize; i++) {
List<Object> iAllocData = allocData.get(i);
boolean live = true;
- long alloctime = (Long) iAllocData.get(MemAllocDBTable.COLUMN.ALLOCATED_TIME.index);
- long address = (Long) iAllocData.get(MemAllocDBTable.COLUMN.ALLOCATED_ADDRESS.index);
+ long alloctime = (Long) iAllocData.get(MemAllocDBTable.BASIC_COLUMN.ALLOCATED_TIME.index);
+ long address = (Long) iAllocData.get(MemAllocDBTable.BASIC_COLUMN.ALLOCATED_ADDRESS.index);
if(addressMap.containsKey(address)) {
int size = addressMap.get(address).size();
return null;
}
// 0 : sequence number - hidden column for sorting
- Long seq = (Long) allocData.get(MemAllocDBTable.COLUMN.SEQUENCE_NUMBER.index);
+ Long seq = (Long) allocData.get(MemAllocDBTable.BASIC_COLUMN.SEQUENCE_NUMBER.index);
text.add(Long.toString(seq));
data.add(seq);
// 1 : allocated time
- long time = (Long) allocData.get(MemAllocDBTable.COLUMN.ALLOCATED_TIME.index);
+ long time = (Long) allocData.get(MemAllocDBTable.BASIC_COLUMN.ALLOCATED_TIME.index);
data.add(Long.valueOf(time));
try {
text.add(Formatter.toTimeFormat(time));
text.add(Long.toString(time));
}
// 2 : PID
- int pid = (Integer) allocData.get(MemAllocDBTable.COLUMN.PID.index);
+ int pid = (Integer) allocData.get(MemAllocDBTable.BASIC_COLUMN.PID.index);
text.add(Integer.toString(pid));
data.add(pid);
// 3 : TID
- int tid = (Integer) allocData.get(MemAllocDBTable.COLUMN.TID.index);
+ int tid = (Integer) allocData.get(MemAllocDBTable.BASIC_COLUMN.TID.index);
text.add(Integer.toString(tid));
data.add(tid);
// 4 : address
- Long address = (Long) allocData.get(MemAllocDBTable.COLUMN.ALLOCATED_ADDRESS.index);
+ Long address = (Long) allocData.get(MemAllocDBTable.BASIC_COLUMN.ALLOCATED_ADDRESS.index);
text.add("0x" + Long.toHexString(address));
data.add(address);
// 5 : size
- Long size = (Long) allocData.get(MemAllocDBTable.COLUMN.ALLOCATED_MEMORY_SIZE.index);
+ Long size = (Long) allocData.get(MemAllocDBTable.BASIC_COLUMN.ALLOCATED_MEMORY_SIZE.index);
text.add(Long.toString(size));
data.add(size);
// 6 : library name
- String libName = Global.getLibraryName((Integer)allocData.get(MemAllocDBTable.COLUMN.CALLER_LIBRARY_ID.index));
+ String libName = Global.getLibraryName((Integer)allocData.get(MemAllocDBTable.BASIC_COLUMN.CALLER_LIBRARY_ID.index));
if (libName == null || libName.isEmpty()) {
libName = AnalyzerConstants.UNKNOWN_LIB;
}
text.add(libName);
data.add(libName);
// 7 : api type
- int apiId = (Integer) allocData.get(MemAllocDBTable.COLUMN.API_ID.index);
+ int apiId = (Integer) allocData.get(MemAllocDBTable.BASIC_COLUMN.API_ID.index);
String apiName = Global.getFunctionName(apiId);
text.add(apiName);
data.add(apiName);
-
+
+ // 8 : leak
+ boolean leak = false;
+
+ if (SettingDataManager.INSTANCE.isPreferenceSelected(FlatPreferences.LEAK_SANITIZER)) {
+ if (lsanDataList.isEmpty())
+ lsanDataList = lsanDBTable.selectAllColumnData("");
+
+ for (List<Object> row : lsanDataList)
+ if (((Long) row.get(0)).equals(address)) {
+ leak = true;
+ break;
+ }
+ }
+
+ text.add(leak ? CommonConstants.YES : CommonConstants.EMPTY);
+ data.add(leak ? CommonConstants.YES : CommonConstants.EMPTY);
+
+ tableData.setType(AnalyzerConstants.TYPE_TABLE_MEM_ALLOCATEDTRACE);
+
TreeInput output = new TreeInput();
output.setText(text);
tableData.getData().addAll(data);
return output;
}
+ /**
+ * Parses given report file.
+ *
+ * @param filepath path to pulled report file on host
+ */
+ public void parseReportFile(String filepath) {
+ Scanner scanner = null;
+ lsanDataList.clear();
+
+ String parsingErrorMsg = "Failed to parse file: " + filepath;
+
+ try {
+ scanner = new Scanner(new FileInputStream(new File(filepath)), StandardCharsets.US_ASCII.name());
+
+ // loop through lines
+ while (scanner.hasNextLine()) {
+ /**
+ * There are 3 long fields separated by space character on each
+ * line in data file in following format:
+ *
+ * <allocation address> <chunk size> <first 4 bytes in chunk>
+ */
+ String[] fields = scanner.nextLine().split(" ");
+ if (fields.length != 3) {
+ Logger.error(parsingErrorMsg);
+ scanner.close();
+ return;
+ }
+
+ List<Object> row = new ArrayList<Object>();
+ for (String field : fields)
+ row.add(Long.parseLong(field));
+
+ lsanDataList.add(row);
+ }
+
+ lsanDBInserter.pushData(lsanDataList);
+
+ } catch (FileNotFoundException e) {
+ Logger.warning("File was not found: " + filepath);
+
+ } catch (NumberFormatException e) {
+ Logger.error(parsingErrorMsg + CommonConstants.NEW_LINE + e.getMessage());
+
+ } finally {
+ if (scanner != null)
+ scanner.close();
+ }
+ }
+
private String getTargetPIDString(){
List<Integer> pidlist = new ArrayList<Integer>();
return logs;
}
-
+
+ /**
+ * @return true if allocator's address is supported in current protocol, false otherwise
+ */
+ private boolean isAllocatorAddrSupported() {
+ Protocol projectProtocol = Global.getCurrentProtocol();
+ return (projectProtocol.getVersionNum() >= Protocol.VERSION_42.getVersionNum());
+ }
+ /**
+ * Extract allocator's address from SWAP message
+ * @param logData the SWAP message of MSG_PROBE_MEMORY type saved in {@link MemoryData} format
+ * @return allocator's address as long value or 0 if protocol doesn't support such data
+ */
+ private long getAllocatorAddress(MemoryData logData) {
+ if (!isAllocatorAddrSupported())
+ return 0;
+ int reserved1 = logData.getReserved1();
+ int reserved2 = logData.getReserved2();
+ long allocatorAddress = (long) reserved2 << 32 | reserved1 & 0xFFFFFFFFL;
+ return allocatorAddress;
+ }
+
+
private void makeHeapData(Logs alloclogs) {
List<LogData> memoryLogList = alloclogs == null ? null : alloclogs.getRawLogs();
int memApiType = logData.getMemoryApiType();
int pid = logData.getPid();
- long calleraddress = logData.getCallerPcAddr();
+ long calleraddress = logData.getCallerPcAddr();
int binaryid = Global.getBinaryID(pid, logData.getTime(), calleraddress);
if(MEM_API_TYPE_ALLOC == memApiType) {
- makeAllocData(logData, binaryid);
+ long allocatorAddr = getAllocatorAddress(logData);
+ makeAllocData(logData, binaryid, allocatorAddr);
}
else if(MEM_API_TYPE_FREE == memApiType) {
makeFreeData(logData, binaryid);
continue;
}
}
-
+
if (memoryAllocDataList.size() > 0) {
@SuppressWarnings("unchecked")
List<List<Object>> mList = (List<List<Object>>) memoryAllocDataList.clone();
}
}
- private void makeAllocData(MemoryData mData, int binaryid) {
+ private void makeAllocData(MemoryData mData, int binaryid, long allocatorAddr) {
ArrayList<Object> dbAllocData = new ArrayList<Object>();
int pid = mData.getPid();
dbAllocData.add(Integer.valueOf(binaryid));
dbAllocData.add(Integer.valueOf(mData.getMsgID()));
dbAllocData.add(Long.valueOf(mallocsize));
-
+ dbAllocData.add(allocatorAddr == 0 ? null : Long.valueOf(allocatorAddr));
memoryAllocDataList.add(dbAllocData);
-
+
//if(!addressMap.contains(address)) {
// addressMap.add(address);
//}
return;
}
+ // TODO: Add check for data size to be loaded from data base.
+ // If data size exceeds predefined limit - invoke DALimit.stopTraceAndOpenWarningDialog()
preAllocDataList = getAllocationDataFromDB(start, end, targetIds);
preFreeDataList = getFreeDataFromDB(start, end, targetIds);
import org.tizen.dynamicanalyzer.database.DBColumn;
import org.tizen.dynamicanalyzer.database.DBConstants;
import org.tizen.dynamicanalyzer.database.DBTable;
+import org.tizen.dynamicanalyzer.database.IResultSet;
import org.tizen.dynamicanalyzer.util.Logger;
public class MemAllocDBTable extends DBTable {
CALLER_PC_ADDRESS(7, DBConstants.DBCOLUMN_CALLER_PC_ADDRESS),
CALLER_LIBRARY_ID(8, "CALLER_LIBRARY_ID"),
MESSAGE_ID(9, "MESSAGE_ID"),
- ALLOCATED_MEMORY_SIZE(10, "ALLOCATED_MEMORY_SIZE");
+ ALLOCATED_MEMORY_SIZE(10, "ALLOCATED_MEMORY_SIZE"),
+ ALLOCATOR_ADDRESS(11, "ALLOCATOR_ADDRESS");
public final int index;
public final String name;
this.name = name;
}
}
+
+ public enum BASIC_COLUMN {
+ SEQUENCE_NUMBER(0, COLUMN.SEQUENCE_NUMBER),
+ PID(1, COLUMN.PID),
+ TID(2, COLUMN.TID),
+ API_ID(3, COLUMN.API_ID),
+ ALLOCATED_ADDRESS(4, COLUMN.ALLOCATED_ADDRESS),
+ ALLOCATED_TIME(5, COLUMN.ALLOCATED_TIME),
+ CALLER_LIBRARY_ID(6, COLUMN.CALLER_LIBRARY_ID),
+ ALLOCATED_MEMORY_SIZE(7, COLUMN.ALLOCATED_MEMORY_SIZE);
+
+ public final int index;
+ public final String name;
+
+ BASIC_COLUMN(int index, COLUMN col) {
+ this.index = index;
+ this.name = col.name;
+ }
+ }
+
@Override
public String getTableName() {
}
public MemAllocDBTable() {
+ // required columns
addColumn(new DBColumn(COLUMN.SEQUENCE_NUMBER.name, DBConstants.PRIMARY_KEY, DBConstants.DBTYPE_INT8));
addColumn(new DBColumn(COLUMN.PID.name, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
addColumn(new DBColumn(COLUMN.TID.name, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
addColumn(new DBColumn(COLUMN.CALLER_LIBRARY_ID.name, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
addColumn(new DBColumn(COLUMN.MESSAGE_ID.name, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
addColumn(new DBColumn(COLUMN.ALLOCATED_MEMORY_SIZE.name, DBConstants.NOT_NULL, DBConstants.DBTYPE_LONG));
+ // optional columns
+ addColumn(new DBColumn(COLUMN.ALLOCATOR_ADDRESS.name, DBConstants.EMPTY, DBConstants.DBTYPE_LONG));
setIndexColumn(COLUMN.PID.index);
setIndexColumn(COLUMN.SEQUENCE_NUMBER.index);
prep.setInt(9, (Integer) (rowData.get(COLUMN.CALLER_LIBRARY_ID.index)));
prep.setInt(10, (Integer) (rowData.get(COLUMN.MESSAGE_ID.index)));
prep.setLong(11, (Long) (rowData.get(COLUMN.ALLOCATED_MEMORY_SIZE.index)));
+ Object allocatorAddr = rowData.get(COLUMN.ALLOCATOR_ADDRESS.index );
+ if (allocatorAddr == null)
+ prep.setNull(12, java.sql.Types.BIGINT);
+ else
+ prep.setLong(12, (Long) (allocatorAddr));
} catch (SQLException e) {
Logger.exception(e);
isPrepared = false;
}
@Override
+ protected void postProcess(List<List<Object>> data) {
+ data.clear();
+ }
+
+ /**
+ * The method extracts only not-null columns from MemAllocDBTable.
+ */
+ @Override
public List<Object> extractDataFromResultSet(ResultSet rs) {
List<Object> row = new ArrayList<Object>();
try {
return row;
}
+ /**
+ * Select data only from basic columns needed for proper tables construction
+ * @param where string describing selection conditions
+ * @return list of rows where row is list of objects,
+ * <code>null</code> if there is no data in the table
+ */
+ public List<List<Object>> selectBasicColumns(String where) {
+ return selectData(getBasicColumns(), where, new IResultSet() {
+ @Override
+ public List<Object> extractDataFromResultSet(ResultSet rs) {
+ List<Object> row = new ArrayList<Object>();
+ try {
+ row.add(Long.valueOf(rs.getLong(1)));
+ row.add(Integer.valueOf(rs.getInt(2)));
+ row.add(Integer.valueOf(rs.getInt(3)));
+ row.add(Integer.valueOf(rs.getInt(4)));
+ row.add(Long.valueOf(rs.getLong(5)));
+ row.add(Long.valueOf(rs.getLong(6)));
+ row.add(Integer.valueOf(rs.getInt(7)));
+ row.add(Long.valueOf(rs.getLong(8)));
+ } catch (SQLException e) {
+ Logger.exception(e);
+ return null;
+ }
+ return row;
+ }
+ });
+ }
+
+ /**
+ * Select data only from non-optional columns
+ * @param where string describing selection conditions
+ * @return list of rows where row is list of objects,
+ * <code>null</code> if there is no data in the table
+ */
+ public List<List<Object>> selectRequiredColumns(String where) {
+ return selectData(getRequiredColumns(), where, this);
+ }
+
+ /**
+ * Get names of basic columns of the table
+ * @return ordered list of columns' names
+ */
+ private List<String> getBasicColumns() {
+ List<String> columns = new ArrayList<String>();
+ for (MemAllocDBTable.BASIC_COLUMN col : MemAllocDBTable.BASIC_COLUMN.values()) {
+ columns.add(col.name);
+ }
+ return columns;
+ }
+
+ /**
+ * Get names of non-optional columns of the table
+ * @return ordered list of columns' names
+ */
+ private List<String> getRequiredColumns() {
+ List<String> columns = new ArrayList<String>();
+ for (MemAllocDBTable.COLUMN col : MemAllocDBTable.COLUMN.values()) {
+ if (col.equals(COLUMN.ALLOCATOR_ADDRESS)) continue;
+ columns.add(col.name);
+ }
+ return columns;
+ }
}
import org.tizen.dynamicanalyzer.database.DBColumn;
import org.tizen.dynamicanalyzer.database.DBConstants;
import org.tizen.dynamicanalyzer.database.DBTable;
+import org.tizen.dynamicanalyzer.database.IResultSet;
import org.tizen.dynamicanalyzer.util.Logger;
public class MemFreeDBTable extends DBTable {
this.name = name;
}
}
+
+ enum BASIC_COLUMN {
+ SEQUENCE_NUMBER(0, COLUMN.SEQUENCE_NUMBER),
+ PID(1, COLUMN.PID),
+ FREE_TIME(2, COLUMN.FREE_TIME),
+ ALLOCATED_ADDRESS(3, COLUMN.ALLOCATED_ADDRESS);
+
+ public final int index;
+ public final String name;
+
+ BASIC_COLUMN(int index, COLUMN col) {
+ this.index = index;
+ this.name = col.name;
+ }
+ }
@Override
public String getTableName() {
}
@Override
+ protected void postProcess(List<List<Object>> data) {
+ data.clear();
+ }
+
+ @Override
public List<Object> extractDataFromResultSet(ResultSet rs) {
List<Object> row = new ArrayList<Object>();
try {
return row;
}
+ /**
+ * Select data only from basic columns needed for proper tables construction
+ * @param where string describing selection conditions
+ * @return list of rows where row is list of objects,
+ * <code>null</code> if there is no data in the table
+ */
+ public List<List<Object>> selectBasicColumns(String where) {
+ return selectData(getBasicColumns(), where, new IResultSet() {
+ @Override
+ public List<Object> extractDataFromResultSet(ResultSet rs) {
+ List<Object> row = new ArrayList<Object>();
+ try {
+ row.add(Long.valueOf(rs.getLong(1)));
+ row.add(Integer.valueOf(rs.getInt(2)));
+ row.add(Long.valueOf(rs.getLong(3)));
+ row.add(Long.valueOf(rs.getLong(4)));
+ } catch (SQLException e) {
+ Logger.exception(e);
+ return null;
+ }
+ return row;
+ }
+ });
+ }
+
+ /**
+ * Get names of basic columns of the table
+ * @return ordered list of columns' names
+ */
+ private List<String> getBasicColumns() {
+ List<String> columns = new ArrayList<String>();
+ for (MemFreeDBTable.BASIC_COLUMN col : MemFreeDBTable.BASIC_COLUMN.values()) {
+ columns.add(col.name);
+ }
+ return columns;
+ }
}
--- /dev/null
+package org.tizen.dynamicanalyzer.ui.memory.data;
+
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.tizen.dynamicanalyzer.database.DBColumn;
+import org.tizen.dynamicanalyzer.database.DBConstants;
+import org.tizen.dynamicanalyzer.database.DBTable;
+import org.tizen.dynamicanalyzer.util.Logger;
+
+/**
+ * Database table containing data from LeakSanitizer report file.
+ */
+public class MemLSanTable extends DBTable {
+ public static final String TABLENAME = "MEM_LSAN_DB";
+
+ public enum COLUMN {
+ // @formatter:off
+ ALLOCATED_ADDRESS (0, "ALLOCATED_ADDRESS" ),
+ ALLOCATED_MEMORY_SIZE (1, "ALLOCATED_MEMORY_SIZE" ),
+ ALLOCATED_FIRST_FOUR_BYTES(2, "ALLOCATED_FIRST_FOUR_BYTES");
+ // @formatter:on
+
+ public final int index;
+ public final String name;
+
+ COLUMN(int index, String name) {
+ this.index = index;
+ this.name = name;
+ }
+ }
+
+ @Override
+ public String getTableName() {
+ return TABLENAME;
+ }
+
+ public MemLSanTable() {
+ addColumn(new DBColumn(COLUMN.ALLOCATED_ADDRESS.name, DBConstants.NOT_NULL, DBConstants.DBTYPE_LONG));
+ addColumn(new DBColumn(COLUMN.ALLOCATED_MEMORY_SIZE.name, DBConstants.NOT_NULL, DBConstants.DBTYPE_LONG));
+ addColumn(new DBColumn(COLUMN.ALLOCATED_FIRST_FOUR_BYTES.name, DBConstants.NOT_NULL, DBConstants.DBTYPE_LONG));
+
+ setIndexColumn(COLUMN.ALLOCATED_ADDRESS.index);
+ }
+
+ @Override
+ public boolean prepare(PreparedStatement prep, List<Object> rowData) {
+ boolean isPrepared = true;
+
+ int columnsize = getColumnSize();
+ if (columnsize != rowData.size()) {
+ isPrepared = false;
+ } else {
+ try {
+ prep.setLong(1, (Long) (rowData.get(COLUMN.ALLOCATED_ADDRESS.index)));
+ prep.setLong(2, (Long) (rowData.get(COLUMN.ALLOCATED_MEMORY_SIZE.index)));
+ prep.setLong(3, (Long) (rowData.get(COLUMN.ALLOCATED_FIRST_FOUR_BYTES.index)));
+ } catch (SQLException e) {
+ Logger.exception(e);
+ isPrepared = false;
+ }
+ }
+
+ return isPrepared;
+ }
+
+ @Override
+ public List<Object> extractDataFromResultSet(ResultSet rs) {
+ List<Object> row = new ArrayList<Object>();
+ try {
+ row.add(Long.valueOf(rs.getLong(1)));
+ row.add(Long.valueOf(rs.getLong(2)));
+ row.add(Long.valueOf(rs.getLong(3)));
+ } catch (SQLException e) {
+ Logger.exception(e);
+ return null;
+ }
+
+ return row;
+ }
+}
package org.tizen.dynamicanalyzer.ui.memory.table;
+import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.tizen.dynamicanalyzer.ui.memory.MemoryPersistentAllocationsTableView;
import org.tizen.dynamicanalyzer.ui.memory.data.HeapDataManager;
import org.tizen.dynamicanalyzer.ui.memory.data.MemAllocDBTable;
-import org.tizen.dynamicanalyzer.ui.memory.table.MemoryPersistentAllocationsTable.MemoryPersistentAllocationsTableIndex;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineTableView;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
}
/**
+ * Last item added to Callstack table. It is required, because table items
+ * can be updated with data of further items.
+ */
+ GridItem lastItem;
+
+ /**
* Public constructor.
*
* @param parent parent composite
*/
public void updateCallstackTable(DASelectionData selData) {
table.removeAll();
- if (null == selData) {
+ if (!isSelectionValid(selData)) {
return;
}
- String viewId = selData.getViewID();
- if (!viewId.equals(MemoryPersistentAllocationsTableView.class.getName()))
+ DATableDataFormat tableData = (DATableDataFormat) ((GridItem[])selData.getData())[0].getData();
+
+ List<Object> memAllocationData = tableData.getData();
+ long seqNum = (long) getMemAllocationDataByColumnIndex(memAllocationData, MemoryPersistentAllocationsTableIndex.SEQ.getIndex());
+ long time = (long) getMemAllocationDataByColumnIndex(memAllocationData, MemoryPersistentAllocationsTableIndex.TIMESTAMP.getIndex());
+ long allocCallerAddr = getCallerAddr(memAllocationData, seqNum);
+ int pid = (int) getMemAllocationDataByColumnIndex(memAllocationData, MemoryPersistentAllocationsTableIndex.PID.getIndex());
+ String allocCallerPath = (String) getMemAllocationDataByColumnIndex(memAllocationData, MemoryPersistentAllocationsTableIndex.LIBRARY.getIndex());
+ String allocName = (String) getMemAllocationDataByColumnIndex(memAllocationData, MemoryPersistentAllocationsTableIndex.CALLED.getIndex());
+
+ Map<Long, CallStackUnit> addrMap = Global.getRuntimeCallstackManager()
+ .getCallStackApiAddrByPidMap(pid);
+ if ((null == addrMap) || (addrMap.isEmpty())) {
return;
+ }
- Object obj = selData.getData();
- if (obj instanceof GridItem[]) {
- GridItem[] items = (GridItem[]) obj;
- if (items.length <= 0) {
+ List<Long> addrs = getAddrs(seqNum);
+ if (null == addrs) {
+ // FIXME: actually below is too strong suggestion, any other issue
+ // may occur while getting addresses
+ // This case may occurred if sequence number is above Long.MAX_VALUE
+ addrs = getAddrs(Long.MAX_VALUE);
+ if (null == addrs) {
+ Logger.error("Function entry or exit not found");
return;
}
- DATableDataFormat tableData = (DATableDataFormat) items[0].getData();
-
- long seqNum = -1;
- long time = -1;
- long allocCallerAddr = 0;
- int pid = 0;
- String allocPath = null;
- String allocName = null;
-
- if (tableData.getType() == AnalyzerConstants.TYPE_TABLE_MEM_ALLOCATEDTRACE) {
- List<Object> memAllocationData = tableData.getData();
- seqNum = (Long) memAllocationData.get(MemoryPersistentAllocationsTableIndex.SEQ.getIndex());
- time = (Long) memAllocationData
- .get(MemoryPersistentAllocationsTableIndex.TIMESTAMP
- .getIndex());
- allocPath = (String) memAllocationData.get(MemoryPersistentAllocationsTableIndex.LIBRARY.getIndex());
- allocName = (String) memAllocationData
- .get(MemoryPersistentAllocationsTableIndex.CALLED.getIndex());
- pid = (Integer) memAllocationData.get(MemoryPersistentAllocationsTableIndex.PID.getIndex());
- List<Object> row = getAllocationInfo(seqNum);
- if (row!=null)
- allocCallerAddr = (long) row.get(MemAllocDBTable.COLUMN.CALLER_PC_ADDRESS.index);
- }
+ }
+ long allocAddr = (long) HeapDataManager.getInstance().getAllocatorAddrBySeqFromDB(seqNum);
+ String allocPath = Global.getLibraryName(Global.getBinaryID(pid, time, allocAddr));
+ fillAllocationFields(time, pid, allocName, allocCallerAddr, allocCallerPath,
+ allocAddr, allocPath);
+ // --------------------------------
- Map<Long, CallStackUnit> addrMap = Global.getRuntimeCallstackManager().getCallStackApiAddrByPidMap(pid);
+ if (addrs.isEmpty())
+ return;
+ if (allocCallerPath.equals(Global.getLibraryName(addrMap.get(addrs.get(0)).getBinaryID()))) {
+ // this case occurred when allocation performed from profiled application.
+ lastItem.setText(0, addrMap.get(addrs.get(0)).getFunctionName());
+ if (addrs.size() > 1)
+ lastItem.setData(
+ AnalyzerConstants.MEM_CALLSTACK_KEY_CALLER_ADDRESS,
+ addrs.get(1));
+ lastItem.setData(
+ AnalyzerConstants.MEM_CALLSTACK_KEY_FUNCTION_START_ADDRESS,
+ addrMap.get(addrs.get(0)).getFunctionStartAddr());
+ // in this case addrs first element is already in table, so it
+ // should be removed.
+ addrs.remove(0);
+ }
- if ((null == addrMap) || (addrMap.isEmpty())) {
- return;
- }
+ // --------------------------------
- List<Long> addrs = getAddrs(seqNum);
+ if (!addrs.isEmpty())
+ fillCallstackFields(addrs, addrMap, pid, time);
- if (null == addrs) {
- //FIXME: actually below is too strong suggestion, any other issue may occur while getting addrs
- addrs = getAddrs(Long.MAX_VALUE); // This case may occured if seq Num is above Long.MAX_VALUE
- if (null == addrs) {
- Logger.error("Function entry or exit not found");
- return;
- }
- }
+ }
- DATableDataFormat callstackTableData = new DATableDataFormat(allocCallerAddr);
- callstackTableData.setType(AnalyzerConstants.TYPE_TABLE_MEM_CALLSTACK);
- callstackTableData.setObject(allocCallerAddr);
- GridItem gridItem = new GridItem(table, SWT.NONE);
- gridItem.setData(callstackTableData);
- gridItem.setData(AnalyzerConstants.CALLSTACK_KEY_ADDR, 0L);
- gridItem.setData(AnalyzerConstants.CALLSTACK_KEY_PID, pid);
- gridItem.setData(AnalyzerConstants.CALLSTACK_KEY_TIME, time);
- gridItem.setData(AnalyzerConstants.CALLSTACK_KEY_LIBNAME, "");
- gridItem.setData(
- AnalyzerConstants.MEM_CALLSTACK_KEY_CALLER_ADDRESS,
- allocCallerAddr);
- gridItem.setData(
- AnalyzerConstants.MEM_CALLSTACK_KEY_FUNCTION_START_ADDRESS,
- 0L);
-
- gridItem.setText(0, allocName);
- gridItem.setText(1, UNKNOWN);
- gridItem.setText(2, UNKNOWN_LIBRARY);
-
- gridItem = new GridItem(table, SWT.NONE);
- gridItem.setData(callstackTableData);
- gridItem.setData(AnalyzerConstants.CALLSTACK_KEY_ADDR, allocCallerAddr);
- gridItem.setData(AnalyzerConstants.CALLSTACK_KEY_PID, pid);
- gridItem.setData(AnalyzerConstants.CALLSTACK_KEY_TIME, time);
- gridItem.setData(AnalyzerConstants.CALLSTACK_KEY_LIBNAME, allocPath);
- gridItem.setData(
- AnalyzerConstants.MEM_CALLSTACK_KEY_CALLER_ADDRESS, 0L);
- gridItem.setData(
- AnalyzerConstants.MEM_CALLSTACK_KEY_FUNCTION_START_ADDRESS,
- 0L);
-
- gridItem.setText(0, UNKNOWN);
- String addrInput = (allocCallerAddr == 0)
- ? UNKNOWN
- : Formatter.toHexString(Long.toString(allocCallerAddr)).toLowerCase(); //$NON-NLS-1$
- gridItem.setText(1, addrInput);
- gridItem.setText(2, allocPath);
-
- int size = addrs.size();
- for (int i = 0; i < size; i++) {
- String hexAddr = Formatter.toHexString(addrs.get(i).toString());
- CallStackUnit api = addrMap.get(addrs.get(i));
-
- if (null == api) {
- Logger.debug("callstackunit for addr : " + hexAddr
- + " not found");
- break;
- }
+ /**
+ * Check that selected data are valid. Data assumed to be valid if it is not
+ * null, correctly initialized item of Persistent Allocations table.
+ *
+ * @param selData selected data
+ * @return {@code true} if selected data is valid
+ */
+ private boolean isSelectionValid(DASelectionData selData) {
+ if (null == selData) {
+ return false;
+ }
+ String viewId = selData.getViewID();
+ if (!viewId.equals(MemoryPersistentAllocationsTableView.class
+ .getName()))
+ return false;
- String path = api.getPath();
- if (null == path) {
- Logger.debug("callstackunit for addr : " + hexAddr
- + " not found");
- break;
- }
+ Object obj = selData.getData();
+ if (!(obj instanceof GridItem[])) {
+ return false;
+ }
+ GridItem[] items = (GridItem[]) obj;
+ if (items.length <= 0) {
+ return false;
+ }
+ DATableDataFormat tableData = (DATableDataFormat) items[0].getData();
+ if (tableData.getType() != AnalyzerConstants.TYPE_TABLE_MEM_ALLOCATEDTRACE) {
+ return false;
+ }
+ return true;
+ }
- long address = addrs.get(i);
- if (i==0){
- if(allocPath.equals(Global.getLibraryName(api.getBinaryID()))){
- gridItem.setText(0, api.getFunctionName());
- gridItem.setData(
- AnalyzerConstants.MEM_CALLSTACK_KEY_CALLER_ADDRESS,
- addrs.get(1));
- gridItem.setData(
- AnalyzerConstants.MEM_CALLSTACK_KEY_FUNCTION_START_ADDRESS,
- api.getFunctionStartAddr());
- continue;
- }else{
- if (addrs.size() > 1)
- address = 0L;
- }
- }
+ /**
+ * Add 2 items to Memory callstack table: 1 - called allocation function
+ * info, 2 - information about allocation caller.
+ * @param time time when allocation was performed
+ * @param pid identifier of process
+ * @param allocName name of called allocation function
+ * @param allocCallerAddr address of allocation caller instruction
+ * @param allocCallerPath library from where allocation was called
+ * @param allocAddr address of allocator
+ * @param allocPath library which allocator belongs to
+ */
+ private void fillAllocationFields(long time, int pid,
+ String allocName, long allocCallerAddr, String allocCallerPath, long allocAddr, String allocPath) {
+ DATableDataFormat callstackTableData = new DATableDataFormat(allocCallerAddr);
+ callstackTableData.setType(AnalyzerConstants.TYPE_TABLE_MEM_CALLSTACK);
+ callstackTableData.setObject(allocCallerAddr);
+
+ GridItem gridItem = createGridItem(callstackTableData, 0L, pid, time, "", allocCallerAddr, 0L);
+ gridItem.setText(0, allocName);
+ gridItem.setText(1, allocAddr == 0 ? UNKNOWN : formatLongAddr(allocAddr));
+ gridItem.setText(2, allocPath.isEmpty() ? UNKNOWN_LIBRARY : allocPath);
+ gridItem = createGridItem(callstackTableData, allocCallerAddr, pid, time, allocCallerPath,
+ 0L, 0L);
+ gridItem.setText(0, UNKNOWN);
+ String addrInput = (allocCallerAddr == 0) ? UNKNOWN : formatLongAddr(allocCallerAddr); //$NON-NLS-1$
+ gridItem.setText(1, addrInput);
+ gridItem.setText(2, allocCallerPath);
+ }
- gridItem = new GridItem(table, SWT.NONE);
- // setData block
- callstackTableData = new DATableDataFormat(address);
- callstackTableData.setType(AnalyzerConstants.TYPE_TABLE_MEM_CALLSTACK);
- callstackTableData.setObject(address);
- gridItem.setData(callstackTableData);
- gridItem.setData(AnalyzerConstants.CALLSTACK_KEY_ADDR, address);
- gridItem.setData(AnalyzerConstants.CALLSTACK_KEY_PID, pid);
- gridItem.setData(AnalyzerConstants.CALLSTACK_KEY_TIME, time);
- gridItem.setData(AnalyzerConstants.CALLSTACK_KEY_LIBNAME, path);
- if (i + 1 < addrs.size())
- gridItem.setData(AnalyzerConstants.MEM_CALLSTACK_KEY_CALLER_ADDRESS, addrs.get(i+1));
- else
- gridItem.setData(
- AnalyzerConstants.MEM_CALLSTACK_KEY_CALLER_ADDRESS,
- 0L);
- gridItem.setData(
- AnalyzerConstants.MEM_CALLSTACK_KEY_FUNCTION_START_ADDRESS,
- api.getFunctionStartAddr());
-
- addrInput = (address == 0) ? UNKNOWN : hexAddr; //$NON-NLS-1$
- gridItem.setText(1, addrInput.toLowerCase());
- String fName = api.getFunctionName();
- gridItem.setText(0, fName);
- gridItem.setText(2, path);
+ /**
+ * Add a callstack of function from where allocation was called.
+ *
+ * @param addrs list with addresses of functions in callstack
+ * @param addrMap map with callstack units, contains info about each
+ * function in callstack
+ * @param pid identifier of process
+ * @param time time when allocation was performed
+ */
+ private void fillCallstackFields(List<Long> addrs,
+ Map<Long, CallStackUnit> addrMap, int pid, long time) {
+
+ for (int i = 0; i < addrs.size(); i++) {
+ String hexAddr = Formatter.toHexString(addrs.get(i).toString());
+ CallStackUnit api = addrMap.get(addrs.get(i));
+ if (null == api) {
+ Logger.debug("callstackunit for addr : " + hexAddr
+ + " not found");
+ break;
+ }
+ if (null == api.getPath()) {
+ Logger.debug("callstackunit for addr : " + hexAddr
+ + " not filled");
+ break;
}
+
+ long address = addrs.get(i);
+ // setData block
+ DATableDataFormat callstackTableData = new DATableDataFormat(address);
+ callstackTableData.setType(AnalyzerConstants.TYPE_TABLE_MEM_CALLSTACK);
+ callstackTableData.setObject(address);
+
+ long nextAddr = 0L;
+ if (i + 1 < addrs.size())
+ nextAddr = addrs.get(i + 1);
+ GridItem gridItem = createGridItem(callstackTableData, address, pid,
+ time, api.getPath(), nextAddr, api.getFunctionStartAddr());
+ String addrInput = (address == 0) ? UNKNOWN : hexAddr; //$NON-NLS-1$
+ gridItem.setText(1, addrInput.toLowerCase());
+ gridItem.setText(0, api.getFunctionName());
+ gridItem.setText(2, api.getPath());
}
}
/**
+ * Create grid item for Callstack table.
+ *
+ * @param callstackTableData represents data for item
+ * @param addr address of instruction described in this table item
+ * @param pid process identifier
+ * @param time time when allocation was performed
+ * @param allocPath library from where allocation was called
+ * @param callerAddr address of caller
+ * @param memFuncAddr address of source code
+ * @return GridItem representing all this data
+ */
+ private GridItem createGridItem(DATableDataFormat callstackTableData,
+ long addr, int pid, long time, String allocPath,
+ long callerAddr, long memFuncAddr) {
+ GridItem gridItem = new GridItem(table, SWT.NONE);
+ gridItem.setData(callstackTableData);
+ gridItem.setData(AnalyzerConstants.CALLSTACK_KEY_ADDR, addr);
+ gridItem.setData(AnalyzerConstants.CALLSTACK_KEY_PID, pid);
+ gridItem.setData(AnalyzerConstants.CALLSTACK_KEY_TIME, time);
+ gridItem.setData(AnalyzerConstants.CALLSTACK_KEY_LIBNAME, allocPath);
+ gridItem.setData(AnalyzerConstants.MEM_CALLSTACK_KEY_CALLER_ADDRESS,
+ callerAddr);
+ gridItem.setData(
+ AnalyzerConstants.MEM_CALLSTACK_KEY_FUNCTION_START_ADDRESS,
+ memFuncAddr);
+ lastItem = gridItem;
+ return gridItem;
+ }
+
+ /**
+ * Extract an index specified piece of data from a row in memory Persistent
+ * Allocations table.
+ *
+ * @param memAllocationData row from memory Persistent Allocations table
+ * @param index index of element in row
+ * @return a corresponding piece of data or null if failed to extract
+ */
+ private Object getMemAllocationDataByColumnIndex(List<Object> memAllocationData, int index) {
+ if (memAllocationData != null)
+ if (memAllocationData.get(index) != null)
+ return memAllocationData.get(index);
+ return null;
+ }
+
+ /**
+ * Extract caller address from memory allocation data.
+ *
+ * @param memAllocationData memory allocation data
+ * @param seqNum sequence number of allocation call
+ * @return caller address or -1 if failed to extract
+ */
+ private long getCallerAddr(List<Object> memAllocationData, long seqNum) {
+ List<Object> row = getAllocationInfo(seqNum);
+ if (row != null)
+ return (long) row.get(MemAllocDBTable.COLUMN.CALLER_PC_ADDRESS.index);
+ return -1;
+ }
+
+ /**
* Request {@link MemAllocDBTable} for row data for allocation operation
* with specified sequence number.
*
* @return unmodifiable list of addresses
*/
private List<Long> getAddrs(long seqNum) {
+ List<Long> res = new ArrayList<Long>();
RuntimeCallstackManager callstackManager = Global
.getRuntimeCallstackManager();
if (callstackManager.getCallStackDataBySeqMap().floorEntry(seqNum) == null)
return null;
- return callstackManager.getCallStackDataBySeqMap().floorEntry(seqNum)
- .getValue().getAddrs();
+ res.addAll(callstackManager.getCallStackDataBySeqMap()
+ .floorEntry(seqNum).getValue().getAddrs());
+ return res;
}
@Override
// TODO Auto-generated method stub
return null;
}
+
+ /**
+ * Format address as a hex string
+ * @param addr address as long value
+ * @return hex string in lower case presenting the address
+ */
+ private String formatLongAddr(long addr) {
+ return Formatter
+ .toHexString(Long.toString(addr)).toLowerCase();
+ }
}
\ No newline at end of file
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;\r
import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite;\r
import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;\r
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;\r
import org.tizen.dynamicanalyzer.util.Logger;\r
import org.tizen.dynamicanalyzer.utils.Formatter;\r
\r
comparator.setType(AnalyzerConstants.SORT_TYPE_NONE);\r
comparator.setColumn(0);\r
\r
- parent.addControlListener(new TableColumnSizePackListener(this, columnSizes));\r
}\r
\r
public void setSelectionRange(Long start, Long end, Long current) {\r
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
public class MemoryMapTable extends DATreeComposite {
comparator.setType(AnalyzerConstants.SORT_TYPE_NUM);
comparator.setColumn(3);
- parent.addControlListener(
- new TableColumnSizePackListener(this, columnSizes));
}
/**
import org.eclipse.nebula.widgets.grid.Grid;
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.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.common.DAState;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
import org.tizen.dynamicanalyzer.widgets.timeline.MarkerManager;
public class MemoryPersistentAllocationsTable extends DATableComposite {
- public enum MemoryPersistentAllocationsTableIndex{
- SEQ(0),
- TIMESTAMP(1),
- PID(2),
- TID(3),
- ALLOCATED_ADDRESS(4),
- SIZE(5),
- LIBRARY(6),
- CALLED(7),
- EMPTY(8),
- RUNTIME_STUB(9);
-
- private int index;
- private MemoryPersistentAllocationsTableIndex(int index){
- this.index = index;
- }
- public int getIndex(){
- return index;
- }
- }
-
- private int COLUMN_SIZE__SEQ = 60;
- private int COLUMN_SIZE__TIMESTAMP = 105;
- private int COLUMN_SIZE__PID = 40;
- private int COLUMN_SIZE__TID = 40;
- private int COLUMN_SIZE__ALLOCATED_ADDRESS = 90;
- private int COLUMN_SIZE__SIZE = 45;
- private int COLUMN_SIZE__LIBRARY = 205;
- private int COLUMN_SIZE__CALLED = 115;
-
private Long StartTime;
private Long EndTime;
setTableName(MemoryPageLabels.MEMORY_ALLOCATION_TRACE_VIEW_TITLE);
setComparator(new DefaultTableComparator());
- setSortTypes(new int[] { 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_STRING,
- AnalyzerConstants.SORT_TYPE_STRING,
- AnalyzerConstants.SORT_TYPE_NONE,
- AnalyzerConstants.SORT_TYPE_STRING });
- setColumnAlignment(new int[] { SWT.RIGHT, SWT.CENTER, SWT.RIGHT,
- SWT.RIGHT, SWT.RIGHT, SWT.RIGHT, SWT.LEFT, SWT.CENTER,
- SWT.LEFT, SWT.CENTER });
- setColumns(new String[] {
- MemoryPageLabels.MEMORY_ALLOCATION_TRACE_VIEW_SEQ,
- MemoryPageLabels.MEMORY_ALLOCATION_TRACE_VIEW_TIMESTAMP,
- MemoryPageLabels.MEMORY_ALLOCATION_TRACE_VIEW_PID,
- MemoryPageLabels.MEMORY_ALLOCATION_TRACE_VIEW_TID,
- MemoryPageLabels.MEMORY_ALLOCATION_TRACE_VIEW_ALLOCATED_ADDRESS,
- MemoryPageLabels.MEMORY_ALLOCATION_TRACE_VIEW_SIZE,
- MemoryPageLabels.MEMORY_ALLOCATION_TRACE_VIEW_LIBRARY,
- MemoryPageLabels.MEMORY_ALLOCATION_TRACE_VIEW_CALLED_FUNCTION,
- "",
- "Streaming is not supported. Please select range or stop Tracing"
- });
+ setSortTypes(MemoryPersistentAllocationsTableIndex.getSortTypes());
+ setColumnAlignment(MemoryPersistentAllocationsTableIndex.getAlignments());
+ setColumns(MemoryPersistentAllocationsTableIndex.getNames());
- int[] columnSizes = { COLUMN_SIZE__SEQ, COLUMN_SIZE__TIMESTAMP,
- COLUMN_SIZE__PID, COLUMN_SIZE__TID,
- COLUMN_SIZE__ALLOCATED_ADDRESS, COLUMN_SIZE__SIZE, COLUMN_SIZE__LIBRARY,
- COLUMN_SIZE__CALLED, 15, 800 };
+ int[] columnSizes = MemoryPersistentAllocationsTableIndex.getSizes();
setColumnSize(columnSizes);
setTableToolTipEnable(false);
- parent.addControlListener(new TableColumnSizePackListener(this, columnSizes));
+ // hide 'seq #' column
+ table.getColumn(0).setVisible(false);
+
table.addSelectionListener(new SelectionListener() {
@Override
return;
}
List<Object> markerData = ((DATableDataFormat) ti[0].getData()).getData();
- long markerTime = (Long) markerData.get(1);
+ long markerTime = (Long) markerData.get(MemoryPersistentAllocationsTableIndex.TIMESTAMP.getIndex());
MarkerManager.INSTANCE.addMarker(markerTime);
}
}
});
-
- initFilterPopupMenu();
}
public void setSelectionRange(Long start, Long end){
EndTime = end;
}
+ /**
+ * Check is interval selected or not.
+ *
+ * @return {@code true} if interval is selected and {@code false} otherwise.
+ */
+ public boolean isSelectionPerformed() {
+ return StartTime != EndTime;
+ }
@Override
protected List<TableInput> makeTableInput() {
List<TableInput> output = new ArrayList<TableInput>();
return output;
}
- if (isFilter) {
- output = filteredTable;
- return output;
- }
-
if(DAState.isRunning() == false) {
if(StartTime == 0 && EndTime == 0 && Toolbar.INSTANCE.getSelectedPid() <= 0) {
List<TableInput> wholedata = HeapDataManager.getInstance().getWholeAllocationTraceTreeInput();
if(wholedata.size() != 0) {
- tableClone = wholedata;
return wholedata;
}
}
TableInput alloInput = HeapDataManager.getInstance().makeTreeInputForLeakData(iAllocData, index++);
if (alloInput != null){
- ((DATableDataFormat)alloInput.getData()).setType(AnalyzerConstants.TYPE_TABLE_MEM_ALLOCATEDTRACE);
output.add(alloInput);
}
}
- tableClone = output;
return output;
}
--- /dev/null
+package org.tizen.dynamicanalyzer.ui.memory.table;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
+import org.tizen.dynamicanalyzer.nl.MemoryPageLabels;
+
+/**
+ * Enum representing 'Persistent Allocations' table columns.
+ */
+public enum MemoryPersistentAllocationsTableIndex{
+ // @formatter:off
+ SEQ(0, 60, AnalyzerConstants.SORT_TYPE_NUM, SWT.RIGHT,
+ MemoryPageLabels.MEMORY_ALLOCATION_TRACE_VIEW_SEQ),
+ TIMESTAMP(1, 105, AnalyzerConstants.SORT_TYPE_NUM, SWT.CENTER,
+ MemoryPageLabels.MEMORY_ALLOCATION_TRACE_VIEW_TIMESTAMP),
+ PID(2, 40, AnalyzerConstants.SORT_TYPE_NUM, SWT.RIGHT,
+ MemoryPageLabels.MEMORY_ALLOCATION_TRACE_VIEW_PID),
+ TID(3, 40, AnalyzerConstants.SORT_TYPE_NUM, SWT.RIGHT,
+ MemoryPageLabels.MEMORY_ALLOCATION_TRACE_VIEW_TID),
+ ALLOCATED_ADDRESS(4, 90, AnalyzerConstants.SORT_TYPE_NUM, SWT.RIGHT,
+ MemoryPageLabels.MEMORY_ALLOCATION_TRACE_VIEW_ALLOCATED_ADDRESS),
+ SIZE(5, 45, AnalyzerConstants.SORT_TYPE_NUM, SWT.RIGHT,
+ MemoryPageLabels.MEMORY_ALLOCATION_TRACE_VIEW_SIZE),
+ LIBRARY(6, 205, AnalyzerConstants.SORT_TYPE_STRING, SWT.LEFT,
+ MemoryPageLabels.MEMORY_ALLOCATION_TRACE_VIEW_LIBRARY),
+ CALLED(7, 115, AnalyzerConstants.SORT_TYPE_STRING, SWT.CENTER,
+ MemoryPageLabels.MEMORY_ALLOCATION_TRACE_VIEW_CALLED_FUNCTION),
+ LEAK(8, 60, AnalyzerConstants.SORT_TYPE_GRID, SWT.RIGHT,
+ MemoryPageLabels.MEMORY_ALLOCATION_TRACE_VIEW_LEAK),
+ EMPTY(9, 15, AnalyzerConstants.SORT_TYPE_NONE, SWT.LEFT,
+ "");
+ // @formatter:on
+
+ private int index;
+ private int size;
+ private int sortType;
+ private int alignment;
+ private String name;
+
+ /**
+ * Creates a new column instance given its {@code index}, {@code size},
+ * {@code sortType}, {@code alignment} and {@code name}.
+ *
+ * @param index column index
+ * @param size column size
+ * @param sortType column content type for sorting
+ * @param alignment column {@link SWT} alignment
+ * @param name column name
+ */
+ private MemoryPersistentAllocationsTableIndex(int index, int size, int sortType, int alignment, String name) {
+ this.index = index;
+ this.size = size;
+ this.sortType = sortType;
+ this.alignment = alignment;
+ this.name = name;
+ }
+
+ public int getIndex() {
+ return index;
+ }
+
+ public int getSize() {
+ return size;
+ }
+
+ public int getSortType() {
+ return sortType;
+ }
+
+ public int getAlignment() {
+ return alignment;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Static part: column fields registry for easier table initialization.
+ */
+
+ private static List<Integer> sizes = new ArrayList<Integer>();
+ private static List<Integer> sortTypes = new ArrayList<Integer>();
+ private static List<Integer> alignments = new ArrayList<Integer>();
+ private static List<String> names = new ArrayList<String>();
+
+ /**
+ * NOTE: following code could not be placed in instance constructor because
+ * instance constructors in enums are always executed before any static
+ * initialization blocks, meaning that all static fields will not be
+ * initialized yet and could not be used without manual initialization.
+ */
+ static {
+ for (MemoryPersistentAllocationsTableIndex col : MemoryPersistentAllocationsTableIndex.values()) {
+ sizes.add(col.getSize());
+ sortTypes.add(col.getSortType());
+ alignments.add(col.getAlignment());
+ names.add(col.getName());
+ }
+ }
+
+ /**
+ * Helper method to convert {@code Integer} list t0 {@code int} array.
+ *
+ * @param list list to convert
+ * @return resulting array
+ */
+ private static int[] intListToArray(List<Integer> list) {
+ int[] result = new int[list.size()];
+ for (int i = 0; i < result.length; ++i)
+ result[i] = list.get(i);
+
+ return result;
+ }
+
+ public static int[] getSizes() {
+ return intListToArray(sizes);
+ }
+
+ public static int[] getSortTypes() {
+ return intListToArray(sortTypes);
+ }
+
+ public static int[] getAlignments() {
+ return intListToArray(alignments);
+ }
+
+ public static String[] getNames() {
+ return names.toArray(new String[0]);
+ }
+}
import org.tizen.dynamicanalyzer.ui.memory.data.HeapDataManager;\r
import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite;\r
import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;\r
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;\r
\r
public class MemoryStatisticsTable extends DATreeComposite {\r
- private int[] columnSizes = { 265, 140, 90, 90, 90, 110, 15, 800 };\r
+ private int[] columnSizes = {265, 140, 90, 90, 90, 110, 15};\r
private int[] columnAlignment = { SWT.LEFT, SWT.RIGHT, SWT.RIGHT, SWT.RIGHT,\r
- SWT.RIGHT, SWT.RIGHT, SWT.RIGHT, SWT.CENTER };\r
-\r
- private boolean[] columnVisibilityEnable = { true, true, true, true, true, true, true, false };\r
- private boolean[] columnVisibilityDisable = { false, false, false, false, false, false, false, true };\r
+ SWT.RIGHT, SWT.RIGHT, SWT.RIGHT};\r
\r
private Long StartTime;\r
private Long EndTime;\r
MemoryPageLabels.MEMORY_STATISTICS_VIEW_FREED,\r
MemoryPageLabels.MEMORY_STATISTICS_VIEW_PERSISTENT,\r
MemoryPageLabels.MEMORY_STATISTICS_VIEW_TOTAL_BYTE,\r
- MemoryPageLabels.MEMORY_STATISTICS_VIEW_PERSISTENT_BYTE,
- "",\r
- "Streaming is not supported. Please select range or stop Tracing"\r
+ MemoryPageLabels.MEMORY_STATISTICS_VIEW_PERSISTENT_BYTE,\r
+ ""\r
};\r
\r
private int[] sortTypes = { AnalyzerConstants.SORT_TYPE_STRING, AnalyzerConstants.SORT_TYPE_NUM,\r
AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM,\r
AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM,\r
- AnalyzerConstants.SORT_TYPE_NONE, AnalyzerConstants.SORT_TYPE_NONE\r
+ AnalyzerConstants.SORT_TYPE_NONE\r
};\r
\r
public MemoryStatisticsTable(Composite parent, int style, int tableStyle) {
comparator.setType(AnalyzerConstants.SORT_TYPE_NUM);\r
comparator.setColumn(1);\r
- parent.addControlListener(new TableColumnSizePackListener(this, columnSizes));\r
}\r
public void setSelectionRange(Long start, Long end){
EndTime = end;\r
}\r
\r
+ /**\r
+ * Check is interval selected or not.\r
+ *\r
+ * @return {@code true} if interval is selected and {@code false} otherwise.\r
+ */\r
+ public boolean isSelectionPerformed() {\r
+ return StartTime != EndTime;\r
+ }\r
+\r
@Override\r
public List<TreeInput> makeTreeInput() {\r
List<TreeInput> output = new ArrayList<TreeInput>();
StartTime = (long)0;\r
EndTime = (long)0;\r
}\r
-\r
- /**\r
- * Set column visibility state corresponding to two table states:\r
- * {@code enabled == true} - data columns are visible, warning column is hidden\r
- * {@code enabled == false} - data columns are hidden, warning columns is visible\r
- *\r
- * @param enabled column state to set\r
- */\r
- public void setColumnVisibilityState(boolean enabled) {\r
- if (enabled) {\r
- setColumnVisibility(columnVisibilityEnable);\r
- } else {\r
- setColumnVisibility(columnVisibilityDisable);\r
- }\r
- }\r
}
import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
import org.tizen.dynamicanalyzer.ui.toolbar.Toolbar;
import org.tizen.dynamicanalyzer.ui.widgets.DAAdvancedViewComposite;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
import org.tizen.dynamicanalyzer.util.Logger;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
tableComp.setColumns(columnNames);
tableComp.setColumnSize(columnSizes);
tableComp.setTableName(NetworkPageLabels.NETWORK_API_LIST_VIEW_TITLE);
- contents.addControlListener(new TableColumnSizePackListener(tableComp, columnSizes));
setTable(tableComp);
}
package org.tizen.dynamicanalyzer.ui.network;
-import java.util.Map;
-
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.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Sash;
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.setting.SettingDataManager;
import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
-import org.tizen.dynamicanalyzer.swap.logparser.DataManagerRegistry;
import org.tizen.dynamicanalyzer.ui.network.data.NetworkDataManager;
-import org.tizen.dynamicanalyzer.ui.page.BaseView;
-import org.tizen.dynamicanalyzer.ui.page.PageInfoRegistry;
-import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineTableView;
-import org.tizen.dynamicanalyzer.util.Logger;
-import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
-import org.tizen.dynamicanalyzer.widgets.da.view.DABaseComposite;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DABaseDataPageComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DATabComposite;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
-public class NetworkPage extends DAPageComposite {
+public class NetworkPage extends DABaseDataPageComposite {
public static final String pageID = NetworkPage.class.getName();
public static final String chartViewID = NetworkChartView.class.getName();
public static final String listViewID = NetworkAPIListView.class.getName();
private DATabComposite networkAPITableView = null;
- SashForm baseForm;
- SashForm topForm;
- SashForm bottomForm;
-
- boolean isDetailMode = true;
-
- int tableHeight = -1;
- int tableWeight = 65;
-
- boolean wasSashCreated = false;
-
public NetworkPage(Composite parent, int style) {
super(parent, style);
setTitle(AnalyzerLabels.COOLBAR_AREA_NETWORK);
- this.setData(DAPageComposite.KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_NETWORK_TOOLTIP);
+ this.setData(KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_NETWORK_TOOLTIP);
this.setBackground(ColorResources.WHITE);
this.setLayout(new FillLayout());
- baseForm = new SashForm(this, SWT.VERTICAL);
- baseForm.setLayout(new FillLayout());
- baseForm.setForeground(ColorResources.WHITE);
- baseForm.setBackground(ColorResources.WHITE);
// ((FillLayout) getLayout()).marginHeight = 15;
// ((FillLayout) getLayout()).marginWidth = 5;
- topForm = new SashForm(baseForm, SWT.VERTICAL);
NetworkChartView networkChartView = new NetworkChartView(topForm, SWT.NONE);
addView(networkChartView);
- bottomForm = new SashForm(baseForm, SWT.HORIZONTAL);
-
- SashForm bottomLeftForm = new SashForm(bottomForm, SWT.NONE);
- bottomLeftForm.setForeground(ColorResources.WHITE);
- bottomLeftForm.setLayout(new FillLayout());
-
- SashForm bottomRightForm = new SashForm(bottomForm, SWT.NONE);
- bottomRightForm.setForeground(ColorResources.WHITE);
- bottomRightForm.setLayout(new FillLayout());
-
networkAPITableView = new DATabComposite(bottomLeftForm, SWT.NONE, false, true);
{
NetworkAPIListView networkApiListView = new NetworkAPIListView(networkAPITableView.getContentComposite(), SWT.NONE);
addView(detailInfo);
}
addView(networkDetailTableView);
-
- topForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- bottomForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- bottomLeftForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- bottomRightForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
-
- bottomForm.setWeights(new int[] { tableWeight, 100 - tableWeight });
-
- addTableWeightListener();
- }
-
- private void addHeightWeightListener() {
- if(baseForm.getChildren().length > 2) {
- ((Sash)baseForm.getChildren()[2]).addListener(SWT.MouseUp, new Listener() {
- @Override
- public void handleEvent(Event event) {
- tableHeight = (int)((double)baseForm.getWeights()[0] / baseForm.getWeights()[0] + baseForm.getWeights()[1]) * baseForm.getSize().y * 1/1000;
- }
- });
-
- wasSashCreated = true;
- }
- }
-
- private void addTableWeightListener() {
- ((SashForm)bottomForm.getChildren()[0]).addListener(SWT.Resize, new Listener(){
- @Override
- public void handleEvent(Event event) {
- resizeTableButton();
- }
- });
}
@Override
- public Composite getTopTable() {
- DAViewComposite view = (DAViewComposite)this.networkAPITableView.getTopComposite();
- Composite comp = (Composite)view.getControl();
- Logger.debug(comp.toString());
- return comp;
- }
-
- public SashForm getBaseForm() {
- return baseForm;
- }
-
- public void setDetailMode(boolean mode) {
- isDetailMode = mode;
- }
-
- @Override
- protected void onResized(int width, int height) {
- if(!wasSashCreated) { // This variable needs to check whether a Sash was created to calculate height ratio between chart area and table area
- addHeightWeightListener();
- }
-
- resizePageButton();
- resizeTableButton();
-
- if(!isDetailMode) {
- baseForm.setWeights(new int[] { 100, 0 });
- } else {
- int hrate = (tableHeight == -1) ? (int) (TimelineTableView.DEFAULT_TABLE_VIEW_HEIGHT * 100 / height) :
- (int) (tableHeight * 100 / height);
-
- if(hrate > 100) {
- return;
- }
-
- baseForm.setWeights(new int[] { 100 - hrate, hrate });
- }
- }
-
- private void resizePageButton() {
- int width = WorkbenchUtil.getWorkbenchWindow().getShell().getBounds().width;
- int pageCount = PageInfoRegistry.getPageNamesByTarget(SettingDataManager.INSTANCE.getConnectedTargetOrSelected().getTargetName()).size();
-
- int newWidth = (width/pageCount > DATabComposite.LONG_TAB_WIDTH) ? DATabComposite.LONG_TAB_WIDTH : width/pageCount;
- ((BaseView)WorkbenchUtil.getViewPart(BaseView.ID)).getMainTab().updateTabButtonsWidth(newWidth);
- }
-
- private void resizeTableButton() {
- double weight = (double) bottomForm.getWeights()[0] / 1000;
- int width = (int) (WorkbenchUtil.getWorkbenchWindow().getShell().getBounds().width * weight);
- int tabCount = networkAPITableView.getTabButtons().size();
-
- int newWidth = (width/tabCount > DATabComposite.LONG_TAB_WIDTH) ? DATabComposite.LONG_TAB_WIDTH : width/tabCount;
- networkAPITableView.updateTabButtonsWidth(newWidth);
- }
-
- @Override
public void clear() {
super.clear();
NetworkDataManager.getInstance().clear();
}
-
- @Override
- public void updateView() {
- for (Map.Entry<String, DABaseComposite> entry : childMap.entrySet()) {
- entry.getValue().updateView();
- }
- if(!isDetailMode) {
- if(baseForm.getChildren().length > 2) {
- ((Sash)baseForm.getChildren()[2]).setVisible(false);
- }
- } else {
- if(baseForm.getChildren().length > 2) {
- ((Sash)baseForm.getChildren()[2]).setVisible(true);
- }
- }
- }
}
import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
import org.tizen.dynamicanalyzer.ui.toolbar.Toolbar;
import org.tizen.dynamicanalyzer.ui.widgets.DAAdvancedViewComposite;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
import org.tizen.dynamicanalyzer.util.Logger;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
tableComp.setColumns(columnNames);
tableComp.setColumnSize(columnSizes);
tableComp.setTableName(NetworkPageLabels.NETWORK_API_LIST_VIEW_TITLE);
- contents.addControlListener(new TableColumnSizePackListener(tableComp, columnSizes));
setTable(tableComp);
}
package org.tizen.dynamicanalyzer.ui.opengl;
-import java.util.Map;
-
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.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Sash;
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
-import org.tizen.dynamicanalyzer.swap.logparser.DataManagerRegistry;
import org.tizen.dynamicanalyzer.ui.opengl.chart.GLChartView;
import org.tizen.dynamicanalyzer.ui.opengl.data.GLDataManager;
import org.tizen.dynamicanalyzer.ui.opengl.table.api.GLAPIListView;
import org.tizen.dynamicanalyzer.ui.opengl.table.state.GLRedundantTableView;
import org.tizen.dynamicanalyzer.ui.opengl.table.state.GLStatisticsTableView;
import org.tizen.dynamicanalyzer.ui.opengl.table.state.GLTextureTableView;
-import org.tizen.dynamicanalyzer.ui.page.BaseView;
-import org.tizen.dynamicanalyzer.ui.page.PageInfoRegistry;
-import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineTableView;
-import org.tizen.dynamicanalyzer.util.Logger;
-import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
-import org.tizen.dynamicanalyzer.widgets.da.view.DABaseComposite;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DABaseDataPageComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DATabComposite;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.setting.SettingDataManager;
-public class GLPage extends DAPageComposite {
+public class GLPage extends DABaseDataPageComposite {
public static final String pageID = GLPage.class.getName();
public static final String chartViewID = GLChartView.class.getName();
public static final String apiListViewID = GLAPIListView.class.getName();
private DATabComposite glLeftTableView = null;
private DATabComposite glRightTableView = null;
- SashForm baseForm;
- SashForm topForm;
- SashForm bottomForm;
- SashForm bottomLeftForm;
- SashForm bottomRightForm;
-
GLChartView glChartView;
GLAPIListView glAPIListView;
GLTextureTableView glTextureView;
GLStatisticsTableView glStatisticsView;
GLRedundantTableView glRedundantView;
-
- boolean isDetailMode = true;
-
- int tableHeight = -1;
- int tableWeight = 50;
-
- boolean wasSashCreated = false;
-
+
public GLPage(Composite parent, int style) {
super(parent, style);
setTitle(AnalyzerLabels.COOLBAR_AREA_OPENGLES);
- this.setData(DAPageComposite.KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_GRAPHICS_TOOLTIP);
+ this.setData(KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_GRAPHICS_TOOLTIP);
this.setBackground(ColorResources.WHITE);
this.setLayout(new FillLayout());
- baseForm = new SashForm(this, SWT.VERTICAL);
- baseForm.setLayout(new FillLayout());
- baseForm.setForeground(ColorResources.WHITE);
- baseForm.setBackground(ColorResources.WHITE);
-
- topForm = new SashForm(baseForm, SWT.VERTICAL);
+ setTableWeight(50);
+
GLChartView glChartView = new GLChartView(topForm, SWT.NONE);
addView(glChartView);
-
- bottomForm = new SashForm(baseForm, SWT.HORIZONTAL);
-
- bottomLeftForm = new SashForm(bottomForm, SWT.NONE);
- bottomLeftForm.setForeground(ColorResources.TAB_SELECTED_COLOR_START);
- bottomLeftForm.setLayout(new FillLayout());
-
- bottomRightForm = new SashForm(bottomForm, SWT.NONE);
- bottomRightForm.setForeground(ColorResources.TAB_SELECTED_COLOR_START);
- bottomRightForm.setLayout(new FillLayout());
-
+
glLeftTableView = new DATabComposite(bottomLeftForm, SWT.NONE, false, true);
{
GLStatisticsTableView glStatisticsView = new GLStatisticsTableView(glLeftTableView.getContentComposite(), SWT.NONE);
addView(glTextureTableView);
}
addView(glRightTableView);
-
- topForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- bottomForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- bottomLeftForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- bottomRightForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
-
- bottomForm.setWeights(new int[] { tableWeight, 100 - tableWeight });
-
- addTableWeightListener();
- }
-
- private void addTableWeightListener() {
- ((SashForm)bottomForm.getChildren()[0]).addListener(SWT.Resize, new Listener(){
- @Override
- public void handleEvent(Event event) {
- resizeLeftTableButton();
- resizeRightTableButton();
- }
- });
- }
-
- private void addHeightWeightListener() {
- if(baseForm.getChildren().length > 2) {
- ((Sash)baseForm.getChildren()[2]).addListener(SWT.MouseUp, new Listener() {
- @Override
- public void handleEvent(Event event) {
- tableHeight = (int)((double)baseForm.getWeights()[0] / baseForm.getWeights()[0] + baseForm.getWeights()[1]) * baseForm.getSize().y * 1/1000;
- }
- });
-
- wasSashCreated = true;
- }
- }
-
- @Override
- public Composite getTopTable() {
- DAViewComposite view = (DAViewComposite)this.glLeftTableView.getTopComposite();
- Composite comp = (Composite)view.getControl();
- Logger.debug(comp.toString());
- return comp;
- }
-
- public SashForm getBaseForm() {
- return baseForm;
- }
-
- public void setDetailMode(boolean mode) {
- isDetailMode = mode;
- }
-
- @Override
- protected void onResized(int width, int height) {
- if(!wasSashCreated) { // This variable needs to check whether a Sash was created to calculate height ratio between chart area and table area
- addHeightWeightListener();
- }
-
- resizePageButton();
- resizeLeftTableButton();
- resizeRightTableButton();
-
- if(!isDetailMode) {
- baseForm.setWeights(new int[] { 100, 0 });
- } else {
- int hrate = (tableHeight == -1) ? (int) (TimelineTableView.DEFAULT_TABLE_VIEW_HEIGHT * 100 / height) :
- (int) (tableHeight * 100 / height);
-
- if(hrate > 100) {
- return;
- }
-
- baseForm.setWeights(new int[] { 100 - hrate, hrate });
- }
- }
-
- private void resizePageButton() {
- int width = WorkbenchUtil.getWorkbenchWindow().getShell().getBounds().width;
- int pageCount = PageInfoRegistry.getPageNamesByTarget(SettingDataManager.INSTANCE.getConnectedTargetOrSelected().getTargetName()).size();
-
- int newWidth = (width/pageCount > DATabComposite.LONG_TAB_WIDTH) ? DATabComposite.LONG_TAB_WIDTH : width/pageCount;
- ((BaseView)WorkbenchUtil.getViewPart(BaseView.ID)).getMainTab().updateTabButtonsWidth(newWidth);
- }
-
- private void resizeLeftTableButton() {
- double weight = (double) bottomForm.getWeights()[0] / 1000;
- int width = (int) (WorkbenchUtil.getWorkbenchWindow().getShell().getBounds().width * weight);
- int tabCount = glLeftTableView.getTabButtons().size();
-
- int newWidth = (width/tabCount > DATabComposite.LONG_TAB_WIDTH) ? DATabComposite.LONG_TAB_WIDTH : width/tabCount;
- glLeftTableView.updateTabButtonsWidth(newWidth);
- }
-
- private void resizeRightTableButton() {
- double weight = (double) bottomForm.getWeights()[1] / 1000;
- int width = (int) (WorkbenchUtil.getWorkbenchWindow().getShell().getBounds().width * weight);
- int tabCount = glRightTableView.getTabButtons().size();
-
- int newWidth = (width/tabCount > DATabComposite.LONG_TAB_WIDTH) ? DATabComposite.LONG_TAB_WIDTH : width/tabCount;
- glRightTableView.updateTabButtonsWidth(newWidth);
}
@Override
super.clear();
GLDataManager.getInstance().clear();
}
-
- @Override
- public void updateView() {
- for (Map.Entry<String, DABaseComposite> entry : childMap.entrySet()) {
- entry.getValue().updateView();
- }
- if(!isDetailMode) {
- if(baseForm.getChildren().length > 2) {
- ((Sash)baseForm.getChildren()[2]).setVisible(false);
- }
- } else {
- if(baseForm.getChildren().length > 2) {
- ((Sash)baseForm.getChildren()[2]).setVisible(true);
- }
- }
- }
}
import java.util.HashMap;
+import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
}
- public static String getConstantString(int key) {
+ /**
+ * Returns OpenGL API constant name corresponding to a given {@code value}.
+ *
+ * @param value integer value
+ * @return name of the corresponding constant
+ */
+ public static String getAPIConstantString(int value) {
+ String result = getConstantString(value);
+ return result != null
+ ? result
+ : String.format(AnalyzerConstants.UNKNOWN_API + " (%d)", value);
+ }
+
+ /**
+ * Returns OpenGL API constant name corresponding to a given {@code value}.
+ *
+ * @param value integer value
+ * @return name of the corresponding constant or {@code null} if such
+ * constant is undefined
+ */
+ public static String getConstantString(int value) {
if (constantMap == null) {
initialize();
}
- return constantMap.get(key);
+
+ return constantMap.get(value);
}
public static String convertEnumValue(String arg, String splitChar, String[] removeChar) {
if (i == 0) {
returnValue.append(value);
} else {
- returnValue.append(CommonConstants.SPACE).append(CommonConstants.COMMA)
+ returnValue.append(CommonConstants.COMMA).append(CommonConstants.SPACE)
.append(value);
}
}
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
import org.tizen.dynamicanalyzer.ui.widgets.DAAdvancedViewComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
public class GLAPIListView extends DAAdvancedViewComposite {
glAPIListTable.setColumnVisibility(columnVisibility);
glAPIListTable.setTableToolTipEnable(true);
- contents.addControlListener(new TableColumnSizePackListener(glAPIListTable, columnSizes));
setTable(glAPIListTable);
}
import org.tizen.dynamicanalyzer.ui.widgets.DAAdvancedPopupMenu.ADVANCED_MENU_ITEM;
import org.tizen.dynamicanalyzer.ui.widgets.DAAdvancedViewComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
public class GLContextTableView extends DAAdvancedViewComposite {
tableComp.setColumnSize(columnSizes);
tableComp.setColumnVisibility(columnVisibility);
tableComp.setTableToolTipEnable(false);
- contents.addControlListener(new TableColumnSizePackListener(tableComp, columnSizes));
setTable(tableComp);
// disable filter menu
disableAdvancedMenuItem(ADVANCED_MENU_ITEM.FILTER.index);
import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSelectionData;
import org.tizen.dynamicanalyzer.ui.widgets.DAAdvancedViewComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
public class GLProgramTableView extends DAAdvancedViewComposite {
tableComp.setColumnVisibility(columnVisibility);
tableComp.setTableToolTipEnable(false);
- contents.addControlListener(new TableColumnSizePackListener(tableComp, columnSizes));
setTable(tableComp);
}
import org.tizen.dynamicanalyzer.ui.widgets.DAAdvancedPopupMenu.ADVANCED_MENU_ITEM;
import org.tizen.dynamicanalyzer.ui.widgets.DAAdvancedViewComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
public class GLRedundantTableView extends DAAdvancedViewComposite {
tableComp.setColumnSize(columnSizes);
tableComp.setColumnVisibility(columnVisibility);
tableComp.setTableToolTipEnable(false);
- contents.addControlListener(new TableColumnSizePackListener(tableComp, columnSizes));
setTable(tableComp);
// disable filter menu
disableAdvancedMenuItem(ADVANCED_MENU_ITEM.FILTER.index);
import org.tizen.dynamicanalyzer.nl.GLPageLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSelectionData;
-import org.tizen.dynamicanalyzer.ui.widgets.DAAdvancedViewComposite;
import org.tizen.dynamicanalyzer.ui.widgets.DAAdvancedPopupMenu.ADVANCED_MENU_ITEM;
+import org.tizen.dynamicanalyzer.ui.widgets.DAAdvancedViewComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
public class GLStatisticsTableView extends DAAdvancedViewComposite {
tableComp.setColumnSize(columnSizes);
tableComp.setColumnVisibility(columnVisibility);
tableComp.setTableToolTipEnable(false);
- contents.addControlListener(new TableColumnSizePackListener(tableComp, columnSizes));
setTable(tableComp);
// disable filter menu
disableAdvancedMenuItem(ADVANCED_MENU_ITEM.FILTER.index);
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.model.FilterProperty;
import org.tizen.dynamicanalyzer.model.TableInput;
String contextId = GLPageLabels.GL_CONTEXT + Long.toString(textureList.get(i).getContextID());
String textureIdStr = GLPageLabels.GL_TEXTURE + textureId;
- String type = GLConstantDefine.getConstantString(textureList.get(i).getType());
- String wrapS = GLConstantDefine.getConstantString(textureList.get(i).getWrapS());
- String wrapT = GLConstantDefine.getConstantString(textureList.get(i).getWrapT());
- String minFilter = GLConstantDefine.getConstantString(textureList.get(i).getMinFilter());
- String magFilter = GLConstantDefine.getConstantString(textureList.get(i).getMagFilter());
+ String type = GLConstantDefine.getAPIConstantString(textureList.get(i).getType());
+ String wrapS = GLConstantDefine.getAPIConstantString(textureList.get(i).getWrapS());
+ String wrapT = GLConstantDefine.getAPIConstantString(textureList.get(i).getWrapT());
+ String minFilter = GLConstantDefine.getAPIConstantString(textureList.get(i).getMinFilter());
+ String magFilter = GLConstantDefine.getAPIConstantString(textureList.get(i).getMagFilter());
for (int j = 0; j < filterList.size(); j++) {
switch(filterList.get(j).getColumnIndex()) {
import org.tizen.dynamicanalyzer.ui.opengl.data.type.GLSelectionData;
import org.tizen.dynamicanalyzer.ui.widgets.DAAdvancedViewComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
public class GLTextureTableView extends DAAdvancedViewComposite {
tableComp.setColumnVisibility(columnVisibility);
tableComp.setTableToolTipEnable(false);
- contents.addControlListener(new TableColumnSizePackListener(tableComp, columnSizes));
setTable(tableComp);
}
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.da.view.DABaseComposite;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAContainerComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DATabComposite;
import org.tizen.dynamicanalyzer.widgets.timeline.MarkerManager;
import org.tizen.dynamicanalyzer.workbench.LayoutManager;
}
public static final String ID = BaseView.class.getName();
- DAPageComposite topComposite = null;
+ DAContainerComposite topComposite = null;
DATabComposite tabView = null;
private static final int MINIMUM_SHELL_WIDTH = 800;
IDECommunicator.startIDECommunicatorThread();
SideWorker.INSTANCE.start();
}
- });
+ }, "IDEComThread");
IDEComthread.start();
// delete temp folder
}
}
- public DAPageComposite getTopComposite() {
+ public DAContainerComposite getTopComposite() {
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
- topComposite = (DAPageComposite) tabView.getTopComposite();
+ topComposite = (DAContainerComposite) tabView.getTopComposite();
}
});
return topComposite;
}
- public DAPageComposite getTopPage() {
+ public DAContainerComposite getTopPage() {
return getTopComposite();
}
import org.tizen.dynamicanalyzer.ui.toolbar.setting.PreferencesDialog;
import org.tizen.dynamicanalyzer.ui.toolbar.setting.TargetDialog;
import org.tizen.dynamicanalyzer.ui.widgets.SearchDialog;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DABaseDataPageComposite;
import org.tizen.dynamicanalyzer.util.CommonUtil;
import org.tizen.dynamicanalyzer.util.Logger;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
if (menuName.equals(MenuBarLabels.ANALYZE_SEARCH)) {
Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell();
BaseView baseView = (BaseView)WorkbenchUtil.getViewPart(BaseView.ID);
- Composite comp = baseView.getTopPage().getTopTable();
+ Composite comp = baseView.getTopPage().getActiveTable();
SearchDialog dialog = new SearchDialog(shell, comp);
dialog.open();
} else if (menuName.equals(MenuBarLabels.ANALYZE_TARGET)) {
MenuItem source = (MenuItem) arg0.getSource();
if (menuName.equals(MenuBarLabels.VIEW_DETAIL)) {
- TimelinePage tlPage = (TimelinePage)AnalyzerUtil.getTabPage(TimelinePage.pageID);
- MemoryPage mmPage = (MemoryPage)AnalyzerUtil.getTabPage(MemoryPage.pageID);
- NetworkPage nwPage = (NetworkPage)AnalyzerUtil.getTabPage(NetworkPage.pageID);
- ThreadPage thPage = (ThreadPage)AnalyzerUtil.getTabPage(ThreadPage.pageID);
- FilePage fiPage = (FilePage)AnalyzerUtil.getTabPage(FilePage.pageID);
- GLPage glPage = (GLPage)AnalyzerUtil.getTabPage(GLPage.pageID);
-
if(!source.getSelection()) {
- if(tlPage != null) {
- tlPage.getBaseForm().setWeights(new int[] { 100, 0 });
- tlPage.setDetailMode(false);
- }
-
- if(mmPage != null) {
- mmPage.getBaseForm().setWeights(new int[] { 100, 0 });
- mmPage.setDetailMode(false);
- }
-
- if(nwPage != null) {
- nwPage.getBaseForm().setWeights(new int[] { 100, 0 });
- nwPage.setDetailMode(false);
- }
-
- if(thPage != null) {
- thPage.getBaseForm().setWeights(new int[] { 100, 0 });
- thPage.setDetailMode(false);
- }
-
- if(fiPage != null) {
- fiPage.getBaseForm().setWeights(new int[] { 100, 0 });
- fiPage.setDetailMode(false);
- }
-
- if(glPage != null) {
- glPage.getBaseForm().setWeights(new int[] { 100, 0 });
- glPage.setDetailMode(false);
- }
+ DABaseDataPageComposite.setDetailMode(false);
} else {
- if(tlPage != null) {
- tlPage.getBaseForm().setWeights(new int[] { 65, 35 });
- tlPage.setDetailMode(true);
- }
-
- if(mmPage != null) {
- mmPage.getBaseForm().setWeights(new int[] { 65, 35 });
- mmPage.setDetailMode(true);
- }
-
- if(nwPage != null) {
- nwPage.getBaseForm().setWeights(new int[] { 65, 35 });
- nwPage.setDetailMode(true);
- }
-
- if(thPage != null) {
- thPage.getBaseForm().setWeights(new int[] { 65, 35 });
- thPage.setDetailMode(true);
- }
-
- if(fiPage != null) {
- fiPage.getBaseForm().setWeights(new int[] { 65, 35 });
- fiPage.setDetailMode(true);
- }
-
- if(glPage != null) {
- glPage.getBaseForm().setWeights(new int[] { 65, 35 });
- glPage.setDetailMode(true);
- }
+ DABaseDataPageComposite.setDetailMode(true);
}
-
+ // Next 3 instructions performed to fire controlResized event.
+ Shell shell = AnalyzerUtil.getTopPage().getShell();
+ shell.setSize(shell.getSize().x, shell.getSize().y + 1);
+ shell.setSize(shell.getSize().x, shell.getSize().y - 1);
+
AnalyzerManager.getCurrentPage().updateView();
}
}
aboutDialog.open();
} else if (menuName.equals(MenuBarLabels.HELP_BUGREPORT)) {
try {
- String url = MenuBarLabels.HELP_BUGREPORT_LINK;
+ String url = AnalyzerLabels.BUGREPORT_LINK;
if (CommonUtil.isWin()) {
org.eclipse.swt.program.Program.launch(url);
} else if (CommonUtil.isLinux()) {
}
} else if (menuName.equals(MenuBarLabels.HELP_HOWTO)) {
try {
- String url = MenuBarLabels.HELP_HOWTO_LINK;
+ String url = AnalyzerLabels.HOWTO_LINK;
if (CommonUtil.isWin()) {
org.eclipse.swt.program.Program.launch(url);
} else if (CommonUtil.isLinux()) {
import org.tizen.dynamicanalyzer.ui.timeline.calltrace.CallTraceDataManager;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineDataManager;
import org.tizen.dynamicanalyzer.ui.timeline.dlog.DLogDataManager;
-import org.tizen.dynamicanalyzer.ui.toolbar.replay.data.ReplayDataManager;
import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
import org.tizen.dynamicanalyzer.ui.userinterface.UIPage;
import org.tizen.dynamicanalyzer.util.Logger;
PageInfo timelinePageInfo = new PageInfo(TimelinePage.class,
SettingConstants.PAGE_NAME_TIME_LINE, true);
timelinePageInfo.addDataManager(TimelineDataManager.class);
- timelinePageInfo.addDataManager(ReplayDataManager.class);
timelinePageInfo.addDataManager(CallTraceDataManager.class);
// InteractiveDataManager is not supported in CLI mode
if (Global.isGUIMode()) {
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.util.Logger;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAContainerComposite;
public class UpdateViewTimer extends TimerTask {
private static Timer timer = null;
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
- DAPageComposite page = AnalyzerManager.getCurrentPage();
+ DAContainerComposite page = AnalyzerManager.getCurrentPage();
page.updateView();
}
});
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
import org.tizen.dynamicanalyzer.widgets.da.view.DABaseComposite;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAContainerComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DATabButton;
import org.tizen.dynamicanalyzer.widgets.da.view.DATabComposite;
import org.tizen.dynamicanalyzer.widgets.timeline.MarkerManager;
if (webProfileDataMakerMap != null) {
webProfileDataMakerMap.clear();
}
- SummaryDataManager.getInstance().getLeakDataMaker().clearLeakDataForRange();
}
public void initRange() {
// make web profile data
makeWebProfileDataForRange();
- // make leak data
- int selectedPid = Toolbar.INSTANCE.getSelectedPid();
- SummaryDataManager.getInstance().getLeakDataMaker()
- .makeLeakDataForRange(Long.valueOf(markerStartTime), Long.valueOf(markerEndTime),
- selectedPid);
AnalyzerUtil.changePage(RangePage.pageID);
- final DAPageComposite page = AnalyzerManager.getCurrentPage();
+ final DAContainerComposite page = AnalyzerManager.getCurrentPage();
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Seokgil Kang <seokgil.kang@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.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 RangeLeakView(Composite parent, int style) {
- super(parent, style);
- setTitle(SummaryLabels.LEAK_VIEW_TITLE_LEAK_CANDIDATE);
- ((LeakTable) treeComp).setRangeTable(true);
- treeComp.setTableName(SummaryLabels.RANGE_PAGE_LEAK_TABLE_NAME);
- }
-}
import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineTableView;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAContainerComposite;
import org.tizen.dynamicanalyzer.resources.ColorResources;
-public class RangePage extends DAPageComposite {
+public class RangePage extends DAContainerComposite {
public static final String pageID = RangePage.class.getName();
public static final String failedListViewID = RangeFailedApiListView.class
.getName();
- public static final String leakViewID = RangeLeakView.class.getName();
public static final String profilingViewID = RangeProfilingView.class
.getName();
public static final String warningListViewID = RangeWarningListView.class
public RangePage(Composite parent, int style) {
super(parent, style);
setTitle(AnalyzerLabels.COOLBAR_AREA_RANGE);
- this.setData(DAPageComposite.KEY_TOOLTIP,
+ this.setData(DAContainerComposite.KEY_TOOLTIP,
ShortCutManager.COOLBAR_AREA_RANGE_TOOLTIP);
this.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
this.setLayout(new FillLayout());
.setSelectionEnabled(true);
addView(failedApiListView);
- // LEAK_VIEW_INDEX = 1;
- RangeLeakView leakView = new RangeLeakView(upperForm, SWT.NONE);
- addView(leakView);
-
// INFO_VIEW_INDEX = 2;
TimelineTableView tabView = new TimelineTableView(upperForm,
SWT.NONE);
package org.tizen.dynamicanalyzer.ui.summary;
-import java.util.List;
import java.util.Map;
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.database.DBTable;
-import org.tizen.dynamicanalyzer.protocol.ProtocolConstants;
import org.tizen.dynamicanalyzer.swap.logparser.LogPackage;
-import org.tizen.dynamicanalyzer.swap.logparser.Logs;
import org.tizen.dynamicanalyzer.swap.logparser.PageDataManager;
-import org.tizen.dynamicanalyzer.swap.model.data.LogData;
import org.tizen.dynamicanalyzer.ui.summary.failed.FailedApiDataDBTable;
import org.tizen.dynamicanalyzer.ui.summary.failed.FailedApiDataMaker;
-import org.tizen.dynamicanalyzer.ui.summary.leaks.CurrentLeakData;
-import org.tizen.dynamicanalyzer.ui.summary.leaks.FreeDataDBTable;
-import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakDataDBTable;
-import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakDataMaker;
-import org.tizen.dynamicanalyzer.ui.summary.leaks.MemoryAllocationDataDBTable;
-import org.tizen.dynamicanalyzer.ui.summary.leaks.NewLeakDetector;
import org.tizen.dynamicanalyzer.ui.summary.warning.WarningDataDBTable;
import org.tizen.dynamicanalyzer.ui.summary.warning.WarningDataMaker;
public class SummaryDataManager extends PageDataManager {
private static SummaryDataManager instance = new SummaryDataManager();
- private LeakDataMaker leakDataMaker = null;
private FailedApiDataMaker failedApiDataMaker = null;
private WarningDataMaker warningDataMaker = null;
- private MemoryAllocationDataDBTable memoryAllocationDataTable = null;
- private FreeDataDBTable freeDataTable = null;
- private LeakDataDBTable leakDataTable = null;
private FailedApiDataDBTable failedApiDataTable = null;
private WarningDataDBTable warningDataDBTable = null;
private SummaryDataManager() {
- memoryAllocationDataTable = new MemoryAllocationDataDBTable();
- freeDataTable = new FreeDataDBTable();
- leakDataTable = new LeakDataDBTable();
failedApiDataTable = new FailedApiDataDBTable();
warningDataDBTable = new WarningDataDBTable();
- leakDataMaker = new LeakDataMaker(makeInserter(memoryAllocationDataTable),
- makeInserter(freeDataTable));
failedApiDataMaker = new FailedApiDataMaker(makeInserter(failedApiDataTable));
warningDataMaker = new WarningDataMaker(warningDataDBTable);
}
- public LeakDataMaker getLeakDataMaker() {
- return leakDataMaker;
- }
-
public FailedApiDataMaker getFailedApiDataMaker() {
return failedApiDataMaker;
}
return warningDataMaker;
}
- public DBTable getMemoryAllocationDataDBTable() {
- return memoryAllocationDataTable;
- }
-
- public DBTable getFreeDataDBTable() {
- return freeDataTable;
- }
-
- public DBTable getLeakDataDBTable() {
- return leakDataTable;
- }
-
public DBTable getFailedApiDataDBTable() {
return failedApiDataTable;
}
}
public void clear() {
- leakDataMaker.clear();
failedApiDataMaker.clear();
warningDataMaker.clear();
}
@Override
protected void makeData(LogPackage pack) {
- Logs memoryLogs = pack.getLogs(ProtocolConstants.MSG_PROBE_MEMORY);
- if (null != memoryLogs && memoryLogs.getRawLogs().size() != 0) {
- List<LogData> inputs = memoryLogs.getLogs();
-
- leakDataMaker.makeData(inputs);
- }
+ // do nothing
}
@Override
public void saveData(Map<String, String> dataMap) {
- leakDataMaker.makeData();
warningDataMaker.insertDBWhenSave();
}
@Override
public void openData(Map<String, String> dataMap) {
- List<List<Object>> leakDataList = leakDataMaker.getLeakDataFromDB();
- if (leakDataList == null)
- return;
-
- int size = leakDataList.size();
- NewLeakDetector leakDetector = AnalyzerManager.getNewLeakDetector();
- leakDetector.clear();
-
- for (int i = 0; i < size; i++) {
- List<Object> iLeakData = leakDataList.get(i);
- long seqNum = (Long) iLeakData.get(LeakDataDBTable.COLUMN.SEQUENCE_NUMBER.index);
- long allocValue = (Long) iLeakData.get(LeakDataDBTable.COLUMN.ALLOCATED_VALUE.index);
- int pid = (Integer) iLeakData.get(LeakDataDBTable.COLUMN.PID.index);
- CurrentLeakData newLeakData = new CurrentLeakData(seqNum, allocValue, pid);
- leakDetector.addCurrentLeakData(newLeakData);
- }
-
warningDataMaker.selectDBWhenOpen();
}
}
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
import org.tizen.dynamicanalyzer.swap.logparser.DataManagerRegistry;
import org.tizen.dynamicanalyzer.ui.summary.failed.FailedApiListView;
-import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakView;
import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;
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.timeline.common.TimelineTableView;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAContainerComposite;
-public class SummaryPage extends DAPageComposite {
+public class SummaryPage extends DAContainerComposite {
public static final String pageID = SummaryPage.class.getName();
public static final String failedViewID = FailedApiListView.class.getName();
- public static final String leakViewID = LeakView.class.getName();
- public static final String profilingViewID = FunctionUsageProfilingView.class.getName();
+ public static final String profilingViewID = FunctionUsageProfilingView.class
+ .getName();
public static final String warningListViewID = WarningListView.class.getName();
public static final String warningDetailViewID = WarningDetailView.class.getName();
super(parent, style);
setTitle(AnalyzerLabels.COOLBAR_AREA_SUMMARY);
- this.setData(DAPageComposite.KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_SUMMARY_TOOLTIP);
+ this.setData(DAContainerComposite.KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_SUMMARY_TOOLTIP);
this.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
this.setLayout(new FillLayout());
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;
/*
ScreenshotTabComposite tabView = new ScreenshotTabComposite(upperForm, SWT.NONE,
addView(warningDetailView);
warningForm.setWeights(new int[] { 70, 30 });
- baseForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- bottomForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- upperForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- warningForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
+ baseForm.setSashWidth(SASH_WIDTH);
+ bottomForm.setSashWidth(SASH_WIDTH);
+ upperForm.setSashWidth(SASH_WIDTH);
+ warningForm.setSashWidth(SASH_WIDTH);
DataManagerRegistry.registerPageDataManager(FunctionUsageProfiler.getInstance());
DataManagerRegistry.registerPageDataManager(SummaryDataManager.getInstance());
import org.tizen.dynamicanalyzer.database.DBColumn;
import org.tizen.dynamicanalyzer.database.DBConstants;
import org.tizen.dynamicanalyzer.database.DBTable;
-import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakDataDBTable.COLUMN;
import org.tizen.dynamicanalyzer.util.Logger;
public class FailedApiDataDBTable extends DBTable {
import org.tizen.dynamicanalyzer.ui.widgets.DAAdvancedViewComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
public class FailedApiListView extends DAAdvancedViewComposite {
tableComp.setColumns(columnNames);
tableComp.setColumnSize(columnSizes);
tableComp.setColumnVisibility(columnVisibility);
- contents.addControlListener(new TableColumnSizePackListener(tableComp,
- columnSizes));
setTable(tableComp);
}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Seokgil Kang <seokgil.kang@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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.tizen.dynamicanalyzer.swap.model.data.FileData;
-import org.tizen.dynamicanalyzer.swap.model.data.LogData;
-import org.tizen.dynamicanalyzer.swap.model.data.MemoryData;
-
-public class CurrentLeakData {
- private long seqNum = -1;
- private long allocValue = -1;
- private int pid = -1;
-
- public CurrentLeakData(LogData log) {
- this.seqNum = log.getSeq();
- if (log instanceof MemoryData) {
- this.allocValue = ((MemoryData) log).getAddress();
- } else if (log instanceof FileData) {
- this.allocValue = ((FileData) log).getFdValue();
- }
- this.pid = log.getPid();
- }
-
- public CurrentLeakData(long seqNumber, long allocValue, int pid) {
- this.seqNum = seqNumber;
- this.allocValue = allocValue;
- this.pid = pid;
- }
-
- public long getSequenceNumber() {
- return seqNum;
- }
-
- public long getAllocatedValue() {
- return allocValue;
- }
-
- public int getPid() {
- return pid;
- }
-}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Seokgil Kang <seokgil.kang@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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.sql.PreparedStatement;
-import java.sql.SQLException;
-import java.util.List;
-
-import org.tizen.dynamicanalyzer.database.DBColumn;
-import org.tizen.dynamicanalyzer.database.DBConstants;
-import org.tizen.dynamicanalyzer.database.DBTable;
-import org.tizen.dynamicanalyzer.util.Logger;
-
-public class FreeDataDBTable extends DBTable {
- private static final String TABLENAME = "FREE_DATA";
-
- public enum COLUMN {
- SEQUENCE_NUMBER(0, DBConstants.DBCOLUMN_SEQUENCE_NUMBER),
- PID(1, DBConstants.DBCOLUMN_PID),
- MESSAGE_ID(2, "MESSAGE_ID"),
- FREE_TIME(3, "FREE_TIME"),
- ALLOCATED_ADDRESS(4, "ALLOCATED_ADDRESS");
-
- public final int index;
- public final String name;
-
- COLUMN(int index, String name) {
- this.index = index;
- this.name = name;
- }
- }
-
- @Override
- public String getTableName() {
- return TABLENAME;
- }
-
- public FreeDataDBTable() {
- addColumn(new DBColumn(COLUMN.SEQUENCE_NUMBER.name, DBConstants.PRIMARY_KEY,
- DBConstants.DBTYPE_INT8));
- addColumn(new DBColumn(COLUMN.PID.name, DBConstants.NOT_NULL,
- DBConstants.DBTYPE_INT4));
- addColumn(new DBColumn(COLUMN.MESSAGE_ID.name, DBConstants.NOT_NULL,
- DBConstants.DBTYPE_INT4));
- addColumn(new DBColumn(COLUMN.FREE_TIME.name, DBConstants.NOT_NULL, DBConstants.DBTYPE_LONG)); // default:0
- addColumn(new DBColumn(COLUMN.ALLOCATED_ADDRESS.name, DBConstants.NOT_NULL,
- DBConstants.DBTYPE_LONG));
- setIndexColumn(COLUMN.PID.index);
- setIndexColumn(COLUMN.FREE_TIME.index);
- }
-
- @Override
- public boolean prepare(PreparedStatement prep, List<Object> rowData) {
- boolean isPrepared = true;
-
- int columnsize = getColumnSize();
- if (columnsize != rowData.size()) {
- isPrepared = false;
- } else {
- try {
- prep.setLong(1, (Long) (rowData.get(COLUMN.SEQUENCE_NUMBER.index)));
- prep.setInt(2, (Integer) (rowData.get(COLUMN.PID.index)));
- prep.setInt(3, (Integer) (rowData.get(COLUMN.MESSAGE_ID.index)));
- prep.setLong(4, (Long) (rowData.get(COLUMN.FREE_TIME.index)));
- prep.setLong(5, (Long) (rowData.get(COLUMN.ALLOCATED_ADDRESS.index)));
- } catch (SQLException e) {
- Logger.exception(e);
- isPrepared = false;
- }
- }
-
- return isPrepared;
- }
-}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Seokgil Kang <seokgil.kang@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.leaks;
-
-import java.util.HashMap;
-
-public class LeakCheckList {
- private static HashMap<String, LeakInfo> leakCheckList = null;
-
- public static HashMap<String, LeakInfo> getLeakCheckList() {
- if (null == leakCheckList) {
- init();
- }
- return leakCheckList;
- }
-
- private static void init() {
- leakCheckList = new HashMap<String, LeakInfo>();
-
- /** memory leak check list */
- LeakInfo info = new LeakInfo("malloc", LeakDetector.API_TYPE_OPEN, true);
- leakCheckList.put("malloc", info);
-
- info = new LeakInfo("free", LeakDetector.API_TYPE_CLOSE, true);
- leakCheckList.put("free", info);
-
- info = new LeakInfo("realloc", LeakDetector.API_TYPE_REALLOC, true);
- leakCheckList.put("realloc", info);
-
- info = new LeakInfo("calloc", LeakDetector.API_TYPE_OPEN, true);
- leakCheckList.put("calloc", info);
-
- /** file leak check list */
- info = new LeakInfo("open", LeakDetector.API_TYPE_OPEN, true);
- leakCheckList.put("open", info);
-
- info = new LeakInfo("close", LeakDetector.API_TYPE_CLOSE, true);
- leakCheckList.put("close", info);
-
- info = new LeakInfo("fopen", LeakDetector.API_TYPE_OPEN, true);
- leakCheckList.put("fopen", info);
-
- info = new LeakInfo("fclose", LeakDetector.API_TYPE_CLOSE, true);
- leakCheckList.put("fclose", info);
-
- info = new LeakInfo("File::Construct", LeakDetector.API_TYPE_OPEN,
- false);
- leakCheckList.put("File::Construct", info);
-
- info = new LeakInfo("File::~File", LeakDetector.API_TYPE_CLOSE, false);
- leakCheckList.put("File::~File", info);
-
- /** new - delete */
- info = new LeakInfo("new", LeakDetector.API_TYPE_OPEN, true);
- leakCheckList.put("new", info);
-
- info = new LeakInfo("delete", LeakDetector.API_TYPE_CLOSE, true);
- leakCheckList.put("delete", info);
-
- /** new - delete full signature */
- info = new LeakInfo("void *operator new(std::size_t size) throw (std::bad_alloc)",
- LeakDetector.API_TYPE_OPEN, true);
- leakCheckList.put("void *operator new(std::size_t size) throw (std::bad_alloc)", info);
- info = new LeakInfo("void operator delete(void *ptr) throw()",
- LeakDetector.API_TYPE_CLOSE, true);
- leakCheckList.put("void operator delete(void *ptr) throw()", info);
-
- info = new LeakInfo("void *operator new[](std::size_t size) throw (std::bad_alloc)",
- LeakDetector.API_TYPE_OPEN, true);
- leakCheckList.put("void *operator new[](std::size_t size) throw (std::bad_alloc)", info);
- info = new LeakInfo("void operator delete[](void *ptr) throw()",
- LeakDetector.API_TYPE_CLOSE, true);
- leakCheckList.put("void operator delete[](void *ptr) throw()", info);
-
- info = new LeakInfo("void *operator new(std::size_t size, const std::nothrow_t& nothrow) throw()",
- LeakDetector.API_TYPE_OPEN, true);
- leakCheckList.put("void *operator new(std::size_t size, const std::nothrow_t& nothrow) throw()", info);
- info = new LeakInfo("void operator delete(void *ptr, const std::nothrow_t& nothrow) throw()",
- LeakDetector.API_TYPE_CLOSE, true);
- leakCheckList.put("void operator delete(void *ptr, const std::nothrow_t& nothrow) throw()", info);
-
- info = new LeakInfo("void *operator new[](std::size_t size, const std::nothrow_t& nothrow) throw()",
- LeakDetector.API_TYPE_OPEN, true);
- leakCheckList.put("void *operator new[](std::size_t size, const std::nothrow_t& nothrow) throw()", info);
- info = new LeakInfo("void operator delete[](void *ptr, const std::nothrow_t& nothrow) throw()",
- LeakDetector.API_TYPE_CLOSE, true);
- leakCheckList.put("void operator delete[](void *ptr, const std::nothrow_t& nothrow) throw()", info);
-
- /** etc.. */
- info = new LeakInfo("app_get_name", LeakDetector.API_TYPE_OPEN, false);
- leakCheckList.put("app_get_name", info);
-
- info = new LeakInfo("app_get_data_directory",
- LeakDetector.API_TYPE_OPEN, false);
- leakCheckList.put("app_get_data_directory", info);
-
- info = new LeakInfo("app_get_package", LeakDetector.API_TYPE_OPEN,
- false);
- leakCheckList.put("app_get_package", info);
-
- info = new LeakInfo("app_get_version", LeakDetector.API_TYPE_OPEN,
- false);
- leakCheckList.put("app_get_version", info);
-
- }
-}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Seokgil Kang <seokgil.kang@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.leaks;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.tizen.dynamicanalyzer.swap.model.data.LogData;
-import org.tizen.dynamicanalyzer.swap.model.data.LogDataFactory;
-import org.tizen.dynamicanalyzer.swap.model.data.MemoryData;
-import org.tizen.dynamicanalyzer.swap.model.data.ProbeCommonData;
-
-public class LeakData {
- public static final int INDEX_LEAK_SEQ = 1;
- public static final int INDEX_ID = 2;
- public static final int INDEX_SEQ = 3;
- public static final int INDEX_TIME = 4;
- public static final int INDEX_API_NAME = 5;
- public static final int INDEX_PID = 6;
- public static final int INDEX_ADDR = 7;
- public static final int INDEX_CALLER_PCADDR = 8;
- public static final int INDEX_PARAMETER = 9;
- public static final int INDEX_RETURN = 10;
- public static final int INDEX_LIB_NAME = 11;
- public static final int INDEX_KEY = 12;
- public static final int INDEX_PARENT_KEY = 13;
-
- private static int logNum = 0;
- private int leakSeq = -1;
- private int id = -1;
- private long seq = -1;
- private long time = -1;
- private String apiName = null;
- private int pid = -1;
- private long addr = -1;
- private long callerPcAddr = -1;
- private String param = null;
- private String retValue = null;
- private String libName = null;
- private int key = -1;
- private int parentKey = -1;
-
- private List<LeakData> children;
-
- public LeakData(LogData log, LeakDetector leakDetector) {
- leakSeq = leakDetector.getLeakSeq();
- leakDetector.increaseLeakSeq();
- this.key = log.getKey();
- this.seq = log.getSeq();
- this.id = log.getMsgID();
- this.time = log.getTime();
- // TODO : name field
- ProbeCommonData pcd = (ProbeCommonData) log;
- this.apiName = pcd.getApiName();
- this.param = pcd.getArgs();
- this.retValue = pcd.getReturn();
- this.callerPcAddr = pcd.getCallerPcAddr();
-
- if (log instanceof MemoryData) {
- this.addr = ((MemoryData) log).getAddress();
- }
- pid = log.getPid();
- // TODO: libName
- libName = pcd.getLibName();
- }
-
- // load data
- public LeakData(List<String> loadData) {
- leakSeq = Integer.parseInt(loadData.get(INDEX_LEAK_SEQ));
- id = Integer.parseInt(loadData.get(INDEX_ID));
- seq = Long.parseLong(loadData.get(INDEX_SEQ));
- time = Long.parseLong(loadData.get(INDEX_TIME));
- apiName = loadData.get(INDEX_API_NAME);
- pid = Integer.parseInt(loadData.get(INDEX_PID));
- addr = Long.parseLong(loadData.get(INDEX_ADDR));
- callerPcAddr = Long.parseLong(loadData.get(INDEX_CALLER_PCADDR));
- param = loadData.get(INDEX_PARAMETER);
- retValue = loadData.get(INDEX_RETURN);
- libName = loadData.get(INDEX_LIB_NAME);
- key = Integer.parseInt(loadData.get(INDEX_KEY));
- parentKey = Integer.parseInt(loadData.get(INDEX_PARENT_KEY));
- }
-
- public int getKey() {
- return key;
- }
-
- public void setKey(int key) {
- this.key = key;
- }
-
- public long getAddr() {
- return addr;
- }
-
- public void setAddr(long addr) {
- this.addr = addr;
- }
-
- public long getSeq() {
- return seq;
- }
-
- public void setSeq(long seq) {
- this.seq = seq;
- }
-
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public long getTime() {
- return time;
- }
-
- public void setTime(long time) {
- this.time = time;
- }
-
- public String getName() {
- return apiName;
- }
-
- public void setName(String name) {
- this.apiName = name;
- }
-
- public String getParam() {
- return param;
- }
-
- public void setParam(String param) {
- this.param = param;
- }
-
- public String getRet() {
- return retValue;
- }
-
- public void setRet(String ret) {
- this.retValue = ret;
- }
-
- public int getLeakSeq() {
- return leakSeq;
- }
-
- public void setLeakSeq(int leakSeq) {
- this.leakSeq = leakSeq;
- }
-
- public int getParentKey() {
- return parentKey;
- }
-
- public void setParentKey(int parentKey) {
- this.parentKey = parentKey;
- }
-
- public long getCallerPc() {
- return callerPcAddr;
- }
-
- public void setCallerPc(long callerPc) {
- this.callerPcAddr = callerPc;
- }
-
- public List<LeakData> getChildren() {
- if (null == children) {
- children = new ArrayList<LeakData>();
- }
- return children;
- }
-
- public void setChildren(List<LeakData> children) {
- this.children = children;
- }
-
- public void addChild(LeakData child) {
- getChildren().add(child);
- }
-
- public void removeChild(int key) {
- int size = children.size();
- for (int i = 0; i < size; i++) {
- if (key == children.get(i).getKey()) {
- children.remove(i);
- break;
- }
- }
- }
-
- public static int getLogNum() {
- return logNum++;
- }
-
- public int getPid() {
- return pid;
- }
-
- public void setPid(int pid) {
- this.pid = pid;
- }
-
- public String getLibName() {
- return libName;
- }
-
- public void setLibName(String libName) {
- this.libName = libName;
- }
-
- public String getType() {
- return LogDataFactory.getLogFormatName(id);
- }
-}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Seokgil Kang <seokgil.kang@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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.sql.PreparedStatement;
-import java.sql.SQLException;
-import java.util.List;
-
-import org.tizen.dynamicanalyzer.database.DBColumn;
-import org.tizen.dynamicanalyzer.database.DBConstants;
-import org.tizen.dynamicanalyzer.database.DBTable;
-import org.tizen.dynamicanalyzer.util.Logger;
-
-public class LeakDataDBTable extends DBTable {
- private static final String TABLENAME = "LEAK_DATA";
-
- public enum COLUMN {
- SEQUENCE_NUMBER(0, DBConstants.DBCOLUMN_SEQUENCE_NUMBER),
- ALLOCATED_VALUE(1, "ALLOCATED_VALUE"),
- PID(2, DBConstants.DBCOLUMN_PID);
-
- public final int index;
- public final String name;
-
- COLUMN(int index, String name) {
- this.index = index;
- this.name = name;
- }
- }
-
- public LeakDataDBTable() {
- addColumn(new DBColumn(COLUMN.SEQUENCE_NUMBER.name, DBConstants.PRIMARY_KEY,
- DBConstants.DBTYPE_INT8));
- addColumn(new DBColumn(COLUMN.ALLOCATED_VALUE.name, DBConstants.NOT_NULL,
- DBConstants.DBTYPE_LONG));
- addColumn(new DBColumn(COLUMN.PID.name, DBConstants.NOT_NULL,
- DBConstants.DBTYPE_INT4));
- }
-
- @Override
- public boolean prepare(PreparedStatement prep, List<Object> rowData) {
- boolean isPrepared = true;
-
- int columnsize = getColumnSize();
- if (columnsize != rowData.size()) {
- isPrepared = false;
- } else {
- try {
- prep.setLong(1, (Long) (rowData.get(COLUMN.SEQUENCE_NUMBER.index)));
- prep.setLong(2, (Long) (rowData.get(COLUMN.ALLOCATED_VALUE.index)));
- prep.setInt(3, (Integer) (rowData.get(COLUMN.PID.index)));
- } catch (SQLException e) {
- Logger.exception(e);
- isPrepared = false;
- }
- }
-
- return isPrepared;
- }
-
- @Override
- public String getTableName() {
- return TABLENAME;
- }
-
-}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Seokgil Kang <seokgil.kang@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
-import org.tizen.dynamicanalyzer.common.DALimit;
-import org.tizen.dynamicanalyzer.common.Global;
-import org.tizen.dynamicanalyzer.constant.CommonConstants;
-import org.tizen.dynamicanalyzer.database.DBInserter;
-import org.tizen.dynamicanalyzer.database.DBTable;
-import org.tizen.dynamicanalyzer.database.IResultSet;
-import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
-import org.tizen.dynamicanalyzer.protocol.ProtocolConstants;
-import org.tizen.dynamicanalyzer.swap.model.data.LogData;
-import org.tizen.dynamicanalyzer.swap.model.data.MemoryData;
-import org.tizen.dynamicanalyzer.ui.summary.SummaryDataManager;
-import org.tizen.dynamicanalyzer.util.Logger;
-
-public class LeakDataMaker {
- private static final String query_withSeq = "where %s = %s";
- private static final String query_withSeqList = "where %s in (";
- private static final String query_withPidAndTime = "where %s = %s and %s >= %s and %s <= %s order by %s";
-
- private ArrayList<List<Object>> memoryAllocDataList;
- private ArrayList<List<Object>> freeDataList;
- private List<List<Object>> rangeDataList;
- private NewLeakDetector leakDetector = AnalyzerManager.getNewLeakDetector();
-
- private DBInserter allocDBInserter = null;
- private DBInserter freeDBInserter = null;
-
- public LeakDataMaker(DBInserter alloc_inserter, DBInserter free_inserter) {
- memoryAllocDataList = new ArrayList<List<Object>>();
- freeDataList = new ArrayList<List<Object>>();
- rangeDataList = new ArrayList<List<Object>>();
-
- allocDBInserter = alloc_inserter;
- freeDBInserter = free_inserter;
- }
-
- public void makeData(List<LogData> inputs) {
- int size = inputs.size();
- for (int i = 0; i < size; i++) {
- LogData input = (LogData) inputs.get(i);
- if (input == null)
- continue;
- if (isHeapMemoryOverflow())
- break;
- switch (leakDetector.runLeakDetect(input)) {
- case LogCenterConstants.MEMORY_API_ALLOC: // alloc, realloc
- makeAllocData(input);
- break;
- case LogCenterConstants.MEMORY_API_FREE: // free
- makeFreeData(input);
- break;
- case -1:
- default:
- break;
- }
- }
-
- if (memoryAllocDataList.size() > 0) {
- @SuppressWarnings("unchecked")
- List<List<Object>> mList = (List<List<Object>>) memoryAllocDataList.clone();
- memoryAllocDataList.clear();
-
- allocDBInserter.pushData(mList);
- }
-
- if (freeDataList.size() > 0) {
- @SuppressWarnings("unchecked")
- List<List<Object>> fList = (List<List<Object>>) freeDataList.clone();
- freeDataList.clear();
-
- freeDBInserter.pushData(fList);
- }
- }
-
- public void makeData() {
- Map<Integer, CurrentLeakData> leaks = leakDetector.getLeakHash();
- List<List<Object>> leakDataList = new ArrayList<List<Object>>();
-
- for (Map.Entry<Integer, CurrentLeakData> entry : leaks.entrySet()) {
- CurrentLeakData input = entry.getValue();
- if (input == null) {
- continue;
- }
-
- List<Object> dbLeakData = new ArrayList<Object>();
- dbLeakData.add(Long.valueOf(input.getSequenceNumber()));
- dbLeakData.add(Long.valueOf(input.getAllocatedValue()));
- dbLeakData.add(Integer.valueOf(input.getPid()));
-
- leakDataList.add(dbLeakData);
- }
-
- if (leakDataList.size() > 0) {
- SummaryDataManager.getInstance().getLeakDataDBTable().insertData(leakDataList);
- }
- }
-
- private boolean isHeapMemoryOverflow() {
- boolean flag = false;
- if (leakDetector.getLeakHash().size() > DALimit.MAX_LEAK_CHECK_BUFFER_SIZE) {
- DALimit.stopTraceAndOpenWarningDialog();
- flag = true;
- }
-
- return flag;
- }
-
- public void makeAllocData(LogData log) {
- ArrayList<Object> dbAllocData = new ArrayList<Object>();
-
- switch (log.getMsgID()) {
- case ProtocolConstants.MSG_PROBE_MEMORY: {
- MemoryData mData = (MemoryData) log;
-
- dbAllocData.add(Long.valueOf(mData.getSeq()));
- dbAllocData.add(Integer.valueOf(mData.getPid()));
- dbAllocData.add(Integer.valueOf(mData.getApiId()));
- dbAllocData.add(Integer.valueOf(mData.getMemoryApiType()));
- dbAllocData.add(Long.valueOf(mData.getAddress()));
- dbAllocData.add(Long.valueOf(mData.getTime()));
- dbAllocData.add(Long.valueOf(mData.getCallerPcAddr()));
- dbAllocData.add(String.valueOf(mData.getArgs()));
- dbAllocData.add(String.valueOf(mData.getReturn()));
- dbAllocData.add(String.valueOf(mData.getLibName()));
- dbAllocData.add(Integer.valueOf(mData.getMsgID()));
- dbAllocData.add(Integer.valueOf(mData.getTid()));
- dbAllocData.add(Long.valueOf(mData.getSize()));
- break;
- }
- default:
- break;
- }
-
- memoryAllocDataList.add(dbAllocData);
- }
-
- public void makeFreeData(LogData log) {
- ArrayList<Object> dbFreeData = new ArrayList<Object>();
-
- switch (log.getMsgID()) {
- case ProtocolConstants.MSG_PROBE_MEMORY: {
- MemoryData mData = (MemoryData) log;
-
- dbFreeData.add(Long.valueOf(mData.getSeq()));
- dbFreeData.add(Integer.valueOf(mData.getPid()));
- dbFreeData.add(Integer.valueOf(mData.getMsgID()));
- dbFreeData.add(Long.valueOf(mData.getTime()));
- dbFreeData.add(Long.valueOf(mData.getAddress()));
- break;
- }
- default:
- break;
- }
-
- freeDataList.add(dbFreeData);
- }
-
- public void clear() {
- memoryAllocDataList.clear();
- freeDataList.clear();
- }
-
- private List<List<Object>> executeQuery(String where) {
- DBTable table = SummaryDataManager.getInstance().getMemoryAllocationDataDBTable();
- List<String> columns = new ArrayList<String>();
- columns.add(MemoryAllocationDataDBTable.COLUMN.SEQUENCE_NUMBER.name);
- columns.add(MemoryAllocationDataDBTable.COLUMN.PID.name);
- columns.add(MemoryAllocationDataDBTable.COLUMN.API_ID.name);
- columns.add(MemoryAllocationDataDBTable.COLUMN.API_TYPE.name);
- columns.add(MemoryAllocationDataDBTable.COLUMN.ALLOCATED_ADDRESS.name);
- columns.add(MemoryAllocationDataDBTable.COLUMN.ALLOCATED_TIME.name);
- columns.add(MemoryAllocationDataDBTable.COLUMN.CALLER_PC_ADDRESS.name);
- columns.add(MemoryAllocationDataDBTable.COLUMN.ARGUMENT.name);
- columns.add(MemoryAllocationDataDBTable.COLUMN.RETURN_VALUE.name);
- columns.add(MemoryAllocationDataDBTable.COLUMN.CALLER_LIBRARY_NAME.name);
- columns.add(MemoryAllocationDataDBTable.COLUMN.MESSAGE_ID.name);
-
- return table.selectData(columns, where, new IResultSet() {
- @Override
- public List<Object> extractDataFromResultSet(ResultSet rs) {
- List<Object> row = new ArrayList<Object>();
- try {
- row.add(Long.valueOf(rs.getLong(1)));
- row.add(Integer.valueOf(rs.getInt(2)));
- row.add(Integer.valueOf(rs.getInt(3)));
- row.add(Integer.valueOf(rs.getInt(4)));
- row.add(Long.valueOf(rs.getLong(5)));
- row.add(Long.valueOf(rs.getLong(6)));
- row.add(Long.valueOf(rs.getLong(7)));
- row.add(rs.getString(8));
- row.add(rs.getString(9));
- row.add(rs.getString(10));
- row.add(Integer.valueOf(rs.getInt(11)));
- } catch (SQLException e) {
- Logger.exception(e);
- return null;
- }
-
- return row;
- }
- });
- }
-
- public List<List<Object>> getAllocationDataFromDB(Long seq) {
- String where = String.format(query_withSeq,
- MemoryAllocationDataDBTable.COLUMN.SEQUENCE_NUMBER.name, seq);
-
- return executeQuery(where);
- }
-
- public List<List<Object>> getLeakDataFromDB() {
- DBTable table = SummaryDataManager.getInstance().getLeakDataDBTable();
- List<String> columns = new ArrayList<String>();
- columns.add(LeakDataDBTable.COLUMN.SEQUENCE_NUMBER.name);
- columns.add(LeakDataDBTable.COLUMN.ALLOCATED_VALUE.name);
- columns.add(LeakDataDBTable.COLUMN.PID.name);
-
- return table.selectData(columns, null, new IResultSet() {
- @Override
- public List<Object> extractDataFromResultSet(ResultSet rs) {
- List<Object> row = new ArrayList<Object>();
- try {
- row.add(Long.valueOf(rs.getLong(1)));
- row.add(Long.valueOf(rs.getLong(2)));
- row.add(Integer.valueOf(rs.getInt(3)));
- } catch (SQLException e) {
- Logger.exception(e);
- return null;
- }
-
- return row;
- }
- });
- }
-
- public List<List<Object>> getLeakDataWithSeq(List<Long> leakSequenceNumbers,
- List<String> whereQueryList) {
- StringBuilder where = new StringBuilder();
- where.append(String.format(query_withSeqList,
- MemoryAllocationDataDBTable.COLUMN.SEQUENCE_NUMBER.name));
- int size = leakSequenceNumbers.size();
- for (int i = 0; i < size - 1; i++) {
- where.append(String.valueOf(leakSequenceNumbers.get(i)));
- where.append(CommonConstants.COMMA);
- where.append(CommonConstants.SPACE);
- }
-
- where.append(String.valueOf(leakSequenceNumbers.get(size - 1)));
- where.append(CommonConstants.CLOSE_BRACKET);
-
- if (whereQueryList != null && !whereQueryList.isEmpty()) {
- // if 'WHERE' condition used on the DB query is existed
- for (int i = 0; i < whereQueryList.size(); i++) {
- where.append(" and ");
- where.append(whereQueryList.get(i));
- }
- }
-
- return executeQuery(where.toString());
- }
-
- public List<List<Object>> getLeakDataForRange() {
- return rangeDataList;
- }
-
- public void clearLeakDataForRange() {
- if (!rangeDataList.isEmpty())
- rangeDataList.clear();
- }
-
- public void makeLeakDataForRange(Long startTime, Long endTime, int selectedPid) {
- clearLeakDataForRange();
-
- if (selectedPid != 0) {
- List<List<Object>> allocDataList = getAllocationDataWithPidFromDBForRange(startTime,
- endTime, selectedPid);
- List<List<Object>> freeDataList = getFreeDataWithPidFromDBForRange(startTime, endTime,
- selectedPid);
-
- if (allocDataList != null) {
- if (freeDataList == null) {
- rangeDataList.addAll(allocDataList);
- } else {
- List<List<Object>> result = makeSubLeakDataForRange(allocDataList, freeDataList);
- if (result != null && !result.isEmpty())
- rangeDataList.addAll(result);
- }
- }
- } else {
- int[] pids = Global.getProject().getProcessIDs();
- for (int i = 0; i < pids.length; i++) {
- List<List<Object>> allocDataList = getAllocationDataWithPidFromDBForRange(startTime,
- endTime, pids[i]);
- List<List<Object>> freeDataList = getFreeDataWithPidFromDBForRange(startTime, endTime,
- pids[i]);
-
- if (allocDataList == null)
- continue;
-
- if (freeDataList == null) {
- rangeDataList.addAll(allocDataList);
- continue;
- }
-
- List<List<Object>> result = makeSubLeakDataForRange(allocDataList, freeDataList);
- if (result != null && !result.isEmpty())
- rangeDataList.addAll(result);
- }
- }
- }
-
- private List<List<Object>> makeSubLeakDataForRange(List<List<Object>> allocData,
- List<List<Object>> freeData) {
- for (int i = 0; i < freeData.size(); i++) {
- List<Object> iFreeData = freeData.get(i);
- long address = (Long) iFreeData.get(2);
- long freeTime = (Long) iFreeData.get(1);
-
- int allocDataSize = allocData.size();
- for (int j = 0; j < allocDataSize; j++) {
- List<Object> iAllocData = allocData.get(j);
- long allocatedTime = (Long) iAllocData
- .get(MemoryAllocationDataDBTable.COLUMN.ALLOCATED_TIME.index);
- if (allocatedTime <= freeTime) {
- if (address == (Long) iAllocData
- .get(MemoryAllocationDataDBTable.COLUMN.ALLOCATED_ADDRESS.index)) {
- allocData.remove(j);
- break;
- }
- } else {
- break;
- }
- }
- }
-
- return allocData;
- }
-
- private List<List<Object>> getAllocationDataWithPidFromDBForRange(Long startTime, Long endTime,
- int pid) {
- String where = String.format(query_withPidAndTime,
- MemoryAllocationDataDBTable.COLUMN.PID.name,
- Integer.toString(pid),
- MemoryAllocationDataDBTable.COLUMN.ALLOCATED_TIME.name, startTime.toString(),
- MemoryAllocationDataDBTable.COLUMN.ALLOCATED_TIME.name, endTime.toString(),
- MemoryAllocationDataDBTable.COLUMN.ALLOCATED_TIME.name);
-
- return executeQuery(where);
- }
-
- private List<List<Object>> getFreeDataWithPidFromDBForRange(Long startTime, Long endTime,
- int pid) {
- String where = String.format(query_withPidAndTime, FreeDataDBTable.COLUMN.PID.name,
- Integer.toString(pid),
- FreeDataDBTable.COLUMN.FREE_TIME.name,
- startTime.toString(), FreeDataDBTable.COLUMN.FREE_TIME.name, endTime.toString(),
- FreeDataDBTable.COLUMN.FREE_TIME.name);
- DBTable table = SummaryDataManager.getInstance().getFreeDataDBTable();
- List<String> columns = new ArrayList<String>();
- columns.add(FreeDataDBTable.COLUMN.PID.name);
- columns.add(FreeDataDBTable.COLUMN.FREE_TIME.name);
- columns.add(FreeDataDBTable.COLUMN.ALLOCATED_ADDRESS.name);
-
- return table.selectData(columns, where, new IResultSet() {
- @Override
- public List<Object> extractDataFromResultSet(ResultSet rs) {
- List<Object> row = new ArrayList<Object>();
- try {
- row.add(Integer.valueOf(rs.getInt(1)));
- row.add(Long.valueOf(rs.getLong(2)));
- row.add(Long.valueOf(rs.getLong(3)));
- } catch (SQLException e) {
- Logger.exception(e);
- return null;
- }
-
- return row;
- }
- });
- }
-}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Seokgil Kang <seokgil.kang@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.leaks;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import org.tizen.dynamicanalyzer.protocol.ProtocolConstants;
-import org.tizen.dynamicanalyzer.setting.Feature;
-import org.tizen.dynamicanalyzer.setting.SettingDataManager;
-import org.tizen.dynamicanalyzer.setting.TargetData;
-import org.tizen.dynamicanalyzer.swap.model.data.LogData;
-import org.tizen.dynamicanalyzer.swap.model.data.ProbeCommonData;
-import org.tizen.dynamicanalyzer.util.Logger;
-
-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<Long, LeakData> leakHash;
- HashMap<Long, LeakData> childHash;
- private int leakSeq = 0;
-
- public LeakDetector() {
- }
-
- public List<LeakData> getLeakDataList() {
- List<LeakData> leakList = new ArrayList<LeakData>();
- leakList.addAll(getLeakHash().values());
- return leakList;
- }
-
- public HashMap<Long, LeakData> getLeakHash() {
- if (null == leakHash) {
- leakHash = new HashMap<Long, LeakData>();
- }
- return leakHash;
- }
-
- public HashMap<Long, LeakData> getChildHash() {
- if (null == childHash) {
- childHash = new HashMap<Long, LeakData>();
- }
- return childHash;
- }
-
- // public HashMap<String, Check> getLeakCheckHash() {
- // if (null == leakCheckHash) {
- // leakCheckHash = new HashMap<String, Check>();
- // LeakCheckList leakCheckList = AnalyzerManager.getLeakCheckList();
- // if (null != leakCheckList) {
- // List<Check> checks = leakCheckList.getChecks();
- // if (null != checks) {
- // int size = checks.size();
- // for (int i = 0; i < size; i++) {
- // leakCheckHash.put(checks.get(i).getName(),
- // checks.get(i));
- // }
- // }
- // }
- // }
- // return leakCheckHash;
- // }
-
- private boolean isDropLog(LogData logData) {
- TargetData target = SettingDataManager.INSTANCE.getConnectedTargetOrSelected();
- int id = logData.getMsgID();
- switch (id) {
- case ProtocolConstants.MSG_PROBE_FILE:
- if (target.isSelectedFeature(Feature.INTERNAL_PROBE_FILE)) {
- return true;
- }
- break;
- case ProtocolConstants.MSG_PROBE_MEMORY:
- if (target.isSelectedFeature(Feature.INTERNAL_PROBE_MEMORY)) {
- return true;
- }
- break;
- case ProtocolConstants.MSG_PROBE_THREAD:
- if (target.isSelectedFeature(Feature.INTERNAL_PROBE_THREAD)) {
- return true;
- }
- break;
- default:
- break;
- }
-
- return false;
- }
-
- public void runLeakDectect(LogData logData) {
- ProbeCommonData log = (ProbeCommonData) logData;
- String apiName = log.getApiName();
- long errno = log.getErrno();
- if (0 != errno) {
- return;
- }
-
- if (isDropLog(logData) && log.isInternal()) {
- // Logger.debug("drop log " + log.getApiName() + " check "
- // + log.getInternalCall());
- return;
- }
-
- LeakInfo chk = null;
- if (null == LeakCheckList.getLeakCheckList().get(apiName)) {
- return;
- } else {
- chk = LeakCheckList.getLeakCheckList().get(apiName);
- }
-
- HashMap<Long, LeakData> leaks = getLeakHash();
- if (chk.getApiType() == API_TYPE_OPEN) {
- // if (chk.isCheckUserCall()) {
- // checkUserFuncLeakData(logData, chk);
- // } else {
- LeakData newLeak = new LeakData(logData, this);
- leaks.put((long) logData.getKey(), newLeak);
- // }
- } else if (chk.getApiType() == API_TYPE_CLOSE) {
- int key = log.getKey();
- LeakData freeData = getChildHash().get(Long.valueOf(key));
- if (null != freeData) {
- LeakData parent = leaks.get((long) freeData.getParentKey());
- parent.removeChild(key);
- getChildHash().remove(Long.valueOf(key));
- if (parent.getChildren().isEmpty()) {
- leaks.remove(Long.valueOf(parent.getKey()));
- }
- } else {
- leaks.remove(Long.valueOf(key));
- }
-
- } else if (chk.getApiType() == API_TYPE_REALLOC) {
- // Logger.debug("realloc!! " + input);
-
- // free index = input param 1st
- // String inputParam = input[LogCenterConstants.INPUTPARM_INDEX];
- String inputParam = ((ProbeCommonData) log).getArgs();
- String[] splitInputParam = inputParam.split("\\,"); //$NON-NLS-1$
- String param = splitInputParam[0];
- long rmKey = -1;
- try {
- if (param.contains("0x")) {
- rmKey = Long.decode(param);
- } else {
- rmKey = Long.parseLong(splitInputParam[0]);
- }
- leaks.remove(rmKey);
- } catch (NumberFormatException e) {
- Logger.exception(e);
- }
-
- // internal check
- // if (chk.isCheckUserCall()) {
- // checkUserFuncLeakData(log, chk);
- // } else {
- // String key = input[chk.getKeyIndex()];
- // leaks.put(key, new LeakData(key, input, this));
- int key = log.getKey();
- leaks.put((long) key, new LeakData(log, this));
- // }
- }
- }
-
- // private void checkUserFuncLeakData(LogData log, LeakInfo chk) {
- // HashMap<Long, CallStackData> cdMap = AnalyzerManager
- // .getCallstackManager().getCallStackDataBySeqMap();
- // // HashMap<Long, String> apiMap = LogSpliter.getCallStackApiByAddrMap();
- // HashMap<Long, CallStackUnit> addrMap = AnalyzerManager
- // .getCallstackManager().getCallStackApiByAddrMap();
- //
- // if (null == cdMap || null == addrMap) {
- // return;
- // }
- //
- // long seqNum = log.getSeq();
- // CallStackData csd = cdMap.get(seqNum);
- // if (null == csd) {
- // // Logger.debug("no callstack "); //$NON-NLS-1$
- // // for (int i = 0; i < input.length; i++)
- // // {
- // // Logger.debug(false, input[i] + " "); //$NON-NLS-1$
- // // }
- // // Logger.debug();
- // return;
- // }
- // List<Long> addrs = null;
- // addrs = csd.getAddrs();
- // if (addrs.isEmpty()) {
- // Logger.debug("BUG: Callstack is empty!"); //$NON-NLS-1$
- // return;
- // }
- //
- // CallStackUnit callerFunc = addrMap.get(addrs.get(0));
- //
- // // user call
- // if (AnalyzerManager.getCallstackManager().isUserCall(
- // callerFunc.getFunctionName())) {
- // HashMap<Integer, LeakData> leaks = getLeakHash();
- // LeakData newLeak = new LeakData(log, 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) 2013 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Seokgil Kang <seokgil.kang@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.leaks;
-
-public class LeakInfo {
- private String apiName = null;
- private int apiType = -1;
- private boolean checkUserCall = false;
-
- public LeakInfo(String name, int type, boolean usercall) {
- apiName = name;
- apiType = type;
- checkUserCall = usercall;
- }
-
- public String getApiName() {
- return apiName;
- }
-
- public int getApiType() {
- return apiType;
- }
-
- public boolean isCheckUserCall() {
- return checkUserCall;
- }
-
-}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Seokgil Kang <seokgil.kang@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.leaks;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-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.AnalyzerConstants;
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
-import org.tizen.dynamicanalyzer.common.DASelectionData;
-import org.tizen.dynamicanalyzer.common.Global;
-import org.tizen.dynamicanalyzer.constant.CommonConstants;
-import org.tizen.dynamicanalyzer.listeners.SummaryMouseDoubleClickListener;
-import org.tizen.dynamicanalyzer.model.FilterProperty;
-import org.tizen.dynamicanalyzer.model.TreeInput;
-import org.tizen.dynamicanalyzer.swap.model.data.LogDataFactory;
-import org.tizen.dynamicanalyzer.swap.model.data.ProbeCommonData;
-import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
-import org.tizen.dynamicanalyzer.ui.range.RangePage;
-import org.tizen.dynamicanalyzer.ui.summary.SummaryDataManager;
-import org.tizen.dynamicanalyzer.ui.summary.SummaryPage;
-import org.tizen.dynamicanalyzer.ui.toolbar.Toolbar;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite;
-import org.tizen.dynamicanalyzer.util.Logger;
-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);
- setContextMenu(AnalyzerConstants.CONTEXT_TABLE_RANGE);
-
- table.addSelectionListener(new SelectionListener() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- GridItem[] items = table.getSelection();
-
- DATableDataFormat dataFormat = (DATableDataFormat) items[0].getData();
- long time = (Long) dataFormat.getData().get(LeakData.INDEX_TIME);
-
- String id = SummaryPage.leakViewID;
- if (isRange) {
- id = RangePage.leakViewID;
- }
- DASelectionData selData = new DASelectionData(id, time, 0, items, table);
- AnalyzerManager.getCurrentPage().updateView(selData);
- }
-
- @Override
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
- });
-
- table.addMouseListener(new SummaryMouseDoubleClickListener(SummaryPage.leakViewID));
- }
-
- 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<Long, 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 selectedPid = ToolbarArea.INSTANCE.getSelectedPid();
- // int size = leakList.size();
- // for (int i = 0; i < size; i++) {
- // LeakData leakData = leakList.get(i);
- // if (selectedPid != 0) {
- // if (selectedPid != leakData.getPid()) {
- // continue;
- // }
- // }
- // TreeInput leakInput = makeInput(leakData);
- // makeChildTree(leakData.getChildren(), leakInput,
- // Integer.toString(leakData.getParentKey()));
- // }
- // return output;
- // }
-
- @Override
- public List<TreeInput> makeTreeInput() {
- List<TreeInput> output = new ArrayList<TreeInput>();
- Map<Integer, CurrentLeakData> leaks = null;
- List<List<Object>> leakDataList = null;
- List<FilterProperty> filterList = getFilterList();
- // TODO : make hashkey (LogData.getKey() --> combination of pid and
- // address)
- if (isRange) {
- leakDataList = SummaryDataManager.getInstance().getLeakDataMaker()
- .getLeakDataForRange();
- } else {
- leaks = AnalyzerManager.getNewLeakDetector().getLeakHash();
- if (leaks == null || leaks.isEmpty())
- return output;
-
- List<Long> leakSeqNumList = new ArrayList<Long>();
- for (Integer key : leaks.keySet()) {
- leakSeqNumList.add(leaks.get(key).getSequenceNumber());
- }
-
- if (!filterList.isEmpty()) {
- // if filter is set by user
- List<String> whereQueryList = convertFilterProperty2Query(filterList);
- leakDataList = SummaryDataManager.getInstance().getLeakDataMaker()
- .getLeakDataWithSeq(leakSeqNumList, whereQueryList);
- } else {
- leakDataList = SummaryDataManager.getInstance().getLeakDataMaker()
- .getLeakDataWithSeq(leakSeqNumList, null);
- }
- }
-
- if (leakDataList == null)
- return output;
- // TODO : it is necessary to consider when choosing a multi-processes.
- int selectedPid = Toolbar.INSTANCE.getSelectedPid();
- int size = leakDataList.size();
-
- for (int i = 0; i < size; i++) {
- List<Object> iLeakData = leakDataList.get(i);
- if (!isRange) {
- if (selectedPid != 0) {
- if (selectedPid != ((Integer) iLeakData
- .get(MemoryAllocationDataDBTable.COLUMN.PID.index)).intValue()) {
- continue;
- }
- }
- }
-
- TreeInput leakInput = makeTreeInputForLeakData(iLeakData, i, filterList);
- if (leakInput != null){
- output.add(leakInput);
- }
- }
-
- return output;
- }
-
- private TreeInput makeTreeInputForLeakData(List<Object> leakData, int index,
- List<FilterProperty> filterList) {
- TreeInput output = null;
-
- if (leakData == null) {
- Logger.error("very strange case !!");
- return null;
- }
-
- Long seq = (Long) leakData.get(MemoryAllocationDataDBTable.COLUMN.SEQUENCE_NUMBER.index);
-
- int apiId = (Integer) leakData.get(MemoryAllocationDataDBTable.COLUMN.API_ID.index);
- String apiName = Global.getFunctionName(apiId);
-
- int pid = (Integer) leakData.get(MemoryAllocationDataDBTable.COLUMN.PID.index);
- String pidString = Integer.toString(pid);
-
- int id = (Integer) leakData.get(MemoryAllocationDataDBTable.COLUMN.MESSAGE_ID.index);
- String type = LogDataFactory.getLogFormatName(id);
-
- long time = (Long) leakData.get(MemoryAllocationDataDBTable.COLUMN.ALLOCATED_TIME.index);
- String timeFormat = null;
- try {
- timeFormat = Formatter.toTimeFormat(time);
- } catch(NumberFormatException e) {
- Logger.exception(e);
- timeFormat = Long.toString(time);
- }
-
- String args = (String) leakData.get(MemoryAllocationDataDBTable.COLUMN.ARGUMENT.index);
-
- String retValue = (String) leakData
- .get(MemoryAllocationDataDBTable.COLUMN.RETURN_VALUE.index);
-
- String libName = (String) leakData
- .get(MemoryAllocationDataDBTable.COLUMN.CALLER_LIBRARY_NAME.index);
- if (libName == null || libName.isEmpty()) {
- libName = AnalyzerConstants.UNKNOWN_LIB;
- }
-
- // check for filter data of the excluded columns
- // from the process of creating a filter query
- // (check for all filter data for the range analysis)
- for (int i = 0; i < filterList.size(); i++) {
- switch(filterList.get(i).getColumnIndex()) {
- case 1: // API(api name)
- if (apiName.toLowerCase().contains(filterList.get(i).getKeyWord().toLowerCase())) {
- break;
- } else {
- return output;
- }
- case 2: // pid
- if (isRange) {
- if (pidString.contains(filterList.get(i).getKeyWord())) {
- break;
- } else {
- return output;
- }
- }
- break;
- case 3: // Category(log format name)
- if (type.toLowerCase().contains(filterList.get(i).getKeyWord().toLowerCase())) {
- break;
- } else {
- return output;
- }
- case 4: // Time(allocated time)
- if (timeFormat.toLowerCase().contains(filterList.get(i).getKeyWord().toLowerCase())) {
- break;
- } else {
- return output;
- }
- case 5: // arguments
- if (isRange) {
- if (args.toLowerCase().contains(filterList.get(i).getKeyWord().toLowerCase())) {
- break;
- } else {
- return output;
- }
- }
- break;
- case 6: // return value
- if (isRange) {
- if (retValue.toLowerCase().contains(
- filterList.get(i).getKeyWord().toLowerCase())) {
- break;
- } else {
- return output;
- }
- }
- break;
- case 7: // library name
- if (isRange) {
- if (libName.toLowerCase()
- .contains(filterList.get(i).getKeyWord().toLowerCase())) {
- break;
- } else {
- return output;
- }
- }
- break;
- default:
- break;
- }
- }
-
- // create table text & data
- List<String> text = new ArrayList<String>();
- List<Object> data = new ArrayList<Object>();
-
- // 0 : sequence number - hidden column for sorting
- text.add(Long.toString(seq));
- data.add(seq);
- // 1 : api name
- text.add(apiName);
- data.add(apiName);
- // 2 : pid
- text.add(pidString);
- data.add(pid);
- // 3 : message id
- text.add(type);
- data.add(type);
- // 4 : allocated time
- text.add(timeFormat);
- data.add(Long.valueOf(time));
- // 5 : arguments
- text.add(args);
- data.add(args);
- // 6 : return value
- text.add(retValue);
- data.add(retValue);
- // 7 : library name
- text.add(libName);
- data.add(libName);
- // 8 : for ToolTip Listener
- data.add((Long) leakData.get(MemoryAllocationDataDBTable.COLUMN.ALLOCATED_ADDRESS.index));
- // 9 : caller pc address
- long callerPcAddr = (Long) leakData
- .get(MemoryAllocationDataDBTable.COLUMN.CALLER_PC_ADDRESS.index);
- data.add(callerPcAddr);
-
- ProbeCommonData probeData = new ProbeCommonData();
- probeData.setSeq(seq);
- probeData.setApiName(apiName);
- probeData.setMsgID(id);
- probeData.setPid(pid);
- probeData.setTime(time);
- probeData.setArgs(args);
- probeData.setReturn(retValue);
- probeData.setCallerAddress(callerPcAddr);
- probeData.setLibName(libName);
-
- DATableDataFormat tableData = new DATableDataFormat(index);
- tableData.setType(AnalyzerConstants.TYPE_TABLE_LEAK);
- tableData.getData().addAll(data);
- tableData.setObject(apiName);
- tableData.setLogData(probeData);
-
- output = new TreeInput();
- output.setText(text);
- output.setData(tableData);
- // output.setParent(Integer.toString(leakData.getParentKey()));
-
- if (RangeDataManager.getInstance().isBeingAnalyzed()) {
- long leakTime = time;
- long startTime = RangeDataManager.getInstance().getAnalysisStartTime();
- long endTime = RangeDataManager.getInstance().getAnalysisEndTime();
- if (leakTime >= startTime && leakTime <= endTime) {
- output.setInRange(true);
- }
- }
-
- return output;
- }
-
- private List<FilterProperty> getFilterList() {
- List<FilterProperty> filterList = getFilterPropertyList();
- if (!filterList.isEmpty()) {
- List<FilterProperty> filterListRep = new ArrayList<FilterProperty>();
- filterListRep.addAll(filterList);
- return filterListRep;
- } else {
- return filterList;
- }
- }
-
- @Override
- protected List<String> convertFilterProperty2Query(List<FilterProperty> filterList) {
- List<String> queries = new ArrayList<String>();
-
- Iterator<FilterProperty> iter = filterList.iterator();
- while (iter.hasNext()) {
- FilterProperty prop = iter.next();
- String queryPrefix = getFilteredColumnName(prop.getColumnIndex());
- if (queryPrefix != null) {
- queries.add(makeFilterWhereClause(queryPrefix, prop.getKeyWord()));
- iter.remove();
- }
- }
-
- return queries;
- }
-
- // excluded columns : API(api name), Category(log format name), Time(allocated time)
- @Override
- protected String getFilteredColumnName(int index) {
- String columnName = null;
- switch (index) {
- case 2:
- columnName = MemoryAllocationDataDBTable.COLUMN.PID.name;
- break;
- case 5:
- columnName = addLowerOperation(MemoryAllocationDataDBTable.COLUMN.ARGUMENT.name);
- break;
- case 6:
- columnName = addLowerOperation(MemoryAllocationDataDBTable.COLUMN.RETURN_VALUE.name);
- break;
- case 7:
- columnName = addLowerOperation(MemoryAllocationDataDBTable.COLUMN.CALLER_LIBRARY_NAME.name);
- break;
- default:
- break;
- }
-
- return columnName;
- }
-}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Seokgil Kang <seokgil.kang@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.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.nl.AnalyzerLabels;
-import org.tizen.dynamicanalyzer.nl.SummaryLabels;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.ui.widgets.DAAdvancedViewComposite;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TreeDataComparator;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
-
-public class LeakView extends DAAdvancedViewComposite {
- protected String[] columnNames = {SummaryLabels.LEAK_VIEW_INDEX, SummaryLabels.LEAK_VIEW_NAME,
- SummaryLabels.LEAK_VIEW_PID,
- SummaryLabels.LEAK_VIEW_TYPE, SummaryLabels.LEAK_VIEW_TIME,
- SummaryLabels.LEAK_VIEW_PARAMETER,
- SummaryLabels.LEAK_VIEW_RETURN, AnalyzerLabels.TABLE_COLUMN_LIBNAME };
- protected int[] columnSizes = { 25, 150, 45, 65, 70, 100, 70, 200 };
- protected boolean[] columnVisibility = { false, true, true, true, true,
- true, true, true };
- protected int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NUM,
- AnalyzerConstants.SORT_TYPE_STRING, AnalyzerConstants.SORT_TYPE_NUM,
- AnalyzerConstants.SORT_TYPE_STRING, AnalyzerConstants.SORT_TYPE_NUM,
- AnalyzerConstants.SORT_TYPE_STRING,
- AnalyzerConstants.SORT_TYPE_STRING,
- AnalyzerConstants.SORT_TYPE_STRING };
-
- protected DATreeComposite treeComp = null;
-
- public LeakView(Composite parent, int style) {
- super(parent, style, false, true);
- this.setLayout(new FillLayout());
-
- setTitle(SummaryLabels.LEAK_VIEW_TITLE_LEAK);
-
- Composite contents = 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));
- setTable(treeComp);
- }
-
- @Override
- public void updateView() {
- treeComp.updateTree();
- }
-
- @Override
- public void updateView(DAViewData data) {
- // other view selection occurred
- treeComp.deselectAll();
- }
-
- @Override
- public void clear() {
- treeComp.clear();
- }
-
- @Override
- public Control getControl() {
- return treeComp;
- }
-}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Seokgil Kang <seokgil.kang@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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.sql.PreparedStatement;
-import java.sql.SQLException;
-import java.util.List;
-
-import org.tizen.dynamicanalyzer.common.DALimit;
-import org.tizen.dynamicanalyzer.database.DBColumn;
-import org.tizen.dynamicanalyzer.database.DBConstants;
-import org.tizen.dynamicanalyzer.database.DBTable;
-import org.tizen.dynamicanalyzer.util.Logger;
-
-public class MemoryAllocationDataDBTable extends DBTable {
- private static final String TABLENAME = "MEMORY_ALLOCATION_DATA";
-
- public enum COLUMN {
- SEQUENCE_NUMBER(0, DBConstants.DBCOLUMN_SEQUENCE_NUMBER),
- PID(1, DBConstants.DBCOLUMN_PID),
- API_ID(2, DBConstants.DBCOLUMN_API_ID),
- API_TYPE(3, DBConstants.DBCOLUMN_API_TYPE),
- ALLOCATED_ADDRESS(4, "ALLOCATED_ADDRESS"),
- ALLOCATED_TIME(5, "ALLOCATED_TIME"),
- CALLER_PC_ADDRESS(6, DBConstants.DBCOLUMN_CALLER_PC_ADDRESS),
- ARGUMENT(7, DBConstants.DBCOLUMN_ARGUMENT),
- RETURN_VALUE(8, DBConstants.DBCOLUMN_RETURN_VALUE),
- CALLER_LIBRARY_NAME(9, DBConstants.DBCOLUMN_CALLER_LIBRARY_NAME),
- MESSAGE_ID(10, "MESSAGE_ID"),
- TID(11, DBConstants.DBCOLUMN_TID),
- ALLOCATED_MEMORY_SIZE(12, "ALLOCATED_MEMORY_SIZE");
- // MEMORY_ALLOCATION_KEY(13, "MEMORY_ALLOCATION_KEY"),
- // MEMORY_ALLOCATION_PARENT_KEY(14, "MEMORY_ALLOCATION_PARENT_KEY");
-
- public final int index;
- public final String name;
-
- COLUMN(int index, String name) {
- this.index = index;
- this.name = name;
- }
- }
-
- @Override
- public String getTableName() {
- return TABLENAME;
- }
-
- public MemoryAllocationDataDBTable() {
- addColumn(new DBColumn(COLUMN.SEQUENCE_NUMBER.name, DBConstants.PRIMARY_KEY,
- DBConstants.DBTYPE_INT8));
- addColumn(new DBColumn(COLUMN.PID.name, DBConstants.NOT_NULL,
- DBConstants.DBTYPE_INT4));
- addColumn(new DBColumn(COLUMN.API_ID.name, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
- addColumn(new DBColumn(COLUMN.API_TYPE.name, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
- addColumn(new DBColumn(COLUMN.ALLOCATED_ADDRESS.name, DBConstants.NOT_NULL,
- DBConstants.DBTYPE_LONG)); // default:-1
- addColumn(new DBColumn(COLUMN.ALLOCATED_TIME.name, DBConstants.NOT_NULL,
- DBConstants.DBTYPE_LONG));
- addColumn(new DBColumn(COLUMN.CALLER_PC_ADDRESS.name, DBConstants.EMPTY,
- DBConstants.DBTYPE_LONG));
- addColumn(new DBColumn(COLUMN.ARGUMENT.name, DBConstants.EMPTY, DBConstants.DBTYPE_VARCHAR,
- DALimit.FUNCTION_ARGUMENTS_VALUE_LENGTH));
- addColumn(new DBColumn(COLUMN.RETURN_VALUE.name, DBConstants.EMPTY,
- DBConstants.DBTYPE_VARCHAR, DALimit.FUNCTION_ARGUMENTS_FORMAT_LENGTH));
- addColumn(new DBColumn(COLUMN.CALLER_LIBRARY_NAME.name, DBConstants.NOT_NULL,
- DBConstants.DBTYPE_VARCHAR, DALimit.FUNCTION_NAME_LENGTH));
- addColumn(new DBColumn(COLUMN.MESSAGE_ID.name, DBConstants.NOT_NULL,
- DBConstants.DBTYPE_INT4));
- addColumn(new DBColumn(COLUMN.TID.name, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
- addColumn(new DBColumn(COLUMN.ALLOCATED_MEMORY_SIZE.name, DBConstants.NOT_NULL,
- DBConstants.DBTYPE_LONG));
- // addColumn(new DBColumn(COLUMN.MEMORY_ALLOCATION_KEY.name,
- // DBConstants.NOT_NULL, DBConstants.INTEGER));
- // addColumn(new DBColumn(COLUMN.MEMORY_ALLOCATION_PARENT_KEY.name,
- // DBConstants.NOT_NULL, DBConstants.INTEGER));
- setIndexColumn(COLUMN.PID.index);
- setIndexColumn(COLUMN.ALLOCATED_ADDRESS.index);
- }
-
- @Override
- public boolean prepare(PreparedStatement prep, List<Object> rowData) {
- boolean isPrepared = true;
-
- int columnsize = getColumnSize();
- if (columnsize != rowData.size()) {
- isPrepared = false;
- } else {
- try {
- prep.setLong(1, (Long) (rowData.get(COLUMN.SEQUENCE_NUMBER.index)));
- prep.setInt(2, (Integer) (rowData.get(COLUMN.PID.index)));
- prep.setInt(3, (Integer) (rowData.get(COLUMN.API_ID.index)));
- prep.setInt(4, (Integer) (rowData.get(COLUMN.API_TYPE.index)));
- prep.setLong(5, (Long) (rowData.get(COLUMN.ALLOCATED_ADDRESS.index)));
- prep.setLong(6, (Long) (rowData.get(COLUMN.ALLOCATED_TIME.index)));
- prep.setLong(7, (Long) (rowData.get(COLUMN.CALLER_PC_ADDRESS.index)));
- prep.setString(8, (String) (rowData.get(COLUMN.ARGUMENT.index)));
- prep.setString(9, (String) (rowData.get(COLUMN.RETURN_VALUE.index)));
- prep.setString(10, (String) (rowData.get(COLUMN.CALLER_LIBRARY_NAME.index)));
- prep.setInt(11, (Integer) (rowData.get(COLUMN.MESSAGE_ID.index)));
- prep.setInt(12, (Integer) (rowData.get(COLUMN.TID.index)));
- prep.setLong(13, (Long) (rowData.get(COLUMN.ALLOCATED_MEMORY_SIZE.index)));
-// prep.setInt(13, (Integer) (rowData.get(COLUMN.MEMORY_ALLOCATION_KEY.index)));
-// prep.setInt(14, (Integer) (rowData.get(COLUMN.MEMORY_ALLOCATION_PARENT_KEY.index)));
- } catch (SQLException e) {
- Logger.exception(e);
- isPrepared = false;
- }
- }
-
- return isPrepared;
- }
-}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Seokgil Kang <seokgil.kang@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
-import org.tizen.dynamicanalyzer.setting.Feature;
-import org.tizen.dynamicanalyzer.setting.SettingDataManager;
-import org.tizen.dynamicanalyzer.setting.TargetData;
-import org.tizen.dynamicanalyzer.swap.model.data.LogData;
-import org.tizen.dynamicanalyzer.swap.model.data.MemoryData;
-import org.tizen.dynamicanalyzer.swap.model.data.ProbeCommonData;
-import org.tizen.dynamicanalyzer.util.Logger;
-
-public class NewLeakDetector {
- // TODO : understand and refactoring
-// HashMap<Long, CurrentLeakData> leakHash;
-// HashMap<Long, CurrentLeakData> childHash;
- Map<Integer, CurrentLeakData> leakHash;
- private int leakSeq = 0;
-
- public NewLeakDetector() {
- }
-
- public List<CurrentLeakData> getLeakDataList() {
- List<CurrentLeakData> leakList = new ArrayList<CurrentLeakData>();
- leakList.addAll(getLeakHash().values());
- return leakList;
- }
-
- public Map<Integer, CurrentLeakData> getLeakHash() {
- if (null == leakHash) {
- leakHash = new ConcurrentHashMap<Integer, CurrentLeakData>();
- }
- return leakHash;
- }
-
-// public HashMap<Long, CurrentLeakData> getChildHash() {
-// if (null == childHash) {
-// childHash = new HashMap<Long, CurrentLeakData>();
-// }
-// return childHash;
-// }
-
- // public HashMap<String, Check> getLeakCheckHash() {
- // if (null == leakCheckHash) {
- // leakCheckHash = new HashMap<String, Check>();
- // LeakCheckList leakCheckList = AnalyzerManager.getLeakCheckList();
- // if (null != leakCheckList) {
- // List<Check> checks = leakCheckList.getChecks();
- // if (null != checks) {
- // int size = checks.size();
- // for (int i = 0; i < size; i++) {
- // leakCheckHash.put(checks.get(i).getName(),
- // checks.get(i));
- // }
- // }
- // }
- // }
- // return leakCheckHash;
- // }
-
- // Feature On : false, Feature Off : true
- private boolean isDropLog(LogData logData) {
- TargetData target = SettingDataManager.INSTANCE.getConnectedTargetOrSelected();
- ProbeCommonData pData = (ProbeCommonData) logData;
- if (!pData.isInternal()) return false;
- if (target.isSelectedFeature(Feature.INTERNAL_PROBE_MEMORY)) {
- return false;
- }
-
- return true;
- }
-
-// public int runLeakDetect(LogData logData) {
-// ProbeCommonData log = (ProbeCommonData) logData;
-// String apiName = log.getApiName();
-// long errno = log.getErrno();
-// if (0 != errno) {
-//// return;
-// return -1;
-// }
-//
-// if (isDropLog(logData) && log.isInternal()) {
-//// return;
-// return -1;
-// }
-//
-// LeakInfo chk = null;
-// if (null == LeakCheckList.getLeakCheckList().get(apiName)) {
-//// return;
-// return -1;
-// } else {
-// chk = LeakCheckList.getLeakCheckList().get(apiName);
-// }
-//
-// HashMap<Long, CurrentLeakData> leaks = getLeakHash();
-// if (chk.getApiType() == API_TYPE_OPEN) {
-// CurrentLeakData newLeak = new CurrentLeakData(logData);
-//// leaks.put((long)logData.getKey(), newLeak);
-// leaks.put((long)log.getKey(), newLeak);
-// } else if (chk.getApiType() == API_TYPE_CLOSE) {
-// leaks.remove((long)log.getKey());
-//// int key = log.getKey();
-//// CurrentLeakData freeData = getChildHash().get(key);
-//// if (null != freeData) {
-//// LeakData parent = leaks.get((long)freeData.getParentKey());
-//// parent.removeChild(key);
-//// getChildHash().remove(key);
-//// if (parent.getChildren().isEmpty()) {
-//// leaks.remove(parent.getKey());
-//// }
-//// } else {
-//// leaks.remove(key);
-//// }
-//
-// } else if (chk.getApiType() == API_TYPE_REALLOC) {
-// String inputParam = ((ProbeCommonData) log).getArgs();
-// String[] splitInputParam = inputParam.split("\\,"); //$NON-NLS-1$
-// String param = String.valueOf(splitInputParam[0]);
-// long rmKey = -1;
-// try {
-// if (param.contains("0x")) {
-// rmKey = Long.decode(param);
-// } else {
-// rmKey = Integer.parseInt(splitInputParam[0]);
-// }
-// leaks.remove(rmKey);
-// } catch (NumberFormatException e) {
-// Logger.exception(e);
-// }
-//
-// leaks.put((long)log.getKey(), new CurrentLeakData(log));
-// }
-//
-// return chk.getApiType();
-// }
-
- public int runLeakDetect(LogData logData) {
- ProbeCommonData log = (ProbeCommonData) logData;
- int result = -1;
-// long errno = log.getErrno();
-// if (0 != errno) { // for OSP app
-// return result;
-// }
-
- if (isDropLog(logData)) return result;
-
- Map<Integer, CurrentLeakData> leaks = getLeakHash();
- if (logData instanceof MemoryData) {
- MemoryData mlog = (MemoryData) logData;
- if (mlog.getMemoryApiType() == LogCenterConstants.MEMORY_API_ALLOC) {
- if (mlog.getReturn().equalsIgnoreCase(String.valueOf("0x0")))
- return result;
- if (log.getApiName().contains("realloc")) {
- String inputParam = log.getArgs();
- String[] splitInputParam = inputParam.split("\\,"); //$NON-NLS-1$
- String param = String.valueOf(splitInputParam[0]);
- long allocatedAddr = -1;
- try {
- if (param.contains("0x")) {
- allocatedAddr = Long.decode(param);
- } else {
- allocatedAddr = Long.parseLong(splitInputParam[0]);
- }
- int rmKey = findAllocatedKey(leaks, allocatedAddr, log.getPid());
- if (rmKey != -1)
- leaks.remove(rmKey);
- } catch (NumberFormatException e) {
- Logger.exception(e);
- }
- }
-
- addCurrentLeakData(leaks, logData);
- } else if (mlog.getMemoryApiType() == LogCenterConstants.MEMORY_API_FREE) {
- int key = findAllocatedKey(leaks, mlog.getAddress(), log.getPid());
- if (key != -1) {
- leaks.remove(key);
- }
-// leaks.remove((long)log.getKey());
- }
-
- result = mlog.getMemoryApiType();
- }
-
- return result;
- }
-
- private void addCurrentLeakData(Map<Integer, CurrentLeakData> leaks, LogData log) {
- CurrentLeakData newLeak = new CurrentLeakData(log);
- ((ConcurrentHashMap<Integer, CurrentLeakData>)leaks).put((Integer)log.getKey(), newLeak);
- leakSeq++;
- }
-
- public void addCurrentLeakData(CurrentLeakData leakData) {
- Long key = leakData.getSequenceNumber();
- getLeakHash().put(key.hashCode(), leakData);
- leakSeq++;
- }
-
- private int findAllocatedKey(Map<Integer, CurrentLeakData> leaks, long addr, int pid) {
- for (Map.Entry<Integer, CurrentLeakData> entry : leaks.entrySet()) {
- if (entry.getValue().getAllocatedValue() == addr
- && entry.getValue().getPid() == pid) {
- return entry.getKey();
- }
- }
-
- return -1;
- }
-
- public int getLeakSeq() {
- return leakSeq;
- }
-
- public void clear() {
- getLeakHash().clear();
-// getChildHash().clear();
- leakSeq = 0;
- }
-}
// TODO: will get sample_time from Project.java
if (!isSetSamplePeriod) {
- SAMPLE_TIME = SettingDataManager.INSTANCE.getOptionsPreferencesValue(FlatPreferences.FUNCTION_SAMPLING_RATE);
+ SAMPLE_TIME = SettingDataManager.INSTANCE.getPreferenceValue(FlatPreferences.FUNCTION_SAMPLING_RATE);
if (SAMPLE_TIME < 0) {
SAMPLE_TIME = Feature.FUNCTION_SAMPLING_RATE.getData().getDefaultValue();
}
AppInfo appInfo = Global.getProject().getApplicationInfo();
BinaryInfo binfo = Global.getProject().getDeviceStatusInfo()
.getBinaryInfo(appInfo.getExecBinaryPath());
- if (binfo.getTargetBinaryPath().equals(csa.getPath())) {
+ if ((null != binfo.getTargetBinaryPath())
+ && (binfo.getTargetBinaryPath().equals(csa.getPath()))) {
if (null == appBin) {
CallStackUnit appBinCsa = new CallStackUnit(-1, FunctionUsageProfiler.APPLICATION,
log);
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.TableColumnSizePackListener;
import org.tizen.dynamicanalyzer.ui.widgets.table.TreeDataComparator;
import org.tizen.dynamicanalyzer.util.Logger;
import org.tizen.dynamicanalyzer.utils.Formatter;
setColumnVisibility(new boolean[] { true, true, true, true, true, true, true, true });
setTableToolTipEnable(false);
setTableName(SummaryLabels.FUNCTION_USER_PROFILING_VIEW_TITLE);
- parent.addControlListener(new TableColumnSizePackListener(this, columnSizes));
table.addSelectionListener(new SelectionListener() {
*/
package org.tizen.dynamicanalyzer.ui.summary.profiling;
-import java.util.List;
-
import java.util.ArrayList;
+import java.util.List;
import org.eclipse.nebula.widgets.grid.GridItem;
import org.eclipse.swt.SWT;
import org.tizen.dynamicanalyzer.ui.toolbar.Toolbar;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
import org.tizen.dynamicanalyzer.ui.widgets.table.TreeDataComparator;
import org.tizen.dynamicanalyzer.utils.Formatter;
setColumnVisibility(columnVisibility);
setTableToolTipEnable(false);
setTableName(SummaryLabels.FUNCTION_USER_PROFILING_VIEW_TITLE);
- parent.addControlListener(new TableColumnSizePackListener(this, columnSizes));
table.addSelectionListener(new SelectionListener() {
import org.tizen.dynamicanalyzer.ui.widgets.DAAdvancedViewComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAContainerComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
public class WarningListView extends DAAdvancedViewComposite {
tableComp.setColumnSize(columnSizes);
tableComp.setColumnVisibility(columnVisibility);
tableComp.setTableName(SummaryLabels.WARNING_LIST_VIEW_TITLE);
- contents.addControlListener(new TableColumnSizePackListener(tableComp,
- columnSizes));
setTable(tableComp);
}
Control current = this;
Composite parent = getParent();
while (parent != null) {
- if ((parent instanceof DAPageComposite)
- && ((DAPageComposite) parent).isToplevel())
+ if ((parent instanceof DAContainerComposite)
+ && ((DAContainerComposite) parent).isToplevel())
break;
if (parent instanceof SashForm) {
import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
import org.tizen.dynamicanalyzer.ui.toolbar.Toolbar;
import org.tizen.dynamicanalyzer.ui.widgets.DAAdvancedViewComposite;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
public class ThreadAPIListView extends DAAdvancedViewComposite {
tableComp.setColumns(columnNames);
tableComp.setColumnSize(columnSizes);
- contents.addControlListener(new TableColumnSizePackListener(tableComp, columnSizes));
setTable(tableComp);
}
*/
package org.tizen.dynamicanalyzer.ui.thread;
-import java.util.Map;
-
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.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Sash;
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.setting.SettingDataManager;
import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
-import org.tizen.dynamicanalyzer.swap.logparser.DataManagerRegistry;
-import org.tizen.dynamicanalyzer.ui.page.BaseView;
-import org.tizen.dynamicanalyzer.ui.page.PageInfoRegistry;
import org.tizen.dynamicanalyzer.ui.thread.chart.ThreadChartView;
import org.tizen.dynamicanalyzer.ui.thread.data.ThreadDataManager;
-import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineTableView;
-import org.tizen.dynamicanalyzer.util.Logger;
-import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
-import org.tizen.dynamicanalyzer.widgets.da.view.DABaseComposite;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DABaseDataPageComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DATabComposite;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
-public class ThreadPage extends DAPageComposite {
+public class ThreadPage extends DABaseDataPageComposite {
public static final String pageID = ThreadPage.class.getName();
public static final String chartViewID = ThreadChartView.class.getName();
public static final String listViewID = ThreadAPIListView.class.getName();
private DATabComposite threadApiTableView = null;
private DATabComposite threadDetailTableView = null;
- SashForm baseForm;
- SashForm topForm;
- SashForm bottomForm;
-
- boolean isDetailMode = true;
-
- int tableHeight = -1;
- int tableWeight = 65;
-
- boolean wasSashCreated = false;
-
public ThreadPage(Composite parent, int style) {
super(parent, style);
setTitle(AnalyzerLabels.COOLBAR_AREA_THREAD);
- this.setData(DAPageComposite.KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_THREAD_TOOLTIP);
+ this.setData(KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_THREAD_TOOLTIP);
this.setBackground(ColorResources.WHITE);
this.setLayout(new FillLayout());
- baseForm = new SashForm(this, SWT.VERTICAL);
- baseForm.setLayout(new FillLayout());
- baseForm.setForeground(ColorResources.WHITE);
- baseForm.setBackground(ColorResources.WHITE);
// ((FillLayout) getLayout()).marginHeight = 15;
// ((FillLayout) getLayout()).marginWidth = 5;
- topForm = new SashForm(baseForm, SWT.VERTICAL);
ThreadChartView threadChartView = new ThreadChartView(topForm, SWT.NONE);
addView(threadChartView);
- bottomForm = new SashForm(baseForm, SWT.HORIZONTAL);
-
- SashForm bottomLeftForm = new SashForm(bottomForm, SWT.NONE);
- bottomLeftForm.setForeground(ColorResources.TAB_SELECTED_COLOR_START);
- bottomLeftForm.setLayout(new FillLayout());
-
- SashForm bottomRightForm = new SashForm(bottomForm, SWT.NONE);
- bottomRightForm.setForeground(ColorResources.TAB_SELECTED_COLOR_START);
- bottomRightForm.setLayout(new FillLayout());
-
threadApiTableView = new DATabComposite(bottomLeftForm, SWT.NONE, false, true);
{
ThreadAPIListView threadAPIListView = new ThreadAPIListView(threadApiTableView.getContentComposite(),
addView(threadDetailInfoView);
}
addView(threadDetailTableView);
-
- topForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- bottomForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- bottomLeftForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- bottomRightForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
-
- bottomForm.setWeights(new int[] { tableWeight, 100 - tableWeight });
-
- addTableWeightListener();
- }
-
- private void addHeightWeightListener() {
- if(baseForm.getChildren().length > 2) {
- ((Sash)baseForm.getChildren()[2]).addListener(SWT.MouseUp, new Listener() {
- @Override
- public void handleEvent(Event event) {
- tableHeight = (int)((double)baseForm.getWeights()[0] / baseForm.getWeights()[0] + baseForm.getWeights()[1]) * baseForm.getSize().y * 1/1000;
- }
- });
-
- wasSashCreated = true;
- }
- }
-
- private void addTableWeightListener() {
- ((SashForm)bottomForm.getChildren()[0]).addListener(SWT.Resize, new Listener(){
- @Override
- public void handleEvent(Event event) {
- resizeTableButton();
- }
- });
}
@Override
- public Composite getTopTable() {
- DAViewComposite view = (DAViewComposite)this.threadApiTableView.getTopComposite();
- Composite comp = (Composite)view.getControl();
- Logger.debug(comp.toString());
- return comp;
- }
-
- public SashForm getBaseForm() {
- return baseForm;
- }
-
- public void setDetailMode(boolean mode) {
- isDetailMode = mode;
- }
-
- @Override
- protected void onResized(int width, int height) {
- if(!wasSashCreated) { // This variable needs to check whether a Sash was created to calculate height ratio between chart area and table area
- addHeightWeightListener();
- }
-
- resizePageButton();
- resizeTableButton();
-
- if(!isDetailMode) {
- baseForm.setWeights(new int[] { 100, 0 });
- } else {
- int hrate = (tableHeight == -1) ? (int) (TimelineTableView.DEFAULT_TABLE_VIEW_HEIGHT * 100 / height) :
- (int) (tableHeight * 100 / height);
-
- if(hrate > 100) {
- return;
- }
-
- baseForm.setWeights(new int[] { 100 - hrate, hrate });
- }
- }
-
- private void resizePageButton() {
- int width = WorkbenchUtil.getWorkbenchWindow().getShell().getBounds().width;
- int pageCount = PageInfoRegistry.getPageNamesByTarget(SettingDataManager.INSTANCE.getConnectedTargetOrSelected().getTargetName()).size();
-
- int newWidth = (width/pageCount > DATabComposite.LONG_TAB_WIDTH) ? DATabComposite.LONG_TAB_WIDTH : width/pageCount;
- ((BaseView)WorkbenchUtil.getViewPart(BaseView.ID)).getMainTab().updateTabButtonsWidth(newWidth);
- }
-
- private void resizeTableButton() {
- double weight = (double) bottomForm.getWeights()[0] / 1000;
- int width = (int) (WorkbenchUtil.getWorkbenchWindow().getShell().getBounds().width * weight);
- int tabCount = threadApiTableView.getTabButtons().size();
-
- int newWidth = (width/tabCount > DATabComposite.LONG_TAB_WIDTH) ? DATabComposite.LONG_TAB_WIDTH : width/tabCount;
- threadApiTableView.updateTabButtonsWidth(newWidth);
- }
-
- @Override
public void clear() {
super.clear();
ThreadDataManager.getInstance().clear();
}
-
- @Override
- public void updateView() {
- for (Map.Entry<String, DABaseComposite> entry : childMap.entrySet()) {
- entry.getValue().updateView();
- }
- if(!isDetailMode) {
- if(baseForm.getChildren().length > 2) {
- ((Sash)baseForm.getChildren()[2]).setVisible(false);
- }
- } else {
- if(baseForm.getChildren().length > 2) {
- ((Sash)baseForm.getChildren()[2]).setVisible(true);
- }
- }
- }
}
package org.tizen.dynamicanalyzer.ui.timeline;
-import java.util.Map;
-
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.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Sash;
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.Global;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.setting.SettingDataManager;
import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
import org.tizen.dynamicanalyzer.ui.info.callstack.CallstackView;
import org.tizen.dynamicanalyzer.ui.info.screenshot.ScreenshotDataManager;
import org.tizen.dynamicanalyzer.ui.interactive.data.InteractiveDataManager;
-import org.tizen.dynamicanalyzer.ui.page.BaseView;
-import org.tizen.dynamicanalyzer.ui.page.PageInfoRegistry;
import org.tizen.dynamicanalyzer.ui.summary.SummaryDataManager;
import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;
import org.tizen.dynamicanalyzer.ui.timeline.calltrace.CallTraceDataManager;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineChartView;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineDataManager;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineTableView;
-import org.tizen.dynamicanalyzer.ui.toolbar.replay.data.ReplayDataManager;
-import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
-import org.tizen.dynamicanalyzer.widgets.da.view.DABaseComposite;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DABaseDataPageComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DATabComposite;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
-public class TimelinePage extends DAPageComposite {
+public class TimelinePage extends DABaseDataPageComposite {
public static final String pageID = TimelinePage.class.getName();
public static final String timelineViewID = TimelineChartView.class.getName();
public static final String calltraceViewID = CallTraceView.class.getName();
- SashForm baseForm;
- SashForm topForm;
- SashForm bottomForm;
-
TimelineChartView timelineChartView;
TimelineTableView timelineTableView;
-
- boolean isDetailMode = true;
-
- int tableHeight = -1;
- int tableWeight = 65;
-
+
boolean wasSashCreated = false;
public TimelinePage(Composite parent, int style) {
super(parent, style);
setTitle(AnalyzerLabels.COOLBAR_AREA_TIMELINE);
- this.setData(DAPageComposite.KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_TIMELINE_TOOLTIP);
+ this.setData(KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_TIMELINE_TOOLTIP);
this.setBackground(ColorResources.WHITE);
this.setLayout(new FillLayout());
- baseForm = new SashForm(this, SWT.VERTICAL);
- baseForm.setForeground(ColorResources.WHITE);
- baseForm.setBackground(ColorResources.WHITE);
// ((FillLayout) getLayout()).marginHeight = 15;
// ((FillLayout) getLayout()).marginWidth = 5;
- topForm = new SashForm(baseForm, SWT.VERTICAL);
timelineChartView = new TimelineChartView(topForm, SWT.NONE);
addView(timelineChartView);
- bottomForm = new SashForm(baseForm, SWT.HORIZONTAL);
-
- SashForm bottomLeftForm = new SashForm(bottomForm, SWT.NONE);
- bottomLeftForm.setForeground(ColorResources.WHITE);
- bottomLeftForm.setLayout(new FillLayout());
-
- SashForm bottomRightForm = new SashForm(bottomForm, SWT.NONE);
- bottomRightForm.setForeground(ColorResources.WHITE);
- bottomRightForm.setLayout(new FillLayout());
-
timelineTableView = new TimelineTableView(bottomLeftForm, SWT.NONE);
addView(timelineTableView);
-
+
DATabComposite timelineCallStackTableView = new DATabComposite(bottomRightForm, SWT.NONE, false, true);
{
CallstackView callstack = new CallstackView(timelineCallStackTableView.getContentComposite(), SWT.NONE);
addView(callstack);
}
addView(timelineCallStackTableView);
-
- topForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- bottomForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- bottomLeftForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- bottomRightForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
-
- bottomForm.setWeights(new int[] { tableWeight, 100 - tableWeight });
-
- addTableWeightListener();
- }
-
- private void addHeightWeightListener() {
- if(baseForm.getChildren().length > 2) {
- ((Sash)baseForm.getChildren()[2]).addListener(SWT.MouseUp, new Listener() {
- @Override
- public void handleEvent(Event event) {
- tableHeight = baseForm.getWeights()[1] * baseForm.getSize().y / 1000;
- }
- });
-
- wasSashCreated = true;
- }
- }
-
- private void addTableWeightListener() {
- ((SashForm)bottomForm.getChildren()[0]).addListener(SWT.Resize, new Listener(){
- @Override
- public void handleEvent(Event event) {
- resizeTableButton();
- }
- });
- }
-
- @Override
- public Composite getTopTable() {
- DAViewComposite view= (DAViewComposite)this.timelineTableView.getTopComposite();
- Composite comp = (Composite)view.getControl();
- return comp;
}
+
public TimelineChartView getTimelineChartView() {
return timelineChartView;
}
public TimelineTableView getTimelineTableView() {
return timelineTableView;
}
-
- public SashForm getBaseForm() {
- return baseForm;
- }
-
- public void setDetailMode(boolean mode) {
- isDetailMode = mode;
- }
-
- @Override
- protected void onResized(int width, int height) {
- if(!wasSashCreated) { // This variable needs to check whether a Sash was created to calculate height ratio between chart area and table area
- addHeightWeightListener();
- }
-
- resizePageButton();
- resizeTableButton();
-
- if(!isDetailMode) {
- baseForm.setWeights(new int[] { 100, 0 });
- } else {
- int hrate = (tableHeight == -1) ? (int) (TimelineTableView.DEFAULT_TABLE_VIEW_HEIGHT * 100 / height) :
- (int) (tableHeight * 100 / height);
-
- if(hrate > 100) {
- return;
- }
-
- baseForm.setWeights(new int[] { 100 - hrate, hrate });
- }
- }
-
- private void resizePageButton() {
- int width = WorkbenchUtil.getWorkbenchWindow().getShell().getBounds().width;
- int pageCount = PageInfoRegistry.getPageNamesByTarget(SettingDataManager.INSTANCE.getConnectedTargetOrSelected().getTargetName()).size();
-
- int newWidth = (width/pageCount > DATabComposite.LONG_TAB_WIDTH) ? DATabComposite.LONG_TAB_WIDTH : width/pageCount;
- ((BaseView)WorkbenchUtil.getViewPart(BaseView.ID)).getMainTab().updateTabButtonsWidth(newWidth);
- }
-
- public void resizeTableButton() {
- double weight = (double) bottomForm.getWeights()[0] / 1000;
- int width = (int) (WorkbenchUtil.getWorkbenchWindow().getShell().getBounds().width * weight);
- int tabCount = timelineTableView.getTabButtons().size();
-
- int newWidth = (width/tabCount > DATabComposite.LONG_TAB_WIDTH) ? DATabComposite.LONG_TAB_WIDTH : width/tabCount;
- timelineTableView.updateTabButtonsWidth(newWidth);
- }
@Override
public void clear() {
// clear data managers
TimelineDataManager.getInstance().clear();
- ReplayDataManager.getInstance().clear();
CallTraceDataManager.getInstance().clear();
InteractiveDataManager.getInstance().clear();
ScreenshotDataManager.getInstance().clear();
FunctionUsageProfiler.getInstance().clear();
SummaryDataManager.getInstance().clear();
}
-
- @Override
- public void updateView() {
- for (Map.Entry<String, DABaseComposite> entry : childMap.entrySet()) {
- entry.getValue().updateView();
- }
- if(!isDetailMode) {
- if(baseForm.getChildren().length > 2) {
- ((Sash)baseForm.getChildren()[2]).setVisible(false);
- }
- } else {
- if(baseForm.getChildren().length > 2) {
- ((Sash)baseForm.getChildren()[2]).setVisible(true);
- }
- }
- }
}
private double time;
private CreateImageThread(String imagePath, double time) {
+ super(CreateImageThread.class.getSimpleName());
+
this.imagePath = imagePath;
this.time = time;
}
}
});
}
- });
+ }, "DlogThread");
dlogthread.start();
start = true;
import org.eclipse.swt.events.MouseListener;\r
import org.eclipse.swt.events.SelectionEvent;\r
import org.eclipse.swt.events.SelectionListener;\r
-import org.eclipse.swt.graphics.Point;\r
import org.eclipse.swt.widgets.Composite;\r
-import org.eclipse.swt.widgets.Display;\r
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;\r
import org.tizen.dynamicanalyzer.common.AnalyzerManager;\r
import org.tizen.dynamicanalyzer.common.DASelectionData;\r
import org.tizen.dynamicanalyzer.common.Global;\r
import org.tizen.dynamicanalyzer.model.TableInput;\r
import org.tizen.dynamicanalyzer.resources.ColorResources;\r
-import org.tizen.dynamicanalyzer.resources.FontResources;\r
import org.tizen.dynamicanalyzer.ui.common.UICommonConstants;\r
-import org.tizen.dynamicanalyzer.ui.page.BaseView;\r
import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;\r
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineChartView;\r
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;\r
import org.tizen.dynamicanalyzer.ui.toolbar.Toolbar;\r
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;\r
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;\r
-import org.tizen.dynamicanalyzer.ui.widgets.table.DATablePopupMenu;\r
import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;\r
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;\r
-import org.tizen.dynamicanalyzer.util.WorkbenchUtil;\r
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;\r
import org.tizen.dynamicanalyzer.utils.Formatter;\r
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;\r
-import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuItem;\r
-import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuListener;\r
import org.tizen.dynamicanalyzer.widgets.timeline.MarkerManager;\r
import org.tizen.sdblib.util.StringUtil;\r
\r
private int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NONE, AnalyzerConstants.SORT_TYPE_NONE, AnalyzerConstants.SORT_TYPE_NONE,\r
AnalyzerConstants.SORT_TYPE_NONE,AnalyzerConstants.SORT_TYPE_NONE, AnalyzerConstants.SORT_TYPE_NONE };\r
\r
- private List<TableInput> tableClone = new ArrayList<TableInput>();\r
private List<DADlogData> dlogClone = new ArrayList<DADlogData>();\r
- private List<TableInput> filteredDlog = new ArrayList<TableInput>();\r
- private static boolean isFilter = false;\r
\r
- private static String POPUP_FILTER_BY_LEVEL = "Filter by selected Level";\r
- private static String POPUP_FILTER_BY_PID = "Filter by selected PID";\r
- private static String POPUP_FILTER_BY_TID = "Filter by selected TID";\r
- private static String POPUP_FILTER_BY_TAG = "Filter by selected Tag";\r
- private static String POPUP_SHOW_ALL_DLOGS = "Show all Dlogs";\r
- \r
- private static int TABLE_INDEX_LEVEL = 1;\r
- private static int TABLE_INDEX_PID = 2;\r
- private static int TABLE_INDEX_TID = 3;\r
- private static int TABLE_INDEX_TAG = 4;\r
- \r
public DlogTable(Composite parent, int compStyle, int tableStyle) {\r
super(parent, compStyle, tableStyle);\r
\r
\r
setComparator(new DefaultTableComparator()); \r
\r
- parent.addControlListener(new TableColumnSizePackListener(this, columnSizes));\r
\r
- initDlogListeners(); \r
- initPopupMenu();\r
+ initDlogListeners();\r
}\r
- \r
- private void initPopupMenu() {\r
- popupMenu = new DATablePopupMenu(table);\r
- popupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT);\r
- \r
- DAPopupMenuItem filterByLevelItem = new DAPopupMenuItem(popupMenu);\r
- filterByLevelItem.setText(POPUP_FILTER_BY_LEVEL);\r
- filterByLevelItem.addListener(new DAPopupMenuListener() {\r
- @Override\r
- public void widgetSelected(DAPopupMenuItem menuItem) {\r
- GridItem item = table.getItem(new Point(mousePoint.x, mousePoint.y));\r
- if (null == item) {\r
- return;\r
- }\r
- \r
- String startData = ((DATableDataFormat) item.getData()).getData().get(TABLE_INDEX_LEVEL).toString();\r
- filterTable(startData, TABLE_INDEX_LEVEL);\r
- }\r
- });\r
- \r
- DAPopupMenuItem filterByLevelPID = new DAPopupMenuItem(popupMenu);\r
- filterByLevelPID.setText(POPUP_FILTER_BY_PID);\r
- filterByLevelPID.addListener(new DAPopupMenuListener() {\r
- @Override\r
- public void widgetSelected(DAPopupMenuItem menuItem) {\r
- GridItem item = table.getItem(new Point(mousePoint.x, mousePoint.y));\r
- if (null == item) {\r
- return;\r
- }\r
- \r
- String startData = ((DATableDataFormat) item.getData()).getData().get(TABLE_INDEX_PID).toString();\r
- filterTable(startData, TABLE_INDEX_PID);\r
- }\r
- });\r
- \r
- DAPopupMenuItem filterByLevelTID = new DAPopupMenuItem(popupMenu);\r
- filterByLevelTID.setText(POPUP_FILTER_BY_TID);\r
- filterByLevelTID.addListener(new DAPopupMenuListener() {\r
- @Override\r
- public void widgetSelected(DAPopupMenuItem menuItem) {\r
- GridItem item = table.getItem(new Point(mousePoint.x, mousePoint.y));\r
- if (null == item) {\r
- return;\r
- }\r
- \r
- String startData = ((DATableDataFormat) item.getData()).getData().get(TABLE_INDEX_TID).toString();\r
- filterTable(startData, TABLE_INDEX_TID);\r
- }\r
- });\r
- \r
- DAPopupMenuItem filterByTagItem = new DAPopupMenuItem(popupMenu);\r
- filterByTagItem.setText(POPUP_FILTER_BY_TAG);\r
- filterByTagItem.addListener(new DAPopupMenuListener() {\r
- @Override\r
- public void widgetSelected(DAPopupMenuItem menuItem) {\r
- GridItem item = table.getItem(new Point(mousePoint.x, mousePoint.y));\r
- if (null == item) {\r
- return;\r
- }\r
- \r
- String startData = ((DATableDataFormat) item.getData()).getData().get(TABLE_INDEX_TAG).toString();\r
- filterTable(startData, TABLE_INDEX_TAG);\r
- }\r
- });\r
- \r
- \r
- \r
- DAPopupMenuItem allDlogShowItem = new DAPopupMenuItem(popupMenu);\r
- allDlogShowItem.setText(POPUP_SHOW_ALL_DLOGS);\r
- allDlogShowItem.addListener(new DAPopupMenuListener() {\r
- @Override\r
- public void widgetSelected(DAPopupMenuItem menuItem) {\r
- isFilter = false;\r
- table.update();\r
- Display.getDefault().syncExec(new Runnable() {\r
- @Override\r
- public void run() {\r
- BaseView baseView = (BaseView) WorkbenchUtil.getViewPart(BaseView.ID);\r
- baseView.getTopComposite().updateView();\r
- }\r
- });\r
- }\r
- });\r
- }\r
- \r
+\r
public boolean initDlogListeners(){\r
\r
table.addSelectionListener(new SelectionListener() {\r
dlogClone = dlogData;\r
int seqnum = 0;\r
\r
- if(isFilter){\r
- output = filteredDlog;\r
- return output;\r
- }\r
for(DADlogData data : dlogData){\r
List<String> text = new ArrayList<String>();\r
List<Object> tabledata = new ArrayList<Object>();\r
\r
output.add(tableInput);\r
}\r
- tableClone = output;\r
return output;\r
}\r
\r
- private void filterTable(String input, int categoryIndex) {\r
- \r
- filteredDlog.clear();\r
- \r
- if(tableClone != null){\r
- for(TableInput table : tableClone){\r
- if(table.getText().get(categoryIndex).equals(input)){\r
- filteredDlog.add(table);\r
- isFilter = true;\r
- }\r
- }\r
- }\r
- table.update();\r
- Display.getDefault().syncExec(new Runnable() {\r
- @Override\r
- public void run() {\r
- BaseView baseView = (BaseView) WorkbenchUtil.getViewPart(BaseView.ID); \r
- baseView.getTopComposite().updateView(); \r
- }\r
- });\r
- }\r
-\r
private void setDlogSelecetionRange(long startTime, long endTime){\r
\r
double startMarkerTime = startTime\r
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 org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Shell;
-import org.tizen.dynamicanalyzer.common.path.PathManager;
-import org.tizen.dynamicanalyzer.constant.CommonConstants;
+import org.tizen.dynamicanalyzer.common.AboutInfo;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.nl.WidgetLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
private Composite buttonContentsComp = null;
private Composite titleCotentsComp = null;
- private static String sdkBuildVersionInfo = CommonConstants.EMPTY;
- private static String daBuildIDInfo = CommonConstants.EMPTY;
- private static String daVersionInfo = CommonConstants.EMPTY;
-
final private int WIDTH = 430;
final private int HEIGHT = 310;
- final static String daAboutFilePath = PathManager.getWorkbenchPluginPath() + File.separator + "about.mappings";
-
- final static String daVersionFilePath = PathManager.DA_INSTALL_PATH + File.separator + "version";
-
- final static String sdkVersionFilePath = PathManager.TIZEN_SDK_INSTALL_PATH + File.separator + "sdk.version";
-
public AboutDialog(Shell parent) {
super(parent);
}
}
});
- updateBuildInfo();
-
titleCotentsComp = new Composite(shell, SWT.NONE);
mainContentsComp = new Composite(shell, SWT.NONE);
Composite marginMiddle = new Composite(shell, SWT.NONE);
}
private void drawMainContents() {
+ AboutInfo info = AboutInfo.getInstance();
+
Composite contents = new Composite(mainContentsComp, SWT.NONE);
FormData form = new FormData();
form.top = new FormAttachment(0, 22);
daversionvalue.setFont(FontResources.DIALOG_CONTENTS_NORMAL_FONT);
daversionvalue.setBackground(ColorResources.DIALOG_CONTENT_BACKGROUND);
daversionvalue.setForeground(ColorResources.DEFAULT_FONT_COLOR);
- daversionvalue.setText(daVersionInfo);
+ daversionvalue.setText(info.getDAVersion());
((FormData)valuecontents.getLayoutData()).top = new FormAttachment(0, 17);
Label buildtimevalue = new Label(valuecontents, SWT.LEFT);
buildtimevalue.setFont(FontResources.DIALOG_CONTENTS_NORMAL_FONT);
buildtimevalue.setBackground(ColorResources.DIALOG_CONTENT_BACKGROUND);
buildtimevalue.setForeground(ColorResources.DEFAULT_FONT_COLOR);
- buildtimevalue.setText(daBuildIDInfo);
+ buildtimevalue.setText(info.getDABuildID());
Link tizensitevalue = new Link(valuecontents, SWT.LEFT);
tizensitevalue.setFont(FontResources.DIALOG_CONTENTS_NORMAL_FONT);
tizensitevalue.setBackground(ColorResources.DIALOG_CONTENT_BACKGROUND);
tizensitevalue.setForeground(ColorResources.POINT);
- tizensitevalue.setText("<a>" + AnalyzerLabels.ABOUT_DIALOG_TIZEN_SITE_LINK + "</a>");
+ tizensitevalue.setText("<a>" + info.getTizenSite() + "</a>");
tizensitevalue.addSelectionListener(new SelectionListener() {
@Override
public void widgetDefaultSelected(SelectionEvent arg0) {
@Override
public void widgetSelected(SelectionEvent arg0) {
try {
- String url = AnalyzerLabels.ABOUT_DIALOG_TIZEN_SITE_LINK;
+ String url = AboutInfo.getInstance().getTizenSite();
if (CommonUtil.isWin()) {
org.eclipse.swt.program.Program.launch(url);
} else if (CommonUtil.isLinux()) {
releasenotevalue.setFont(FontResources.DIALOG_CONTENTS_NORMAL_FONT);
releasenotevalue.setBackground(ColorResources.DIALOG_CONTENT_BACKGROUND);
releasenotevalue.setForeground(ColorResources.POINT);
- releasenotevalue.setText("<a>" + AnalyzerLabels.ABOUT_DIALOG_TIZEN_DEVELOP_SITE_LINK + "</a>");
+ releasenotevalue.setText("<a>" + AnalyzerLabels.TIZEN_DEVELOP_SITE_LINK + "</a>");
releasenotevalue.addSelectionListener(new SelectionListener() {
@Override
public void widgetDefaultSelected(SelectionEvent arg0) {
@Override
public void widgetSelected(SelectionEvent arg0) {
try {
- String url = AnalyzerLabels.ABOUT_DIALOG_RELEASE_NOTE_LINK;
+ String url = AboutInfo.getInstance().getReleaseNote();
if (CommonUtil.isWin()) {
org.eclipse.swt.program.Program.launch(url);
} else if (CommonUtil.isLinux()) {
}
});
}
-
- private static void updateBuildInfo() {
- if (sdkBuildVersionInfo.equals(CommonConstants.EMPTY) || daBuildIDInfo.equals(CommonConstants.EMPTY)) {
- updateDABuildInfo();
- sdkBuildVersionInfo = getSdkVersion();
- writeBuildInfoToAboutFile();
- }
- }
-
- private static void writeBuildInfoToAboutFile() {
- File DAAboutFile = new File(daAboutFilePath);
- if (!DAAboutFile.exists()) {
- Logger.error("about dlg, not exists file : " + daAboutFilePath);
- return;
- }
- FileWriter fileWriter = null;
- BufferedWriter buffWriter = null;
- PrintWriter printWriter = null;
- try {
- fileWriter = new FileWriter(DAAboutFile);
- buffWriter = new BufferedWriter(fileWriter);
- printWriter = new PrintWriter(buffWriter);
-
- printWriter.println("0" + CommonConstants.EQUAL + sdkBuildVersionInfo);//$NON-NLS-1$
- printWriter.println("1" + CommonConstants.EQUAL + daBuildIDInfo);//$NON-NLS-1$
- printWriter.checkError();
- } catch (IOException e) {
- Logger.exception(e);
- } finally {
- CommonUtil.tryClose(fileWriter, buffWriter, printWriter);
- }
-
- }
-
- private static String parseBuildVersion(String readData) {
- String[] splitData = readData.split("0="); //$NON-NLS-1$
- int size = splitData.length;
- if (2 != size) {
- return null;
- }
- return splitData[1];
- }
-
- private static String parseBuildTime(String readData) {
- String[] splitData = readData.split("1="); //$NON-NLS-1$
- int size = splitData.length;
- if (2 != size) {
- return null;
- }
- return splitData[1];
- }
-
- private static String getSdkVersion() {
- File file = new File(sdkVersionFilePath);
- if (!file.exists()) {
- Logger.error("about dlg, not exists file : " + sdkVersionFilePath);
- return CommonConstants.EMPTY;
- }
- BufferedReader in = null;
- String content;
- try {
- in = new BufferedReader(new FileReader(file));
- while (null != (content = in.readLine())) {
- String[] splitData = content.split("TIZEN_SDK_VERSION="); //$NON-NLS-1$
- int size = splitData.length;
- if (2 == size) {
- return splitData[1];
- }
- }
- } catch (FileNotFoundException e) {
- Logger.exception(e);
- } catch (IOException e) {
- Logger.exception(e);
- } finally {
- CommonUtil.tryClose(in);
- }
- return CommonConstants.EMPTY;
- }
-
- private static void updateDABuildInfo() {
- String buildVersion;
- String buildTime;
- File SDKAboutFile = new File(daAboutFilePath);
- if (!SDKAboutFile.exists()) {
- Logger.error("about dlg, not exists file : " + daAboutFilePath);
- return;
- }
-
- BufferedReader in = null;
- String content;
- try {
- in = new BufferedReader(new FileReader(SDKAboutFile));
- while (null != (content = in.readLine())) {
- buildVersion = parseBuildVersion(content);
- if (buildVersion != null) {
- sdkBuildVersionInfo = buildVersion;
- }
- buildTime = parseBuildTime(content);
- if (buildTime != null) {
- daBuildIDInfo = buildTime;
- }
- }
- } catch (FileNotFoundException e) {
- Logger.exception(e);
- } catch (IOException e) {
- Logger.exception(e);
- } finally {
- CommonUtil.tryClose(in);
- }
-
- File DAVersionFile = new File(daVersionFilePath);
- if (!DAVersionFile.exists()) {
- Logger.error("about dlg, not exists file : " + daAboutFilePath);
- return;
- }
-
- String daverion = "";
- try {
- in = new BufferedReader(new FileReader(DAVersionFile));
- while (null != (daverion = in.readLine())) {
- daVersionInfo = daverion;
- }
- } catch (FileNotFoundException e) {
- Logger.exception(e);
- } catch (IOException e) {
- Logger.exception(e);
- } finally {
- CommonUtil.tryClose(in);
- }
- }
-
}
import org.tizen.dynamicanalyzer.nl.WidgetLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.util.CommonUtil;
import org.tizen.dynamicanalyzer.widgets.animation.DAAnimationIcon;
import org.tizen.dynamicanalyzer.widgets.da.base.DAMessageBox;
import org.tizen.dynamicanalyzer.widgets.da.base.DATextBox;
-import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
public class RemoteDeviceDialog extends DAMessageBox {
private static final int WIDTH = 430;
progressIcon.start();
// start RemoteDeviceManager
- Thread managerThread = new Thread(new RemoteDeviceManager(self));
+ Thread managerThread = new Thread(new RemoteDeviceManager(self),
+ RemoteDeviceManager.class.getSimpleName());
managerThread.start();
}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Jaewon Lim <jaewon81.lim@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.toolbar;
-
-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.tizen.dynamicanalyzer.appearance.DesignConstants;
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
-import org.tizen.dynamicanalyzer.common.Global;
-import org.tizen.dynamicanalyzer.constant.CommonConstants;
-import org.tizen.dynamicanalyzer.handlers.UIActionHolder;
-import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
-import org.tizen.dynamicanalyzer.nl.UserErrorWarningLabels;
-import org.tizen.dynamicanalyzer.nl.WidgetLabels;
-import org.tizen.dynamicanalyzer.project.Project;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.resources.FontResources;
-import org.tizen.dynamicanalyzer.util.CommonUtil;
-import org.tizen.dynamicanalyzer.util.Logger;
-import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
-import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
-import org.tizen.dynamicanalyzer.widgets.da.base.DAButton;
-import org.tizen.dynamicanalyzer.widgets.da.base.DAMessageBox;
-import org.tizen.dynamicanalyzer.widgets.da.base.DATextBox;
-
-public class SaveAsDialog extends DAMessageBox {
- private final int WIDTH = 446;
- private final int HEIGHT = 145 + 22;
-
- private DATextBox textBox = null;
- private String saveFileName = null;
- private DAButton okButton = null;
- private DAButton cancelButton = null;
- private Label info = null;
-
- public SaveAsDialog(Shell parentShell) {
- super(parentShell);
- }
-
- protected boolean run() {
- int dialogLocationX = shell.getParent().getLocation().x + (shell.getParent().getSize().x - WIDTH)/2;
- int dialogLocationY = shell.getParent().getLocation().y + (shell.getParent().getSize().y - HEIGHT)/2;
- shell.setLocation(dialogLocationX, dialogLocationY);
-
- shell.setSize(WIDTH, HEIGHT);
- shell.setLayout(new FormLayout());
- shell.setSize(WIDTH, HEIGHT);
- shell.setText(AnalyzerLabels.SAVE_TRACE_TITLE);
- 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 DATextBox(shell, SWT.SINGLE);
- data = new FormData();
- data.top = new FormAttachment(label, 10);
- data.left = new FormAttachment(0, 9);
- data.height = 20;
- data.width = 410;
- textBox.setLayoutData(data);
- textBox.setBackground(ColorResources.VIEW_BG_COLOR);
- textBox.getControl().addKeyListener(keyListener);
-
- info = new Label(shell, SWT.TRANSPARENT);
- data = new FormData();
- data.top = new FormAttachment(textBox.getControl(), 5);
- data.left = new FormAttachment(0, 9);
- data.height = 20;
- data.width = 410;
- info.setLayoutData(data);
- info.setBackground(ColorResources.DIALOG_BG_UPPER);
- info.setForeground(ColorResources.RED);
- info.setFont(FontResources.COMBO);
-
- 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(100, -50);
- 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(WidgetLabels.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(WidgetLabels.CANCEL);
- cancelButton.addClickListener(cancelButtonListener);
-
- saveFileName = getDefaultSaveFileName();
- if (null == saveFileName) {
- // create warning message box
- Logger.debug("save file name is null");
- return false;
- } else {
- textBox.setText(saveFileName);
- String textString = textBox.getText();
- textBox.getControl().setSelection(0, textString.length());
- }
-
- // check filename validation when dialog is opened
- checkFileNameValidation();
-
- return true;
- }
-
- public String getSaveFileName() {
- return saveFileName;
- }
-
- private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {
-
- @Override
- public void handleClickEvent(DACustomButton button) {
- saveFileName = textBox.getText();
-
- if (saveFileName.length() > CommonConstants.FILE_NAME_MAX) {
- saveFileName = saveFileName.substring(0, CommonConstants.FILE_NAME_MAX);
- }
-
- setResult(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) {
- checkFileNameValidation();
- }
-
- @Override
- public void keyPressed(KeyEvent e) {
-
- }
- };
-
- private String getDefaultSaveFileName() {
- Project project = Global.getProject();
- String sourcePath = project.getSavePath();
- String[] splitSourcePath = null;
- if (CommonUtil.isWin()) {
- splitSourcePath = sourcePath.split("\\\\"); //$NON-NLS-1$
- } else if (CommonUtil.isMac()) {
- splitSourcePath = sourcePath.split("\\/"); //$NON-NLS-1$
- } else if (CommonUtil.isLinux()) {
- splitSourcePath = sourcePath.split("\\/"); //$NON-NLS-1$
- } else {
- UIActionHolder.getUIAction().showWarning(AnalyzerLabels.OS_WARNING);
- return null;
- }
-
- if (null == splitSourcePath) {
- return null;
- }
-
- String saveFileName = splitSourcePath[splitSourcePath.length - 1];
- if (null == saveFileName || saveFileName.isEmpty()) {
- return null;
- } else {
- return saveFileName;
- }
- }
-
- private void checkFileNameValidation() {
- String filename = textBox.getText();
- String errorMessage = null;
-
- if (filename == null
- || filename.contains("\\") //$NON-NLS-1$
- || filename.contains(CommonConstants.SLASH)
- || filename.contains(CommonConstants.COLON)
- || filename.contains(CommonConstants.ASTERISK)
- || filename.contains("\\?") || filename.contains("\"") //$NON-NLS-1$ //$NON-NLS-2$
- || filename.contains("<") || filename.contains(">") //$NON-NLS-1$ //$NON-NLS-2$
- || filename.contains(CommonConstants.CMD_SPLIT)) {
- errorMessage = UserErrorWarningLabels.WARNING_FILENAME_INVALID_CHAR;
- } else if (filename.isEmpty()) {
- errorMessage = UserErrorWarningLabels.WARNING_FILENAME_EMPTY;
- } else if (filename.length() > CommonConstants.FILE_NAME_MAX) {
- errorMessage = UserErrorWarningLabels.WARNING_FILENAME_TOO_LONG;
- } else {
- errorMessage = null;
- }
-
- if (errorMessage == null) {
- // valid file name
- info.setText(CommonConstants.EMPTY);
- okButton.setButtonEnabled(true);
- } else {
- // invalid file name
- info.setText(errorMessage);
- okButton.setButtonEnabled(false);
- }
- }
-
-}
import org.tizen.dynamicanalyzer.control.ApplistManager;
import org.tizen.dynamicanalyzer.handlers.CommandAction;
import org.tizen.dynamicanalyzer.handlers.CommonAction;
-import org.tizen.dynamicanalyzer.handlers.ReplayManager;
import org.tizen.dynamicanalyzer.handlers.UIActionHolder;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.nl.UserErrorWarningLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.resources.FontResources;
import org.tizen.dynamicanalyzer.resources.ImageResources;
-import org.tizen.dynamicanalyzer.setting.Feature;
import org.tizen.dynamicanalyzer.setting.SettingDataManager;
import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
import org.tizen.dynamicanalyzer.ui.common.explorer.DeviceExplorerDialog;
import org.tizen.dynamicanalyzer.ui.page.BaseView;
import org.tizen.dynamicanalyzer.ui.toolbar.opentrace.OpenTraceDialog;
-import org.tizen.dynamicanalyzer.ui.toolbar.replayEditor.ReplayEditDialog;
import org.tizen.dynamicanalyzer.ui.toolbar.setting.PreferencesDialog;
import org.tizen.dynamicanalyzer.ui.widgets.SearchDialog;
import org.tizen.dynamicanalyzer.util.Logger;
public static final int START_BUTTON = 0;
public static final int SAVE_BUTTON = 1;
public static final int OPEN_BUTTON = 2;
- public static final int REPLAY_BUTTON = 3;
public static final int SOURCE_BUTTON = 4;
public static final int ABOUT_BUTTON = 5;
public static final int CONFIG_BUTTON = 6;
public static final int SETTING_BUTTON = 7;
public static final int SCREENSHOT_BUTTON = 8;
- public static final int REPLAY_EDIT_BUTTON = 9;
public static final int SEARCH_BUTTON = 10;
public static final String ALL_PROCESS = "All Processes";
private DACustomCombo processCombo;
private DACustomButton startButton;
private TimerClock timerClock;
- private DACustomButton saveTraceButton;
private DACustomButton openTraceButton;
- private DACustomButton replayButton;
- private DACustomButton replayEditButton;
private DACustomButton configButton;
private DACustomButton screenshotButton;
private DACustomButton aboutButton;
}
setStartButtonState(true);
- setReplayButtonState(true);
}
});
}
});
- saveTraceButton.addClickListener(new DACustomButtonClickEventListener() {
-
- @Override
- public void handleClickEvent(DACustomButton button) {
- Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell();
-
- SaveAsDialog dialog = new SaveAsDialog(shell);
- Object result = dialog.open();
- if (null != result) {
- if (!CommandAction.save(dialog.getSaveFileName())) {
- UIActionHolder.getUIAction().showWarning(AnalyzerLabels.SAVE_FAILED);
- }
-
- button.setButtonEnabled(false);
- }
- }
- });
-
openTraceButton.addClickListener(new DACustomButtonClickEventListener() {
@Override
}
});
- replayButton.addClickListener(new DACustomButtonClickEventListener() {
-
- @Override
- public void handleClickEvent(DACustomButton button) {
- if (DAState.isStartable()) {
- if (ReplayManager.init()) {
- CommandAction.startTrace(false);
- }
- }
- }
- });
-
- replayEditButton.addClickListener(new DACustomButtonClickEventListener() {
-
- @Override
- public void handleClickEvent(DACustomButton button) {
- Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell();
- ReplayEditDialog dialog = new ReplayEditDialog(shell);
- dialog.open();
- }
- });
-
configButton.addClickListener(new DACustomButtonClickEventListener() {
@Override
public void handleClickEvent(DACustomButton button) {
Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell();
BaseView baseView = (BaseView)WorkbenchUtil.getViewPart(BaseView.ID);
- Composite comp = baseView.getTopPage().getTopTable();
+ Composite comp = baseView.getTopPage().getActiveTable();
SearchDialog dialog = new SearchDialog(shell, comp);
dialog.open();
}
private void createToolbar(Composite parent) {
/** Creates control composite **/
- /** which contains start, TimerClock, save, open and replay buttons. */
+ /** which contains start, TimerClock, save and open buttons. */
// Creates start button.
startButton = new DACustomButton(parent, ImageResources.START, ImageResources.START_PUSH,
ImageResources.START_HOVER, ImageResources.START_DISABLE);
timerClock.setClockFont(FontResources.TIMER);
timerClock.setFontColor(ColorResources.POINT);
- // // Creates save trace button.
- saveTraceButton = new DACustomButton(parent, ImageResources.SAVE, ImageResources.SAVE_PUSH,
- ImageResources.SAVE_HOVER, ImageResources.SAVE_DISABLE);
- saveTraceButton.setButtonEnabled(false);
- saveTraceButton.setBackground(ColorResources.COOLBAR_BG_COLOR);
- saveTraceButton.setToolTipText(ShortCutManager.SAVE_TRACE);
- buttons.put(SAVE_BUTTON, saveTraceButton);
-
// // Creates open trace button.
openTraceButton = new DACustomButton(parent, ImageResources.OPEN, ImageResources.OPEN_PUSH,
ImageResources.OPEN_HOVER, ImageResources.OPEN_DISABLE);
openTraceButton.setBackground(ColorResources.COOLBAR_BG_COLOR);
buttons.put(OPEN_BUTTON, openTraceButton);
- // Creates replay button.
- replayButton = new DACustomButton(parent, ImageResources.REPLAY,
- ImageResources.REPLAY_PUSH, ImageResources.REPLAY_HOVER,
- ImageResources.REPLAY_DISABLE);
- replayButton.setToolTipText(ShortCutManager.REPLAY);
- replayButton.setBackground(ColorResources.COOLBAR_BG_COLOR);
- buttons.put(REPLAY_BUTTON, replayButton);
-
- // Creates replayEdit button.
- replayEditButton = new DACustomButton(parent, ImageResources.REPLAY_EDIT,
- ImageResources.REPLAY_EDIT_PUSH, ImageResources.REPLAY_EDIT_HOVER,
- ImageResources.REPLAY_EDIT_DISABLE);
- replayEditButton.setToolTipText(ShortCutManager.REPLAY_EDIT);
- replayEditButton.setBackground(ColorResources.COOLBAR_BG_COLOR);
- buttons.put(REPLAY_EDIT_BUTTON, replayEditButton);
-
// Creates config button
configButton = new DACustomButton(parent, ImageResources.DA_PREFERENCES_ICON_NOR,
ImageResources.DA_PREFERENCES_ICON_SEL, ImageResources.DA_PREFERENCES_ICON_OVER,
viewSourceButton.setBackground(ColorResources.COOLBAR_BG_COLOR);
buttons.put(SOURCE_BUTTON, viewSourceButton);
- saveTraceButton.setVisible(false);
openTraceButton.setVisible(false);
- replayButton.setVisible(false);
- replayEditButton.setVisible(false);
viewSourceButton.setVisible(false);
// Creates snapshot on/off button.
data.left = new FormAttachment(timerClock, 4, SWT.RIGHT);
data.width = 27;
data.height = 30;
- saveTraceButton.setLayoutData(data);
-
- data = new FormData();
- data.top = new FormAttachment(0, DesignConstants.DA_BUTTON_TOP);
- data.left = new FormAttachment(saveTraceButton, 0, SWT.RIGHT);
- data.width = 27;
- data.height = 30;
openTraceButton.setLayoutData(data);
data = new FormData();
data.top = new FormAttachment(0, DesignConstants.DA_BUTTON_TOP);
- data.left = new FormAttachment(openTraceButton, 0, SWT.RIGHT);
- data.width = 33; // 31
- data.height = 30;
- replayButton.setLayoutData(data);
-
- data = new FormData();
- data.top = new FormAttachment(0, DesignConstants.DA_BUTTON_TOP);
- data.left = new FormAttachment(replayButton, 0, SWT.RIGHT);
- data.width = 0;
- data.height = 30;
- replayEditButton.setLayoutData(data);
-
- data = new FormData();
- data.top = new FormAttachment(0, DesignConstants.DA_BUTTON_TOP);
data.right = new FormAttachment(100, -20);
data.width = 24;
data.height = 24;
processCombo = makeDACustomCombo(parent);
data = new FormData();
data.top = new FormAttachment(0, DesignConstants.COMBO_APP_TOP);
- data.left = new FormAttachment(replayEditButton, 15);
+ data.left = new FormAttachment(appCombo, 15);
data.width = DesignConstants.COMBO_APP_WIDTH;
data.height = DesignConstants.COMBO_APP_HEIGHT;
processCombo.setLayoutData(data);
if(startButton.isEnabled()){
setAppComboState(true);
setStartButtonState(true);
- setReplayButtonState(true);
return;
}
}
setAppComboState(true);
setStartButtonState(false);
- setReplayButtonState(false);
}
AppComboTitleChanged();
}
}
- });
+ }, "UpdateNewComboThread");
updateNewCombo.start();
}
}
/*************************************************************************************************
- * methods to change state of controls major controls : device / app combo, save / open / replay
- * buttons minor controls : process combo, source view / screenshot / setting / about buttons
- * special control : start button
+ * methods to change state of controls major controls : device / app combo,
+ * save / open buttons minor controls : process combo, source view /
+ * screenshot / setting / about buttons special control : start button
*************************************************************************************************/
/**
startButton.setButtonEnabled(false);
}
- public void setSaveButtonState(boolean enabled) {
- if (enabled) {
- Project curProject = Global.getProject();
- if (curProject != null && curProject.isValid()) {
- saveTraceButton.setButtonEnabled(true);
- return;
- }
- }
-
- saveTraceButton.setButtonEnabled(false);
- }
-
- private void setReplayButtonState(final boolean enabled) {
- if (enabled) {
- // if the recording option is not checked then replay button is not available
- if (!SettingDataManager.INSTANCE.isOptionsSelectedFeature(Feature.RECORDING)) {
- replayButton.setButtonEnabled(false);
- replayEditButton.setButtonEnabled(false);
- return;
- }
- Project curProject = Global.getProject();
- if (curProject != null && curProject.isValid()) {
- DeviceInfo curDev = Global.getCurrentDeviceInfo();
- if (curDev != null) {
- String sDeviceName = curDev.getIDevice().getSerialNumber();
- String pDeviceName = curProject.getDevice();
- String appName = curProject.getAppName();
- String appComboText = appCombo.getText();
-
- if (pDeviceName != null && !pDeviceName.isEmpty()
- && pDeviceName.equals(sDeviceName) && appName != null
- && !appName.isEmpty() && appName.equals(appComboText)) {
- if (!appName.equals(AnalyzerConstants.RUNNING_PROCESS_LABEL)
- && !appName.equals(AnalyzerConstants.COMMON_EXECUTABLE_LABEL)
- && !appName.equals(AnalyzerConstants.WITHOUT_EXECUTABLE_LABEL)) {
- replayButton.setButtonEnabled(true);
- replayEditButton.setButtonEnabled(true);
- return;
- }
- }
- }
- }
- }
-
- replayButton.setButtonEnabled(false);
- replayEditButton.setButtonEnabled(false);
- }
-
private void setMajorControlState(boolean enabled) {
deviceCombo.setEnabled(enabled);
setAppComboState(enabled);
- setSaveButtonState(enabled);
openTraceButton.setButtonEnabled(enabled);
- setReplayButtonState(enabled);
-
}
private void setMinorControlState(boolean enabled) {
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
import org.tizen.dynamicanalyzer.widgets.da.base.ProgressDialog;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAContainerComposite;
import org.tizen.dynamicanalyzer.workbench.LayoutManager;
public class OpenTraceProgressManager implements Runnable {
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
- if (Global.getProject().getSavePath().contains(PathManager.DA_TEMP_FOLDER_PATH)) {
+ if (Global.getProject().getSavePath().contains(PathManager.DA_TEMP_FOLDER_PATH))
Toolbar.INSTANCE.setAllControlState(true);
- } else {
- Toolbar.INSTANCE.setSaveButtonState(false);
- }
UIActionHolder.getUIAction().applyWebProfilingUI(Global.getProject().isWebApplication());
- DAPageComposite page = AnalyzerManager.getCurrentPage();
+ DAContainerComposite page = AnalyzerManager.getCurrentPage();
page.updateView();
}
});
+++ /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.replay.data;
-
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-import java.util.List;
-
-import org.tizen.dynamicanalyzer.constant.CommonConstants;
-import org.tizen.dynamicanalyzer.database.DBColumn;
-import org.tizen.dynamicanalyzer.database.DBConstants;
-import org.tizen.dynamicanalyzer.database.DBTable;
-import org.tizen.dynamicanalyzer.database.SqlConnectionManager;
-import org.tizen.dynamicanalyzer.model.DATime;
-import org.tizen.dynamicanalyzer.swap.model.data.RecordEventObject;
-import org.tizen.dynamicanalyzer.swap.model.data.ReplayData;
-import org.tizen.dynamicanalyzer.util.Logger;
-
-public class ReplayDBManager extends DBTable {
-
- private static final String TABLENAME = "REPLAY";//$NON-NLS-1$
- public static final String RID = "RID";//$NON-NLS-1$
- public static final String SEQ = "SEQUENCE_NUMBER";//$NON-NLS-1$
- public static final String TIME = "TIME";//$NON-NLS-1$
- public static final String SEC = "SEC";//$NON-NLS-1$
- public static final String NANO = "NANO";//$NON-NLS-1$
- public static final String EVENT_ID = "EVENT_ID";//$NON-NLS-1$
- public static final String EVENT_TYPE = "EVENT_TYPE";//$NON-NLS-1$
- public static final String EVENT_CODE = "EVENT_CODE";//$NON-NLS-1$
- public static final String EVENT_VALUE = "EVENT_VALUE";//$NON-NLS-1$
-
- private static final int DB_RID_INDEX = 0;
- private static final int DB_SEQ_INDEX = 1;
- private static final int DB_TIME_INDEX = 2;
- private static final int DB_SEC_INDEX = 3;
- private static final int DB_NANO_INDEX = 4;
- private static final int DB_EVENT_ID_INDEX = 5;
- private static final int DB_EVENT_TYPE_INDEX = 6;
- private static final int DB_EVENT_CODE_INDEX = 7;
- private static final int DB_EVENT_VALUE = 8;
-
- private static final String SELECT_QUERY = "select " + RID + CommonConstants.COMMA + SEQ
- + CommonConstants.COMMA + TIME + CommonConstants.COMMA + SEC + CommonConstants.COMMA
- + NANO + CommonConstants.COMMA + EVENT_ID + CommonConstants.COMMA + EVENT_TYPE
- + CommonConstants.COMMA + EVENT_CODE + CommonConstants.COMMA + EVENT_VALUE
- + " from " + TABLENAME + " order by " + TIME + CommonConstants.COMMA + RID; //$NON-NLS-1$
- private static final String DELETE_QUERY = "delete from " + TABLENAME;
-
- @Override
- public String getTableName() {
- return TABLENAME;
- }
-
- public ReplayDBManager() {
- addColumn(new DBColumn(RID, DBConstants.PRIMARY_KEY, DBConstants.DBTYPE_INT4));
- addColumn(new DBColumn(SEQ, DBConstants.NOT_NULL, DBConstants.DBTYPE_LONG));
- addColumn(new DBColumn(TIME, DBConstants.NOT_NULL, DBConstants.DBTYPE_LONG));
- addColumn(new DBColumn(SEC, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
- addColumn(new DBColumn(NANO, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
- addColumn(new DBColumn(EVENT_ID, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
- addColumn(new DBColumn(EVENT_TYPE, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
- addColumn(new DBColumn(EVENT_CODE, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
- addColumn(new DBColumn(EVENT_VALUE, DBConstants.NOT_NULL, DBConstants.DBTYPE_INT4));
- }
-
- public ReplayData getReplayLogs() {
-
- List<List<Object>> result = SqlConnectionManager.executeQuery(SELECT_QUERY);
- if (null == result || result.size() == 0 || result.get(0).size() == 0) {
- return null;
- }
-
- ReplayData output = new ReplayData();
- List<RecordEventObject> eventObjs = output.getRecordEvent();
- for (List<Object> data : result) {
- RecordEventObject reObj = new RecordEventObject();
- reObj.setMsgID((Integer) data.get(DB_RID_INDEX));
- reObj.setSeq((Long) data.get(DB_SEQ_INDEX));
- reObj.setTime((Long) data.get(DB_TIME_INDEX));
- DATime eventTime = new DATime();
- eventTime.setSec((Integer) data.get(DB_SEC_INDEX));
- eventTime.setNano((Integer) data.get(DB_NANO_INDEX));
- reObj.setEventTime(eventTime);
- reObj.setEventId((Integer) data.get(DB_EVENT_ID_INDEX));
- reObj.setEventType((Integer) data.get(DB_EVENT_TYPE_INDEX));
- reObj.setEventCode((Integer) data.get(DB_EVENT_CODE_INDEX));
- reObj.setEventValue((Integer) data.get(DB_EVENT_VALUE));
- eventObjs.add(reObj);
- }
- return output;
- }
-
- public boolean deleteReplayTableItems() {
- SqlConnectionManager.executeUpdate(DELETE_QUERY);
- return true;
- }
-
- @Override
- public boolean prepare(PreparedStatement prep, List<Object> rowData) {
- boolean isPrepared = true;
-
- int columnsize = getColumnSize();
- if (columnsize != rowData.size()) {
- isPrepared = false;
- } else {
- try {
- prep.setInt(DB_RID_INDEX + 1, (Integer) (rowData.get(DB_RID_INDEX)));
- prep.setLong(DB_SEQ_INDEX + 1, (Long) (rowData.get(DB_SEQ_INDEX)));
- prep.setLong(DB_TIME_INDEX + 1, (Long) (rowData.get(DB_TIME_INDEX)));
- prep.setInt(DB_SEC_INDEX + 1, (Integer) (rowData.get(DB_SEC_INDEX)));
- prep.setInt(DB_NANO_INDEX + 1, (Integer) (rowData.get(DB_NANO_INDEX)));
- prep.setInt(DB_EVENT_ID_INDEX + 1, (Integer) (rowData.get(DB_EVENT_ID_INDEX)));
- prep.setInt(DB_EVENT_TYPE_INDEX + 1, (Integer) (rowData.get(DB_EVENT_TYPE_INDEX)));
- prep.setInt(DB_EVENT_CODE_INDEX + 1, (Integer) (rowData.get(DB_EVENT_CODE_INDEX)));
- prep.setInt(DB_EVENT_VALUE + 1, (Integer) (rowData.get(DB_EVENT_VALUE)));
- } catch (SQLException e) {
- Logger.exception(e);
- isPrepared = false;
- }
- }
-
- return isPrepared;
- }
-}
+++ /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.toolbar.replay.data;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.tizen.dynamicanalyzer.protocol.ProtocolConstants;
-import org.tizen.dynamicanalyzer.swap.logparser.LogPackage;
-import org.tizen.dynamicanalyzer.swap.logparser.Logs;
-import org.tizen.dynamicanalyzer.swap.logparser.PageDataManager;
-import org.tizen.dynamicanalyzer.swap.model.data.LogData;
-import org.tizen.dynamicanalyzer.swap.model.data.RecordEventObject;
-import org.tizen.dynamicanalyzer.swap.model.data.ReplayData;
-
-public class ReplayDataManager extends PageDataManager {
- private static ReplayDataManager instance = new ReplayDataManager();
-
- private ReplayDBManager replayDBManager = null;
- private int rid = 0;
-
- private ReplayDataManager() {
- replayDBManager = new ReplayDBManager();
- }
-
- public static ReplayDataManager getInstance() {
- return instance;
- }
-
- public void clear() {
- rid = 0;
- }
-
- public ReplayDBManager getReplayDBManager() {
- return replayDBManager;
- }
-
- @Override
- protected void makeData(LogPackage pack) {
- Logs logs = pack.getLogs(ProtocolConstants.MSG_DATA_RECORD);
- if (null != logs && logs.getRawLogs().size() != 0) {
-
- List<List<Object>> insertData = new ArrayList<List<Object>>();
-
- List<LogData> inputs = logs.getLogs();
- int dataRowSize = inputs.size();
- for (int i = 0; i < dataRowSize; i++) {
- ReplayData replayData = (ReplayData) inputs.get(i);
- List<RecordEventObject> events = replayData.getRecordEvent();
- for (int ii = 0; ii < events.size(); ii++) {
- RecordEventObject reo = events.get(ii);
- List<Object> insertObject = new ArrayList<Object>();
- insertObject.add(rid++);
- insertObject.add(reo.getSeq());
- insertObject.add(reo.getTime());
- insertObject.add(reo.getEventTime().getSec());
- insertObject.add(reo.getEventTime().getNano());
- insertObject.add(reo.getEventId());
- insertObject.add(reo.getEventType());
- insertObject.add(reo.getEventCode());
- insertObject.add(reo.getEventValue());
- insertData.add(insertObject);
- }
- }
- replayDBManager.insertData(insertData);
- }
- }
-
-}
+++ /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.replayEditor;
-
-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.appearance.DesignConstants;
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
-import org.tizen.dynamicanalyzer.common.Global;
-import org.tizen.dynamicanalyzer.common.path.PathManager;
-import org.tizen.dynamicanalyzer.constant.CommonConstants;
-import org.tizen.dynamicanalyzer.handlers.UIActionHolder;
-import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
-import org.tizen.dynamicanalyzer.nl.WidgetLabels;
-import org.tizen.dynamicanalyzer.project.Project;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.util.CommonUtil;
-import org.tizen.dynamicanalyzer.util.Logger;
-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.da.base.DAButton;
-import org.tizen.dynamicanalyzer.widgets.da.base.DAMessageBox;
-
-public class RepalyEditSaveDialog extends DAMessageBox {
- public int MAX_SAVE_FILE_NAME_LENGTH = 35;
-
- public Text textBox = null;
- public String saveFileName = null;
- private DAButton okButton = null;
- private DAButton cancelButton = null;
-
- private String targetPath = CommonConstants.EMPTY;
-
- public RepalyEditSaveDialog(Shell parentShell) {
- super(parentShell);
- }
-
- protected boolean 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);
- textBox.addPaintListener(new PaintListener() {
-
- @Override
- public void paintControl(PaintEvent e) {
- e.gc.setForeground(ColorResources.BUTTON_OUTLINE_HOVER_IN_COLOR);
- Text text = (Text) e.widget;
- Rectangle rect = text.getClientArea();
- e.gc.drawRectangle(rect.x, rect.y, rect.width - 1, rect.height - 1);
- }
- });
-
- 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(WidgetLabels.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(WidgetLabels.CANCEL);
- cancelButton.addClickListener(cancelButtonListener);
-
- saveFileName = getSaveFileName();
- if (null == saveFileName) {
- // create warning message box
- Logger.debug("save file name is null");
- return false;
- } else {
- textBox.setText(saveFileName);
- String textString = textBox.getText();
- textBox.setSelection(0, textString.length());
- }
-
- return true;
- }
-
- private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {
- @Override
- public void handleClickEvent(DACustomButton button) {
- saveFileName = textBox.getText();
- if (saveFileName.length() > MAX_SAVE_FILE_NAME_LENGTH) {
- String old = saveFileName;
- saveFileName = old.substring(0, MAX_SAVE_FILE_NAME_LENGTH - 1);
- }
- if (executeSaveTrace()) {
- setResult(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.setButtonEnabled(false);
- } else {
- okButton.setButtonEnabled(true);
- }
- }
-
- @Override
- public void keyPressed(KeyEvent e) {
- }
- };
-
- private String getSaveFileName() {
- Project project = Global.getProject();
- String sourcePath = project.getSavePath();
- String[] splitSourcePath = null;
- if (CommonUtil.isWin()) {
- splitSourcePath = sourcePath.split("\\\\"); //$NON-NLS-1$
- } else if (CommonUtil.isMac()) {
- splitSourcePath = sourcePath.split("\\/"); //$NON-NLS-1$
- } else if (CommonUtil.isLinux()) {
- splitSourcePath = sourcePath.split("\\/"); //$NON-NLS-1$
- } else {
- UIActionHolder.getUIAction().showWarning(AnalyzerLabels.OS_WARNING);
- return null;
- }
- if (null == splitSourcePath) {
- return null;
- }
- String saveFileName = new String(splitSourcePath[splitSourcePath.length - 1]);
- if (null == saveFileName || saveFileName.isEmpty()) {
- return null;
- }
- return saveFileName;
- }
-
- private boolean executeSaveTrace() {
- Project project = Global.getProject();
- String sourcePath = project.getSavePath();
- targetPath = PathManager.DA_SAVE_PATH + File.separator + saveFileName;
- if (Global.getProject().getSavePath().equals(targetPath)) {
- return true;
- }
- File sourceFolder = new File(sourcePath);
- if (!sourceFolder.isDirectory()) {
- if (!sourceFolder.mkdirs()) {
- Logger.debug("source directory create failed...");
- return false;
- }
- }
- File targetFolder = new File(targetPath);
- if (!targetFolder.isDirectory()) {
- if (!targetFolder.mkdirs()) {
- Logger.debug("target directory create failed...");
- return false;
- }
- }
- AnalyzerUtil.copyDirectory(sourceFolder, targetFolder);
-
- 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;
- }
-
- public String getSavedPath() {
- return this.targetPath;
- }
-
-}
+++ /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.replayEditor;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-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.nl.AnalyzerLabels;
-import org.tizen.dynamicanalyzer.nl.ReplayEditLabels;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.resources.FontResources;
-import org.tizen.dynamicanalyzer.resources.ImageResources;
-import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
-import org.tizen.dynamicanalyzer.ui.toolbar.replayEditor.data.ReplayEditSaveDataMaker;
-import org.tizen.dynamicanalyzer.ui.toolbar.replayEditor.data.ReplayEditTableDataMaker;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
-import org.tizen.dynamicanalyzer.util.Logger;
-import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
-import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
-import org.tizen.dynamicanalyzer.widgets.da.base.DAButton;
-import org.tizen.dynamicanalyzer.widgets.da.base.DAMessageBox;
-
-public class ReplayEditDialog extends DAMessageBox {
- private static boolean opened = false;
- private DACustomButton cancelButton = null;
- private DATableComposite replayTable;
-
- public ReplayEditDialog(Shell parent) {
- super(parent);
- }
-
- private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {
-
- @Override
- public void handleClickEvent(DACustomButton button) {
-// ReplayEditSaveDataMaker.getInstance().saveData();
- ReplayEditSaveDataMaker.getInstance().setTableItemsList(
- replayTable);
- ReplayEditSaveDataMaker.getInstance().insertDB();
- shell.dispose();
- }
- };
- private DACustomButtonClickEventListener cancelButtonListener = new DACustomButtonClickEventListener() {
-
- @Override
- public void handleClickEvent(DACustomButton button) {
- shell.dispose();
- }
- };
-
- protected boolean run() {
- if (opened) {
- return false;
- }
- ReplayEditTableDataMaker.getInstance().clean();
- shell.setSize(608, 480);
- shell.setLayout(new FormLayout());
- shell.setText(AnalyzerLabels.REPLAYEDIT);
-
- shell.addDisposeListener(new DisposeListener() {
-
- @Override
- public void widgetDisposed(DisposeEvent e) {
- Logger.debug("shell disposed!"); //$NON-NLS-1$
- opened = false;
- ShortCutManager.getInstance().setEnabled(!opened);
- }
- });
-
- // banner
- Label banner = new Label(shell, SWT.TRANSPARENT);
- banner.setBackground(ColorResources.WINDOW_BG_COLOR);
- banner.setImage(ImageResources.REPLAY_EDIT_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(shell, 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);
-
- ReplayEditTableView featuresPage = new ReplayEditTableView(
- tabContentsComp, SWT.NONE);
- 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);
- featuresPage.setLayoutData(compData);
-
- replayTable = featuresPage.getReplayTable();
-
- // button
- Composite buttonContentsComp = new Composite(shell, 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(ReplayEditLabels.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);
-
- ReplayEditTableDataMaker.getInstance().setOkButton(
- new DAButton(buttonContentsComp, SWT.NONE));
- ReplayEditTableDataMaker.getInstance().getOkButton()
- .addClickListener(okButtonListener);
- ReplayEditTableDataMaker.getInstance().getOkButton()
- .setText(ReplayEditLabels.OK);
- ReplayEditTableDataMaker.getInstance().getOkButton()
- .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;
- ReplayEditTableDataMaker.getInstance().getOkButton()
- .setLayoutData(buttonData);
-
- opened = true;
- ShortCutManager.getInstance().setEnabled(!opened);
-
- return true;
- }
-
-}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2013 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.replayEditor;
-
-import org.eclipse.swt.widgets.Composite;
-import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenu;
-
-public class ReplayEditPopupMenu extends DAPopupMenu {
-
- public ReplayEditPopupMenu(Composite parent) {
- super(parent);
- // TODO Auto-generated constructor stub
- }
- public void setMouseListener(){
- }
-
-}
+++ /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.replayEditor;
-
-import java.io.File;
-import java.io.IOException;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-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.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-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.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
-import org.tizen.dynamicanalyzer.common.Global;
-import org.tizen.dynamicanalyzer.common.ScreenshotConstants;
-import org.tizen.dynamicanalyzer.common.path.PathManager;
-import org.tizen.dynamicanalyzer.constant.CommonConstants;
-import org.tizen.dynamicanalyzer.nl.ReplayEditLabels;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
-import org.tizen.dynamicanalyzer.util.Logger;
-import org.tizen.dynamicanalyzer.widgets.da.base.DAMessageBox;
-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 ReplayEditScreenshotDialog extends DAMessageBox {
- private DATableComposite screenshotTable = null;
-
- int[] sortTypes = { AnalyzerConstants.SORT_TYPE_GRID, AnalyzerConstants.SORT_TYPE_GRID,
- AnalyzerConstants.SORT_TYPE_GRID };
- private String[] columnNames = { CommonConstants.EMPTY, CommonConstants.EMPTY,
- CommonConstants.EMPTY };
- private int[] columnSizes = { ScreenshotConstants.DEFAULT_IMAGE_WIDTH + 15, 0, 0 };
- private boolean[] columnVisibility = { true, true, true };
-
- protected GridItem item = null;
-
- private String resolutionWidth = CommonConstants.EMPTY;
- private String resolutionHeight = CommonConstants.EMPTY;
-
- public ReplayEditScreenshotDialog(Shell parent, GridItem item) {
- super(parent);
- this.item = item;
- }
-
- protected boolean run() {
- shell.setSize(ScreenshotConstants.DEFAULT_IMAGE_WIDTH + 15,
- ScreenshotConstants.DEFAULT_IMAGE_HEIGHT + 42);
- shell.setLayout(new FormLayout());
- shell.setText(ReplayEditLabels.REPLAY_EDIT_SNAPSHOT_TABLE_TITLE);
-
- Composite tableComp = new Composite(shell, SWT.NONE);
- tableComp.setLayout(new FormLayout());
- FormData data = new FormData();
- data.top = new FormAttachment(0, 5);
- data.left = new FormAttachment(0, 5);
- data.right = new FormAttachment(100, -5);
- data.bottom = new FormAttachment(100, -5);
- tableComp.setLayoutData(data);
- tableComp.setBackground(ColorResources.DIALOG_BG_UPPER);
-
- screenshotTable = new ReplayEditScreenshotTable(tableComp, SWT.NONE | SWT.V_SCROLL
- | SWT.SINGLE, getSavedPouchPoint(item.getText(4)),
- getSavedPouchPoint(item.getText(5)));
- screenshotTable.setTableName(ReplayEditLabels.TABLE_TITLE);
- screenshotTable.setComparator(new DefaultTableComparator());
- screenshotTable.setSortTypes(sortTypes);
- screenshotTable.setColumns(columnNames);
- screenshotTable.setColumnSize(columnSizes);
- screenshotTable.setColumnVisibility(columnVisibility);
- screenshotTable.setTableToolTipEnable(false);
- screenshotTable.getTable().addSelectionListener(featureTableSelectionListener);
- screenshotTable.getTable().addMouseListener(mouseListener);
- screenshotTable.getTable().setHeaderVisible(false);
- 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, 0);
- screenshotTable.setLayoutData(data);
- screenshotTable.getTable().setItemHeight(ScreenshotConstants.DEFAULT_IMAGE_HEIGHT);
-
- screenshotTable.updateTable();
-
- return true;
- }
-
- private SelectionListener featureTableSelectionListener = new SelectionListener() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- }
-
- @Override
- public void widgetDefaultSelected(SelectionEvent e) {
- // TODO Auto-generated method stub
- }
- };
-
- private MouseListener mouseListener = new MouseListener() {
-
- @Override
- public void mouseUp(MouseEvent e) {
- }
-
- @Override
- public void mouseDown(MouseEvent e) {
- Point DisplyPt = Display.getCurrent().getCursorLocation();
- int tableX = screenshotTable.getTable().getShell().getBounds().x;
- int tableY = screenshotTable.getTable().getShell().getBounds().y;
- int imgClickX = DisplyPt.x - tableX - 5;
- int imgClickY = DisplyPt.y - tableY - 55;
- int drawImagWidth = ScreenshotConstants.DEFAULT_IMAGE_WIDTH;
- int drawImagHeight = ScreenshotConstants.DEFAULT_IMAGE_HEIGHT - 20;
-
- int imgWidth = 720;
- int imgHeight = 1280;
- if (!resolutionWidth.equals(CommonConstants.EMPTY)) {
- imgWidth = Integer.parseInt(resolutionWidth);
- }
-
- if (!resolutionHeight.equals(CommonConstants.EMPTY)) {
- imgHeight = Integer.parseInt(resolutionHeight);
- }
-
- if ((0 <= imgClickX && imgClickX <= drawImagWidth)
- && (0 <= imgClickY && imgClickY <= drawImagHeight)) {
- int x = (imgClickX * imgWidth) / drawImagWidth;
- int y = ((imgClickY * imgHeight) / drawImagHeight) + 40;
- // Logger.debug("x : " + x + " y : " + y);
- item.setText(4, ReplayEditLabels.CONTEXT_VALUE_X + Integer.toString(x));
- item.setText(5, ReplayEditLabels.CONTEXT_VALUE_Y + Integer.toString(y));
- shell.dispose();
- }
- }
-
- @Override
- public void mouseDoubleClick(MouseEvent e) {
- }
- };
-
- public int getSavedPouchPoint(String value) {
- int point = 0;
- if (getDeviceResolution() == false) {
- return point;
- }
-
- if (value.contains(ReplayEditLabels.CONTEXT_VALUE_X)) {
- point = Integer.parseInt(value.replace(ReplayEditLabels.CONTEXT_VALUE_X,
- CommonConstants.EMPTY));
- point = (point * ScreenshotConstants.DEFAULT_IMAGE_WIDTH)
- / Integer.parseInt(resolutionWidth);
- }
- if (value.contains(ReplayEditLabels.CONTEXT_VALUE_Y)) {
- point = Integer.parseInt(value.replace(ReplayEditLabels.CONTEXT_VALUE_Y,
- CommonConstants.EMPTY));
- point = (point * ScreenshotConstants.DEFAULT_IMAGE_HEIGHT)
- / Integer.parseInt(resolutionHeight);
- }
- return point;
- }
-
- private boolean getDeviceResolution() {
- String selDeviceName = Global.getCurrentDeviceInfo().getIDevice().getDeviceName();
- String resolutionInfoXmlPath = PathManager.TIZEN_SDK_DATA_PATH + File.separator
- + "emulator-vms" + File.separator + "vms"//$NON-NLS-1$
- + File.separator + selDeviceName + File.separator + "vm_config.xml";//$NON-NLS-1$
-
- DocumentBuilder builder = null;
- Document doc = null;
-
- try {
- builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- doc = builder.parse(resolutionInfoXmlPath);
- } catch (ParserConfigurationException e) {
- // TODO Auto-generated catch block
- Logger.exception(e);
- } catch (SAXException e) {
- // TODO Auto-generated catch block
- Logger.exception(e);
- } catch (IOException e) {
- // TODO Auto-generated catch block
- Logger.exception(e);
- }
-
- if (null == doc) {
- return false;
- }
-
- Element root = doc.getDocumentElement();
-
- NodeList deviceNode = root.getElementsByTagName("device");//$NON-NLS-1$
- Element deviceElement = (Element) deviceNode.item(0);
-
- NodeList displayNode = deviceElement.getElementsByTagName("display");//$NON-NLS-1$
- Element displayElement = (Element) displayNode.item(0);
-
- NodeList resolutionNode = displayElement.getElementsByTagName("resolution");//$NON-NLS-1$
- Element resolutionElement = (Element) resolutionNode.item(0);
-
- NodeList widthNodeList = resolutionElement.getElementsByTagName("width");//$NON-NLS-1$
- Element widthElement = (Element) widthNodeList.item(0);
- Node widthNode = widthElement.getFirstChild();
- resolutionWidth = widthNode.getNodeValue();
- NodeList heightNodeList = resolutionElement.getElementsByTagName("height");//$NON-NLS-1$
- Element heightElement = (Element) heightNodeList.item(0);
- Node heightNode = heightElement.getFirstChild();
- resolutionHeight = heightNode.getNodeValue();
- return true;
- }
-
-}
\ 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.replayEditor;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-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.common.Global;
-import org.tizen.dynamicanalyzer.model.FilterProperty;
-import org.tizen.dynamicanalyzer.model.TableInput;
-import org.tizen.dynamicanalyzer.project.ImageInfo;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DATableHeaderRenderer;
-
-public class ReplayEditScreenshotTable extends DATableComposite {
- private int savedX = 0;
- private int savedY = 0;
-
- @Override
- protected List<TableInput> makeTableInput() {
- List<TableInput> input = new ArrayList<TableInput>();
-
- Set<Map.Entry<Long, ImageInfo>> images = Global.getImageInfoSet();
-
- // insert default image name
- List<String> text = new ArrayList<String>();
- text.add(AnalyzerConstants.DEFAULT_IMAGE_NAME);
- text.add(Integer.toString(savedX));
- text.add(Integer.toString(savedY));
- TableInput tableInput = new TableInput();
- tableInput.setText(text);
- input.add(tableInput);
-
- // insert images
- if (images != null && !images.isEmpty()) {
- Iterator<Map.Entry<Long, ImageInfo>> iter = images.iterator();
-
- while (iter.hasNext()) {
- text = new ArrayList<String>();
-
- ImageInfo image = iter.next().getValue();
-
- String path = Global.getProject().getSavePath() + File.separator
- + AnalyzerConstants.IMAGE_FOLDER_NAME + File.separator
- + image.getFileName();
- text.add(path);
- text.add(Integer.toString(savedX));
- text.add(Integer.toString(savedY));
- 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);
- for (int j = 0; j < text.size(); j++) {
- gridItem.setText(j, text.get(j));
- }
- }
- table.update();
- }
-
- public ReplayEditScreenshotTable(Composite parent, int style, int x, int y) {
- super(parent, style);
- savedX = x;
- savedY = y;
- }
-
- @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 ReplayEditScreenshotTableCellRenderer());
- column.setHeaderRenderer(new DATableHeaderRenderer());
- column.pack();
-
- }
- }
-}
\ 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.replayEditor;
-
-import org.eclipse.nebula.widgets.grid.GridItem;
-import org.eclipse.nebula.widgets.grid.internal.DefaultCellRenderer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTError;
-import org.eclipse.swt.SWTException;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Display;
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
-import org.tizen.dynamicanalyzer.common.ScreenshotConstants;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.resources.ImageResources;
-import org.tizen.dynamicanalyzer.util.Logger;
-
-public class ReplayEditScreenshotTableCellRenderer extends DefaultCellRenderer {
- @Override
- public void paint(GC gc, Object value) {
- GridItem item = (GridItem) value;
- gc.setFont(item.getFont(getColumn()));
- paintBackground(gc, item);
- paintImage(gc, item);
- paintTableBoardLine(gc, item);
- paintSavedPoint(gc, item);
- }
-
- private void paintBackground(GC gc, GridItem item) {
- boolean drawBackground = true;
- if (item.getChecked() && getColumn() == 0) {
- gc.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_START);
- gc.setBackground(ColorResources.TABLE_CONTENTS_SELECTED_START);
- } 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 && item.getChecked() && getColumn() == 0) {
- 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);
- }
- }
-
- private void paintImage(GC gc, GridItem item) {
- String path = item.getText(0);
- Image img = null;
- if (path.equals(AnalyzerConstants.DEFAULT_IMAGE_NAME)) {
- img = ImageResources.NO_IMAGE;
- } else {
- try {
- img = new Image(Display.getDefault(), path);
- } catch (IllegalArgumentException e) {
- Logger.exception(e);
- img = ImageResources.NO_IMAGE;
- } catch (SWTError err) {
- Logger.exception(err);
- img = ImageResources.NO_IMAGE;
- } catch (SWTException e) {
- Logger.debug("Wait for receiving image : " + path);
- img = ImageResources.NO_IMAGE;
- }
- if (img.isDisposed()) {
- Logger.debug("before set image : disposed");
- }
- }
- Rectangle bounds = img.getBounds();
- int width = ScreenshotConstants.DEFAULT_IMAGE_WIDTH;
- int height = ScreenshotConstants.DEFAULT_IMAGE_HEIGHT;
-
- gc.drawImage(img, 0, 0, bounds.width, bounds.height, 0, 0, width, height);
- }
-
- private void paintTableBoardLine(GC gc, GridItem item) {
- if (!item.getParent().getLinesVisible()) {
- return;
- }
- 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);
- }
-
- private void paintSavedPoint(GC gc, GridItem item) {
- int savedX = Integer.parseInt(item.getText(1));
- int savedY = Integer.parseInt(item.getText(2));
- gc.setForeground(ColorResources.RED);
- gc.setLineWidth(1);
- gc.drawLine(0, savedY, getBounds().width, savedY);
- gc.drawLine(savedX, 0, savedX, getBounds().height);
- gc.setLineWidth(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.toolbar.replayEditor;
-
-import java.awt.event.KeyEvent;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.nebula.widgets.grid.GridColumn;
-import org.eclipse.nebula.widgets.grid.GridEditor;
-import org.eclipse.nebula.widgets.grid.GridItem;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-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.constant.CommonConstants;
-import org.tizen.dynamicanalyzer.model.FilterProperty;
-import org.tizen.dynamicanalyzer.model.TableInput;
-import org.tizen.dynamicanalyzer.nl.ReplayEditLabels;
-import org.tizen.dynamicanalyzer.resources.FontResources;
-import org.tizen.dynamicanalyzer.resources.ImageResources;
-import org.tizen.dynamicanalyzer.ui.toolbar.replayEditor.data.ReplayEditDataType;
-import org.tizen.dynamicanalyzer.ui.toolbar.replayEditor.data.ReplayEditTableData;
-import org.tizen.dynamicanalyzer.ui.toolbar.replayEditor.data.ReplayEditTableDataMaker;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DATableHeaderRenderer;
-import org.tizen.dynamicanalyzer.util.Logger;
-import org.tizen.dynamicanalyzer.widgets.da.base.DATextBox;
-import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenu;
-import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuItem;
-import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuListener;
-
-public class ReplayEditTable extends DATableComposite {
- private String[] columnNames = null;
- protected DAPopupMenu eventTypePopupMenu = null;
- protected DAPopupMenu eventKeyPopupMenu = null;
-
- private boolean isMouseSelectedTableItem = false;
- private int mouseSelectedItemIndex = -1;
- private int mouseSelectedColumnIndex = -1;
- private int mouseSelectedPreColunmEndX = -1;
-
- private String savedItemTextForReset = CommonConstants.EMPTY;
- private List<String> selectedPreKeyContext = new ArrayList<String>();
- private List<String> selectedPreTouchContext = new ArrayList<String>();
-
- private List<String> copyItemText = new ArrayList<String>();
- private int selectedCutItemIndex = -1;
- private int selectedCopyItemIndex = -1;
-
- private int nowMousePositionX = 0;
- private int nowMousePositionY = 0;
-
- DAPopupMenuItem copyItem = null;
- DAPopupMenuItem cutItem = null;
- DAPopupMenuItem insertItem = null;
- DAPopupMenuItem pasteItem = null;
- DAPopupMenuItem deleteItem = null;
-
- private DATextBox inputValueText = null;
-
- private boolean enableCoordinateIcon = true;
-
- @Override
- protected List<TableInput> makeTableInput() {
- List<TableInput> input = new ArrayList<TableInput>();
- List<ReplayEditTableData> replayEditorDataList = ReplayEditTableDataMaker.getInstance()
- .getReplayEditTableData();
- if (null == replayEditorDataList) {
- return input;
- }
- for (int i = 0; i < replayEditorDataList.size(); i++) {
- List<String> text = new ArrayList<String>();
- ReplayEditTableData replayTableType = replayEditorDataList.get(i);
- text.add(Integer.toString(i));
- text.add(replayTableType.getStrEventMouseDownTime());
- text.add(replayTableType.getStrEventMouseUpTime());
- text.add(replayTableType.getStrEventType());
- text.add(replayTableType.getStrEventValue1());
- text.add(replayTableType.getStrEventValue2());
- text.add(replayTableType.getModifiabilityEvent());
-
- 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);
- for (int j = 0; j < text.size(); j++) {
- gridItem.setText(j, text.get(j));
- }
- }
- table.update();
- tableRedraw();
- }
-
- public ReplayEditTable(Composite parent, int style) {
- super(parent, style);
- setMenuItemOfSeqColumn();
- setMenuItemOfEventType();
- setMenuItemOfKey();
- table.addListener(SWT.Dispose, tableMouseListener);
- table.addListener(SWT.MouseEnter, tableMouseListener);
- table.addListener(SWT.MouseExit, tableMouseListener);
- table.addListener(SWT.MouseMove, tableMouseListener);
- table.addListener(SWT.MouseHover, tableMouseListener);
- table.addListener(SWT.MouseUp, tableMouseListener);
- table.addListener(SWT.MouseDown, tableMouseListener);
- table.addListener(SWT.MouseDoubleClick, tableMouseListener);
- table.getShell().getDisplay().addFilter(SWT.KeyUp, new Listener() {
- @Override
- public void handleEvent(Event event) {
- setItemKeyText(event);
- }
- });
- }
-
- private Listener tableMouseListener = new Listener() {
- @Override
- public void handleEvent(Event event) {
- final int MOUSE_LEFT = 1;
- final int MOUSE_RIGHT = 3;
- GridItem item = table.getItem(new Point(event.x, event.y));
- if (null == item) {
- return;
- }
- switch (event.type) {
- case SWT.Dispose:
- break;
- case SWT.MouseEnter:
- break;
- case SWT.MouseExit:
- break;
- case SWT.MouseMove:
- upadteMouseOverTableItemsStatus(item, event);
- updateMouseOverTableItemsText();
- if (null != inputValueText) {
- inputValueText.getControl().dispose();
- inputValueText = null;
- }
- break;
- case SWT.MouseDoubleClick:
- break;
- case SWT.MouseHover:
- break;
- case SWT.MouseUp:
- break;
- case SWT.MouseDown:
- updateSelectedItemIndexValue(item, event);
- switch (event.button) {
- case MOUSE_LEFT: {
- if (selectPopupMenuMouseDownIcon(item, event)) {
- updateKeyboardInputStatus(item, event);
- }
- break;
- }
- case MOUSE_RIGHT: {
- break;
- }
- default: {
- break;
- }
- }
- break;
- default:
- break;
- }
- }
- };
-
- private List<String> getSelectedItemText(int index) {
- List<String> text = new ArrayList<String>();
- int size = table.getColumns().length;
- for (int j = 0; j < size + 1; j++) {
- text.add(table.getItem(index).getText(j));
- }
- return text;
- }
-
- private void pasteTableItems(int index, List<String> itemText) {
- List<List<String>> gridItemTextList = new ArrayList<List<String>>();
- for (int i = 0; i < table.getItemCount(); i++) {
- List<String> text = new ArrayList<String>();
- if (i == index) {
- gridItemTextList.add(itemText);
- continue;
- }
- int size = table.getColumns().length;
- for (int j = 0; j < size + 1; j++) {
- text.add(table.getItem(i).getText(j));
- }
- gridItemTextList.add(text);
- }
- table.removeAll();
- int size = gridItemTextList.size();
- for (int i = 0; i < size; i++) {
- List<String> text = gridItemTextList.get(i);
- GridItem gridItem = new GridItem(table, SWT.NONE);
- for (int j = 0; j < text.size(); j++) {
- gridItem.setText(j, text.get(j));
- }
- }
- table.update();
- tableRedraw();
- }
-
- private void insertTableItems(int index, List<String> itemText) {
- List<List<String>> gridItemTextList = new ArrayList<List<String>>();
- for (int i = 0; i < table.getItemCount(); i++) {
- List<String> text = new ArrayList<String>();
- int size = table.getColumns().length;
- for (int j = 0; j < size + 1; j++) {
- text.add(table.getItem(i).getText(j));
- }
- gridItemTextList.add(text);
- if (i == index) {
- gridItemTextList.add(itemText);
- }
- }
- table.removeAll();
- int size = gridItemTextList.size();
- for (int i = 0; i < size; i++) {
- List<String> text = gridItemTextList.get(i);
- GridItem gridItem = new GridItem(table, SWT.NONE);
- for (int j = 0; j < text.size(); j++) {
- gridItem.setText(j, text.get(j));
- }
- }
- table.update();
- tableRedraw();
- }
-
- private void updateTableSequenceNumber() {
- int size = table.getItemCount();
- for (int i = 0; i < size; i++) {
- table.getItem(i).setText(ReplayEditDataType.SEQ_TABLE_INDEX, Integer.toString(i));
- }
- tableRedraw();
- }
-
- private String getMouseSelectedItemOptionText() {
- return table.getItem(getMouseSelectedTableItemIndex()).getText(
- ReplayEditDataType.OPTION_TABLE_INDEX);
- }
-
- private void setMouseSelectedItemOptionText(String text) {
- table.getItem(getMouseSelectedTableItemIndex()).setText(
- ReplayEditDataType.OPTION_TABLE_INDEX, text);
- }
-
- private void addMouseSelectedItemOptionText(String text) {
- String optionText = table.getItem(getMouseSelectedTableItemIndex()).getText(
- ReplayEditDataType.OPTION_TABLE_INDEX);
- if (!optionText.contains(text)) {
- optionText += text;
- table.getItem(getMouseSelectedTableItemIndex()).setText(
- ReplayEditDataType.OPTION_TABLE_INDEX, optionText);
- }
- }
-
- private void removeMouseSelectedItemOptionText(String text) {
- String optionText = table.getItem(getMouseSelectedTableItemIndex()).getText(
- ReplayEditDataType.OPTION_TABLE_INDEX);
- if (optionText.contains(text)) {
- optionText = optionText.replace(text, CommonConstants.EMPTY);
- table.getItem(getMouseSelectedTableItemIndex()).setText(
- ReplayEditDataType.OPTION_TABLE_INDEX, optionText);
- }
- }
-
- private int getMouseSelectedTableItemIndex() {
- return mouseSelectedItemIndex;
- }
-
- private int getMouseSelectedTableColumnIndex() {
- return mouseSelectedColumnIndex;
- }
-
- private String getMouseSelectedTableItemText() {
- return table.getItem(getMouseSelectedTableItemIndex()).getText(
- getMouseSelectedTableColumnIndex());
- }
-
- private void setMouseSelectedTableItemText(String text) {
- table.getItem(getMouseSelectedTableItemIndex()).setText(getMouseSelectedTableColumnIndex(),
- text);
- }
-
- private void setMenuItemOfSeqColumn() {
- popupMenu = new ReplayEditPopupMenu(table);
- popupMenu.setMouseListener();
- popupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT);
- cutItem = new DAPopupMenuItem(popupMenu);
- cutItem.setText(ReplayEditLabels.CONTEXT_CUT);
- cutItem.addListener(new DAPopupMenuListener() {
- @Override
- public void widgetSelected(DAPopupMenuItem menuItem) {
- copyItemText = getSelectedItemText(getMouseSelectedTableItemIndex());
- if (copyItemText.get(ReplayEditDataType.OPTION_TABLE_INDEX).contains(
- ReplayEditDataType.SELECTED_ITEM_COPY)) {
- copyItemText.set(
- ReplayEditDataType.OPTION_TABLE_INDEX,
- getReplaceString(
- copyItemText.get(ReplayEditDataType.OPTION_TABLE_INDEX),
- ReplayEditDataType.SELECTED_ITEM_COPY, CommonConstants.EMPTY));
- }
- if (selectedCopyItemIndex >= 0) {
- disableCopyItem(selectedCopyItemIndex);
- selectedCopyItemIndex = -1;
- } else {
- disableCopyItem(selectedCutItemIndex);
- }
-
- selectedCutItemIndex = getMouseSelectedTableItemIndex();
- enableCopyItem();
- }
- });
- copyItem = new DAPopupMenuItem(popupMenu);
- copyItem.setText(ReplayEditLabels.CONTEXT_COPY);
- copyItem.addListener(new DAPopupMenuListener() {
- @Override
- public void widgetSelected(DAPopupMenuItem menuItem) {
- copyItemText = getSelectedItemText(getMouseSelectedTableItemIndex());
- if (copyItemText.get(ReplayEditDataType.OPTION_TABLE_INDEX).contains(
- ReplayEditDataType.SELECTED_ITEM_COPY)) {
- copyItemText.set(
- ReplayEditDataType.OPTION_TABLE_INDEX,
- getReplaceString(
- copyItemText.get(ReplayEditDataType.OPTION_TABLE_INDEX),
- ReplayEditDataType.SELECTED_ITEM_COPY, CommonConstants.EMPTY));
- }
- if (selectedCutItemIndex >= 0) {
- disableCopyItem(selectedCutItemIndex);
- selectedCutItemIndex = -1;
- } else {
- disableCopyItem(selectedCopyItemIndex);
- }
-
- selectedCopyItemIndex = getMouseSelectedTableItemIndex();
- enableCopyItem();
- }
- });
- pasteItem = new DAPopupMenuItem(popupMenu);
- pasteItem.setText(ReplayEditLabels.CONTEXT_PASTE);
- pasteItem.addListener(new DAPopupMenuListener() {
- @Override
- public void widgetSelected(DAPopupMenuItem menuItem) {
- if (selectedCopyItemIndex >= 0) {
- pasteTableItems(getMouseSelectedTableItemIndex(), copyItemText);
- updateTableSequenceNumber();
- disableCopyItem(getMouseSelectedTableItemIndex());
- } else if (selectedCutItemIndex >= 0) {
- pasteTableItems(getMouseSelectedTableItemIndex(), copyItemText);
- table.remove(selectedCutItemIndex);
- updateTableSequenceNumber();
- selectedCutItemIndex = -1;
- }
- updateVaildState();
- tableRedraw();
- }
- });
-
- insertItem = new DAPopupMenuItem(popupMenu);
- insertItem.setText(ReplayEditLabels.CONTEXT_INSERT);
- insertItem.addListener(new DAPopupMenuListener() {
- @Override
- public void widgetSelected(DAPopupMenuItem menuItem) {
- if (getCopyItemIndex() > -1) {
- if (selectedCopyItemIndex >= 0) {
- insertTableItems(getMouseSelectedTableItemIndex(), copyItemText);
- } else if (selectedCutItemIndex >= 0) {
- disableCopyItem(selectedCutItemIndex + 1);
- insertTableItems(getMouseSelectedTableItemIndex(), copyItemText);
- table.remove(selectedCutItemIndex - 1);
- updateTableSequenceNumber();
- selectedCutItemIndex = -1;
- }
- } else {
- insertTableItems(getMouseSelectedTableItemIndex(),
- getSelectedItemText(getMouseSelectedTableItemIndex()));
- }
- updateTableSequenceNumber();
- updateVaildState();
- tableRedraw();
- }
- });
- deleteItem = new DAPopupMenuItem(popupMenu);
- deleteItem.setText(ReplayEditLabels.CONTEXT_DELETE);
- deleteItem.addListener(new DAPopupMenuListener() {
- @Override
- public void widgetSelected(DAPopupMenuItem menuItem) {
- table.remove(getMouseSelectedTableItemIndex());
- updateTableSequenceNumber();
- updateVaildState();
- tableRedraw();
- }
- });
- }
-
- private void enableCopyItem() {
- String itemOption = getMouseSelectedItemOptionText();
- if (!itemOption.contains(ReplayEditDataType.SELECTED_ITEM_COPY)) {
- setMouseSelectedItemOptionText(itemOption + ReplayEditDataType.SELECTED_ITEM_COPY);
- }
- }
-
- private void disableCopyItem(int index) {
- if (index < 0) {
- return;
- }
- String itemOption = getMouseSelectedItemOptionText();
- if (itemOption.contains(ReplayEditDataType.SELECTED_ITEM_COPY)) {
- itemOption = itemOption.replace(ReplayEditDataType.SELECTED_ITEM_COPY,
- CommonConstants.EMPTY);
- }
- table.getItem(index).setText(ReplayEditDataType.OPTION_TABLE_INDEX, itemOption);
- }
-
- private void setMenuItemOfEventType() {
- eventTypePopupMenu = new ReplayEditPopupMenu(table);
- eventTypePopupMenu.setMouseListener();
- eventTypePopupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT);
- DAPopupMenuItem cutItem = new DAPopupMenuItem(eventTypePopupMenu);
- cutItem.setText(ReplayEditLabels.CONTEXT_TOUCH);
- cutItem.addListener(new DAPopupMenuListener() {
- @Override
- public void widgetSelected(DAPopupMenuItem menuItem) {
- updateSelectPopupMenu(ReplayEditLabels.CONTEXT_TOUCH);
- }
- });
- DAPopupMenuItem copyItem = new DAPopupMenuItem(eventTypePopupMenu);
- copyItem.setText(ReplayEditLabels.CONTEXT_KEY);
- copyItem.addListener(new DAPopupMenuListener() {
- @Override
- public void widgetSelected(DAPopupMenuItem menuItem) {
- updateSelectPopupMenu(ReplayEditLabels.CONTEXT_KEY);
- }
- });
- }
-
- private void setMenuItemOfKey() {
- eventKeyPopupMenu = new ReplayEditPopupMenu(table);
- eventKeyPopupMenu.setMouseListener();
- eventKeyPopupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT);
- DAPopupMenuItem menuItem = new DAPopupMenuItem(eventKeyPopupMenu);
- menuItem.setText(ReplayEditLabels.CONTEXT_KEY_MENU);
- menuItem.addListener(new DAPopupMenuListener() {
- @Override
- public void widgetSelected(DAPopupMenuItem menuItem) {
- updateSelectPopupMenu(ReplayEditLabels.CONTEXT_KEY_MENU);
- }
- });
- DAPopupMenuItem homeItem = new DAPopupMenuItem(eventKeyPopupMenu);
- homeItem.setText(ReplayEditLabels.CONTEXT_KEY_HOME);
- homeItem.addListener(new DAPopupMenuListener() {
- @Override
- public void widgetSelected(DAPopupMenuItem menuItem) {
- updateSelectPopupMenu(ReplayEditLabels.CONTEXT_KEY_HOME);
- }
- });
- DAPopupMenuItem backItem = new DAPopupMenuItem(eventKeyPopupMenu);
- backItem.setText(ReplayEditLabels.CONTEXT_KEY_BACK);
- backItem.addListener(new DAPopupMenuListener() {
- @Override
- public void widgetSelected(DAPopupMenuItem menuItem) {
- updateSelectPopupMenu(ReplayEditLabels.CONTEXT_KEY_BACK);
- }
- });
- DAPopupMenuItem powerItem = new DAPopupMenuItem(eventKeyPopupMenu);
- powerItem.setText(ReplayEditLabels.CONTEXT_KEY_POWER);
- powerItem.addListener(new DAPopupMenuListener() {
- @Override
- public void widgetSelected(DAPopupMenuItem menuItem) {
- updateSelectPopupMenu(ReplayEditLabels.CONTEXT_KEY_POWER);
- }
- });
- DAPopupMenuItem volumeUpItem = new DAPopupMenuItem(eventKeyPopupMenu);
- volumeUpItem.setText(ReplayEditLabels.CONTEXT_KEY_VOLUME_UP);
- volumeUpItem.addListener(new DAPopupMenuListener() {
- @Override
- public void widgetSelected(DAPopupMenuItem menuItem) {
- updateSelectPopupMenu(ReplayEditLabels.CONTEXT_KEY_VOLUME_UP);
- }
- });
- DAPopupMenuItem volumeDownItem = new DAPopupMenuItem(eventKeyPopupMenu);
- volumeDownItem.setText(ReplayEditLabels.CONTEXT_KEY_VOLUME_DOWN);
- volumeDownItem.addListener(new DAPopupMenuListener() {
- @Override
- public void widgetSelected(DAPopupMenuItem menuItem) {
- updateSelectPopupMenu(ReplayEditLabels.CONTEXT_KEY_VOLUME_DOWN);
- }
- });
- }
-
- private void setItemKeyText(Event event) {
- if (isMouseSelectedTableItem) {
- if (isTimeColumnIndex()) {
- updateTextOfTimeColumnIndex(event);
- } else if (isValueColumnIndex()) {
- updateTextOfValueColumnIndex(event);
- }
- updateVaildState();
- }
- }
-
- private boolean isTimeColumnIndex() {
- if (getColumnName(getMouseSelectedTableColumnIndex()).equals(
- ReplayEditLabels.TABLE_COLUMN_MOUSE_DOWN_TIME)
- || getColumnName(getMouseSelectedTableColumnIndex()).equals(
- ReplayEditLabels.TABLE_COLUMN_MOUSE_UP_TIME)) {
- return true;
- } else {
- return false;
- }
- }
-
- private boolean isValueColumnIndex() {
- if (getColumnName(getMouseSelectedTableColumnIndex()).equals(
- ReplayEditLabels.TABLE_COLUMN_VALUE1)
- || getColumnName(getMouseSelectedTableColumnIndex()).equals(
- ReplayEditLabels.TABLE_COLUMN_VALUE2)) {
- return true;
- } else {
- return false;
- }
- }
-
- private void updateTextOfTimeColumnIndex(Event event) {
- boolean iskeyInput = false;
- if (KeyEvent.VK_0 <= event.character && event.character <= KeyEvent.VK_9) {
- iskeyInput = true;
- }
- if (KeyEvent.VK_PERIOD == event.character) {
- iskeyInput = true;
- }
- if (!iskeyInput) {
- removeInputValue();
- return;
- }
- String savedString = inputValueText.getText();
- if (!savedString.contains(ReplayEditLabels.CONTEXT_VALUE_S)) {
- savedString += ReplayEditLabels.CONTEXT_VALUE_S;
- }
- if (savedString.length() > 10) {
- removeInputValue();
- return;
- }
- if (savedString.contains(CommonConstants.DOT)) {
- String lines[] = savedString.split(CommonConstants.CMD_SPLIT_DOT);
- if (lines.length > 0 && lines[1].trim().length() > 2) {
- removeInputValue();
- return;
- }
- }
- setMouseSelectedTableItemText(savedString);
- tableRedraw();
- }
-
- private void updateTextOfValueColumnIndex(Event event) {
- boolean iskeyInput = false;
- if (KeyEvent.VK_0 <= event.character && event.character <= KeyEvent.VK_9) {
- iskeyInput = true;
- }
- if (!iskeyInput) {
- removeInputValue();
- return;
- }
- String savedString = inputValueText.getText();
- StringBuffer inputString = new StringBuffer(savedString);
- if (getColumnName(getMouseSelectedTableColumnIndex()).equals(
- ReplayEditLabels.TABLE_COLUMN_VALUE1)) {
- if (!savedString.contains(ReplayEditLabels.CONTEXT_VALUE_X)) {
- inputString.insert(0, ReplayEditLabels.CONTEXT_VALUE_X);
- }
- } else {
- if (!savedString.contains(ReplayEditLabels.CONTEXT_VALUE_Y)) {
- inputString.insert(0, ReplayEditLabels.CONTEXT_VALUE_Y);
- }
- }
- setMouseSelectedTableItemText(inputString.toString());
- tableRedraw();
- }
-
- private void addTextWidget(GridItem gridItem) {
- GridEditor editor = new GridEditor(table);
- editor.minimumWidth = 10;
- editor.horizontalAlignment = SWT.CENTER;
- editor.grabHorizontal = true;
-
- inputValueText = new DATextBox(table, SWT.CENTER);
- inputValueText.getControl().setText(getMouseSelectedTableItemText());
- inputValueText.getControl().selectAll();
- inputValueText.getControl().setFocus();
- editor.setEditor(inputValueText.getControl(), gridItem, getMouseSelectedTableColumnIndex());
- }
-
- private void removeInputValue() {
- if (null == inputValueText || inputValueText.getText().length() <= 0) {
- return;
- }
- StringBuffer textBuffer = new StringBuffer(inputValueText.getText());
- textBuffer.deleteCharAt(textBuffer.length() - 1);
- inputValueText.setText(textBuffer.toString());
- inputValueText.getControl().setSelection(textBuffer.length());
- }
-
- private void updateSelectPopupMenu(String text) {
- if (!getColumnName(getMouseSelectedTableColumnIndex()).equals(
- ReplayEditLabels.TABLE_COLUMN_TYPE)) {
- setMouseSelectedTableItemText(text);
- tableRedraw();
- return;
- }
-
- if (text.contains(ReplayEditLabels.CONTEXT_KEY)) {
- if (selectedPreKeyContext.size() > 3
- && selectedPreKeyContext.get(0).equals(
- Integer.toString(getMouseSelectedTableItemIndex()))) {
- setPreSelectedContext(text);
- } else {
- table.getItem(getMouseSelectedTableItemIndex()).setText(
- getMouseSelectedTableColumnIndex(), text);
- table.getItem(getMouseSelectedTableItemIndex()).setText(
- getMouseSelectedTableColumnIndex() + 1, ReplayEditLabels.CONTEXT_KEY_MENU);
- table.getItem(getMouseSelectedTableItemIndex()).setText(
- getMouseSelectedTableColumnIndex() + 2, CommonConstants.DASH);
- }
- } else if (text.contains(ReplayEditLabels.CONTEXT_TOUCH)) {
- if (selectedPreTouchContext.size() > 3
- && selectedPreTouchContext.get(0).equals(
- Integer.toString(getMouseSelectedTableItemIndex()))) {
- setPreSelectedContext(text);
- } else {
- table.getItem(getMouseSelectedTableItemIndex()).setText(
- getMouseSelectedTableColumnIndex(), text);
- table.getItem(getMouseSelectedTableItemIndex()).setText(
- getMouseSelectedTableColumnIndex() + 1,
- ReplayEditLabels.CONTEXT_VALUE_X + CommonConstants.ZERO);
- table.getItem(getMouseSelectedTableItemIndex()).setText(
- getMouseSelectedTableColumnIndex() + 2,
- ReplayEditLabels.CONTEXT_VALUE_Y + CommonConstants.ZERO);
- }
- }
- tableRedraw();
- }
-
- private void savedSelectedContext(String text) {
- if (text.equals(ReplayEditLabels.CONTEXT_KEY)) {
- selectedPreKeyContext.clear();
- selectedPreKeyContext.add(Integer.toString(getMouseSelectedTableItemIndex()));
- selectedPreKeyContext.add(table.getItem(getMouseSelectedTableItemIndex()).getText(
- getMouseSelectedTableColumnIndex()));
- selectedPreKeyContext.add(table.getItem(getMouseSelectedTableItemIndex()).getText(
- getMouseSelectedTableColumnIndex() + 1));
- selectedPreKeyContext.add(table.getItem(getMouseSelectedTableItemIndex()).getText(
- getMouseSelectedTableColumnIndex() + 2));
- } else if (text.equals(ReplayEditLabels.CONTEXT_TOUCH)) {
- selectedPreTouchContext.clear();
- selectedPreTouchContext.add(Integer.toString(getMouseSelectedTableItemIndex()));
- selectedPreTouchContext.add(table.getItem(getMouseSelectedTableItemIndex()).getText(
- getMouseSelectedTableColumnIndex()));
- selectedPreTouchContext.add(table.getItem(getMouseSelectedTableItemIndex()).getText(
- getMouseSelectedTableColumnIndex() + 1));
- selectedPreTouchContext.add(table.getItem(getMouseSelectedTableItemIndex()).getText(
- getMouseSelectedTableColumnIndex() + 2));
- }
- }
-
- private void setPreSelectedContext(String text) {
- if (text.equals(ReplayEditLabels.CONTEXT_KEY)) {
- table.getItem(getMouseSelectedTableItemIndex()).setText(
- getMouseSelectedTableColumnIndex(), selectedPreKeyContext.get(1));
- table.getItem(getMouseSelectedTableItemIndex()).setText(
- getMouseSelectedTableColumnIndex() + 1, selectedPreKeyContext.get(2));
- table.getItem(getMouseSelectedTableItemIndex()).setText(
- getMouseSelectedTableColumnIndex() + 2, selectedPreKeyContext.get(3));
- } else if (text.equals(ReplayEditLabels.CONTEXT_TOUCH)) {
- table.getItem(getMouseSelectedTableItemIndex()).setText(
- getMouseSelectedTableColumnIndex(), selectedPreTouchContext.get(1));
- table.getItem(getMouseSelectedTableItemIndex()).setText(
- getMouseSelectedTableColumnIndex() + 1, selectedPreTouchContext.get(2));
- table.getItem(getMouseSelectedTableItemIndex()).setText(
- getMouseSelectedTableColumnIndex() + 2, selectedPreTouchContext.get(3));
- }
- }
-
- private void upadteMouseOverTableItemsStatus(GridItem item, Event event) {
- for (int i = 0; i < table.getItemCount(); i++) {
- for (int j = 0; j < table.getColumns().length; j++) {
- table.getItem(i).setChecked(j, false);
- }
- }
- int selectedColumnIndex = getMouseColumnIndex(item, event);
- String selectedText = item.getText(selectedColumnIndex);
- if (selectedText.equals(CommonConstants.DASH)) {
- return;
- }
-
- String selectedOptionText = item.getText(6);
- if (!selectedOptionText.contains(ReplayEditDataType.MODIFIABILITY_TRUE)) {
- return;
- }
- if (selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_S) || selectedText.length() == 0) {
- item.setImage(null);
- } else if (selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_X)
- || selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_Y)) {
- if (enableCoordinateIcon) {
- item.setImage(ImageResources.REPLAY_EDIT_SNAPSHOT_DOWN);
- } else {
- item.setImage(null);
- }
- } else {
- item.setImage(ImageResources.REPLAY_EDIT_DROPDOWN_DOWN);
- }
- item.setChecked(selectedColumnIndex, true);
- tableRedraw();
- }
-
- private void updateMouseOverTableItemsText() {
- if (!isMouseSelectedTableItem) {
- return;
- }
- removeMouseSelectedItemOptionText(ReplayEditDataType.SELECTED_ITEM_KEY_INPUT);
- updateRollbackText();
- updateNextItemsSavedTime();
- updateVaildState();
- isMouseSelectedTableItem = false;
- tableRedraw();
- }
-
- private boolean updateVaildItems() {
- int nSize = table.getItemCount();
- long preEventTime = 0;
- boolean isVaild = true;
- for (int i = 0; i < nSize; i++) {
- long mouseDowntime = getLongTableTime(table.getItem(i).getText(
- ReplayEditDataType.MOUSE_DOWN_TIME_TABLE_INDEX));
- String upTime = table.getItem(i).getText(ReplayEditDataType.MOUSE_UP_TIME_TABLE_INDEX);
-
- long mouseUptime = 0;
- if (!upTime.equals(CommonConstants.EMPTY)) {
- mouseUptime = getLongTableTime(upTime);
- } else {
- mouseUptime = mouseDowntime;
- }
- if (mouseUptime < mouseDowntime) {
- isVaild = false;
- } else if (mouseDowntime < preEventTime) {
- isVaild = false;
- } else {
- String itemOption = table.getItem(i).getText(ReplayEditDataType.OPTION_TABLE_INDEX);
- if (itemOption.contains(ReplayEditDataType.ITEM_TIME_VAILD_FALSE)) {
- String removeItemOption = itemOption.replace(
- ReplayEditDataType.ITEM_TIME_VAILD_FALSE, CommonConstants.EMPTY);
- table.getItem(i).setText(ReplayEditDataType.OPTION_TABLE_INDEX,
- removeItemOption);
- }
- }
- preEventTime = mouseUptime;
- if (!isVaild) {
- String itemOption = table.getItem(i).getText(ReplayEditDataType.OPTION_TABLE_INDEX);
- if (!itemOption.contains(ReplayEditDataType.ITEM_TIME_VAILD_FALSE)) {
- table.getItem(i).setText(ReplayEditDataType.OPTION_TABLE_INDEX,
- itemOption + ReplayEditDataType.ITEM_TIME_VAILD_FALSE);
- }
- }
- }
- return isVaild;
- }
-
- private long getLongTableTime(String time) {
- String strTime = time;
- if (strTime.contains(ReplayEditLabels.CONTEXT_VALUE_S)) {
- strTime = time.replace(ReplayEditLabels.CONTEXT_VALUE_S, CommonConstants.EMPTY);
- }
- if (strTime.contains(CommonConstants.DOT)) {
- strTime = strTime.replace(CommonConstants.DOT, CommonConstants.EMPTY);
- }
- if (strTime.length() == 1) {
- strTime += 0;
- }
- if (strTime.equals(CommonConstants.EMPTY)) {
- return 0;
- } else {
- return Long.parseLong(strTime);
- }
- }
-
- private String getStrTableTime(Long time) {
- return String.format("%d.%ds", time / 10, time % 10);
- }
-
- private void addTableTime(boolean isMouseDown) {
- String eventTime = updateDotChartAtTime();
- long preTime = getLongTableTime(savedItemTextForReset);
- long nowTime = getLongTableTime(eventTime);
- long addTime = nowTime - preTime;
- int nSize = table.getItemCount();
- int startItem = getMouseSelectedTableItemIndex();
- for (int i = startItem; i < nSize; i++) {
- if (!table.getItem(i).getText(ReplayEditDataType.OPTION_TABLE_INDEX)
- .contains(ReplayEditDataType.MODIFIABILITY_TRUE)) {
- continue;
- }
- long mouseDowntime = getLongTableTime(table.getItem(i).getText(
- ReplayEditDataType.MOUSE_DOWN_TIME_TABLE_INDEX));
- mouseDowntime += addTime;
-
- String upTime = table.getItem(i).getText(ReplayEditDataType.MOUSE_UP_TIME_TABLE_INDEX);
- long mouseUptime = 0;
- if (!upTime.equals(CommonConstants.EMPTY)) {
- mouseUptime = getLongTableTime(upTime);
- }
- mouseUptime += addTime;
- if (i == startItem) {
- if (isMouseDown && !upTime.equals(CommonConstants.EMPTY)) {
- table.getItem(i).setText(ReplayEditDataType.MOUSE_UP_TIME_TABLE_INDEX,
- getStrTableTime(mouseUptime));
- }
- } else {
- table.getItem(i).setText(ReplayEditDataType.MOUSE_DOWN_TIME_TABLE_INDEX,
- getStrTableTime(mouseDowntime));
- if (!upTime.equals(CommonConstants.EMPTY)) {
- table.getItem(i).setText(ReplayEditDataType.MOUSE_UP_TIME_TABLE_INDEX,
- getStrTableTime(mouseUptime));
- }
- }
- }
- }
-
- private void updateNextItemsSavedTime() {
- if (!isMouseSelectedTableItem) {
- return;
- }
- String savedString = getMouseSelectedTableItemText();
- if (savedString.length() <= 0) {
- return;
- }
- if (getColumnName(getMouseSelectedTableColumnIndex()).equals(
- ReplayEditLabels.TABLE_COLUMN_MOUSE_DOWN_TIME)) {
- addTableTime(true);
- } else if (getColumnName(getMouseSelectedTableColumnIndex()).equals(
- ReplayEditLabels.TABLE_COLUMN_MOUSE_UP_TIME)) {
- addTableTime(false);
- }
- }
-
- private boolean updateRollbackText() {
- if (!isMouseSelectedTableItem) {
- return false;
- }
- String savedString = getMouseSelectedTableItemText();
- boolean isResetText = false;
- if (savedString.length() == 0) {
- isResetText = true;
- }
- if (!isResetText) {
- return false;
- }
- setMouseSelectedTableItemText(savedItemTextForReset);
- return true;
- }
-
- private String updateDotChartAtTime() {
- String chagneString = CommonConstants.EMPTY;
- String savedString = getMouseSelectedTableItemText();
- if (!savedString.contains(CommonConstants.DOT)) {
- String strPoint = CommonConstants.DOT + CommonConstants.ZERO;
- chagneString = new StringBuffer(savedString).insert(savedString.length() - 1, strPoint)
- .toString();
- setMouseSelectedTableItemText(chagneString);
- } else {
- chagneString = savedString;
- }
- return chagneString;
- }
-
- private void updateSelectedItemIndexValue(GridItem item, Event event) {
- GridColumn[] columns = table.getColumns();
- mouseSelectedItemIndex = -1;
- mouseSelectedColumnIndex = -1;
- mouseSelectedPreColunmEndX = -1;
-
- int tableItemSize = table.getItemCount();
- boolean isFindSelectedItem = false;
- for (int i = 0; i < tableItemSize; i++) {
- if (isFindSelectedItem == true) {
- break;
- } else {
- mouseSelectedPreColunmEndX = -1;
- }
- for (int j = 0; j < columns.length; j++) {
- if (table.getItem(i).getChecked(j)) {
- mouseSelectedItemIndex = i;
- mouseSelectedColumnIndex = j;
- isFindSelectedItem = true;
- break;
- }
- mouseSelectedPreColunmEndX += columns[j].getWidth();
- }
- }
- }
-
- private void updateKeyboardInputStatus(GridItem item, Event event) {
- if (!item.getText(ReplayEditDataType.OPTION_TABLE_INDEX).contains(
- ReplayEditDataType.MODIFIABILITY_TRUE)) {
- deleteItem.setEnabled(false);
- return;
- }
- String selectedText = getMouseSelectedTableItemText();
- if (selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_X)
- || selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_Y)
- || selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_S)
- || selectedText.equals(CommonConstants.EMPTY)) {
- isMouseSelectedTableItem = true;
- savedItemTextForReset = getMouseSelectedTableItemText();
- addTextWidget(item);
- addMouseSelectedItemOptionText(ReplayEditDataType.SELECTED_ITEM_KEY_INPUT);
- }
- }
-
- private boolean selectPopupMenuMouseDownIcon(GridItem item, Event event) {
- if (mouseSelectedPreColunmEndX > event.x || event.x > mouseSelectedPreColunmEndX + 20
- || getMouseSelectedTableItemIndex() == -1) {
- return true;
- }
- Point tablePt = new Point(table.getShell().getBounds().x, table.getShell().getBounds().y);
- Point MousePt = new Point(0, 0);
- MousePt.x = tablePt.x + mouseSelectedPreColunmEndX + 8;
- int selectedIndexPosition = table.getSelectionIndex()
- - table.getVerticalBar().getSelection();
- MousePt.y = tablePt.y + table.getItemHeight() * selectedIndexPosition + 135;
- String selectedText = item.getText(getMouseSelectedTableColumnIndex());
- if (selectedText.contains(ReplayEditLabels.CONTEXT_TOUCH)
- || selectedText.contains(ReplayEditLabels.CONTEXT_KEY)) {
- eventTypePopupMenu.open(eventTypePopupMenu.getTopShell(), MousePt.x, MousePt.y);
- savedSelectedContext(selectedText);
- } else if (selectedText.contains(ReplayEditLabels.CONTEXT_KEY_MENU)
- || selectedText.contains(ReplayEditLabels.CONTEXT_KEY_HOME)
- || selectedText.contains(ReplayEditLabels.CONTEXT_KEY_BACK)
- || selectedText.contains(ReplayEditLabels.CONTEXT_KEY_POWER)
- || selectedText.contains(ReplayEditLabels.CONTEXT_KEY_VOLUME_UP)
- || selectedText.contains(ReplayEditLabels.CONTEXT_KEY_VOLUME_DOWN)) {
- eventKeyPopupMenu.open(eventKeyPopupMenu.getTopShell(), MousePt.x, MousePt.y);
- } else if (selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_X)
- || selectedText.contains(ReplayEditLabels.CONTEXT_VALUE_Y)) {
- if (enableCoordinateIcon) {
- ReplayEditScreenshotDialog dialog = new ReplayEditScreenshotDialog(
- table.getShell(), item);
- dialog.open();
- }
- return false;
- } else {
- openPoppupMenuMouseDownSequenceColumn(item, event);
- }
- return true;
- }
-
- private void openPoppupMenuMouseDownSequenceColumn(GridItem item, Event event) {
- if (!item.getText(ReplayEditDataType.OPTION_TABLE_INDEX).contains(
- ReplayEditDataType.MODIFIABILITY_TRUE)) {
- if (selectedCutItemIndex > 0 || selectedCopyItemIndex > 0) {
- insertItem.setEnabled(true);
- } else {
- insertItem.setEnabled(false);
- }
- copyItem.setEnabled(false);
- cutItem.setEnabled(false);
- pasteItem.setEnabled(false);
- deleteItem.setEnabled(false);
-
- } else if (getCopyItemIndex() > -1) {
- copyItem.setEnabled(true);
- cutItem.setEnabled(true);
- insertItem.setEnabled(true);
- pasteItem.setEnabled(true);
- deleteItem.setEnabled(true);
- } else {
- copyItem.setEnabled(true);
- cutItem.setEnabled(true);
- insertItem.setEnabled(true);
- pasteItem.setEnabled(false);
- deleteItem.setEnabled(true);
- }
-
- GridColumn[] columns = table.getColumns();
- if (event.x <= columns[0].getWidth()) {
- Point pt = Display.getCurrent().getCursorLocation();
- popupMenu.open(popupMenu.getTopShell(), pt.x - 5, pt.y - 5);
- } else {
- popupMenu.closeChild();
- }
- }
-
- private int getCopyItemIndex() {
- int nSize = table.getItemCount();
- int index = -1;
- for (int i = 0; i < nSize; i++) {
- if (table.getItem(i).getText(ReplayEditDataType.OPTION_TABLE_INDEX)
- .contains(ReplayEditDataType.SELECTED_ITEM_COPY)) {
- index = i;
- break;
- }
- }
- return index;
- }
-
- private int getMouseColumnIndex(GridItem item, Event event) {
- nowMousePositionX = event.x;
- nowMousePositionY = event.y;
- GridColumn[] columns = table.getColumns();
- int size = columns.length;
- int preColunmStartX = 0;
- int preColunmEndX = 0;
- for (int i = 0; i < size; i++) {
- preColunmEndX += columns[i].getWidth();
- if (preColunmStartX <= event.x && event.x <= preColunmEndX) {
- return i;
- }
- preColunmStartX += columns[i].getWidth();
- }
- return -1;
- }
-
- private void tableRedraw() {
- table.redraw(nowMousePositionX - 100, nowMousePositionY - 100, 100, 100, false);
- }
-
- private void updateVaildState() {
- if (updateVaildItems()) {
- enableSaveButton();
- } else {
- disableSaveButton();
- }
- table.redraw();
- }
-
- private void enableSaveButton() {
- if (null != ReplayEditTableDataMaker.getInstance().getOkButton()) {
- ReplayEditTableDataMaker.getInstance().getOkButton().setButtonEnabled(true);
- }
- if (null != ReplayEditTableDataMaker.getInstance().getSaveButton()) {
- ReplayEditTableDataMaker.getInstance().getSaveButton().setButtonEnabled(true);
- }
- }
-
- private void disableSaveButton() {
- if (null != ReplayEditTableDataMaker.getInstance().getOkButton()) {
- ReplayEditTableDataMaker.getInstance().getOkButton().setButtonEnabled(false);
- }
- if (null != ReplayEditTableDataMaker.getInstance().getSaveButton()) {
- ReplayEditTableDataMaker.getInstance().getSaveButton().setButtonEnabled(false);
- }
-
- }
-
- @Override
- public void setColumns(String[] columnNames) {
- this.columnNames = 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 ReplayEditTableCellRenderer());
- column.setHeaderRenderer(new DATableHeaderRenderer());
- column.pack();
- }
- }
-
- public String getColumnName(int index) {
- if (this.columnNames.length > index) {
- return this.columnNames[index];
- } else {
- Logger.error("[ERR] input column index is wrong !!");
- return CommonConstants.EMPTY;
- }
- }
-
- private String getReplaceString(String target, String oldString, String newString) {
- return target.replace(oldString, newString);
- }
-}
+++ /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.replayEditor;
-
-import org.eclipse.nebula.widgets.grid.GridItem;
-import org.eclipse.nebula.widgets.grid.internal.DefaultCellRenderer;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.resources.FontResources;
-import org.tizen.dynamicanalyzer.ui.toolbar.replayEditor.data.ReplayEditDataType;
-
-public class ReplayEditTableCellRenderer extends DefaultCellRenderer {
- int leftMargin = 4;
- int rightMargin = 4;
- int textTopMargin = 1;
-
- public Image menuImg = null;
-
- @Override
- public void paint(GC gc, Object value) {
- GridItem item = (GridItem) value;
- gc.setFont(item.getFont(getColumn()));
- paintImage(gc, item);
- paintText(gc, item);
- paintTableBoardLine(gc, item);
- paintMouseOverColumn(gc, item);
- paintSelectedInputKey(gc, item);
- paintVaildTime(gc, item);
- }
-
- private void paintImage(GC gc, GridItem item) {
- menuImg = item.getImage();
- if (menuImg == null || !item.getChecked(getColumn())) {
- return;
- }
- int y = getBounds().y;
- y += (getBounds().height - menuImg.getBounds().height) / 2;
- gc.drawImage(menuImg, getBounds().x, y);
- }
-
- private void paintText(GC gc, GridItem item) {
- int x = leftMargin;
- int width = getBounds().width - x - rightMargin;
- String text = item.getText(getColumn());
- int len = gc.stringExtent(text).x;
- if (len < width) {
- x += (width - len) / 2;
- }
- gc.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
- gc.setFont(FontResources.TABLE_CELL_FONT);
- gc.drawText(text, getBounds().x + x, getBounds().y + textTopMargin, true);
- }
-
- private void paintTableBoardLine(GC gc, GridItem item) {
- if (!item.getParent().getLinesVisible()) {
- return;
- }
- 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);
- }
-
- private void paintMouseOverColumn(GC gc, GridItem item) {
- if (!item.getChecked(getColumn())) {
- return;
- }
- Rectangle focusRect = new Rectangle(getBounds().x - 1, getBounds().y - 1,
- getBounds().width, getBounds().height + 1);
- gc.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_START);
- gc.drawRectangle(focusRect);
- if (!isFocus()) {
- return;
- }
- focusRect.x++;
- focusRect.width -= 2;
- focusRect.y++;
- focusRect.height -= 2;
- gc.drawRectangle(focusRect);
- }
-
- private void paintSelectedInputKey(GC gc, GridItem item) {
- String optionColumn = item.getText(6);
- if (!item.getChecked(getColumn())
- || !optionColumn.contains(ReplayEditDataType.SELECTED_ITEM_KEY_INPUT)) {
- return;
- }
- Rectangle focusRect = new Rectangle(getBounds().x - 1, getBounds().y - 1,
- getBounds().width, getBounds().height + 1);
- gc.setForeground(ColorResources.RED);
- gc.drawRectangle(focusRect);
- if (!isFocus()) {
- return;
- }
- focusRect.x++;
- focusRect.width -= 2;
- focusRect.y++;
- focusRect.height -= 2;
- gc.drawRectangle(focusRect);
- }
-
- private void paintVaildTime(GC gc, GridItem item) {
- String optionColumn = item.getText(6);
- if (!optionColumn.contains(ReplayEditDataType.ITEM_TIME_VAILD_FALSE)) {
- return;
- }
- gc.setForeground(ColorResources.RED);
- gc.setLineWidth(1);
- gc.drawLine(getBounds().x, getBounds().y + (getBounds().height / 3), getBounds().x
- + getBounds().width, getBounds().y + (getBounds().height / 3));
- gc.setLineWidth(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.toolbar.replayEditor;
-
-import java.io.Serializable;
-import java.util.Comparator;
-
-import org.tizen.dynamicanalyzer.ui.toolbar.replayEditor.data.ReplayEditTableData;
-
-
-public class ReplayEditTableItemListSortComparator implements Comparator<ReplayEditTableData>,
- Serializable {
-
- private static final long serialVersionUID = 1L;
-
- @Override
- public int compare(ReplayEditTableData one, ReplayEditTableData two) {
- long time1 = one.getLongEventMouseDownTime();
- long time2 = two.getLongEventMouseDownTime();
-
- 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:
- * 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.replayEditor;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-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.common.AnalyzerConstants;
-import org.tizen.dynamicanalyzer.nl.ReplayEditLabels;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DefaultTableComparator;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
-
-public class ReplayEditTableView extends DAPageComposite {
- public static final String ID = ReplayEditTableView.class.getName();
- private DATableComposite replayTable = null;
-
- int[] sortTypes = { AnalyzerConstants.SORT_TYPE_GRID,
- AnalyzerConstants.SORT_TYPE_GRID, AnalyzerConstants.SORT_TYPE_GRID,
- AnalyzerConstants.SORT_TYPE_GRID, AnalyzerConstants.SORT_TYPE_GRID };
- int[] sourceColumns = { 0, 0, 0, 0, 0, 0 };
- private String[] columnNames = { ReplayEditLabels.TABLE_COLUMN_SEQ,
- ReplayEditLabels.TABLE_COLUMN_MOUSE_DOWN_TIME,
- ReplayEditLabels.TABLE_COLUMN_MOUSE_UP_TIME,
- ReplayEditLabels.TABLE_COLUMN_TYPE,
- ReplayEditLabels.TABLE_COLUMN_VALUE1,
- ReplayEditLabels.TABLE_COLUMN_VALUE2 };
- private int[] columnSizes = { 80, 110, 110, 100, 100, 100 };
- private boolean[] columnVisibility = { true, true, true, true, true, true };
-
- public ReplayEditTableView(Composite parent, int style) {
- super(parent, style);
- setTitle(ReplayEditLabels.TABLE_PAGE_TITLE);
- this.setLayout(new FormLayout());
- this.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
-
- Composite tableComp = new Composite(this, SWT.NONE);
- tableComp.setLayout(new FormLayout());
- FormData data = new FormData();
- data.top = new FormAttachment(0, 5);
- data.left = new FormAttachment(0, 5);
- data.right = new FormAttachment(100, -5);
- data.bottom = new FormAttachment(100, -5);
- tableComp.setLayoutData(data);
- tableComp.setBackground(ColorResources.DIALOG_BG_UPPER);
-
- // Table
- replayTable = new ReplayEditTable(tableComp, SWT.BORDER | SWT.V_SCROLL
- | SWT.SINGLE);
- replayTable.setTableName(ReplayEditLabels.TABLE_TITLE);
- replayTable.setComparator(new DefaultTableComparator());
- replayTable.setSortTypes(sortTypes);
- replayTable.setColumns(columnNames);
- replayTable.setColumnSize(columnSizes);
- replayTable.setColumnVisibility(columnVisibility);
- replayTable.setTableToolTipEnable(false);
- replayTable.getTable().addSelectionListener(
- featureTableSelectionListener);
- replayTable.getTable().addMouseListener(mouseListener);
- 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, 0);
- replayTable.setLayoutData(data);
-
- replayTable.updateTable();
- }
-
- private SelectionListener featureTableSelectionListener = new SelectionListener() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- }
-
- @Override
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
- };
-
- private MouseListener mouseListener = new MouseListener() {
-
- @Override
- public void mouseUp(MouseEvent e) {
- // do nothing
- }
-
- @Override
- public void mouseDown(MouseEvent e) {
- // do nothing
- }
-
- @Override
- public void mouseDoubleClick(MouseEvent e) {
- }
- };
-
- public DATableComposite getReplayTable() {
- return this.replayTable;
- }
-
-}
\ 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.replayEditor.data;
-
-
-public class ReplayEditDataType {
- public static final int SEQ_TABLE_INDEX = 0;
- public static final int MOUSE_DOWN_TIME_TABLE_INDEX = 1;
- public static final int MOUSE_UP_TIME_TABLE_INDEX = 2;
- public static final int TYPE_TABLE_INDEX = 3;
- public static final int VALUE1_TABLE_INDEX = 4;
- public static final int VALUE2_TABLE_INDEX = 5;
- public static final int OPTION_TABLE_INDEX = 6;
-
- public static final String MODIFIABILITY_TRUE = "MODIFIABILITY_TRUE ";
- public static final String SELECTED_ITEM_COPY = "SELECTED_ITEM_COPY ";
- public static final String SELECTED_ITEM_KEY_INPUT = "SELECTED_ITEM_KEY_INPUT ";
- public static final String ITEM_TIME_VAILD_FALSE = "ITEM_TIME_VAILD_FALSE ";
-
- public static final int EVENT_TYPE_END_LOG = 0;
- public static final int EVENT_TYPE_KEY_DOUSE_UP_VALUE = 0;
- public static final int EVENT_TYPE_TOUCH_DOUSE_UP_VALUE = -1;
-
- public static final int EVENT_TYPE_TOUCH = 3;
- public static final int TOUCH_EVENT_CODE_TOUCH = 57;
- public static final int TOUCH_EVENT_CODE_X = 53;
- public static final int TOUCH_EVENT_CODE_Y = 54;
- // Touch
- // ID : 0 TYPE : 3 CODE : 57 VALUE : 1
- // ID : 0 TYPE : 3 CODE : 53 VALUE : 170
- // ID : 0 TYPE : 3 CODE : 54 VALUE : 270
- // ID : 0 TYPE : 0 CODE : 0 VALUE : 0
- // ID : 0 TYPE : 3 CODE : 57 VALUE : -1
- // ID : 0 TYPE : 0 CODE : 0 VALUE : 0
- // Drag
- // ID : 0 TYPE : 3 CODE : 57 VALUE : 2
- // ID : 0 TYPE : 3 CODE : 53 VALUE : 244
- // ID : 0 TYPE : 3 CODE : 54 VALUE : 176
- // ID : 0 TYPE : 0 CODE : 0 VALUE : 0
- // ID : 0 TYPE : 3 CODE : 53 VALUE : 248
- // ID : 0 TYPE : 3 CODE : 54 VALUE : 180
- // ID : 0 TYPE : 0 CODE : 0 VALUE : 0
- // ID : 0 TYPE : 3 CODE : 54 VALUE : 182
- // ID : 0 TYPE : 0 CODE : 0 VALUE : 0
- // ID : 0 TYPE : 3 CODE : 53 VALUE : 250
- // ID : 0 TYPE : 3 CODE : 54 VALUE : 186
- // ID : 0 TYPE : 0 CODE : 0 VALUE : 0
- // ID : 0 TYPE : 3 CODE : 57 VALUE : -1
- // ID : 0 TYPE : 0 CODE : 0 VALUE : 0
- public static final int EVENT_TYPE_KEY = 1;
- public static final int KEY_MENU = 169;
- // ID : 1 TYPE : 1 CODE : 169 VALUE : 1
- // ID : 1 TYPE : 0 CODE : 0 VALUE : 0
- // ID : 1 TYPE : 1 CODE : 169 VALUE : 0
- // ID : 1 TYPE : 0 CODE : 0 VALUE : 0
- public static final int KEY_HOME = 139;
- // ID : 1 TYPE : 1 CODE : 139 VALUE : 1
- // ID : 1 TYPE : 0 CODE : 0 VALUE : 0
- // ID : 1 TYPE : 1 CODE : 139 VALUE : 0
- // ID : 1 TYPE : 0 CODE : 0 VALUE : 0
- public static final int KEY_BACK = 158;
- // ID : 1 TYPE : 1 CODE : 158 VALUE : 1
- // ID : 1 TYPE : 0 CODE : 0 VALUE : 0
- // ID : 1 TYPE : 1 CODE : 158 VALUE : 0
- // ID : 1 TYPE : 0 CODE : 0 VALUE : 0
- public static final int KEY_POWER = 116;
- // ID : 1 TYPE : 1 CODE : 116 VALUE : 1
- // ID : 1 TYPE : 0 CODE : 0 VALUE : 0
- // ID : 1 TYPE : 1 CODE : 116 VALUE : 0
- // ID : 1 TYPE : 0 CODE : 0 VALUE : 0
- public static final int KEY_VOLUME_UP = 115;
- // ID : 1 TYPE : 1 CODE : 115 VALUE : 1
- // ID : 1 TYPE : 0 CODE : 0 VALUE : 0
- // ID : 1 TYPE : 1 CODE : 115 VALUE : 0
- // ID : 1 TYPE : 0 CODE : 0 VALUE : 0
- public static final int KEY_VOLUME_DOWN = 114;
- // ID : 1 TYPE : 1 CODE : 114 VALUE : 1
- // ID : 1 TYPE : 0 CODE : 0 VALUE : 0
- // ID : 1 TYPE : 1 CODE : 114 VALUE : 0
- // ID : 1 TYPE : 0 CODE : 0 VALUE : 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.replayEditor.data;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.swt.widgets.Shell;
-import org.tizen.dynamicanalyzer.common.Global;
-import org.tizen.dynamicanalyzer.constant.CommonConstants;
-import org.tizen.dynamicanalyzer.model.DATime;
-import org.tizen.dynamicanalyzer.nl.ReplayEditLabels;
-import org.tizen.dynamicanalyzer.ui.toolbar.replay.data.ReplayDataManager;
-import org.tizen.dynamicanalyzer.ui.toolbar.replayEditor.RepalyEditSaveDialog;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
-import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
-
-public class ReplayEditSaveDataMaker extends ReplayEditDataType {
-
- private static final long tmpSeqForEventLogFormatSize = 0000;
- private static final int EVENT_TYPE_TOUCH_DOUSE_UP_VALUE = -1;
-
- private int insertDBRid = 0;
- private int insertkeySequence = 1;
-
- private static ReplayEditSaveDataMaker instance = null;
- private List<List<String>> tableItemsList = null;
-
- public static ReplayEditSaveDataMaker getInstance() {
- if (null == instance) {
- instance = new ReplayEditSaveDataMaker();
- }
- return instance;
- }
-
- public void clean() {
- tableItemsList = null;
- }
-
- public void saveData() {
- Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell();
- RepalyEditSaveDialog dialog = new RepalyEditSaveDialog(shell);
- Object result = dialog.open();
- if (null == result) {
- return;
- }
- insertDB();
- }
-
- public void insertDB() {
- ReplayDataManager.getInstance().getReplayDBManager().deleteReplayTableItems();
- insertDBData();
- }
-
- private void cleanInsertData() {
- insertDBRid = 0;
- insertkeySequence = 1;
- }
-
- private void insertDBData() {
- cleanInsertData();
- int size = getTableItemsList().size();
- boolean isStartDragItem = false;
- for (int i = 0; i < size; i++) {
- List<String> item = getTableItemsList().get(i);
- List<List<Object>> dataList = new ArrayList<List<Object>>();
- if (item.get(TYPE_TABLE_INDEX).equals(ReplayEditLabels.CONTEXT_KEY)
- && isStartDragItem == false) {
- dataList = makeDBKeyData(item);
- } else if (isTouchTableItem(item, isStartDragItem)) {
- dataList = makeDBTouchData(item);
- } else if (isDragStartTableItem(item, isStartDragItem)) {
- isStartDragItem = true;
- dataList = makeDBDragStartData(item);
- } else if (isDragTableItem(item, isStartDragItem)) {
- dataList = makeDBDragData(item);
- } else if (isDragEndTableItem(item, isStartDragItem)) {
- isStartDragItem = false;
- dataList = makeDBDragEndData(item);
- }
- if (dataList.size() > 0) {
- ReplayDataManager.getInstance().getReplayDBManager().insertData(dataList);
- dataList.clear();
- }
- }
- }
-
- private boolean isTouchTableItem(List<String> item, boolean isStartDragItem) {
- if (item.get(TYPE_TABLE_INDEX).equals(ReplayEditLabels.CONTEXT_TOUCH)
- && item.get(MOUSE_UP_TIME_TABLE_INDEX).toString().length() != 0
- && isStartDragItem == false) {
- return true;
- } else {
- return false;
- }
- }
-
- private boolean isDragStartTableItem(List<String> item, boolean isStartDragItem) {
- if (item.get(TYPE_TABLE_INDEX).equals(ReplayEditLabels.CONTEXT_TOUCH)
- && item.get(MOUSE_UP_TIME_TABLE_INDEX).toString().length() == 0
- && isStartDragItem == false) {
- return true;
- } else {
- return false;
- }
- }
-
- private boolean isDragTableItem(List<String> item, boolean isStartDragItem) {
- if (item.get(TYPE_TABLE_INDEX).equals(ReplayEditLabels.CONTEXT_TOUCH)
- && item.get(MOUSE_UP_TIME_TABLE_INDEX).toString().length() == 0
- && isStartDragItem == true) {
- return true;
- } else {
- return false;
- }
- }
-
- private boolean isDragEndTableItem(List<String> item, boolean isStartDragItem) {
- if (item.get(TYPE_TABLE_INDEX).equals(ReplayEditLabels.CONTEXT_TOUCH)
- && isStartDragItem == true) {
- return true;
- } else {
- return false;
- }
- }
-
- public String getDBTime(String time) {
- String strTime = time;
- if (strTime.equals(CommonConstants.EMPTY)) {
- return CommonConstants.EMPTY;
- }
- if (strTime.contains(ReplayEditLabels.CONTEXT_VALUE_S)) {
- strTime = time.replace(ReplayEditLabels.CONTEXT_VALUE_S, CommonConstants.EMPTY);
- }
-
- if (strTime.contains(CommonConstants.DOT)) {
- strTime = strTime.replace(CommonConstants.DOT, CommonConstants.EMPTY);
- }
- strTime += 10000;
- return strTime;
- }
-
- private int getDBPoint(String point) {
- String strPoint = point;
- if (strPoint.contains(ReplayEditLabels.CONTEXT_VALUE_X)) {
- strPoint = strPoint.replace(ReplayEditLabels.CONTEXT_VALUE_X, CommonConstants.EMPTY);
- }
- if (strPoint.contains(ReplayEditLabels.CONTEXT_VALUE_Y)) {
- strPoint = strPoint.replace(ReplayEditLabels.CONTEXT_VALUE_Y, CommonConstants.EMPTY);
- }
- return Integer.parseInt(strPoint.trim());
- }
-
- public long getTimeValue(long sec, long nano) {
- DATime startTime = Global.getProject().getProfilingStartTime();
- long startSec = startTime.getSec();
- long startNano = startTime.getNano();
- long resultSec = sec - startSec;
- long resultNano = nano - startNano;
- long time = resultSec * 1000 * 1000 + resultNano / 1000;
- return time;
- }
-
- private DATime getDATimeValue(long time) {
- DATime startTime = Global.getProject().getProfilingStartTime();
- long startSec = startTime.getSec();
- long startNano = startTime.getNano();
- long delaySec = time / (1000 * 1000);
- long delayNano = time % (1000 * 1000);
-
- long eventTimeSec = startSec + delaySec;
- long eventTimeNano = delayNano * 1000 + startNano;
-
- if (eventTimeNano > 1000 * 1000 * 1000) {
- eventTimeSec++;
- delaySec++;
- eventTimeNano = ((time - (delaySec * 1000 * 1000)) * 1000) + startNano;
- }
- DATime resultTime = new DATime();
- resultTime.setSec((int) eventTimeSec);
- resultTime.setNano((int) eventTimeNano);
- // Long resultLongtime = getTimeValue(eventTimeSec, eventTimeNano);
- // Logger.debug("time : " + time + " resultLongtime : "
- // + resultLongtime + " secTime : " + eventTimeSec
- // + " nanoTime : " + eventTimeNano);
- return resultTime;
- }
-
- private int getKeyValue(List<String> item) {
- String keyValue = item.get(VALUE1_TABLE_INDEX);
- int nKey = 0;
- if (keyValue.equals(ReplayEditLabels.CONTEXT_KEY_MENU)) {
- nKey = KEY_MENU;
- } else if (keyValue.equals(ReplayEditLabels.CONTEXT_KEY_HOME)) {
- nKey = KEY_HOME;
- } else if (keyValue.equals(ReplayEditLabels.CONTEXT_KEY_BACK)) {
- nKey = KEY_BACK;
- } else if (keyValue.equals(ReplayEditLabels.CONTEXT_KEY_POWER)) {
- nKey = KEY_POWER;
- } else if (keyValue.equals(ReplayEditLabels.CONTEXT_KEY_VOLUME_UP)) {
- nKey = KEY_VOLUME_UP;
- } else if (keyValue.equals(ReplayEditLabels.CONTEXT_KEY_VOLUME_DOWN)) {
- nKey = KEY_VOLUME_DOWN;
- }
- return nKey;
- }
-
- private List<List<Object>> makeDBKeyData(List<String> item) {
- String itemMouseDownTime = getDBTime(item.get(MOUSE_DOWN_TIME_TABLE_INDEX));
- String itemMouseUpTime = getDBTime(item.get(MOUSE_UP_TIME_TABLE_INDEX));
- if (itemMouseUpTime.equals(CommonConstants.EMPTY)) {
- itemMouseUpTime = itemMouseDownTime;
- }
- int itemValue1 = getKeyValue(item);
- DATime mouseDownTime = getDATimeValue(Long.parseLong(itemMouseDownTime));
- DATime mouseUpTime = getDATimeValue(Long.parseLong(itemMouseUpTime));
- int mouseDownTimeSec = mouseDownTime.getSec();
- int mouseDownTimeNano = mouseDownTime.getNano();
- int mouseUpTimeSec = mouseUpTime.getSec();
- int mouseUpTimeNano = mouseUpTime.getNano();
-
- List<List<Object>> dbKeyDataList = new ArrayList<List<Object>>();
- for (int i = 0; i < 4; i++) {
- List<Object> keyData = new ArrayList<Object>();
- if (i == 0) {
- keyData.add(mouseDownTimeSec + insertDBRid++);
- keyData.add(tmpSeqForEventLogFormatSize);
- keyData.add(Long.parseLong(itemMouseDownTime));
- keyData.add(mouseDownTimeSec);
- keyData.add(mouseDownTimeNano);
- keyData.add(1);
- keyData.add(EVENT_TYPE_KEY);
- keyData.add(itemValue1);
- keyData.add(1);
- } else if (i == 1) {
- keyData.add(mouseDownTimeSec + insertDBRid++);
- keyData.add(tmpSeqForEventLogFormatSize);
- keyData.add(Long.parseLong(itemMouseDownTime));
- keyData.add(mouseDownTimeSec);
- keyData.add(mouseDownTimeNano);
- keyData.add(1);
- keyData.add(0);
- keyData.add(0);
- keyData.add(0);
- } else if (i == 2) {
- keyData.add(mouseUpTimeSec + insertDBRid++);
- keyData.add(tmpSeqForEventLogFormatSize);
- keyData.add(Long.parseLong(itemMouseDownTime));
- keyData.add(mouseUpTimeSec);
- keyData.add(mouseUpTimeNano);
- keyData.add(1);
- keyData.add(EVENT_TYPE_KEY);
- keyData.add(itemValue1);
- keyData.add(0);
- } else if (i == 3) {
- keyData.add(mouseUpTimeSec + insertDBRid++);
- keyData.add(tmpSeqForEventLogFormatSize);
- keyData.add(Long.parseLong(itemMouseDownTime));
- keyData.add(mouseUpTimeSec);
- keyData.add(mouseUpTimeNano);
- keyData.add(1);
- keyData.add(0);
- keyData.add(0);
- keyData.add(0);
- }
- dbKeyDataList.add(keyData);
- }
- return dbKeyDataList;
- }
-
- private List<List<Object>> makeDBTouchData(List<String> item) {
- List<List<Object>> dbKeyDataList = new ArrayList<List<Object>>();
- dbKeyDataList.add(getTouchFirstLog(item));
- List<Object> touchXList = getTouchXValueLog(item);
- if (null != touchXList) {
- dbKeyDataList.add(touchXList);
- }
- List<Object> touchYList = getTouchYValueLog(item);
- if (null != touchYList) {
- dbKeyDataList.add(touchYList);
- }
- dbKeyDataList.add(getMouseDownEmptyLog(item));
- dbKeyDataList.add(getTouchMouseUPLog(item));
- dbKeyDataList.add(getMouseUpEmptyLog(item));
- return dbKeyDataList;
- }
-
- private List<List<Object>> makeDBDragStartData(List<String> item) {
- List<List<Object>> dbKeyDataList = new ArrayList<List<Object>>();
- dbKeyDataList.add(getTouchFirstLog(item));
- List<Object> touchXList = getTouchXValueLog(item);
- if (null != touchXList) {
- dbKeyDataList.add(touchXList);
- }
- List<Object> touchYList = getTouchYValueLog(item);
- if (null != touchYList) {
- dbKeyDataList.add(touchYList);
- }
- dbKeyDataList.add(getMouseDownEmptyLog(item));
- return dbKeyDataList;
- }
-
- private List<List<Object>> makeDBDragData(List<String> item) {
- List<List<Object>> dbKeyDataList = new ArrayList<List<Object>>();
- List<Object> touchXList = getTouchXValueLog(item);
- if (null != touchXList) {
- dbKeyDataList.add(touchXList);
- }
- List<Object> touchYList = getTouchYValueLog(item);
- if (null != touchYList) {
- dbKeyDataList.add(touchYList);
- }
- dbKeyDataList.add(getMouseDownEmptyLog(item));
- return dbKeyDataList;
- }
-
- private List<List<Object>> makeDBDragEndData(List<String> item) {
- List<List<Object>> dbKeyDataList = new ArrayList<List<Object>>();
- List<Object> touchXList = getTouchXValueLog(item);
- if (null != touchXList) {
- dbKeyDataList.add(touchXList);
- }
- List<Object> touchYList = getTouchYValueLog(item);
- if (null != touchYList) {
- dbKeyDataList.add(touchYList);
- }
- dbKeyDataList.add(getMouseDownEmptyLog(item));
- dbKeyDataList.add(getTouchMouseUPLog(item));
- dbKeyDataList.add(getMouseUpEmptyLog(item));
- return dbKeyDataList;
- }
-
- private List<Object> getTouchFirstLog(List<String> item) {
- String itemMouseDownTime = getDBTime(item.get(MOUSE_DOWN_TIME_TABLE_INDEX));
- DATime mouseDownTime = getDATimeValue(Long.parseLong(itemMouseDownTime));
- List<Object> keyData = new ArrayList<Object>();
- keyData.add(mouseDownTime.getSec() + insertDBRid++);
- keyData.add(tmpSeqForEventLogFormatSize);
- keyData.add(Long.parseLong(itemMouseDownTime));
- keyData.add(mouseDownTime.getSec());
- keyData.add(mouseDownTime.getNano());
- keyData.add(0);
- keyData.add(EVENT_TYPE_TOUCH);
- keyData.add(TOUCH_EVENT_CODE_TOUCH);
- keyData.add(insertkeySequence++);
- return keyData;
- }
-
- private List<Object> getTouchXValueLog(List<String> item) {
- String itemMouseDownTime = getDBTime(item.get(MOUSE_DOWN_TIME_TABLE_INDEX));
- DATime mouseDownTime = getDATimeValue(Long.parseLong(itemMouseDownTime));
- String itemValue1 = item.get(VALUE1_TABLE_INDEX).trim();
- if (itemValue1.length() == 0) {
- return null;
- }
- List<Object> keyData = new ArrayList<Object>();
- keyData.add(mouseDownTime.getSec() + insertDBRid++);
- keyData.add(tmpSeqForEventLogFormatSize);
- keyData.add(Long.parseLong(itemMouseDownTime));
- keyData.add(mouseDownTime.getSec());
- keyData.add(mouseDownTime.getNano());
- keyData.add(0);
- keyData.add(EVENT_TYPE_TOUCH);
- keyData.add(TOUCH_EVENT_CODE_X);
- keyData.add(getDBPoint(itemValue1));
- return keyData;
- }
-
- private List<Object> getTouchYValueLog(List<String> item) {
- String itemMouseDownTime = getDBTime(item.get(MOUSE_DOWN_TIME_TABLE_INDEX));
- DATime mouseDownTime = getDATimeValue(Long.parseLong(itemMouseDownTime));
- String itemValue2 = item.get(VALUE2_TABLE_INDEX).trim();
- if (itemValue2.length() == 0) {
- return null;
- }
- List<Object> keyData = new ArrayList<Object>();
- keyData.add(mouseDownTime.getSec() + insertDBRid++);
- keyData.add(tmpSeqForEventLogFormatSize);
- keyData.add(Long.parseLong(itemMouseDownTime));
- keyData.add(mouseDownTime.getSec());
- keyData.add(mouseDownTime.getNano());
- keyData.add(0);
- keyData.add(EVENT_TYPE_TOUCH);
- keyData.add(TOUCH_EVENT_CODE_Y);
- keyData.add(getDBPoint(itemValue2));
- return keyData;
- }
-
- private List<Object> getMouseDownEmptyLog(List<String> item) {
- String itemMouseDownTime = getDBTime(item.get(MOUSE_DOWN_TIME_TABLE_INDEX));
- DATime mouseDownTime = getDATimeValue(Long.parseLong(itemMouseDownTime));
- List<Object> keyData = new ArrayList<Object>();
- keyData.add(mouseDownTime.getSec() + insertDBRid++);
- keyData.add(tmpSeqForEventLogFormatSize);
- keyData.add(Long.parseLong(itemMouseDownTime));
- keyData.add(mouseDownTime.getSec());
- keyData.add(mouseDownTime.getNano());
- keyData.add(0);
- keyData.add(0);
- keyData.add(0);
- keyData.add(0);
- return keyData;
- }
-
- private List<Object> getMouseUpEmptyLog(List<String> item) {
- String itemMouseUpTime = getDBTime(item.get(MOUSE_UP_TIME_TABLE_INDEX));
- DATime mouseUpTime = getDATimeValue(Long.parseLong(itemMouseUpTime));
- List<Object> keyData = new ArrayList<Object>();
- keyData.add(mouseUpTime.getSec() + insertDBRid++);
- keyData.add(tmpSeqForEventLogFormatSize);
- keyData.add(Long.parseLong(itemMouseUpTime));
- keyData.add(mouseUpTime.getSec());
- keyData.add(mouseUpTime.getNano());
- keyData.add(0);
- keyData.add(0);
- keyData.add(0);
- keyData.add(0);
- return keyData;
- }
-
- private List<Object> getTouchMouseUPLog(List<String> item) {
- String itemMouseDownTime = getDBTime(item.get(MOUSE_DOWN_TIME_TABLE_INDEX));
- String itemMouseUpTime = getDBTime(item.get(MOUSE_UP_TIME_TABLE_INDEX));
- DATime mouseUpTime = getDATimeValue(Long.parseLong(itemMouseUpTime));
- List<Object> keyData = new ArrayList<Object>();
- keyData.add(mouseUpTime.getSec() + insertDBRid++);
- keyData.add(tmpSeqForEventLogFormatSize);
- keyData.add(Long.parseLong(itemMouseDownTime));
- keyData.add(mouseUpTime.getSec());
- keyData.add(mouseUpTime.getNano());
- keyData.add(0);
- keyData.add(EVENT_TYPE_TOUCH);
- keyData.add(TOUCH_EVENT_CODE_TOUCH);
- keyData.add(EVENT_TYPE_TOUCH_DOUSE_UP_VALUE);
- return keyData;
- }
-
- private List<List<String>> getTableItemsList() {
- if (null == tableItemsList) {
- tableItemsList = new ArrayList<List<String>>();
- }
- return tableItemsList;
- }
-
- public void setTableItemsList(DATableComposite replayComp) {
- if (null == tableItemsList) {
- tableItemsList = new ArrayList<List<String>>();
- }
- for (int i = 0; i < replayComp.getTable().getItemCount(); i++) {
- List<String> text = new ArrayList<String>();
- int size = replayComp.getTable().getColumns().length;
- for (int j = 0; j < size + 1; j++) {
- text.add(replayComp.getTable().getItem(i).getText(j));
- }
- tableItemsList.add(text);
- }
- }
-
-}
+++ /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.replayEditor.data;
-
-import org.tizen.dynamicanalyzer.constant.CommonConstants;
-import org.tizen.dynamicanalyzer.nl.ReplayEditLabels;
-
-public class ReplayEditTableData {
- private int eventRid = -1;
- private int eventSeq = -1;
- private long eventMouseDownTime = -1;
- private long eventMouseUpTime = -1;
- private String strEventType = CommonConstants.EMPTY;
- private String strEventValue1 = CommonConstants.EMPTY;
- private String strEventValue2 = CommonConstants.EMPTY;
- private boolean DragEvent = true;
-
- public int getEventSeq() {
- return eventSeq;
- }
-
- public void setEventSeq(int eventSeq) {
- this.eventSeq = eventSeq;
- }
-
- public String getStrEventMouseDownTime() {
- if (eventMouseDownTime < 0) {
- return CommonConstants.EMPTY;
- } else {
- return getStrTableTime(eventMouseDownTime);
- }
- }
-
- public long getLongEventMouseDownTime(){
- return this.eventMouseDownTime;
- }
-
- public void setEventMouseDownTime(long eventMouseDownTime) {
- this.eventMouseDownTime = eventMouseDownTime;
- }
-
- public String getStrEventMouseUpTime() {
- if (eventMouseUpTime < 0) {
- return CommonConstants.EMPTY;
- } else {
- return getStrTableTime(eventMouseUpTime);
- }
- }
-
- private String getStrTableTime(Long time) {
- String reverseStrTime = reverseString(Long.toString(time));
- StringBuffer strTime = new StringBuffer(CommonConstants.EMPTY);
- for (int i = 5; i < reverseStrTime.length(); i++) {
- strTime.append(reverseStrTime.charAt(i));
- if (i == 5) {
- strTime.append(CommonConstants.DOT);
- }
- }
- return reverseString(strTime.toString()) + ReplayEditLabels.CONTEXT_VALUE_S;
- }
-
- private String reverseString(String str) {
- return (new StringBuffer(str).reverse().toString());
- }
-
- public void setEventMouseUpTime(long eventMouseUpTime) {
- this.eventMouseUpTime = eventMouseUpTime;
- }
-
- public long getLongEventMouseUpTime() {
- return this.eventMouseUpTime;
- }
-
- public String getModifiabilityEvent() {
- if (DragEvent) {
- return ReplayEditDataType.MODIFIABILITY_TRUE;
- }else{
- return CommonConstants.EMPTY;
- }
- }
-
- public void setModifiabilityEvent(boolean dragEvent) {
- this.DragEvent = dragEvent;
- }
-
- public String getStrEventType() {
- return strEventType;
- }
-
- public void setStrEventType(String strEventType) {
- this.strEventType = strEventType;
- }
-
- public String getStrEventValue1() {
- return strEventValue1;
- }
-
- public void setStrEventValue1(String strEventValue1) {
- this.strEventValue1 = strEventValue1;
- }
-
- public String getStrEventValue2() {
- return strEventValue2;
- }
-
- public void setStrEventValue2(String strEventValue2) {
- this.strEventValue2 = strEventValue2;
- }
-
- public int getEventRid() {
- return eventRid;
- }
-
- public void setEventRid(int eventRid) {
- this.eventRid = eventRid;
- }
-
-}
+++ /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.replayEditor.data;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.tizen.dynamicanalyzer.constant.CommonConstants;
-import org.tizen.dynamicanalyzer.nl.ReplayEditLabels;
-import org.tizen.dynamicanalyzer.swap.model.data.RecordEventObject;
-import org.tizen.dynamicanalyzer.swap.model.data.ReplayData;
-import org.tizen.dynamicanalyzer.ui.toolbar.replay.data.ReplayDataManager;
-import org.tizen.dynamicanalyzer.util.Logger;
-import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
-
-public class ReplayEditTableDataMaker extends ReplayEditDataType {
- private DACustomButton saveButton = null;
- private DACustomButton okButton = null;
- private static ReplayEditTableDataMaker instance = null;
- private ReplayData replayDBData = null;
- private List<ReplayEditTableData> replayModifyDataList = null;
-
- public static ReplayEditTableDataMaker getInstance() {
- if (null == instance) {
- instance = new ReplayEditTableDataMaker();
- }
- return instance;
- }
-
- public void clean() {
- replayModifyDataList = null;
- replayDBData = null;
- }
-
- public List<ReplayEditTableData> getReplayEditTableData() {
- if (null != replayModifyDataList) {
- return replayModifyDataList;
- }
- replayModifyDataList = makeReplayEditData();
- return replayModifyDataList;
- }
-
- private List<List<RecordEventObject>> makeReplayUnitList() {
- List<List<RecordEventObject>> returnDataList = new ArrayList<List<RecordEventObject>>();
- List<RecordEventObject> unitDataList = new ArrayList<RecordEventObject>();
- if (null == getReplayDBData() || null == getReplayDBData().getRecordEvent()) {
- return returnDataList;
- }
- for (RecordEventObject reo : getReplayDBData().getRecordEvent()) {
- unitDataList.add(reo);
- if (reo.getEventType() == EVENT_TYPE_END_LOG) {
- returnDataList.add(unitDataList);
- unitDataList = new ArrayList<RecordEventObject>();
- }
- }
- return returnDataList;
- }
-
- private List<ReplayEditTableData> makeReplayEditData() {
- List<ReplayEditTableData> returnDataList = new ArrayList<ReplayEditTableData>();
- List<List<RecordEventObject>> replayUnitList = makeReplayUnitList();
- if (null == replayUnitList) {
- return null;
- }
- for (List<RecordEventObject> unitList : replayUnitList) {
- if (isEventMouseUpTime(unitList.get(0))) {
- returnDataList.get(returnDataList.size() - 1).setEventMouseUpTime(
- unitList.get(0).getTime());
- continue;
- }
- ReplayEditTableData itemData = getReplayEditTableData(unitList);
- returnDataList.add(itemData);
- }
- return returnDataList;
- }
-
- private ReplayEditTableData getReplayEditTableData(List<RecordEventObject> unitList) {
- ReplayEditTableData itemData = new ReplayEditTableData();
- for (int i = 0; i < unitList.size(); i++) {
- RecordEventObject reo = unitList.get(i);
- if (isEventEdgeLog(reo)) {
- continue;
- }
- if (i == 0) {
- itemData.setEventMouseDownTime(reo.getTime());
- itemData.setStrEventType(setEventType(reo.getEventType()));
- itemData.setEventRid(reo.getMsgID());
- }
- setItemDataValue(itemData, reo);
- }
- return itemData;
- }
-
- public ReplayData getReplayDBData() {
- if (null != replayDBData) {
- return replayDBData;
- }
- replayDBData = ReplayDataManager.getInstance().getReplayDBManager().getReplayLogs();
- return replayDBData;
- }
-
- public void setReplayDBData(ReplayData replayData) {
- this.replayDBData = replayData;
- }
-
- private boolean isEventEdgeLog(RecordEventObject reo) {
- if (reo.getEventType() == EVENT_TYPE_END_LOG) {
- return true;
- } else {
- return false;
- }
- }
-
- private boolean isEventMouseUpTime(RecordEventObject reo) {
- if (reo.getEventType() == EVENT_TYPE_KEY
- && reo.getEventValue() == EVENT_TYPE_KEY_DOUSE_UP_VALUE) {
- return true;
- } else if (reo.getEventType() == EVENT_TYPE_TOUCH
- && reo.getEventValue() == EVENT_TYPE_TOUCH_DOUSE_UP_VALUE) {
- return true;
- } else {
- return false;
- }
- }
-
- private void setItemDataValue(ReplayEditTableData itemData, RecordEventObject reo) {
- if (reo.getEventType() == EVENT_TYPE_KEY) {
- setEventTypeKeyValue(itemData, reo);
- } else if (reo.getEventType() == EVENT_TYPE_TOUCH) {
- setEventTypeTouchValue(itemData, reo);
- } else {
- Logger.error("Not define event type : " + reo.getEventType());
- }
- }
-
- private void setEventTypeKeyValue(ReplayEditTableData itemData, RecordEventObject reo) {
- itemData.setStrEventValue1(setEventValue1(reo.getEventCode()));
- itemData.setStrEventValue2(CommonConstants.DASH);
- }
-
- private void setEventTypeTouchValue(ReplayEditTableData itemData, RecordEventObject reo) {
- if (reo.getEventCode() == TOUCH_EVENT_CODE_TOUCH) {
- return;
- }
- if (reo.getEventCode() == TOUCH_EVENT_CODE_X) {
- itemData.setStrEventValue1(ReplayEditLabels.CONTEXT_VALUE_X
- + Integer.toString(reo.getEventValue()));
- } else if (reo.getEventCode() == TOUCH_EVENT_CODE_Y) {
- itemData.setStrEventValue2(ReplayEditLabels.CONTEXT_VALUE_Y
- + Integer.toString(reo.getEventValue()));
- } else {
- Logger.error("Not define key event type : " + reo.getEventCode());
- }
- }
-
- private String setEventType(int type) {
- if (type == EVENT_TYPE_KEY) {
- return ReplayEditLabels.CONTEXT_KEY;
- } else if (type == EVENT_TYPE_TOUCH) {
- return ReplayEditLabels.CONTEXT_TOUCH;
- } else {
- Logger.error("Not define set key event type : " + type);
- return CommonConstants.EMPTY;
- }
- }
-
- private String setEventValue1(int type) {
- String strType = CommonConstants.EMPTY;
- switch (type) {
- case KEY_MENU: {
- strType = ReplayEditLabels.CONTEXT_KEY_MENU;
- break;
- }
- case KEY_HOME: {
- strType = ReplayEditLabels.CONTEXT_KEY_HOME;
- break;
- }
- case KEY_BACK: {
- strType = ReplayEditLabels.CONTEXT_KEY_BACK;
- break;
- }
- case KEY_POWER: {
- strType = ReplayEditLabels.CONTEXT_KEY_POWER;
- break;
- }
- case KEY_VOLUME_DOWN: {
- strType = ReplayEditLabels.CONTEXT_KEY_VOLUME_DOWN;
- break;
- }
- case KEY_VOLUME_UP: {
- strType = ReplayEditLabels.CONTEXT_KEY_VOLUME_UP;
- break;
- }
- default: {
- }
- }
- return strType;
- }
-
- public DACustomButton getSaveButton() {
- return saveButton;
- }
-
- public void setSaveButton(DACustomButton saveButton) {
- this.saveButton = saveButton;
- }
-
- public DACustomButton getOkButton() {
- return okButton;
- }
-
- public void setOkButton(DACustomButton okButton) {
- this.okButton = okButton;
- }
-
-}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Heeyoung Hwang <heeyoung1008.hwang@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.ui.toolbar.setting;
-
-import org.eclipse.nebula.widgets.grid.Grid;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.ControlListener;
-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.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
-import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
-import org.tizen.dynamicanalyzer.nl.WidgetLabels;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.resources.FontResources;
-import org.tizen.dynamicanalyzer.setting.SettingDataManager;
-import org.tizen.dynamicanalyzer.setting.Template;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
-import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
-import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
-import org.tizen.dynamicanalyzer.widgets.da.base.DAButton;
-import org.tizen.dynamicanalyzer.widgets.da.base.DAMessageBox;
-
-public class FeatureDialog extends DAMessageBox {
- private DATableComposite featuresTable = null;
-
- int[] sortTypes = { AnalyzerConstants.SORT_TYPE_GRID };
- private String[] columnNames = { ConfigureLabels.FEATURE_DIALOG_FEATURE_TABLE_COLUMN_NAME };
- private int[] columnSizes = { 571 };
- private boolean[] columnVisibility = { true };
-
- private DAButton okButton = null;
- private DAButton cancelButton = null;
-
- public FeatureDialog(Shell parentShell) {
- super(parentShell);
- }
-
- private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {
-
- @Override
- public void handleClickEvent(DACustomButton button) {
- // check feature change
- Grid table = ((FeatureDialogFeaturesTable) featuresTable).getTable();
- if (SettingDialogManager.INSTANCE.validInputText(table) &&
- SettingDialogManager.INSTANCE.changedFeaturesFromTableItemsList(table)) {
- // set custom template
- SettingDataManager.INSTANCE.getTarget(null).setSelectedTemplate(
- Template.TEMPLATE_CUSTOM);
-
- // apply selected feature
- SettingDialogManager.INSTANCE.setFeaturesValueFromTableItemsList(table);
-
- // update template view
- setResult(Boolean.valueOf(true));
- }
- shell.dispose(); // close dialog
- }
- };
-
- private DACustomButtonClickEventListener cancelButtonListener = new DACustomButtonClickEventListener() {
-
- @Override
- public void handleClickEvent(DACustomButton button) {
- shell.dispose(); // close dialog
- }
- };
-
- private SelectionListener featureTableSelectionListener = new SelectionListener() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- // do nothing
- }
-
- @Override
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
- };
-
- private MouseListener mouseListener = new MouseListener() {
-
- @Override
- public void mouseUp(MouseEvent e) {
- // do nothing
- }
-
- @Override
- public void mouseDown(MouseEvent e) {
- // check feature change
- Grid table = ((FeatureDialogFeaturesTable) featuresTable).getTable();
- if (SettingDialogManager.INSTANCE.validInputText(table) &&
- SettingDialogManager.INSTANCE.changedFeaturesFromTableItemsList(table)) {
- okButton.setButtonEnabled(true);
- } else {
- okButton.setButtonEnabled(false);
- }
- }
-
- @Override
- public void mouseDoubleClick(MouseEvent e) {
- // do nothing
- }
- };
-
- public void enableButteon() {
- okButton.setButtonEnabled(true);
- cancelButton.setButtonEnabled(true);
- }
-
- public void diableButteon() {
- okButton.setButtonEnabled(false);
- cancelButton.setButtonEnabled(true);
- }
-
- protected boolean run() {
- // shell.setSize(446, 424);
- shell.setSize(610, 520);
- shell.setLayout(new FormLayout());
- shell.setText(ConfigureLabels.FEATURE_DIALOG_HEADER_TITLE);
- shell.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
-
- Composite tableComp = new Composite(shell, SWT.NONE);
- FormLayout compLayout = new FormLayout();
- tableComp.setLayout(compLayout);
- tableComp.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
-
- 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, -51);
- tableComp.setLayoutData(compData);
-
- tableComp.addPaintListener(new PaintListener() {
-
- @Override
- public void paintControl(PaintEvent e) {
- Rectangle r = new Rectangle(6, 35, 432, 294);
- e.gc.setForeground(ColorResources.SETTING_STROKE);
- e.gc.drawRectangle(r);
- }
- });
-
- // Title
- Label tableTitle = new Label(tableComp, SWT.TRANSPARENT);
- tableTitle.setText(ConfigureLabels.FEATURE_DIALOG_DESCRIPTION);
- tableTitle.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
- tableTitle.setForeground(ColorResources.DEFAULT_FONT_COLOR);
- tableTitle.setFont(FontResources.SETTING_TITLE_FONT);
-
- FormData data = new FormData();
- data.top = new FormAttachment(0, 17);
- data.left = new FormAttachment(0, 8);
- data.width = 432;
- data.height = 18;
- tableTitle.setLayoutData(data);
-
- // Table
- featuresTable = new FeatureDialogFeaturesTable(tableComp, SWT.BORDER | SWT.V_SCROLL
- | SWT.SINGLE | SWT.NO_FOCUS);
- featuresTable.setTree(true);
- featuresTable.setItemHeightSize(22);
- featuresTable.setTableName(ConfigureLabels.FEATURE_DIALOG_DESCRIPTION);
- featuresTable.setSortTypes(sortTypes);
- featuresTable.setColumns(columnNames);
- featuresTable.setColumnSize(columnSizes);
- featuresTable.setColumnVisibility(columnVisibility);
- featuresTable.setTableToolTipEnable(false);
- featuresTable.getTable().addSelectionListener(featureTableSelectionListener);
- featuresTable.getTable().addMouseListener(mouseListener);
- data = new FormData();
- data.top = new FormAttachment(0, 36);
- data.left = new FormAttachment(0, 7);
- data.right = new FormAttachment(100, -6);
- data.bottom = new FormAttachment(100, -14);
- featuresTable.setLayoutData(data);
-
- featuresTable.addControlListener(new ControlListener() {
- @Override
- public void controlResized(ControlEvent e) {
- Rectangle r = featuresTable.getClientArea();
- int size = r.width;
- columnSizes[0] = size;
- featuresTable.setColumnSize(columnSizes);
- featuresTable.redraw();
- }
-
- @Override
- public void controlMoved(ControlEvent e) {
- }
- });
-
- // button
- Composite buttonContentsComp = new Composite(shell, SWT.NONE);
- compLayout = new FormLayout();
- buttonContentsComp.setLayout(compLayout);
- buttonContentsComp
- .setBackground(ColorResources.CONFIGURATION_BUTTON_COVER_BACKGROUND_COLOR);
- compData = new FormData();
- compData.top = new FormAttachment(tableComp, 0);
- compData.left = new FormAttachment(0, 0);
- compData.right = new FormAttachment(100, 0);
- compData.bottom = new FormAttachment(100, 0);
- buttonContentsComp.setLayoutData(compData);
- SettingDialogManager.INSTANCE.setFeatureDlg(this);
- buttonContentsComp.addPaintListener(new PaintListener() {
-
- @Override
- public void paintControl(PaintEvent e) {
- Composite comp = (Composite) e.widget;
- Rectangle rect = comp.getClientArea();
- e.gc.setForeground(ColorResources.SETTING_SUNKEN_LINE_1);
- e.gc.drawLine(0, 0, rect.width - 1, 0);
- e.gc.setForeground(ColorResources.SETTING_SUNKEN_LINE_2);
- e.gc.drawLine(0, 1, rect.width - 1, 1);
- }
- });
-
- cancelButton = new DAButton(buttonContentsComp, SWT.NONE);
- cancelButton.addClickListener(cancelButtonListener);
- cancelButton.setText(WidgetLabels.CANCEL);
- cancelButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT);
- FormData buttonData = new FormData();
- // buttonData.right = new FormAttachment(100, -119);
- buttonData.right = new FormAttachment(100, -200);
- buttonData.top = new FormAttachment(0, 13);
- buttonData.width = 100;
- buttonData.height = 28;
- cancelButton.setLayoutData(buttonData);
-
- okButton = new DAButton(buttonContentsComp, SWT.NONE);
- okButton.addClickListener(okButtonListener);
- okButton.setText(WidgetLabels.OK);
- okButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT);
- buttonData = new FormData();
- buttonData.right = new FormAttachment(cancelButton, -8);
- buttonData.top = new FormAttachment(0, 13);
- buttonData.width = 100;
- buttonData.height = 28;
- okButton.setLayoutData(buttonData);
- okButton.setButtonEnabled(false);
-
- featuresTable.updateTable();
- shell.open();
- return true;
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Heeyoung Hwang <heeyoung1008.hwang@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.ui.toolbar.setting;
-
-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.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.tizen.dynamicanalyzer.common.DAState;
-import org.tizen.dynamicanalyzer.constant.CommonConstants;
-import org.tizen.dynamicanalyzer.model.FilterProperty;
-import org.tizen.dynamicanalyzer.model.TreeInput;
-import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.resources.ImageResources;
-import org.tizen.dynamicanalyzer.setting.Feature;
-import org.tizen.dynamicanalyzer.setting.FeatureData;
-import org.tizen.dynamicanalyzer.setting.SettingConstants;
-import org.tizen.dynamicanalyzer.setting.SettingDataManager;
-import org.tizen.dynamicanalyzer.setting.TargetData;
-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.util.Logger;
-import org.tizen.dynamicanalyzer.widgets.tooltip.DACustomTooltip;
-
-public class FeatureDialogFeaturesTable extends DATreeComposite {
- private static final int tableTextOptionColumnIndex = 1;
-
- // row detail information
- public static final String ITEM_PARENT_FEATURE_NAME_ITEM = ", parent_feature_name_";//$NON-NLS-1$
- public static final String ITEM_ALL_CHECKED = ", item_all_checked ";//$NON-NLS-1$
- public static final String ITEM_PART_CHECKED = ", item_part_checked ";//$NON-NLS-1$
- public static final String FEATURE_OPTION_VALUE = ", feature_option_value ";//$NON-NLS-1$
- public static final String FEATURE_INVALID_VALUE = ", feature_invalid_value ";//$NON-NLS-1$
-
- public FeatureDialogFeaturesTable(Composite parent, int style) {
- super(parent, style);
-
- table.setLinesVisible(false);
- table.addListener(SWT.Dispose, tableMouseListener);
- table.addListener(SWT.MouseEnter, tableMouseListener);
- table.addListener(SWT.MouseExit, tableMouseListener);
- table.addListener(SWT.MouseMove, tableMouseListener);
- table.addListener(SWT.MouseHover, tableMouseListener);
- table.addListener(SWT.MouseUp, tableMouseListener);
- table.addListener(SWT.MouseDown, tableMouseListener);
- table.addListener(SWT.MouseDoubleClick, tableMouseListener);
- setTableToolTipListener(); // set table tooltip listener
- }
-
- private void setTableToolTipListener() {
- table.addListener(SWT.MouseEnter, tableTooltipListener);
- table.addListener(SWT.MouseExit, tableTooltipListener);
- table.addListener(SWT.MouseMove, tableTooltipListener);
- }
-
- // tooltip
- private DACustomTooltip tooltip = new DACustomTooltip() {
-
- @Override
- public void setTooltipMessage() {
- tooltipMessage.clear();
- FeatureData feature = Feature.getFeature(getSelectedItem()).getData();
- String message = feature.getOverheadRankingMessage();
- if ((null != message) && (!message.isEmpty())) {
- tooltipMessage.add(message);
- setFontColor(feature.getOverheadRankingFontColor());
- }
- }
-
- @Override
- public void setTooltipMessage(String name) {
- // TODO Auto-generated method stub
-
- }
- };
-
- private Listener tableTooltipListener = new Listener() {
-
- @Override
- public void handleEvent(Event event) {
- // tooltip open and move
- if (event.type == SWT.MouseEnter || event.type == SWT.MouseMove) {
- // get table item
- GridItem item = table.getItem(new Point(event.x, event.y));
- if (null == item) {
- return;
- }
-
- // check checkbox
- if (DAState.isStartable()) {
- if (isClickCheckBox(item, event)) {
- tooltip.setSeletedItem(item.getText());
- tooltip.openAndMove(table.getShell());
- } else {
- tooltip.setSeletedItem(null);
- tooltip.close();
- }
- }
- }
-
- // tooltip close
- if (event.type == SWT.MouseExit) {
- tooltip.close();
- }
- }
- };
-
- @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 FeatureDialogFeaturesTreeTableCellRenderer(table));
- DATableHeaderRenderer header = new DATableHeaderRenderer(SWT.LEFT);
- header.setBgColor(ColorResources.SETTING_TABLE_HEADER_BG);
- header.setFontColor(ColorResources.SETTING_TABLE_HEADER_FONT_COLOR);
- column.setHeaderRenderer(header);
-
- if (i == 0) {
- column.setTree(true);
- }
- column.pack();
- }
- }
-
- /**
- * Creates an TreeInput Object for the feature.
- *
- * @param feature feature information
- * @return The resulting TreeInput object
- */
- private TreeInput makeInput(FeatureData feature) {
- DATableDataFormat tableData = new DATableDataFormat(0);
- List<String> text = new ArrayList<String>();
- String featureName = feature.getFeatureName();
- text.add(featureName);
-
- TargetData target = SettingDataManager.INSTANCE.getTarget(null);
- StringBuffer optionColumn = new StringBuffer();
-
- // check selected feature : , item_all_checked
- if (target.isSelectedFeature(feature.getKey()) == true) {
- optionColumn.append(ITEM_ALL_CHECKED);
- } else {
- optionColumn.append(CommonConstants.EMPTY);
- }
-
- // check parent feature : , parent_feature_name_xxx
- if (feature.getParentIndex() > 0) {
- String parentFeatureName = Feature.getFeature(feature.getParentIndex()).getName();
- optionColumn.append(ITEM_PARENT_FEATURE_NAME_ITEM + parentFeatureName);
- }
-
- // check option feature : , feature_option_value "xxx"
- if (feature.getFeatureType() == SettingConstants.FEATURE_TYPE_DETAIL) {
- String optionText = getDetailFeatureOptionText(featureName);
- if (optionText != null) {
- optionColumn.append(FEATURE_OPTION_VALUE + optionText);
- }
- }
-
- text.add(optionColumn.toString());
- TreeInput outPut = new TreeInput();
- outPut.setText(text);
- outPut.setData(tableData);
- return outPut;
- }
-
- @Override
- public List<TreeInput> makeTreeInput() {
- List<TreeInput> output = new ArrayList<TreeInput>();
- TargetData target = SettingDataManager.INSTANCE.getTarget(null);
-
- List<Feature> featureList = target.getAvailableFeatureList();
- for (int i = 0; i < featureList.size(); i++) {
- FeatureData feature = featureList.get(i).getData();
-
- // check exist current feature node
- if (!existTreeInput(output, feature.getFeatureName())) {
- // create current feature node
- TreeInput currentNode = makeInput(feature);
-
- // check exist parent feature
- if (feature.getParentIndex() <= 0) {
- output.add(currentNode);
- } else {
- String parentFeatureName = Feature.getFeature(feature.getParentIndex())
- .getName();
- // check exist parent feature node
- if (!existTreeInput(output, parentFeatureName)) {
- // create parent feature node
- TreeInput parentNode = makeInput(Feature.getFeature(
- feature.getParentIndex()).getData());
- output.add(parentNode);
- parentNode.getChildren().add(currentNode);
-
- } else {
- TreeInput parentTreeInput = getTreeInput(output, parentFeatureName);
- if (parentTreeInput != null) {
- parentTreeInput.getChildren().add(currentNode);
- }
- }
- }
- }
- }
-
- updateParentFeatureCheckStatus(output);
- return output;
- }
-
- private boolean existTreeInput(List<TreeInput> list, String featureName) {
- for (int j = 0; j < list.size(); j++) {
- String name = (String) list.get(j).getText().get(0);
- if (name.equals(featureName)) {
- return true;
- }
- }
- return false;
- }
-
- private TreeInput getTreeInput(List<TreeInput> list, String featureName) {
- for (int j = 0; j < list.size(); j++) {
- String name = (String) list.get(j).getText().get(0);
- if (name.equals(featureName)) {
- return list.get(j);
- }
- }
- return null;
- }
-
- private String getDetailFeatureOptionText(String featureName) {
- if (featureName.equals(ConfigureLabels.FEATURE_DETAIL_VALUE_SYSTEM_SAMPLING_RATE)
- || featureName.equals(ConfigureLabels.FEATURE_DETAIL_VALUE_FUNCTION_SAMPLING_RATE)) {
- return getSystemOptionText(featureName);
- } else {
- Logger.debug("the feature is not an option. " + featureName);
- }
-
- return null;
- }
-
- private String getSystemOptionText(String featureName) {
- StringBuffer optionValue = new StringBuffer();
- TargetData target = SettingDataManager.INSTANCE.getTarget(null);
-
- FeatureData feature = Feature.getFeature(featureName).getData();
- int selectedValue = target.getSelectedFeatureValue(feature.getKey());
- int defaultValue = feature.getDefaultValue();
-
- if (selectedValue > 0) {
- optionValue.append(ConfigureLabels.SAMPLING + Integer.toString(selectedValue));
- } else {
- optionValue.append(ConfigureLabels.SAMPLING + Integer.toString(defaultValue));
- }
- return optionValue.toString();
- }
-
- private Listener tableMouseListener = new Listener() {
- @Override
- public void handleEvent(Event event) {
- final int MOUSE_LEFT = 1;
- final int MOUSE_RIGHT = 3;
- GridItem item = table.getItem(new Point(event.x, event.y));
- if (null == item) {
- return;
- }
- switch (event.type) {
- case SWT.Dispose:
- break;
- case SWT.MouseEnter:
- break;
- case SWT.MouseExit:
- break;
- case SWT.MouseMove:
- break;
- case SWT.MouseDoubleClick:
- break;
- case SWT.MouseHover:
- break;
- case SWT.MouseUp:
- break;
- case SWT.MouseDown:
- switch (event.button) {
- case MOUSE_LEFT: {
- if (DAState.isStartable()) {
- if (isClickCheckBox(item, event)) {
- updateCheckBox(item, event);
- updateChildCheckBoxByParent(item, event);
- updateParentCheckBoxByChild(item, event);
-
- if (item.hasChildren() && isCheckStatus(item)) {
- item.setExpanded(true);
- }
- }
- }
- break;
- }
- case MOUSE_RIGHT: {
- break;
- }
- default: {
- break;
- }
- }
- break;
- default:
- break;
- }
- }
- };
-
- // TODO:refactoring about the legacy code.
- private void updateParentFeatureCheckStatus(List<TreeInput> output) {
- for (int i = 0; i < output.size(); i++) {
- TreeInput treeData = output.get(i);
- if (treeData.getChildren().size() > 0) {
- int childCheckedCount = 0;
- int childUnCheckedCount = 0;
- for (int j = 0; j < treeData.getChildren().size(); j++) {
- if (treeData.getChildren().get(j).getText().get(1)
- .contains(ITEM_ALL_CHECKED)) {
- childCheckedCount++;
- } else {
- childUnCheckedCount++;
- }
- }
-
- if (childCheckedCount > 0 && childUnCheckedCount == 0) {
- setCheckStatus(treeData, ITEM_ALL_CHECKED);
- } else if (childCheckedCount > 0 && childUnCheckedCount > 0) {
- setCheckStatus(treeData, ITEM_PART_CHECKED);
- } else if (childCheckedCount == 0 && childUnCheckedCount > 0) {
- setCheckStatus(treeData, CommonConstants.EMPTY);
- }
- }
-
- }
- }
-
- // TODO:refactoring about the legacy code.
- private boolean isClickCheckBox(GridItem item, Event event) {
- String optionText = item.getText(tableTextOptionColumnIndex);
- int checkImgX = 0;
- if (!optionText.contains(ITEM_PARENT_FEATURE_NAME_ITEM)) {
- checkImgX = 20;
- } else {
- checkImgX = 40;
- }
- int checkImgWidth = ImageResources.CHECKBOX_SELECTED.getBounds().width;
- if ((checkImgX <= event.x) && (event.x <= checkImgX + checkImgWidth + 10)) {
- return true;
- }
- return false;
- }
-
- // TODO:refactoring about the legacy code.
- private void updateCheckBox(GridItem item, Event event) {
- String optionText = item.getText(tableTextOptionColumnIndex);
- if (optionText.contains(ITEM_PART_CHECKED)) {
- optionText = item.getText(tableTextOptionColumnIndex).replace(
- ITEM_PART_CHECKED, CommonConstants.EMPTY);
- }
- if (optionText.contains(ITEM_ALL_CHECKED)) {
- optionText = item.getText(tableTextOptionColumnIndex).replace(
- ITEM_ALL_CHECKED, CommonConstants.EMPTY);
- } else {
- optionText += ITEM_ALL_CHECKED;
- }
- item.setText(tableTextOptionColumnIndex, optionText);
- }
-
-
- // TODO:refactoring about the legacy code.
- private void updateChildCheckBoxByParent(GridItem item, Event event) {
- String featureName = item.getText(0);
-
- String optionText = item.getText(tableTextOptionColumnIndex);
- if (!optionText.contains(ITEM_PARENT_FEATURE_NAME_ITEM)) {
- for (int i = 0; i < table.getItemCount(); i++) {
- FeatureData feature = Feature.getFeature(table.getItem(i).getText(0)).getData();
- Feature parentFeature = Feature.getFeature(feature.getParentIndex());
- if (parentFeature != null) {
- String parentFeatureName = parentFeature.getName();
-
- if (featureName.equals(parentFeatureName)) {
- if (optionText.contains(ITEM_ALL_CHECKED)) {
- setCheckStatus(table.getItem(i), ITEM_ALL_CHECKED);
- } else {
- setCheckStatus(table.getItem(i), CommonConstants.EMPTY);
- }
- }
- }
- }
- }
- }
-
- // TODO:refactoring about the legacy code.
- private void updateParentCheckBoxByChild(GridItem item, Event event) {
- String featureName = item.getText(0);
- FeatureData feature = Feature.getFeature(item.getText(0)).getData();
- Feature parentFeature = Feature.getFeature(feature.getParentIndex());
- if (parentFeature != null) {
- String parentFeatureName = parentFeature.getName();
-
- int parentIndex = -1;
- int childCheckedCount = 0;
- int childUnCheckedCount = 0;
- for (int i = 0; i < table.getItemCount(); i++) {
- featureName = table.getItem(i).getText(0);
- if (featureName.equals(parentFeatureName)) {
- parentIndex = i;
- continue;
- }
- if (parentIndex > -1) {
- FeatureData tableFeature = Feature.getFeature(featureName).getData();
- if (tableFeature.getParentIndex() == feature.getParentIndex()) {
- if (table.getItem(i).getText(1).contains(ITEM_ALL_CHECKED)) {
- childCheckedCount++;
- } else {
- childUnCheckedCount++;
- }
- }
- }
- }
- if (childCheckedCount > 0 && childUnCheckedCount == 0) {
- setCheckStatus(table.getItem(parentIndex), ITEM_ALL_CHECKED);
- } else if (childCheckedCount > 0 && childUnCheckedCount > 0) {
- setCheckStatus(table.getItem(parentIndex), ITEM_PART_CHECKED);
- } else if (childCheckedCount == 0 && childUnCheckedCount > 0) {
- setCheckStatus(table.getItem(parentIndex), CommonConstants.EMPTY);
- }
- }
- }
-
- // TODO:refactoring about the legacy code.
- private void setCheckStatus(TreeInput item, String status) {
- String optionText = item.getText().get(tableTextOptionColumnIndex);
- if (optionText.contains(ITEM_ALL_CHECKED)) {
- optionText = item.getText().get(tableTextOptionColumnIndex)
- .replace(ITEM_ALL_CHECKED, CommonConstants.EMPTY);
- } else if (optionText.contains(ITEM_PART_CHECKED)) {
- optionText = item.getText().get(tableTextOptionColumnIndex)
- .replace(ITEM_PART_CHECKED, CommonConstants.EMPTY);
- }
-
- if (status.contains(ITEM_ALL_CHECKED)) {
- optionText += ITEM_ALL_CHECKED;
- } else if (status.contains(ITEM_PART_CHECKED)) {
- optionText += ITEM_PART_CHECKED;
- }
- item.getText().set(tableTextOptionColumnIndex, optionText);
- }
-
- // TODO:refactoring about the legacy code.
- private void setCheckStatus(GridItem item, String status) {
- String optionText = item.getText(tableTextOptionColumnIndex);
- if (optionText.contains(ITEM_ALL_CHECKED)) {
- optionText = item.getText(tableTextOptionColumnIndex).replace(
- ITEM_ALL_CHECKED, CommonConstants.EMPTY);
- } else if (optionText.contains(ITEM_PART_CHECKED)) {
- optionText = item.getText(tableTextOptionColumnIndex).replace(
- ITEM_PART_CHECKED, CommonConstants.EMPTY);
- }
-
- if (status.contains(ITEM_ALL_CHECKED)) {
- optionText += ITEM_ALL_CHECKED;
- } else if (status.contains(ITEM_PART_CHECKED)) {
- optionText += ITEM_PART_CHECKED;
- }
-
- item.setText(tableTextOptionColumnIndex, optionText);
- }
-
- private boolean isCheckStatus(GridItem item) {
- String optionText = item.getText(tableTextOptionColumnIndex);
- if (optionText.contains(ITEM_ALL_CHECKED)
- || optionText.contains(ITEM_PART_CHECKED)) {
- return true;
- }
- return false;
- }
-}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Heeyoung Hwang <heeyoung1008.hwang@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.ui.toolbar.setting;
-
-import org.eclipse.nebula.widgets.grid.Grid;
-import org.eclipse.nebula.widgets.grid.GridItem;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.GC;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DATableCellRenderer;
-
-public class FeatureDialogFeaturesTreeTableCellRenderer extends DATableCellRenderer {
-
- private static final int LEFT_MARGIN = 4;
- private Grid table = null;
-
- public FeatureDialogFeaturesTreeTableCellRenderer(Grid table) {
- this.table = table;
- }
-
- public void setTree(boolean tree) {
- super.setTree(tree);
- if (tree) {
- toggleRenderer = new FeatureDialogFeaturesTreeTableToggleRenderer(table);
- toggleRenderer.setDisplay(getDisplay());
- }
- }
-
- @Override
- public void paint(GC gc, Object value) {
- GridItem item = (GridItem) value;
- gc.setFont(item.getFont(getColumn()));
-
- // paint background
- paintBackground(gc, item);
-
- // draw table row
- int x = LEFT_MARGIN;
- x += item.getLevel() * 20;
- toggleRenderer.setLocation(getBounds().x + x,
- (getBounds().height - toggleRenderer.getBounds().height) / 2 + getBounds().y);
- toggleRenderer.paint(gc, item);
- }
-
- private void paintBackground(GC gc, GridItem item) {
- // background color
- Color color = null;
- if (item.getLevel() == 0) {
- color = ColorResources.SETTING_TABLE_CONTENTS_PARENT;
- } else {
- color = ColorResources.SETTING_TABLE_CONTENTS_CHILD;
- }
- gc.setBackground(color);
- gc.fillRectangle(getBounds().x, getBounds().y, getBounds().width, getBounds().y + getBounds().height);
-
- // font color
- gc.setForeground(ColorResources.SETTING_TABLE_CONTENTS_FONT_COLOR);
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Heeyoung Hwang <heeyoung1008.hwang@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.toolbar.setting;
-
-import org.eclipse.nebula.widgets.grid.Grid;
-import org.eclipse.nebula.widgets.grid.GridEditor;
-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.VerifyEvent;
-import org.eclipse.swt.events.VerifyListener;
-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.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.DAState;
-import org.tizen.dynamicanalyzer.constant.CommonConstants;
-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.setting.Feature;
-import org.tizen.dynamicanalyzer.setting.FeatureData;
-import org.tizen.dynamicanalyzer.setting.SettingConstants;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DATableToggleRenderer;
-import org.tizen.dynamicanalyzer.widgets.da.base.DATextBox;
-
-public class FeatureDialogFeaturesTreeTableToggleRenderer extends DATableToggleRenderer {
- private static final int intevalSize = 15;
- private Grid table = null;
-
- // System detail widget
- private Composite detailSystemComposit = null;
- private Label systemTitle = null;
- private DATextBox systemTextBox = null;
- private Label systemTextBoxLabel = null;
- private Label systemInfo = null;
- private GridEditor systemEditor = null;
-
- // Sampling detail widget
- private Composite detailSamplingComposit = null;
- private Label samplingTitle = null;
- private DATextBox samplingTextBox = null;
- private Label samplingTextBoxLabel = null;
- private Label samplingInfo = null;
- private GridEditor samplingEditor = null;
-
- public FeatureDialogFeaturesTreeTableToggleRenderer(Grid table) {
- super();
- setSize(11, 9);
- this.table = table;
-
- // init widget
- initSystemDetailWidget();
- initSamplingDetailWidget();
- }
-
- // TODO:refactoring about the legacy code.
- public void paint(GC gc, Object value) {
- GridItem item = (GridItem) value;
-
- Font font = item.getFont(0);
- if (null == font) {
- gc.setFont(FontResources.TABLE_CELL_FONT);
- } else {
- gc.setFont(font);
- }
-
- // parent feature
- if (item.hasChildren()) {
- // draw tree image
- Image treeFoldImg = null;
- if (item.isExpanded()) {
- treeFoldImg = ImageResources.TREE_OPEN;
- } else {
- treeFoldImg = ImageResources.TREE_FOLD;
- }
-
- int foldImgOffset = (getBounds().width - ImageResources.TREE_OPEN.getBounds().width) / 2;
- int x = getBounds().x + foldImgOffset;
- gc.drawImage(treeFoldImg, 5, getBounds().y);
-
- // draw checkBox image
- Image checkImg = null;
- if (item.getText(1).contains(FeatureDialogFeaturesTable.ITEM_ALL_CHECKED)
- || item.getText(1).contains(FeatureDialogFeaturesTable.ITEM_PART_CHECKED)) {
- checkImg = ImageResources.CHECKBOX_SELECTED;
- // } else if (item.getText(1).contains(
- // FeatureDialog.ITEM_PART_CHECKED)) {
- // checkImg = ImageResources.CHECKBOX_SELECTED_PART;
- } else {
- checkImg = ImageResources.CHECKBOX_UNSELECTED;
- }
-
- Rectangle checkImgRect = ImageResources.CHECKBOX_SELECTED.getBounds();
- x += intevalSize;
- gc.drawImage(checkImg, x, getBounds().y - 3);
- x += checkImgRect.width + intevalSize;
-
- // draw text : feature name
- gc.drawText(item.getText(), x, getBounds().y - 2, true);
-
- } else { // child feature
- Rectangle r = ImageResources.TREE_OPEN.getBounds();
- int offset = (getBounds().width - r.width) / 2;
- int x = getBounds().x + offset;
-
- // detail feature
- if (isDetailFeature(item) == true) {
- updateDetails(item);
- } else { // sub feature
- // draw checkBox image
- Image checkImg = null;
- if (item.getText(1).contains(FeatureDialogFeaturesTable.ITEM_ALL_CHECKED)) {
- checkImg = ImageResources.CHECKBOX_SELECTED;
- } else if (item.getText(1).contains(FeatureDialogFeaturesTable.ITEM_PART_CHECKED)) {
- checkImg = ImageResources.CHECKBOX_SELECTED_PART;
- } else {
- checkImg = ImageResources.CHECKBOX_UNSELECTED;
- }
- Rectangle checkImgRect = ImageResources.CHECKBOX_SELECTED.getBounds();
- x += intevalSize;
- gc.drawImage(checkImg, x, getBounds().y - 3);
- x += checkImgRect.width + intevalSize;
-
- // draw text : feature name
- gc.drawText(item.getText(), x, getBounds().y - 2, true);
- }
- }
- }
-
- private boolean isDetailFeature(GridItem item) {
- FeatureData feature = Feature.getFeature(item.getText()).getData();
- if (SettingConstants.FEATURE_TYPE_DETAIL == feature.getFeatureType()) {
- return true;
- }
- return false;
- }
-
- private void updateDetails(GridItem item) {
- if (ConfigureLabels.FEATURE_DETAIL_VALUE_SYSTEM_SAMPLING_RATE.equals(item.getText())) {
- updateSystemDetails(item);
- } else if (ConfigureLabels.FEATURE_DETAIL_VALUE_FUNCTION_SAMPLING_RATE.equals(item
- .getText())) {
- updateSamplingDetails(item);
- }
- }
-
- private void initSystemDetailWidget() {
- // composite
- detailSystemComposit = new Composite(table, SWT.NONE);
- detailSystemComposit.setLayout(new FormLayout());
- detailSystemComposit.setBackground(ColorResources.SETTING_TABLE_CONTENTS_CHILD);
-
- // label
- systemTitle = new Label(detailSystemComposit, SWT.TRANSPARENT);
- systemTitle.setText(ConfigureLabels.SAMPLING);
- FormData data = new FormData();
- data.top = new FormAttachment(0, 5);
- data.left = new FormAttachment(0, 0);
- data.width = 90;
- data.height = 16;
- systemTitle.setLayoutData(data);
- systemTitle.setForeground(ColorResources.SETTING_COLOR);
- systemTitle.setFont(FontResources.SETTING_DESCRIPTION_FONT);
- systemTitle.setBackground(ColorResources.SETTING_TABLE_CONTENTS_CHILD);
-
- // text box
- systemTextBox = new DATextBox(detailSystemComposit, SWT.SINGLE);
- data = new FormData();
- data.top = new FormAttachment(0, 4);
- data.left = new FormAttachment(systemTitle, 5);
- data.width = 50;
- data.height = 13;
- systemTextBox.setLayoutData(data);
- systemTextBox.setForeground(ColorResources.SETTING_COLOR);
- systemTextBox.setFont(FontResources.SETTING_DESCRIPTION_FONT);
- systemTextBox.getControl().addKeyListener(systemKeyListener);
- systemTextBox.setTextTooltip(true);
- systemTextBox.setTextTooltipMessage(ConfigureLabels.FEATURE_OVERHEAD_RANKING_INPUT_VALUE);
- systemTextBox.getControl().addVerifyListener(new VerifyListener() {
- public void verifyText(VerifyEvent e) {
- e.doit = e.text.matches("[0-9]*");
- }
- });
-
- // label
- systemTextBoxLabel = new Label(detailSystemComposit, SWT.TRANSPARENT);
- systemTextBoxLabel.setText(ConfigureLabels.MS);
- data = new FormData();
- data.top = new FormAttachment(0, 5);
- data.left = new FormAttachment(systemTextBox.getControl(), 5);
- data.width = 30;
- data.height = 16;
- systemTextBoxLabel.setLayoutData(data);
- systemTextBoxLabel.setForeground(ColorResources.SETTING_COLOR);
- systemTextBoxLabel.setFont(FontResources.SETTING_DESCRIPTION_FONT);
- systemTextBoxLabel.setBackground(ColorResources.SETTING_TABLE_CONTENTS_CHILD);
-
- // waring label
- systemInfo = new Label(detailSystemComposit, SWT.TRANSPARENT);
- data = new FormData();
- data.top = new FormAttachment(0, 5);
- data.left = new FormAttachment(systemTextBoxLabel, 5);
- data.width = 250;
- data.height = 16;
- systemInfo.setLayoutData(data);
- systemInfo.setForeground(ColorResources.SETTING_WARNING_FONT_COLOR);
- systemInfo.setFont(FontResources.SETTING_DESCRIPTION_FONT);
- systemInfo.setBackground(ColorResources.SETTING_TABLE_CONTENTS_CHILD);
- }
-
- private void initSamplingDetailWidget() {
- // composite
- detailSamplingComposit = new Composite(table, SWT.NONE);
- detailSamplingComposit.setLayout(new FormLayout());
- detailSamplingComposit.setBackground(ColorResources.SETTING_TABLE_CONTENTS_CHILD);
-
- // label
- samplingTitle = new Label(detailSamplingComposit, SWT.TRANSPARENT);
- samplingTitle.setText(ConfigureLabels.SAMPLING);
- FormData data = new FormData();
- data.top = new FormAttachment(0, 5);
- data.left = new FormAttachment(0, 0);
- data.width = 90;
- data.height = 16;
- samplingTitle.setLayoutData(data);
- samplingTitle.setForeground(ColorResources.SETTING_COLOR);
- samplingTitle.setFont(FontResources.SETTING_DESCRIPTION_FONT);
- samplingTitle.setBackground(ColorResources.SETTING_TABLE_CONTENTS_CHILD);
-
- // text box
- samplingTextBox = new DATextBox(detailSamplingComposit, SWT.SINGLE);
- data = new FormData();
- data.top = new FormAttachment(0, 4);
- data.left = new FormAttachment(samplingTitle, 5);
- data.width = 50;
- data.height = 13;
- samplingTextBox.setLayoutData(data);
- samplingTextBox.setForeground(ColorResources.SETTING_COLOR);
- samplingTextBox.setFont(FontResources.SETTING_DESCRIPTION_FONT);
- samplingTextBox.getControl().addKeyListener(samplingKeyListener);
- samplingTextBox.setTextTooltip(true);
- samplingTextBox.setTextTooltipMessage(ConfigureLabels.FEATURE_OVERHEAD_RANKING_INPUT_VALUE);
- samplingTextBox.getControl().addVerifyListener(new VerifyListener() {
- public void verifyText(VerifyEvent e) {
- e.doit = e.text.matches("[0-9]*");
- }
- });
-
- // label
- samplingTextBoxLabel = new Label(detailSamplingComposit, SWT.TRANSPARENT);
- samplingTextBoxLabel.setText(ConfigureLabels.MS);
- data = new FormData();
- data.top = new FormAttachment(0, 5);
- data.left = new FormAttachment(samplingTextBox.getControl(), 5);
- data.width = 30;
- data.height = 16;
- samplingTextBoxLabel.setLayoutData(data);
- samplingTextBoxLabel.setForeground(ColorResources.SETTING_COLOR);
- samplingTextBoxLabel.setFont(FontResources.SETTING_DESCRIPTION_FONT);
- samplingTextBoxLabel.setBackground(ColorResources.SETTING_TABLE_CONTENTS_CHILD);
-
- // waring label
- samplingInfo = new Label(detailSamplingComposit, SWT.TRANSPARENT);
- data = new FormData();
- data.top = new FormAttachment(0, 5);
- data.left = new FormAttachment(samplingTextBoxLabel, 5);
- data.width = 250;
- data.height = 16;
- samplingInfo.setLayoutData(data);
- samplingInfo.setForeground(ColorResources.SETTING_WARNING_FONT_COLOR);
- samplingInfo.setFont(FontResources.SETTING_DESCRIPTION_FONT);
- samplingInfo.setBackground(ColorResources.SETTING_TABLE_CONTENTS_CHILD);
- }
-
- private void updateSystemDetails(GridItem item) {
- // text box
- String text = getOptionText(item, ConfigureLabels.SAMPLING);
- if ((null != text) && (!text.equals(systemTextBox.getText()))) {
- systemTextBox.setText(text);
- }
-
- if (isTableSelectedFeature(item.getParentItem().getText())) {
- systemTextBox.getControl().setEnabled(true);
- checkValidInputText(ConfigureLabels.FEATURE_DETAIL_VALUE_SYSTEM_SAMPLING_RATE,
- systemTextBox, systemInfo);
- } else {
- systemTextBox.getControl().setEnabled(false);
- systemInfo.setText(CommonConstants.EMPTY);
- }
-
- if (!DAState.isStartable()) {
- systemTextBox.getControl().setEnabled(false);
- }
-
- systemEditor = new GridEditor(table);
- systemEditor.horizontalAlignment = SWT.LEFT;
- systemEditor.grabHorizontal = true;
- systemEditor.setEditor(detailSystemComposit, item, 0);
- detailSystemComposit.layout(true);
- }
-
- private void updateSamplingDetails(GridItem item) {
- // text box
- String text = getOptionText(item, ConfigureLabels.SAMPLING);
- if ((null != text) && (!text.equals(samplingTextBox.getText()))) {
- samplingTextBox.setText(text);
- }
-
- if (isTableSelectedFeature(item.getParentItem().getText())) {
- samplingTextBox.getControl().setEnabled(true);
- checkValidInputText(ConfigureLabels.FEATURE_DETAIL_VALUE_FUNCTION_SAMPLING_RATE,
- samplingTextBox, samplingInfo);
- } else {
- samplingTextBox.getControl().setEnabled(false);
- samplingInfo.setText(CommonConstants.EMPTY);
- }
-
- if (!DAState.isStartable()) {
- samplingTextBox.getControl().setEnabled(false);
- }
-
- samplingEditor = new GridEditor(table);
- samplingEditor.horizontalAlignment = SWT.LEFT;
- samplingEditor.grabHorizontal = true;
- samplingEditor.setEditor(detailSamplingComposit, item, 0);
- detailSamplingComposit.layout(true);
- }
-
- private boolean isTableSelectedFeature(String featureName) {
- GridItem[] list = table.getItems();
- for (int i = 0; i < list.length; i++) {
- if (featureName.equals(list[i].getText(0))) {
- String optionText = list[i].getText(1);
- if (optionText.contains(FeatureDialogFeaturesTable.ITEM_ALL_CHECKED)
- || optionText.contains(FeatureDialogFeaturesTable.ITEM_PART_CHECKED)) {
- return true;
- } else {
- return false;
- }
- }
- }
- return false;
- }
-
- private GridItem getGridItem(String featureName) {
- GridItem[] list = table.getItems();
- for (int i = 0; i < list.length; i++) {
- if (featureName.equals(list[i].getText(0))) {
- return list[i];
- }
- }
- return null;
- }
-
- private boolean checkValidInputText(String featuresName, DATextBox textBox, Label info) {
- FeatureData feature = Feature.getFeature(featuresName).getData();
- String errormsg = feature.validateInputValue(textBox.getText());
- info.setText(errormsg);
- if (!errormsg.isEmpty()) {
- return false;
- } else {
- return true;
- }
- }
-
- private String getOptionText(GridItem item, String optionName) {
- String value = null;
- if (item.getText(1).contains(optionName)) {
- String[] optionList = item.getText(1).split(optionName);
- if (optionList.length > 1) {
- if (optionList[1].contains(CommonConstants.COMMA)) {
- String[] optionList2 = optionList[1].split(CommonConstants.COMMA);
- value = optionList2[0];
- } else {
- value = optionList[1];
- }
- }
- }
- return value;
- }
-
- private void setOptionText(GridItem item, String optionName, String value) {
- StringBuffer buffer = new StringBuffer();
- String optionText = item.getText(1);
- if (optionText.contains(optionName)) {
- String[] optionList = item.getText(1).split(optionName);
- if (optionList.length > 1) {
- buffer.append(optionList[0] + optionName + value);
-
- if (optionList[1].contains(CommonConstants.COMMA)) {
- String[] optionList2 = optionList[1].split(CommonConstants.COMMA);
- for (int i = 1; i < optionList2.length; i++) {
- buffer.append(CommonConstants.COMMA + optionList2[i]);
- }
- }
- }
- }
- item.setText(1, buffer.toString());
- }
-
- private void updateInputText(GridItem item, boolean valid) {
- String optionText = item.getText(1);
- if (optionText.contains(FeatureDialogFeaturesTable.FEATURE_INVALID_VALUE)) {
- optionText = item.getText(1).replace(FeatureDialogFeaturesTable.FEATURE_INVALID_VALUE,
- CommonConstants.EMPTY);
- }
- if (valid == false) {
- optionText += FeatureDialogFeaturesTable.FEATURE_INVALID_VALUE;
- }
- item.setText(1, optionText);
- }
-
- private KeyListener systemKeyListener = new KeyListener() {
-
- @Override
- public void keyReleased(KeyEvent e) {
- // check validation input text
- boolean valid = checkValidInputText(
- ConfigureLabels.FEATURE_DETAIL_VALUE_SYSTEM_SAMPLING_RATE, systemTextBox,
- systemInfo);
-
- // update button state
- GridItem item = getGridItem(ConfigureLabels.FEATURE_DETAIL_VALUE_SYSTEM_SAMPLING_RATE);
- if (null != item) {
- setOptionText(item, ConfigureLabels.SAMPLING, systemTextBox.getText());
- updateInputText(item, valid);
-
- SettingDialogManager.INSTANCE.updateFeatureButtonStatus(table);
- }
- }
-
- @Override
- public void keyPressed(KeyEvent e) {
- }
- };
-
- private KeyListener samplingKeyListener = new KeyListener() {
-
- @Override
- public void keyReleased(KeyEvent e) {
- // check validation input text
- boolean valid = checkValidInputText(
- ConfigureLabels.FEATURE_DETAIL_VALUE_FUNCTION_SAMPLING_RATE, samplingTextBox,
- samplingInfo);
-
- // update button state
- GridItem item = getGridItem(ConfigureLabels.FEATURE_DETAIL_VALUE_FUNCTION_SAMPLING_RATE);
- if (null != item) {
- setOptionText(item, ConfigureLabels.SAMPLING, samplingTextBox.getText());
- updateInputText(item, valid);
-
- SettingDialogManager.INSTANCE.updateFeatureButtonStatus(table);
-
- }
- }
-
- @Override
- public void keyPressed(KeyEvent e) {
- }
- };
-
- /**
- * {@inheritDoc}
- */
- public Point computeSize(GC gc, int wHint, int hHint, Object value) {
- return new Point(11, 9);
- }
-
-}
\ No newline at end of file
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.button.toggle.DACustomFeatureToggleButton;
import org.tizen.dynamicanalyzer.widgets.button.toggle.DACustomMultiToggleButtonGroup;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DABaseComposite;
import org.tizen.dynamicanalyzer.widgets.tooltip.DACustomTooltip;
-public class FlatFeatureDialogFeatureListPage extends DAPageComposite {
+public class FlatFeatureDialogFeatureListPage extends DABaseComposite {
// feature list widget
private FlatFeatureDialog featureDialog = null;
import org.tizen.dynamicanalyzer.setting.TargetData;
import org.tizen.dynamicanalyzer.util.Logger;
import org.tizen.dynamicanalyzer.widgets.button.toggle.DACustomToggleButton;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DABaseComposite;
-public class FlatFeatureDialogSelectedFeaturePage extends DAPageComposite {
+public class FlatFeatureDialogSelectedFeaturePage extends DABaseComposite {
// selectedFeature widget
private FlatFeatureDialog featureDialog = null;
private Composite selectedComp = null;
import org.tizen.dynamicanalyzer.setting.TargetData;
import org.tizen.dynamicanalyzer.widgets.button.toggle.DACustomFeatureToggleButton;
import org.tizen.dynamicanalyzer.widgets.button.toggle.DACustomFeatureToggleButtonGroup;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DABaseComposite;
-public class FlatFeatureDialogTargetPage extends DAPageComposite {
+public class FlatFeatureDialogTargetPage extends DABaseComposite {
private enum ProfileDisplayInfo {
PROFILE_NAME_MOBILE(0, ConfigureLabels.TARGET_NAME_FLAT_MOBILE_FOCUS,
ImageResources.TARGET_NAME_FLAT_MOBILE_SEL,
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
+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.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.RowData;
-import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.tizen.dynamicanalyzer.common.DAState;
+import org.tizen.dynamicanalyzer.common.Global;
+import org.tizen.dynamicanalyzer.communicator.DeviceInfo;
import org.tizen.dynamicanalyzer.handlers.CommonAction;
import org.tizen.dynamicanalyzer.nl.PreferencesDialogLabels;
import org.tizen.dynamicanalyzer.nl.WidgetLabels;
+import org.tizen.dynamicanalyzer.protocol.Protocol;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.resources.FontResources;
import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.setting.FlatPreferences;
import org.tizen.dynamicanalyzer.setting.SettingDataManager;
import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
+import org.tizen.dynamicanalyzer.ui.memory.MemoryPage;
+import org.tizen.dynamicanalyzer.ui.memory.MemoryPersistentAllocationsTableView;
import org.tizen.dynamicanalyzer.ui.page.MenuBar;
+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.toggle.DACustomExtendButton;
public class PreferencesDialog extends DAMessageBox {
private static boolean opened = false;
private static boolean screenshotFeatureEnabled = false;
+ private static boolean leakSanitizerEnabled = false;
private ScrolledComposite scrolledComp = null;
private Composite buttonContentsComp = null;
- final private int DIALOG_HEIGT = 500;
- final private int DIALOG_WIDTH = 450;
+
+ final private static int DIALOG_HEIGHT = 500;
+ final private static int DIALOG_WIDTH = 450;
final private static int LABLE_LEFT_MARGIN = 35;
final private static int LABLE_WIDTH = 150;
private DACustomToggleButton periodicallyToggle = null;
private DACustomToggleButton onSceneTransitionToggle = null;
+ private DACustomToggleButton leakSanitizerToggle = null;
private DACustomCombo systemRateCombo = null;
private DACustomCombo functionRateCombo = null;
private DACustomCombo screenshotRateCombo = null;
private Button okButton;
+ private Composite memoryProfilingView = null;
+
public PreferencesDialog(Shell parentShell) {
super(parentShell);
}
}
int dialogLocationX = shell.getParent().getLocation().x + (shell.getParent().getSize().x - DIALOG_WIDTH) / 2;
- int dialogLocationY = shell.getParent().getLocation().y + (shell.getParent().getSize().y - DIALOG_HEIGT) / 2;
+ int dialogLocationY = shell.getParent().getLocation().y + (shell.getParent().getSize().y - DIALOG_HEIGHT) / 2;
shell.setLocation(dialogLocationX, dialogLocationY);
- shell.setSize(DIALOG_WIDTH, DIALOG_HEIGT);
+ shell.setSize(DIALOG_WIDTH, DIALOG_HEIGHT);
shell.setLayout(new FormLayout());
shell.setText(PreferencesDialogLabels.TITLE);
shell.setBackground(ColorResources.DIALOG_CONTENT_BACKGROUND);
buttonContentsComp.setLayoutData(compData);
buttonContentsComp.setBackground(ColorResources.WHITE);
- screenshotFeatureEnabled = SettingDataManager.INSTANCE.getSelectedFlatFeatureSet().contains(FlatFeature.SCREENSHOT);
+ screenshotFeatureEnabled = SettingDataManager.INSTANCE.isFlatFeatureSelected(FlatFeature.SCREENSHOT);
+ leakSanitizerEnabled = SettingDataManager.INSTANCE.isFlatFeatureSelected(FlatFeature.MEMORY_ALLOC) &&
+ !SettingDataManager.INSTANCE.isFlatFeatureSelected(FlatFeature.THREAD_ANALYSIS);
+
+ // check LSan availability
+ if (leakSanitizerEnabled) {
+ DeviceInfo device = Global.getCurrentDeviceInfo();
+ boolean leakSanitizerSupported = false;
+ if (device != null) {
+ Protocol usedProtocol = Protocol.getVersion(
+ device.getCommunicator().getProtocolVersion());
+
+ leakSanitizerSupported = usedProtocol.getVersionNum() >= Protocol.VERSION_42
+ .getVersionNum();
+ }
+ leakSanitizerEnabled = leakSanitizerSupported;
+ }
drawPreferenceCom();
// Heights for expandable views
int generalviewHeight = CONTROL_HEIGHT * 3 + LABLE_INTERVAL * 2;
int screenshotViewHeight = CONTROL_HEIGHT * 2 + LABLE_INTERVAL;
+ int memoryProfilingViewHeight = CONTROL_HEIGHT + 10;
/**
* Base composite
onSceneTransitionToggle = createToggleButton(screenshotView);
}
+ /**
+ * Memory Profiling preferences
+ */
+ {
+ // Base view
+ Composite memoryProfilingBaseView = new Composite(baseCom, SWT.NONE);
+ memoryProfilingBaseView.setLayoutData(new RowData());
+ memoryProfilingBaseView.setBackground(ColorResources.DIALOG_CONTENT_BACKGROUND);
+ memoryProfilingBaseView.setLayout(parentLayout);
+
+ // Add 'Memory Profiling' button
+ DACustomButton memoryProfilingExtend = createFoldingButton(memoryProfilingBaseView,
+ PreferencesDialogLabels.HEAP_ALLOCATION);
+
+ // Add expandable view
+ memoryProfilingView = new Composite(memoryProfilingBaseView, SWT.NONE);
+ memoryProfilingView.setBackground(ColorResources.DIALOG_CONTENT_BACKGROUND);
+ memoryProfilingView.setLayoutData(new RowData(SWT.DEFAULT, memoryProfilingViewHeight));
+ memoryProfilingView.setLayout(childLayout);
+
+ // Expand listener
+ memoryProfilingExtend.addClickListener(createExpandListener(memoryProfilingView));
+
+ // LeakSanitizer
+ createLabel(memoryProfilingView, PreferencesDialogLabels.LEAK_SANITIZER, 2);
+ leakSanitizerToggle = createToggleButton(memoryProfilingView);
+ leakSanitizerToggle.setToolTipText(PreferencesDialogLabels.LEAK_SANITIZER_TOOLTIP);
+ }
+
scrolledComp.setContent(baseCom);
scrolledComp.setMinSize(baseCom.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
}
private void setSelectedOptions() {
- int value = SettingDataManager.INSTANCE.getOptionsPreferencesValue(FlatPreferences.SOURCE_VIEW);
+ int value = SettingDataManager.INSTANCE.getPreferenceValue(FlatPreferences.SOURCE_VIEW);
if (value == 1) {
sourceviewtoggle.setToggled(true);
MenuBar.getInstance().setSourceView(true);
MenuBar.getInstance().setSourceView(false);
}
- value = SettingDataManager.INSTANCE.getOptionsPreferencesValue(FlatPreferences.SYSTEM_SAMPLING_RATE);
+ value = SettingDataManager.INSTANCE.getPreferenceValue(FlatPreferences.SYSTEM_SAMPLING_RATE);
systemRateCombo.setText(String.valueOf(value));
- value = SettingDataManager.INSTANCE.getOptionsPreferencesValue(FlatPreferences.FUNCTION_SAMPLING_RATE);
+ value = SettingDataManager.INSTANCE.getPreferenceValue(FlatPreferences.FUNCTION_SAMPLING_RATE);
functionRateCombo.setText(String.valueOf(value));
if (screenshotFeatureEnabled) {
- value = SettingDataManager.INSTANCE.getOptionsPreferencesValue(FlatPreferences.SCREENSHOT_PERIODICALLY);
+ value = SettingDataManager.INSTANCE.getPreferenceValue(FlatPreferences.SCREENSHOT_PERIODICALLY);
boolean enabled = (value != 0);
periodicallyToggle.setToggled(enabled);
if (enabled)
screenshotRateCombo.setText(String.valueOf(value));
- enabled = SettingDataManager.INSTANCE.isOptionsSelectedPrefereces(FlatPreferences.SCREENSHOT_ON_SCENE_TRANSITION);
+ enabled = SettingDataManager.INSTANCE.isPreferenceSelected(FlatPreferences.SCREENSHOT_ON_SCENE_TRANSITION);
onSceneTransitionToggle.setToggled(enabled);
onSceneTransitionToggle.setButtonEnabled(true);
} else {
onSceneTransitionToggle.setToggled(false);
onSceneTransitionToggle.setButtonEnabled(false);
}
+
+ if (leakSanitizerEnabled) {
+ leakSanitizerToggle.setToggled(SettingDataManager.INSTANCE
+ .isPreferenceSelected(FlatPreferences.LEAK_SANITIZER));
+ leakSanitizerToggle.setButtonEnabled(true);
+ } else {
+ leakSanitizerToggle.setToggled(false);
+ leakSanitizerToggle.setButtonEnabled(false);
+ }
}
private void resetToDefault() {
value = FlatPreferences.SCREENSHOT_ON_SCENE_TRANSITION.getDefaultValue();
onSceneTransitionToggle.setToggled(value != 0);
}
+
+ if (leakSanitizerEnabled) {
+ value = FlatPreferences.LEAK_SANITIZER.getDefaultValue();
+ leakSanitizerToggle.setToggled(value == 1);
+ }
}
private DACustomExtendButton createFoldingButton(Composite parent, String text) {
private void applyPreferenceData() {
boolean sourceViewEnabled = sourceviewtoggle.isToggled();
MenuBar.getInstance().setSourceView(sourceViewEnabled);
- SettingDataManager.INSTANCE.addOptionsSelectedPreference(FlatPreferences.SOURCE_VIEW, sourceViewEnabled ? 1 : 0);
+ SettingDataManager.INSTANCE.setPreferenceValue(FlatPreferences.SOURCE_VIEW, sourceViewEnabled ? 1 : 0);
String ratestring = systemRateCombo.getText();
try {
int rate = Integer.parseInt(ratestring);
- SettingDataManager.INSTANCE.addOptionsSelectedPreference(FlatPreferences.SYSTEM_SAMPLING_RATE, rate);
+ SettingDataManager.INSTANCE.setPreferenceValue(FlatPreferences.SYSTEM_SAMPLING_RATE, rate);
} catch (Exception ex) {
return;
ratestring = functionRateCombo.getText();
try {
int rate = Integer.parseInt(ratestring);
- SettingDataManager.INSTANCE.addOptionsSelectedPreference(FlatPreferences.FUNCTION_SAMPLING_RATE, rate);
+ SettingDataManager.INSTANCE.setPreferenceValue(FlatPreferences.FUNCTION_SAMPLING_RATE, rate);
} catch (Exception ex) {
return;
return;
}
}
- SettingDataManager.INSTANCE.addOptionsSelectedPreference(FlatPreferences.SCREENSHOT_PERIODICALLY, rate);
+ SettingDataManager.INSTANCE.setPreferenceValue(FlatPreferences.SCREENSHOT_PERIODICALLY, rate);
+
+ SettingDataManager.INSTANCE.setPreferenceSelected(
+ FlatPreferences.SCREENSHOT_ON_SCENE_TRANSITION,
+ onSceneTransitionToggle.isToggled());
+
+ SettingDataManager.INSTANCE.setPreferenceSelected(FlatPreferences.LEAK_SANITIZER,
+ leakSanitizerToggle.isToggled());
- if (onSceneTransitionToggle.isToggled())
- SettingDataManager.INSTANCE.addOptionsSelectedPreference(FlatPreferences.SCREENSHOT_ON_SCENE_TRANSITION, 1);
- else
- SettingDataManager.INSTANCE.deleteOptionsSelectedPreference(FlatPreferences.SCREENSHOT_ON_SCENE_TRANSITION);
+ ((MemoryPersistentAllocationsTableView) AnalyzerUtil
+ .getView(MemoryPage.pageID, MemoryPersistentAllocationsTableView.ID))
+ .updateView();
}
private DACustomCombo makeDACustomCombo(Composite parent, String unit) {
periodicallyToggle.setButtonEnabled(false);
screenshotRateCombo.setEnabled(false);
onSceneTransitionToggle.setButtonEnabled(false);
+ leakSanitizerToggle.setButtonEnabled(false);
}
}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Heeyoung Hwang <heeyoung1008.hwang@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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.setting;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-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.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.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
-import org.tizen.dynamicanalyzer.common.DAState;
-import org.tizen.dynamicanalyzer.communicator.IDECommunicator;
-import org.tizen.dynamicanalyzer.handlers.CommonAction;
-import org.tizen.dynamicanalyzer.handlers.UIActionHolder;
-import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
-import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
-import org.tizen.dynamicanalyzer.nl.WidgetLabels;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.resources.FontResources;
-import org.tizen.dynamicanalyzer.setting.SettingDataManager;
-import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
-import org.tizen.dynamicanalyzer.util.Logger;
-import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
-import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
-import org.tizen.dynamicanalyzer.widgets.da.base.DAButton;
-import org.tizen.dynamicanalyzer.widgets.da.base.DAMessageBox;
-import org.tizen.dynamicanalyzer.widgets.da.view.DABaseComposite;
-import org.tizen.dynamicanalyzer.widgets.da.view.DATabComposite;
-
-public class SettingDialog extends DAMessageBox {
- private static boolean opened = false;
- private DACustomButton okButton = null;
- private DACustomButton cancelButton = null;
- private boolean isApply = false;
-
- private SettingDialogTemplatePage templatesPage = null;
- private SettingDialogOptionPage optionPage = null;
-
- private DATabComposite tabView = null;
- private Composite buttonContentsComp = null;
-
- public SettingDialog(Shell parentShell) {
- super(parentShell);
- }
-
- private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {
-
- @Override
- public void handleClickEvent(DACustomButton button) {
- if (optionPage.isValidInputValue()) {
- isApply = true;
- doApply();
- doRun();
- shell.close(); // close dialog
- } else {
- doWarningMessage();
- }
- }
- };
-
- private DACustomButtonClickEventListener cancelButtonListener = new DACustomButtonClickEventListener() {
-
- @Override
- public void handleClickEvent(DACustomButton button) {
-// if (optionPage.isValidInputValue()) {
- isApply = true;
- doRevert();
- doRun();
- shell.close(); // close dialog
-// } else {
-// doWarningMessage();
-// }
-
- }
- };
-
- private void doApply() {
- Composite selectedComposite = tabView.getTopComposite();
- if (!(selectedComposite instanceof SettingDialogBinarySettingsPage)) {
- if (DAState.isStartable()) {
- // add & remove tab view page and (timeline) chart
- UIActionHolder.getUIAction().setUIElementsBySetting();
-
- // write setting data
- SettingDataManager.INSTANCE.applySettingData();
- }
- } else {
- // binary setting page
- SettingDialogBinarySettingsPage page = (SettingDialogBinarySettingsPage) selectedComposite;
- page.doApply();
- }
-
- }
-
- private void doRevert() {
- // rollback setting data
- SettingDataManager.INSTANCE.revertSettingData();
- }
-
- private void doRun() {
- Composite selectedComposite = tabView.getTopComposite();
- if (!(selectedComposite instanceof SettingDialogBinarySettingsPage)) {
- if (DAState.isStartable()) {
- CommonAction.configure();
- }
- }
- }
-
- private void doWarningMessage() {
- UIActionHolder.getUIAction().showWarning(ConfigureLabels.SETTING_WARNING_MESSAGE_SETTING_INVALID_INPUT_VALUE,
- 550, 153);
- }
-
- protected boolean run() {
- if (opened) {
- return false;
- }
- IDECommunicator.setOpenWelcomeDlg(true);
- shell.setSize(631, 550);
- shell.setLayout(new FormLayout());
- shell.setText(AnalyzerLabels.SETTING_TITLE);
- shell.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
-
- // content composite
- Composite contentsComp = new Composite(shell, SWT.NONE);
- FormLayout compLayout = new FormLayout();
- contentsComp.setLayout(compLayout);
- contentsComp.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
-
- 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, -49);
- contentsComp.setLayoutData(compData);
-
- // check exist setting file
- if (SettingDataManager.INSTANCE.isParsingSuccess() == false) {
- Label label = new Label(contentsComp, SWT.NONE);
- label.setForeground(ColorResources.DEFAULT_FONT_COLOR);
- label.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
- label.setFont(FontResources.SETTING_TITLE_FONT);
- label.setText(ConfigureLabels.SETTING_WARNING_MESSAGE_FILE_NOT_FOUND);
-
- shell.addDisposeListener(new DisposeListener() {
-
- @Override
- public void widgetDisposed(DisposeEvent e) {
- opened = false;
- ShortCutManager.getInstance().setEnabled(!opened);
- }
- });
- opened = true;
- ShortCutManager.getInstance().setEnabled(!opened);
-
- shell.open();
- return true;
- }
-
- // tab view
- tabView = new DATabComposite(contentsComp, SWT.DOUBLE_BUFFERED);
- tabView.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
- tabView.setTabWidth(120);
- 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);
-
- templatesPage = new SettingDialogTemplatePage(tabView.getContentComposite(), SWT.NONE);
- tabView.addView(templatesPage, false);
-
- optionPage = new SettingDialogOptionPage(tabView.getContentComposite(), SWT.NONE);
- tabView.addView(optionPage, false);
-
- // check platform SDK (show binary setting page)
- if (AnalyzerManager.isPlatformSDK()) {
- createBinarySettingPage();
- }
-
- // button composite
- buttonContentsComp = new Composite(shell, SWT.NONE);
- 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);
- buttonContentsComp.addPaintListener(new PaintListener() {
-
- @Override
- public void paintControl(PaintEvent e) {
- Composite comp = (Composite) e.widget;
- Rectangle rect = comp.getClientArea();
- e.gc.setForeground(ColorResources.SETTING_SUNKEN_LINE_1);
- e.gc.drawLine(0, 0, rect.width - 1, 0);
- e.gc.setForeground(ColorResources.SETTING_SUNKEN_LINE_2);
- e.gc.drawLine(0, 1, rect.width - 1, 1);
- }
- });
-
- optionPage.addListener(SWT.Hide, new Listener() {
-
- @Override
- public void handleEvent(Event event) {
- Logger.debug("options page hide");
- if (!optionPage.isValidInputValue()) {
- doWarningMessage();
- optionPage.revertInputValue();
- }
- // update total overhead range
- templatesPage.updateTotalOverheadRange();
- }
- });
-
- cancelButton = new DAButton(buttonContentsComp, SWT.NONE);
- cancelButton.addClickListener(cancelButtonListener);
- cancelButton.setText(WidgetLabels.CANCEL);
- cancelButton.setButtonFont(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(WidgetLabels.OK);
- okButton.setButtonFont(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);
-
- shell.addDisposeListener(new DisposeListener() {
-
- @Override
- public void widgetDisposed(DisposeEvent e) {
- opened = false;
- ShortCutManager.getInstance().setEnabled(!opened);
- }
-
- });
-
- opened = true;
- ShortCutManager.getInstance().setEnabled(!opened);
-
- shell.addShellListener(shellListener);
- shell.open();
- return true;
- }
-
- private void createBinarySettingPage() {
- DABaseComposite binarySettings = new SettingDialogBinarySettingsPage(
- tabView.getContentComposite(), SWT.NONE);
- tabView.addView(binarySettings, false);
-
- // binarySettings tab is selected, the close button will be shown.
- // ok and cancel button is hidden
- binarySettings.addListener(SWT.Show, new Listener() {
-
- @Override
- public void handleEvent(Event event) {
- Logger.debug("binary settings show");
- cancelButton.setText(WidgetLabels.CLOSE);
- FormData data = (FormData) okButton.getLayoutData();
- data.width = 0;
-
- buttonContentsComp.layout();
- }
- });
-
- binarySettings.addListener(SWT.Hide, new Listener() {
-
- @Override
- public void handleEvent(Event event) {
- Logger.debug("binary settings hide");
- cancelButton.setText(WidgetLabels.CANCEL);
- FormData data = (FormData) okButton.getLayoutData();
- data.width = 100;
-
- buttonContentsComp.layout();
- }
- });
- }
-
- private void notifyAutoRun() {
- synchronized (IDECommunicator.getWaitingWelcomeDlg()) {
- IDECommunicator.setOpenWelcomeDlg(false);
- IDECommunicator.getWaitingWelcomeDlg().notifyAll();
- }
- }
-
- private ShellListener shellListener = new ShellListener() {
-
- @Override
- public void shellActivated(ShellEvent e) {
- // TODO Auto-generated method stub
- }
-
- @Override
- public void shellClosed(ShellEvent e) {
- // TODO Auto-generated method stub
- if (!isApply) {
- doRevert();
- doRun();
- }
- notifyAutoRun();
- }
-
- @Override
- public void shellDeactivated(ShellEvent e) {
- // TODO Auto-generated method stub
- }
-
- @Override
- public void shellDeiconified(ShellEvent e) {
- // TODO Auto-generated method stub
- }
-
- @Override
- public void shellIconified(ShellEvent e) {
- // TODO Auto-generated method stub
- }
-
- };
-}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Jaewon Lim <jaewon81.lim@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.toolbar.setting;
-
-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 org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.ScrolledComposite;
-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.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.tizen.dynamicanalyzer.common.DAResult;
-import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode;
-import org.tizen.dynamicanalyzer.common.Global;
-import org.tizen.dynamicanalyzer.common.path.PathManager;
-import org.tizen.dynamicanalyzer.communicator.DACommunicator;
-import org.tizen.dynamicanalyzer.communicator.DeviceInfo;
-import org.tizen.dynamicanalyzer.communicator.UnsupportedProtocolException;
-import org.tizen.dynamicanalyzer.constant.CommonConstants;
-import org.tizen.dynamicanalyzer.handlers.UIActionHolder;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.resources.FontResources;
-import org.tizen.dynamicanalyzer.setting.SettingDataManager;
-import org.tizen.dynamicanalyzer.swap.platform.BinarySettingData;
-import org.tizen.dynamicanalyzer.swap.platform.BinarySettingManager;
-import org.tizen.dynamicanalyzer.swap.platform.ui.BinarySettingProcessor;
-import org.tizen.dynamicanalyzer.swap.platform.ui.BinarySettingProgressManager;
-import org.tizen.dynamicanalyzer.swap.platform.ui.InputRow;
-import org.tizen.dynamicanalyzer.swap.platform.ui.LoadSettingDialog;
-import org.tizen.dynamicanalyzer.swap.platform.ui.SaveSettingDialog;
-import org.tizen.dynamicanalyzer.ui.common.explorer.DeviceExplorerDialog;
-import org.tizen.dynamicanalyzer.ui.common.explorer.FileExplorerDialog;
-import org.tizen.dynamicanalyzer.util.CommonUtil;
-import org.tizen.dynamicanalyzer.util.Logger;
-import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
-import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
-import org.tizen.dynamicanalyzer.widgets.da.base.DAButton;
-import org.tizen.dynamicanalyzer.widgets.da.base.WarningDialog;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
-
-public class SettingDialogBinarySettingsPage extends DAPageComposite {
- public static final String ID = SettingDialogBinarySettingsPage.class.getName();
-
- public static final int RADIO_CURRENT = 1;
- public static final int RADIO_ADD = 2;
- public static final int RADIO_REMOVE = 3;
-
- private List<InputRow> inputRowList = null;
-
- private ScrolledComposite scrolledComposite = null;
- private Composite inputComposite = null;
-
- private DAButton clearButton = null;
- private DAButton addButton = null;
- private DAButton saveButton = null;
- private DAButton loadButton = null;
- private DAButton debugRootButton = null;
- private Label librariesLabel = null;
-
- private String rootPath = null;
- private SettingDialogBinarySettingsPage me = null;
-
- private DACustomButtonClickEventListener addButtonListener = new DACustomButtonClickEventListener() {
-
- @Override
- public void handleClickEvent(DACustomButton button) {
- DeviceInfo curDev = Global.getCurrentDeviceInfo();
- if (curDev == null) {
- UIActionHolder.getUIAction().showWarning(getShell(), new DAResult(ErrorCode.ERR_NO_DEVICE));
- } else if (!curDev.isRootAvailable()) {
- UIActionHolder.getUIAction().showWarning(getShell(), new DAResult(ErrorCode.ERR_BY_SECURITY));
- } else {
- DeviceExplorerDialog dialog = new DeviceExplorerDialog(getShell(), true);
- // dialog.setFilter(".so");
- Object result = dialog.open();
- if (result != null) {
- BinarySettingProgressManager.getInstance().startProcessStart(
- "Wait for add binaries...");
- BinarySettingProcessor.runAddThread(result, me);
- }
- }
- }
- };
-
- private DACustomButtonClickEventListener removeButtonListener = new DACustomButtonClickEventListener() {
-
- @Override
- public void handleClickEvent(DACustomButton button) {
- String binaryPath = ((InputRow) button.getParent()).getBinaryName();
-
- removeInputRow(binaryPath);
- Composite inputComposite = button.getParent().getParent();
- BinarySettingData rmData = BinarySettingManager.getInstance().getBinarySetting(
- binaryPath);
-
- if (null != rmData) {
- List<String> rmBinaries = new ArrayList<String>();
- rmBinaries.add(rmData.getBinaryPath());
-
- try {
- DACommunicator.removeInstrumentation(rmBinaries);
- } catch (InterruptedException e) {
- Logger.warning("Intterrupted during send remove instrumentation message");
- } catch (UnsupportedProtocolException e) {
- Logger.warning("Message to remove instrumentation is not supported by communicator");
- }
- } // else : do nothing
-
- BinarySettingManager.getInstance().removeBinarySettingData(binaryPath);
- button.getParent().dispose();
- ((SettingDialogBinarySettingsPage) (inputComposite.getParent().getParent()))
- .updateLayout();
- }
- };
-
- private DACustomButtonClickEventListener loadButtonListener = new DACustomButtonClickEventListener() {
-
- @Override
- public void handleClickEvent(DACustomButton button) {
- DeviceInfo curDev = Global.getCurrentDeviceInfo();
- if (curDev == null) {
- UIActionHolder.getUIAction().showWarning(getShell(), new DAResult(ErrorCode.ERR_NO_DEVICE));
- return;
- }
-
- if (!curDev.isRootAvailable()) {
- UIActionHolder.getUIAction().showWarning(getShell(), new DAResult(ErrorCode.ERR_BY_SECURITY));
- return;
- }
-
- LoadSettingDialog dialog = new LoadSettingDialog(button.getParent().getShell());
- Object result = dialog.open();
- if (result == null) {
- return;
- }
-
- // swap remove message send and inputrow dispose
- cleanRow();
-
- String path = (String) result;
- File saveFile = new File(path);
- BufferedReader br = null;
- try {
- br = new BufferedReader(new FileReader(saveFile));
- BinarySettingManager.getInstance().openData(br);
- List<BinarySettingData> binarySettings = BinarySettingManager.getInstance()
- .getBinarySettingList();
-
- for (int i = 0; i < binarySettings.size(); i++) {
- InputRow inputRow = new InputRow(inputComposite, removeButtonListener);
- inputRow.setBinaryName(binarySettings.get(i).getBinaryPath());
- inputRow.setDebugText(binarySettings.get(i).getDebugRpmPath());
- inputRow.setSourceText(binarySettings.get(i).getUserSourceDir());
- inputRowList.add(inputRow);
- }
-
- BinarySettingProgressManager.getInstance().startProcessStart(
- "now loading binaries...");
- BinarySettingProcessor.runLoadingThread(me);
- } catch (FileNotFoundException e) {
- Logger.exception(e);
- } catch (IOException e) {
- Logger.exception(e);
- } finally {
- CommonUtil.tryClose(br);
- }
- }
- };
-
- private DACustomButtonClickEventListener debugRootButtonListener = new DACustomButtonClickEventListener() {
-
- @Override
- public void handleClickEvent(DACustomButton button) {
- FileExplorerDialog dialog = new FileExplorerDialog(getShell());
- dialog.getExplorer().setRoot(CommonUtil.getHomeDirectory());
- Object result = dialog.open();
- if (result != null) {
- @SuppressWarnings("unchecked")
- List<File> files = (List<File>) result;
- if (!files.isEmpty()) {
- File file = files.get(0);
- if (!file.isDirectory()) {
- file = file.getParentFile();
- }
-
- if (null != file) {
- rootPath = file.getAbsolutePath();
- } // else : do nothing
- }
-
- if (null != rootPath) {
- BinarySettingProgressManager.getInstance().startProcessStart(
- "Wait for update debug path");
- BinarySettingProcessor.runUpdateDebugRoot(me);
- BinarySettingManager.getInstance().setDebugRoot(rootPath);
- }
- }
- }
- };
-
- private DACustomButtonClickEventListener saveButtonListener = new DACustomButtonClickEventListener() {
-
- @Override
- public void handleClickEvent(DACustomButton button) {
- SaveSettingDialog dialog = new SaveSettingDialog(button.getParent().getShell(),
- inputRowList);
- dialog.open();
- }
- };
-
- private DACustomButtonClickEventListener cleanButtonListener = new DACustomButtonClickEventListener() {
-
- @Override
- public void handleClickEvent(DACustomButton button) {
- if (null != button) {
- WarningDialog dialog = new WarningDialog(getShell(), SWT.NONE);
- dialog.setMessage("Clear binary settings?\nIf you click 'Ok', All settings will be deleted");
- boolean result = dialog.open();
- if (!result) {
- return;
- }
- }
-
- cleanRow();
- }
- };
-
- private void cleanRow() {
- List<BinarySettingData> binaries = BinarySettingManager.getInstance()
- .getBinarySettingList();
- if (!binaries.isEmpty()) {
- List<String> removePaths = new ArrayList<String>();
- for (BinarySettingData data : binaries) {
- removePaths.add(data.getBinaryPath());
- }
-
- try {
- DACommunicator.removeInstrumentation(removePaths);
- } catch (InterruptedException e) {
- Logger.warning("Interrupted during send remove instrumentation message");
- } catch (UnsupportedProtocolException e) {
- Logger.warning("Message to remove instrumentation is not supported by communicator");
- }
-
- for (int i = 0; i < inputRowList.size(); i++) {
- BinarySettingManager.getInstance().removeBinarySettingData(
- inputRowList.get(i).getBinaryName());
- inputRowList.get(i).dispose();
- }
- inputRowList.clear();
- }
-
- updateLayout();
- }
-
- private void clearLayout() {
- for (int i = 0; i < inputRowList.size(); i++) {
- inputRowList.get(i).dispose();
- }
- inputRowList.clear();
- }
-
- public SettingDialogBinarySettingsPage(Composite parent, int style) {
- super(parent, style);
- me = this;
- setTitle("Binary Settings"); // TODO nl
- rootPath = PathManager.getRootstrapsPath(SettingDataManager.INSTANCE.getPlatform());
- inputRowList = new ArrayList<InputRow>();
-
- String settingPath = PathManager.DA_SETTING_PATH;
- File settingFolder = new File(settingPath);
- if (!settingFolder.exists() || !settingFolder.isDirectory()) {
- if (!settingFolder.mkdirs()) {
- Logger.debug("setting directory create failed...");
- }
- }
-
- this.setLayout(new FormLayout());
- this.setBackground(ColorResources.DIALOG_BG_UPPER);
-
- int libCount = BinarySettingManager.getInstance().getBinarySettingList().size();
- librariesLabel = new Label(this, SWT.TRANSPARENT);
- FormData data = new FormData();
- data.top = new FormAttachment(0, 15);
- data.left = new FormAttachment(0, 16);
- data.height = 16;
- data.width = 100;
- librariesLabel.setLayoutData(data);
- librariesLabel.setText("Libraies (" + libCount + ")");
- librariesLabel.setBackground(ColorResources.DIALOG_BG_UPPER);
- librariesLabel.setFont(FontResources.getDADefaultFont());
-
- scrolledComposite = new ScrolledComposite(this, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- data = new FormData();
- data.top = new FormAttachment(librariesLabel, 4);
- data.left = new FormAttachment(0, 6);
- data.right = new FormAttachment(100, -6);
- data.bottom = new FormAttachment(100, -45);
-
- // data.width = 590;
- scrolledComposite.setLayoutData(data);
- scrolledComposite.setLayout(new FormLayout());
- scrolledComposite.setExpandHorizontal(true);
- scrolledComposite.setExpandVertical(true);
- scrolledComposite.setBackground(ColorResources.BINARY_SETTINGS_INPUT_BOX_COLOR);
-
- inputComposite = new Composite(scrolledComposite, SWT.NONE);
- scrolledComposite.setContent(inputComposite);
- scrolledComposite.setMinSize(inputComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
- scrolledComposite.setShowFocusedControl(true);
- data = new FormData();
- data.top = new FormAttachment(0, 5);
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(100, 0);
- data.bottom = new FormAttachment(100, -5);
- inputComposite.setLayoutData(data);
- inputComposite.setLayout(new FormLayout());
- inputComposite.setBackground(ColorResources.BINARY_SETTINGS_INPUT_BOX_COLOR);
-
- loadButton = new DAButton(this, SWT.NONE);
- data = new FormData();
- data.top = new FormAttachment(scrolledComposite, 17);
- data.left = new FormAttachment(0, 6);
- data.height = 22;
- data.width = 78;
- loadButton.setLayoutData(data);
- loadButton.setText("Load");
- loadButton.addClickListener(loadButtonListener);
-
- saveButton = new DAButton(this, SWT.NONE);
- data = new FormData();
- data.top = new FormAttachment(scrolledComposite, 17);
- data.left = new FormAttachment(loadButton, 6);
- data.height = 22;
- data.width = 78;
- saveButton.setLayoutData(data);
- saveButton.setText("Save");
- saveButton.addClickListener(saveButtonListener);
-
- debugRootButton = new DAButton(this, SWT.NONE);
- data = new FormData();
- data.top = new FormAttachment(scrolledComposite, 17);
- data.left = new FormAttachment(saveButton, 32);
- data.height = 22;
- data.width = 112;
- debugRootButton.setLayoutData(data);
- debugRootButton.setText("Set DebugRoot");
- debugRootButton.addClickListener(debugRootButtonListener);
-
- clearButton = new DAButton(this, SWT.NONE);
- data = new FormData();
- data.top = new FormAttachment(scrolledComposite, 17);
- data.right = new FormAttachment(100, -6);
- data.height = 22;
- data.width = 78;
- clearButton.setLayoutData(data);
- clearButton.setText("Clear");
- clearButton.addClickListener(cleanButtonListener);
-
- addButton = new DAButton(this, SWT.NONE);
- data = new FormData();
- data.top = new FormAttachment(scrolledComposite, 17);
- data.right = new FormAttachment(clearButton, -6);
- data.height = 22;
- data.width = 78;
- addButton.setLayoutData(data);
- addButton.setText("Add");
- addButton.addClickListener(addButtonListener);
-
- this.addListener(SWT.Show, new Listener() {
-
- @Override
- public void handleEvent(Event event) {
- initInputRows();
- }
- });
-
- this.addListener(SWT.Dispose, new Listener() {
-
- @Override
- public void handleEvent(Event event) {
- }
- });
- }
-
- public void doApply() {
- // dirty check and update path
- for (InputRow inputRow : inputRowList) {
- String binary = inputRow.getBinaryName();
- String debug = inputRow.getDebugText();
- String source = inputRow.getSourceText();
- BinarySettingData binData = BinarySettingManager.getInstance().getBinarySetting(binary);
- if (binData != null) {
- binData.setDebugRpmPath(debug);
- binData.setUserSourceDir(source);
- } else {
- Logger.debug("binary data is null");
- }
- }
-
- Logger.debug("update complete!");
- }
-
- public void doClose() {
- }
-
- public void initInputRows() {
- List<BinarySettingData> binData = null;
- binData = BinarySettingManager.getInstance().getBinarySettingList();
- clearLayout();
- for (int i = 0; i < binData.size(); i++) {
- InputRow inputRow = new InputRow(inputComposite, removeButtonListener);
- inputRow.setBinaryName(binData.get(i).getBinaryPath());
- // String debug = binData.get(i).getDebugFilePath();
- String debug = binData.get(i).getDebugRpmPath();
- if (null != debug && !debug.isEmpty()) {
- inputRow.setDebugText(debug);
- } else {
- inputRow.setDebugText(CommonConstants.EMPTY);
- }
-
- String source = binData.get(i).getUserSourceDir();
- if (null != source && !source.isEmpty()) {
- inputRow.setSourceText(source);
- } else {
- source = binData.get(i).getRpmSourceDir();
- if (null != source && !source.isEmpty()) {
- inputRow.setSourceText(source);
- } else {
- inputRow.setSourceText(CommonConstants.EMPTY);
- }
- }
- inputRowList.add(inputRow);
- }
- updateLayout();
- }
-
- private void removeInputRow(String path) {
- InputRow prev = null;
- InputRow cur = null;
- InputRow next = null;
-
- for (int i = 0; i < inputRowList.size(); i++) {
- // define prev, cur, next inputRow
- if (i != 0) {
- prev = cur;
- }
- cur = inputRowList.get(i);
- if (i != inputRowList.size() - 1) {
- next = inputRowList.get(i + 1);
- } else {
- next = null;
- }
-
- if (cur.getBinaryName().equals(path)) {
- // modify layout of next input row
- if (next != null) {
- FormData nextData = (FormData) next.getLayoutData();
- if (prev != null) {
- nextData.top = new FormAttachment(prev, 2);
- } else {
- nextData.top = new FormAttachment(0, 0);
- }
- }
-
- // remove from row list
- inputRowList.remove(i);
- break;
- }
- }
- }
-
- public void updateLayout() {
- int count = BinarySettingManager.getInstance().getBinarySettingList().size();
- librariesLabel.setText("Libraries (" + count + ")");
- inputComposite.layout();
- scrolledComposite.setMinSize(inputComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
- if (count == 0) {
- saveButton.setButtonEnabled(false);
- clearButton.setButtonEnabled(false);
- } else {
- saveButton.setButtonEnabled(true);
- clearButton.setButtonEnabled(true);
- }
- }
-
- public String getDebugRootPath() {
- return rootPath;
- }
-}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Heeyoung Hwang <heeyoung1008.hwang@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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.setting;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.nebula.widgets.grid.Grid;
-import org.eclipse.nebula.widgets.grid.GridItem;
-import org.tizen.dynamicanalyzer.constant.CommonConstants;
-import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
-import org.tizen.dynamicanalyzer.setting.Feature;
-import org.tizen.dynamicanalyzer.setting.FeatureValueData;
-import org.tizen.dynamicanalyzer.setting.SettingConstants;
-import org.tizen.dynamicanalyzer.setting.SettingDataManager;
-import org.tizen.dynamicanalyzer.setting.TargetData;
-
-public enum SettingDialogManager {
- INSTANCE;
-
- private FeatureDialog featureDlg = null;
-
- public FeatureDialog getFeatureDlg() {
- return featureDlg;
- }
-
- public void setFeatureDlg(FeatureDialog featureDlg) {
- this.featureDlg = featureDlg;
- }
-
- public void updateFeatureButtonStatus(Grid table) {
- if (validInputText(table) && changedFeaturesFromTableItemsList(table)) {
- featureDlg.enableButteon();
- } else {
- featureDlg.diableButteon();
- }
- }
-
- public void setFeaturesValueFromTableItemsList(Grid table) {
- TargetData target = SettingDataManager.INSTANCE.getTarget(null);
- List<FeatureValueData> list = new ArrayList<FeatureValueData>();
- FeatureValueData featureValue = null;
-
- for (int i = 0; i < table.getItemCount(); i++) {
- String featureName = table.getItem(i).getText(0);
- String optionText = table.getItem(i).getText(1);
-
- Feature feature = Feature.getFeature(featureName);
- if ((optionText.contains(FeatureDialogFeaturesTable.ITEM_ALL_CHECKED))
- || (optionText.contains(FeatureDialogFeaturesTable.ITEM_PART_CHECKED))) {
-
- // check detail feature
- if (feature.getData().getFeatureType() == SettingConstants.FEATURE_TYPE_DETAIL) {
- featureValue = addDetailFeature(table.getItem(i));
- } else { // main, sub fearue
- featureValue = new FeatureValueData(feature);
- }
- list.add(featureValue);
- }
- }
- target.setSelectedFeatureList(list);
- }
-
- /**
- * Make sure that the feature has changed in the table.
- *
- * @param table feature table
- * @return Whether the change of feature
- */
- public boolean changedFeaturesFromTableItemsList(Grid table) {
- TargetData target = SettingDataManager.INSTANCE.getTarget(null);
- int count = 0;
-
- for (int i = 0; i < table.getItemCount(); i++) {
- String featureName = table.getItem(i).getText(0);
- String optionText = table.getItem(i).getText(1);
-
- Feature feature = Feature.getFeature(featureName);
- if ((optionText.contains(FeatureDialogFeaturesTable.ITEM_ALL_CHECKED))
- || (optionText.contains(FeatureDialogFeaturesTable.ITEM_PART_CHECKED))) {
- count++;
-
- // check detail feature
- if (feature.getData().getFeatureType() == SettingConstants.FEATURE_TYPE_DETAIL) {
- if (changedDetailFeature(table.getItem(i), target) == true) {
- return true;
- }
- } else { // main, sub fearue
- if (target.isSelectedFeature(feature) == false) {
- return true;
- }
- }
- }
- }
-
- if (target.getSelectedFeatureList().size() != count) {
- return true;
- }
- return false;
- }
-
- public boolean validInputText(Grid table) {
- for (int i = 0; i < table.getItemCount(); i++) {
- String optionText = table.getItem(i).getText(1);
-
- if ((optionText.contains(FeatureDialogFeaturesTable.ITEM_ALL_CHECKED))
- || (optionText.contains(FeatureDialogFeaturesTable.ITEM_PART_CHECKED))) {
- if (optionText.contains(FeatureDialogFeaturesTable.FEATURE_INVALID_VALUE)) {
- return false;
- }
- }
- }
- return true;
- }
-
- private FeatureValueData addDetailFeature(GridItem item) {
- FeatureValueData featureValue = null;
- String featureName = item.getText(0);
- Feature feature = Feature.getFeature(featureName);
-
- if ((ConfigureLabels.FEATURE_DETAIL_VALUE_SYSTEM_SAMPLING_RATE.equals(featureName))
- || (ConfigureLabels.FEATURE_DETAIL_VALUE_FUNCTION_SAMPLING_RATE.equals(featureName))) {
- int tableValue = Integer.parseInt(getOptionText(item, ConfigureLabels.SAMPLING));
- featureValue = new FeatureValueData(feature);
- featureValue.setValue(tableValue);
- }
- return featureValue;
- }
-
- private boolean changedDetailFeature(GridItem item, TargetData target) {
- String featureName = item.getText(0);
-
- if ((ConfigureLabels.FEATURE_DETAIL_VALUE_SYSTEM_SAMPLING_RATE.equals(featureName))
- || (ConfigureLabels.FEATURE_DETAIL_VALUE_FUNCTION_SAMPLING_RATE.equals(featureName))) {
- int value = target.getSelectedFeatureValue(Feature.getFeature(featureName));
- int tableValue = Integer.parseInt(getOptionText(item, ConfigureLabels.SAMPLING));
- if (value != tableValue) {
- return true;
- }
- }
- return false;
- }
-
- private String getOptionText(GridItem item, String optionName) {
- String value = null;
- if (item.getText(1).contains(optionName)) {
- String[] optionList = item.getText(1).split(optionName);
- if (optionList.length > 1) {
- if (optionList[1].contains(CommonConstants.COMMA)) {
- String[] optionList2 = optionList[1].split(CommonConstants.COMMA);
- value = optionList2[0];
- } else {
- value = optionList[1];
- }
- }
- }
- return value;
- }
-}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Heeyoung Hwang <heeyoung1008.hwang@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.ui.toolbar.setting;
-
-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.events.VerifyEvent;
-import org.eclipse.swt.events.VerifyListener;
-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.common.DAState;
-import org.tizen.dynamicanalyzer.constant.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.setting.Feature;
-import org.tizen.dynamicanalyzer.setting.FeatureData;
-import org.tizen.dynamicanalyzer.setting.SettingDataManager;
-import org.tizen.dynamicanalyzer.widgets.button.checkbox.DACheckBox;
-import org.tizen.dynamicanalyzer.widgets.button.checkbox.DACheckboxSelectionListener;
-import org.tizen.dynamicanalyzer.widgets.da.base.DATextBox;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
-
-public class SettingDialogOptionPage extends DAPageComposite {
- public static final String ID = SettingDialogOptionPage.class.getName();
-
- private DACheckBox autoStopCheckBox = null;
- private DACheckBox recordingCheckBox = null;
-
- private DACheckBox onSceneTransitionCheckBox = null;
- private DACheckBox periodicallyCheckBox = null;
- private DATextBox periodicallyTextBox = null;
- private Label periodicallyTextBoxLabel = null;
- private Label periodicallyInfo = null;
-
- private boolean isValidInputValue = true;
-
- public SettingDialogOptionPage(Composite parent, int style) {
-
- super(parent, style);
- setTitle(AnalyzerLabels.COOLBAR_AREA_CONFIGURATION_OPTION);
- this.setLayout(new FormLayout());
- this.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
-
- // Configuration Setting
- Label settingLabel = new Label(this, SWT.TRANSPARENT);
- settingLabel.setText(ConfigureLabels.SETTING_OPTION_TAB_DESCRIPTION);
- settingLabel.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
- settingLabel.setForeground(ColorResources.DEFAULT_FONT_COLOR);
- settingLabel.setFont(FontResources.SETTING_TITLE_FONT);
- FormData data = new FormData();
- data.top = new FormAttachment(0, 14);
- data.left = new FormAttachment(0, 8);
- data.height = 18;
- settingLabel.setLayoutData(data);
-
- this.addPaintListener(new PaintListener() {
-
- @Override
- public void paintControl(PaintEvent e) {
- Composite comp = (Composite) e.widget;
- Rectangle rect = comp.getClientArea();
-
- Rectangle r = new Rectangle(8, 41, rect.width - 16, 23);
- e.gc.setForeground(ColorResources.SETTING_STROKE);
- e.gc.drawRectangle(r);
- e.gc.setBackground(ColorResources.SETTING_TITLE_BACKGROUND);
- e.gc.fillRectangle(9, 42, rect.width - 18, 21);
-
- r = new Rectangle(8, 124, rect.width - 16, 23);
- e.gc.drawRectangle(r);
- e.gc.fillRectangle(9, 125, rect.width - 18, 21);
- }
- });
-
- createRcording();
- createScreenShot();
-
- // check running state
- if (!DAState.isStartable()) {
- this.setEnabled(false);
- }
- }
-
- public void createRcording() {
- // recording title label
- Label recordingTitleLabel = new Label(this, SWT.TRANSPARENT);
- FormData data = new FormData();
- data.top = new FormAttachment(0, 45);
- data.left = new FormAttachment(0, 16);
- data.height = 18;
- data.width = 120;
- recordingTitleLabel.setLayoutData(data);
- recordingTitleLabel.setText(ConfigureLabels.SETTING_DIALOG_RECORDING_REPLAY);
- recordingTitleLabel.setBackground(ColorResources.SETTING_TITLE_BACKGROUND);
- recordingTitleLabel.setForeground(ColorResources.DEFAULT_FONT_COLOR);
- recordingTitleLabel.setFont(FontResources.SETTING_TITLE_FONT);
- recordingTitleLabel.setAlignment(SWT.LEFT);
-
- // feature : recording
- recordingCheckBox = new DACheckBox(this, SWT.NONE);
- data = new FormData();
- data.top = new FormAttachment(recordingTitleLabel, 4);
- data.left = new FormAttachment(0, 19);
- data.height = 22;
- data.width = 16;
- recordingCheckBox.setLayoutData(data);
- recordingCheckBox.setForeground(ColorResources.BLACK);
- recordingCheckBox
- .setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
- recordingCheckBox.setText(ConfigureLabels.FEATURE_NAME_RECORDING);
- recordingCheckBox.addSelectionListener(recordingCheckBoxListener);
- recordingCheckBox.setChecked(SettingDataManager.INSTANCE
- .isOptionsSelectedFeature(Feature.RECORDING));
-
- Label recordingLabel = new Label(this, SWT.TRANSPARENT);
- recordingLabel.setText(ConfigureLabels.FEATURE_NAME_RECORDING);
- recordingLabel
- .setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
- recordingLabel.setForeground(ColorResources.BLACK);
- recordingLabel.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
- data = new FormData();
- data.top = new FormAttachment(recordingTitleLabel, 7);
- data.left = new FormAttachment(0, 42);
- recordingLabel.setLayoutData(data);
-
- // recording autoStop
- autoStopCheckBox = new DACheckBox(this, SWT.NONE);
- data = new FormData();
- data.top = new FormAttachment(recordingCheckBox, 4);
- data.left = new FormAttachment(0, 19);
- data.height = 22;
- data.width = 16;
- autoStopCheckBox.setLayoutData(data);
- autoStopCheckBox.setForeground(ColorResources.BLACK);
- autoStopCheckBox
- .setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
- autoStopCheckBox.setText(ConfigureLabels.SETTING_OPTION_AUTO_STOP);
- autoStopCheckBox.addSelectionListener(autoStopCheckBoxListener);
- autoStopCheckBox.setChecked(SettingDataManager.INSTANCE
- .isOptionsSelectedFeature(Feature.AUTO_STOP));
-
- Label autoStopLabel = new Label(this, SWT.TRANSPARENT);
- autoStopLabel.setText(ConfigureLabels.SETTING_OPTION_AUTO_STOP);
- autoStopLabel
- .setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
- autoStopLabel.setForeground(ColorResources.BLACK);
- autoStopLabel.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
- data = new FormData();
- data.top = new FormAttachment(recordingCheckBox, 7);
- data.left = new FormAttachment(0, 42);
- autoStopLabel.setLayoutData(data);
-
- if(!SettingDataManager.INSTANCE.isOptionsSelectedFeature(Feature.RECORDING)){
- autoStopCheckBox.setChecked(false);
- autoStopCheckBox.setEnabled(false);
- }
- }
-
- public void createScreenShot() {
- // screenshot title label
- Label screenshotTitleLabel = new Label(this, SWT.TRANSPARENT);
- FormData data = new FormData();
- data.top = new FormAttachment(0, 128);
- data.left = new FormAttachment(0, 16);
- data.height = 18;
- data.width = 120;
- screenshotTitleLabel.setLayoutData(data);
- screenshotTitleLabel.setText(ConfigureLabels.SETTING_DIALOG_SCREENSHOT);
- screenshotTitleLabel.setBackground(ColorResources.SETTING_TITLE_BACKGROUND);
- screenshotTitleLabel.setForeground(ColorResources.DEFAULT_FONT_COLOR);
- screenshotTitleLabel.setFont(FontResources.SETTING_TITLE_FONT);
- screenshotTitleLabel.setAlignment(SWT.LEFT);
-
- // on scene transition
- onSceneTransitionCheckBox = new DACheckBox(this, SWT.NONE);
- data = new FormData();
- data.top = new FormAttachment(screenshotTitleLabel, 4);
- data.left = new FormAttachment(0, 19);
- data.height = 22;
- data.width = 16;
- onSceneTransitionCheckBox.setLayoutData(data);
- onSceneTransitionCheckBox.setForeground(ColorResources.BLACK);
- onSceneTransitionCheckBox
- .setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
- onSceneTransitionCheckBox
- .setText(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_ON_SCENE_TRANSITION);
- onSceneTransitionCheckBox.addSelectionListener(onSceneTransitionCheckBoxListener);
- onSceneTransitionCheckBox.setChecked(SettingDataManager.INSTANCE
- .isOptionsSelectedFeature(Feature.SCREENSHOT_ON_SCENE_TRANSITION));
-
- Label onSceneTransitionLabel = new Label(this, SWT.TRANSPARENT);
- onSceneTransitionLabel
- .setText(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_ON_SCENE_TRANSITION);
- onSceneTransitionLabel
- .setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
- onSceneTransitionLabel.setForeground(ColorResources.BLACK);
- onSceneTransitionLabel.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
- data = new FormData();
- data.top = new FormAttachment(screenshotTitleLabel, 7);
- data.left = new FormAttachment(0, 42);
- onSceneTransitionLabel.setLayoutData(data);
-
- // periodically
- periodicallyCheckBox = new DACheckBox(this, SWT.NONE);
- data = new FormData();
- data.top = new FormAttachment(onSceneTransitionCheckBox, 0);
- data.left = new FormAttachment(0, 19);
- data.height = 22;
- data.width = 16;
- periodicallyCheckBox.setLayoutData(data);
- periodicallyCheckBox.setForeground(ColorResources.BLACK);
- periodicallyCheckBox
- .setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
- periodicallyCheckBox.setText(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_PERIODICALLY);
- periodicallyCheckBox.addSelectionListener(periodicallyCheckBoxListener);
- boolean isSelectedFeature = SettingDataManager.INSTANCE
- .isOptionsSelectedFeature(Feature.SCREENSHOT_PERIODICALLY);
- periodicallyCheckBox.setChecked(isSelectedFeature);
-
- Label periodicallyLabel = new Label(this, SWT.TRANSPARENT);
- periodicallyLabel.setText(ConfigureLabels.FEATURE_DETAIL_VALUE_SCREENSHOT_PERIODICALLY);
- periodicallyLabel.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
- periodicallyLabel.setForeground(ColorResources.BLACK);
- periodicallyLabel.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
- data = new FormData();
- data.top = new FormAttachment(onSceneTransitionCheckBox, 3);
- data.left = new FormAttachment(0, 42);
- data.width = 75;
- periodicallyLabel.setLayoutData(data);
-
- // text box
- periodicallyTextBox = new DATextBox(this, SWT.SINGLE);
- data = new FormData();
- data.top = new FormAttachment(onSceneTransitionCheckBox, 3);
- data.left = new FormAttachment(periodicallyLabel, 0);
- data.width = 48;
- data.height = 16;
- periodicallyTextBox.setLayoutData(data);
- periodicallyTextBox.setForeground(ColorResources.SETTING_COLOR);
- periodicallyTextBox.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
- periodicallyTextBox.setText(String.valueOf(SettingDataManager.INSTANCE
- .getOptionsFeatureValue(Feature.SCREENSHOT_PERIODICALLY)));
- periodicallyTextBox.getControl().addKeyListener(periodicallyTextBoxKeyListener);
- periodicallyTextBox.setTextTooltip(true);
- periodicallyTextBox
- .setTextTooltipMessage(ConfigureLabels.FEATURE_OVERHEAD_RANKING_INPUT_VALUE);
-
- periodicallyTextBox.getControl().addVerifyListener(new VerifyListener() {
- public void verifyText(VerifyEvent e) {
- e.doit = e.text.matches("[0-9]*");
- }
- });
-
- // label
- periodicallyTextBoxLabel = new Label(this, SWT.TRANSPARENT);
- periodicallyTextBoxLabel.setText(ConfigureLabels.SECOND);
- data = new FormData();
- data.top = new FormAttachment(onSceneTransitionCheckBox, 5);
- data.left = new FormAttachment(periodicallyTextBox.getControl(), 4);
- data.width = 70;
- data.height = 16;
- periodicallyTextBoxLabel.setLayoutData(data);
- periodicallyTextBoxLabel.setForeground(ColorResources.SETTING_COLOR);
- periodicallyTextBoxLabel.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
- periodicallyTextBoxLabel
- .setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
-
- // waring label
- periodicallyInfo = new Label(this, SWT.TRANSPARENT);
- data = new FormData();
- data.top = new FormAttachment(onSceneTransitionCheckBox, 5);
- data.left = new FormAttachment(periodicallyTextBoxLabel, 0);
- data.width = 250;
- data.height = 16;
- periodicallyInfo.setLayoutData(data);
- periodicallyInfo.setForeground(ColorResources.SETTING_WARNING_FONT_COLOR);
- periodicallyInfo.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
- periodicallyInfo.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
-
- // check status : periodicallyCheckBox
- if (isSelectedFeature) {
- periodicallyTextBox.getControl().setEnabled(true);
- isValidInputValue = checkValidInputText(Feature.SCREENSHOT_PERIODICALLY,
- periodicallyTextBox, periodicallyInfo);
- } else {
- periodicallyTextBox.getControl().setEnabled(false);
- periodicallyInfo.setText(CommonConstants.EMPTY);
- }
- }
-
- private DACheckboxSelectionListener autoStopCheckBoxListener = new DACheckboxSelectionListener() {
- @Override
- public void handleSelectionEvent(DACheckBox checkbox) {
- SettingDataManager setting = SettingDataManager.INSTANCE;
- if (setting.isOptionsSelectedFeature(Feature.AUTO_STOP)) {
- setting.deleteOptionsSelectedFeature(Feature.AUTO_STOP);
- autoStopCheckBox.setChecked(false);
- } else {
- setting.addOptionsSelectedFeature(Feature.AUTO_STOP, 0);
- autoStopCheckBox.setChecked(true);
- }
- }
- };
-
- private DACheckboxSelectionListener recordingCheckBoxListener = new DACheckboxSelectionListener() {
- @Override
- public void handleSelectionEvent(DACheckBox checkbox) {
- SettingDataManager setting = SettingDataManager.INSTANCE;
- // Auto-stop option is only available when recording option is checked
- if (setting.isOptionsSelectedFeature(Feature.RECORDING)) {
- setting.deleteOptionsSelectedFeature(Feature.RECORDING);
- recordingCheckBox.setChecked(false);
- if (setting.isOptionsSelectedFeature(Feature.AUTO_STOP)) {
- setting.deleteOptionsSelectedFeature(Feature.AUTO_STOP);
- autoStopCheckBox.setChecked(false);
- }
- autoStopCheckBox.setEnabled(false);
- } else {
- setting.addOptionsSelectedFeature(Feature.RECORDING, 0);
- recordingCheckBox.setChecked(true);
- autoStopCheckBox.setEnabled(true);
- }
- }
- };
-
- private DACheckboxSelectionListener onSceneTransitionCheckBoxListener = new DACheckboxSelectionListener() {
- @Override
- public void handleSelectionEvent(DACheckBox checkbox) {
- SettingDataManager setting = SettingDataManager.INSTANCE;
- if (setting.isOptionsSelectedFeature(Feature.SCREENSHOT_ON_SCENE_TRANSITION)) {
- setting.deleteOptionsSelectedFeature(Feature.SCREENSHOT_ON_SCENE_TRANSITION);
- onSceneTransitionCheckBox.setChecked(false);
- } else {
- setting.addOptionsSelectedFeature(Feature.SCREENSHOT_ON_SCENE_TRANSITION, 0);
- onSceneTransitionCheckBox.setChecked(true);
- }
- }
- };
-
- private DACheckboxSelectionListener periodicallyCheckBoxListener = new DACheckboxSelectionListener() {
- @Override
- public void handleSelectionEvent(DACheckBox checkbox) {
- SettingDataManager setting = SettingDataManager.INSTANCE;
- if (setting.isOptionsSelectedFeature(Feature.SCREENSHOT_PERIODICALLY)) {
- setting.deleteOptionsSelectedFeature(Feature.SCREENSHOT_PERIODICALLY);
- periodicallyCheckBox.setChecked(false);
- periodicallyTextBox.getControl().setEnabled(false);
- periodicallyInfo.setText(CommonConstants.EMPTY);
- isValidInputValue = true;
- } else {
- // set init Feature Value
- int value = setting.getOptionsFeaturInitValue(Feature.SCREENSHOT_PERIODICALLY);
- setting.addOptionsSelectedFeature(Feature.SCREENSHOT_PERIODICALLY, value);
- periodicallyCheckBox.setChecked(true);
- periodicallyTextBox.getControl().setEnabled(true);
- isValidInputValue = checkValidInputText(Feature.SCREENSHOT_PERIODICALLY,
- periodicallyTextBox, periodicallyInfo);
- }
- }
- };
-
- private KeyListener periodicallyTextBoxKeyListener = new KeyListener() {
-
- @Override
- public void keyReleased(KeyEvent e) {
- // check validation input text
- isValidInputValue = checkValidInputText(Feature.SCREENSHOT_PERIODICALLY,
- periodicallyTextBox, periodicallyInfo);
- if (isValidInputValue) {
- SettingDataManager.INSTANCE.addOptionsSelectedFeature(
- Feature.SCREENSHOT_PERIODICALLY,
- Integer.parseInt(periodicallyTextBox.getText()));
- }
- }
-
- @Override
- public void keyPressed(KeyEvent e) {
- }
- };
-
- private boolean checkValidInputText(Feature feature, DATextBox textBox, Label info) {
- FeatureData featureData = feature.getData();
- String errormsg = featureData.validateInputValue(textBox.getText());
- info.setText(errormsg);
- if (!errormsg.isEmpty()) {
- return false;
- } else {
- return true;
- }
- }
-
- public boolean isValidInputValue() {
- return isValidInputValue;
- }
-
- public void revertInputValue() {
- int value = SettingDataManager.INSTANCE
- .getOptionsFeaturInitValue(Feature.SCREENSHOT_PERIODICALLY);
-
- periodicallyTextBox.setText(String.valueOf(value));
- periodicallyInfo.setText(CommonConstants.EMPTY);
- isValidInputValue = true;
-
- SettingDataManager.INSTANCE.addOptionsSelectedFeature(Feature.SCREENSHOT_PERIODICALLY,
- Integer.parseInt(periodicallyTextBox.getText()));
-
- }
-}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Heeyoung Hwang <heeyoung1008.hwang@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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.setting;
-
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.ScrolledComposite;
-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.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Composite;
-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.tizen.dynamicanalyzer.common.DAState;
-import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
-import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
-import org.tizen.dynamicanalyzer.nl.WidgetLabels;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.resources.FontResources;
-import org.tizen.dynamicanalyzer.resources.ImageResources;
-import org.tizen.dynamicanalyzer.setting.SettingDataManager;
-import org.tizen.dynamicanalyzer.setting.TargetData;
-import org.tizen.dynamicanalyzer.setting.Template;
-import org.tizen.dynamicanalyzer.setting.TemplateData;
-import org.tizen.dynamicanalyzer.util.CommonUtil;
-import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
-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.button.toggle.DACustomToggleButtonGroup;
-import org.tizen.dynamicanalyzer.widgets.da.base.DAButton;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
-
-public class SettingDialogTemplatePage extends DAPageComposite {
- private enum ProfileDisplayInfo {
- PROFILE_NAME_MOBILE(0, ConfigureLabels.TARGET_NAME_MOBILE,
- ImageResources.TARGET_NAME_MOBILE),
- PROFILE_NAME_TV(1, ConfigureLabels.TARGET_NAME_TV, ImageResources.TARGET_NAME_TV),
- PROFILE_NAME_WEARABLE(2, ConfigureLabels.TARGET_NAME_WEARABLE,
- ImageResources.TARGET_NAME_WEARABLE);
-
- private int id = -1;
- private String displayName = null;
- private Image image = null;
-
- private ProfileDisplayInfo(int id, String displayName, Image image) {
- this.id = id;
- this.displayName = displayName;
- this.image = image;
- }
-
- public static Image getImage(String displayName) {
- ProfileDisplayInfo[] profiles = ProfileDisplayInfo.values();
- for (ProfileDisplayInfo profile : profiles) {
- if (profile.displayName.equals(displayName)) {
- return profile.image;
- }
- }
- return null;
- }
- };
-
- private enum TemplateDisplayInfo {
- TEMPLATE_NAME_BOTTLENECK(0, ConfigureLabels.TEMPLATE_NAME_BOTTLENECK,
- ImageResources.TEMPLATE_BOTTLENECK_ANALYSIS),
- TEMPLATE_NAME_MEMORY_LEAKS(1, ConfigureLabels.TEMPLATE_NAME_MEMORY_LEAKS,
- ImageResources.TEMPLATE_MEMORY_LEAK),
- TEMPLATE_NAME_PROCESS_ACTIVITY(2, ConfigureLabels.TEMPLATE_NAME_PROCESS_ACTIVITY,
- ImageResources.TEMPLATE_PROCESS_ACTIVITY),
- TEMPLATE_NAME_FILE(3, ConfigureLabels.TEMPLATE_NAME_FILE,
- ImageResources.TEMPLATE_FILE_ANALYSIS),
- TEMPLATE_NAME_THREAD_ACTIVITY(4, ConfigureLabels.TEMPLATE_NAME_THREAD_ACTIVITY,
- ImageResources.TEMPLATE_THREAD_ACTIVITY_ANALYSIS),
- TEMPLATE_NAME_WAIT_STATUS(5, ConfigureLabels.TEMPLATE_NAME_WAIT_STATUS,
- ImageResources.TEMPLATE_WAIT_STATUS_ANALYSIS),
- TEMPLATE_NAME_NETWORK(6, ConfigureLabels.TEMPLATE_NAME_NETWORK,
- ImageResources.TEMPLATE_NETWORK_ANALYSIS),
- TEMPLATE_NAME_OPEN_GL(7, ConfigureLabels.TEMPLATE_NAME_OPEN_GL,
- ImageResources.TEMPLATE_OPEN_GL_ANALYSIS),
- TEMPLATE_NAME_ENERGY(8, ConfigureLabels.TEMPLATE_NAME_ENERGY,
- ImageResources.TEMPLATE_ENERGY),
- TEMPLATE_NAME_HIERARCHY_VIEWER(9, ConfigureLabels.TEMPLATE_NAME_UI_HIERARCHY,
- ImageResources.TEMPLATE_UI_HIERARCHY_ANALYSIS),
- TEMPLATE_NAME_CUSTOM(10, ConfigureLabels.TEMPLATE_NAME_CUSTOM,
- ImageResources.TEMPLATE_CUSTOM);
-
- private int id = -1;
- private String displayName = null;
- private Image image = null;
-
- private TemplateDisplayInfo(int id, String displayName, Image image) {
- this.id = id;
- this.displayName = displayName;
- this.image = image;
- }
-
- public static Image getImage(String displayName) {
- TemplateDisplayInfo[] templates = TemplateDisplayInfo.values();
- for (TemplateDisplayInfo template : templates) {
- if (template.displayName.equals(displayName)) {
- return template.image;
- }
- }
- return null;
- }
- };
-
- // target widget
- private Composite targetComp = null;
- private Label targetLabel = null;
- private ScrolledComposite targetScrolledComposite = null;
- private Composite targetInputComposite = null;
-
- // template title widget
- private Composite templateComp = null;
- private Label templateLabel = null;
- private ScrolledComposite scrolledComposite = null;
- private Composite inputComposite = null;
-
- // template description widget
- private Composite descriptionComp = null;
- private Label templateIcon = null;
- private Label templateNameLabel = null;
- private Label templateDescriptionLabel = null;
-
- // overhead widget
- private Label overheadLabel = null;
- private Label totalOverheadRange = null;
- private Label overheadDescriptionLabel = null;
-
- private DACustomButton detailButton = null;
-
- private DACustomButtonClickEventListener detailButtonListener = new DACustomButtonClickEventListener() {
-
- @Override
- public void handleClickEvent(DACustomButton button) {
- // show feature dialog
- Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell();
- FeatureDialog dialog = new FeatureDialog(shell);
- Object result = dialog.open();
- if (result != null) {
- createTemplateTitleComposite();
- createTemplateDescriptionComposite();
- }
- }
- };
-
- public SettingDialogTemplatePage(Composite parent, int style) {
- super(parent, style);
- setTitle(AnalyzerLabels.COOLBAR_AREA_CONFIGURATION_FEATURES);
- this.setLayout(new FormLayout());
- this.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
-
- // Title
- Label title = new Label(this, SWT.TRANSPARENT);
- title.setText(ConfigureLabels.SETTING_DIALOG_DESCRIPTION);
- title.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
- title.setForeground(ColorResources.DEFAULT_FONT_COLOR);
- title.setFont(FontResources.SETTING_TITLE_FONT);
-
- FormData data = new FormData();
- data.top = new FormAttachment(0, 14);
- data.left = new FormAttachment(0, 8);
- data.height = 18;
- title.setLayoutData(data);
-
- createTargetComposite();
- createTemplateDescriptionComposite();
- createTemplateTitleComposite();
- }
-
- private void initTargetCompositeWidget() {
- if (null != targetLabel) {
- targetLabel.dispose();
- targetLabel = null;
- }
-
- if (null != targetScrolledComposite) {
- targetScrolledComposite.dispose();
- targetScrolledComposite = null;
- }
-
- if (null != targetInputComposite) {
- targetInputComposite.dispose();
- targetInputComposite = null;
- }
- }
-
- private void initTemplateTitleWidget() {
- if (null != templateLabel) {
- templateLabel.dispose();
- templateLabel = null;
- }
-
- if (null != scrolledComposite) {
- scrolledComposite.dispose();
- scrolledComposite = null;
- }
-
- if (null != inputComposite) {
- inputComposite.dispose();
- inputComposite = null;
- }
- }
-
- private void initTemplateDescriptionWidget() {
- if (null != templateIcon) {
- templateIcon.dispose();
- templateIcon = null;
- }
-
- if (null != templateNameLabel) {
- templateNameLabel.dispose();
- templateNameLabel = null;
- }
-
- if (null != templateDescriptionLabel) {
- templateDescriptionLabel.dispose();
- templateDescriptionLabel = null;
- }
-
- if (null != overheadLabel) {
- overheadLabel.dispose();
- overheadLabel = null;
- }
-
- if (null != totalOverheadRange) {
- totalOverheadRange.dispose();
- totalOverheadRange = null;
- }
-
- if (null != overheadDescriptionLabel) {
- overheadDescriptionLabel.dispose();
- overheadDescriptionLabel = null;
- }
-
- if (null != detailButton) {
- detailButton.dispose();
- detailButton = null;
- }
- }
-
- private DACustomToggleButton createToggleButton(Composite composit, Image image,
- Point imagePoint, String title, Point fontPoint, int width, int height,
- int topPosition, int leftPosition) {
-
- DACustomToggleButton toggle = new DACustomToggleButton(composit, SWT.NONE);
- // color and image
- toggle.setColors(ColorResources.SETTING_BUTTON_NORMAL_COLOR,
- ColorResources.SETTING_BUTTON_PUSH_COLOR,
- ColorResources.SETTING_BUTTON_HOVER_COLOR,
- ColorResources.SETTING_BUTTON_DISABLE_COLOR,
- ColorResources.SETTING_BUTTON_TOGGLE_NORMAL_COLOR,
- ColorResources.SETTING_BUTTON_TOGGLE_HOVER_COLOR,
- ColorResources.SETTING_BUTTON_TOGGLE_PUSH_COLOR,
- ColorResources.SETTING_BUTTON_DISABLE_COLOR);
- toggle.setButtonImages(image, image, image, image, image, image, image, image);
- toggle.setButtonImagePoint(imagePoint);
-
- // font
- toggle.setTitle(title);
- toggle.setFontPoint(fontPoint);
- toggle.setFontColors(ColorResources.SETTING_COLOR, ColorResources.SETTING_COLOR,
- ColorResources.SETTING_COLOR, ColorResources.SETTING_COLOR);
- toggle.setButtonFont(FontResources.SETTING_BUTTON_FONT);
-
- // layout
- FormData data = new FormData();
- data.top = new FormAttachment(0, topPosition);
- data.left = new FormAttachment(0, leftPosition);
- data.width = width;
- data.height = height;
- toggle.setLayoutData(data);
-
- return toggle;
- }
-
- public void createTargetComposite() {
- initTargetCompositeWidget();
-
- // Composite
- if (null == targetComp) {
- targetComp = new Composite(this, SWT.NONE);
- targetComp.setLayout(new FormLayout());
- FormData compData = new FormData();
- compData.top = new FormAttachment(0, 41);
- compData.left = new FormAttachment(0, 6);
- compData.width = 86;
- compData.height = 403;
- targetComp.setLayoutData(compData);
- targetComp.setBackground(ColorResources.WHITE);
-
- targetComp.addPaintListener(new PaintListener() {
-
- @Override
- public void paintControl(PaintEvent e) {
- Composite comp = (Composite) e.widget;
- Rectangle rect = comp.getClientArea();
- Rectangle r = new Rectangle(0, 0, rect.width - 1, rect.height - 1);
- e.gc.setForeground(ColorResources.SETTING_STROKE);
- e.gc.drawRectangle(r);
- e.gc.drawLine(0, 22, rect.width - 1, 22);
- e.gc.setBackground(ColorResources.SETTING_TITLE_BACKGROUND);
- e.gc.fillRectangle(1, 1, 84, 21);
- }
- });
- }
-
- // label
- targetLabel = new Label(targetComp, SWT.TRANSPARENT);
- FormData data = new FormData();
- data.top = new FormAttachment(0, 4);
- data.left = new FormAttachment(0, 1);
- data.height = 18;
- data.width = 84;
- targetLabel.setLayoutData(data);
- targetLabel.setText(ConfigureLabels.SETTING_DIALOG_TARGET_TITLE);
- targetLabel.setBackground(ColorResources.SETTING_TITLE_BACKGROUND);
- targetLabel.setForeground(ColorResources.DEFAULT_FONT_COLOR);
- targetLabel.setFont(FontResources.SETTING_TITLE_FONT);
- targetLabel.setAlignment(SWT.CENTER);
-
- // scrolledComposite
- targetScrolledComposite = new ScrolledComposite(targetComp, SWT.BORDER | SWT.V_SCROLL
- | SWT.H_SCROLL);
- targetScrolledComposite.setLayout(new FormLayout());
- data = new FormData();
- data.top = new FormAttachment(targetLabel, 1);
- data.left = new FormAttachment(0, 1);
- data.right = new FormAttachment(100, -1);
- data.bottom = new FormAttachment(100, -1);
- targetScrolledComposite.setLayoutData(data);
- targetScrolledComposite.setExpandHorizontal(true);
- targetScrolledComposite.setExpandVertical(true);
- targetScrolledComposite.setBackground(ColorResources.WHITE);
-
- // composite : input
- targetInputComposite = new Composite(targetScrolledComposite, SWT.NONE);
- targetScrolledComposite.setContent(targetInputComposite);
- targetScrolledComposite.setMinSize(targetInputComposite.computeSize(SWT.DEFAULT,
- SWT.DEFAULT));
- targetScrolledComposite.setShowFocusedControl(true);
- targetInputComposite.setLayout(new FormLayout());
- data = new FormData();
- data.top = new FormAttachment(0, 1);
- data.left = new FormAttachment(0, 1);
- data.right = new FormAttachment(100, -1);
- data.bottom = new FormAttachment(100, -1);
- targetInputComposite.setLayoutData(data);
- targetInputComposite.setBackground(ColorResources.WHITE);
-
- // ToogleButtonGroup
- Map<String, TargetData> targetList = SettingDataManager.INSTANCE.getTargetListMap();
- String selectedTarget = SettingDataManager.INSTANCE.getConnectedTargetOrSelected().getTargetName();
- SettingDataManager.INSTANCE.setSelectedTarget(selectedTarget);
- DACustomToggleButtonGroup targetGroup = new DACustomToggleButtonGroup();
- Point imagePoint = new Point(18, 8);
- Point fontPoint = new Point(-1, 60);
- int topPosition = 4;
- int leftPosition = 3;
-
- for (Map.Entry<String, TargetData> entry : targetList.entrySet()) {
- TargetData target = entry.getValue();
-
- DACustomToggleButton toggle = createToggleButton(targetInputComposite,
- ProfileDisplayInfo.getImage(target.getTargetName()), imagePoint,
- target.getTargetName(), fontPoint, 76, 76, topPosition, leftPosition);
- targetGroup.addToggleButton(toggle);
-
- // listener
- toggle.addListener(SWT.MouseUp, new Listener() {
-
- @Override
- public void handleEvent(Event event) {
- DACustomToggleButton toggleButton = (DACustomToggleButton) event.widget;
- if (toggleButton.isToggled()) {
-
- // set selected target
- SettingDataManager.INSTANCE.setSelectedTarget(toggleButton.getText());
-
- // update template view
- createTemplateTitleComposite();
- createTemplateDescriptionComposite();
- }
- }
- });
-
- // set next position
- topPosition += 80;
-
- // set selection target
- if (selectedTarget.equals(entry.getKey()) == true) {
- targetGroup.setSelection(toggle);
- }
- }
- targetComp.layout(true);
- targetInputComposite.layout();
- targetScrolledComposite.setMinSize(targetInputComposite.computeSize(SWT.DEFAULT,
- SWT.DEFAULT));
-
- if (!DAState.isStartable()) {
- targetComp.setEnabled(false);
- }
- }
-
- public void createTemplateDescriptionComposite() {
- initTemplateDescriptionWidget();
-
- if (null == descriptionComp) {
- // Composite
- descriptionComp = new Composite(this, SWT.NONE);
- descriptionComp.setLayout(new FormLayout());
- FormData compData = new FormData();
- compData.top = new FormAttachment(0, 265);
- compData.left = new FormAttachment(0, 98);
- compData.width = 524;
- compData.height = 179;
- descriptionComp.setLayoutData(compData);
- descriptionComp.setBackground(ColorResources.WHITE);
-
- descriptionComp.addPaintListener(new PaintListener() {
-
- @Override
- public void paintControl(PaintEvent e) {
- Composite comp = (Composite) e.widget;
- Rectangle rect = comp.getClientArea();
- Rectangle r = new Rectangle(0, 0, rect.width - 1, rect.height - 1);
- e.gc.setForeground(ColorResources.SETTING_STROKE);
- e.gc.drawRectangle(r);
- e.gc.drawLine(0, 117, rect.width - 1, 117);
-
- // overhead
- e.gc.drawImage(ImageResources.OVERHEAD_BAR_BG, 90, 130);
- e.gc.drawImage(ImageResources.OVERHEAD_BAR, 91, 133);
- }
- });
- }
-
- TargetData target = SettingDataManager.INSTANCE.getTarget(null);
- TemplateData template = target.getSelectedTemplate().getData();
-
- // image
- templateIcon = new Label(descriptionComp, SWT.TRANSPARENT);
- templateIcon.setImage(TemplateDisplayInfo.getImage(template.getTemplateName()));
- FormData data = new FormData();
- data.left = new FormAttachment(0, 21);
- data.top = new FormAttachment(0, 16);
- data.width = 40;
- data.height = 40;
- templateIcon.setLayoutData(data);
- templateIcon.setBackground(ColorResources.WHITE);
-
- // label : templateName
- templateNameLabel = new Label(descriptionComp, SWT.TRANSPARENT);
- data = new FormData();
- data.top = new FormAttachment(0, 16);
- data.left = new FormAttachment(0, 81);
- data.width = 401;
- data.height = 15;
- templateNameLabel.setLayoutData(data);
- templateNameLabel.setText(template.getTemplateName());
- templateNameLabel.setBackground(ColorResources.WHITE);
- templateNameLabel.setForeground(ColorResources.DEFAULT_FONT_COLOR);
- templateNameLabel.setFont(FontResources.SETTING_TITLE_FONT);
-
- // text : description
- templateDescriptionLabel = new Label(descriptionComp, SWT.WRAP | SWT.READ_ONLY);
- data = new FormData();
- data.top = new FormAttachment(0, 40);
- data.left = new FormAttachment(0, 81);
- data.width = 401;
- data.height = 70;
- templateDescriptionLabel.setLayoutData(data);
- templateDescriptionLabel.setText(template.getDescription());
- templateDescriptionLabel.setBackground(ColorResources.WHITE);
- templateDescriptionLabel.setForeground(ColorResources.SETTING_COLOR);
- templateDescriptionLabel.setFont(FontResources.SETTING_DESCRIPTION_FONT);
-
- // label : overhead
- overheadLabel = new Label(descriptionComp, SWT.TRANSPARENT);
- data = new FormData();
- data.top = new FormAttachment(0, 130);
- data.left = new FormAttachment(0, 9);
- data.width = 80;
- data.height = 20;
- overheadLabel.setLayoutData(data);
- overheadLabel.setText(ConfigureLabels.SETTING_DIALOG_OVERHEAD);
- overheadLabel.setBackground(ColorResources.WHITE);
- overheadLabel.setForeground(ColorResources.DEFAULT_FONT_COLOR);
- overheadLabel.setFont(FontResources.SETTING_TITLE_FONT);
-
- // update total overhead range
- updateTotalOverheadRange();
-
- // label : overhead description
- overheadDescriptionLabel = new Label(descriptionComp, SWT.WRAP | SWT.READ_ONLY);
- data = new FormData();
- data.top = new FormAttachment(0, 153);
- data.left = new FormAttachment(0, 90);
- data.width = 350;
- data.height = 20;
- overheadDescriptionLabel.setLayoutData(data);
- overheadDescriptionLabel.setText(ConfigureLabels.SETTING_DIALOG_OVERHEAD_DESCRIPTION);
- overheadDescriptionLabel.setBackground(ColorResources.WHITE);
- overheadDescriptionLabel.setForeground(ColorResources.SETTING_COLOR);
- overheadDescriptionLabel.setFont(FontResources.SETTING_DESCRIPTION_FONT);
-
- detailButton = new DAButton(descriptionComp, SWT.NONE);
- detailButton.addClickListener(detailButtonListener);
- detailButton.setText(WidgetLabels.DETAIL);
- detailButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT);
- data = new FormData();
- data.top = new FormAttachment(0, 130);
- data.right = new FormAttachment(100, -9);
- data.width = 100;
- data.height = 22;
- detailButton.setLayoutData(data);
-
- descriptionComp.layout(true);
- }
-
- public void updateTotalOverheadRange() {
- SettingDataManager setting = SettingDataManager.INSTANCE;
- TargetData target = setting.getTarget(null);
-
- if (null != totalOverheadRange) {
- totalOverheadRange.dispose();
- totalOverheadRange = null;
- }
-
- int totalOverheadRangeCount = setting.getTotalOverheadRangeCount();
- int width = 200 / totalOverheadRangeCount;
- int totalOverheadRangeValue = setting.getSelectedOverheadLevel(target.getTargetName());
- int startPosition = 91 + (width * totalOverheadRangeValue);
-
- totalOverheadRange = new Label(descriptionComp, SWT.TRANSPARENT);
- FormData data = new FormData();
- data.top = new FormAttachment(0, 133);
- data.left = new FormAttachment(0, startPosition);
- data.width = width * (totalOverheadRangeCount - totalOverheadRangeValue);
- data.height = 10;
- totalOverheadRange.setLayoutData(data);
- totalOverheadRange.setBackground(ColorResources.SETTING_OVERHEAD_BACKGROUND);
-
- descriptionComp.layout(true);
- }
-
- public void createTemplateTitleComposite() {
- initTemplateTitleWidget();
-
- // Composite
- if (null == templateComp) {
- templateComp = new Composite(this, SWT.NONE);
- templateComp.setLayout(new FormLayout());
- FormData compData = new FormData();
- compData.top = new FormAttachment(0, 41);
- compData.left = new FormAttachment(0, 98);
- compData.width = 524;
- compData.height = 218;
- templateComp.setLayoutData(compData);
- templateComp.setBackground(ColorResources.WHITE);
-
- templateComp.addPaintListener(new PaintListener() {
-
- @Override
- public void paintControl(PaintEvent e) {
- Composite comp = (Composite) e.widget;
- Rectangle rect = comp.getClientArea();
- Rectangle r = new Rectangle(0, 0, rect.width - 1, rect.height - 1);
- e.gc.setForeground(ColorResources.SETTING_STROKE);
- e.gc.drawRectangle(r);
- e.gc.drawLine(0, 22, rect.width - 1, 22);
-
- e.gc.setBackground(ColorResources.SETTING_TITLE_BACKGROUND);
- e.gc.fillRectangle(1, 1, 522, 21);
-
- }
- });
- }
-
- // label : template
- templateLabel = new Label(templateComp, SWT.TRANSPARENT);
- FormData data = new FormData();
- data.top = new FormAttachment(0, 4);
- data.left = new FormAttachment(0, 1);
- data.height = 18;
- data.width = 502;
- templateLabel.setLayoutData(data);
- templateLabel.setText(ConfigureLabels.SETTING_DIALOG_TEMPLATE_TITLE);
- templateLabel.setBackground(ColorResources.SETTING_TITLE_BACKGROUND);
- templateLabel.setForeground(ColorResources.DEFAULT_FONT_COLOR);
- templateLabel.setFont(FontResources.SETTING_TITLE_FONT);
- templateLabel.setAlignment(SWT.CENTER);
-
- // scrolledComposite
- scrolledComposite = new ScrolledComposite(templateComp, SWT.BORDER | SWT.V_SCROLL
- | SWT.H_SCROLL);
- scrolledComposite.setLayout(new FormLayout());
- data = new FormData();
- data.top = new FormAttachment(templateLabel, 1);
- data.left = new FormAttachment(0, 1);
- data.right = new FormAttachment(100, -1);
- data.bottom = new FormAttachment(100, -1);
- scrolledComposite.setLayoutData(data);
- scrolledComposite.setExpandHorizontal(true);
- scrolledComposite.setExpandVertical(true);
- scrolledComposite.setBackground(ColorResources.WHITE);
-
- // composite : input
- inputComposite = new Composite(scrolledComposite, SWT.NONE);
- scrolledComposite.setContent(inputComposite);
- scrolledComposite.setMinSize(inputComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
- scrolledComposite.setShowFocusedControl(true);
- inputComposite.setLayout(new FormLayout());
- data = new FormData();
- data.top = new FormAttachment(0, 1);
- data.left = new FormAttachment(0, 1);
- data.right = new FormAttachment(100, -1);
- data.bottom = new FormAttachment(100, -1);
- inputComposite.setLayoutData(data);
- inputComposite.setBackground(ColorResources.WHITE);
-
- // ToogleButtonGroup
- String selectedTarget = SettingDataManager.INSTANCE.getSelectedTarget();
- DACustomToggleButtonGroup targetGroup = new DACustomToggleButtonGroup();
- Point imagePoint = new Point(23, 8);
- Point fontPoint = new Point(-1, 60);
- int defaultLeftPosition = 21; // linux, mac
- if (CommonUtil.isWin()) {
- defaultLeftPosition = 13;
- }
- int topPosition = 4;
- int leftPosition = defaultLeftPosition;
-
- TargetData target = SettingDataManager.INSTANCE.getTarget(selectedTarget);
- Template selectedTemplate = target.getSelectedTemplate();
- List<Template> templateList = target.getAvailableTemplateList();
- for (int i = 0; i < templateList.size(); i++) {
- TemplateData template = templateList.get(i).getData();
- DACustomToggleButton toggle = createToggleButton(inputComposite,
- TemplateDisplayInfo.getImage(template.getTemplateName()), imagePoint,
- template.getTemplateName(), fontPoint, 92, 76, topPosition, leftPosition);
- targetGroup.addToggleButton(toggle);
-
- // listener
- toggle.addListener(SWT.MouseUp, new Listener() {
-
- @Override
- public void handleEvent(Event event) {
- DACustomToggleButton toggleButton = (DACustomToggleButton) event.widget;
- if (toggleButton.isToggled()) {
- // set select template
- TargetData target = SettingDataManager.INSTANCE.getTarget(null);
- String preSelectedTemplate = target.getSelectedTemplate().getName();
-
- if (!preSelectedTemplate.equals(toggleButton.getText())) {
- Template template = Template.getTemplate(toggleButton.getText());
- target.setSelectedTemplate(template);
- target.changeSelectedFeatureList(template);
-
- // change description
- createTemplateDescriptionComposite();
- }
- }
- }
- });
-
- // set next position
- if (leftPosition + 96 < 480) {
- leftPosition += 96;
- } else {
- leftPosition = defaultLeftPosition;
- topPosition += 79;
- }
-
- // set selection template
- if (templateList.get(i) == selectedTemplate) {
- targetGroup.setSelection(toggle);
- }
- }
-
- templateComp.layout(true);
- inputComposite.layout();
- scrolledComposite.setMinSize(inputComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
-
- if (!DAState.isStartable()) {
- templateComp.setEnabled(false);
- }
- }
-}
import org.tizen.dynamicanalyzer.resources.FontResources;
import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.widgets.button.toggle.DACustomFeatureToggleButton;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DABaseComposite;
-public class TargetDialogAppListPage extends DAPageComposite {
+public class TargetDialogAppListPage extends DABaseComposite {
private final int TextLength = 19;
import org.tizen.dynamicanalyzer.project.PackageInfo;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.resources.FontResources;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DABaseComposite;
import org.tizen.dynamicanalyzer.widgets.helper.Formatter;
import org.tizen.sdblib.IDevice;
import org.tizen.sdblib.exception.SdbCommandRejectedException;
import org.tizen.sdblib.exception.TimeoutException;
import org.tizen.sdblib.receiver.MultiLineReceiver;
-public class TargetDialogInfoPage extends DAPageComposite {
+public class TargetDialogInfoPage extends DABaseComposite {
private final int TextLength = 40;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
import org.tizen.dynamicanalyzer.widgets.button.toggle.DACustomFeatureToggleButton;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DABaseComposite;
import org.tizen.sdblib.receiver.MultiLineReceiver;
-public class TargetDialogTargetPage extends DAPageComposite {
+public class TargetDialogTargetPage extends DABaseComposite {
private enum ProfileDisplayInfo {
PROFILE_NAME_MOBILE(0, ConfigureLabels.TARGET_NAME_FLAT_MOBILE_FOCUS,
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Heeyoung Hwang <heeyoung1008.hwang@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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.setting;
-
-import org.eclipse.swt.SWT;
-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.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.common.DAState;
-import org.tizen.dynamicanalyzer.communicator.IDECommunicator;
-import org.tizen.dynamicanalyzer.handlers.CommonAction;
-import org.tizen.dynamicanalyzer.handlers.UIActionHolder;
-import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
-import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
-import org.tizen.dynamicanalyzer.nl.WidgetLabels;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.resources.FontResources;
-import org.tizen.dynamicanalyzer.resources.ImageResources;
-import org.tizen.dynamicanalyzer.setting.SettingDataManager;
-import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
-import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
-import org.tizen.dynamicanalyzer.widgets.da.base.DAButton;
-import org.tizen.dynamicanalyzer.widgets.da.base.DAMessageBox;
-public class WelcomeDialog extends DAMessageBox {
-
- private DACustomButton okButton = null;
- private DACustomButton cancelButton = null;
- private boolean isApply = false;
-
- private SettingDialogTemplatePage templatesPage = null;
-
- public WelcomeDialog(Shell parentShell) {
- super(parentShell);
- }
-
- private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {
-
- @Override
- public void handleClickEvent(DACustomButton button) {
- isApply = true;
- doApply();
- doRun();
- shell.close(); // close dialog
- }
- };
-
- private DACustomButtonClickEventListener cancelButtonListener = new DACustomButtonClickEventListener() {
-
- @Override
- public void handleClickEvent(DACustomButton button) {
- isApply = true;
- doRevert();
- doRun();
- shell.close(); // close dialog
- }
- };
-
- private void doApply() {
- if (DAState.isStartable()) {
- // add & remove tab view page and (timeline) chart
- UIActionHolder.getUIAction().setUIElementsBySetting();
-
- // write setting data
- SettingDataManager.INSTANCE.applySettingData();
- }
- }
-
- private void doRevert() {
- if (DAState.isStartable()) {
- // rollback setting data
- SettingDataManager.INSTANCE.revertSettingData();
- }
- }
-
- private void doRun() {
- if (DAState.isStartable()) {
- CommonAction.configure();
- }
- }
-
- protected boolean run() {
- IDECommunicator.setOpenWelcomeDlg(true);
- shell.setSize(611, 558);
- shell.setLayout(new FormLayout());
- shell.setText(AnalyzerLabels.SETTING_TITLE);
- shell.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
-
- // banner
- Label banner = new Label(shell, 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);
-
- // content composite
- Composite contentsComp = new Composite(shell, SWT.NONE);
- FormLayout compLayout = new FormLayout();
- contentsComp.setLayout(compLayout);
- contentsComp.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
-
- 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, -49);
- contentsComp.setLayoutData(compData);
-
- // check exist setting file
- if (SettingDataManager.INSTANCE.isParsingSuccess() == false) {
- Label label = new Label(contentsComp, SWT.NONE);
- label.setForeground(ColorResources.DEFAULT_FONT_COLOR);
- label.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
- label.setFont(FontResources.SETTING_TITLE_FONT);
- label.setText(ConfigureLabels.SETTING_WARNING_MESSAGE_FILE_NOT_FOUND);
-
- shell.addShellListener(shellListener);
- shell.open();
- return true;
- }
-
- templatesPage = new SettingDialogTemplatePage(contentsComp, SWT.NONE);
- 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);
- templatesPage.setLayoutData(compData);
-
- // button composite
- Composite buttonContentsComp = new Composite(shell, SWT.NONE);
- 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);
- buttonContentsComp.addPaintListener(new PaintListener() {
-
- @Override
- public void paintControl(PaintEvent e) {
- Composite comp = (Composite) e.widget;
- Rectangle rect = comp.getClientArea();
- e.gc.setForeground(ColorResources.SETTING_SUNKEN_LINE_1);
- e.gc.drawLine(0, 0, rect.width - 1, 0);
- e.gc.setForeground(ColorResources.SETTING_SUNKEN_LINE_2);
- e.gc.drawLine(0, 1, rect.width - 1, 1);
- }
- });
-
- cancelButton = new DAButton(buttonContentsComp, SWT.NONE);
- cancelButton.addClickListener(cancelButtonListener);
- cancelButton.setText(WidgetLabels.CANCEL);
-
- cancelButton.setButtonFont(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(WidgetLabels.OK);
- okButton.setButtonFont(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);
-
- shell.addShellListener(shellListener);
- shell.open();
- return true;
- }
-
- private void notifyAutoRun() {
- synchronized (IDECommunicator.getWaitingWelcomeDlg()) {
- IDECommunicator.setOpenWelcomeDlg(false);
- IDECommunicator.getWaitingWelcomeDlg().notifyAll();
- }
- }
-
- private ShellListener shellListener = new ShellListener() {
-
- @Override
- public void shellActivated(ShellEvent e) {
-
- }
-
- @Override
- public void shellClosed(ShellEvent e) {
- if (!isApply) {
- doRevert();
- doRun();
- }
- notifyAutoRun();
- }
-
- @Override
- public void shellDeactivated(ShellEvent e) {
-
- }
-
- @Override
- public void shellDeiconified(ShellEvent e) {
-
- }
-
- @Override
- public void shellIconified(ShellEvent e) {
-
- }
- };
-}
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
import org.tizen.dynamicanalyzer.swap.logparser.DataManagerRegistry;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineTableView;
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.widgets.da.view.DAPageComposite;
-import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAContainerComposite;
-public class UIPage extends DAPageComposite {
+public class UIPage extends DAContainerComposite {
public static final String pageID = UIPage.class.getName();
public static final String controlListViewID = UIControlListView.class.getName();
public static final String sceneListViewID = UISceneListView.class.getName();
super(parent, style);
setTitle(AnalyzerLabels.COOLBAR_AREA_UI);
this.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
- this.setData(DAPageComposite.KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_UI_TOOLTIP);
+ this.setData(DAContainerComposite.KEY_TOOLTIP, ShortCutManager.COOLBAR_AREA_UI_TOOLTIP);
this.setLayout(new FillLayout());
baseForm = new SashForm(this, SWT.VERTICAL);
baseForm.setLayout(new FillLayout());
bottomForm.setWeights(new int[] { 77, 23 });
- baseForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- upperForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
- bottomForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
+ baseForm.setSashWidth(SASH_WIDTH);
+ upperForm.setSashWidth(SASH_WIDTH);
+ bottomForm.setSashWidth(SASH_WIDTH);
DataManagerRegistry.registerPageDataManager(UIDataManager.getInstance());
}
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
import org.tizen.dynamicanalyzer.ui.userinterface.UIPage;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
treeComp.setTableToolTipEnable(false);
treeComp.setTableToolTipListener(null);
- contents.addControlListener(new TableColumnSizePackListener(treeComp,
- columnSizes));
}
@Override
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager;
import org.tizen.dynamicanalyzer.ui.userinterface.UIPage;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
treeComp.setColumnVisibility(columnVisibility);
treeComp.setTableToolTipEnable(false);
treeComp.setTableName(UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_NAME);
- contents.addControlListener(new TableColumnSizePackListener(treeComp,
- columnSizes));
}
private void createColumnData() {
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.ui.userinterface.UIPage;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
-import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
tableComp.setColumnVisibility(columnVisibility);
tableComp.setTableToolTipEnable(false);
- contents.addControlListener(new TableColumnSizePackListener(tableComp,
- columnSizes));
-
}
@Override
import org.tizen.dynamicanalyzer.resources.FontResources;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite;
+import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
import org.tizen.dynamicanalyzer.widgets.da.base.DAMessageBox;
public class SearchDialog extends DAMessageBox {
private String viewName = null;
private Composite composite = null;
+ public SearchDialog() {
+ this(WorkbenchUtil.getWorkbenchWindow().getShell(), AnalyzerUtil
+ .getTopPage().getActiveTable());
+ }
+
public SearchDialog(Shell parentShell, Composite comp) {
super(parentShell);
if (comp instanceof DATableComposite) {
--- /dev/null
+package org.tizen.dynamicanalyzer.ui.widgets.table;
+
+import java.util.Map;
+
+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.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Sash;
+import org.tizen.dynamicanalyzer.appearance.DesignConstants;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.setting.SettingDataManager;
+import org.tizen.dynamicanalyzer.ui.page.BaseView;
+import org.tizen.dynamicanalyzer.ui.page.PageInfoRegistry;
+import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
+import org.tizen.dynamicanalyzer.widgets.da.view.DABaseComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAContainerComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DATabComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
+
+/**
+ * Composite that implements standard data page for DA. This page contains time
+ * line charts and data tables. This class encapsulates {@link SashForm} for
+ * main elements of page, initialize them and maintain resize activity.
+ */
+public class DABaseDataPageComposite extends DAContainerComposite {
+
+ public static final double DEFAULT_BOTTOM_FORM_HEIGHT = DesignConstants.TABLE_VIEW_HEIGHT
+ + DesignConstants.TAB_BUTTON_HEIGHT;
+
+ /**
+ * Base form for page. Fill all space inside window, lower tool bar.
+ */
+ protected SashForm baseForm;
+ /**
+ * Form that encapsulates DACharts. Allocated at the top of the
+ * {@link baseForm}.
+ */
+ protected SashForm topForm;
+ /**
+ * Form that encapsulates DATables and other non graphical data. Allocated
+ * at the bottom of the {@link baseForm}.
+ */
+ protected SashForm bottomForm;
+ /**
+ * Right part of {@link bottomForm}.
+ */
+ protected SashForm bottomRightForm;
+ /**
+ * Left part of {@link bottomForm}.
+ */
+ protected SashForm bottomLeftForm;
+
+ /**
+ * Part of bottom composite, specified as a percentage, taken by
+ * leftBottomForm.
+ */
+ int tableWeight = 65;
+
+ /**
+ * Part of base composite, specified as a percentage, taken by bottomForm.
+ */
+ int tableHeight = -1;
+
+ protected static boolean isDetailMode = true;
+ /**
+ * Public constructor. Initialize page and forms for data.
+ *
+ * @param parent parent composite
+ * @param style SWT style definition.
+ */
+ public DABaseDataPageComposite(Composite parent, int style) {
+ super(parent, style);
+
+ baseForm = new SashForm(this, SWT.VERTICAL);
+ baseForm.setLayout(new FillLayout());
+ baseForm.setForeground(ColorResources.WHITE);
+ baseForm.setBackground(ColorResources.WHITE);
+
+ topForm = new SashForm(baseForm, SWT.VERTICAL);
+
+ bottomForm = new SashForm(baseForm, SWT.HORIZONTAL);
+
+ bottomLeftForm = new SashForm(bottomForm, SWT.NONE);
+ bottomLeftForm.setForeground(ColorResources.WHITE);
+ bottomLeftForm.setLayout(new FillLayout());
+
+ bottomRightForm = new SashForm(bottomForm, SWT.NONE);
+ bottomRightForm.setForeground(ColorResources.WHITE);
+ bottomRightForm.setLayout(new FillLayout());
+
+ baseForm.setSashWidth(SASH_WIDTH);
+ bottomForm.setSashWidth(SASH_WIDTH);
+ bottomLeftForm.setSashWidth(SASH_WIDTH);
+ bottomRightForm.setSashWidth(SASH_WIDTH);
+
+ bottomForm.setWeights(new int[] { tableWeight, 100 - tableWeight });
+
+ addTableWeightListener();
+ }
+
+ /**
+ * Actions, that should be performed on Page resize.
+ *
+ * @param width width of resized page
+ * @param height height of resized page
+ */
+ protected void onResized(int width, int height) {
+ // Accurate vertical sizes of topForm and bottomForm
+ addHeightWeightListener(height);
+ if (!isDetailMode) {
+ baseForm.setWeights(new int[] { 100, 0 });
+ } else {
+ int hrate = (tableHeight == -1) ? (int) (DEFAULT_BOTTOM_FORM_HEIGHT * 100 / height)
+ : (int) (tableHeight * 100 / height);
+
+ if (hrate > 100) {
+ return;
+ }
+ baseForm.setWeights(new int[] { 100 - hrate, hrate });
+ }
+
+ resizePageButton();
+ resizeTableButton();
+ }
+
+ private void addHeightWeightListener(int pageHeight) {
+ if (baseForm.getChildren().length > 2) {
+ ((Sash) baseForm.getChildren()[2]).addListener(SWT.MouseUp,
+ new Listener() {
+ @Override
+ public void handleEvent(Event event) {
+ tableHeight = baseForm.getWeights()[1]
+ * baseForm.getSize().y / 1000;
+ }
+ });
+ }
+ }
+
+ private void addTableWeightListener() {
+ ((SashForm) bottomForm.getChildren()[0]).addListener(SWT.Resize,
+ new Listener() {
+ @Override
+ public void handleEvent(Event event) {
+ resizeTableButton();
+ }
+ });
+ }
+
+ /**
+ * Get active table for this page.
+ *
+ * @return instance of {@link DATableComposite} or <code>null</code> if
+ * there is no table on the page
+ */
+ @Override
+ public Composite getActiveTable() {
+ if (activeTabComposite != null)
+ return (Composite) ((DAViewComposite) activeTabComposite
+ .getTopComposite()).getControl();
+ else
+ return null;
+ }
+
+ public SashForm getBaseForm() {
+ return baseForm;
+ }
+
+ public SashForm getTopForm() {
+ return topForm;
+ }
+
+ public SashForm getBottomForm() {
+ return bottomForm;
+ }
+
+ public SashForm getBottomRightForm() {
+ return bottomRightForm;
+ }
+
+ public SashForm getBottomLeftForm() {
+ return bottomLeftForm;
+ }
+
+ /**
+ * Check that weight value is in [0..100] interval and set new
+ * {@link tableWeight} value.
+ *
+ * @param weight weight specified as a percentage.
+ */
+ public void setTableWeight(int weight){
+ if (weight >= 0 && weight <= 100) {
+ this.tableWeight = weight;
+ }
+ }
+
+ /**
+ * Search through children of given composite for instances of {@link DATableComposite}
+ * and call for each of them {@link DATableComposite#resizeColumns()} method to calculate new columns sizes.
+ *
+ * @param parent parent {@link Composite}
+ * @param width width of DATableComposite after resize
+ */
+ private void resizeTablesColumns(Composite parent, int width) {
+ for (Control comp : parent.getChildren()) {
+ if (comp instanceof DATableComposite) {
+ ((DATableComposite) comp).resizeColumns(width);
+ } else if (comp instanceof Composite) {
+ resizeTablesColumns((Composite) comp, width);
+ }
+ }
+ }
+
+ /**
+ * Calculate size of buttons for tables. It is about buttons allocated on
+ * top of bottom form, used to switch between different tables.
+ */
+ public void resizeTableButton() {
+ resizeTableButtonInForm(bottomLeftForm, 0);
+ resizeTableButtonInForm(bottomRightForm, 1);
+ }
+
+ /**
+ * Calculate size of buttons for tables in specified SashForm. It is about
+ * buttons allocated on top of bottom form, used to switch between different
+ * tables.
+ *
+ * @param form specified SashForm
+ * @param index index of specified SashForm in bottomForm
+ */
+ private void resizeTableButtonInForm(SashForm form, int index) {
+ if (form.getChildren().length > 0
+ && form.getChildren()[0] instanceof DATabComposite) {
+ double weight = (double) bottomForm.getWeights()[index] / 1000;
+ int width = (int) (WorkbenchUtil.getWorkbenchWindow().getShell().getBounds().width * weight);
+ ((DATabComposite) form.getChildren()[0]).resizeTableButton(width);
+ resizeTablesColumns(((DATabComposite) form.getChildren()[0]), width);
+ }
+ }
+
+ /**
+ * Calculate size of buttons for pages. It is about buttons allocated on top
+ * of page, used to switch between different pages, like Memory, Timeline,
+ * etc.
+ */
+ private void resizePageButton() {
+ int width = this.getShell().getBounds().width;
+ String targetName = SettingDataManager.INSTANCE
+ .getConnectedTargetOrSelected().getTargetName();
+ int pageCount = PageInfoRegistry.getPageNamesByTarget(targetName)
+ .size();
+ int newWidth = (width / pageCount > DATabComposite.LONG_TAB_WIDTH) ? DATabComposite.LONG_TAB_WIDTH
+ : width / pageCount;
+ ((BaseView) WorkbenchUtil.getViewPart(BaseView.ID)).getMainTab()
+ .updateTabButtonsWidth(newWidth);
+ }
+
+ @Override
+ public void updateView() {
+ for (Map.Entry<String, DABaseComposite> entry : childMap.entrySet()) {
+ entry.getValue().updateView();
+ }
+ if (!isDetailMode) {
+ if (baseForm.getChildren().length > 2) {
+ ((Sash) baseForm.getChildren()[2]).setVisible(false);
+ }
+ } else {
+ if (baseForm.getChildren().length > 2) {
+ ((Sash) baseForm.getChildren()[2]).setVisible(true);
+ }
+ }
+ }
+
+ public static void setDetailMode(boolean isDetail) {
+ isDetailMode = isDetail;
+
+ }
+}
import org.eclipse.nebula.widgets.grid.GridColumn;
import org.eclipse.nebula.widgets.grid.GridItem;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
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.SelectionAdapter;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.FillLayout;
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.resources.ImageResources;
import org.tizen.dynamicanalyzer.swap.model.data.LogData;
import org.tizen.dynamicanalyzer.ui.common.PopupAnalysisMenuItemClickListener;
-import org.tizen.dynamicanalyzer.ui.page.BaseView;
+import org.tizen.dynamicanalyzer.ui.memory.table.MemoryPersistentAllocationsTable;
+import org.tizen.dynamicanalyzer.ui.memory.table.MemoryStatisticsTable;
import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
import org.tizen.dynamicanalyzer.ui.widgets.DAGrid;
import org.tizen.dynamicanalyzer.ui.widgets.FilterDialog;
import org.tizen.dynamicanalyzer.ui.widgets.SearchDialog;
import org.tizen.dynamicanalyzer.util.Logger;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
+import org.tizen.dynamicanalyzer.widgets.da.view.DATabComposite;
+import org.tizen.dynamicanalyzer.widgets.helper.WidgetUtils;
import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenu;
import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuItem;
import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuListener;
private int itemHeightSize = 16;
+ /**
+ * Relative weights of each column.
+ */
+ private double columnWeights[];
+
+ /**
+ * {@code true} when left mouse button is pressed, {@code false} otherwise.
+ */
+ private boolean mousePressed;
+
protected RangeDataManager rangeDataManager = RangeDataManager.getInstance();
+ /**
+ * Length of queue of runnable tasks assigned to the table.
+ */
+ public volatile int taskQueueSize = 0;
protected static final Image filterImg = ImageResources.COLUMN_FILTER_NORMAL;
protected static final int filterImgOffset = 12;
+ private static final int MINIMAL_COLUMN_SIZE = 10;
public DATableComposite(Composite parent, int style) {
this(parent, SWT.NONE, style);
table.setEmptyCellRenderer(new DATableEmptyCellRenderer());
table.setItemHeight(getItemHeightSize());
+ table.addMouseListener(new MouseListener() {
+
+ @Override
+ public void mouseUp(MouseEvent e) {
+ mousePressed = false;
+ }
+
+ @Override
+ public void mouseDown(MouseEvent e) {
+ if (e.button == 1)
+ mousePressed = true;
+ }
+
+ @Override
+ public void mouseDoubleClick(MouseEvent e) {
+ }
+ });
+
setTableLayout();
addMouseMoveListener();
addMouseWheelListener();
public void handleEvent(Event event) {
mousePoint.x = event.x;
mousePoint.y = event.y;
+ if (mousePressed) {
+ columnWeights = null;
+ resizeColumns(table.getSize().x);
+ }
}
});
}
public void widgetDefaultSelected(SelectionEvent e) {
}
});
+
+ table.addFocusListener(new FocusAdapter() {
+ @Override
+ public void focusGained(FocusEvent e) {
+ activateParentTab();
+ }
+ });
}
protected void addKeyListener() {
}
});
}
+ initFilterPopupMenu();
}
public void setColumns(String[] columnNames, int[] headerAlignmentStyle) {
}
table.removeAll();
+ tableClone.clear();
+
+ List<TableInput> input = null;
+ if (isFilter) {
+ input = filteredTable;
+ enableFiltering(false);
+ } else {
+ input = makeTableInput();
+ enableFiltering(true);
+ }
- List<TableInput> input = makeTableInput();
if (null == input || input.isEmpty()) {
return;
}
+ tableClone.addAll(input);
if (null != comparator) {
Collections.sort(input, comparator);
}
int focusIndex = -1;
int size = input.size();
for (int i = 0; i < size; i++) {
+ if ((this instanceof MemoryPersistentAllocationsTable)
+ || (this instanceof MemoryStatisticsTable)) {
+ if (i % 300 == 0) {
+ // for each 300 item check that new update still was not
+ // started.
+ synchronized (this) {
+ if (taskQueueSize > 1) {
+ // This means that another selection was performed.
+ return;
+ }
+ }
+ }
+ }
GridItem gridItem = new GridItem(table, SWT.NONE);
DATableDataFormat gridData = (DATableDataFormat) input.get(i).getData();
gridItem.setData(gridData);
}
public void setContextMenu(final int context) {
- popupMenu = new DATablePopupMenu(table);
- popupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT);
+ if (popupMenu == null) {
+ popupMenu = new DATablePopupMenu(table);
+ popupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT);
+ }
if ((context & AnalyzerConstants.CONTEXT_TABLE_RANGE) != 0) {
+ if(popupMenu.getItems()!=null && !popupMenu.getItems().isEmpty())
+ new DAPopupMenuItem(popupMenu, DAPopupMenuItem.SEPARATOR);
setRangeContext();
}
- if ((context & AnalyzerConstants.CONTEXT_TABLE_RANGE) != 0
- && (context & AnalyzerConstants.CONTEXT_TABLE_SOURCE) != 0) {
- new DAPopupMenuItem(popupMenu, DAPopupMenuItem.SEPARATOR);
- }
if ((context & AnalyzerConstants.CONTEXT_TABLE_SOURCE) != 0) {
+ if(popupMenu.getItems()!=null && !popupMenu.getItems().isEmpty())
+ new DAPopupMenuItem(popupMenu, DAPopupMenuItem.SEPARATOR);
setSourceContext();
}
table.addListener(SWT.MouseDown, new Listener() {
* "show all" item that reverts all filter actions.
*/
protected void initFilterPopupMenu() {
- popupMenu = new DATablePopupMenu(table);
- popupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT);
+ if (this.getTableName().toLowerCase().contains("callstack"))
+ return;
+ if (popupMenu == null) {
+ popupMenu = new DATablePopupMenu(table);
+ popupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT);
+ }
for (int i = 0; i < table.getColumns().length; i++) {
final int index = i;
@Override
public void widgetSelected(DAPopupMenuItem menuItem) {
isFilter = false;
- table.update();
- Display.getDefault().syncExec(new Runnable() {
- @Override
- public void run() {
- BaseView baseView = (BaseView) WorkbenchUtil
- .getViewPart(BaseView.ID);
- baseView.getTopComposite().updateView();
- }
- });
+ updateTable();
}
});
}
* @param categoryIndex index of field
*/
private void filterTable(String input, int categoryIndex) {
-
+ isFilter = true;
filteredTable.clear();
if (tableClone != null) {
for (TableInput table : tableClone) {
if (table.getText().get(categoryIndex).equals(input)) {
filteredTable.add(table);
- isFilter = true;
}
}
}
- table.update();
- Display.getDefault().syncExec(new Runnable() {
- @Override
- public void run() {
- BaseView baseView = (BaseView) WorkbenchUtil
- .getViewPart(BaseView.ID);
- baseView.getTopComposite().updateView();
+ updateTable();
+ }
+
+ /**
+ * Enables or disables filtering buttons according to if it is possible to filter or not.
+ * All pop up menu items can be separated into few groups:
+ * 1) Filtering items, that contains text like "Filter by " + column name.
+ * Them should be enabled if it is possible to filter.
+ * 2) Filter disable item, that contains text "Show all items".
+ * It should be disabled if it is possible to filter.
+ * 3) Other items, that should not be disabled or enabled according to filtering activity.
+ *
+ * @param enable flag indicates whether filtering items should be enabled
+ */
+ private void enableFiltering(boolean enable) {
+ for (DAPopupMenuItem item : popupMenu.getChildren()) {
+ if (item.getText() == null)
+ //To prevent NullPointerException
+ continue;
+ if (item.getText().startsWith(POPUP_FILTER_BY))
+ item.setEnabled(enable);
+ if (item.getText().equals(POPUP_SHOW_ALL_ITEMS))
+ item.setEnabled(!enable);
+ }
+ }
+
+ /**
+ * Propagate table activation to the parent {@link DATabComposite}.
+ */
+ private void activateParentTab() {
+ DATabComposite parentTab = WidgetUtils.getParentOfType(this, DATabComposite.class);
+ if (parentTab != null) {
+ parentTab.activateTab();
+ }
+ }
+
+ /**
+ * Calculate width for each column, based on their weights.
+ *
+ * @param width visible width of table.
+ */
+ public void resizeColumns(int width) {
+ if (columnWeights == null) {
+ setColumnWeights(width);
+ }
+
+ int[] sizes = new int[table.getColumnCount()];
+ for (int i = 0; i < table.getColumnCount(); i++) {
+ if (table.getColumn(i).isVisible()) {
+ double size = columnWeights[i] * width;
+ int w = (int) Math.round(size);
+ sizes[i] = w;
+ } else {
+ sizes[i] = 0;
}
- });
+ }
+ setColumnSize(sizes);
+ }
+
+ /**
+ * Calculate relative weights for each visible column. Weights for
+ * invisibleColumns equals to 0.
+ *
+ * @param width visible width of table.
+ */
+ private void setColumnWeights(int width) {
+ int nominalWidth = 0;
+ for (int i = 0; i < table.getColumnCount(); i++) {
+ if (table.getColumn(i).isVisible())
+ nominalWidth += table.getColumn(i).getWidth();
+ }
+ if (table.getSize().x > 0) {
+ if (table.getSize().x != nominalWidth) {
+ int oldLastWidth = table.getColumn(table.getColumnCount() - 1)
+ .getWidth();
+ oldLastWidth += table.getSize().x - nominalWidth;
+ table.getColumn(table.getColumnCount() - 1).setWidth(
+ max(oldLastWidth, MINIMAL_COLUMN_SIZE));
+ nominalWidth = table.getSize().x;
+ }
+ }
+ columnWeights = new double[table.getColumnCount()];
+ for (int i = 0; i < table.getColumnCount(); i++)
+ if (table.getColumn(i).isVisible())
+ columnWeights[i] = (double) max(table.getColumn(i).getWidth(),
+ MINIMAL_COLUMN_SIZE) / nominalWidth;
+ else
+ columnWeights[i] = 0;
+ }
+
+ private static int max(int a, int b) {
+ return (a > b) ? a : b;
}
}
super.clear();
getExpandMap().clear();
}
+
+ /**
+ * Do nothing for DATreeComposite.
+ */
+ @Override
+ protected void initFilterPopupMenu() {
+ }
}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Jungwook Ryu <jungwook.ryu@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.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);
- }
-}
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.NotEnabledException;
import org.tizen.dynamicanalyzer.util.Logger;
import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
import org.tizen.dynamicanalyzer.widgets.da.view.DABaseComposite;
-import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
+import org.tizen.dynamicanalyzer.widgets.da.view.DAContainerComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DATabComposite;
import org.tizen.dynamicanalyzer.widgets.timeline.MarkerManager;
import org.tizen.dynamicanalyzer.widgets.timeline.markers.IEventListener;
public class AnalyzerUtil {
// FIXME start
private static TimelineChartView timelineComposite;
- private static Map<String, Boolean> latestTraceModeMap = new HashMap<String, Boolean>();
+ private static Map<String, Boolean> latestTraceModeMap = new HashMap<String, Boolean>();
+
+ // LSan lock and condition provided by it
+ private static final Lock lsanLock = new ReentrantLock();
+ private static final Condition lsanCondition = lsanLock.newCondition();
static {
MarkerManager.INSTANCE.addEventListener(new IEventListener() {
});
}
+ public static Lock getLSanLock() {
+ return lsanLock;
+ }
+
+ public static Condition getLSanCondition() {
+ return lsanCondition;
+ }
+
public static TimelineChartView getTimelineComposite() {
return timelineComposite;
}
return baseView.getMainTab();
}
- public static DAPageComposite getTopPage() {
+ public static DAContainerComposite getTopPage() {
BaseView baseView = (BaseView) WorkbenchUtil.getViewPart(BaseView.ID);
return baseView.getTopPage();
}
public static DABaseComposite getView(String pageId, String viewId) {
- DAPageComposite page = (DAPageComposite) getTabPage(pageId);
+ DAContainerComposite page = (DAContainerComposite) getTabPage(pageId);
if(page == null){
return null;
}
+* 2.4.0
+== Maria Guseva <m.guseva@samsung.com> November 16, 2016
+- Add LeakSanitizer preference option for HeapAllocation profiling,
+supported in both GUI and CLI
+- Add filtering popup menu to most non-tree tables
+- Add allocator address to show in Memory Callstack
+- Add 'version' command to DACLI
+- Unify UI for labels of hidden tables
+- Fix Ctrl+F shortcut and search button of toolbar
+- Fix new line constants in CommonConstants
+- Fix known CLI communication issues
+- Fix issues in CLI output formatting
+- Fix Release Note link reference
+- Fix empty fields in GLTexture table
+- Add version information in DA logs
+- Add names for unnamed threads
+- Improve HeapDataManager memory usage
+- Refactor DA*Composite classes
+- Partly cleanup classes for deadcode: AnalyzerLabels, Toolbar,
+OpenTraceProgress, SettingDataManager, MenuBarLabels
+- Delete unused classes/packages: SaveAsDialog, ReplayButton, ReplayEditButton,
+ReplayManager, replayEditor, summary.leaks.
+- Delete unused and duplicated image resources
+- Fix JIRA defects:
+ SPTSDKUX-1970: Resize ratio is not maintained on resizing exclusing and inclusive tab
+ SPTSDKUX-2292: List is unable to scroll in Range table.
+ SPTSDKUX-2454: Startup info is not showing for target Mobile device
+== Maria Guseva <m.guseva@samsung.com> November 16, 2016
* 2.3.21
- Fix JIRA defects:
SPTSDKUX-2442: Unable to Launch web app in target mobile device.
Source:dynamic-analyzer
-Version:2.3.21
+Version:2.4.0
Maintainer:Gihun Chang <gihun.chang@samsung.com>, WooJin Jung <woojin2.jung@samsung.com>, Jaewon Lim <jaewon81.lim@samsung.com>, Seokgil Kang <seokgil.kang@samsung.com>
Package:dynamic-analyzer-product
<modelVersion>4.0.0</modelVersion>
<groupId>org.tizen.dynamicanalyzer</groupId>
<artifactId>dynamic-analyzer</artifactId>
- <version>2.3.21-SNAPSHOT</version>
+ <version>2.4.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>