slicedLog = log[0].split(AnalyzerConstants.DATA_PARSING_TOKEN);
logId = slicedLog[LogCenterConstants.ID_INDEX];
int id = Integer.parseInt(logId);
- if (LogCenterConstants.LOG_DEVICE != id) {
+ if (LogCenterConstants.LOG_DEVICE != id){
+// if (LogCenterConstants.LOG_DEVICE != id && LogCenterConstants.LOG_SNAPSHOT != id) {
if (null == pid) {
pid = slicedLog[LogCenterConstants.PROCESS_ID_INDEX];
} else {
}
}
}
+ if (LogCenterConstants.LOG_SNAPSHOT == id) {
+ System.out.println("break point");
+ }
String currentTime = null;
try {
package org.tizen.dynamicanalyzer.model;
+import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.tizen.dynamicanalyzer.common.DASelectionData;
public class DAView extends Composite implements ViewAction {
protected String name = null;
+ protected int[] oldInnerLayout = null;
+ protected int[] oldOuterLayout = null;
+
+ private int[] innerMaxWeight = null;
+ private int[] outerMaxWeight = null;
public DAView(Composite parent, int style) {
super(parent, style);
// TODO Auto-generated method stub
}
+
@Override
public String getViewName() {
return name;
}
+
+ public void setMaxSize(boolean maximized) {
+
+ if (null == innerMaxWeight || null == outerMaxWeight) {
+ return;
+ }
+
+ Composite parent = getParent();
+ if (!(parent instanceof SashForm)) {
+ parent = parent.getParent();
+ if (!(parent instanceof SashForm)) {
+ return;
+ }
+ }
+
+ Composite pParent = parent.getParent();
+ if (!(pParent instanceof SashForm)) {
+ return;
+ }
+
+ SashForm innerForm = (SashForm) parent;
+ SashForm outerForm = (SashForm) pParent;
+
+ if (maximized) {
+ oldInnerLayout = innerForm.getWeights();
+ oldOuterLayout = outerForm.getWeights();
+ innerForm.setWeights(innerMaxWeight);
+ outerForm.setWeights(outerMaxWeight);
+ } else {
+ innerForm.setWeights(oldInnerLayout);
+ outerForm.setWeights(oldOuterLayout);
+ }
+ }
+
+ public void setMaxWeight(int[] inner, int[] outer) {
+ innerMaxWeight = inner;
+ outerMaxWeight = outer;
+ }
}
/** title bar colors **/\r
public static Color TITLEBAR_TEXT_COLOR = getColor("titlebar_text_color"); //$NON-NLS-1$\r
public static Color TITLEBAR_BG_COLOR = getColor("titlebar_bg"); //$NON-NLS-1$\r
+ public static Color TITLEBAR_START_COLOR = getColor("titlebar_start_color"); //$NON-NLS-1$\r
+ public static Color TITLEBAR_END_COLOR = getColor("titlebar_end_color"); //$NON-NLS-1$\r
+ public static Color TITLEBAR_BOTTOM_STROKE_1 = getColor("titlebar_bottom_stroke_1"); //$NON-NLS-1$\r
+ public static Color TITLEBAR_BOTTOM_STROKE_2 = getColor("titlebar_bottom_stroke_2"); //$NON-NLS-1$\r
\r
/** Coolbar bg color **/\r
public static Color COOLBAR_BG_COLOR = getColor("coolbar_bg_color"); //$NON-NLS-1$\r
/** title bar colors **/\r
TITLEBAR_TEXT_COLOR = getColor("titlebar_text_color"); //$NON-NLS-1$\r
TITLEBAR_BG_COLOR = getColor("titlebar_bg"); //$NON-NLS-1$\r
+ TITLEBAR_START_COLOR = getColor("titlebar_start_color"); //$NON-NLS-1$\r
+ TITLEBAR_END_COLOR = getColor("titlebar_end_color"); //$NON-NLS-1$\r
\r
/** Coolbar bg color **/\r
COOLBAR_BG_COLOR = getColor("coolbar_bg_color"); //$NON-NLS-1$\r
DAThemeBlack() {
super();
name = "black";
-
-
+
// defaule
setColor("blue", new RGB(0, 102, 134));
setColor("green", new RGB(68, 98, 12));
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));
/** title bar colors **/
setColor("titlebar_text_color", new RGB(64, 208, 255)); //$NON-NLS-1$
setColor("titlebar_bg", new RGB(78, 79, 81)); //$NON-NLS-1$
+ setColor("titlebar_start_color", new RGB(103, 103, 104)); //$NON-NLS-1$
+ setColor("titlebar_end_color", new RGB(133, 133, 133)); //$NON-NLS-1$
+ setColor("titlebar_bottom_stroke_1", new RGB(0, 0, 0));
+ setColor("titlebar_bottom_stroke_2", new RGB(128, 128, 128));
/** device and application combo specific colors start **/
setColor("device_application_enable_font", new RGB(255, 255, 255)); //$NON-NLS-1$
setColor("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$
-
+ 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("file_open_end_stop", new RGB(232, 73, 73)); //$NON-NLS-1$
setColor("file_failed_start", new RGB(226, 58, 242)); //$NON-NLS-1$
setColor("file_failed_end", new RGB(164, 40, 176)); //$NON-NLS-1$
- setColor("file_read_start", new RGB(41,162,118)); //$NON-NLS-1$
- setColor("file_read_end", new RGB(6,75,44)); //$NON-NLS-1$
- setColor("file_write_start", new RGB(84,71,214)); //$NON-NLS-1$
- setColor("file_write_end", new RGB(18,17,105)); //$NON-NLS-1$
- setColor("file_other_start", new RGB(255,222,125)); //$NON-NLS-1$
- setColor("file_other_end", new RGB(255,186,29)); //$NON-NLS-1$
-
+ setColor("file_read_start", new RGB(41, 162, 118)); //$NON-NLS-1$
+ setColor("file_read_end", new RGB(6, 75, 44)); //$NON-NLS-1$
+ setColor("file_write_start", new RGB(84, 71, 214)); //$NON-NLS-1$
+ setColor("file_write_end", new RGB(18, 17, 105)); //$NON-NLS-1$
+ setColor("file_other_start", new RGB(255, 222, 125)); //$NON-NLS-1$
+ setColor("file_other_end", new RGB(255, 186, 29)); //$NON-NLS-1$
+
setColor("file_chart_selection_bg_start", new RGB(0, 151, 201)); //$NON-NLS-1$
setColor("file_chart_selection_bg_end", new RGB(0, 151, 201)); //$NON-NLS-1$
setColor("file_chart_parent_bg_start", new RGB(84, 85, 86)); //$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("seriesColorUIEventListener", 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$
-
- /*** scale ***/
+
+ /*** 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$
}
}
-
/** title bar colors **/
setColor("titlebar_text_color", new RGB(64, 208, 255)); //$NON-NLS-1$
setColor("titlebar_bg", new RGB(78, 79, 81)); //$NON-NLS-1$
+ setColor("titlebar_start_color", new RGB(240, 240, 240)); //$NON-NLS-1$
+ setColor("titlebar_end_color", new RGB(165, 165, 165)); //$NON-NLS-1$
+ setColor("titlebar_bottom_stroke_1", new RGB(115, 115, 115));
+ setColor("titlebar_bottom_stroke_2", new RGB(160, 160, 160));
+
/** device and application combo specific colors start **/
setColor("device_application_enable_font", new RGB(0, 0, 0)); //$NON-NLS-1$
public static final String ID = FileApiListView.class.getName();
private String lastSelectionKey = null;
+ int[] innerMaxWeight = { 0, 100 };
+ int[] outerMaxWeight = { 100, 0 };
private String[] columnNames = { FilePageLabels.FILE_API_LIST_VIEW_INDEX,
FilePageLabels.FILE_API_LIST_VIEW_TIME,
ViewContainer viewContainer = new ViewContainer(this, true);
viewContainer.setTitleText(FilePageLabels.FILE_API_LIST_VIEW_TITLE);
+ setMaxWeight(innerMaxWeight, outerMaxWeight);
Composite contents = viewContainer.getContentArea();
contents.setBackground(ColorResources.WINDOW_BG_COLOR);
private int apiCount = 0;
private int failedApiCount = 0;
+ int[] innerMaxWeight = { 0, 100 };
+ int[] outerMaxWeight = { 0, 100 };
+
private void init() {
fileName = AnalyzerLabels.EMPTY_STRING;
filePath = AnalyzerLabels.EMPTY_STRING;
ViewContainer viewContainer = new ViewContainer(this, true);
viewContainer.setTitleText(FilePageLabels.FILE_DETAILS_TITLE);
-
+ setMaxWeight(innerMaxWeight, outerMaxWeight);
+
Composite contents = viewContainer.getContentArea();
contents.setBackground(ColorResources.VIEW_BG_COLOR);
contents.setLayout(new FillLayout());
{
String pathLabel = FilePageLabels.FILE_DETAILS_FILE_PATH;
e.gc.drawString(pathLabel, x, y + fontHeight);
- Point pathSize = e.gc.textExtent(pathLabel,SWT.DRAW_MNEMONIC);
+ Point pathSize = e.gc.textExtent(pathLabel,
+ SWT.DRAW_MNEMONIC);
int xPos = x + pathSize.x;
int width = rect.width - xPos;
String text = filePath;
}
}
+ e.gc.drawString(FilePageLabels.FILE_DETAILS_TOTAL_SIZE
+ + Integer.toString(totalSize), x, y += fontHeight);
+ e.gc.drawString(
+ FilePageLabels.FILE_DETAILS_READ_SIZE
+ + Integer.toString(readSize), x,
+ y += fontHeight);
+ e.gc.drawString(FilePageLabels.FILE_DETAILS_WRITE_SIZE
+ + Integer.toString(writeSize), x, y += fontHeight);
+ e.gc.drawString(FilePageLabels.FILE_DETAILS_TOTAL_USE_TIME
+ + Formatter.toTimeFormat(Long.toString(totalUseTime)),
+ x, y += fontHeight);
+ e.gc.drawString(
+ FilePageLabels.FILE_DETAILS_API_COUNT
+ + Integer.toString(apiCount), x,
+ y += fontHeight);
+ e.gc.drawString(FilePageLabels.FILE_DETAILS_FAILED_API_COUNT
+ + Integer.toString(failedApiCount), x, y += fontHeight);
- e.gc.drawString(FilePageLabels.FILE_DETAILS_TOTAL_SIZE+ Integer.toString(totalSize), x,y += fontHeight);
- e.gc.drawString(FilePageLabels.FILE_DETAILS_READ_SIZE+ Integer.toString(readSize), x,y += fontHeight);
- e.gc.drawString(FilePageLabels.FILE_DETAILS_WRITE_SIZE+ Integer.toString(writeSize), x, y += fontHeight);
- e.gc.drawString(FilePageLabels.FILE_DETAILS_TOTAL_USE_TIME+ Formatter.toTimeFormat(Long.toString(totalUseTime)),x, y += fontHeight);
- e.gc.drawString(FilePageLabels.FILE_DETAILS_API_COUNT+ Integer.toString(apiCount), x, y += fontHeight);
- e.gc.drawString(FilePageLabels.FILE_DETAILS_FAILED_API_COUNT+ Integer.toString(failedApiCount), x, y += fontHeight);
-
}
});
}
writeSize = 0;
apiCount = 0;
failedApiCount = 0;
- if (!item.isParent())
- {
- item = FileChartManager.getInstance().getFileRegister().get(item.getParentKey());
+ if (!item.isParent()) {
+ item = FileChartManager.getInstance().getFileRegister()
+ .get(item.getParentKey());
}
fileName = item.getFileName();
filePath = item.getPath();
int writeSize = 0;
int totalSize = 0;
int size = item.getChildern().size();
- for (int i = 0; i < size; i++)
- {
+ for (int i = 0; i < size; i++) {
FileChartItemData child = item.getChildern().get(i);
readSize += child.getReadSize();
writeSize += child.getWriteSize();
totalSize += child.getTotalSize();
-
- for (int ii = 0; ii < child.getData().size(); ii++)
- {
+
+ for (int ii = 0; ii < child.getData().size(); ii++) {
apiCount += child.getData().get(ii).getRelations().size();
}
}
leftForm = new SashForm(baseForm, SWT.VERTICAL);
FileChartView fileChartView = new FileChartView(leftForm, SWT.NONE);
addView(fileChartView);
-
FileApiListView fileApiListView = new FileApiListView(leftForm,
SWT.NONE);
addView(fileApiListView);
import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.ui.timeline.DATimelineTabComposite;
-
public class ImageViewer extends Composite {
- class ImageData {
- public GC gc;
- public int imgWidth;
- public int imgHeight;
- public int marginX;
- public int marginY;
- public int maxImageWidth;
- public int maxImageHeight;
- public int minImageWidth;
- public int minImageHeight;
- public double imgWidthRate;
- public double imgHeightRate;
-
- public ImageData(int type) {
- gc = null;
-
- if (type == SnapshotConstants.IMAGE_TYPE_WIDE) {
- imgWidth = SnapshotConstants.DEFAULT_W_IMAGE_WIDTH;
- imgHeight = SnapshotConstants.DEFAULT_W_IMAGE_HEIGHT;
- marginX = SnapshotConstants.DEFAULT_IMAGE_MARGIN_X;
- marginY = SnapshotConstants.DEFAULT_IMAGE_MARGIN_Y;
- maxImageWidth = SnapshotConstants.MAX_W_IMAGE_WIDTH;
- maxImageHeight = SnapshotConstants.MAX_W_IMAGE_HEIGHT;
- minImageWidth = SnapshotConstants.MIN_W_IMAGE_WIDTH;
- minImageHeight = SnapshotConstants.MIN_W_IMAGE_HEIGHT;
- imgWidthRate = SnapshotConstants.W_IMAGE_WIDTH_RATE;
- imgHeightRate = SnapshotConstants.W_IMAGE_HEIGHT_RATE;
- } else {
- imgWidth = SnapshotConstants.DEFAULT_IMAGE_WIDTH;
- imgHeight = SnapshotConstants.DEFAULT_IMAGE_HEIGHT;
- marginX = SnapshotConstants.DEFAULT_IMAGE_MARGIN_X;
- marginY = SnapshotConstants.DEFAULT_IMAGE_MARGIN_Y;
- maxImageWidth = SnapshotConstants.MAX_IMAGE_WIDTH;
- maxImageHeight = SnapshotConstants.MAX_IMAGE_HEIGHT;
- minImageWidth = SnapshotConstants.MIN_IMAGE_WIDTH;
- minImageHeight = SnapshotConstants.MIN_IMAGE_HEIGHT;
- imgWidthRate = SnapshotConstants.IMAGE_WIDTH_RATE;
- imgHeightRate = SnapshotConstants.IMAGE_HEIGHT_RATE;
- }
- }
- }
-
- private final int MOUSE_EXIT = 0;
- private final int MOUSE_LEFT = 1;
- private final int MOUSE_RIGHT = 2;
- private final int MOUSE_DOWN_LEFT = 3;
- private final int MOUSE_DOWN_RIGHT = 4;
-
- private Image image;
- private Canvas canvas;
- private Canvas popup;
- private HashMap<String, ImageSelectionListener> listeners;
- private Shell childShell;
- private Composite parent;
- int childShellWidth = 0;
- int childShellHeight = 0;
- private int state = MOUSE_EXIT;
- private boolean mouseDown = false;
- private int currentImageIndex = 0;
- private boolean leftEnable = false;
- private boolean rightEnable = false;
-
- // +2 means outer offset
- private final int shellMaxWidth = 480 / 2 + 2;
- private final int shellMaxHeight = 800 / 2 + 2;
- private Timer timer = null;
-
- public ImageViewer(Composite parent, int style) {
- super(parent, style);
- this.parent = parent;
- this.setLayout(new FillLayout());
-
- canvas = new Canvas(this, SWT.NONE);
- setImage(ImageResources.NO_IMAGE);
- canvas.addListener(SWT.MouseEnter, mouseListener);
- canvas.addListener(SWT.MouseExit, mouseListener);
- canvas.addListener(SWT.MouseUp, mouseListener);
- canvas.addListener(SWT.MouseMove, mouseListener);
- canvas.addListener(SWT.MouseDown, mouseListener);
- canvas.addPaintListener(new PaintListener() {
- @Override
- public void paintControl(PaintEvent e) {
- if (null == image || null == e.gc) {
- return;
- }
-
- try {
- Rectangle bounds = image.getBounds();
- int iw = bounds.width;
- int ih = bounds.height;
-
- int imageType =
- iw > ih ? SnapshotConstants.IMAGE_TYPE_WIDE
- : SnapshotConstants.IMAGE_TYPE_NORMAL;
- ImageData imageData = new ImageData(imageType);
-
- imageData.gc = e.gc;
- imageData.imgWidth = iw;
- imageData.imgHeight = ih;
- drawThumbnail(imageData);
- imageData.gc.dispose();
- } catch (SWTException se) {
- se.printStackTrace();
- }
- }
- });
-
- }
-
- public void setEnable(boolean enabled) {
- canvas.setEnabled(enabled);
- }
-
- public HashMap<String, ImageSelectionListener> getSelectionListeners() {
- if (null == listeners) {
- listeners = new HashMap<String, ImageSelectionListener>();
- }
- return listeners;
- }
-
- private void setImage(Image input) {
- if (input == null) {
- image = null;
- return;
- }
-
- if (null != image && !image.isDisposed() && !image.equals(ImageResources.NO_IMAGE)) {
- image.dispose();
- }
- image = input;
- }
-
- public void clear() {
- setImage(ImageResources.NO_IMAGE);
- canvas.redraw();
- currentImageIndex = 0;
- }
-
- private void drawThumbnail(ImageData imgData) {
- Rectangle bounds = canvas.getBounds();
- int cw = bounds.width;
- int ch = bounds.height;
-
- imgData.gc.drawImage(image, 0, 0, imgData.imgWidth, imgData.imgHeight, 0, 0, cw, ch);
- if (state == MOUSE_LEFT && leftEnable) {
- imgData.gc.drawImage(ImageResources.SNAPSHOT_LEFT_HOVER, 0, 0);
- } else if (state == MOUSE_RIGHT && rightEnable) {
- Rectangle rect = ImageResources.SNAPSHOT_RIGHT_HOVER.getBounds();
- imgData.gc.drawImage(ImageResources.SNAPSHOT_RIGHT_HOVER, rect.width, 0);
- } else if (state == MOUSE_DOWN_LEFT && leftEnable) {
- imgData.gc.drawImage(ImageResources.SNAPSHOT_LEFT_PUSH, 0, 0);
- } else if (state == MOUSE_DOWN_RIGHT && rightEnable) {
- Rectangle rect = ImageResources.SNAPSHOT_RIGHT_HOVER.getBounds();
- imgData.gc.drawImage(ImageResources.SNAPSHOT_RIGHT_PUSH, rect.width, 0);
- }
- }
-
- public void drawSnapshot(String time) {
- if (null != time && !time.isEmpty()) {
- int index = AnalyzerManager.getImageIndexByTime(time);
- ImageInfo imageInfo = AnalyzerManager.getImageInfoByTime(time);
- if (null == imageInfo) {
- return;
- }
- String path = null;
- if (imageInfo.getSeq().equals("-1") || index < 0) { //$NON-NLS-1$
- path = AnalyzerConstants.DEFAULT_IMAGE_NAME;
- } else {
- path =
- AnalyzerManager.getProject().getSavePath() + File.separator
- + AnalyzerConstants.IMAGE_FOLDER_NAME + File.separator
- + imageInfo.getSeq() + CommonConstants.EXTENSION_PNG_IMAGE;
- }
- Image img = null;
- if (path.equals(AnalyzerConstants.DEFAULT_IMAGE_NAME)) {
- img = ImageResources.NO_IMAGE;
- } else {
- try {
- img = new Image(Display.getDefault(), path);
- } catch (SWTError err) {
- err.printStackTrace();
- img = ImageResources.NO_IMAGE;
- } catch (Exception e) {
- e.printStackTrace();
- img = ImageResources.NO_IMAGE;
- }
- if (img.isDisposed()) {
- System.out.println("before set image : disposed"); //$NON-NLS-1$
- }
- }
- setImage(img);
- currentImageIndex = index;
- canvas.redraw();
- if (childShell != null) {
- popup.redraw();
- }
- }
- }
-
- private Listener mouseListener = new Listener() {
-
- @Override
- public void handleEvent(Event event) {
- if (event.type == SWT.MouseEnter) {
- setButtonCondition();
-
- if (childShell == null) {
- openChildShell();
- }
- } else if (event.type == SWT.MouseExit) {
- if (childShell != null) {
- if (timer != null) {
- timer.cancel();
- timer = null;
- }
- childShell.close();
- childShell = null;
- // ready = false;
- }
- state = MOUSE_EXIT;
- canvas.redraw();
- } else if (event.type == SWT.MouseMove) {
- if (!mouseDown) {
- Rectangle rect = canvas.getBounds();
- int prevState = state;
- if (event.x < rect.x + rect.width / 2) {
- state = MOUSE_LEFT;
- } else if (event.x > rect.x + rect.width / 2) {
- state = MOUSE_RIGHT;
- } else {
- state = MOUSE_EXIT;
- }
- if (prevState != state) {
- canvas.redraw();
- }
- }
- } else if (event.type == SWT.MouseDown) {
- mouseDown = true;
- Rectangle rect = canvas.getBounds();
- int prevState = state;
- if (event.x < rect.x + rect.width / 2) {
- state = MOUSE_DOWN_LEFT;
- } else if (event.x > rect.x + rect.width / 2) {
- state = MOUSE_DOWN_RIGHT;
- } else {
- state = MOUSE_EXIT;
- }
- if (prevState != state) {
- canvas.redraw();
- }
- } else if (event.type == SWT.MouseUp) {
- mouseDown = false;
- Rectangle rect = canvas.getBounds();
- int prevState = state;
- if (event.x < rect.x + rect.width / 2) {
- if (state == MOUSE_DOWN_LEFT && leftEnable) {
- leftArrowAction();
- setButtonCondition();
- }
- state = MOUSE_LEFT;
- } else if (event.x > rect.x + rect.width / 2) {
- if (state == MOUSE_DOWN_RIGHT && rightEnable) {
- rightArrowAction();
- setButtonCondition();
- }
- state = MOUSE_RIGHT;
- } else {
- state = MOUSE_EXIT;
- }
- if (prevState != state) {
- canvas.redraw();
- }
- }
- }
- };
-
- private void setButtonCondition() {
- List<ImageInfo> imageList = AnalyzerManager.getImageList();
- ImageInfo imgInfo = imageList.get(currentImageIndex);
- drawSnapshot(imgInfo.getTime());
- if (imageList.size() < 2) {
- leftEnable = false;
- rightEnable = false;
- } else {
- if (currentImageIndex == 0) {
- leftEnable = false;
- if (imageList.size() > 1) {
- rightEnable = true;
- } else {
- rightEnable = false;
- }
- } else {
- leftEnable = true;
- if (imageList.size() - 1 == currentImageIndex) {
- rightEnable = false;
- } else {
- rightEnable = true;
- }
- }
- }
- }
-
- private void widgetSelected(String timeStr) {
- long time = Long.parseLong(timeStr);
- AnalyzerManager.getCurrentPage().updatePage(new DASelectionData(DATimelineTabComposite.ID,
- time, time, null, null));
- }
-
- private void leftArrowAction() {
- List<ImageInfo> imageList = AnalyzerManager.getImageList();
- ImageInfo imgInfo = imageList.get(--currentImageIndex);
- drawSnapshot(imgInfo.getTime());
- widgetSelected(imgInfo.getTime());
- }
-
- private void rightArrowAction() {
- List<ImageInfo> imageList = AnalyzerManager.getImageList();
- if (imageList.size() <= currentImageIndex + 1) {
- return;
- }
- ImageInfo imgInfo = imageList.get(++currentImageIndex);
- drawSnapshot(imgInfo.getTime());
- widgetSelected(imgInfo.getTime());
- }
-
- private void openChildShell() {
- childShell = new Shell(parent.getShell(), SWT.ON_TOP);
- childShell.setLayout(new FillLayout());
- Point p = canvas.toDisplay(0, 0);
-
- childShellWidth = shellMaxWidth;
- childShellHeight = shellMaxHeight;
-
- childShell.setSize(childShellWidth, childShellHeight);
- childShell.setLocation(p.x - childShellWidth, p.y);
- popup = new Canvas(childShell, SWT.DOUBLE_BUFFERED | SWT.TRANSPARENCY_ALPHA);
-
- popup.addPaintListener(new PaintListener() {
- @Override
- public void paintControl(PaintEvent e) {
- if (null == image || null == e.gc) {
- return;
- }
- // if (ready) {
- try {
- Rectangle bounds = image.getBounds();
- int iw = bounds.width;
- int ih = bounds.height;
- int imageType =
- iw > ih ? SnapshotConstants.IMAGE_TYPE_WIDE
- : SnapshotConstants.IMAGE_TYPE_NORMAL;
- ImageData imageData = new ImageData(imageType);
-
- imageData.gc = e.gc;
- imageData.imgWidth = iw;
- imageData.imgHeight = ih;
-
- Rectangle rects = popup.getBounds();
- int cw = rects.width - 2;
- int ch = rects.height - 2;
-
- e.gc.setForeground(ColorResources.SNAPSHOT_VIEWER_BORDER);
- imageData.gc.drawRectangle(rects.x, rects.y, rects.width - 1, rects.height - 1);
-
- imageData.gc.drawImage(image, 0, 0, imageData.imgWidth, imageData.imgHeight, 1,
- 1, cw, ch);
-
- imageData.gc.dispose();
- } catch (SWTException se) {
- se.printStackTrace();
- }
- }
- });
- childShell.open();
- // if (timer != null) {
- // timer.cancel();
- // timer = null;
- // }
- // timer = new Timer();
- // timer.schedule(new TimerTask() {
- // @Override
- // public void run() {
- // Display.getDefault().syncExec(new Runnable() {
- // @Override
- // public void run() {
- // if (null == childShell
- // || childShellWidth > shellMaxWidth) {
- // if (timer != null) {
- // timer.cancel();
- // timer = null;
- // }
- // ready = true;
- // childShell.redraw();
- // return;
- // }
- // Rectangle rect = canvas.getBounds();
- // int x = (int) ((float) shellMaxWidth / rect.width) * 50;
- // int y = (int) ((float) shellMaxHeight / rect.height) * 50;
- // childShellWidth += x;
- // childShellHeight += y;
- // childShell.setSize(childShellWidth, childShellHeight);
- // Point p = canvas.toDisplay(0, 0);
- // childShell.setLocation(p.x - childShellWidth, p.y);
- // childShell.redraw();
- // }
- // });
- // }
- // }, 10, 5);
- }
+ class ImageData {
+ public GC gc;
+ public int imgWidth;
+ public int imgHeight;
+ public int marginX;
+ public int marginY;
+ public int maxImageWidth;
+ public int maxImageHeight;
+ public int minImageWidth;
+ public int minImageHeight;
+ public double imgWidthRate;
+ public double imgHeightRate;
+
+ public ImageData(int type) {
+ gc = null;
+
+ if (type == SnapshotConstants.IMAGE_TYPE_WIDE) {
+ imgWidth = SnapshotConstants.DEFAULT_W_IMAGE_WIDTH;
+ imgHeight = SnapshotConstants.DEFAULT_W_IMAGE_HEIGHT;
+ marginX = SnapshotConstants.DEFAULT_IMAGE_MARGIN_X;
+ marginY = SnapshotConstants.DEFAULT_IMAGE_MARGIN_Y;
+ maxImageWidth = SnapshotConstants.MAX_W_IMAGE_WIDTH;
+ maxImageHeight = SnapshotConstants.MAX_W_IMAGE_HEIGHT;
+ minImageWidth = SnapshotConstants.MIN_W_IMAGE_WIDTH;
+ minImageHeight = SnapshotConstants.MIN_W_IMAGE_HEIGHT;
+ imgWidthRate = SnapshotConstants.W_IMAGE_WIDTH_RATE;
+ imgHeightRate = SnapshotConstants.W_IMAGE_HEIGHT_RATE;
+ } else {
+ imgWidth = SnapshotConstants.DEFAULT_IMAGE_WIDTH;
+ imgHeight = SnapshotConstants.DEFAULT_IMAGE_HEIGHT;
+ marginX = SnapshotConstants.DEFAULT_IMAGE_MARGIN_X;
+ marginY = SnapshotConstants.DEFAULT_IMAGE_MARGIN_Y;
+ maxImageWidth = SnapshotConstants.MAX_IMAGE_WIDTH;
+ maxImageHeight = SnapshotConstants.MAX_IMAGE_HEIGHT;
+ minImageWidth = SnapshotConstants.MIN_IMAGE_WIDTH;
+ minImageHeight = SnapshotConstants.MIN_IMAGE_HEIGHT;
+ imgWidthRate = SnapshotConstants.IMAGE_WIDTH_RATE;
+ imgHeightRate = SnapshotConstants.IMAGE_HEIGHT_RATE;
+ }
+ }
+ }
+
+ private final int MOUSE_EXIT = 0;
+ private final int MOUSE_LEFT = 1;
+ private final int MOUSE_RIGHT = 2;
+ private final int MOUSE_DOWN_LEFT = 3;
+ private final int MOUSE_DOWN_RIGHT = 4;
+
+ private Image image;
+ private Canvas canvas;
+ private Canvas popup;
+ private HashMap<String, ImageSelectionListener> listeners;
+ private Shell childShell;
+ private Composite parent;
+ int childShellWidth = 0;
+ int childShellHeight = 0;
+ private int state = MOUSE_EXIT;
+ private boolean mouseDown = false;
+ private int currentImageIndex = 0;
+ private boolean leftEnable = false;
+ private boolean rightEnable = false;
+
+ // +2 means outer offset
+ private final int shellMaxWidth = 480 / 2 + 2;
+ private final int shellMaxHeight = 800 / 2 + 2;
+ private Timer timer = null;
+
+ public ImageViewer(Composite parent, int style) {
+ super(parent, style);
+ this.parent = parent;
+ this.setLayout(new FillLayout());
+
+ canvas = new Canvas(this, SWT.NONE);
+ setImage(ImageResources.NO_IMAGE);
+ canvas.addListener(SWT.MouseEnter, mouseListener);
+ canvas.addListener(SWT.MouseExit, mouseListener);
+ canvas.addListener(SWT.MouseUp, mouseListener);
+ canvas.addListener(SWT.MouseMove, mouseListener);
+ canvas.addListener(SWT.MouseDown, mouseListener);
+ canvas.addPaintListener(new PaintListener() {
+ @Override
+ public void paintControl(PaintEvent e) {
+ if (null == image || null == e.gc) {
+ return;
+ }
+
+ try {
+ Rectangle bounds = image.getBounds();
+ int iw = bounds.width;
+ int ih = bounds.height;
+
+ int imageType = iw > ih ? SnapshotConstants.IMAGE_TYPE_WIDE
+ : SnapshotConstants.IMAGE_TYPE_NORMAL;
+ ImageData imageData = new ImageData(imageType);
+
+ imageData.gc = e.gc;
+ imageData.imgWidth = iw;
+ imageData.imgHeight = ih;
+ drawThumbnail(imageData);
+ imageData.gc.dispose();
+ } catch (SWTException se) {
+ se.printStackTrace();
+ }
+ }
+ });
+
+ }
+
+ public void setEnable(boolean enabled) {
+ canvas.setEnabled(enabled);
+ }
+
+ public HashMap<String, ImageSelectionListener> getSelectionListeners() {
+ if (null == listeners) {
+ listeners = new HashMap<String, ImageSelectionListener>();
+ }
+ return listeners;
+ }
+
+ private void setImage(Image input) {
+ if (input == null) {
+ image = null;
+ return;
+ }
+
+ if (null != image && !image.isDisposed()
+ && !image.equals(ImageResources.NO_IMAGE)) {
+ image.dispose();
+ }
+ image = input;
+ }
+
+ public void clear() {
+ setImage(ImageResources.NO_IMAGE);
+ canvas.redraw();
+ currentImageIndex = 0;
+ }
+
+ private void drawThumbnail(ImageData imgData) {
+ Rectangle bounds = canvas.getBounds();
+ int cw = bounds.width;
+ int ch = bounds.height;
+
+ imgData.gc.drawImage(image, 0, 0, imgData.imgWidth, imgData.imgHeight,
+ 0, 0, cw, ch);
+ if (state == MOUSE_LEFT && leftEnable) {
+ imgData.gc.drawImage(ImageResources.SNAPSHOT_LEFT_HOVER, 0, 0);
+ } else if (state == MOUSE_RIGHT && rightEnable) {
+ Rectangle rect = ImageResources.SNAPSHOT_RIGHT_HOVER.getBounds();
+ imgData.gc.drawImage(ImageResources.SNAPSHOT_RIGHT_HOVER,
+ rect.width, 0);
+ } else if (state == MOUSE_DOWN_LEFT && leftEnable) {
+ imgData.gc.drawImage(ImageResources.SNAPSHOT_LEFT_PUSH, 0, 0);
+ } else if (state == MOUSE_DOWN_RIGHT && rightEnable) {
+ Rectangle rect = ImageResources.SNAPSHOT_RIGHT_HOVER.getBounds();
+ imgData.gc.drawImage(ImageResources.SNAPSHOT_RIGHT_PUSH,
+ rect.width, 0);
+ }
+ }
+
+ public void drawSnapshot(String time) {
+ if (null != time && !time.isEmpty()) {
+ int index = AnalyzerManager.getImageIndexByTime(time);
+ ImageInfo imageInfo = AnalyzerManager.getImageInfoByTime(time);
+ if (null == imageInfo) {
+ return;
+ }
+ String path = null;
+ if (imageInfo.getSeq().equals("-1") || index < 0) { //$NON-NLS-1$
+ path = AnalyzerConstants.DEFAULT_IMAGE_NAME;
+ } else {
+ path = AnalyzerManager.getProject().getSavePath()
+ + File.separator + AnalyzerConstants.IMAGE_FOLDER_NAME
+ + File.separator + imageInfo.getSeq()
+ + CommonConstants.EXTENSION_PNG_IMAGE;
+ }
+ Image img = null;
+ if (path.equals(AnalyzerConstants.DEFAULT_IMAGE_NAME)) {
+ img = ImageResources.NO_IMAGE;
+ } else {
+ try {
+ img = new Image(Display.getDefault(), path);
+ } catch (SWTError err) {
+ err.printStackTrace();
+ img = ImageResources.NO_IMAGE;
+ } catch (Exception e) {
+ e.printStackTrace();
+ img = ImageResources.NO_IMAGE;
+ }
+ if (img.isDisposed()) {
+ System.out.println("before set image : disposed"); //$NON-NLS-1$
+ }
+ }
+ setImage(img);
+ currentImageIndex = index;
+ canvas.redraw();
+ if (childShell != null) {
+ popup.redraw();
+ }
+ }
+ }
+
+ private Listener mouseListener = new Listener() {
+
+ @Override
+ public void handleEvent(Event event) {
+ if (event.type == SWT.MouseEnter) {
+ setButtonCondition();
+
+ if (childShell == null) {
+ openChildShell();
+ }
+ } else if (event.type == SWT.MouseExit) {
+ if (childShell != null) {
+ if (timer != null) {
+ timer.cancel();
+ timer = null;
+ }
+ childShell.close();
+ childShell = null;
+ // ready = false;
+ }
+ state = MOUSE_EXIT;
+ canvas.redraw();
+ } else if (event.type == SWT.MouseMove) {
+ if (!mouseDown) {
+ Rectangle rect = canvas.getBounds();
+ int prevState = state;
+ if (event.x < rect.x + rect.width / 2) {
+ state = MOUSE_LEFT;
+ } else if (event.x > rect.x + rect.width / 2) {
+ state = MOUSE_RIGHT;
+ } else {
+ state = MOUSE_EXIT;
+ }
+ if (prevState != state) {
+ canvas.redraw();
+ }
+ }
+ } else if (event.type == SWT.MouseDown) {
+ mouseDown = true;
+ Rectangle rect = canvas.getBounds();
+ int prevState = state;
+ if (event.x < rect.x + rect.width / 2) {
+ state = MOUSE_DOWN_LEFT;
+ } else if (event.x > rect.x + rect.width / 2) {
+ state = MOUSE_DOWN_RIGHT;
+ } else {
+ state = MOUSE_EXIT;
+ }
+ if (prevState != state) {
+ canvas.redraw();
+ }
+ } else if (event.type == SWT.MouseUp) {
+ mouseDown = false;
+ Rectangle rect = canvas.getBounds();
+ int prevState = state;
+ if (event.x < rect.x + rect.width / 2) {
+ if (state == MOUSE_DOWN_LEFT && leftEnable) {
+ leftArrowAction();
+ setButtonCondition();
+ }
+ state = MOUSE_LEFT;
+ } else if (event.x > rect.x + rect.width / 2) {
+ if (state == MOUSE_DOWN_RIGHT && rightEnable) {
+ rightArrowAction();
+ setButtonCondition();
+ }
+ state = MOUSE_RIGHT;
+ } else {
+ state = MOUSE_EXIT;
+ }
+ if (prevState != state) {
+ canvas.redraw();
+ }
+ }
+ }
+ };
+
+ private void setButtonCondition() {
+ List<ImageInfo> imageList = AnalyzerManager.getImageList();
+ ImageInfo imgInfo = imageList.get(currentImageIndex);
+ drawSnapshot(imgInfo.getTime());
+ if (imageList.size() < 2) {
+ leftEnable = false;
+ rightEnable = false;
+ } else {
+ if (currentImageIndex == 0) {
+ leftEnable = false;
+ if (imageList.size() > 1) {
+ rightEnable = true;
+ } else {
+ rightEnable = false;
+ }
+ } else {
+ leftEnable = true;
+ if (imageList.size() - 1 == currentImageIndex) {
+ rightEnable = false;
+ } else {
+ rightEnable = true;
+ }
+ }
+ }
+ }
+
+ private void widgetSelected(String timeStr) {
+ long time = Long.parseLong(timeStr);
+ AnalyzerManager.getCurrentPage().updatePage(
+ new DASelectionData(DATimelineTabComposite.ID, time, time,
+ null, null));
+ }
+
+ private void leftArrowAction() {
+ List<ImageInfo> imageList = AnalyzerManager.getImageList();
+ ImageInfo imgInfo = imageList.get(--currentImageIndex);
+ drawSnapshot(imgInfo.getTime());
+ widgetSelected(imgInfo.getTime());
+ }
+
+ private void rightArrowAction() {
+ List<ImageInfo> imageList = AnalyzerManager.getImageList();
+ if (imageList.size() <= currentImageIndex + 1) {
+ return;
+ }
+ ImageInfo imgInfo = imageList.get(++currentImageIndex);
+ drawSnapshot(imgInfo.getTime());
+ widgetSelected(imgInfo.getTime());
+ }
+
+ private void openChildShell() {
+ childShell = new Shell(parent.getShell(), SWT.ON_TOP);
+ childShell.setLayout(new FillLayout());
+ Point p = canvas.toDisplay(0, 0);
+
+ childShellWidth = shellMaxWidth;
+ childShellHeight = shellMaxHeight;
+
+ childShell.setSize(childShellWidth, childShellHeight);
+ childShell.setLocation(p.x - childShellWidth, p.y);
+ popup = new Canvas(childShell, SWT.DOUBLE_BUFFERED
+ | SWT.TRANSPARENCY_ALPHA);
+
+ popup.addPaintListener(new PaintListener() {
+ @Override
+ public void paintControl(PaintEvent e) {
+ if (null == image || null == e.gc) {
+ return;
+ }
+ // if (ready) {
+ try {
+ Rectangle bounds = image.getBounds();
+ int iw = bounds.width;
+ int ih = bounds.height;
+ int imageType = iw > ih ? SnapshotConstants.IMAGE_TYPE_WIDE
+ : SnapshotConstants.IMAGE_TYPE_NORMAL;
+ ImageData imageData = new ImageData(imageType);
+
+ imageData.gc = e.gc;
+ imageData.imgWidth = iw;
+ imageData.imgHeight = ih;
+
+ Rectangle rects = popup.getBounds();
+ int cw = rects.width - 2;
+ int ch = rects.height - 2;
+
+ e.gc.setForeground(ColorResources.BLACK);
+ imageData.gc.drawRectangle(rects.x, rects.y,
+ rects.width - 1, rects.height - 1);
+
+ imageData.gc.drawImage(image, 0, 0, imageData.imgWidth,
+ imageData.imgHeight, 1, 1, cw, ch);
+
+ imageData.gc.dispose();
+ } catch (SWTException se) {
+ se.printStackTrace();
+ }
+ }
+ });
+ childShell.open();
+ // if (timer != null) {
+ // timer.cancel();
+ // timer = null;
+ // }
+ // timer = new Timer();
+ // timer.schedule(new TimerTask() {
+ // @Override
+ // public void run() {
+ // Display.getDefault().syncExec(new Runnable() {
+ // @Override
+ // public void run() {
+ // if (null == childShell
+ // || childShellWidth > shellMaxWidth) {
+ // if (timer != null) {
+ // timer.cancel();
+ // timer = null;
+ // }
+ // boolean ready = true;
+ // childShell.redraw();
+ // return;
+ // }
+ // Rectangle rect = canvas.getBounds();
+ // int x = (int) ((float) shellMaxWidth / rect.width) * 50;
+ // int y = (int) ((float) shellMaxHeight / rect.height) * 50;
+ // childShellWidth += x;
+ // childShellHeight += y;
+ // childShell.setSize(childShellWidth, childShellHeight);
+ // Point p = canvas.toDisplay(0, 0);
+ // childShell.setLocation(p.x - childShellWidth, p.y);
+ // childShell.redraw();
+ // }
+ // });
+ // }
+ // }, 10, 5);
+ }
}
data.height = 230;
snapshot.setLayoutData(data);
// FIXME : not supported
- snapshot.setEnable(false);
+ snapshot.setEnable(true);
// icon area
iconComp = new Composite(innerComp, SWT.NONE);
public class FailedApiListView extends DAView {
public static final String ID = FailedApiListView.class.getName();
private DATableComposite tableComp = null;
+
+ int[] innerMaxWeight = { 100, 0, 0 };
+ int[] outerMaxWeight = { 100, 0 };
+
private String[] columnNames = { SummaryLabels.FAILED_API_LIST_VIEW_INDEX,
SummaryLabels.FAILED_API_LIST_VIEW_TIME,
SummaryLabels.FAILED_API_LIST_VIEW_NAME,
AnalyzerConstants.SORT_TYPE_STRING,
AnalyzerConstants.SORT_TYPE_STRING,
AnalyzerConstants.SORT_TYPE_STRING,
- AnalyzerConstants.SORT_TYPE_GRID,
- AnalyzerConstants.SORT_TYPE_GRID };
+ AnalyzerConstants.SORT_TYPE_GRID, AnalyzerConstants.SORT_TYPE_GRID };
int[] sourceColumns = { LogCenterConstants.SEQUENCE_NUMBER_INDEX,
LogCenterConstants.TIME_INDEX, LogCenterConstants.APINAME_INDEX,
LogCenterConstants.INPUTPARM_INDEX,
ViewContainer viewContainer = new ViewContainer(this, true);
viewContainer
.setTitleText(SummaryLabels.FAILED_API_LIST_VIEW_FAILED_API_LIST);
-
+ setMaxWeight(innerMaxWeight, outerMaxWeight);
Composite contents = viewContainer.getContentArea();
contents.setBackground(ColorResources.WINDOW_BG_COLOR);
contents.setLayout(new FillLayout());
public class LeakView extends DAView {
public static final String ID = LeakView.class.getName();
+
+ int[] innerMaxWeight = { 0, 100, 0 };
+ int[] outerMaxWeight = { 100, 0 };
+
private String[] columnNames = { SummaryLabels.LEAK_VIEW_NAME,
SummaryLabels.LEAK_VIEW_INDEX, SummaryLabels.LEAK_VIEW_TYPE,
SummaryLabels.LEAK_VIEW_TIME,
ViewContainer viewContainer = new ViewContainer(this, true);
viewContainer.setTitleText(SummaryLabels.LEAK_VIEW_LEAK_VIEW);
+ setMaxWeight(innerMaxWeight, outerMaxWeight);
Composite contents = viewContainer.getContentArea();
contents.setBackground(ColorResources.WINDOW_BG_COLOR);
public static final String ID = FunctionUsageProfilingView.class.getName();
private ProfilingTable treeComp = null;
+ int[] innerMaxWeight = { 100, 0 };
+ int[] outerMaxWeight = { 0, 100 };
+
private String[] columnNames = {
SummaryLabels.FUNCTION_USER_PROFILING_VIEW_NAME,
SummaryLabels.FUNCTION_USER_PROFILING_VIEW_EXCLUSIVE_CPU_TIME,
ViewContainer viewContainer = new ViewContainer(this, true);
viewContainer
.setTitleText(SummaryLabels.FUNCTION_USER_PROFILING_VIEW_TITLE);
-
+ setMaxWeight(innerMaxWeight, outerMaxWeight);
Composite contents = viewContainer.getContentArea();
contents.setBackground(ColorResources.WINDOW_BG_COLOR);
contents.setLayout(new FillLayout());
package org.tizen.dynamicanalyzer.ui.summary.warning;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
public static final String ID = WarningListView.class.getName();
+ int[] innerMaxWeight = { 0, 100 };
+ int[] outerMaxWeight = { 0, 100 };
+
private DATableComposite tableComp = null;
- private String[] columnNames = { SummaryLabels.WARNING_LIST_VIEW_INDEX, SummaryLabels.WARNING_LIST_VIEW_CATEGORY, SummaryLabels.WARNING_LIST_VIEW_WARNING_MESSAGE };
+ private String[] columnNames = { SummaryLabels.WARNING_LIST_VIEW_INDEX,
+ SummaryLabels.WARNING_LIST_VIEW_CATEGORY,
+ SummaryLabels.WARNING_LIST_VIEW_WARNING_MESSAGE };
private int[] columnSizes = { 25, 0, 200 };
int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NUM,
- AnalyzerConstants.SORT_TYPE_GRID,
- AnalyzerConstants.SORT_TYPE_GRID };
+ AnalyzerConstants.SORT_TYPE_GRID, AnalyzerConstants.SORT_TYPE_GRID };
int[] sourceColumns = { LogCenterConstants.SEQUENCE_NUMBER_INDEX,
- LogCenterConstants.ID_INDEX, LogCenterConstants.APINAME_INDEX};
+ LogCenterConstants.ID_INDEX, LogCenterConstants.APINAME_INDEX };
public WarningListView(Composite parent, int style) {
super(parent, style);
this.setLayout(new FillLayout());
ViewContainer viewContainer = new ViewContainer(this, true);
- viewContainer.setTitleText(SummaryLabels.WARNING_LIST_VIEW_WARNING_LIST);
+ viewContainer
+ .setTitleText(SummaryLabels.WARNING_LIST_VIEW_WARNING_LIST);
+ setMaxWeight(innerMaxWeight, outerMaxWeight);
Composite contents = viewContainer.getContentArea();
contents.setBackground(ColorResources.VIEW_BG_COLOR);
contents.setLayout(new FillLayout());
- tableComp = new WarningTable(contents, SWT.NONE, SWT.SINGLE | SWT.BORDER
- | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
+ tableComp = new WarningTable(contents, SWT.NONE, SWT.SINGLE
+ | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
tableComp.setTableName("Warning List");
tableComp.setComparator(new TableComparator());
tableComp.setSortTypes(sortTypes);
tableComp.setColumnSize(columnSizes);
}
-
@Override
public void updateView() {
tableComp.updateTable();
public void otherViewSelectionOccured() {
tableComp.deselectAll();
}
+
+ @Override
+ public void setMaxSize(boolean maximized) {
+
+ if (null == innerMaxWeight || null == outerMaxWeight) {
+ return;
+ }
+
+ Composite parent = getParent();
+ if (parent instanceof SashForm) {
+ parent = parent.getParent();
+ if (!(parent instanceof SashForm)) {
+ return;
+ }
+ }
+
+ Composite pParent = parent.getParent();
+ if (!(pParent instanceof SashForm)) {
+ return;
+ }
+
+ SashForm innerForm = (SashForm) parent;
+ SashForm outerForm = (SashForm) pParent;
+
+ if (maximized) {
+ oldInnerLayout = innerForm.getWeights();
+ oldOuterLayout = outerForm.getWeights();
+ innerForm.setWeights(innerMaxWeight);
+ outerForm.setWeights(outerMaxWeight);
+ } else {
+ innerForm.setWeights(oldInnerLayout);
+ outerForm.setWeights(oldOuterLayout);
+ }
+ }
}
public static final String ID = ThreadAPIListView.class.getName();
private String lastSelectionKey = null;
+ int[] innerMaxWeight = { 0, 100 };
+ int[] outerMaxWeight = { 100, 0 };
private String[] columnNames = {
ThreadPageLabels.THREAD_API_LIST_VIEW_INDEX,
ViewContainer viewContainer = new ViewContainer(this, true);
viewContainer.setTitleText(ThreadPageLabels.THREAD_API_LIST_VEIW_TITLE);
-
+ setMaxWeight(innerMaxWeight, outerMaxWeight);
+
Composite contents = viewContainer.getContentArea();
contents.setBackground(ColorResources.WINDOW_BG_COLOR);
contents.setLayout(new FillLayout());
private long totalUseTime = 0;
private int apiCount = 0;
private int failedApiCount = 0;
+
+ int[] innerMaxWeight = { 0, 100 };
+ int[] outerMaxWeight = { 0, 100 };
private void init() {
fileName = AnalyzerLabels.EMPTY_STRING;
ViewContainer viewContainer = new ViewContainer(this, true);
viewContainer.setTitleText(ThreadPageLabels.THREAD_DETAILS_TITLE);
-
+ setMaxWeight(innerMaxWeight, outerMaxWeight);
+
Composite contents = viewContainer.getContentArea();
contents.setBackground(ColorResources.VIEW_BG_COLOR);
contents.setLayout(new FillLayout());
AnalyzerConstants.SORT_TYPE_STRING };
int[] sourceColumns = { LogCenterConstants.TIME_INDEX,
LogCenterConstants.APINAME_INDEX };
+ int[] innerMaxWeight = {0, 100};
+ int[] outerMaxWeight = {0, 100};
public CallTraceView(Composite parent, int style) {
super(parent, style);
contents.setLayout(new FillLayout());
tableComp = new CallTraceTable(contents, SWT.NONE, SWT.MULTI
| SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
- tableComp.setTableName("Calltrace"); // test
+ tableComp.setTableName("Calltrace"); // test
tableComp.setComparator(new TableComparator());
tableComp.setSortTypes(sortTypes);
tableComp.setSourceColumns(sourceColumns);
tableComp.setColumns(columnNames);
tableComp.setColumnSize(columnSizes);
tableComp.setColumnVisibility(columnVisibility);
+
+ setMaxWeight(innerMaxWeight, outerMaxWeight);
}
@Override
}
}
}
+
+
}
import org.tizen.dynamicanalyzer.common.DesignConstants;
import org.tizen.dynamicanalyzer.communicator.DACommunicator;
import org.tizen.dynamicanalyzer.handlers.ReplayTraceHandler;
+import org.tizen.dynamicanalyzer.logparser.MessageProcess;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.project.AppDesktopInfo;
import org.tizen.dynamicanalyzer.project.Project;
private static final int TAB_FILE = 2;
private static final int TAB_THREAD = 3; // FIXME
private static final int TAB_UI = 4; // FIXME
-
private Cursor cursor;
public static boolean bThreadPageWork = false; // FIXME
public static boolean bUIPageWork = false; // FIXME
-
+
public static final int TOOLBAR_STATE_RECORDING = 0;
public static final int TOOLBAR_STATE_READY = 1;
createToolbar(toolbarComposite);
- // Creates coolbar bottom line.
-// Composite lineComposite = new Composite(baseComposite, SWT.NONE);
-// lineComposite.setLayout(new FormLayout());
-// lineComposite.setBackground(ColorResources.BLACK);
-
-// createPageBar(lineComposite);
- // Sets layout data.
Control page = configurer.createPageComposite(baseComposite);
FormData data = new FormData();
data.height = 38;
toolbarComposite.setLayoutData(data);
-// data = new FormData();
-// data.top = new FormAttachment(toolbarComposite, 0, SWT.BOTTOM);
-// data.left = new FormAttachment(0, 0);
-// data.right = new FormAttachment(100, 0);
-// lineComposite.setLayoutData(data);
-
data = new FormData();
data.top = new FormAttachment(toolbarComposite, 0, SWT.BOTTOM);
data.left = new FormAttachment(0, 0);
.addClickListener(new DACustomButtonClickEventListener() {
@Override
public void handleClickEvent(DACustomButton button) {
-
+
+ String[] testLogs = {
+ "5|7`,1002`,snapshot1`,5997316521`,5383`,5383`,testLog, 1, 0`,17`,0`,0`,1`",
+ "5|7`,1003`,snapshot2`,5997316521`,5383`,5383`,testLog, 1, 0`,17`,0`,0`,1`"};
+
+ for (int i = 0; i < testLogs.length; i++) {
+ MessageProcess.getInstance().processMessage(
+ testLogs[i]);
+ }
+
// TODO : use for test code...
// System.out.println(SymbolNameDemangler
// .nameDemangle("_ZN3Osp4Base7Runtime14IEventListenerC1Ev"));
// } else {
// AnalyzerManager.setTheme(DAThemeWhite.getInstance());
// }
-// BaseView view = (BaseView) AnalyzerUtil.getView(BaseView.ID);
-// FilePage filePage = new FilePage(view.getMainTab().getContentComposite(),
-// SWT.NONE);
-// view.getMainTab().addView(filePage, AnalyzerLabels.COOLBAR_AREA_FILE);
+ // BaseView view = (BaseView)
+ // AnalyzerUtil.getView(BaseView.ID);
+ // FilePage filePage = new
+ // FilePage(view.getMainTab().getContentComposite(),
+ // SWT.NONE);
+ // view.getMainTab().addView(filePage,
+ // AnalyzerLabels.COOLBAR_AREA_FILE);
}
});
}
addToolbarListeners();
}
-
// tab, set selection
public void setSelectionTab(int nTab) {
public DACustomButton getThreadButton() {
return pageTab.get(TAB_THREAD);
}
-
+
public DACustomButton getUIButton() {
return pageTab.get(TAB_UI);
}
}
});
}
-
+
public void setSourceViewState(final boolean enabled) {
Display.getDefault().syncExec(new Runnable() {
@Override
public static final String ID = FileApiListView.class.getName();
+ int[] innerMaxWeight = { 100, 0, 0 };
+ int[] outerMaxWeight = { 100, 0 };
+
private String[] columnNames = { UserInterfacePageLabels.USERINTERFACE_CONTROL_LIST_VIEW_INDEX,
UserInterfacePageLabels.USERINTERFACE_CONTROL_LIST_VIEW_TIME,
UserInterfacePageLabels.USERINTERFACE_CONTROL_LIST_VIEW_COLUMN_2,
ViewContainer viewContainer = new ViewContainer(this, true);
viewContainer.setTitleText(UserInterfacePageLabels.USERINTERFACE_CONTROL_LIST_VIEW_NAME);
-
+ setMaxWeight(innerMaxWeight, outerMaxWeight);
+
Composite contents = viewContainer.getContentArea();
contents.setBackground(ColorResources.WINDOW_BG_COLOR);
contents.setLayout(new FillLayout());
public class UserInterfaceFormBasedLeakListView extends DAView {
public static final String ID = FileApiListView.class.getName();
-
+ int[] innerMaxWeight = { 0, 100 };
+ int[] outerMaxWeight = { 0, 100 };
+
private String[] columnNames = { UserInterfacePageLabels.USERINTERFACE_FORMBASEDLEAK_LIST_VIEW_COLUMN_0,
UserInterfacePageLabels.USERINTERFACE_FORMBASEDLEAK_LIST_VIEW_COLUMN_1,
UserInterfacePageLabels.USERINTERFACE_FORMBASEDLEAK_LIST_VIEW_COLUMN_2,
ViewContainer viewContainer = new ViewContainer(this, true);
viewContainer.setTitleText(UserInterfacePageLabels.USERINTERFACE_FORMBASEDLEAK_LIST_VIEW_NAME);
-
+ setMaxWeight(innerMaxWeight, outerMaxWeight);
+
Composite contents = viewContainer.getContentArea();
contents.setBackground(ColorResources.WINDOW_BG_COLOR);
contents.setLayout(new FillLayout());
package org.tizen.dynamicanalyzer.ui.userinterface;
-
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
public class UserInterfaceFunctionProfilingView extends DAView {
public static final String ID = FileApiListView.class.getName();
+ int[] innerMaxWeight = { 100, 0 };
+ int[] outerMaxWeight = { 0, 100 };
- private String[] columnNames = { UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_0,
+ private String[] columnNames = {
+ UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_0,
UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_1,
UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_2,
UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_3,
UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_4,
- UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_5
- };
+ UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_COLUMN_5 };
private int[] columnSizes = { 200, 0, 0, 0, 0, 0 };
UserInterfaceFunctionProfilingTable treeComp = null;
private boolean[] columnVisibility = { true, true, true, true, true, true };
int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NONE,
- AnalyzerConstants.SORT_TYPE_NUM,
AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM,
- AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM };
+ AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM,
+ AnalyzerConstants.SORT_TYPE_NUM };
int[] sourceColumns = { ProfilingData.NAME_INDEX,
ProfilingData.EXCOUNT_INDEX, ProfilingData.EXCOUNT_INDEX,
ProfilingData.INCOUNT_INDEX, ProfilingData.INCOUNT_INDEX,
- ProfilingData.CALLCOUNT_INDEX};
-
+ ProfilingData.CALLCOUNT_INDEX };
+
public UserInterfaceFunctionProfilingView(Composite parent, int style) {
super(parent, style);
this.setLayout(new FillLayout());
ViewContainer viewContainer = new ViewContainer(this, true);
- viewContainer.setTitleText(UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_NAME);
+ viewContainer
+ .setTitleText(UserInterfacePageLabels.USERINTERFACE_UIFUNCTIONPROFILING_LIST_VIEW_NAME);
+ setMaxWeight(innerMaxWeight, outerMaxWeight);
Composite contents = viewContainer.getContentArea();
contents.setBackground(ColorResources.WINDOW_BG_COLOR);
contents.setLayout(new FillLayout());
- treeComp = new UserInterfaceFunctionProfilingTable(contents, SWT.NONE, SWT.SINGLE
- | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
+ treeComp = new UserInterfaceFunctionProfilingTable(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);
public static final String ID = FileApiListView.class.getName();
- private String[] columnNames = { UserInterfacePageLabels.USERINTERFACE_SCENETRANSFORM_LIST_VIEW_INDEX,
+ int[] innerMaxWeight = { 0, 100, 0 };
+ int[] outerMaxWeight = { 100, 0 };
+
+ private String[] columnNames = {
+ UserInterfacePageLabels.USERINTERFACE_SCENETRANSFORM_LIST_VIEW_INDEX,
UserInterfacePageLabels.USERINTERFACE_SCENETRANSFORM_LIST_VIEW_TIME,
UserInterfacePageLabels.USERINTERFACE_SCENETRANSFORM_LIST_VIEW_COLUMN_2,
UserInterfacePageLabels.USERINTERFACE_SCENETRANSFORM_LIST_VIEW_COLUMN_3,
this.setLayout(new FillLayout());
ViewContainer viewContainer = new ViewContainer(this, true);
- viewContainer.setTitleText(UserInterfacePageLabels.USERINTERFACE_SCENETRANSFORM_LIST_VIEW_NAME);
+ viewContainer
+ .setTitleText(UserInterfacePageLabels.USERINTERFACE_SCENETRANSFORM_LIST_VIEW_NAME);
+ setMaxWeight(innerMaxWeight, outerMaxWeight);
Composite contents = viewContainer.getContentArea();
contents.setBackground(ColorResources.WINDOW_BG_COLOR);
public void updateView(DASelectionData data) {
tableComp.updateTable();
}
+
@Override
public void updateView() {
tableComp.updateTable();
-
+
}
+
@Override
public Control getControl() {
return tableComp;
import org.eclipse.swt.widgets.Listener;\r
import org.tizen.dynamicanalyzer.common.CommonConstants;\r
import org.tizen.dynamicanalyzer.common.DesignConstants;\r
+import org.tizen.dynamicanalyzer.model.DAView;\r
import org.tizen.dynamicanalyzer.resources.ColorResources;\r
import org.tizen.dynamicanalyzer.resources.FontResources;\r
\r
private String title = CommonConstants.EMPTY;\r
private Color titleFontColor = ColorResources.VIEW_TITLE_FONT_COLOR;\r
private static final int OFFSET = 5;\r
+ private Composite parent = null;\r
+ private boolean isMaximized = false;\r
\r
public ViewContainer(Composite parent, boolean titleVisibility) {\r
final Composite composite = new Composite(parent, SWT.NONE);\r
composite.setLayout(new FormLayout());\r
-\r
+ this.parent = parent;\r
// Creates title bar.\r
titleBar = new Canvas(composite, SWT.DOUBLE_BUFFERED);\r
titleBar.addPaintListener(titlePaintListener);\r
\r
Rectangle bounds = titleBar.getBounds();\r
int width = bounds.width;\r
- int height = bounds.height;\r
+ int height = bounds.height - 2;\r
\r
// Draws background.\r
- gc.setForeground(ColorResources.BUTTON_NORMAL_COLOR_START);\r
- gc.setBackground(ColorResources.BUTTON_NORMAL_COLOR_END);\r
+ gc.setForeground(ColorResources.TITLEBAR_START_COLOR);\r
+ gc.setBackground(ColorResources.TITLEBAR_END_COLOR);\r
gc.fillGradientRectangle(bounds.x, bounds.y, width, height, true);\r
+ gc.setForeground(ColorResources.TITLEBAR_BOTTOM_STROKE_1);\r
+ gc.drawLine(bounds.x, bounds.y + height + 1, bounds.x + width,\r
+ bounds.y + height + 1);\r
+ gc.setForeground(ColorResources.TITLEBAR_BOTTOM_STROKE_2);\r
+ gc.drawLine(bounds.x, bounds.y + height + 2, bounds.x + width,\r
+ bounds.y + height + 2);\r
\r
// Draws text.\r
Point textSize = gc.textExtent(title, SWT.DRAW_MNEMONIC);\r
\r
@Override\r
public void handleEvent(Event event) {\r
-\r
+ if (parent instanceof DAView) {\r
+ isMaximized = !isMaximized;\r
+ ((DAView) parent).setMaxSize(isMaximized);\r
+ }\r
}\r
};\r
+\r
}\r